stencil.js 5.6 MB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226262272622826229262302623126232262332623426235262362623726238262392624026241262422624326244262452624626247262482624926250262512625226253262542625526256262572625826259262602626126262262632626426265262662626726268262692627026271262722627326274262752627626277262782627926280262812628226283262842628526286262872628826289262902629126292262932629426295262962629726298262992630026301263022630326304263052630626307263082630926310263112631226313263142631526316263172631826319263202632126322263232632426325263262632726328263292633026331263322633326334263352633626337263382633926340263412634226343263442634526346263472634826349263502635126352263532635426355263562635726358263592636026361263622636326364263652636626367263682636926370263712637226373263742637526376263772637826379263802638126382263832638426385263862638726388263892639026391263922639326394263952639626397263982639926400264012640226403264042640526406264072640826409264102641126412264132641426415264162641726418264192642026421264222642326424264252642626427264282642926430264312643226433264342643526436264372643826439264402644126442264432644426445264462644726448264492645026451264522645326454264552645626457264582645926460264612646226463264642646526466264672646826469264702647126472264732647426475264762647726478264792648026481264822648326484264852648626487264882648926490264912649226493264942649526496264972649826499265002650126502265032650426505265062650726508265092651026511265122651326514265152651626517265182651926520265212652226523265242652526526265272652826529265302653126532265332653426535265362653726538265392654026541265422654326544265452654626547265482654926550265512655226553265542655526556265572655826559265602656126562265632656426565265662656726568265692657026571265722657326574265752657626577265782657926580265812658226583265842658526586265872658826589265902659126592265932659426595265962659726598265992660026601266022660326604266052660626607266082660926610266112661226613266142661526616266172661826619266202662126622266232662426625266262662726628266292663026631266322663326634266352663626637266382663926640266412664226643266442664526646266472664826649266502665126652266532665426655266562665726658266592666026661266622666326664266652666626667266682666926670266712667226673266742667526676266772667826679266802668126682266832668426685266862668726688266892669026691266922669326694266952669626697266982669926700267012670226703267042670526706267072670826709267102671126712267132671426715267162671726718267192672026721267222672326724267252672626727267282672926730267312673226733267342673526736267372673826739267402674126742267432674426745267462674726748267492675026751267522675326754267552675626757267582675926760267612676226763267642676526766267672676826769267702677126772267732677426775267762677726778267792678026781267822678326784267852678626787267882678926790267912679226793267942679526796267972679826799268002680126802268032680426805268062680726808268092681026811268122681326814268152681626817268182681926820268212682226823268242682526826268272682826829268302683126832268332683426835268362683726838268392684026841268422684326844268452684626847268482684926850268512685226853268542685526856268572685826859268602686126862268632686426865268662686726868268692687026871268722687326874268752687626877268782687926880268812688226883268842688526886268872688826889268902689126892268932689426895268962689726898268992690026901269022690326904269052690626907269082690926910269112691226913269142691526916269172691826919269202692126922269232692426925269262692726928269292693026931269322693326934269352693626937269382693926940269412694226943269442694526946269472694826949269502695126952269532695426955269562695726958269592696026961269622696326964269652696626967269682696926970269712697226973269742697526976269772697826979269802698126982269832698426985269862698726988269892699026991269922699326994269952699626997269982699927000270012700227003270042700527006270072700827009270102701127012270132701427015270162701727018270192702027021270222702327024270252702627027270282702927030270312703227033270342703527036270372703827039270402704127042270432704427045270462704727048270492705027051270522705327054270552705627057270582705927060270612706227063270642706527066270672706827069270702707127072270732707427075270762707727078270792708027081270822708327084270852708627087270882708927090270912709227093270942709527096270972709827099271002710127102271032710427105271062710727108271092711027111271122711327114271152711627117271182711927120271212712227123271242712527126271272712827129271302713127132271332713427135271362713727138271392714027141271422714327144271452714627147271482714927150271512715227153271542715527156271572715827159271602716127162271632716427165271662716727168271692717027171271722717327174271752717627177271782717927180271812718227183271842718527186271872718827189271902719127192271932719427195271962719727198271992720027201272022720327204272052720627207272082720927210272112721227213272142721527216272172721827219272202722127222272232722427225272262722727228272292723027231272322723327234272352723627237272382723927240272412724227243272442724527246272472724827249272502725127252272532725427255272562725727258272592726027261272622726327264272652726627267272682726927270272712727227273272742727527276272772727827279272802728127282272832728427285272862728727288272892729027291272922729327294272952729627297272982729927300273012730227303273042730527306273072730827309273102731127312273132731427315273162731727318273192732027321273222732327324273252732627327273282732927330273312733227333273342733527336273372733827339273402734127342273432734427345273462734727348273492735027351273522735327354273552735627357273582735927360273612736227363273642736527366273672736827369273702737127372273732737427375273762737727378273792738027381273822738327384273852738627387273882738927390273912739227393273942739527396273972739827399274002740127402274032740427405274062740727408274092741027411274122741327414274152741627417274182741927420274212742227423274242742527426274272742827429274302743127432274332743427435274362743727438274392744027441274422744327444274452744627447274482744927450274512745227453274542745527456274572745827459274602746127462274632746427465274662746727468274692747027471274722747327474274752747627477274782747927480274812748227483274842748527486274872748827489274902749127492274932749427495274962749727498274992750027501275022750327504275052750627507275082750927510275112751227513275142751527516275172751827519275202752127522275232752427525275262752727528275292753027531275322753327534275352753627537275382753927540275412754227543275442754527546275472754827549275502755127552275532755427555275562755727558275592756027561275622756327564275652756627567275682756927570275712757227573275742757527576275772757827579275802758127582275832758427585275862758727588275892759027591275922759327594275952759627597275982759927600276012760227603276042760527606276072760827609276102761127612276132761427615276162761727618276192762027621276222762327624276252762627627276282762927630276312763227633276342763527636276372763827639276402764127642276432764427645276462764727648276492765027651276522765327654276552765627657276582765927660276612766227663276642766527666276672766827669276702767127672276732767427675276762767727678276792768027681276822768327684276852768627687276882768927690276912769227693276942769527696276972769827699277002770127702277032770427705277062770727708277092771027711277122771327714277152771627717277182771927720277212772227723277242772527726277272772827729277302773127732277332773427735277362773727738277392774027741277422774327744277452774627747277482774927750277512775227753277542775527756277572775827759277602776127762277632776427765277662776727768277692777027771277722777327774277752777627777277782777927780277812778227783277842778527786277872778827789277902779127792277932779427795277962779727798277992780027801278022780327804278052780627807278082780927810278112781227813278142781527816278172781827819278202782127822278232782427825278262782727828278292783027831278322783327834278352783627837278382783927840278412784227843278442784527846278472784827849278502785127852278532785427855278562785727858278592786027861278622786327864278652786627867278682786927870278712787227873278742787527876278772787827879278802788127882278832788427885278862788727888278892789027891278922789327894278952789627897278982789927900279012790227903279042790527906279072790827909279102791127912279132791427915279162791727918279192792027921279222792327924279252792627927279282792927930279312793227933279342793527936279372793827939279402794127942279432794427945279462794727948279492795027951279522795327954279552795627957279582795927960279612796227963279642796527966279672796827969279702797127972279732797427975279762797727978279792798027981279822798327984279852798627987279882798927990279912799227993279942799527996279972799827999280002800128002280032800428005280062800728008280092801028011280122801328014280152801628017280182801928020280212802228023280242802528026280272802828029280302803128032280332803428035280362803728038280392804028041280422804328044280452804628047280482804928050280512805228053280542805528056280572805828059280602806128062280632806428065280662806728068280692807028071280722807328074280752807628077280782807928080280812808228083280842808528086280872808828089280902809128092280932809428095280962809728098280992810028101281022810328104281052810628107281082810928110281112811228113281142811528116281172811828119281202812128122281232812428125281262812728128281292813028131281322813328134281352813628137281382813928140281412814228143281442814528146281472814828149281502815128152281532815428155281562815728158281592816028161281622816328164281652816628167281682816928170281712817228173281742817528176281772817828179281802818128182281832818428185281862818728188281892819028191281922819328194281952819628197281982819928200282012820228203282042820528206282072820828209282102821128212282132821428215282162821728218282192822028221282222822328224282252822628227282282822928230282312823228233282342823528236282372823828239282402824128242282432824428245282462824728248282492825028251282522825328254282552825628257282582825928260282612826228263282642826528266282672826828269282702827128272282732827428275282762827728278282792828028281282822828328284282852828628287282882828928290282912829228293282942829528296282972829828299283002830128302283032830428305283062830728308283092831028311283122831328314283152831628317283182831928320283212832228323283242832528326283272832828329283302833128332283332833428335283362833728338283392834028341283422834328344283452834628347283482834928350283512835228353283542835528356283572835828359283602836128362283632836428365283662836728368283692837028371283722837328374283752837628377283782837928380283812838228383283842838528386283872838828389283902839128392283932839428395283962839728398283992840028401284022840328404284052840628407284082840928410284112841228413284142841528416284172841828419284202842128422284232842428425284262842728428284292843028431284322843328434284352843628437284382843928440284412844228443284442844528446284472844828449284502845128452284532845428455284562845728458284592846028461284622846328464284652846628467284682846928470284712847228473284742847528476284772847828479284802848128482284832848428485284862848728488284892849028491284922849328494284952849628497284982849928500285012850228503285042850528506285072850828509285102851128512285132851428515285162851728518285192852028521285222852328524285252852628527285282852928530285312853228533285342853528536285372853828539285402854128542285432854428545285462854728548285492855028551285522855328554285552855628557285582855928560285612856228563285642856528566285672856828569285702857128572285732857428575285762857728578285792858028581285822858328584285852858628587285882858928590285912859228593285942859528596285972859828599286002860128602286032860428605286062860728608286092861028611286122861328614286152861628617286182861928620286212862228623286242862528626286272862828629286302863128632286332863428635286362863728638286392864028641286422864328644286452864628647286482864928650286512865228653286542865528656286572865828659286602866128662286632866428665286662866728668286692867028671286722867328674286752867628677286782867928680286812868228683286842868528686286872868828689286902869128692286932869428695286962869728698286992870028701287022870328704287052870628707287082870928710287112871228713287142871528716287172871828719287202872128722287232872428725287262872728728287292873028731287322873328734287352873628737287382873928740287412874228743287442874528746287472874828749287502875128752287532875428755287562875728758287592876028761287622876328764287652876628767287682876928770287712877228773287742877528776287772877828779287802878128782287832878428785287862878728788287892879028791287922879328794287952879628797287982879928800288012880228803288042880528806288072880828809288102881128812288132881428815288162881728818288192882028821288222882328824288252882628827288282882928830288312883228833288342883528836288372883828839288402884128842288432884428845288462884728848288492885028851288522885328854288552885628857288582885928860288612886228863288642886528866288672886828869288702887128872288732887428875288762887728878288792888028881288822888328884288852888628887288882888928890288912889228893288942889528896288972889828899289002890128902289032890428905289062890728908289092891028911289122891328914289152891628917289182891928920289212892228923289242892528926289272892828929289302893128932289332893428935289362893728938289392894028941289422894328944289452894628947289482894928950289512895228953289542895528956289572895828959289602896128962289632896428965289662896728968289692897028971289722897328974289752897628977289782897928980289812898228983289842898528986289872898828989289902899128992289932899428995289962899728998289992900029001290022900329004290052900629007290082900929010290112901229013290142901529016290172901829019290202902129022290232902429025290262902729028290292903029031290322903329034290352903629037290382903929040290412904229043290442904529046290472904829049290502905129052290532905429055290562905729058290592906029061290622906329064290652906629067290682906929070290712907229073290742907529076290772907829079290802908129082290832908429085290862908729088290892909029091290922909329094290952909629097290982909929100291012910229103291042910529106291072910829109291102911129112291132911429115291162911729118291192912029121291222912329124291252912629127291282912929130291312913229133291342913529136291372913829139291402914129142291432914429145291462914729148291492915029151291522915329154291552915629157291582915929160291612916229163291642916529166291672916829169291702917129172291732917429175291762917729178291792918029181291822918329184291852918629187291882918929190291912919229193291942919529196291972919829199292002920129202292032920429205292062920729208292092921029211292122921329214292152921629217292182921929220292212922229223292242922529226292272922829229292302923129232292332923429235292362923729238292392924029241292422924329244292452924629247292482924929250292512925229253292542925529256292572925829259292602926129262292632926429265292662926729268292692927029271292722927329274292752927629277292782927929280292812928229283292842928529286292872928829289292902929129292292932929429295292962929729298292992930029301293022930329304293052930629307293082930929310293112931229313293142931529316293172931829319293202932129322293232932429325293262932729328293292933029331293322933329334293352933629337293382933929340293412934229343293442934529346293472934829349293502935129352293532935429355293562935729358293592936029361293622936329364293652936629367293682936929370293712937229373293742937529376293772937829379293802938129382293832938429385293862938729388293892939029391293922939329394293952939629397293982939929400294012940229403294042940529406294072940829409294102941129412294132941429415294162941729418294192942029421294222942329424294252942629427294282942929430294312943229433294342943529436294372943829439294402944129442294432944429445294462944729448294492945029451294522945329454294552945629457294582945929460294612946229463294642946529466294672946829469294702947129472294732947429475294762947729478294792948029481294822948329484294852948629487294882948929490294912949229493294942949529496294972949829499295002950129502295032950429505295062950729508295092951029511295122951329514295152951629517295182951929520295212952229523295242952529526295272952829529295302953129532295332953429535295362953729538295392954029541295422954329544295452954629547295482954929550295512955229553295542955529556295572955829559295602956129562295632956429565295662956729568295692957029571295722957329574295752957629577295782957929580295812958229583295842958529586295872958829589295902959129592295932959429595295962959729598295992960029601296022960329604296052960629607296082960929610296112961229613296142961529616296172961829619296202962129622296232962429625296262962729628296292963029631296322963329634296352963629637296382963929640296412964229643296442964529646296472964829649296502965129652296532965429655296562965729658296592966029661296622966329664296652966629667296682966929670296712967229673296742967529676296772967829679296802968129682296832968429685296862968729688296892969029691296922969329694296952969629697296982969929700297012970229703297042970529706297072970829709297102971129712297132971429715297162971729718297192972029721297222972329724297252972629727297282972929730297312973229733297342973529736297372973829739297402974129742297432974429745297462974729748297492975029751297522975329754297552975629757297582975929760297612976229763297642976529766297672976829769297702977129772297732977429775297762977729778297792978029781297822978329784297852978629787297882978929790297912979229793297942979529796297972979829799298002980129802298032980429805298062980729808298092981029811298122981329814298152981629817298182981929820298212982229823298242982529826298272982829829298302983129832298332983429835298362983729838298392984029841298422984329844298452984629847298482984929850298512985229853298542985529856298572985829859298602986129862298632986429865298662986729868298692987029871298722987329874298752987629877298782987929880298812988229883298842988529886298872988829889298902989129892298932989429895298962989729898298992990029901299022990329904299052990629907299082990929910299112991229913299142991529916299172991829919299202992129922299232992429925299262992729928299292993029931299322993329934299352993629937299382993929940299412994229943299442994529946299472994829949299502995129952299532995429955299562995729958299592996029961299622996329964299652996629967299682996929970299712997229973299742997529976299772997829979299802998129982299832998429985299862998729988299892999029991299922999329994299952999629997299982999930000300013000230003300043000530006300073000830009300103001130012300133001430015300163001730018300193002030021300223002330024300253002630027300283002930030300313003230033300343003530036300373003830039300403004130042300433004430045300463004730048300493005030051300523005330054300553005630057300583005930060300613006230063300643006530066300673006830069300703007130072300733007430075300763007730078300793008030081300823008330084300853008630087300883008930090300913009230093300943009530096300973009830099301003010130102301033010430105301063010730108301093011030111301123011330114301153011630117301183011930120301213012230123301243012530126301273012830129301303013130132301333013430135301363013730138301393014030141301423014330144301453014630147301483014930150301513015230153301543015530156301573015830159301603016130162301633016430165301663016730168301693017030171301723017330174301753017630177301783017930180301813018230183301843018530186301873018830189301903019130192301933019430195301963019730198301993020030201302023020330204302053020630207302083020930210302113021230213302143021530216302173021830219302203022130222302233022430225302263022730228302293023030231302323023330234302353023630237302383023930240302413024230243302443024530246302473024830249302503025130252302533025430255302563025730258302593026030261302623026330264302653026630267302683026930270302713027230273302743027530276302773027830279302803028130282302833028430285302863028730288302893029030291302923029330294302953029630297302983029930300303013030230303303043030530306303073030830309303103031130312303133031430315303163031730318303193032030321303223032330324303253032630327303283032930330303313033230333303343033530336303373033830339303403034130342303433034430345303463034730348303493035030351303523035330354303553035630357303583035930360303613036230363303643036530366303673036830369303703037130372303733037430375303763037730378303793038030381303823038330384303853038630387303883038930390303913039230393303943039530396303973039830399304003040130402304033040430405304063040730408304093041030411304123041330414304153041630417304183041930420304213042230423304243042530426304273042830429304303043130432304333043430435304363043730438304393044030441304423044330444304453044630447304483044930450304513045230453304543045530456304573045830459304603046130462304633046430465304663046730468304693047030471304723047330474304753047630477304783047930480304813048230483304843048530486304873048830489304903049130492304933049430495304963049730498304993050030501305023050330504305053050630507305083050930510305113051230513305143051530516305173051830519305203052130522305233052430525305263052730528305293053030531305323053330534305353053630537305383053930540305413054230543305443054530546305473054830549305503055130552305533055430555305563055730558305593056030561305623056330564305653056630567305683056930570305713057230573305743057530576305773057830579305803058130582305833058430585305863058730588305893059030591305923059330594305953059630597305983059930600306013060230603306043060530606306073060830609306103061130612306133061430615306163061730618306193062030621306223062330624306253062630627306283062930630306313063230633306343063530636306373063830639306403064130642306433064430645306463064730648306493065030651306523065330654306553065630657306583065930660306613066230663306643066530666306673066830669306703067130672306733067430675306763067730678306793068030681306823068330684306853068630687306883068930690306913069230693306943069530696306973069830699307003070130702307033070430705307063070730708307093071030711307123071330714307153071630717307183071930720307213072230723307243072530726307273072830729307303073130732307333073430735307363073730738307393074030741307423074330744307453074630747307483074930750307513075230753307543075530756307573075830759307603076130762307633076430765307663076730768307693077030771307723077330774307753077630777307783077930780307813078230783307843078530786307873078830789307903079130792307933079430795307963079730798307993080030801308023080330804308053080630807308083080930810308113081230813308143081530816308173081830819308203082130822308233082430825308263082730828308293083030831308323083330834308353083630837308383083930840308413084230843308443084530846308473084830849308503085130852308533085430855308563085730858308593086030861308623086330864308653086630867308683086930870308713087230873308743087530876308773087830879308803088130882308833088430885308863088730888308893089030891308923089330894308953089630897308983089930900309013090230903309043090530906309073090830909309103091130912309133091430915309163091730918309193092030921309223092330924309253092630927309283092930930309313093230933309343093530936309373093830939309403094130942309433094430945309463094730948309493095030951309523095330954309553095630957309583095930960309613096230963309643096530966309673096830969309703097130972309733097430975309763097730978309793098030981309823098330984309853098630987309883098930990309913099230993309943099530996309973099830999310003100131002310033100431005310063100731008310093101031011310123101331014310153101631017310183101931020310213102231023310243102531026310273102831029310303103131032310333103431035310363103731038310393104031041310423104331044310453104631047310483104931050310513105231053310543105531056310573105831059310603106131062310633106431065310663106731068310693107031071310723107331074310753107631077310783107931080310813108231083310843108531086310873108831089310903109131092310933109431095310963109731098310993110031101311023110331104311053110631107311083110931110311113111231113311143111531116311173111831119311203112131122311233112431125311263112731128311293113031131311323113331134311353113631137311383113931140311413114231143311443114531146311473114831149311503115131152311533115431155311563115731158311593116031161311623116331164311653116631167311683116931170311713117231173311743117531176311773117831179311803118131182311833118431185311863118731188311893119031191311923119331194311953119631197311983119931200312013120231203312043120531206312073120831209312103121131212312133121431215312163121731218312193122031221312223122331224312253122631227312283122931230312313123231233312343123531236312373123831239312403124131242312433124431245312463124731248312493125031251312523125331254312553125631257312583125931260312613126231263312643126531266312673126831269312703127131272312733127431275312763127731278312793128031281312823128331284312853128631287312883128931290312913129231293312943129531296312973129831299313003130131302313033130431305313063130731308313093131031311313123131331314313153131631317313183131931320313213132231323313243132531326313273132831329313303133131332313333133431335313363133731338313393134031341313423134331344313453134631347313483134931350313513135231353313543135531356313573135831359313603136131362313633136431365313663136731368313693137031371313723137331374313753137631377313783137931380313813138231383313843138531386313873138831389313903139131392313933139431395313963139731398313993140031401314023140331404314053140631407314083140931410314113141231413314143141531416314173141831419314203142131422314233142431425314263142731428314293143031431314323143331434314353143631437314383143931440314413144231443314443144531446314473144831449314503145131452314533145431455314563145731458314593146031461314623146331464314653146631467314683146931470314713147231473314743147531476314773147831479314803148131482314833148431485314863148731488314893149031491314923149331494314953149631497314983149931500315013150231503315043150531506315073150831509315103151131512315133151431515315163151731518315193152031521315223152331524315253152631527315283152931530315313153231533315343153531536315373153831539315403154131542315433154431545315463154731548315493155031551315523155331554315553155631557315583155931560315613156231563315643156531566315673156831569315703157131572315733157431575315763157731578315793158031581315823158331584315853158631587315883158931590315913159231593315943159531596315973159831599316003160131602316033160431605316063160731608316093161031611316123161331614316153161631617316183161931620316213162231623316243162531626316273162831629316303163131632316333163431635316363163731638316393164031641316423164331644316453164631647316483164931650316513165231653316543165531656316573165831659316603166131662316633166431665316663166731668316693167031671316723167331674316753167631677316783167931680316813168231683316843168531686316873168831689316903169131692316933169431695316963169731698316993170031701317023170331704317053170631707317083170931710317113171231713317143171531716317173171831719317203172131722317233172431725317263172731728317293173031731317323173331734317353173631737317383173931740317413174231743317443174531746317473174831749317503175131752317533175431755317563175731758317593176031761317623176331764317653176631767317683176931770317713177231773317743177531776317773177831779317803178131782317833178431785317863178731788317893179031791317923179331794317953179631797317983179931800318013180231803318043180531806318073180831809318103181131812318133181431815318163181731818318193182031821318223182331824318253182631827318283182931830318313183231833318343183531836318373183831839318403184131842318433184431845318463184731848318493185031851318523185331854318553185631857318583185931860318613186231863318643186531866318673186831869318703187131872318733187431875318763187731878318793188031881318823188331884318853188631887318883188931890318913189231893318943189531896318973189831899319003190131902319033190431905319063190731908319093191031911319123191331914319153191631917319183191931920319213192231923319243192531926319273192831929319303193131932319333193431935319363193731938319393194031941319423194331944319453194631947319483194931950319513195231953319543195531956319573195831959319603196131962319633196431965319663196731968319693197031971319723197331974319753197631977319783197931980319813198231983319843198531986319873198831989319903199131992319933199431995319963199731998319993200032001320023200332004320053200632007320083200932010320113201232013320143201532016320173201832019320203202132022320233202432025320263202732028320293203032031320323203332034320353203632037320383203932040320413204232043320443204532046320473204832049320503205132052320533205432055320563205732058320593206032061320623206332064320653206632067320683206932070320713207232073320743207532076320773207832079320803208132082320833208432085320863208732088320893209032091320923209332094320953209632097320983209932100321013210232103321043210532106321073210832109321103211132112321133211432115321163211732118321193212032121321223212332124321253212632127321283212932130321313213232133321343213532136321373213832139321403214132142321433214432145321463214732148321493215032151321523215332154321553215632157321583215932160321613216232163321643216532166321673216832169321703217132172321733217432175321763217732178321793218032181321823218332184321853218632187321883218932190321913219232193321943219532196321973219832199322003220132202322033220432205322063220732208322093221032211322123221332214322153221632217322183221932220322213222232223322243222532226322273222832229322303223132232322333223432235322363223732238322393224032241322423224332244322453224632247322483224932250322513225232253322543225532256322573225832259322603226132262322633226432265322663226732268322693227032271322723227332274322753227632277322783227932280322813228232283322843228532286322873228832289322903229132292322933229432295322963229732298322993230032301323023230332304323053230632307323083230932310323113231232313323143231532316323173231832319323203232132322323233232432325323263232732328323293233032331323323233332334323353233632337323383233932340323413234232343323443234532346323473234832349323503235132352323533235432355323563235732358323593236032361323623236332364323653236632367323683236932370323713237232373323743237532376323773237832379323803238132382323833238432385323863238732388323893239032391323923239332394323953239632397323983239932400324013240232403324043240532406324073240832409324103241132412324133241432415324163241732418324193242032421324223242332424324253242632427324283242932430324313243232433324343243532436324373243832439324403244132442324433244432445324463244732448324493245032451324523245332454324553245632457324583245932460324613246232463324643246532466324673246832469324703247132472324733247432475324763247732478324793248032481324823248332484324853248632487324883248932490324913249232493324943249532496324973249832499325003250132502325033250432505325063250732508325093251032511325123251332514325153251632517325183251932520325213252232523325243252532526325273252832529325303253132532325333253432535325363253732538325393254032541325423254332544325453254632547325483254932550325513255232553325543255532556325573255832559325603256132562325633256432565325663256732568325693257032571325723257332574325753257632577325783257932580325813258232583325843258532586325873258832589325903259132592325933259432595325963259732598325993260032601326023260332604326053260632607326083260932610326113261232613326143261532616326173261832619326203262132622326233262432625326263262732628326293263032631326323263332634326353263632637326383263932640326413264232643326443264532646326473264832649326503265132652326533265432655326563265732658326593266032661326623266332664326653266632667326683266932670326713267232673326743267532676326773267832679326803268132682326833268432685326863268732688326893269032691326923269332694326953269632697326983269932700327013270232703327043270532706327073270832709327103271132712327133271432715327163271732718327193272032721327223272332724327253272632727327283272932730327313273232733327343273532736327373273832739327403274132742327433274432745327463274732748327493275032751327523275332754327553275632757327583275932760327613276232763327643276532766327673276832769327703277132772327733277432775327763277732778327793278032781327823278332784327853278632787327883278932790327913279232793327943279532796327973279832799328003280132802328033280432805328063280732808328093281032811328123281332814328153281632817328183281932820328213282232823328243282532826328273282832829328303283132832328333283432835328363283732838328393284032841328423284332844328453284632847328483284932850328513285232853328543285532856328573285832859328603286132862328633286432865328663286732868328693287032871328723287332874328753287632877328783287932880328813288232883328843288532886328873288832889328903289132892328933289432895328963289732898328993290032901329023290332904329053290632907329083290932910329113291232913329143291532916329173291832919329203292132922329233292432925329263292732928329293293032931329323293332934329353293632937329383293932940329413294232943329443294532946329473294832949329503295132952329533295432955329563295732958329593296032961329623296332964329653296632967329683296932970329713297232973329743297532976329773297832979329803298132982329833298432985329863298732988329893299032991329923299332994329953299632997329983299933000330013300233003330043300533006330073300833009330103301133012330133301433015330163301733018330193302033021330223302333024330253302633027330283302933030330313303233033330343303533036330373303833039330403304133042330433304433045330463304733048330493305033051330523305333054330553305633057330583305933060330613306233063330643306533066330673306833069330703307133072330733307433075330763307733078330793308033081330823308333084330853308633087330883308933090330913309233093330943309533096330973309833099331003310133102331033310433105331063310733108331093311033111331123311333114331153311633117331183311933120331213312233123331243312533126331273312833129331303313133132331333313433135331363313733138331393314033141331423314333144331453314633147331483314933150331513315233153331543315533156331573315833159331603316133162331633316433165331663316733168331693317033171331723317333174331753317633177331783317933180331813318233183331843318533186331873318833189331903319133192331933319433195331963319733198331993320033201332023320333204332053320633207332083320933210332113321233213332143321533216332173321833219332203322133222332233322433225332263322733228332293323033231332323323333234332353323633237332383323933240332413324233243332443324533246332473324833249332503325133252332533325433255332563325733258332593326033261332623326333264332653326633267332683326933270332713327233273332743327533276332773327833279332803328133282332833328433285332863328733288332893329033291332923329333294332953329633297332983329933300333013330233303333043330533306333073330833309333103331133312333133331433315333163331733318333193332033321333223332333324333253332633327333283332933330333313333233333333343333533336333373333833339333403334133342333433334433345333463334733348333493335033351333523335333354333553335633357333583335933360333613336233363333643336533366333673336833369333703337133372333733337433375333763337733378333793338033381333823338333384333853338633387333883338933390333913339233393333943339533396333973339833399334003340133402334033340433405334063340733408334093341033411334123341333414334153341633417334183341933420334213342233423334243342533426334273342833429334303343133432334333343433435334363343733438334393344033441334423344333444334453344633447334483344933450334513345233453334543345533456334573345833459334603346133462334633346433465334663346733468334693347033471334723347333474334753347633477334783347933480334813348233483334843348533486334873348833489334903349133492334933349433495334963349733498334993350033501335023350333504335053350633507335083350933510335113351233513335143351533516335173351833519335203352133522335233352433525335263352733528335293353033531335323353333534335353353633537335383353933540335413354233543335443354533546335473354833549335503355133552335533355433555335563355733558335593356033561335623356333564335653356633567335683356933570335713357233573335743357533576335773357833579335803358133582335833358433585335863358733588335893359033591335923359333594335953359633597335983359933600336013360233603336043360533606336073360833609336103361133612336133361433615336163361733618336193362033621336223362333624336253362633627336283362933630336313363233633336343363533636336373363833639336403364133642336433364433645336463364733648336493365033651336523365333654336553365633657336583365933660336613366233663336643366533666336673366833669336703367133672336733367433675336763367733678336793368033681336823368333684336853368633687336883368933690336913369233693336943369533696336973369833699337003370133702337033370433705337063370733708337093371033711337123371333714337153371633717337183371933720337213372233723337243372533726337273372833729337303373133732337333373433735337363373733738337393374033741337423374333744337453374633747337483374933750337513375233753337543375533756337573375833759337603376133762337633376433765337663376733768337693377033771337723377333774337753377633777337783377933780337813378233783337843378533786337873378833789337903379133792337933379433795337963379733798337993380033801338023380333804338053380633807338083380933810338113381233813338143381533816338173381833819338203382133822338233382433825338263382733828338293383033831338323383333834338353383633837338383383933840338413384233843338443384533846338473384833849338503385133852338533385433855338563385733858338593386033861338623386333864338653386633867338683386933870338713387233873338743387533876338773387833879338803388133882338833388433885338863388733888338893389033891338923389333894338953389633897338983389933900339013390233903339043390533906339073390833909339103391133912339133391433915339163391733918339193392033921339223392333924339253392633927339283392933930339313393233933339343393533936339373393833939339403394133942339433394433945339463394733948339493395033951339523395333954339553395633957339583395933960339613396233963339643396533966339673396833969339703397133972339733397433975339763397733978339793398033981339823398333984339853398633987339883398933990339913399233993339943399533996339973399833999340003400134002340033400434005340063400734008340093401034011340123401334014340153401634017340183401934020340213402234023340243402534026340273402834029340303403134032340333403434035340363403734038340393404034041340423404334044340453404634047340483404934050340513405234053340543405534056340573405834059340603406134062340633406434065340663406734068340693407034071340723407334074340753407634077340783407934080340813408234083340843408534086340873408834089340903409134092340933409434095340963409734098340993410034101341023410334104341053410634107341083410934110341113411234113341143411534116341173411834119341203412134122341233412434125341263412734128341293413034131341323413334134341353413634137341383413934140341413414234143341443414534146341473414834149341503415134152341533415434155341563415734158341593416034161341623416334164341653416634167341683416934170341713417234173341743417534176341773417834179341803418134182341833418434185341863418734188341893419034191341923419334194341953419634197341983419934200342013420234203342043420534206342073420834209342103421134212342133421434215342163421734218342193422034221342223422334224342253422634227342283422934230342313423234233342343423534236342373423834239342403424134242342433424434245342463424734248342493425034251342523425334254342553425634257342583425934260342613426234263342643426534266342673426834269342703427134272342733427434275342763427734278342793428034281342823428334284342853428634287342883428934290342913429234293342943429534296342973429834299343003430134302343033430434305343063430734308343093431034311343123431334314343153431634317343183431934320343213432234323343243432534326343273432834329343303433134332343333433434335343363433734338343393434034341343423434334344343453434634347343483434934350343513435234353343543435534356343573435834359343603436134362343633436434365343663436734368343693437034371343723437334374343753437634377343783437934380343813438234383343843438534386343873438834389343903439134392343933439434395343963439734398343993440034401344023440334404344053440634407344083440934410344113441234413344143441534416344173441834419344203442134422344233442434425344263442734428344293443034431344323443334434344353443634437344383443934440344413444234443344443444534446344473444834449344503445134452344533445434455344563445734458344593446034461344623446334464344653446634467344683446934470344713447234473344743447534476344773447834479344803448134482344833448434485344863448734488344893449034491344923449334494344953449634497344983449934500345013450234503345043450534506345073450834509345103451134512345133451434515345163451734518345193452034521345223452334524345253452634527345283452934530345313453234533345343453534536345373453834539345403454134542345433454434545345463454734548345493455034551345523455334554345553455634557345583455934560345613456234563345643456534566345673456834569345703457134572345733457434575345763457734578345793458034581345823458334584345853458634587345883458934590345913459234593345943459534596345973459834599346003460134602346033460434605346063460734608346093461034611346123461334614346153461634617346183461934620346213462234623346243462534626346273462834629346303463134632346333463434635346363463734638346393464034641346423464334644346453464634647346483464934650346513465234653346543465534656346573465834659346603466134662346633466434665346663466734668346693467034671346723467334674346753467634677346783467934680346813468234683346843468534686346873468834689346903469134692346933469434695346963469734698346993470034701347023470334704347053470634707347083470934710347113471234713347143471534716347173471834719347203472134722347233472434725347263472734728347293473034731347323473334734347353473634737347383473934740347413474234743347443474534746347473474834749347503475134752347533475434755347563475734758347593476034761347623476334764347653476634767347683476934770347713477234773347743477534776347773477834779347803478134782347833478434785347863478734788347893479034791347923479334794347953479634797347983479934800348013480234803348043480534806348073480834809348103481134812348133481434815348163481734818348193482034821348223482334824348253482634827348283482934830348313483234833348343483534836348373483834839348403484134842348433484434845348463484734848348493485034851348523485334854348553485634857348583485934860348613486234863348643486534866348673486834869348703487134872348733487434875348763487734878348793488034881348823488334884348853488634887348883488934890348913489234893348943489534896348973489834899349003490134902349033490434905349063490734908349093491034911349123491334914349153491634917349183491934920349213492234923349243492534926349273492834929349303493134932349333493434935349363493734938349393494034941349423494334944349453494634947349483494934950349513495234953349543495534956349573495834959349603496134962349633496434965349663496734968349693497034971349723497334974349753497634977349783497934980349813498234983349843498534986349873498834989349903499134992349933499434995349963499734998349993500035001350023500335004350053500635007350083500935010350113501235013350143501535016350173501835019350203502135022350233502435025350263502735028350293503035031350323503335034350353503635037350383503935040350413504235043350443504535046350473504835049350503505135052350533505435055350563505735058350593506035061350623506335064350653506635067350683506935070350713507235073350743507535076350773507835079350803508135082350833508435085350863508735088350893509035091350923509335094350953509635097350983509935100351013510235103351043510535106351073510835109351103511135112351133511435115351163511735118351193512035121351223512335124351253512635127351283512935130351313513235133351343513535136351373513835139351403514135142351433514435145351463514735148351493515035151351523515335154351553515635157351583515935160351613516235163351643516535166351673516835169351703517135172351733517435175351763517735178351793518035181351823518335184351853518635187351883518935190351913519235193351943519535196351973519835199352003520135202352033520435205352063520735208352093521035211352123521335214352153521635217352183521935220352213522235223352243522535226352273522835229352303523135232352333523435235352363523735238352393524035241352423524335244352453524635247352483524935250352513525235253352543525535256352573525835259352603526135262352633526435265352663526735268352693527035271352723527335274352753527635277352783527935280352813528235283352843528535286352873528835289352903529135292352933529435295352963529735298352993530035301353023530335304353053530635307353083530935310353113531235313353143531535316353173531835319353203532135322353233532435325353263532735328353293533035331353323533335334353353533635337353383533935340353413534235343353443534535346353473534835349353503535135352353533535435355353563535735358353593536035361353623536335364353653536635367353683536935370353713537235373353743537535376353773537835379353803538135382353833538435385353863538735388353893539035391353923539335394353953539635397353983539935400354013540235403354043540535406354073540835409354103541135412354133541435415354163541735418354193542035421354223542335424354253542635427354283542935430354313543235433354343543535436354373543835439354403544135442354433544435445354463544735448354493545035451354523545335454354553545635457354583545935460354613546235463354643546535466354673546835469354703547135472354733547435475354763547735478354793548035481354823548335484354853548635487354883548935490354913549235493354943549535496354973549835499355003550135502355033550435505355063550735508355093551035511355123551335514355153551635517355183551935520355213552235523355243552535526355273552835529355303553135532355333553435535355363553735538355393554035541355423554335544355453554635547355483554935550355513555235553355543555535556355573555835559355603556135562355633556435565355663556735568355693557035571355723557335574355753557635577355783557935580355813558235583355843558535586355873558835589355903559135592355933559435595355963559735598355993560035601356023560335604356053560635607356083560935610356113561235613356143561535616356173561835619356203562135622356233562435625356263562735628356293563035631356323563335634356353563635637356383563935640356413564235643356443564535646356473564835649356503565135652356533565435655356563565735658356593566035661356623566335664356653566635667356683566935670356713567235673356743567535676356773567835679356803568135682356833568435685356863568735688356893569035691356923569335694356953569635697356983569935700357013570235703357043570535706357073570835709357103571135712357133571435715357163571735718357193572035721357223572335724357253572635727357283572935730357313573235733357343573535736357373573835739357403574135742357433574435745357463574735748357493575035751357523575335754357553575635757357583575935760357613576235763357643576535766357673576835769357703577135772357733577435775357763577735778357793578035781357823578335784357853578635787357883578935790357913579235793357943579535796357973579835799358003580135802358033580435805358063580735808358093581035811358123581335814358153581635817358183581935820358213582235823358243582535826358273582835829358303583135832358333583435835358363583735838358393584035841358423584335844358453584635847358483584935850358513585235853358543585535856358573585835859358603586135862358633586435865358663586735868358693587035871358723587335874358753587635877358783587935880358813588235883358843588535886358873588835889358903589135892358933589435895358963589735898358993590035901359023590335904359053590635907359083590935910359113591235913359143591535916359173591835919359203592135922359233592435925359263592735928359293593035931359323593335934359353593635937359383593935940359413594235943359443594535946359473594835949359503595135952359533595435955359563595735958359593596035961359623596335964359653596635967359683596935970359713597235973359743597535976359773597835979359803598135982359833598435985359863598735988359893599035991359923599335994359953599635997359983599936000360013600236003360043600536006360073600836009360103601136012360133601436015360163601736018360193602036021360223602336024360253602636027360283602936030360313603236033360343603536036360373603836039360403604136042360433604436045360463604736048360493605036051360523605336054360553605636057360583605936060360613606236063360643606536066360673606836069360703607136072360733607436075360763607736078360793608036081360823608336084360853608636087360883608936090360913609236093360943609536096360973609836099361003610136102361033610436105361063610736108361093611036111361123611336114361153611636117361183611936120361213612236123361243612536126361273612836129361303613136132361333613436135361363613736138361393614036141361423614336144361453614636147361483614936150361513615236153361543615536156361573615836159361603616136162361633616436165361663616736168361693617036171361723617336174361753617636177361783617936180361813618236183361843618536186361873618836189361903619136192361933619436195361963619736198361993620036201362023620336204362053620636207362083620936210362113621236213362143621536216362173621836219362203622136222362233622436225362263622736228362293623036231362323623336234362353623636237362383623936240362413624236243362443624536246362473624836249362503625136252362533625436255362563625736258362593626036261362623626336264362653626636267362683626936270362713627236273362743627536276362773627836279362803628136282362833628436285362863628736288362893629036291362923629336294362953629636297362983629936300363013630236303363043630536306363073630836309363103631136312363133631436315363163631736318363193632036321363223632336324363253632636327363283632936330363313633236333363343633536336363373633836339363403634136342363433634436345363463634736348363493635036351363523635336354363553635636357363583635936360363613636236363363643636536366363673636836369363703637136372363733637436375363763637736378363793638036381363823638336384363853638636387363883638936390363913639236393363943639536396363973639836399364003640136402364033640436405364063640736408364093641036411364123641336414364153641636417364183641936420364213642236423364243642536426364273642836429364303643136432364333643436435364363643736438364393644036441364423644336444364453644636447364483644936450364513645236453364543645536456364573645836459364603646136462364633646436465364663646736468364693647036471364723647336474364753647636477364783647936480364813648236483364843648536486364873648836489364903649136492364933649436495364963649736498364993650036501365023650336504365053650636507365083650936510365113651236513365143651536516365173651836519365203652136522365233652436525365263652736528365293653036531365323653336534365353653636537365383653936540365413654236543365443654536546365473654836549365503655136552365533655436555365563655736558365593656036561365623656336564365653656636567365683656936570365713657236573365743657536576365773657836579365803658136582365833658436585365863658736588365893659036591365923659336594365953659636597365983659936600366013660236603366043660536606366073660836609366103661136612366133661436615366163661736618366193662036621366223662336624366253662636627366283662936630366313663236633366343663536636366373663836639366403664136642366433664436645366463664736648366493665036651366523665336654366553665636657366583665936660366613666236663366643666536666366673666836669366703667136672366733667436675366763667736678366793668036681366823668336684366853668636687366883668936690366913669236693366943669536696366973669836699367003670136702367033670436705367063670736708367093671036711367123671336714367153671636717367183671936720367213672236723367243672536726367273672836729367303673136732367333673436735367363673736738367393674036741367423674336744367453674636747367483674936750367513675236753367543675536756367573675836759367603676136762367633676436765367663676736768367693677036771367723677336774367753677636777367783677936780367813678236783367843678536786367873678836789367903679136792367933679436795367963679736798367993680036801368023680336804368053680636807368083680936810368113681236813368143681536816368173681836819368203682136822368233682436825368263682736828368293683036831368323683336834368353683636837368383683936840368413684236843368443684536846368473684836849368503685136852368533685436855368563685736858368593686036861368623686336864368653686636867368683686936870368713687236873368743687536876368773687836879368803688136882368833688436885368863688736888368893689036891368923689336894368953689636897368983689936900369013690236903369043690536906369073690836909369103691136912369133691436915369163691736918369193692036921369223692336924369253692636927369283692936930369313693236933369343693536936369373693836939369403694136942369433694436945369463694736948369493695036951369523695336954369553695636957369583695936960369613696236963369643696536966369673696836969369703697136972369733697436975369763697736978369793698036981369823698336984369853698636987369883698936990369913699236993369943699536996369973699836999370003700137002370033700437005370063700737008370093701037011370123701337014370153701637017370183701937020370213702237023370243702537026370273702837029370303703137032370333703437035370363703737038370393704037041370423704337044370453704637047370483704937050370513705237053370543705537056370573705837059370603706137062370633706437065370663706737068370693707037071370723707337074370753707637077370783707937080370813708237083370843708537086370873708837089370903709137092370933709437095370963709737098370993710037101371023710337104371053710637107371083710937110371113711237113371143711537116371173711837119371203712137122371233712437125371263712737128371293713037131371323713337134371353713637137371383713937140371413714237143371443714537146371473714837149371503715137152371533715437155371563715737158371593716037161371623716337164371653716637167371683716937170371713717237173371743717537176371773717837179371803718137182371833718437185371863718737188371893719037191371923719337194371953719637197371983719937200372013720237203372043720537206372073720837209372103721137212372133721437215372163721737218372193722037221372223722337224372253722637227372283722937230372313723237233372343723537236372373723837239372403724137242372433724437245372463724737248372493725037251372523725337254372553725637257372583725937260372613726237263372643726537266372673726837269372703727137272372733727437275372763727737278372793728037281372823728337284372853728637287372883728937290372913729237293372943729537296372973729837299373003730137302373033730437305373063730737308373093731037311373123731337314373153731637317373183731937320373213732237323373243732537326373273732837329373303733137332373333733437335373363733737338373393734037341373423734337344373453734637347373483734937350373513735237353373543735537356373573735837359373603736137362373633736437365373663736737368373693737037371373723737337374373753737637377373783737937380373813738237383373843738537386373873738837389373903739137392373933739437395373963739737398373993740037401374023740337404374053740637407374083740937410374113741237413374143741537416374173741837419374203742137422374233742437425374263742737428374293743037431374323743337434374353743637437374383743937440374413744237443374443744537446374473744837449374503745137452374533745437455374563745737458374593746037461374623746337464374653746637467374683746937470374713747237473374743747537476374773747837479374803748137482374833748437485374863748737488374893749037491374923749337494374953749637497374983749937500375013750237503375043750537506375073750837509375103751137512375133751437515375163751737518375193752037521375223752337524375253752637527375283752937530375313753237533375343753537536375373753837539375403754137542375433754437545375463754737548375493755037551375523755337554375553755637557375583755937560375613756237563375643756537566375673756837569375703757137572375733757437575375763757737578375793758037581375823758337584375853758637587375883758937590375913759237593375943759537596375973759837599376003760137602376033760437605376063760737608376093761037611376123761337614376153761637617376183761937620376213762237623376243762537626376273762837629376303763137632376333763437635376363763737638376393764037641376423764337644376453764637647376483764937650376513765237653376543765537656376573765837659376603766137662376633766437665376663766737668376693767037671376723767337674376753767637677376783767937680376813768237683376843768537686376873768837689376903769137692376933769437695376963769737698376993770037701377023770337704377053770637707377083770937710377113771237713377143771537716377173771837719377203772137722377233772437725377263772737728377293773037731377323773337734377353773637737377383773937740377413774237743377443774537746377473774837749377503775137752377533775437755377563775737758377593776037761377623776337764377653776637767377683776937770377713777237773377743777537776377773777837779377803778137782377833778437785377863778737788377893779037791377923779337794377953779637797377983779937800378013780237803378043780537806378073780837809378103781137812378133781437815378163781737818378193782037821378223782337824378253782637827378283782937830378313783237833378343783537836378373783837839378403784137842378433784437845378463784737848378493785037851378523785337854378553785637857378583785937860378613786237863378643786537866378673786837869378703787137872378733787437875378763787737878378793788037881378823788337884378853788637887378883788937890378913789237893378943789537896378973789837899379003790137902379033790437905379063790737908379093791037911379123791337914379153791637917379183791937920379213792237923379243792537926379273792837929379303793137932379333793437935379363793737938379393794037941379423794337944379453794637947379483794937950379513795237953379543795537956379573795837959379603796137962379633796437965379663796737968379693797037971379723797337974379753797637977379783797937980379813798237983379843798537986379873798837989379903799137992379933799437995379963799737998379993800038001380023800338004380053800638007380083800938010380113801238013380143801538016380173801838019380203802138022380233802438025380263802738028380293803038031380323803338034380353803638037380383803938040380413804238043380443804538046380473804838049380503805138052380533805438055380563805738058380593806038061380623806338064380653806638067380683806938070380713807238073380743807538076380773807838079380803808138082380833808438085380863808738088380893809038091380923809338094380953809638097380983809938100381013810238103381043810538106381073810838109381103811138112381133811438115381163811738118381193812038121381223812338124381253812638127381283812938130381313813238133381343813538136381373813838139381403814138142381433814438145381463814738148381493815038151381523815338154381553815638157381583815938160381613816238163381643816538166381673816838169381703817138172381733817438175381763817738178381793818038181381823818338184381853818638187381883818938190381913819238193381943819538196381973819838199382003820138202382033820438205382063820738208382093821038211382123821338214382153821638217382183821938220382213822238223382243822538226382273822838229382303823138232382333823438235382363823738238382393824038241382423824338244382453824638247382483824938250382513825238253382543825538256382573825838259382603826138262382633826438265382663826738268382693827038271382723827338274382753827638277382783827938280382813828238283382843828538286382873828838289382903829138292382933829438295382963829738298382993830038301383023830338304383053830638307383083830938310383113831238313383143831538316383173831838319383203832138322383233832438325383263832738328383293833038331383323833338334383353833638337383383833938340383413834238343383443834538346383473834838349383503835138352383533835438355383563835738358383593836038361383623836338364383653836638367383683836938370383713837238373383743837538376383773837838379383803838138382383833838438385383863838738388383893839038391383923839338394383953839638397383983839938400384013840238403384043840538406384073840838409384103841138412384133841438415384163841738418384193842038421384223842338424384253842638427384283842938430384313843238433384343843538436384373843838439384403844138442384433844438445384463844738448384493845038451384523845338454384553845638457384583845938460384613846238463384643846538466384673846838469384703847138472384733847438475384763847738478384793848038481384823848338484384853848638487384883848938490384913849238493384943849538496384973849838499385003850138502385033850438505385063850738508385093851038511385123851338514385153851638517385183851938520385213852238523385243852538526385273852838529385303853138532385333853438535385363853738538385393854038541385423854338544385453854638547385483854938550385513855238553385543855538556385573855838559385603856138562385633856438565385663856738568385693857038571385723857338574385753857638577385783857938580385813858238583385843858538586385873858838589385903859138592385933859438595385963859738598385993860038601386023860338604386053860638607386083860938610386113861238613386143861538616386173861838619386203862138622386233862438625386263862738628386293863038631386323863338634386353863638637386383863938640386413864238643386443864538646386473864838649386503865138652386533865438655386563865738658386593866038661386623866338664386653866638667386683866938670386713867238673386743867538676386773867838679386803868138682386833868438685386863868738688386893869038691386923869338694386953869638697386983869938700387013870238703387043870538706387073870838709387103871138712387133871438715387163871738718387193872038721387223872338724387253872638727387283872938730387313873238733387343873538736387373873838739387403874138742387433874438745387463874738748387493875038751387523875338754387553875638757387583875938760387613876238763387643876538766387673876838769387703877138772387733877438775387763877738778387793878038781387823878338784387853878638787387883878938790387913879238793387943879538796387973879838799388003880138802388033880438805388063880738808388093881038811388123881338814388153881638817388183881938820388213882238823388243882538826388273882838829388303883138832388333883438835388363883738838388393884038841388423884338844388453884638847388483884938850388513885238853388543885538856388573885838859388603886138862388633886438865388663886738868388693887038871388723887338874388753887638877388783887938880388813888238883388843888538886388873888838889388903889138892388933889438895388963889738898388993890038901389023890338904389053890638907389083890938910389113891238913389143891538916389173891838919389203892138922389233892438925389263892738928389293893038931389323893338934389353893638937389383893938940389413894238943389443894538946389473894838949389503895138952389533895438955389563895738958389593896038961389623896338964389653896638967389683896938970389713897238973389743897538976389773897838979389803898138982389833898438985389863898738988389893899038991389923899338994389953899638997389983899939000390013900239003390043900539006390073900839009390103901139012390133901439015390163901739018390193902039021390223902339024390253902639027390283902939030390313903239033390343903539036390373903839039390403904139042390433904439045390463904739048390493905039051390523905339054390553905639057390583905939060390613906239063390643906539066390673906839069390703907139072390733907439075390763907739078390793908039081390823908339084390853908639087390883908939090390913909239093390943909539096390973909839099391003910139102391033910439105391063910739108391093911039111391123911339114391153911639117391183911939120391213912239123391243912539126391273912839129391303913139132391333913439135391363913739138391393914039141391423914339144391453914639147391483914939150391513915239153391543915539156391573915839159391603916139162391633916439165391663916739168391693917039171391723917339174391753917639177391783917939180391813918239183391843918539186391873918839189391903919139192391933919439195391963919739198391993920039201392023920339204392053920639207392083920939210392113921239213392143921539216392173921839219392203922139222392233922439225392263922739228392293923039231392323923339234392353923639237392383923939240392413924239243392443924539246392473924839249392503925139252392533925439255392563925739258392593926039261392623926339264392653926639267392683926939270392713927239273392743927539276392773927839279392803928139282392833928439285392863928739288392893929039291392923929339294392953929639297392983929939300393013930239303393043930539306393073930839309393103931139312393133931439315393163931739318393193932039321393223932339324393253932639327393283932939330393313933239333393343933539336393373933839339393403934139342393433934439345393463934739348393493935039351393523935339354393553935639357393583935939360393613936239363393643936539366393673936839369393703937139372393733937439375393763937739378393793938039381393823938339384393853938639387393883938939390393913939239393393943939539396393973939839399394003940139402394033940439405394063940739408394093941039411394123941339414394153941639417394183941939420394213942239423394243942539426394273942839429394303943139432394333943439435394363943739438394393944039441394423944339444394453944639447394483944939450394513945239453394543945539456394573945839459394603946139462394633946439465394663946739468394693947039471394723947339474394753947639477394783947939480394813948239483394843948539486394873948839489394903949139492394933949439495394963949739498394993950039501395023950339504395053950639507395083950939510395113951239513395143951539516395173951839519395203952139522395233952439525395263952739528395293953039531395323953339534395353953639537395383953939540395413954239543395443954539546395473954839549395503955139552395533955439555395563955739558395593956039561395623956339564395653956639567395683956939570395713957239573395743957539576395773957839579395803958139582395833958439585395863958739588395893959039591395923959339594395953959639597395983959939600396013960239603396043960539606396073960839609396103961139612396133961439615396163961739618396193962039621396223962339624396253962639627396283962939630396313963239633396343963539636396373963839639396403964139642396433964439645396463964739648396493965039651396523965339654396553965639657396583965939660396613966239663396643966539666396673966839669396703967139672396733967439675396763967739678396793968039681396823968339684396853968639687396883968939690396913969239693396943969539696396973969839699397003970139702397033970439705397063970739708397093971039711397123971339714397153971639717397183971939720397213972239723397243972539726397273972839729397303973139732397333973439735397363973739738397393974039741397423974339744397453974639747397483974939750397513975239753397543975539756397573975839759397603976139762397633976439765397663976739768397693977039771397723977339774397753977639777397783977939780397813978239783397843978539786397873978839789397903979139792397933979439795397963979739798397993980039801398023980339804398053980639807398083980939810398113981239813398143981539816398173981839819398203982139822398233982439825398263982739828398293983039831398323983339834398353983639837398383983939840398413984239843398443984539846398473984839849398503985139852398533985439855398563985739858398593986039861398623986339864398653986639867398683986939870398713987239873398743987539876398773987839879398803988139882398833988439885398863988739888398893989039891398923989339894398953989639897398983989939900399013990239903399043990539906399073990839909399103991139912399133991439915399163991739918399193992039921399223992339924399253992639927399283992939930399313993239933399343993539936399373993839939399403994139942399433994439945399463994739948399493995039951399523995339954399553995639957399583995939960399613996239963399643996539966399673996839969399703997139972399733997439975399763997739978399793998039981399823998339984399853998639987399883998939990399913999239993399943999539996399973999839999400004000140002400034000440005400064000740008400094001040011400124001340014400154001640017400184001940020400214002240023400244002540026400274002840029400304003140032400334003440035400364003740038400394004040041400424004340044400454004640047400484004940050400514005240053400544005540056400574005840059400604006140062400634006440065400664006740068400694007040071400724007340074400754007640077400784007940080400814008240083400844008540086400874008840089400904009140092400934009440095400964009740098400994010040101401024010340104401054010640107401084010940110401114011240113401144011540116401174011840119401204012140122401234012440125401264012740128401294013040131401324013340134401354013640137401384013940140401414014240143401444014540146401474014840149401504015140152401534015440155401564015740158401594016040161401624016340164401654016640167401684016940170401714017240173401744017540176401774017840179401804018140182401834018440185401864018740188401894019040191401924019340194401954019640197401984019940200402014020240203402044020540206402074020840209402104021140212402134021440215402164021740218402194022040221402224022340224402254022640227402284022940230402314023240233402344023540236402374023840239402404024140242402434024440245402464024740248402494025040251402524025340254402554025640257402584025940260402614026240263402644026540266402674026840269402704027140272402734027440275402764027740278402794028040281402824028340284402854028640287402884028940290402914029240293402944029540296402974029840299403004030140302403034030440305403064030740308403094031040311403124031340314403154031640317403184031940320403214032240323403244032540326403274032840329403304033140332403334033440335403364033740338403394034040341403424034340344403454034640347403484034940350403514035240353403544035540356403574035840359403604036140362403634036440365403664036740368403694037040371403724037340374403754037640377403784037940380403814038240383403844038540386403874038840389403904039140392403934039440395403964039740398403994040040401404024040340404404054040640407404084040940410404114041240413404144041540416404174041840419404204042140422404234042440425404264042740428404294043040431404324043340434404354043640437404384043940440404414044240443404444044540446404474044840449404504045140452404534045440455404564045740458404594046040461404624046340464404654046640467404684046940470404714047240473404744047540476404774047840479404804048140482404834048440485404864048740488404894049040491404924049340494404954049640497404984049940500405014050240503405044050540506405074050840509405104051140512405134051440515405164051740518405194052040521405224052340524405254052640527405284052940530405314053240533405344053540536405374053840539405404054140542405434054440545405464054740548405494055040551405524055340554405554055640557405584055940560405614056240563405644056540566405674056840569405704057140572405734057440575405764057740578405794058040581405824058340584405854058640587405884058940590405914059240593405944059540596405974059840599406004060140602406034060440605406064060740608406094061040611406124061340614406154061640617406184061940620406214062240623406244062540626406274062840629406304063140632406334063440635406364063740638406394064040641406424064340644406454064640647406484064940650406514065240653406544065540656406574065840659406604066140662406634066440665406664066740668406694067040671406724067340674406754067640677406784067940680406814068240683406844068540686406874068840689406904069140692406934069440695406964069740698406994070040701407024070340704407054070640707407084070940710407114071240713407144071540716407174071840719407204072140722407234072440725407264072740728407294073040731407324073340734407354073640737407384073940740407414074240743407444074540746407474074840749407504075140752407534075440755407564075740758407594076040761407624076340764407654076640767407684076940770407714077240773407744077540776407774077840779407804078140782407834078440785407864078740788407894079040791407924079340794407954079640797407984079940800408014080240803408044080540806408074080840809408104081140812408134081440815408164081740818408194082040821408224082340824408254082640827408284082940830408314083240833408344083540836408374083840839408404084140842408434084440845408464084740848408494085040851408524085340854408554085640857408584085940860408614086240863408644086540866408674086840869408704087140872408734087440875408764087740878408794088040881408824088340884408854088640887408884088940890408914089240893408944089540896408974089840899409004090140902409034090440905409064090740908409094091040911409124091340914409154091640917409184091940920409214092240923409244092540926409274092840929409304093140932409334093440935409364093740938409394094040941409424094340944409454094640947409484094940950409514095240953409544095540956409574095840959409604096140962409634096440965409664096740968409694097040971409724097340974409754097640977409784097940980409814098240983409844098540986409874098840989409904099140992409934099440995409964099740998409994100041001410024100341004410054100641007410084100941010410114101241013410144101541016410174101841019410204102141022410234102441025410264102741028410294103041031410324103341034410354103641037410384103941040410414104241043410444104541046410474104841049410504105141052410534105441055410564105741058410594106041061410624106341064410654106641067410684106941070410714107241073410744107541076410774107841079410804108141082410834108441085410864108741088410894109041091410924109341094410954109641097410984109941100411014110241103411044110541106411074110841109411104111141112411134111441115411164111741118411194112041121411224112341124411254112641127411284112941130411314113241133411344113541136411374113841139411404114141142411434114441145411464114741148411494115041151411524115341154411554115641157411584115941160411614116241163411644116541166411674116841169411704117141172411734117441175411764117741178411794118041181411824118341184411854118641187411884118941190411914119241193411944119541196411974119841199412004120141202412034120441205412064120741208412094121041211412124121341214412154121641217412184121941220412214122241223412244122541226412274122841229412304123141232412334123441235412364123741238412394124041241412424124341244412454124641247412484124941250412514125241253412544125541256412574125841259412604126141262412634126441265412664126741268412694127041271412724127341274412754127641277412784127941280412814128241283412844128541286412874128841289412904129141292412934129441295412964129741298412994130041301413024130341304413054130641307413084130941310413114131241313413144131541316413174131841319413204132141322413234132441325413264132741328413294133041331413324133341334413354133641337413384133941340413414134241343413444134541346413474134841349413504135141352413534135441355413564135741358413594136041361413624136341364413654136641367413684136941370413714137241373413744137541376413774137841379413804138141382413834138441385413864138741388413894139041391413924139341394413954139641397413984139941400414014140241403414044140541406414074140841409414104141141412414134141441415414164141741418414194142041421414224142341424414254142641427414284142941430414314143241433414344143541436414374143841439414404144141442414434144441445414464144741448414494145041451414524145341454414554145641457414584145941460414614146241463414644146541466414674146841469414704147141472414734147441475414764147741478414794148041481414824148341484414854148641487414884148941490414914149241493414944149541496414974149841499415004150141502415034150441505415064150741508415094151041511415124151341514415154151641517415184151941520415214152241523415244152541526415274152841529415304153141532415334153441535415364153741538415394154041541415424154341544415454154641547415484154941550415514155241553415544155541556415574155841559415604156141562415634156441565415664156741568415694157041571415724157341574415754157641577415784157941580415814158241583415844158541586415874158841589415904159141592415934159441595415964159741598415994160041601416024160341604416054160641607416084160941610416114161241613416144161541616416174161841619416204162141622416234162441625416264162741628416294163041631416324163341634416354163641637416384163941640416414164241643416444164541646416474164841649416504165141652416534165441655416564165741658416594166041661416624166341664416654166641667416684166941670416714167241673416744167541676416774167841679416804168141682416834168441685416864168741688416894169041691416924169341694416954169641697416984169941700417014170241703417044170541706417074170841709417104171141712417134171441715417164171741718417194172041721417224172341724417254172641727417284172941730417314173241733417344173541736417374173841739417404174141742417434174441745417464174741748417494175041751417524175341754417554175641757417584175941760417614176241763417644176541766417674176841769417704177141772417734177441775417764177741778417794178041781417824178341784417854178641787417884178941790417914179241793417944179541796417974179841799418004180141802418034180441805418064180741808418094181041811418124181341814418154181641817418184181941820418214182241823418244182541826418274182841829418304183141832418334183441835418364183741838418394184041841418424184341844418454184641847418484184941850418514185241853418544185541856418574185841859418604186141862418634186441865418664186741868418694187041871418724187341874418754187641877418784187941880418814188241883418844188541886418874188841889418904189141892418934189441895418964189741898418994190041901419024190341904419054190641907419084190941910419114191241913419144191541916419174191841919419204192141922419234192441925419264192741928419294193041931419324193341934419354193641937419384193941940419414194241943419444194541946419474194841949419504195141952419534195441955419564195741958419594196041961419624196341964419654196641967419684196941970419714197241973419744197541976419774197841979419804198141982419834198441985419864198741988419894199041991419924199341994419954199641997419984199942000420014200242003420044200542006420074200842009420104201142012420134201442015420164201742018420194202042021420224202342024420254202642027420284202942030420314203242033420344203542036420374203842039420404204142042420434204442045420464204742048420494205042051420524205342054420554205642057420584205942060420614206242063420644206542066420674206842069420704207142072420734207442075420764207742078420794208042081420824208342084420854208642087420884208942090420914209242093420944209542096420974209842099421004210142102421034210442105421064210742108421094211042111421124211342114421154211642117421184211942120421214212242123421244212542126421274212842129421304213142132421334213442135421364213742138421394214042141421424214342144421454214642147421484214942150421514215242153421544215542156421574215842159421604216142162421634216442165421664216742168421694217042171421724217342174421754217642177421784217942180421814218242183421844218542186421874218842189421904219142192421934219442195421964219742198421994220042201422024220342204422054220642207422084220942210422114221242213422144221542216422174221842219422204222142222422234222442225422264222742228422294223042231422324223342234422354223642237422384223942240422414224242243422444224542246422474224842249422504225142252422534225442255422564225742258422594226042261422624226342264422654226642267422684226942270422714227242273422744227542276422774227842279422804228142282422834228442285422864228742288422894229042291422924229342294422954229642297422984229942300423014230242303423044230542306423074230842309423104231142312423134231442315423164231742318423194232042321423224232342324423254232642327423284232942330423314233242333423344233542336423374233842339423404234142342423434234442345423464234742348423494235042351423524235342354423554235642357423584235942360423614236242363423644236542366423674236842369423704237142372423734237442375423764237742378423794238042381423824238342384423854238642387423884238942390423914239242393423944239542396423974239842399424004240142402424034240442405424064240742408424094241042411424124241342414424154241642417424184241942420424214242242423424244242542426424274242842429424304243142432424334243442435424364243742438424394244042441424424244342444424454244642447424484244942450424514245242453424544245542456424574245842459424604246142462424634246442465424664246742468424694247042471424724247342474424754247642477424784247942480424814248242483424844248542486424874248842489424904249142492424934249442495424964249742498424994250042501425024250342504425054250642507425084250942510425114251242513425144251542516425174251842519425204252142522425234252442525425264252742528425294253042531425324253342534425354253642537425384253942540425414254242543425444254542546425474254842549425504255142552425534255442555425564255742558425594256042561425624256342564425654256642567425684256942570425714257242573425744257542576425774257842579425804258142582425834258442585425864258742588425894259042591425924259342594425954259642597425984259942600426014260242603426044260542606426074260842609426104261142612426134261442615426164261742618426194262042621426224262342624426254262642627426284262942630426314263242633426344263542636426374263842639426404264142642426434264442645426464264742648426494265042651426524265342654426554265642657426584265942660426614266242663426644266542666426674266842669426704267142672426734267442675426764267742678426794268042681426824268342684426854268642687426884268942690426914269242693426944269542696426974269842699427004270142702427034270442705427064270742708427094271042711427124271342714427154271642717427184271942720427214272242723427244272542726427274272842729427304273142732427334273442735427364273742738427394274042741427424274342744427454274642747427484274942750427514275242753427544275542756427574275842759427604276142762427634276442765427664276742768427694277042771427724277342774427754277642777427784277942780427814278242783427844278542786427874278842789427904279142792427934279442795427964279742798427994280042801428024280342804428054280642807428084280942810428114281242813428144281542816428174281842819428204282142822428234282442825428264282742828428294283042831428324283342834428354283642837428384283942840428414284242843428444284542846428474284842849428504285142852428534285442855428564285742858428594286042861428624286342864428654286642867428684286942870428714287242873428744287542876428774287842879428804288142882428834288442885428864288742888428894289042891428924289342894428954289642897428984289942900429014290242903429044290542906429074290842909429104291142912429134291442915429164291742918429194292042921429224292342924429254292642927429284292942930429314293242933429344293542936429374293842939429404294142942429434294442945429464294742948429494295042951429524295342954429554295642957429584295942960429614296242963429644296542966429674296842969429704297142972429734297442975429764297742978429794298042981429824298342984429854298642987429884298942990429914299242993429944299542996429974299842999430004300143002430034300443005430064300743008430094301043011430124301343014430154301643017430184301943020430214302243023430244302543026430274302843029430304303143032430334303443035430364303743038430394304043041430424304343044430454304643047430484304943050430514305243053430544305543056430574305843059430604306143062430634306443065430664306743068430694307043071430724307343074430754307643077430784307943080430814308243083430844308543086430874308843089430904309143092430934309443095430964309743098430994310043101431024310343104431054310643107431084310943110431114311243113431144311543116431174311843119431204312143122431234312443125431264312743128431294313043131431324313343134431354313643137431384313943140431414314243143431444314543146431474314843149431504315143152431534315443155431564315743158431594316043161431624316343164431654316643167431684316943170431714317243173431744317543176431774317843179431804318143182431834318443185431864318743188431894319043191431924319343194431954319643197431984319943200432014320243203432044320543206432074320843209432104321143212432134321443215432164321743218432194322043221432224322343224432254322643227432284322943230432314323243233432344323543236432374323843239432404324143242432434324443245432464324743248432494325043251432524325343254432554325643257432584325943260432614326243263432644326543266432674326843269432704327143272432734327443275432764327743278432794328043281432824328343284432854328643287432884328943290432914329243293432944329543296432974329843299433004330143302433034330443305433064330743308433094331043311433124331343314433154331643317433184331943320433214332243323433244332543326433274332843329433304333143332433334333443335433364333743338433394334043341433424334343344433454334643347433484334943350433514335243353433544335543356433574335843359433604336143362433634336443365433664336743368433694337043371433724337343374433754337643377433784337943380433814338243383433844338543386433874338843389433904339143392433934339443395433964339743398433994340043401434024340343404434054340643407434084340943410434114341243413434144341543416434174341843419434204342143422434234342443425434264342743428434294343043431434324343343434434354343643437434384343943440434414344243443434444344543446434474344843449434504345143452434534345443455434564345743458434594346043461434624346343464434654346643467434684346943470434714347243473434744347543476434774347843479434804348143482434834348443485434864348743488434894349043491434924349343494434954349643497434984349943500435014350243503435044350543506435074350843509435104351143512435134351443515435164351743518435194352043521435224352343524435254352643527435284352943530435314353243533435344353543536435374353843539435404354143542435434354443545435464354743548435494355043551435524355343554435554355643557435584355943560435614356243563435644356543566435674356843569435704357143572435734357443575435764357743578435794358043581435824358343584435854358643587435884358943590435914359243593435944359543596435974359843599436004360143602436034360443605436064360743608436094361043611436124361343614436154361643617436184361943620436214362243623436244362543626436274362843629436304363143632436334363443635436364363743638436394364043641436424364343644436454364643647436484364943650436514365243653436544365543656436574365843659436604366143662436634366443665436664366743668436694367043671436724367343674436754367643677436784367943680436814368243683436844368543686436874368843689436904369143692436934369443695436964369743698436994370043701437024370343704437054370643707437084370943710437114371243713437144371543716437174371843719437204372143722437234372443725437264372743728437294373043731437324373343734437354373643737437384373943740437414374243743437444374543746437474374843749437504375143752437534375443755437564375743758437594376043761437624376343764437654376643767437684376943770437714377243773437744377543776437774377843779437804378143782437834378443785437864378743788437894379043791437924379343794437954379643797437984379943800438014380243803438044380543806438074380843809438104381143812438134381443815438164381743818438194382043821438224382343824438254382643827438284382943830438314383243833438344383543836438374383843839438404384143842438434384443845438464384743848438494385043851438524385343854438554385643857438584385943860438614386243863438644386543866438674386843869438704387143872438734387443875438764387743878438794388043881438824388343884438854388643887438884388943890438914389243893438944389543896438974389843899439004390143902439034390443905439064390743908439094391043911439124391343914439154391643917439184391943920439214392243923439244392543926439274392843929439304393143932439334393443935439364393743938439394394043941439424394343944439454394643947439484394943950439514395243953439544395543956439574395843959439604396143962439634396443965439664396743968439694397043971439724397343974439754397643977439784397943980439814398243983439844398543986439874398843989439904399143992439934399443995439964399743998439994400044001440024400344004440054400644007440084400944010440114401244013440144401544016440174401844019440204402144022440234402444025440264402744028440294403044031440324403344034440354403644037440384403944040440414404244043440444404544046440474404844049440504405144052440534405444055440564405744058440594406044061440624406344064440654406644067440684406944070440714407244073440744407544076440774407844079440804408144082440834408444085440864408744088440894409044091440924409344094440954409644097440984409944100441014410244103441044410544106441074410844109441104411144112441134411444115441164411744118441194412044121441224412344124441254412644127441284412944130441314413244133441344413544136441374413844139441404414144142441434414444145441464414744148441494415044151441524415344154441554415644157441584415944160441614416244163441644416544166441674416844169441704417144172441734417444175441764417744178441794418044181441824418344184441854418644187441884418944190441914419244193441944419544196441974419844199442004420144202442034420444205442064420744208442094421044211442124421344214442154421644217442184421944220442214422244223442244422544226442274422844229442304423144232442334423444235442364423744238442394424044241442424424344244442454424644247442484424944250442514425244253442544425544256442574425844259442604426144262442634426444265442664426744268442694427044271442724427344274442754427644277442784427944280442814428244283442844428544286442874428844289442904429144292442934429444295442964429744298442994430044301443024430344304443054430644307443084430944310443114431244313443144431544316443174431844319443204432144322443234432444325443264432744328443294433044331443324433344334443354433644337443384433944340443414434244343443444434544346443474434844349443504435144352443534435444355443564435744358443594436044361443624436344364443654436644367443684436944370443714437244373443744437544376443774437844379443804438144382443834438444385443864438744388443894439044391443924439344394443954439644397443984439944400444014440244403444044440544406444074440844409444104441144412444134441444415444164441744418444194442044421444224442344424444254442644427444284442944430444314443244433444344443544436444374443844439444404444144442444434444444445444464444744448444494445044451444524445344454444554445644457444584445944460444614446244463444644446544466444674446844469444704447144472444734447444475444764447744478444794448044481444824448344484444854448644487444884448944490444914449244493444944449544496444974449844499445004450144502445034450444505445064450744508445094451044511445124451344514445154451644517445184451944520445214452244523445244452544526445274452844529445304453144532445334453444535445364453744538445394454044541445424454344544445454454644547445484454944550445514455244553445544455544556445574455844559445604456144562445634456444565445664456744568445694457044571445724457344574445754457644577445784457944580445814458244583445844458544586445874458844589445904459144592445934459444595445964459744598445994460044601446024460344604446054460644607446084460944610446114461244613446144461544616446174461844619446204462144622446234462444625446264462744628446294463044631446324463344634446354463644637446384463944640446414464244643446444464544646446474464844649446504465144652446534465444655446564465744658446594466044661446624466344664446654466644667446684466944670446714467244673446744467544676446774467844679446804468144682446834468444685446864468744688446894469044691446924469344694446954469644697446984469944700447014470244703447044470544706447074470844709447104471144712447134471444715447164471744718447194472044721447224472344724447254472644727447284472944730447314473244733447344473544736447374473844739447404474144742447434474444745447464474744748447494475044751447524475344754447554475644757447584475944760447614476244763447644476544766447674476844769447704477144772447734477444775447764477744778447794478044781447824478344784447854478644787447884478944790447914479244793447944479544796447974479844799448004480144802448034480444805448064480744808448094481044811448124481344814448154481644817448184481944820448214482244823448244482544826448274482844829448304483144832448334483444835448364483744838448394484044841448424484344844448454484644847448484484944850448514485244853448544485544856448574485844859448604486144862448634486444865448664486744868448694487044871448724487344874448754487644877448784487944880448814488244883448844488544886448874488844889448904489144892448934489444895448964489744898448994490044901449024490344904449054490644907449084490944910449114491244913449144491544916449174491844919449204492144922449234492444925449264492744928449294493044931449324493344934449354493644937449384493944940449414494244943449444494544946449474494844949449504495144952449534495444955449564495744958449594496044961449624496344964449654496644967449684496944970449714497244973449744497544976449774497844979449804498144982449834498444985449864498744988449894499044991449924499344994449954499644997449984499945000450014500245003450044500545006450074500845009450104501145012450134501445015450164501745018450194502045021450224502345024450254502645027450284502945030450314503245033450344503545036450374503845039450404504145042450434504445045450464504745048450494505045051450524505345054450554505645057450584505945060450614506245063450644506545066450674506845069450704507145072450734507445075450764507745078450794508045081450824508345084450854508645087450884508945090450914509245093450944509545096450974509845099451004510145102451034510445105451064510745108451094511045111451124511345114451154511645117451184511945120451214512245123451244512545126451274512845129451304513145132451334513445135451364513745138451394514045141451424514345144451454514645147451484514945150451514515245153451544515545156451574515845159451604516145162451634516445165451664516745168451694517045171451724517345174451754517645177451784517945180451814518245183451844518545186451874518845189451904519145192451934519445195451964519745198451994520045201452024520345204452054520645207452084520945210452114521245213452144521545216452174521845219452204522145222452234522445225452264522745228452294523045231452324523345234452354523645237452384523945240452414524245243452444524545246452474524845249452504525145252452534525445255452564525745258452594526045261452624526345264452654526645267452684526945270452714527245273452744527545276452774527845279452804528145282452834528445285452864528745288452894529045291452924529345294452954529645297452984529945300453014530245303453044530545306453074530845309453104531145312453134531445315453164531745318453194532045321453224532345324453254532645327453284532945330453314533245333453344533545336453374533845339453404534145342453434534445345453464534745348453494535045351453524535345354453554535645357453584535945360453614536245363453644536545366453674536845369453704537145372453734537445375453764537745378453794538045381453824538345384453854538645387453884538945390453914539245393453944539545396453974539845399454004540145402454034540445405454064540745408454094541045411454124541345414454154541645417454184541945420454214542245423454244542545426454274542845429454304543145432454334543445435454364543745438454394544045441454424544345444454454544645447454484544945450454514545245453454544545545456454574545845459454604546145462454634546445465454664546745468454694547045471454724547345474454754547645477454784547945480454814548245483454844548545486454874548845489454904549145492454934549445495454964549745498454994550045501455024550345504455054550645507455084550945510455114551245513455144551545516455174551845519455204552145522455234552445525455264552745528455294553045531455324553345534455354553645537455384553945540455414554245543455444554545546455474554845549455504555145552455534555445555455564555745558455594556045561455624556345564455654556645567455684556945570455714557245573455744557545576455774557845579455804558145582455834558445585455864558745588455894559045591455924559345594455954559645597455984559945600456014560245603456044560545606456074560845609456104561145612456134561445615456164561745618456194562045621456224562345624456254562645627456284562945630456314563245633456344563545636456374563845639456404564145642456434564445645456464564745648456494565045651456524565345654456554565645657456584565945660456614566245663456644566545666456674566845669456704567145672456734567445675456764567745678456794568045681456824568345684456854568645687456884568945690456914569245693456944569545696456974569845699457004570145702457034570445705457064570745708457094571045711457124571345714457154571645717457184571945720457214572245723457244572545726457274572845729457304573145732457334573445735457364573745738457394574045741457424574345744457454574645747457484574945750457514575245753457544575545756457574575845759457604576145762457634576445765457664576745768457694577045771457724577345774457754577645777457784577945780457814578245783457844578545786457874578845789457904579145792457934579445795457964579745798457994580045801458024580345804458054580645807458084580945810458114581245813458144581545816458174581845819458204582145822458234582445825458264582745828458294583045831458324583345834458354583645837458384583945840458414584245843458444584545846458474584845849458504585145852458534585445855458564585745858458594586045861458624586345864458654586645867458684586945870458714587245873458744587545876458774587845879458804588145882458834588445885458864588745888458894589045891458924589345894458954589645897458984589945900459014590245903459044590545906459074590845909459104591145912459134591445915459164591745918459194592045921459224592345924459254592645927459284592945930459314593245933459344593545936459374593845939459404594145942459434594445945459464594745948459494595045951459524595345954459554595645957459584595945960459614596245963459644596545966459674596845969459704597145972459734597445975459764597745978459794598045981459824598345984459854598645987459884598945990459914599245993459944599545996459974599845999460004600146002460034600446005460064600746008460094601046011460124601346014460154601646017460184601946020460214602246023460244602546026460274602846029460304603146032460334603446035460364603746038460394604046041460424604346044460454604646047460484604946050460514605246053460544605546056460574605846059460604606146062460634606446065460664606746068460694607046071460724607346074460754607646077460784607946080460814608246083460844608546086460874608846089460904609146092460934609446095460964609746098460994610046101461024610346104461054610646107461084610946110461114611246113461144611546116461174611846119461204612146122461234612446125461264612746128461294613046131461324613346134461354613646137461384613946140461414614246143461444614546146461474614846149461504615146152461534615446155461564615746158461594616046161461624616346164461654616646167461684616946170461714617246173461744617546176461774617846179461804618146182461834618446185461864618746188461894619046191461924619346194461954619646197461984619946200462014620246203462044620546206462074620846209462104621146212462134621446215462164621746218462194622046221462224622346224462254622646227462284622946230462314623246233462344623546236462374623846239462404624146242462434624446245462464624746248462494625046251462524625346254462554625646257462584625946260462614626246263462644626546266462674626846269462704627146272462734627446275462764627746278462794628046281462824628346284462854628646287462884628946290462914629246293462944629546296462974629846299463004630146302463034630446305463064630746308463094631046311463124631346314463154631646317463184631946320463214632246323463244632546326463274632846329463304633146332463334633446335463364633746338463394634046341463424634346344463454634646347463484634946350463514635246353463544635546356463574635846359463604636146362463634636446365463664636746368463694637046371463724637346374463754637646377463784637946380463814638246383463844638546386463874638846389463904639146392463934639446395463964639746398463994640046401464024640346404464054640646407464084640946410464114641246413464144641546416464174641846419464204642146422464234642446425464264642746428464294643046431464324643346434464354643646437464384643946440464414644246443464444644546446464474644846449464504645146452464534645446455464564645746458464594646046461464624646346464464654646646467464684646946470464714647246473464744647546476464774647846479464804648146482464834648446485464864648746488464894649046491464924649346494464954649646497464984649946500465014650246503465044650546506465074650846509465104651146512465134651446515465164651746518465194652046521465224652346524465254652646527465284652946530465314653246533465344653546536465374653846539465404654146542465434654446545465464654746548465494655046551465524655346554465554655646557465584655946560465614656246563465644656546566465674656846569465704657146572465734657446575465764657746578465794658046581465824658346584465854658646587465884658946590465914659246593465944659546596465974659846599466004660146602466034660446605466064660746608466094661046611466124661346614466154661646617466184661946620466214662246623466244662546626466274662846629466304663146632466334663446635466364663746638466394664046641466424664346644466454664646647466484664946650466514665246653466544665546656466574665846659466604666146662466634666446665466664666746668466694667046671466724667346674466754667646677466784667946680466814668246683466844668546686466874668846689466904669146692466934669446695466964669746698466994670046701467024670346704467054670646707467084670946710467114671246713467144671546716467174671846719467204672146722467234672446725467264672746728467294673046731467324673346734467354673646737467384673946740467414674246743467444674546746467474674846749467504675146752467534675446755467564675746758467594676046761467624676346764467654676646767467684676946770467714677246773467744677546776467774677846779467804678146782467834678446785467864678746788467894679046791467924679346794467954679646797467984679946800468014680246803468044680546806468074680846809468104681146812468134681446815468164681746818468194682046821468224682346824468254682646827468284682946830468314683246833468344683546836468374683846839468404684146842468434684446845468464684746848468494685046851468524685346854468554685646857468584685946860468614686246863468644686546866468674686846869468704687146872468734687446875468764687746878468794688046881468824688346884468854688646887468884688946890468914689246893468944689546896468974689846899469004690146902469034690446905469064690746908469094691046911469124691346914469154691646917469184691946920469214692246923469244692546926469274692846929469304693146932469334693446935469364693746938469394694046941469424694346944469454694646947469484694946950469514695246953469544695546956469574695846959469604696146962469634696446965469664696746968469694697046971469724697346974469754697646977469784697946980469814698246983469844698546986469874698846989469904699146992469934699446995469964699746998469994700047001470024700347004470054700647007470084700947010470114701247013470144701547016470174701847019470204702147022470234702447025470264702747028470294703047031470324703347034470354703647037470384703947040470414704247043470444704547046470474704847049470504705147052470534705447055470564705747058470594706047061470624706347064470654706647067470684706947070470714707247073470744707547076470774707847079470804708147082470834708447085470864708747088470894709047091470924709347094470954709647097470984709947100471014710247103471044710547106471074710847109471104711147112471134711447115471164711747118471194712047121471224712347124471254712647127471284712947130471314713247133471344713547136471374713847139471404714147142471434714447145471464714747148471494715047151471524715347154471554715647157471584715947160471614716247163471644716547166471674716847169471704717147172471734717447175471764717747178471794718047181471824718347184471854718647187471884718947190471914719247193471944719547196471974719847199472004720147202472034720447205472064720747208472094721047211472124721347214472154721647217472184721947220472214722247223472244722547226472274722847229472304723147232472334723447235472364723747238472394724047241472424724347244472454724647247472484724947250472514725247253472544725547256472574725847259472604726147262472634726447265472664726747268472694727047271472724727347274472754727647277472784727947280472814728247283472844728547286472874728847289472904729147292472934729447295472964729747298472994730047301473024730347304473054730647307473084730947310473114731247313473144731547316473174731847319473204732147322473234732447325473264732747328473294733047331473324733347334473354733647337473384733947340473414734247343473444734547346473474734847349473504735147352473534735447355473564735747358473594736047361473624736347364473654736647367473684736947370473714737247373473744737547376473774737847379473804738147382473834738447385473864738747388473894739047391473924739347394473954739647397473984739947400474014740247403474044740547406474074740847409474104741147412474134741447415474164741747418474194742047421474224742347424474254742647427474284742947430474314743247433474344743547436474374743847439474404744147442474434744447445474464744747448474494745047451474524745347454474554745647457474584745947460474614746247463474644746547466474674746847469474704747147472474734747447475474764747747478474794748047481474824748347484474854748647487474884748947490474914749247493474944749547496474974749847499475004750147502475034750447505475064750747508475094751047511475124751347514475154751647517475184751947520475214752247523475244752547526475274752847529475304753147532475334753447535475364753747538475394754047541475424754347544475454754647547475484754947550475514755247553475544755547556475574755847559475604756147562475634756447565475664756747568475694757047571475724757347574475754757647577475784757947580475814758247583475844758547586475874758847589475904759147592475934759447595475964759747598475994760047601476024760347604476054760647607476084760947610476114761247613476144761547616476174761847619476204762147622476234762447625476264762747628476294763047631476324763347634476354763647637476384763947640476414764247643476444764547646476474764847649476504765147652476534765447655476564765747658476594766047661476624766347664476654766647667476684766947670476714767247673476744767547676476774767847679476804768147682476834768447685476864768747688476894769047691476924769347694476954769647697476984769947700477014770247703477044770547706477074770847709477104771147712477134771447715477164771747718477194772047721477224772347724477254772647727477284772947730477314773247733477344773547736477374773847739477404774147742477434774447745477464774747748477494775047751477524775347754477554775647757477584775947760477614776247763477644776547766477674776847769477704777147772477734777447775477764777747778477794778047781477824778347784477854778647787477884778947790477914779247793477944779547796477974779847799478004780147802478034780447805478064780747808478094781047811478124781347814478154781647817478184781947820478214782247823478244782547826478274782847829478304783147832478334783447835478364783747838478394784047841478424784347844478454784647847478484784947850478514785247853478544785547856478574785847859478604786147862478634786447865478664786747868478694787047871478724787347874478754787647877478784787947880478814788247883478844788547886478874788847889478904789147892478934789447895478964789747898478994790047901479024790347904479054790647907479084790947910479114791247913479144791547916479174791847919479204792147922479234792447925479264792747928479294793047931479324793347934479354793647937479384793947940479414794247943479444794547946479474794847949479504795147952479534795447955479564795747958479594796047961479624796347964479654796647967479684796947970479714797247973479744797547976479774797847979479804798147982479834798447985479864798747988479894799047991479924799347994479954799647997479984799948000480014800248003480044800548006480074800848009480104801148012480134801448015480164801748018480194802048021480224802348024480254802648027480284802948030480314803248033480344803548036480374803848039480404804148042480434804448045480464804748048480494805048051480524805348054480554805648057480584805948060480614806248063480644806548066480674806848069480704807148072480734807448075480764807748078480794808048081480824808348084480854808648087480884808948090480914809248093480944809548096480974809848099481004810148102481034810448105481064810748108481094811048111481124811348114481154811648117481184811948120481214812248123481244812548126481274812848129481304813148132481334813448135481364813748138481394814048141481424814348144481454814648147481484814948150481514815248153481544815548156481574815848159481604816148162481634816448165481664816748168481694817048171481724817348174481754817648177481784817948180481814818248183481844818548186481874818848189481904819148192481934819448195481964819748198481994820048201482024820348204482054820648207482084820948210482114821248213482144821548216482174821848219482204822148222482234822448225482264822748228482294823048231482324823348234482354823648237482384823948240482414824248243482444824548246482474824848249482504825148252482534825448255482564825748258482594826048261482624826348264482654826648267482684826948270482714827248273482744827548276482774827848279482804828148282482834828448285482864828748288482894829048291482924829348294482954829648297482984829948300483014830248303483044830548306483074830848309483104831148312483134831448315483164831748318483194832048321483224832348324483254832648327483284832948330483314833248333483344833548336483374833848339483404834148342483434834448345483464834748348483494835048351483524835348354483554835648357483584835948360483614836248363483644836548366483674836848369483704837148372483734837448375483764837748378483794838048381483824838348384483854838648387483884838948390483914839248393483944839548396483974839848399484004840148402484034840448405484064840748408484094841048411484124841348414484154841648417484184841948420484214842248423484244842548426484274842848429484304843148432484334843448435484364843748438484394844048441484424844348444484454844648447484484844948450484514845248453484544845548456484574845848459484604846148462484634846448465484664846748468484694847048471484724847348474484754847648477484784847948480484814848248483484844848548486484874848848489484904849148492484934849448495484964849748498484994850048501485024850348504485054850648507485084850948510485114851248513485144851548516485174851848519485204852148522485234852448525485264852748528485294853048531485324853348534485354853648537485384853948540485414854248543485444854548546485474854848549485504855148552485534855448555485564855748558485594856048561485624856348564485654856648567485684856948570485714857248573485744857548576485774857848579485804858148582485834858448585485864858748588485894859048591485924859348594485954859648597485984859948600486014860248603486044860548606486074860848609486104861148612486134861448615486164861748618486194862048621486224862348624486254862648627486284862948630486314863248633486344863548636486374863848639486404864148642486434864448645486464864748648486494865048651486524865348654486554865648657486584865948660486614866248663486644866548666486674866848669486704867148672486734867448675486764867748678486794868048681486824868348684486854868648687486884868948690486914869248693486944869548696486974869848699487004870148702487034870448705487064870748708487094871048711487124871348714487154871648717487184871948720487214872248723487244872548726487274872848729487304873148732487334873448735487364873748738487394874048741487424874348744487454874648747487484874948750487514875248753487544875548756487574875848759487604876148762487634876448765487664876748768487694877048771487724877348774487754877648777487784877948780487814878248783487844878548786487874878848789487904879148792487934879448795487964879748798487994880048801488024880348804488054880648807488084880948810488114881248813488144881548816488174881848819488204882148822488234882448825488264882748828488294883048831488324883348834488354883648837488384883948840488414884248843488444884548846488474884848849488504885148852488534885448855488564885748858488594886048861488624886348864488654886648867488684886948870488714887248873488744887548876488774887848879488804888148882488834888448885488864888748888488894889048891488924889348894488954889648897488984889948900489014890248903489044890548906489074890848909489104891148912489134891448915489164891748918489194892048921489224892348924489254892648927489284892948930489314893248933489344893548936489374893848939489404894148942489434894448945489464894748948489494895048951489524895348954489554895648957489584895948960489614896248963489644896548966489674896848969489704897148972489734897448975489764897748978489794898048981489824898348984489854898648987489884898948990489914899248993489944899548996489974899848999490004900149002490034900449005490064900749008490094901049011490124901349014490154901649017490184901949020490214902249023490244902549026490274902849029490304903149032490334903449035490364903749038490394904049041490424904349044490454904649047490484904949050490514905249053490544905549056490574905849059490604906149062490634906449065490664906749068490694907049071490724907349074490754907649077490784907949080490814908249083490844908549086490874908849089490904909149092490934909449095490964909749098490994910049101491024910349104491054910649107491084910949110491114911249113491144911549116491174911849119491204912149122491234912449125491264912749128491294913049131491324913349134491354913649137491384913949140491414914249143491444914549146491474914849149491504915149152491534915449155491564915749158491594916049161491624916349164491654916649167491684916949170491714917249173491744917549176491774917849179491804918149182491834918449185491864918749188491894919049191491924919349194491954919649197491984919949200492014920249203492044920549206492074920849209492104921149212492134921449215492164921749218492194922049221492224922349224492254922649227492284922949230492314923249233492344923549236492374923849239492404924149242492434924449245492464924749248492494925049251492524925349254492554925649257492584925949260492614926249263492644926549266492674926849269492704927149272492734927449275492764927749278492794928049281492824928349284492854928649287492884928949290492914929249293492944929549296492974929849299493004930149302493034930449305493064930749308493094931049311493124931349314493154931649317493184931949320493214932249323493244932549326493274932849329493304933149332493334933449335493364933749338493394934049341493424934349344493454934649347493484934949350493514935249353493544935549356493574935849359493604936149362493634936449365493664936749368493694937049371493724937349374493754937649377493784937949380493814938249383493844938549386493874938849389493904939149392493934939449395493964939749398493994940049401494024940349404494054940649407494084940949410494114941249413494144941549416494174941849419494204942149422494234942449425494264942749428494294943049431494324943349434494354943649437494384943949440494414944249443494444944549446494474944849449494504945149452494534945449455494564945749458494594946049461494624946349464494654946649467494684946949470494714947249473494744947549476494774947849479494804948149482494834948449485494864948749488494894949049491494924949349494494954949649497494984949949500495014950249503495044950549506495074950849509495104951149512495134951449515495164951749518495194952049521495224952349524495254952649527495284952949530495314953249533495344953549536495374953849539495404954149542495434954449545495464954749548495494955049551495524955349554495554955649557495584955949560495614956249563495644956549566495674956849569495704957149572495734957449575495764957749578495794958049581495824958349584495854958649587495884958949590495914959249593495944959549596495974959849599496004960149602496034960449605496064960749608496094961049611496124961349614496154961649617496184961949620496214962249623496244962549626496274962849629496304963149632496334963449635496364963749638496394964049641496424964349644496454964649647496484964949650496514965249653496544965549656496574965849659496604966149662496634966449665496664966749668496694967049671496724967349674496754967649677496784967949680496814968249683496844968549686496874968849689496904969149692496934969449695496964969749698496994970049701497024970349704497054970649707497084970949710497114971249713497144971549716497174971849719497204972149722497234972449725497264972749728497294973049731497324973349734497354973649737497384973949740497414974249743497444974549746497474974849749497504975149752497534975449755497564975749758497594976049761497624976349764497654976649767497684976949770497714977249773497744977549776497774977849779497804978149782497834978449785497864978749788497894979049791497924979349794497954979649797497984979949800498014980249803498044980549806498074980849809498104981149812498134981449815498164981749818498194982049821498224982349824498254982649827498284982949830498314983249833498344983549836498374983849839498404984149842498434984449845498464984749848498494985049851498524985349854498554985649857498584985949860498614986249863498644986549866498674986849869498704987149872498734987449875498764987749878498794988049881498824988349884498854988649887498884988949890498914989249893498944989549896498974989849899499004990149902499034990449905499064990749908499094991049911499124991349914499154991649917499184991949920499214992249923499244992549926499274992849929499304993149932499334993449935499364993749938499394994049941499424994349944499454994649947499484994949950499514995249953499544995549956499574995849959499604996149962499634996449965499664996749968499694997049971499724997349974499754997649977499784997949980499814998249983499844998549986499874998849989499904999149992499934999449995499964999749998499995000050001500025000350004500055000650007500085000950010500115001250013500145001550016500175001850019500205002150022500235002450025500265002750028500295003050031500325003350034500355003650037500385003950040500415004250043500445004550046500475004850049500505005150052500535005450055500565005750058500595006050061500625006350064500655006650067500685006950070500715007250073500745007550076500775007850079500805008150082500835008450085500865008750088500895009050091500925009350094500955009650097500985009950100501015010250103501045010550106501075010850109501105011150112501135011450115501165011750118501195012050121501225012350124501255012650127501285012950130501315013250133501345013550136501375013850139501405014150142501435014450145501465014750148501495015050151501525015350154501555015650157501585015950160501615016250163501645016550166501675016850169501705017150172501735017450175501765017750178501795018050181501825018350184501855018650187501885018950190501915019250193501945019550196501975019850199502005020150202502035020450205502065020750208502095021050211502125021350214502155021650217502185021950220502215022250223502245022550226502275022850229502305023150232502335023450235502365023750238502395024050241502425024350244502455024650247502485024950250502515025250253502545025550256502575025850259502605026150262502635026450265502665026750268502695027050271502725027350274502755027650277502785027950280502815028250283502845028550286502875028850289502905029150292502935029450295502965029750298502995030050301503025030350304503055030650307503085030950310503115031250313503145031550316503175031850319503205032150322503235032450325503265032750328503295033050331503325033350334503355033650337503385033950340503415034250343503445034550346503475034850349503505035150352503535035450355503565035750358503595036050361503625036350364503655036650367503685036950370503715037250373503745037550376503775037850379503805038150382503835038450385503865038750388503895039050391503925039350394503955039650397503985039950400504015040250403504045040550406504075040850409504105041150412504135041450415504165041750418504195042050421504225042350424504255042650427504285042950430504315043250433504345043550436504375043850439504405044150442504435044450445504465044750448504495045050451504525045350454504555045650457504585045950460504615046250463504645046550466504675046850469504705047150472504735047450475504765047750478504795048050481504825048350484504855048650487504885048950490504915049250493504945049550496504975049850499505005050150502505035050450505505065050750508505095051050511505125051350514505155051650517505185051950520505215052250523505245052550526505275052850529505305053150532505335053450535505365053750538505395054050541505425054350544505455054650547505485054950550505515055250553505545055550556505575055850559505605056150562505635056450565505665056750568505695057050571505725057350574505755057650577505785057950580505815058250583505845058550586505875058850589505905059150592505935059450595505965059750598505995060050601506025060350604506055060650607506085060950610506115061250613506145061550616506175061850619506205062150622506235062450625506265062750628506295063050631506325063350634506355063650637506385063950640506415064250643506445064550646506475064850649506505065150652506535065450655506565065750658506595066050661506625066350664506655066650667506685066950670506715067250673506745067550676506775067850679506805068150682506835068450685506865068750688506895069050691506925069350694506955069650697506985069950700507015070250703507045070550706507075070850709507105071150712507135071450715507165071750718507195072050721507225072350724507255072650727507285072950730507315073250733507345073550736507375073850739507405074150742507435074450745507465074750748507495075050751507525075350754507555075650757507585075950760507615076250763507645076550766507675076850769507705077150772507735077450775507765077750778507795078050781507825078350784507855078650787507885078950790507915079250793507945079550796507975079850799508005080150802508035080450805508065080750808508095081050811508125081350814508155081650817508185081950820508215082250823508245082550826508275082850829508305083150832508335083450835508365083750838508395084050841508425084350844508455084650847508485084950850508515085250853508545085550856508575085850859508605086150862508635086450865508665086750868508695087050871508725087350874508755087650877508785087950880508815088250883508845088550886508875088850889508905089150892508935089450895508965089750898508995090050901509025090350904509055090650907509085090950910509115091250913509145091550916509175091850919509205092150922509235092450925509265092750928509295093050931509325093350934509355093650937509385093950940509415094250943509445094550946509475094850949509505095150952509535095450955509565095750958509595096050961509625096350964509655096650967509685096950970509715097250973509745097550976509775097850979509805098150982509835098450985509865098750988509895099050991509925099350994509955099650997509985099951000510015100251003510045100551006510075100851009510105101151012510135101451015510165101751018510195102051021510225102351024510255102651027510285102951030510315103251033510345103551036510375103851039510405104151042510435104451045510465104751048510495105051051510525105351054510555105651057510585105951060510615106251063510645106551066510675106851069510705107151072510735107451075510765107751078510795108051081510825108351084510855108651087510885108951090510915109251093510945109551096510975109851099511005110151102511035110451105511065110751108511095111051111511125111351114511155111651117511185111951120511215112251123511245112551126511275112851129511305113151132511335113451135511365113751138511395114051141511425114351144511455114651147511485114951150511515115251153511545115551156511575115851159511605116151162511635116451165511665116751168511695117051171511725117351174511755117651177511785117951180511815118251183511845118551186511875118851189511905119151192511935119451195511965119751198511995120051201512025120351204512055120651207512085120951210512115121251213512145121551216512175121851219512205122151222512235122451225512265122751228512295123051231512325123351234512355123651237512385123951240512415124251243512445124551246512475124851249512505125151252512535125451255512565125751258512595126051261512625126351264512655126651267512685126951270512715127251273512745127551276512775127851279512805128151282512835128451285512865128751288512895129051291512925129351294512955129651297512985129951300513015130251303513045130551306513075130851309513105131151312513135131451315513165131751318513195132051321513225132351324513255132651327513285132951330513315133251333513345133551336513375133851339513405134151342513435134451345513465134751348513495135051351513525135351354513555135651357513585135951360513615136251363513645136551366513675136851369513705137151372513735137451375513765137751378513795138051381513825138351384513855138651387513885138951390513915139251393513945139551396513975139851399514005140151402514035140451405514065140751408514095141051411514125141351414514155141651417514185141951420514215142251423514245142551426514275142851429514305143151432514335143451435514365143751438514395144051441514425144351444514455144651447514485144951450514515145251453514545145551456514575145851459514605146151462514635146451465514665146751468514695147051471514725147351474514755147651477514785147951480514815148251483514845148551486514875148851489514905149151492514935149451495514965149751498514995150051501515025150351504515055150651507515085150951510515115151251513515145151551516515175151851519515205152151522515235152451525515265152751528515295153051531515325153351534515355153651537515385153951540515415154251543515445154551546515475154851549515505155151552515535155451555515565155751558515595156051561515625156351564515655156651567515685156951570515715157251573515745157551576515775157851579515805158151582515835158451585515865158751588515895159051591515925159351594515955159651597515985159951600516015160251603516045160551606516075160851609516105161151612516135161451615516165161751618516195162051621516225162351624516255162651627516285162951630516315163251633516345163551636516375163851639516405164151642516435164451645516465164751648516495165051651516525165351654516555165651657516585165951660516615166251663516645166551666516675166851669516705167151672516735167451675516765167751678516795168051681516825168351684516855168651687516885168951690516915169251693516945169551696516975169851699517005170151702517035170451705517065170751708517095171051711517125171351714517155171651717517185171951720517215172251723517245172551726517275172851729517305173151732517335173451735517365173751738517395174051741517425174351744517455174651747517485174951750517515175251753517545175551756517575175851759517605176151762517635176451765517665176751768517695177051771517725177351774517755177651777517785177951780517815178251783517845178551786517875178851789517905179151792517935179451795517965179751798517995180051801518025180351804518055180651807518085180951810518115181251813518145181551816518175181851819518205182151822518235182451825518265182751828518295183051831518325183351834518355183651837518385183951840518415184251843518445184551846518475184851849518505185151852518535185451855518565185751858518595186051861518625186351864518655186651867518685186951870518715187251873518745187551876518775187851879518805188151882518835188451885518865188751888518895189051891518925189351894518955189651897518985189951900519015190251903519045190551906519075190851909519105191151912519135191451915519165191751918519195192051921519225192351924519255192651927519285192951930519315193251933519345193551936519375193851939519405194151942519435194451945519465194751948519495195051951519525195351954519555195651957519585195951960519615196251963519645196551966519675196851969519705197151972519735197451975519765197751978519795198051981519825198351984519855198651987519885198951990519915199251993519945199551996519975199851999520005200152002520035200452005520065200752008520095201052011520125201352014520155201652017520185201952020520215202252023520245202552026520275202852029520305203152032520335203452035520365203752038520395204052041520425204352044520455204652047520485204952050520515205252053520545205552056520575205852059520605206152062520635206452065520665206752068520695207052071520725207352074520755207652077520785207952080520815208252083520845208552086520875208852089520905209152092520935209452095520965209752098520995210052101521025210352104521055210652107521085210952110521115211252113521145211552116521175211852119521205212152122521235212452125521265212752128521295213052131521325213352134521355213652137521385213952140521415214252143521445214552146521475214852149521505215152152521535215452155521565215752158521595216052161521625216352164521655216652167521685216952170521715217252173521745217552176521775217852179521805218152182521835218452185521865218752188521895219052191521925219352194521955219652197521985219952200522015220252203522045220552206522075220852209522105221152212522135221452215522165221752218522195222052221522225222352224522255222652227522285222952230522315223252233522345223552236522375223852239522405224152242522435224452245522465224752248522495225052251522525225352254522555225652257522585225952260522615226252263522645226552266522675226852269522705227152272522735227452275522765227752278522795228052281522825228352284522855228652287522885228952290522915229252293522945229552296522975229852299523005230152302523035230452305523065230752308523095231052311523125231352314523155231652317523185231952320523215232252323523245232552326523275232852329523305233152332523335233452335523365233752338523395234052341523425234352344523455234652347523485234952350523515235252353523545235552356523575235852359523605236152362523635236452365523665236752368523695237052371523725237352374523755237652377523785237952380523815238252383523845238552386523875238852389523905239152392523935239452395523965239752398523995240052401524025240352404524055240652407524085240952410524115241252413524145241552416524175241852419524205242152422524235242452425524265242752428524295243052431524325243352434524355243652437524385243952440524415244252443524445244552446524475244852449524505245152452524535245452455524565245752458524595246052461524625246352464524655246652467524685246952470524715247252473524745247552476524775247852479524805248152482524835248452485524865248752488524895249052491524925249352494524955249652497524985249952500525015250252503525045250552506525075250852509525105251152512525135251452515525165251752518525195252052521525225252352524525255252652527525285252952530525315253252533525345253552536525375253852539525405254152542525435254452545525465254752548525495255052551525525255352554525555255652557525585255952560525615256252563525645256552566525675256852569525705257152572525735257452575525765257752578525795258052581525825258352584525855258652587525885258952590525915259252593525945259552596525975259852599526005260152602526035260452605526065260752608526095261052611526125261352614526155261652617526185261952620526215262252623526245262552626526275262852629526305263152632526335263452635526365263752638526395264052641526425264352644526455264652647526485264952650526515265252653526545265552656526575265852659526605266152662526635266452665526665266752668526695267052671526725267352674526755267652677526785267952680526815268252683526845268552686526875268852689526905269152692526935269452695526965269752698526995270052701527025270352704527055270652707527085270952710527115271252713527145271552716527175271852719527205272152722527235272452725527265272752728527295273052731527325273352734527355273652737527385273952740527415274252743527445274552746527475274852749527505275152752527535275452755527565275752758527595276052761527625276352764527655276652767527685276952770527715277252773527745277552776527775277852779527805278152782527835278452785527865278752788527895279052791527925279352794527955279652797527985279952800528015280252803528045280552806528075280852809528105281152812528135281452815528165281752818528195282052821528225282352824528255282652827528285282952830528315283252833528345283552836528375283852839528405284152842528435284452845528465284752848528495285052851528525285352854528555285652857528585285952860528615286252863528645286552866528675286852869528705287152872528735287452875528765287752878528795288052881528825288352884528855288652887528885288952890528915289252893528945289552896528975289852899529005290152902529035290452905529065290752908529095291052911529125291352914529155291652917529185291952920529215292252923529245292552926529275292852929529305293152932529335293452935529365293752938529395294052941529425294352944529455294652947529485294952950529515295252953529545295552956529575295852959529605296152962529635296452965529665296752968529695297052971529725297352974529755297652977529785297952980529815298252983529845298552986529875298852989529905299152992529935299452995529965299752998529995300053001530025300353004530055300653007530085300953010530115301253013530145301553016530175301853019530205302153022530235302453025530265302753028530295303053031530325303353034530355303653037530385303953040530415304253043530445304553046530475304853049530505305153052530535305453055530565305753058530595306053061530625306353064530655306653067530685306953070530715307253073530745307553076530775307853079530805308153082530835308453085530865308753088530895309053091530925309353094530955309653097530985309953100531015310253103531045310553106531075310853109531105311153112531135311453115531165311753118531195312053121531225312353124531255312653127531285312953130531315313253133531345313553136531375313853139531405314153142531435314453145531465314753148531495315053151531525315353154531555315653157531585315953160531615316253163531645316553166531675316853169531705317153172531735317453175531765317753178531795318053181531825318353184531855318653187531885318953190531915319253193531945319553196531975319853199532005320153202532035320453205532065320753208532095321053211532125321353214532155321653217532185321953220532215322253223532245322553226532275322853229532305323153232532335323453235532365323753238532395324053241532425324353244532455324653247532485324953250532515325253253532545325553256532575325853259532605326153262532635326453265532665326753268532695327053271532725327353274532755327653277532785327953280532815328253283532845328553286532875328853289532905329153292532935329453295532965329753298532995330053301533025330353304533055330653307533085330953310533115331253313533145331553316533175331853319533205332153322533235332453325533265332753328533295333053331533325333353334533355333653337533385333953340533415334253343533445334553346533475334853349533505335153352533535335453355533565335753358533595336053361533625336353364533655336653367533685336953370533715337253373533745337553376533775337853379533805338153382533835338453385533865338753388533895339053391533925339353394533955339653397533985339953400534015340253403534045340553406534075340853409534105341153412534135341453415534165341753418534195342053421534225342353424534255342653427534285342953430534315343253433534345343553436534375343853439534405344153442534435344453445534465344753448534495345053451534525345353454534555345653457534585345953460534615346253463534645346553466534675346853469534705347153472534735347453475534765347753478534795348053481534825348353484534855348653487534885348953490534915349253493534945349553496534975349853499535005350153502535035350453505535065350753508535095351053511535125351353514535155351653517535185351953520535215352253523535245352553526535275352853529535305353153532535335353453535535365353753538535395354053541535425354353544535455354653547535485354953550535515355253553535545355553556535575355853559535605356153562535635356453565535665356753568535695357053571535725357353574535755357653577535785357953580535815358253583535845358553586535875358853589535905359153592535935359453595535965359753598535995360053601536025360353604536055360653607536085360953610536115361253613536145361553616536175361853619536205362153622536235362453625536265362753628536295363053631536325363353634536355363653637536385363953640536415364253643536445364553646536475364853649536505365153652536535365453655536565365753658536595366053661536625366353664536655366653667536685366953670536715367253673536745367553676536775367853679536805368153682536835368453685536865368753688536895369053691536925369353694536955369653697536985369953700537015370253703537045370553706537075370853709537105371153712537135371453715537165371753718537195372053721537225372353724537255372653727537285372953730537315373253733537345373553736537375373853739537405374153742537435374453745537465374753748537495375053751537525375353754537555375653757537585375953760537615376253763537645376553766537675376853769537705377153772537735377453775537765377753778537795378053781537825378353784537855378653787537885378953790537915379253793537945379553796537975379853799538005380153802538035380453805538065380753808538095381053811538125381353814538155381653817538185381953820538215382253823538245382553826538275382853829538305383153832538335383453835538365383753838538395384053841538425384353844538455384653847538485384953850538515385253853538545385553856538575385853859538605386153862538635386453865538665386753868538695387053871538725387353874538755387653877538785387953880538815388253883538845388553886538875388853889538905389153892538935389453895538965389753898538995390053901539025390353904539055390653907539085390953910539115391253913539145391553916539175391853919539205392153922539235392453925539265392753928539295393053931539325393353934539355393653937539385393953940539415394253943539445394553946539475394853949539505395153952539535395453955539565395753958539595396053961539625396353964539655396653967539685396953970539715397253973539745397553976539775397853979539805398153982539835398453985539865398753988539895399053991539925399353994539955399653997539985399954000540015400254003540045400554006540075400854009540105401154012540135401454015540165401754018540195402054021540225402354024540255402654027540285402954030540315403254033540345403554036540375403854039540405404154042540435404454045540465404754048540495405054051540525405354054540555405654057540585405954060540615406254063540645406554066540675406854069540705407154072540735407454075540765407754078540795408054081540825408354084540855408654087540885408954090540915409254093540945409554096540975409854099541005410154102541035410454105541065410754108541095411054111541125411354114541155411654117541185411954120541215412254123541245412554126541275412854129541305413154132541335413454135541365413754138541395414054141541425414354144541455414654147541485414954150541515415254153541545415554156541575415854159541605416154162541635416454165541665416754168541695417054171541725417354174541755417654177541785417954180541815418254183541845418554186541875418854189541905419154192541935419454195541965419754198541995420054201542025420354204542055420654207542085420954210542115421254213542145421554216542175421854219542205422154222542235422454225542265422754228542295423054231542325423354234542355423654237542385423954240542415424254243542445424554246542475424854249542505425154252542535425454255542565425754258542595426054261542625426354264542655426654267542685426954270542715427254273542745427554276542775427854279542805428154282542835428454285542865428754288542895429054291542925429354294542955429654297542985429954300543015430254303543045430554306543075430854309543105431154312543135431454315543165431754318543195432054321543225432354324543255432654327543285432954330543315433254333543345433554336543375433854339543405434154342543435434454345543465434754348543495435054351543525435354354543555435654357543585435954360543615436254363543645436554366543675436854369543705437154372543735437454375543765437754378543795438054381543825438354384543855438654387543885438954390543915439254393543945439554396543975439854399544005440154402544035440454405544065440754408544095441054411544125441354414544155441654417544185441954420544215442254423544245442554426544275442854429544305443154432544335443454435544365443754438544395444054441544425444354444544455444654447544485444954450544515445254453544545445554456544575445854459544605446154462544635446454465544665446754468544695447054471544725447354474544755447654477544785447954480544815448254483544845448554486544875448854489544905449154492544935449454495544965449754498544995450054501545025450354504545055450654507545085450954510545115451254513545145451554516545175451854519545205452154522545235452454525545265452754528545295453054531545325453354534545355453654537545385453954540545415454254543545445454554546545475454854549545505455154552545535455454555545565455754558545595456054561545625456354564545655456654567545685456954570545715457254573545745457554576545775457854579545805458154582545835458454585545865458754588545895459054591545925459354594545955459654597545985459954600546015460254603546045460554606546075460854609546105461154612546135461454615546165461754618546195462054621546225462354624546255462654627546285462954630546315463254633546345463554636546375463854639546405464154642546435464454645546465464754648546495465054651546525465354654546555465654657546585465954660546615466254663546645466554666546675466854669546705467154672546735467454675546765467754678546795468054681546825468354684546855468654687546885468954690546915469254693546945469554696546975469854699547005470154702547035470454705547065470754708547095471054711547125471354714547155471654717547185471954720547215472254723547245472554726547275472854729547305473154732547335473454735547365473754738547395474054741547425474354744547455474654747547485474954750547515475254753547545475554756547575475854759547605476154762547635476454765547665476754768547695477054771547725477354774547755477654777547785477954780547815478254783547845478554786547875478854789547905479154792547935479454795547965479754798547995480054801548025480354804548055480654807548085480954810548115481254813548145481554816548175481854819548205482154822548235482454825548265482754828548295483054831548325483354834548355483654837548385483954840548415484254843548445484554846548475484854849548505485154852548535485454855548565485754858548595486054861548625486354864548655486654867548685486954870548715487254873548745487554876548775487854879548805488154882548835488454885548865488754888548895489054891548925489354894548955489654897548985489954900549015490254903549045490554906549075490854909549105491154912549135491454915549165491754918549195492054921549225492354924549255492654927549285492954930549315493254933549345493554936549375493854939549405494154942549435494454945549465494754948549495495054951549525495354954549555495654957549585495954960549615496254963549645496554966549675496854969549705497154972549735497454975549765497754978549795498054981549825498354984549855498654987549885498954990549915499254993549945499554996549975499854999550005500155002550035500455005550065500755008550095501055011550125501355014550155501655017550185501955020550215502255023550245502555026550275502855029550305503155032550335503455035550365503755038550395504055041550425504355044550455504655047550485504955050550515505255053550545505555056550575505855059550605506155062550635506455065550665506755068550695507055071550725507355074550755507655077550785507955080550815508255083550845508555086550875508855089550905509155092550935509455095550965509755098550995510055101551025510355104551055510655107551085510955110551115511255113551145511555116551175511855119551205512155122551235512455125551265512755128551295513055131551325513355134551355513655137551385513955140551415514255143551445514555146551475514855149551505515155152551535515455155551565515755158551595516055161551625516355164551655516655167551685516955170551715517255173551745517555176551775517855179551805518155182551835518455185551865518755188551895519055191551925519355194551955519655197551985519955200552015520255203552045520555206552075520855209552105521155212552135521455215552165521755218552195522055221552225522355224552255522655227552285522955230552315523255233552345523555236552375523855239552405524155242552435524455245552465524755248552495525055251552525525355254552555525655257552585525955260552615526255263552645526555266552675526855269552705527155272552735527455275552765527755278552795528055281552825528355284552855528655287552885528955290552915529255293552945529555296552975529855299553005530155302553035530455305553065530755308553095531055311553125531355314553155531655317553185531955320553215532255323553245532555326553275532855329553305533155332553335533455335553365533755338553395534055341553425534355344553455534655347553485534955350553515535255353553545535555356553575535855359553605536155362553635536455365553665536755368553695537055371553725537355374553755537655377553785537955380553815538255383553845538555386553875538855389553905539155392553935539455395553965539755398553995540055401554025540355404554055540655407554085540955410554115541255413554145541555416554175541855419554205542155422554235542455425554265542755428554295543055431554325543355434554355543655437554385543955440554415544255443554445544555446554475544855449554505545155452554535545455455554565545755458554595546055461554625546355464554655546655467554685546955470554715547255473554745547555476554775547855479554805548155482554835548455485554865548755488554895549055491554925549355494554955549655497554985549955500555015550255503555045550555506555075550855509555105551155512555135551455515555165551755518555195552055521555225552355524555255552655527555285552955530555315553255533555345553555536555375553855539555405554155542555435554455545555465554755548555495555055551555525555355554555555555655557555585555955560555615556255563555645556555566555675556855569555705557155572555735557455575555765557755578555795558055581555825558355584555855558655587555885558955590555915559255593555945559555596555975559855599556005560155602556035560455605556065560755608556095561055611556125561355614556155561655617556185561955620556215562255623556245562555626556275562855629556305563155632556335563455635556365563755638556395564055641556425564355644556455564655647556485564955650556515565255653556545565555656556575565855659556605566155662556635566455665556665566755668556695567055671556725567355674556755567655677556785567955680556815568255683556845568555686556875568855689556905569155692556935569455695556965569755698556995570055701557025570355704557055570655707557085570955710557115571255713557145571555716557175571855719557205572155722557235572455725557265572755728557295573055731557325573355734557355573655737557385573955740557415574255743557445574555746557475574855749557505575155752557535575455755557565575755758557595576055761557625576355764557655576655767557685576955770557715577255773557745577555776557775577855779557805578155782557835578455785557865578755788557895579055791557925579355794557955579655797557985579955800558015580255803558045580555806558075580855809558105581155812558135581455815558165581755818558195582055821558225582355824558255582655827558285582955830558315583255833558345583555836558375583855839558405584155842558435584455845558465584755848558495585055851558525585355854558555585655857558585585955860558615586255863558645586555866558675586855869558705587155872558735587455875558765587755878558795588055881558825588355884558855588655887558885588955890558915589255893558945589555896558975589855899559005590155902559035590455905559065590755908559095591055911559125591355914559155591655917559185591955920559215592255923559245592555926559275592855929559305593155932559335593455935559365593755938559395594055941559425594355944559455594655947559485594955950559515595255953559545595555956559575595855959559605596155962559635596455965559665596755968559695597055971559725597355974559755597655977559785597955980559815598255983559845598555986559875598855989559905599155992559935599455995559965599755998559995600056001560025600356004560055600656007560085600956010560115601256013560145601556016560175601856019560205602156022560235602456025560265602756028560295603056031560325603356034560355603656037560385603956040560415604256043560445604556046560475604856049560505605156052560535605456055560565605756058560595606056061560625606356064560655606656067560685606956070560715607256073560745607556076560775607856079560805608156082560835608456085560865608756088560895609056091560925609356094560955609656097560985609956100561015610256103561045610556106561075610856109561105611156112561135611456115561165611756118561195612056121561225612356124561255612656127561285612956130561315613256133561345613556136561375613856139561405614156142561435614456145561465614756148561495615056151561525615356154561555615656157561585615956160561615616256163561645616556166561675616856169561705617156172561735617456175561765617756178561795618056181561825618356184561855618656187561885618956190561915619256193561945619556196561975619856199562005620156202562035620456205562065620756208562095621056211562125621356214562155621656217562185621956220562215622256223562245622556226562275622856229562305623156232562335623456235562365623756238562395624056241562425624356244562455624656247562485624956250562515625256253562545625556256562575625856259562605626156262562635626456265562665626756268562695627056271562725627356274562755627656277562785627956280562815628256283562845628556286562875628856289562905629156292562935629456295562965629756298562995630056301563025630356304563055630656307563085630956310563115631256313563145631556316563175631856319563205632156322563235632456325563265632756328563295633056331563325633356334563355633656337563385633956340563415634256343563445634556346563475634856349563505635156352563535635456355563565635756358563595636056361563625636356364563655636656367563685636956370563715637256373563745637556376563775637856379563805638156382563835638456385563865638756388563895639056391563925639356394563955639656397563985639956400564015640256403564045640556406564075640856409564105641156412564135641456415564165641756418564195642056421564225642356424564255642656427564285642956430564315643256433564345643556436564375643856439564405644156442564435644456445564465644756448564495645056451564525645356454564555645656457564585645956460564615646256463564645646556466564675646856469564705647156472564735647456475564765647756478564795648056481564825648356484564855648656487564885648956490564915649256493564945649556496564975649856499565005650156502565035650456505565065650756508565095651056511565125651356514565155651656517565185651956520565215652256523565245652556526565275652856529565305653156532565335653456535565365653756538565395654056541565425654356544565455654656547565485654956550565515655256553565545655556556565575655856559565605656156562565635656456565565665656756568565695657056571565725657356574565755657656577565785657956580565815658256583565845658556586565875658856589565905659156592565935659456595565965659756598565995660056601566025660356604566055660656607566085660956610566115661256613566145661556616566175661856619566205662156622566235662456625566265662756628566295663056631566325663356634566355663656637566385663956640566415664256643566445664556646566475664856649566505665156652566535665456655566565665756658566595666056661566625666356664566655666656667566685666956670566715667256673566745667556676566775667856679566805668156682566835668456685566865668756688566895669056691566925669356694566955669656697566985669956700567015670256703567045670556706567075670856709567105671156712567135671456715567165671756718567195672056721567225672356724567255672656727567285672956730567315673256733567345673556736567375673856739567405674156742567435674456745567465674756748567495675056751567525675356754567555675656757567585675956760567615676256763567645676556766567675676856769567705677156772567735677456775567765677756778567795678056781567825678356784567855678656787567885678956790567915679256793567945679556796567975679856799568005680156802568035680456805568065680756808568095681056811568125681356814568155681656817568185681956820568215682256823568245682556826568275682856829568305683156832568335683456835568365683756838568395684056841568425684356844568455684656847568485684956850568515685256853568545685556856568575685856859568605686156862568635686456865568665686756868568695687056871568725687356874568755687656877568785687956880568815688256883568845688556886568875688856889568905689156892568935689456895568965689756898568995690056901569025690356904569055690656907569085690956910569115691256913569145691556916569175691856919569205692156922569235692456925569265692756928569295693056931569325693356934569355693656937569385693956940569415694256943569445694556946569475694856949569505695156952569535695456955569565695756958569595696056961569625696356964569655696656967569685696956970569715697256973569745697556976569775697856979569805698156982569835698456985569865698756988569895699056991569925699356994569955699656997569985699957000570015700257003570045700557006570075700857009570105701157012570135701457015570165701757018570195702057021570225702357024570255702657027570285702957030570315703257033570345703557036570375703857039570405704157042570435704457045570465704757048570495705057051570525705357054570555705657057570585705957060570615706257063570645706557066570675706857069570705707157072570735707457075570765707757078570795708057081570825708357084570855708657087570885708957090570915709257093570945709557096570975709857099571005710157102571035710457105571065710757108571095711057111571125711357114571155711657117571185711957120571215712257123571245712557126571275712857129571305713157132571335713457135571365713757138571395714057141571425714357144571455714657147571485714957150571515715257153571545715557156571575715857159571605716157162571635716457165571665716757168571695717057171571725717357174571755717657177571785717957180571815718257183571845718557186571875718857189571905719157192571935719457195571965719757198571995720057201572025720357204572055720657207572085720957210572115721257213572145721557216572175721857219572205722157222572235722457225572265722757228572295723057231572325723357234572355723657237572385723957240572415724257243572445724557246572475724857249572505725157252572535725457255572565725757258572595726057261572625726357264572655726657267572685726957270572715727257273572745727557276572775727857279572805728157282572835728457285572865728757288572895729057291572925729357294572955729657297572985729957300573015730257303573045730557306573075730857309573105731157312573135731457315573165731757318573195732057321573225732357324573255732657327573285732957330573315733257333573345733557336573375733857339573405734157342573435734457345573465734757348573495735057351573525735357354573555735657357573585735957360573615736257363573645736557366573675736857369573705737157372573735737457375573765737757378573795738057381573825738357384573855738657387573885738957390573915739257393573945739557396573975739857399574005740157402574035740457405574065740757408574095741057411574125741357414574155741657417574185741957420574215742257423574245742557426574275742857429574305743157432574335743457435574365743757438574395744057441574425744357444574455744657447574485744957450574515745257453574545745557456574575745857459574605746157462574635746457465574665746757468574695747057471574725747357474574755747657477574785747957480574815748257483574845748557486574875748857489574905749157492574935749457495574965749757498574995750057501575025750357504575055750657507575085750957510575115751257513575145751557516575175751857519575205752157522575235752457525575265752757528575295753057531575325753357534575355753657537575385753957540575415754257543575445754557546575475754857549575505755157552575535755457555575565755757558575595756057561575625756357564575655756657567575685756957570575715757257573575745757557576575775757857579575805758157582575835758457585575865758757588575895759057591575925759357594575955759657597575985759957600576015760257603576045760557606576075760857609576105761157612576135761457615576165761757618576195762057621576225762357624576255762657627576285762957630576315763257633576345763557636576375763857639576405764157642576435764457645576465764757648576495765057651576525765357654576555765657657576585765957660576615766257663576645766557666576675766857669576705767157672576735767457675576765767757678576795768057681576825768357684576855768657687576885768957690576915769257693576945769557696576975769857699577005770157702577035770457705577065770757708577095771057711577125771357714577155771657717577185771957720577215772257723577245772557726577275772857729577305773157732577335773457735577365773757738577395774057741577425774357744577455774657747577485774957750577515775257753577545775557756577575775857759577605776157762577635776457765577665776757768577695777057771577725777357774577755777657777577785777957780577815778257783577845778557786577875778857789577905779157792577935779457795577965779757798577995780057801578025780357804578055780657807578085780957810578115781257813578145781557816578175781857819578205782157822578235782457825578265782757828578295783057831578325783357834578355783657837578385783957840578415784257843578445784557846578475784857849578505785157852578535785457855578565785757858578595786057861578625786357864578655786657867578685786957870578715787257873578745787557876578775787857879578805788157882578835788457885578865788757888578895789057891578925789357894578955789657897578985789957900579015790257903579045790557906579075790857909579105791157912579135791457915579165791757918579195792057921579225792357924579255792657927579285792957930579315793257933579345793557936579375793857939579405794157942579435794457945579465794757948579495795057951579525795357954579555795657957579585795957960579615796257963579645796557966579675796857969579705797157972579735797457975579765797757978579795798057981579825798357984579855798657987579885798957990579915799257993579945799557996579975799857999580005800158002580035800458005580065800758008580095801058011580125801358014580155801658017580185801958020580215802258023580245802558026580275802858029580305803158032580335803458035580365803758038580395804058041580425804358044580455804658047580485804958050580515805258053580545805558056580575805858059580605806158062580635806458065580665806758068580695807058071580725807358074580755807658077580785807958080580815808258083580845808558086580875808858089580905809158092580935809458095580965809758098580995810058101581025810358104581055810658107581085810958110581115811258113581145811558116581175811858119581205812158122581235812458125581265812758128581295813058131581325813358134581355813658137581385813958140581415814258143581445814558146581475814858149581505815158152581535815458155581565815758158581595816058161581625816358164581655816658167581685816958170581715817258173581745817558176581775817858179581805818158182581835818458185581865818758188581895819058191581925819358194581955819658197581985819958200582015820258203582045820558206582075820858209582105821158212582135821458215582165821758218582195822058221582225822358224582255822658227582285822958230582315823258233582345823558236582375823858239582405824158242582435824458245582465824758248582495825058251582525825358254582555825658257582585825958260582615826258263582645826558266582675826858269582705827158272582735827458275582765827758278582795828058281582825828358284582855828658287582885828958290582915829258293582945829558296582975829858299583005830158302583035830458305583065830758308583095831058311583125831358314583155831658317583185831958320583215832258323583245832558326583275832858329583305833158332583335833458335583365833758338583395834058341583425834358344583455834658347583485834958350583515835258353583545835558356583575835858359583605836158362583635836458365583665836758368583695837058371583725837358374583755837658377583785837958380583815838258383583845838558386583875838858389583905839158392583935839458395583965839758398583995840058401584025840358404584055840658407584085840958410584115841258413584145841558416584175841858419584205842158422584235842458425584265842758428584295843058431584325843358434584355843658437584385843958440584415844258443584445844558446584475844858449584505845158452584535845458455584565845758458584595846058461584625846358464584655846658467584685846958470584715847258473584745847558476584775847858479584805848158482584835848458485584865848758488584895849058491584925849358494584955849658497584985849958500585015850258503585045850558506585075850858509585105851158512585135851458515585165851758518585195852058521585225852358524585255852658527585285852958530585315853258533585345853558536585375853858539585405854158542585435854458545585465854758548585495855058551585525855358554585555855658557585585855958560585615856258563585645856558566585675856858569585705857158572585735857458575585765857758578585795858058581585825858358584585855858658587585885858958590585915859258593585945859558596585975859858599586005860158602586035860458605586065860758608586095861058611586125861358614586155861658617586185861958620586215862258623586245862558626586275862858629586305863158632586335863458635586365863758638586395864058641586425864358644586455864658647586485864958650586515865258653586545865558656586575865858659586605866158662586635866458665586665866758668586695867058671586725867358674586755867658677586785867958680586815868258683586845868558686586875868858689586905869158692586935869458695586965869758698586995870058701587025870358704587055870658707587085870958710587115871258713587145871558716587175871858719587205872158722587235872458725587265872758728587295873058731587325873358734587355873658737587385873958740587415874258743587445874558746587475874858749587505875158752587535875458755587565875758758587595876058761587625876358764587655876658767587685876958770587715877258773587745877558776587775877858779587805878158782587835878458785587865878758788587895879058791587925879358794587955879658797587985879958800588015880258803588045880558806588075880858809588105881158812588135881458815588165881758818588195882058821588225882358824588255882658827588285882958830588315883258833588345883558836588375883858839588405884158842588435884458845588465884758848588495885058851588525885358854588555885658857588585885958860588615886258863588645886558866588675886858869588705887158872588735887458875588765887758878588795888058881588825888358884588855888658887588885888958890588915889258893588945889558896588975889858899589005890158902589035890458905589065890758908589095891058911589125891358914589155891658917589185891958920589215892258923589245892558926589275892858929589305893158932589335893458935589365893758938589395894058941589425894358944589455894658947589485894958950589515895258953589545895558956589575895858959589605896158962589635896458965589665896758968589695897058971589725897358974589755897658977589785897958980589815898258983589845898558986589875898858989589905899158992589935899458995589965899758998589995900059001590025900359004590055900659007590085900959010590115901259013590145901559016590175901859019590205902159022590235902459025590265902759028590295903059031590325903359034590355903659037590385903959040590415904259043590445904559046590475904859049590505905159052590535905459055590565905759058590595906059061590625906359064590655906659067590685906959070590715907259073590745907559076590775907859079590805908159082590835908459085590865908759088590895909059091590925909359094590955909659097590985909959100591015910259103591045910559106591075910859109591105911159112591135911459115591165911759118591195912059121591225912359124591255912659127591285912959130591315913259133591345913559136591375913859139591405914159142591435914459145591465914759148591495915059151591525915359154591555915659157591585915959160591615916259163591645916559166591675916859169591705917159172591735917459175591765917759178591795918059181591825918359184591855918659187591885918959190591915919259193591945919559196591975919859199592005920159202592035920459205592065920759208592095921059211592125921359214592155921659217592185921959220592215922259223592245922559226592275922859229592305923159232592335923459235592365923759238592395924059241592425924359244592455924659247592485924959250592515925259253592545925559256592575925859259592605926159262592635926459265592665926759268592695927059271592725927359274592755927659277592785927959280592815928259283592845928559286592875928859289592905929159292592935929459295592965929759298592995930059301593025930359304593055930659307593085930959310593115931259313593145931559316593175931859319593205932159322593235932459325593265932759328593295933059331593325933359334593355933659337593385933959340593415934259343593445934559346593475934859349593505935159352593535935459355593565935759358593595936059361593625936359364593655936659367593685936959370593715937259373593745937559376593775937859379593805938159382593835938459385593865938759388593895939059391593925939359394593955939659397593985939959400594015940259403594045940559406594075940859409594105941159412594135941459415594165941759418594195942059421594225942359424594255942659427594285942959430594315943259433594345943559436594375943859439594405944159442594435944459445594465944759448594495945059451594525945359454594555945659457594585945959460594615946259463594645946559466594675946859469594705947159472594735947459475594765947759478594795948059481594825948359484594855948659487594885948959490594915949259493594945949559496594975949859499595005950159502595035950459505595065950759508595095951059511595125951359514595155951659517595185951959520595215952259523595245952559526595275952859529595305953159532595335953459535595365953759538595395954059541595425954359544595455954659547595485954959550595515955259553595545955559556595575955859559595605956159562595635956459565595665956759568595695957059571595725957359574595755957659577595785957959580595815958259583595845958559586595875958859589595905959159592595935959459595595965959759598595995960059601596025960359604596055960659607596085960959610596115961259613596145961559616596175961859619596205962159622596235962459625596265962759628596295963059631596325963359634596355963659637596385963959640596415964259643596445964559646596475964859649596505965159652596535965459655596565965759658596595966059661596625966359664596655966659667596685966959670596715967259673596745967559676596775967859679596805968159682596835968459685596865968759688596895969059691596925969359694596955969659697596985969959700597015970259703597045970559706597075970859709597105971159712597135971459715597165971759718597195972059721597225972359724597255972659727597285972959730597315973259733597345973559736597375973859739597405974159742597435974459745597465974759748597495975059751597525975359754597555975659757597585975959760597615976259763597645976559766597675976859769597705977159772597735977459775597765977759778597795978059781597825978359784597855978659787597885978959790597915979259793597945979559796597975979859799598005980159802598035980459805598065980759808598095981059811598125981359814598155981659817598185981959820598215982259823598245982559826598275982859829598305983159832598335983459835598365983759838598395984059841598425984359844598455984659847598485984959850598515985259853598545985559856598575985859859598605986159862598635986459865598665986759868598695987059871598725987359874598755987659877598785987959880598815988259883598845988559886598875988859889598905989159892598935989459895598965989759898598995990059901599025990359904599055990659907599085990959910599115991259913599145991559916599175991859919599205992159922599235992459925599265992759928599295993059931599325993359934599355993659937599385993959940599415994259943599445994559946599475994859949599505995159952599535995459955599565995759958599595996059961599625996359964599655996659967599685996959970599715997259973599745997559976599775997859979599805998159982599835998459985599865998759988599895999059991599925999359994599955999659997599985999960000600016000260003600046000560006600076000860009600106001160012600136001460015600166001760018600196002060021600226002360024600256002660027600286002960030600316003260033600346003560036600376003860039600406004160042600436004460045600466004760048600496005060051600526005360054600556005660057600586005960060600616006260063600646006560066600676006860069600706007160072600736007460075600766007760078600796008060081600826008360084600856008660087600886008960090600916009260093600946009560096600976009860099601006010160102601036010460105601066010760108601096011060111601126011360114601156011660117601186011960120601216012260123601246012560126601276012860129601306013160132601336013460135601366013760138601396014060141601426014360144601456014660147601486014960150601516015260153601546015560156601576015860159601606016160162601636016460165601666016760168601696017060171601726017360174601756017660177601786017960180601816018260183601846018560186601876018860189601906019160192601936019460195601966019760198601996020060201602026020360204602056020660207602086020960210602116021260213602146021560216602176021860219602206022160222602236022460225602266022760228602296023060231602326023360234602356023660237602386023960240602416024260243602446024560246602476024860249602506025160252602536025460255602566025760258602596026060261602626026360264602656026660267602686026960270602716027260273602746027560276602776027860279602806028160282602836028460285602866028760288602896029060291602926029360294602956029660297602986029960300603016030260303603046030560306603076030860309603106031160312603136031460315603166031760318603196032060321603226032360324603256032660327603286032960330603316033260333603346033560336603376033860339603406034160342603436034460345603466034760348603496035060351603526035360354603556035660357603586035960360603616036260363603646036560366603676036860369603706037160372603736037460375603766037760378603796038060381603826038360384603856038660387603886038960390603916039260393603946039560396603976039860399604006040160402604036040460405604066040760408604096041060411604126041360414604156041660417604186041960420604216042260423604246042560426604276042860429604306043160432604336043460435604366043760438604396044060441604426044360444604456044660447604486044960450604516045260453604546045560456604576045860459604606046160462604636046460465604666046760468604696047060471604726047360474604756047660477604786047960480604816048260483604846048560486604876048860489604906049160492604936049460495604966049760498604996050060501605026050360504605056050660507605086050960510605116051260513605146051560516605176051860519605206052160522605236052460525605266052760528605296053060531605326053360534605356053660537605386053960540605416054260543605446054560546605476054860549605506055160552605536055460555605566055760558605596056060561605626056360564605656056660567605686056960570605716057260573605746057560576605776057860579605806058160582605836058460585605866058760588605896059060591605926059360594605956059660597605986059960600606016060260603606046060560606606076060860609606106061160612606136061460615606166061760618606196062060621606226062360624606256062660627606286062960630606316063260633606346063560636606376063860639606406064160642606436064460645606466064760648606496065060651606526065360654606556065660657606586065960660606616066260663606646066560666606676066860669606706067160672606736067460675606766067760678606796068060681606826068360684606856068660687606886068960690606916069260693606946069560696606976069860699607006070160702607036070460705607066070760708607096071060711607126071360714607156071660717607186071960720607216072260723607246072560726607276072860729607306073160732607336073460735607366073760738607396074060741607426074360744607456074660747607486074960750607516075260753607546075560756607576075860759607606076160762607636076460765607666076760768607696077060771607726077360774607756077660777607786077960780607816078260783607846078560786607876078860789607906079160792607936079460795607966079760798607996080060801608026080360804608056080660807608086080960810608116081260813608146081560816608176081860819608206082160822608236082460825608266082760828608296083060831608326083360834608356083660837608386083960840608416084260843608446084560846608476084860849608506085160852608536085460855608566085760858608596086060861608626086360864608656086660867608686086960870608716087260873608746087560876608776087860879608806088160882608836088460885608866088760888608896089060891608926089360894608956089660897608986089960900609016090260903609046090560906609076090860909609106091160912609136091460915609166091760918609196092060921609226092360924609256092660927609286092960930609316093260933609346093560936609376093860939609406094160942609436094460945609466094760948609496095060951609526095360954609556095660957609586095960960609616096260963609646096560966609676096860969609706097160972609736097460975609766097760978609796098060981609826098360984609856098660987609886098960990609916099260993609946099560996609976099860999610006100161002610036100461005610066100761008610096101061011610126101361014610156101661017610186101961020610216102261023610246102561026610276102861029610306103161032610336103461035610366103761038610396104061041610426104361044610456104661047610486104961050610516105261053610546105561056610576105861059610606106161062610636106461065610666106761068610696107061071610726107361074610756107661077610786107961080610816108261083610846108561086610876108861089610906109161092610936109461095610966109761098610996110061101611026110361104611056110661107611086110961110611116111261113611146111561116611176111861119611206112161122611236112461125611266112761128611296113061131611326113361134611356113661137611386113961140611416114261143611446114561146611476114861149611506115161152611536115461155611566115761158611596116061161611626116361164611656116661167611686116961170611716117261173611746117561176611776117861179611806118161182611836118461185611866118761188611896119061191611926119361194611956119661197611986119961200612016120261203612046120561206612076120861209612106121161212612136121461215612166121761218612196122061221612226122361224612256122661227612286122961230612316123261233612346123561236612376123861239612406124161242612436124461245612466124761248612496125061251612526125361254612556125661257612586125961260612616126261263612646126561266612676126861269612706127161272612736127461275612766127761278612796128061281612826128361284612856128661287612886128961290612916129261293612946129561296612976129861299613006130161302613036130461305613066130761308613096131061311613126131361314613156131661317613186131961320613216132261323613246132561326613276132861329613306133161332613336133461335613366133761338613396134061341613426134361344613456134661347613486134961350613516135261353613546135561356613576135861359613606136161362613636136461365613666136761368613696137061371613726137361374613756137661377613786137961380613816138261383613846138561386613876138861389613906139161392613936139461395613966139761398613996140061401614026140361404614056140661407614086140961410614116141261413614146141561416614176141861419614206142161422614236142461425614266142761428614296143061431614326143361434614356143661437614386143961440614416144261443614446144561446614476144861449614506145161452614536145461455614566145761458614596146061461614626146361464614656146661467614686146961470614716147261473614746147561476614776147861479614806148161482614836148461485614866148761488614896149061491614926149361494614956149661497614986149961500615016150261503615046150561506615076150861509615106151161512615136151461515615166151761518615196152061521615226152361524615256152661527615286152961530615316153261533615346153561536615376153861539615406154161542615436154461545615466154761548615496155061551615526155361554615556155661557615586155961560615616156261563615646156561566615676156861569615706157161572615736157461575615766157761578615796158061581615826158361584615856158661587615886158961590615916159261593615946159561596615976159861599616006160161602616036160461605616066160761608616096161061611616126161361614616156161661617616186161961620616216162261623616246162561626616276162861629616306163161632616336163461635616366163761638616396164061641616426164361644616456164661647616486164961650616516165261653616546165561656616576165861659616606166161662616636166461665616666166761668616696167061671616726167361674616756167661677616786167961680616816168261683616846168561686616876168861689616906169161692616936169461695616966169761698616996170061701617026170361704617056170661707617086170961710617116171261713617146171561716617176171861719617206172161722617236172461725617266172761728617296173061731617326173361734617356173661737617386173961740617416174261743617446174561746617476174861749617506175161752617536175461755617566175761758617596176061761617626176361764617656176661767617686176961770617716177261773617746177561776617776177861779617806178161782617836178461785617866178761788617896179061791617926179361794617956179661797617986179961800618016180261803618046180561806618076180861809618106181161812618136181461815618166181761818618196182061821618226182361824618256182661827618286182961830618316183261833618346183561836618376183861839618406184161842618436184461845618466184761848618496185061851618526185361854618556185661857618586185961860618616186261863618646186561866618676186861869618706187161872618736187461875618766187761878618796188061881618826188361884618856188661887618886188961890618916189261893618946189561896618976189861899619006190161902619036190461905619066190761908619096191061911619126191361914619156191661917619186191961920619216192261923619246192561926619276192861929619306193161932619336193461935619366193761938619396194061941619426194361944619456194661947619486194961950619516195261953619546195561956619576195861959619606196161962619636196461965619666196761968619696197061971619726197361974619756197661977619786197961980619816198261983619846198561986619876198861989619906199161992619936199461995619966199761998619996200062001620026200362004620056200662007620086200962010620116201262013620146201562016620176201862019620206202162022620236202462025620266202762028620296203062031620326203362034620356203662037620386203962040620416204262043620446204562046620476204862049620506205162052620536205462055620566205762058620596206062061620626206362064620656206662067620686206962070620716207262073620746207562076620776207862079620806208162082620836208462085620866208762088620896209062091620926209362094620956209662097620986209962100621016210262103621046210562106621076210862109621106211162112621136211462115621166211762118621196212062121621226212362124621256212662127621286212962130621316213262133621346213562136621376213862139621406214162142621436214462145621466214762148621496215062151621526215362154621556215662157621586215962160621616216262163621646216562166621676216862169621706217162172621736217462175621766217762178621796218062181621826218362184621856218662187621886218962190621916219262193621946219562196621976219862199622006220162202622036220462205622066220762208622096221062211622126221362214622156221662217622186221962220622216222262223622246222562226622276222862229622306223162232622336223462235622366223762238622396224062241622426224362244622456224662247622486224962250622516225262253622546225562256622576225862259622606226162262622636226462265622666226762268622696227062271622726227362274622756227662277622786227962280622816228262283622846228562286622876228862289622906229162292622936229462295622966229762298622996230062301623026230362304623056230662307623086230962310623116231262313623146231562316623176231862319623206232162322623236232462325623266232762328623296233062331623326233362334623356233662337623386233962340623416234262343623446234562346623476234862349623506235162352623536235462355623566235762358623596236062361623626236362364623656236662367623686236962370623716237262373623746237562376623776237862379623806238162382623836238462385623866238762388623896239062391623926239362394623956239662397623986239962400624016240262403624046240562406624076240862409624106241162412624136241462415624166241762418624196242062421624226242362424624256242662427624286242962430624316243262433624346243562436624376243862439624406244162442624436244462445624466244762448624496245062451624526245362454624556245662457624586245962460624616246262463624646246562466624676246862469624706247162472624736247462475624766247762478624796248062481624826248362484624856248662487624886248962490624916249262493624946249562496624976249862499625006250162502625036250462505625066250762508625096251062511625126251362514625156251662517625186251962520625216252262523625246252562526625276252862529625306253162532625336253462535625366253762538625396254062541625426254362544625456254662547625486254962550625516255262553625546255562556625576255862559625606256162562625636256462565625666256762568625696257062571625726257362574625756257662577625786257962580625816258262583625846258562586625876258862589625906259162592625936259462595625966259762598625996260062601626026260362604626056260662607626086260962610626116261262613626146261562616626176261862619626206262162622626236262462625626266262762628626296263062631626326263362634626356263662637626386263962640626416264262643626446264562646626476264862649626506265162652626536265462655626566265762658626596266062661626626266362664626656266662667626686266962670626716267262673626746267562676626776267862679626806268162682626836268462685626866268762688626896269062691626926269362694626956269662697626986269962700627016270262703627046270562706627076270862709627106271162712627136271462715627166271762718627196272062721627226272362724627256272662727627286272962730627316273262733627346273562736627376273862739627406274162742627436274462745627466274762748627496275062751627526275362754627556275662757627586275962760627616276262763627646276562766627676276862769627706277162772627736277462775627766277762778627796278062781627826278362784627856278662787627886278962790627916279262793627946279562796627976279862799628006280162802628036280462805628066280762808628096281062811628126281362814628156281662817628186281962820628216282262823628246282562826628276282862829628306283162832628336283462835628366283762838628396284062841628426284362844628456284662847628486284962850628516285262853628546285562856628576285862859628606286162862628636286462865628666286762868628696287062871628726287362874628756287662877628786287962880628816288262883628846288562886628876288862889628906289162892628936289462895628966289762898628996290062901629026290362904629056290662907629086290962910629116291262913629146291562916629176291862919629206292162922629236292462925629266292762928629296293062931629326293362934629356293662937629386293962940629416294262943629446294562946629476294862949629506295162952629536295462955629566295762958629596296062961629626296362964629656296662967629686296962970629716297262973629746297562976629776297862979629806298162982629836298462985629866298762988629896299062991629926299362994629956299662997629986299963000630016300263003630046300563006630076300863009630106301163012630136301463015630166301763018630196302063021630226302363024630256302663027630286302963030630316303263033630346303563036630376303863039630406304163042630436304463045630466304763048630496305063051630526305363054630556305663057630586305963060630616306263063630646306563066630676306863069630706307163072630736307463075630766307763078630796308063081630826308363084630856308663087630886308963090630916309263093630946309563096630976309863099631006310163102631036310463105631066310763108631096311063111631126311363114631156311663117631186311963120631216312263123631246312563126631276312863129631306313163132631336313463135631366313763138631396314063141631426314363144631456314663147631486314963150631516315263153631546315563156631576315863159631606316163162631636316463165631666316763168631696317063171631726317363174631756317663177631786317963180631816318263183631846318563186631876318863189631906319163192631936319463195631966319763198631996320063201632026320363204632056320663207632086320963210632116321263213632146321563216632176321863219632206322163222632236322463225632266322763228632296323063231632326323363234632356323663237632386323963240632416324263243632446324563246632476324863249632506325163252632536325463255632566325763258632596326063261632626326363264632656326663267632686326963270632716327263273632746327563276632776327863279632806328163282632836328463285632866328763288632896329063291632926329363294632956329663297632986329963300633016330263303633046330563306633076330863309633106331163312633136331463315633166331763318633196332063321633226332363324633256332663327633286332963330633316333263333633346333563336633376333863339633406334163342633436334463345633466334763348633496335063351633526335363354633556335663357633586335963360633616336263363633646336563366633676336863369633706337163372633736337463375633766337763378633796338063381633826338363384633856338663387633886338963390633916339263393633946339563396633976339863399634006340163402634036340463405634066340763408634096341063411634126341363414634156341663417634186341963420634216342263423634246342563426634276342863429634306343163432634336343463435634366343763438634396344063441634426344363444634456344663447634486344963450634516345263453634546345563456634576345863459634606346163462634636346463465634666346763468634696347063471634726347363474634756347663477634786347963480634816348263483634846348563486634876348863489634906349163492634936349463495634966349763498634996350063501635026350363504635056350663507635086350963510635116351263513635146351563516635176351863519635206352163522635236352463525635266352763528635296353063531635326353363534635356353663537635386353963540635416354263543635446354563546635476354863549635506355163552635536355463555635566355763558635596356063561635626356363564635656356663567635686356963570635716357263573635746357563576635776357863579635806358163582635836358463585635866358763588635896359063591635926359363594635956359663597635986359963600636016360263603636046360563606636076360863609636106361163612636136361463615636166361763618636196362063621636226362363624636256362663627636286362963630636316363263633636346363563636636376363863639636406364163642636436364463645636466364763648636496365063651636526365363654636556365663657636586365963660636616366263663636646366563666636676366863669636706367163672636736367463675636766367763678636796368063681636826368363684636856368663687636886368963690636916369263693636946369563696636976369863699637006370163702637036370463705637066370763708637096371063711637126371363714637156371663717637186371963720637216372263723637246372563726637276372863729637306373163732637336373463735637366373763738637396374063741637426374363744637456374663747637486374963750637516375263753637546375563756637576375863759637606376163762637636376463765637666376763768637696377063771637726377363774637756377663777637786377963780637816378263783637846378563786637876378863789637906379163792637936379463795637966379763798637996380063801638026380363804638056380663807638086380963810638116381263813638146381563816638176381863819638206382163822638236382463825638266382763828638296383063831638326383363834638356383663837638386383963840638416384263843638446384563846638476384863849638506385163852638536385463855638566385763858638596386063861638626386363864638656386663867638686386963870638716387263873638746387563876638776387863879638806388163882638836388463885638866388763888638896389063891638926389363894638956389663897638986389963900639016390263903639046390563906639076390863909639106391163912639136391463915639166391763918639196392063921639226392363924639256392663927639286392963930639316393263933639346393563936639376393863939639406394163942639436394463945639466394763948639496395063951639526395363954639556395663957639586395963960639616396263963639646396563966639676396863969639706397163972639736397463975639766397763978639796398063981639826398363984639856398663987639886398963990639916399263993639946399563996639976399863999640006400164002640036400464005640066400764008640096401064011640126401364014640156401664017640186401964020640216402264023640246402564026640276402864029640306403164032640336403464035640366403764038640396404064041640426404364044640456404664047640486404964050640516405264053640546405564056640576405864059640606406164062640636406464065640666406764068640696407064071640726407364074640756407664077640786407964080640816408264083640846408564086640876408864089640906409164092640936409464095640966409764098640996410064101641026410364104641056410664107641086410964110641116411264113641146411564116641176411864119641206412164122641236412464125641266412764128641296413064131641326413364134641356413664137641386413964140641416414264143641446414564146641476414864149641506415164152641536415464155641566415764158641596416064161641626416364164641656416664167641686416964170641716417264173641746417564176641776417864179641806418164182641836418464185641866418764188641896419064191641926419364194641956419664197641986419964200642016420264203642046420564206642076420864209642106421164212642136421464215642166421764218642196422064221642226422364224642256422664227642286422964230642316423264233642346423564236642376423864239642406424164242642436424464245642466424764248642496425064251642526425364254642556425664257642586425964260642616426264263642646426564266642676426864269642706427164272642736427464275642766427764278642796428064281642826428364284642856428664287642886428964290642916429264293642946429564296642976429864299643006430164302643036430464305643066430764308643096431064311643126431364314643156431664317643186431964320643216432264323643246432564326643276432864329643306433164332643336433464335643366433764338643396434064341643426434364344643456434664347643486434964350643516435264353643546435564356643576435864359643606436164362643636436464365643666436764368643696437064371643726437364374643756437664377643786437964380643816438264383643846438564386643876438864389643906439164392643936439464395643966439764398643996440064401644026440364404644056440664407644086440964410644116441264413644146441564416644176441864419644206442164422644236442464425644266442764428644296443064431644326443364434644356443664437644386443964440644416444264443644446444564446644476444864449644506445164452644536445464455644566445764458644596446064461644626446364464644656446664467644686446964470644716447264473644746447564476644776447864479644806448164482644836448464485644866448764488644896449064491644926449364494644956449664497644986449964500645016450264503645046450564506645076450864509645106451164512645136451464515645166451764518645196452064521645226452364524645256452664527645286452964530645316453264533645346453564536645376453864539645406454164542645436454464545645466454764548645496455064551645526455364554645556455664557645586455964560645616456264563645646456564566645676456864569645706457164572645736457464575645766457764578645796458064581645826458364584645856458664587645886458964590645916459264593645946459564596645976459864599646006460164602646036460464605646066460764608646096461064611646126461364614646156461664617646186461964620646216462264623646246462564626646276462864629646306463164632646336463464635646366463764638646396464064641646426464364644646456464664647646486464964650646516465264653646546465564656646576465864659646606466164662646636466464665646666466764668646696467064671646726467364674646756467664677646786467964680646816468264683646846468564686646876468864689646906469164692646936469464695646966469764698646996470064701647026470364704647056470664707647086470964710647116471264713647146471564716647176471864719647206472164722647236472464725647266472764728647296473064731647326473364734647356473664737647386473964740647416474264743647446474564746647476474864749647506475164752647536475464755647566475764758647596476064761647626476364764647656476664767647686476964770647716477264773647746477564776647776477864779647806478164782647836478464785647866478764788647896479064791647926479364794647956479664797647986479964800648016480264803648046480564806648076480864809648106481164812648136481464815648166481764818648196482064821648226482364824648256482664827648286482964830648316483264833648346483564836648376483864839648406484164842648436484464845648466484764848648496485064851648526485364854648556485664857648586485964860648616486264863648646486564866648676486864869648706487164872648736487464875648766487764878648796488064881648826488364884648856488664887648886488964890648916489264893648946489564896648976489864899649006490164902649036490464905649066490764908649096491064911649126491364914649156491664917649186491964920649216492264923649246492564926649276492864929649306493164932649336493464935649366493764938649396494064941649426494364944649456494664947649486494964950649516495264953649546495564956649576495864959649606496164962649636496464965649666496764968649696497064971649726497364974649756497664977649786497964980649816498264983649846498564986649876498864989649906499164992649936499464995649966499764998649996500065001650026500365004650056500665007650086500965010650116501265013650146501565016650176501865019650206502165022650236502465025650266502765028650296503065031650326503365034650356503665037650386503965040650416504265043650446504565046650476504865049650506505165052650536505465055650566505765058650596506065061650626506365064650656506665067650686506965070650716507265073650746507565076650776507865079650806508165082650836508465085650866508765088650896509065091650926509365094650956509665097650986509965100651016510265103651046510565106651076510865109651106511165112651136511465115651166511765118651196512065121651226512365124651256512665127651286512965130651316513265133651346513565136651376513865139651406514165142651436514465145651466514765148651496515065151651526515365154651556515665157651586515965160651616516265163651646516565166651676516865169651706517165172651736517465175651766517765178651796518065181651826518365184651856518665187651886518965190651916519265193651946519565196651976519865199652006520165202652036520465205652066520765208652096521065211652126521365214652156521665217652186521965220652216522265223652246522565226652276522865229652306523165232652336523465235652366523765238652396524065241652426524365244652456524665247652486524965250652516525265253652546525565256652576525865259652606526165262652636526465265652666526765268652696527065271652726527365274652756527665277652786527965280652816528265283652846528565286652876528865289652906529165292652936529465295652966529765298652996530065301653026530365304653056530665307653086530965310653116531265313653146531565316653176531865319653206532165322653236532465325653266532765328653296533065331653326533365334653356533665337653386533965340653416534265343653446534565346653476534865349653506535165352653536535465355653566535765358653596536065361653626536365364653656536665367653686536965370653716537265373653746537565376653776537865379653806538165382653836538465385653866538765388653896539065391653926539365394653956539665397653986539965400654016540265403654046540565406654076540865409654106541165412654136541465415654166541765418654196542065421654226542365424654256542665427654286542965430654316543265433654346543565436654376543865439654406544165442654436544465445654466544765448654496545065451654526545365454654556545665457654586545965460654616546265463654646546565466654676546865469654706547165472654736547465475654766547765478654796548065481654826548365484654856548665487654886548965490654916549265493654946549565496654976549865499655006550165502655036550465505655066550765508655096551065511655126551365514655156551665517655186551965520655216552265523655246552565526655276552865529655306553165532655336553465535655366553765538655396554065541655426554365544655456554665547655486554965550655516555265553655546555565556655576555865559655606556165562655636556465565655666556765568655696557065571655726557365574655756557665577655786557965580655816558265583655846558565586655876558865589655906559165592655936559465595655966559765598655996560065601656026560365604656056560665607656086560965610656116561265613656146561565616656176561865619656206562165622656236562465625656266562765628656296563065631656326563365634656356563665637656386563965640656416564265643656446564565646656476564865649656506565165652656536565465655656566565765658656596566065661656626566365664656656566665667656686566965670656716567265673656746567565676656776567865679656806568165682656836568465685656866568765688656896569065691656926569365694656956569665697656986569965700657016570265703657046570565706657076570865709657106571165712657136571465715657166571765718657196572065721657226572365724657256572665727657286572965730657316573265733657346573565736657376573865739657406574165742657436574465745657466574765748657496575065751657526575365754657556575665757657586575965760657616576265763657646576565766657676576865769657706577165772657736577465775657766577765778657796578065781657826578365784657856578665787657886578965790657916579265793657946579565796657976579865799658006580165802658036580465805658066580765808658096581065811658126581365814658156581665817658186581965820658216582265823658246582565826658276582865829658306583165832658336583465835658366583765838658396584065841658426584365844658456584665847658486584965850658516585265853658546585565856658576585865859658606586165862658636586465865658666586765868658696587065871658726587365874658756587665877658786587965880658816588265883658846588565886658876588865889658906589165892658936589465895658966589765898658996590065901659026590365904659056590665907659086590965910659116591265913659146591565916659176591865919659206592165922659236592465925659266592765928659296593065931659326593365934659356593665937659386593965940659416594265943659446594565946659476594865949659506595165952659536595465955659566595765958659596596065961659626596365964659656596665967659686596965970659716597265973659746597565976659776597865979659806598165982659836598465985659866598765988659896599065991659926599365994659956599665997659986599966000660016600266003660046600566006660076600866009660106601166012660136601466015660166601766018660196602066021660226602366024660256602666027660286602966030660316603266033660346603566036660376603866039660406604166042660436604466045660466604766048660496605066051660526605366054660556605666057660586605966060660616606266063660646606566066660676606866069660706607166072660736607466075660766607766078660796608066081660826608366084660856608666087660886608966090660916609266093660946609566096660976609866099661006610166102661036610466105661066610766108661096611066111661126611366114661156611666117661186611966120661216612266123661246612566126661276612866129661306613166132661336613466135661366613766138661396614066141661426614366144661456614666147661486614966150661516615266153661546615566156661576615866159661606616166162661636616466165661666616766168661696617066171661726617366174661756617666177661786617966180661816618266183661846618566186661876618866189661906619166192661936619466195661966619766198661996620066201662026620366204662056620666207662086620966210662116621266213662146621566216662176621866219662206622166222662236622466225662266622766228662296623066231662326623366234
  1. /*!
  2. Stencil Compiler v2.15.1 | MIT Licensed | https://stenciljs.com
  3. */
  4. (function(exports) {
  5. 'use strict';
  6. if (typeof globalThis === 'undefined') {
  7. if (typeof self !== 'undefined') {
  8. self.globalThis = self;
  9. } else if (typeof window !== 'undefined') {
  10. window.globalThis = window;
  11. } else if (typeof global !== 'undefined') {
  12. global.globalThis = global;
  13. }
  14. }
  15. const Buffer = globalThis.Buffer || {};
  16. const process = globalThis.process || {};
  17. if (!process.argv) {
  18. process.argv = [''];
  19. }
  20. let __cwd = '/';
  21. if (!process.cwd) {
  22. process.cwd = () => __cwd;
  23. }
  24. if (!process.chdir) {
  25. process.chdir = (v) => __cwd = v;
  26. }
  27. if (!process.nextTick) {
  28. const resolved = Promise.resolve();
  29. process.nextTick = (cb) => resolved.then(cb);
  30. }
  31. if (!process.platform) {
  32. process.platform = 'stencil';
  33. }
  34. if (!process.version) {
  35. process.version = 'v12.0.0';
  36. }
  37. process.browser = !!globalThis.location;
  38. // 'path' module extracted from Node.js v8.11.1 (only the posix part)
  39. function assertPath(path) {
  40. if (typeof path !== 'string') {
  41. throw new TypeError('Path must be a string. Received ' + JSON.stringify(path));
  42. }
  43. }
  44. // Resolves . and .. elements in a path with directory names
  45. function normalizeStringPosix(path, allowAboveRoot) {
  46. var res = '';
  47. var lastSegmentLength = 0;
  48. var lastSlash = -1;
  49. var dots = 0;
  50. var code;
  51. for (var i = 0; i <= path.length; ++i) {
  52. if (i < path.length)
  53. code = path.charCodeAt(i);
  54. else if (code === 47 /*/*/)
  55. break;
  56. else
  57. code = 47 /*/*/;
  58. if (code === 47 /*/*/) {
  59. if (lastSlash === i - 1 || dots === 1) ; else if (lastSlash !== i - 1 && dots === 2) {
  60. if (res.length < 2 || lastSegmentLength !== 2 || res.charCodeAt(res.length - 1) !== 46 /*.*/ || res.charCodeAt(res.length - 2) !== 46 /*.*/) {
  61. if (res.length > 2) {
  62. var lastSlashIndex = res.lastIndexOf('/');
  63. if (lastSlashIndex !== res.length - 1) {
  64. if (lastSlashIndex === -1) {
  65. res = '';
  66. lastSegmentLength = 0;
  67. } else {
  68. res = res.slice(0, lastSlashIndex);
  69. lastSegmentLength = res.length - 1 - res.lastIndexOf('/');
  70. }
  71. lastSlash = i;
  72. dots = 0;
  73. continue;
  74. }
  75. } else if (res.length === 2 || res.length === 1) {
  76. res = '';
  77. lastSegmentLength = 0;
  78. lastSlash = i;
  79. dots = 0;
  80. continue;
  81. }
  82. }
  83. if (allowAboveRoot) {
  84. if (res.length > 0)
  85. res += '/..';
  86. else
  87. res = '..';
  88. lastSegmentLength = 2;
  89. }
  90. } else {
  91. if (res.length > 0)
  92. res += '/' + path.slice(lastSlash + 1, i);
  93. else
  94. res = path.slice(lastSlash + 1, i);
  95. lastSegmentLength = i - lastSlash - 1;
  96. }
  97. lastSlash = i;
  98. dots = 0;
  99. } else if (code === 46 /*.*/ && dots !== -1) {
  100. ++dots;
  101. } else {
  102. dots = -1;
  103. }
  104. }
  105. return res;
  106. }
  107. function _format(sep, pathObject) {
  108. var dir = pathObject.dir || pathObject.root;
  109. var base = pathObject.base || (pathObject.name || '') + (pathObject.ext || '');
  110. if (!dir) {
  111. return base;
  112. }
  113. if (dir === pathObject.root) {
  114. return dir + base;
  115. }
  116. return dir + sep + base;
  117. }
  118. var posix$2 = {
  119. // path.resolve([from ...], to)
  120. resolve: function resolve() {
  121. var resolvedPath = '';
  122. var resolvedAbsolute = false;
  123. var cwd;
  124. for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
  125. var path;
  126. if (i >= 0)
  127. path = arguments[i];
  128. else {
  129. if (cwd === undefined)
  130. cwd = process.cwd();
  131. path = cwd;
  132. }
  133. assertPath(path);
  134. // Skip empty entries
  135. if (path.length === 0) {
  136. continue;
  137. }
  138. resolvedPath = path + '/' + resolvedPath;
  139. resolvedAbsolute = path.charCodeAt(0) === 47 /*/*/;
  140. }
  141. // At this point the path should be resolved to a full absolute path, but
  142. // handle relative paths to be safe (might happen when process.cwd() fails)
  143. // Normalize the path
  144. resolvedPath = normalizeStringPosix(resolvedPath, !resolvedAbsolute);
  145. if (resolvedAbsolute) {
  146. if (resolvedPath.length > 0)
  147. return '/' + resolvedPath;
  148. else
  149. return '/';
  150. } else if (resolvedPath.length > 0) {
  151. return resolvedPath;
  152. } else {
  153. return '.';
  154. }
  155. },
  156. normalize: function normalize(path) {
  157. assertPath(path);
  158. if (path.length === 0) return '.';
  159. var isAbsolute = path.charCodeAt(0) === 47 /*/*/;
  160. var trailingSeparator = path.charCodeAt(path.length - 1) === 47 /*/*/;
  161. // Normalize the path
  162. path = normalizeStringPosix(path, !isAbsolute);
  163. if (path.length === 0 && !isAbsolute) path = '.';
  164. if (path.length > 0 && trailingSeparator) path += '/';
  165. if (isAbsolute) return '/' + path;
  166. return path;
  167. },
  168. isAbsolute: function isAbsolute(path) {
  169. assertPath(path);
  170. return path.length > 0 && path.charCodeAt(0) === 47 /*/*/;
  171. },
  172. join: function join() {
  173. if (arguments.length === 0)
  174. return '.';
  175. var joined;
  176. for (var i = 0; i < arguments.length; ++i) {
  177. var arg = arguments[i];
  178. assertPath(arg);
  179. if (arg.length > 0) {
  180. if (joined === undefined)
  181. joined = arg;
  182. else
  183. joined += '/' + arg;
  184. }
  185. }
  186. if (joined === undefined)
  187. return '.';
  188. return posix$2.normalize(joined);
  189. },
  190. relative: function relative(from, to) {
  191. assertPath(from);
  192. assertPath(to);
  193. if (from === to) return '';
  194. from = posix$2.resolve(from);
  195. to = posix$2.resolve(to);
  196. if (from === to) return '';
  197. // Trim any leading backslashes
  198. var fromStart = 1;
  199. for (; fromStart < from.length; ++fromStart) {
  200. if (from.charCodeAt(fromStart) !== 47 /*/*/)
  201. break;
  202. }
  203. var fromEnd = from.length;
  204. var fromLen = fromEnd - fromStart;
  205. // Trim any leading backslashes
  206. var toStart = 1;
  207. for (; toStart < to.length; ++toStart) {
  208. if (to.charCodeAt(toStart) !== 47 /*/*/)
  209. break;
  210. }
  211. var toEnd = to.length;
  212. var toLen = toEnd - toStart;
  213. // Compare paths to find the longest common path from root
  214. var length = fromLen < toLen ? fromLen : toLen;
  215. var lastCommonSep = -1;
  216. var i = 0;
  217. for (; i <= length; ++i) {
  218. if (i === length) {
  219. if (toLen > length) {
  220. if (to.charCodeAt(toStart + i) === 47 /*/*/) {
  221. // We get here if `from` is the exact base path for `to`.
  222. // For example: from='/foo/bar'; to='/foo/bar/baz'
  223. return to.slice(toStart + i + 1);
  224. } else if (i === 0) {
  225. // We get here if `from` is the root
  226. // For example: from='/'; to='/foo'
  227. return to.slice(toStart + i);
  228. }
  229. } else if (fromLen > length) {
  230. if (from.charCodeAt(fromStart + i) === 47 /*/*/) {
  231. // We get here if `to` is the exact base path for `from`.
  232. // For example: from='/foo/bar/baz'; to='/foo/bar'
  233. lastCommonSep = i;
  234. } else if (i === 0) {
  235. // We get here if `to` is the root.
  236. // For example: from='/foo'; to='/'
  237. lastCommonSep = 0;
  238. }
  239. }
  240. break;
  241. }
  242. var fromCode = from.charCodeAt(fromStart + i);
  243. var toCode = to.charCodeAt(toStart + i);
  244. if (fromCode !== toCode)
  245. break;
  246. else if (fromCode === 47 /*/*/)
  247. lastCommonSep = i;
  248. }
  249. var out = '';
  250. // Generate the relative path based on the path difference between `to`
  251. // and `from`
  252. for (i = fromStart + lastCommonSep + 1; i <= fromEnd; ++i) {
  253. if (i === fromEnd || from.charCodeAt(i) === 47 /*/*/) {
  254. if (out.length === 0)
  255. out += '..';
  256. else
  257. out += '/..';
  258. }
  259. }
  260. // Lastly, append the rest of the destination (`to`) path that comes after
  261. // the common path parts
  262. if (out.length > 0)
  263. return out + to.slice(toStart + lastCommonSep);
  264. else {
  265. toStart += lastCommonSep;
  266. if (to.charCodeAt(toStart) === 47 /*/*/)
  267. ++toStart;
  268. return to.slice(toStart);
  269. }
  270. },
  271. _makeLong: function _makeLong(path) {
  272. return path;
  273. },
  274. dirname: function dirname(path) {
  275. assertPath(path);
  276. if (path.length === 0) return '.';
  277. var code = path.charCodeAt(0);
  278. var hasRoot = code === 47 /*/*/;
  279. var end = -1;
  280. var matchedSlash = true;
  281. for (var i = path.length - 1; i >= 1; --i) {
  282. code = path.charCodeAt(i);
  283. if (code === 47 /*/*/) {
  284. if (!matchedSlash) {
  285. end = i;
  286. break;
  287. }
  288. } else {
  289. // We saw the first non-path separator
  290. matchedSlash = false;
  291. }
  292. }
  293. if (end === -1) return hasRoot ? '/' : '.';
  294. if (hasRoot && end === 1) return '//';
  295. return path.slice(0, end);
  296. },
  297. basename: function basename(path, ext) {
  298. if (ext !== undefined && typeof ext !== 'string') throw new TypeError('"ext" argument must be a string');
  299. assertPath(path);
  300. var start = 0;
  301. var end = -1;
  302. var matchedSlash = true;
  303. var i;
  304. if (ext !== undefined && ext.length > 0 && ext.length <= path.length) {
  305. if (ext.length === path.length && ext === path) return '';
  306. var extIdx = ext.length - 1;
  307. var firstNonSlashEnd = -1;
  308. for (i = path.length - 1; i >= 0; --i) {
  309. var code = path.charCodeAt(i);
  310. if (code === 47 /*/*/) {
  311. // If we reached a path separator that was not part of a set of path
  312. // separators at the end of the string, stop now
  313. if (!matchedSlash) {
  314. start = i + 1;
  315. break;
  316. }
  317. } else {
  318. if (firstNonSlashEnd === -1) {
  319. // We saw the first non-path separator, remember this index in case
  320. // we need it if the extension ends up not matching
  321. matchedSlash = false;
  322. firstNonSlashEnd = i + 1;
  323. }
  324. if (extIdx >= 0) {
  325. // Try to match the explicit extension
  326. if (code === ext.charCodeAt(extIdx)) {
  327. if (--extIdx === -1) {
  328. // We matched the extension, so mark this as the end of our path
  329. // component
  330. end = i;
  331. }
  332. } else {
  333. // Extension does not match, so our result is the entire path
  334. // component
  335. extIdx = -1;
  336. end = firstNonSlashEnd;
  337. }
  338. }
  339. }
  340. }
  341. if (start === end) end = firstNonSlashEnd;else if (end === -1) end = path.length;
  342. return path.slice(start, end);
  343. } else {
  344. for (i = path.length - 1; i >= 0; --i) {
  345. if (path.charCodeAt(i) === 47 /*/*/) {
  346. // If we reached a path separator that was not part of a set of path
  347. // separators at the end of the string, stop now
  348. if (!matchedSlash) {
  349. start = i + 1;
  350. break;
  351. }
  352. } else if (end === -1) {
  353. // We saw the first non-path separator, mark this as the end of our
  354. // path component
  355. matchedSlash = false;
  356. end = i + 1;
  357. }
  358. }
  359. if (end === -1) return '';
  360. return path.slice(start, end);
  361. }
  362. },
  363. extname: function extname(path) {
  364. assertPath(path);
  365. var startDot = -1;
  366. var startPart = 0;
  367. var end = -1;
  368. var matchedSlash = true;
  369. // Track the state of characters (if any) we see before our first dot and
  370. // after any path separator we find
  371. var preDotState = 0;
  372. for (var i = path.length - 1; i >= 0; --i) {
  373. var code = path.charCodeAt(i);
  374. if (code === 47 /*/*/) {
  375. // If we reached a path separator that was not part of a set of path
  376. // separators at the end of the string, stop now
  377. if (!matchedSlash) {
  378. startPart = i + 1;
  379. break;
  380. }
  381. continue;
  382. }
  383. if (end === -1) {
  384. // We saw the first non-path separator, mark this as the end of our
  385. // extension
  386. matchedSlash = false;
  387. end = i + 1;
  388. }
  389. if (code === 46 /*.*/) {
  390. // If this is our first dot, mark it as the start of our extension
  391. if (startDot === -1)
  392. startDot = i;
  393. else if (preDotState !== 1)
  394. preDotState = 1;
  395. } else if (startDot !== -1) {
  396. // We saw a non-dot and non-path separator before our dot, so we should
  397. // have a good chance at having a non-empty extension
  398. preDotState = -1;
  399. }
  400. }
  401. if (startDot === -1 || end === -1 ||
  402. // We saw a non-dot character immediately before the dot
  403. preDotState === 0 ||
  404. // The (right-most) trimmed path component is exactly '..'
  405. preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
  406. return '';
  407. }
  408. return path.slice(startDot, end);
  409. },
  410. format: function format(pathObject) {
  411. if (pathObject === null || typeof pathObject !== 'object') {
  412. throw new TypeError('The "pathObject" argument must be of type Object. Received type ' + typeof pathObject);
  413. }
  414. return _format('/', pathObject);
  415. },
  416. parse: function parse(path) {
  417. assertPath(path);
  418. var ret = { root: '', dir: '', base: '', ext: '', name: '' };
  419. if (path.length === 0) return ret;
  420. var code = path.charCodeAt(0);
  421. var isAbsolute = code === 47 /*/*/;
  422. var start;
  423. if (isAbsolute) {
  424. ret.root = '/';
  425. start = 1;
  426. } else {
  427. start = 0;
  428. }
  429. var startDot = -1;
  430. var startPart = 0;
  431. var end = -1;
  432. var matchedSlash = true;
  433. var i = path.length - 1;
  434. // Track the state of characters (if any) we see before our first dot and
  435. // after any path separator we find
  436. var preDotState = 0;
  437. // Get non-dir info
  438. for (; i >= start; --i) {
  439. code = path.charCodeAt(i);
  440. if (code === 47 /*/*/) {
  441. // If we reached a path separator that was not part of a set of path
  442. // separators at the end of the string, stop now
  443. if (!matchedSlash) {
  444. startPart = i + 1;
  445. break;
  446. }
  447. continue;
  448. }
  449. if (end === -1) {
  450. // We saw the first non-path separator, mark this as the end of our
  451. // extension
  452. matchedSlash = false;
  453. end = i + 1;
  454. }
  455. if (code === 46 /*.*/) {
  456. // If this is our first dot, mark it as the start of our extension
  457. if (startDot === -1) startDot = i;else if (preDotState !== 1) preDotState = 1;
  458. } else if (startDot !== -1) {
  459. // We saw a non-dot and non-path separator before our dot, so we should
  460. // have a good chance at having a non-empty extension
  461. preDotState = -1;
  462. }
  463. }
  464. if (startDot === -1 || end === -1 ||
  465. // We saw a non-dot character immediately before the dot
  466. preDotState === 0 ||
  467. // The (right-most) trimmed path component is exactly '..'
  468. preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
  469. if (end !== -1) {
  470. if (startPart === 0 && isAbsolute) ret.base = ret.name = path.slice(1, end);else ret.base = ret.name = path.slice(startPart, end);
  471. }
  472. } else {
  473. if (startPart === 0 && isAbsolute) {
  474. ret.name = path.slice(1, startDot);
  475. ret.base = path.slice(1, end);
  476. } else {
  477. ret.name = path.slice(startPart, startDot);
  478. ret.base = path.slice(startPart, end);
  479. }
  480. ret.ext = path.slice(startDot, end);
  481. }
  482. if (startPart > 0) ret.dir = path.slice(0, startPart - 1);else if (isAbsolute) ret.dir = '/';
  483. return ret;
  484. },
  485. sep: '/',
  486. delimiter: ':',
  487. win32: null,
  488. posix: null
  489. };
  490. posix$2.posix = posix$2;
  491. var pathBrowserify = posix$2;
  492. const IS_NODE_ENV = typeof global !== 'undefined' &&
  493. typeof require === 'function' &&
  494. !!global.process &&
  495. typeof __filename === 'string' &&
  496. (!global.origin || typeof global.origin !== 'string');
  497. const OS_PLATFORM = IS_NODE_ENV ? process.platform : '';
  498. const IS_WINDOWS_ENV = OS_PLATFORM === 'win32';
  499. const IS_CASE_SENSITIVE_FILE_NAMES = !IS_WINDOWS_ENV;
  500. const IS_BROWSER_ENV = typeof location !== 'undefined' && typeof navigator !== 'undefined' && typeof XMLHttpRequest !== 'undefined';
  501. const IS_WEB_WORKER_ENV = IS_BROWSER_ENV && typeof self !== 'undefined' && typeof self.importScripts === 'function';
  502. const HAS_WEB_WORKER = IS_BROWSER_ENV && typeof Worker === 'function';
  503. const IS_FETCH_ENV = typeof fetch === 'function';
  504. const requireFunc = IS_NODE_ENV ? require : () => { };
  505. const getCurrentDirectory = IS_NODE_ENV ? process.cwd : () => '/';
  506. /**
  507. * Default style mode id
  508. */
  509. const DEFAULT_STYLE_MODE = '$';
  510. /**
  511. * File names and value
  512. */
  513. const COLLECTION_MANIFEST_FILE_NAME = 'collection-manifest.json';
  514. const formatComponentRuntimeMeta = (compilerMeta, includeMethods) => {
  515. let flags = 0;
  516. if (compilerMeta.encapsulation === 'shadow') {
  517. flags |= 1 /* shadowDomEncapsulation */;
  518. if (compilerMeta.shadowDelegatesFocus) {
  519. flags |= 16 /* shadowDelegatesFocus */;
  520. }
  521. }
  522. else if (compilerMeta.encapsulation === 'scoped') {
  523. flags |= 2 /* scopedCssEncapsulation */;
  524. }
  525. if (compilerMeta.encapsulation !== 'shadow' && compilerMeta.htmlTagNames.includes('slot')) {
  526. flags |= 4 /* hasSlotRelocation */;
  527. }
  528. if (compilerMeta.hasMode) {
  529. flags |= 32 /* hasMode */;
  530. }
  531. const members = formatComponentRuntimeMembers(compilerMeta, includeMethods);
  532. const hostListeners = formatHostListeners(compilerMeta);
  533. return trimFalsy([
  534. flags,
  535. compilerMeta.tagName,
  536. Object.keys(members).length > 0 ? members : undefined,
  537. hostListeners.length > 0 ? hostListeners : undefined,
  538. ]);
  539. };
  540. const stringifyRuntimeData = (data) => {
  541. const json = JSON.stringify(data);
  542. if (json.length > 10000) {
  543. // JSON metadata is big, JSON.parse() is faster
  544. // https://twitter.com/mathias/status/1143551692732030979
  545. return `JSON.parse(${JSON.stringify(json)})`;
  546. }
  547. return json;
  548. };
  549. const formatComponentRuntimeMembers = (compilerMeta, includeMethods = true) => {
  550. return {
  551. ...formatPropertiesRuntimeMember(compilerMeta.properties),
  552. ...formatStatesRuntimeMember(compilerMeta.states),
  553. ...(includeMethods ? formatMethodsRuntimeMember(compilerMeta.methods) : {}),
  554. };
  555. };
  556. const formatPropertiesRuntimeMember = (properties) => {
  557. const runtimeMembers = {};
  558. properties.forEach((member) => {
  559. runtimeMembers[member.name] = trimFalsy([
  560. /**
  561. * [0] member type
  562. */
  563. formatFlags(member),
  564. formatAttrName(member),
  565. ]);
  566. });
  567. return runtimeMembers;
  568. };
  569. const formatFlags = (compilerProperty) => {
  570. let type = formatPropType(compilerProperty.type);
  571. if (compilerProperty.mutable) {
  572. type |= 1024 /* Mutable */;
  573. }
  574. if (compilerProperty.reflect) {
  575. type |= 512 /* ReflectAttr */;
  576. }
  577. return type;
  578. };
  579. const formatAttrName = (compilerProperty) => {
  580. if (typeof compilerProperty.attribute === 'string') {
  581. // string attr name means we should observe this attribute
  582. if (compilerProperty.name === compilerProperty.attribute) {
  583. // property name and attribute name are the exact same
  584. // true value means to use the property name for the attribute name
  585. return undefined;
  586. }
  587. // property name and attribute name are not the same
  588. // so we need to return the actual string value
  589. // example: "multiWord" !== "multi-word"
  590. return compilerProperty.attribute;
  591. }
  592. // we shouldn't even observe an attribute for this property
  593. return undefined;
  594. };
  595. const formatPropType = (type) => {
  596. if (type === 'string') {
  597. return 1 /* String */;
  598. }
  599. if (type === 'number') {
  600. return 2 /* Number */;
  601. }
  602. if (type === 'boolean') {
  603. return 4 /* Boolean */;
  604. }
  605. if (type === 'any') {
  606. return 8 /* Any */;
  607. }
  608. return 16 /* Unknown */;
  609. };
  610. const formatStatesRuntimeMember = (states) => {
  611. const runtimeMembers = {};
  612. states.forEach((member) => {
  613. runtimeMembers[member.name] = [
  614. 32 /* State */,
  615. ];
  616. });
  617. return runtimeMembers;
  618. };
  619. const formatMethodsRuntimeMember = (methods) => {
  620. const runtimeMembers = {};
  621. methods.forEach((member) => {
  622. runtimeMembers[member.name] = [
  623. 64 /* Method */,
  624. ];
  625. });
  626. return runtimeMembers;
  627. };
  628. const formatHostListeners = (compilerMeta) => {
  629. return compilerMeta.listeners.map((compilerListener) => {
  630. const hostListener = [
  631. computeListenerFlags(compilerListener),
  632. compilerListener.name,
  633. compilerListener.method,
  634. ];
  635. return hostListener;
  636. });
  637. };
  638. const computeListenerFlags = (listener) => {
  639. let flags = 0;
  640. if (listener.capture) {
  641. flags |= 2 /* Capture */;
  642. }
  643. if (listener.passive) {
  644. flags |= 1 /* Passive */;
  645. }
  646. switch (listener.target) {
  647. case 'document':
  648. flags |= 4 /* TargetDocument */;
  649. break;
  650. case 'window':
  651. flags |= 8 /* TargetWindow */;
  652. break;
  653. case 'body':
  654. flags |= 16 /* TargetBody */;
  655. break;
  656. case 'parent':
  657. flags |= 32 /* TargetParent */;
  658. break;
  659. }
  660. return flags;
  661. };
  662. const trimFalsy = (data) => {
  663. const arr = data;
  664. for (var i = arr.length - 1; i >= 0; i--) {
  665. if (arr[i]) {
  666. break;
  667. }
  668. // if falsy, safe to pop()
  669. arr.pop();
  670. }
  671. return arr;
  672. };
  673. const toLowerCase = (str) => str.toLowerCase();
  674. const toDashCase = (str) => toLowerCase(str
  675. .replace(/([A-Z0-9])/g, (g) => ' ' + g[0])
  676. .trim()
  677. .replace(/ /g, '-'));
  678. const dashToPascalCase$1 = (str) => toLowerCase(str)
  679. .split('-')
  680. .map((segment) => segment.charAt(0).toUpperCase() + segment.slice(1))
  681. .join('');
  682. const toTitleCase = (str) => str.charAt(0).toUpperCase() + str.slice(1);
  683. const noop$1 = () => {
  684. /* noop*/
  685. };
  686. const sortBy = (array, prop) => {
  687. return array.slice().sort((a, b) => {
  688. const nameA = prop(a);
  689. const nameB = prop(b);
  690. if (nameA < nameB)
  691. return -1;
  692. if (nameA > nameB)
  693. return 1;
  694. return 0;
  695. });
  696. };
  697. const flatOne = (array) => {
  698. if (array.flat) {
  699. return array.flat(1);
  700. }
  701. return array.reduce((result, item) => {
  702. result.push(...item);
  703. return result;
  704. }, []);
  705. };
  706. const unique = (array, predicate = (i) => i) => {
  707. const set = new Set();
  708. return array.filter((item) => {
  709. const key = predicate(item);
  710. if (key == null) {
  711. return true;
  712. }
  713. if (set.has(key)) {
  714. return false;
  715. }
  716. set.add(key);
  717. return true;
  718. });
  719. };
  720. const fromEntries = (entries) => {
  721. const object = {};
  722. for (const [key, value] of entries) {
  723. object[key] = value;
  724. }
  725. return object;
  726. };
  727. const pluck = (obj, keys) => {
  728. return keys.reduce((final, key) => {
  729. if (obj[key]) {
  730. final[key] = obj[key];
  731. }
  732. return final;
  733. }, {});
  734. };
  735. const isBoolean$1 = (v) => typeof v === 'boolean';
  736. const isDefined = (v) => v !== null && v !== undefined;
  737. const isFunction = (v) => typeof v === 'function';
  738. const isNumber$1 = (v) => typeof v === 'number';
  739. const isObject$4 = (val) => val != null && typeof val === 'object' && Array.isArray(val) === false;
  740. const isString$1 = (v) => typeof v === 'string';
  741. const isIterable = (v) => isDefined(v) && isFunction(v[Symbol.iterator]);
  742. const isPromise = (v) => !!v && (typeof v === 'object' || typeof v === 'function') && typeof v.then === 'function';
  743. const isGlob = (str) => {
  744. const chars = { '{': '}', '(': ')', '[': ']' };
  745. /* eslint-disable-next-line max-len */
  746. const regex = /\\(.)|(^!|\*|[\].+)]\?|\[[^\\\]]+\]|\{[^\\}]+\}|\(\?[:!=][^\\)]+\)|\([^|]+\|[^\\)]+\))/;
  747. if (str === '') {
  748. return false;
  749. }
  750. let match;
  751. while ((match = regex.exec(str))) {
  752. if (match[2])
  753. return true;
  754. let idx = match.index + match[0].length;
  755. // if an open bracket/brace/paren is escaped,
  756. // set the index to the next closing character
  757. const open = match[1];
  758. const close = open ? chars[open] : null;
  759. if (open && close) {
  760. const n = str.indexOf(close, idx);
  761. if (n !== -1) {
  762. idx = n + 1;
  763. }
  764. }
  765. str = str.slice(idx);
  766. }
  767. return false;
  768. };
  769. /**
  770. * Checks if the path is the OS root path, such as "/" or "C:\"
  771. */
  772. const isRootPath = (p) => p === '/' || windowsPathRegex.test(p);
  773. // https://github.com/nodejs/node/blob/5883a59b21a97e8b7339f435c977155a2c29ba8d/lib/path.js#L43
  774. const windowsPathRegex = /^(?:[a-zA-Z]:|[\\/]{2}[^\\/]+[\\/]+[^\\/]+)?[\\/]$/;
  775. /**
  776. * Iterate through a series of diagnostics to provide minor fix-ups for various edge cases, deduplicate messages, etc.
  777. * @param compilerCtx the current compiler context
  778. * @param diagnostics the diagnostics to normalize
  779. * @returns the normalize documents
  780. */
  781. const normalizeDiagnostics = (compilerCtx, diagnostics) => {
  782. const normalizedErrors = [];
  783. const normalizedOthers = [];
  784. const dups = new Set();
  785. for (let i = 0; i < diagnostics.length; i++) {
  786. const d = normalizeDiagnostic(compilerCtx, diagnostics[i]);
  787. const key = d.absFilePath + d.code + d.messageText + d.type;
  788. if (dups.has(key)) {
  789. continue;
  790. }
  791. dups.add(key);
  792. const total = normalizedErrors.length + normalizedOthers.length;
  793. if (d.level === 'error') {
  794. normalizedErrors.push(d);
  795. }
  796. else if (total < MAX_ERRORS) {
  797. normalizedOthers.push(d);
  798. }
  799. }
  800. return [...normalizedErrors, ...normalizedOthers];
  801. };
  802. /**
  803. * Perform post-processing on a `Diagnostic` to handle a few message edge cases, massaging error message text and
  804. * updating build failure contexts
  805. * @param compilerCtx the current compiler
  806. * @param diagnostic the diagnostic to normalize
  807. * @returns the altered diagnostic
  808. */
  809. const normalizeDiagnostic = (compilerCtx, diagnostic) => {
  810. if (diagnostic.messageText) {
  811. if (typeof diagnostic.messageText.message === 'string') {
  812. diagnostic.messageText = diagnostic.messageText.message;
  813. }
  814. else if (typeof diagnostic.messageText === 'string' && diagnostic.messageText.indexOf('Error: ') === 0) {
  815. diagnostic.messageText = diagnostic.messageText.slice(7);
  816. }
  817. }
  818. if (diagnostic.messageText) {
  819. if (diagnostic.messageText.includes(`Cannot find name 'h'`)) {
  820. diagnostic.header = `Missing "h" import for JSX types`;
  821. diagnostic.messageText = `In order to load accurate JSX types for components, the "h" function must be imported from "@stencil/core" by each component using JSX. For example: import { Component, h } from '@stencil/core';`;
  822. try {
  823. const sourceText = compilerCtx.fs.readFileSync(diagnostic.absFilePath);
  824. const srcLines = splitLineBreaks(sourceText);
  825. for (let i = 0; i < srcLines.length; i++) {
  826. const srcLine = srcLines[i];
  827. if (srcLine.includes('@stencil/core')) {
  828. const msgLines = [];
  829. const beforeLineIndex = i - 1;
  830. if (beforeLineIndex > -1) {
  831. const beforeLine = {
  832. lineIndex: beforeLineIndex,
  833. lineNumber: beforeLineIndex + 1,
  834. text: srcLines[beforeLineIndex],
  835. errorCharStart: -1,
  836. errorLength: -1,
  837. };
  838. msgLines.push(beforeLine);
  839. }
  840. const errorLine = {
  841. lineIndex: i,
  842. lineNumber: i + 1,
  843. text: srcLine,
  844. errorCharStart: 0,
  845. errorLength: -1,
  846. };
  847. msgLines.push(errorLine);
  848. diagnostic.lineNumber = errorLine.lineNumber;
  849. diagnostic.columnNumber = srcLine.indexOf('}');
  850. const afterLineIndex = i + 1;
  851. if (afterLineIndex < srcLines.length) {
  852. const afterLine = {
  853. lineIndex: afterLineIndex,
  854. lineNumber: afterLineIndex + 1,
  855. text: srcLines[afterLineIndex],
  856. errorCharStart: -1,
  857. errorLength: -1,
  858. };
  859. msgLines.push(afterLine);
  860. }
  861. diagnostic.lines = msgLines;
  862. break;
  863. }
  864. }
  865. }
  866. catch (e) { }
  867. }
  868. }
  869. return diagnostic;
  870. };
  871. /**
  872. * Split a corpus by newlines. Carriage returns are treated a newlines.
  873. * @param sourceText the corpus to split
  874. * @returns the split text
  875. */
  876. const splitLineBreaks = (sourceText) => {
  877. if (typeof sourceText !== 'string')
  878. return [];
  879. sourceText = sourceText.replace(/\\r/g, '\n');
  880. return sourceText.split('\n');
  881. };
  882. const escapeHtml = (unsafe) => {
  883. if (unsafe === undefined)
  884. return 'undefined';
  885. if (unsafe === null)
  886. return 'null';
  887. if (typeof unsafe !== 'string') {
  888. unsafe = unsafe.toString();
  889. }
  890. return unsafe
  891. .replace(/&/g, '&amp;')
  892. .replace(/</g, '&lt;')
  893. .replace(/>/g, '&gt;')
  894. .replace(/"/g, '&quot;')
  895. .replace(/'/g, '&#039;');
  896. };
  897. const MAX_ERRORS = 25;
  898. /**
  899. * Builds a template `Diagnostic` entity for a build error. The created `Diagnostic` is returned, and have little
  900. * detail attached to it regarding the specifics of the error - it is the responsibility of the caller of this method
  901. * to attach the specifics of the error message.
  902. *
  903. * The created `Diagnostic` is pushed to the `diagnostics` argument as a side effect of calling this method.
  904. *
  905. * @param diagnostics the existing diagnostics that the created template `Diagnostic` should be added to
  906. * @returns the created `Diagnostic`
  907. */
  908. const buildError = (diagnostics) => {
  909. const diagnostic = {
  910. level: 'error',
  911. type: 'build',
  912. header: 'Build Error',
  913. messageText: 'build error',
  914. relFilePath: null,
  915. absFilePath: null,
  916. lines: [],
  917. };
  918. if (diagnostics) {
  919. diagnostics.push(diagnostic);
  920. }
  921. return diagnostic;
  922. };
  923. /**
  924. * Builds a template `Diagnostic` entity for a build warning. The created `Diagnostic` is returned, and have little
  925. * detail attached to it regarding the specifics of the warning - it is the responsibility of the caller of this method
  926. * to attach the specifics of the warning message.
  927. *
  928. * The created `Diagnostic` is pushed to the `diagnostics` argument as a side effect of calling this method.
  929. *
  930. * @param diagnostics the existing diagnostics that the created template `Diagnostic` should be added to
  931. * @returns the created `Diagnostic`
  932. */
  933. const buildWarn = (diagnostics) => {
  934. const diagnostic = {
  935. level: 'warn',
  936. type: 'build',
  937. header: 'Build Warn',
  938. messageText: 'build warn',
  939. relFilePath: null,
  940. absFilePath: null,
  941. lines: [],
  942. };
  943. diagnostics.push(diagnostic);
  944. return diagnostic;
  945. };
  946. const buildJsonFileError = (compilerCtx, diagnostics, jsonFilePath, msg, pkgKey) => {
  947. const err = buildError(diagnostics);
  948. err.messageText = msg;
  949. err.absFilePath = jsonFilePath;
  950. if (typeof pkgKey === 'string') {
  951. try {
  952. const jsonStr = compilerCtx.fs.readFileSync(jsonFilePath);
  953. const lines = jsonStr.replace(/\r/g, '\n').split('\n');
  954. for (let i = 0; i < lines.length; i++) {
  955. const txtLine = lines[i];
  956. const txtIndex = txtLine.indexOf(pkgKey);
  957. if (txtIndex > -1) {
  958. const warnLine = {
  959. lineIndex: i,
  960. lineNumber: i + 1,
  961. text: txtLine,
  962. errorCharStart: txtIndex,
  963. errorLength: pkgKey.length,
  964. };
  965. err.lineNumber = warnLine.lineNumber;
  966. err.columnNumber = txtIndex + 1;
  967. err.lines.push(warnLine);
  968. if (i >= 0) {
  969. const beforeWarnLine = {
  970. lineIndex: warnLine.lineIndex - 1,
  971. lineNumber: warnLine.lineNumber - 1,
  972. text: lines[i - 1],
  973. errorCharStart: -1,
  974. errorLength: -1,
  975. };
  976. err.lines.unshift(beforeWarnLine);
  977. }
  978. if (i < lines.length) {
  979. const afterWarnLine = {
  980. lineIndex: warnLine.lineIndex + 1,
  981. lineNumber: warnLine.lineNumber + 1,
  982. text: lines[i + 1],
  983. errorCharStart: -1,
  984. errorLength: -1,
  985. };
  986. err.lines.push(afterWarnLine);
  987. }
  988. break;
  989. }
  990. }
  991. }
  992. catch (e) { }
  993. }
  994. return err;
  995. };
  996. /**
  997. * Builds a diagnostic from an `Error`, appends it to the `diagnostics` parameter, and returns the created diagnostic
  998. * @param diagnostics the series of diagnostics the newly created diagnostics should be added to
  999. * @param err the error to derive information from in generating the diagnostic
  1000. * @param msg an optional message to use in place of `err` to generate the diagnostic
  1001. * @returns the generated diagnostic
  1002. */
  1003. const catchError = (diagnostics, err, msg) => {
  1004. const diagnostic = {
  1005. level: 'error',
  1006. type: 'build',
  1007. header: 'Build Error',
  1008. messageText: 'build error',
  1009. relFilePath: null,
  1010. absFilePath: null,
  1011. lines: [],
  1012. };
  1013. if (isString$1(msg)) {
  1014. diagnostic.messageText = msg.length ? msg : 'UNKNOWN ERROR';
  1015. }
  1016. else if (err != null) {
  1017. if (err.stack != null) {
  1018. diagnostic.messageText = err.stack.toString();
  1019. }
  1020. else {
  1021. if (err.message != null) {
  1022. diagnostic.messageText = err.message.length ? err.message : 'UNKNOWN ERROR';
  1023. }
  1024. else {
  1025. diagnostic.messageText = err.toString();
  1026. }
  1027. }
  1028. }
  1029. if (diagnostics != null && !shouldIgnoreError(diagnostic.messageText)) {
  1030. diagnostics.push(diagnostic);
  1031. }
  1032. return diagnostic;
  1033. };
  1034. /**
  1035. * Determine if the provided diagnostics have any build errors
  1036. * @param diagnostics the diagnostics to inspect
  1037. * @returns true if any of the diagnostics in the list provided are errors that did not occur at runtime. false
  1038. * otherwise.
  1039. */
  1040. const hasError = (diagnostics) => {
  1041. if (diagnostics == null || diagnostics.length === 0) {
  1042. return false;
  1043. }
  1044. return diagnostics.some((d) => d.level === 'error' && d.type !== 'runtime');
  1045. };
  1046. /**
  1047. * Determine if the provided diagnostics have any warnings
  1048. * @param diagnostics the diagnostics to inspect
  1049. * @returns true if any of the diagnostics in the list provided are warnings. false otherwise.
  1050. */
  1051. const hasWarning = (diagnostics) => {
  1052. if (diagnostics == null || diagnostics.length === 0) {
  1053. return false;
  1054. }
  1055. return diagnostics.some((d) => d.level === 'warn');
  1056. };
  1057. const shouldIgnoreError = (msg) => {
  1058. return msg === TASK_CANCELED_MSG;
  1059. };
  1060. const TASK_CANCELED_MSG = `task canceled`;
  1061. const loadRollupDiagnostics = (config, compilerCtx, buildCtx, rollupError) => {
  1062. const formattedCode = formatErrorCode(rollupError.code);
  1063. const diagnostic = {
  1064. level: 'error',
  1065. type: 'bundling',
  1066. language: 'javascript',
  1067. code: rollupError.code,
  1068. header: `Rollup${formattedCode.length > 0 ? ': ' + formattedCode : ''}`,
  1069. messageText: formattedCode,
  1070. relFilePath: null,
  1071. absFilePath: null,
  1072. lines: [],
  1073. };
  1074. if (config.logLevel === 'debug' && rollupError.stack) {
  1075. diagnostic.messageText = rollupError.stack;
  1076. }
  1077. else if (rollupError.message) {
  1078. diagnostic.messageText = rollupError.message;
  1079. }
  1080. if (rollupError.plugin) {
  1081. diagnostic.messageText += ` (plugin: ${rollupError.plugin}${rollupError.hook ? `, ${rollupError.hook}` : ''})`;
  1082. }
  1083. const loc = rollupError.loc;
  1084. if (loc != null) {
  1085. const srcFile = loc.file || rollupError.id;
  1086. if (isString$1(srcFile)) {
  1087. try {
  1088. const sourceText = compilerCtx.fs.readFileSync(srcFile);
  1089. if (sourceText) {
  1090. diagnostic.absFilePath = srcFile;
  1091. try {
  1092. const srcLines = splitLineBreaks(sourceText);
  1093. const errorLine = {
  1094. lineIndex: loc.line - 1,
  1095. lineNumber: loc.line,
  1096. text: srcLines[loc.line - 1],
  1097. errorCharStart: loc.column,
  1098. errorLength: 0,
  1099. };
  1100. diagnostic.lineNumber = errorLine.lineNumber;
  1101. diagnostic.columnNumber = errorLine.errorCharStart;
  1102. const highlightLine = errorLine.text.slice(loc.column);
  1103. for (let i = 0; i < highlightLine.length; i++) {
  1104. if (charBreak.has(highlightLine.charAt(i))) {
  1105. break;
  1106. }
  1107. errorLine.errorLength++;
  1108. }
  1109. diagnostic.lines.push(errorLine);
  1110. if (errorLine.errorLength === 0 && errorLine.errorCharStart > 0) {
  1111. errorLine.errorLength = 1;
  1112. errorLine.errorCharStart--;
  1113. }
  1114. if (errorLine.lineIndex > 0) {
  1115. const previousLine = {
  1116. lineIndex: errorLine.lineIndex - 1,
  1117. lineNumber: errorLine.lineNumber - 1,
  1118. text: srcLines[errorLine.lineIndex - 1],
  1119. errorCharStart: -1,
  1120. errorLength: -1,
  1121. };
  1122. diagnostic.lines.unshift(previousLine);
  1123. }
  1124. if (errorLine.lineIndex + 1 < srcLines.length) {
  1125. const nextLine = {
  1126. lineIndex: errorLine.lineIndex + 1,
  1127. lineNumber: errorLine.lineNumber + 1,
  1128. text: srcLines[errorLine.lineIndex + 1],
  1129. errorCharStart: -1,
  1130. errorLength: -1,
  1131. };
  1132. diagnostic.lines.push(nextLine);
  1133. }
  1134. }
  1135. catch (e) {
  1136. diagnostic.messageText += `\nError parsing: ${diagnostic.absFilePath}, line: ${loc.line}, column: ${loc.column}`;
  1137. diagnostic.debugText = sourceText;
  1138. }
  1139. }
  1140. else if (typeof rollupError.frame === 'string') {
  1141. diagnostic.messageText += '\n' + rollupError.frame;
  1142. }
  1143. }
  1144. catch (e) { }
  1145. }
  1146. }
  1147. buildCtx.diagnostics.push(diagnostic);
  1148. };
  1149. const createOnWarnFn = (diagnostics, bundleModulesFiles) => {
  1150. const previousWarns = new Set();
  1151. return function onWarningMessage(warning) {
  1152. if (warning == null || ignoreWarnCodes.has(warning.code) || previousWarns.has(warning.message)) {
  1153. return;
  1154. }
  1155. previousWarns.add(warning.message);
  1156. let label = '';
  1157. if (bundleModulesFiles) {
  1158. label = bundleModulesFiles
  1159. .reduce((cmps, m) => {
  1160. cmps.push(...m.cmps);
  1161. return cmps;
  1162. }, [])
  1163. .join(', ')
  1164. .trim();
  1165. if (label.length) {
  1166. label += ': ';
  1167. }
  1168. }
  1169. const diagnostic = buildWarn(diagnostics);
  1170. diagnostic.header = `Bundling Warning ${warning.code}`;
  1171. diagnostic.messageText = label + (warning.message || warning);
  1172. };
  1173. };
  1174. const ignoreWarnCodes = new Set([
  1175. 'THIS_IS_UNDEFINED',
  1176. 'NON_EXISTENT_EXPORT',
  1177. 'CIRCULAR_DEPENDENCY',
  1178. 'EMPTY_BUNDLE',
  1179. 'UNUSED_EXTERNAL_IMPORT',
  1180. ]);
  1181. const charBreak = new Set([' ', '=', '.', ',', '?', ':', ';', '(', ')', '{', '}', '[', ']', '|', `'`, `"`, '`']);
  1182. const formatErrorCode = (errorCode) => {
  1183. if (typeof errorCode === 'string') {
  1184. return errorCode
  1185. .split('_')
  1186. .map((c) => {
  1187. return toTitleCase(c.toLowerCase());
  1188. })
  1189. .join(' ');
  1190. }
  1191. return (errorCode || '').trim();
  1192. };
  1193. /**
  1194. * Convert Windows backslash paths to slash paths: foo\\bar ➔ foo/bar
  1195. * Forward-slash paths can be used in Windows as long as they're not
  1196. * extended-length paths and don't contain any non-ascii characters.
  1197. * This was created since the path methods in Node.js outputs \\ paths on Windows.
  1198. */
  1199. const normalizePath$1 = (path) => {
  1200. if (typeof path !== 'string') {
  1201. throw new Error(`invalid path to normalize`);
  1202. }
  1203. path = normalizeSlashes(path.trim());
  1204. const components = pathComponents(path, getRootLength(path));
  1205. const reducedComponents = reducePathComponents(components);
  1206. const rootPart = reducedComponents[0];
  1207. const secondPart = reducedComponents[1];
  1208. const normalized = rootPart + reducedComponents.slice(1).join('/');
  1209. if (normalized === '') {
  1210. return '.';
  1211. }
  1212. if (rootPart === '' &&
  1213. secondPart &&
  1214. path.includes('/') &&
  1215. !secondPart.startsWith('.') &&
  1216. !secondPart.startsWith('@')) {
  1217. return './' + normalized;
  1218. }
  1219. return normalized;
  1220. };
  1221. const normalizeSlashes = (path) => path.replace(backslashRegExp, '/');
  1222. const altDirectorySeparator = '\\';
  1223. const urlSchemeSeparator = '://';
  1224. const backslashRegExp = /\\/g;
  1225. const reducePathComponents = (components) => {
  1226. if (!Array.isArray(components) || components.length === 0) {
  1227. return [];
  1228. }
  1229. const reduced = [components[0]];
  1230. for (let i = 1; i < components.length; i++) {
  1231. const component = components[i];
  1232. if (!component)
  1233. continue;
  1234. if (component === '.')
  1235. continue;
  1236. if (component === '..') {
  1237. if (reduced.length > 1) {
  1238. if (reduced[reduced.length - 1] !== '..') {
  1239. reduced.pop();
  1240. continue;
  1241. }
  1242. }
  1243. else if (reduced[0])
  1244. continue;
  1245. }
  1246. reduced.push(component);
  1247. }
  1248. return reduced;
  1249. };
  1250. const getRootLength = (path) => {
  1251. const rootLength = getEncodedRootLength(path);
  1252. return rootLength < 0 ? ~rootLength : rootLength;
  1253. };
  1254. const getEncodedRootLength = (path) => {
  1255. if (!path)
  1256. return 0;
  1257. const ch0 = path.charCodeAt(0);
  1258. // POSIX or UNC
  1259. if (ch0 === 47 /* slash */ || ch0 === 92 /* backslash */) {
  1260. if (path.charCodeAt(1) !== ch0)
  1261. return 1; // POSIX: "/" (or non-normalized "\")
  1262. const p1 = path.indexOf(ch0 === 47 /* slash */ ? '/' : altDirectorySeparator, 2);
  1263. if (p1 < 0)
  1264. return path.length; // UNC: "//server" or "\\server"
  1265. return p1 + 1; // UNC: "//server/" or "\\server\"
  1266. }
  1267. // DOS
  1268. if (isVolumeCharacter(ch0) && path.charCodeAt(1) === 58 /* colon */) {
  1269. const ch2 = path.charCodeAt(2);
  1270. if (ch2 === 47 /* slash */ || ch2 === 92 /* backslash */)
  1271. return 3; // DOS: "c:/" or "c:\"
  1272. if (path.length === 2)
  1273. return 2; // DOS: "c:" (but not "c:d")
  1274. }
  1275. // URL
  1276. const schemeEnd = path.indexOf(urlSchemeSeparator);
  1277. if (schemeEnd !== -1) {
  1278. const authorityStart = schemeEnd + urlSchemeSeparator.length;
  1279. const authorityEnd = path.indexOf('/', authorityStart);
  1280. if (authorityEnd !== -1) {
  1281. // URL: "file:///", "file://server/", "file://server/path"
  1282. // For local "file" URLs, include the leading DOS volume (if present).
  1283. // Per https://www.ietf.org/rfc/rfc1738.txt, a host of "" or "localhost" is a
  1284. // special case interpreted as "the machine from which the URL is being interpreted".
  1285. const scheme = path.slice(0, schemeEnd);
  1286. const authority = path.slice(authorityStart, authorityEnd);
  1287. if (scheme === 'file' &&
  1288. (authority === '' || authority === 'localhost') &&
  1289. isVolumeCharacter(path.charCodeAt(authorityEnd + 1))) {
  1290. const volumeSeparatorEnd = getFileUrlVolumeSeparatorEnd(path, authorityEnd + 2);
  1291. if (volumeSeparatorEnd !== -1) {
  1292. if (path.charCodeAt(volumeSeparatorEnd) === 47 /* slash */) {
  1293. // URL: "file:///c:/", "file://localhost/c:/", "file:///c%3a/", "file://localhost/c%3a/"
  1294. return ~(volumeSeparatorEnd + 1);
  1295. }
  1296. if (volumeSeparatorEnd === path.length) {
  1297. // URL: "file:///c:", "file://localhost/c:", "file:///c$3a", "file://localhost/c%3a"
  1298. // but not "file:///c:d" or "file:///c%3ad"
  1299. return ~volumeSeparatorEnd;
  1300. }
  1301. }
  1302. }
  1303. return ~(authorityEnd + 1); // URL: "file://server/", "http://server/"
  1304. }
  1305. return ~path.length; // URL: "file://server", "http://server"
  1306. }
  1307. // relative
  1308. return 0;
  1309. };
  1310. const isVolumeCharacter = (charCode) => (charCode >= 97 /* a */ && charCode <= 122 /* z */) ||
  1311. (charCode >= 65 /* A */ && charCode <= 90 /* Z */);
  1312. const getFileUrlVolumeSeparatorEnd = (url, start) => {
  1313. const ch0 = url.charCodeAt(start);
  1314. if (ch0 === 58 /* colon */)
  1315. return start + 1;
  1316. if (ch0 === 37 /* percent */ && url.charCodeAt(start + 1) === 51 /* _3 */) {
  1317. const ch2 = url.charCodeAt(start + 2);
  1318. if (ch2 === 97 /* a */ || ch2 === 65 /* A */)
  1319. return start + 3;
  1320. }
  1321. return -1;
  1322. };
  1323. const pathComponents = (path, rootLength) => {
  1324. const root = path.substring(0, rootLength);
  1325. const rest = path.substring(rootLength).split('/');
  1326. const restLen = rest.length;
  1327. if (restLen > 0 && !rest[restLen - 1]) {
  1328. rest.pop();
  1329. }
  1330. return [root, ...rest];
  1331. };
  1332. /**
  1333. * Same as normalizePath(), expect it'll also strip any querystrings
  1334. * from the path name. So /dir/file.css?tag=cmp-a becomes /dir/file.css
  1335. */
  1336. const normalizeFsPath = (p) => normalizePath$1(p.split('?')[0].replace(/\0/g, ''));
  1337. const normalizeFsPathQuery = (importPath) => {
  1338. const pathParts = importPath.split('?');
  1339. const filePath = normalizePath$1(pathParts[0]);
  1340. const ext = filePath.split('.').pop().toLowerCase();
  1341. const params = pathParts.length > 1 ? new URLSearchParams(pathParts[1]) : null;
  1342. const format = params ? params.get('format') : null;
  1343. return {
  1344. filePath,
  1345. ext,
  1346. params,
  1347. format,
  1348. };
  1349. };
  1350. /**
  1351. * Augment a `Diagnostic` with information from a `Node` in the AST to provide richer error information
  1352. * @param d the diagnostic to augment
  1353. * @param node the node to augment with additional information
  1354. * @returns the augmented diagnostic
  1355. */
  1356. const augmentDiagnosticWithNode = (d, node) => {
  1357. if (!node) {
  1358. return d;
  1359. }
  1360. const sourceFile = node.getSourceFile();
  1361. if (!sourceFile) {
  1362. return d;
  1363. }
  1364. d.absFilePath = normalizePath$1(sourceFile.fileName);
  1365. const sourceText = sourceFile.text;
  1366. const srcLines = splitLineBreaks(sourceText);
  1367. const start = node.getStart();
  1368. const end = node.getEnd();
  1369. const posStart = sourceFile.getLineAndCharacterOfPosition(start);
  1370. const errorLine = {
  1371. lineIndex: posStart.line,
  1372. lineNumber: posStart.line + 1,
  1373. text: srcLines[posStart.line],
  1374. errorCharStart: posStart.character,
  1375. errorLength: Math.max(end - start, 1),
  1376. };
  1377. // store metadata for line number and character index where the error occurred
  1378. d.lineNumber = errorLine.lineNumber;
  1379. d.columnNumber = errorLine.errorCharStart + 1;
  1380. d.lines.push(errorLine);
  1381. if (errorLine.errorLength === 0 && errorLine.errorCharStart > 0) {
  1382. errorLine.errorLength = 1;
  1383. errorLine.errorCharStart--;
  1384. }
  1385. // if the error did not occur on the first line of the file, add metadata for the line of code preceding the line
  1386. // where the error was detected to provide the user with additional context
  1387. if (errorLine.lineIndex > 0) {
  1388. const previousLine = {
  1389. lineIndex: errorLine.lineIndex - 1,
  1390. lineNumber: errorLine.lineNumber - 1,
  1391. text: srcLines[errorLine.lineIndex - 1],
  1392. errorCharStart: -1,
  1393. errorLength: -1,
  1394. };
  1395. d.lines.unshift(previousLine);
  1396. }
  1397. // if the error did not occur on the last line of the file, add metadata for the line of code following the line
  1398. // where the error was detected to provide the user with additional context
  1399. if (errorLine.lineIndex + 1 < srcLines.length) {
  1400. const nextLine = {
  1401. lineIndex: errorLine.lineIndex + 1,
  1402. lineNumber: errorLine.lineNumber + 1,
  1403. text: srcLines[errorLine.lineIndex + 1],
  1404. errorCharStart: -1,
  1405. errorLength: -1,
  1406. };
  1407. d.lines.push(nextLine);
  1408. }
  1409. return d;
  1410. };
  1411. /**
  1412. * Ok, so formatting overkill, we know. But whatever, it makes for great
  1413. * error reporting within a terminal. So, yeah, let's code it up, shall we?
  1414. */
  1415. const loadTypeScriptDiagnostics = (tsDiagnostics) => {
  1416. const diagnostics = [];
  1417. const maxErrors = Math.min(tsDiagnostics.length, 50);
  1418. for (let i = 0; i < maxErrors; i++) {
  1419. diagnostics.push(loadTypeScriptDiagnostic(tsDiagnostics[i]));
  1420. }
  1421. return diagnostics;
  1422. };
  1423. const loadTypeScriptDiagnostic = (tsDiagnostic) => {
  1424. const d = {
  1425. level: 'warn',
  1426. type: 'typescript',
  1427. language: 'typescript',
  1428. header: 'TypeScript',
  1429. code: tsDiagnostic.code.toString(),
  1430. messageText: flattenDiagnosticMessageText(tsDiagnostic, tsDiagnostic.messageText),
  1431. relFilePath: null,
  1432. absFilePath: null,
  1433. lines: [],
  1434. };
  1435. if (tsDiagnostic.category === 1) {
  1436. d.level = 'error';
  1437. }
  1438. if (tsDiagnostic.file) {
  1439. d.absFilePath = tsDiagnostic.file.fileName;
  1440. const sourceText = tsDiagnostic.file.text;
  1441. const srcLines = splitLineBreaks(sourceText);
  1442. const posData = tsDiagnostic.file.getLineAndCharacterOfPosition(tsDiagnostic.start);
  1443. const errorLine = {
  1444. lineIndex: posData.line,
  1445. lineNumber: posData.line + 1,
  1446. text: srcLines[posData.line],
  1447. errorCharStart: posData.character,
  1448. errorLength: Math.max(tsDiagnostic.length, 1),
  1449. };
  1450. d.lineNumber = errorLine.lineNumber;
  1451. d.columnNumber = errorLine.errorCharStart + 1;
  1452. d.lines.push(errorLine);
  1453. if (errorLine.errorLength === 0 && errorLine.errorCharStart > 0) {
  1454. errorLine.errorLength = 1;
  1455. errorLine.errorCharStart--;
  1456. }
  1457. if (errorLine.lineIndex > 0) {
  1458. const previousLine = {
  1459. lineIndex: errorLine.lineIndex - 1,
  1460. lineNumber: errorLine.lineNumber - 1,
  1461. text: srcLines[errorLine.lineIndex - 1],
  1462. errorCharStart: -1,
  1463. errorLength: -1,
  1464. };
  1465. d.lines.unshift(previousLine);
  1466. }
  1467. if (errorLine.lineIndex + 1 < srcLines.length) {
  1468. const nextLine = {
  1469. lineIndex: errorLine.lineIndex + 1,
  1470. lineNumber: errorLine.lineNumber + 1,
  1471. text: srcLines[errorLine.lineIndex + 1],
  1472. errorCharStart: -1,
  1473. errorLength: -1,
  1474. };
  1475. d.lines.push(nextLine);
  1476. }
  1477. }
  1478. return d;
  1479. };
  1480. const flattenDiagnosticMessageText = (tsDiagnostic, diag) => {
  1481. if (typeof diag === 'string') {
  1482. return diag;
  1483. }
  1484. else if (diag === undefined) {
  1485. return '';
  1486. }
  1487. const ignoreCodes = [];
  1488. const isStencilConfig = tsDiagnostic.file.fileName.includes('stencil.config');
  1489. if (isStencilConfig) {
  1490. ignoreCodes.push(2322);
  1491. }
  1492. let result = '';
  1493. if (!ignoreCodes.includes(diag.code)) {
  1494. result = diag.messageText;
  1495. if (isIterable(diag.next)) {
  1496. for (const kid of diag.next) {
  1497. result += flattenDiagnosticMessageText(tsDiagnostic, kid);
  1498. }
  1499. }
  1500. }
  1501. if (isStencilConfig) {
  1502. result = result.replace(`type 'StencilConfig'`, `Stencil Config`);
  1503. result = result.replace(`Object literal may only specify known properties, but `, ``);
  1504. result = result.replace(`Object literal may only specify known properties, and `, ``);
  1505. }
  1506. return result.trim();
  1507. };
  1508. const isRemoteUrl = (p) => {
  1509. if (isString$1(p)) {
  1510. p = p.toLowerCase();
  1511. return p.startsWith('https://') || p.startsWith('http://');
  1512. }
  1513. return false;
  1514. };
  1515. const createJsVarName = (fileName) => {
  1516. if (isString$1(fileName)) {
  1517. fileName = fileName.split('?')[0];
  1518. fileName = fileName.split('#')[0];
  1519. fileName = fileName.split('&')[0];
  1520. fileName = fileName.split('=')[0];
  1521. fileName = toDashCase(fileName);
  1522. fileName = fileName.replace(/[|;$%@"<>()+,.{}_\!\/\\]/g, '-');
  1523. fileName = dashToPascalCase$1(fileName);
  1524. if (fileName.length > 1) {
  1525. fileName = fileName[0].toLowerCase() + fileName.slice(1);
  1526. }
  1527. else {
  1528. fileName = fileName.toLowerCase();
  1529. }
  1530. if (fileName.length > 0 && !isNaN(fileName[0])) {
  1531. fileName = '_' + fileName;
  1532. }
  1533. }
  1534. return fileName;
  1535. };
  1536. /**
  1537. * Determines if a given file path points to a type declaration file (ending in .d.ts) or not. This function is
  1538. * case-insensitive in its heuristics.
  1539. * @param filePath the path to check
  1540. * @returns `true` if the given `filePath` points to a type declaration file, `false` otherwise
  1541. */
  1542. const isDtsFile$1 = (filePath) => {
  1543. const parts = filePath.toLowerCase().split('.');
  1544. if (parts.length > 2) {
  1545. return parts[parts.length - 2] === 'd' && parts[parts.length - 1] === 'ts';
  1546. }
  1547. return false;
  1548. };
  1549. /**
  1550. * Generate the preamble to be placed atop the main file of the build
  1551. * @param config the Stencil configuration file
  1552. * @return the generated preamble
  1553. */
  1554. const generatePreamble = (config) => {
  1555. const { preamble } = config;
  1556. if (!preamble) {
  1557. return '';
  1558. }
  1559. // generate the body of the JSDoc-style comment
  1560. const preambleComment = preamble.split('\n').map((l) => ` * ${l}`);
  1561. preambleComment.unshift(`/*!`);
  1562. preambleComment.push(` */`);
  1563. return preambleComment.join('\n');
  1564. };
  1565. const lineBreakRegex = /\r?\n|\r/g;
  1566. function getTextDocs(docs) {
  1567. if (docs == null) {
  1568. return '';
  1569. }
  1570. return `${docs.text.replace(lineBreakRegex, ' ')}
  1571. ${docs.tags
  1572. .filter((tag) => tag.name !== 'internal')
  1573. .map((tag) => `@${tag.name} ${(tag.text || '').replace(lineBreakRegex, ' ')}`)
  1574. .join('\n')}`.trim();
  1575. }
  1576. const getDependencies = (buildCtx) => {
  1577. if (buildCtx.packageJson != null && buildCtx.packageJson.dependencies != null) {
  1578. return Object.keys(buildCtx.packageJson.dependencies).filter((pkgName) => !SKIP_DEPS.includes(pkgName));
  1579. }
  1580. return [];
  1581. };
  1582. const hasDependency = (buildCtx, depName) => {
  1583. return getDependencies(buildCtx).includes(depName);
  1584. };
  1585. const getDynamicImportFunction$1 = (namespace) => `__sc_import_${namespace.replace(/\s|-/g, '_')}`;
  1586. const readPackageJson = async (config, compilerCtx, buildCtx) => {
  1587. try {
  1588. const pkgJson = await compilerCtx.fs.readFile(config.packageJsonFilePath);
  1589. if (pkgJson) {
  1590. const parseResults = parsePackageJson(pkgJson, config.packageJsonFilePath);
  1591. if (parseResults.diagnostic) {
  1592. buildCtx.diagnostics.push(parseResults.diagnostic);
  1593. }
  1594. else {
  1595. buildCtx.packageJson = parseResults.data;
  1596. }
  1597. }
  1598. }
  1599. catch (e) {
  1600. if (!config.outputTargets.some((o) => o.type.includes('dist'))) {
  1601. const diagnostic = buildError(buildCtx.diagnostics);
  1602. diagnostic.header = `Missing "package.json"`;
  1603. diagnostic.messageText = `Valid "package.json" file is required for distribution: ${config.packageJsonFilePath}`;
  1604. }
  1605. }
  1606. };
  1607. const parsePackageJson = (pkgJsonStr, pkgJsonFilePath) => {
  1608. if (isString$1(pkgJsonFilePath)) {
  1609. return parseJson(pkgJsonStr, pkgJsonFilePath);
  1610. }
  1611. return null;
  1612. };
  1613. const parseJson = (jsonStr, filePath) => {
  1614. const rtn = {
  1615. diagnostic: null,
  1616. data: null,
  1617. filePath,
  1618. };
  1619. if (isString$1(jsonStr)) {
  1620. try {
  1621. rtn.data = JSON.parse(jsonStr);
  1622. }
  1623. catch (e) {
  1624. rtn.diagnostic = buildError();
  1625. rtn.diagnostic.absFilePath = filePath;
  1626. rtn.diagnostic.header = `Error Parsing JSON`;
  1627. if (e instanceof Error) {
  1628. rtn.diagnostic.messageText = e.message;
  1629. }
  1630. }
  1631. }
  1632. else {
  1633. rtn.diagnostic = buildError();
  1634. rtn.diagnostic.absFilePath = filePath;
  1635. rtn.diagnostic.header = `Error Parsing JSON`;
  1636. rtn.diagnostic.messageText = `Invalid JSON input to parse`;
  1637. }
  1638. return rtn;
  1639. };
  1640. const SKIP_DEPS = ['@stencil/core'];
  1641. /**
  1642. * Validates that a component tag meets required naming conventions to be used for a web component
  1643. * @param tag the tag to validate
  1644. * @returns an error message if the tag has an invalid name, undefined if the tag name passes all checks
  1645. */
  1646. const validateComponentTag = (tag) => {
  1647. // we want to check this first since we call some String.prototype methods below
  1648. if (typeof tag !== 'string') {
  1649. return `Tag "${tag}" must be a string type`;
  1650. }
  1651. if (tag !== tag.trim()) {
  1652. return `Tag can not contain white spaces`;
  1653. }
  1654. if (tag !== tag.toLowerCase()) {
  1655. return `Tag can not contain upper case characters`;
  1656. }
  1657. if (tag.length === 0) {
  1658. return `Received empty tag value`;
  1659. }
  1660. if (tag.indexOf(' ') > -1) {
  1661. return `"${tag}" tag cannot contain a space`;
  1662. }
  1663. if (tag.indexOf(',') > -1) {
  1664. return `"${tag}" tag cannot be used for multiple tags`;
  1665. }
  1666. const invalidChars = tag.replace(/\w|-/g, '');
  1667. if (invalidChars !== '') {
  1668. return `"${tag}" tag contains invalid characters: ${invalidChars}`;
  1669. }
  1670. if (tag.indexOf('-') === -1) {
  1671. return `"${tag}" tag must contain a dash (-) to work as a valid web component`;
  1672. }
  1673. if (tag.indexOf('--') > -1) {
  1674. return `"${tag}" tag cannot contain multiple dashes (--) next to each other`;
  1675. }
  1676. if (tag.indexOf('-') === 0) {
  1677. return `"${tag}" tag cannot start with a dash (-)`;
  1678. }
  1679. if (tag.lastIndexOf('-') === tag.length - 1) {
  1680. return `"${tag}" tag cannot end with a dash (-)`;
  1681. }
  1682. return undefined;
  1683. };
  1684. /**
  1685. * Used to learn the size of a string in bytes.
  1686. *
  1687. * @param str The string to measure
  1688. * @returns number
  1689. */
  1690. const byteSize = (str) => Buffer.byteLength(str, 'utf8');
  1691. /**
  1692. * Converts a rollup provided source map to one that Stencil can easily understand
  1693. * @param rollupSourceMap the sourcemap to transform
  1694. * @returns the transformed sourcemap
  1695. */
  1696. const rollupToStencilSourceMap = (rollupSourceMap) => {
  1697. if (!rollupSourceMap) {
  1698. return null;
  1699. }
  1700. return {
  1701. file: rollupSourceMap.file,
  1702. mappings: rollupSourceMap.mappings,
  1703. names: rollupSourceMap.names,
  1704. sources: rollupSourceMap.sources,
  1705. sourcesContent: rollupSourceMap.sourcesContent,
  1706. version: rollupSourceMap.version,
  1707. };
  1708. };
  1709. /**
  1710. * A JavaScript formatted string used to link generated code back to the original. This string follows the guidelines
  1711. * found in the [Linking generated code to source maps](https://sourcemaps.info/spec.html#h.lmz475t4mvbx) section of
  1712. * the Sourcemaps V3 specification proposal.
  1713. */
  1714. const JS_SOURCE_MAPPING_URL_LINKER = '//# sourceMappingURL=';
  1715. /**
  1716. * Generates an RFC-3986 compliant string for the given input.
  1717. * More information about RFC-3986 can be found [here](https://datatracker.ietf.org/doc/html/rfc3986)
  1718. * This function's original source is derived from
  1719. * [MDN's encodeURIComponent documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent#description)
  1720. * @param filename the filename to encode
  1721. * @returns the encoded URI
  1722. */
  1723. const encodeToRfc3986 = (filename) => {
  1724. const encodedUri = encodeURIComponent(filename);
  1725. // replace all '!', single quotes, '(', ')', and '*' with their hexadecimal values (UTF-16)
  1726. return encodedUri.replace(/[!'()*]/g, (matchedCharacter) => {
  1727. return '%' + matchedCharacter.charCodeAt(0).toString(16);
  1728. });
  1729. };
  1730. /**
  1731. * Generates a string used to link generated code with the original source, to be placed at the end of the generated
  1732. * code.
  1733. * @param url the url of the source map
  1734. * @returns a linker string, of the format {@link JS_SOURCE_MAPPING_URL_LINKER}=<url>
  1735. */
  1736. const getSourceMappingUrlLinker = (url) => {
  1737. return `${JS_SOURCE_MAPPING_URL_LINKER}${encodeToRfc3986(url)}`;
  1738. };
  1739. /**
  1740. * Generates a string used to link generated code with the original source, to be placed at the end of the generated
  1741. * code as an inline source map.
  1742. * @param sourceMapContents the sourceMapContents of the source map
  1743. * @returns a linker string, of the format {@link JS_SOURCE_MAPPING_URL_LINKER}<dataUriPrefixAndMime><sourceMapContents>
  1744. */
  1745. const getInlineSourceMappingUrlLinker = (sourceMapContents) => {
  1746. const mapBase64 = Buffer.from(sourceMapContents, 'utf8').toString('base64');
  1747. // do not RFC-3986 encode an already valid base64 string. the sourcemaps will not resolve correctly when there is an
  1748. // allowed base64 character is encoded (because it is a disallowed RFC-3986 character)
  1749. return `${JS_SOURCE_MAPPING_URL_LINKER}data:application/json;charset=utf-8;base64,${mapBase64}`;
  1750. };
  1751. /**
  1752. * Generates a string used to link generated code with the original source, to be placed at the end of the generated
  1753. * code. This function prepends a newline to the string.
  1754. * @param url the url of the source map
  1755. * @returns a linker string, of the format {@link JS_SOURCE_MAPPING_URL_LINKER}=<url>.map, prepended with a newline
  1756. */
  1757. const getSourceMappingUrlForEndOfFile = (url) => {
  1758. return `\n${getSourceMappingUrlLinker(url)}.map`;
  1759. };
  1760. let basename;
  1761. let dirname;
  1762. let extname$1;
  1763. let isAbsolute$1;
  1764. let join;
  1765. let normalize$1;
  1766. let parse$7;
  1767. let relative$1;
  1768. let resolve$1;
  1769. let sep;
  1770. let delimiter;
  1771. let posix$1;
  1772. let win32$1;
  1773. const path$5 = {};
  1774. const setPlatformPath = (platformPath) => {
  1775. if (!platformPath) {
  1776. platformPath = pathBrowserify;
  1777. }
  1778. Object.assign(path$5, platformPath);
  1779. const normalizeOrg = path$5.normalize;
  1780. const joinOrg = path$5.join;
  1781. const relativeOrg = path$5.relative;
  1782. const resolveOrg = path$5.resolve;
  1783. normalize$1 = path$5.normalize = (...args) => normalizePath$1(normalizeOrg.apply(path$5, args));
  1784. join = path$5.join = (...args) => normalizePath$1(joinOrg.apply(path$5, args));
  1785. relative$1 = path$5.relative = (...args) => normalizePath$1(relativeOrg.apply(path$5, args));
  1786. resolve$1 = path$5.resolve = (...args) => normalizePath$1(resolveOrg.apply(path$5, args));
  1787. basename = path$5.basename;
  1788. dirname = path$5.dirname;
  1789. extname$1 = path$5.extname;
  1790. isAbsolute$1 = path$5.isAbsolute;
  1791. parse$7 = path$5.parse;
  1792. sep = path$5.sep;
  1793. delimiter = path$5.delimiter;
  1794. posix$1 = path$5.posix;
  1795. if (path$5.win32) {
  1796. win32$1 = path$5.win32;
  1797. }
  1798. else {
  1799. win32$1 = { ...posix$1 };
  1800. win32$1.sep = '\\';
  1801. }
  1802. };
  1803. setPlatformPath(IS_NODE_ENV ? requireFunc('path') : pathBrowserify);
  1804. const path$6 = {
  1805. __proto__: null,
  1806. get basename () { return basename; },
  1807. get dirname () { return dirname; },
  1808. get extname () { return extname$1; },
  1809. get isAbsolute () { return isAbsolute$1; },
  1810. get join () { return join; },
  1811. get normalize () { return normalize$1; },
  1812. get parse () { return parse$7; },
  1813. get relative () { return relative$1; },
  1814. get resolve () { return resolve$1; },
  1815. get sep () { return sep; },
  1816. get delimiter () { return delimiter; },
  1817. get posix () { return posix$1; },
  1818. get win32 () { return win32$1; },
  1819. path: path$5,
  1820. setPlatformPath: setPlatformPath,
  1821. 'default': path$5
  1822. };
  1823. var commonjsGlobal$1 = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
  1824. function createCommonjsModule$1(fn, basedir, module) {
  1825. return module = {
  1826. path: basedir,
  1827. exports: {},
  1828. require: function (path, base) {
  1829. return commonjsRequire$1();
  1830. }
  1831. }, fn(module, module.exports), module.exports;
  1832. }
  1833. function getAugmentedNamespace$1(n) {
  1834. if (n.__esModule) return n;
  1835. var a = Object.defineProperty({}, '__esModule', {value: true});
  1836. Object.keys(n).forEach(function (k) {
  1837. var d = Object.getOwnPropertyDescriptor(n, k);
  1838. Object.defineProperty(a, k, d.get ? d : {
  1839. enumerable: true,
  1840. get: function () {
  1841. return n[k];
  1842. }
  1843. });
  1844. });
  1845. return a;
  1846. }
  1847. function commonjsRequire$1 () {
  1848. throw new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs');
  1849. }
  1850. // for now just expose the builtin process global from node.js
  1851. var process_1 = commonjsGlobal$1.process;
  1852. const process$3 = /*#__PURE__*/Object.assign(/*#__PURE__*/Object.create(null), process_1, {
  1853. 'default': process_1
  1854. });
  1855. const EOL = '\n';
  1856. const platform = () => OS_PLATFORM;
  1857. const os$2 = {
  1858. EOL,
  1859. platform,
  1860. };
  1861. const os$3 = {
  1862. __proto__: null,
  1863. EOL: EOL,
  1864. platform: platform,
  1865. 'default': os$2
  1866. };
  1867. const buildEvents = () => {
  1868. const evCallbacks = [];
  1869. const off = (callback) => {
  1870. const index = evCallbacks.findIndex((ev) => ev.callback === callback);
  1871. if (index > -1) {
  1872. evCallbacks.splice(index, 1);
  1873. return true;
  1874. }
  1875. return false;
  1876. };
  1877. const on = (arg0, arg1) => {
  1878. if (typeof arg0 === 'function') {
  1879. const eventName = null;
  1880. const callback = arg0;
  1881. evCallbacks.push({
  1882. eventName,
  1883. callback,
  1884. });
  1885. return () => off(callback);
  1886. }
  1887. else if (typeof arg0 === 'string' && typeof arg1 === 'function') {
  1888. const eventName = arg0.toLowerCase().trim();
  1889. const callback = arg1;
  1890. evCallbacks.push({
  1891. eventName,
  1892. callback,
  1893. });
  1894. return () => off(callback);
  1895. }
  1896. return () => false;
  1897. };
  1898. const emit = (eventName, data) => {
  1899. const normalizedEventName = eventName.toLowerCase().trim();
  1900. const callbacks = evCallbacks.slice();
  1901. for (const ev of callbacks) {
  1902. if (ev.eventName == null) {
  1903. try {
  1904. ev.callback(eventName, data);
  1905. }
  1906. catch (e) {
  1907. console.error(e);
  1908. }
  1909. }
  1910. else if (ev.eventName === normalizedEventName) {
  1911. try {
  1912. ev.callback(data);
  1913. }
  1914. catch (e) {
  1915. console.error(e);
  1916. }
  1917. }
  1918. }
  1919. };
  1920. const unsubscribeAll = () => {
  1921. evCallbacks.length = 0;
  1922. };
  1923. return {
  1924. emit,
  1925. on,
  1926. unsubscribeAll,
  1927. };
  1928. };
  1929. const createLogger = () => {
  1930. let useColors = IS_BROWSER_ENV;
  1931. let level = 'info';
  1932. const logger = {
  1933. enableColors: (uc) => (useColors = uc),
  1934. getLevel: () => level,
  1935. setLevel: (l) => (level = l),
  1936. emoji: (e) => e,
  1937. info: console.log.bind(console),
  1938. warn: console.warn.bind(console),
  1939. error: console.error.bind(console),
  1940. debug: console.debug.bind(console),
  1941. red: (msg) => msg,
  1942. green: (msg) => msg,
  1943. yellow: (msg) => msg,
  1944. blue: (msg) => msg,
  1945. magenta: (msg) => msg,
  1946. cyan: (msg) => msg,
  1947. gray: (msg) => msg,
  1948. bold: (msg) => msg,
  1949. dim: (msg) => msg,
  1950. bgRed: (msg) => msg,
  1951. createTimeSpan: (_startMsg, _debug = false) => ({
  1952. duration: () => 0,
  1953. finish: () => 0,
  1954. }),
  1955. printDiagnostics(diagnostics) {
  1956. diagnostics.forEach((diagnostic) => logDiagnostic(diagnostic, useColors));
  1957. },
  1958. };
  1959. return logger;
  1960. };
  1961. const logDiagnostic = (diagnostic, useColors) => {
  1962. let color = BLUE;
  1963. let prefix = 'Build';
  1964. let msg = '';
  1965. if (diagnostic.level === 'error') {
  1966. color = RED;
  1967. prefix = 'Error';
  1968. }
  1969. else if (diagnostic.level === 'warn') {
  1970. color = YELLOW;
  1971. prefix = 'Warning';
  1972. }
  1973. if (diagnostic.header) {
  1974. prefix = diagnostic.header;
  1975. }
  1976. const filePath = diagnostic.relFilePath || diagnostic.absFilePath;
  1977. if (filePath) {
  1978. msg += filePath;
  1979. if (typeof diagnostic.lineNumber === 'number' && diagnostic.lineNumber > 0) {
  1980. msg += ', line ' + diagnostic.lineNumber;
  1981. if (typeof diagnostic.columnNumber === 'number' && diagnostic.columnNumber > 0) {
  1982. msg += ', column ' + diagnostic.columnNumber;
  1983. }
  1984. }
  1985. msg += '\n';
  1986. }
  1987. msg += diagnostic.messageText;
  1988. if (diagnostic.lines && diagnostic.lines.length > 0) {
  1989. diagnostic.lines.forEach((l) => {
  1990. msg += '\n' + l.lineNumber + ': ' + l.text;
  1991. });
  1992. msg += '\n';
  1993. }
  1994. if (useColors) {
  1995. const styledPrefix = [
  1996. '%c' + prefix,
  1997. `background: ${color}; color: white; padding: 2px 3px; border-radius: 2px; font-size: 0.8em;`,
  1998. ];
  1999. console.log(...styledPrefix, msg);
  2000. }
  2001. else if (diagnostic.level === 'error') {
  2002. console.error(msg);
  2003. }
  2004. else if (diagnostic.level === 'warn') {
  2005. console.warn(msg);
  2006. }
  2007. else {
  2008. console.log(msg);
  2009. }
  2010. };
  2011. const YELLOW = `#f39c12`;
  2012. const RED = `#c0392b`;
  2013. const BLUE = `#3498db`;
  2014. const createWebWorkerMainController = (sys, maxConcurrentWorkers) => {
  2015. let msgIds = 0;
  2016. let isDestroyed = false;
  2017. let isQueued = false;
  2018. let workerIds = 0;
  2019. let workerBlob;
  2020. const tasks = new Map();
  2021. const queuedSendMsgs = [];
  2022. const workers = [];
  2023. const maxWorkers = Math.max(Math.min(maxConcurrentWorkers, sys.hardwareConcurrency), 2) - 1;
  2024. const tick = Promise.resolve();
  2025. const onMsgsFromWorker = (worker, ev) => {
  2026. if (!isDestroyed) {
  2027. const msgsFromWorker = ev.data;
  2028. if (Array.isArray(msgsFromWorker)) {
  2029. for (const msgFromWorker of msgsFromWorker) {
  2030. if (msgFromWorker) {
  2031. const task = tasks.get(msgFromWorker.stencilId);
  2032. if (task) {
  2033. tasks.delete(msgFromWorker.stencilId);
  2034. if (msgFromWorker.stencilRtnError) {
  2035. task.reject(msgFromWorker.stencilRtnError);
  2036. }
  2037. else {
  2038. task.resolve(msgFromWorker.stencilRtnValue);
  2039. }
  2040. worker.activeTasks--;
  2041. if (worker.activeTasks < 0 || worker.activeTasks > 50) {
  2042. worker.activeTasks = 0;
  2043. }
  2044. }
  2045. else if (msgFromWorker.stencilRtnError) {
  2046. console.error(msgFromWorker.stencilRtnError);
  2047. }
  2048. }
  2049. }
  2050. }
  2051. }
  2052. };
  2053. const onWorkerError = (e) => console.error(e);
  2054. const createWorkerMain = () => {
  2055. let worker = null;
  2056. const workerUrl = sys.getCompilerExecutingPath();
  2057. const workerOpts = {
  2058. name: `stencil.worker.${workerIds++}`,
  2059. };
  2060. try {
  2061. // first try directly starting the worker with the URL
  2062. worker = new Worker(workerUrl, workerOpts);
  2063. }
  2064. catch (e) {
  2065. // probably a cross-origin issue, try using a Blob instead
  2066. if (workerBlob == null) {
  2067. workerBlob = new Blob([`importScripts('${workerUrl}');`], { type: 'application/javascript' });
  2068. }
  2069. worker = new Worker(URL.createObjectURL(workerBlob), workerOpts);
  2070. }
  2071. const workerChild = {
  2072. worker,
  2073. activeTasks: 0,
  2074. sendQueue: [],
  2075. };
  2076. worker.onerror = onWorkerError;
  2077. worker.onmessage = (ev) => onMsgsFromWorker(workerChild, ev);
  2078. return workerChild;
  2079. };
  2080. const sendMsgsToWorkers = (w) => {
  2081. if (w.sendQueue.length > 0) {
  2082. w.worker.postMessage(w.sendQueue);
  2083. w.sendQueue.length = 0;
  2084. }
  2085. };
  2086. const queueMsgToWorker = (msg) => {
  2087. let theChosenOne;
  2088. if (workers.length > 0) {
  2089. theChosenOne = workers[0];
  2090. if (maxWorkers > 1) {
  2091. for (const worker of workers) {
  2092. if (worker.activeTasks < theChosenOne.activeTasks) {
  2093. theChosenOne = worker;
  2094. }
  2095. }
  2096. if (theChosenOne.activeTasks > 0 && workers.length < maxWorkers) {
  2097. theChosenOne = createWorkerMain();
  2098. workers.push(theChosenOne);
  2099. }
  2100. }
  2101. }
  2102. else {
  2103. theChosenOne = createWorkerMain();
  2104. workers.push(theChosenOne);
  2105. }
  2106. theChosenOne.activeTasks++;
  2107. theChosenOne.sendQueue.push(msg);
  2108. };
  2109. const flushSendQueue = () => {
  2110. isQueued = false;
  2111. queuedSendMsgs.forEach(queueMsgToWorker);
  2112. queuedSendMsgs.length = 0;
  2113. workers.forEach(sendMsgsToWorkers);
  2114. };
  2115. const send = (...args) => new Promise((resolve, reject) => {
  2116. if (isDestroyed) {
  2117. reject(TASK_CANCELED_MSG);
  2118. }
  2119. else {
  2120. const msg = {
  2121. stencilId: msgIds++,
  2122. args,
  2123. };
  2124. queuedSendMsgs.push(msg);
  2125. tasks.set(msg.stencilId, {
  2126. resolve,
  2127. reject,
  2128. });
  2129. if (!isQueued) {
  2130. isQueued = true;
  2131. tick.then(flushSendQueue);
  2132. }
  2133. }
  2134. });
  2135. const destroy = () => {
  2136. isDestroyed = true;
  2137. tasks.forEach((t) => t.reject(TASK_CANCELED_MSG));
  2138. tasks.clear();
  2139. workers.forEach((w) => w.worker.terminate());
  2140. workers.length = 0;
  2141. };
  2142. const handler = (name) => {
  2143. return function (...args) {
  2144. return send(name, ...args);
  2145. };
  2146. };
  2147. return {
  2148. send,
  2149. destroy,
  2150. handler,
  2151. maxWorkers,
  2152. };
  2153. };
  2154. const COMMON_DIR_MODULE_EXTS = ['.tsx', '.ts', '.mjs', '.js', '.jsx', '.json', '.md'];
  2155. const COMMON_DIR_FILENAMES = ['package.json', 'index.js', 'index.mjs'];
  2156. const isDtsFile = (p) => p.endsWith('.d.ts');
  2157. const isTsFile = (p) => !isDtsFile(p) && p.endsWith('.ts');
  2158. const isTsxFile = (p) => p.endsWith('.tsx');
  2159. const isJsxFile = (p) => p.endsWith('.jsx');
  2160. const isJsFile = (p) => p.endsWith('.js');
  2161. const isJsonFile = (p) => p.endsWith('.json');
  2162. const getCommonDirName = (dirPath, fileName) => dirPath + '/' + fileName;
  2163. const isCommonDirModuleFile = (p) => COMMON_DIR_MODULE_EXTS.some((ext) => p.endsWith(ext));
  2164. const setPackageVersion = (pkgVersions, pkgName, pkgVersion) => {
  2165. pkgVersions.set(pkgName, pkgVersion);
  2166. };
  2167. const setPackageVersionByContent = (pkgVersions, pkgContent) => {
  2168. try {
  2169. const pkg = JSON.parse(pkgContent);
  2170. if (pkg.name && pkg.version) {
  2171. setPackageVersion(pkgVersions, pkg.name, pkg.version);
  2172. }
  2173. }
  2174. catch (e) { }
  2175. };
  2176. const isLocalModule = (p) => p.startsWith('.') || p.startsWith('/');
  2177. const isStencilCoreImport = (p) => p.startsWith('@stencil/core');
  2178. const shouldFetchModule = (p) => IS_FETCH_ENV && IS_BROWSER_ENV && isNodeModulePath(p);
  2179. const isNodeModulePath = (p) => normalizePath$1(p).split('/').includes('node_modules');
  2180. const getModuleId = (orgImport) => {
  2181. if (orgImport.startsWith('~')) {
  2182. orgImport = orgImport.substring(1);
  2183. }
  2184. const splt = orgImport.split('/');
  2185. const m = {
  2186. moduleId: null,
  2187. filePath: null,
  2188. scope: null,
  2189. scopeSubModuleId: null,
  2190. };
  2191. if (orgImport.startsWith('@') && splt.length > 1) {
  2192. m.moduleId = splt.slice(0, 2).join('/');
  2193. m.filePath = splt.slice(2).join('/');
  2194. m.scope = splt[0];
  2195. m.scopeSubModuleId = splt[1];
  2196. }
  2197. else {
  2198. m.moduleId = splt[0];
  2199. m.filePath = splt.slice(1).join('/');
  2200. }
  2201. return m;
  2202. };
  2203. const getPackageDirPath = (p, moduleId) => {
  2204. const parts = normalizePath$1(p).split('/');
  2205. const m = getModuleId(moduleId);
  2206. for (let i = parts.length - 1; i >= 1; i--) {
  2207. if (parts[i - 1] === 'node_modules') {
  2208. if (m.scope) {
  2209. if (parts[i] === m.scope && parts[i + 1] === m.scopeSubModuleId) {
  2210. return parts.slice(0, i + 2).join('/');
  2211. }
  2212. }
  2213. else if (parts[i] === m.moduleId) {
  2214. return parts.slice(0, i + 1).join('/');
  2215. }
  2216. }
  2217. }
  2218. return null;
  2219. };
  2220. const httpFetch = (sys, input, init) => {
  2221. console.trace(input);
  2222. if (sys && isFunction(sys.fetch)) {
  2223. return sys.fetch(input, init);
  2224. }
  2225. return fetch(input, init);
  2226. };
  2227. const packageVersions = new Map();
  2228. const known404Urls = new Set();
  2229. const getStencilRootUrl = (compilerExe) => new URL('../', compilerExe).href;
  2230. const getStencilModuleUrl = (compilerExe, p) => {
  2231. p = normalizePath$1(p);
  2232. let parts = p.split('/');
  2233. const nmIndex = parts.lastIndexOf('node_modules');
  2234. if (nmIndex > -1 && nmIndex < parts.length - 1) {
  2235. parts = parts.slice(nmIndex + 1);
  2236. if (parts[0].startsWith('@')) {
  2237. parts = parts.slice(2);
  2238. }
  2239. else {
  2240. parts = parts.slice(1);
  2241. }
  2242. p = parts.join('/');
  2243. }
  2244. return new URL('./' + p, getStencilRootUrl(compilerExe)).href;
  2245. };
  2246. const getCommonDirUrl = (sys, pkgVersions, dirPath, fileName) => getNodeModuleFetchUrl(sys, pkgVersions, dirPath) + '/' + fileName;
  2247. const getNodeModuleFetchUrl = (sys, pkgVersions, filePath) => {
  2248. // /node_modules/lodash/package.json
  2249. filePath = normalizePath$1(filePath);
  2250. // ["node_modules", "lodash", "package.json"]
  2251. let pathParts = filePath.split('/').filter((p) => p.length);
  2252. const nmIndex = pathParts.lastIndexOf('node_modules');
  2253. if (nmIndex > -1 && nmIndex < pathParts.length - 1) {
  2254. pathParts = pathParts.slice(nmIndex + 1);
  2255. }
  2256. let moduleId = pathParts.shift();
  2257. if (moduleId.startsWith('@')) {
  2258. moduleId += '/' + pathParts.shift();
  2259. }
  2260. const path = pathParts.join('/');
  2261. if (moduleId === '@stencil/core') {
  2262. const compilerExe = sys.getCompilerExecutingPath();
  2263. return getStencilModuleUrl(compilerExe, path);
  2264. }
  2265. return sys.getRemoteModuleUrl({
  2266. moduleId,
  2267. version: pkgVersions.get(moduleId),
  2268. path,
  2269. });
  2270. };
  2271. const skipFilePathFetch = (filePath) => {
  2272. if (isTsFile(filePath) || isTsxFile(filePath)) {
  2273. // don't bother trying to resolve node_module packages w/ typescript files
  2274. // they should already be .js files
  2275. return true;
  2276. }
  2277. const pathParts = filePath.split('/');
  2278. const secondToLast = pathParts[pathParts.length - 2];
  2279. const lastPart = pathParts[pathParts.length - 1];
  2280. if (secondToLast === 'node_modules' && isCommonDirModuleFile(lastPart)) {
  2281. // /node_modules/index.js
  2282. // /node_modules/lodash.js
  2283. // we just already know this is bogus, so don't bother
  2284. return true;
  2285. }
  2286. return false;
  2287. };
  2288. const skipUrlFetch = (url) =>
  2289. // files we just already know not to try to resolve request
  2290. knownUrlSkips.some((knownSkip) => url.endsWith(knownSkip));
  2291. const knownUrlSkips = [
  2292. '/@stencil/core/internal.js',
  2293. '/@stencil/core/internal.json',
  2294. '/@stencil/core/internal.mjs',
  2295. '/@stencil/core/internal/stencil-core.js/index.json',
  2296. '/@stencil/core/internal/stencil-core.js.json',
  2297. '/@stencil/core/internal/stencil-core.js/package.json',
  2298. '/@stencil/core.js',
  2299. '/@stencil/core.json',
  2300. '/@stencil/core.mjs',
  2301. '/@stencil/core.css',
  2302. '/@stencil/core/index.js',
  2303. '/@stencil/core/index.json',
  2304. '/@stencil/core/index.mjs',
  2305. '/@stencil/core/index.css',
  2306. '/@stencil/package.json',
  2307. ];
  2308. const writeFetchSuccessSync = (sys, inMemoryFs, url, filePath, content, pkgVersions) => {
  2309. if (url.endsWith('package.json')) {
  2310. setPackageVersionByContent(pkgVersions, content);
  2311. }
  2312. let dir = dirname(filePath);
  2313. while (dir !== '/' && dir !== '') {
  2314. if (inMemoryFs) {
  2315. inMemoryFs.clearFileCache(dir);
  2316. inMemoryFs.sys.createDirSync(dir);
  2317. }
  2318. else {
  2319. sys.createDirSync(dir);
  2320. }
  2321. dir = dirname(dir);
  2322. }
  2323. if (inMemoryFs) {
  2324. inMemoryFs.clearFileCache(filePath);
  2325. inMemoryFs.sys.writeFileSync(filePath, content);
  2326. }
  2327. else {
  2328. sys.writeFileSync(filePath, content);
  2329. }
  2330. };
  2331. const writeFetchSuccessAsync = async (sys, inMemoryFs, url, filePath, content, pkgVersions) => {
  2332. if (url.endsWith('package.json')) {
  2333. setPackageVersionByContent(pkgVersions, content);
  2334. }
  2335. let dir = dirname(filePath);
  2336. while (dir !== '/' && dir !== '') {
  2337. if (inMemoryFs) {
  2338. inMemoryFs.clearFileCache(dir);
  2339. await inMemoryFs.sys.createDir(dir);
  2340. }
  2341. else {
  2342. await sys.createDir(dir);
  2343. }
  2344. dir = dirname(dir);
  2345. }
  2346. if (inMemoryFs) {
  2347. inMemoryFs.clearFileCache(filePath);
  2348. await inMemoryFs.sys.writeFile(filePath, content);
  2349. }
  2350. else {
  2351. await sys.writeFile(filePath, content);
  2352. }
  2353. };
  2354. const fetchModuleAsync = async (sys, inMemoryFs, pkgVersions, url, filePath) => {
  2355. if (skipFilePathFetch(filePath) || known404Urls.has(url) || skipUrlFetch(url)) {
  2356. return undefined;
  2357. }
  2358. try {
  2359. const rsp = await httpFetch(sys, url);
  2360. if (rsp) {
  2361. if (rsp.ok) {
  2362. const content = await rsp.clone().text();
  2363. await writeFetchSuccessAsync(sys, inMemoryFs, url, filePath, content, pkgVersions);
  2364. return content;
  2365. }
  2366. if (rsp.status === 404) {
  2367. known404Urls.add(url);
  2368. }
  2369. }
  2370. }
  2371. catch (e) {
  2372. console.error(e);
  2373. }
  2374. return undefined;
  2375. };
  2376. const inherits$3 = (ctor, superCtor) => {
  2377. if (superCtor) {
  2378. ctor.super_ = superCtor;
  2379. ctor.prototype = Object.create(superCtor.prototype, {
  2380. constructor: {
  2381. value: ctor,
  2382. enumerable: false,
  2383. writable: true,
  2384. configurable: true,
  2385. },
  2386. });
  2387. }
  2388. };
  2389. const inspect = (...args) => args.forEach((arg) => console.log(arg));
  2390. const promisify = (fn) => {
  2391. if (typeof fn[promisify.custom] === 'function') {
  2392. // https://nodejs.org/api/util.html#util_custom_promisified_functions
  2393. return function (...args) {
  2394. return fn[promisify.custom].apply(this, args);
  2395. };
  2396. }
  2397. return function (...args) {
  2398. return new Promise((resolve, reject) => {
  2399. args.push((err, result) => {
  2400. if (err != null) {
  2401. reject(err);
  2402. }
  2403. else {
  2404. resolve(result);
  2405. }
  2406. });
  2407. fn.apply(this, args);
  2408. });
  2409. };
  2410. };
  2411. promisify.custom = Symbol('promisify.custom');
  2412. const require$$0$1 = {
  2413. inherits: inherits$3,
  2414. inspect,
  2415. promisify,
  2416. };
  2417. const util$4 = {
  2418. __proto__: null,
  2419. inherits: inherits$3,
  2420. inspect: inspect,
  2421. promisify: promisify,
  2422. 'default': require$$0$1
  2423. };
  2424. class FsError extends Error {
  2425. constructor(syscall, path, code = 'ENOENT', errno = -2) {
  2426. super(`ENOENT: no such file or directory, ${syscall} '${path}'`);
  2427. this.syscall = syscall;
  2428. this.path = path;
  2429. this.code = code;
  2430. this.errno = errno;
  2431. }
  2432. }
  2433. const fs$3 = {
  2434. __sys: {},
  2435. };
  2436. const exists$1 = (fs$3.exists = (p, cb) => {
  2437. fs$3.__sys
  2438. .access(p)
  2439. .then(cb)
  2440. .catch(() => cb(false));
  2441. });
  2442. // https://nodejs.org/api/util.html#util_custom_promisified_functions
  2443. exists$1[promisify.custom] = (p) => fs$3.__sys.access(p);
  2444. const existsSync = (fs$3.existsSync = (p) => {
  2445. // https://nodejs.org/api/fs.html#fs_fs_existssync_path
  2446. return fs$3.__sys.accessSync(p);
  2447. });
  2448. const mkdir = (fs$3.mkdir = (p, opts, cb) => {
  2449. cb = typeof cb === 'function' ? cb : typeof opts === 'function' ? opts : null;
  2450. opts = typeof opts === 'function' ? undefined : opts;
  2451. fs$3.__sys
  2452. .createDir(p, opts)
  2453. .then((results) => {
  2454. if (cb) {
  2455. if (results.error) {
  2456. cb(new FsError('mkdir', p));
  2457. }
  2458. else {
  2459. cb(null);
  2460. }
  2461. }
  2462. })
  2463. .catch((e) => {
  2464. cb && cb(e);
  2465. });
  2466. });
  2467. const mkdirSync = (fs$3.mkdirSync = (p, opts) => {
  2468. const results = fs$3.__sys.createDirSync(p, opts);
  2469. if (results.error) {
  2470. throw new FsError('mkdir', p);
  2471. }
  2472. });
  2473. const readdirSync = (fs$3.readdirSync = (p) => {
  2474. // sys.readdirSync includes full paths
  2475. // but if fs.readdirSync was called, the expected
  2476. // nodejs results are of just the basename for each dir item
  2477. const dirItems = fs$3.__sys.readDirSync(p);
  2478. return dirItems.map((dirItem) => basename(dirItem));
  2479. });
  2480. const readFile$2 = (fs$3.readFile = async (p, opts, cb) => {
  2481. const encoding = typeof opts === 'object' ? opts.encoding : typeof opts === 'string' ? opts : 'utf-8';
  2482. cb = typeof cb === 'function' ? cb : typeof opts === 'function' ? opts : null;
  2483. fs$3.__sys
  2484. .readFile(p, encoding)
  2485. .then((data) => {
  2486. if (cb) {
  2487. if (typeof data === 'string') {
  2488. cb(null, data);
  2489. }
  2490. else {
  2491. cb(new FsError('open', p), data);
  2492. }
  2493. }
  2494. })
  2495. .catch((e) => {
  2496. cb && cb(e);
  2497. });
  2498. });
  2499. const readFileSync = (fs$3.readFileSync = (p, opts) => {
  2500. const encoding = typeof opts === 'object' ? opts.encoding : typeof opts === 'string' ? opts : 'utf-8';
  2501. const data = fs$3.__sys.readFileSync(p, encoding);
  2502. if (typeof data !== 'string') {
  2503. throw new FsError('open', p);
  2504. }
  2505. return data;
  2506. });
  2507. const realpath$3 = (fs$3.realpath = (p, opts, cb) => {
  2508. cb = typeof cb === 'function' ? cb : typeof opts === 'function' ? opts : null;
  2509. fs$3.__sys
  2510. .realpath(p)
  2511. .then((results) => {
  2512. cb && cb(results.error, results.path);
  2513. })
  2514. .catch((e) => {
  2515. cb && cb(e);
  2516. });
  2517. });
  2518. const realpathSync$2 = (fs$3.realpathSync = (p) => {
  2519. const results = fs$3.__sys.realpathSync(p);
  2520. if (results.error) {
  2521. throw results.error;
  2522. }
  2523. return normalizePath$1(results.path);
  2524. });
  2525. const statSync = (fs$3.statSync = (p) => {
  2526. const fsStats = fs$3.__sys.statSync(p);
  2527. if (fsStats.error) {
  2528. throw new FsError('statSync', p);
  2529. }
  2530. return {
  2531. isDirectory: () => fsStats.isDirectory,
  2532. isFile: () => fsStats.isFile,
  2533. isSymbolicLink: () => fsStats.isSymbolicLink,
  2534. size: fsStats.size,
  2535. mtimeMs: fsStats.mtimeMs,
  2536. };
  2537. });
  2538. const lstatSync = (fs$3.lstatSync = statSync);
  2539. const stat$1 = (fs$3.stat = (p, opts, cb) => {
  2540. cb = typeof cb === 'function' ? cb : typeof opts === 'function' ? opts : null;
  2541. fs$3.__sys
  2542. .stat(p)
  2543. .then((fsStats) => {
  2544. if (cb) {
  2545. if (fsStats.error) {
  2546. cb(new FsError('stat', p));
  2547. }
  2548. else {
  2549. cb({
  2550. isDirectory: () => fsStats.isDirectory,
  2551. isFile: () => fsStats.isFile,
  2552. isSymbolicLink: () => fsStats.isSymbolicLink,
  2553. size: fsStats.size,
  2554. mtimeMs: fsStats.mtimeMs,
  2555. });
  2556. }
  2557. }
  2558. })
  2559. .catch((e) => {
  2560. cb && cb(e);
  2561. });
  2562. });
  2563. const watch = (fs$3.watch = () => {
  2564. throw new Error(`fs.watch() not implemented`);
  2565. });
  2566. const writeFile$1 = (fs$3.writeFile = (p, data, opts, cb) => {
  2567. cb = typeof cb === 'function' ? cb : typeof opts === 'function' ? opts : null;
  2568. fs$3.__sys
  2569. .writeFile(p, data)
  2570. .then((writeResults) => {
  2571. if (cb) {
  2572. if (writeResults.error) {
  2573. cb(new FsError('writeFile', p));
  2574. }
  2575. else {
  2576. cb(null);
  2577. }
  2578. }
  2579. })
  2580. .catch((e) => {
  2581. cb && cb(e);
  2582. });
  2583. });
  2584. const fs$4 = {
  2585. __proto__: null,
  2586. exists: exists$1,
  2587. existsSync: existsSync,
  2588. mkdir: mkdir,
  2589. mkdirSync: mkdirSync,
  2590. readdirSync: readdirSync,
  2591. readFile: readFile$2,
  2592. readFileSync: readFileSync,
  2593. realpath: realpath$3,
  2594. realpathSync: realpathSync$2,
  2595. statSync: statSync,
  2596. lstatSync: lstatSync,
  2597. stat: stat$1,
  2598. watch: watch,
  2599. writeFile: writeFile$1,
  2600. 'default': fs$3
  2601. };
  2602. var caller = function () {
  2603. // see https://code.google.com/p/v8/wiki/JavaScriptStackTraceApi
  2604. var origPrepareStackTrace = Error.prepareStackTrace;
  2605. Error.prepareStackTrace = function (_, stack) { return stack; };
  2606. var stack = (new Error()).stack;
  2607. Error.prepareStackTrace = origPrepareStackTrace;
  2608. return stack[2].getFileName();
  2609. };
  2610. var pathParse = createCommonjsModule$1(function (module) {
  2611. var isWindows = process.platform === 'win32';
  2612. // Regex to split a windows path into into [dir, root, basename, name, ext]
  2613. var splitWindowsRe =
  2614. /^(((?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?[\\\/]?)(?:[^\\\/]*[\\\/])*)((\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))[\\\/]*$/;
  2615. var win32 = {};
  2616. function win32SplitPath(filename) {
  2617. return splitWindowsRe.exec(filename).slice(1);
  2618. }
  2619. win32.parse = function(pathString) {
  2620. if (typeof pathString !== 'string') {
  2621. throw new TypeError(
  2622. "Parameter 'pathString' must be a string, not " + typeof pathString
  2623. );
  2624. }
  2625. var allParts = win32SplitPath(pathString);
  2626. if (!allParts || allParts.length !== 5) {
  2627. throw new TypeError("Invalid path '" + pathString + "'");
  2628. }
  2629. return {
  2630. root: allParts[1],
  2631. dir: allParts[0] === allParts[1] ? allParts[0] : allParts[0].slice(0, -1),
  2632. base: allParts[2],
  2633. ext: allParts[4],
  2634. name: allParts[3]
  2635. };
  2636. };
  2637. // Split a filename into [dir, root, basename, name, ext], unix version
  2638. // 'root' is just a slash, or nothing.
  2639. var splitPathRe =
  2640. /^((\/?)(?:[^\/]*\/)*)((\.{1,2}|[^\/]+?|)(\.[^.\/]*|))[\/]*$/;
  2641. var posix = {};
  2642. function posixSplitPath(filename) {
  2643. return splitPathRe.exec(filename).slice(1);
  2644. }
  2645. posix.parse = function(pathString) {
  2646. if (typeof pathString !== 'string') {
  2647. throw new TypeError(
  2648. "Parameter 'pathString' must be a string, not " + typeof pathString
  2649. );
  2650. }
  2651. var allParts = posixSplitPath(pathString);
  2652. if (!allParts || allParts.length !== 5) {
  2653. throw new TypeError("Invalid path '" + pathString + "'");
  2654. }
  2655. return {
  2656. root: allParts[1],
  2657. dir: allParts[0].slice(0, -1),
  2658. base: allParts[2],
  2659. ext: allParts[4],
  2660. name: allParts[3],
  2661. };
  2662. };
  2663. if (isWindows)
  2664. module.exports = win32.parse;
  2665. else /* posix */
  2666. module.exports = posix.parse;
  2667. module.exports.posix = posix.parse;
  2668. module.exports.win32 = win32.parse;
  2669. });
  2670. const path$4 = /*@__PURE__*/getAugmentedNamespace$1(path$6);
  2671. var parse$6 = path$4.parse || pathParse;
  2672. var getNodeModulesDirs = function getNodeModulesDirs(absoluteStart, modules) {
  2673. var prefix = '/';
  2674. if ((/^([A-Za-z]:)/).test(absoluteStart)) {
  2675. prefix = '';
  2676. } else if ((/^\\\\/).test(absoluteStart)) {
  2677. prefix = '\\\\';
  2678. }
  2679. var paths = [absoluteStart];
  2680. var parsed = parse$6(absoluteStart);
  2681. while (parsed.dir !== paths[paths.length - 1]) {
  2682. paths.push(parsed.dir);
  2683. parsed = parse$6(parsed.dir);
  2684. }
  2685. return paths.reduce(function (dirs, aPath) {
  2686. return dirs.concat(modules.map(function (moduleDir) {
  2687. return path$4.resolve(prefix, aPath, moduleDir);
  2688. }));
  2689. }, []);
  2690. };
  2691. var nodeModulesPaths = function nodeModulesPaths(start, opts, request) {
  2692. var modules = opts && opts.moduleDirectory
  2693. ? [].concat(opts.moduleDirectory)
  2694. : ['node_modules'];
  2695. if (opts && typeof opts.paths === 'function') {
  2696. return opts.paths(
  2697. request,
  2698. start,
  2699. function () { return getNodeModulesDirs(start, modules); },
  2700. opts
  2701. );
  2702. }
  2703. var dirs = getNodeModulesDirs(start, modules);
  2704. return opts && opts.paths ? dirs.concat(opts.paths) : dirs;
  2705. };
  2706. var normalizeOptions = function (x, opts) {
  2707. /**
  2708. * This file is purposefully a passthrough. It's expected that third-party
  2709. * environments will override it at runtime in order to inject special logic
  2710. * into `resolve` (by manipulating the options). One such example is the PnP
  2711. * code path in Yarn.
  2712. */
  2713. return opts || {};
  2714. };
  2715. /* eslint no-invalid-this: 1 */
  2716. var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
  2717. var slice$1 = Array.prototype.slice;
  2718. var toStr = Object.prototype.toString;
  2719. var funcType = '[object Function]';
  2720. var implementation = function bind(that) {
  2721. var target = this;
  2722. if (typeof target !== 'function' || toStr.call(target) !== funcType) {
  2723. throw new TypeError(ERROR_MESSAGE + target);
  2724. }
  2725. var args = slice$1.call(arguments, 1);
  2726. var bound;
  2727. var binder = function () {
  2728. if (this instanceof bound) {
  2729. var result = target.apply(
  2730. this,
  2731. args.concat(slice$1.call(arguments))
  2732. );
  2733. if (Object(result) === result) {
  2734. return result;
  2735. }
  2736. return this;
  2737. } else {
  2738. return target.apply(
  2739. that,
  2740. args.concat(slice$1.call(arguments))
  2741. );
  2742. }
  2743. };
  2744. var boundLength = Math.max(0, target.length - args.length);
  2745. var boundArgs = [];
  2746. for (var i = 0; i < boundLength; i++) {
  2747. boundArgs.push('$' + i);
  2748. }
  2749. bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder);
  2750. if (target.prototype) {
  2751. var Empty = function Empty() {};
  2752. Empty.prototype = target.prototype;
  2753. bound.prototype = new Empty();
  2754. Empty.prototype = null;
  2755. }
  2756. return bound;
  2757. };
  2758. var functionBind = Function.prototype.bind || implementation;
  2759. var src = functionBind.call(Function.call, Object.prototype.hasOwnProperty);
  2760. const assert$2 = true;
  2761. const async_hooks$1 = ">= 8";
  2762. const buffer_ieee754$1 = "< 0.9.7";
  2763. const buffer$1 = true;
  2764. const child_process$1 = true;
  2765. const cluster$1 = true;
  2766. const console$2 = true;
  2767. const constants$2 = true;
  2768. const crypto$2 = true;
  2769. const _debug_agent$1 = ">= 1 && < 8";
  2770. const _debugger$1 = "< 8";
  2771. const dgram$1 = true;
  2772. const diagnostics_channel$1 = ">= 15.1";
  2773. const dns$1 = true;
  2774. const domain$1 = ">= 0.7.12";
  2775. const events$2 = true;
  2776. const freelist$1 = "< 6";
  2777. const fs$2 = true;
  2778. const _http_agent$1 = ">= 0.11.1";
  2779. const _http_client$1 = ">= 0.11.1";
  2780. const _http_common$1 = ">= 0.11.1";
  2781. const _http_incoming$1 = ">= 0.11.1";
  2782. const _http_outgoing$1 = ">= 0.11.1";
  2783. const _http_server$1 = ">= 0.11.1";
  2784. const http$1 = true;
  2785. const http2$1 = ">= 8.8";
  2786. const https$1 = true;
  2787. const inspector$1 = ">= 8.0.0";
  2788. const _linklist$1 = "< 8";
  2789. const module$2 = true;
  2790. const net$1 = true;
  2791. const os$1 = true;
  2792. const path$3 = true;
  2793. const perf_hooks$1 = ">= 8.5";
  2794. const process$2 = ">= 1";
  2795. const punycode$1 = true;
  2796. const querystring$1 = true;
  2797. const readline$1 = true;
  2798. const repl$1 = true;
  2799. const smalloc$1 = ">= 0.11.5 && < 3";
  2800. const _stream_duplex$1 = ">= 0.9.4";
  2801. const _stream_transform$1 = ">= 0.9.4";
  2802. const _stream_wrap$1 = ">= 1.4.1";
  2803. const _stream_passthrough$1 = ">= 0.9.4";
  2804. const _stream_readable$1 = ">= 0.9.4";
  2805. const _stream_writable$1 = ">= 0.9.4";
  2806. const stream$1 = true;
  2807. const string_decoder$1 = true;
  2808. const sys$1 = [
  2809. ">= 0.6 && < 0.7",
  2810. ">= 0.8"
  2811. ];
  2812. const timers$2 = true;
  2813. const _tls_common$1 = ">= 0.11.13";
  2814. const _tls_legacy$1 = ">= 0.11.3 && < 10";
  2815. const _tls_wrap$1 = ">= 0.11.3";
  2816. const tls$1 = true;
  2817. const trace_events$1 = ">= 10";
  2818. const tty$1 = true;
  2819. const url$1 = true;
  2820. const util$3 = true;
  2821. const v8$1 = ">= 1";
  2822. const vm$1 = true;
  2823. const wasi$1 = ">= 13.4 && < 13.5";
  2824. const worker_threads$1 = ">= 11.7";
  2825. const zlib$1 = true;
  2826. const data$2 = {
  2827. assert: assert$2,
  2828. "assert/strict": ">= 15",
  2829. async_hooks: async_hooks$1,
  2830. buffer_ieee754: buffer_ieee754$1,
  2831. buffer: buffer$1,
  2832. child_process: child_process$1,
  2833. cluster: cluster$1,
  2834. console: console$2,
  2835. constants: constants$2,
  2836. crypto: crypto$2,
  2837. _debug_agent: _debug_agent$1,
  2838. _debugger: _debugger$1,
  2839. dgram: dgram$1,
  2840. diagnostics_channel: diagnostics_channel$1,
  2841. dns: dns$1,
  2842. "dns/promises": ">= 15",
  2843. domain: domain$1,
  2844. events: events$2,
  2845. freelist: freelist$1,
  2846. fs: fs$2,
  2847. "fs/promises": [
  2848. ">= 10 && < 10.1",
  2849. ">= 14"
  2850. ],
  2851. _http_agent: _http_agent$1,
  2852. _http_client: _http_client$1,
  2853. _http_common: _http_common$1,
  2854. _http_incoming: _http_incoming$1,
  2855. _http_outgoing: _http_outgoing$1,
  2856. _http_server: _http_server$1,
  2857. http: http$1,
  2858. http2: http2$1,
  2859. https: https$1,
  2860. inspector: inspector$1,
  2861. _linklist: _linklist$1,
  2862. module: module$2,
  2863. net: net$1,
  2864. "node-inspect/lib/_inspect": ">= 7.6.0 && < 12",
  2865. "node-inspect/lib/internal/inspect_client": ">= 7.6.0 && < 12",
  2866. "node-inspect/lib/internal/inspect_repl": ">= 7.6.0 && < 12",
  2867. os: os$1,
  2868. path: path$3,
  2869. "path/posix": ">= 15.3",
  2870. "path/win32": ">= 15.3",
  2871. perf_hooks: perf_hooks$1,
  2872. process: process$2,
  2873. punycode: punycode$1,
  2874. querystring: querystring$1,
  2875. readline: readline$1,
  2876. repl: repl$1,
  2877. smalloc: smalloc$1,
  2878. _stream_duplex: _stream_duplex$1,
  2879. _stream_transform: _stream_transform$1,
  2880. _stream_wrap: _stream_wrap$1,
  2881. _stream_passthrough: _stream_passthrough$1,
  2882. _stream_readable: _stream_readable$1,
  2883. _stream_writable: _stream_writable$1,
  2884. stream: stream$1,
  2885. "stream/promises": ">= 15",
  2886. string_decoder: string_decoder$1,
  2887. sys: sys$1,
  2888. timers: timers$2,
  2889. "timers/promises": ">= 15",
  2890. _tls_common: _tls_common$1,
  2891. _tls_legacy: _tls_legacy$1,
  2892. _tls_wrap: _tls_wrap$1,
  2893. tls: tls$1,
  2894. trace_events: trace_events$1,
  2895. tty: tty$1,
  2896. url: url$1,
  2897. util: util$3,
  2898. "util/types": ">= 15.3",
  2899. "v8/tools/arguments": ">= 10 && < 12",
  2900. "v8/tools/codemap": [
  2901. ">= 4.4.0 && < 5",
  2902. ">= 5.2.0 && < 12"
  2903. ],
  2904. "v8/tools/consarray": [
  2905. ">= 4.4.0 && < 5",
  2906. ">= 5.2.0 && < 12"
  2907. ],
  2908. "v8/tools/csvparser": [
  2909. ">= 4.4.0 && < 5",
  2910. ">= 5.2.0 && < 12"
  2911. ],
  2912. "v8/tools/logreader": [
  2913. ">= 4.4.0 && < 5",
  2914. ">= 5.2.0 && < 12"
  2915. ],
  2916. "v8/tools/profile_view": [
  2917. ">= 4.4.0 && < 5",
  2918. ">= 5.2.0 && < 12"
  2919. ],
  2920. "v8/tools/splaytree": [
  2921. ">= 4.4.0 && < 5",
  2922. ">= 5.2.0 && < 12"
  2923. ],
  2924. v8: v8$1,
  2925. vm: vm$1,
  2926. wasi: wasi$1,
  2927. worker_threads: worker_threads$1,
  2928. zlib: zlib$1
  2929. };
  2930. function specifierIncluded$1(current, specifier) {
  2931. var nodeParts = current.split('.');
  2932. var parts = specifier.split(' ');
  2933. var op = parts.length > 1 ? parts[0] : '=';
  2934. var versionParts = (parts.length > 1 ? parts[1] : parts[0]).split('.');
  2935. for (var i = 0; i < 3; ++i) {
  2936. var cur = parseInt(nodeParts[i] || 0, 10);
  2937. var ver = parseInt(versionParts[i] || 0, 10);
  2938. if (cur === ver) {
  2939. continue; // eslint-disable-line no-restricted-syntax, no-continue
  2940. }
  2941. if (op === '<') {
  2942. return cur < ver;
  2943. }
  2944. if (op === '>=') {
  2945. return cur >= ver;
  2946. }
  2947. return false;
  2948. }
  2949. return op === '>=';
  2950. }
  2951. function matchesRange$1(current, range) {
  2952. var specifiers = range.split(/ ?&& ?/);
  2953. if (specifiers.length === 0) {
  2954. return false;
  2955. }
  2956. for (var i = 0; i < specifiers.length; ++i) {
  2957. if (!specifierIncluded$1(current, specifiers[i])) {
  2958. return false;
  2959. }
  2960. }
  2961. return true;
  2962. }
  2963. function versionIncluded$1(nodeVersion, specifierValue) {
  2964. if (typeof specifierValue === 'boolean') {
  2965. return specifierValue;
  2966. }
  2967. var current = typeof nodeVersion === 'undefined'
  2968. ? process.versions && process.versions.node && process.versions.node
  2969. : nodeVersion;
  2970. if (typeof current !== 'string') {
  2971. throw new TypeError(typeof nodeVersion === 'undefined' ? 'Unable to determine current node version' : 'If provided, a valid node version is required');
  2972. }
  2973. if (specifierValue && typeof specifierValue === 'object') {
  2974. for (var i = 0; i < specifierValue.length; ++i) {
  2975. if (matchesRange$1(current, specifierValue[i])) {
  2976. return true;
  2977. }
  2978. }
  2979. return false;
  2980. }
  2981. return matchesRange$1(current, specifierValue);
  2982. }
  2983. var isCoreModule = function isCore(x, nodeVersion) {
  2984. return src(data$2, x) && versionIncluded$1(nodeVersion, data$2[x]);
  2985. };
  2986. const fs$1 = /*@__PURE__*/getAugmentedNamespace$1(fs$4);
  2987. var realpathFS$1 = fs$1.realpath && typeof fs$1.realpath.native === 'function' ? fs$1.realpath.native : fs$1.realpath;
  2988. var defaultIsFile$1 = function isFile(file, cb) {
  2989. fs$1.stat(file, function (err, stat) {
  2990. if (!err) {
  2991. return cb(null, stat.isFile() || stat.isFIFO());
  2992. }
  2993. if (err.code === 'ENOENT' || err.code === 'ENOTDIR') return cb(null, false);
  2994. return cb(err);
  2995. });
  2996. };
  2997. var defaultIsDir$1 = function isDirectory(dir, cb) {
  2998. fs$1.stat(dir, function (err, stat) {
  2999. if (!err) {
  3000. return cb(null, stat.isDirectory());
  3001. }
  3002. if (err.code === 'ENOENT' || err.code === 'ENOTDIR') return cb(null, false);
  3003. return cb(err);
  3004. });
  3005. };
  3006. var defaultRealpath = function realpath(x, cb) {
  3007. realpathFS$1(x, function (realpathErr, realPath) {
  3008. if (realpathErr && realpathErr.code !== 'ENOENT') cb(realpathErr);
  3009. else cb(null, realpathErr ? x : realPath);
  3010. });
  3011. };
  3012. var maybeRealpath = function maybeRealpath(realpath, x, opts, cb) {
  3013. if (opts && opts.preserveSymlinks === false) {
  3014. realpath(x, cb);
  3015. } else {
  3016. cb(null, x);
  3017. }
  3018. };
  3019. var defaultReadPackage = function defaultReadPackage(readFile, pkgfile, cb) {
  3020. readFile(pkgfile, function (readFileErr, body) {
  3021. if (readFileErr) cb(readFileErr);
  3022. else {
  3023. try {
  3024. var pkg = JSON.parse(body);
  3025. cb(null, pkg);
  3026. } catch (jsonErr) {
  3027. cb(null);
  3028. }
  3029. }
  3030. });
  3031. };
  3032. var getPackageCandidates$1 = function getPackageCandidates(x, start, opts) {
  3033. var dirs = nodeModulesPaths(start, opts, x);
  3034. for (var i = 0; i < dirs.length; i++) {
  3035. dirs[i] = path$4.join(dirs[i], x);
  3036. }
  3037. return dirs;
  3038. };
  3039. var async = function resolve(x, options, callback) {
  3040. var cb = callback;
  3041. var opts = options;
  3042. if (typeof options === 'function') {
  3043. cb = opts;
  3044. opts = {};
  3045. }
  3046. if (typeof x !== 'string') {
  3047. var err = new TypeError('Path must be a string.');
  3048. return process.nextTick(function () {
  3049. cb(err);
  3050. });
  3051. }
  3052. opts = normalizeOptions(x, opts);
  3053. var isFile = opts.isFile || defaultIsFile$1;
  3054. var isDirectory = opts.isDirectory || defaultIsDir$1;
  3055. var readFile = opts.readFile || fs$1.readFile;
  3056. var realpath = opts.realpath || defaultRealpath;
  3057. var readPackage = opts.readPackage || defaultReadPackage;
  3058. if (opts.readFile && opts.readPackage) {
  3059. var conflictErr = new TypeError('`readFile` and `readPackage` are mutually exclusive.');
  3060. return process.nextTick(function () {
  3061. cb(conflictErr);
  3062. });
  3063. }
  3064. var packageIterator = opts.packageIterator;
  3065. var extensions = opts.extensions || ['.js'];
  3066. var includeCoreModules = opts.includeCoreModules !== false;
  3067. var basedir = opts.basedir || path$4.dirname(caller());
  3068. var parent = opts.filename || basedir;
  3069. opts.paths = opts.paths || [];
  3070. // ensure that `basedir` is an absolute path at this point, resolving against the process' current working directory
  3071. var absoluteStart = path$4.resolve(basedir);
  3072. maybeRealpath(
  3073. realpath,
  3074. absoluteStart,
  3075. opts,
  3076. function (err, realStart) {
  3077. if (err) cb(err);
  3078. else init(realStart);
  3079. }
  3080. );
  3081. var res;
  3082. function init(basedir) {
  3083. if ((/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/).test(x)) {
  3084. res = path$4.resolve(basedir, x);
  3085. if (x === '.' || x === '..' || x.slice(-1) === '/') res += '/';
  3086. if ((/\/$/).test(x) && res === basedir) {
  3087. loadAsDirectory(res, opts.package, onfile);
  3088. } else loadAsFile(res, opts.package, onfile);
  3089. } else if (includeCoreModules && isCoreModule(x)) {
  3090. return cb(null, x);
  3091. } else loadNodeModules(x, basedir, function (err, n, pkg) {
  3092. if (err) cb(err);
  3093. else if (n) {
  3094. return maybeRealpath(realpath, n, opts, function (err, realN) {
  3095. if (err) {
  3096. cb(err);
  3097. } else {
  3098. cb(null, realN, pkg);
  3099. }
  3100. });
  3101. } else {
  3102. var moduleError = new Error("Cannot find module '" + x + "' from '" + parent + "'");
  3103. moduleError.code = 'MODULE_NOT_FOUND';
  3104. cb(moduleError);
  3105. }
  3106. });
  3107. }
  3108. function onfile(err, m, pkg) {
  3109. if (err) cb(err);
  3110. else if (m) cb(null, m, pkg);
  3111. else loadAsDirectory(res, function (err, d, pkg) {
  3112. if (err) cb(err);
  3113. else if (d) {
  3114. maybeRealpath(realpath, d, opts, function (err, realD) {
  3115. if (err) {
  3116. cb(err);
  3117. } else {
  3118. cb(null, realD, pkg);
  3119. }
  3120. });
  3121. } else {
  3122. var moduleError = new Error("Cannot find module '" + x + "' from '" + parent + "'");
  3123. moduleError.code = 'MODULE_NOT_FOUND';
  3124. cb(moduleError);
  3125. }
  3126. });
  3127. }
  3128. function loadAsFile(x, thePackage, callback) {
  3129. var loadAsFilePackage = thePackage;
  3130. var cb = callback;
  3131. if (typeof loadAsFilePackage === 'function') {
  3132. cb = loadAsFilePackage;
  3133. loadAsFilePackage = undefined;
  3134. }
  3135. var exts = [''].concat(extensions);
  3136. load(exts, x, loadAsFilePackage);
  3137. function load(exts, x, loadPackage) {
  3138. if (exts.length === 0) return cb(null, undefined, loadPackage);
  3139. var file = x + exts[0];
  3140. var pkg = loadPackage;
  3141. if (pkg) onpkg(null, pkg);
  3142. else loadpkg(path$4.dirname(file), onpkg);
  3143. function onpkg(err, pkg_, dir) {
  3144. pkg = pkg_;
  3145. if (err) return cb(err);
  3146. if (dir && pkg && opts.pathFilter) {
  3147. var rfile = path$4.relative(dir, file);
  3148. var rel = rfile.slice(0, rfile.length - exts[0].length);
  3149. var r = opts.pathFilter(pkg, x, rel);
  3150. if (r) return load(
  3151. [''].concat(extensions.slice()),
  3152. path$4.resolve(dir, r),
  3153. pkg
  3154. );
  3155. }
  3156. isFile(file, onex);
  3157. }
  3158. function onex(err, ex) {
  3159. if (err) return cb(err);
  3160. if (ex) return cb(null, file, pkg);
  3161. load(exts.slice(1), x, pkg);
  3162. }
  3163. }
  3164. }
  3165. function loadpkg(dir, cb) {
  3166. if (dir === '' || dir === '/') return cb(null);
  3167. if (process.platform === 'win32' && (/^\w:[/\\]*$/).test(dir)) {
  3168. return cb(null);
  3169. }
  3170. if ((/[/\\]node_modules[/\\]*$/).test(dir)) return cb(null);
  3171. maybeRealpath(realpath, dir, opts, function (unwrapErr, pkgdir) {
  3172. if (unwrapErr) return loadpkg(path$4.dirname(dir), cb);
  3173. var pkgfile = path$4.join(pkgdir, 'package.json');
  3174. isFile(pkgfile, function (err, ex) {
  3175. // on err, ex is false
  3176. if (!ex) return loadpkg(path$4.dirname(dir), cb);
  3177. readPackage(readFile, pkgfile, function (err, pkgParam) {
  3178. if (err) cb(err);
  3179. var pkg = pkgParam;
  3180. if (pkg && opts.packageFilter) {
  3181. pkg = opts.packageFilter(pkg, pkgfile);
  3182. }
  3183. cb(null, pkg, dir);
  3184. });
  3185. });
  3186. });
  3187. }
  3188. function loadAsDirectory(x, loadAsDirectoryPackage, callback) {
  3189. var cb = callback;
  3190. var fpkg = loadAsDirectoryPackage;
  3191. if (typeof fpkg === 'function') {
  3192. cb = fpkg;
  3193. fpkg = opts.package;
  3194. }
  3195. maybeRealpath(realpath, x, opts, function (unwrapErr, pkgdir) {
  3196. if (unwrapErr) return cb(unwrapErr);
  3197. var pkgfile = path$4.join(pkgdir, 'package.json');
  3198. isFile(pkgfile, function (err, ex) {
  3199. if (err) return cb(err);
  3200. if (!ex) return loadAsFile(path$4.join(x, 'index'), fpkg, cb);
  3201. readPackage(readFile, pkgfile, function (err, pkgParam) {
  3202. if (err) return cb(err);
  3203. var pkg = pkgParam;
  3204. if (pkg && opts.packageFilter) {
  3205. pkg = opts.packageFilter(pkg, pkgfile);
  3206. }
  3207. if (pkg && pkg.main) {
  3208. if (typeof pkg.main !== 'string') {
  3209. var mainError = new TypeError('package “' + pkg.name + '” `main` must be a string');
  3210. mainError.code = 'INVALID_PACKAGE_MAIN';
  3211. return cb(mainError);
  3212. }
  3213. if (pkg.main === '.' || pkg.main === './') {
  3214. pkg.main = 'index';
  3215. }
  3216. loadAsFile(path$4.resolve(x, pkg.main), pkg, function (err, m, pkg) {
  3217. if (err) return cb(err);
  3218. if (m) return cb(null, m, pkg);
  3219. if (!pkg) return loadAsFile(path$4.join(x, 'index'), pkg, cb);
  3220. var dir = path$4.resolve(x, pkg.main);
  3221. loadAsDirectory(dir, pkg, function (err, n, pkg) {
  3222. if (err) return cb(err);
  3223. if (n) return cb(null, n, pkg);
  3224. loadAsFile(path$4.join(x, 'index'), pkg, cb);
  3225. });
  3226. });
  3227. return;
  3228. }
  3229. loadAsFile(path$4.join(x, '/index'), pkg, cb);
  3230. });
  3231. });
  3232. });
  3233. }
  3234. function processDirs(cb, dirs) {
  3235. if (dirs.length === 0) return cb(null, undefined);
  3236. var dir = dirs[0];
  3237. isDirectory(path$4.dirname(dir), isdir);
  3238. function isdir(err, isdir) {
  3239. if (err) return cb(err);
  3240. if (!isdir) return processDirs(cb, dirs.slice(1));
  3241. loadAsFile(dir, opts.package, onfile);
  3242. }
  3243. function onfile(err, m, pkg) {
  3244. if (err) return cb(err);
  3245. if (m) return cb(null, m, pkg);
  3246. loadAsDirectory(dir, opts.package, ondir);
  3247. }
  3248. function ondir(err, n, pkg) {
  3249. if (err) return cb(err);
  3250. if (n) return cb(null, n, pkg);
  3251. processDirs(cb, dirs.slice(1));
  3252. }
  3253. }
  3254. function loadNodeModules(x, start, cb) {
  3255. var thunk = function () { return getPackageCandidates$1(x, start, opts); };
  3256. processDirs(
  3257. cb,
  3258. packageIterator ? packageIterator(x, start, thunk, opts) : thunk()
  3259. );
  3260. }
  3261. };
  3262. const assert$1 = true;
  3263. const async_hooks = ">= 8";
  3264. const buffer_ieee754 = "< 0.9.7";
  3265. const buffer = true;
  3266. const child_process = true;
  3267. const cluster = true;
  3268. const console$1 = true;
  3269. const constants$1 = true;
  3270. const crypto$1 = true;
  3271. const _debug_agent = ">= 1 && < 8";
  3272. const _debugger = "< 8";
  3273. const dgram = true;
  3274. const diagnostics_channel = ">= 15.1";
  3275. const dns = true;
  3276. const domain = ">= 0.7.12";
  3277. const events$1 = true;
  3278. const freelist = "< 6";
  3279. const fs = true;
  3280. const _http_agent = ">= 0.11.1";
  3281. const _http_client = ">= 0.11.1";
  3282. const _http_common = ">= 0.11.1";
  3283. const _http_incoming = ">= 0.11.1";
  3284. const _http_outgoing = ">= 0.11.1";
  3285. const _http_server = ">= 0.11.1";
  3286. const http = true;
  3287. const http2 = ">= 8.8";
  3288. const https = true;
  3289. const inspector = ">= 8.0.0";
  3290. const _linklist = "< 8";
  3291. const module$1 = true;
  3292. const net = true;
  3293. const os = true;
  3294. const path$2 = true;
  3295. const perf_hooks = ">= 8.5";
  3296. const process$1 = ">= 1";
  3297. const punycode = true;
  3298. const querystring = true;
  3299. const readline = true;
  3300. const repl = true;
  3301. const smalloc = ">= 0.11.5 && < 3";
  3302. const _stream_duplex = ">= 0.9.4";
  3303. const _stream_transform = ">= 0.9.4";
  3304. const _stream_wrap = ">= 1.4.1";
  3305. const _stream_passthrough = ">= 0.9.4";
  3306. const _stream_readable = ">= 0.9.4";
  3307. const _stream_writable = ">= 0.9.4";
  3308. const stream = true;
  3309. const string_decoder = true;
  3310. const sys = [
  3311. ">= 0.6 && < 0.7",
  3312. ">= 0.8"
  3313. ];
  3314. const timers$1 = true;
  3315. const _tls_common = ">= 0.11.13";
  3316. const _tls_legacy = ">= 0.11.3 && < 10";
  3317. const _tls_wrap = ">= 0.11.3";
  3318. const tls = true;
  3319. const trace_events = ">= 10";
  3320. const tty = true;
  3321. const url = true;
  3322. const util$2 = true;
  3323. const v8 = ">= 1";
  3324. const vm = true;
  3325. const wasi = ">= 13.4 && < 13.5";
  3326. const worker_threads = ">= 11.7";
  3327. const zlib = true;
  3328. const data$1 = {
  3329. assert: assert$1,
  3330. "assert/strict": ">= 15",
  3331. async_hooks: async_hooks,
  3332. buffer_ieee754: buffer_ieee754,
  3333. buffer: buffer,
  3334. child_process: child_process,
  3335. cluster: cluster,
  3336. console: console$1,
  3337. constants: constants$1,
  3338. crypto: crypto$1,
  3339. _debug_agent: _debug_agent,
  3340. _debugger: _debugger,
  3341. dgram: dgram,
  3342. diagnostics_channel: diagnostics_channel,
  3343. dns: dns,
  3344. "dns/promises": ">= 15",
  3345. domain: domain,
  3346. events: events$1,
  3347. freelist: freelist,
  3348. fs: fs,
  3349. "fs/promises": [
  3350. ">= 10 && < 10.1",
  3351. ">= 14"
  3352. ],
  3353. _http_agent: _http_agent,
  3354. _http_client: _http_client,
  3355. _http_common: _http_common,
  3356. _http_incoming: _http_incoming,
  3357. _http_outgoing: _http_outgoing,
  3358. _http_server: _http_server,
  3359. http: http,
  3360. http2: http2,
  3361. https: https,
  3362. inspector: inspector,
  3363. _linklist: _linklist,
  3364. module: module$1,
  3365. net: net,
  3366. "node-inspect/lib/_inspect": ">= 7.6.0 && < 12",
  3367. "node-inspect/lib/internal/inspect_client": ">= 7.6.0 && < 12",
  3368. "node-inspect/lib/internal/inspect_repl": ">= 7.6.0 && < 12",
  3369. os: os,
  3370. path: path$2,
  3371. "path/posix": ">= 15.3",
  3372. "path/win32": ">= 15.3",
  3373. perf_hooks: perf_hooks,
  3374. process: process$1,
  3375. punycode: punycode,
  3376. querystring: querystring,
  3377. readline: readline,
  3378. repl: repl,
  3379. smalloc: smalloc,
  3380. _stream_duplex: _stream_duplex,
  3381. _stream_transform: _stream_transform,
  3382. _stream_wrap: _stream_wrap,
  3383. _stream_passthrough: _stream_passthrough,
  3384. _stream_readable: _stream_readable,
  3385. _stream_writable: _stream_writable,
  3386. stream: stream,
  3387. "stream/promises": ">= 15",
  3388. string_decoder: string_decoder,
  3389. sys: sys,
  3390. timers: timers$1,
  3391. "timers/promises": ">= 15",
  3392. _tls_common: _tls_common,
  3393. _tls_legacy: _tls_legacy,
  3394. _tls_wrap: _tls_wrap,
  3395. tls: tls,
  3396. trace_events: trace_events,
  3397. tty: tty,
  3398. url: url,
  3399. util: util$2,
  3400. "util/types": ">= 15.3",
  3401. "v8/tools/arguments": ">= 10 && < 12",
  3402. "v8/tools/codemap": [
  3403. ">= 4.4.0 && < 5",
  3404. ">= 5.2.0 && < 12"
  3405. ],
  3406. "v8/tools/consarray": [
  3407. ">= 4.4.0 && < 5",
  3408. ">= 5.2.0 && < 12"
  3409. ],
  3410. "v8/tools/csvparser": [
  3411. ">= 4.4.0 && < 5",
  3412. ">= 5.2.0 && < 12"
  3413. ],
  3414. "v8/tools/logreader": [
  3415. ">= 4.4.0 && < 5",
  3416. ">= 5.2.0 && < 12"
  3417. ],
  3418. "v8/tools/profile_view": [
  3419. ">= 4.4.0 && < 5",
  3420. ">= 5.2.0 && < 12"
  3421. ],
  3422. "v8/tools/splaytree": [
  3423. ">= 4.4.0 && < 5",
  3424. ">= 5.2.0 && < 12"
  3425. ],
  3426. v8: v8,
  3427. vm: vm,
  3428. wasi: wasi,
  3429. worker_threads: worker_threads,
  3430. zlib: zlib
  3431. };
  3432. var current = (process.versions && process.versions.node && process.versions.node.split('.')) || [];
  3433. function specifierIncluded(specifier) {
  3434. var parts = specifier.split(' ');
  3435. var op = parts.length > 1 ? parts[0] : '=';
  3436. var versionParts = (parts.length > 1 ? parts[1] : parts[0]).split('.');
  3437. for (var i = 0; i < 3; ++i) {
  3438. var cur = parseInt(current[i] || 0, 10);
  3439. var ver = parseInt(versionParts[i] || 0, 10);
  3440. if (cur === ver) {
  3441. continue; // eslint-disable-line no-restricted-syntax, no-continue
  3442. }
  3443. if (op === '<') {
  3444. return cur < ver;
  3445. } else if (op === '>=') {
  3446. return cur >= ver;
  3447. } else {
  3448. return false;
  3449. }
  3450. }
  3451. return op === '>=';
  3452. }
  3453. function matchesRange(range) {
  3454. var specifiers = range.split(/ ?&& ?/);
  3455. if (specifiers.length === 0) { return false; }
  3456. for (var i = 0; i < specifiers.length; ++i) {
  3457. if (!specifierIncluded(specifiers[i])) { return false; }
  3458. }
  3459. return true;
  3460. }
  3461. function versionIncluded(specifierValue) {
  3462. if (typeof specifierValue === 'boolean') { return specifierValue; }
  3463. if (specifierValue && typeof specifierValue === 'object') {
  3464. for (var i = 0; i < specifierValue.length; ++i) {
  3465. if (matchesRange(specifierValue[i])) { return true; }
  3466. }
  3467. return false;
  3468. }
  3469. return matchesRange(specifierValue);
  3470. }
  3471. var core = {};
  3472. for (var mod in data$1) { // eslint-disable-line no-restricted-syntax
  3473. if (Object.prototype.hasOwnProperty.call(data$1, mod)) {
  3474. core[mod] = versionIncluded(data$1[mod]);
  3475. }
  3476. }
  3477. var core_1 = core;
  3478. var isCore = function isCore(x) {
  3479. return isCoreModule(x);
  3480. };
  3481. var realpathFS = fs$1.realpathSync && typeof fs$1.realpathSync.native === 'function' ? fs$1.realpathSync.native : fs$1.realpathSync;
  3482. var defaultIsFile = function isFile(file) {
  3483. try {
  3484. var stat = fs$1.statSync(file);
  3485. } catch (e) {
  3486. if (e && (e.code === 'ENOENT' || e.code === 'ENOTDIR')) return false;
  3487. throw e;
  3488. }
  3489. return stat.isFile() || stat.isFIFO();
  3490. };
  3491. var defaultIsDir = function isDirectory(dir) {
  3492. try {
  3493. var stat = fs$1.statSync(dir);
  3494. } catch (e) {
  3495. if (e && (e.code === 'ENOENT' || e.code === 'ENOTDIR')) return false;
  3496. throw e;
  3497. }
  3498. return stat.isDirectory();
  3499. };
  3500. var defaultRealpathSync = function realpathSync(x) {
  3501. try {
  3502. return realpathFS(x);
  3503. } catch (realpathErr) {
  3504. if (realpathErr.code !== 'ENOENT') {
  3505. throw realpathErr;
  3506. }
  3507. }
  3508. return x;
  3509. };
  3510. var maybeRealpathSync = function maybeRealpathSync(realpathSync, x, opts) {
  3511. if (opts && opts.preserveSymlinks === false) {
  3512. return realpathSync(x);
  3513. }
  3514. return x;
  3515. };
  3516. var defaultReadPackageSync = function defaultReadPackageSync(readFileSync, pkgfile) {
  3517. var body = readFileSync(pkgfile);
  3518. try {
  3519. var pkg = JSON.parse(body);
  3520. return pkg;
  3521. } catch (jsonErr) {}
  3522. };
  3523. var getPackageCandidates = function getPackageCandidates(x, start, opts) {
  3524. var dirs = nodeModulesPaths(start, opts, x);
  3525. for (var i = 0; i < dirs.length; i++) {
  3526. dirs[i] = path$4.join(dirs[i], x);
  3527. }
  3528. return dirs;
  3529. };
  3530. var sync$1 = function resolveSync(x, options) {
  3531. if (typeof x !== 'string') {
  3532. throw new TypeError('Path must be a string.');
  3533. }
  3534. var opts = normalizeOptions(x, options);
  3535. var isFile = opts.isFile || defaultIsFile;
  3536. var readFileSync = opts.readFileSync || fs$1.readFileSync;
  3537. var isDirectory = opts.isDirectory || defaultIsDir;
  3538. var realpathSync = opts.realpathSync || defaultRealpathSync;
  3539. var readPackageSync = opts.readPackageSync || defaultReadPackageSync;
  3540. if (opts.readFileSync && opts.readPackageSync) {
  3541. throw new TypeError('`readFileSync` and `readPackageSync` are mutually exclusive.');
  3542. }
  3543. var packageIterator = opts.packageIterator;
  3544. var extensions = opts.extensions || ['.js'];
  3545. var includeCoreModules = opts.includeCoreModules !== false;
  3546. var basedir = opts.basedir || path$4.dirname(caller());
  3547. var parent = opts.filename || basedir;
  3548. opts.paths = opts.paths || [];
  3549. // ensure that `basedir` is an absolute path at this point, resolving against the process' current working directory
  3550. var absoluteStart = maybeRealpathSync(realpathSync, path$4.resolve(basedir), opts);
  3551. if ((/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/).test(x)) {
  3552. var res = path$4.resolve(absoluteStart, x);
  3553. if (x === '.' || x === '..' || x.slice(-1) === '/') res += '/';
  3554. var m = loadAsFileSync(res) || loadAsDirectorySync(res);
  3555. if (m) return maybeRealpathSync(realpathSync, m, opts);
  3556. } else if (includeCoreModules && isCoreModule(x)) {
  3557. return x;
  3558. } else {
  3559. var n = loadNodeModulesSync(x, absoluteStart);
  3560. if (n) return maybeRealpathSync(realpathSync, n, opts);
  3561. }
  3562. var err = new Error("Cannot find module '" + x + "' from '" + parent + "'");
  3563. err.code = 'MODULE_NOT_FOUND';
  3564. throw err;
  3565. function loadAsFileSync(x) {
  3566. var pkg = loadpkg(path$4.dirname(x));
  3567. if (pkg && pkg.dir && pkg.pkg && opts.pathFilter) {
  3568. var rfile = path$4.relative(pkg.dir, x);
  3569. var r = opts.pathFilter(pkg.pkg, x, rfile);
  3570. if (r) {
  3571. x = path$4.resolve(pkg.dir, r); // eslint-disable-line no-param-reassign
  3572. }
  3573. }
  3574. if (isFile(x)) {
  3575. return x;
  3576. }
  3577. for (var i = 0; i < extensions.length; i++) {
  3578. var file = x + extensions[i];
  3579. if (isFile(file)) {
  3580. return file;
  3581. }
  3582. }
  3583. }
  3584. function loadpkg(dir) {
  3585. if (dir === '' || dir === '/') return;
  3586. if (process.platform === 'win32' && (/^\w:[/\\]*$/).test(dir)) {
  3587. return;
  3588. }
  3589. if ((/[/\\]node_modules[/\\]*$/).test(dir)) return;
  3590. var pkgfile = path$4.join(maybeRealpathSync(realpathSync, dir, opts), 'package.json');
  3591. if (!isFile(pkgfile)) {
  3592. return loadpkg(path$4.dirname(dir));
  3593. }
  3594. var pkg = readPackageSync(readFileSync, pkgfile);
  3595. if (pkg && opts.packageFilter) {
  3596. // v2 will pass pkgfile
  3597. pkg = opts.packageFilter(pkg, /*pkgfile,*/ dir); // eslint-disable-line spaced-comment
  3598. }
  3599. return { pkg: pkg, dir: dir };
  3600. }
  3601. function loadAsDirectorySync(x) {
  3602. var pkgfile = path$4.join(maybeRealpathSync(realpathSync, x, opts), '/package.json');
  3603. if (isFile(pkgfile)) {
  3604. try {
  3605. var pkg = readPackageSync(readFileSync, pkgfile);
  3606. } catch (e) {}
  3607. if (pkg && opts.packageFilter) {
  3608. // v2 will pass pkgfile
  3609. pkg = opts.packageFilter(pkg, /*pkgfile,*/ x); // eslint-disable-line spaced-comment
  3610. }
  3611. if (pkg && pkg.main) {
  3612. if (typeof pkg.main !== 'string') {
  3613. var mainError = new TypeError('package “' + pkg.name + '” `main` must be a string');
  3614. mainError.code = 'INVALID_PACKAGE_MAIN';
  3615. throw mainError;
  3616. }
  3617. if (pkg.main === '.' || pkg.main === './') {
  3618. pkg.main = 'index';
  3619. }
  3620. try {
  3621. var m = loadAsFileSync(path$4.resolve(x, pkg.main));
  3622. if (m) return m;
  3623. var n = loadAsDirectorySync(path$4.resolve(x, pkg.main));
  3624. if (n) return n;
  3625. } catch (e) {}
  3626. }
  3627. }
  3628. return loadAsFileSync(path$4.join(x, '/index'));
  3629. }
  3630. function loadNodeModulesSync(x, start) {
  3631. var thunk = function () { return getPackageCandidates(x, start, opts); };
  3632. var dirs = packageIterator ? packageIterator(x, start, thunk, opts) : thunk();
  3633. for (var i = 0; i < dirs.length; i++) {
  3634. var dir = dirs[i];
  3635. if (isDirectory(path$4.dirname(dir))) {
  3636. var m = loadAsFileSync(dir);
  3637. if (m) return m;
  3638. var n = loadAsDirectorySync(dir);
  3639. if (n) return n;
  3640. }
  3641. }
  3642. }
  3643. };
  3644. async.core = core_1;
  3645. async.isCore = isCore;
  3646. async.sync = sync$1;
  3647. var resolve = async;
  3648. const resolveModuleIdAsync = (sys, inMemoryFs, opts) => {
  3649. const resolverOpts = createCustomResolverAsync(sys, inMemoryFs, opts.exts);
  3650. resolverOpts.basedir = dirname(normalizeFsPath(opts.containingFile));
  3651. if (opts.packageFilter) {
  3652. resolverOpts.packageFilter = opts.packageFilter;
  3653. }
  3654. else if (opts.packageFilter !== null) {
  3655. resolverOpts.packageFilter = (pkg) => {
  3656. if (!isString$1(pkg.main) || pkg.main === '') {
  3657. pkg.main = 'package.json';
  3658. }
  3659. return pkg;
  3660. };
  3661. }
  3662. return new Promise((resolvePromise, rejectPromise) => {
  3663. resolve(opts.moduleId, resolverOpts, (err, resolveId, pkgData) => {
  3664. if (err) {
  3665. rejectPromise(err);
  3666. }
  3667. else {
  3668. resolveId = normalizePath$1(resolveId);
  3669. const results = {
  3670. moduleId: opts.moduleId,
  3671. resolveId,
  3672. pkgData,
  3673. pkgDirPath: getPackageDirPath(resolveId, opts.moduleId),
  3674. };
  3675. resolvePromise(results);
  3676. }
  3677. });
  3678. });
  3679. };
  3680. const createCustomResolverAsync = (sys, inMemoryFs, exts) => {
  3681. return {
  3682. async isFile(filePath, cb) {
  3683. const fsFilePath = normalizeFsPath(filePath);
  3684. const stat = await inMemoryFs.stat(fsFilePath);
  3685. if (stat.isFile) {
  3686. cb(null, true);
  3687. return;
  3688. }
  3689. if (shouldFetchModule(fsFilePath)) {
  3690. const endsWithExt = exts.some((ext) => fsFilePath.endsWith(ext));
  3691. if (endsWithExt) {
  3692. const url = getNodeModuleFetchUrl(sys, packageVersions, fsFilePath);
  3693. const content = await fetchModuleAsync(sys, inMemoryFs, packageVersions, url, fsFilePath);
  3694. const checkFileExists = typeof content === 'string';
  3695. cb(null, checkFileExists);
  3696. return;
  3697. }
  3698. }
  3699. cb(null, false);
  3700. },
  3701. async isDirectory(dirPath, cb) {
  3702. const fsDirPath = normalizeFsPath(dirPath);
  3703. const stat = await inMemoryFs.stat(fsDirPath);
  3704. if (stat.isDirectory) {
  3705. cb(null, true);
  3706. return;
  3707. }
  3708. if (shouldFetchModule(fsDirPath)) {
  3709. if (basename(fsDirPath) === 'node_modules') {
  3710. // just the /node_modules directory
  3711. inMemoryFs.sys.createDirSync(fsDirPath);
  3712. inMemoryFs.clearFileCache(fsDirPath);
  3713. cb(null, true);
  3714. return;
  3715. }
  3716. if (isCommonDirModuleFile(fsDirPath)) {
  3717. // don't bother seeing if it's a directory if it has a common file extension
  3718. cb(null, false);
  3719. return;
  3720. }
  3721. for (const fileName of COMMON_DIR_FILENAMES) {
  3722. const url = getCommonDirUrl(sys, packageVersions, fsDirPath, fileName);
  3723. const filePath = getCommonDirName(fsDirPath, fileName);
  3724. const content = await fetchModuleAsync(sys, inMemoryFs, packageVersions, url, filePath);
  3725. if (isString$1(content)) {
  3726. cb(null, true);
  3727. return;
  3728. }
  3729. }
  3730. }
  3731. cb(null, false);
  3732. },
  3733. async readFile(p, cb) {
  3734. const fsFilePath = normalizeFsPath(p);
  3735. const data = await inMemoryFs.readFile(fsFilePath);
  3736. if (isString$1(data)) {
  3737. return cb(null, data);
  3738. }
  3739. return cb(`readFile not found: ${p}`);
  3740. },
  3741. async realpath(p, cb) {
  3742. const fsFilePath = normalizeFsPath(p);
  3743. const results = await sys.realpath(fsFilePath);
  3744. if (results.error && results.error.code !== 'ENOENT') {
  3745. cb(results.error);
  3746. }
  3747. else {
  3748. cb(null, results.error ? fsFilePath : results.path);
  3749. }
  3750. },
  3751. extensions: exts,
  3752. };
  3753. };
  3754. const buildId = '20220418164701';
  3755. const minfyJsId = 'terser5.6.1_7';
  3756. const optimizeCssId = 'autoprefixer10.2.5_postcss8.2.8_7';
  3757. const parse5Version = '6.0.1';
  3758. const rollupVersion = '2.42.3';
  3759. const sizzleVersion = '2.42.3';
  3760. const terserVersion = '5.6.1';
  3761. const typescriptVersion = '4.5.4';
  3762. const vermoji = '🐼';
  3763. const version$3 = '2.15.1';
  3764. const versions = {
  3765. stencil: version$3,
  3766. parse5: parse5Version,
  3767. rollup: rollupVersion,
  3768. sizzle: sizzleVersion,
  3769. terser: terserVersion,
  3770. typescript: typescriptVersion,
  3771. };
  3772. const createSystem = (c) => {
  3773. const logger = c && c.logger ? c.logger : createLogger();
  3774. const items = new Map();
  3775. const destroys = new Set();
  3776. const addDestory = (cb) => destroys.add(cb);
  3777. const removeDestory = (cb) => destroys.delete(cb);
  3778. const events = buildEvents();
  3779. const hardwareConcurrency = (IS_BROWSER_ENV && navigator.hardwareConcurrency) || 1;
  3780. const destroy = async () => {
  3781. const waits = [];
  3782. destroys.forEach((cb) => {
  3783. try {
  3784. const rtn = cb();
  3785. if (rtn && rtn.then) {
  3786. waits.push(rtn);
  3787. }
  3788. }
  3789. catch (e) {
  3790. logger.error(`stencil sys destroy: ${e}`);
  3791. }
  3792. });
  3793. await Promise.all(waits);
  3794. destroys.clear();
  3795. };
  3796. const normalize = (p) => {
  3797. if (p === '/' || p === '') {
  3798. return '/';
  3799. }
  3800. const dir = dirname(p);
  3801. const base = basename(p);
  3802. if (dir.endsWith('/')) {
  3803. return normalizePath$1(`${dir}${base}`);
  3804. }
  3805. return normalizePath$1(`${dir}/${base}`);
  3806. };
  3807. const accessSync = (p) => {
  3808. const item = items.get(normalize(p));
  3809. return !!(item && (item.isDirectory || (item.isFile && typeof item.data === 'string')));
  3810. };
  3811. const access = async (p) => accessSync(p);
  3812. const copyFile = async (src, dest) => {
  3813. writeFileSync(dest, readFileSync(src));
  3814. return true;
  3815. };
  3816. const isTTY = () => {
  3817. var _a;
  3818. return !!((_a = process$3 === null || process$3 === void 0 ? void 0 : process_1.stdout) === null || _a === void 0 ? void 0 : _a.isTTY);
  3819. };
  3820. const homeDir = () => {
  3821. return undefined();
  3822. };
  3823. const createDirSync = (p, opts) => {
  3824. p = normalize(p);
  3825. const results = {
  3826. basename: basename(p),
  3827. dirname: dirname(p),
  3828. path: p,
  3829. newDirs: [],
  3830. error: null,
  3831. };
  3832. createDirRecursiveSync(p, opts, results);
  3833. return results;
  3834. };
  3835. const createDirRecursiveSync = (p, opts, results) => {
  3836. const parentDir = dirname(p);
  3837. if (opts && opts.recursive && !isRootPath(parentDir)) {
  3838. createDirRecursiveSync(parentDir, opts, results);
  3839. }
  3840. const item = items.get(p);
  3841. if (!item) {
  3842. items.set(p, {
  3843. basename: basename(p),
  3844. dirname: parentDir,
  3845. isDirectory: true,
  3846. isFile: false,
  3847. watcherCallbacks: null,
  3848. data: undefined,
  3849. });
  3850. results.newDirs.push(p);
  3851. emitDirectoryWatch(p, new Set());
  3852. }
  3853. else {
  3854. item.isDirectory = true;
  3855. item.isFile = false;
  3856. }
  3857. };
  3858. const createDir = async (p, opts) => createDirSync(p, opts);
  3859. const encodeToBase64 = (str) => btoa(unescape(encodeURIComponent(str)));
  3860. const getCurrentDirectory = () => '/';
  3861. const getCompilerExecutingPath = () => {
  3862. if (IS_WEB_WORKER_ENV) {
  3863. return location.href;
  3864. }
  3865. return sys.getRemoteModuleUrl({ moduleId: '@stencil/core', path: 'compiler/stencil.min.js' });
  3866. };
  3867. const isSymbolicLink = async (_p) => false;
  3868. const readDirSync = (p) => {
  3869. p = normalize(p);
  3870. const dirItems = [];
  3871. const dir = items.get(p);
  3872. if (dir && dir.isDirectory) {
  3873. items.forEach((item, itemPath) => {
  3874. if (itemPath !== '/' && (item.isDirectory || (item.isFile && typeof item.data === 'string'))) {
  3875. if (p.endsWith('/') && `${p}${item.basename}` === itemPath) {
  3876. dirItems.push(itemPath);
  3877. }
  3878. else if (`${p}/${item.basename}` === itemPath) {
  3879. dirItems.push(itemPath);
  3880. }
  3881. }
  3882. });
  3883. }
  3884. return dirItems.sort();
  3885. };
  3886. const readDir = async (p) => readDirSync(p);
  3887. const readFileSync = (p) => {
  3888. p = normalize(p);
  3889. const item = items.get(p);
  3890. if (item && item.isFile) {
  3891. return item.data;
  3892. }
  3893. return undefined;
  3894. };
  3895. const readFile = async (p) => readFileSync(p);
  3896. const realpathSync = (p) => {
  3897. const results = {
  3898. path: normalize(p),
  3899. error: null,
  3900. };
  3901. return results;
  3902. };
  3903. const realpath = async (p) => realpathSync(p);
  3904. const rename = async (oldPath, newPath) => {
  3905. oldPath = normalizePath$1(oldPath);
  3906. newPath = normalizePath$1(newPath);
  3907. const results = {
  3908. oldPath,
  3909. newPath,
  3910. renamed: [],
  3911. oldDirs: [],
  3912. oldFiles: [],
  3913. newDirs: [],
  3914. newFiles: [],
  3915. isFile: false,
  3916. isDirectory: false,
  3917. error: null,
  3918. };
  3919. const stats = statSync(oldPath);
  3920. if (!stats.error) {
  3921. if (stats.isFile) {
  3922. results.isFile = true;
  3923. }
  3924. else if (stats.isDirectory) {
  3925. results.isDirectory = true;
  3926. }
  3927. renameNewRecursiveSync(oldPath, newPath, results);
  3928. if (!results.error) {
  3929. if (results.isDirectory) {
  3930. const rmdirResults = removeDirSync(oldPath, { recursive: true });
  3931. if (rmdirResults.error) {
  3932. results.error = rmdirResults.error;
  3933. }
  3934. else {
  3935. results.oldDirs.push(...rmdirResults.removedDirs);
  3936. results.oldFiles.push(...rmdirResults.removedFiles);
  3937. }
  3938. }
  3939. else if (results.isFile) {
  3940. const removeFileResults = removeFileSync(oldPath);
  3941. if (removeFileResults.error) {
  3942. results.error = removeFileResults.error;
  3943. }
  3944. else {
  3945. results.oldFiles.push(oldPath);
  3946. }
  3947. }
  3948. }
  3949. }
  3950. else {
  3951. results.error = `${oldPath} does not exist`;
  3952. }
  3953. return results;
  3954. };
  3955. const renameNewRecursiveSync = (oldPath, newPath, results) => {
  3956. const itemStat = statSync(oldPath);
  3957. if (!itemStat.error && !results.error) {
  3958. if (itemStat.isFile) {
  3959. const newFileParentDir = dirname(newPath);
  3960. const createDirResults = createDirSync(newFileParentDir, { recursive: true });
  3961. const fileContent = items.get(oldPath).data;
  3962. const writeResults = writeFileSync(newPath, fileContent);
  3963. results.newDirs.push(...createDirResults.newDirs);
  3964. results.renamed.push({
  3965. oldPath,
  3966. newPath,
  3967. isDirectory: false,
  3968. isFile: true,
  3969. });
  3970. if (writeResults.error) {
  3971. results.error = writeResults.error;
  3972. }
  3973. else {
  3974. results.newFiles.push(newPath);
  3975. }
  3976. }
  3977. else if (itemStat.isDirectory) {
  3978. const oldDirItemChildPaths = readDirSync(oldPath);
  3979. const createDirResults = createDirSync(newPath, { recursive: true });
  3980. results.newDirs.push(...createDirResults.newDirs);
  3981. results.renamed.push({
  3982. oldPath,
  3983. newPath,
  3984. isDirectory: true,
  3985. isFile: false,
  3986. });
  3987. for (const oldDirItemChildPath of oldDirItemChildPaths) {
  3988. const newDirItemChildPath = oldDirItemChildPath.replace(oldPath, newPath);
  3989. renameNewRecursiveSync(oldDirItemChildPath, newDirItemChildPath, results);
  3990. }
  3991. }
  3992. }
  3993. };
  3994. const resolvePath = (p) => normalize(p);
  3995. const removeDirSync = (p, opts = {}) => {
  3996. const results = {
  3997. basename: basename(p),
  3998. dirname: dirname(p),
  3999. path: p,
  4000. removedDirs: [],
  4001. removedFiles: [],
  4002. error: null,
  4003. };
  4004. remoreDirSyncRecursive(p, opts, results);
  4005. return results;
  4006. };
  4007. const remoreDirSyncRecursive = (p, opts, results) => {
  4008. if (!results.error) {
  4009. p = normalize(p);
  4010. const dirItemPaths = readDirSync(p);
  4011. if (opts && opts.recursive) {
  4012. for (const dirItemPath of dirItemPaths) {
  4013. const item = items.get(dirItemPath);
  4014. if (item) {
  4015. if (item.isDirectory) {
  4016. remoreDirSyncRecursive(dirItemPath, opts, results);
  4017. }
  4018. else if (item.isFile) {
  4019. const removeFileResults = removeFileSync(dirItemPath);
  4020. if (removeFileResults.error) {
  4021. results.error = removeFileResults.error;
  4022. }
  4023. else {
  4024. results.removedFiles.push(dirItemPath);
  4025. }
  4026. }
  4027. }
  4028. }
  4029. }
  4030. else {
  4031. if (dirItemPaths.length > 0) {
  4032. results.error = `cannot delete directory that contains files/subdirectories`;
  4033. return;
  4034. }
  4035. }
  4036. items.delete(p);
  4037. emitDirectoryWatch(p, new Set());
  4038. results.removedDirs.push(p);
  4039. }
  4040. };
  4041. const removeDir = async (p, opts = {}) => removeDirSync(p, opts);
  4042. const statSync = (p) => {
  4043. p = normalize(p);
  4044. const item = items.get(p);
  4045. if (item && (item.isDirectory || (item.isFile && typeof item.data === 'string'))) {
  4046. return {
  4047. isDirectory: item.isDirectory,
  4048. isFile: item.isFile,
  4049. isSymbolicLink: false,
  4050. size: item.isFile && item.data ? item.data.length : 0,
  4051. error: null,
  4052. };
  4053. }
  4054. return {
  4055. isDirectory: false,
  4056. isFile: false,
  4057. isSymbolicLink: false,
  4058. size: 0,
  4059. error: `ENOENT: no such file or directory, statSync '${p}'`,
  4060. };
  4061. };
  4062. const stat = async (p) => statSync(p);
  4063. const removeFileSync = (p) => {
  4064. p = normalize(p);
  4065. const results = {
  4066. basename: basename(p),
  4067. dirname: dirname(p),
  4068. path: p,
  4069. error: null,
  4070. };
  4071. const item = items.get(p);
  4072. if (item) {
  4073. if (item.watcherCallbacks) {
  4074. for (const watcherCallback of item.watcherCallbacks) {
  4075. watcherCallback(p, 'fileDelete');
  4076. }
  4077. }
  4078. items.delete(p);
  4079. emitDirectoryWatch(p, new Set());
  4080. }
  4081. return results;
  4082. };
  4083. const removeFile = async (p) => removeFileSync(p);
  4084. const watchDirectory = (p, dirWatcherCallback) => {
  4085. p = normalize(p);
  4086. const item = items.get(p);
  4087. const close = () => {
  4088. const closeItem = items.get(p);
  4089. if (closeItem && closeItem.watcherCallbacks) {
  4090. const index = closeItem.watcherCallbacks.indexOf(dirWatcherCallback);
  4091. if (index > -1) {
  4092. closeItem.watcherCallbacks.splice(index, 1);
  4093. }
  4094. }
  4095. };
  4096. addDestory(close);
  4097. if (item) {
  4098. item.isDirectory = true;
  4099. item.isFile = false;
  4100. item.watcherCallbacks = item.watcherCallbacks || [];
  4101. item.watcherCallbacks.push(dirWatcherCallback);
  4102. }
  4103. else {
  4104. items.set(p, {
  4105. basename: basename(p),
  4106. dirname: dirname(p),
  4107. isDirectory: true,
  4108. isFile: false,
  4109. watcherCallbacks: [dirWatcherCallback],
  4110. data: undefined,
  4111. });
  4112. }
  4113. return {
  4114. close() {
  4115. removeDestory(close);
  4116. close();
  4117. },
  4118. };
  4119. };
  4120. const watchFile = (p, fileWatcherCallback) => {
  4121. p = normalize(p);
  4122. const item = items.get(p);
  4123. const close = () => {
  4124. const closeItem = items.get(p);
  4125. if (closeItem && closeItem.watcherCallbacks) {
  4126. const index = closeItem.watcherCallbacks.indexOf(fileWatcherCallback);
  4127. if (index > -1) {
  4128. closeItem.watcherCallbacks.splice(index, 1);
  4129. }
  4130. }
  4131. };
  4132. addDestory(close);
  4133. if (item) {
  4134. item.isDirectory = false;
  4135. item.isFile = true;
  4136. item.watcherCallbacks = item.watcherCallbacks || [];
  4137. item.watcherCallbacks.push(fileWatcherCallback);
  4138. }
  4139. else {
  4140. items.set(p, {
  4141. basename: basename(p),
  4142. dirname: dirname(p),
  4143. isDirectory: false,
  4144. isFile: true,
  4145. watcherCallbacks: [fileWatcherCallback],
  4146. data: undefined,
  4147. });
  4148. }
  4149. return {
  4150. close() {
  4151. removeDestory(close);
  4152. close();
  4153. },
  4154. };
  4155. };
  4156. const emitDirectoryWatch = (p, emitted) => {
  4157. const parentDir = normalize(dirname(p));
  4158. const dirItem = items.get(parentDir);
  4159. if (dirItem && dirItem.isDirectory && dirItem.watcherCallbacks) {
  4160. for (const watcherCallback of dirItem.watcherCallbacks) {
  4161. watcherCallback(p, null);
  4162. }
  4163. }
  4164. if (!emitted.has(parentDir)) {
  4165. emitted.add(parentDir);
  4166. emitDirectoryWatch(parentDir, emitted);
  4167. }
  4168. };
  4169. const writeFileSync = (p, data) => {
  4170. p = normalize(p);
  4171. const results = {
  4172. path: p,
  4173. error: null,
  4174. };
  4175. const item = items.get(p);
  4176. if (item) {
  4177. const hasChanged = item.data !== data;
  4178. item.data = data;
  4179. if (hasChanged && item.watcherCallbacks) {
  4180. for (const watcherCallback of item.watcherCallbacks) {
  4181. watcherCallback(p, 'fileUpdate');
  4182. }
  4183. }
  4184. }
  4185. else {
  4186. items.set(p, {
  4187. basename: basename(p),
  4188. dirname: dirname(p),
  4189. isDirectory: false,
  4190. isFile: true,
  4191. watcherCallbacks: null,
  4192. data,
  4193. });
  4194. emitDirectoryWatch(p, new Set());
  4195. }
  4196. return results;
  4197. };
  4198. /**
  4199. * `self` is the global namespace object used within a web worker.
  4200. * `window` is the browser's global namespace object (I reorganized this to check the reference on that second)
  4201. * `global` is Node's global namespace object. https://nodejs.org/api/globals.html#globals_global
  4202. *
  4203. * loading in this order should allow workers, which are most common, then browser,
  4204. * then Node to grab the reference to fetch correctly.
  4205. */
  4206. const fetch = typeof self !== 'undefined'
  4207. ? self === null || self === void 0 ? void 0 : self.fetch
  4208. : typeof window !== 'undefined'
  4209. ? window === null || window === void 0 ? void 0 : window.fetch
  4210. : typeof global !== 'undefined'
  4211. ? global === null || global === void 0 ? void 0 : global.fetch
  4212. : undefined;
  4213. const writeFile = async (p, data) => writeFileSync(p, data);
  4214. const tmpDirSync = () => '/.tmp';
  4215. const tick = Promise.resolve();
  4216. const nextTick = (cb) => tick.then(cb);
  4217. const generateContentHash = async (content, hashLength) => {
  4218. const arrayBuffer = await crypto.subtle.digest('SHA-256', new TextEncoder().encode(content));
  4219. const hashArray = Array.from(new Uint8Array(arrayBuffer)); // convert buffer to byte array
  4220. let hashHex = hashArray.map((b) => b.toString(16).padStart(2, '0')).join(''); // convert bytes to hex string
  4221. if (typeof hashLength === 'number') {
  4222. hashHex = hashHex.slice(0, hashLength);
  4223. }
  4224. return hashHex;
  4225. };
  4226. const copy = async (copyTasks, srcDir) => {
  4227. const results = {
  4228. diagnostics: [],
  4229. dirPaths: [],
  4230. filePaths: [],
  4231. };
  4232. logger.info('todo, copy task', copyTasks.length, srcDir);
  4233. return results;
  4234. };
  4235. const getEnvironmentVar = (key) => {
  4236. return process$3 === null || process$3 === void 0 ? void 0 : process_1.env[key];
  4237. };
  4238. const getLocalModulePath = (opts) => join(opts.rootDir, 'node_modules', opts.moduleId, opts.path);
  4239. const getRemoteModuleUrl = (opts) => {
  4240. const npmBaseUrl = 'https://cdn.jsdelivr.net/npm/';
  4241. const path = `${opts.moduleId}${opts.version ? '@' + opts.version : ''}/${opts.path}`;
  4242. return new URL(path, npmBaseUrl).href;
  4243. };
  4244. const fileWatchTimeout = 32;
  4245. createDirSync('/');
  4246. const sys = {
  4247. name: 'in-memory',
  4248. version: version$3,
  4249. events,
  4250. access,
  4251. accessSync,
  4252. addDestory,
  4253. copyFile,
  4254. createDir,
  4255. createDirSync,
  4256. homeDir,
  4257. isTTY,
  4258. getEnvironmentVar,
  4259. destroy,
  4260. encodeToBase64,
  4261. exit: async (exitCode) => logger.warn(`exit ${exitCode}`),
  4262. getCurrentDirectory,
  4263. getCompilerExecutingPath,
  4264. getLocalModulePath,
  4265. getRemoteModuleUrl,
  4266. hardwareConcurrency,
  4267. isSymbolicLink,
  4268. nextTick,
  4269. normalizePath: normalize,
  4270. platformPath: pathBrowserify,
  4271. readDir,
  4272. readDirSync,
  4273. readFile,
  4274. readFileSync,
  4275. realpath,
  4276. realpathSync,
  4277. removeDestory,
  4278. rename,
  4279. fetch,
  4280. resolvePath,
  4281. removeDir,
  4282. removeDirSync,
  4283. stat,
  4284. statSync,
  4285. tmpDirSync,
  4286. removeFile,
  4287. removeFileSync,
  4288. watchDirectory,
  4289. watchFile,
  4290. watchTimeout: fileWatchTimeout,
  4291. writeFile,
  4292. writeFileSync,
  4293. generateContentHash,
  4294. createWorkerController: HAS_WEB_WORKER
  4295. ? (maxConcurrentWorkers) => createWebWorkerMainController(sys, maxConcurrentWorkers)
  4296. : null,
  4297. details: {
  4298. cpuModel: '',
  4299. freemem: () => 0,
  4300. platform: '',
  4301. release: '',
  4302. totalmem: 0,
  4303. },
  4304. copy,
  4305. };
  4306. sys.resolveModuleId = (opts) => resolveModuleIdAsync(sys, null, opts);
  4307. return sys;
  4308. };
  4309. let cssProcessor;
  4310. const autoprefixCss = async (cssText, opts) => {
  4311. const output = {
  4312. output: cssText,
  4313. diagnostics: [],
  4314. };
  4315. if (!IS_NODE_ENV) {
  4316. return output;
  4317. }
  4318. try {
  4319. const autoprefixerOpts = opts != null && typeof opts === 'object' ? opts : DEFAULT_AUTOPREFIX_LEGACY;
  4320. const processor = getProcessor(autoprefixerOpts);
  4321. const result = await processor.process(cssText, { map: null });
  4322. result.warnings().forEach((warning) => {
  4323. output.diagnostics.push({
  4324. header: `Autoprefix CSS: ${warning.plugin}`,
  4325. messageText: warning.text,
  4326. level: 'warn',
  4327. type: 'css',
  4328. });
  4329. });
  4330. output.output = result.css;
  4331. }
  4332. catch (e) {
  4333. const diagnostic = {
  4334. header: `Autoprefix CSS`,
  4335. messageText: `CSS Error` + e,
  4336. level: `error`,
  4337. type: `css`,
  4338. };
  4339. if (typeof e.name === 'string') {
  4340. diagnostic.header = e.name;
  4341. }
  4342. if (typeof e.reason === 'string') {
  4343. diagnostic.messageText = e.reason;
  4344. }
  4345. if (typeof e.source === 'string' && typeof e.line === 'number') {
  4346. const lines = e.source.replace(/\r/g, '\n').split('\n');
  4347. if (lines.length > 0) {
  4348. const addLine = (lineNumber) => {
  4349. const line = lines[lineNumber];
  4350. if (typeof line === 'string') {
  4351. const printLine = {
  4352. lineIndex: -1,
  4353. lineNumber: -1,
  4354. text: line,
  4355. errorCharStart: -1,
  4356. errorLength: -1,
  4357. };
  4358. diagnostic.lines = diagnostic.lines || [];
  4359. diagnostic.lines.push(printLine);
  4360. }
  4361. };
  4362. addLine(e.line - 3);
  4363. addLine(e.line - 2);
  4364. addLine(e.line - 1);
  4365. addLine(e.line);
  4366. addLine(e.line + 1);
  4367. addLine(e.line + 2);
  4368. addLine(e.line + 3);
  4369. }
  4370. }
  4371. output.diagnostics.push(diagnostic);
  4372. }
  4373. return output;
  4374. };
  4375. const getProcessor = (autoprefixerOpts) => {
  4376. const { postcss, autoprefixer } = requireFunc('../sys/node/autoprefixer.js');
  4377. if (!cssProcessor) {
  4378. cssProcessor = postcss([autoprefixer(autoprefixerOpts)]);
  4379. }
  4380. return cssProcessor;
  4381. };
  4382. const DEFAULT_AUTOPREFIX_LEGACY = {
  4383. overrideBrowserslist: ['last 2 versions', 'iOS >= 9', 'Android >= 4.4', 'Explorer >= 11', 'ExplorerMobile >= 11'],
  4384. cascade: false,
  4385. remove: false,
  4386. flexbox: 'no-2009',
  4387. };
  4388. const parseCss = (css, filePath) => {
  4389. let lineno = 1;
  4390. let column = 1;
  4391. const diagnostics = [];
  4392. const updatePosition = (str) => {
  4393. const lines = str.match(/\n/g);
  4394. if (lines)
  4395. lineno += lines.length;
  4396. const i = str.lastIndexOf('\n');
  4397. column = ~i ? str.length - i : column + str.length;
  4398. };
  4399. const position = () => {
  4400. const start = { line: lineno, column: column };
  4401. return (node) => {
  4402. node.position = new ParsePosition(start);
  4403. whitespace();
  4404. return node;
  4405. };
  4406. };
  4407. const error = (msg) => {
  4408. const srcLines = css.split('\n');
  4409. const d = {
  4410. level: 'error',
  4411. type: 'css',
  4412. language: 'css',
  4413. header: 'CSS Parse',
  4414. messageText: msg,
  4415. absFilePath: filePath,
  4416. lines: [
  4417. {
  4418. lineIndex: lineno - 1,
  4419. lineNumber: lineno,
  4420. errorCharStart: column,
  4421. text: css[lineno - 1],
  4422. },
  4423. ],
  4424. };
  4425. if (lineno > 1) {
  4426. const previousLine = {
  4427. lineIndex: lineno - 1,
  4428. lineNumber: lineno - 1,
  4429. text: css[lineno - 2],
  4430. errorCharStart: -1,
  4431. errorLength: -1,
  4432. };
  4433. d.lines.unshift(previousLine);
  4434. }
  4435. if (lineno + 2 < srcLines.length) {
  4436. const nextLine = {
  4437. lineIndex: lineno,
  4438. lineNumber: lineno + 1,
  4439. text: srcLines[lineno],
  4440. errorCharStart: -1,
  4441. errorLength: -1,
  4442. };
  4443. d.lines.push(nextLine);
  4444. }
  4445. diagnostics.push(d);
  4446. return null;
  4447. };
  4448. const stylesheet = () => {
  4449. const rulesList = rules();
  4450. return {
  4451. type: 14 /* StyleSheet */,
  4452. stylesheet: {
  4453. source: filePath,
  4454. rules: rulesList,
  4455. },
  4456. };
  4457. };
  4458. const open = () => match(/^{\s*/);
  4459. const close = () => match(/^}/);
  4460. const match = (re) => {
  4461. const m = re.exec(css);
  4462. if (!m)
  4463. return;
  4464. const str = m[0];
  4465. updatePosition(str);
  4466. css = css.slice(str.length);
  4467. return m;
  4468. };
  4469. const rules = () => {
  4470. let node;
  4471. const rules = [];
  4472. whitespace();
  4473. comments(rules);
  4474. while (css.length && css.charAt(0) !== '}' && (node = atrule() || rule())) {
  4475. if (node !== false) {
  4476. rules.push(node);
  4477. comments(rules);
  4478. }
  4479. }
  4480. return rules;
  4481. };
  4482. /**
  4483. * Parse whitespace.
  4484. */
  4485. const whitespace = () => match(/^\s*/);
  4486. const comments = (rules) => {
  4487. let c;
  4488. rules = rules || [];
  4489. while ((c = comment())) {
  4490. if (c !== false) {
  4491. rules.push(c);
  4492. }
  4493. }
  4494. return rules;
  4495. };
  4496. const comment = () => {
  4497. const pos = position();
  4498. if ('/' !== css.charAt(0) || '*' !== css.charAt(1))
  4499. return null;
  4500. let i = 2;
  4501. while ('' !== css.charAt(i) && ('*' !== css.charAt(i) || '/' !== css.charAt(i + 1)))
  4502. ++i;
  4503. i += 2;
  4504. if ('' === css.charAt(i - 1)) {
  4505. return error('End of comment missing');
  4506. }
  4507. const comment = css.slice(2, i - 2);
  4508. column += 2;
  4509. updatePosition(comment);
  4510. css = css.slice(i);
  4511. column += 2;
  4512. return pos({
  4513. type: 1 /* Comment */,
  4514. comment,
  4515. });
  4516. };
  4517. const selector = () => {
  4518. const m = match(/^([^{]+)/);
  4519. if (!m)
  4520. return null;
  4521. return trim(m[0])
  4522. .replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g, '')
  4523. .replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g, function (m) {
  4524. return m.replace(/,/g, '\u200C');
  4525. })
  4526. .split(/\s*(?![^(]*\)),\s*/)
  4527. .map(function (s) {
  4528. return s.replace(/\u200C/g, ',');
  4529. });
  4530. };
  4531. const declaration = () => {
  4532. const pos = position();
  4533. // prop
  4534. let prop = match(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);
  4535. if (!prop)
  4536. return null;
  4537. prop = trim(prop[0]);
  4538. // :
  4539. if (!match(/^:\s*/))
  4540. return error(`property missing ':'`);
  4541. // val
  4542. const val = match(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/);
  4543. const ret = pos({
  4544. type: 4 /* Declaration */,
  4545. property: prop.replace(commentre, ''),
  4546. value: val ? trim(val[0]).replace(commentre, '') : '',
  4547. });
  4548. match(/^[;\s]*/);
  4549. return ret;
  4550. };
  4551. const declarations = () => {
  4552. const decls = [];
  4553. if (!open())
  4554. return error(`missing '{'`);
  4555. comments(decls);
  4556. // declarations
  4557. let decl;
  4558. while ((decl = declaration())) {
  4559. if (decl !== false) {
  4560. decls.push(decl);
  4561. comments(decls);
  4562. }
  4563. }
  4564. if (!close())
  4565. return error(`missing '}'`);
  4566. return decls;
  4567. };
  4568. const keyframe = () => {
  4569. let m;
  4570. const values = [];
  4571. const pos = position();
  4572. while ((m = match(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/))) {
  4573. values.push(m[1]);
  4574. match(/^,\s*/);
  4575. }
  4576. if (!values.length)
  4577. return null;
  4578. return pos({
  4579. type: 9 /* KeyFrame */,
  4580. values,
  4581. declarations: declarations(),
  4582. });
  4583. };
  4584. const atkeyframes = () => {
  4585. const pos = position();
  4586. let m = match(/^@([-\w]+)?keyframes\s*/);
  4587. if (!m)
  4588. return null;
  4589. const vendor = m[1];
  4590. // identifier
  4591. m = match(/^([-\w]+)\s*/);
  4592. if (!m)
  4593. return error(`@keyframes missing name`);
  4594. const name = m[1];
  4595. if (!open())
  4596. return error(`@keyframes missing '{'`);
  4597. let frame;
  4598. let frames = comments();
  4599. while ((frame = keyframe())) {
  4600. frames.push(frame);
  4601. frames = frames.concat(comments());
  4602. }
  4603. if (!close())
  4604. return error(`@keyframes missing '}'`);
  4605. return pos({
  4606. type: 8 /* KeyFrames */,
  4607. name: name,
  4608. vendor: vendor,
  4609. keyframes: frames,
  4610. });
  4611. };
  4612. const atsupports = () => {
  4613. const pos = position();
  4614. const m = match(/^@supports *([^{]+)/);
  4615. if (!m)
  4616. return null;
  4617. const supports = trim(m[1]);
  4618. if (!open())
  4619. return error(`@supports missing '{'`);
  4620. const style = comments().concat(rules());
  4621. if (!close())
  4622. return error(`@supports missing '}'`);
  4623. return pos({
  4624. type: 15 /* Supports */,
  4625. supports: supports,
  4626. rules: style,
  4627. });
  4628. };
  4629. const athost = () => {
  4630. const pos = position();
  4631. const m = match(/^@host\s*/);
  4632. if (!m)
  4633. return null;
  4634. if (!open())
  4635. return error(`@host missing '{'`);
  4636. const style = comments().concat(rules());
  4637. if (!close())
  4638. return error(`@host missing '}'`);
  4639. return pos({
  4640. type: 6 /* Host */,
  4641. rules: style,
  4642. });
  4643. };
  4644. const atmedia = () => {
  4645. const pos = position();
  4646. const m = match(/^@media *([^{]+)/);
  4647. if (!m)
  4648. return null;
  4649. const media = trim(m[1]);
  4650. if (!open())
  4651. return error(`@media missing '{'`);
  4652. const style = comments().concat(rules());
  4653. if (!close())
  4654. return error(`@media missing '}'`);
  4655. return pos({
  4656. type: 10 /* Media */,
  4657. media: media,
  4658. rules: style,
  4659. });
  4660. };
  4661. const atcustommedia = () => {
  4662. const pos = position();
  4663. const m = match(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);
  4664. if (!m)
  4665. return null;
  4666. return pos({
  4667. type: 2 /* CustomMedia */,
  4668. name: trim(m[1]),
  4669. media: trim(m[2]),
  4670. });
  4671. };
  4672. const atpage = () => {
  4673. const pos = position();
  4674. const m = match(/^@page */);
  4675. if (!m)
  4676. return null;
  4677. const sel = selector() || [];
  4678. if (!open())
  4679. return error(`@page missing '{'`);
  4680. let decls = comments();
  4681. let decl;
  4682. while ((decl = declaration())) {
  4683. decls.push(decl);
  4684. decls = decls.concat(comments());
  4685. }
  4686. if (!close())
  4687. return error(`@page missing '}'`);
  4688. return pos({
  4689. type: 12 /* Page */,
  4690. selectors: sel,
  4691. declarations: decls,
  4692. });
  4693. };
  4694. const atdocument = () => {
  4695. const pos = position();
  4696. const m = match(/^@([-\w]+)?document *([^{]+)/);
  4697. if (!m)
  4698. return null;
  4699. const vendor = trim(m[1]);
  4700. const doc = trim(m[2]);
  4701. if (!open())
  4702. return error(`@document missing '{'`);
  4703. const style = comments().concat(rules());
  4704. if (!close())
  4705. return error(`@document missing '}'`);
  4706. return pos({
  4707. type: 3 /* Document */,
  4708. document: doc,
  4709. vendor: vendor,
  4710. rules: style,
  4711. });
  4712. };
  4713. const atfontface = () => {
  4714. const pos = position();
  4715. const m = match(/^@font-face\s*/);
  4716. if (!m)
  4717. return null;
  4718. if (!open())
  4719. return error(`@font-face missing '{'`);
  4720. let decls = comments();
  4721. let decl;
  4722. while ((decl = declaration())) {
  4723. decls.push(decl);
  4724. decls = decls.concat(comments());
  4725. }
  4726. if (!close())
  4727. return error(`@font-face missing '}'`);
  4728. return pos({
  4729. type: 5 /* FontFace */,
  4730. declarations: decls,
  4731. });
  4732. };
  4733. const compileAtrule = (nodeName, nodeType) => {
  4734. const re = new RegExp('^@' + nodeName + '\\s*([^;]+);');
  4735. return () => {
  4736. const pos = position();
  4737. const m = match(re);
  4738. if (!m)
  4739. return null;
  4740. const node = {
  4741. type: nodeType,
  4742. };
  4743. node[nodeName] = m[1].trim();
  4744. return pos(node);
  4745. };
  4746. };
  4747. const atimport = compileAtrule('import', 7 /* Import */);
  4748. const atcharset = compileAtrule('charset', 0 /* Charset */);
  4749. const atnamespace = compileAtrule('namespace', 11 /* Namespace */);
  4750. const atrule = () => {
  4751. if (css[0] !== '@')
  4752. return null;
  4753. return (atkeyframes() ||
  4754. atmedia() ||
  4755. atcustommedia() ||
  4756. atsupports() ||
  4757. atimport() ||
  4758. atcharset() ||
  4759. atnamespace() ||
  4760. atdocument() ||
  4761. atpage() ||
  4762. athost() ||
  4763. atfontface());
  4764. };
  4765. const rule = () => {
  4766. const pos = position();
  4767. const sel = selector();
  4768. if (!sel)
  4769. return error('selector missing');
  4770. comments();
  4771. return pos({
  4772. type: 13 /* Rule */,
  4773. selectors: sel,
  4774. declarations: declarations(),
  4775. });
  4776. };
  4777. class ParsePosition {
  4778. constructor(start) {
  4779. this.start = start;
  4780. this.end = { line: lineno, column: column };
  4781. this.source = filePath;
  4782. }
  4783. }
  4784. ParsePosition.prototype.content = css;
  4785. return {
  4786. diagnostics,
  4787. ...addParent(stylesheet()),
  4788. };
  4789. };
  4790. const trim = (str) => (str ? str.trim() : '');
  4791. /**
  4792. * Adds non-enumerable parent node reference to each node.
  4793. */
  4794. const addParent = (obj, parent) => {
  4795. const isNode = obj && typeof obj.type === 'string';
  4796. const childParent = isNode ? obj : parent;
  4797. for (const k in obj) {
  4798. const value = obj[k];
  4799. if (Array.isArray(value)) {
  4800. value.forEach(function (v) {
  4801. addParent(v, childParent);
  4802. });
  4803. }
  4804. else if (value && typeof value === 'object') {
  4805. addParent(value, childParent);
  4806. }
  4807. }
  4808. if (isNode) {
  4809. Object.defineProperty(obj, 'parent', {
  4810. configurable: true,
  4811. writable: true,
  4812. enumerable: false,
  4813. value: parent || null,
  4814. });
  4815. }
  4816. return obj;
  4817. };
  4818. // http://www.w3.org/TR/CSS21/grammar.html
  4819. // https://github.com/visionmedia/css-parse/pull/49#issuecomment-30088027
  4820. const commentre = /\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;
  4821. const getCssSelectors = (sel) => {
  4822. // reusing global SELECTORS since this is a synchronous operation
  4823. SELECTORS.all.length =
  4824. SELECTORS.tags.length =
  4825. SELECTORS.classNames.length =
  4826. SELECTORS.ids.length =
  4827. SELECTORS.attrs.length =
  4828. 0;
  4829. sel = sel
  4830. .replace(/\./g, ' .')
  4831. .replace(/\#/g, ' #')
  4832. .replace(/\[/g, ' [')
  4833. .replace(/\>/g, ' > ')
  4834. .replace(/\+/g, ' + ')
  4835. .replace(/\~/g, ' ~ ')
  4836. .replace(/\*/g, ' * ')
  4837. .replace(/\:not\((.*?)\)/g, ' ');
  4838. const items = sel.split(' ');
  4839. for (let i = 0, l = items.length; i < l; i++) {
  4840. items[i] = items[i].split(':')[0];
  4841. if (items[i].length === 0)
  4842. continue;
  4843. if (items[i].charAt(0) === '.') {
  4844. SELECTORS.classNames.push(items[i].slice(1));
  4845. }
  4846. else if (items[i].charAt(0) === '#') {
  4847. SELECTORS.ids.push(items[i].slice(1));
  4848. }
  4849. else if (items[i].charAt(0) === '[') {
  4850. items[i] = items[i].slice(1).split('=')[0].split(']')[0].trim();
  4851. SELECTORS.attrs.push(items[i].toLowerCase());
  4852. }
  4853. else if (/[a-z]/g.test(items[i].charAt(0))) {
  4854. SELECTORS.tags.push(items[i].toLowerCase());
  4855. }
  4856. }
  4857. SELECTORS.classNames = SELECTORS.classNames.sort((a, b) => {
  4858. if (a.length < b.length)
  4859. return -1;
  4860. if (a.length > b.length)
  4861. return 1;
  4862. return 0;
  4863. });
  4864. return SELECTORS;
  4865. };
  4866. const SELECTORS = {
  4867. all: [],
  4868. tags: [],
  4869. classNames: [],
  4870. ids: [],
  4871. attrs: [],
  4872. };
  4873. const serializeCss = (stylesheet, serializeOpts) => {
  4874. const usedSelectors = serializeOpts.usedSelectors || null;
  4875. const opts = {
  4876. usedSelectors: usedSelectors || null,
  4877. hasUsedAttrs: !!usedSelectors && usedSelectors.attrs.size > 0,
  4878. hasUsedClassNames: !!usedSelectors && usedSelectors.classNames.size > 0,
  4879. hasUsedIds: !!usedSelectors && usedSelectors.ids.size > 0,
  4880. hasUsedTags: !!usedSelectors && usedSelectors.tags.size > 0,
  4881. };
  4882. const rules = stylesheet.rules;
  4883. if (!rules) {
  4884. return '';
  4885. }
  4886. const rulesLen = rules.length;
  4887. const out = [];
  4888. for (let i = 0; i < rulesLen; i++) {
  4889. out.push(serializeCssVisitNode(opts, rules[i], i, rulesLen));
  4890. }
  4891. return out.join('');
  4892. };
  4893. const serializeCssVisitNode = (opts, node, index, len) => {
  4894. const nodeType = node.type;
  4895. if (nodeType === 4 /* Declaration */) {
  4896. return serializeCssDeclaration(node, index, len);
  4897. }
  4898. if (nodeType === 13 /* Rule */) {
  4899. return serializeCssRule(opts, node);
  4900. }
  4901. if (nodeType === 1 /* Comment */) {
  4902. if (node.comment[0] === '!') {
  4903. return `/*${node.comment}*/`;
  4904. }
  4905. else {
  4906. return '';
  4907. }
  4908. }
  4909. if (nodeType === 10 /* Media */) {
  4910. return serializeCssMedia(opts, node);
  4911. }
  4912. if (nodeType === 8 /* KeyFrames */) {
  4913. return serializeCssKeyframes(opts, node);
  4914. }
  4915. if (nodeType === 9 /* KeyFrame */) {
  4916. return serializeCssKeyframe(opts, node);
  4917. }
  4918. if (nodeType === 5 /* FontFace */) {
  4919. return serializeCssFontFace(opts, node);
  4920. }
  4921. if (nodeType === 15 /* Supports */) {
  4922. return serializeCssSupports(opts, node);
  4923. }
  4924. if (nodeType === 7 /* Import */) {
  4925. return '@import ' + node.import + ';';
  4926. }
  4927. if (nodeType === 0 /* Charset */) {
  4928. return '@charset ' + node.charset + ';';
  4929. }
  4930. if (nodeType === 12 /* Page */) {
  4931. return serializeCssPage(opts, node);
  4932. }
  4933. if (nodeType === 6 /* Host */) {
  4934. return '@host{' + serializeCssMapVisit(opts, node.rules) + '}';
  4935. }
  4936. if (nodeType === 2 /* CustomMedia */) {
  4937. return '@custom-media ' + node.name + ' ' + node.media + ';';
  4938. }
  4939. if (nodeType === 3 /* Document */) {
  4940. return serializeCssDocument(opts, node);
  4941. }
  4942. if (nodeType === 11 /* Namespace */) {
  4943. return '@namespace ' + node.namespace + ';';
  4944. }
  4945. return '';
  4946. };
  4947. const serializeCssRule = (opts, node) => {
  4948. const decls = node.declarations;
  4949. const usedSelectors = opts.usedSelectors;
  4950. const selectors = node.selectors.slice();
  4951. if (decls == null || decls.length === 0) {
  4952. return '';
  4953. }
  4954. if (usedSelectors) {
  4955. let i;
  4956. let j;
  4957. let include = true;
  4958. for (i = selectors.length - 1; i >= 0; i--) {
  4959. const sel = getCssSelectors(selectors[i]);
  4960. include = true;
  4961. // classes
  4962. let jlen = sel.classNames.length;
  4963. if (jlen > 0 && opts.hasUsedClassNames) {
  4964. for (j = 0; j < jlen; j++) {
  4965. if (!usedSelectors.classNames.has(sel.classNames[j])) {
  4966. include = false;
  4967. break;
  4968. }
  4969. }
  4970. }
  4971. // tags
  4972. if (include && opts.hasUsedTags) {
  4973. jlen = sel.tags.length;
  4974. if (jlen > 0) {
  4975. for (j = 0; j < jlen; j++) {
  4976. if (!usedSelectors.tags.has(sel.tags[j])) {
  4977. include = false;
  4978. break;
  4979. }
  4980. }
  4981. }
  4982. }
  4983. // attrs
  4984. if (include && opts.hasUsedAttrs) {
  4985. jlen = sel.attrs.length;
  4986. if (jlen > 0) {
  4987. for (j = 0; j < jlen; j++) {
  4988. if (!usedSelectors.attrs.has(sel.attrs[j])) {
  4989. include = false;
  4990. break;
  4991. }
  4992. }
  4993. }
  4994. }
  4995. // ids
  4996. if (include && opts.hasUsedIds) {
  4997. jlen = sel.ids.length;
  4998. if (jlen > 0) {
  4999. for (j = 0; j < jlen; j++) {
  5000. if (!usedSelectors.ids.has(sel.ids[j])) {
  5001. include = false;
  5002. break;
  5003. }
  5004. }
  5005. }
  5006. }
  5007. if (!include) {
  5008. selectors.splice(i, 1);
  5009. }
  5010. }
  5011. }
  5012. if (selectors.length === 0) {
  5013. return '';
  5014. }
  5015. const cleanedSelectors = [];
  5016. let cleanedSelector = '';
  5017. for (const selector of node.selectors) {
  5018. cleanedSelector = removeSelectorWhitespace(selector);
  5019. if (!cleanedSelectors.includes(cleanedSelector)) {
  5020. cleanedSelectors.push(cleanedSelector);
  5021. }
  5022. }
  5023. return `${cleanedSelectors}{${serializeCssMapVisit(opts, decls)}}`;
  5024. };
  5025. const serializeCssDeclaration = (node, index, len) => {
  5026. if (node.value === '') {
  5027. return '';
  5028. }
  5029. if (len - 1 === index) {
  5030. return node.property + ':' + node.value;
  5031. }
  5032. return node.property + ':' + node.value + ';';
  5033. };
  5034. const serializeCssMedia = (opts, node) => {
  5035. const mediaCss = serializeCssMapVisit(opts, node.rules);
  5036. if (mediaCss === '') {
  5037. return '';
  5038. }
  5039. return '@media ' + removeMediaWhitespace(node.media) + '{' + mediaCss + '}';
  5040. };
  5041. const serializeCssKeyframes = (opts, node) => {
  5042. const keyframesCss = serializeCssMapVisit(opts, node.keyframes);
  5043. if (keyframesCss === '') {
  5044. return '';
  5045. }
  5046. return '@' + (node.vendor || '') + 'keyframes ' + node.name + '{' + keyframesCss + '}';
  5047. };
  5048. const serializeCssKeyframe = (opts, node) => {
  5049. return node.values.join(',') + '{' + serializeCssMapVisit(opts, node.declarations) + '}';
  5050. };
  5051. const serializeCssFontFace = (opts, node) => {
  5052. const fontCss = serializeCssMapVisit(opts, node.declarations);
  5053. if (fontCss === '') {
  5054. return '';
  5055. }
  5056. return '@font-face{' + fontCss + '}';
  5057. };
  5058. const serializeCssSupports = (opts, node) => {
  5059. const supportsCss = serializeCssMapVisit(opts, node.rules);
  5060. if (supportsCss === '') {
  5061. return '';
  5062. }
  5063. return '@supports ' + node.supports + '{' + supportsCss + '}';
  5064. };
  5065. const serializeCssPage = (opts, node) => {
  5066. const sel = node.selectors.join(', ');
  5067. return '@page ' + sel + '{' + serializeCssMapVisit(opts, node.declarations) + '}';
  5068. };
  5069. const serializeCssDocument = (opts, node) => {
  5070. const documentCss = serializeCssMapVisit(opts, node.rules);
  5071. const doc = '@' + (node.vendor || '') + 'document ' + node.document;
  5072. if (documentCss === '') {
  5073. return '';
  5074. }
  5075. return doc + '{' + documentCss + '}';
  5076. };
  5077. const serializeCssMapVisit = (opts, nodes) => {
  5078. let rtn = '';
  5079. if (nodes) {
  5080. for (let i = 0, len = nodes.length; i < len; i++) {
  5081. rtn += serializeCssVisitNode(opts, nodes[i], i, len);
  5082. }
  5083. }
  5084. return rtn;
  5085. };
  5086. const removeSelectorWhitespace = (selector) => {
  5087. let rtn = '';
  5088. let char = '';
  5089. let inAttr = false;
  5090. selector = selector.trim();
  5091. for (let i = 0, l = selector.length; i < l; i++) {
  5092. char = selector[i];
  5093. if (char === '[' && rtn[rtn.length - 1] !== '\\') {
  5094. inAttr = true;
  5095. }
  5096. else if (char === ']' && rtn[rtn.length - 1] !== '\\') {
  5097. inAttr = false;
  5098. }
  5099. if (!inAttr && CSS_WS_REG.test(char)) {
  5100. if (CSS_NEXT_CHAR_REG.test(selector[i + 1])) {
  5101. continue;
  5102. }
  5103. if (CSS_PREV_CHAR_REG.test(rtn[rtn.length - 1])) {
  5104. continue;
  5105. }
  5106. rtn += ' ';
  5107. }
  5108. else {
  5109. rtn += char;
  5110. }
  5111. }
  5112. return rtn;
  5113. };
  5114. const removeMediaWhitespace = (media) => {
  5115. let rtn = '';
  5116. let char = '';
  5117. media = media.trim();
  5118. for (let i = 0, l = media.length; i < l; i++) {
  5119. char = media[i];
  5120. if (CSS_WS_REG.test(char)) {
  5121. if (CSS_WS_REG.test(rtn[rtn.length - 1])) {
  5122. continue;
  5123. }
  5124. rtn += ' ';
  5125. }
  5126. else {
  5127. rtn += char;
  5128. }
  5129. }
  5130. return rtn;
  5131. };
  5132. const CSS_WS_REG = /\s/;
  5133. const CSS_NEXT_CHAR_REG = /[>\(\)\~\,\+\s]/;
  5134. const CSS_PREV_CHAR_REG = /[>\(\~\,\+]/;
  5135. const minifyCss = async (input) => {
  5136. const parseResults = parseCss(input.css);
  5137. if (hasError(parseResults.diagnostics)) {
  5138. return input.css;
  5139. }
  5140. if (isFunction(input.resolveUrl) && parseResults.stylesheet && Array.isArray(parseResults.stylesheet.rules)) {
  5141. await resolveStylesheetUrl(parseResults.stylesheet.rules, input.resolveUrl);
  5142. }
  5143. return serializeCss(parseResults.stylesheet, {});
  5144. };
  5145. const resolveStylesheetUrl = async (nodes, resolveUrl, resolved) => {
  5146. for (const node of nodes) {
  5147. if (node.type === 4 /* Declaration */ && isString$1(node.value) && node.value.includes('url(')) {
  5148. const urlSplt = node.value.split(',').map((n) => n.trim());
  5149. for (let i = 0; i < urlSplt.length; i++) {
  5150. const r = /url\((.*?)\)/.exec(urlSplt[i]);
  5151. if (r) {
  5152. try {
  5153. const orgUrl = r[1].replace(/(\'|\")/g, '');
  5154. const newUrl = await resolveUrl(orgUrl);
  5155. urlSplt[i] = urlSplt[i].replace(orgUrl, newUrl);
  5156. }
  5157. catch (e) { }
  5158. }
  5159. }
  5160. node.value = urlSplt.join(',');
  5161. }
  5162. if (Array.isArray(node.declarations)) {
  5163. await resolveStylesheetUrl(node.declarations, resolveUrl);
  5164. }
  5165. if (Array.isArray(node.rules)) {
  5166. await resolveStylesheetUrl(node.rules, resolveUrl);
  5167. }
  5168. if (Array.isArray(node.keyframes)) {
  5169. await resolveStylesheetUrl(node.keyframes, resolveUrl);
  5170. }
  5171. }
  5172. };
  5173. const optimizeCss$1 = async (inputOpts) => {
  5174. let result = {
  5175. output: inputOpts.input,
  5176. diagnostics: [],
  5177. };
  5178. if (inputOpts.autoprefixer !== false && inputOpts.autoprefixer !== null) {
  5179. result = await autoprefixCss(inputOpts.input, inputOpts.autoprefixer);
  5180. if (hasError(result.diagnostics)) {
  5181. return result;
  5182. }
  5183. }
  5184. if (inputOpts.minify !== false) {
  5185. result.output = await minifyCss({
  5186. css: result.output,
  5187. resolveUrl: inputOpts.resolveUrl,
  5188. });
  5189. }
  5190. return result;
  5191. };
  5192. /* -*- Mode: js; js-indent-level: 2; -*- */
  5193. /*
  5194. * Copyright 2011 Mozilla Foundation and contributors
  5195. * Licensed under the New BSD license. See LICENSE or:
  5196. * http://opensource.org/licenses/BSD-3-Clause
  5197. */
  5198. var intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split('');
  5199. /**
  5200. * Encode an integer in the range of 0 to 63 to a single base 64 digit.
  5201. */
  5202. var encode$4 = function (number) {
  5203. if (0 <= number && number < intToCharMap.length) {
  5204. return intToCharMap[number];
  5205. }
  5206. throw new TypeError("Must be between 0 and 63: " + number);
  5207. };
  5208. /**
  5209. * Decode a single base 64 character code digit to an integer. Returns -1 on
  5210. * failure.
  5211. */
  5212. var decode$2 = function (charCode) {
  5213. var bigA = 65; // 'A'
  5214. var bigZ = 90; // 'Z'
  5215. var littleA = 97; // 'a'
  5216. var littleZ = 122; // 'z'
  5217. var zero = 48; // '0'
  5218. var nine = 57; // '9'
  5219. var plus = 43; // '+'
  5220. var slash = 47; // '/'
  5221. var littleOffset = 26;
  5222. var numberOffset = 52;
  5223. // 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ
  5224. if (bigA <= charCode && charCode <= bigZ) {
  5225. return (charCode - bigA);
  5226. }
  5227. // 26 - 51: abcdefghijklmnopqrstuvwxyz
  5228. if (littleA <= charCode && charCode <= littleZ) {
  5229. return (charCode - littleA + littleOffset);
  5230. }
  5231. // 52 - 61: 0123456789
  5232. if (zero <= charCode && charCode <= nine) {
  5233. return (charCode - zero + numberOffset);
  5234. }
  5235. // 62: +
  5236. if (charCode == plus) {
  5237. return 62;
  5238. }
  5239. // 63: /
  5240. if (charCode == slash) {
  5241. return 63;
  5242. }
  5243. // Invalid base64 digit.
  5244. return -1;
  5245. };
  5246. var base64 = {
  5247. encode: encode$4,
  5248. decode: decode$2
  5249. };
  5250. /* -*- Mode: js; js-indent-level: 2; -*- */
  5251. /*
  5252. * Copyright 2011 Mozilla Foundation and contributors
  5253. * Licensed under the New BSD license. See LICENSE or:
  5254. * http://opensource.org/licenses/BSD-3-Clause
  5255. *
  5256. * Based on the Base 64 VLQ implementation in Closure Compiler:
  5257. * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java
  5258. *
  5259. * Copyright 2011 The Closure Compiler Authors. All rights reserved.
  5260. * Redistribution and use in source and binary forms, with or without
  5261. * modification, are permitted provided that the following conditions are
  5262. * met:
  5263. *
  5264. * * Redistributions of source code must retain the above copyright
  5265. * notice, this list of conditions and the following disclaimer.
  5266. * * Redistributions in binary form must reproduce the above
  5267. * copyright notice, this list of conditions and the following
  5268. * disclaimer in the documentation and/or other materials provided
  5269. * with the distribution.
  5270. * * Neither the name of Google Inc. nor the names of its
  5271. * contributors may be used to endorse or promote products derived
  5272. * from this software without specific prior written permission.
  5273. *
  5274. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  5275. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  5276. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  5277. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  5278. * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  5279. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  5280. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  5281. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  5282. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  5283. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  5284. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  5285. */
  5286. // A single base 64 digit can contain 6 bits of data. For the base 64 variable
  5287. // length quantities we use in the source map spec, the first bit is the sign,
  5288. // the next four bits are the actual value, and the 6th bit is the
  5289. // continuation bit. The continuation bit tells us whether there are more
  5290. // digits in this value following this digit.
  5291. //
  5292. // Continuation
  5293. // | Sign
  5294. // | |
  5295. // V V
  5296. // 101011
  5297. var VLQ_BASE_SHIFT = 5;
  5298. // binary: 100000
  5299. var VLQ_BASE = 1 << VLQ_BASE_SHIFT;
  5300. // binary: 011111
  5301. var VLQ_BASE_MASK = VLQ_BASE - 1;
  5302. // binary: 100000
  5303. var VLQ_CONTINUATION_BIT = VLQ_BASE;
  5304. /**
  5305. * Converts from a two-complement value to a value where the sign bit is
  5306. * placed in the least significant bit. For example, as decimals:
  5307. * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary)
  5308. * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary)
  5309. */
  5310. function toVLQSigned(aValue) {
  5311. return aValue < 0
  5312. ? ((-aValue) << 1) + 1
  5313. : (aValue << 1) + 0;
  5314. }
  5315. /**
  5316. * Converts to a two-complement value from a value where the sign bit is
  5317. * placed in the least significant bit. For example, as decimals:
  5318. * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1
  5319. * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2
  5320. */
  5321. function fromVLQSigned(aValue) {
  5322. var isNegative = (aValue & 1) === 1;
  5323. var shifted = aValue >> 1;
  5324. return isNegative
  5325. ? -shifted
  5326. : shifted;
  5327. }
  5328. /**
  5329. * Returns the base 64 VLQ encoded value.
  5330. */
  5331. var encode$3 = function base64VLQ_encode(aValue) {
  5332. var encoded = "";
  5333. var digit;
  5334. var vlq = toVLQSigned(aValue);
  5335. do {
  5336. digit = vlq & VLQ_BASE_MASK;
  5337. vlq >>>= VLQ_BASE_SHIFT;
  5338. if (vlq > 0) {
  5339. // There are still more digits in this value, so we must make sure the
  5340. // continuation bit is marked.
  5341. digit |= VLQ_CONTINUATION_BIT;
  5342. }
  5343. encoded += base64.encode(digit);
  5344. } while (vlq > 0);
  5345. return encoded;
  5346. };
  5347. /**
  5348. * Decodes the next base 64 VLQ value from the given string and returns the
  5349. * value and the rest of the string via the out parameter.
  5350. */
  5351. var decode$1 = function base64VLQ_decode(aStr, aIndex, aOutParam) {
  5352. var strLen = aStr.length;
  5353. var result = 0;
  5354. var shift = 0;
  5355. var continuation, digit;
  5356. do {
  5357. if (aIndex >= strLen) {
  5358. throw new Error("Expected more digits in base 64 VLQ value.");
  5359. }
  5360. digit = base64.decode(aStr.charCodeAt(aIndex++));
  5361. if (digit === -1) {
  5362. throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1));
  5363. }
  5364. continuation = !!(digit & VLQ_CONTINUATION_BIT);
  5365. digit &= VLQ_BASE_MASK;
  5366. result = result + (digit << shift);
  5367. shift += VLQ_BASE_SHIFT;
  5368. } while (continuation);
  5369. aOutParam.value = fromVLQSigned(result);
  5370. aOutParam.rest = aIndex;
  5371. };
  5372. var base64Vlq = {
  5373. encode: encode$3,
  5374. decode: decode$1
  5375. };
  5376. var util$1 = createCommonjsModule$1(function (module, exports) {
  5377. /* -*- Mode: js; js-indent-level: 2; -*- */
  5378. /*
  5379. * Copyright 2011 Mozilla Foundation and contributors
  5380. * Licensed under the New BSD license. See LICENSE or:
  5381. * http://opensource.org/licenses/BSD-3-Clause
  5382. */
  5383. /**
  5384. * This is a helper function for getting values from parameter/options
  5385. * objects.
  5386. *
  5387. * @param args The object we are extracting values from
  5388. * @param name The name of the property we are getting.
  5389. * @param defaultValue An optional value to return if the property is missing
  5390. * from the object. If this is not specified and the property is missing, an
  5391. * error will be thrown.
  5392. */
  5393. function getArg(aArgs, aName, aDefaultValue) {
  5394. if (aName in aArgs) {
  5395. return aArgs[aName];
  5396. } else if (arguments.length === 3) {
  5397. return aDefaultValue;
  5398. } else {
  5399. throw new Error('"' + aName + '" is a required argument.');
  5400. }
  5401. }
  5402. exports.getArg = getArg;
  5403. var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/;
  5404. var dataUrlRegexp = /^data:.+\,.+$/;
  5405. function urlParse(aUrl) {
  5406. var match = aUrl.match(urlRegexp);
  5407. if (!match) {
  5408. return null;
  5409. }
  5410. return {
  5411. scheme: match[1],
  5412. auth: match[2],
  5413. host: match[3],
  5414. port: match[4],
  5415. path: match[5]
  5416. };
  5417. }
  5418. exports.urlParse = urlParse;
  5419. function urlGenerate(aParsedUrl) {
  5420. var url = '';
  5421. if (aParsedUrl.scheme) {
  5422. url += aParsedUrl.scheme + ':';
  5423. }
  5424. url += '//';
  5425. if (aParsedUrl.auth) {
  5426. url += aParsedUrl.auth + '@';
  5427. }
  5428. if (aParsedUrl.host) {
  5429. url += aParsedUrl.host;
  5430. }
  5431. if (aParsedUrl.port) {
  5432. url += ":" + aParsedUrl.port;
  5433. }
  5434. if (aParsedUrl.path) {
  5435. url += aParsedUrl.path;
  5436. }
  5437. return url;
  5438. }
  5439. exports.urlGenerate = urlGenerate;
  5440. /**
  5441. * Normalizes a path, or the path portion of a URL:
  5442. *
  5443. * - Replaces consecutive slashes with one slash.
  5444. * - Removes unnecessary '.' parts.
  5445. * - Removes unnecessary '<dir>/..' parts.
  5446. *
  5447. * Based on code in the Node.js 'path' core module.
  5448. *
  5449. * @param aPath The path or url to normalize.
  5450. */
  5451. function normalize(aPath) {
  5452. var path = aPath;
  5453. var url = urlParse(aPath);
  5454. if (url) {
  5455. if (!url.path) {
  5456. return aPath;
  5457. }
  5458. path = url.path;
  5459. }
  5460. var isAbsolute = exports.isAbsolute(path);
  5461. var parts = path.split(/\/+/);
  5462. for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {
  5463. part = parts[i];
  5464. if (part === '.') {
  5465. parts.splice(i, 1);
  5466. } else if (part === '..') {
  5467. up++;
  5468. } else if (up > 0) {
  5469. if (part === '') {
  5470. // The first part is blank if the path is absolute. Trying to go
  5471. // above the root is a no-op. Therefore we can remove all '..' parts
  5472. // directly after the root.
  5473. parts.splice(i + 1, up);
  5474. up = 0;
  5475. } else {
  5476. parts.splice(i, 2);
  5477. up--;
  5478. }
  5479. }
  5480. }
  5481. path = parts.join('/');
  5482. if (path === '') {
  5483. path = isAbsolute ? '/' : '.';
  5484. }
  5485. if (url) {
  5486. url.path = path;
  5487. return urlGenerate(url);
  5488. }
  5489. return path;
  5490. }
  5491. exports.normalize = normalize;
  5492. /**
  5493. * Joins two paths/URLs.
  5494. *
  5495. * @param aRoot The root path or URL.
  5496. * @param aPath The path or URL to be joined with the root.
  5497. *
  5498. * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a
  5499. * scheme-relative URL: Then the scheme of aRoot, if any, is prepended
  5500. * first.
  5501. * - Otherwise aPath is a path. If aRoot is a URL, then its path portion
  5502. * is updated with the result and aRoot is returned. Otherwise the result
  5503. * is returned.
  5504. * - If aPath is absolute, the result is aPath.
  5505. * - Otherwise the two paths are joined with a slash.
  5506. * - Joining for example 'http://' and 'www.example.com' is also supported.
  5507. */
  5508. function join(aRoot, aPath) {
  5509. if (aRoot === "") {
  5510. aRoot = ".";
  5511. }
  5512. if (aPath === "") {
  5513. aPath = ".";
  5514. }
  5515. var aPathUrl = urlParse(aPath);
  5516. var aRootUrl = urlParse(aRoot);
  5517. if (aRootUrl) {
  5518. aRoot = aRootUrl.path || '/';
  5519. }
  5520. // `join(foo, '//www.example.org')`
  5521. if (aPathUrl && !aPathUrl.scheme) {
  5522. if (aRootUrl) {
  5523. aPathUrl.scheme = aRootUrl.scheme;
  5524. }
  5525. return urlGenerate(aPathUrl);
  5526. }
  5527. if (aPathUrl || aPath.match(dataUrlRegexp)) {
  5528. return aPath;
  5529. }
  5530. // `join('http://', 'www.example.com')`
  5531. if (aRootUrl && !aRootUrl.host && !aRootUrl.path) {
  5532. aRootUrl.host = aPath;
  5533. return urlGenerate(aRootUrl);
  5534. }
  5535. var joined = aPath.charAt(0) === '/'
  5536. ? aPath
  5537. : normalize(aRoot.replace(/\/+$/, '') + '/' + aPath);
  5538. if (aRootUrl) {
  5539. aRootUrl.path = joined;
  5540. return urlGenerate(aRootUrl);
  5541. }
  5542. return joined;
  5543. }
  5544. exports.join = join;
  5545. exports.isAbsolute = function (aPath) {
  5546. return aPath.charAt(0) === '/' || urlRegexp.test(aPath);
  5547. };
  5548. /**
  5549. * Make a path relative to a URL or another path.
  5550. *
  5551. * @param aRoot The root path or URL.
  5552. * @param aPath The path or URL to be made relative to aRoot.
  5553. */
  5554. function relative(aRoot, aPath) {
  5555. if (aRoot === "") {
  5556. aRoot = ".";
  5557. }
  5558. aRoot = aRoot.replace(/\/$/, '');
  5559. // It is possible for the path to be above the root. In this case, simply
  5560. // checking whether the root is a prefix of the path won't work. Instead, we
  5561. // need to remove components from the root one by one, until either we find
  5562. // a prefix that fits, or we run out of components to remove.
  5563. var level = 0;
  5564. while (aPath.indexOf(aRoot + '/') !== 0) {
  5565. var index = aRoot.lastIndexOf("/");
  5566. if (index < 0) {
  5567. return aPath;
  5568. }
  5569. // If the only part of the root that is left is the scheme (i.e. http://,
  5570. // file:///, etc.), one or more slashes (/), or simply nothing at all, we
  5571. // have exhausted all components, so the path is not relative to the root.
  5572. aRoot = aRoot.slice(0, index);
  5573. if (aRoot.match(/^([^\/]+:\/)?\/*$/)) {
  5574. return aPath;
  5575. }
  5576. ++level;
  5577. }
  5578. // Make sure we add a "../" for each component we removed from the root.
  5579. return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1);
  5580. }
  5581. exports.relative = relative;
  5582. var supportsNullProto = (function () {
  5583. var obj = Object.create(null);
  5584. return !('__proto__' in obj);
  5585. }());
  5586. function identity (s) {
  5587. return s;
  5588. }
  5589. /**
  5590. * Because behavior goes wacky when you set `__proto__` on objects, we
  5591. * have to prefix all the strings in our set with an arbitrary character.
  5592. *
  5593. * See https://github.com/mozilla/source-map/pull/31 and
  5594. * https://github.com/mozilla/source-map/issues/30
  5595. *
  5596. * @param String aStr
  5597. */
  5598. function toSetString(aStr) {
  5599. if (isProtoString(aStr)) {
  5600. return '$' + aStr;
  5601. }
  5602. return aStr;
  5603. }
  5604. exports.toSetString = supportsNullProto ? identity : toSetString;
  5605. function fromSetString(aStr) {
  5606. if (isProtoString(aStr)) {
  5607. return aStr.slice(1);
  5608. }
  5609. return aStr;
  5610. }
  5611. exports.fromSetString = supportsNullProto ? identity : fromSetString;
  5612. function isProtoString(s) {
  5613. if (!s) {
  5614. return false;
  5615. }
  5616. var length = s.length;
  5617. if (length < 9 /* "__proto__".length */) {
  5618. return false;
  5619. }
  5620. if (s.charCodeAt(length - 1) !== 95 /* '_' */ ||
  5621. s.charCodeAt(length - 2) !== 95 /* '_' */ ||
  5622. s.charCodeAt(length - 3) !== 111 /* 'o' */ ||
  5623. s.charCodeAt(length - 4) !== 116 /* 't' */ ||
  5624. s.charCodeAt(length - 5) !== 111 /* 'o' */ ||
  5625. s.charCodeAt(length - 6) !== 114 /* 'r' */ ||
  5626. s.charCodeAt(length - 7) !== 112 /* 'p' */ ||
  5627. s.charCodeAt(length - 8) !== 95 /* '_' */ ||
  5628. s.charCodeAt(length - 9) !== 95 /* '_' */) {
  5629. return false;
  5630. }
  5631. for (var i = length - 10; i >= 0; i--) {
  5632. if (s.charCodeAt(i) !== 36 /* '$' */) {
  5633. return false;
  5634. }
  5635. }
  5636. return true;
  5637. }
  5638. /**
  5639. * Comparator between two mappings where the original positions are compared.
  5640. *
  5641. * Optionally pass in `true` as `onlyCompareGenerated` to consider two
  5642. * mappings with the same original source/line/column, but different generated
  5643. * line and column the same. Useful when searching for a mapping with a
  5644. * stubbed out mapping.
  5645. */
  5646. function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) {
  5647. var cmp = strcmp(mappingA.source, mappingB.source);
  5648. if (cmp !== 0) {
  5649. return cmp;
  5650. }
  5651. cmp = mappingA.originalLine - mappingB.originalLine;
  5652. if (cmp !== 0) {
  5653. return cmp;
  5654. }
  5655. cmp = mappingA.originalColumn - mappingB.originalColumn;
  5656. if (cmp !== 0 || onlyCompareOriginal) {
  5657. return cmp;
  5658. }
  5659. cmp = mappingA.generatedColumn - mappingB.generatedColumn;
  5660. if (cmp !== 0) {
  5661. return cmp;
  5662. }
  5663. cmp = mappingA.generatedLine - mappingB.generatedLine;
  5664. if (cmp !== 0) {
  5665. return cmp;
  5666. }
  5667. return strcmp(mappingA.name, mappingB.name);
  5668. }
  5669. exports.compareByOriginalPositions = compareByOriginalPositions;
  5670. /**
  5671. * Comparator between two mappings with deflated source and name indices where
  5672. * the generated positions are compared.
  5673. *
  5674. * Optionally pass in `true` as `onlyCompareGenerated` to consider two
  5675. * mappings with the same generated line and column, but different
  5676. * source/name/original line and column the same. Useful when searching for a
  5677. * mapping with a stubbed out mapping.
  5678. */
  5679. function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) {
  5680. var cmp = mappingA.generatedLine - mappingB.generatedLine;
  5681. if (cmp !== 0) {
  5682. return cmp;
  5683. }
  5684. cmp = mappingA.generatedColumn - mappingB.generatedColumn;
  5685. if (cmp !== 0 || onlyCompareGenerated) {
  5686. return cmp;
  5687. }
  5688. cmp = strcmp(mappingA.source, mappingB.source);
  5689. if (cmp !== 0) {
  5690. return cmp;
  5691. }
  5692. cmp = mappingA.originalLine - mappingB.originalLine;
  5693. if (cmp !== 0) {
  5694. return cmp;
  5695. }
  5696. cmp = mappingA.originalColumn - mappingB.originalColumn;
  5697. if (cmp !== 0) {
  5698. return cmp;
  5699. }
  5700. return strcmp(mappingA.name, mappingB.name);
  5701. }
  5702. exports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated;
  5703. function strcmp(aStr1, aStr2) {
  5704. if (aStr1 === aStr2) {
  5705. return 0;
  5706. }
  5707. if (aStr1 === null) {
  5708. return 1; // aStr2 !== null
  5709. }
  5710. if (aStr2 === null) {
  5711. return -1; // aStr1 !== null
  5712. }
  5713. if (aStr1 > aStr2) {
  5714. return 1;
  5715. }
  5716. return -1;
  5717. }
  5718. /**
  5719. * Comparator between two mappings with inflated source and name strings where
  5720. * the generated positions are compared.
  5721. */
  5722. function compareByGeneratedPositionsInflated(mappingA, mappingB) {
  5723. var cmp = mappingA.generatedLine - mappingB.generatedLine;
  5724. if (cmp !== 0) {
  5725. return cmp;
  5726. }
  5727. cmp = mappingA.generatedColumn - mappingB.generatedColumn;
  5728. if (cmp !== 0) {
  5729. return cmp;
  5730. }
  5731. cmp = strcmp(mappingA.source, mappingB.source);
  5732. if (cmp !== 0) {
  5733. return cmp;
  5734. }
  5735. cmp = mappingA.originalLine - mappingB.originalLine;
  5736. if (cmp !== 0) {
  5737. return cmp;
  5738. }
  5739. cmp = mappingA.originalColumn - mappingB.originalColumn;
  5740. if (cmp !== 0) {
  5741. return cmp;
  5742. }
  5743. return strcmp(mappingA.name, mappingB.name);
  5744. }
  5745. exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated;
  5746. /**
  5747. * Strip any JSON XSSI avoidance prefix from the string (as documented
  5748. * in the source maps specification), and then parse the string as
  5749. * JSON.
  5750. */
  5751. function parseSourceMapInput(str) {
  5752. return JSON.parse(str.replace(/^\)]}'[^\n]*\n/, ''));
  5753. }
  5754. exports.parseSourceMapInput = parseSourceMapInput;
  5755. /**
  5756. * Compute the URL of a source given the the source root, the source's
  5757. * URL, and the source map's URL.
  5758. */
  5759. function computeSourceURL(sourceRoot, sourceURL, sourceMapURL) {
  5760. sourceURL = sourceURL || '';
  5761. if (sourceRoot) {
  5762. // This follows what Chrome does.
  5763. if (sourceRoot[sourceRoot.length - 1] !== '/' && sourceURL[0] !== '/') {
  5764. sourceRoot += '/';
  5765. }
  5766. // The spec says:
  5767. // Line 4: An optional source root, useful for relocating source
  5768. // files on a server or removing repeated values in the
  5769. // “sources” entry. This value is prepended to the individual
  5770. // entries in the “source” field.
  5771. sourceURL = sourceRoot + sourceURL;
  5772. }
  5773. // Historically, SourceMapConsumer did not take the sourceMapURL as
  5774. // a parameter. This mode is still somewhat supported, which is why
  5775. // this code block is conditional. However, it's preferable to pass
  5776. // the source map URL to SourceMapConsumer, so that this function
  5777. // can implement the source URL resolution algorithm as outlined in
  5778. // the spec. This block is basically the equivalent of:
  5779. // new URL(sourceURL, sourceMapURL).toString()
  5780. // ... except it avoids using URL, which wasn't available in the
  5781. // older releases of node still supported by this library.
  5782. //
  5783. // The spec says:
  5784. // If the sources are not absolute URLs after prepending of the
  5785. // “sourceRoot”, the sources are resolved relative to the
  5786. // SourceMap (like resolving script src in a html document).
  5787. if (sourceMapURL) {
  5788. var parsed = urlParse(sourceMapURL);
  5789. if (!parsed) {
  5790. throw new Error("sourceMapURL could not be parsed");
  5791. }
  5792. if (parsed.path) {
  5793. // Strip the last path component, but keep the "/".
  5794. var index = parsed.path.lastIndexOf('/');
  5795. if (index >= 0) {
  5796. parsed.path = parsed.path.substring(0, index + 1);
  5797. }
  5798. }
  5799. sourceURL = join(urlGenerate(parsed), sourceURL);
  5800. }
  5801. return normalize(sourceURL);
  5802. }
  5803. exports.computeSourceURL = computeSourceURL;
  5804. });
  5805. /* -*- Mode: js; js-indent-level: 2; -*- */
  5806. /*
  5807. * Copyright 2011 Mozilla Foundation and contributors
  5808. * Licensed under the New BSD license. See LICENSE or:
  5809. * http://opensource.org/licenses/BSD-3-Clause
  5810. */
  5811. var has$1 = Object.prototype.hasOwnProperty;
  5812. var hasNativeMap = typeof Map !== "undefined";
  5813. /**
  5814. * A data structure which is a combination of an array and a set. Adding a new
  5815. * member is O(1), testing for membership is O(1), and finding the index of an
  5816. * element is O(1). Removing elements from the set is not supported. Only
  5817. * strings are supported for membership.
  5818. */
  5819. function ArraySet$2() {
  5820. this._array = [];
  5821. this._set = hasNativeMap ? new Map() : Object.create(null);
  5822. }
  5823. /**
  5824. * Static method for creating ArraySet instances from an existing array.
  5825. */
  5826. ArraySet$2.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) {
  5827. var set = new ArraySet$2();
  5828. for (var i = 0, len = aArray.length; i < len; i++) {
  5829. set.add(aArray[i], aAllowDuplicates);
  5830. }
  5831. return set;
  5832. };
  5833. /**
  5834. * Return how many unique items are in this ArraySet. If duplicates have been
  5835. * added, than those do not count towards the size.
  5836. *
  5837. * @returns Number
  5838. */
  5839. ArraySet$2.prototype.size = function ArraySet_size() {
  5840. return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length;
  5841. };
  5842. /**
  5843. * Add the given string to this set.
  5844. *
  5845. * @param String aStr
  5846. */
  5847. ArraySet$2.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) {
  5848. var sStr = hasNativeMap ? aStr : util$1.toSetString(aStr);
  5849. var isDuplicate = hasNativeMap ? this.has(aStr) : has$1.call(this._set, sStr);
  5850. var idx = this._array.length;
  5851. if (!isDuplicate || aAllowDuplicates) {
  5852. this._array.push(aStr);
  5853. }
  5854. if (!isDuplicate) {
  5855. if (hasNativeMap) {
  5856. this._set.set(aStr, idx);
  5857. } else {
  5858. this._set[sStr] = idx;
  5859. }
  5860. }
  5861. };
  5862. /**
  5863. * Is the given string a member of this set?
  5864. *
  5865. * @param String aStr
  5866. */
  5867. ArraySet$2.prototype.has = function ArraySet_has(aStr) {
  5868. if (hasNativeMap) {
  5869. return this._set.has(aStr);
  5870. } else {
  5871. var sStr = util$1.toSetString(aStr);
  5872. return has$1.call(this._set, sStr);
  5873. }
  5874. };
  5875. /**
  5876. * What is the index of the given string in the array?
  5877. *
  5878. * @param String aStr
  5879. */
  5880. ArraySet$2.prototype.indexOf = function ArraySet_indexOf(aStr) {
  5881. if (hasNativeMap) {
  5882. var idx = this._set.get(aStr);
  5883. if (idx >= 0) {
  5884. return idx;
  5885. }
  5886. } else {
  5887. var sStr = util$1.toSetString(aStr);
  5888. if (has$1.call(this._set, sStr)) {
  5889. return this._set[sStr];
  5890. }
  5891. }
  5892. throw new Error('"' + aStr + '" is not in the set.');
  5893. };
  5894. /**
  5895. * What is the element at the given index?
  5896. *
  5897. * @param Number aIdx
  5898. */
  5899. ArraySet$2.prototype.at = function ArraySet_at(aIdx) {
  5900. if (aIdx >= 0 && aIdx < this._array.length) {
  5901. return this._array[aIdx];
  5902. }
  5903. throw new Error('No element indexed by ' + aIdx);
  5904. };
  5905. /**
  5906. * Returns the array representation of this set (which has the proper indices
  5907. * indicated by indexOf). Note that this is a copy of the internal array used
  5908. * for storing the members so that no one can mess with internal state.
  5909. */
  5910. ArraySet$2.prototype.toArray = function ArraySet_toArray() {
  5911. return this._array.slice();
  5912. };
  5913. var ArraySet_1 = ArraySet$2;
  5914. var arraySet = {
  5915. ArraySet: ArraySet_1
  5916. };
  5917. /* -*- Mode: js; js-indent-level: 2; -*- */
  5918. /*
  5919. * Copyright 2014 Mozilla Foundation and contributors
  5920. * Licensed under the New BSD license. See LICENSE or:
  5921. * http://opensource.org/licenses/BSD-3-Clause
  5922. */
  5923. /**
  5924. * Determine whether mappingB is after mappingA with respect to generated
  5925. * position.
  5926. */
  5927. function generatedPositionAfter(mappingA, mappingB) {
  5928. // Optimized for most common case
  5929. var lineA = mappingA.generatedLine;
  5930. var lineB = mappingB.generatedLine;
  5931. var columnA = mappingA.generatedColumn;
  5932. var columnB = mappingB.generatedColumn;
  5933. return lineB > lineA || lineB == lineA && columnB >= columnA ||
  5934. util$1.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0;
  5935. }
  5936. /**
  5937. * A data structure to provide a sorted view of accumulated mappings in a
  5938. * performance conscious manner. It trades a neglibable overhead in general
  5939. * case for a large speedup in case of mappings being added in order.
  5940. */
  5941. function MappingList$1() {
  5942. this._array = [];
  5943. this._sorted = true;
  5944. // Serves as infimum
  5945. this._last = {generatedLine: -1, generatedColumn: 0};
  5946. }
  5947. /**
  5948. * Iterate through internal items. This method takes the same arguments that
  5949. * `Array.prototype.forEach` takes.
  5950. *
  5951. * NOTE: The order of the mappings is NOT guaranteed.
  5952. */
  5953. MappingList$1.prototype.unsortedForEach =
  5954. function MappingList_forEach(aCallback, aThisArg) {
  5955. this._array.forEach(aCallback, aThisArg);
  5956. };
  5957. /**
  5958. * Add the given source mapping.
  5959. *
  5960. * @param Object aMapping
  5961. */
  5962. MappingList$1.prototype.add = function MappingList_add(aMapping) {
  5963. if (generatedPositionAfter(this._last, aMapping)) {
  5964. this._last = aMapping;
  5965. this._array.push(aMapping);
  5966. } else {
  5967. this._sorted = false;
  5968. this._array.push(aMapping);
  5969. }
  5970. };
  5971. /**
  5972. * Returns the flat, sorted array of mappings. The mappings are sorted by
  5973. * generated position.
  5974. *
  5975. * WARNING: This method returns internal data without copying, for
  5976. * performance. The return value must NOT be mutated, and should be treated as
  5977. * an immutable borrow. If you want to take ownership, you must make your own
  5978. * copy.
  5979. */
  5980. MappingList$1.prototype.toArray = function MappingList_toArray() {
  5981. if (!this._sorted) {
  5982. this._array.sort(util$1.compareByGeneratedPositionsInflated);
  5983. this._sorted = true;
  5984. }
  5985. return this._array;
  5986. };
  5987. var MappingList_1 = MappingList$1;
  5988. var mappingList = {
  5989. MappingList: MappingList_1
  5990. };
  5991. /* -*- Mode: js; js-indent-level: 2; -*- */
  5992. /*
  5993. * Copyright 2011 Mozilla Foundation and contributors
  5994. * Licensed under the New BSD license. See LICENSE or:
  5995. * http://opensource.org/licenses/BSD-3-Clause
  5996. */
  5997. var ArraySet$1 = arraySet.ArraySet;
  5998. var MappingList = mappingList.MappingList;
  5999. /**
  6000. * An instance of the SourceMapGenerator represents a source map which is
  6001. * being built incrementally. You may pass an object with the following
  6002. * properties:
  6003. *
  6004. * - file: The filename of the generated source.
  6005. * - sourceRoot: A root for all relative URLs in this source map.
  6006. */
  6007. function SourceMapGenerator$3(aArgs) {
  6008. if (!aArgs) {
  6009. aArgs = {};
  6010. }
  6011. this._file = util$1.getArg(aArgs, 'file', null);
  6012. this._sourceRoot = util$1.getArg(aArgs, 'sourceRoot', null);
  6013. this._skipValidation = util$1.getArg(aArgs, 'skipValidation', false);
  6014. this._sources = new ArraySet$1();
  6015. this._names = new ArraySet$1();
  6016. this._mappings = new MappingList();
  6017. this._sourcesContents = null;
  6018. }
  6019. SourceMapGenerator$3.prototype._version = 3;
  6020. /**
  6021. * Creates a new SourceMapGenerator based on a SourceMapConsumer
  6022. *
  6023. * @param aSourceMapConsumer The SourceMap.
  6024. */
  6025. SourceMapGenerator$3.fromSourceMap =
  6026. function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) {
  6027. var sourceRoot = aSourceMapConsumer.sourceRoot;
  6028. var generator = new SourceMapGenerator$3({
  6029. file: aSourceMapConsumer.file,
  6030. sourceRoot: sourceRoot
  6031. });
  6032. aSourceMapConsumer.eachMapping(function (mapping) {
  6033. var newMapping = {
  6034. generated: {
  6035. line: mapping.generatedLine,
  6036. column: mapping.generatedColumn
  6037. }
  6038. };
  6039. if (mapping.source != null) {
  6040. newMapping.source = mapping.source;
  6041. if (sourceRoot != null) {
  6042. newMapping.source = util$1.relative(sourceRoot, newMapping.source);
  6043. }
  6044. newMapping.original = {
  6045. line: mapping.originalLine,
  6046. column: mapping.originalColumn
  6047. };
  6048. if (mapping.name != null) {
  6049. newMapping.name = mapping.name;
  6050. }
  6051. }
  6052. generator.addMapping(newMapping);
  6053. });
  6054. aSourceMapConsumer.sources.forEach(function (sourceFile) {
  6055. var sourceRelative = sourceFile;
  6056. if (sourceRoot !== null) {
  6057. sourceRelative = util$1.relative(sourceRoot, sourceFile);
  6058. }
  6059. if (!generator._sources.has(sourceRelative)) {
  6060. generator._sources.add(sourceRelative);
  6061. }
  6062. var content = aSourceMapConsumer.sourceContentFor(sourceFile);
  6063. if (content != null) {
  6064. generator.setSourceContent(sourceFile, content);
  6065. }
  6066. });
  6067. return generator;
  6068. };
  6069. /**
  6070. * Add a single mapping from original source line and column to the generated
  6071. * source's line and column for this source map being created. The mapping
  6072. * object should have the following properties:
  6073. *
  6074. * - generated: An object with the generated line and column positions.
  6075. * - original: An object with the original line and column positions.
  6076. * - source: The original source file (relative to the sourceRoot).
  6077. * - name: An optional original token name for this mapping.
  6078. */
  6079. SourceMapGenerator$3.prototype.addMapping =
  6080. function SourceMapGenerator_addMapping(aArgs) {
  6081. var generated = util$1.getArg(aArgs, 'generated');
  6082. var original = util$1.getArg(aArgs, 'original', null);
  6083. var source = util$1.getArg(aArgs, 'source', null);
  6084. var name = util$1.getArg(aArgs, 'name', null);
  6085. if (!this._skipValidation) {
  6086. this._validateMapping(generated, original, source, name);
  6087. }
  6088. if (source != null) {
  6089. source = String(source);
  6090. if (!this._sources.has(source)) {
  6091. this._sources.add(source);
  6092. }
  6093. }
  6094. if (name != null) {
  6095. name = String(name);
  6096. if (!this._names.has(name)) {
  6097. this._names.add(name);
  6098. }
  6099. }
  6100. this._mappings.add({
  6101. generatedLine: generated.line,
  6102. generatedColumn: generated.column,
  6103. originalLine: original != null && original.line,
  6104. originalColumn: original != null && original.column,
  6105. source: source,
  6106. name: name
  6107. });
  6108. };
  6109. /**
  6110. * Set the source content for a source file.
  6111. */
  6112. SourceMapGenerator$3.prototype.setSourceContent =
  6113. function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) {
  6114. var source = aSourceFile;
  6115. if (this._sourceRoot != null) {
  6116. source = util$1.relative(this._sourceRoot, source);
  6117. }
  6118. if (aSourceContent != null) {
  6119. // Add the source content to the _sourcesContents map.
  6120. // Create a new _sourcesContents map if the property is null.
  6121. if (!this._sourcesContents) {
  6122. this._sourcesContents = Object.create(null);
  6123. }
  6124. this._sourcesContents[util$1.toSetString(source)] = aSourceContent;
  6125. } else if (this._sourcesContents) {
  6126. // Remove the source file from the _sourcesContents map.
  6127. // If the _sourcesContents map is empty, set the property to null.
  6128. delete this._sourcesContents[util$1.toSetString(source)];
  6129. if (Object.keys(this._sourcesContents).length === 0) {
  6130. this._sourcesContents = null;
  6131. }
  6132. }
  6133. };
  6134. /**
  6135. * Applies the mappings of a sub-source-map for a specific source file to the
  6136. * source map being generated. Each mapping to the supplied source file is
  6137. * rewritten using the supplied source map. Note: The resolution for the
  6138. * resulting mappings is the minimium of this map and the supplied map.
  6139. *
  6140. * @param aSourceMapConsumer The source map to be applied.
  6141. * @param aSourceFile Optional. The filename of the source file.
  6142. * If omitted, SourceMapConsumer's file property will be used.
  6143. * @param aSourceMapPath Optional. The dirname of the path to the source map
  6144. * to be applied. If relative, it is relative to the SourceMapConsumer.
  6145. * This parameter is needed when the two source maps aren't in the same
  6146. * directory, and the source map to be applied contains relative source
  6147. * paths. If so, those relative source paths need to be rewritten
  6148. * relative to the SourceMapGenerator.
  6149. */
  6150. SourceMapGenerator$3.prototype.applySourceMap =
  6151. function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) {
  6152. var sourceFile = aSourceFile;
  6153. // If aSourceFile is omitted, we will use the file property of the SourceMap
  6154. if (aSourceFile == null) {
  6155. if (aSourceMapConsumer.file == null) {
  6156. throw new Error(
  6157. 'SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, ' +
  6158. 'or the source map\'s "file" property. Both were omitted.'
  6159. );
  6160. }
  6161. sourceFile = aSourceMapConsumer.file;
  6162. }
  6163. var sourceRoot = this._sourceRoot;
  6164. // Make "sourceFile" relative if an absolute Url is passed.
  6165. if (sourceRoot != null) {
  6166. sourceFile = util$1.relative(sourceRoot, sourceFile);
  6167. }
  6168. // Applying the SourceMap can add and remove items from the sources and
  6169. // the names array.
  6170. var newSources = new ArraySet$1();
  6171. var newNames = new ArraySet$1();
  6172. // Find mappings for the "sourceFile"
  6173. this._mappings.unsortedForEach(function (mapping) {
  6174. if (mapping.source === sourceFile && mapping.originalLine != null) {
  6175. // Check if it can be mapped by the source map, then update the mapping.
  6176. var original = aSourceMapConsumer.originalPositionFor({
  6177. line: mapping.originalLine,
  6178. column: mapping.originalColumn
  6179. });
  6180. if (original.source != null) {
  6181. // Copy mapping
  6182. mapping.source = original.source;
  6183. if (aSourceMapPath != null) {
  6184. mapping.source = util$1.join(aSourceMapPath, mapping.source);
  6185. }
  6186. if (sourceRoot != null) {
  6187. mapping.source = util$1.relative(sourceRoot, mapping.source);
  6188. }
  6189. mapping.originalLine = original.line;
  6190. mapping.originalColumn = original.column;
  6191. if (original.name != null) {
  6192. mapping.name = original.name;
  6193. }
  6194. }
  6195. }
  6196. var source = mapping.source;
  6197. if (source != null && !newSources.has(source)) {
  6198. newSources.add(source);
  6199. }
  6200. var name = mapping.name;
  6201. if (name != null && !newNames.has(name)) {
  6202. newNames.add(name);
  6203. }
  6204. }, this);
  6205. this._sources = newSources;
  6206. this._names = newNames;
  6207. // Copy sourcesContents of applied map.
  6208. aSourceMapConsumer.sources.forEach(function (sourceFile) {
  6209. var content = aSourceMapConsumer.sourceContentFor(sourceFile);
  6210. if (content != null) {
  6211. if (aSourceMapPath != null) {
  6212. sourceFile = util$1.join(aSourceMapPath, sourceFile);
  6213. }
  6214. if (sourceRoot != null) {
  6215. sourceFile = util$1.relative(sourceRoot, sourceFile);
  6216. }
  6217. this.setSourceContent(sourceFile, content);
  6218. }
  6219. }, this);
  6220. };
  6221. /**
  6222. * A mapping can have one of the three levels of data:
  6223. *
  6224. * 1. Just the generated position.
  6225. * 2. The Generated position, original position, and original source.
  6226. * 3. Generated and original position, original source, as well as a name
  6227. * token.
  6228. *
  6229. * To maintain consistency, we validate that any new mapping being added falls
  6230. * in to one of these categories.
  6231. */
  6232. SourceMapGenerator$3.prototype._validateMapping =
  6233. function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource,
  6234. aName) {
  6235. // When aOriginal is truthy but has empty values for .line and .column,
  6236. // it is most likely a programmer error. In this case we throw a very
  6237. // specific error message to try to guide them the right way.
  6238. // For example: https://github.com/Polymer/polymer-bundler/pull/519
  6239. if (aOriginal && typeof aOriginal.line !== 'number' && typeof aOriginal.column !== 'number') {
  6240. throw new Error(
  6241. 'original.line and original.column are not numbers -- you probably meant to omit ' +
  6242. 'the original mapping entirely and only map the generated position. If so, pass ' +
  6243. 'null for the original mapping instead of an object with empty or null values.'
  6244. );
  6245. }
  6246. if (aGenerated && 'line' in aGenerated && 'column' in aGenerated
  6247. && aGenerated.line > 0 && aGenerated.column >= 0
  6248. && !aOriginal && !aSource && !aName) {
  6249. // Case 1.
  6250. return;
  6251. }
  6252. else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated
  6253. && aOriginal && 'line' in aOriginal && 'column' in aOriginal
  6254. && aGenerated.line > 0 && aGenerated.column >= 0
  6255. && aOriginal.line > 0 && aOriginal.column >= 0
  6256. && aSource) {
  6257. // Cases 2 and 3.
  6258. return;
  6259. }
  6260. else {
  6261. throw new Error('Invalid mapping: ' + JSON.stringify({
  6262. generated: aGenerated,
  6263. source: aSource,
  6264. original: aOriginal,
  6265. name: aName
  6266. }));
  6267. }
  6268. };
  6269. /**
  6270. * Serialize the accumulated mappings in to the stream of base 64 VLQs
  6271. * specified by the source map format.
  6272. */
  6273. SourceMapGenerator$3.prototype._serializeMappings =
  6274. function SourceMapGenerator_serializeMappings() {
  6275. var previousGeneratedColumn = 0;
  6276. var previousGeneratedLine = 1;
  6277. var previousOriginalColumn = 0;
  6278. var previousOriginalLine = 0;
  6279. var previousName = 0;
  6280. var previousSource = 0;
  6281. var result = '';
  6282. var next;
  6283. var mapping;
  6284. var nameIdx;
  6285. var sourceIdx;
  6286. var mappings = this._mappings.toArray();
  6287. for (var i = 0, len = mappings.length; i < len; i++) {
  6288. mapping = mappings[i];
  6289. next = '';
  6290. if (mapping.generatedLine !== previousGeneratedLine) {
  6291. previousGeneratedColumn = 0;
  6292. while (mapping.generatedLine !== previousGeneratedLine) {
  6293. next += ';';
  6294. previousGeneratedLine++;
  6295. }
  6296. }
  6297. else {
  6298. if (i > 0) {
  6299. if (!util$1.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) {
  6300. continue;
  6301. }
  6302. next += ',';
  6303. }
  6304. }
  6305. next += base64Vlq.encode(mapping.generatedColumn
  6306. - previousGeneratedColumn);
  6307. previousGeneratedColumn = mapping.generatedColumn;
  6308. if (mapping.source != null) {
  6309. sourceIdx = this._sources.indexOf(mapping.source);
  6310. next += base64Vlq.encode(sourceIdx - previousSource);
  6311. previousSource = sourceIdx;
  6312. // lines are stored 0-based in SourceMap spec version 3
  6313. next += base64Vlq.encode(mapping.originalLine - 1
  6314. - previousOriginalLine);
  6315. previousOriginalLine = mapping.originalLine - 1;
  6316. next += base64Vlq.encode(mapping.originalColumn
  6317. - previousOriginalColumn);
  6318. previousOriginalColumn = mapping.originalColumn;
  6319. if (mapping.name != null) {
  6320. nameIdx = this._names.indexOf(mapping.name);
  6321. next += base64Vlq.encode(nameIdx - previousName);
  6322. previousName = nameIdx;
  6323. }
  6324. }
  6325. result += next;
  6326. }
  6327. return result;
  6328. };
  6329. SourceMapGenerator$3.prototype._generateSourcesContent =
  6330. function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) {
  6331. return aSources.map(function (source) {
  6332. if (!this._sourcesContents) {
  6333. return null;
  6334. }
  6335. if (aSourceRoot != null) {
  6336. source = util$1.relative(aSourceRoot, source);
  6337. }
  6338. var key = util$1.toSetString(source);
  6339. return Object.prototype.hasOwnProperty.call(this._sourcesContents, key)
  6340. ? this._sourcesContents[key]
  6341. : null;
  6342. }, this);
  6343. };
  6344. /**
  6345. * Externalize the source map.
  6346. */
  6347. SourceMapGenerator$3.prototype.toJSON =
  6348. function SourceMapGenerator_toJSON() {
  6349. var map = {
  6350. version: this._version,
  6351. sources: this._sources.toArray(),
  6352. names: this._names.toArray(),
  6353. mappings: this._serializeMappings()
  6354. };
  6355. if (this._file != null) {
  6356. map.file = this._file;
  6357. }
  6358. if (this._sourceRoot != null) {
  6359. map.sourceRoot = this._sourceRoot;
  6360. }
  6361. if (this._sourcesContents) {
  6362. map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot);
  6363. }
  6364. return map;
  6365. };
  6366. /**
  6367. * Render the source map being generated to a string.
  6368. */
  6369. SourceMapGenerator$3.prototype.toString =
  6370. function SourceMapGenerator_toString() {
  6371. return JSON.stringify(this.toJSON());
  6372. };
  6373. var SourceMapGenerator_1 = SourceMapGenerator$3;
  6374. var sourceMapGenerator = {
  6375. SourceMapGenerator: SourceMapGenerator_1
  6376. };
  6377. var binarySearch = createCommonjsModule$1(function (module, exports) {
  6378. /* -*- Mode: js; js-indent-level: 2; -*- */
  6379. /*
  6380. * Copyright 2011 Mozilla Foundation and contributors
  6381. * Licensed under the New BSD license. See LICENSE or:
  6382. * http://opensource.org/licenses/BSD-3-Clause
  6383. */
  6384. exports.GREATEST_LOWER_BOUND = 1;
  6385. exports.LEAST_UPPER_BOUND = 2;
  6386. /**
  6387. * Recursive implementation of binary search.
  6388. *
  6389. * @param aLow Indices here and lower do not contain the needle.
  6390. * @param aHigh Indices here and higher do not contain the needle.
  6391. * @param aNeedle The element being searched for.
  6392. * @param aHaystack The non-empty array being searched.
  6393. * @param aCompare Function which takes two elements and returns -1, 0, or 1.
  6394. * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or
  6395. * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the
  6396. * closest element that is smaller than or greater than the one we are
  6397. * searching for, respectively, if the exact element cannot be found.
  6398. */
  6399. function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) {
  6400. // This function terminates when one of the following is true:
  6401. //
  6402. // 1. We find the exact element we are looking for.
  6403. //
  6404. // 2. We did not find the exact element, but we can return the index of
  6405. // the next-closest element.
  6406. //
  6407. // 3. We did not find the exact element, and there is no next-closest
  6408. // element than the one we are searching for, so we return -1.
  6409. var mid = Math.floor((aHigh - aLow) / 2) + aLow;
  6410. var cmp = aCompare(aNeedle, aHaystack[mid], true);
  6411. if (cmp === 0) {
  6412. // Found the element we are looking for.
  6413. return mid;
  6414. }
  6415. else if (cmp > 0) {
  6416. // Our needle is greater than aHaystack[mid].
  6417. if (aHigh - mid > 1) {
  6418. // The element is in the upper half.
  6419. return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias);
  6420. }
  6421. // The exact needle element was not found in this haystack. Determine if
  6422. // we are in termination case (3) or (2) and return the appropriate thing.
  6423. if (aBias == exports.LEAST_UPPER_BOUND) {
  6424. return aHigh < aHaystack.length ? aHigh : -1;
  6425. } else {
  6426. return mid;
  6427. }
  6428. }
  6429. else {
  6430. // Our needle is less than aHaystack[mid].
  6431. if (mid - aLow > 1) {
  6432. // The element is in the lower half.
  6433. return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias);
  6434. }
  6435. // we are in termination case (3) or (2) and return the appropriate thing.
  6436. if (aBias == exports.LEAST_UPPER_BOUND) {
  6437. return mid;
  6438. } else {
  6439. return aLow < 0 ? -1 : aLow;
  6440. }
  6441. }
  6442. }
  6443. /**
  6444. * This is an implementation of binary search which will always try and return
  6445. * the index of the closest element if there is no exact hit. This is because
  6446. * mappings between original and generated line/col pairs are single points,
  6447. * and there is an implicit region between each of them, so a miss just means
  6448. * that you aren't on the very start of a region.
  6449. *
  6450. * @param aNeedle The element you are looking for.
  6451. * @param aHaystack The array that is being searched.
  6452. * @param aCompare A function which takes the needle and an element in the
  6453. * array and returns -1, 0, or 1 depending on whether the needle is less
  6454. * than, equal to, or greater than the element, respectively.
  6455. * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or
  6456. * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the
  6457. * closest element that is smaller than or greater than the one we are
  6458. * searching for, respectively, if the exact element cannot be found.
  6459. * Defaults to 'binarySearch.GREATEST_LOWER_BOUND'.
  6460. */
  6461. exports.search = function search(aNeedle, aHaystack, aCompare, aBias) {
  6462. if (aHaystack.length === 0) {
  6463. return -1;
  6464. }
  6465. var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack,
  6466. aCompare, aBias || exports.GREATEST_LOWER_BOUND);
  6467. if (index < 0) {
  6468. return -1;
  6469. }
  6470. // We have found either the exact element, or the next-closest element than
  6471. // the one we are searching for. However, there may be more than one such
  6472. // element. Make sure we always return the smallest of these.
  6473. while (index - 1 >= 0) {
  6474. if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) {
  6475. break;
  6476. }
  6477. --index;
  6478. }
  6479. return index;
  6480. };
  6481. });
  6482. /* -*- Mode: js; js-indent-level: 2; -*- */
  6483. /*
  6484. * Copyright 2011 Mozilla Foundation and contributors
  6485. * Licensed under the New BSD license. See LICENSE or:
  6486. * http://opensource.org/licenses/BSD-3-Clause
  6487. */
  6488. // It turns out that some (most?) JavaScript engines don't self-host
  6489. // `Array.prototype.sort`. This makes sense because C++ will likely remain
  6490. // faster than JS when doing raw CPU-intensive sorting. However, when using a
  6491. // custom comparator function, calling back and forth between the VM's C++ and
  6492. // JIT'd JS is rather slow *and* loses JIT type information, resulting in
  6493. // worse generated code for the comparator function than would be optimal. In
  6494. // fact, when sorting with a comparator, these costs outweigh the benefits of
  6495. // sorting in C++. By using our own JS-implemented Quick Sort (below), we get
  6496. // a ~3500ms mean speed-up in `bench/bench.html`.
  6497. /**
  6498. * Swap the elements indexed by `x` and `y` in the array `ary`.
  6499. *
  6500. * @param {Array} ary
  6501. * The array.
  6502. * @param {Number} x
  6503. * The index of the first item.
  6504. * @param {Number} y
  6505. * The index of the second item.
  6506. */
  6507. function swap(ary, x, y) {
  6508. var temp = ary[x];
  6509. ary[x] = ary[y];
  6510. ary[y] = temp;
  6511. }
  6512. /**
  6513. * Returns a random integer within the range `low .. high` inclusive.
  6514. *
  6515. * @param {Number} low
  6516. * The lower bound on the range.
  6517. * @param {Number} high
  6518. * The upper bound on the range.
  6519. */
  6520. function randomIntInRange(low, high) {
  6521. return Math.round(low + (Math.random() * (high - low)));
  6522. }
  6523. /**
  6524. * The Quick Sort algorithm.
  6525. *
  6526. * @param {Array} ary
  6527. * An array to sort.
  6528. * @param {function} comparator
  6529. * Function to use to compare two items.
  6530. * @param {Number} p
  6531. * Start index of the array
  6532. * @param {Number} r
  6533. * End index of the array
  6534. */
  6535. function doQuickSort(ary, comparator, p, r) {
  6536. // If our lower bound is less than our upper bound, we (1) partition the
  6537. // array into two pieces and (2) recurse on each half. If it is not, this is
  6538. // the empty array and our base case.
  6539. if (p < r) {
  6540. // (1) Partitioning.
  6541. //
  6542. // The partitioning chooses a pivot between `p` and `r` and moves all
  6543. // elements that are less than or equal to the pivot to the before it, and
  6544. // all the elements that are greater than it after it. The effect is that
  6545. // once partition is done, the pivot is in the exact place it will be when
  6546. // the array is put in sorted order, and it will not need to be moved
  6547. // again. This runs in O(n) time.
  6548. // Always choose a random pivot so that an input array which is reverse
  6549. // sorted does not cause O(n^2) running time.
  6550. var pivotIndex = randomIntInRange(p, r);
  6551. var i = p - 1;
  6552. swap(ary, pivotIndex, r);
  6553. var pivot = ary[r];
  6554. // Immediately after `j` is incremented in this loop, the following hold
  6555. // true:
  6556. //
  6557. // * Every element in `ary[p .. i]` is less than or equal to the pivot.
  6558. //
  6559. // * Every element in `ary[i+1 .. j-1]` is greater than the pivot.
  6560. for (var j = p; j < r; j++) {
  6561. if (comparator(ary[j], pivot) <= 0) {
  6562. i += 1;
  6563. swap(ary, i, j);
  6564. }
  6565. }
  6566. swap(ary, i + 1, j);
  6567. var q = i + 1;
  6568. // (2) Recurse on each half.
  6569. doQuickSort(ary, comparator, p, q - 1);
  6570. doQuickSort(ary, comparator, q + 1, r);
  6571. }
  6572. }
  6573. /**
  6574. * Sort the given array in-place with the given comparator function.
  6575. *
  6576. * @param {Array} ary
  6577. * An array to sort.
  6578. * @param {function} comparator
  6579. * Function to use to compare two items.
  6580. */
  6581. var quickSort_1 = function (ary, comparator) {
  6582. doQuickSort(ary, comparator, 0, ary.length - 1);
  6583. };
  6584. var quickSort$1 = {
  6585. quickSort: quickSort_1
  6586. };
  6587. /* -*- Mode: js; js-indent-level: 2; -*- */
  6588. /*
  6589. * Copyright 2011 Mozilla Foundation and contributors
  6590. * Licensed under the New BSD license. See LICENSE or:
  6591. * http://opensource.org/licenses/BSD-3-Clause
  6592. */
  6593. var ArraySet = arraySet.ArraySet;
  6594. var quickSort = quickSort$1.quickSort;
  6595. function SourceMapConsumer$2(aSourceMap, aSourceMapURL) {
  6596. var sourceMap = aSourceMap;
  6597. if (typeof aSourceMap === 'string') {
  6598. sourceMap = util$1.parseSourceMapInput(aSourceMap);
  6599. }
  6600. return sourceMap.sections != null
  6601. ? new IndexedSourceMapConsumer(sourceMap, aSourceMapURL)
  6602. : new BasicSourceMapConsumer(sourceMap, aSourceMapURL);
  6603. }
  6604. SourceMapConsumer$2.fromSourceMap = function(aSourceMap, aSourceMapURL) {
  6605. return BasicSourceMapConsumer.fromSourceMap(aSourceMap, aSourceMapURL);
  6606. };
  6607. /**
  6608. * The version of the source mapping spec that we are consuming.
  6609. */
  6610. SourceMapConsumer$2.prototype._version = 3;
  6611. // `__generatedMappings` and `__originalMappings` are arrays that hold the
  6612. // parsed mapping coordinates from the source map's "mappings" attribute. They
  6613. // are lazily instantiated, accessed via the `_generatedMappings` and
  6614. // `_originalMappings` getters respectively, and we only parse the mappings
  6615. // and create these arrays once queried for a source location. We jump through
  6616. // these hoops because there can be many thousands of mappings, and parsing
  6617. // them is expensive, so we only want to do it if we must.
  6618. //
  6619. // Each object in the arrays is of the form:
  6620. //
  6621. // {
  6622. // generatedLine: The line number in the generated code,
  6623. // generatedColumn: The column number in the generated code,
  6624. // source: The path to the original source file that generated this
  6625. // chunk of code,
  6626. // originalLine: The line number in the original source that
  6627. // corresponds to this chunk of generated code,
  6628. // originalColumn: The column number in the original source that
  6629. // corresponds to this chunk of generated code,
  6630. // name: The name of the original symbol which generated this chunk of
  6631. // code.
  6632. // }
  6633. //
  6634. // All properties except for `generatedLine` and `generatedColumn` can be
  6635. // `null`.
  6636. //
  6637. // `_generatedMappings` is ordered by the generated positions.
  6638. //
  6639. // `_originalMappings` is ordered by the original positions.
  6640. SourceMapConsumer$2.prototype.__generatedMappings = null;
  6641. Object.defineProperty(SourceMapConsumer$2.prototype, '_generatedMappings', {
  6642. configurable: true,
  6643. enumerable: true,
  6644. get: function () {
  6645. if (!this.__generatedMappings) {
  6646. this._parseMappings(this._mappings, this.sourceRoot);
  6647. }
  6648. return this.__generatedMappings;
  6649. }
  6650. });
  6651. SourceMapConsumer$2.prototype.__originalMappings = null;
  6652. Object.defineProperty(SourceMapConsumer$2.prototype, '_originalMappings', {
  6653. configurable: true,
  6654. enumerable: true,
  6655. get: function () {
  6656. if (!this.__originalMappings) {
  6657. this._parseMappings(this._mappings, this.sourceRoot);
  6658. }
  6659. return this.__originalMappings;
  6660. }
  6661. });
  6662. SourceMapConsumer$2.prototype._charIsMappingSeparator =
  6663. function SourceMapConsumer_charIsMappingSeparator(aStr, index) {
  6664. var c = aStr.charAt(index);
  6665. return c === ";" || c === ",";
  6666. };
  6667. /**
  6668. * Parse the mappings in a string in to a data structure which we can easily
  6669. * query (the ordered arrays in the `this.__generatedMappings` and
  6670. * `this.__originalMappings` properties).
  6671. */
  6672. SourceMapConsumer$2.prototype._parseMappings =
  6673. function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {
  6674. throw new Error("Subclasses must implement _parseMappings");
  6675. };
  6676. SourceMapConsumer$2.GENERATED_ORDER = 1;
  6677. SourceMapConsumer$2.ORIGINAL_ORDER = 2;
  6678. SourceMapConsumer$2.GREATEST_LOWER_BOUND = 1;
  6679. SourceMapConsumer$2.LEAST_UPPER_BOUND = 2;
  6680. /**
  6681. * Iterate over each mapping between an original source/line/column and a
  6682. * generated line/column in this source map.
  6683. *
  6684. * @param Function aCallback
  6685. * The function that is called with each mapping.
  6686. * @param Object aContext
  6687. * Optional. If specified, this object will be the value of `this` every
  6688. * time that `aCallback` is called.
  6689. * @param aOrder
  6690. * Either `SourceMapConsumer.GENERATED_ORDER` or
  6691. * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to
  6692. * iterate over the mappings sorted by the generated file's line/column
  6693. * order or the original's source/line/column order, respectively. Defaults to
  6694. * `SourceMapConsumer.GENERATED_ORDER`.
  6695. */
  6696. SourceMapConsumer$2.prototype.eachMapping =
  6697. function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) {
  6698. var context = aContext || null;
  6699. var order = aOrder || SourceMapConsumer$2.GENERATED_ORDER;
  6700. var mappings;
  6701. switch (order) {
  6702. case SourceMapConsumer$2.GENERATED_ORDER:
  6703. mappings = this._generatedMappings;
  6704. break;
  6705. case SourceMapConsumer$2.ORIGINAL_ORDER:
  6706. mappings = this._originalMappings;
  6707. break;
  6708. default:
  6709. throw new Error("Unknown order of iteration.");
  6710. }
  6711. var sourceRoot = this.sourceRoot;
  6712. mappings.map(function (mapping) {
  6713. var source = mapping.source === null ? null : this._sources.at(mapping.source);
  6714. source = util$1.computeSourceURL(sourceRoot, source, this._sourceMapURL);
  6715. return {
  6716. source: source,
  6717. generatedLine: mapping.generatedLine,
  6718. generatedColumn: mapping.generatedColumn,
  6719. originalLine: mapping.originalLine,
  6720. originalColumn: mapping.originalColumn,
  6721. name: mapping.name === null ? null : this._names.at(mapping.name)
  6722. };
  6723. }, this).forEach(aCallback, context);
  6724. };
  6725. /**
  6726. * Returns all generated line and column information for the original source,
  6727. * line, and column provided. If no column is provided, returns all mappings
  6728. * corresponding to a either the line we are searching for or the next
  6729. * closest line that has any mappings. Otherwise, returns all mappings
  6730. * corresponding to the given line and either the column we are searching for
  6731. * or the next closest column that has any offsets.
  6732. *
  6733. * The only argument is an object with the following properties:
  6734. *
  6735. * - source: The filename of the original source.
  6736. * - line: The line number in the original source. The line number is 1-based.
  6737. * - column: Optional. the column number in the original source.
  6738. * The column number is 0-based.
  6739. *
  6740. * and an array of objects is returned, each with the following properties:
  6741. *
  6742. * - line: The line number in the generated source, or null. The
  6743. * line number is 1-based.
  6744. * - column: The column number in the generated source, or null.
  6745. * The column number is 0-based.
  6746. */
  6747. SourceMapConsumer$2.prototype.allGeneratedPositionsFor =
  6748. function SourceMapConsumer_allGeneratedPositionsFor(aArgs) {
  6749. var line = util$1.getArg(aArgs, 'line');
  6750. // When there is no exact match, BasicSourceMapConsumer.prototype._findMapping
  6751. // returns the index of the closest mapping less than the needle. By
  6752. // setting needle.originalColumn to 0, we thus find the last mapping for
  6753. // the given line, provided such a mapping exists.
  6754. var needle = {
  6755. source: util$1.getArg(aArgs, 'source'),
  6756. originalLine: line,
  6757. originalColumn: util$1.getArg(aArgs, 'column', 0)
  6758. };
  6759. needle.source = this._findSourceIndex(needle.source);
  6760. if (needle.source < 0) {
  6761. return [];
  6762. }
  6763. var mappings = [];
  6764. var index = this._findMapping(needle,
  6765. this._originalMappings,
  6766. "originalLine",
  6767. "originalColumn",
  6768. util$1.compareByOriginalPositions,
  6769. binarySearch.LEAST_UPPER_BOUND);
  6770. if (index >= 0) {
  6771. var mapping = this._originalMappings[index];
  6772. if (aArgs.column === undefined) {
  6773. var originalLine = mapping.originalLine;
  6774. // Iterate until either we run out of mappings, or we run into
  6775. // a mapping for a different line than the one we found. Since
  6776. // mappings are sorted, this is guaranteed to find all mappings for
  6777. // the line we found.
  6778. while (mapping && mapping.originalLine === originalLine) {
  6779. mappings.push({
  6780. line: util$1.getArg(mapping, 'generatedLine', null),
  6781. column: util$1.getArg(mapping, 'generatedColumn', null),
  6782. lastColumn: util$1.getArg(mapping, 'lastGeneratedColumn', null)
  6783. });
  6784. mapping = this._originalMappings[++index];
  6785. }
  6786. } else {
  6787. var originalColumn = mapping.originalColumn;
  6788. // Iterate until either we run out of mappings, or we run into
  6789. // a mapping for a different line than the one we were searching for.
  6790. // Since mappings are sorted, this is guaranteed to find all mappings for
  6791. // the line we are searching for.
  6792. while (mapping &&
  6793. mapping.originalLine === line &&
  6794. mapping.originalColumn == originalColumn) {
  6795. mappings.push({
  6796. line: util$1.getArg(mapping, 'generatedLine', null),
  6797. column: util$1.getArg(mapping, 'generatedColumn', null),
  6798. lastColumn: util$1.getArg(mapping, 'lastGeneratedColumn', null)
  6799. });
  6800. mapping = this._originalMappings[++index];
  6801. }
  6802. }
  6803. }
  6804. return mappings;
  6805. };
  6806. var SourceMapConsumer_1 = SourceMapConsumer$2;
  6807. /**
  6808. * A BasicSourceMapConsumer instance represents a parsed source map which we can
  6809. * query for information about the original file positions by giving it a file
  6810. * position in the generated source.
  6811. *
  6812. * The first parameter is the raw source map (either as a JSON string, or
  6813. * already parsed to an object). According to the spec, source maps have the
  6814. * following attributes:
  6815. *
  6816. * - version: Which version of the source map spec this map is following.
  6817. * - sources: An array of URLs to the original source files.
  6818. * - names: An array of identifiers which can be referrenced by individual mappings.
  6819. * - sourceRoot: Optional. The URL root from which all sources are relative.
  6820. * - sourcesContent: Optional. An array of contents of the original source files.
  6821. * - mappings: A string of base64 VLQs which contain the actual mappings.
  6822. * - file: Optional. The generated file this source map is associated with.
  6823. *
  6824. * Here is an example source map, taken from the source map spec[0]:
  6825. *
  6826. * {
  6827. * version : 3,
  6828. * file: "out.js",
  6829. * sourceRoot : "",
  6830. * sources: ["foo.js", "bar.js"],
  6831. * names: ["src", "maps", "are", "fun"],
  6832. * mappings: "AA,AB;;ABCDE;"
  6833. * }
  6834. *
  6835. * The second parameter, if given, is a string whose value is the URL
  6836. * at which the source map was found. This URL is used to compute the
  6837. * sources array.
  6838. *
  6839. * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1#
  6840. */
  6841. function BasicSourceMapConsumer(aSourceMap, aSourceMapURL) {
  6842. var sourceMap = aSourceMap;
  6843. if (typeof aSourceMap === 'string') {
  6844. sourceMap = util$1.parseSourceMapInput(aSourceMap);
  6845. }
  6846. var version = util$1.getArg(sourceMap, 'version');
  6847. var sources = util$1.getArg(sourceMap, 'sources');
  6848. // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which
  6849. // requires the array) to play nice here.
  6850. var names = util$1.getArg(sourceMap, 'names', []);
  6851. var sourceRoot = util$1.getArg(sourceMap, 'sourceRoot', null);
  6852. var sourcesContent = util$1.getArg(sourceMap, 'sourcesContent', null);
  6853. var mappings = util$1.getArg(sourceMap, 'mappings');
  6854. var file = util$1.getArg(sourceMap, 'file', null);
  6855. // Once again, Sass deviates from the spec and supplies the version as a
  6856. // string rather than a number, so we use loose equality checking here.
  6857. if (version != this._version) {
  6858. throw new Error('Unsupported version: ' + version);
  6859. }
  6860. if (sourceRoot) {
  6861. sourceRoot = util$1.normalize(sourceRoot);
  6862. }
  6863. sources = sources
  6864. .map(String)
  6865. // Some source maps produce relative source paths like "./foo.js" instead of
  6866. // "foo.js". Normalize these first so that future comparisons will succeed.
  6867. // See bugzil.la/1090768.
  6868. .map(util$1.normalize)
  6869. // Always ensure that absolute sources are internally stored relative to
  6870. // the source root, if the source root is absolute. Not doing this would
  6871. // be particularly problematic when the source root is a prefix of the
  6872. // source (valid, but why??). See github issue #199 and bugzil.la/1188982.
  6873. .map(function (source) {
  6874. return sourceRoot && util$1.isAbsolute(sourceRoot) && util$1.isAbsolute(source)
  6875. ? util$1.relative(sourceRoot, source)
  6876. : source;
  6877. });
  6878. // Pass `true` below to allow duplicate names and sources. While source maps
  6879. // are intended to be compressed and deduplicated, the TypeScript compiler
  6880. // sometimes generates source maps with duplicates in them. See Github issue
  6881. // #72 and bugzil.la/889492.
  6882. this._names = ArraySet.fromArray(names.map(String), true);
  6883. this._sources = ArraySet.fromArray(sources, true);
  6884. this._absoluteSources = this._sources.toArray().map(function (s) {
  6885. return util$1.computeSourceURL(sourceRoot, s, aSourceMapURL);
  6886. });
  6887. this.sourceRoot = sourceRoot;
  6888. this.sourcesContent = sourcesContent;
  6889. this._mappings = mappings;
  6890. this._sourceMapURL = aSourceMapURL;
  6891. this.file = file;
  6892. }
  6893. BasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer$2.prototype);
  6894. BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer$2;
  6895. /**
  6896. * Utility function to find the index of a source. Returns -1 if not
  6897. * found.
  6898. */
  6899. BasicSourceMapConsumer.prototype._findSourceIndex = function(aSource) {
  6900. var relativeSource = aSource;
  6901. if (this.sourceRoot != null) {
  6902. relativeSource = util$1.relative(this.sourceRoot, relativeSource);
  6903. }
  6904. if (this._sources.has(relativeSource)) {
  6905. return this._sources.indexOf(relativeSource);
  6906. }
  6907. // Maybe aSource is an absolute URL as returned by |sources|. In
  6908. // this case we can't simply undo the transform.
  6909. var i;
  6910. for (i = 0; i < this._absoluteSources.length; ++i) {
  6911. if (this._absoluteSources[i] == aSource) {
  6912. return i;
  6913. }
  6914. }
  6915. return -1;
  6916. };
  6917. /**
  6918. * Create a BasicSourceMapConsumer from a SourceMapGenerator.
  6919. *
  6920. * @param SourceMapGenerator aSourceMap
  6921. * The source map that will be consumed.
  6922. * @param String aSourceMapURL
  6923. * The URL at which the source map can be found (optional)
  6924. * @returns BasicSourceMapConsumer
  6925. */
  6926. BasicSourceMapConsumer.fromSourceMap =
  6927. function SourceMapConsumer_fromSourceMap(aSourceMap, aSourceMapURL) {
  6928. var smc = Object.create(BasicSourceMapConsumer.prototype);
  6929. var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true);
  6930. var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true);
  6931. smc.sourceRoot = aSourceMap._sourceRoot;
  6932. smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(),
  6933. smc.sourceRoot);
  6934. smc.file = aSourceMap._file;
  6935. smc._sourceMapURL = aSourceMapURL;
  6936. smc._absoluteSources = smc._sources.toArray().map(function (s) {
  6937. return util$1.computeSourceURL(smc.sourceRoot, s, aSourceMapURL);
  6938. });
  6939. // Because we are modifying the entries (by converting string sources and
  6940. // names to indices into the sources and names ArraySets), we have to make
  6941. // a copy of the entry or else bad things happen. Shared mutable state
  6942. // strikes again! See github issue #191.
  6943. var generatedMappings = aSourceMap._mappings.toArray().slice();
  6944. var destGeneratedMappings = smc.__generatedMappings = [];
  6945. var destOriginalMappings = smc.__originalMappings = [];
  6946. for (var i = 0, length = generatedMappings.length; i < length; i++) {
  6947. var srcMapping = generatedMappings[i];
  6948. var destMapping = new Mapping;
  6949. destMapping.generatedLine = srcMapping.generatedLine;
  6950. destMapping.generatedColumn = srcMapping.generatedColumn;
  6951. if (srcMapping.source) {
  6952. destMapping.source = sources.indexOf(srcMapping.source);
  6953. destMapping.originalLine = srcMapping.originalLine;
  6954. destMapping.originalColumn = srcMapping.originalColumn;
  6955. if (srcMapping.name) {
  6956. destMapping.name = names.indexOf(srcMapping.name);
  6957. }
  6958. destOriginalMappings.push(destMapping);
  6959. }
  6960. destGeneratedMappings.push(destMapping);
  6961. }
  6962. quickSort(smc.__originalMappings, util$1.compareByOriginalPositions);
  6963. return smc;
  6964. };
  6965. /**
  6966. * The version of the source mapping spec that we are consuming.
  6967. */
  6968. BasicSourceMapConsumer.prototype._version = 3;
  6969. /**
  6970. * The list of original sources.
  6971. */
  6972. Object.defineProperty(BasicSourceMapConsumer.prototype, 'sources', {
  6973. get: function () {
  6974. return this._absoluteSources.slice();
  6975. }
  6976. });
  6977. /**
  6978. * Provide the JIT with a nice shape / hidden class.
  6979. */
  6980. function Mapping() {
  6981. this.generatedLine = 0;
  6982. this.generatedColumn = 0;
  6983. this.source = null;
  6984. this.originalLine = null;
  6985. this.originalColumn = null;
  6986. this.name = null;
  6987. }
  6988. /**
  6989. * Parse the mappings in a string in to a data structure which we can easily
  6990. * query (the ordered arrays in the `this.__generatedMappings` and
  6991. * `this.__originalMappings` properties).
  6992. */
  6993. BasicSourceMapConsumer.prototype._parseMappings =
  6994. function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {
  6995. var generatedLine = 1;
  6996. var previousGeneratedColumn = 0;
  6997. var previousOriginalLine = 0;
  6998. var previousOriginalColumn = 0;
  6999. var previousSource = 0;
  7000. var previousName = 0;
  7001. var length = aStr.length;
  7002. var index = 0;
  7003. var cachedSegments = {};
  7004. var temp = {};
  7005. var originalMappings = [];
  7006. var generatedMappings = [];
  7007. var mapping, str, segment, end, value;
  7008. while (index < length) {
  7009. if (aStr.charAt(index) === ';') {
  7010. generatedLine++;
  7011. index++;
  7012. previousGeneratedColumn = 0;
  7013. }
  7014. else if (aStr.charAt(index) === ',') {
  7015. index++;
  7016. }
  7017. else {
  7018. mapping = new Mapping();
  7019. mapping.generatedLine = generatedLine;
  7020. // Because each offset is encoded relative to the previous one,
  7021. // many segments often have the same encoding. We can exploit this
  7022. // fact by caching the parsed variable length fields of each segment,
  7023. // allowing us to avoid a second parse if we encounter the same
  7024. // segment again.
  7025. for (end = index; end < length; end++) {
  7026. if (this._charIsMappingSeparator(aStr, end)) {
  7027. break;
  7028. }
  7029. }
  7030. str = aStr.slice(index, end);
  7031. segment = cachedSegments[str];
  7032. if (segment) {
  7033. index += str.length;
  7034. } else {
  7035. segment = [];
  7036. while (index < end) {
  7037. base64Vlq.decode(aStr, index, temp);
  7038. value = temp.value;
  7039. index = temp.rest;
  7040. segment.push(value);
  7041. }
  7042. if (segment.length === 2) {
  7043. throw new Error('Found a source, but no line and column');
  7044. }
  7045. if (segment.length === 3) {
  7046. throw new Error('Found a source and line, but no column');
  7047. }
  7048. cachedSegments[str] = segment;
  7049. }
  7050. // Generated column.
  7051. mapping.generatedColumn = previousGeneratedColumn + segment[0];
  7052. previousGeneratedColumn = mapping.generatedColumn;
  7053. if (segment.length > 1) {
  7054. // Original source.
  7055. mapping.source = previousSource + segment[1];
  7056. previousSource += segment[1];
  7057. // Original line.
  7058. mapping.originalLine = previousOriginalLine + segment[2];
  7059. previousOriginalLine = mapping.originalLine;
  7060. // Lines are stored 0-based
  7061. mapping.originalLine += 1;
  7062. // Original column.
  7063. mapping.originalColumn = previousOriginalColumn + segment[3];
  7064. previousOriginalColumn = mapping.originalColumn;
  7065. if (segment.length > 4) {
  7066. // Original name.
  7067. mapping.name = previousName + segment[4];
  7068. previousName += segment[4];
  7069. }
  7070. }
  7071. generatedMappings.push(mapping);
  7072. if (typeof mapping.originalLine === 'number') {
  7073. originalMappings.push(mapping);
  7074. }
  7075. }
  7076. }
  7077. quickSort(generatedMappings, util$1.compareByGeneratedPositionsDeflated);
  7078. this.__generatedMappings = generatedMappings;
  7079. quickSort(originalMappings, util$1.compareByOriginalPositions);
  7080. this.__originalMappings = originalMappings;
  7081. };
  7082. /**
  7083. * Find the mapping that best matches the hypothetical "needle" mapping that
  7084. * we are searching for in the given "haystack" of mappings.
  7085. */
  7086. BasicSourceMapConsumer.prototype._findMapping =
  7087. function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName,
  7088. aColumnName, aComparator, aBias) {
  7089. // To return the position we are searching for, we must first find the
  7090. // mapping for the given position and then return the opposite position it
  7091. // points to. Because the mappings are sorted, we can use binary search to
  7092. // find the best mapping.
  7093. if (aNeedle[aLineName] <= 0) {
  7094. throw new TypeError('Line must be greater than or equal to 1, got '
  7095. + aNeedle[aLineName]);
  7096. }
  7097. if (aNeedle[aColumnName] < 0) {
  7098. throw new TypeError('Column must be greater than or equal to 0, got '
  7099. + aNeedle[aColumnName]);
  7100. }
  7101. return binarySearch.search(aNeedle, aMappings, aComparator, aBias);
  7102. };
  7103. /**
  7104. * Compute the last column for each generated mapping. The last column is
  7105. * inclusive.
  7106. */
  7107. BasicSourceMapConsumer.prototype.computeColumnSpans =
  7108. function SourceMapConsumer_computeColumnSpans() {
  7109. for (var index = 0; index < this._generatedMappings.length; ++index) {
  7110. var mapping = this._generatedMappings[index];
  7111. // Mappings do not contain a field for the last generated columnt. We
  7112. // can come up with an optimistic estimate, however, by assuming that
  7113. // mappings are contiguous (i.e. given two consecutive mappings, the
  7114. // first mapping ends where the second one starts).
  7115. if (index + 1 < this._generatedMappings.length) {
  7116. var nextMapping = this._generatedMappings[index + 1];
  7117. if (mapping.generatedLine === nextMapping.generatedLine) {
  7118. mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1;
  7119. continue;
  7120. }
  7121. }
  7122. // The last mapping for each line spans the entire line.
  7123. mapping.lastGeneratedColumn = Infinity;
  7124. }
  7125. };
  7126. /**
  7127. * Returns the original source, line, and column information for the generated
  7128. * source's line and column positions provided. The only argument is an object
  7129. * with the following properties:
  7130. *
  7131. * - line: The line number in the generated source. The line number
  7132. * is 1-based.
  7133. * - column: The column number in the generated source. The column
  7134. * number is 0-based.
  7135. * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or
  7136. * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the
  7137. * closest element that is smaller than or greater than the one we are
  7138. * searching for, respectively, if the exact element cannot be found.
  7139. * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.
  7140. *
  7141. * and an object is returned with the following properties:
  7142. *
  7143. * - source: The original source file, or null.
  7144. * - line: The line number in the original source, or null. The
  7145. * line number is 1-based.
  7146. * - column: The column number in the original source, or null. The
  7147. * column number is 0-based.
  7148. * - name: The original identifier, or null.
  7149. */
  7150. BasicSourceMapConsumer.prototype.originalPositionFor =
  7151. function SourceMapConsumer_originalPositionFor(aArgs) {
  7152. var needle = {
  7153. generatedLine: util$1.getArg(aArgs, 'line'),
  7154. generatedColumn: util$1.getArg(aArgs, 'column')
  7155. };
  7156. var index = this._findMapping(
  7157. needle,
  7158. this._generatedMappings,
  7159. "generatedLine",
  7160. "generatedColumn",
  7161. util$1.compareByGeneratedPositionsDeflated,
  7162. util$1.getArg(aArgs, 'bias', SourceMapConsumer$2.GREATEST_LOWER_BOUND)
  7163. );
  7164. if (index >= 0) {
  7165. var mapping = this._generatedMappings[index];
  7166. if (mapping.generatedLine === needle.generatedLine) {
  7167. var source = util$1.getArg(mapping, 'source', null);
  7168. if (source !== null) {
  7169. source = this._sources.at(source);
  7170. source = util$1.computeSourceURL(this.sourceRoot, source, this._sourceMapURL);
  7171. }
  7172. var name = util$1.getArg(mapping, 'name', null);
  7173. if (name !== null) {
  7174. name = this._names.at(name);
  7175. }
  7176. return {
  7177. source: source,
  7178. line: util$1.getArg(mapping, 'originalLine', null),
  7179. column: util$1.getArg(mapping, 'originalColumn', null),
  7180. name: name
  7181. };
  7182. }
  7183. }
  7184. return {
  7185. source: null,
  7186. line: null,
  7187. column: null,
  7188. name: null
  7189. };
  7190. };
  7191. /**
  7192. * Return true if we have the source content for every source in the source
  7193. * map, false otherwise.
  7194. */
  7195. BasicSourceMapConsumer.prototype.hasContentsOfAllSources =
  7196. function BasicSourceMapConsumer_hasContentsOfAllSources() {
  7197. if (!this.sourcesContent) {
  7198. return false;
  7199. }
  7200. return this.sourcesContent.length >= this._sources.size() &&
  7201. !this.sourcesContent.some(function (sc) { return sc == null; });
  7202. };
  7203. /**
  7204. * Returns the original source content. The only argument is the url of the
  7205. * original source file. Returns null if no original source content is
  7206. * available.
  7207. */
  7208. BasicSourceMapConsumer.prototype.sourceContentFor =
  7209. function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {
  7210. if (!this.sourcesContent) {
  7211. return null;
  7212. }
  7213. var index = this._findSourceIndex(aSource);
  7214. if (index >= 0) {
  7215. return this.sourcesContent[index];
  7216. }
  7217. var relativeSource = aSource;
  7218. if (this.sourceRoot != null) {
  7219. relativeSource = util$1.relative(this.sourceRoot, relativeSource);
  7220. }
  7221. var url;
  7222. if (this.sourceRoot != null
  7223. && (url = util$1.urlParse(this.sourceRoot))) {
  7224. // XXX: file:// URIs and absolute paths lead to unexpected behavior for
  7225. // many users. We can help them out when they expect file:// URIs to
  7226. // behave like it would if they were running a local HTTP server. See
  7227. // https://bugzilla.mozilla.org/show_bug.cgi?id=885597.
  7228. var fileUriAbsPath = relativeSource.replace(/^file:\/\//, "");
  7229. if (url.scheme == "file"
  7230. && this._sources.has(fileUriAbsPath)) {
  7231. return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)]
  7232. }
  7233. if ((!url.path || url.path == "/")
  7234. && this._sources.has("/" + relativeSource)) {
  7235. return this.sourcesContent[this._sources.indexOf("/" + relativeSource)];
  7236. }
  7237. }
  7238. // This function is used recursively from
  7239. // IndexedSourceMapConsumer.prototype.sourceContentFor. In that case, we
  7240. // don't want to throw if we can't find the source - we just want to
  7241. // return null, so we provide a flag to exit gracefully.
  7242. if (nullOnMissing) {
  7243. return null;
  7244. }
  7245. else {
  7246. throw new Error('"' + relativeSource + '" is not in the SourceMap.');
  7247. }
  7248. };
  7249. /**
  7250. * Returns the generated line and column information for the original source,
  7251. * line, and column positions provided. The only argument is an object with
  7252. * the following properties:
  7253. *
  7254. * - source: The filename of the original source.
  7255. * - line: The line number in the original source. The line number
  7256. * is 1-based.
  7257. * - column: The column number in the original source. The column
  7258. * number is 0-based.
  7259. * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or
  7260. * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the
  7261. * closest element that is smaller than or greater than the one we are
  7262. * searching for, respectively, if the exact element cannot be found.
  7263. * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.
  7264. *
  7265. * and an object is returned with the following properties:
  7266. *
  7267. * - line: The line number in the generated source, or null. The
  7268. * line number is 1-based.
  7269. * - column: The column number in the generated source, or null.
  7270. * The column number is 0-based.
  7271. */
  7272. BasicSourceMapConsumer.prototype.generatedPositionFor =
  7273. function SourceMapConsumer_generatedPositionFor(aArgs) {
  7274. var source = util$1.getArg(aArgs, 'source');
  7275. source = this._findSourceIndex(source);
  7276. if (source < 0) {
  7277. return {
  7278. line: null,
  7279. column: null,
  7280. lastColumn: null
  7281. };
  7282. }
  7283. var needle = {
  7284. source: source,
  7285. originalLine: util$1.getArg(aArgs, 'line'),
  7286. originalColumn: util$1.getArg(aArgs, 'column')
  7287. };
  7288. var index = this._findMapping(
  7289. needle,
  7290. this._originalMappings,
  7291. "originalLine",
  7292. "originalColumn",
  7293. util$1.compareByOriginalPositions,
  7294. util$1.getArg(aArgs, 'bias', SourceMapConsumer$2.GREATEST_LOWER_BOUND)
  7295. );
  7296. if (index >= 0) {
  7297. var mapping = this._originalMappings[index];
  7298. if (mapping.source === needle.source) {
  7299. return {
  7300. line: util$1.getArg(mapping, 'generatedLine', null),
  7301. column: util$1.getArg(mapping, 'generatedColumn', null),
  7302. lastColumn: util$1.getArg(mapping, 'lastGeneratedColumn', null)
  7303. };
  7304. }
  7305. }
  7306. return {
  7307. line: null,
  7308. column: null,
  7309. lastColumn: null
  7310. };
  7311. };
  7312. var BasicSourceMapConsumer_1 = BasicSourceMapConsumer;
  7313. /**
  7314. * An IndexedSourceMapConsumer instance represents a parsed source map which
  7315. * we can query for information. It differs from BasicSourceMapConsumer in
  7316. * that it takes "indexed" source maps (i.e. ones with a "sections" field) as
  7317. * input.
  7318. *
  7319. * The first parameter is a raw source map (either as a JSON string, or already
  7320. * parsed to an object). According to the spec for indexed source maps, they
  7321. * have the following attributes:
  7322. *
  7323. * - version: Which version of the source map spec this map is following.
  7324. * - file: Optional. The generated file this source map is associated with.
  7325. * - sections: A list of section definitions.
  7326. *
  7327. * Each value under the "sections" field has two fields:
  7328. * - offset: The offset into the original specified at which this section
  7329. * begins to apply, defined as an object with a "line" and "column"
  7330. * field.
  7331. * - map: A source map definition. This source map could also be indexed,
  7332. * but doesn't have to be.
  7333. *
  7334. * Instead of the "map" field, it's also possible to have a "url" field
  7335. * specifying a URL to retrieve a source map from, but that's currently
  7336. * unsupported.
  7337. *
  7338. * Here's an example source map, taken from the source map spec[0], but
  7339. * modified to omit a section which uses the "url" field.
  7340. *
  7341. * {
  7342. * version : 3,
  7343. * file: "app.js",
  7344. * sections: [{
  7345. * offset: {line:100, column:10},
  7346. * map: {
  7347. * version : 3,
  7348. * file: "section.js",
  7349. * sources: ["foo.js", "bar.js"],
  7350. * names: ["src", "maps", "are", "fun"],
  7351. * mappings: "AAAA,E;;ABCDE;"
  7352. * }
  7353. * }],
  7354. * }
  7355. *
  7356. * The second parameter, if given, is a string whose value is the URL
  7357. * at which the source map was found. This URL is used to compute the
  7358. * sources array.
  7359. *
  7360. * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt
  7361. */
  7362. function IndexedSourceMapConsumer(aSourceMap, aSourceMapURL) {
  7363. var sourceMap = aSourceMap;
  7364. if (typeof aSourceMap === 'string') {
  7365. sourceMap = util$1.parseSourceMapInput(aSourceMap);
  7366. }
  7367. var version = util$1.getArg(sourceMap, 'version');
  7368. var sections = util$1.getArg(sourceMap, 'sections');
  7369. if (version != this._version) {
  7370. throw new Error('Unsupported version: ' + version);
  7371. }
  7372. this._sources = new ArraySet();
  7373. this._names = new ArraySet();
  7374. var lastOffset = {
  7375. line: -1,
  7376. column: 0
  7377. };
  7378. this._sections = sections.map(function (s) {
  7379. if (s.url) {
  7380. // The url field will require support for asynchronicity.
  7381. // See https://github.com/mozilla/source-map/issues/16
  7382. throw new Error('Support for url field in sections not implemented.');
  7383. }
  7384. var offset = util$1.getArg(s, 'offset');
  7385. var offsetLine = util$1.getArg(offset, 'line');
  7386. var offsetColumn = util$1.getArg(offset, 'column');
  7387. if (offsetLine < lastOffset.line ||
  7388. (offsetLine === lastOffset.line && offsetColumn < lastOffset.column)) {
  7389. throw new Error('Section offsets must be ordered and non-overlapping.');
  7390. }
  7391. lastOffset = offset;
  7392. return {
  7393. generatedOffset: {
  7394. // The offset fields are 0-based, but we use 1-based indices when
  7395. // encoding/decoding from VLQ.
  7396. generatedLine: offsetLine + 1,
  7397. generatedColumn: offsetColumn + 1
  7398. },
  7399. consumer: new SourceMapConsumer$2(util$1.getArg(s, 'map'), aSourceMapURL)
  7400. }
  7401. });
  7402. }
  7403. IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer$2.prototype);
  7404. IndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer$2;
  7405. /**
  7406. * The version of the source mapping spec that we are consuming.
  7407. */
  7408. IndexedSourceMapConsumer.prototype._version = 3;
  7409. /**
  7410. * The list of original sources.
  7411. */
  7412. Object.defineProperty(IndexedSourceMapConsumer.prototype, 'sources', {
  7413. get: function () {
  7414. var sources = [];
  7415. for (var i = 0; i < this._sections.length; i++) {
  7416. for (var j = 0; j < this._sections[i].consumer.sources.length; j++) {
  7417. sources.push(this._sections[i].consumer.sources[j]);
  7418. }
  7419. }
  7420. return sources;
  7421. }
  7422. });
  7423. /**
  7424. * Returns the original source, line, and column information for the generated
  7425. * source's line and column positions provided. The only argument is an object
  7426. * with the following properties:
  7427. *
  7428. * - line: The line number in the generated source. The line number
  7429. * is 1-based.
  7430. * - column: The column number in the generated source. The column
  7431. * number is 0-based.
  7432. *
  7433. * and an object is returned with the following properties:
  7434. *
  7435. * - source: The original source file, or null.
  7436. * - line: The line number in the original source, or null. The
  7437. * line number is 1-based.
  7438. * - column: The column number in the original source, or null. The
  7439. * column number is 0-based.
  7440. * - name: The original identifier, or null.
  7441. */
  7442. IndexedSourceMapConsumer.prototype.originalPositionFor =
  7443. function IndexedSourceMapConsumer_originalPositionFor(aArgs) {
  7444. var needle = {
  7445. generatedLine: util$1.getArg(aArgs, 'line'),
  7446. generatedColumn: util$1.getArg(aArgs, 'column')
  7447. };
  7448. // Find the section containing the generated position we're trying to map
  7449. // to an original position.
  7450. var sectionIndex = binarySearch.search(needle, this._sections,
  7451. function(needle, section) {
  7452. var cmp = needle.generatedLine - section.generatedOffset.generatedLine;
  7453. if (cmp) {
  7454. return cmp;
  7455. }
  7456. return (needle.generatedColumn -
  7457. section.generatedOffset.generatedColumn);
  7458. });
  7459. var section = this._sections[sectionIndex];
  7460. if (!section) {
  7461. return {
  7462. source: null,
  7463. line: null,
  7464. column: null,
  7465. name: null
  7466. };
  7467. }
  7468. return section.consumer.originalPositionFor({
  7469. line: needle.generatedLine -
  7470. (section.generatedOffset.generatedLine - 1),
  7471. column: needle.generatedColumn -
  7472. (section.generatedOffset.generatedLine === needle.generatedLine
  7473. ? section.generatedOffset.generatedColumn - 1
  7474. : 0),
  7475. bias: aArgs.bias
  7476. });
  7477. };
  7478. /**
  7479. * Return true if we have the source content for every source in the source
  7480. * map, false otherwise.
  7481. */
  7482. IndexedSourceMapConsumer.prototype.hasContentsOfAllSources =
  7483. function IndexedSourceMapConsumer_hasContentsOfAllSources() {
  7484. return this._sections.every(function (s) {
  7485. return s.consumer.hasContentsOfAllSources();
  7486. });
  7487. };
  7488. /**
  7489. * Returns the original source content. The only argument is the url of the
  7490. * original source file. Returns null if no original source content is
  7491. * available.
  7492. */
  7493. IndexedSourceMapConsumer.prototype.sourceContentFor =
  7494. function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {
  7495. for (var i = 0; i < this._sections.length; i++) {
  7496. var section = this._sections[i];
  7497. var content = section.consumer.sourceContentFor(aSource, true);
  7498. if (content) {
  7499. return content;
  7500. }
  7501. }
  7502. if (nullOnMissing) {
  7503. return null;
  7504. }
  7505. else {
  7506. throw new Error('"' + aSource + '" is not in the SourceMap.');
  7507. }
  7508. };
  7509. /**
  7510. * Returns the generated line and column information for the original source,
  7511. * line, and column positions provided. The only argument is an object with
  7512. * the following properties:
  7513. *
  7514. * - source: The filename of the original source.
  7515. * - line: The line number in the original source. The line number
  7516. * is 1-based.
  7517. * - column: The column number in the original source. The column
  7518. * number is 0-based.
  7519. *
  7520. * and an object is returned with the following properties:
  7521. *
  7522. * - line: The line number in the generated source, or null. The
  7523. * line number is 1-based.
  7524. * - column: The column number in the generated source, or null.
  7525. * The column number is 0-based.
  7526. */
  7527. IndexedSourceMapConsumer.prototype.generatedPositionFor =
  7528. function IndexedSourceMapConsumer_generatedPositionFor(aArgs) {
  7529. for (var i = 0; i < this._sections.length; i++) {
  7530. var section = this._sections[i];
  7531. // Only consider this section if the requested source is in the list of
  7532. // sources of the consumer.
  7533. if (section.consumer._findSourceIndex(util$1.getArg(aArgs, 'source')) === -1) {
  7534. continue;
  7535. }
  7536. var generatedPosition = section.consumer.generatedPositionFor(aArgs);
  7537. if (generatedPosition) {
  7538. var ret = {
  7539. line: generatedPosition.line +
  7540. (section.generatedOffset.generatedLine - 1),
  7541. column: generatedPosition.column +
  7542. (section.generatedOffset.generatedLine === generatedPosition.line
  7543. ? section.generatedOffset.generatedColumn - 1
  7544. : 0)
  7545. };
  7546. return ret;
  7547. }
  7548. }
  7549. return {
  7550. line: null,
  7551. column: null
  7552. };
  7553. };
  7554. /**
  7555. * Parse the mappings in a string in to a data structure which we can easily
  7556. * query (the ordered arrays in the `this.__generatedMappings` and
  7557. * `this.__originalMappings` properties).
  7558. */
  7559. IndexedSourceMapConsumer.prototype._parseMappings =
  7560. function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) {
  7561. this.__generatedMappings = [];
  7562. this.__originalMappings = [];
  7563. for (var i = 0; i < this._sections.length; i++) {
  7564. var section = this._sections[i];
  7565. var sectionMappings = section.consumer._generatedMappings;
  7566. for (var j = 0; j < sectionMappings.length; j++) {
  7567. var mapping = sectionMappings[j];
  7568. var source = section.consumer._sources.at(mapping.source);
  7569. source = util$1.computeSourceURL(section.consumer.sourceRoot, source, this._sourceMapURL);
  7570. this._sources.add(source);
  7571. source = this._sources.indexOf(source);
  7572. var name = null;
  7573. if (mapping.name) {
  7574. name = section.consumer._names.at(mapping.name);
  7575. this._names.add(name);
  7576. name = this._names.indexOf(name);
  7577. }
  7578. // The mappings coming from the consumer for the section have
  7579. // generated positions relative to the start of the section, so we
  7580. // need to offset them to be relative to the start of the concatenated
  7581. // generated file.
  7582. var adjustedMapping = {
  7583. source: source,
  7584. generatedLine: mapping.generatedLine +
  7585. (section.generatedOffset.generatedLine - 1),
  7586. generatedColumn: mapping.generatedColumn +
  7587. (section.generatedOffset.generatedLine === mapping.generatedLine
  7588. ? section.generatedOffset.generatedColumn - 1
  7589. : 0),
  7590. originalLine: mapping.originalLine,
  7591. originalColumn: mapping.originalColumn,
  7592. name: name
  7593. };
  7594. this.__generatedMappings.push(adjustedMapping);
  7595. if (typeof adjustedMapping.originalLine === 'number') {
  7596. this.__originalMappings.push(adjustedMapping);
  7597. }
  7598. }
  7599. }
  7600. quickSort(this.__generatedMappings, util$1.compareByGeneratedPositionsDeflated);
  7601. quickSort(this.__originalMappings, util$1.compareByOriginalPositions);
  7602. };
  7603. var IndexedSourceMapConsumer_1 = IndexedSourceMapConsumer;
  7604. var sourceMapConsumer = {
  7605. SourceMapConsumer: SourceMapConsumer_1,
  7606. BasicSourceMapConsumer: BasicSourceMapConsumer_1,
  7607. IndexedSourceMapConsumer: IndexedSourceMapConsumer_1
  7608. };
  7609. /* -*- Mode: js; js-indent-level: 2; -*- */
  7610. /*
  7611. * Copyright 2011 Mozilla Foundation and contributors
  7612. * Licensed under the New BSD license. See LICENSE or:
  7613. * http://opensource.org/licenses/BSD-3-Clause
  7614. */
  7615. var SourceMapGenerator$2 = sourceMapGenerator.SourceMapGenerator;
  7616. // Matches a Windows-style `\r\n` newline or a `\n` newline used by all other
  7617. // operating systems these days (capturing the result).
  7618. var REGEX_NEWLINE = /(\r?\n)/;
  7619. // Newline character code for charCodeAt() comparisons
  7620. var NEWLINE_CODE = 10;
  7621. // Private symbol for identifying `SourceNode`s when multiple versions of
  7622. // the source-map library are loaded. This MUST NOT CHANGE across
  7623. // versions!
  7624. var isSourceNode = "$$$isSourceNode$$$";
  7625. /**
  7626. * SourceNodes provide a way to abstract over interpolating/concatenating
  7627. * snippets of generated JavaScript source code while maintaining the line and
  7628. * column information associated with the original source code.
  7629. *
  7630. * @param aLine The original line number.
  7631. * @param aColumn The original column number.
  7632. * @param aSource The original source's filename.
  7633. * @param aChunks Optional. An array of strings which are snippets of
  7634. * generated JS, or other SourceNodes.
  7635. * @param aName The original identifier.
  7636. */
  7637. function SourceNode$1(aLine, aColumn, aSource, aChunks, aName) {
  7638. this.children = [];
  7639. this.sourceContents = {};
  7640. this.line = aLine == null ? null : aLine;
  7641. this.column = aColumn == null ? null : aColumn;
  7642. this.source = aSource == null ? null : aSource;
  7643. this.name = aName == null ? null : aName;
  7644. this[isSourceNode] = true;
  7645. if (aChunks != null) this.add(aChunks);
  7646. }
  7647. /**
  7648. * Creates a SourceNode from generated code and a SourceMapConsumer.
  7649. *
  7650. * @param aGeneratedCode The generated code
  7651. * @param aSourceMapConsumer The SourceMap for the generated code
  7652. * @param aRelativePath Optional. The path that relative sources in the
  7653. * SourceMapConsumer should be relative to.
  7654. */
  7655. SourceNode$1.fromStringWithSourceMap =
  7656. function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) {
  7657. // The SourceNode we want to fill with the generated code
  7658. // and the SourceMap
  7659. var node = new SourceNode$1();
  7660. // All even indices of this array are one line of the generated code,
  7661. // while all odd indices are the newlines between two adjacent lines
  7662. // (since `REGEX_NEWLINE` captures its match).
  7663. // Processed fragments are accessed by calling `shiftNextLine`.
  7664. var remainingLines = aGeneratedCode.split(REGEX_NEWLINE);
  7665. var remainingLinesIndex = 0;
  7666. var shiftNextLine = function() {
  7667. var lineContents = getNextLine();
  7668. // The last line of a file might not have a newline.
  7669. var newLine = getNextLine() || "";
  7670. return lineContents + newLine;
  7671. function getNextLine() {
  7672. return remainingLinesIndex < remainingLines.length ?
  7673. remainingLines[remainingLinesIndex++] : undefined;
  7674. }
  7675. };
  7676. // We need to remember the position of "remainingLines"
  7677. var lastGeneratedLine = 1, lastGeneratedColumn = 0;
  7678. // The generate SourceNodes we need a code range.
  7679. // To extract it current and last mapping is used.
  7680. // Here we store the last mapping.
  7681. var lastMapping = null;
  7682. aSourceMapConsumer.eachMapping(function (mapping) {
  7683. if (lastMapping !== null) {
  7684. // We add the code from "lastMapping" to "mapping":
  7685. // First check if there is a new line in between.
  7686. if (lastGeneratedLine < mapping.generatedLine) {
  7687. // Associate first line with "lastMapping"
  7688. addMappingWithCode(lastMapping, shiftNextLine());
  7689. lastGeneratedLine++;
  7690. lastGeneratedColumn = 0;
  7691. // The remaining code is added without mapping
  7692. } else {
  7693. // There is no new line in between.
  7694. // Associate the code between "lastGeneratedColumn" and
  7695. // "mapping.generatedColumn" with "lastMapping"
  7696. var nextLine = remainingLines[remainingLinesIndex] || '';
  7697. var code = nextLine.substr(0, mapping.generatedColumn -
  7698. lastGeneratedColumn);
  7699. remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn -
  7700. lastGeneratedColumn);
  7701. lastGeneratedColumn = mapping.generatedColumn;
  7702. addMappingWithCode(lastMapping, code);
  7703. // No more remaining code, continue
  7704. lastMapping = mapping;
  7705. return;
  7706. }
  7707. }
  7708. // We add the generated code until the first mapping
  7709. // to the SourceNode without any mapping.
  7710. // Each line is added as separate string.
  7711. while (lastGeneratedLine < mapping.generatedLine) {
  7712. node.add(shiftNextLine());
  7713. lastGeneratedLine++;
  7714. }
  7715. if (lastGeneratedColumn < mapping.generatedColumn) {
  7716. var nextLine = remainingLines[remainingLinesIndex] || '';
  7717. node.add(nextLine.substr(0, mapping.generatedColumn));
  7718. remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn);
  7719. lastGeneratedColumn = mapping.generatedColumn;
  7720. }
  7721. lastMapping = mapping;
  7722. }, this);
  7723. // We have processed all mappings.
  7724. if (remainingLinesIndex < remainingLines.length) {
  7725. if (lastMapping) {
  7726. // Associate the remaining code in the current line with "lastMapping"
  7727. addMappingWithCode(lastMapping, shiftNextLine());
  7728. }
  7729. // and add the remaining lines without any mapping
  7730. node.add(remainingLines.splice(remainingLinesIndex).join(""));
  7731. }
  7732. // Copy sourcesContent into SourceNode
  7733. aSourceMapConsumer.sources.forEach(function (sourceFile) {
  7734. var content = aSourceMapConsumer.sourceContentFor(sourceFile);
  7735. if (content != null) {
  7736. if (aRelativePath != null) {
  7737. sourceFile = util$1.join(aRelativePath, sourceFile);
  7738. }
  7739. node.setSourceContent(sourceFile, content);
  7740. }
  7741. });
  7742. return node;
  7743. function addMappingWithCode(mapping, code) {
  7744. if (mapping === null || mapping.source === undefined) {
  7745. node.add(code);
  7746. } else {
  7747. var source = aRelativePath
  7748. ? util$1.join(aRelativePath, mapping.source)
  7749. : mapping.source;
  7750. node.add(new SourceNode$1(mapping.originalLine,
  7751. mapping.originalColumn,
  7752. source,
  7753. code,
  7754. mapping.name));
  7755. }
  7756. }
  7757. };
  7758. /**
  7759. * Add a chunk of generated JS to this source node.
  7760. *
  7761. * @param aChunk A string snippet of generated JS code, another instance of
  7762. * SourceNode, or an array where each member is one of those things.
  7763. */
  7764. SourceNode$1.prototype.add = function SourceNode_add(aChunk) {
  7765. if (Array.isArray(aChunk)) {
  7766. aChunk.forEach(function (chunk) {
  7767. this.add(chunk);
  7768. }, this);
  7769. }
  7770. else if (aChunk[isSourceNode] || typeof aChunk === "string") {
  7771. if (aChunk) {
  7772. this.children.push(aChunk);
  7773. }
  7774. }
  7775. else {
  7776. throw new TypeError(
  7777. "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk
  7778. );
  7779. }
  7780. return this;
  7781. };
  7782. /**
  7783. * Add a chunk of generated JS to the beginning of this source node.
  7784. *
  7785. * @param aChunk A string snippet of generated JS code, another instance of
  7786. * SourceNode, or an array where each member is one of those things.
  7787. */
  7788. SourceNode$1.prototype.prepend = function SourceNode_prepend(aChunk) {
  7789. if (Array.isArray(aChunk)) {
  7790. for (var i = aChunk.length-1; i >= 0; i--) {
  7791. this.prepend(aChunk[i]);
  7792. }
  7793. }
  7794. else if (aChunk[isSourceNode] || typeof aChunk === "string") {
  7795. this.children.unshift(aChunk);
  7796. }
  7797. else {
  7798. throw new TypeError(
  7799. "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk
  7800. );
  7801. }
  7802. return this;
  7803. };
  7804. /**
  7805. * Walk over the tree of JS snippets in this node and its children. The
  7806. * walking function is called once for each snippet of JS and is passed that
  7807. * snippet and the its original associated source's line/column location.
  7808. *
  7809. * @param aFn The traversal function.
  7810. */
  7811. SourceNode$1.prototype.walk = function SourceNode_walk(aFn) {
  7812. var chunk;
  7813. for (var i = 0, len = this.children.length; i < len; i++) {
  7814. chunk = this.children[i];
  7815. if (chunk[isSourceNode]) {
  7816. chunk.walk(aFn);
  7817. }
  7818. else {
  7819. if (chunk !== '') {
  7820. aFn(chunk, { source: this.source,
  7821. line: this.line,
  7822. column: this.column,
  7823. name: this.name });
  7824. }
  7825. }
  7826. }
  7827. };
  7828. /**
  7829. * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between
  7830. * each of `this.children`.
  7831. *
  7832. * @param aSep The separator.
  7833. */
  7834. SourceNode$1.prototype.join = function SourceNode_join(aSep) {
  7835. var newChildren;
  7836. var i;
  7837. var len = this.children.length;
  7838. if (len > 0) {
  7839. newChildren = [];
  7840. for (i = 0; i < len-1; i++) {
  7841. newChildren.push(this.children[i]);
  7842. newChildren.push(aSep);
  7843. }
  7844. newChildren.push(this.children[i]);
  7845. this.children = newChildren;
  7846. }
  7847. return this;
  7848. };
  7849. /**
  7850. * Call String.prototype.replace on the very right-most source snippet. Useful
  7851. * for trimming whitespace from the end of a source node, etc.
  7852. *
  7853. * @param aPattern The pattern to replace.
  7854. * @param aReplacement The thing to replace the pattern with.
  7855. */
  7856. SourceNode$1.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) {
  7857. var lastChild = this.children[this.children.length - 1];
  7858. if (lastChild[isSourceNode]) {
  7859. lastChild.replaceRight(aPattern, aReplacement);
  7860. }
  7861. else if (typeof lastChild === 'string') {
  7862. this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement);
  7863. }
  7864. else {
  7865. this.children.push(''.replace(aPattern, aReplacement));
  7866. }
  7867. return this;
  7868. };
  7869. /**
  7870. * Set the source content for a source file. This will be added to the SourceMapGenerator
  7871. * in the sourcesContent field.
  7872. *
  7873. * @param aSourceFile The filename of the source file
  7874. * @param aSourceContent The content of the source file
  7875. */
  7876. SourceNode$1.prototype.setSourceContent =
  7877. function SourceNode_setSourceContent(aSourceFile, aSourceContent) {
  7878. this.sourceContents[util$1.toSetString(aSourceFile)] = aSourceContent;
  7879. };
  7880. /**
  7881. * Walk over the tree of SourceNodes. The walking function is called for each
  7882. * source file content and is passed the filename and source content.
  7883. *
  7884. * @param aFn The traversal function.
  7885. */
  7886. SourceNode$1.prototype.walkSourceContents =
  7887. function SourceNode_walkSourceContents(aFn) {
  7888. for (var i = 0, len = this.children.length; i < len; i++) {
  7889. if (this.children[i][isSourceNode]) {
  7890. this.children[i].walkSourceContents(aFn);
  7891. }
  7892. }
  7893. var sources = Object.keys(this.sourceContents);
  7894. for (var i = 0, len = sources.length; i < len; i++) {
  7895. aFn(util$1.fromSetString(sources[i]), this.sourceContents[sources[i]]);
  7896. }
  7897. };
  7898. /**
  7899. * Return the string representation of this source node. Walks over the tree
  7900. * and concatenates all the various snippets together to one string.
  7901. */
  7902. SourceNode$1.prototype.toString = function SourceNode_toString() {
  7903. var str = "";
  7904. this.walk(function (chunk) {
  7905. str += chunk;
  7906. });
  7907. return str;
  7908. };
  7909. /**
  7910. * Returns the string representation of this source node along with a source
  7911. * map.
  7912. */
  7913. SourceNode$1.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) {
  7914. var generated = {
  7915. code: "",
  7916. line: 1,
  7917. column: 0
  7918. };
  7919. var map = new SourceMapGenerator$2(aArgs);
  7920. var sourceMappingActive = false;
  7921. var lastOriginalSource = null;
  7922. var lastOriginalLine = null;
  7923. var lastOriginalColumn = null;
  7924. var lastOriginalName = null;
  7925. this.walk(function (chunk, original) {
  7926. generated.code += chunk;
  7927. if (original.source !== null
  7928. && original.line !== null
  7929. && original.column !== null) {
  7930. if(lastOriginalSource !== original.source
  7931. || lastOriginalLine !== original.line
  7932. || lastOriginalColumn !== original.column
  7933. || lastOriginalName !== original.name) {
  7934. map.addMapping({
  7935. source: original.source,
  7936. original: {
  7937. line: original.line,
  7938. column: original.column
  7939. },
  7940. generated: {
  7941. line: generated.line,
  7942. column: generated.column
  7943. },
  7944. name: original.name
  7945. });
  7946. }
  7947. lastOriginalSource = original.source;
  7948. lastOriginalLine = original.line;
  7949. lastOriginalColumn = original.column;
  7950. lastOriginalName = original.name;
  7951. sourceMappingActive = true;
  7952. } else if (sourceMappingActive) {
  7953. map.addMapping({
  7954. generated: {
  7955. line: generated.line,
  7956. column: generated.column
  7957. }
  7958. });
  7959. lastOriginalSource = null;
  7960. sourceMappingActive = false;
  7961. }
  7962. for (var idx = 0, length = chunk.length; idx < length; idx++) {
  7963. if (chunk.charCodeAt(idx) === NEWLINE_CODE) {
  7964. generated.line++;
  7965. generated.column = 0;
  7966. // Mappings end at eol
  7967. if (idx + 1 === length) {
  7968. lastOriginalSource = null;
  7969. sourceMappingActive = false;
  7970. } else if (sourceMappingActive) {
  7971. map.addMapping({
  7972. source: original.source,
  7973. original: {
  7974. line: original.line,
  7975. column: original.column
  7976. },
  7977. generated: {
  7978. line: generated.line,
  7979. column: generated.column
  7980. },
  7981. name: original.name
  7982. });
  7983. }
  7984. } else {
  7985. generated.column++;
  7986. }
  7987. }
  7988. });
  7989. this.walkSourceContents(function (sourceFile, sourceContent) {
  7990. map.setSourceContent(sourceFile, sourceContent);
  7991. });
  7992. return { code: generated.code, map: map };
  7993. };
  7994. var SourceNode_1 = SourceNode$1;
  7995. var sourceNode = {
  7996. SourceNode: SourceNode_1
  7997. };
  7998. /*
  7999. * Copyright 2009-2011 Mozilla Foundation and contributors
  8000. * Licensed under the New BSD license. See LICENSE.txt or:
  8001. * http://opensource.org/licenses/BSD-3-Clause
  8002. */
  8003. var SourceMapGenerator$1 = sourceMapGenerator.SourceMapGenerator;
  8004. var SourceMapConsumer$1 = sourceMapConsumer.SourceMapConsumer;
  8005. var SourceNode = sourceNode.SourceNode;
  8006. var sourceMap = {
  8007. SourceMapGenerator: SourceMapGenerator$1,
  8008. SourceMapConsumer: SourceMapConsumer$1,
  8009. SourceNode: SourceNode
  8010. };
  8011. // Terser 5.6.1
  8012. function characters(e){return e.split("")}function member(e,t){return t.includes(e)}class DefaultsError extends Error{constructor(e,t){super(),this.name="DefaultsError",this.message=e,this.defs=t;}}function defaults$1(e,t,n){!0===e&&(e={}),null!=e&&"object"==typeof e&&(e=Object.assign({},e));const o=e||{};if(n)for(const e in o)if(HOP(o,e)&&!HOP(t,e))throw new DefaultsError("`"+e+"` is not a supported option",t);for(const n in t)if(HOP(t,n))if(e&&HOP(e,n))if("ecma"===n){let t=0|e[n];t>5&&t<2015&&(t+=2009),o[n]=t;}else o[n]=e&&HOP(e,n)?e[n]:t[n];else o[n]=t[n];return o}function noop(){}function return_false(){return !1}function return_true(){return !0}function return_this(){return this}function return_null(){return null}var MAP=function(){function e(e,r,a){var s,u=[],l=[];function _(){var _=r(e[s],s),c=_ instanceof i;return c&&(_=_.v),_ instanceof n?(_=_.v)instanceof o?l.push.apply(l,a?_.v.slice().reverse():_.v):l.push(_):_!==t&&(_ instanceof o?u.push.apply(u,a?_.v.slice().reverse():_.v):u.push(_)),c}if(Array.isArray(e))if(a){for(s=e.length;--s>=0&&!_(););u.reverse(),l.reverse();}else for(s=0;s<e.length&&!_();++s);else for(s in e)if(HOP(e,s)&&_())break;return l.concat(u)}e.at_top=function(e){return new n(e)},e.splice=function(e){return new o(e)},e.last=function(e){return new i(e)};var t=e.skip={};function n(e){this.v=e;}function o(e){this.v=e;}function i(e){this.v=e;}return e}();function make_node(e,t,n){return n||(n={}),t&&(n.start||(n.start=t.start),n.end||(n.end=t.end)),new e(n)}function push_uniq(e,t){e.includes(t)||e.push(t);}function string_template(e,t){return e.replace(/{(.+?)}/g,(function(e,n){return t&&t[n]}))}function remove$1(e,t){for(var n=e.length;--n>=0;)e[n]===t&&e.splice(n,1);}function mergeSort(e,t){return e.length<2?e.slice():function e(n){if(n.length<=1)return n;var o=Math.floor(n.length/2),i=n.slice(0,o),r=n.slice(o);return function(e,n){for(var o=[],i=0,r=0,a=0;i<e.length&&r<n.length;)t(e[i],n[r])<=0?o[a++]=e[i++]:o[a++]=n[r++];return i<e.length&&o.push.apply(o,e.slice(i)),r<n.length&&o.push.apply(o,n.slice(r)),o}(i=e(i),r=e(r))}(e)}function makePredicate(e){return Array.isArray(e)||(e=e.split(" ")),new Set(e)}function map_add(e,t,n){e.has(t)?e.get(t).push(n):e.set(t,[n]);}function map_from_object(e){var t=new Map;for(var n in e)HOP(e,n)&&"$"===n.charAt(0)&&t.set(n.substr(1),e[n]);return t}function map_to_object(e){var t=Object.create(null);return e.forEach((function(e,n){t["$"+n]=e;})),t}function HOP(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function keep_name(e,t){return !0===e||e instanceof RegExp&&e.test(t)}var lineTerminatorEscape={"\0":"0","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"};function regexp_source_fix(e){return e.replace(/[\0\n\r\u2028\u2029]/g,(function(t,n){return ("\\"!=e[n-1]||"\\"==e[n-2]&&!/(?:^|[^\\])(?:\\{2})*$/.test(e.slice(0,n-1))?"\\":"")+lineTerminatorEscape[t]}))}function sort_regexp_flags(e){const t=new Set(e.split(""));let n="";for(const e of "gimuy")t.has(e)&&(n+=e,t.delete(e));return t.size&&t.forEach((e=>{n+=e;})),n}function has_annotation(e,t){return e._annotations&t}function set_annotation(e,t){e._annotations|=t;}var LATEST_RAW="",LATEST_TEMPLATE_END=!0,KEYWORDS="break case catch class const continue debugger default delete do else export extends finally for function if in instanceof let new return switch throw try typeof var void while with",KEYWORDS_ATOM="false null true",RESERVED_WORDS="enum implements import interface package private protected public static super this "+KEYWORDS_ATOM+" "+KEYWORDS,KEYWORDS_BEFORE_EXPRESSION="return new delete throw else case yield await";KEYWORDS=makePredicate(KEYWORDS),RESERVED_WORDS=makePredicate(RESERVED_WORDS),KEYWORDS_BEFORE_EXPRESSION=makePredicate(KEYWORDS_BEFORE_EXPRESSION),KEYWORDS_ATOM=makePredicate(KEYWORDS_ATOM);var OPERATOR_CHARS=makePredicate(characters("+-*&%=<>!?|~^")),RE_NUM_LITERAL=/[0-9a-f]/i,RE_HEX_NUMBER=/^0x[0-9a-f]+$/i,RE_OCT_NUMBER=/^0[0-7]+$/,RE_ES6_OCT_NUMBER=/^0o[0-7]+$/i,RE_BIN_NUMBER=/^0b[01]+$/i,RE_DEC_NUMBER=/^\d*\.?\d*(?:e[+-]?\d*(?:\d\.?|\.?\d)\d*)?$/i,RE_BIG_INT=/^(0[xob])?[0-9a-f]+n$/i,OPERATORS=makePredicate(["in","instanceof","typeof","new","void","delete","++","--","+","-","!","~","&","|","^","*","**","/","%",">>","<<",">>>","<",">","<=",">=","==","===","!=","!==","?","=","+=","-=","||=","&&=","??=","/=","*=","**=","%=",">>=","<<=",">>>=","|=","^=","&=","&&","??","||"]),WHITESPACE_CHARS=makePredicate(characters("  \n\r\t\f\v​           \u2028\u2029   \ufeff")),NEWLINE_CHARS=makePredicate(characters("\n\r\u2028\u2029")),PUNC_AFTER_EXPRESSION=makePredicate(characters(";]),:")),PUNC_BEFORE_EXPRESSION=makePredicate(characters("[{(,;:")),PUNC_CHARS=makePredicate(characters("[]{}(),;:")),UNICODE={ID_Start:/[$A-Z_a-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]/,ID_Continue:/(?:[$0-9A-Z_a-z\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF])+/};function get_full_char(e,t){if(is_surrogate_pair_head(e.charCodeAt(t))){if(is_surrogate_pair_tail(e.charCodeAt(t+1)))return e.charAt(t)+e.charAt(t+1)}else if(is_surrogate_pair_tail(e.charCodeAt(t))&&is_surrogate_pair_head(e.charCodeAt(t-1)))return e.charAt(t-1)+e.charAt(t);return e.charAt(t)}function get_full_char_code(e,t){return is_surrogate_pair_head(e.charCodeAt(t))?65536+(e.charCodeAt(t)-55296<<10)+e.charCodeAt(t+1)-56320:e.charCodeAt(t)}function get_full_char_length(e){for(var t=0,n=0;n<e.length;n++)is_surrogate_pair_head(e.charCodeAt(n))&&is_surrogate_pair_tail(e.charCodeAt(n+1))&&(t++,n++);return e.length-t}function from_char_code(e){return e>65535?(e-=65536,String.fromCharCode(55296+(e>>10))+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function is_surrogate_pair_head(e){return e>=55296&&e<=56319}function is_surrogate_pair_tail(e){return e>=56320&&e<=57343}function is_digit(e){return e>=48&&e<=57}function is_identifier_start(e){return UNICODE.ID_Start.test(e)}function is_identifier_char(e){return UNICODE.ID_Continue.test(e)}const BASIC_IDENT=/^[a-z_$][a-z0-9_$]*$/i;function is_basic_identifier_string(e){return BASIC_IDENT.test(e)}function is_identifier_string(e,t){if(BASIC_IDENT.test(e))return !0;if(!t&&/[\ud800-\udfff]/.test(e))return !1;var n=UNICODE.ID_Start.exec(e);return !(!n||0!==n.index||(e=e.slice(n[0].length))&&(!(n=UNICODE.ID_Continue.exec(e))||n[0].length!==e.length))}function parse_js_number(e,t=!0){if(!t&&e.includes("e"))return NaN;if(RE_HEX_NUMBER.test(e))return parseInt(e.substr(2),16);if(RE_OCT_NUMBER.test(e))return parseInt(e.substr(1),8);if(RE_ES6_OCT_NUMBER.test(e))return parseInt(e.substr(2),8);if(RE_BIN_NUMBER.test(e))return parseInt(e.substr(2),2);if(RE_DEC_NUMBER.test(e))return parseFloat(e);var n=parseFloat(e);return n==e?n:void 0}class JS_Parse_Error extends Error{constructor(e,t,n,o,i){super(),this.name="SyntaxError",this.message=e,this.filename=t,this.line=n,this.col=o,this.pos=i;}}function js_error(e,t,n,o,i){throw new JS_Parse_Error(e,t,n,o,i)}function is_token(e,t,n){return e.type==t&&(null==n||e.value==n)}var EX_EOF={};function tokenizer$1(e,t,n,o){var i={text:e,filename:t,pos:0,tokpos:0,line:1,tokline:0,col:0,tokcol:0,newline_before:!1,regex_allowed:!1,brace_counter:0,template_braces:[],comments_before:[],directives:{},directive_stack:[]};function r(){return get_full_char(i.text,i.pos)}function a(){if(46!==i.text.charCodeAt(i.pos+1))return !1;const e=i.text.charCodeAt(i.pos+2);return e<48||e>57}function s(e,t){var n=get_full_char(i.text,i.pos++);if(e&&!n)throw EX_EOF;return NEWLINE_CHARS.has(n)?(i.newline_before=i.newline_before||!t,++i.line,i.col=0,"\r"==n&&"\n"==r()&&(++i.pos,n="\n")):(n.length>1&&(++i.pos,++i.col),++i.col),n}function u(e){for(;e--;)s();}function l(e){return i.text.substr(i.pos,e.length)==e}function _(e,t){var n=i.text.indexOf(e,i.pos);if(t&&-1==n)throw EX_EOF;return n}function c(){i.tokline=i.line,i.tokcol=i.col,i.tokpos=i.pos;}var f=!1,p=null;function d(e,n,o){i.regex_allowed="operator"==e&&!UNARY_POSTFIX.has(n)||"keyword"==e&&KEYWORDS_BEFORE_EXPRESSION.has(n)||"punc"==e&&PUNC_BEFORE_EXPRESSION.has(n)||"arrow"==e,"punc"!=e||"."!=n&&"?."!=n?o||(f=!1):f=!0;const r=i.tokline,a=i.tokcol,s=i.tokpos,u=i.newline_before,l=t;let _=[],c=[];o||(_=i.comments_before,c=i.comments_before=[]),i.newline_before=!1;const d=new AST_Token(e,n,r,a,s,u,_,c,l);return o||(p=d),d}function S(){for(;WHITESPACE_CHARS.has(r());)s();}function m(e){js_error(e,t,i.tokline,i.tokcol,i.tokpos);}function A(e){var t=!1,n=!1,o=!1,i="."==e,a=!1,u=!1,l=function(e){for(var t,n="",o=0;(t=r())&&e(t,o++);)n+=s();return n}((function(r,s){if(a)return !1;switch(r.charCodeAt(0)){case 95:return u=!0;case 98:case 66:return o=!0;case 111:case 79:case 120:case 88:return !o&&(o=!0);case 101:case 69:return !!o||!t&&(t=n=!0);case 45:return n||0==s&&!e;case 43:return n;case n=!1,46:return !(i||o||t)&&(i=!0)}return "n"===r?(a=!0,!0):RE_NUM_LITERAL.test(r)}));if(e&&(l=e+l),LATEST_RAW=l,RE_OCT_NUMBER.test(l)&&F.has_directive("use strict")&&m("Legacy octal literals are not allowed in strict mode"),u&&(l.endsWith("_")?m("Numeric separators are not allowed at the end of numeric literals"):l.includes("__")&&m("Only one underscore is allowed as numeric separator"),l=l.replace(/_/g,"")),l.endsWith("n")){const e=l.slice(0,-1),t=parse_js_number(e,RE_HEX_NUMBER.test(e));if(!i&&RE_BIG_INT.test(l)&&!isNaN(t))return d("big_int",e);m("Invalid or unexpected token");}var _=parse_js_number(l);if(!isNaN(_))return d("num",_);m("Invalid syntax: "+l);}function T(e){return e>="0"&&e<="7"}function h(e,t,n){var o=s(!0,e);switch(o.charCodeAt(0)){case 110:return "\n";case 114:return "\r";case 116:return "\t";case 98:return "\b";case 118:return "\v";case 102:return "\f";case 120:return String.fromCharCode(E(2,t));case 117:if("{"==r()){for(s(!0),"}"===r()&&m("Expecting hex-character between {}");"0"==r();)s(!0);var a,u=_("}",!0)-i.pos;return (u>6||(a=E(u,t))>1114111)&&m("Unicode reference out of bounds"),s(!0),from_char_code(a)}return String.fromCharCode(E(4,t));case 10:return "";case 13:if("\n"==r())return s(!0,e),""}return T(o)?(n&&t&&("0"===o&&!T(r())||m("Octal escape sequences are not allowed in template strings")),function(e,t){var n=r();return n>="0"&&n<="7"&&(e+=s(!0))[0]<="3"&&(n=r())>="0"&&n<="7"&&(e+=s(!0)),"0"===e?"\0":(e.length>0&&F.has_directive("use strict")&&t&&m("Legacy octal escape sequences are not allowed in strict mode"),String.fromCharCode(parseInt(e,8)))}(o,t)):o}function E(e,t){for(var n=0;e>0;--e){if(!t&&isNaN(parseInt(r(),16)))return parseInt(n,16)||"";var o=s(!0);isNaN(parseInt(o,16))&&m("Invalid hex-character pattern in string"),n+=o;}return parseInt(n,16)}var g=O("Unterminated string constant",(function(){const e=i.pos;for(var t=s(),n=[];;){var o=s(!0,!0);if("\\"==o)o=h(!0,!0);else if("\r"==o||"\n"==o)m("Unterminated string constant");else if(o==t)break;n.push(o);}var r=d("string",n.join(""));return LATEST_RAW=i.text.slice(e,i.pos),r.quote=t,r})),D=O("Unterminated template",(function(e){e&&i.template_braces.push(i.brace_counter);var t,n,o="",a="";for(s(!0,!0);"`"!=(t=s(!0,!0));){if("\r"==t)"\n"==r()&&++i.pos,t="\n";else if("$"==t&&"{"==r())return s(!0,!0),i.brace_counter++,n=d(e?"template_head":"template_substitution",o),LATEST_RAW=a,LATEST_TEMPLATE_END=!1,n;if(a+=t,"\\"==t){var u=i.pos;t=h(!0,!(p&&("name"===p.type||"punc"===p.type&&(")"===p.value||"]"===p.value))),!0),a+=i.text.substr(u,i.pos-u);}o+=t;}return i.template_braces.pop(),n=d(e?"template_head":"template_substitution",o),LATEST_RAW=a,LATEST_TEMPLATE_END=!0,n}));function b(e){var t,n=i.regex_allowed,o=function(){for(var e=i.text,t=i.pos,n=i.text.length;t<n;++t){var o=e[t];if(NEWLINE_CHARS.has(o))return t}return -1}();return -1==o?(t=i.text.substr(i.pos),i.pos=i.text.length):(t=i.text.substring(i.pos,o),i.pos=o),i.col=i.tokcol+(i.pos-i.tokpos),i.comments_before.push(d(e,t,!0)),i.regex_allowed=n,F}var y=O("Unterminated multiline comment",(function(){var e=i.regex_allowed,t=_("*/",!0),n=i.text.substring(i.pos,t).replace(/\r\n|\r|\u2028|\u2029/g,"\n");return u(get_full_char_length(n)+2),i.comments_before.push(d("comment2",n,!0)),i.newline_before=i.newline_before||n.includes("\n"),i.regex_allowed=e,F})),v=O("Unterminated identifier name",(function(){var e,t=[],n=!1,o=function(){return n=!0,s(),"u"!==r()&&m("Expecting UnicodeEscapeSequence -- uXXXX or u{XXXX}"),h(!1,!0)};if("\\"===(e=r()))is_identifier_start(e=o())||m("First identifier char is an invalid identifier char");else {if(!is_identifier_start(e))return "";s();}for(t.push(e);null!=(e=r());){if("\\"===(e=r()))is_identifier_char(e=o())||m("Invalid escaped identifier char");else {if(!is_identifier_char(e))break;s();}t.push(e);}const i=t.join("");return RESERVED_WORDS.has(i)&&n&&m("Escaped characters are not allowed in keywords"),i})),C=O("Unterminated regular expression",(function(e){for(var t,n=!1,o=!1;t=s(!0);)if(NEWLINE_CHARS.has(t))m("Unexpected line terminator");else if(n)e+="\\"+t,n=!1;else if("["==t)o=!0,e+=t;else if("]"==t&&o)o=!1,e+=t;else {if("/"==t&&!o)break;"\\"==t?n=!0:e+=t;}return d("regexp","/"+e+"/"+v())}));function R(e){return d("operator",function e(t){if(!r())return t;var n=t+r();return OPERATORS.has(n)?(s(),e(n)):t}(e||s()))}function k(){switch(s(),r()){case"/":return s(),b("comment1");case"*":return s(),y()}return i.regex_allowed?C(""):R("/")}function O(e,t){return function(n){try{return t(n)}catch(t){if(t!==EX_EOF)throw t;m(e);}}}function F(e){if(null!=e)return C(e);for(o&&0==i.pos&&l("#!")&&(c(),u(2),b("comment5"));;){if(S(),c(),n){if(l("\x3c!--")){u(4),b("comment3");continue}if(l("--\x3e")&&i.newline_before){u(3),b("comment4");continue}}var t=r();if(!t)return d("eof");var _=t.charCodeAt(0);switch(_){case 34:case 39:return g();case 46:return s(),is_digit(r().charCodeAt(0))?A("."):"."===r()?(s(),s(),d("expand","...")):d("punc",".");case 47:var p=k();if(p===F)continue;return p;case 61:return s(),">"===r()?(s(),d("arrow","=>")):R("=");case 63:if(!a())break;return s(),s(),d("punc","?.");case 96:return D(!0);case 123:i.brace_counter++;break;case 125:if(i.brace_counter--,i.template_braces.length>0&&i.template_braces[i.template_braces.length-1]===i.brace_counter)return D(!1)}if(is_digit(_))return A();if(PUNC_CHARS.has(t))return d("punc",s());if(OPERATOR_CHARS.has(t))return R();if(92==_||is_identifier_start(t))return T=v(),f?d("name",T):KEYWORDS_ATOM.has(T)?d("atom",T):KEYWORDS.has(T)?OPERATORS.has(T)?d("operator",T):d("keyword",T):d("name",T);if(35==_)return s(),d("privatename",v());break}var T;m("Unexpected character '"+t+"'");}return F.next=s,F.peek=r,F.context=function(e){return e&&(i=e),i},F.add_directive=function(e){i.directive_stack[i.directive_stack.length-1].push(e),void 0===i.directives[e]?i.directives[e]=1:i.directives[e]++;},F.push_directives_stack=function(){i.directive_stack.push([]);},F.pop_directives_stack=function(){for(var e=i.directive_stack[i.directive_stack.length-1],t=0;t<e.length;t++)i.directives[e[t]]--;i.directive_stack.pop();},F.has_directive=function(e){return i.directives[e]>0},F}var UNARY_PREFIX=makePredicate(["typeof","void","delete","--","++","!","~","-","+"]),UNARY_POSTFIX=makePredicate(["--","++"]),ASSIGNMENT=makePredicate(["=","+=","-=","??=","&&=","||=","/=","*=","**=","%=",">>=","<<=",">>>=","|=","^=","&="]),LOGICAL_ASSIGNMENT=makePredicate(["??=","&&=","||="]),PRECEDENCE=function(e,t){for(var n=0;n<e.length;++n)for(var o=e[n],i=0;i<o.length;++i)t[o[i]]=n+1;return t}([["||"],["??"],["&&"],["|"],["^"],["&"],["==","===","!=","!=="],["<",">","<=",">=","in","instanceof"],[">>","<<",">>>"],["+","-"],["*","/","%"],["**"]],{}),ATOMIC_START_TOKEN=makePredicate(["atom","num","big_int","string","regexp","name"]);function parse$5(e,t){const n=new WeakMap;t=defaults$1(t,{bare_returns:!1,ecma:null,expression:!1,filename:null,html5_comments:!0,module:!1,shebang:!0,strict:!1,toplevel:null},!0);var o={input:"string"==typeof e?tokenizer$1(e,t.filename,t.html5_comments,t.shebang):e,token:null,prev:null,peeked:null,in_function:0,in_async:-1,in_generator:-1,in_directives:!0,in_loop:0,labels:[]};function i(e,t){return is_token(o.token,e,t)}function r(){return o.peeked||(o.peeked=o.input())}function a(){return o.prev=o.token,o.peeked||r(),o.token=o.peeked,o.peeked=null,o.in_directives=o.in_directives&&("string"==o.token.type||i("punc",";")),o.token}function s(){return o.prev}function u(e,t,n,i){var r=o.input.context();js_error(e,r.filename,null!=t?t:r.tokline,null!=n?n:r.tokcol,null!=i?i:r.tokpos);}function l(e,t){u(t,e.line,e.col);}function _(e){null==e&&(e=o.token),l(e,"Unexpected token: "+e.type+" ("+e.value+")");}function c(e,t){if(i(e,t))return a();l(o.token,"Unexpected token "+o.token.type+" «"+o.token.value+"», expected "+e+" «"+t+"»");}function f(e){return c("punc",e)}function p(e){return e.nlb||!e.comments_before.every((e=>!e.nlb))}function d(){return !t.strict&&(i("eof")||i("punc","}")||p(o.token))}function S(){return o.in_generator===o.in_function}function m(){return o.in_async===o.in_function||0===o.in_function&&o.input.has_directive("use strict")}function A(e){i("punc",";")?a():e||d()||_();}function T(){f("(");var e=Se(!0);return f(")"),e}function h(e){return function(...t){const n=o.token,i=e(...t);return i.start=n,i.end=s(),i}}function E(){(i("operator","/")||i("operator","/="))&&(o.peeked=null,o.token=o.input(o.token.value.substr(1)));}o.token=a();var g=h((function e(n,S,h){switch(E(),o.token.type){case"string":if(o.in_directives){var g=r();!LATEST_RAW.includes("\\")&&(is_token(g,"punc",";")||is_token(g,"punc","}")||p(g)||is_token(g,"eof"))?o.input.add_directive(o.token.value):o.in_directives=!1;}var k=o.in_directives,F=b();return k&&F.body instanceof AST_String?new AST_Directive(F.body):F;case"template_head":case"num":case"big_int":case"regexp":case"operator":case"atom":return b();case"name":if("async"==o.token.value&&is_token(r(),"keyword","function"))return a(),a(),S&&u("functions are not allowed as the body of a loop"),O(AST_Defun,!1,!0,n);if("import"==o.token.value&&!is_token(r(),"punc","(")&&!is_token(r(),"punc",".")){a();var M=function(){var e,t,n=s();i("name")&&(e=re(AST_SymbolImport)),i("punc",",")&&a(),((t=J(!0))||e)&&c("name","from");var r=o.token;return "string"!==r.type&&_(),a(),new AST_Import({start:n,imported_name:e,imported_names:t,module_name:new AST_String({start:r,value:r.value,quote:r.quote,end:r}),end:o.token})}();return A(),M}return is_token(r(),"punc",":")?D():b();case"punc":switch(o.token.value){case"{":return new AST_BlockStatement({start:o.token,body:w(),end:s()});case"[":case"(":return b();case";":return o.in_directives=!1,a(),new AST_EmptyStatement;default:_();}case"keyword":switch(o.token.value){case"break":return a(),y(AST_Break);case"continue":return a(),y(AST_Continue);case"debugger":return a(),A(),new AST_Debugger;case"do":a();var I=me(e);c("keyword","while");var B=T();return A(!0),new AST_Do({body:I,condition:B});case"while":return a(),new AST_While({condition:T(),body:me((function(){return e(!1,!0)}))});case"for":return a(),function(){var e="`for await` invalid in this context",t=o.token;"name"==t.type&&"await"==t.value?(m()||l(t,e),a()):t=!1,f("(");var n=null;if(i("punc",";"))t&&l(t,e);else {n=i("keyword","var")?(a(),L(!0)):i("keyword","let")?(a(),V(!0)):i("keyword","const")?(a(),U(!0)):Se(!0,!0);var r=i("operator","in"),s=i("name","of");if(t&&!s&&l(t,e),r||s)return n instanceof AST_Definitions?n.definitions.length>1&&l(n.start,"Only one variable declaration allowed in for..in loop"):fe(n)||(n=pe(n))instanceof AST_Destructuring||l(n.start,"Invalid left-hand side in for..in loop"),a(),r?R(n):C(n,!!t)}return v(n)}();case"class":return a(),S&&u("classes are not allowed as the body of a loop"),h&&u("classes are not allowed as the body of an if"),j(AST_DefClass);case"function":return a(),S&&u("functions are not allowed as the body of a loop"),O(AST_Defun,!1,!1,n);case"if":return a(),x();case"return":0!=o.in_function||t.bare_returns||u("'return' outside of function"),a();var K=null;return i("punc",";")?a():d()||(K=Se(!0),A()),new AST_Return({value:K});case"switch":return a(),new AST_Switch({expression:T(),body:me(P)});case"throw":return a(),p(o.token)&&u("Illegal newline after 'throw'"),K=Se(!0),A(),new AST_Throw({value:K});case"try":return a(),function(){var e=w(),t=null,n=null;if(i("keyword","catch")){var r=o.token;if(a(),i("punc","{"))var l=null;else f("("),l=N(void 0,AST_SymbolCatch),f(")");t=new AST_Catch({start:r,argname:l,body:w(),end:s()});}return i("keyword","finally")&&(r=o.token,a(),n=new AST_Finally({start:r,body:w(),end:s()})),t||n||u("Missing catch/finally blocks"),new AST_Try({body:e,bcatch:t,bfinally:n})}();case"var":return a(),M=L(),A(),M;case"let":return a(),M=V(),A(),M;case"const":return a(),M=U(),A(),M;case"with":return o.input.has_directive("use strict")&&u("Strict mode may not include a with statement"),a(),new AST_With({expression:T(),body:e()});case"export":if(!is_token(r(),"punc","("))return a(),M=ee(),i("punc",";")&&A(),M}}_();}));function D(){var e=re(AST_Label);"await"===e.name&&o.in_async===o.in_function&&l(o.prev,"await cannot be used as label inside async function"),o.labels.some((t=>t.name===e.name))&&u("Label "+e.name+" defined twice"),f(":"),o.labels.push(e);var t=g();return o.labels.pop(),t instanceof AST_IterationStatement||e.references.forEach((function(t){t instanceof AST_Continue&&(t=t.label.start,u("Continue label `"+e.name+"` refers to non-IterationStatement.",t.line,t.col,t.pos));})),new AST_LabeledStatement({body:t,label:e})}function b(e){return new AST_SimpleStatement({body:(e=Se(!0),A(),e)})}function y(e){var t,n=null;d()||(n=re(AST_LabelRef,!0)),null!=n?((t=o.labels.find((e=>e.name===n.name)))||u("Undefined label "+n.name),n.thedef=t):0==o.in_loop&&u(e.TYPE+" not inside a loop or switch"),A();var i=new e({label:n});return t&&t.references.push(i),i}function v(e){f(";");var t=i("punc",";")?null:Se(!0);f(";");var n=i("punc",")")?null:Se(!0);return f(")"),new AST_For({init:e,condition:t,step:n,body:me((function(){return g(!1,!0)}))})}function C(e,t){var n=e instanceof AST_Definitions?e.definitions[0].name:null,o=Se(!0);return f(")"),new AST_ForOf({await:t,init:e,name:n,object:o,body:me((function(){return g(!1,!0)}))})}function R(e){var t=Se(!0);return f(")"),new AST_ForIn({init:e,object:t,body:me((function(){return g(!1,!0)}))})}var k=function(e,t,n){p(o.token)&&u("Unexpected newline before arrow (=>)"),c("arrow","=>");var r=I(i("punc","{"),!1,n),a=r instanceof Array&&r.length?r[r.length-1].end:r instanceof Array?e:r.end;return new AST_Arrow({start:e,end:a,async:n,argnames:t,body:r})},O=function(e,t,n,o){var r=e===AST_Defun,u=i("operator","*");u&&a();var l=i("name")?re(r?AST_SymbolDefun:AST_SymbolLambda):null;r&&!l&&(o?e=AST_Function:_()),!l||e===AST_Accessor||l instanceof AST_SymbolDeclaration||_(s());var c=[],f=I(!0,u||t,n,l,c);return new e({start:c.start,end:f.end,is_generator:u,async:n,name:l,argnames:c,body:f})};function F(e,t){var n=new Set,o=!1,i=!1,r=!1,a=!!t,s={add_parameter:function(t){if(n.has(t.value))!1===o&&(o=t),s.check_strict();else if(n.add(t.value),e)switch(t.value){case"arguments":case"eval":case"yield":a&&l(t,"Unexpected "+t.value+" identifier as parameter inside strict mode");break;default:RESERVED_WORDS.has(t.value)&&_();}},mark_default_assignment:function(e){!1===i&&(i=e);},mark_spread:function(e){!1===r&&(r=e);},mark_strict_mode:function(){a=!0;},is_strict:function(){return !1!==i||!1!==r||a},check_strict:function(){s.is_strict()&&!1!==o&&l(o,"Parameter "+o.value+" was used already");}};return s}function N(e,t){var n,r=!1;return void 0===e&&(e=F(!0,o.input.has_directive("use strict"))),i("expand","...")&&(r=o.token,e.mark_spread(o.token),a()),n=M(e,t),i("operator","=")&&!1===r&&(e.mark_default_assignment(o.token),a(),n=new AST_DefaultAssign({start:n.start,left:n,operator:"=",right:Se(!1),end:o.token})),!1!==r&&(i("punc",")")||_(),n=new AST_Expansion({start:r,expression:n,end:r})),e.check_strict(),n}function M(e,t){var n,l=[],c=!0,p=!1,d=o.token;if(void 0===e&&(e=F(!1,o.input.has_directive("use strict"))),t=void 0===t?AST_SymbolFunarg:t,i("punc","[")){for(a();!i("punc","]");){if(c?c=!1:f(","),i("expand","...")&&(p=!0,n=o.token,e.mark_spread(o.token),a()),i("punc"))switch(o.token.value){case",":l.push(new AST_Hole({start:o.token,end:o.token}));continue;case"]":break;case"[":case"{":l.push(M(e,t));break;default:_();}else i("name")?(e.add_parameter(o.token),l.push(re(t))):u("Invalid function parameter");i("operator","=")&&!1===p&&(e.mark_default_assignment(o.token),a(),l[l.length-1]=new AST_DefaultAssign({start:l[l.length-1].start,left:l[l.length-1],operator:"=",right:Se(!1),end:o.token})),p&&(i("punc","]")||u("Rest element must be last element"),l[l.length-1]=new AST_Expansion({start:n,expression:l[l.length-1],end:n}));}return f("]"),e.check_strict(),new AST_Destructuring({start:d,names:l,is_array:!0,end:s()})}if(i("punc","{")){for(a();!i("punc","}");){if(c?c=!1:f(","),i("expand","...")&&(p=!0,n=o.token,e.mark_spread(o.token),a()),i("name")&&(is_token(r(),"punc")||is_token(r(),"operator"))&&[",","}","="].includes(r().value)){e.add_parameter(o.token);var S=s(),m=re(t);p?l.push(new AST_Expansion({start:n,expression:m,end:m.end})):l.push(new AST_ObjectKeyVal({start:S,key:m.name,value:m,end:m.end}));}else {if(i("punc","}"))continue;var A=o.token,T=te();null===T?_(s()):"name"!==s().type||i("punc",":")?(f(":"),l.push(new AST_ObjectKeyVal({start:A,quote:A.quote,key:T,value:M(e,t),end:s()}))):l.push(new AST_ObjectKeyVal({start:s(),key:T,value:new t({start:s(),name:T,end:s()}),end:s()}));}p?i("punc","}")||u("Rest element must be last element"):i("operator","=")&&(e.mark_default_assignment(o.token),a(),l[l.length-1].value=new AST_DefaultAssign({start:l[l.length-1].value.start,left:l[l.length-1].value,operator:"=",right:Se(!1),end:o.token}));}return f("}"),e.check_strict(),new AST_Destructuring({start:d,names:l,is_array:!1,end:s()})}if(i("name"))return e.add_parameter(o.token),re(t);u("Invalid function parameter");}function I(e,t,n,r,s){var u=o.in_loop,l=o.labels,_=o.in_generator,c=o.in_async;if(++o.in_function,t&&(o.in_generator=o.in_function),n&&(o.in_async=o.in_function),s&&function(e){var t=F(!0,o.input.has_directive("use strict"));for(f("(");!i("punc",")");){var n=N(t);if(e.push(n),i("punc",")")||f(","),n instanceof AST_Expansion)break}a();}(s),e&&(o.in_directives=!0),o.in_loop=0,o.labels=[],e){o.input.push_directives_stack();var p=w();r&&ie(r),s&&s.forEach(ie),o.input.pop_directives_stack();}else p=[new AST_Return({start:o.token,value:Se(!1),end:o.token})];return --o.in_function,o.in_loop=u,o.labels=l,o.in_generator=_,o.in_async=c,p}function x(){var e=T(),t=g(!1,!1,!0),n=null;return i("keyword","else")&&(a(),n=g(!1,!1,!0)),new AST_If({condition:e,body:t,alternative:n})}function w(){f("{");for(var e=[];!i("punc","}");)i("eof")&&_(),e.push(g());return a(),e}function P(){f("{");for(var e,t=[],n=null,r=null;!i("punc","}");)i("eof")&&_(),i("keyword","case")?(r&&(r.end=s()),n=[],r=new AST_Case({start:(e=o.token,a(),e),expression:Se(!0),body:n}),t.push(r),f(":")):i("keyword","default")?(r&&(r.end=s()),n=[],r=new AST_Default({start:(e=o.token,a(),f(":"),e),body:n}),t.push(r)):(n||_(),n.push(g()));return r&&(r.end=s()),a(),t}function B(e,t){for(var n,r=[];;){var l="var"===t?AST_SymbolVar:"const"===t?AST_SymbolConst:"let"===t?AST_SymbolLet:null;if(i("punc","{")||i("punc","[")?n=new AST_VarDef({start:o.token,name:M(void 0,l),value:i("operator","=")?(c("operator","="),Se(!1,e)):null,end:s()}):"import"==(n=new AST_VarDef({start:o.token,name:re(l),value:i("operator","=")?(a(),Se(!1,e)):e||"const"!==t?null:u("Missing initializer in const declaration"),end:s()})).name.name&&u("Unexpected token: import"),r.push(n),!i("punc",","))break;a();}return r}var L=function(e){return new AST_Var({start:s(),definitions:B(e,"var"),end:s()})},V=function(e){return new AST_Let({start:s(),definitions:B(e,"let"),end:s()})},U=function(e){return new AST_Const({start:s(),definitions:B(e,"const"),end:s()})};function K(){var e,t=o.token;switch(t.type){case"name":e=oe(AST_SymbolRef);break;case"num":e=new AST_Number({start:t,end:t,value:t.value,raw:LATEST_RAW});break;case"big_int":e=new AST_BigInt({start:t,end:t,value:t.value});break;case"string":e=new AST_String({start:t,end:t,value:t.value,quote:t.quote});break;case"regexp":const[n,o,i]=t.value.match(/^\/(.*)\/(\w*)$/);e=new AST_RegExp({start:t,end:t,value:{source:o,flags:i}});break;case"atom":switch(t.value){case"false":e=new AST_False({start:t,end:t});break;case"true":e=new AST_True({start:t,end:t});break;case"null":e=new AST_Null({start:t,end:t});}}return a(),e}function G(e,t){var n=function(e,t){return t?new AST_DefaultAssign({start:e.start,left:e,operator:"=",right:t,end:t.end}):e};return e instanceof AST_Object?n(new AST_Destructuring({start:e.start,end:e.end,is_array:!1,names:e.properties.map((e=>G(e)))}),t):e instanceof AST_ObjectKeyVal?(e.value=G(e.value),n(e,t)):e instanceof AST_Hole?e:e instanceof AST_Destructuring?(e.names=e.names.map((e=>G(e))),n(e,t)):e instanceof AST_SymbolRef?n(new AST_SymbolFunarg({name:e.name,start:e.start,end:e.end}),t):e instanceof AST_Expansion?(e.expression=G(e.expression),n(e,t)):e instanceof AST_Array?n(new AST_Destructuring({start:e.start,end:e.end,is_array:!0,names:e.elements.map((e=>G(e)))}),t):e instanceof AST_Assign?n(G(e.left,e.right),t):e instanceof AST_DefaultAssign?(e.left=G(e.left),e):void u("Invalid function parameter",e.start.line,e.start.col)}var H=function(e,t){if(i("operator","new"))return function(e){var t=o.token;if(c("operator","new"),i("punc","."))return a(),c("name","target"),se(new AST_NewTarget({start:t,end:s()}),e);var n,r=H(!1);i("punc","(")?(a(),n=z(")",!0)):n=[];var u=new AST_New({start:t,expression:r,args:n,end:s()});return ae(u),se(u,e)}(e);if(i("operator","import"))return function(){var e=o.token;return c("operator","import"),c("punc","."),c("name","meta"),se(new AST_ImportMeta({start:e,end:s()}),!1)}();var u,l=o.token,p=i("name","async")&&"["!=(u=r()).value&&"arrow"!=u.type&&K();if(i("punc")){switch(o.token.value){case"(":if(p&&!e)break;var d=function(e,t){var n,r,u,l=[];for(f("(");!i("punc",")");)n&&_(n),i("expand","...")?(n=o.token,t&&(r=o.token),a(),l.push(new AST_Expansion({start:s(),expression:Se(),end:o.token}))):l.push(Se()),i("punc",")")||(f(","),i("punc",")")&&(u=s(),t&&(r=u)));return f(")"),e&&i("arrow","=>")?n&&u&&_(u):r&&_(r),l}(t,!p);if(t&&i("arrow","=>"))return k(l,d.map((e=>G(e))),!!p);var S=p?new AST_Call({expression:p,args:d}):1==d.length?d[0]:new AST_Sequence({expressions:d});if(S.start){const e=l.comments_before.length;if(n.set(l,e),S.start.comments_before.unshift(...l.comments_before),l.comments_before=S.start.comments_before,0==e&&l.comments_before.length>0){var m=l.comments_before[0];m.nlb||(m.nlb=l.nlb,l.nlb=!1);}l.comments_after=S.start.comments_after;}S.start=l;var A=s();return S.end&&(A.comments_before=S.end.comments_before,S.end.comments_after.push(...A.comments_after),A.comments_after=S.end.comments_after),S.end=A,S instanceof AST_Call&&ae(S),se(S,e);case"[":return se(W(),e);case"{":return se(Y(),e)}p||_();}if(t&&i("name")&&is_token(r(),"arrow")){var T=new AST_SymbolFunarg({name:o.token.value,start:l,end:l});return a(),k(l,[T],!!p)}if(i("keyword","function")){a();var h=O(AST_Function,!1,!!p);return h.start=l,h.end=s(),se(h,e)}if(p)return se(p,e);if(i("keyword","class")){a();var E=j(AST_ClassExpression);return E.start=l,E.end=s(),se(E,e)}return i("template_head")?se(X(),e):ATOMIC_START_TOKEN.has(o.token.type)?se(K(),e):void _()};function X(){var e=[],t=o.token;for(e.push(new AST_TemplateSegment({start:o.token,raw:LATEST_RAW,value:o.token.value,end:o.token}));!LATEST_TEMPLATE_END;)a(),E(),e.push(Se(!0)),e.push(new AST_TemplateSegment({start:o.token,raw:LATEST_RAW,value:o.token.value,end:o.token}));return a(),new AST_TemplateString({start:t,segments:e,end:o.token})}function z(e,t,n){for(var r=!0,u=[];!i("punc",e)&&(r?r=!1:f(","),!t||!i("punc",e));)i("punc",",")&&n?u.push(new AST_Hole({start:o.token,end:o.token})):i("expand","...")?(a(),u.push(new AST_Expansion({start:s(),expression:Se(),end:o.token}))):u.push(Se(!1));return a(),u}var W=h((function(){return f("["),new AST_Array({elements:z("]",!t.strict,!0)})})),q=h(((e,t)=>O(AST_Accessor,e,t))),Y=h((function(){var e=o.token,n=!0,r=[];for(f("{");!i("punc","}")&&(n?n=!1:f(","),t.strict||!i("punc","}"));)if("expand"!=(e=o.token).type){var u,l=te();if(i("punc",":"))null===l?_(s()):(a(),u=Se(!1));else {var c=$(l,e);if(c){r.push(c);continue}u=new AST_SymbolRef({start:s(),name:l,end:s()});}i("operator","=")&&(a(),u=new AST_Assign({start:e,left:u,operator:"=",right:Se(!1),logical:!1,end:s()})),r.push(new AST_ObjectKeyVal({start:e,quote:e.quote,key:l instanceof AST_Node?l:""+l,value:u,end:s()}));}else a(),r.push(new AST_Expansion({start:e,expression:Se(!1),end:s()}));return a(),new AST_Object({properties:r})}));function j(e){var t,n,r,u,l=[];for(o.input.push_directives_stack(),o.input.add_directive("use strict"),"name"==o.token.type&&"extends"!=o.token.value&&(r=re(e===AST_DefClass?AST_SymbolDefClass:AST_SymbolClass)),e!==AST_DefClass||r||_(),"extends"==o.token.value&&(a(),u=Se(!0)),f("{");i("punc",";");)a();for(;!i("punc","}");)for(t=o.token,(n=$(te(),t,!0))||_(),l.push(n);i("punc",";");)a();return o.input.pop_directives_stack(),a(),new e({start:t,name:r,extends:u,properties:l,end:s()})}function $(e,t,n){var r=function(e,t){return "string"==typeof e||"number"==typeof e?new AST_SymbolMethod({start:t,name:""+e,end:s()}):(null===e&&_(),e)},u="privatename"==t.type,l=!1,c=!1,f=!1,p=t;if(n&&"static"===e&&!i("punc","(")&&(c=!0,u="privatename"==(p=o.token).type,e=te()),"async"!==e||i("punc","(")||i("punc",",")||i("punc","}")||i("operator","=")||(l=!0,u="privatename"==(p=o.token).type,e=te()),null===e&&(f=!0,u="privatename"==(p=o.token).type,null===(e=te())&&_()),i("punc","("))return e=r(e,t),new(u?AST_PrivateMethod:AST_ConciseMethod)({start:t,static:c,is_generator:f,async:l,key:e,quote:e instanceof AST_SymbolMethod?p.quote:void 0,value:q(f,l),end:s()});const d=o.token;if(("get"===e||"set"===e)&&"privatename"===d.type)return a(),new("get"===e?AST_PrivateGetter:AST_PrivateSetter)({start:t,static:c,key:r(d.value,t),value:q(),end:s()});if("get"==e){if(!i("punc")||i("punc","["))return e=r(te(),t),new AST_ObjectGetter({start:t,static:c,key:e,quote:e instanceof AST_SymbolMethod?d.quote:void 0,value:q(),end:s()})}else if("set"==e&&(!i("punc")||i("punc","[")))return e=r(te(),t),new AST_ObjectSetter({start:t,static:c,key:e,quote:e instanceof AST_SymbolMethod?d.quote:void 0,value:q(),end:s()});if(n){const n=(e=>"string"==typeof e||"number"==typeof e?new AST_SymbolClassProperty({start:p,end:p,name:""+e}):(null===e&&_(),e))(e),o=n instanceof AST_SymbolClassProperty?p.quote:void 0,r=u?AST_ClassPrivateProperty:AST_ClassProperty;if(i("operator","="))return a(),new r({start:t,static:c,quote:o,key:n,value:Se(!1),end:s()});if(i("name")||i("privatename")||i("operator","*")||i("punc",";")||i("punc","}"))return new r({start:t,static:c,quote:o,key:n,end:s()})}}function Z(e){function t(e){return new e({name:te(),start:s(),end:s()})}var n,r,u=e?AST_SymbolImportForeign:AST_SymbolExportForeign,l=e?AST_SymbolImport:AST_SymbolExport,_=o.token;return e?n=t(u):r=t(l),i("name","as")?(a(),e?r=t(l):n=t(u)):e?r=new l(n):n=new u(r),new AST_NameMapping({start:_,foreign_name:n,name:r,end:s()})}function Q(e,t){var n,i=e?AST_SymbolImportForeign:AST_SymbolExportForeign,r=e?AST_SymbolImport:AST_SymbolExport,a=o.token,u=s();return t=t||new r({name:"*",start:a,end:u}),n=new i({name:"*",start:a,end:u}),new AST_NameMapping({start:a,foreign_name:n,name:t,end:u})}function J(e){var t;if(i("punc","{")){for(a(),t=[];!i("punc","}");)t.push(Z(e)),i("punc",",")&&a();a();}else if(i("operator","*")){var n;a(),e&&i("name","as")&&(a(),n=re(e?AST_SymbolImport:AST_SymbolExportForeign)),t=[Q(e,n)];}return t}function ee(){var e,t,n,u,l,c=o.token;if(i("keyword","default"))e=!0,a();else if(t=J(!1)){if(i("name","from")){a();var f=o.token;return "string"!==f.type&&_(),a(),new AST_Export({start:c,is_default:e,exported_names:t,module_name:new AST_String({start:f,value:f.value,quote:f.quote,end:f}),end:s()})}return new AST_Export({start:c,is_default:e,exported_names:t,end:s()})}return i("punc","{")||e&&(i("keyword","class")||i("keyword","function"))&&is_token(r(),"punc")?(u=Se(!1),A()):(n=g(e))instanceof AST_Definitions&&e?_(n.start):n instanceof AST_Definitions||n instanceof AST_Lambda||n instanceof AST_DefClass?l=n:n instanceof AST_SimpleStatement?u=n.body:_(n.start),new AST_Export({start:c,is_default:e,exported_value:u,exported_definition:l,end:s()})}function te(){var e=o.token;switch(e.type){case"punc":if("["===e.value){a();var t=Se(!1);return f("]"),t}_(e);case"operator":if("*"===e.value)return a(),null;["delete","in","instanceof","new","typeof","void"].includes(e.value)||_(e);case"name":case"privatename":case"string":case"num":case"big_int":case"keyword":case"atom":return a(),e.value;default:_(e);}}function ne(){var e=o.token;return "name"!=e.type&&"privatename"!=e.type&&_(),a(),e.value}function oe(e){var t=o.token.value;return new("this"==t?AST_This:"super"==t?AST_Super:e)({name:String(t),start:o.token,end:o.token})}function ie(e){var t=e.name;S()&&"yield"==t&&l(e.start,"Yield cannot be used as identifier inside generators"),o.input.has_directive("use strict")&&("yield"==t&&l(e.start,"Unexpected yield identifier inside strict mode"),e instanceof AST_SymbolDeclaration&&("arguments"==t||"eval"==t)&&l(e.start,"Unexpected "+t+" in strict mode"));}function re(e,t){if(!i("name"))return t||u("Name expected"),null;var n=oe(e);return ie(n),a(),n}function ae(e){var t=e.start,o=t.comments_before;const i=n.get(t);for(var r=null!=i?i:o.length;--r>=0;){var a=o[r];if(/[@#]__/.test(a.value)){if(/[@#]__PURE__/.test(a.value)){set_annotation(e,_PURE);break}if(/[@#]__INLINE__/.test(a.value)){set_annotation(e,_INLINE);break}if(/[@#]__NOINLINE__/.test(a.value)){set_annotation(e,_NOINLINE);break}}}}var se=function(e,t,n){var o=e.start;if(i("punc",".")){a();const r=i("privatename")?AST_DotHash:AST_Dot;return se(new r({start:o,expression:e,optional:!1,property:ne(),end:s()}),t,n)}if(i("punc","[")){a();var r=Se(!0);return f("]"),se(new AST_Sub({start:o,expression:e,optional:!1,property:r,end:s()}),t,n)}if(t&&i("punc","(")){a();var u=new AST_Call({start:o,expression:e,optional:!1,args:ue(),end:s()});return ae(u),se(u,!0,n)}if(i("punc","?.")){let n;if(a(),t&&i("punc","(")){a();const t=new AST_Call({start:o,optional:!0,expression:e,args:ue(),end:s()});ae(t),n=se(t,!0,!0);}else if(i("name")||i("privatename")){const r=i("privatename")?AST_DotHash:AST_Dot;n=se(new r({start:o,expression:e,optional:!0,property:ne(),end:s()}),t,!0);}else if(i("punc","[")){a();const i=Se(!0);f("]"),n=se(new AST_Sub({start:o,expression:e,optional:!0,property:i,end:s()}),t,!0);}return n||_(),n instanceof AST_Chain?n:new AST_Chain({start:o,expression:n,end:s()})}return i("template_head")?(n&&_(),se(new AST_PrefixedTemplateString({start:o,prefix:e,template_string:X(),end:s()}),t)):e};function ue(){for(var e=[];!i("punc",")");)i("expand","...")?(a(),e.push(new AST_Expansion({start:s(),expression:Se(!1),end:s()}))):e.push(Se(!1)),i("punc",")")||f(",");return a(),e}var le=function(e,t){var n=o.token;if("name"==n.type&&"await"==n.value&&m())return a(),m()||u("Unexpected await expression outside async function",o.prev.line,o.prev.col,o.prev.pos),new AST_Await({start:s(),end:o.token,expression:le(!0)});if(i("operator")&&UNARY_PREFIX.has(n.value)){a(),E();var r=_e(AST_UnaryPrefix,n,le(e));return r.start=n,r.end=s(),r}for(var l=H(e,t);i("operator")&&UNARY_POSTFIX.has(o.token.value)&&!p(o.token);)l instanceof AST_Arrow&&_(),(l=_e(AST_UnaryPostfix,o.token,l)).start=n,l.end=o.token,a();return l};function _e(e,t,n){var i=t.value;switch(i){case"++":case"--":fe(n)||u("Invalid use of "+i+" operator",t.line,t.col,t.pos);break;case"delete":n instanceof AST_SymbolRef&&o.input.has_directive("use strict")&&u("Calling delete on expression not allowed in strict mode",n.start.line,n.start.col,n.start.pos);}return new e({operator:i,expression:n})}var ce=function(e,t,n){var r=i("operator")?o.token.value:null;"in"==r&&n&&(r=null),"**"==r&&e instanceof AST_UnaryPrefix&&!is_token(e.start,"punc","(")&&"--"!==e.operator&&"++"!==e.operator&&_(e.start);var s=null!=r?PRECEDENCE[r]:null;if(null!=s&&(s>t||"**"===r&&t===s)){a();var u=ce(le(!0),s,n);return ce(new AST_Binary({start:e.start,left:e,operator:r,right:u,end:u.end}),t,n)}return e};function fe(e){return e instanceof AST_PropAccess||e instanceof AST_SymbolRef}function pe(e){if(e instanceof AST_Object)e=new AST_Destructuring({start:e.start,names:e.properties.map(pe),is_array:!1,end:e.end});else if(e instanceof AST_Array){for(var t=[],n=0;n<e.elements.length;n++)e.elements[n]instanceof AST_Expansion&&(n+1!==e.elements.length&&l(e.elements[n].start,"Spread must the be last element in destructuring array"),e.elements[n].expression=pe(e.elements[n].expression)),t.push(pe(e.elements[n]));e=new AST_Destructuring({start:e.start,names:t,is_array:!0,end:e.end});}else e instanceof AST_ObjectProperty?e.value=pe(e.value):e instanceof AST_Assign&&(e=new AST_DefaultAssign({start:e.start,left:e.left,operator:"=",right:e.right,end:e.end}));return e}var de=function(e){E();var t=o.token;if("name"==t.type&&"yield"==t.value){if(S())return a(),function(){S()||u("Unexpected yield expression outside generator function",o.prev.line,o.prev.col,o.prev.pos);var e=o.token,t=!1,n=!0;return d()||i("punc")&&PUNC_AFTER_EXPRESSION.has(o.token.value)?n=!1:i("operator","*")&&(t=!0,a()),new AST_Yield({start:e,is_star:t,expression:n?Se():null,end:s()})}();o.input.has_directive("use strict")&&l(o.token,"Unexpected yield identifier inside strict mode");}var n=function(e){var t=o.token,n=function(e){return ce(le(!0,!0),0,e)}(e);if(i("operator","?")){a();var r=Se(!1);return f(":"),new AST_Conditional({start:t,condition:n,consequent:r,alternative:Se(!1,e),end:s()})}return n}(e),r=o.token.value;if(i("operator")&&ASSIGNMENT.has(r)){if(fe(n)||(n=pe(n))instanceof AST_Destructuring)return a(),new AST_Assign({start:t,left:n,operator:r,right:de(e),logical:LOGICAL_ASSIGNMENT.has(r),end:s()});u("Invalid assignment");}return n},Se=function(e,t){for(var n=o.token,s=[];s.push(de(t)),e&&i("punc",",");)a(),e=!0;return 1==s.length?s[0]:new AST_Sequence({start:n,expressions:s,end:r()})};function me(e){++o.in_loop;var t=e();return --o.in_loop,t}return t.expression?Se(!0):function(){var e=o.token,n=[];for(o.input.push_directives_stack(),t.module&&o.input.add_directive("use strict");!i("eof");)n.push(g());o.input.pop_directives_stack();var r=s(),a=t.toplevel;return a?(a.body=a.body.concat(n),a.end=r):a=new AST_Toplevel({start:e,body:n,end:r}),a}()}function DEFNODE(e,t,n,o=AST_Node){var i=t=t?t.split(/\s+/):[];o&&o.PROPS&&(t=t.concat(o.PROPS));for(var r="return function AST_"+e+"(props){ if (props) { ",a=t.length;--a>=0;)r+="this."+t[a]+" = props."+t[a]+";";const s=o&&Object.create(o.prototype);(s&&s.initialize||n&&n.initialize)&&(r+="this.initialize();"),r+="}",r+="this.flags = 0;",r+="}";var u=new Function(r)();if(s&&(u.prototype=s,u.BASE=o),o&&o.SUBCLASSES.push(u),u.prototype.CTOR=u,u.prototype.constructor=u,u.PROPS=t||null,u.SELF_PROPS=i,u.SUBCLASSES=[],e&&(u.prototype.TYPE=u.TYPE=e),n)for(a in n)HOP(n,a)&&("$"===a[0]?u[a.substr(1)]=n[a]:u.prototype[a]=n[a]);return u.DEFMETHOD=function(e,t){this.prototype[e]=t;},u}const has_tok_flag=(e,t)=>Boolean(e.flags&t),set_tok_flag=(e,t,n)=>{n?e.flags|=t:e.flags&=~t;};class AST_Token{constructor(e,t,n,o,i,r,a,s,u){this.flags=r?1:0,this.type=e,this.value=t,this.line=n,this.col=o,this.pos=i,this.comments_before=a,this.comments_after=s,this.file=u,Object.seal(this);}get nlb(){return has_tok_flag(this,1)}set nlb(e){set_tok_flag(this,1,e);}get quote(){return has_tok_flag(this,4)?has_tok_flag(this,2)?"'":'"':""}set quote(e){set_tok_flag(this,2,"'"===e),set_tok_flag(this,4,!!e);}}var AST_Node=DEFNODE("Node","start end",{_clone:function(e){if(e){var t=this.clone();return t.transform(new TreeTransformer((function(e){if(e!==t)return e.clone(!0)})))}return new this.CTOR(this)},clone:function(e){return this._clone(e)},$documentation:"Base class of all AST nodes",$propdoc:{start:"[AST_Token] The first token of this node",end:"[AST_Token] The last token of this node"},_walk:function(e){return e._visit(this)},walk:function(e){return this._walk(e)},_children_backwards:()=>{}},null),AST_Statement=DEFNODE("Statement",null,{$documentation:"Base class of all statements"}),AST_Debugger=DEFNODE("Debugger",null,{$documentation:"Represents a debugger statement"},AST_Statement),AST_Directive=DEFNODE("Directive","value quote",{$documentation:'Represents a directive, like "use strict";',$propdoc:{value:"[string] The value of this directive as a plain string (it's not an AST_String!)",quote:"[string] the original quote character"}},AST_Statement),AST_SimpleStatement=DEFNODE("SimpleStatement","body",{$documentation:"A statement consisting of an expression, i.e. a = 1 + 2",$propdoc:{body:"[AST_Node] an expression node (should not be instanceof AST_Statement)"},_walk:function(e){return e._visit(this,(function(){this.body._walk(e);}))},_children_backwards(e){e(this.body);}},AST_Statement);function walk_body(e,t){const n=e.body;for(var o=0,i=n.length;o<i;o++)n[o]._walk(t);}function clone_block_scope(e){var t=this._clone(e);return this.block_scope&&(t.block_scope=this.block_scope.clone()),t}var AST_Block=DEFNODE("Block","body block_scope",{$documentation:"A body of statements (usually braced)",$propdoc:{body:"[AST_Statement*] an array of statements",block_scope:"[AST_Scope] the block scope"},_walk:function(e){return e._visit(this,(function(){walk_body(this,e);}))},_children_backwards(e){let t=this.body.length;for(;t--;)e(this.body[t]);},clone:clone_block_scope},AST_Statement),AST_BlockStatement=DEFNODE("BlockStatement",null,{$documentation:"A block statement"},AST_Block),AST_EmptyStatement=DEFNODE("EmptyStatement",null,{$documentation:"The empty statement (empty block or simply a semicolon)"},AST_Statement),AST_StatementWithBody=DEFNODE("StatementWithBody","body",{$documentation:"Base class for all statements that contain one nested body: `For`, `ForIn`, `Do`, `While`, `With`",$propdoc:{body:"[AST_Statement] the body; this should always be present, even if it's an AST_EmptyStatement"}},AST_Statement),AST_LabeledStatement=DEFNODE("LabeledStatement","label",{$documentation:"Statement with a label",$propdoc:{label:"[AST_Label] a label definition"},_walk:function(e){return e._visit(this,(function(){this.label._walk(e),this.body._walk(e);}))},_children_backwards(e){e(this.body),e(this.label);},clone:function(e){var t=this._clone(e);if(e){var n=t.label,o=this.label;t.walk(new TreeWalker((function(e){e instanceof AST_LoopControl&&e.label&&e.label.thedef===o&&(e.label.thedef=n,n.references.push(e));})));}return t}},AST_StatementWithBody),AST_IterationStatement=DEFNODE("IterationStatement","block_scope",{$documentation:"Internal class. All loops inherit from it.",$propdoc:{block_scope:"[AST_Scope] the block scope for this iteration statement."},clone:clone_block_scope},AST_StatementWithBody),AST_DWLoop=DEFNODE("DWLoop","condition",{$documentation:"Base class for do/while statements",$propdoc:{condition:"[AST_Node] the loop condition. Should not be instanceof AST_Statement"}},AST_IterationStatement),AST_Do=DEFNODE("Do",null,{$documentation:"A `do` statement",_walk:function(e){return e._visit(this,(function(){this.body._walk(e),this.condition._walk(e);}))},_children_backwards(e){e(this.condition),e(this.body);}},AST_DWLoop),AST_While=DEFNODE("While",null,{$documentation:"A `while` statement",_walk:function(e){return e._visit(this,(function(){this.condition._walk(e),this.body._walk(e);}))},_children_backwards(e){e(this.body),e(this.condition);}},AST_DWLoop),AST_For=DEFNODE("For","init condition step",{$documentation:"A `for` statement",$propdoc:{init:"[AST_Node?] the `for` initialization code, or null if empty",condition:"[AST_Node?] the `for` termination clause, or null if empty",step:"[AST_Node?] the `for` update clause, or null if empty"},_walk:function(e){return e._visit(this,(function(){this.init&&this.init._walk(e),this.condition&&this.condition._walk(e),this.step&&this.step._walk(e),this.body._walk(e);}))},_children_backwards(e){e(this.body),this.step&&e(this.step),this.condition&&e(this.condition),this.init&&e(this.init);}},AST_IterationStatement),AST_ForIn=DEFNODE("ForIn","init object",{$documentation:"A `for ... in` statement",$propdoc:{init:"[AST_Node] the `for/in` initialization code",object:"[AST_Node] the object that we're looping through"},_walk:function(e){return e._visit(this,(function(){this.init._walk(e),this.object._walk(e),this.body._walk(e);}))},_children_backwards(e){e(this.body),this.object&&e(this.object),this.init&&e(this.init);}},AST_IterationStatement),AST_ForOf=DEFNODE("ForOf","await",{$documentation:"A `for ... of` statement"},AST_ForIn),AST_With=DEFNODE("With","expression",{$documentation:"A `with` statement",$propdoc:{expression:"[AST_Node] the `with` expression"},_walk:function(e){return e._visit(this,(function(){this.expression._walk(e),this.body._walk(e);}))},_children_backwards(e){e(this.body),e(this.expression);}},AST_StatementWithBody),AST_Scope=DEFNODE("Scope","variables functions uses_with uses_eval parent_scope enclosed cname",{$documentation:"Base class for all statements introducing a lexical scope",$propdoc:{variables:"[Map/S] a map of name -> SymbolDef for all variables/functions defined in this scope",functions:"[Map/S] like `variables`, but only lists function declarations",uses_with:"[boolean/S] tells whether this scope uses the `with` statement",uses_eval:"[boolean/S] tells whether this scope contains a direct call to the global `eval`",parent_scope:"[AST_Scope?/S] link to the parent scope",enclosed:"[SymbolDef*/S] a list of all symbol definitions that are accessed from this scope or any subscopes",cname:"[integer/S] current index for mangling variables (used internally by the mangler)"},get_defun_scope:function(){for(var e=this;e.is_block_scope();)e=e.parent_scope;return e},clone:function(e,t){var n=this._clone(e);return e&&this.variables&&t&&!this._block_scope?n.figure_out_scope({},{toplevel:t,parent_scope:this.parent_scope}):(this.variables&&(n.variables=new Map(this.variables)),this.functions&&(n.functions=new Map(this.functions)),this.enclosed&&(n.enclosed=this.enclosed.slice()),this._block_scope&&(n._block_scope=this._block_scope)),n},pinned:function(){return this.uses_eval||this.uses_with}},AST_Block),AST_Toplevel=DEFNODE("Toplevel","globals",{$documentation:"The toplevel scope",$propdoc:{globals:"[Map/S] a map of name -> SymbolDef for all undeclared names"},wrap_commonjs:function(e){var t=this.body,n="(function(exports){'$ORIG';})(typeof "+e+"=='undefined'?("+e+"={}):"+e+");";return (n=parse$5(n)).transform(new TreeTransformer((function(e){if(e instanceof AST_Directive&&"$ORIG"==e.value)return MAP.splice(t)})))},wrap_enclose:function(e){"string"!=typeof e&&(e="");var t=e.indexOf(":");t<0&&(t=e.length);var n=this.body;return parse$5(["(function(",e.slice(0,t),'){"$ORIG"})(',e.slice(t+1),")"].join("")).transform(new TreeTransformer((function(e){if(e instanceof AST_Directive&&"$ORIG"==e.value)return MAP.splice(n)})))}},AST_Scope),AST_Expansion=DEFNODE("Expansion","expression",{$documentation:"An expandible argument, such as ...rest, a splat, such as [1,2,...all], or an expansion in a variable declaration, such as var [first, ...rest] = list",$propdoc:{expression:"[AST_Node] the thing to be expanded"},_walk:function(e){return e._visit(this,(function(){this.expression.walk(e);}))},_children_backwards(e){e(this.expression);}}),AST_Lambda=DEFNODE("Lambda","name argnames uses_arguments is_generator async",{$documentation:"Base class for functions",$propdoc:{name:"[AST_SymbolDeclaration?] the name of this function",argnames:"[AST_SymbolFunarg|AST_Destructuring|AST_Expansion|AST_DefaultAssign*] array of function arguments, destructurings, or expanding arguments",uses_arguments:"[boolean/S] tells whether this function accesses the arguments array",is_generator:"[boolean] is this a generator method",async:"[boolean] is this method async"},args_as_names:function(){for(var e=[],t=0;t<this.argnames.length;t++)this.argnames[t]instanceof AST_Destructuring?e.push(...this.argnames[t].all_symbols()):e.push(this.argnames[t]);return e},_walk:function(e){return e._visit(this,(function(){this.name&&this.name._walk(e);for(var t=this.argnames,n=0,o=t.length;n<o;n++)t[n]._walk(e);walk_body(this,e);}))},_children_backwards(e){let t=this.body.length;for(;t--;)e(this.body[t]);for(t=this.argnames.length;t--;)e(this.argnames[t]);this.name&&e(this.name);},is_braceless(){return this.body[0]instanceof AST_Return&&this.body[0].value}},AST_Scope),AST_Accessor=DEFNODE("Accessor",null,{$documentation:"A setter/getter function. The `name` property is always null."},AST_Lambda),AST_Function=DEFNODE("Function",null,{$documentation:"A function expression"},AST_Lambda),AST_Arrow=DEFNODE("Arrow",null,{$documentation:"An ES6 Arrow function ((a) => b)"},AST_Lambda),AST_Defun=DEFNODE("Defun",null,{$documentation:"A function definition"},AST_Lambda),AST_Destructuring=DEFNODE("Destructuring","names is_array",{$documentation:"A destructuring of several names. Used in destructuring assignment and with destructuring function argument names",$propdoc:{names:"[AST_Node*] Array of properties or elements",is_array:"[Boolean] Whether the destructuring represents an object or array"},_walk:function(e){return e._visit(this,(function(){this.names.forEach((function(t){t._walk(e);}));}))},_children_backwards(e){let t=this.names.length;for(;t--;)e(this.names[t]);},all_symbols:function(){var e=[];return this.walk(new TreeWalker((function(t){t instanceof AST_Symbol&&e.push(t);}))),e}}),AST_PrefixedTemplateString=DEFNODE("PrefixedTemplateString","template_string prefix",{$documentation:"A templatestring with a prefix, such as String.raw`foobarbaz`",$propdoc:{template_string:"[AST_TemplateString] The template string",prefix:"[AST_Node] The prefix, which will get called."},_walk:function(e){return e._visit(this,(function(){this.prefix._walk(e),this.template_string._walk(e);}))},_children_backwards(e){e(this.template_string),e(this.prefix);}}),AST_TemplateString=DEFNODE("TemplateString","segments",{$documentation:"A template string literal",$propdoc:{segments:"[AST_Node*] One or more segments, starting with AST_TemplateSegment. AST_Node may follow AST_TemplateSegment, but each AST_Node must be followed by AST_TemplateSegment."},_walk:function(e){return e._visit(this,(function(){this.segments.forEach((function(t){t._walk(e);}));}))},_children_backwards(e){let t=this.segments.length;for(;t--;)e(this.segments[t]);}}),AST_TemplateSegment=DEFNODE("TemplateSegment","value raw",{$documentation:"A segment of a template string literal",$propdoc:{value:"Content of the segment",raw:"Raw source of the segment"}}),AST_Jump=DEFNODE("Jump",null,{$documentation:"Base class for “jumps” (for now that's `return`, `throw`, `break` and `continue`)"},AST_Statement),AST_Exit=DEFNODE("Exit","value",{$documentation:"Base class for “exits” (`return` and `throw`)",$propdoc:{value:"[AST_Node?] the value returned or thrown by this statement; could be null for AST_Return"},_walk:function(e){return e._visit(this,this.value&&function(){this.value._walk(e);})},_children_backwards(e){this.value&&e(this.value);}},AST_Jump),AST_Return=DEFNODE("Return",null,{$documentation:"A `return` statement"},AST_Exit),AST_Throw=DEFNODE("Throw",null,{$documentation:"A `throw` statement"},AST_Exit),AST_LoopControl=DEFNODE("LoopControl","label",{$documentation:"Base class for loop control statements (`break` and `continue`)",$propdoc:{label:"[AST_LabelRef?] the label, or null if none"},_walk:function(e){return e._visit(this,this.label&&function(){this.label._walk(e);})},_children_backwards(e){this.label&&e(this.label);}},AST_Jump),AST_Break=DEFNODE("Break",null,{$documentation:"A `break` statement"},AST_LoopControl),AST_Continue=DEFNODE("Continue",null,{$documentation:"A `continue` statement"},AST_LoopControl),AST_Await=DEFNODE("Await","expression",{$documentation:"An `await` statement",$propdoc:{expression:"[AST_Node] the mandatory expression being awaited"},_walk:function(e){return e._visit(this,(function(){this.expression._walk(e);}))},_children_backwards(e){e(this.expression);}}),AST_Yield=DEFNODE("Yield","expression is_star",{$documentation:"A `yield` statement",$propdoc:{expression:"[AST_Node?] the value returned or thrown by this statement; could be null (representing undefined) but only when is_star is set to false",is_star:"[Boolean] Whether this is a yield or yield* statement"},_walk:function(e){return e._visit(this,this.expression&&function(){this.expression._walk(e);})},_children_backwards(e){this.expression&&e(this.expression);}}),AST_If=DEFNODE("If","condition alternative",{$documentation:"A `if` statement",$propdoc:{condition:"[AST_Node] the `if` condition",alternative:"[AST_Statement?] the `else` part, or null if not present"},_walk:function(e){return e._visit(this,(function(){this.condition._walk(e),this.body._walk(e),this.alternative&&this.alternative._walk(e);}))},_children_backwards(e){this.alternative&&e(this.alternative),e(this.body),e(this.condition);}},AST_StatementWithBody),AST_Switch=DEFNODE("Switch","expression",{$documentation:"A `switch` statement",$propdoc:{expression:"[AST_Node] the `switch` “discriminant”"},_walk:function(e){return e._visit(this,(function(){this.expression._walk(e),walk_body(this,e);}))},_children_backwards(e){let t=this.body.length;for(;t--;)e(this.body[t]);e(this.expression);}},AST_Block),AST_SwitchBranch=DEFNODE("SwitchBranch",null,{$documentation:"Base class for `switch` branches"},AST_Block),AST_Default=DEFNODE("Default",null,{$documentation:"A `default` switch branch"},AST_SwitchBranch),AST_Case=DEFNODE("Case","expression",{$documentation:"A `case` switch branch",$propdoc:{expression:"[AST_Node] the `case` expression"},_walk:function(e){return e._visit(this,(function(){this.expression._walk(e),walk_body(this,e);}))},_children_backwards(e){let t=this.body.length;for(;t--;)e(this.body[t]);e(this.expression);}},AST_SwitchBranch),AST_Try=DEFNODE("Try","bcatch bfinally",{$documentation:"A `try` statement",$propdoc:{bcatch:"[AST_Catch?] the catch block, or null if not present",bfinally:"[AST_Finally?] the finally block, or null if not present"},_walk:function(e){return e._visit(this,(function(){walk_body(this,e),this.bcatch&&this.bcatch._walk(e),this.bfinally&&this.bfinally._walk(e);}))},_children_backwards(e){this.bfinally&&e(this.bfinally),this.bcatch&&e(this.bcatch);let t=this.body.length;for(;t--;)e(this.body[t]);}},AST_Block),AST_Catch=DEFNODE("Catch","argname",{$documentation:"A `catch` node; only makes sense as part of a `try` statement",$propdoc:{argname:"[AST_SymbolCatch|AST_Destructuring|AST_Expansion|AST_DefaultAssign] symbol for the exception"},_walk:function(e){return e._visit(this,(function(){this.argname&&this.argname._walk(e),walk_body(this,e);}))},_children_backwards(e){let t=this.body.length;for(;t--;)e(this.body[t]);this.argname&&e(this.argname);}},AST_Block),AST_Finally=DEFNODE("Finally",null,{$documentation:"A `finally` node; only makes sense as part of a `try` statement"},AST_Block),AST_Definitions=DEFNODE("Definitions","definitions",{$documentation:"Base class for `var` or `const` nodes (variable declarations/initializations)",$propdoc:{definitions:"[AST_VarDef*] array of variable definitions"},_walk:function(e){return e._visit(this,(function(){for(var t=this.definitions,n=0,o=t.length;n<o;n++)t[n]._walk(e);}))},_children_backwards(e){let t=this.definitions.length;for(;t--;)e(this.definitions[t]);}},AST_Statement),AST_Var=DEFNODE("Var",null,{$documentation:"A `var` statement"},AST_Definitions),AST_Let=DEFNODE("Let",null,{$documentation:"A `let` statement"},AST_Definitions),AST_Const=DEFNODE("Const",null,{$documentation:"A `const` statement"},AST_Definitions),AST_VarDef=DEFNODE("VarDef","name value",{$documentation:"A variable declaration; only appears in a AST_Definitions node",$propdoc:{name:"[AST_Destructuring|AST_SymbolConst|AST_SymbolLet|AST_SymbolVar] name of the variable",value:"[AST_Node?] initializer, or null of there's no initializer"},_walk:function(e){return e._visit(this,(function(){this.name._walk(e),this.value&&this.value._walk(e);}))},_children_backwards(e){this.value&&e(this.value),e(this.name);}}),AST_NameMapping=DEFNODE("NameMapping","foreign_name name",{$documentation:"The part of the export/import statement that declare names from a module.",$propdoc:{foreign_name:"[AST_SymbolExportForeign|AST_SymbolImportForeign] The name being exported/imported (as specified in the module)",name:"[AST_SymbolExport|AST_SymbolImport] The name as it is visible to this module."},_walk:function(e){return e._visit(this,(function(){this.foreign_name._walk(e),this.name._walk(e);}))},_children_backwards(e){e(this.name),e(this.foreign_name);}}),AST_Import=DEFNODE("Import","imported_name imported_names module_name",{$documentation:"An `import` statement",$propdoc:{imported_name:"[AST_SymbolImport] The name of the variable holding the module's default export.",imported_names:"[AST_NameMapping*] The names of non-default imported variables",module_name:"[AST_String] String literal describing where this module came from"},_walk:function(e){return e._visit(this,(function(){this.imported_name&&this.imported_name._walk(e),this.imported_names&&this.imported_names.forEach((function(t){t._walk(e);})),this.module_name._walk(e);}))},_children_backwards(e){if(e(this.module_name),this.imported_names){let t=this.imported_names.length;for(;t--;)e(this.imported_names[t]);}this.imported_name&&e(this.imported_name);}}),AST_ImportMeta=DEFNODE("ImportMeta",null,{$documentation:"A reference to import.meta"}),AST_Export=DEFNODE("Export","exported_definition exported_value is_default exported_names module_name",{$documentation:"An `export` statement",$propdoc:{exported_definition:"[AST_Defun|AST_Definitions|AST_DefClass?] An exported definition",exported_value:"[AST_Node?] An exported value",exported_names:"[AST_NameMapping*?] List of exported names",module_name:"[AST_String?] Name of the file to load exports from",is_default:"[Boolean] Whether this is the default exported value of this module"},_walk:function(e){return e._visit(this,(function(){this.exported_definition&&this.exported_definition._walk(e),this.exported_value&&this.exported_value._walk(e),this.exported_names&&this.exported_names.forEach((function(t){t._walk(e);})),this.module_name&&this.module_name._walk(e);}))},_children_backwards(e){if(this.module_name&&e(this.module_name),this.exported_names){let t=this.exported_names.length;for(;t--;)e(this.exported_names[t]);}this.exported_value&&e(this.exported_value),this.exported_definition&&e(this.exported_definition);}},AST_Statement),AST_Call=DEFNODE("Call","expression args optional _annotations",{$documentation:"A function call expression",$propdoc:{expression:"[AST_Node] expression to invoke as function",args:"[AST_Node*] array of arguments",optional:"[boolean] whether this is an optional call (IE ?.() )",_annotations:"[number] bitfield containing information about the call"},initialize(){null==this._annotations&&(this._annotations=0);},_walk(e){return e._visit(this,(function(){for(var t=this.args,n=0,o=t.length;n<o;n++)t[n]._walk(e);this.expression._walk(e);}))},_children_backwards(e){let t=this.args.length;for(;t--;)e(this.args[t]);e(this.expression);}}),AST_New=DEFNODE("New",null,{$documentation:"An object instantiation. Derives from a function call since it has exactly the same properties"},AST_Call),AST_Sequence=DEFNODE("Sequence","expressions",{$documentation:"A sequence expression (comma-separated expressions)",$propdoc:{expressions:"[AST_Node*] array of expressions (at least two)"},_walk:function(e){return e._visit(this,(function(){this.expressions.forEach((function(t){t._walk(e);}));}))},_children_backwards(e){let t=this.expressions.length;for(;t--;)e(this.expressions[t]);}}),AST_PropAccess=DEFNODE("PropAccess","expression property optional",{$documentation:'Base class for property access expressions, i.e. `a.foo` or `a["foo"]`',$propdoc:{expression:"[AST_Node] the “container” expression",property:"[AST_Node|string] the property to access. For AST_Dot & AST_DotHash this is always a plain string, while for AST_Sub it's an arbitrary AST_Node",optional:"[boolean] whether this is an optional property access (IE ?.)"}}),AST_Dot=DEFNODE("Dot","quote",{$documentation:"A dotted property access expression",$propdoc:{quote:"[string] the original quote character when transformed from AST_Sub"},_walk:function(e){return e._visit(this,(function(){this.expression._walk(e);}))},_children_backwards(e){e(this.expression);}},AST_PropAccess),AST_DotHash=DEFNODE("DotHash","",{$documentation:"A dotted property access to a private property",_walk:function(e){return e._visit(this,(function(){this.expression._walk(e);}))},_children_backwards(e){e(this.expression);}},AST_PropAccess),AST_Sub=DEFNODE("Sub",null,{$documentation:'Index-style property access, i.e. `a["foo"]`',_walk:function(e){return e._visit(this,(function(){this.expression._walk(e),this.property._walk(e);}))},_children_backwards(e){e(this.property),e(this.expression);}},AST_PropAccess),AST_Chain=DEFNODE("Chain","expression",{$documentation:"A chain expression like a?.b?.(c)?.[d]",$propdoc:{expression:"[AST_Call|AST_Dot|AST_DotHash|AST_Sub] chain element."},_walk:function(e){return e._visit(this,(function(){this.expression._walk(e);}))},_children_backwards(e){e(this.expression);}}),AST_Unary=DEFNODE("Unary","operator expression",{$documentation:"Base class for unary expressions",$propdoc:{operator:"[string] the operator",expression:"[AST_Node] expression that this unary operator applies to"},_walk:function(e){return e._visit(this,(function(){this.expression._walk(e);}))},_children_backwards(e){e(this.expression);}}),AST_UnaryPrefix=DEFNODE("UnaryPrefix",null,{$documentation:"Unary prefix expression, i.e. `typeof i` or `++i`"},AST_Unary),AST_UnaryPostfix=DEFNODE("UnaryPostfix",null,{$documentation:"Unary postfix expression, i.e. `i++`"},AST_Unary),AST_Binary=DEFNODE("Binary","operator left right",{$documentation:"Binary expression, i.e. `a + b`",$propdoc:{left:"[AST_Node] left-hand side expression",operator:"[string] the operator",right:"[AST_Node] right-hand side expression"},_walk:function(e){return e._visit(this,(function(){this.left._walk(e),this.right._walk(e);}))},_children_backwards(e){e(this.right),e(this.left);}}),AST_Conditional=DEFNODE("Conditional","condition consequent alternative",{$documentation:"Conditional expression using the ternary operator, i.e. `a ? b : c`",$propdoc:{condition:"[AST_Node]",consequent:"[AST_Node]",alternative:"[AST_Node]"},_walk:function(e){return e._visit(this,(function(){this.condition._walk(e),this.consequent._walk(e),this.alternative._walk(e);}))},_children_backwards(e){e(this.alternative),e(this.consequent),e(this.condition);}}),AST_Assign=DEFNODE("Assign","logical",{$documentation:"An assignment expression — `a = b + 5`",$propdoc:{logical:"Whether it's a logical assignment"}},AST_Binary),AST_DefaultAssign=DEFNODE("DefaultAssign",null,{$documentation:"A default assignment expression like in `(a = 3) => a`"},AST_Binary),AST_Array=DEFNODE("Array","elements",{$documentation:"An array literal",$propdoc:{elements:"[AST_Node*] array of elements"},_walk:function(e){return e._visit(this,(function(){for(var t=this.elements,n=0,o=t.length;n<o;n++)t[n]._walk(e);}))},_children_backwards(e){let t=this.elements.length;for(;t--;)e(this.elements[t]);}}),AST_Object=DEFNODE("Object","properties",{$documentation:"An object literal",$propdoc:{properties:"[AST_ObjectProperty*] array of properties"},_walk:function(e){return e._visit(this,(function(){for(var t=this.properties,n=0,o=t.length;n<o;n++)t[n]._walk(e);}))},_children_backwards(e){let t=this.properties.length;for(;t--;)e(this.properties[t]);}}),AST_ObjectProperty=DEFNODE("ObjectProperty","key value",{$documentation:"Base class for literal object properties",$propdoc:{key:"[string|AST_Node] property name. For ObjectKeyVal this is a string. For getters, setters and computed property this is an AST_Node.",value:"[AST_Node] property value. For getters and setters this is an AST_Accessor."},_walk:function(e){return e._visit(this,(function(){this.key instanceof AST_Node&&this.key._walk(e),this.value._walk(e);}))},_children_backwards(e){e(this.value),this.key instanceof AST_Node&&e(this.key);}}),AST_ObjectKeyVal=DEFNODE("ObjectKeyVal","quote",{$documentation:"A key: value object property",$propdoc:{quote:"[string] the original quote character"},computed_key(){return this.key instanceof AST_Node}},AST_ObjectProperty),AST_PrivateSetter=DEFNODE("PrivateSetter","static",{$propdoc:{static:"[boolean] whether this is a static private setter"},$documentation:"A private setter property",computed_key:()=>!1},AST_ObjectProperty),AST_PrivateGetter=DEFNODE("PrivateGetter","static",{$propdoc:{static:"[boolean] whether this is a static private getter"},$documentation:"A private getter property",computed_key:()=>!1},AST_ObjectProperty),AST_ObjectSetter=DEFNODE("ObjectSetter","quote static",{$propdoc:{quote:"[string|undefined] the original quote character, if any",static:"[boolean] whether this is a static setter (classes only)"},$documentation:"An object setter property",computed_key(){return !(this.key instanceof AST_SymbolMethod)}},AST_ObjectProperty),AST_ObjectGetter=DEFNODE("ObjectGetter","quote static",{$propdoc:{quote:"[string|undefined] the original quote character, if any",static:"[boolean] whether this is a static getter (classes only)"},$documentation:"An object getter property",computed_key(){return !(this.key instanceof AST_SymbolMethod)}},AST_ObjectProperty),AST_ConciseMethod=DEFNODE("ConciseMethod","quote static is_generator async",{$propdoc:{quote:"[string|undefined] the original quote character, if any",static:"[boolean] is this method static (classes only)",is_generator:"[boolean] is this a generator method",async:"[boolean] is this method async"},$documentation:"An ES6 concise method inside an object or class",computed_key(){return !(this.key instanceof AST_SymbolMethod)}},AST_ObjectProperty),AST_PrivateMethod=DEFNODE("PrivateMethod","",{$documentation:"A private class method inside a class"},AST_ConciseMethod),AST_Class=DEFNODE("Class","name extends properties",{$propdoc:{name:"[AST_SymbolClass|AST_SymbolDefClass?] optional class name.",extends:"[AST_Node]? optional parent class",properties:"[AST_ObjectProperty*] array of properties"},$documentation:"An ES6 class",_walk:function(e){return e._visit(this,(function(){this.name&&this.name._walk(e),this.extends&&this.extends._walk(e),this.properties.forEach((t=>t._walk(e)));}))},_children_backwards(e){let t=this.properties.length;for(;t--;)e(this.properties[t]);this.extends&&e(this.extends),this.name&&e(this.name);}},AST_Scope),AST_ClassProperty=DEFNODE("ClassProperty","static quote",{$documentation:"A class property",$propdoc:{static:"[boolean] whether this is a static key",quote:"[string] which quote is being used"},_walk:function(e){return e._visit(this,(function(){this.key instanceof AST_Node&&this.key._walk(e),this.value instanceof AST_Node&&this.value._walk(e);}))},_children_backwards(e){this.value instanceof AST_Node&&e(this.value),this.key instanceof AST_Node&&e(this.key);},computed_key(){return !(this.key instanceof AST_SymbolClassProperty)}},AST_ObjectProperty),AST_ClassPrivateProperty=DEFNODE("ClassProperty","",{$documentation:"A class property for a private property"},AST_ClassProperty),AST_DefClass=DEFNODE("DefClass",null,{$documentation:"A class definition"},AST_Class),AST_ClassExpression=DEFNODE("ClassExpression",null,{$documentation:"A class expression."},AST_Class),AST_Symbol=DEFNODE("Symbol","scope name thedef",{$propdoc:{name:"[string] name of this symbol",scope:"[AST_Scope/S] the current scope (not necessarily the definition scope)",thedef:"[SymbolDef/S] the definition of this symbol"},$documentation:"Base class for all symbols"}),AST_NewTarget=DEFNODE("NewTarget",null,{$documentation:"A reference to new.target"}),AST_SymbolDeclaration=DEFNODE("SymbolDeclaration","init",{$documentation:"A declaration symbol (symbol in var/const, function name or argument, symbol in catch)"},AST_Symbol),AST_SymbolVar=DEFNODE("SymbolVar",null,{$documentation:"Symbol defining a variable"},AST_SymbolDeclaration),AST_SymbolBlockDeclaration=DEFNODE("SymbolBlockDeclaration",null,{$documentation:"Base class for block-scoped declaration symbols"},AST_SymbolDeclaration),AST_SymbolConst=DEFNODE("SymbolConst",null,{$documentation:"A constant declaration"},AST_SymbolBlockDeclaration),AST_SymbolLet=DEFNODE("SymbolLet",null,{$documentation:"A block-scoped `let` declaration"},AST_SymbolBlockDeclaration),AST_SymbolFunarg=DEFNODE("SymbolFunarg",null,{$documentation:"Symbol naming a function argument"},AST_SymbolVar),AST_SymbolDefun=DEFNODE("SymbolDefun",null,{$documentation:"Symbol defining a function"},AST_SymbolDeclaration),AST_SymbolMethod=DEFNODE("SymbolMethod",null,{$documentation:"Symbol in an object defining a method"},AST_Symbol),AST_SymbolClassProperty=DEFNODE("SymbolClassProperty",null,{$documentation:"Symbol for a class property"},AST_Symbol),AST_SymbolLambda=DEFNODE("SymbolLambda",null,{$documentation:"Symbol naming a function expression"},AST_SymbolDeclaration),AST_SymbolDefClass=DEFNODE("SymbolDefClass",null,{$documentation:"Symbol naming a class's name in a class declaration. Lexically scoped to its containing scope, and accessible within the class."},AST_SymbolBlockDeclaration),AST_SymbolClass=DEFNODE("SymbolClass",null,{$documentation:"Symbol naming a class's name. Lexically scoped to the class."},AST_SymbolDeclaration),AST_SymbolCatch=DEFNODE("SymbolCatch",null,{$documentation:"Symbol naming the exception in catch"},AST_SymbolBlockDeclaration),AST_SymbolImport=DEFNODE("SymbolImport",null,{$documentation:"Symbol referring to an imported name"},AST_SymbolBlockDeclaration),AST_SymbolImportForeign=DEFNODE("SymbolImportForeign",null,{$documentation:"A symbol imported from a module, but it is defined in the other module, and its real name is irrelevant for this module's purposes"},AST_Symbol),AST_Label=DEFNODE("Label","references",{$documentation:"Symbol naming a label (declaration)",$propdoc:{references:"[AST_LoopControl*] a list of nodes referring to this label"},initialize:function(){this.references=[],this.thedef=this;}},AST_Symbol),AST_SymbolRef=DEFNODE("SymbolRef",null,{$documentation:"Reference to some symbol (not definition/declaration)"},AST_Symbol),AST_SymbolExport=DEFNODE("SymbolExport",null,{$documentation:"Symbol referring to a name to export"},AST_SymbolRef),AST_SymbolExportForeign=DEFNODE("SymbolExportForeign",null,{$documentation:"A symbol exported from this module, but it is used in the other module, and its real name is irrelevant for this module's purposes"},AST_Symbol),AST_LabelRef=DEFNODE("LabelRef",null,{$documentation:"Reference to a label symbol"},AST_Symbol),AST_This=DEFNODE("This",null,{$documentation:"The `this` symbol"},AST_Symbol),AST_Super=DEFNODE("Super",null,{$documentation:"The `super` symbol"},AST_This),AST_Constant=DEFNODE("Constant",null,{$documentation:"Base class for all constants",getValue:function(){return this.value}}),AST_String=DEFNODE("String","value quote",{$documentation:"A string literal",$propdoc:{value:"[string] the contents of this string",quote:"[string] the original quote character"}},AST_Constant),AST_Number=DEFNODE("Number","value raw",{$documentation:"A number literal",$propdoc:{value:"[number] the numeric value",raw:"[string] numeric value as string"}},AST_Constant),AST_BigInt=DEFNODE("BigInt","value",{$documentation:"A big int literal",$propdoc:{value:"[string] big int value"}},AST_Constant),AST_RegExp=DEFNODE("RegExp","value",{$documentation:"A regexp literal",$propdoc:{value:"[RegExp] the actual regexp"}},AST_Constant),AST_Atom=DEFNODE("Atom",null,{$documentation:"Base class for atoms"},AST_Constant),AST_Null=DEFNODE("Null",null,{$documentation:"The `null` atom",value:null},AST_Atom),AST_NaN=DEFNODE("NaN",null,{$documentation:"The impossible value",value:NaN},AST_Atom),AST_Undefined=DEFNODE("Undefined",null,{$documentation:"The `undefined` value",value:void 0},AST_Atom),AST_Hole=DEFNODE("Hole",null,{$documentation:"A hole in an array",value:void 0},AST_Atom),AST_Infinity=DEFNODE("Infinity",null,{$documentation:"The `Infinity` value",value:1/0},AST_Atom),AST_Boolean=DEFNODE("Boolean",null,{$documentation:"Base class for booleans"},AST_Atom),AST_False=DEFNODE("False",null,{$documentation:"The `false` atom",value:!1},AST_Boolean),AST_True=DEFNODE("True",null,{$documentation:"The `true` atom",value:!0},AST_Boolean);function walk$3(e,t,n=[e]){const o=n.push.bind(n);for(;n.length;){const e=n.pop(),i=t(e,n);if(i){if(i===walk_abort)return !0}else e._children_backwards(o);}return !1}function walk_parent(e,t,n){const o=[e],i=o.push.bind(o),r=n?n.slice():[],a=[];let s;const u={parent:(e=0)=>-1===e?s:n&&e>=r.length?(e-=r.length,n[n.length-(e+1)]):r[r.length-(1+e)]};for(;o.length;){for(s=o.pop();a.length&&o.length==a[a.length-1];)r.pop(),a.pop();const e=t(s,u);if(e){if(e===walk_abort)return !0;continue}const n=o.length;s._children_backwards(i),o.length>n&&(r.push(s),a.push(n-1));}return !1}const walk_abort=Symbol("abort walk");class TreeWalker{constructor(e){this.visit=e,this.stack=[],this.directives=Object.create(null);}_visit(e,t){this.push(e);var n=this.visit(e,t?function(){t.call(e);}:noop);return !n&&t&&t.call(e),this.pop(),n}parent(e){return this.stack[this.stack.length-2-(e||0)]}push(e){e instanceof AST_Lambda?this.directives=Object.create(this.directives):e instanceof AST_Directive&&!this.directives[e.value]?this.directives[e.value]=e:e instanceof AST_Class&&(this.directives=Object.create(this.directives),this.directives["use strict"]||(this.directives["use strict"]=e)),this.stack.push(e);}pop(){var e=this.stack.pop();(e instanceof AST_Lambda||e instanceof AST_Class)&&(this.directives=Object.getPrototypeOf(this.directives));}self(){return this.stack[this.stack.length-1]}find_parent(e){for(var t=this.stack,n=t.length;--n>=0;){var o=t[n];if(o instanceof e)return o}}has_directive(e){var t=this.directives[e];if(t)return t;var n=this.stack[this.stack.length-1];if(n instanceof AST_Scope&&n.body)for(var o=0;o<n.body.length;++o){var i=n.body[o];if(!(i instanceof AST_Directive))break;if(i.value==e)return i}}loopcontrol_target(e){var t=this.stack;if(e.label){for(var n=t.length;--n>=0;)if((o=t[n])instanceof AST_LabeledStatement&&o.label.name==e.label.name)return o.body}else for(n=t.length;--n>=0;){var o;if((o=t[n])instanceof AST_IterationStatement||e instanceof AST_Break&&o instanceof AST_Switch)return o}}}class TreeTransformer extends TreeWalker{constructor(e,t){super(),this.before=e,this.after=t;}}const _PURE=1,_INLINE=2,_NOINLINE=4,ast=Object.freeze({__proto__:null,AST_Accessor,AST_Array,AST_Arrow,AST_Assign,AST_Atom,AST_Await,AST_BigInt,AST_Binary,AST_Block,AST_BlockStatement,AST_Boolean,AST_Break,AST_Call,AST_Case,AST_Catch,AST_Chain,AST_Class,AST_ClassExpression,AST_ClassPrivateProperty,AST_ClassProperty,AST_ConciseMethod,AST_Conditional,AST_Const,AST_Constant,AST_Continue,AST_Debugger,AST_Default,AST_DefaultAssign,AST_DefClass,AST_Definitions,AST_Defun,AST_Destructuring,AST_Directive,AST_Do,AST_Dot,AST_DotHash,AST_DWLoop,AST_EmptyStatement,AST_Exit,AST_Expansion,AST_Export,AST_False,AST_Finally,AST_For,AST_ForIn,AST_ForOf,AST_Function,AST_Hole,AST_If,AST_Import,AST_ImportMeta,AST_Infinity,AST_IterationStatement,AST_Jump,AST_Label,AST_LabeledStatement,AST_LabelRef,AST_Lambda,AST_Let,AST_LoopControl,AST_NameMapping,AST_NaN,AST_New,AST_NewTarget,AST_Node,AST_Null,AST_Number,AST_Object,AST_ObjectGetter,AST_ObjectKeyVal,AST_ObjectProperty,AST_ObjectSetter,AST_PrefixedTemplateString,AST_PrivateGetter,AST_PrivateMethod,AST_PrivateSetter,AST_PropAccess,AST_RegExp,AST_Return,AST_Scope,AST_Sequence,AST_SimpleStatement,AST_Statement,AST_StatementWithBody,AST_String,AST_Sub,AST_Super,AST_Switch,AST_SwitchBranch,AST_Symbol,AST_SymbolBlockDeclaration,AST_SymbolCatch,AST_SymbolClass,AST_SymbolClassProperty,AST_SymbolConst,AST_SymbolDeclaration,AST_SymbolDefClass,AST_SymbolDefun,AST_SymbolExport,AST_SymbolExportForeign,AST_SymbolFunarg,AST_SymbolImport,AST_SymbolImportForeign,AST_SymbolLambda,AST_SymbolLet,AST_SymbolMethod,AST_SymbolRef,AST_SymbolVar,AST_TemplateSegment,AST_TemplateString,AST_This,AST_Throw,AST_Token,AST_Toplevel,AST_True,AST_Try,AST_Unary,AST_UnaryPostfix,AST_UnaryPrefix,AST_Undefined,AST_Var,AST_VarDef,AST_While,AST_With,AST_Yield,TreeTransformer,TreeWalker,walk: walk$3,walk_abort,walk_body,walk_parent,_INLINE,_NOINLINE,_PURE});function def_transform(e,t){e.DEFMETHOD("transform",(function(e,n){let o;if(e.push(this),e.before&&(o=e.before(this,t,n)),void 0===o&&(o=this,t(o,e),e.after)){const t=e.after(o,n);void 0!==t&&(o=t);}return e.pop(),o}));}function do_list(e,t){return MAP(e,(function(e){return e.transform(t,!0)}))}function first_in_statement(e){let t=e.parent(-1);for(let n,o=0;n=e.parent(o);o++){if(n instanceof AST_Statement&&n.body===t)return !0;if(!(n instanceof AST_Sequence&&n.expressions[0]===t||"Call"===n.TYPE&&n.expression===t||n instanceof AST_PrefixedTemplateString&&n.prefix===t||n instanceof AST_Dot&&n.expression===t||n instanceof AST_Sub&&n.expression===t||n instanceof AST_Conditional&&n.condition===t||n instanceof AST_Binary&&n.left===t||n instanceof AST_UnaryPostfix&&n.expression===t))return !1;t=n;}}function left_is_object(e){return e instanceof AST_Object||(e instanceof AST_Sequence?left_is_object(e.expressions[0]):"Call"===e.TYPE?left_is_object(e.expression):e instanceof AST_PrefixedTemplateString?left_is_object(e.prefix):e instanceof AST_Dot||e instanceof AST_Sub?left_is_object(e.expression):e instanceof AST_Conditional?left_is_object(e.condition):e instanceof AST_Binary?left_is_object(e.left):e instanceof AST_UnaryPostfix&&left_is_object(e.expression))}def_transform(AST_Node,noop),def_transform(AST_LabeledStatement,(function(e,t){e.label=e.label.transform(t),e.body=e.body.transform(t);})),def_transform(AST_SimpleStatement,(function(e,t){e.body=e.body.transform(t);})),def_transform(AST_Block,(function(e,t){e.body=do_list(e.body,t);})),def_transform(AST_Do,(function(e,t){e.body=e.body.transform(t),e.condition=e.condition.transform(t);})),def_transform(AST_While,(function(e,t){e.condition=e.condition.transform(t),e.body=e.body.transform(t);})),def_transform(AST_For,(function(e,t){e.init&&(e.init=e.init.transform(t)),e.condition&&(e.condition=e.condition.transform(t)),e.step&&(e.step=e.step.transform(t)),e.body=e.body.transform(t);})),def_transform(AST_ForIn,(function(e,t){e.init=e.init.transform(t),e.object=e.object.transform(t),e.body=e.body.transform(t);})),def_transform(AST_With,(function(e,t){e.expression=e.expression.transform(t),e.body=e.body.transform(t);})),def_transform(AST_Exit,(function(e,t){e.value&&(e.value=e.value.transform(t));})),def_transform(AST_LoopControl,(function(e,t){e.label&&(e.label=e.label.transform(t));})),def_transform(AST_If,(function(e,t){e.condition=e.condition.transform(t),e.body=e.body.transform(t),e.alternative&&(e.alternative=e.alternative.transform(t));})),def_transform(AST_Switch,(function(e,t){e.expression=e.expression.transform(t),e.body=do_list(e.body,t);})),def_transform(AST_Case,(function(e,t){e.expression=e.expression.transform(t),e.body=do_list(e.body,t);})),def_transform(AST_Try,(function(e,t){e.body=do_list(e.body,t),e.bcatch&&(e.bcatch=e.bcatch.transform(t)),e.bfinally&&(e.bfinally=e.bfinally.transform(t));})),def_transform(AST_Catch,(function(e,t){e.argname&&(e.argname=e.argname.transform(t)),e.body=do_list(e.body,t);})),def_transform(AST_Definitions,(function(e,t){e.definitions=do_list(e.definitions,t);})),def_transform(AST_VarDef,(function(e,t){e.name=e.name.transform(t),e.value&&(e.value=e.value.transform(t));})),def_transform(AST_Destructuring,(function(e,t){e.names=do_list(e.names,t);})),def_transform(AST_Lambda,(function(e,t){e.name&&(e.name=e.name.transform(t)),e.argnames=do_list(e.argnames,t),e.body instanceof AST_Node?e.body=e.body.transform(t):e.body=do_list(e.body,t);})),def_transform(AST_Call,(function(e,t){e.expression=e.expression.transform(t),e.args=do_list(e.args,t);})),def_transform(AST_Sequence,(function(e,t){const n=do_list(e.expressions,t);e.expressions=n.length?n:[new AST_Number({value:0})];})),def_transform(AST_Dot,(function(e,t){e.expression=e.expression.transform(t);})),def_transform(AST_Sub,(function(e,t){e.expression=e.expression.transform(t),e.property=e.property.transform(t);})),def_transform(AST_Chain,(function(e,t){e.expression=e.expression.transform(t);})),def_transform(AST_Yield,(function(e,t){e.expression&&(e.expression=e.expression.transform(t));})),def_transform(AST_Await,(function(e,t){e.expression=e.expression.transform(t);})),def_transform(AST_Unary,(function(e,t){e.expression=e.expression.transform(t);})),def_transform(AST_Binary,(function(e,t){e.left=e.left.transform(t),e.right=e.right.transform(t);})),def_transform(AST_Conditional,(function(e,t){e.condition=e.condition.transform(t),e.consequent=e.consequent.transform(t),e.alternative=e.alternative.transform(t);})),def_transform(AST_Array,(function(e,t){e.elements=do_list(e.elements,t);})),def_transform(AST_Object,(function(e,t){e.properties=do_list(e.properties,t);})),def_transform(AST_ObjectProperty,(function(e,t){e.key instanceof AST_Node&&(e.key=e.key.transform(t)),e.value&&(e.value=e.value.transform(t));})),def_transform(AST_Class,(function(e,t){e.name&&(e.name=e.name.transform(t)),e.extends&&(e.extends=e.extends.transform(t)),e.properties=do_list(e.properties,t);})),def_transform(AST_Expansion,(function(e,t){e.expression=e.expression.transform(t);})),def_transform(AST_NameMapping,(function(e,t){e.foreign_name=e.foreign_name.transform(t),e.name=e.name.transform(t);})),def_transform(AST_Import,(function(e,t){e.imported_name&&(e.imported_name=e.imported_name.transform(t)),e.imported_names&&do_list(e.imported_names,t),e.module_name=e.module_name.transform(t);})),def_transform(AST_Export,(function(e,t){e.exported_definition&&(e.exported_definition=e.exported_definition.transform(t)),e.exported_value&&(e.exported_value=e.exported_value.transform(t)),e.exported_names&&do_list(e.exported_names,t),e.module_name&&(e.module_name=e.module_name.transform(t));})),def_transform(AST_TemplateString,(function(e,t){e.segments=do_list(e.segments,t);})),def_transform(AST_PrefixedTemplateString,(function(e,t){e.prefix=e.prefix.transform(t),e.template_string=e.template_string.transform(t);})),function(){var e=function(e){for(var t=!0,n=0;n<e.length;n++)t&&e[n]instanceof AST_Statement&&e[n].body instanceof AST_String?e[n]=new AST_Directive({start:e[n].start,end:e[n].end,value:e[n].body.value}):!t||e[n]instanceof AST_Statement&&e[n].body instanceof AST_String||(t=!1);return e},t={Program:function(t){return new AST_Toplevel({start:n(t),end:o(t),body:e(t.body.map(a))})},ArrayPattern:function(e){return new AST_Destructuring({start:n(e),end:o(e),names:e.elements.map((function(e){return null===e?new AST_Hole:a(e)})),is_array:!0})},ObjectPattern:function(e){return new AST_Destructuring({start:n(e),end:o(e),names:e.properties.map(a),is_array:!1})},AssignmentPattern:function(e){return new AST_DefaultAssign({start:n(e),end:o(e),left:a(e.left),operator:"=",right:a(e.right)})},SpreadElement:function(e){return new AST_Expansion({start:n(e),end:o(e),expression:a(e.argument)})},RestElement:function(e){return new AST_Expansion({start:n(e),end:o(e),expression:a(e.argument)})},TemplateElement:function(e){return new AST_TemplateSegment({start:n(e),end:o(e),value:e.value.cooked,raw:e.value.raw})},TemplateLiteral:function(e){for(var t=[],i=0;i<e.quasis.length;i++)t.push(a(e.quasis[i])),e.expressions[i]&&t.push(a(e.expressions[i]));return new AST_TemplateString({start:n(e),end:o(e),segments:t})},TaggedTemplateExpression:function(e){return new AST_PrefixedTemplateString({start:n(e),end:o(e),template_string:a(e.quasi),prefix:a(e.tag)})},FunctionDeclaration:function(t){return new AST_Defun({start:n(t),end:o(t),name:a(t.id),argnames:t.params.map(a),is_generator:t.generator,async:t.async,body:e(a(t.body).body)})},FunctionExpression:function(t){return new AST_Function({start:n(t),end:o(t),name:a(t.id),argnames:t.params.map(a),is_generator:t.generator,async:t.async,body:e(a(t.body).body)})},ArrowFunctionExpression:function(e){const t="BlockStatement"===e.body.type?a(e.body).body:[make_node(AST_Return,{},{value:a(e.body)})];return new AST_Arrow({start:n(e),end:o(e),argnames:e.params.map(a),body:t,async:e.async})},ExpressionStatement:function(e){return new AST_SimpleStatement({start:n(e),end:o(e),body:a(e.expression)})},TryStatement:function(e){var t=e.handlers||[e.handler];if(t.length>1||e.guardedHandlers&&e.guardedHandlers.length)throw new Error("Multiple catch clauses are not supported.");return new AST_Try({start:n(e),end:o(e),body:a(e.block).body,bcatch:a(t[0]),bfinally:e.finalizer?new AST_Finally(a(e.finalizer)):null})},Property:function(e){var t=e.key,i={start:n(t||e.value),end:o(e.value),key:"Identifier"==t.type?t.name:t.value,value:a(e.value)};return e.computed&&(i.key=a(e.key)),e.method?(i.is_generator=e.value.generator,i.async=e.value.async,e.computed?i.key=a(e.key):i.key=new AST_SymbolMethod({name:i.key}),new AST_ConciseMethod(i)):"init"==e.kind?("Identifier"!=t.type&&"Literal"!=t.type&&(i.key=a(t)),new AST_ObjectKeyVal(i)):("string"!=typeof i.key&&"number"!=typeof i.key||(i.key=new AST_SymbolMethod({name:i.key})),i.value=new AST_Accessor(i.value),"get"==e.kind?new AST_ObjectGetter(i):"set"==e.kind?new AST_ObjectSetter(i):"method"==e.kind?(i.async=e.value.async,i.is_generator=e.value.generator,i.quote=e.computed?'"':null,new AST_ConciseMethod(i)):void 0)},MethodDefinition:function(e){var t={start:n(e),end:o(e),key:e.computed?a(e.key):new AST_SymbolMethod({name:e.key.name||e.key.value}),value:a(e.value),static:e.static};return "get"==e.kind?new AST_ObjectGetter(t):"set"==e.kind?new AST_ObjectSetter(t):(t.is_generator=e.value.generator,t.async=e.value.async,new AST_ConciseMethod(t))},FieldDefinition:function(e){let t;if(e.computed)t=a(e.key);else {if("Identifier"!==e.key.type)throw new Error("Non-Identifier key in FieldDefinition");t=a(e.key);}return new AST_ClassProperty({start:n(e),end:o(e),key:t,value:a(e.value),static:e.static})},PropertyDefinition:function(e){let t;if(e.computed)t=a(e.key);else {if("Identifier"!==e.key.type)throw new Error("Non-Identifier key in PropertyDefinition");t=a(e.key);}return new AST_ClassProperty({start:n(e),end:o(e),key:t,value:a(e.value),static:e.static})},ArrayExpression:function(e){return new AST_Array({start:n(e),end:o(e),elements:e.elements.map((function(e){return null===e?new AST_Hole:a(e)}))})},ObjectExpression:function(e){return new AST_Object({start:n(e),end:o(e),properties:e.properties.map((function(e){return "SpreadElement"===e.type||(e.type="Property"),a(e)}))})},SequenceExpression:function(e){return new AST_Sequence({start:n(e),end:o(e),expressions:e.expressions.map(a)})},MemberExpression:function(e){return new(e.computed?AST_Sub:AST_Dot)({start:n(e),end:o(e),property:e.computed?a(e.property):e.property.name,expression:a(e.object),optional:e.optional||!1})},ChainExpression:function(e){return new AST_Chain({start:n(e),end:o(e),expression:a(e.expression)})},SwitchCase:function(e){return new(e.test?AST_Case:AST_Default)({start:n(e),end:o(e),expression:a(e.test),body:e.consequent.map(a)})},VariableDeclaration:function(e){return new("const"===e.kind?AST_Const:"let"===e.kind?AST_Let:AST_Var)({start:n(e),end:o(e),definitions:e.declarations.map(a)})},ImportDeclaration:function(e){var t=null,i=null;return e.specifiers.forEach((function(e){"ImportSpecifier"===e.type?(i||(i=[]),i.push(new AST_NameMapping({start:n(e),end:o(e),foreign_name:a(e.imported),name:a(e.local)}))):"ImportDefaultSpecifier"===e.type?t=a(e.local):"ImportNamespaceSpecifier"===e.type&&(i||(i=[]),i.push(new AST_NameMapping({start:n(e),end:o(e),foreign_name:new AST_SymbolImportForeign({name:"*"}),name:a(e.local)})));})),new AST_Import({start:n(e),end:o(e),imported_name:t,imported_names:i,module_name:a(e.source)})},ExportAllDeclaration:function(e){return new AST_Export({start:n(e),end:o(e),exported_names:[new AST_NameMapping({name:new AST_SymbolExportForeign({name:"*"}),foreign_name:new AST_SymbolExportForeign({name:"*"})})],module_name:a(e.source)})},ExportNamedDeclaration:function(e){return new AST_Export({start:n(e),end:o(e),exported_definition:a(e.declaration),exported_names:e.specifiers&&e.specifiers.length?e.specifiers.map((function(e){return new AST_NameMapping({foreign_name:a(e.exported),name:a(e.local)})})):null,module_name:a(e.source)})},ExportDefaultDeclaration:function(e){return new AST_Export({start:n(e),end:o(e),exported_value:a(e.declaration),is_default:!0})},Literal:function(e){var t=e.value,i={start:n(e),end:o(e)},r=e.regex;if(r&&r.pattern)return i.value={source:r.pattern,flags:r.flags},new AST_RegExp(i);if(r){const n=e.raw||t,o=n.match(/^\/(.*)\/(\w*)$/);if(!o)throw new Error("Invalid regex source "+n);const[r,a,s]=o;return i.value={source:a,flags:s},new AST_RegExp(i)}if(null===t)return new AST_Null(i);switch(typeof t){case"string":return i.value=t,new AST_String(i);case"number":return i.value=t,i.raw=e.raw||t.toString(),new AST_Number(i);case"boolean":return new(t?AST_True:AST_False)(i)}},MetaProperty:function(e){return "new"===e.meta.name&&"target"===e.property.name?new AST_NewTarget({start:n(e),end:o(e)}):"import"===e.meta.name&&"meta"===e.property.name?new AST_ImportMeta({start:n(e),end:o(e)}):void 0},Identifier:function(e){var t=r[r.length-2];return new("LabeledStatement"==t.type?AST_Label:"VariableDeclarator"==t.type&&t.id===e?"const"==t.kind?AST_SymbolConst:"let"==t.kind?AST_SymbolLet:AST_SymbolVar:/Import.*Specifier/.test(t.type)?t.local===e?AST_SymbolImport:AST_SymbolImportForeign:"ExportSpecifier"==t.type?t.local===e?AST_SymbolExport:AST_SymbolExportForeign:"FunctionExpression"==t.type?t.id===e?AST_SymbolLambda:AST_SymbolFunarg:"FunctionDeclaration"==t.type?t.id===e?AST_SymbolDefun:AST_SymbolFunarg:"ArrowFunctionExpression"==t.type?t.params.includes(e)?AST_SymbolFunarg:AST_SymbolRef:"ClassExpression"==t.type?t.id===e?AST_SymbolClass:AST_SymbolRef:"Property"==t.type?t.key===e&&t.computed||t.value===e?AST_SymbolRef:AST_SymbolMethod:"PropertyDefinition"==t.type||"FieldDefinition"===t.type?t.key===e&&t.computed||t.value===e?AST_SymbolRef:AST_SymbolClassProperty:"ClassDeclaration"==t.type?t.id===e?AST_SymbolDefClass:AST_SymbolRef:"MethodDefinition"==t.type?t.computed?AST_SymbolRef:AST_SymbolMethod:"CatchClause"==t.type?AST_SymbolCatch:"BreakStatement"==t.type||"ContinueStatement"==t.type?AST_LabelRef:AST_SymbolRef)({start:n(e),end:o(e),name:e.name})},BigIntLiteral:e=>new AST_BigInt({start:n(e),end:o(e),value:e.value})};function n(e){var t=e.loc,n=t&&t.start,o=e.range;return new AST_Token("","",n&&n.line||0,n&&n.column||0,o?o[0]:e.start,!1,[],[],t&&t.source)}function o(e){var t=e.loc,n=t&&t.end,o=e.range;return new AST_Token("","",n&&n.line||0,n&&n.column||0,o?o[0]:e.end,!1,[],[],t&&t.source)}function i(e,i,r){var u="function From_Moz_"+e+"(M){\n";u+="return new U2."+i.name+"({\nstart: my_start_token(M),\nend: my_end_token(M)";var _="function To_Moz_"+e+"(M){\n";_+="return {\ntype: "+JSON.stringify(e),r&&r.split(/\s*,\s*/).forEach((function(e){var t=/([a-z0-9$_]+)([=@>%])([a-z0-9$_]+)/i.exec(e);if(!t)throw new Error("Can't understand property map: "+e);var n=t[1],o=t[2],i=t[3];switch(u+=",\n"+i+": ",_+=",\n"+n+": ",o){case"@":u+="M."+n+".map(from_moz)",_+="M."+i+".map(to_moz)";break;case">":u+="from_moz(M."+n+")",_+="to_moz(M."+i+")";break;case"=":u+="M."+n,_+="M."+i;break;case"%":u+="from_moz(M."+n+").body",_+="to_moz_block(M)";break;default:throw new Error("Can't understand operator in propmap: "+e)}})),u+="\n})\n}",_+="\n}\n}",u=new Function("U2","my_start_token","my_end_token","from_moz","return("+u+")")(ast,n,o,a),_=new Function("to_moz","to_moz_block","to_moz_scope","return("+_+")")(l,c,f),t[e]=u,s(i,_);}t.UpdateExpression=t.UnaryExpression=function(e){return new(("prefix"in e?e.prefix:"UnaryExpression"==e.type)?AST_UnaryPrefix:AST_UnaryPostfix)({start:n(e),end:o(e),operator:e.operator,expression:a(e.argument)})},t.ClassDeclaration=t.ClassExpression=function(e){return new("ClassDeclaration"===e.type?AST_DefClass:AST_ClassExpression)({start:n(e),end:o(e),name:a(e.id),extends:a(e.superClass),properties:e.body.body.map(a)})},i("EmptyStatement",AST_EmptyStatement),i("BlockStatement",AST_BlockStatement,"body@body"),i("IfStatement",AST_If,"test>condition, consequent>body, alternate>alternative"),i("LabeledStatement",AST_LabeledStatement,"label>label, body>body"),i("BreakStatement",AST_Break,"label>label"),i("ContinueStatement",AST_Continue,"label>label"),i("WithStatement",AST_With,"object>expression, body>body"),i("SwitchStatement",AST_Switch,"discriminant>expression, cases@body"),i("ReturnStatement",AST_Return,"argument>value"),i("ThrowStatement",AST_Throw,"argument>value"),i("WhileStatement",AST_While,"test>condition, body>body"),i("DoWhileStatement",AST_Do,"test>condition, body>body"),i("ForStatement",AST_For,"init>init, test>condition, update>step, body>body"),i("ForInStatement",AST_ForIn,"left>init, right>object, body>body"),i("ForOfStatement",AST_ForOf,"left>init, right>object, body>body, await=await"),i("AwaitExpression",AST_Await,"argument>expression"),i("YieldExpression",AST_Yield,"argument>expression, delegate=is_star"),i("DebuggerStatement",AST_Debugger),i("VariableDeclarator",AST_VarDef,"id>name, init>value"),i("CatchClause",AST_Catch,"param>argname, body%body"),i("ThisExpression",AST_This),i("Super",AST_Super),i("BinaryExpression",AST_Binary,"operator=operator, left>left, right>right"),i("LogicalExpression",AST_Binary,"operator=operator, left>left, right>right"),i("AssignmentExpression",AST_Assign,"operator=operator, left>left, right>right"),i("ConditionalExpression",AST_Conditional,"test>condition, consequent>consequent, alternate>alternative"),i("NewExpression",AST_New,"callee>expression, arguments@args"),i("CallExpression",AST_Call,"callee>expression, optional=optional, arguments@args"),s(AST_Toplevel,(function(e){return f("Program",e)})),s(AST_Expansion,(function(e){return {type:_()?"RestElement":"SpreadElement",argument:l(e.expression)}})),s(AST_PrefixedTemplateString,(function(e){return {type:"TaggedTemplateExpression",tag:l(e.prefix),quasi:l(e.template_string)}})),s(AST_TemplateString,(function(e){for(var t=[],n=[],o=0;o<e.segments.length;o++)o%2!=0?n.push(l(e.segments[o])):t.push({type:"TemplateElement",value:{raw:e.segments[o].raw,cooked:e.segments[o].value},tail:o===e.segments.length-1});return {type:"TemplateLiteral",quasis:t,expressions:n}})),s(AST_Defun,(function(e){return {type:"FunctionDeclaration",id:l(e.name),params:e.argnames.map(l),generator:e.is_generator,async:e.async,body:f("BlockStatement",e)}})),s(AST_Function,(function(e,t){var n=void 0!==t.is_generator?t.is_generator:e.is_generator;return {type:"FunctionExpression",id:l(e.name),params:e.argnames.map(l),generator:n,async:e.async,body:f("BlockStatement",e)}})),s(AST_Arrow,(function(e){var t={type:"BlockStatement",body:e.body.map(l)};return {type:"ArrowFunctionExpression",params:e.argnames.map(l),async:e.async,body:t}})),s(AST_Destructuring,(function(e){return e.is_array?{type:"ArrayPattern",elements:e.names.map(l)}:{type:"ObjectPattern",properties:e.names.map(l)}})),s(AST_Directive,(function(e){return {type:"ExpressionStatement",expression:{type:"Literal",value:e.value,raw:e.print_to_string()},directive:e.value}})),s(AST_SimpleStatement,(function(e){return {type:"ExpressionStatement",expression:l(e.body)}})),s(AST_SwitchBranch,(function(e){return {type:"SwitchCase",test:l(e.expression),consequent:e.body.map(l)}})),s(AST_Try,(function(e){return {type:"TryStatement",block:c(e),handler:l(e.bcatch),guardedHandlers:[],finalizer:l(e.bfinally)}})),s(AST_Catch,(function(e){return {type:"CatchClause",param:l(e.argname),guard:null,body:c(e)}})),s(AST_Definitions,(function(e){return {type:"VariableDeclaration",kind:e instanceof AST_Const?"const":e instanceof AST_Let?"let":"var",declarations:e.definitions.map(l)}})),s(AST_Export,(function(e){return e.exported_names?"*"===e.exported_names[0].name.name?{type:"ExportAllDeclaration",source:l(e.module_name)}:{type:"ExportNamedDeclaration",specifiers:e.exported_names.map((function(e){return {type:"ExportSpecifier",exported:l(e.foreign_name),local:l(e.name)}})),declaration:l(e.exported_definition),source:l(e.module_name)}:{type:e.is_default?"ExportDefaultDeclaration":"ExportNamedDeclaration",declaration:l(e.exported_value||e.exported_definition)}})),s(AST_Import,(function(e){var t=[];return e.imported_name&&t.push({type:"ImportDefaultSpecifier",local:l(e.imported_name)}),e.imported_names&&"*"===e.imported_names[0].foreign_name.name?t.push({type:"ImportNamespaceSpecifier",local:l(e.imported_names[0].name)}):e.imported_names&&e.imported_names.forEach((function(e){t.push({type:"ImportSpecifier",local:l(e.name),imported:l(e.foreign_name)});})),{type:"ImportDeclaration",specifiers:t,source:l(e.module_name)}})),s(AST_ImportMeta,(function(){return {type:"MetaProperty",meta:{type:"Identifier",name:"import"},property:{type:"Identifier",name:"meta"}}})),s(AST_Sequence,(function(e){return {type:"SequenceExpression",expressions:e.expressions.map(l)}})),s(AST_DotHash,(function(e){return {type:"MemberExpression",object:l(e.expression),computed:!1,property:{type:"PrivateIdentifier",name:e.property},optional:e.optional}})),s(AST_PropAccess,(function(e){var t=e instanceof AST_Sub;return {type:"MemberExpression",object:l(e.expression),computed:t,property:t?l(e.property):{type:"Identifier",name:e.property},optional:e.optional}})),s(AST_Chain,(function(e){return {type:"ChainExpression",expression:l(e.expression)}})),s(AST_Unary,(function(e){return {type:"++"==e.operator||"--"==e.operator?"UpdateExpression":"UnaryExpression",operator:e.operator,prefix:e instanceof AST_UnaryPrefix,argument:l(e.expression)}})),s(AST_Binary,(function(e){return "="==e.operator&&_()?{type:"AssignmentPattern",left:l(e.left),right:l(e.right)}:{type:"&&"==e.operator||"||"==e.operator||"??"===e.operator?"LogicalExpression":"BinaryExpression",left:l(e.left),operator:e.operator,right:l(e.right)}})),s(AST_Array,(function(e){return {type:"ArrayExpression",elements:e.elements.map(l)}})),s(AST_Object,(function(e){return {type:"ObjectExpression",properties:e.properties.map(l)}})),s(AST_ObjectProperty,(function(e,t){var n,o=e.key instanceof AST_Node?l(e.key):{type:"Identifier",value:e.key};"number"==typeof e.key&&(o={type:"Literal",value:Number(e.key)}),"string"==typeof e.key&&(o={type:"Identifier",name:e.key});var i="string"==typeof e.key||"number"==typeof e.key,r=!i&&(!(e.key instanceof AST_Symbol)||e.key instanceof AST_SymbolRef);return e instanceof AST_ObjectKeyVal?(n="init",r=!i):e instanceof AST_ObjectGetter?n="get":e instanceof AST_ObjectSetter&&(n="set"),e instanceof AST_PrivateGetter||e instanceof AST_PrivateSetter?{type:"MethodDefinition",computed:!1,kind:e instanceof AST_PrivateGetter?"get":"set",static:e.static,key:{type:"PrivateIdentifier",name:e.key.name},value:l(e.value)}:e instanceof AST_ClassPrivateProperty?{type:"PropertyDefinition",key:{type:"PrivateIdentifier",name:e.key.name},value:l(e.value),computed:!1,static:e.static}:e instanceof AST_ClassProperty?{type:"PropertyDefinition",key:o,value:l(e.value),computed:r,static:e.static}:t instanceof AST_Class?{type:"MethodDefinition",computed:r,kind:n,static:e.static,key:l(e.key),value:l(e.value)}:{type:"Property",computed:r,kind:n,key:o,value:l(e.value)}})),s(AST_ConciseMethod,(function(e,t){if(t instanceof AST_Object)return {type:"Property",computed:!(e.key instanceof AST_Symbol)||e.key instanceof AST_SymbolRef,kind:"init",method:!0,shorthand:!1,key:l(e.key),value:l(e.value)};const n=e instanceof AST_PrivateMethod?{type:"PrivateIdentifier",name:e.key.name}:l(e.key);return {type:"MethodDefinition",kind:"constructor"===e.key?"constructor":"method",key:n,value:l(e.value),computed:!(e.key instanceof AST_Symbol)||e.key instanceof AST_SymbolRef,static:e.static}})),s(AST_Class,(function(e){return {type:e instanceof AST_ClassExpression?"ClassExpression":"ClassDeclaration",superClass:l(e.extends),id:e.name?l(e.name):null,body:{type:"ClassBody",body:e.properties.map(l)}}})),s(AST_NewTarget,(function(){return {type:"MetaProperty",meta:{type:"Identifier",name:"new"},property:{type:"Identifier",name:"target"}}})),s(AST_Symbol,(function(e,t){if(e instanceof AST_SymbolMethod&&t.quote)return {type:"Literal",value:e.name};var n=e.definition();return {type:"Identifier",name:n?n.mangled_name||n.name:e.name}})),s(AST_RegExp,(function(e){const t=e.value.source,n=e.value.flags;return {type:"Literal",value:null,raw:e.print_to_string(),regex:{pattern:t,flags:n}}})),s(AST_Constant,(function(e){return {type:"Literal",value:e.value,raw:e.raw||e.print_to_string()}})),s(AST_Atom,(function(e){return {type:"Identifier",name:String(e.value)}})),s(AST_BigInt,(e=>({type:"BigIntLiteral",value:e.value}))),AST_Boolean.DEFMETHOD("to_mozilla_ast",AST_Constant.prototype.to_mozilla_ast),AST_Null.DEFMETHOD("to_mozilla_ast",AST_Constant.prototype.to_mozilla_ast),AST_Hole.DEFMETHOD("to_mozilla_ast",(function(){return null})),AST_Block.DEFMETHOD("to_mozilla_ast",AST_BlockStatement.prototype.to_mozilla_ast),AST_Lambda.DEFMETHOD("to_mozilla_ast",AST_Function.prototype.to_mozilla_ast);var r=null;function a(e){r.push(e);var n=null!=e?t[e.type](e):null;return r.pop(),n}function s(e,t){e.DEFMETHOD("to_mozilla_ast",(function(e){return n=t(this,e),o=this.start,i=this.end,o&&i?(null!=o.pos&&null!=i.endpos&&(n.range=[o.pos,i.endpos]),o.line&&(n.loc={start:{line:o.line,column:o.col},end:i.endline?{line:i.endline,column:i.endcol}:null},o.file&&(n.loc.source=o.file)),n):n;var n,o,i;}));}AST_Node.from_mozilla_ast=function(e){var t=r;r=[];var n=a(e);return r=t,n};var u=null;function l(e){null===u&&(u=[]),u.push(e);var t=null!=e?e.to_mozilla_ast(u[u.length-2]):null;return u.pop(),0===u.length&&(u=null),t}function _(){for(var e=u.length;e--;)if(u[e]instanceof AST_Destructuring)return !0;return !1}function c(e){return {type:"BlockStatement",body:e.body.map(l)}}function f(e,t){var n=t.body.map(l);return t.body[0]instanceof AST_SimpleStatement&&t.body[0].body instanceof AST_String&&n.unshift(l(new AST_EmptyStatement(t.body[0]))),{type:e,body:n}}}();const EXPECT_DIRECTIVE=/^$|[;{][\s\n]*$/,r_annotation=/[@#]__(PURE|INLINE|NOINLINE)__/g;function is_some_comments(e){return ("comment2"===e.type||"comment1"===e.type)&&/@preserve|@lic|@cc_on|^\**!/i.test(e.value)}function OutputStream(e){var t=!e;void 0===(e=defaults$1(e,{ascii_only:!1,beautify:!1,braces:!1,comments:"some",ecma:5,ie8:!1,indent_level:4,indent_start:0,inline_script:!0,keep_numbers:!1,keep_quoted_props:!1,max_line_len:!1,preamble:null,preserve_annotations:!1,quote_keys:!1,quote_style:0,safari10:!1,semicolons:!0,shebang:!0,shorthand:void 0,source_map:null,webkit:!1,width:80,wrap_iife:!1,wrap_func_args:!0},!0)).shorthand&&(e.shorthand=e.ecma>5);var n=return_false;if(e.comments){let t=e.comments;if("string"==typeof e.comments&&/^\/.*\/[a-zA-Z]*$/.test(e.comments)){var o=e.comments.lastIndexOf("/");t=new RegExp(e.comments.substr(1,o-1),e.comments.substr(o+1));}n=t instanceof RegExp?function(e){return "comment5"!=e.type&&t.test(e.value)}:"function"==typeof t?function(e){return "comment5"!=e.type&&t(this,e)}:"some"===t?is_some_comments:return_true;}var i=0,r=0,a=1,s=0,u="";let l=new Set;var _=e.ascii_only?function(t,n){return e.ecma>=2015&&!e.safari10&&(t=t.replace(/[\ud800-\udbff][\udc00-\udfff]/g,(function(e){return "\\u{"+get_full_char_code(e,0).toString(16)+"}"}))),t.replace(/[\u0000-\u001f\u007f-\uffff]/g,(function(e){var t=e.charCodeAt(0).toString(16);if(t.length<=2&&!n){for(;t.length<2;)t="0"+t;return "\\x"+t}for(;t.length<4;)t="0"+t;return "\\u"+t}))}:function(e){return e.replace(/[\ud800-\udbff][\udc00-\udfff]|([\ud800-\udbff]|[\udc00-\udfff])/g,(function(e,t){return t?"\\u"+t.charCodeAt(0).toString(16):e}))};function c(t,n){var o=function(t,n){var o=0,i=0;function r(){return "'"+t.replace(/\x27/g,"\\'")+"'"}function a(){return '"'+t.replace(/\x22/g,'\\"')+'"'}if(t=t.replace(/[\\\b\f\n\r\v\t\x22\x27\u2028\u2029\0\ufeff]/g,(function(n,r){switch(n){case'"':return ++o,'"';case"'":return ++i,"'";case"\\":return "\\\\";case"\n":return "\\n";case"\r":return "\\r";case"\t":return "\\t";case"\b":return "\\b";case"\f":return "\\f";case"\v":return e.ie8?"\\x0B":"\\v";case"\u2028":return "\\u2028";case"\u2029":return "\\u2029";case"\ufeff":return "\\ufeff";case"\0":return /[0-9]/.test(get_full_char(t,r+1))?"\\x00":"\\0"}return n})),t=_(t),"`"===n)return "`"+t.replace(/`/g,"\\`")+"`";switch(e.quote_style){case 1:return r();case 2:return a();case 3:return "'"==n?r():a();default:return o>i?r():a()}}(t,n);return e.inline_script&&(o=(o=(o=o.replace(/<\x2f(script)([>\/\t\n\f\r ])/gi,"<\\/$1$2")).replace(/\x3c!--/g,"\\x3c!--")).replace(/--\x3e/g,"--\\x3e")),o}var f,p,d=!1,S=!1,m=!1,A=0,T=!1,h=!1,E=-1,g="",D=e.source_map&&[],b=D?function(){D.forEach((function(t){try{e.source_map.add(t.token.file,t.line,t.col,t.token.line,t.token.col,t.name||"name"!=t.token.type?t.name:t.token.value);}catch(e){}})),D=[];}:noop,y=e.max_line_len?function(){if(r>e.max_line_len&&A){var t=u.slice(0,A),n=u.slice(A);if(D){var o=n.length-r;D.forEach((function(e){e.line++,e.col+=o;}));}u=t+"\n"+n,a++,s++,r=n.length;}A&&(A=0,b());}:noop,v=makePredicate("( [ + * / - , . `");function C(t){var n=get_full_char(t=String(t),0);T&&n&&(T=!1,"\n"!==n&&(C("\n"),k())),h&&n&&(h=!1,/[\s;})]/.test(n)||R()),E=-1;var o=g.charAt(g.length-1);m&&(m=!1,(":"!==o||"}"!==n)&&(n&&";}".includes(n)||";"===o)||(e.semicolons||v.has(n)?(u+=";",r++,s++):(y(),r>0&&(u+="\n",s++,a++,r=0),/^\s+$/.test(t)&&(m=!0)),e.beautify||(S=!1))),S&&((is_identifier_char(o)&&(is_identifier_char(n)||"\\"==n)||"/"==n&&n==o||("+"==n||"-"==n)&&n==g)&&(u+=" ",r++,s++),S=!1),f&&(D.push({token:f,name:p,line:a,col:r}),f=!1,A||b()),u+=t,d="("==t[t.length-1],s+=t.length;var i=t.split(/\r?\n/),l=i.length-1;a+=l,r+=i[0].length,l>0&&(y(),r=i[l].length),g=t;}var R=e.beautify?function(){C(" ");}:function(){S=!0;},k=e.beautify?function(t){var n;e.beautify&&C((n=t?.5:0," ".repeat(e.indent_start+i-n*e.indent_level)));}:noop,O=e.beautify?function(e,t){!0===e&&(e=I());var n=i;i=e;var o=t();return i=n,o}:function(e,t){return t()},F=e.beautify?function(){if(E<0)return C("\n");"\n"!=u[E]&&(u=u.slice(0,E)+"\n"+u.slice(E),s++,a++),E++;}:e.max_line_len?function(){y(),A=u.length;}:noop,N=e.beautify?function(){C(";");}:function(){m=!0;};function M(){m=!1,C(";");}function I(){return i+e.indent_level}function x(){return A&&y(),u}function w(){let e=u.length-1;for(;e>=0;){const t=u.charCodeAt(e);if(10===t)return !0;if(32!==t)return !1;e--;}return !0}function P(t){return e.preserve_annotations||(t=t.replace(r_annotation," ")),/^\s*$/.test(t)?"":t.replace(/(<\s*\/\s*)(script)/i,"<\\/$2")}var B=[];return {get:x,toString:x,indent:k,in_directive:!1,use_asm:null,active_scope:null,indentation:function(){return i},current_width:function(){return r-i},should_break:function(){return e.width&&this.current_width()>=e.width},has_parens:function(){return d},newline:F,print:C,star:function(){C("*");},space:R,comma:function(){C(","),R();},colon:function(){C(":"),R();},last:function(){return g},semicolon:N,force_semicolon:M,to_utf8:_,print_name:function(e){C(function(e){return e=e.toString(),_(e,!0)}(e));},print_string:function(e,t,n){var o=c(e,t);!0!==n||o.includes("\\")||(EXPECT_DIRECTIVE.test(u)||M(),M()),C(o);},print_template_string_chars:function(e){var t=c(e,"`").replace(/\${/g,"\\${");return C(t.substr(1,t.length-2))},encode_string:c,next_indent:I,with_indent:O,with_block:function(e){var t;return C("{"),F(),O(I(),(function(){t=e();})),k(),C("}"),t},with_parens:function(e){C("(");var t=e();return C(")"),t},with_square:function(e){C("[");var t=e();return C("]"),t},add_mapping:D?function(e,t){f=e,p=t;}:noop,option:function(t){return e[t]},printed_comments:l,prepend_comments:t?noop:function(t){var o=t.start;if(!o)return;var i=this.printed_comments;const r=t instanceof AST_Exit&&t.value;if(o.comments_before&&i.has(o.comments_before)){if(!r)return;o.comments_before=[];}var a=o.comments_before;if(a||(a=o.comments_before=[]),i.add(a),r){var u=new TreeWalker((function(e){var t=u.parent();if(!(t instanceof AST_Exit||t instanceof AST_Binary&&t.left===e||"Call"==t.TYPE&&t.expression===e||t instanceof AST_Conditional&&t.condition===e||t instanceof AST_Dot&&t.expression===e||t instanceof AST_Sequence&&t.expressions[0]===e||t instanceof AST_Sub&&t.expression===e||t instanceof AST_UnaryPostfix))return !0;if(e.start){var n=e.start.comments_before;n&&!i.has(n)&&(i.add(n),a=a.concat(n));}}));u.push(t),t.value.walk(u);}if(0==s){a.length>0&&e.shebang&&"comment5"===a[0].type&&!i.has(a[0])&&(C("#!"+a.shift().value+"\n"),k());var l=e.preamble;l&&C(l.replace(/\r\n?|[\n\u2028\u2029]|\s*$/g,"\n"));}if(0!=(a=a.filter(n,t).filter((e=>!i.has(e)))).length){var _=w();a.forEach((function(e,t){if(i.add(e),_||(e.nlb?(C("\n"),k(),_=!0):t>0&&R()),/comment[134]/.test(e.type))(n=P(e.value))&&(C("//"+n+"\n"),k()),_=!0;else if("comment2"==e.type){var n;(n=P(e.value))&&C("/*"+n+"*/"),_=!1;}})),_||(o.nlb?(C("\n"),k()):R());}},append_comments:t||n===return_false?noop:function(e,t){var o=e.end;if(o){var i=this.printed_comments,r=o[t?"comments_before":"comments_after"];if(r&&!i.has(r)&&(e instanceof AST_Statement||r.every((e=>!/comment[134]/.test(e.type))))){i.add(r);var a=u.length;r.filter(n,e).forEach((function(e,n){if(!i.has(e))if(i.add(e),h=!1,T?(C("\n"),k(),T=!1):e.nlb&&(n>0||!w())?(C("\n"),k()):(n>0||!t)&&R(),/comment[134]/.test(e.type)){const t=P(e.value);t&&C("//"+t),T=!0;}else if("comment2"==e.type){const t=P(e.value);t&&C("/*"+t+"*/"),h=!0;}})),u.length>a&&(E=a);}}},line:function(){return a},col:function(){return r},pos:function(){return s},push_node:function(e){B.push(e);},pop_node:function(){return B.pop()},parent:function(e){return B[B.length-2-(e||0)]}}}!function(){function e(e,t){e.DEFMETHOD("_codegen",t);}function t(e,n){Array.isArray(e)?e.forEach((function(e){t(e,n);})):e.DEFMETHOD("needs_parens",n);}function n(e,t,n,o){var i=e.length-1;n.in_directive=o,e.forEach((function(e,o){!0!==n.in_directive||e instanceof AST_Directive||e instanceof AST_EmptyStatement||e instanceof AST_SimpleStatement&&e.body instanceof AST_String||(n.in_directive=!1),e instanceof AST_EmptyStatement||(n.indent(),e.print(n),o==i&&t||(n.newline(),t&&n.newline())),!0===n.in_directive&&e instanceof AST_SimpleStatement&&e.body instanceof AST_String&&(n.in_directive=!1);})),n.in_directive=!1;}function o(e,t){t.print("{"),t.with_indent(t.next_indent(),(function(){t.append_comments(e,!0);})),t.print("}");}function i(e,t,i){e.body.length>0?t.with_block((function(){n(e.body,!1,t,i);})):o(e,t);}function r(e,t,n){var o=!1;n&&(o=walk$3(e,(e=>e instanceof AST_Scope||(e instanceof AST_Binary&&"in"==e.operator?walk_abort:void 0)))),e.print(t,o);}function a(e,t,n){return n.option("quote_keys")?n.print_string(e):""+ +e==e&&e>=0?n.option("keep_numbers")?n.print(e):n.print(_(e)):(RESERVED_WORDS.has(e)?n.option("ie8"):n.option("ecma")<2015||n.option("safari10")?!is_basic_identifier_string(e):!is_identifier_string(e,!0))||t&&n.option("keep_quoted_props")?n.print_string(e,t):n.print_name(e)}AST_Node.DEFMETHOD("print",(function(e,t){var n=this,o=n._codegen;function i(){e.prepend_comments(n),n.add_source_map(e),o(n,e),e.append_comments(n);}n instanceof AST_Scope?e.active_scope=n:!e.use_asm&&n instanceof AST_Directive&&"use asm"==n.value&&(e.use_asm=e.active_scope),e.push_node(n),t||n.needs_parens(e)?e.with_parens(i):i(),e.pop_node(),n===e.use_asm&&(e.use_asm=null);})),AST_Node.DEFMETHOD("_print",AST_Node.prototype.print),AST_Node.DEFMETHOD("print_to_string",(function(e){var t=OutputStream(e);return this.print(t),t.get()})),t(AST_Node,return_false),t(AST_Function,(function(e){return !(e.has_parens()||!first_in_statement(e))||(!!(e.option("webkit")&&(t=e.parent())instanceof AST_PropAccess&&t.expression===this)||(!!(e.option("wrap_iife")&&(t=e.parent())instanceof AST_Call&&t.expression===this)||!!(e.option("wrap_func_args")&&(t=e.parent())instanceof AST_Call&&t.args.includes(this))));var t;})),t(AST_Arrow,(function(e){var t=e.parent();return !!(e.option("wrap_func_args")&&t instanceof AST_Call&&t.args.includes(this))||t instanceof AST_PropAccess&&t.expression===this})),t(AST_Object,(function(e){return !e.has_parens()&&first_in_statement(e)})),t(AST_ClassExpression,first_in_statement),t(AST_Unary,(function(e){var t=e.parent();return t instanceof AST_PropAccess&&t.expression===this||t instanceof AST_Call&&t.expression===this||t instanceof AST_Binary&&"**"===t.operator&&this instanceof AST_UnaryPrefix&&t.left===this&&"++"!==this.operator&&"--"!==this.operator})),t(AST_Await,(function(e){var t=e.parent();return t instanceof AST_PropAccess&&t.expression===this||t instanceof AST_Call&&t.expression===this||t instanceof AST_Binary&&"**"===t.operator&&t.left===this||e.option("safari10")&&t instanceof AST_UnaryPrefix})),t(AST_Sequence,(function(e){var t=e.parent();return t instanceof AST_Call||t instanceof AST_Unary||t instanceof AST_Binary||t instanceof AST_VarDef||t instanceof AST_PropAccess||t instanceof AST_Array||t instanceof AST_ObjectProperty||t instanceof AST_Conditional||t instanceof AST_Arrow||t instanceof AST_DefaultAssign||t instanceof AST_Expansion||t instanceof AST_ForOf&&this===t.object||t instanceof AST_Yield||t instanceof AST_Export})),t(AST_Binary,(function(e){var t=e.parent();if(t instanceof AST_Call&&t.expression===this)return !0;if(t instanceof AST_Unary)return !0;if(t instanceof AST_PropAccess&&t.expression===this)return !0;if(t instanceof AST_Binary){const e=t.operator,n=this.operator;if("??"===n&&("||"===e||"&&"===e))return !0;if("??"===e&&("||"===n||"&&"===n))return !0;const o=PRECEDENCE[e],i=PRECEDENCE[n];if(o>i||o==i&&(this===t.right||"**"==e))return !0}})),t(AST_Yield,(function(e){var t=e.parent();return t instanceof AST_Binary&&"="!==t.operator||t instanceof AST_Call&&t.expression===this||t instanceof AST_Conditional&&t.condition===this||t instanceof AST_Unary||t instanceof AST_PropAccess&&t.expression===this||void 0})),t(AST_PropAccess,(function(e){var t=e.parent();if(t instanceof AST_New&&t.expression===this)return walk$3(this,(e=>e instanceof AST_Scope||(e instanceof AST_Call?walk_abort:void 0)))})),t(AST_Call,(function(e){var t,n=e.parent();return !!(n instanceof AST_New&&n.expression===this||n instanceof AST_Export&&n.is_default&&this.expression instanceof AST_Function)||this.expression instanceof AST_Function&&n instanceof AST_PropAccess&&n.expression===this&&(t=e.parent(1))instanceof AST_Assign&&t.left===n})),t(AST_New,(function(e){var t=e.parent();if(0===this.args.length&&(t instanceof AST_PropAccess||t instanceof AST_Call&&t.expression===this))return !0})),t(AST_Number,(function(e){var t=e.parent();if(t instanceof AST_PropAccess&&t.expression===this){var n=this.getValue();if(n<0||/^0/.test(_(n)))return !0}})),t(AST_BigInt,(function(e){var t=e.parent();if(t instanceof AST_PropAccess&&t.expression===this&&this.getValue().startsWith("-"))return !0})),t([AST_Assign,AST_Conditional],(function(e){var t=e.parent();return t instanceof AST_Unary||t instanceof AST_Binary&&!(t instanceof AST_Assign)||t instanceof AST_Call&&t.expression===this||t instanceof AST_Conditional&&t.condition===this||t instanceof AST_PropAccess&&t.expression===this||this instanceof AST_Assign&&this.left instanceof AST_Destructuring&&!1===this.left.is_array||void 0})),e(AST_Directive,(function(e,t){t.print_string(e.value,e.quote),t.semicolon();})),e(AST_Expansion,(function(e,t){t.print("..."),e.expression.print(t);})),e(AST_Destructuring,(function(e,t){t.print(e.is_array?"[":"{");var n=e.names.length;e.names.forEach((function(e,o){o>0&&t.comma(),e.print(t),o==n-1&&e instanceof AST_Hole&&t.comma();})),t.print(e.is_array?"]":"}");})),e(AST_Debugger,(function(e,t){t.print("debugger"),t.semicolon();})),AST_StatementWithBody.DEFMETHOD("_do_print_body",(function(e){l(this.body,e);})),e(AST_Statement,(function(e,t){e.body.print(t),t.semicolon();})),e(AST_Toplevel,(function(e,t){n(e.body,!0,t,!0),t.print("");})),e(AST_LabeledStatement,(function(e,t){e.label.print(t),t.colon(),e.body.print(t);})),e(AST_SimpleStatement,(function(e,t){e.body.print(t),t.semicolon();})),e(AST_BlockStatement,(function(e,t){i(e,t);})),e(AST_EmptyStatement,(function(e,t){t.semicolon();})),e(AST_Do,(function(e,t){t.print("do"),t.space(),c(e.body,t),t.space(),t.print("while"),t.space(),t.with_parens((function(){e.condition.print(t);})),t.semicolon();})),e(AST_While,(function(e,t){t.print("while"),t.space(),t.with_parens((function(){e.condition.print(t);})),t.space(),e._do_print_body(t);})),e(AST_For,(function(e,t){t.print("for"),t.space(),t.with_parens((function(){e.init?(e.init instanceof AST_Definitions?e.init.print(t):r(e.init,t,!0),t.print(";"),t.space()):t.print(";"),e.condition?(e.condition.print(t),t.print(";"),t.space()):t.print(";"),e.step&&e.step.print(t);})),t.space(),e._do_print_body(t);})),e(AST_ForIn,(function(e,t){t.print("for"),e.await&&(t.space(),t.print("await")),t.space(),t.with_parens((function(){e.init.print(t),t.space(),t.print(e instanceof AST_ForOf?"of":"in"),t.space(),e.object.print(t);})),t.space(),e._do_print_body(t);})),e(AST_With,(function(e,t){t.print("with"),t.space(),t.with_parens((function(){e.expression.print(t);})),t.space(),e._do_print_body(t);})),AST_Lambda.DEFMETHOD("_do_print",(function(e,t){var n=this;t||(n.async&&(e.print("async"),e.space()),e.print("function"),n.is_generator&&e.star(),n.name&&e.space()),n.name instanceof AST_Symbol?n.name.print(e):t&&n.name instanceof AST_Node&&e.with_square((function(){n.name.print(e);})),e.with_parens((function(){n.argnames.forEach((function(t,n){n&&e.comma(),t.print(e);}));})),e.space(),i(n,e,!0);})),e(AST_Lambda,(function(e,t){e._do_print(t);})),e(AST_PrefixedTemplateString,(function(e,t){var n=e.prefix,o=n instanceof AST_Lambda||n instanceof AST_Binary||n instanceof AST_Conditional||n instanceof AST_Sequence||n instanceof AST_Unary||n instanceof AST_Dot&&n.expression instanceof AST_Object;o&&t.print("("),e.prefix.print(t),o&&t.print(")"),e.template_string.print(t);})),e(AST_TemplateString,(function(e,t){var n=t.parent()instanceof AST_PrefixedTemplateString;t.print("`");for(var o=0;o<e.segments.length;o++)e.segments[o]instanceof AST_TemplateSegment?n?t.print(e.segments[o].raw):t.print_template_string_chars(e.segments[o].value):(t.print("${"),e.segments[o].print(t),t.print("}"));t.print("`");})),e(AST_TemplateSegment,(function(e,t){t.print_template_string_chars(e.value);})),AST_Arrow.DEFMETHOD("_do_print",(function(e){var t=this,n=e.parent(),o=n instanceof AST_Binary&&!(n instanceof AST_Assign)||n instanceof AST_Unary||n instanceof AST_Call&&t===n.expression;o&&e.print("("),t.async&&(e.print("async"),e.space()),1===t.argnames.length&&t.argnames[0]instanceof AST_Symbol?t.argnames[0].print(e):e.with_parens((function(){t.argnames.forEach((function(t,n){n&&e.comma(),t.print(e);}));})),e.space(),e.print("=>"),e.space();const r=t.body[0];if(1===t.body.length&&r instanceof AST_Return){const t=r.value;t?left_is_object(t)?(e.print("("),t.print(e),e.print(")")):t.print(e):e.print("{}");}else i(t,e);o&&e.print(")");})),AST_Exit.DEFMETHOD("_do_print",(function(e,t){if(e.print(t),this.value){e.space();const t=this.value.start.comments_before;t&&t.length&&!e.printed_comments.has(t)?(e.print("("),this.value.print(e),e.print(")")):this.value.print(e);}e.semicolon();})),e(AST_Return,(function(e,t){e._do_print(t,"return");})),e(AST_Throw,(function(e,t){e._do_print(t,"throw");})),e(AST_Yield,(function(e,t){var n=e.is_star?"*":"";t.print("yield"+n),e.expression&&(t.space(),e.expression.print(t));})),e(AST_Await,(function(e,t){t.print("await"),t.space();var n=e.expression,o=!(n instanceof AST_Call||n instanceof AST_SymbolRef||n instanceof AST_PropAccess||n instanceof AST_Unary||n instanceof AST_Constant||n instanceof AST_Await||n instanceof AST_Object);o&&t.print("("),e.expression.print(t),o&&t.print(")");})),AST_LoopControl.DEFMETHOD("_do_print",(function(e,t){e.print(t),this.label&&(e.space(),this.label.print(e)),e.semicolon();})),e(AST_Break,(function(e,t){e._do_print(t,"break");})),e(AST_Continue,(function(e,t){e._do_print(t,"continue");})),e(AST_If,(function(e,t){t.print("if"),t.space(),t.with_parens((function(){e.condition.print(t);})),t.space(),e.alternative?(function(e,t){var n=e.body;if(t.option("braces")||t.option("ie8")&&n instanceof AST_Do)return c(n,t);if(!n)return t.force_semicolon();for(;;)if(n instanceof AST_If){if(!n.alternative)return void c(e.body,t);n=n.alternative;}else {if(!(n instanceof AST_StatementWithBody))break;n=n.body;}l(e.body,t);}(e,t),t.space(),t.print("else"),t.space(),e.alternative instanceof AST_If?e.alternative.print(t):l(e.alternative,t)):e._do_print_body(t);})),e(AST_Switch,(function(e,t){t.print("switch"),t.space(),t.with_parens((function(){e.expression.print(t);})),t.space();var n=e.body.length-1;n<0?o(e,t):t.with_block((function(){e.body.forEach((function(e,o){t.indent(!0),e.print(t),o<n&&e.body.length>0&&t.newline();}));}));})),AST_SwitchBranch.DEFMETHOD("_do_print_body",(function(e){e.newline(),this.body.forEach((function(t){e.indent(),t.print(e),e.newline();}));})),e(AST_Default,(function(e,t){t.print("default:"),e._do_print_body(t);})),e(AST_Case,(function(e,t){t.print("case"),t.space(),e.expression.print(t),t.print(":"),e._do_print_body(t);})),e(AST_Try,(function(e,t){t.print("try"),t.space(),i(e,t),e.bcatch&&(t.space(),e.bcatch.print(t)),e.bfinally&&(t.space(),e.bfinally.print(t));})),e(AST_Catch,(function(e,t){t.print("catch"),e.argname&&(t.space(),t.with_parens((function(){e.argname.print(t);}))),t.space(),i(e,t);})),e(AST_Finally,(function(e,t){t.print("finally"),t.space(),i(e,t);})),AST_Definitions.DEFMETHOD("_do_print",(function(e,t){e.print(t),e.space(),this.definitions.forEach((function(t,n){n&&e.comma(),t.print(e);}));var n=e.parent();(!(n instanceof AST_For||n instanceof AST_ForIn)||n&&n.init!==this)&&e.semicolon();})),e(AST_Let,(function(e,t){e._do_print(t,"let");})),e(AST_Var,(function(e,t){e._do_print(t,"var");})),e(AST_Const,(function(e,t){e._do_print(t,"const");})),e(AST_Import,(function(e,t){t.print("import"),t.space(),e.imported_name&&e.imported_name.print(t),e.imported_name&&e.imported_names&&(t.print(","),t.space()),e.imported_names&&(1===e.imported_names.length&&"*"===e.imported_names[0].foreign_name.name?e.imported_names[0].print(t):(t.print("{"),e.imported_names.forEach((function(n,o){t.space(),n.print(t),o<e.imported_names.length-1&&t.print(",");})),t.space(),t.print("}"))),(e.imported_name||e.imported_names)&&(t.space(),t.print("from"),t.space()),e.module_name.print(t),t.semicolon();})),e(AST_ImportMeta,(function(e,t){t.print("import.meta");})),e(AST_NameMapping,(function(e,t){var n=t.parent()instanceof AST_Import,o=e.name.definition();(o&&o.mangled_name||e.name.name)!==e.foreign_name.name?(n?t.print(e.foreign_name.name):e.name.print(t),t.space(),t.print("as"),t.space(),n?e.name.print(t):t.print(e.foreign_name.name)):e.name.print(t);})),e(AST_Export,(function(e,t){if(t.print("export"),t.space(),e.is_default&&(t.print("default"),t.space()),e.exported_names)1===e.exported_names.length&&"*"===e.exported_names[0].name.name?e.exported_names[0].print(t):(t.print("{"),e.exported_names.forEach((function(n,o){t.space(),n.print(t),o<e.exported_names.length-1&&t.print(",");})),t.space(),t.print("}"));else if(e.exported_value)e.exported_value.print(t);else if(e.exported_definition&&(e.exported_definition.print(t),e.exported_definition instanceof AST_Definitions))return;e.module_name&&(t.space(),t.print("from"),t.space(),e.module_name.print(t)),(e.exported_value&&!(e.exported_value instanceof AST_Defun||e.exported_value instanceof AST_Function||e.exported_value instanceof AST_Class)||e.module_name||e.exported_names)&&t.semicolon();})),e(AST_VarDef,(function(e,t){if(e.name.print(t),e.value){t.space(),t.print("="),t.space();var n=t.parent(1),o=n instanceof AST_For||n instanceof AST_ForIn;r(e.value,t,o);}})),e(AST_Call,(function(e,t){e.expression.print(t),e instanceof AST_New&&0===e.args.length||((e.expression instanceof AST_Call||e.expression instanceof AST_Lambda)&&t.add_mapping(e.start),e.optional&&t.print("?."),t.with_parens((function(){e.args.forEach((function(e,n){n&&t.comma(),e.print(t);}));})));})),e(AST_New,(function(e,t){t.print("new"),t.space(),AST_Call.prototype._codegen(e,t);})),AST_Sequence.DEFMETHOD("_do_print",(function(e){this.expressions.forEach((function(t,n){n>0&&(e.comma(),e.should_break()&&(e.newline(),e.indent())),t.print(e);}));})),e(AST_Sequence,(function(e,t){e._do_print(t);})),e(AST_Dot,(function(e,t){var n=e.expression;n.print(t);var o=e.property,i=RESERVED_WORDS.has(o)?t.option("ie8"):!is_identifier_string(o,t.option("ecma")>=2015||t.option("safari10"));e.optional&&t.print("?."),i?(t.print("["),t.add_mapping(e.end),t.print_string(o),t.print("]")):(n instanceof AST_Number&&n.getValue()>=0&&(/[xa-f.)]/i.test(t.last())||t.print(".")),e.optional||t.print("."),t.add_mapping(e.end),t.print_name(o));})),e(AST_DotHash,(function(e,t){e.expression.print(t);var n=e.property;e.optional&&t.print("?"),t.print(".#"),t.print_name(n);})),e(AST_Sub,(function(e,t){e.expression.print(t),e.optional&&t.print("?."),t.print("["),e.property.print(t),t.print("]");})),e(AST_Chain,(function(e,t){e.expression.print(t);})),e(AST_UnaryPrefix,(function(e,t){var n=e.operator;t.print(n),(/^[a-z]/i.test(n)||/[+-]$/.test(n)&&e.expression instanceof AST_UnaryPrefix&&/^[+-]/.test(e.expression.operator))&&t.space(),e.expression.print(t);})),e(AST_UnaryPostfix,(function(e,t){e.expression.print(t),t.print(e.operator);})),e(AST_Binary,(function(e,t){var n=e.operator;e.left.print(t),">"==n[0]&&e.left instanceof AST_UnaryPostfix&&"--"==e.left.operator?t.print(" "):t.space(),t.print(n),("<"==n||"<<"==n)&&e.right instanceof AST_UnaryPrefix&&"!"==e.right.operator&&e.right.expression instanceof AST_UnaryPrefix&&"--"==e.right.expression.operator?t.print(" "):t.space(),e.right.print(t);})),e(AST_Conditional,(function(e,t){e.condition.print(t),t.space(),t.print("?"),t.space(),e.consequent.print(t),t.space(),t.colon(),e.alternative.print(t);})),e(AST_Array,(function(e,t){t.with_square((function(){var n=e.elements,o=n.length;o>0&&t.space(),n.forEach((function(e,n){n&&t.comma(),e.print(t),n===o-1&&e instanceof AST_Hole&&t.comma();})),o>0&&t.space();}));})),e(AST_Object,(function(e,t){e.properties.length>0?t.with_block((function(){e.properties.forEach((function(e,n){n&&(t.print(","),t.newline()),t.indent(),e.print(t);})),t.newline();})):o(e,t);})),e(AST_Class,(function(e,t){if(t.print("class"),t.space(),e.name&&(e.name.print(t),t.space()),e.extends){var n=!(e.extends instanceof AST_SymbolRef||e.extends instanceof AST_PropAccess||e.extends instanceof AST_ClassExpression||e.extends instanceof AST_Function);t.print("extends"),n?t.print("("):t.space(),e.extends.print(t),n?t.print(")"):t.space();}e.properties.length>0?t.with_block((function(){e.properties.forEach((function(e,n){n&&t.newline(),t.indent(),e.print(t);})),t.newline();})):t.print("{}");})),e(AST_NewTarget,(function(e,t){t.print("new.target");})),e(AST_ObjectKeyVal,(function(e,t){function n(e){var t=e.definition();return t?t.mangled_name||t.name:e.name}var o=t.option("shorthand");o&&e.value instanceof AST_Symbol&&is_identifier_string(e.key,t.option("ecma")>=2015||t.option("safari10"))&&n(e.value)===e.key&&!RESERVED_WORDS.has(e.key)?a(e.key,e.quote,t):o&&e.value instanceof AST_DefaultAssign&&e.value.left instanceof AST_Symbol&&is_identifier_string(e.key,t.option("ecma")>=2015||t.option("safari10"))&&n(e.value.left)===e.key?(a(e.key,e.quote,t),t.space(),t.print("="),t.space(),e.value.right.print(t)):(e.key instanceof AST_Node?t.with_square((function(){e.key.print(t);})):a(e.key,e.quote,t),t.colon(),e.value.print(t));})),e(AST_ClassPrivateProperty,((e,t)=>{e.static&&(t.print("static"),t.space()),t.print("#"),a(e.key.name,e.quote,t),e.value&&(t.print("="),e.value.print(t)),t.semicolon();})),e(AST_ClassProperty,((e,t)=>{e.static&&(t.print("static"),t.space()),e.key instanceof AST_SymbolClassProperty?a(e.key.name,e.quote,t):(t.print("["),e.key.print(t),t.print("]")),e.value&&(t.print("="),e.value.print(t)),t.semicolon();})),AST_ObjectProperty.DEFMETHOD("_print_getter_setter",(function(e,t,n){var o=this;o.static&&(n.print("static"),n.space()),e&&(n.print(e),n.space()),o.key instanceof AST_SymbolMethod?(t&&n.print("#"),a(o.key.name,o.quote,n)):n.with_square((function(){o.key.print(n);})),o.value._do_print(n,!0);})),e(AST_ObjectSetter,(function(e,t){e._print_getter_setter("set",!1,t);})),e(AST_ObjectGetter,(function(e,t){e._print_getter_setter("get",!1,t);})),e(AST_PrivateSetter,(function(e,t){e._print_getter_setter("set",!0,t);})),e(AST_PrivateGetter,(function(e,t){e._print_getter_setter("get",!0,t);})),e(AST_PrivateMethod,(function(e,t){var n;e.is_generator&&e.async?n="async*":e.is_generator?n="*":e.async&&(n="async"),e._print_getter_setter(n,!0,t);})),e(AST_ConciseMethod,(function(e,t){var n;e.is_generator&&e.async?n="async*":e.is_generator?n="*":e.async&&(n="async"),e._print_getter_setter(n,!1,t);})),AST_Symbol.DEFMETHOD("_do_print",(function(e){var t=this.definition();e.print_name(t?t.mangled_name||t.name:this.name);})),e(AST_Symbol,(function(e,t){e._do_print(t);})),e(AST_Hole,noop),e(AST_This,(function(e,t){t.print("this");})),e(AST_Super,(function(e,t){t.print("super");})),e(AST_Constant,(function(e,t){t.print(e.getValue());})),e(AST_String,(function(e,t){t.print_string(e.getValue(),e.quote,t.in_directive);})),e(AST_Number,(function(e,t){(t.option("keep_numbers")||t.use_asm)&&e.raw?t.print(e.raw):t.print(_(e.getValue()));})),e(AST_BigInt,(function(e,t){t.print(e.getValue()+"n");}));const s=/(<\s*\/\s*script)/i,u=(e,t)=>t.replace("/","\\/");function l(e,t){t.option("braces")?c(e,t):!e||e instanceof AST_EmptyStatement?t.force_semicolon():e.print(t);}function _(e){var t,n,o,i=e.toString(10).replace(/^0\./,".").replace("e+","e"),r=[i];return Math.floor(e)===e&&(e<0?r.push("-0x"+(-e).toString(16).toLowerCase()):r.push("0x"+e.toString(16).toLowerCase())),(t=/^\.0+/.exec(i))?(n=t[0].length,o=i.slice(n),r.push(o+"e-"+(o.length+n-1))):(t=/0+$/.exec(i))?(n=t[0].length,r.push(i.slice(0,-n)+"e"+n)):(t=/^(\d)\.(\d+)e(-?\d+)$/.exec(i))&&r.push(t[1]+t[2]+"e"+(t[3]-t[2].length)),function(e){for(var t=e[0],n=t.length,o=1;o<e.length;++o)e[o].length<n&&(n=(t=e[o]).length);return t}(r)}function c(e,t){!e||e instanceof AST_EmptyStatement?t.print("{}"):e instanceof AST_BlockStatement?e.print(t):t.with_block((function(){t.indent(),e.print(t),t.newline();}));}function f(e,t){e.forEach((function(e){e.DEFMETHOD("add_source_map",t);}));}e(AST_RegExp,(function(e,t){let{source:n,flags:o}=e.getValue();n=regexp_source_fix(n),o=o?sort_regexp_flags(o):"",n=n.replace(s,u),t.print(t.to_utf8(`/${n}/${o}`));const i=t.parent();i instanceof AST_Binary&&/^\w/.test(i.operator)&&i.left===e&&t.print(" ");})),f([AST_Node,AST_LabeledStatement,AST_Toplevel],noop),f([AST_Array,AST_BlockStatement,AST_Catch,AST_Class,AST_Constant,AST_Debugger,AST_Definitions,AST_Directive,AST_Finally,AST_Jump,AST_Lambda,AST_New,AST_Object,AST_StatementWithBody,AST_Symbol,AST_Switch,AST_SwitchBranch,AST_TemplateString,AST_TemplateSegment,AST_Try],(function(e){e.add_mapping(this.start);})),f([AST_ObjectGetter,AST_ObjectSetter],(function(e){e.add_mapping(this.start,this.key.name);})),f([AST_ObjectProperty],(function(e){e.add_mapping(this.start,this.key);}));}();const shallow_cmp=(e,t)=>null===e&&null===t||e.TYPE===t.TYPE&&e.shallow_cmp(t),equivalent_to=(e,t)=>{if(!shallow_cmp(e,t))return !1;const n=[e],o=[t],i=n.push.bind(n),r=o.push.bind(o);for(;n.length&&o.length;){const e=n.pop(),t=o.pop();if(!shallow_cmp(e,t))return !1;if(e._children_backwards(i),t._children_backwards(r),n.length!==o.length)return !1}return 0==n.length&&0==o.length},mkshallow=e=>{const t=Object.keys(e).map((t=>{if("eq"===e[t])return `this.${t} === other.${t}`;if("exist"===e[t])return `(this.${t} == null ? other.${t} == null : this.${t} === other.${t})`;throw new Error(`mkshallow: Unexpected instruction: ${e[t]}`)})).join(" && ");return new Function("other","return "+t)},pass_through=()=>!0;AST_Node.prototype.shallow_cmp=function(){throw new Error("did not find a shallow_cmp function for "+this.constructor.name)},AST_Debugger.prototype.shallow_cmp=pass_through,AST_Directive.prototype.shallow_cmp=mkshallow({value:"eq"}),AST_SimpleStatement.prototype.shallow_cmp=pass_through,AST_Block.prototype.shallow_cmp=pass_through,AST_EmptyStatement.prototype.shallow_cmp=pass_through,AST_LabeledStatement.prototype.shallow_cmp=mkshallow({"label.name":"eq"}),AST_Do.prototype.shallow_cmp=pass_through,AST_While.prototype.shallow_cmp=pass_through,AST_For.prototype.shallow_cmp=mkshallow({init:"exist",condition:"exist",step:"exist"}),AST_ForIn.prototype.shallow_cmp=pass_through,AST_ForOf.prototype.shallow_cmp=pass_through,AST_With.prototype.shallow_cmp=pass_through,AST_Toplevel.prototype.shallow_cmp=pass_through,AST_Expansion.prototype.shallow_cmp=pass_through,AST_Lambda.prototype.shallow_cmp=mkshallow({is_generator:"eq",async:"eq"}),AST_Destructuring.prototype.shallow_cmp=mkshallow({is_array:"eq"}),AST_PrefixedTemplateString.prototype.shallow_cmp=pass_through,AST_TemplateString.prototype.shallow_cmp=pass_through,AST_TemplateSegment.prototype.shallow_cmp=mkshallow({value:"eq"}),AST_Jump.prototype.shallow_cmp=pass_through,AST_LoopControl.prototype.shallow_cmp=pass_through,AST_Await.prototype.shallow_cmp=pass_through,AST_Yield.prototype.shallow_cmp=mkshallow({is_star:"eq"}),AST_If.prototype.shallow_cmp=mkshallow({alternative:"exist"}),AST_Switch.prototype.shallow_cmp=pass_through,AST_SwitchBranch.prototype.shallow_cmp=pass_through,AST_Try.prototype.shallow_cmp=mkshallow({bcatch:"exist",bfinally:"exist"}),AST_Catch.prototype.shallow_cmp=mkshallow({argname:"exist"}),AST_Finally.prototype.shallow_cmp=pass_through,AST_Definitions.prototype.shallow_cmp=pass_through,AST_VarDef.prototype.shallow_cmp=mkshallow({value:"exist"}),AST_NameMapping.prototype.shallow_cmp=pass_through,AST_Import.prototype.shallow_cmp=mkshallow({imported_name:"exist",imported_names:"exist"}),AST_ImportMeta.prototype.shallow_cmp=pass_through,AST_Export.prototype.shallow_cmp=mkshallow({exported_definition:"exist",exported_value:"exist",exported_names:"exist",module_name:"eq",is_default:"eq"}),AST_Call.prototype.shallow_cmp=pass_through,AST_Sequence.prototype.shallow_cmp=pass_through,AST_PropAccess.prototype.shallow_cmp=pass_through,AST_Chain.prototype.shallow_cmp=pass_through,AST_Dot.prototype.shallow_cmp=mkshallow({property:"eq"}),AST_Unary.prototype.shallow_cmp=mkshallow({operator:"eq"}),AST_Binary.prototype.shallow_cmp=mkshallow({operator:"eq"}),AST_Conditional.prototype.shallow_cmp=pass_through,AST_Array.prototype.shallow_cmp=pass_through,AST_Object.prototype.shallow_cmp=pass_through,AST_ObjectProperty.prototype.shallow_cmp=pass_through,AST_ObjectKeyVal.prototype.shallow_cmp=mkshallow({key:"eq"}),AST_ObjectSetter.prototype.shallow_cmp=mkshallow({static:"eq"}),AST_ObjectGetter.prototype.shallow_cmp=mkshallow({static:"eq"}),AST_ConciseMethod.prototype.shallow_cmp=mkshallow({static:"eq",is_generator:"eq",async:"eq"}),AST_Class.prototype.shallow_cmp=mkshallow({name:"exist",extends:"exist"}),AST_ClassProperty.prototype.shallow_cmp=mkshallow({static:"eq"}),AST_Symbol.prototype.shallow_cmp=mkshallow({name:"eq"}),AST_NewTarget.prototype.shallow_cmp=pass_through,AST_This.prototype.shallow_cmp=pass_through,AST_Super.prototype.shallow_cmp=pass_through,AST_String.prototype.shallow_cmp=mkshallow({value:"eq"}),AST_Number.prototype.shallow_cmp=mkshallow({value:"eq"}),AST_BigInt.prototype.shallow_cmp=mkshallow({value:"eq"}),AST_RegExp.prototype.shallow_cmp=function(e){return this.value.flags===e.value.flags&&this.value.source===e.value.source},AST_Atom.prototype.shallow_cmp=pass_through;let function_defs=null,unmangleable_names=null;class SymbolDef{constructor(e,t,n){this.name=t.name,this.orig=[t],this.init=n,this.eliminated=0,this.assignments=0,this.scope=e,this.replaced=0,this.global=!1,this.export=0,this.mangled_name=null,this.undeclared=!1,this.id=SymbolDef.next_id++,this.chained=!1,this.direct_access=!1,this.escaped=0,this.recursive_refs=0,this.references=[],this.should_replace=void 0,this.single_use=!1,this.fixed=!1,Object.seal(this);}fixed_value(){return !this.fixed||this.fixed instanceof AST_Node?this.fixed:this.fixed()}unmangleable(e){return e||(e={}),!!(function_defs&&function_defs.has(this.id)&&keep_name(e.keep_fnames,this.orig[0].name))||this.global&&!e.toplevel||1&this.export||this.undeclared||!e.eval&&this.scope.pinned()||(this.orig[0]instanceof AST_SymbolLambda||this.orig[0]instanceof AST_SymbolDefun)&&keep_name(e.keep_fnames,this.orig[0].name)||this.orig[0]instanceof AST_SymbolMethod||(this.orig[0]instanceof AST_SymbolClass||this.orig[0]instanceof AST_SymbolDefClass)&&keep_name(e.keep_classnames,this.orig[0].name)}mangle(e){const t=e.cache&&e.cache.props;if(this.global&&t&&t.has(this.name))this.mangled_name=t.get(this.name);else if(!this.mangled_name&&!this.unmangleable(e)){var n=this.scope,o=this.orig[0];e.ie8&&o instanceof AST_SymbolLambda&&(n=n.parent_scope);const i=redefined_catch_def(this);this.mangled_name=i?i.mangled_name||i.name:n.next_mangled(e,this),this.global&&t&&t.set(this.name,this.mangled_name);}}}function redefined_catch_def(e){if(e.orig[0]instanceof AST_SymbolCatch&&e.scope.is_block_scope())return e.scope.get_defun_scope().variables.get(e.name)}function find_scopes_visible_from(e){const t=new Set;for(const n of new Set(e))!function e(n){null==n||t.has(n)||(t.add(n),e(n.parent_scope));}(n);return [...t]}function next_mangled(e,t){var n=e.enclosed;e:for(;;){var o=base54(++e.cname);if(!RESERVED_WORDS.has(o)&&!(t.reserved.has(o)||unmangleable_names&&unmangleable_names.has(o))){for(let e=n.length;--e>=0;){const i=n[e];if(o==(i.mangled_name||i.unmangleable(t)&&i.name))continue e}return o}}}SymbolDef.next_id=1,AST_Scope.DEFMETHOD("figure_out_scope",(function(e,{parent_scope:t=null,toplevel:n=this}={}){if(e=defaults$1(e,{cache:null,ie8:!1,safari10:!1}),!(n instanceof AST_Toplevel))throw new Error("Invalid toplevel scope");var o=this.parent_scope=t,i=new Map,r=null,a=null,s=[],u=new TreeWalker(((t,n)=>{if(t.is_block_scope()){const i=o;t.block_scope=o=new AST_Scope(t),o._block_scope=!0;const r=t instanceof AST_Catch?i.parent_scope:i;if(o.init_scope_vars(r),o.uses_with=i.uses_with,o.uses_eval=i.uses_eval,e.safari10&&(t instanceof AST_For||t instanceof AST_ForIn)&&s.push(o),t instanceof AST_Switch){const e=o;o=i,t.expression.walk(u),o=e;for(let e=0;e<t.body.length;e++)t.body[e].walk(u);}else n();return o=i,!0}if(t instanceof AST_Destructuring){const e=a;return a=t,n(),a=e,!0}if(t instanceof AST_Scope){t.init_scope_vars(o);var _=o,c=r,f=i;return r=o=t,i=new Map,n(),o=_,r=c,i=f,!0}if(t instanceof AST_LabeledStatement){var p=t.label;if(i.has(p.name))throw new Error(string_template("Label {name} defined twice",p));return i.set(p.name,p),n(),i.delete(p.name),!0}if(t instanceof AST_With)for(var d=o;d;d=d.parent_scope)d.uses_with=!0;else {if(t instanceof AST_Symbol&&(t.scope=o),t instanceof AST_Label&&(t.thedef=t,t.references=[]),t instanceof AST_SymbolLambda)r.def_function(t,"arguments"==t.name?void 0:r);else if(t instanceof AST_SymbolDefun)l((t.scope=r.parent_scope.get_defun_scope()).def_function(t,r),1);else if(t instanceof AST_SymbolClass)l(r.def_variable(t,r),1);else if(t instanceof AST_SymbolImport)o.def_variable(t);else if(t instanceof AST_SymbolDefClass)l((t.scope=r.parent_scope).def_function(t,r),1);else if(t instanceof AST_SymbolVar||t instanceof AST_SymbolLet||t instanceof AST_SymbolConst||t instanceof AST_SymbolCatch){if((S=t instanceof AST_SymbolBlockDeclaration?o.def_variable(t,null):r.def_variable(t,"SymbolVar"==t.TYPE?null:void 0)).orig.every((e=>e===t||(t instanceof AST_SymbolBlockDeclaration?e instanceof AST_SymbolLambda:!(e instanceof AST_SymbolLet||e instanceof AST_SymbolConst))))||js_error(`"${t.name}" is redeclared`,t.start.file,t.start.line,t.start.col,t.start.pos),t instanceof AST_SymbolFunarg||l(S,2),r!==o){t.mark_enclosed();var S=o.find_variable(t);t.thedef!==S&&(t.thedef=S,t.reference());}}else if(t instanceof AST_LabelRef){var m=i.get(t.name);if(!m)throw new Error(string_template("Undefined label {name} [{line},{col}]",{name:t.name,line:t.start.line,col:t.start.col}));t.thedef=m;}o instanceof AST_Toplevel||!(t instanceof AST_Export||t instanceof AST_Import)||js_error(`"${t.TYPE}" statement may only appear at the top level`,t.start.file,t.start.line,t.start.col,t.start.pos);}}));function l(e,t){if(a){var n=0;do{t++;}while(u.parent(n++)!==a)}var o=u.parent(t);if(e.export=o instanceof AST_Export?1:0){var i=o.exported_definition;(i instanceof AST_Defun||i instanceof AST_DefClass)&&o.is_default&&(e.export=2);}}if(this.walk(u),this instanceof AST_Toplevel&&(this.globals=new Map),u=new TreeWalker((e=>{if(e instanceof AST_LoopControl&&e.label)return e.label.thedef.references.push(e),!0;if(e instanceof AST_SymbolRef){var t,o=e.name;if("eval"==o&&u.parent()instanceof AST_Call)for(var i=e.scope;i&&!i.uses_eval;i=i.parent_scope)i.uses_eval=!0;return u.parent()instanceof AST_NameMapping&&u.parent(1).module_name||!(t=e.scope.find_variable(o))?(t=n.def_global(e),e instanceof AST_SymbolExport&&(t.export=1)):t.scope instanceof AST_Lambda&&"arguments"==o&&(t.scope.uses_arguments=!0),e.thedef=t,e.reference(),!e.scope.is_block_scope()||t.orig[0]instanceof AST_SymbolBlockDeclaration||(e.scope=e.scope.get_defun_scope()),!0}var r;if(e instanceof AST_SymbolCatch&&(r=redefined_catch_def(e.definition())))for(i=e.scope;i&&(push_uniq(i.enclosed,r),i!==r.scope);)i=i.parent_scope;})),this.walk(u),(e.ie8||e.safari10)&&walk$3(this,(e=>{if(e instanceof AST_SymbolCatch){var t=e.name,o=e.thedef.references,i=e.scope.get_defun_scope(),r=i.find_variable(t)||n.globals.get(t)||i.def_variable(e);return o.forEach((function(e){e.thedef=r,e.reference();})),e.thedef=r,e.reference(),!0}})),e.safari10)for(const e of s)e.parent_scope.variables.forEach((function(t){push_uniq(e.enclosed,t);}));})),AST_Toplevel.DEFMETHOD("def_global",(function(e){var t=this.globals,n=e.name;if(t.has(n))return t.get(n);var o=new SymbolDef(this,e);return o.undeclared=!0,o.global=!0,t.set(n,o),o})),AST_Scope.DEFMETHOD("init_scope_vars",(function(e){this.variables=new Map,this.functions=new Map,this.uses_with=!1,this.uses_eval=!1,this.parent_scope=e,this.enclosed=[],this.cname=-1;})),AST_Scope.DEFMETHOD("conflicting_def",(function(e){return this.enclosed.find((t=>t.name===e))||this.variables.has(e)||this.parent_scope&&this.parent_scope.conflicting_def(e)})),AST_Scope.DEFMETHOD("conflicting_def_shallow",(function(e){return this.enclosed.find((t=>t.name===e))||this.variables.has(e)})),AST_Scope.DEFMETHOD("add_child_scope",(function(e){if(e.parent_scope===this)return;e.parent_scope=this;const t=(()=>{const e=[];let t=this;do{e.push(t);}while(t=t.parent_scope);return e.reverse(),e})(),n=new Set(e.enclosed),o=[];for(const e of t){o.forEach((t=>push_uniq(e.enclosed,t)));for(const t of e.variables.values())n.has(t)&&(push_uniq(o,t),push_uniq(e.enclosed,t));}})),AST_Scope.DEFMETHOD("create_symbol",(function(e,{source:t,tentative_name:n,scope:o,conflict_scopes:i=[o],init:r=null}={}){let a;if(i=find_scopes_visible_from(i),n){n=a=n.replace(/(?:^[^a-z_$]|[^a-z0-9_$])/gi,"_");let e=0;for(;i.find((e=>e.conflicting_def_shallow(a)));)a=n+"$"+e++;}if(!a)throw new Error("No symbol name could be generated in create_symbol()");const s=make_node(e,t,{name:a,scope:o});return this.def_variable(s,r||null),s.mark_enclosed(),s})),AST_Node.DEFMETHOD("is_block_scope",return_false),AST_Class.DEFMETHOD("is_block_scope",return_false),AST_Lambda.DEFMETHOD("is_block_scope",return_false),AST_Toplevel.DEFMETHOD("is_block_scope",return_false),AST_SwitchBranch.DEFMETHOD("is_block_scope",return_false),AST_Block.DEFMETHOD("is_block_scope",return_true),AST_Scope.DEFMETHOD("is_block_scope",(function(){return this._block_scope||!1})),AST_IterationStatement.DEFMETHOD("is_block_scope",return_true),AST_Lambda.DEFMETHOD("init_scope_vars",(function(){AST_Scope.prototype.init_scope_vars.apply(this,arguments),this.uses_arguments=!1,this.def_variable(new AST_SymbolFunarg({name:"arguments",start:this.start,end:this.end}));})),AST_Arrow.DEFMETHOD("init_scope_vars",(function(){AST_Scope.prototype.init_scope_vars.apply(this,arguments),this.uses_arguments=!1;})),AST_Symbol.DEFMETHOD("mark_enclosed",(function(){for(var e=this.definition(),t=this.scope;t&&(push_uniq(t.enclosed,e),t!==e.scope);)t=t.parent_scope;})),AST_Symbol.DEFMETHOD("reference",(function(){this.definition().references.push(this),this.mark_enclosed();})),AST_Scope.DEFMETHOD("find_variable",(function(e){return e instanceof AST_Symbol&&(e=e.name),this.variables.get(e)||this.parent_scope&&this.parent_scope.find_variable(e)})),AST_Scope.DEFMETHOD("def_function",(function(e,t){var n=this.def_variable(e,t);return (!n.init||n.init instanceof AST_Defun)&&(n.init=t),this.functions.set(e.name,n),n})),AST_Scope.DEFMETHOD("def_variable",(function(e,t){var n=this.variables.get(e.name);return n?(n.orig.push(e),n.init&&(n.scope!==e.scope||n.init instanceof AST_Function)&&(n.init=t)):(n=new SymbolDef(this,e,t),this.variables.set(e.name,n),n.global=!this.parent_scope),e.thedef=n})),AST_Scope.DEFMETHOD("next_mangled",(function(e){return next_mangled(this,e)})),AST_Toplevel.DEFMETHOD("next_mangled",(function(e){let t;const n=this.mangled_names;do{t=next_mangled(this,e);}while(n.has(t));return t})),AST_Function.DEFMETHOD("next_mangled",(function(e,t){for(var n=t.orig[0]instanceof AST_SymbolFunarg&&this.name&&this.name.definition(),o=n?n.mangled_name||n.name:null;;){var i=next_mangled(this,e);if(!o||o!=i)return i}})),AST_Symbol.DEFMETHOD("unmangleable",(function(e){var t=this.definition();return !t||t.unmangleable(e)})),AST_Label.DEFMETHOD("unmangleable",return_false),AST_Symbol.DEFMETHOD("unreferenced",(function(){return !this.definition().references.length&&!this.scope.pinned()})),AST_Symbol.DEFMETHOD("definition",(function(){return this.thedef})),AST_Symbol.DEFMETHOD("global",(function(){return this.thedef.global})),AST_Toplevel.DEFMETHOD("_default_mangler_options",(function(e){return (e=defaults$1(e,{eval:!1,ie8:!1,keep_classnames:!1,keep_fnames:!1,module:!1,reserved:[],toplevel:!1})).module&&(e.toplevel=!0),Array.isArray(e.reserved)||e.reserved instanceof Set||(e.reserved=[]),e.reserved=new Set(e.reserved),e.reserved.add("arguments"),e})),AST_Toplevel.DEFMETHOD("mangle_names",(function(e){e=this._default_mangler_options(e);var t=-1,n=[];e.keep_fnames&&(function_defs=new Set);const o=this.mangled_names=new Set;e.cache&&(this.globals.forEach(r),e.cache.props&&e.cache.props.forEach((function(e){o.add(e);})));var i=new TreeWalker((function(o,i){if(o instanceof AST_LabeledStatement){var a=t;return i(),t=a,!0}if(o instanceof AST_Scope)o.variables.forEach(r);else if(o.is_block_scope())o.block_scope.variables.forEach(r);else if(function_defs&&o instanceof AST_VarDef&&o.value instanceof AST_Lambda&&!o.value.name&&keep_name(e.keep_fnames,o.name.name))function_defs.add(o.name.definition().id);else {if(o instanceof AST_Label){let e;do{e=base54(++t);}while(RESERVED_WORDS.has(e));return o.mangled_name=e,!0}!e.ie8&&!e.safari10&&o instanceof AST_SymbolCatch&&n.push(o.definition());}}));function r(t){!(e.reserved.has(t.name)||1&t.export)&&n.push(t);}this.walk(i),(e.keep_fnames||e.keep_classnames)&&(unmangleable_names=new Set,n.forEach((t=>{t.name.length<6&&t.unmangleable(e)&&unmangleable_names.add(t.name);}))),n.forEach((t=>{t.mangle(e);})),function_defs=null,unmangleable_names=null;})),AST_Toplevel.DEFMETHOD("find_colliding_names",(function(e){const t=e.cache&&e.cache.props,n=new Set;return e.reserved.forEach(o),this.globals.forEach(i),this.walk(new TreeWalker((function(e){e instanceof AST_Scope&&e.variables.forEach(i),e instanceof AST_SymbolCatch&&i(e.definition());}))),n;function o(e){n.add(e);}function i(n){var i=n.name;if(n.global&&t&&t.has(i))i=t.get(i);else if(!n.unmangleable(e))return;o(i);}})),AST_Toplevel.DEFMETHOD("expand_names",(function(e){base54.reset(),base54.sort(),e=this._default_mangler_options(e);var t=this.find_colliding_names(e),n=0;function o(o){if(o.global&&e.cache)return;if(o.unmangleable(e))return;if(e.reserved.has(o.name))return;const i=redefined_catch_def(o),r=o.name=i?i.name:function(){var e;do{e=base54(n++);}while(t.has(e)||RESERVED_WORDS.has(e));return e}();o.orig.forEach((function(e){e.name=r;})),o.references.forEach((function(e){e.name=r;}));}this.globals.forEach(o),this.walk(new TreeWalker((function(e){e instanceof AST_Scope&&e.variables.forEach(o),e instanceof AST_SymbolCatch&&o(e.definition());})));})),AST_Node.DEFMETHOD("tail_node",return_this),AST_Sequence.DEFMETHOD("tail_node",(function(){return this.expressions[this.expressions.length-1]})),AST_Toplevel.DEFMETHOD("compute_char_frequency",(function(e){e=this._default_mangler_options(e);try{AST_Node.prototype.print=function(n,o){this._print(n,o),this instanceof AST_Symbol&&!this.unmangleable(e)?base54.consider(this.name,-1):e.properties&&(this instanceof AST_DotHash?base54.consider("#"+this.property,-1):this instanceof AST_Dot?base54.consider(this.property,-1):this instanceof AST_Sub&&t(this.property));},base54.consider(this.print_to_string(),1);}finally{AST_Node.prototype.print=AST_Node.prototype._print;}function t(e){e instanceof AST_String?base54.consider(e.value,-1):e instanceof AST_Conditional?(t(e.consequent),t(e.alternative)):e instanceof AST_Sequence&&t(e.tail_node());}base54.sort();}));const base54=(()=>{const e="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_".split(""),t="0123456789".split("");let n,o;function i(){o=new Map,e.forEach((function(e){o.set(e,0);})),t.forEach((function(e){o.set(e,0);}));}function r(e,t){return o.get(t)-o.get(e)}function a(e){var t="",o=54;e++;do{e--,t+=n[e%o],e=Math.floor(e/o),o=64;}while(e>0);return t}return a.consider=function(e,t){for(var n=e.length;--n>=0;)o.set(e[n],o.get(e[n])+t);},a.sort=function(){n=mergeSort(e,r).concat(mergeSort(t,r));},a.reset=i,i(),a})();let mangle_options;AST_Node.prototype.size=function(e,t){mangle_options=e&&e.mangle_options;let n=0;return walk_parent(this,((e,t)=>{if(n+=e._size(t),e instanceof AST_Arrow&&e.is_braceless())return n+=e.body[0].value._size(t),!0}),t||e&&e.stack),mangle_options=void 0,n},AST_Node.prototype._size=()=>0,AST_Debugger.prototype._size=()=>8,AST_Directive.prototype._size=function(){return 2+this.value.length};const list_overhead=e=>e.length&&e.length-1;AST_Block.prototype._size=function(){return 2+list_overhead(this.body)},AST_Toplevel.prototype._size=function(){return list_overhead(this.body)},AST_EmptyStatement.prototype._size=()=>1,AST_LabeledStatement.prototype._size=()=>2,AST_Do.prototype._size=()=>9,AST_While.prototype._size=()=>7,AST_For.prototype._size=()=>8,AST_ForIn.prototype._size=()=>8,AST_With.prototype._size=()=>6,AST_Expansion.prototype._size=()=>3;const lambda_modifiers=e=>(e.is_generator?1:0)+(e.async?6:0);AST_Accessor.prototype._size=function(){return lambda_modifiers(this)+4+list_overhead(this.argnames)+list_overhead(this.body)},AST_Function.prototype._size=function(e){return 2*!!first_in_statement(e)+lambda_modifiers(this)+12+list_overhead(this.argnames)+list_overhead(this.body)},AST_Defun.prototype._size=function(){return lambda_modifiers(this)+13+list_overhead(this.argnames)+list_overhead(this.body)},AST_Arrow.prototype._size=function(){let e=2+list_overhead(this.argnames);1===this.argnames.length&&this.argnames[0]instanceof AST_Symbol||(e+=2);const t=this.is_braceless()?0:list_overhead(this.body)+2;return lambda_modifiers(this)+e+t},AST_Destructuring.prototype._size=()=>2,AST_TemplateString.prototype._size=function(){return 2+3*Math.floor(this.segments.length/2)},AST_TemplateSegment.prototype._size=function(){return this.value.length},AST_Return.prototype._size=function(){return this.value?7:6},AST_Throw.prototype._size=()=>6,AST_Break.prototype._size=function(){return this.label?6:5},AST_Continue.prototype._size=function(){return this.label?9:8},AST_If.prototype._size=()=>4,AST_Switch.prototype._size=function(){return 8+list_overhead(this.body)},AST_Case.prototype._size=function(){return 5+list_overhead(this.body)},AST_Default.prototype._size=function(){return 8+list_overhead(this.body)},AST_Try.prototype._size=function(){return 3+list_overhead(this.body)},AST_Catch.prototype._size=function(){let e=7+list_overhead(this.body);return this.argname&&(e+=2),e},AST_Finally.prototype._size=function(){return 7+list_overhead(this.body)};const def_size=(e,t)=>e+list_overhead(t.definitions);AST_Var.prototype._size=function(){return def_size(4,this)},AST_Let.prototype._size=function(){return def_size(4,this)},AST_Const.prototype._size=function(){return def_size(6,this)},AST_VarDef.prototype._size=function(){return this.value?1:0},AST_NameMapping.prototype._size=function(){return this.name?4:0},AST_Import.prototype._size=function(){let e=6;return this.imported_name&&(e+=1),(this.imported_name||this.imported_names)&&(e+=5),this.imported_names&&(e+=2+list_overhead(this.imported_names)),e},AST_ImportMeta.prototype._size=()=>11,AST_Export.prototype._size=function(){let e=7+(this.is_default?8:0);return this.exported_value&&(e+=this.exported_value._size()),this.exported_names&&(e+=2+list_overhead(this.exported_names)),this.module_name&&(e+=5),e},AST_Call.prototype._size=function(){return this.optional?4+list_overhead(this.args):2+list_overhead(this.args)},AST_New.prototype._size=function(){return 6+list_overhead(this.args)},AST_Sequence.prototype._size=function(){return list_overhead(this.expressions)},AST_Dot.prototype._size=function(){return this.optional?this.property.length+2:this.property.length+1},AST_DotHash.prototype._size=function(){return this.optional?this.property.length+3:this.property.length+2},AST_Sub.prototype._size=function(){return this.optional?4:2},AST_Unary.prototype._size=function(){return "typeof"===this.operator?7:"void"===this.operator?5:this.operator.length},AST_Binary.prototype._size=function(e){if("in"===this.operator)return 4;let t=this.operator.length;return ("+"===this.operator||"-"===this.operator)&&this.right instanceof AST_Unary&&this.right.operator===this.operator&&(t+=1),this.needs_parens(e)&&(t+=2),t},AST_Conditional.prototype._size=()=>3,AST_Array.prototype._size=function(){return 2+list_overhead(this.elements)},AST_Object.prototype._size=function(e){let t=2;return first_in_statement(e)&&(t+=2),t+list_overhead(this.properties)};const key_size=e=>"string"==typeof e?e.length:0;AST_ObjectKeyVal.prototype._size=function(){return key_size(this.key)+1};const static_size=e=>e?7:0;AST_ObjectGetter.prototype._size=function(){return 5+static_size(this.static)+key_size(this.key)},AST_ObjectSetter.prototype._size=function(){return 5+static_size(this.static)+key_size(this.key)},AST_ConciseMethod.prototype._size=function(){return static_size(this.static)+key_size(this.key)+lambda_modifiers(this)},AST_PrivateMethod.prototype._size=function(){return AST_ConciseMethod.prototype._size.call(this)+1},AST_PrivateGetter.prototype._size=AST_PrivateSetter.prototype._size=function(){return AST_ConciseMethod.prototype._size.call(this)+4},AST_Class.prototype._size=function(){return (this.name?8:7)+(this.extends?8:0)},AST_ClassProperty.prototype._size=function(){return static_size(this.static)+("string"==typeof this.key?this.key.length+2:0)+(this.value?1:0)},AST_ClassPrivateProperty.prototype._size=function(){return AST_ClassProperty.prototype._size.call(this)+1},AST_Symbol.prototype._size=function(){return !mangle_options||this.definition().unmangleable(mangle_options)?this.name.length:1},AST_SymbolClassProperty.prototype._size=function(){return this.name.length},AST_SymbolRef.prototype._size=AST_SymbolDeclaration.prototype._size=function(){const{name:e,thedef:t}=this;return t&&t.global?e.length:"arguments"===e?9:AST_Symbol.prototype._size.call(this)},AST_NewTarget.prototype._size=()=>10,AST_SymbolImportForeign.prototype._size=function(){return this.name.length},AST_SymbolExportForeign.prototype._size=function(){return this.name.length},AST_This.prototype._size=()=>4,AST_Super.prototype._size=()=>5,AST_String.prototype._size=function(){return this.value.length+2},AST_Number.prototype._size=function(){const{value:e}=this;return 0===e?1:e>0&&Math.floor(e)===e?Math.floor(Math.log10(e)+1):e.toString().length},AST_BigInt.prototype._size=function(){return this.value.length},AST_RegExp.prototype._size=function(){return this.value.toString().length},AST_Null.prototype._size=()=>4,AST_NaN.prototype._size=()=>3,AST_Undefined.prototype._size=()=>6,AST_Hole.prototype._size=()=>0,AST_Infinity.prototype._size=()=>8,AST_True.prototype._size=()=>4,AST_False.prototype._size=()=>5,AST_Await.prototype._size=()=>6,AST_Yield.prototype._size=()=>6;const TOP=1024,has_flag=(e,t)=>e.flags&t,set_flag=(e,t)=>{e.flags|=t;},clear_flag=(e,t)=>{e.flags&=~t;};class Compressor extends TreeWalker{constructor(e,{false_by_default:t=!1,mangle_options:n=!1}){super(),void 0===e.defaults||e.defaults||(t=!0),this.options=defaults$1(e,{arguments:!1,arrows:!t,booleans:!t,booleans_as_integers:!1,collapse_vars:!t,comparisons:!t,computed_props:!t,conditionals:!t,dead_code:!t,defaults:!0,directives:!t,drop_console:!1,drop_debugger:!t,ecma:5,evaluate:!t,expression:!1,global_defs:!1,hoist_funs:!1,hoist_props:!t,hoist_vars:!1,ie8:!1,if_return:!t,inline:!t,join_vars:!t,keep_classnames:!1,keep_fargs:!0,keep_fnames:!1,keep_infinity:!1,loops:!t,module:!1,negate_iife:!t,passes:1,properties:!t,pure_getters:!t&&"strict",pure_funcs:null,reduce_funcs:null,reduce_vars:!t,sequences:!t,side_effects:!t,switches:!t,top_retain:null,toplevel:!(!e||!e.top_retain),typeofs:!t,unsafe:!1,unsafe_arrows:!1,unsafe_comps:!1,unsafe_Function:!1,unsafe_math:!1,unsafe_symbols:!1,unsafe_methods:!1,unsafe_proto:!1,unsafe_regexp:!1,unsafe_undefined:!1,unused:!t,warnings:!1},!0);var o=this.options.global_defs;if("object"==typeof o)for(var i in o)"@"===i[0]&&HOP(o,i)&&(o[i.slice(1)]=parse$5(o[i],{expression:!0}));!0===this.options.inline&&(this.options.inline=3);var r=this.options.pure_funcs;this.pure_funcs="function"==typeof r?r:r?function(e){return !r.includes(e.expression.print_to_string())}:return_true;var a=this.options.top_retain;a instanceof RegExp?this.top_retain=function(e){return a.test(e.name)}:"function"==typeof a?this.top_retain=a:a&&("string"==typeof a&&(a=a.split(/,/)),this.top_retain=function(e){return a.includes(e.name)}),this.options.module&&(this.directives["use strict"]=!0,this.options.toplevel=!0);var s=this.options.toplevel;this.toplevel="string"==typeof s?{funcs:/funcs/.test(s),vars:/vars/.test(s)}:{funcs:s,vars:s};var u=this.options.sequences;this.sequences_limit=1==u?800:0|u,this.evaluated_regexps=new Map,this._toplevel=void 0,this.mangle_options=n;}option(e){return this.options[e]}exposed(e){if(e.export)return !0;if(e.global)for(var t=0,n=e.orig.length;t<n;t++)if(!this.toplevel[e.orig[t]instanceof AST_SymbolDefun?"funcs":"vars"])return !0;return !1}in_boolean_context(){if(!this.option("booleans"))return !1;for(var e,t=this.self(),n=0;e=this.parent(n);n++){if(e instanceof AST_SimpleStatement||e instanceof AST_Conditional&&e.condition===t||e instanceof AST_DWLoop&&e.condition===t||e instanceof AST_For&&e.condition===t||e instanceof AST_If&&e.condition===t||e instanceof AST_UnaryPrefix&&"!"==e.operator&&e.expression===t)return !0;if(!(e instanceof AST_Binary&&("&&"==e.operator||"||"==e.operator||"??"==e.operator)||e instanceof AST_Conditional||e.tail_node()===t))return !1;t=e;}}get_toplevel(){return this._toplevel}compress(e){e=e.resolve_defines(this),this._toplevel=e,this.option("expression")&&this._toplevel.process_expression(!0);for(var t=+this.options.passes||1,n=1/0,o=!1,i={ie8:this.option("ie8")},r=0;r<t;r++)if(this._toplevel.figure_out_scope(i),0===r&&this.option("drop_console")&&(this._toplevel=this._toplevel.drop_console()),(r>0||this.option("reduce_vars"))&&this._toplevel.reset_opt_flags(this),this._toplevel=this._toplevel.transform(this),t>1){let e=0;if(walk$3(this._toplevel,(()=>{e++;})),e<n)n=e,o=!1;else {if(o)break;o=!0;}}return this.option("expression")&&this._toplevel.process_expression(!1),e=this._toplevel,this._toplevel=void 0,e}before(e,t){if(has_flag(e,256))return e;var n=!1;e instanceof AST_Scope&&(e=(e=e.hoist_properties(this)).hoist_declarations(this),n=!0),t(e,this),t(e,this);var o=e.optimize(this);return n&&o instanceof AST_Scope&&(o.drop_unused(this),t(o,this)),o===e&&set_flag(o,256),o}}function def_optimize(e,t){e.DEFMETHOD("optimize",(function(e){var n=this;if(has_flag(n,512))return n;if(e.has_directive("use asm"))return n;var o=t(n,e);return set_flag(o,512),o}));}function read_property(e,t){if(!((t=get_value(t))instanceof AST_Node)){var n;if(e instanceof AST_Array){var o=e.elements;if("length"==t)return make_node_from_constant(o.length,e);"number"==typeof t&&t in o&&(n=o[t]);}else if(e instanceof AST_Object){t=""+t;for(var i=e.properties,r=i.length;--r>=0;){if(!(i[r]instanceof AST_ObjectKeyVal))return;n||i[r].key!==t||(n=i[r].value);}}return n instanceof AST_SymbolRef&&n.fixed_value()||n}}function is_modified(e,t,n,o,i,r){var a=t.parent(i),s=is_lhs(n,a);if(s)return s;if(!r&&a instanceof AST_Call&&a.expression===n&&!(o instanceof AST_Arrow)&&!(o instanceof AST_Class)&&!a.is_expr_pure(e)&&(!(o instanceof AST_Function)||!(a instanceof AST_New)&&o.contains_this()))return !0;if(a instanceof AST_Array)return is_modified(e,t,a,a,i+1);if(a instanceof AST_ObjectKeyVal&&n===a.value){var u=t.parent(i+1);return is_modified(e,t,u,u,i+2)}if(a instanceof AST_PropAccess&&a.expression===n){var l=read_property(o,a.property);return !r&&is_modified(e,t,a,l,i+1)}}function is_func_expr(e){return e instanceof AST_Arrow||e instanceof AST_Function}function is_lhs_read_only(e){if(e instanceof AST_This)return !0;if(e instanceof AST_SymbolRef)return e.definition().orig[0]instanceof AST_SymbolLambda;if(e instanceof AST_PropAccess){if((e=e.expression)instanceof AST_SymbolRef){if(e.is_immutable())return !1;e=e.fixed_value();}return !e||!(e instanceof AST_RegExp)&&(e instanceof AST_Constant||is_lhs_read_only(e))}return !1}function is_ref_of(e,t){if(!(e instanceof AST_SymbolRef))return !1;for(var n=e.definition().orig,o=n.length;--o>=0;)if(n[o]instanceof t)return !0}function find_scope(e){for(let t=0;;t++){const n=e.parent(t);if(n instanceof AST_Toplevel)return n;if(n instanceof AST_Lambda)return n;if(n.block_scope)return n.block_scope}}function find_variable(e,t){for(var n,o=0;(n=e.parent(o++))&&!(n instanceof AST_Scope);)if(n instanceof AST_Catch&&n.argname){n=n.argname.definition().scope;break}return n.find_variable(t)}function make_sequence(e,t){if(1==t.length)return t[0];if(0==t.length)throw new Error("trying to create a sequence with length zero!");return make_node(AST_Sequence,e,{expressions:t.reduce(merge_sequence,[])})}function make_node_from_constant(e,t){switch(typeof e){case"string":return make_node(AST_String,t,{value:e});case"number":return isNaN(e)?make_node(AST_NaN,t):isFinite(e)?1/e<0?make_node(AST_UnaryPrefix,t,{operator:"-",expression:make_node(AST_Number,t,{value:-e})}):make_node(AST_Number,t,{value:e}):e<0?make_node(AST_UnaryPrefix,t,{operator:"-",expression:make_node(AST_Infinity,t)}):make_node(AST_Infinity,t);case"boolean":return make_node(e?AST_True:AST_False,t);case"undefined":return make_node(AST_Undefined,t);default:if(null===e)return make_node(AST_Null,t,{value:null});if(e instanceof RegExp)return make_node(AST_RegExp,t,{value:{source:regexp_source_fix(e.source),flags:e.flags}});throw new Error(string_template("Can't handle constant of type: {type}",{type:typeof e}))}}function maintain_this_binding(e,t,n){return e instanceof AST_UnaryPrefix&&"delete"==e.operator||e instanceof AST_Call&&e.expression===t&&(n instanceof AST_PropAccess||n instanceof AST_SymbolRef&&"eval"==n.name)?make_sequence(t,[make_node(AST_Number,t,{value:0}),n]):n}function merge_sequence(e,t){return t instanceof AST_Sequence?e.push(...t.expressions):e.push(t),e}function as_statement_array(e){if(null===e)return [];if(e instanceof AST_BlockStatement)return e.body;if(e instanceof AST_EmptyStatement)return [];if(e instanceof AST_Statement)return [e];throw new Error("Can't convert thing to statement array")}function is_empty(e){return null===e||e instanceof AST_EmptyStatement||e instanceof AST_BlockStatement&&0==e.body.length}function can_be_evicted_from_block(e){return !(e instanceof AST_DefClass||e instanceof AST_Defun||e instanceof AST_Let||e instanceof AST_Const||e instanceof AST_Export||e instanceof AST_Import)}function loop_body(e){return e instanceof AST_IterationStatement&&e.body instanceof AST_BlockStatement?e.body:e}function is_iife_call(e){return "Call"==e.TYPE&&(e.expression instanceof AST_Function||is_iife_call(e.expression))}function is_undeclared_ref(e){return e instanceof AST_SymbolRef&&e.definition().undeclared}def_optimize(AST_Node,(function(e){return e})),AST_Toplevel.DEFMETHOD("drop_console",(function(){return this.transform(new TreeTransformer((function(e){if("Call"==e.TYPE){var t=e.expression;if(t instanceof AST_PropAccess){for(var n=t.expression;n.expression;)n=n.expression;if(is_undeclared_ref(n)&&"console"==n.name)return make_node(AST_Undefined,e)}}})))})),AST_Node.DEFMETHOD("equivalent_to",(function(e){return equivalent_to(this,e)})),AST_Scope.DEFMETHOD("process_expression",(function(e,t){var n=this,o=new TreeTransformer((function(i){if(e&&i instanceof AST_SimpleStatement)return make_node(AST_Return,i,{value:i.body});if(!e&&i instanceof AST_Return){if(t){var r=i.value&&i.value.drop_side_effect_free(t,!0);return r?make_node(AST_SimpleStatement,i,{body:r}):make_node(AST_EmptyStatement,i)}return make_node(AST_SimpleStatement,i,{body:i.value||make_node(AST_UnaryPrefix,i,{operator:"void",expression:make_node(AST_Number,i,{value:0})})})}if(i instanceof AST_Class||i instanceof AST_Lambda&&i!==n)return i;if(i instanceof AST_Block){var a=i.body.length-1;a>=0&&(i.body[a]=i.body[a].transform(o));}else i instanceof AST_If?(i.body=i.body.transform(o),i.alternative&&(i.alternative=i.alternative.transform(o))):i instanceof AST_With&&(i.body=i.body.transform(o));return i}));n.transform(o);})),function(e){function t(e,t){t.assignments=0,t.chained=!1,t.direct_access=!1,t.escaped=0,t.recursive_refs=0,t.references=[],t.single_use=void 0,t.scope.pinned()?t.fixed=!1:t.orig[0]instanceof AST_SymbolConst||!e.exposed(t)?t.fixed=t.init:t.fixed=!1;}function n(e,n,o){o.variables.forEach((function(o){t(n,o),null===o.fixed?(e.defs_to_safe_ids.set(o.id,e.safe_ids),a(e,o,!0)):o.fixed&&(e.loop_ids.set(o.id,e.in_loop),a(e,o,!0));}));}function o(e,n){n.block_scope&&n.block_scope.variables.forEach((n=>{t(e,n);}));}function i(e){e.safe_ids=Object.create(e.safe_ids);}function r(e){e.safe_ids=Object.getPrototypeOf(e.safe_ids);}function a(e,t,n){e.safe_ids[t.id]=n;}function s(e,t){if("m"==t.single_use)return !1;if(e.safe_ids[t.id]){if(null==t.fixed){var n=t.orig[0];if(n instanceof AST_SymbolFunarg||"arguments"==n.name)return !1;t.fixed=make_node(AST_Undefined,n);}return !0}return t.fixed instanceof AST_Defun}function u(e,t,n,o){if(void 0===t.fixed)return !0;let i;return null===t.fixed&&(i=e.defs_to_safe_ids.get(t.id))?(i[t.id]=!1,e.defs_to_safe_ids.delete(t.id),!0):!!HOP(e.safe_ids,t.id)&&!!s(e,t)&&!1!==t.fixed&&!(null!=t.fixed&&(!o||t.references.length>t.assignments))&&(t.fixed instanceof AST_Defun?o instanceof AST_Node&&t.fixed.parent_scope===n:t.orig.every((e=>!(e instanceof AST_SymbolConst||e instanceof AST_SymbolDefun||e instanceof AST_SymbolLambda))))}function l(e,t,n,o,i,r=0,a=1){var s=e.parent(r);if(i){if(i.is_constant())return;if(i instanceof AST_ClassExpression)return}if(s instanceof AST_Assign&&("="===s.operator||s.logical)&&o===s.right||s instanceof AST_Call&&(o!==s.expression||s instanceof AST_New)||s instanceof AST_Exit&&o===s.value&&o.scope!==t.scope||s instanceof AST_VarDef&&o===s.value||s instanceof AST_Yield&&o===s.value&&o.scope!==t.scope)return !(a>1)||i&&i.is_constant_expression(n)||(a=1),void((!t.escaped||t.escaped>a)&&(t.escaped=a));if(s instanceof AST_Array||s instanceof AST_Await||s instanceof AST_Binary&&lazy_op.has(s.operator)||s instanceof AST_Conditional&&o!==s.condition||s instanceof AST_Expansion||s instanceof AST_Sequence&&o===s.tail_node())l(e,t,n,s,s,r+1,a);else if(s instanceof AST_ObjectKeyVal&&o===s.value){var u=e.parent(r+1);l(e,t,n,u,u,r+2,a);}else if(s instanceof AST_PropAccess&&o===s.expression&&(l(e,t,n,s,i=read_property(i,s.property),r+1,a+1),i))return;r>0||s instanceof AST_Sequence&&o!==s.tail_node()||s instanceof AST_SimpleStatement||(t.direct_access=!0);}e(AST_Node,noop);const _=e=>walk$3(e,(e=>{if(e instanceof AST_Symbol){var t=e.definition();t&&(e instanceof AST_SymbolRef&&t.references.push(e),t.fixed=!1);}}));e(AST_Accessor,(function(e,t,o){return i(e),n(e,o,this),t(),r(e),!0})),e(AST_Assign,(function(e,t,n){var o=this;if(o.left instanceof AST_Destructuring)return void _(o.left);const s=()=>{if(o.logical)return o.left.walk(e),i(e),o.right.walk(e),r(e),!0};var c=o.left;if(!(c instanceof AST_SymbolRef))return s();var f=c.definition(),p=u(e,f,c.scope,o.right);if(f.assignments++,!p)return s();var d=f.fixed;if(!d&&"="!=o.operator&&!o.logical)return s();var S="="==o.operator,m=S?o.right:o;return is_modified(n,e,o,m,0)?s():(f.references.push(c),o.logical||(S||(f.chained=!0),f.fixed=S?function(){return o.right}:function(){return make_node(AST_Binary,o,{operator:o.operator.slice(0,-1),left:d instanceof AST_Node?d:d(),right:o.right})}),o.logical?(a(e,f,!1),i(e),o.right.walk(e),r(e),!0):(a(e,f,!1),o.right.walk(e),a(e,f,!0),l(e,f,c.scope,o,m,0,1),!0))})),e(AST_Binary,(function(e){if(lazy_op.has(this.operator))return this.left.walk(e),i(e),this.right.walk(e),r(e),!0})),e(AST_Block,(function(e,t,n){o(n,this);})),e(AST_Case,(function(e){return i(e),this.expression.walk(e),r(e),i(e),walk_body(this,e),r(e),!0})),e(AST_Class,(function(e,t){return clear_flag(this,16),i(e),t(),r(e),!0})),e(AST_Conditional,(function(e){return this.condition.walk(e),i(e),this.consequent.walk(e),r(e),i(e),this.alternative.walk(e),r(e),!0})),e(AST_Chain,(function(e,t){const n=e.safe_ids;return t(),e.safe_ids=n,!0})),e(AST_Call,(function(e){this.expression.walk(e),this.optional&&i(e);for(const t of this.args)t.walk(e);return !0})),e(AST_PropAccess,(function(e){if(this.optional)return this.expression.walk(e),i(e),this.property instanceof AST_Node&&this.property.walk(e),!0})),e(AST_Default,(function(e,t){return i(e),t(),r(e),!0})),e(AST_Lambda,(function(e,t,o){return clear_flag(this,16),i(e),n(e,o,this),this.uses_arguments?(t(),void r(e)):(!this.name&&(s=e.parent())instanceof AST_Call&&s.expression===this&&!s.args.some((e=>e instanceof AST_Expansion))&&this.argnames.every((e=>e instanceof AST_Symbol))&&this.argnames.forEach(((t,n)=>{if(t.definition){var o=t.definition();o.orig.length>1||(void 0!==o.fixed||this.uses_arguments&&!e.has_directive("use strict")?o.fixed=!1:(o.fixed=function(){return s.args[n]||make_node(AST_Undefined,s)},e.loop_ids.set(o.id,e.in_loop),a(e,o,!0)));}})),t(),r(e),!0);var s;})),e(AST_Do,(function(e,t,n){o(n,this);const a=e.in_loop;return e.in_loop=this,i(e),this.body.walk(e),has_break_or_continue(this)&&(r(e),i(e)),this.condition.walk(e),r(e),e.in_loop=a,!0})),e(AST_For,(function(e,t,n){o(n,this),this.init&&this.init.walk(e);const a=e.in_loop;return e.in_loop=this,i(e),this.condition&&this.condition.walk(e),this.body.walk(e),this.step&&(has_break_or_continue(this)&&(r(e),i(e)),this.step.walk(e)),r(e),e.in_loop=a,!0})),e(AST_ForIn,(function(e,t,n){o(n,this),_(this.init),this.object.walk(e);const a=e.in_loop;return e.in_loop=this,i(e),this.body.walk(e),r(e),e.in_loop=a,!0})),e(AST_If,(function(e){return this.condition.walk(e),i(e),this.body.walk(e),r(e),this.alternative&&(i(e),this.alternative.walk(e),r(e)),!0})),e(AST_LabeledStatement,(function(e){return i(e),this.body.walk(e),r(e),!0})),e(AST_SymbolCatch,(function(){this.definition().fixed=!1;})),e(AST_SymbolRef,(function(e,t,n){var o,i,r=this.definition();r.references.push(this),1==r.references.length&&!r.fixed&&r.orig[0]instanceof AST_SymbolDefun&&e.loop_ids.set(r.id,e.in_loop),void 0!==r.fixed&&s(e,r)?r.fixed&&((o=this.fixed_value())instanceof AST_Lambda&&recursive_ref(e,r)?r.recursive_refs++:o&&!n.exposed(r)&&function(e,t,n){return t.option("unused")&&!n.scope.pinned()&&n.references.length-n.recursive_refs==1&&e.loop_ids.get(n.id)===e.in_loop}(e,n,r)?r.single_use=o instanceof AST_Lambda&&!o.pinned()||o instanceof AST_Class||r.scope===this.scope&&o.is_constant_expression():r.single_use=!1,is_modified(n,e,this,o,0,!!(i=o)&&(i.is_constant()||i instanceof AST_Lambda||i instanceof AST_This))&&(r.single_use?r.single_use="m":r.fixed=!1)):r.fixed=!1,l(e,r,this.scope,this,o,0,1);})),e(AST_Toplevel,(function(e,o,i){this.globals.forEach((function(e){t(i,e);})),n(e,i,this);})),e(AST_Try,(function(e,t,n){return o(n,this),i(e),walk_body(this,e),r(e),this.bcatch&&(i(e),this.bcatch.walk(e),r(e)),this.bfinally&&this.bfinally.walk(e),!0})),e(AST_Unary,(function(e){var t=this;if("++"===t.operator||"--"===t.operator){var n=t.expression;if(n instanceof AST_SymbolRef){var o=n.definition(),i=u(e,o,n.scope,!0);if(o.assignments++,i){var r=o.fixed;if(r)return o.references.push(n),o.chained=!0,o.fixed=function(){return make_node(AST_Binary,t,{operator:t.operator.slice(0,-1),left:make_node(AST_UnaryPrefix,t,{operator:"+",expression:r instanceof AST_Node?r:r()}),right:make_node(AST_Number,t,{value:1})})},a(e,o,!0),!0}}}})),e(AST_VarDef,(function(e,t){var n=this;if(n.name instanceof AST_Destructuring)_(n.name);else {var o=n.name.definition();if(n.value){if(u(e,o,n.name.scope,n.value))return o.fixed=function(){return n.value},e.loop_ids.set(o.id,e.in_loop),a(e,o,!1),t(),a(e,o,!0),!0;o.fixed=!1;}}})),e(AST_While,(function(e,t,n){o(n,this);const a=e.in_loop;return e.in_loop=this,i(e),t(),r(e),e.in_loop=a,!0}));}((function(e,t){e.DEFMETHOD("reduce_vars",t);})),AST_Toplevel.DEFMETHOD("reset_opt_flags",(function(e){const t=this,n=e.option("reduce_vars"),o=new TreeWalker((function(i,r){if(clear_flag(i,1792),n)return e.top_retain&&i instanceof AST_Defun&&o.parent()===t&&set_flag(i,TOP),i.reduce_vars(o,r,e)}));o.safe_ids=Object.create(null),o.in_loop=null,o.loop_ids=new Map,o.defs_to_safe_ids=new Map,t.walk(o);})),AST_Symbol.DEFMETHOD("fixed_value",(function(){var e=this.thedef.fixed;return !e||e instanceof AST_Node?e:e()})),AST_SymbolRef.DEFMETHOD("is_immutable",(function(){var e=this.definition().orig;return 1==e.length&&e[0]instanceof AST_SymbolLambda}));var global_names=makePredicate("Array Boolean clearInterval clearTimeout console Date decodeURI decodeURIComponent encodeURI encodeURIComponent Error escape eval EvalError Function isFinite isNaN JSON Math Number parseFloat parseInt RangeError ReferenceError RegExp Object setInterval setTimeout String SyntaxError TypeError unescape URIError");AST_SymbolRef.DEFMETHOD("is_declared",(function(e){return !this.definition().undeclared||e.option("unsafe")&&global_names.has(this.name)}));var identifier_atom=makePredicate("Infinity NaN undefined");function is_identifier_atom(e){return e instanceof AST_Infinity||e instanceof AST_NaN||e instanceof AST_Undefined}function tighten_body(e,t){var n,o,i=t.find_parent(AST_Scope).get_defun_scope();!function(){var e=t.self(),r=0;do{if(e instanceof AST_Catch||e instanceof AST_Finally)r++;else if(e instanceof AST_IterationStatement)n=!0;else {if(e instanceof AST_Scope){i=e;break}e instanceof AST_Try&&(o=!0);}}while(e=t.parent(r++))}();var r,a=10;do{r=!1,u(e),t.option("dead_code")&&_(e,t),t.option("if_return")&&l(e,t),t.sequences_limit>0&&(f(e,t),d(e,t)),t.option("join_vars")&&m(e),t.option("collapse_vars")&&s(e,t);}while(r&&a-- >0);function s(e,t){if(i.pinned())return e;for(var a,s=[],u=e.length,l=new TreeTransformer((function(e){if(v)return e;if(!y)return e!==c[f]?e:++f<c.length?M(e):(y=!0,(S=P(e,0))===e&&(v=!0),e);var n,i=l.parent();if(e instanceof AST_Assign&&(e.logical||"="!=e.operator&&A.equivalent_to(e.left))||e instanceof AST_Await||e instanceof AST_Call&&A instanceof AST_PropAccess&&A.equivalent_to(e.expression)||e instanceof AST_Debugger||e instanceof AST_Destructuring||e instanceof AST_Expansion&&e.expression instanceof AST_Symbol&&(e.expression instanceof AST_This||e.expression.definition().references.length>1)||e instanceof AST_IterationStatement&&!(e instanceof AST_For)||e instanceof AST_LoopControl||e instanceof AST_Try||e instanceof AST_With||e instanceof AST_Yield||e instanceof AST_Export||e instanceof AST_Class||i instanceof AST_For&&e!==i.init||!g&&e instanceof AST_SymbolRef&&!e.is_declared(t)&&!pure_prop_access_globals.has(e)||e instanceof AST_SymbolRef&&i instanceof AST_Call&&has_annotation(i,_NOINLINE))return v=!0,e;if(m||h&&g||!(i instanceof AST_Binary&&lazy_op.has(i.operator)&&i.left!==e||i instanceof AST_Conditional&&i.condition!==e||i instanceof AST_If&&i.condition!==e)||(m=i),R&&!(e instanceof AST_SymbolDeclaration)&&A.equivalent_to(e)){if(m)return v=!0,e;if(is_lhs(e,i))return d&&C++,e;if(C++,d&&p instanceof AST_VarDef)return e;if(r=v=!0,p instanceof AST_UnaryPostfix)return make_node(AST_UnaryPrefix,p,p);if(p instanceof AST_VarDef){var a=p.name.definition(),s=p.value;return a.references.length-a.replaced!=1||t.exposed(a)?make_node(AST_Assign,p,{operator:"=",logical:!1,left:make_node(AST_SymbolRef,p.name,p.name),right:s}):(a.replaced++,b&&is_identifier_atom(s)?s.transform(t):maintain_this_binding(i,e,s))}return clear_flag(p,32),p}return (e instanceof AST_Call||e instanceof AST_Exit&&(E||A instanceof AST_PropAccess||H(A))||e instanceof AST_PropAccess&&(E||e.expression.may_throw_on_access(t))||e instanceof AST_SymbolRef&&(T.get(e.name)||E&&H(e))||e instanceof AST_VarDef&&e.value&&(T.has(e.name.name)||E&&H(e.name))||(n=is_lhs(e.left,e))&&(n instanceof AST_PropAccess||T.has(n.name))||D&&(o?e.has_side_effects(t):X(e)))&&(S=e,e instanceof AST_Scope&&(v=!0)),M(e)}),(function(e){v||(S===e&&(v=!0),m===e&&(m=null));})),_=new TreeTransformer((function(e){if(v)return e;if(!y){if(e!==c[f])return e;if(++f<c.length)return;return y=!0,e}return e instanceof AST_SymbolRef&&e.name==F.name?(--C||(v=!0),is_lhs(e,_.parent())?e:(F.replaced++,d.replaced--,p.value)):e instanceof AST_Default||e instanceof AST_Scope?e:void 0}));--u>=0;){0==u&&t.option("unused")&&x();var c=[];for(w(e[u]);s.length>0;){c=s.pop();var f=0,p=c[c.length-1],d=null,S=null,m=null,A=B(p);if(A&&!is_lhs_read_only(A)&&!A.has_side_effects(t)){var T=V(p),h=K(A);A instanceof AST_SymbolRef&&T.set(A.name,!1);var E=(N=p)instanceof AST_Unary?unary_side_effects.has(N.operator):L(N).has_side_effects(t),g=G(),D=p.may_throw(t),b=p.name instanceof AST_SymbolFunarg,y=b,v=!1,C=0,R=!a||!y;if(!R){for(var k=t.self().argnames.lastIndexOf(p.name)+1;!v&&k<a.length;k++)a[k].transform(l);R=!0;}for(var O=u;!v&&O<e.length;O++)e[O].transform(l);if(d){var F=p.name.definition();if(v&&F.references.length-F.replaced>C)C=!1;else {for(v=!1,f=0,y=b,O=u;!v&&O<e.length;O++)e[O].transform(_);d.single_use=!1;}}C&&!U(p)&&e.splice(u,1);}}}var N;function M(e){if(e instanceof AST_Scope)return e;if(e instanceof AST_Switch){e.expression=e.expression.transform(l);for(var t=0,n=e.body.length;!v&&t<n;t++){var o=e.body[t];if(o instanceof AST_Case){if(!y){if(o!==c[f])continue;f++;}if(o.expression=o.expression.transform(l),!g)break}}return v=!0,e}}function I(e,t,n){var o=!1,r=!(e instanceof AST_Arrow);return t.walk(new TreeWalker((function(t,a){if(o)return !0;if(t instanceof AST_SymbolRef&&(e.variables.has(t.name)||function(e,t){if(e.global)return !1;let n=e.scope;for(;n&&n!==t;){if(n.variables.has(e.name))return !0;n=n.parent_scope;}return !1}(t.definition(),e))){var s=t.definition().scope;if(s!==i)for(;s=s.parent_scope;)if(s===i)return !0;return o=!0}if((n||r)&&t instanceof AST_This)return o=!0;if(t instanceof AST_Scope&&!(t instanceof AST_Arrow)){var u=r;return r=!1,a(),r=u,!0}}))),o}function x(){var e,n=t.self();if(is_func_expr(n)&&!n.name&&!n.uses_arguments&&!n.pinned()&&(e=t.parent())instanceof AST_Call&&e.expression===n&&e.args.every((e=>!(e instanceof AST_Expansion)))){var o=t.has_directive("use strict");o&&!member(o,n.body)&&(o=!1);var i=n.argnames.length;a=e.args.slice(i);for(var r=new Set,u=i;--u>=0;){var l=n.argnames[u],_=e.args[u];const i=l.definition&&l.definition();if(!(i&&i.orig.length>1||(a.unshift(make_node(AST_VarDef,l,{name:l,value:_})),r.has(l.name))))if(r.add(l.name),l instanceof AST_Expansion){var c=e.args.slice(u);c.every((e=>!I(n,e,o)))&&s.unshift([make_node(AST_VarDef,l,{name:l.expression,value:make_node(AST_Array,e,{elements:c})})]);}else _?(_ instanceof AST_Lambda&&_.pinned()||I(n,_,o))&&(_=null):_=make_node(AST_Undefined,l).transform(t),_&&s.unshift([make_node(AST_VarDef,l,{name:l,value:_})]);}}}function w(e){if(c.push(e),e instanceof AST_Assign)e.left.has_side_effects(t)||s.push(c.slice()),w(e.right);else if(e instanceof AST_Binary)w(e.left),w(e.right);else if(e instanceof AST_Call&&!has_annotation(e,_NOINLINE))w(e.expression),e.args.forEach(w);else if(e instanceof AST_Case)w(e.expression);else if(e instanceof AST_Conditional)w(e.condition),w(e.consequent),w(e.alternative);else if(e instanceof AST_Definitions){var n=e.definitions.length,o=n-200;for(o<0&&(o=0);o<n;o++)w(e.definitions[o]);}else e instanceof AST_DWLoop?(w(e.condition),e.body instanceof AST_Block||w(e.body)):e instanceof AST_Exit?e.value&&w(e.value):e instanceof AST_For?(e.init&&w(e.init),e.condition&&w(e.condition),e.step&&w(e.step),e.body instanceof AST_Block||w(e.body)):e instanceof AST_ForIn?(w(e.object),e.body instanceof AST_Block||w(e.body)):e instanceof AST_If?(w(e.condition),e.body instanceof AST_Block||w(e.body),!e.alternative||e.alternative instanceof AST_Block||w(e.alternative)):e instanceof AST_Sequence?e.expressions.forEach(w):e instanceof AST_SimpleStatement?w(e.body):e instanceof AST_Switch?(w(e.expression),e.body.forEach(w)):e instanceof AST_Unary?"++"!=e.operator&&"--"!=e.operator||s.push(c.slice()):e instanceof AST_VarDef&&e.value&&(s.push(c.slice()),w(e.value));c.pop();}function P(e,t,n){var o=l.parent(t);return o instanceof AST_Assign?!n||o.logical||o.left instanceof AST_PropAccess||T.has(o.left.name)?e:P(o,t+1,n):o instanceof AST_Binary?!n||lazy_op.has(o.operator)&&o.left!==e?e:P(o,t+1,n):o instanceof AST_Call||o instanceof AST_Case?e:o instanceof AST_Conditional?n&&o.condition===e?P(o,t+1,n):e:o instanceof AST_Definitions?P(o,t+1,!0):o instanceof AST_Exit?n?P(o,t+1,n):e:o instanceof AST_If?n&&o.condition===e?P(o,t+1,n):e:o instanceof AST_IterationStatement?e:o instanceof AST_Sequence?P(o,t+1,o.tail_node()!==e):o instanceof AST_SimpleStatement?P(o,t+1,!0):o instanceof AST_Switch||o instanceof AST_VarDef?e:null}function B(e){if(e instanceof AST_Assign&&e.logical)return !1;if(!(e instanceof AST_VarDef&&e.name instanceof AST_SymbolDeclaration)){const t=e instanceof AST_Assign?e.left:e.expression;return !is_ref_of(t,AST_SymbolConst)&&!is_ref_of(t,AST_SymbolLet)&&t}var n=e.name.definition();if(member(e.name,n.orig)){var o=n.references.length-n.replaced;if(o)return n.orig.length-n.eliminated>1&&!(e.name instanceof AST_SymbolFunarg)||(o>1?function(e){var t=e.value;if(t instanceof AST_SymbolRef&&"arguments"!=t.name){var n=t.definition();if(!n.undeclared)return d=n}}(e):!t.exposed(n))?make_node(AST_SymbolRef,e.name,e.name):void 0}}function L(e){return e instanceof AST_Assign?e.right:e.value}function V(e){var n=new Map;if(e instanceof AST_Unary)return n;var o=new TreeWalker((function(e){for(var i=e;i instanceof AST_PropAccess;)i=i.expression;(i instanceof AST_SymbolRef||i instanceof AST_This)&&n.set(i.name,n.get(i.name)||is_modified(t,o,e,e,0));}));return L(e).walk(o),n}function U(n){if(n.name instanceof AST_SymbolFunarg){var o=t.parent(),i=t.self().argnames,r=i.indexOf(n.name);if(r<0)o.args.length=Math.min(o.args.length,i.length-1);else {var a=o.args;a[r]&&(a[r]=make_node(AST_Number,a[r],{value:0}));}return !0}var s=!1;return e[u].transform(new TreeTransformer((function(e,t,o){return s?e:e===n||e.body===n?(s=!0,e instanceof AST_VarDef?(e.value=e.name instanceof AST_SymbolConst?make_node(AST_Undefined,e.value):null,e):o?MAP.skip:null):void 0}),(function(e){if(e instanceof AST_Sequence)switch(e.expressions.length){case 0:return null;case 1:return e.expressions[0]}})))}function K(e){for(;e instanceof AST_PropAccess;)e=e.expression;return e instanceof AST_SymbolRef&&e.definition().scope===i&&!(n&&(T.has(e.name)||p instanceof AST_Unary||p instanceof AST_Assign&&!p.logical&&"="!=p.operator))}function G(){if(E)return !1;if(d)return !0;if(A instanceof AST_SymbolRef){var e=A.definition();if(e.references.length-e.replaced==(p instanceof AST_VarDef?1:2))return !0}return !1}function H(e){if(!e.definition)return !0;var t=e.definition();return !(1==t.orig.length&&t.orig[0]instanceof AST_SymbolDefun||t.scope.get_defun_scope()===i&&t.references.every((e=>{var t=e.scope.get_defun_scope();return "Scope"==t.TYPE&&(t=t.parent_scope),t===i})))}function X(e,t){if(e instanceof AST_Assign)return X(e.left,!0);if(e instanceof AST_Unary)return X(e.expression,!0);if(e instanceof AST_VarDef)return e.value&&X(e.value);if(t){if(e instanceof AST_Dot)return X(e.expression,!0);if(e instanceof AST_Sub)return X(e.expression,!0);if(e instanceof AST_SymbolRef)return e.definition().scope!==i}return !1}}function u(e){for(var t=[],n=0;n<e.length;){var o=e[n];o instanceof AST_BlockStatement&&o.body.every(can_be_evicted_from_block)?(r=!0,u(o.body),e.splice(n,1,...o.body),n+=o.body.length):o instanceof AST_EmptyStatement?(r=!0,e.splice(n,1)):o instanceof AST_Directive?t.indexOf(o.value)<0?(n++,t.push(o.value)):(r=!0,e.splice(n,1)):n++;}}function l(e,t){for(var n=t.self(),o=function(e){for(var t=0,n=e.length;--n>=0;){var o=e[n];if(o instanceof AST_If&&o.body instanceof AST_Return&&++t>1)return !0}return !1}(e),i=n instanceof AST_Lambda,a=e.length;--a>=0;){var s=e[a],u=T(a),l=e[u];if(i&&!l&&s instanceof AST_Return){if(!s.value){r=!0,e.splice(a,1);continue}if(s.value instanceof AST_UnaryPrefix&&"void"==s.value.operator){r=!0,e[a]=make_node(AST_SimpleStatement,s,{body:s.value.expression});continue}}if(s instanceof AST_If){var _;if(S(_=aborts(s.body))){_.label&&remove$1(_.label.thedef.references,_),r=!0,(s=s.clone()).condition=s.condition.negate(t);var f=A(s.body,_);s.body=make_node(AST_BlockStatement,s,{body:as_statement_array(s.alternative).concat(m())}),s.alternative=make_node(AST_BlockStatement,s,{body:f}),e[a]=s.transform(t);continue}if(S(_=aborts(s.alternative))){_.label&&remove$1(_.label.thedef.references,_),r=!0,(s=s.clone()).body=make_node(AST_BlockStatement,s.body,{body:as_statement_array(s.body).concat(m())}),f=A(s.alternative,_),s.alternative=make_node(AST_BlockStatement,s.alternative,{body:f}),e[a]=s.transform(t);continue}}if(s instanceof AST_If&&s.body instanceof AST_Return){var p=s.body.value;if(!p&&!s.alternative&&(i&&!l||l instanceof AST_Return&&!l.value)){r=!0,e[a]=make_node(AST_SimpleStatement,s.condition,{body:s.condition});continue}if(p&&!s.alternative&&l instanceof AST_Return&&l.value){r=!0,(s=s.clone()).alternative=l,e[a]=s.transform(t),e.splice(u,1);continue}if(p&&!s.alternative&&(!l&&i&&o||l instanceof AST_Return)){r=!0,(s=s.clone()).alternative=l||make_node(AST_Return,s,{value:null}),e[a]=s.transform(t),l&&e.splice(u,1);continue}var d=e[h(a)];if(t.option("sequences")&&i&&!s.alternative&&d instanceof AST_If&&d.body instanceof AST_Return&&T(u)==e.length&&l instanceof AST_SimpleStatement){r=!0,(s=s.clone()).alternative=make_node(AST_BlockStatement,l,{body:[l,make_node(AST_Return,l,{value:null})]}),e[a]=s.transform(t),e.splice(u,1);continue}}}function S(o){if(!o)return !1;for(var r=a+1,s=e.length;r<s;r++){var u=e[r];if(u instanceof AST_Const||u instanceof AST_Let)return !1}var l=o instanceof AST_LoopControl?t.loopcontrol_target(o):null;return o instanceof AST_Return&&i&&function(e){return !e||e instanceof AST_UnaryPrefix&&"void"==e.operator}(o.value)||o instanceof AST_Continue&&n===loop_body(l)||o instanceof AST_Break&&l instanceof AST_BlockStatement&&n===l}function m(){var t=e.slice(a+1);return e.length=a+1,t.filter((function(t){return !(t instanceof AST_Defun&&(e.push(t),1))}))}function A(e,t){var n=as_statement_array(e).slice(0,-1);return t.value&&n.push(make_node(AST_SimpleStatement,t.value,{body:t.value.expression})),n}function T(t){for(var n=t+1,o=e.length;n<o;n++){var i=e[n];if(!(i instanceof AST_Var&&c(i)))break}return n}function h(t){for(var n=t;--n>=0;){var o=e[n];if(!(o instanceof AST_Var&&c(o)))break}return n}}function _(e,t){for(var n,o=t.self(),i=0,a=0,s=e.length;i<s;i++){var u=e[i];if(u instanceof AST_LoopControl){var l=t.loopcontrol_target(u);u instanceof AST_Break&&!(l instanceof AST_IterationStatement)&&loop_body(l)===o||u instanceof AST_Continue&&loop_body(l)===o?u.label&&remove$1(u.label.thedef.references,u):e[a++]=u;}else e[a++]=u;if(aborts(u)){n=e.slice(i+1);break}}e.length=a,r=a!=s,n&&n.forEach((function(n){trim_unreachable_code(t,n,e);}));}function c(e){return e.definitions.every((e=>!e.value))}function f(e,t){if(!(e.length<2)){for(var n=[],o=0,i=0,a=e.length;i<a;i++){var s=e[i];if(s instanceof AST_SimpleStatement){n.length>=t.sequences_limit&&l();var u=s.body;n.length>0&&(u=u.drop_side_effect_free(t)),u&&merge_sequence(n,u);}else s instanceof AST_Definitions&&c(s)||s instanceof AST_Defun||l(),e[o++]=s;}l(),e.length=o,o!=a&&(r=!0);}function l(){if(n.length){var t=make_sequence(n[0],n);e[o++]=make_node(AST_SimpleStatement,t,{body:t}),n=[];}}}function p(e,t){if(!(e instanceof AST_BlockStatement))return e;for(var n=null,o=0,i=e.body.length;o<i;o++){var r=e.body[o];if(r instanceof AST_Var&&c(r))t.push(r);else {if(n)return !1;n=r;}}return n}function d(e,t){function n(e){i--,r=!0;var n=o.body;return make_sequence(n,[n,e]).transform(t)}for(var o,i=0,a=0;a<e.length;a++){var s=e[a];if(o&&(s instanceof AST_Exit?s.value=n(s.value||make_node(AST_Undefined,s).transform(t)):s instanceof AST_For?s.init instanceof AST_Definitions||walk$3(o.body,(e=>e instanceof AST_Scope||(e instanceof AST_Binary&&"in"===e.operator?walk_abort:void 0)))||(s.init?s.init=n(s.init):(s.init=o.body,i--,r=!0)):s instanceof AST_ForIn?s.init instanceof AST_Const||s.init instanceof AST_Let||(s.object=n(s.object)):s instanceof AST_If?s.condition=n(s.condition):(s instanceof AST_Switch||s instanceof AST_With)&&(s.expression=n(s.expression))),t.option("conditionals")&&s instanceof AST_If){var u=[],l=p(s.body,u),_=p(s.alternative,u);if(!1!==l&&!1!==_&&u.length>0){var c=u.length;u.push(make_node(AST_If,s,{condition:s.condition,body:l||make_node(AST_EmptyStatement,s.body),alternative:_})),u.unshift(i,1),[].splice.apply(e,u),a+=c,i+=c+1,o=null,r=!0;continue}}e[i++]=s,o=s instanceof AST_SimpleStatement?s:null;}e.length=i;}function S(e,n){if(e instanceof AST_Definitions){var o,r=e.definitions[e.definitions.length-1];if(r.value instanceof AST_Object&&(n instanceof AST_Assign&&!n.logical?o=[n]:n instanceof AST_Sequence&&(o=n.expressions.slice()),o)){var a=!1;do{var s=o[0];if(!(s instanceof AST_Assign))break;if("="!=s.operator)break;if(!(s.left instanceof AST_PropAccess))break;var u=s.left.expression;if(!(u instanceof AST_SymbolRef))break;if(r.name.name!=u.name)break;if(!s.right.is_constant_expression(i))break;var l=s.left.property;if(l instanceof AST_Node&&(l=l.evaluate(t)),l instanceof AST_Node)break;l=""+l;var _=t.option("ecma")<2015&&t.has_directive("use strict")?function(e){return e.key!=l&&e.key&&e.key.name!=l}:function(e){return e.key&&e.key.name!=l};if(!r.value.properties.every(_))break;var c=r.value.properties.filter((function(e){return e.key===l}))[0];c?c.value=new AST_Sequence({start:c.start,expressions:[c.value.clone(),s.right.clone()],end:c.end}):r.value.properties.push(make_node(AST_ObjectKeyVal,s,{key:l,value:s.right})),o.shift(),a=!0;}while(o.length);return a&&o}}}function m(e){for(var t,n=0,o=-1,i=e.length;n<i;n++){var a=e[n],s=e[o];if(a instanceof AST_Definitions)s&&s.TYPE==a.TYPE?(s.definitions=s.definitions.concat(a.definitions),r=!0):t&&t.TYPE==a.TYPE&&c(a)?(t.definitions=t.definitions.concat(a.definitions),r=!0):(e[++o]=a,t=a);else if(a instanceof AST_Exit)a.value=l(a.value);else if(a instanceof AST_For)(u=S(s,a.init))?(r=!0,a.init=u.length?make_sequence(a.init,u):null,e[++o]=a):s instanceof AST_Var&&(!a.init||a.init.TYPE==s.TYPE)?(a.init&&(s.definitions=s.definitions.concat(a.init.definitions)),a.init=s,e[o]=a,r=!0):t&&a.init&&t.TYPE==a.init.TYPE&&c(a.init)?(t.definitions=t.definitions.concat(a.init.definitions),a.init=null,e[++o]=a,r=!0):e[++o]=a;else if(a instanceof AST_ForIn)a.object=l(a.object);else if(a instanceof AST_If)a.condition=l(a.condition);else if(a instanceof AST_SimpleStatement){var u;if(u=S(s,a.body)){if(r=!0,!u.length)continue;a.body=make_sequence(a.body,u);}e[++o]=a;}else a instanceof AST_Switch||a instanceof AST_With?a.expression=l(a.expression):e[++o]=a;}function l(t){e[++o]=a;var n=S(s,t);return n?(r=!0,n.length?make_sequence(t,n):t instanceof AST_Sequence?t.tail_node().left:t.left):t}e.length=o+1;}}function trim_unreachable_code(e,t,n){walk$3(t,(o=>o instanceof AST_Var?(o.remove_initializers(),n.push(o),!0):o instanceof AST_Defun&&(o===t||!e.has_directive("use strict"))?(n.push(o===t?o:make_node(AST_Var,o,{definitions:[make_node(AST_VarDef,o,{name:make_node(AST_SymbolVar,o.name,o.name),value:null})]})),!0):o instanceof AST_Export||o instanceof AST_Import?(n.push(o),!0):o instanceof AST_Scope||void 0));}function get_value(e){return e instanceof AST_Constant?e.getValue():e instanceof AST_UnaryPrefix&&"void"==e.operator&&e.expression instanceof AST_Constant?void 0:e}function is_undefined(e,t){return has_flag(e,8)||e instanceof AST_Undefined||e instanceof AST_UnaryPrefix&&"void"==e.operator&&!e.expression.has_side_effects(t)}!function(e){function t(e){return /strict/.test(e.option("pure_getters"))}AST_Node.DEFMETHOD("may_throw_on_access",(function(e){return !e.option("pure_getters")||this._dot_throw(e)})),e(AST_Node,t),e(AST_Null,return_true),e(AST_Undefined,return_true),e(AST_Constant,return_false),e(AST_Array,return_false),e(AST_Object,(function(e){if(!t(e))return !1;for(var n=this.properties.length;--n>=0;)if(this.properties[n]._dot_throw(e))return !0;return !1})),e(AST_Class,return_false),e(AST_ObjectProperty,return_false),e(AST_ObjectGetter,return_true),e(AST_Expansion,(function(e){return this.expression._dot_throw(e)})),e(AST_Function,return_false),e(AST_Arrow,return_false),e(AST_UnaryPostfix,return_false),e(AST_UnaryPrefix,(function(){return "void"==this.operator})),e(AST_Binary,(function(e){return ("&&"==this.operator||"||"==this.operator||"??"==this.operator)&&(this.left._dot_throw(e)||this.right._dot_throw(e))})),e(AST_Assign,(function(e){return !!this.logical||"="==this.operator&&this.right._dot_throw(e)})),e(AST_Conditional,(function(e){return this.consequent._dot_throw(e)||this.alternative._dot_throw(e)})),e(AST_Dot,(function(e){return !(!t(e)||"prototype"==this.property&&(this.expression instanceof AST_Function||this.expression instanceof AST_Class))})),e(AST_Chain,(function(e){return this.expression._dot_throw(e)})),e(AST_Sequence,(function(e){return this.tail_node()._dot_throw(e)})),e(AST_SymbolRef,(function(e){if("arguments"===this.name)return !1;if(has_flag(this,8))return !0;if(!t(e))return !1;if(is_undeclared_ref(this)&&this.is_declared(e))return !1;if(this.is_immutable())return !1;var n=this.fixed_value();return !n||n._dot_throw(e)}));}((function(e,t){e.DEFMETHOD("_dot_throw",t);})),function(e){const t=makePredicate("! delete"),n=makePredicate("in instanceof == != === !== < <= >= >");e(AST_Node,return_false),e(AST_UnaryPrefix,(function(){return t.has(this.operator)})),e(AST_Binary,(function(){return n.has(this.operator)||lazy_op.has(this.operator)&&this.left.is_boolean()&&this.right.is_boolean()})),e(AST_Conditional,(function(){return this.consequent.is_boolean()&&this.alternative.is_boolean()})),e(AST_Assign,(function(){return "="==this.operator&&this.right.is_boolean()})),e(AST_Sequence,(function(){return this.tail_node().is_boolean()})),e(AST_True,return_true),e(AST_False,return_true);}((function(e,t){e.DEFMETHOD("is_boolean",t);})),function(e){e(AST_Node,return_false),e(AST_Number,return_true);var t=makePredicate("+ - ~ ++ --");e(AST_Unary,(function(){return t.has(this.operator)}));var n=makePredicate("- * / % & | ^ << >> >>>");e(AST_Binary,(function(e){return n.has(this.operator)||"+"==this.operator&&this.left.is_number(e)&&this.right.is_number(e)})),e(AST_Assign,(function(e){return n.has(this.operator.slice(0,-1))||"="==this.operator&&this.right.is_number(e)})),e(AST_Sequence,(function(e){return this.tail_node().is_number(e)})),e(AST_Conditional,(function(e){return this.consequent.is_number(e)&&this.alternative.is_number(e)}));}((function(e,t){e.DEFMETHOD("is_number",t);})),function(e){e(AST_Node,return_false),e(AST_String,return_true),e(AST_TemplateString,return_true),e(AST_UnaryPrefix,(function(){return "typeof"==this.operator})),e(AST_Binary,(function(e){return "+"==this.operator&&(this.left.is_string(e)||this.right.is_string(e))})),e(AST_Assign,(function(e){return ("="==this.operator||"+="==this.operator)&&this.right.is_string(e)})),e(AST_Sequence,(function(e){return this.tail_node().is_string(e)})),e(AST_Conditional,(function(e){return this.consequent.is_string(e)&&this.alternative.is_string(e)}));}((function(e,t){e.DEFMETHOD("is_string",t);}));var lazy_op=makePredicate("&& || ??"),unary_side_effects=makePredicate("delete ++ --");function is_lhs(e,t){return t instanceof AST_Unary&&unary_side_effects.has(t.operator)?t.expression:t instanceof AST_Assign&&t.left===e?e:void 0}function best_of_expression(e,t){return e.size()>t.size()?t:e}function best_of_statement(e,t){return best_of_expression(make_node(AST_SimpleStatement,e,{body:e}),make_node(AST_SimpleStatement,t,{body:t})).body}function best_of(e,t,n){return (first_in_statement(e)?best_of_statement:best_of_expression)(t,n)}function convert_to_predicate(e){const t=new Map;for(var n of Object.keys(e))t.set(n,makePredicate(e[n]));return t}!function(e){function t(e,n){if(e instanceof AST_Node)return make_node(e.CTOR,n,e);if(Array.isArray(e))return make_node(AST_Array,n,{elements:e.map((function(e){return t(e,n)}))});if(e&&"object"==typeof e){var o=[];for(var i in e)HOP(e,i)&&o.push(make_node(AST_ObjectKeyVal,n,{key:i,value:t(e[i],n)}));return make_node(AST_Object,n,{properties:o})}return make_node_from_constant(e,n)}AST_Toplevel.DEFMETHOD("resolve_defines",(function(e){return e.option("global_defs")?(this.figure_out_scope({ie8:e.option("ie8")}),this.transform(new TreeTransformer((function(t){var n=t._find_defs(e,"");if(n){for(var o,i=0,r=t;(o=this.parent(i++))&&o instanceof AST_PropAccess&&o.expression===r;)r=o;if(!is_lhs(r,o))return n}})))):this})),e(AST_Node,noop),e(AST_Chain,(function(e,t){return this.expression._find_defs(e,t)})),e(AST_Dot,(function(e,t){return this.expression._find_defs(e,"."+this.property+t)})),e(AST_SymbolDeclaration,(function(){this.global();})),e(AST_SymbolRef,(function(e,n){if(this.global()){var o=e.option("global_defs"),i=this.name+n;return HOP(o,i)?t(o[i],this):void 0}}));}((function(e,t){e.DEFMETHOD("_find_defs",t);}));var object_fns=["constructor","toString","valueOf"],native_fns=convert_to_predicate({Array:["indexOf","join","lastIndexOf","slice"].concat(object_fns),Boolean:object_fns,Function:object_fns,Number:["toExponential","toFixed","toPrecision"].concat(object_fns),Object:object_fns,RegExp:["test"].concat(object_fns),String:["charAt","charCodeAt","concat","indexOf","italics","lastIndexOf","match","replace","search","slice","split","substr","substring","toLowerCase","toUpperCase","trim"].concat(object_fns)}),static_fns=convert_to_predicate({Array:["isArray"],Math:["abs","acos","asin","atan","ceil","cos","exp","floor","log","round","sin","sqrt","tan","atan2","pow","max","min"],Number:["isFinite","isNaN"],Object:["create","getOwnPropertyDescriptor","getOwnPropertyNames","getPrototypeOf","isExtensible","isFrozen","isSealed","keys"],String:["fromCharCode"]});!function(e){AST_Node.DEFMETHOD("evaluate",(function(e){if(!e.option("evaluate"))return this;var t=this._eval(e,1);return !t||t instanceof RegExp?t:"function"==typeof t||"object"==typeof t?this:t}));var t=makePredicate("! ~ - + void");AST_Node.DEFMETHOD("is_constant",(function(){return this instanceof AST_Constant?!(this instanceof AST_RegExp):this instanceof AST_UnaryPrefix&&this.expression instanceof AST_Constant&&t.has(this.operator)})),e(AST_Statement,(function(){throw new Error(string_template("Cannot evaluate a statement [{file}:{line},{col}]",this.start))})),e(AST_Lambda,return_this),e(AST_Class,return_this),e(AST_Node,return_this),e(AST_Constant,(function(){return this.getValue()})),e(AST_BigInt,return_this),e(AST_RegExp,(function(e){let t=e.evaluated_regexps.get(this);if(void 0===t){try{t=(0,eval)(this.print_to_string());}catch(e){t=null;}e.evaluated_regexps.set(this,t);}return t||this})),e(AST_TemplateString,(function(){return 1!==this.segments.length?this:this.segments[0].value})),e(AST_Function,(function(e){if(e.option("unsafe")){var t=function(){};return t.node=this,t.toString=function(){return this.node.print_to_string()},t}return this})),e(AST_Array,(function(e,t){if(e.option("unsafe")){for(var n=[],o=0,i=this.elements.length;o<i;o++){var r=this.elements[o],a=r._eval(e,t);if(r===a)return this;n.push(a);}return n}return this})),e(AST_Object,(function(e,t){if(e.option("unsafe")){for(var n={},o=0,i=this.properties.length;o<i;o++){var r=this.properties[o];if(r instanceof AST_Expansion)return this;var a=r.key;if(a instanceof AST_Symbol)a=a.name;else if(a instanceof AST_Node&&(a=a._eval(e,t))===r.key)return this;if("function"==typeof Object.prototype[a])return this;if(!(r.value instanceof AST_Function)&&(n[a]=r.value._eval(e,t),n[a]===r.value))return this}return n}return this}));var n=makePredicate("! typeof void");e(AST_UnaryPrefix,(function(e,t){var o=this.expression;if(e.option("typeofs")&&"typeof"==this.operator&&(o instanceof AST_Lambda||o instanceof AST_SymbolRef&&o.fixed_value()instanceof AST_Lambda))return "function";if(n.has(this.operator)||t++,(o=o._eval(e,t))===this.expression)return this;switch(this.operator){case"!":return !o;case"typeof":return o instanceof RegExp?this:typeof o;case"void":return;case"~":return ~o;case"-":return -o;case"+":return +o}return this}));var o=makePredicate("&& || ?? === !==");const i=makePredicate("== != === !=="),r=e=>"object"==typeof e||"function"==typeof e||"symbol"==typeof e;e(AST_Binary,(function(e,t){o.has(this.operator)||t++;var n=this.left._eval(e,t);if(n===this.left)return this;var a,s=this.right._eval(e,t);if(s===this.right)return this;if(null!=n&&null!=s&&i.has(this.operator)&&r(n)&&r(s)&&typeof n==typeof s)return this;switch(this.operator){case"&&":a=n&&s;break;case"||":a=n||s;break;case"??":a=null!=n?n:s;break;case"|":a=n|s;break;case"&":a=n&s;break;case"^":a=n^s;break;case"+":a=n+s;break;case"*":a=n*s;break;case"**":a=Math.pow(n,s);break;case"/":a=n/s;break;case"%":a=n%s;break;case"-":a=n-s;break;case"<<":a=n<<s;break;case">>":a=n>>s;break;case">>>":a=n>>>s;break;case"==":a=n==s;break;case"===":a=n===s;break;case"!=":a=n!=s;break;case"!==":a=n!==s;break;case"<":a=n<s;break;case"<=":a=n<=s;break;case">":a=n>s;break;case">=":a=n>=s;break;default:return this}return isNaN(a)&&e.find_parent(AST_With)?this:a})),e(AST_Conditional,(function(e,t){var n=this.condition._eval(e,t);if(n===this.condition)return this;var o=n?this.consequent:this.alternative,i=o._eval(e,t);return i===o?this:i}));const a=new Set;e(AST_SymbolRef,(function(e,t){if(a.has(this))return this;var n=this.fixed_value();if(!n)return this;a.add(this);const o=n._eval(e,t);if(a.delete(this),o===n)return this;if(o&&"object"==typeof o){var i=this.definition().escaped;if(i&&t>i)return this}return o}));var s={Array,Math,Number,Object,String},u=convert_to_predicate({Math:["E","LN10","LN2","LOG2E","LOG10E","PI","SQRT1_2","SQRT2"],Number:["MAX_VALUE","MIN_VALUE","NaN","NEGATIVE_INFINITY","POSITIVE_INFINITY"]});e(AST_PropAccess,(function(e,t){if(!this.optional||null!=this.expression._eval(e,t)){if(e.option("unsafe")){var n=this.property;if(n instanceof AST_Node&&(n=n._eval(e,t))===this.property)return this;var o,i=this.expression;if(is_undeclared_ref(i)){var r,a="hasOwnProperty"===i.name&&"call"===n&&(r=e.parent()&&e.parent().args)&&r&&r[0]&&r[0].evaluate(e);if(null==(a=a instanceof AST_Dot?a.expression:a)||a.thedef&&a.thedef.undeclared)return this.clone();var l=u.get(i.name);if(!l||!l.has(n))return this;o=s[i.name];}else {if(!(o=i._eval(e,t+1))||o===i||!HOP(o,n))return this;if("function"==typeof o)switch(n){case"name":return o.node.name?o.node.name.name:"";case"length":return o.node.argnames.length;default:return this}}return o[n]}return this}})),e(AST_Chain,(function(e,t){const n=this.expression._eval(e,t);return n===this.expression?this:n})),e(AST_Call,(function(e,t){var n=this.expression;if(!this.optional||null!=this.expression._eval(e,t)){if(e.option("unsafe")&&n instanceof AST_PropAccess){var o,i=n.property;if(i instanceof AST_Node&&(i=i._eval(e,t))===n.property)return this;var r=n.expression;if(is_undeclared_ref(r)){var a="hasOwnProperty"===r.name&&"call"===i&&this.args[0]&&this.args[0].evaluate(e);if(null==(a=a instanceof AST_Dot?a.expression:a)||a.thedef&&a.thedef.undeclared)return this.clone();var u=static_fns.get(r.name);if(!u||!u.has(i))return this;o=s[r.name];}else {if((o=r._eval(e,t+1))===r||!o)return this;var l=native_fns.get(o.constructor.name);if(!l||!l.has(i))return this}for(var _=[],c=0,f=this.args.length;c<f;c++){var p=this.args[c],d=p._eval(e,t);if(p===d)return this;_.push(d);}try{return o[i].apply(o,_)}catch(e){}}return this}})),e(AST_New,return_this);}((function(e,t){e.DEFMETHOD("_eval",t);})),function(e){function t(e){return make_node(AST_UnaryPrefix,e,{operator:"!",expression:e})}function n(e,n,o){var i=t(e);if(o){var r=make_node(AST_SimpleStatement,n,{body:n});return best_of_expression(i,r)===r?n:i}return best_of_expression(i,n)}e(AST_Node,(function(){return t(this)})),e(AST_Statement,(function(){throw new Error("Cannot negate a statement")})),e(AST_Function,(function(){return t(this)})),e(AST_Arrow,(function(){return t(this)})),e(AST_UnaryPrefix,(function(){return "!"==this.operator?this.expression:t(this)})),e(AST_Sequence,(function(e){var t=this.expressions.slice();return t.push(t.pop().negate(e)),make_sequence(this,t)})),e(AST_Conditional,(function(e,t){var o=this.clone();return o.consequent=o.consequent.negate(e),o.alternative=o.alternative.negate(e),n(this,o,t)})),e(AST_Binary,(function(e,o){var i=this.clone(),r=this.operator;if(e.option("unsafe_comps"))switch(r){case"<=":return i.operator=">",i;case"<":return i.operator=">=",i;case">=":return i.operator="<",i;case">":return i.operator="<=",i}switch(r){case"==":return i.operator="!=",i;case"!=":return i.operator="==",i;case"===":return i.operator="!==",i;case"!==":return i.operator="===",i;case"&&":return i.operator="||",i.left=i.left.negate(e,o),i.right=i.right.negate(e),n(this,i,o);case"||":return i.operator="&&",i.left=i.left.negate(e,o),i.right=i.right.negate(e),n(this,i,o);case"??":return i.right=i.right.negate(e),n(this,i,o)}return t(this)}));}((function(e,t){e.DEFMETHOD("negate",(function(e,n){return t.call(this,e,n)}));}));var global_pure_fns=makePredicate("Boolean decodeURI decodeURIComponent Date encodeURI encodeURIComponent Error escape EvalError isFinite isNaN Number Object parseFloat parseInt RangeError ReferenceError String SyntaxError TypeError unescape URIError");AST_Call.DEFMETHOD("is_expr_pure",(function(e){if(e.option("unsafe")){var t=this.expression,n=this.args&&this.args[0]&&this.args[0].evaluate(e);if(t.expression&&"hasOwnProperty"===t.expression.name&&(null==n||n.thedef&&n.thedef.undeclared))return !1;if(is_undeclared_ref(t)&&global_pure_fns.has(t.name))return !0;let o;if(t instanceof AST_Dot&&is_undeclared_ref(t.expression)&&(o=static_fns.get(t.expression.name))&&o.has(t.property))return !0}return !!has_annotation(this,_PURE)||!e.pure_funcs(this)})),AST_Node.DEFMETHOD("is_call_pure",return_false),AST_Dot.DEFMETHOD("is_call_pure",(function(e){if(!e.option("unsafe"))return;const t=this.expression;let n;return t instanceof AST_Array?n=native_fns.get("Array"):t.is_boolean()?n=native_fns.get("Boolean"):t.is_number(e)?n=native_fns.get("Number"):t instanceof AST_RegExp?n=native_fns.get("RegExp"):t.is_string(e)?n=native_fns.get("String"):this.may_throw_on_access(e)||(n=native_fns.get("Object")),n&&n.has(this.property)}));const pure_prop_access_globals=new Set(["Number","String","Array","Object","Function","Promise"]);function aborts(e){return e&&e.aborts()}!function(e){function t(e,t){for(var n=e.length;--n>=0;)if(e[n].has_side_effects(t))return !0;return !1}e(AST_Node,return_true),e(AST_EmptyStatement,return_false),e(AST_Constant,return_false),e(AST_This,return_false),e(AST_Block,(function(e){return t(this.body,e)})),e(AST_Call,(function(e){return !(this.is_expr_pure(e)||this.expression.is_call_pure(e)&&!this.expression.has_side_effects(e))||t(this.args,e)})),e(AST_Switch,(function(e){return this.expression.has_side_effects(e)||t(this.body,e)})),e(AST_Case,(function(e){return this.expression.has_side_effects(e)||t(this.body,e)})),e(AST_Try,(function(e){return t(this.body,e)||this.bcatch&&this.bcatch.has_side_effects(e)||this.bfinally&&this.bfinally.has_side_effects(e)})),e(AST_If,(function(e){return this.condition.has_side_effects(e)||this.body&&this.body.has_side_effects(e)||this.alternative&&this.alternative.has_side_effects(e)})),e(AST_LabeledStatement,(function(e){return this.body.has_side_effects(e)})),e(AST_SimpleStatement,(function(e){return this.body.has_side_effects(e)})),e(AST_Lambda,return_false),e(AST_Class,(function(e){return !(!this.extends||!this.extends.has_side_effects(e))||t(this.properties,e)})),e(AST_Binary,(function(e){return this.left.has_side_effects(e)||this.right.has_side_effects(e)})),e(AST_Assign,return_true),e(AST_Conditional,(function(e){return this.condition.has_side_effects(e)||this.consequent.has_side_effects(e)||this.alternative.has_side_effects(e)})),e(AST_Unary,(function(e){return unary_side_effects.has(this.operator)||this.expression.has_side_effects(e)})),e(AST_SymbolRef,(function(e){return !this.is_declared(e)&&!pure_prop_access_globals.has(this.name)})),e(AST_SymbolClassProperty,return_false),e(AST_SymbolDeclaration,return_false),e(AST_Object,(function(e){return t(this.properties,e)})),e(AST_ObjectProperty,(function(e){return this.computed_key()&&this.key.has_side_effects(e)||this.value&&this.value.has_side_effects(e)})),e(AST_ClassProperty,(function(e){return this.computed_key()&&this.key.has_side_effects(e)||this.static&&this.value&&this.value.has_side_effects(e)})),e(AST_ConciseMethod,(function(e){return this.computed_key()&&this.key.has_side_effects(e)})),e(AST_ObjectGetter,(function(e){return this.computed_key()&&this.key.has_side_effects(e)})),e(AST_ObjectSetter,(function(e){return this.computed_key()&&this.key.has_side_effects(e)})),e(AST_Array,(function(e){return t(this.elements,e)})),e(AST_Dot,(function(e){return !this.optional&&this.expression.may_throw_on_access(e)||this.expression.has_side_effects(e)})),e(AST_Sub,(function(e){return (!this.optional||!is_nullish(this.expression))&&(!this.optional&&this.expression.may_throw_on_access(e)||this.expression.has_side_effects(e)||this.property.has_side_effects(e))})),e(AST_Chain,(function(e){return this.expression.has_side_effects(e)})),e(AST_Sequence,(function(e){return t(this.expressions,e)})),e(AST_Definitions,(function(e){return t(this.definitions,e)})),e(AST_VarDef,(function(){return this.value})),e(AST_TemplateSegment,return_false),e(AST_TemplateString,(function(e){return t(this.segments,e)}));}((function(e,t){e.DEFMETHOD("has_side_effects",t);})),function(e){function t(e,t){for(var n=e.length;--n>=0;)if(e[n].may_throw(t))return !0;return !1}e(AST_Node,return_true),e(AST_Constant,return_false),e(AST_EmptyStatement,return_false),e(AST_Lambda,return_false),e(AST_SymbolDeclaration,return_false),e(AST_This,return_false),e(AST_Class,(function(e){return !(!this.extends||!this.extends.may_throw(e))||t(this.properties,e)})),e(AST_Array,(function(e){return t(this.elements,e)})),e(AST_Assign,(function(e){return !!this.right.may_throw(e)||!(!e.has_directive("use strict")&&"="==this.operator&&this.left instanceof AST_SymbolRef)&&this.left.may_throw(e)})),e(AST_Binary,(function(e){return this.left.may_throw(e)||this.right.may_throw(e)})),e(AST_Block,(function(e){return t(this.body,e)})),e(AST_Call,(function(e){return (!this.optional||!is_nullish(this.expression))&&(!!t(this.args,e)||!this.is_expr_pure(e)&&(!!this.expression.may_throw(e)||!(this.expression instanceof AST_Lambda)||t(this.expression.body,e)))})),e(AST_Case,(function(e){return this.expression.may_throw(e)||t(this.body,e)})),e(AST_Conditional,(function(e){return this.condition.may_throw(e)||this.consequent.may_throw(e)||this.alternative.may_throw(e)})),e(AST_Definitions,(function(e){return t(this.definitions,e)})),e(AST_If,(function(e){return this.condition.may_throw(e)||this.body&&this.body.may_throw(e)||this.alternative&&this.alternative.may_throw(e)})),e(AST_LabeledStatement,(function(e){return this.body.may_throw(e)})),e(AST_Object,(function(e){return t(this.properties,e)})),e(AST_ObjectProperty,(function(e){return !!this.value&&this.value.may_throw(e)})),e(AST_ClassProperty,(function(e){return this.computed_key()&&this.key.may_throw(e)||this.static&&this.value&&this.value.may_throw(e)})),e(AST_ConciseMethod,(function(e){return this.computed_key()&&this.key.may_throw(e)})),e(AST_ObjectGetter,(function(e){return this.computed_key()&&this.key.may_throw(e)})),e(AST_ObjectSetter,(function(e){return this.computed_key()&&this.key.may_throw(e)})),e(AST_Return,(function(e){return this.value&&this.value.may_throw(e)})),e(AST_Sequence,(function(e){return t(this.expressions,e)})),e(AST_SimpleStatement,(function(e){return this.body.may_throw(e)})),e(AST_Dot,(function(e){return !this.optional&&this.expression.may_throw_on_access(e)||this.expression.may_throw(e)})),e(AST_Sub,(function(e){return (!this.optional||!is_nullish(this.expression))&&(!this.optional&&this.expression.may_throw_on_access(e)||this.expression.may_throw(e)||this.property.may_throw(e))})),e(AST_Chain,(function(e){return this.expression.may_throw(e)})),e(AST_Switch,(function(e){return this.expression.may_throw(e)||t(this.body,e)})),e(AST_SymbolRef,(function(e){return !this.is_declared(e)&&!pure_prop_access_globals.has(this.name)})),e(AST_SymbolClassProperty,return_false),e(AST_Try,(function(e){return this.bcatch?this.bcatch.may_throw(e):t(this.body,e)||this.bfinally&&this.bfinally.may_throw(e)})),e(AST_Unary,(function(e){return !("typeof"==this.operator&&this.expression instanceof AST_SymbolRef)&&this.expression.may_throw(e)})),e(AST_VarDef,(function(e){return !!this.value&&this.value.may_throw(e)}));}((function(e,t){e.DEFMETHOD("may_throw",t);})),function(e){function t(e){let t=!0;return walk$3(this,(n=>{if(n instanceof AST_SymbolRef){if(has_flag(this,16))return t=!1,walk_abort;var o=n.definition();if(member(o,this.enclosed)&&!this.variables.has(o.name)){if(e){var i=e.find_variable(n);if(o.undeclared?!i:i===o)return t="f",!0}return t=!1,walk_abort}return !0}if(n instanceof AST_This&&this instanceof AST_Arrow)return t=!1,walk_abort})),t}e(AST_Node,return_false),e(AST_Constant,return_true),e(AST_Class,(function(e){if(this.extends&&!this.extends.is_constant_expression(e))return !1;for(const t of this.properties){if(t.computed_key()&&!t.key.is_constant_expression(e))return !1;if(t.static&&t.value&&!t.value.is_constant_expression(e))return !1}return t.call(this,e)})),e(AST_Lambda,t),e(AST_Unary,(function(){return this.expression.is_constant_expression()})),e(AST_Binary,(function(){return this.left.is_constant_expression()&&this.right.is_constant_expression()})),e(AST_Array,(function(){return this.elements.every((e=>e.is_constant_expression()))})),e(AST_Object,(function(){return this.properties.every((e=>e.is_constant_expression()))})),e(AST_ObjectProperty,(function(){return !(this.key instanceof AST_Node||!this.value||!this.value.is_constant_expression())}));}((function(e,t){e.DEFMETHOD("is_constant_expression",t);})),function(e){function t(){for(var e=0;e<this.body.length;e++)if(aborts(this.body[e]))return this.body[e];return null}e(AST_Statement,return_null),e(AST_Jump,return_this),e(AST_Import,(function(){return null})),e(AST_BlockStatement,t),e(AST_SwitchBranch,t),e(AST_If,(function(){return this.alternative&&aborts(this.body)&&aborts(this.alternative)&&this}));}((function(e,t){e.DEFMETHOD("aborts",t);}));var directives=new Set(["use asm","use strict"]);function can_be_extracted_from_if_block(e){return !(e instanceof AST_Const||e instanceof AST_Let||e instanceof AST_Class)}function opt_AST_Lambda(e,t){return tighten_body(e.body,t),t.option("side_effects")&&1==e.body.length&&e.body[0]===t.has_directive("use strict")&&(e.body.length=0),e}def_optimize(AST_Directive,(function(e,t){return !t.option("directives")||directives.has(e.value)&&t.has_directive(e.value)===e?e:make_node(AST_EmptyStatement,e)})),def_optimize(AST_Debugger,(function(e,t){return t.option("drop_debugger")?make_node(AST_EmptyStatement,e):e})),def_optimize(AST_LabeledStatement,(function(e,t){return e.body instanceof AST_Break&&t.loopcontrol_target(e.body)===e.body?make_node(AST_EmptyStatement,e):0==e.label.references.length?e.body:e})),def_optimize(AST_Block,(function(e,t){return tighten_body(e.body,t),e})),def_optimize(AST_BlockStatement,(function(e,t){switch(tighten_body(e.body,t),e.body.length){case 1:if(!t.has_directive("use strict")&&t.parent()instanceof AST_If&&can_be_extracted_from_if_block(e.body[0])||can_be_evicted_from_block(e.body[0]))return e.body[0];break;case 0:return make_node(AST_EmptyStatement,e)}return e})),def_optimize(AST_Lambda,opt_AST_Lambda);const r_keep_assign=/keep_assign/;function has_break_or_continue(e,t){var n=!1,o=new TreeWalker((function(t){return !!(n||t instanceof AST_Scope)||(t instanceof AST_LoopControl&&o.loopcontrol_target(t)===e?n=!0:void 0)}));return t instanceof AST_LabeledStatement&&o.push(t),o.push(e),e.body.walk(o),n}function if_break_in_loop(e,t){var n=e.body instanceof AST_BlockStatement?e.body.body[0]:e.body;if(t.option("dead_code")&&i(n)){var o=[];return e.init instanceof AST_Statement?o.push(e.init):e.init&&o.push(make_node(AST_SimpleStatement,e.init,{body:e.init})),e.condition&&o.push(make_node(AST_SimpleStatement,e.condition,{body:e.condition})),trim_unreachable_code(t,e.body,o),make_node(AST_BlockStatement,e,{body:o})}return n instanceof AST_If&&(i(n.body)?(e.condition?e.condition=make_node(AST_Binary,e.condition,{left:e.condition,operator:"&&",right:n.condition.negate(t)}):e.condition=n.condition.negate(t),r(n.alternative)):i(n.alternative)&&(e.condition?e.condition=make_node(AST_Binary,e.condition,{left:e.condition,operator:"&&",right:n.condition}):e.condition=n.condition,r(n.body))),e;function i(e){return e instanceof AST_Break&&t.loopcontrol_target(e)===t.self()}function r(n){n=as_statement_array(n),e.body instanceof AST_BlockStatement?(e.body=e.body.clone(),e.body.body=n.concat(e.body.body.slice(1)),e.body=e.body.transform(t)):e.body=make_node(AST_BlockStatement,e.body,{body:n}).transform(t),e=if_break_in_loop(e,t);}}function retain_top_func(e,t){return t.top_retain&&e instanceof AST_Defun&&has_flag(e,TOP)&&e.name&&t.top_retain(e.name)}AST_Scope.DEFMETHOD("drop_unused",(function(e){if(!e.option("unused"))return;if(e.has_directive("use asm"))return;var t=this;if(t.pinned())return;var n=!(t instanceof AST_Toplevel)||e.toplevel.funcs,o=!(t instanceof AST_Toplevel)||e.toplevel.vars;const i=r_keep_assign.test(e.option("unused"))?return_false:function(e){return e instanceof AST_Assign&&!e.logical&&(has_flag(e,32)||"="==e.operator)?e.left:e instanceof AST_Unary&&has_flag(e,32)?e.expression:void 0};var r=new Map,a=new Map;t instanceof AST_Toplevel&&e.top_retain&&t.variables.forEach((function(t){e.top_retain(t)&&!r.has(t.id)&&r.set(t.id,t);}));var s=new Map,u=new Map,l=this,_=new TreeWalker((function(i,c){if(i instanceof AST_Lambda&&i.uses_arguments&&!_.has_directive("use strict")&&i.argnames.forEach((function(e){if(e instanceof AST_SymbolDeclaration){var t=e.definition();r.has(t.id)||r.set(t.id,t);}})),i!==t){if(i instanceof AST_Defun||i instanceof AST_DefClass){var p=i.name.definition();if((_.parent()instanceof AST_Export||!n&&l===t)&&p.global&&!r.has(p.id)&&r.set(p.id,p),i instanceof AST_DefClass){i.extends&&(i.extends.has_side_effects(e)||i.extends.may_throw(e))&&i.extends.walk(_);for(const t of i.properties)(t.has_side_effects(e)||t.may_throw(e))&&t.walk(_);}return map_add(u,p.id,i),!0}if(i instanceof AST_SymbolFunarg&&l===t&&map_add(s,i.definition().id,i),i instanceof AST_Definitions&&l===t){const t=_.parent()instanceof AST_Export;return i.definitions.forEach((function(n){if(n.name instanceof AST_SymbolVar&&map_add(s,n.name.definition().id,n),!t&&o||walk$3(n.name,(e=>{if(e instanceof AST_SymbolDeclaration){const n=e.definition();!t&&!n.global||r.has(n.id)||r.set(n.id,n);}})),n.value){if(n.name instanceof AST_Destructuring)n.walk(_);else {var i=n.name.definition();map_add(u,i.id,n.value),i.chained||n.name.fixed_value()!==n.value||a.set(i.id,n);}n.value.has_side_effects(e)&&n.value.walk(_);}})),!0}return f(i,c)}}));t.walk(_),_=new TreeWalker(f),r.forEach((function(e){var t=u.get(e.id);t&&t.forEach((function(e){e.walk(_);}));}));var c=new TreeTransformer((function(u,_,f){var p=c.parent();if(o){const e=i(u);if(e instanceof AST_SymbolRef){var d=e.definition(),S=r.has(d.id);if(u instanceof AST_Assign){if(!S||a.has(d.id)&&a.get(d.id)!==u)return maintain_this_binding(p,u,u.right.transform(c))}else if(!S)return f?MAP.skip:make_node(AST_Number,u,{value:0})}}if(l===t){if(u.name&&(u instanceof AST_ClassExpression&&!keep_name(e.option("keep_classnames"),(d=u.name.definition()).name)||u instanceof AST_Function&&!keep_name(e.option("keep_fnames"),(d=u.name.definition()).name))&&(!r.has(d.id)||d.orig.length>1)&&(u.name=null),u instanceof AST_Lambda&&!(u instanceof AST_Accessor))for(var m=!e.option("keep_fargs"),A=u.argnames,T=A.length;--T>=0;){var h=A[T];h instanceof AST_Expansion&&(h=h.expression),h instanceof AST_DefaultAssign&&(h=h.left),h instanceof AST_Destructuring||r.has(h.definition().id)?m=!1:(set_flag(h,1),m&&A.pop());}if((u instanceof AST_Defun||u instanceof AST_DefClass)&&u!==t){const t=u.name.definition();if(!(t.global&&!n||r.has(t.id))){if(t.eliminated++,u instanceof AST_DefClass){const t=u.drop_side_effect_free(e);if(t)return make_node(AST_SimpleStatement,u,{body:t})}return f?MAP.skip:make_node(AST_EmptyStatement,u)}}if(u instanceof AST_Definitions&&!(p instanceof AST_ForIn&&p.init===u)){var E=!(p instanceof AST_Toplevel||u instanceof AST_Var),g=[],D=[],b=[],y=[];switch(u.definitions.forEach((function(t){t.value&&(t.value=t.value.transform(c));var n=t.name instanceof AST_Destructuring,i=n?new SymbolDef(null,{name:"<destructure>"}):t.name.definition();if(E&&i.global)return b.push(t);if(!o&&!E||n&&(t.name.names.length||t.name.is_array||1!=e.option("pure_getters"))||r.has(i.id)){if(t.value&&a.has(i.id)&&a.get(i.id)!==t&&(t.value=t.value.drop_side_effect_free(e)),t.name instanceof AST_SymbolVar){var l=s.get(i.id);if(l.length>1&&(!t.value||i.orig.indexOf(t.name)>i.eliminated)){if(t.value){var _=make_node(AST_SymbolRef,t.name,t.name);i.references.push(_);var f=make_node(AST_Assign,t,{operator:"=",logical:!1,left:_,right:t.value});a.get(i.id)===t&&a.set(i.id,f),y.push(f.transform(c));}return remove$1(l,t),void i.eliminated++}}t.value?(y.length>0&&(b.length>0?(y.push(t.value),t.value=make_sequence(t.value,y)):g.push(make_node(AST_SimpleStatement,u,{body:make_sequence(u,y)})),y=[]),b.push(t)):D.push(t);}else if(i.orig[0]instanceof AST_SymbolCatch)(p=t.value&&t.value.drop_side_effect_free(e))&&y.push(p),t.value=null,D.push(t);else {var p;(p=t.value&&t.value.drop_side_effect_free(e))&&y.push(p),i.eliminated++;}})),(D.length>0||b.length>0)&&(u.definitions=D.concat(b),g.push(u)),y.length>0&&g.push(make_node(AST_SimpleStatement,u,{body:make_sequence(u,y)})),g.length){case 0:return f?MAP.skip:make_node(AST_EmptyStatement,u);case 1:return g[0];default:return f?MAP.splice(g):make_node(AST_BlockStatement,u,{body:g})}}if(u instanceof AST_For)return _(u,this),u.init instanceof AST_BlockStatement&&(v=u.init,u.init=v.body.pop(),v.body.push(u)),u.init instanceof AST_SimpleStatement?u.init=u.init.body:is_empty(u.init)&&(u.init=null),v?f?MAP.splice(v.body):v:u;if(u instanceof AST_LabeledStatement&&u.body instanceof AST_For){if(_(u,this),u.body instanceof AST_BlockStatement){var v=u.body;return u.body=v.body.pop(),v.body.push(u),f?MAP.splice(v.body):v}return u}if(u instanceof AST_BlockStatement)return _(u,this),f&&u.body.every(can_be_evicted_from_block)?MAP.splice(u.body):u;if(u instanceof AST_Scope){const e=l;return l=u,_(u,this),l=e,u}}}));function f(e,n){var o;const s=i(e);if(s instanceof AST_SymbolRef&&!is_ref_of(e.left,AST_SymbolBlockDeclaration)&&t.variables.get(s.name)===(o=s.definition()))return e instanceof AST_Assign&&(e.right.walk(_),o.chained||e.left.fixed_value()!==e.right||a.set(o.id,e)),!0;if(e instanceof AST_SymbolRef){if(o=e.definition(),!r.has(o.id)&&(r.set(o.id,o),o.orig[0]instanceof AST_SymbolCatch)){const e=o.scope.is_block_scope()&&o.scope.get_defun_scope().variables.get(o.name);e&&r.set(e.id,e);}return !0}if(e instanceof AST_Scope){var u=l;return l=e,n(),l=u,!0}}t.transform(c);})),AST_Scope.DEFMETHOD("hoist_declarations",(function(e){var t=this;if(e.has_directive("use asm"))return t;if(!Array.isArray(t.body))return t;var n=e.option("hoist_funs"),o=e.option("hoist_vars");if(n||o){var i=[],r=[],a=new Map,s=0,u=0;walk$3(t,(e=>e instanceof AST_Scope&&e!==t||(e instanceof AST_Var?(++u,!0):void 0))),o=o&&u>1;var l=new TreeTransformer((function(u){if(u!==t){if(u instanceof AST_Directive)return i.push(u),make_node(AST_EmptyStatement,u);if(n&&u instanceof AST_Defun&&!(l.parent()instanceof AST_Export)&&l.parent()===t)return r.push(u),make_node(AST_EmptyStatement,u);if(o&&u instanceof AST_Var&&!u.definitions.some((e=>e.name instanceof AST_Destructuring))){u.definitions.forEach((function(e){a.set(e.name.name,e),++s;}));var _=u.to_assignments(e),c=l.parent();if(c instanceof AST_ForIn&&c.init===u){if(null==_){var f=u.definitions[0].name;return make_node(AST_SymbolRef,f,f)}return _}return c instanceof AST_For&&c.init===u?_:_?make_node(AST_SimpleStatement,u,{body:_}):make_node(AST_EmptyStatement,u)}if(u instanceof AST_Scope)return u}}));if(t=t.transform(l),s>0){var _=[];const e=t instanceof AST_Lambda,n=e?t.args_as_names():null;if(a.forEach(((t,o)=>{e&&n.some((e=>e.name===t.name.name))?a.delete(o):((t=t.clone()).value=null,_.push(t),a.set(o,t));})),_.length>0){for(;0<t.body.length;){if(t.body[0]instanceof AST_SimpleStatement){var c,f,p=t.body[0].body;if(p instanceof AST_Assign&&"="==p.operator&&(c=p.left)instanceof AST_Symbol&&a.has(c.name)){if((d=a.get(c.name)).value)break;d.value=p.right,remove$1(_,d),_.push(d),t.body.splice(0,1);continue}if(p instanceof AST_Sequence&&(f=p.expressions[0])instanceof AST_Assign&&"="==f.operator&&(c=f.left)instanceof AST_Symbol&&a.has(c.name)){var d;if((d=a.get(c.name)).value)break;d.value=f.right,remove$1(_,d),_.push(d),t.body[0].body=make_sequence(p,p.expressions.slice(1));continue}}if(t.body[0]instanceof AST_EmptyStatement)t.body.splice(0,1);else {if(!(t.body[0]instanceof AST_BlockStatement))break;t.body.splice(0,1,...t.body[0].body);}}_=make_node(AST_Var,t,{definitions:_}),r.push(_);}}t.body=i.concat(r,t.body);}return t})),AST_Scope.DEFMETHOD("hoist_properties",(function(e){var t=this;if(!e.option("hoist_props")||e.has_directive("use asm"))return t;var n=t instanceof AST_Toplevel&&e.top_retain||return_false,o=new Map,i=new TreeTransformer((function(r,a){if(r instanceof AST_Definitions&&i.parent()instanceof AST_Export)return r;if(r instanceof AST_VarDef){const s=r.name;let u,l;if(s.scope===t&&1!=(u=s.definition()).escaped&&!u.assignments&&!u.direct_access&&!u.single_use&&!e.exposed(u)&&!n(u)&&(l=s.fixed_value())===r.value&&l instanceof AST_Object&&!l.properties.some((e=>e instanceof AST_Expansion||e.computed_key()))){a(r,this);const e=new Map,n=[];return l.properties.forEach((({key:o,value:a})=>{const u=find_scope(i),l=t.create_symbol(s.CTOR,{source:s,scope:u,conflict_scopes:new Set([u,...s.definition().references.map((e=>e.scope))]),tentative_name:s.name+"_"+o});e.set(String(o),l.definition()),n.push(make_node(AST_VarDef,r,{name:l,value:a}));})),o.set(u.id,e),MAP.splice(n)}}else if(r instanceof AST_PropAccess&&r.expression instanceof AST_SymbolRef){const e=o.get(r.expression.definition().id);if(e){const t=e.get(String(get_value(r.property))),n=make_node(AST_SymbolRef,r,{name:t.name,scope:r.expression.scope,thedef:t});return n.reference({}),n}}}));return t.transform(i)})),function(e){function t(e,t,n){var o=e.length;if(!o)return null;for(var i=[],r=!1,a=0;a<o;a++){var s=e[a].drop_side_effect_free(t,n);r|=s!==e[a],s&&(i.push(s),n=!1);}return r?i.length?i:null:e}e(AST_Node,return_this),e(AST_Constant,return_null),e(AST_This,return_null),e(AST_Call,(function(e,n){if(this.optional&&is_nullish(this.expression))return make_node(AST_Undefined,this);if(!this.is_expr_pure(e)){if(this.expression.is_call_pure(e)){var o=this.args.slice();return o.unshift(this.expression.expression),(o=t(o,e,n))&&make_sequence(this,o)}if(is_func_expr(this.expression)&&(!this.expression.name||!this.expression.name.definition().references.length)){var i=this.clone();return i.expression.process_expression(!1,e),i}return this}var r=t(this.args,e,n);return r&&make_sequence(this,r)})),e(AST_Accessor,return_null),e(AST_Function,return_null),e(AST_Arrow,return_null),e(AST_Class,(function(e){const t=[],n=this.extends&&this.extends.drop_side_effect_free(e);n&&t.push(n);for(const n of this.properties){const o=n.drop_side_effect_free(e);o&&t.push(o);}return t.length?make_sequence(this,t):null})),e(AST_Binary,(function(e,t){var n=this.right.drop_side_effect_free(e);if(!n)return this.left.drop_side_effect_free(e,t);if(lazy_op.has(this.operator)){if(n===this.right)return this;var o=this.clone();return o.right=n,o}var i=this.left.drop_side_effect_free(e,t);return i?make_sequence(this,[i,n]):this.right.drop_side_effect_free(e,t)})),e(AST_Assign,(function(e){if(this.logical)return this;var t=this.left;if(t.has_side_effects(e)||e.has_directive("use strict")&&t instanceof AST_PropAccess&&t.expression.is_constant())return this;for(set_flag(this,32);t instanceof AST_PropAccess;)t=t.expression;return t.is_constant_expression(e.find_parent(AST_Scope))?this.right.drop_side_effect_free(e):this})),e(AST_Conditional,(function(e){var t=this.consequent.drop_side_effect_free(e),n=this.alternative.drop_side_effect_free(e);if(t===this.consequent&&n===this.alternative)return this;if(!t)return n?make_node(AST_Binary,this,{operator:"||",left:this.condition,right:n}):this.condition.drop_side_effect_free(e);if(!n)return make_node(AST_Binary,this,{operator:"&&",left:this.condition,right:t});var o=this.clone();return o.consequent=t,o.alternative=n,o})),e(AST_Unary,(function(e,t){if(unary_side_effects.has(this.operator))return this.expression.has_side_effects(e)?clear_flag(this,32):set_flag(this,32),this;if("typeof"==this.operator&&this.expression instanceof AST_SymbolRef)return null;var n=this.expression.drop_side_effect_free(e,t);return t&&n&&is_iife_call(n)?n===this.expression&&"!"==this.operator?this:n.negate(e,t):n})),e(AST_SymbolRef,(function(e){return this.is_declared(e)||pure_prop_access_globals.has(this.name)?null:this})),e(AST_Object,(function(e,n){var o=t(this.properties,e,n);return o&&make_sequence(this,o)})),e(AST_ObjectProperty,(function(e,t){const n=this instanceof AST_ObjectKeyVal&&this.key instanceof AST_Node&&this.key.drop_side_effect_free(e,t),o=this.value&&this.value.drop_side_effect_free(e,t);return n&&o?make_sequence(this,[n,o]):n||o})),e(AST_ClassProperty,(function(e){const t=this.computed_key()&&this.key.drop_side_effect_free(e),n=this.static&&this.value&&this.value.drop_side_effect_free(e);return t&&n?make_sequence(this,[t,n]):t||n||null})),e(AST_ConciseMethod,(function(){return this.computed_key()?this.key:null})),e(AST_ObjectGetter,(function(){return this.computed_key()?this.key:null})),e(AST_ObjectSetter,(function(){return this.computed_key()?this.key:null})),e(AST_Array,(function(e,n){var o=t(this.elements,e,n);return o&&make_sequence(this,o)})),e(AST_Dot,(function(e,t){return this.optional?is_nullish(this.expression)?make_node(AST_Undefined,this):this:this.expression.may_throw_on_access(e)?this:this.expression.drop_side_effect_free(e,t)})),e(AST_Sub,(function(e,t){if(this.optional)return is_nullish(this.expression)?make_node(AST_Undefined,this):this;if(this.expression.may_throw_on_access(e))return this;var n=this.expression.drop_side_effect_free(e,t);if(!n)return this.property.drop_side_effect_free(e,t);var o=this.property.drop_side_effect_free(e);return o?make_sequence(this,[n,o]):n})),e(AST_Chain,(function(e,t){return this.expression.drop_side_effect_free(e,t)})),e(AST_Sequence,(function(e){var t=this.tail_node(),n=t.drop_side_effect_free(e);if(n===t)return this;var o=this.expressions.slice(0,-1);return n&&o.push(n),o.length?make_sequence(this,o):make_node(AST_Number,this,{value:0})})),e(AST_Expansion,(function(e,t){return this.expression.drop_side_effect_free(e,t)})),e(AST_TemplateSegment,return_null),e(AST_TemplateString,(function(e){var n=t(this.segments,e,first_in_statement);return n&&make_sequence(this,n)}));}((function(e,t){e.DEFMETHOD("drop_side_effect_free",t);})),def_optimize(AST_SimpleStatement,(function(e,t){if(t.option("side_effects")){var n=e.body,o=n.drop_side_effect_free(t,!0);if(!o)return make_node(AST_EmptyStatement,e);if(o!==n)return make_node(AST_SimpleStatement,e,{body:o})}return e})),def_optimize(AST_While,(function(e,t){return t.option("loops")?make_node(AST_For,e,e).optimize(t):e})),def_optimize(AST_Do,(function(e,t){if(!t.option("loops"))return e;var n=e.condition.tail_node().evaluate(t);if(!(n instanceof AST_Node)){if(n)return make_node(AST_For,e,{body:make_node(AST_BlockStatement,e.body,{body:[e.body,make_node(AST_SimpleStatement,e.condition,{body:e.condition})]})}).optimize(t);if(!has_break_or_continue(e,t.parent()))return make_node(AST_BlockStatement,e.body,{body:[e.body,make_node(AST_SimpleStatement,e.condition,{body:e.condition})]}).optimize(t)}return e})),def_optimize(AST_For,(function(e,t){if(!t.option("loops"))return e;if(t.option("side_effects")&&e.init&&(e.init=e.init.drop_side_effect_free(t)),e.condition){var n=e.condition.evaluate(t);if(!(n instanceof AST_Node))if(n)e.condition=null;else if(!t.option("dead_code")){var o=e.condition;e.condition=make_node_from_constant(n,e.condition),e.condition=best_of_expression(e.condition.transform(t),o);}if(t.option("dead_code")&&(n instanceof AST_Node&&(n=e.condition.tail_node().evaluate(t)),!n)){var i=[];return trim_unreachable_code(t,e.body,i),e.init instanceof AST_Statement?i.push(e.init):e.init&&i.push(make_node(AST_SimpleStatement,e.init,{body:e.init})),i.push(make_node(AST_SimpleStatement,e.condition,{body:e.condition})),make_node(AST_BlockStatement,e,{body:i}).optimize(t)}}return if_break_in_loop(e,t)})),def_optimize(AST_If,(function(e,t){if(is_empty(e.alternative)&&(e.alternative=null),!t.option("conditionals"))return e;var n=e.condition.evaluate(t);if(!(t.option("dead_code")||n instanceof AST_Node)){var o=e.condition;e.condition=make_node_from_constant(n,o),e.condition=best_of_expression(e.condition.transform(t),o);}if(t.option("dead_code")){if(n instanceof AST_Node&&(n=e.condition.tail_node().evaluate(t)),!n){var i=[];return trim_unreachable_code(t,e.body,i),i.push(make_node(AST_SimpleStatement,e.condition,{body:e.condition})),e.alternative&&i.push(e.alternative),make_node(AST_BlockStatement,e,{body:i}).optimize(t)}if(!(n instanceof AST_Node))return (i=[]).push(make_node(AST_SimpleStatement,e.condition,{body:e.condition})),i.push(e.body),e.alternative&&trim_unreachable_code(t,e.alternative,i),make_node(AST_BlockStatement,e,{body:i}).optimize(t)}var r=e.condition.negate(t),a=e.condition.size(),s=r.size(),u=s<a;if(e.alternative&&u){u=!1,e.condition=r;var l=e.body;e.body=e.alternative||make_node(AST_EmptyStatement,e),e.alternative=l;}if(is_empty(e.body)&&is_empty(e.alternative))return make_node(AST_SimpleStatement,e.condition,{body:e.condition.clone()}).optimize(t);if(e.body instanceof AST_SimpleStatement&&e.alternative instanceof AST_SimpleStatement)return make_node(AST_SimpleStatement,e,{body:make_node(AST_Conditional,e,{condition:e.condition,consequent:e.body.body,alternative:e.alternative.body})}).optimize(t);if(is_empty(e.alternative)&&e.body instanceof AST_SimpleStatement)return a===s&&!u&&e.condition instanceof AST_Binary&&"||"==e.condition.operator&&(u=!0),u?make_node(AST_SimpleStatement,e,{body:make_node(AST_Binary,e,{operator:"||",left:r,right:e.body.body})}).optimize(t):make_node(AST_SimpleStatement,e,{body:make_node(AST_Binary,e,{operator:"&&",left:e.condition,right:e.body.body})}).optimize(t);if(e.body instanceof AST_EmptyStatement&&e.alternative instanceof AST_SimpleStatement)return make_node(AST_SimpleStatement,e,{body:make_node(AST_Binary,e,{operator:"||",left:e.condition,right:e.alternative.body})}).optimize(t);if(e.body instanceof AST_Exit&&e.alternative instanceof AST_Exit&&e.body.TYPE==e.alternative.TYPE)return make_node(e.body.CTOR,e,{value:make_node(AST_Conditional,e,{condition:e.condition,consequent:e.body.value||make_node(AST_Undefined,e.body),alternative:e.alternative.value||make_node(AST_Undefined,e.alternative)}).transform(t)}).optimize(t);if(e.body instanceof AST_If&&!e.body.alternative&&!e.alternative&&(e=make_node(AST_If,e,{condition:make_node(AST_Binary,e.condition,{operator:"&&",left:e.condition,right:e.body.condition}),body:e.body.body,alternative:null})),aborts(e.body)&&e.alternative){var _=e.alternative;return e.alternative=null,make_node(AST_BlockStatement,e,{body:[e,_]}).optimize(t)}return aborts(e.alternative)?(i=e.body,e.body=e.alternative,e.condition=u?r:e.condition.negate(t),e.alternative=null,make_node(AST_BlockStatement,e,{body:[e,i]}).optimize(t)):e})),def_optimize(AST_Switch,(function(e,t){if(!t.option("switches"))return e;var n,o=e.expression.evaluate(t);if(!(o instanceof AST_Node)){var i=e.expression;e.expression=make_node_from_constant(o,i),e.expression=best_of_expression(e.expression.transform(t),i);}if(!t.option("dead_code"))return e;o instanceof AST_Node&&(o=e.expression.tail_node().evaluate(t));for(var r,a,s=[],u=[],l=0,_=e.body.length;l<_&&!a;l++){if((n=e.body[l])instanceof AST_Default)r?T(n,u[u.length-1]):r=n;else if(!(o instanceof AST_Node)){if(!((m=n.expression.evaluate(t))instanceof AST_Node)&&m!==o){T(n,u[u.length-1]);continue}if(m instanceof AST_Node&&(m=n.expression.tail_node().evaluate(t)),m===o&&(a=n,r)){var c=u.indexOf(r);u.splice(c,1),T(r,u[c-1]),r=null;}}if(aborts(n)){var f=u[u.length-1];aborts(f)&&f.body.length==n.body.length&&make_node(AST_BlockStatement,f,f).equivalent_to(make_node(AST_BlockStatement,n,n))&&(f.body=[]);}u.push(n);}for(;l<_;)T(e.body[l++],u[u.length-1]);for(u.length>0&&(u[0].body=s.concat(u[0].body)),e.body=u;n=u[u.length-1];){var p=n.body[n.body.length-1];if(p instanceof AST_Break&&t.loopcontrol_target(p)===e&&n.body.pop(),n.body.length||n instanceof AST_Case&&(r||n.expression.has_side_effects(t)))break;u.pop()===r&&(r=null);}if(0==u.length)return make_node(AST_BlockStatement,e,{body:s.concat(make_node(AST_SimpleStatement,e.expression,{body:e.expression}))}).optimize(t);if(1==u.length&&(u[0]===a||u[0]===r)){var d=!1,S=new TreeWalker((function(t){if(d||t instanceof AST_Lambda||t instanceof AST_SimpleStatement)return !0;t instanceof AST_Break&&S.loopcontrol_target(t)===e&&(d=!0);}));if(e.walk(S),!d){var m,A=u[0].body.slice();return (m=u[0].expression)&&A.unshift(make_node(AST_SimpleStatement,m,{body:m})),A.unshift(make_node(AST_SimpleStatement,e.expression,{body:e.expression})),make_node(AST_BlockStatement,e,{body:A}).optimize(t)}}return e;function T(e,n){n&&!aborts(n)?n.body=n.body.concat(e.body):trim_unreachable_code(t,e,s);}})),def_optimize(AST_Try,(function(e,t){if(tighten_body(e.body,t),e.bcatch&&e.bfinally&&e.bfinally.body.every(is_empty)&&(e.bfinally=null),t.option("dead_code")&&e.body.every(is_empty)){var n=[];return e.bcatch&&trim_unreachable_code(t,e.bcatch,n),e.bfinally&&n.push(...e.bfinally.body),make_node(AST_BlockStatement,e,{body:n}).optimize(t)}return e})),AST_Definitions.DEFMETHOD("remove_initializers",(function(){var e=[];this.definitions.forEach((function(t){t.name instanceof AST_SymbolDeclaration?(t.value=null,e.push(t)):walk$3(t.name,(n=>{n instanceof AST_SymbolDeclaration&&e.push(make_node(AST_VarDef,t,{name:n,value:null}));}));})),this.definitions=e;})),AST_Definitions.DEFMETHOD("to_assignments",(function(e){var t=e.option("reduce_vars"),n=[];for(const e of this.definitions){if(e.value){var o=make_node(AST_SymbolRef,e.name,e.name);n.push(make_node(AST_Assign,e,{operator:"=",logical:!1,left:o,right:e.value})),t&&(o.definition().fixed=!1);}else if(e.value){var i=make_node(AST_VarDef,e,{name:e.name,value:e.value}),r=make_node(AST_Var,e,{definitions:[i]});n.push(r);}const a=e.name.definition();a.eliminated++,a.replaced--;}return 0==n.length?null:make_sequence(this,n)})),def_optimize(AST_Definitions,(function(e){return 0==e.definitions.length?make_node(AST_EmptyStatement,e):e})),def_optimize(AST_VarDef,(function(e){return e.name instanceof AST_SymbolLet&&null!=e.value&&is_undefined(e.value)&&(e.value=null),e})),def_optimize(AST_Import,(function(e){return e})),def_optimize(AST_Call,(function(e,t){var n=e.expression,o=n;inline_array_like_spread(e.args);var i=e.args.every((e=>!(e instanceof AST_Expansion)));if(t.option("reduce_vars")&&o instanceof AST_SymbolRef&&!has_annotation(e,_NOINLINE)){const e=o.fixed_value();retain_top_func(e,t)||(o=e);}if(e.optional&&is_nullish(o))return make_node(AST_Undefined,e);var r=o instanceof AST_Lambda;if(r&&o.pinned())return e;if(t.option("unused")&&i&&r&&!o.uses_arguments){for(var a=0,s=0,u=0,l=e.args.length;u<l;u++){if(o.argnames[u]instanceof AST_Expansion){if(has_flag(o.argnames[u].expression,1))for(;u<l;)(d=e.args[u++].drop_side_effect_free(t))&&(e.args[a++]=d);else for(;u<l;)e.args[a++]=e.args[u++];s=a;break}var _=u>=o.argnames.length;if(_||has_flag(o.argnames[u],1)){if(d=e.args[u].drop_side_effect_free(t))e.args[a++]=d;else if(!_){e.args[a++]=make_node(AST_Number,e.args[u],{value:0});continue}}else e.args[a++]=e.args[u];s=a;}e.args.length=s;}if(t.option("unsafe"))if(is_undeclared_ref(n))switch(n.name){case"Array":if(1!=e.args.length)return make_node(AST_Array,e,{elements:e.args}).optimize(t);if(e.args[0]instanceof AST_Number&&e.args[0].value<=11){const t=[];for(let n=0;n<e.args[0].value;n++)t.push(new AST_Hole);return new AST_Array({elements:t})}break;case"Object":if(0==e.args.length)return make_node(AST_Object,e,{properties:[]});break;case"String":if(0==e.args.length)return make_node(AST_String,e,{value:""});if(e.args.length<=1)return make_node(AST_Binary,e,{left:e.args[0],operator:"+",right:make_node(AST_String,e,{value:""})}).optimize(t);break;case"Number":if(0==e.args.length)return make_node(AST_Number,e,{value:0});if(1==e.args.length&&t.option("unsafe_math"))return make_node(AST_UnaryPrefix,e,{expression:e.args[0],operator:"+"}).optimize(t);break;case"Symbol":1==e.args.length&&e.args[0]instanceof AST_String&&t.option("unsafe_symbols")&&(e.args.length=0);break;case"Boolean":if(0==e.args.length)return make_node(AST_False,e);if(1==e.args.length)return make_node(AST_UnaryPrefix,e,{expression:make_node(AST_UnaryPrefix,e,{expression:e.args[0],operator:"!"}),operator:"!"}).optimize(t);break;case"RegExp":var c=[];if(e.args.length>=1&&e.args.length<=2&&e.args.every((e=>{var n=e.evaluate(t);return c.push(n),e!==n}))){let[n,o]=c;n=regexp_source_fix(new RegExp(n).source);const i=make_node(AST_RegExp,e,{value:{source:n,flags:o}});if(i._eval(t)!==i)return i}}else if(n instanceof AST_Dot)switch(n.property){case"toString":if(0==e.args.length&&!n.expression.may_throw_on_access(t))return make_node(AST_Binary,e,{left:make_node(AST_String,e,{value:""}),operator:"+",right:n.expression}).optimize(t);break;case"join":if(n.expression instanceof AST_Array)e:{var f;if(!(e.args.length>0&&(f=e.args[0].evaluate(t))===e.args[0])){var p,d,S=[],m=[];for(u=0,l=n.expression.elements.length;u<l;u++){var A=n.expression.elements[u];if(A instanceof AST_Expansion)break e;var T=A.evaluate(t);T!==A?m.push(T):(m.length>0&&(S.push(make_node(AST_String,e,{value:m.join(f)})),m.length=0),S.push(A));}return m.length>0&&S.push(make_node(AST_String,e,{value:m.join(f)})),0==S.length?make_node(AST_String,e,{value:""}):1==S.length?S[0].is_string(t)?S[0]:make_node(AST_Binary,S[0],{operator:"+",left:make_node(AST_String,e,{value:""}),right:S[0]}):""==f?(p=S[0].is_string(t)||S[1].is_string(t)?S.shift():make_node(AST_String,e,{value:""}),S.reduce((function(e,t){return make_node(AST_Binary,t,{operator:"+",left:e,right:t})}),p).optimize(t)):((d=e.clone()).expression=d.expression.clone(),d.expression.expression=d.expression.expression.clone(),d.expression.expression.elements=S,best_of(t,e,d))}}break;case"charAt":if(n.expression.is_string(t)){var h=e.args[0],E=h?h.evaluate(t):0;if(E!==h)return make_node(AST_Sub,n,{expression:n.expression,property:make_node_from_constant(0|E,h||n)}).optimize(t)}break;case"apply":if(2==e.args.length&&e.args[1]instanceof AST_Array)return (I=e.args[1].elements.slice()).unshift(e.args[0]),make_node(AST_Call,e,{expression:make_node(AST_Dot,n,{expression:n.expression,optional:!1,property:"call"}),args:I}).optimize(t);break;case"call":var g=n.expression;if(g instanceof AST_SymbolRef&&(g=g.fixed_value()),g instanceof AST_Lambda&&!g.contains_this())return (e.args.length?make_sequence(this,[e.args[0],make_node(AST_Call,e,{expression:n.expression,args:e.args.slice(1)})]):make_node(AST_Call,e,{expression:n.expression,args:[]})).optimize(t)}if(t.option("unsafe_Function")&&is_undeclared_ref(n)&&"Function"==n.name){if(0==e.args.length)return make_node(AST_Function,e,{argnames:[],body:[]}).optimize(t);if(e.args.every((e=>e instanceof AST_String)))try{var D=parse$5(C="n(function("+e.args.slice(0,-1).map((function(e){return e.value})).join(",")+"){"+e.args[e.args.length-1].value+"})"),b={ie8:t.option("ie8")};D.figure_out_scope(b);var y,v=new Compressor(t.options,{mangle_options:t.mangle_options});(D=D.transform(v)).figure_out_scope(b),base54.reset(),D.compute_char_frequency(b),D.mangle_names(b),walk$3(D,(e=>{if(is_func_expr(e))return y=e,walk_abort}));var C=OutputStream();return AST_BlockStatement.prototype._codegen.call(y,y,C),e.args=[make_node(AST_String,e,{value:y.argnames.map((function(e){return e.print_to_string()})).join(",")}),make_node(AST_String,e.args[e.args.length-1],{value:C.get().replace(/^{|}$/g,"")})],e}catch(e){if(!(e instanceof JS_Parse_Error))throw e}}var R=r&&o.body[0],k=r&&!o.is_generator&&!o.async,O=k&&t.option("inline")&&!e.is_expr_pure(t);if(O&&R instanceof AST_Return){let n=R.value;if(!n||n.is_constant_expression()){n=n?n.clone(!0):make_node(AST_Undefined,e);const o=e.args.concat(n);return make_sequence(e,o).optimize(t)}if(1===o.argnames.length&&o.argnames[0]instanceof AST_SymbolFunarg&&e.args.length<2&&n instanceof AST_SymbolRef&&n.name===o.argnames[0].name){const n=(e.args[0]||make_node(AST_Undefined)).optimize(t);let o;return n instanceof AST_PropAccess&&(o=t.parent())instanceof AST_Call&&o.expression===e?make_sequence(e,[make_node(AST_Number,e,{value:0}),n]):n}}if(O){var F,N,M=-1;let r,a,s;if(i&&!o.uses_arguments&&!(t.parent()instanceof AST_Class)&&!(o.name&&o instanceof AST_Function)&&(a=function(e){var n=o.body,i=n.length;if(t.option("inline")<3)return 1==i&&w(e);e=null;for(var r=0;r<i;r++){var a=n[r];if(a instanceof AST_Var){if(e&&!a.definitions.every((e=>!e.value)))return !1}else {if(e)return !1;a instanceof AST_EmptyStatement||(e=a);}}return w(e)}(R))&&(n===o||has_annotation(e,_INLINE)||t.option("unused")&&1==(r=n.definition()).references.length&&!recursive_ref(t,r)&&o.is_constant_expression(n.scope))&&!has_annotation(e,_PURE|_NOINLINE)&&!o.contains_this()&&function(){var e=new Set;do{if((F=t.parent(++M)).is_block_scope()&&F.block_scope&&F.block_scope.variables.forEach((function(t){e.add(t.name);})),F instanceof AST_Catch)F.argname&&e.add(F.argname.name);else if(F instanceof AST_IterationStatement)N=[];else if(F instanceof AST_SymbolRef&&F.fixed_value()instanceof AST_Scope)return !1}while(!(F instanceof AST_Scope));var n=!(F instanceof AST_Toplevel)||t.toplevel.vars,i=t.option("inline");return !(!function(e,t){for(var n=o.body.length,i=0;i<n;i++){var r=o.body[i];if(r instanceof AST_Var){if(!t)return !1;for(var a=r.definitions.length;--a>=0;){var s=r.definitions[a].name;if(s instanceof AST_Destructuring||e.has(s.name)||identifier_atom.has(s.name)||F.conflicting_def(s.name))return !1;N&&N.push(s.definition());}}}return !0}(e,i>=3&&n)||!function(e,t){for(var n=0,i=o.argnames.length;n<i;n++){var r=o.argnames[n];if(r instanceof AST_DefaultAssign){if(has_flag(r.left,1))continue;return !1}if(r instanceof AST_Destructuring)return !1;if(r instanceof AST_Expansion){if(has_flag(r.expression,1))continue;return !1}if(!has_flag(r,1)){if(!t||e.has(r.name)||identifier_atom.has(r.name)||F.conflicting_def(r.name))return !1;N&&N.push(r.definition());}}return !0}(e,i>=2&&n)||N&&0!=N.length&&is_reachable(o,N))}()&&(s=find_scope(t))&&!scope_encloses_variables_in_this_scope(s,o)&&!function(){let e,n=0;for(;e=t.parent(n++);){if(e instanceof AST_DefaultAssign)return !0;if(e instanceof AST_Block)break}return !1}()&&!(F instanceof AST_Class))return set_flag(o,256),s.add_child_scope(o),make_sequence(e,function(n){var i=[],r=[];if(function(t,n){for(var i=o.argnames.length,r=e.args.length;--r>=i;)n.push(e.args[r]);for(r=i;--r>=0;){var a=o.argnames[r],s=e.args[r];if(has_flag(a,1)||!a.name||F.conflicting_def(a.name))s&&n.push(s);else {var u=make_node(AST_SymbolVar,a,a);a.definition().orig.push(u),!s&&N&&(s=make_node(AST_Undefined,e)),P(t,n,u,s);}}t.reverse(),n.reverse();}(i,r),function(e,t){for(var n=t.length,i=0,r=o.body.length;i<r;i++){var a=o.body[i];if(a instanceof AST_Var)for(var s=0,u=a.definitions.length;s<u;s++){var l=a.definitions[s],_=l.name;if(P(e,t,_,l.value),N&&o.argnames.every((e=>e.name!=_.name))){var c=o.variables.get(_.name),f=make_node(AST_SymbolRef,_,_);c.references.push(f),t.splice(n++,0,make_node(AST_Assign,l,{operator:"=",logical:!1,left:f,right:make_node(AST_Undefined,_)}));}}}}(i,r),r.push(n),i.length){const e=F.body.indexOf(t.parent(M-1))+1;F.body.splice(e,0,make_node(AST_Var,o,{definitions:i}));}return r.map((e=>e.clone(!0)))}(a)).optimize(t)}if(O&&has_annotation(e,_INLINE))return set_flag(o,256),(o=make_node(o.CTOR===AST_Defun?AST_Function:o.CTOR,o,o)).figure_out_scope({},{parent_scope:find_scope(t),toplevel:t.get_toplevel()}),make_node(AST_Call,e,{expression:o,args:e.args}).optimize(t);if(k&&t.option("side_effects")&&o.body.every(is_empty)){var I=e.args.concat(make_node(AST_Undefined,e));return make_sequence(e,I).optimize(t)}if(t.option("negate_iife")&&t.parent()instanceof AST_SimpleStatement&&is_iife_call(e))return e.negate(t,!0);var x=e.evaluate(t);return x!==e?(x=make_node_from_constant(x,e).optimize(t),best_of(t,x,e)):e;function w(t){return t?t instanceof AST_Return?t.value?t.value.clone(!0):make_node(AST_Undefined,e):t instanceof AST_SimpleStatement?make_node(AST_UnaryPrefix,t,{operator:"void",expression:t.body.clone(!0)}):void 0:make_node(AST_Undefined,e)}function P(t,n,o,i){var r=o.definition();F.variables.has(o.name)||(F.variables.set(o.name,r),F.enclosed.push(r),t.push(make_node(AST_VarDef,o,{name:o,value:null})));var a=make_node(AST_SymbolRef,o,o);r.references.push(a),i&&n.push(make_node(AST_Assign,e,{operator:"=",logical:!1,left:a,right:i.clone()}));}})),def_optimize(AST_New,(function(e,t){return t.option("unsafe")&&is_undeclared_ref(e.expression)&&["Object","RegExp","Function","Error","Array"].includes(e.expression.name)?make_node(AST_Call,e,e).transform(t):e})),def_optimize(AST_Sequence,(function(e,t){if(!t.option("side_effects"))return e;var n,o,i=[];n=first_in_statement(t),o=e.expressions.length-1,e.expressions.forEach((function(e,r){r<o&&(e=e.drop_side_effect_free(t,n)),e&&(merge_sequence(i,e),n=!1);}));var r=i.length-1;return function(){for(;r>0&&is_undefined(i[r],t);)r--;r<i.length-1&&(i[r]=make_node(AST_UnaryPrefix,e,{operator:"void",expression:i[r]}),i.length=r+1);}(),0==r?((e=maintain_this_binding(t.parent(),t.self(),i[0]))instanceof AST_Sequence||(e=e.optimize(t)),e):(e.expressions=i,e)})),AST_Unary.DEFMETHOD("lift_sequences",(function(e){if(e.option("sequences")&&this.expression instanceof AST_Sequence){var t=this.expression.expressions.slice(),n=this.clone();return n.expression=t.pop(),t.push(n),make_sequence(this,t).optimize(e)}return this})),def_optimize(AST_UnaryPostfix,(function(e,t){return e.lift_sequences(t)})),def_optimize(AST_UnaryPrefix,(function(e,t){var n=e.expression;if("delete"==e.operator&&!(n instanceof AST_SymbolRef||n instanceof AST_PropAccess||is_identifier_atom(n))){if(n instanceof AST_Sequence){const o=n.expressions.slice();return o.push(make_node(AST_True,e)),make_sequence(e,o).optimize(t)}return make_sequence(e,[n,make_node(AST_True,e)]).optimize(t)}var o=e.lift_sequences(t);if(o!==e)return o;if(t.option("side_effects")&&"void"==e.operator)return (n=n.drop_side_effect_free(t))?(e.expression=n,e):make_node(AST_Undefined,e).optimize(t);if(t.in_boolean_context())switch(e.operator){case"!":if(n instanceof AST_UnaryPrefix&&"!"==n.operator)return n.expression;n instanceof AST_Binary&&(e=best_of(t,e,n.negate(t,first_in_statement(t))));break;case"typeof":return (n instanceof AST_SymbolRef?make_node(AST_True,e):make_sequence(e,[n,make_node(AST_True,e)])).optimize(t)}if("-"==e.operator&&n instanceof AST_Infinity&&(n=n.transform(t)),n instanceof AST_Binary&&("+"==e.operator||"-"==e.operator)&&("*"==n.operator||"/"==n.operator||"%"==n.operator))return make_node(AST_Binary,e,{operator:n.operator,left:make_node(AST_UnaryPrefix,n.left,{operator:e.operator,expression:n.left}),right:n.right});if("-"!=e.operator||!(n instanceof AST_Number||n instanceof AST_Infinity||n instanceof AST_BigInt)){var i=e.evaluate(t);if(i!==e)return best_of(t,i=make_node_from_constant(i,e).optimize(t),e)}return e})),AST_Binary.DEFMETHOD("lift_sequences",(function(e){if(e.option("sequences")){if(this.left instanceof AST_Sequence){var t=this.left.expressions.slice();return (n=this.clone()).left=t.pop(),t.push(n),make_sequence(this,t).optimize(e)}if(this.right instanceof AST_Sequence&&!this.left.has_side_effects(e)){for(var n,o="="==this.operator&&this.left instanceof AST_SymbolRef,i=(t=this.right.expressions).length-1,r=0;r<i&&(o||!t[r].has_side_effects(e));r++);if(r==i)return t=t.slice(),(n=this.clone()).right=t.pop(),t.push(n),make_sequence(this,t).optimize(e);if(r>0)return (n=this.clone()).right=make_sequence(this.right,t.slice(r)),(t=t.slice(0,r)).push(n),make_sequence(this,t).optimize(e)}}return this}));var commutativeOperators=makePredicate("== === != !== * & | ^");function is_object(e){return e instanceof AST_Array||e instanceof AST_Lambda||e instanceof AST_Object||e instanceof AST_Class}function recursive_ref(e,t){for(var n,o=0;n=e.parent(o);o++)if(n instanceof AST_Lambda||n instanceof AST_Class){var i=n.name;if(i&&i.definition()===t)break}return n}function within_array_or_object_literal(e){for(var t,n=0;t=e.parent(n++);){if(t instanceof AST_Statement)return !1;if(t instanceof AST_Array||t instanceof AST_ObjectKeyVal||t instanceof AST_Object)return !0}return !1}function scope_encloses_variables_in_this_scope(e,t){for(const n of t.enclosed){if(t.variables.has(n.name))continue;const o=e.find_variable(n.name);if(o){if(o===n)continue;return !0}}return !1}function is_atomic(e,t){return e instanceof AST_SymbolRef||e.TYPE===t.TYPE}function is_reachable(e,t){const n=e=>{if(e instanceof AST_SymbolRef&&member(e.definition(),t))return walk_abort};return walk_parent(e,((t,o)=>{if(t instanceof AST_Scope&&t!==e){var i=o.parent();if(i instanceof AST_Call&&i.expression===t)return;return !walk$3(t,n)||walk_abort}}))}def_optimize(AST_Binary,(function(e,t){function n(){return e.left.is_constant()||e.right.is_constant()||!e.left.has_side_effects(t)&&!e.right.has_side_effects(t)}function o(t){if(n()){t&&(e.operator=t);var o=e.left;e.left=e.right,e.right=o;}}if(commutativeOperators.has(e.operator)&&e.right.is_constant()&&!e.left.is_constant()&&(e.left instanceof AST_Binary&&PRECEDENCE[e.left.operator]>=PRECEDENCE[e.operator]||o()),e=e.lift_sequences(t),t.option("comparisons"))switch(e.operator){case"===":case"!==":var i=!0;(e.left.is_string(t)&&e.right.is_string(t)||e.left.is_number(t)&&e.right.is_number(t)||e.left.is_boolean()&&e.right.is_boolean()||e.left.equivalent_to(e.right))&&(e.operator=e.operator.substr(0,2));case"==":case"!=":if(!i&&is_undefined(e.left,t))e.left=make_node(AST_Null,e.left);else if(t.option("typeofs")&&e.left instanceof AST_String&&"undefined"==e.left.value&&e.right instanceof AST_UnaryPrefix&&"typeof"==e.right.operator){var r=e.right.expression;(r instanceof AST_SymbolRef?!r.is_declared(t):r instanceof AST_PropAccess&&t.option("ie8"))||(e.right=r,e.left=make_node(AST_Undefined,e.left).optimize(t),2==e.operator.length&&(e.operator+="="));}else if(e.left instanceof AST_SymbolRef&&e.right instanceof AST_SymbolRef&&e.left.definition()===e.right.definition()&&is_object(e.left.fixed_value()))return make_node("="==e.operator[0]?AST_True:AST_False,e);break;case"&&":case"||":var a=e.left;if(a.operator==e.operator&&(a=a.right),a instanceof AST_Binary&&a.operator==("&&"==e.operator?"!==":"===")&&e.right instanceof AST_Binary&&a.operator==e.right.operator&&(is_undefined(a.left,t)&&e.right.left instanceof AST_Null||a.left instanceof AST_Null&&is_undefined(e.right.left,t))&&!a.right.has_side_effects(t)&&a.right.equivalent_to(e.right.right)){var s=make_node(AST_Binary,e,{operator:a.operator.slice(0,-1),left:make_node(AST_Null,e),right:a.right});return a!==e.left&&(s=make_node(AST_Binary,e,{operator:e.operator,left:e.left.left,right:s})),s}}if("+"==e.operator&&t.in_boolean_context()){var u=e.left.evaluate(t),l=e.right.evaluate(t);if(u&&"string"==typeof u)return make_sequence(e,[e.right,make_node(AST_True,e)]).optimize(t);if(l&&"string"==typeof l)return make_sequence(e,[e.left,make_node(AST_True,e)]).optimize(t)}if(t.option("comparisons")&&e.is_boolean()){if(!(t.parent()instanceof AST_Binary)||t.parent()instanceof AST_Assign){var _=make_node(AST_UnaryPrefix,e,{operator:"!",expression:e.negate(t,first_in_statement(t))});e=best_of(t,e,_);}if(t.option("unsafe_comps"))switch(e.operator){case"<":o(">");break;case"<=":o(">=");}}if("+"==e.operator){if(e.right instanceof AST_String&&""==e.right.getValue()&&e.left.is_string(t))return e.left;if(e.left instanceof AST_String&&""==e.left.getValue()&&e.right.is_string(t))return e.right;if(e.left instanceof AST_Binary&&"+"==e.left.operator&&e.left.left instanceof AST_String&&""==e.left.left.getValue()&&e.right.is_string(t))return e.left=e.left.right,e}if(t.option("evaluate")){switch(e.operator){case"&&":if(!(u=!!has_flag(e.left,2)||!has_flag(e.left,4)&&e.left.evaluate(t)))return maintain_this_binding(t.parent(),t.self(),e.left).optimize(t);if(!(u instanceof AST_Node))return make_sequence(e,[e.left,e.right]).optimize(t);if(l=e.right.evaluate(t)){if(!(l instanceof AST_Node)&&("&&"==(c=t.parent()).operator&&c.left===t.self()||t.in_boolean_context()))return e.left.optimize(t)}else {if(t.in_boolean_context())return make_sequence(e,[e.left,make_node(AST_False,e)]).optimize(t);set_flag(e,4);}if("||"==e.left.operator&&!(f=e.left.right.evaluate(t)))return make_node(AST_Conditional,e,{condition:e.left.left,consequent:e.right,alternative:e.left.right}).optimize(t);break;case"||":var c,f;if(!(u=!!has_flag(e.left,2)||!has_flag(e.left,4)&&e.left.evaluate(t)))return make_sequence(e,[e.left,e.right]).optimize(t);if(!(u instanceof AST_Node))return maintain_this_binding(t.parent(),t.self(),e.left).optimize(t);if(l=e.right.evaluate(t)){if(!(l instanceof AST_Node)){if(t.in_boolean_context())return make_sequence(e,[e.left,make_node(AST_True,e)]).optimize(t);set_flag(e,2);}}else if("||"==(c=t.parent()).operator&&c.left===t.self()||t.in_boolean_context())return e.left.optimize(t);if("&&"==e.left.operator&&(f=e.left.right.evaluate(t))&&!(f instanceof AST_Node))return make_node(AST_Conditional,e,{condition:e.left.left,consequent:e.left.right,alternative:e.right}).optimize(t);break;case"??":if(is_nullish(e.left))return e.right;if(!((u=e.left.evaluate(t))instanceof AST_Node))return null==u?e.right:e.left;if(t.in_boolean_context()){const n=e.right.evaluate(t);if(!(n instanceof AST_Node||n))return e.left}}var p=!0;switch(e.operator){case"+":if(e.right instanceof AST_Constant&&e.left instanceof AST_Binary&&"+"==e.left.operator&&e.left.is_string(t)){var d=(S=make_node(AST_Binary,e,{operator:"+",left:e.left.right,right:e.right})).optimize(t);S!==d&&(e=make_node(AST_Binary,e,{operator:"+",left:e.left.left,right:d}));}if(e.left instanceof AST_Binary&&"+"==e.left.operator&&e.left.is_string(t)&&e.right instanceof AST_Binary&&"+"==e.right.operator&&e.right.is_string(t)){var S,m=(S=make_node(AST_Binary,e,{operator:"+",left:e.left.right,right:e.right.left})).optimize(t);S!==m&&(e=make_node(AST_Binary,e,{operator:"+",left:make_node(AST_Binary,e.left,{operator:"+",left:e.left.left,right:m}),right:e.right.right}));}if(e.right instanceof AST_UnaryPrefix&&"-"==e.right.operator&&e.left.is_number(t)){e=make_node(AST_Binary,e,{operator:"-",left:e.left,right:e.right.expression});break}if(e.left instanceof AST_UnaryPrefix&&"-"==e.left.operator&&n()&&e.right.is_number(t)){e=make_node(AST_Binary,e,{operator:"-",left:e.right,right:e.left.expression});break}if(e.left instanceof AST_TemplateString){var A=e.left;if((d=e.right.evaluate(t))!=e.right)return A.segments[A.segments.length-1].value+=String(d),A}if(e.right instanceof AST_TemplateString&&(d=e.right,(A=e.left.evaluate(t))!=e.left))return d.segments[0].value=String(A)+d.segments[0].value,d;if(e.left instanceof AST_TemplateString&&e.right instanceof AST_TemplateString){var T=(A=e.left).segments;d=e.right,T[T.length-1].value+=d.segments[0].value;for(var h=1;h<d.segments.length;h++)T.push(d.segments[h]);return A}case"*":p=t.option("unsafe_math");case"&":case"|":case"^":if(e.left.is_number(t)&&e.right.is_number(t)&&n()&&!(e.left instanceof AST_Binary&&e.left.operator!=e.operator&&PRECEDENCE[e.left.operator]>=PRECEDENCE[e.operator])){var E=make_node(AST_Binary,e,{operator:e.operator,left:e.right,right:e.left});e=e.right instanceof AST_Constant&&!(e.left instanceof AST_Constant)?best_of(t,E,e):best_of(t,e,E);}p&&e.is_number(t)&&(e.right instanceof AST_Binary&&e.right.operator==e.operator&&(e=make_node(AST_Binary,e,{operator:e.operator,left:make_node(AST_Binary,e.left,{operator:e.operator,left:e.left,right:e.right.left,start:e.left.start,end:e.right.left.end}),right:e.right.right})),e.right instanceof AST_Constant&&e.left instanceof AST_Binary&&e.left.operator==e.operator&&(e.left.left instanceof AST_Constant?e=make_node(AST_Binary,e,{operator:e.operator,left:make_node(AST_Binary,e.left,{operator:e.operator,left:e.left.left,right:e.right,start:e.left.left.start,end:e.right.end}),right:e.left.right}):e.left.right instanceof AST_Constant&&(e=make_node(AST_Binary,e,{operator:e.operator,left:make_node(AST_Binary,e.left,{operator:e.operator,left:e.left.right,right:e.right,start:e.left.right.start,end:e.right.end}),right:e.left.left}))),e.left instanceof AST_Binary&&e.left.operator==e.operator&&e.left.right instanceof AST_Constant&&e.right instanceof AST_Binary&&e.right.operator==e.operator&&e.right.left instanceof AST_Constant&&(e=make_node(AST_Binary,e,{operator:e.operator,left:make_node(AST_Binary,e.left,{operator:e.operator,left:make_node(AST_Binary,e.left.left,{operator:e.operator,left:e.left.right,right:e.right.left,start:e.left.right.start,end:e.right.left.end}),right:e.left.left}),right:e.right.right})));}}if(e.right instanceof AST_Binary&&e.right.operator==e.operator&&(lazy_op.has(e.operator)||"+"==e.operator&&(e.right.left.is_string(t)||e.left.is_string(t)&&e.right.right.is_string(t))))return e.left=make_node(AST_Binary,e.left,{operator:e.operator,left:e.left.transform(t),right:e.right.left.transform(t)}),e.right=e.right.right.transform(t),e.transform(t);var g=e.evaluate(t);return g!==e?(g=make_node_from_constant(g,e).optimize(t),best_of(t,g,e)):e})),def_optimize(AST_SymbolExport,(function(e){return e})),def_optimize(AST_SymbolRef,(function(e,t){if(!t.option("ie8")&&is_undeclared_ref(e)&&!t.find_parent(AST_With))switch(e.name){case"undefined":return make_node(AST_Undefined,e).optimize(t);case"NaN":return make_node(AST_NaN,e).optimize(t);case"Infinity":return make_node(AST_Infinity,e).optimize(t)}const n=t.parent();if(t.option("reduce_vars")&&is_lhs(e,n)!==e){const r=e.definition(),a=find_scope(t);if(t.top_retain&&r.global&&t.top_retain(r))return r.fixed=!1,r.single_use=!1,e;let s=e.fixed_value(),u=r.single_use&&!(n instanceof AST_Call&&n.is_expr_pure(t)||has_annotation(n,_NOINLINE))&&!(n instanceof AST_Export&&s instanceof AST_Lambda&&s.name);if(u&&(s instanceof AST_Lambda||s instanceof AST_Class))if(retain_top_func(s,t))u=!1;else if(r.scope!==e.scope&&(1==r.escaped||has_flag(s,16)||within_array_or_object_literal(t)))u=!1;else if(recursive_ref(t,r))u=!1;else if((r.scope!==e.scope||r.orig[0]instanceof AST_SymbolFunarg)&&(u=s.is_constant_expression(e.scope),"f"==u)){var o=e.scope;do{(o instanceof AST_Defun||is_func_expr(o))&&set_flag(o,16);}while(o=o.parent_scope)}if(u&&s instanceof AST_Lambda&&(u=r.scope===e.scope&&!scope_encloses_variables_in_this_scope(a,s)||n instanceof AST_Call&&n.expression===e&&!scope_encloses_variables_in_this_scope(a,s)&&!(s.name&&s.name.definition().recursive_refs>0)),u&&s instanceof AST_Class&&(u=!(s.extends&&(s.extends.may_throw(t)||s.extends.has_side_effects(t))||s.properties.some((e=>e.may_throw(t)||e.has_side_effects(t))))),u&&s){if(s instanceof AST_DefClass&&(set_flag(s,256),s=make_node(AST_ClassExpression,s,s)),s instanceof AST_Defun&&(set_flag(s,256),s=make_node(AST_Function,s,s)),r.recursive_refs>0&&s.name instanceof AST_SymbolDefun){const e=s.name.definition();let t=s.variables.get(s.name.name),n=t&&t.orig[0];n instanceof AST_SymbolLambda||(n=make_node(AST_SymbolLambda,s.name,s.name),n.scope=s,s.name=n,t=s.def_function(n)),walk$3(s,(n=>{n instanceof AST_SymbolRef&&n.definition()===e&&(n.thedef=t,t.references.push(n));}));}return (s instanceof AST_Lambda||s instanceof AST_Class)&&s.parent_scope!==a&&(s=s.clone(!0,t.get_toplevel()),a.add_child_scope(s)),s.optimize(t)}if(s){let n;if(s instanceof AST_This)r.orig[0]instanceof AST_SymbolFunarg||!r.references.every((e=>r.scope===e.scope))||(n=s);else {var i=s.evaluate(t);i===s||!t.option("unsafe_regexp")&&i instanceof RegExp||(n=make_node_from_constant(i,s));}if(n){const o=e.size(t),i=n.size(t);let a=0;if(t.option("unused")&&!t.exposed(r)&&(a=(o+2+i)/(r.references.length-r.assignments)),i<=o+a)return n}}}return e})),def_optimize(AST_Undefined,(function(e,t){if(t.option("unsafe_undefined")){var n=find_variable(t,"undefined");if(n){var o=make_node(AST_SymbolRef,e,{name:"undefined",scope:n.scope,thedef:n});return set_flag(o,8),o}}var i=is_lhs(t.self(),t.parent());return i&&is_atomic(i,e)?e:make_node(AST_UnaryPrefix,e,{operator:"void",expression:make_node(AST_Number,e,{value:0})})})),def_optimize(AST_Infinity,(function(e,t){var n=is_lhs(t.self(),t.parent());return n&&is_atomic(n,e)?e:!t.option("keep_infinity")||n&&!is_atomic(n,e)||find_variable(t,"Infinity")?make_node(AST_Binary,e,{operator:"/",left:make_node(AST_Number,e,{value:1}),right:make_node(AST_Number,e,{value:0})}):e})),def_optimize(AST_NaN,(function(e,t){var n=is_lhs(t.self(),t.parent());return n&&!is_atomic(n,e)||find_variable(t,"NaN")?make_node(AST_Binary,e,{operator:"/",left:make_node(AST_Number,e,{value:0}),right:make_node(AST_Number,e,{value:0})}):e}));const ASSIGN_OPS=makePredicate("+ - / * % >> << >>> | ^ &"),ASSIGN_OPS_COMMUTATIVE=makePredicate("* | ^ &");function is_nullish(e){let t;return e instanceof AST_Null||is_undefined(e)||e instanceof AST_SymbolRef&&(t=e.definition().fixed)instanceof AST_Node&&is_nullish(t)||e instanceof AST_PropAccess&&e.optional&&is_nullish(e.expression)||e instanceof AST_Call&&e.optional&&is_nullish(e.expression)||e instanceof AST_Chain&&is_nullish(e.expression)}function is_nullish_check(e,t,n){if(t.may_throw(n))return !1;let o;if(e instanceof AST_Binary&&"=="===e.operator&&((o=is_nullish(e.left)&&e.left)||(o=is_nullish(e.right)&&e.right))&&(o===e.left?e.right:e.left).equivalent_to(t))return !0;if(e instanceof AST_Binary&&"||"===e.operator){let n,o;const i=e=>{if(!(e instanceof AST_Binary)||"==="!==e.operator&&"=="!==e.operator)return !1;let i,r=0;return e.left instanceof AST_Null&&(r++,n=e,i=e.right),e.right instanceof AST_Null&&(r++,n=e,i=e.left),is_undefined(e.left)&&(r++,o=e,i=e.right),is_undefined(e.right)&&(r++,o=e,i=e.left),1===r&&!!i.equivalent_to(t)};if(!i(e.left))return !1;if(!i(e.right))return !1;if(n&&o&&n!==o)return !0}return !1}function safe_to_flatten(e,t){return e instanceof AST_SymbolRef&&(e=e.fixed_value()),!!e&&(!(e instanceof AST_Lambda||e instanceof AST_Class)||!(e instanceof AST_Lambda&&e.contains_this())||t.parent()instanceof AST_New)}function literals_in_boolean_context(e,t){return t.in_boolean_context()?best_of(t,e,make_sequence(e,[e,make_node(AST_True,e)]).optimize(t)):e}function inline_array_like_spread(e){for(var t=0;t<e.length;t++){var n=e[t];if(n instanceof AST_Expansion){var o=n.expression;o instanceof AST_Array&&!o.elements.some((e=>e instanceof AST_Hole))&&(e.splice(t,1,...o.elements),t--);}}}function inline_object_prop_spread(e){for(var t=0;t<e.length;t++){var n=e[t];if(n instanceof AST_Expansion){const o=n.expression;o instanceof AST_Object&&o.properties.every((e=>e instanceof AST_ObjectKeyVal))?(e.splice(t,1,...o.properties),t--):o instanceof AST_Constant&&!(o instanceof AST_String)&&e.splice(t,1);}}}function lift_key(e,t){if(!t.option("computed_props"))return e;if(!(e.key instanceof AST_Constant))return e;if(e.key instanceof AST_String||e.key instanceof AST_Number){if("__proto__"===e.key.value)return e;if("constructor"==e.key.value&&t.parent()instanceof AST_Class)return e;e.key=e instanceof AST_ObjectKeyVal?e.key.value:make_node(e instanceof AST_ClassProperty?AST_SymbolClassProperty:AST_SymbolMethod,e.key,{name:e.key.value});}return e}async function SourceMap$3(e){var t;e=defaults$1(e,{file:null,root:null,orig:null,orig_line_diff:0,dest_line_diff:0});var n=new sourceMap.SourceMapGenerator({file:e.file,sourceRoot:e.root});return e.orig&&(t=await new sourceMap.SourceMapConsumer(e.orig)).sources.forEach((function(e){var o=t.sourceContentFor(e,!0);o&&n.setSourceContent(e,o);})),{add:function(o,i,r,a,s,u){if(t){var l=t.originalPositionFor({line:a,column:s});if(null===l.source)return;o=l.source,a=l.line,s=l.column,u=l.name||u;}n.addMapping({generated:{line:i+e.dest_line_diff,column:r},original:{line:a+e.orig_line_diff,column:s},source:o,name:u});},get:function(){return n},toString:function(){return n.toString()},destroy:function(){t&&t.destroy&&t.destroy();}}}def_optimize(AST_Assign,(function(e,t){if(e.logical)return e.lift_sequences(t);var n;if(t.option("dead_code")&&e.left instanceof AST_SymbolRef&&(n=e.left.definition()).scope===t.find_parent(AST_Lambda)){var o,i=0,r=e;do{if(o=r,(r=t.parent(i++))instanceof AST_Exit){if(a(i,r))break;if(is_reachable(n.scope,[n]))break;return "="==e.operator?e.right:(n.fixed=!1,make_node(AST_Binary,e,{operator:e.operator.slice(0,-1),left:e.left,right:e.right}).optimize(t))}}while(r instanceof AST_Binary&&r.right===o||r instanceof AST_Sequence&&r.tail_node()===o)}return "="==(e=e.lift_sequences(t)).operator&&e.left instanceof AST_SymbolRef&&e.right instanceof AST_Binary&&(e.right.left instanceof AST_SymbolRef&&e.right.left.name==e.left.name&&ASSIGN_OPS.has(e.right.operator)?(e.operator=e.right.operator+"=",e.right=e.right.right):e.right.right instanceof AST_SymbolRef&&e.right.right.name==e.left.name&&ASSIGN_OPS_COMMUTATIVE.has(e.right.operator)&&!e.right.left.has_side_effects(t)&&(e.operator=e.right.operator+"=",e.right=e.right.left)),e;function a(n,o){var i=e.right;e.right=make_node(AST_Null,i);var r=o.may_throw(t);e.right=i;for(var a,s=e.left.definition().scope;(a=t.parent(n++))!==s;)if(a instanceof AST_Try){if(a.bfinally)return !0;if(r&&a.bcatch)return !0}}})),def_optimize(AST_DefaultAssign,(function(e,t){if(!t.option("evaluate"))return e;var n=e.right.evaluate(t);return void 0===n?e=e.left:n!==e.right&&(n=make_node_from_constant(n,e.right),e.right=best_of_expression(n,e.right)),e})),def_optimize(AST_Conditional,(function(e,t){if(!t.option("conditionals"))return e;if(e.condition instanceof AST_Sequence){var n=e.condition.expressions.slice();return e.condition=n.pop(),n.push(e),make_sequence(e,n)}var o=e.condition.evaluate(t);if(o!==e.condition)return maintain_this_binding(t.parent(),t.self(),o?e.consequent:e.alternative);var i=o.negate(t,first_in_statement(t));best_of(t,o,i)===i&&(e=make_node(AST_Conditional,e,{condition:i,consequent:e.alternative,alternative:e.consequent}));var r,a=e.condition,s=e.consequent,u=e.alternative;if(a instanceof AST_SymbolRef&&s instanceof AST_SymbolRef&&a.definition()===s.definition())return make_node(AST_Binary,e,{operator:"||",left:a,right:u});if(s instanceof AST_Assign&&u instanceof AST_Assign&&s.operator===u.operator&&s.logical===u.logical&&s.left.equivalent_to(u.left)&&(!e.condition.has_side_effects(t)||"="==s.operator&&!s.left.has_side_effects(t)))return make_node(AST_Assign,e,{operator:s.operator,left:s.left,logical:s.logical,right:make_node(AST_Conditional,e,{condition:e.condition,consequent:s.right,alternative:u.right})});if(s instanceof AST_Call&&u.TYPE===s.TYPE&&s.args.length>0&&s.args.length==u.args.length&&s.expression.equivalent_to(u.expression)&&!e.condition.has_side_effects(t)&&!s.expression.has_side_effects(t)&&"number"==typeof(r=function(){for(var e=s.args,t=u.args,n=0,o=e.length;n<o;n++){if(e[n]instanceof AST_Expansion)return;if(!e[n].equivalent_to(t[n])){if(t[n]instanceof AST_Expansion)return;for(var i=n+1;i<o;i++){if(e[i]instanceof AST_Expansion)return;if(!e[i].equivalent_to(t[i]))return}return n}}}())){var l=s.clone();return l.args[r]=make_node(AST_Conditional,e,{condition:e.condition,consequent:s.args[r],alternative:u.args[r]}),l}if(u instanceof AST_Conditional&&s.equivalent_to(u.consequent))return make_node(AST_Conditional,e,{condition:make_node(AST_Binary,e,{operator:"||",left:a,right:u.condition}),consequent:s,alternative:u.alternative}).optimize(t);if(t.option("ecma")>=2020&&is_nullish_check(a,u,t))return make_node(AST_Binary,e,{operator:"??",left:u,right:s}).optimize(t);if(u instanceof AST_Sequence&&s.equivalent_to(u.expressions[u.expressions.length-1]))return make_sequence(e,[make_node(AST_Binary,e,{operator:"||",left:a,right:make_sequence(e,u.expressions.slice(0,-1))}),s]).optimize(t);if(u instanceof AST_Binary&&"&&"==u.operator&&s.equivalent_to(u.right))return make_node(AST_Binary,e,{operator:"&&",left:make_node(AST_Binary,e,{operator:"||",left:a,right:u.left}),right:s}).optimize(t);if(s instanceof AST_Conditional&&s.alternative.equivalent_to(u))return make_node(AST_Conditional,e,{condition:make_node(AST_Binary,e,{left:e.condition,operator:"&&",right:s.condition}),consequent:s.consequent,alternative:u});if(s.equivalent_to(u))return make_sequence(e,[e.condition,s]).optimize(t);if(s instanceof AST_Binary&&"||"==s.operator&&s.right.equivalent_to(u))return make_node(AST_Binary,e,{operator:"||",left:make_node(AST_Binary,e,{operator:"&&",left:e.condition,right:s.left}),right:u}).optimize(t);var _=t.in_boolean_context();return f(e.consequent)?p(e.alternative)?c(e.condition):make_node(AST_Binary,e,{operator:"||",left:c(e.condition),right:e.alternative}):p(e.consequent)?f(e.alternative)?c(e.condition.negate(t)):make_node(AST_Binary,e,{operator:"&&",left:c(e.condition.negate(t)),right:e.alternative}):f(e.alternative)?make_node(AST_Binary,e,{operator:"||",left:c(e.condition.negate(t)),right:e.consequent}):p(e.alternative)?make_node(AST_Binary,e,{operator:"&&",left:c(e.condition),right:e.consequent}):e;function c(e){return e.is_boolean()?e:make_node(AST_UnaryPrefix,e,{operator:"!",expression:e.negate(t)})}function f(e){return e instanceof AST_True||_&&e instanceof AST_Constant&&e.getValue()||e instanceof AST_UnaryPrefix&&"!"==e.operator&&e.expression instanceof AST_Constant&&!e.expression.getValue()}function p(e){return e instanceof AST_False||_&&e instanceof AST_Constant&&!e.getValue()||e instanceof AST_UnaryPrefix&&"!"==e.operator&&e.expression instanceof AST_Constant&&e.expression.getValue()}})),def_optimize(AST_Boolean,(function(e,t){if(t.in_boolean_context())return make_node(AST_Number,e,{value:+e.value});var n=t.parent();return t.option("booleans_as_integers")?(n instanceof AST_Binary&&("==="==n.operator||"!=="==n.operator)&&(n.operator=n.operator.replace(/=$/,"")),make_node(AST_Number,e,{value:+e.value})):t.option("booleans")?n instanceof AST_Binary&&("=="==n.operator||"!="==n.operator)?make_node(AST_Number,e,{value:+e.value}):make_node(AST_UnaryPrefix,e,{operator:"!",expression:make_node(AST_Number,e,{value:1-e.value})}):e})),AST_PropAccess.DEFMETHOD("flatten_object",(function(e,t){if(t.option("properties")){var n=t.option("unsafe_arrows")&&t.option("ecma")>=2015,o=this.expression;if(o instanceof AST_Object)for(var i=o.properties,r=i.length;--r>=0;){var a=i[r];if(""+(a instanceof AST_ConciseMethod?a.key.name:a.key)==e){if(!i.every((e=>e instanceof AST_ObjectKeyVal||n&&e instanceof AST_ConciseMethod&&!e.is_generator)))break;if(!safe_to_flatten(a.value,t))break;return make_node(AST_Sub,this,{expression:make_node(AST_Array,o,{elements:i.map((function(e){var t=e.value;t instanceof AST_Accessor&&(t=make_node(AST_Function,t,t));var n=e.key;return n instanceof AST_Node&&!(n instanceof AST_SymbolMethod)?make_sequence(e,[n,t]):t}))}),property:make_node(AST_Number,this,{value:r})})}}}})),def_optimize(AST_Sub,(function(e,t){var n,o=e.expression,i=e.property;if(t.option("properties")){var r=i.evaluate(t);if(r!==i){"string"==typeof r&&("undefined"==r?r=void 0:(g=parseFloat(r)).toString()==r&&(r=g)),i=e.property=best_of_expression(i,make_node_from_constant(r,i).transform(t));var a=""+r;if(is_basic_identifier_string(a)&&a.length<=i.size()+1)return make_node(AST_Dot,e,{expression:o,optional:e.optional,property:a,quote:i.quote}).optimize(t)}}e:if(t.option("arguments")&&o instanceof AST_SymbolRef&&"arguments"==o.name&&1==o.definition().orig.length&&(n=o.scope)instanceof AST_Lambda&&n.uses_arguments&&!(n instanceof AST_Arrow)&&i instanceof AST_Number){for(var s=i.getValue(),u=new Set,l=n.argnames,_=0;_<l.length;_++){if(!(l[_]instanceof AST_SymbolFunarg))break e;var c=l[_].name;if(u.has(c))break e;u.add(c);}var f=n.argnames[s];if(f&&t.has_directive("use strict")){var p=f.definition();(!t.option("reduce_vars")||p.assignments||p.orig.length>1)&&(f=null);}else if(!f&&!t.option("keep_fargs")&&s<n.argnames.length+5)for(;s>=n.argnames.length;)f=n.create_symbol(AST_SymbolFunarg,{source:n,scope:n,tentative_name:"argument_"+n.argnames.length}),n.argnames.push(f);if(f){var d=make_node(AST_SymbolRef,e,f);return d.reference({}),clear_flag(f,1),d}}if(is_lhs(e,t.parent()))return e;if(r!==i){var S=e.flatten_object(a,t);S&&(o=e.expression=S.expression,i=e.property=S.property);}if(t.option("properties")&&t.option("side_effects")&&i instanceof AST_Number&&o instanceof AST_Array){s=i.getValue();var m=o.elements,A=m[s];e:if(safe_to_flatten(A,t)){for(var T=!0,h=[],E=m.length;--E>s;)(g=m[E].drop_side_effect_free(t))&&(h.unshift(g),T&&g.has_side_effects(t)&&(T=!1));if(A instanceof AST_Expansion)break e;for(A=A instanceof AST_Hole?make_node(AST_Undefined,A):A,T||h.unshift(A);--E>=0;){var g;if((g=m[E])instanceof AST_Expansion)break e;(g=g.drop_side_effect_free(t))?h.unshift(g):s--;}return T?(h.push(A),make_sequence(e,h).optimize(t)):make_node(AST_Sub,e,{expression:make_node(AST_Array,o,{elements:h}),property:make_node(AST_Number,i,{value:s})})}}var D=e.evaluate(t);return D!==e?best_of(t,D=make_node_from_constant(D,e).optimize(t),e):e.optional&&is_nullish(e.expression)?make_node(AST_Undefined,e):e})),def_optimize(AST_Chain,(function(e,t){return e.expression=e.expression.optimize(t),e})),AST_Lambda.DEFMETHOD("contains_this",(function(){return walk$3(this,(e=>e instanceof AST_This?walk_abort:e!==this&&e instanceof AST_Scope&&!(e instanceof AST_Arrow)||void 0))})),def_optimize(AST_Dot,(function(e,t){const n=t.parent();if(is_lhs(e,n))return e;if(t.option("unsafe_proto")&&e.expression instanceof AST_Dot&&"prototype"==e.expression.property){var o=e.expression.expression;if(is_undeclared_ref(o))switch(o.name){case"Array":e.expression=make_node(AST_Array,e.expression,{elements:[]});break;case"Function":e.expression=make_node(AST_Function,e.expression,{argnames:[],body:[]});break;case"Number":e.expression=make_node(AST_Number,e.expression,{value:0});break;case"Object":e.expression=make_node(AST_Object,e.expression,{properties:[]});break;case"RegExp":e.expression=make_node(AST_RegExp,e.expression,{value:{source:"t",flags:""}});break;case"String":e.expression=make_node(AST_String,e.expression,{value:""});}}if(!(n instanceof AST_Call&&has_annotation(n,_NOINLINE))){const n=e.flatten_object(e.property,t);if(n)return n.optimize(t)}let i=e.evaluate(t);return i!==e?(i=make_node_from_constant(i,e).optimize(t),best_of(t,i,e)):e.optional&&is_nullish(e.expression)?make_node(AST_Undefined,e):e})),def_optimize(AST_Array,(function(e,t){var n=literals_in_boolean_context(e,t);return n!==e?n:(inline_array_like_spread(e.elements),e)})),def_optimize(AST_Object,(function(e,t){var n=literals_in_boolean_context(e,t);return n!==e?n:(inline_object_prop_spread(e.properties),e)})),def_optimize(AST_RegExp,literals_in_boolean_context),def_optimize(AST_Return,(function(e,t){return e.value&&is_undefined(e.value,t)&&(e.value=null),e})),def_optimize(AST_Arrow,opt_AST_Lambda),def_optimize(AST_Function,(function(e,t){return e=opt_AST_Lambda(e,t),!(t.option("unsafe_arrows")&&t.option("ecma")>=2015)||e.name||e.is_generator||e.uses_arguments||e.pinned()||walk$3(e,(e=>{if(e instanceof AST_This)return walk_abort}))?e:make_node(AST_Arrow,e,e).optimize(t)})),def_optimize(AST_Class,(function(e){return e})),def_optimize(AST_Yield,(function(e,t){return e.expression&&!e.is_star&&is_undefined(e.expression,t)&&(e.expression=null),e})),def_optimize(AST_TemplateString,(function(e,t){if(!t.option("evaluate")||t.parent()instanceof AST_PrefixedTemplateString)return e;for(var n=[],o=0;o<e.segments.length;o++){var i=e.segments[o];if(i instanceof AST_Node){var r=i.evaluate(t);if(r!==i&&(r+"").length<=i.size()+"${}".length){n[n.length-1].value=n[n.length-1].value+r+e.segments[++o].value;continue}if(i instanceof AST_TemplateString){var a=i.segments;n[n.length-1].value+=a[0].value;for(var s=1;s<a.length;s++)i=a[s],n.push(i);continue}}n.push(i);}if(e.segments=n,1==n.length)return make_node(AST_String,e,n[0]);if(3===n.length&&n[1]instanceof AST_Node&&(n[1].is_string(t)||n[1].is_number(t)||is_nullish(n[1])||t.option("unsafe"))){if(""===n[2].value)return make_node(AST_Binary,e,{operator:"+",left:make_node(AST_String,e,{value:n[0].value}),right:n[1]});if(""===n[0].value)return make_node(AST_Binary,e,{operator:"+",left:n[1],right:make_node(AST_String,e,{value:n[2].value})})}return e})),def_optimize(AST_PrefixedTemplateString,(function(e){return e})),def_optimize(AST_ObjectProperty,lift_key),def_optimize(AST_ConciseMethod,(function(e,t){if(lift_key(e,t),t.option("arrows")&&t.parent()instanceof AST_Object&&!e.is_generator&&!e.value.uses_arguments&&!e.value.pinned()&&1==e.value.body.length&&e.value.body[0]instanceof AST_Return&&e.value.body[0].value&&!e.value.contains_this()){var n=make_node(AST_Arrow,e.value,e.value);return n.async=e.async,n.is_generator=e.is_generator,make_node(AST_ObjectKeyVal,e,{key:e.key instanceof AST_SymbolMethod?e.key.name:e.key,value:n,quote:e.quote})}return e})),def_optimize(AST_ObjectKeyVal,(function(e,t){lift_key(e,t);var n=t.option("unsafe_methods");if(n&&t.option("ecma")>=2015&&(!(n instanceof RegExp)||n.test(e.key+""))){var o=e.key,i=e.value;if((i instanceof AST_Arrow&&Array.isArray(i.body)&&!i.contains_this()||i instanceof AST_Function)&&!i.name)return make_node(AST_ConciseMethod,e,{async:i.async,is_generator:i.is_generator,key:o instanceof AST_Node?o:make_node(AST_SymbolMethod,e,{name:o}),value:make_node(AST_Accessor,i,i),quote:e.quote})}return e})),def_optimize(AST_Destructuring,(function(e,t){if(1==t.option("pure_getters")&&t.option("unused")&&!e.is_array&&Array.isArray(e.names)&&!function(e){for(var t=[/^VarDef$/,/^(Const|Let|Var)$/,/^Export$/],n=0,o=0,i=t.length;n<i;o++){var r=e.parent(o);if(!r)return !1;if(0!==n||"Destructuring"!=r.TYPE){if(!t[n].test(r.TYPE))return !1;n++;}}return !0}(t)&&!(e.names[e.names.length-1]instanceof AST_Expansion)){for(var n=[],o=0;o<e.names.length;o++){var i=e.names[o];i instanceof AST_ObjectKeyVal&&"string"==typeof i.key&&i.value instanceof AST_SymbolDeclaration&&!r(t,i.value.definition())||n.push(i);}n.length!=e.names.length&&(e.names=n);}return e;function r(e,t){return !!t.references.length||!!t.global&&(!e.toplevel.vars||!!e.top_retain&&e.top_retain(t))}}));var domprops=["$&","$'","$*","$+","$1","$2","$3","$4","$5","$6","$7","$8","$9","$_","$`","$input","-moz-animation","-moz-animation-delay","-moz-animation-direction","-moz-animation-duration","-moz-animation-fill-mode","-moz-animation-iteration-count","-moz-animation-name","-moz-animation-play-state","-moz-animation-timing-function","-moz-appearance","-moz-backface-visibility","-moz-border-end","-moz-border-end-color","-moz-border-end-style","-moz-border-end-width","-moz-border-image","-moz-border-start","-moz-border-start-color","-moz-border-start-style","-moz-border-start-width","-moz-box-align","-moz-box-direction","-moz-box-flex","-moz-box-ordinal-group","-moz-box-orient","-moz-box-pack","-moz-box-sizing","-moz-float-edge","-moz-font-feature-settings","-moz-font-language-override","-moz-force-broken-image-icon","-moz-hyphens","-moz-image-region","-moz-margin-end","-moz-margin-start","-moz-orient","-moz-osx-font-smoothing","-moz-outline-radius","-moz-outline-radius-bottomleft","-moz-outline-radius-bottomright","-moz-outline-radius-topleft","-moz-outline-radius-topright","-moz-padding-end","-moz-padding-start","-moz-perspective","-moz-perspective-origin","-moz-tab-size","-moz-text-size-adjust","-moz-transform","-moz-transform-origin","-moz-transform-style","-moz-transition","-moz-transition-delay","-moz-transition-duration","-moz-transition-property","-moz-transition-timing-function","-moz-user-focus","-moz-user-input","-moz-user-modify","-moz-user-select","-moz-window-dragging","-webkit-align-content","-webkit-align-items","-webkit-align-self","-webkit-animation","-webkit-animation-delay","-webkit-animation-direction","-webkit-animation-duration","-webkit-animation-fill-mode","-webkit-animation-iteration-count","-webkit-animation-name","-webkit-animation-play-state","-webkit-animation-timing-function","-webkit-appearance","-webkit-backface-visibility","-webkit-background-clip","-webkit-background-origin","-webkit-background-size","-webkit-border-bottom-left-radius","-webkit-border-bottom-right-radius","-webkit-border-image","-webkit-border-radius","-webkit-border-top-left-radius","-webkit-border-top-right-radius","-webkit-box-align","-webkit-box-direction","-webkit-box-flex","-webkit-box-ordinal-group","-webkit-box-orient","-webkit-box-pack","-webkit-box-shadow","-webkit-box-sizing","-webkit-filter","-webkit-flex","-webkit-flex-basis","-webkit-flex-direction","-webkit-flex-flow","-webkit-flex-grow","-webkit-flex-shrink","-webkit-flex-wrap","-webkit-justify-content","-webkit-line-clamp","-webkit-mask","-webkit-mask-clip","-webkit-mask-composite","-webkit-mask-image","-webkit-mask-origin","-webkit-mask-position","-webkit-mask-position-x","-webkit-mask-position-y","-webkit-mask-repeat","-webkit-mask-size","-webkit-order","-webkit-perspective","-webkit-perspective-origin","-webkit-text-fill-color","-webkit-text-size-adjust","-webkit-text-stroke","-webkit-text-stroke-color","-webkit-text-stroke-width","-webkit-transform","-webkit-transform-origin","-webkit-transform-style","-webkit-transition","-webkit-transition-delay","-webkit-transition-duration","-webkit-transition-property","-webkit-transition-timing-function","-webkit-user-select","0","1","10","11","12","13","14","15","16","17","18","19","2","20","3","4","5","6","7","8","9","@@iterator","ABORT_ERR","ACTIVE","ACTIVE_ATTRIBUTES","ACTIVE_TEXTURE","ACTIVE_UNIFORMS","ACTIVE_UNIFORM_BLOCKS","ADDITION","ALIASED_LINE_WIDTH_RANGE","ALIASED_POINT_SIZE_RANGE","ALLOW_KEYBOARD_INPUT","ALLPASS","ALPHA","ALPHA_BITS","ALREADY_SIGNALED","ALT_MASK","ALWAYS","ANY_SAMPLES_PASSED","ANY_SAMPLES_PASSED_CONSERVATIVE","ANY_TYPE","ANY_UNORDERED_NODE_TYPE","ARRAY_BUFFER","ARRAY_BUFFER_BINDING","ATTACHED_SHADERS","ATTRIBUTE_NODE","AT_TARGET","AbortController","AbortSignal","AbsoluteOrientationSensor","AbstractRange","Accelerometer","AddSearchProvider","AggregateError","AnalyserNode","Animation","AnimationEffect","AnimationEvent","AnimationPlaybackEvent","AnimationTimeline","AnonXMLHttpRequest","Any","ApplicationCache","ApplicationCacheErrorEvent","Array","ArrayBuffer","ArrayType","Atomics","Attr","Audio","AudioBuffer","AudioBufferSourceNode","AudioContext","AudioDestinationNode","AudioListener","AudioNode","AudioParam","AudioParamMap","AudioProcessingEvent","AudioScheduledSourceNode","AudioStreamTrack","AudioWorklet","AudioWorkletNode","AuthenticatorAssertionResponse","AuthenticatorAttestationResponse","AuthenticatorResponse","AutocompleteErrorEvent","BACK","BAD_BOUNDARYPOINTS_ERR","BAD_REQUEST","BANDPASS","BLEND","BLEND_COLOR","BLEND_DST_ALPHA","BLEND_DST_RGB","BLEND_EQUATION","BLEND_EQUATION_ALPHA","BLEND_EQUATION_RGB","BLEND_SRC_ALPHA","BLEND_SRC_RGB","BLUE_BITS","BLUR","BOOL","BOOLEAN_TYPE","BOOL_VEC2","BOOL_VEC3","BOOL_VEC4","BOTH","BROWSER_DEFAULT_WEBGL","BUBBLING_PHASE","BUFFER_SIZE","BUFFER_USAGE","BYTE","BYTES_PER_ELEMENT","BackgroundFetchManager","BackgroundFetchRecord","BackgroundFetchRegistration","BarProp","BarcodeDetector","BaseAudioContext","BaseHref","BatteryManager","BeforeInstallPromptEvent","BeforeLoadEvent","BeforeUnloadEvent","BigInt","BigInt64Array","BigUint64Array","BiquadFilterNode","Blob","BlobEvent","Bluetooth","BluetoothCharacteristicProperties","BluetoothDevice","BluetoothRemoteGATTCharacteristic","BluetoothRemoteGATTDescriptor","BluetoothRemoteGATTServer","BluetoothRemoteGATTService","BluetoothUUID","Boolean","BroadcastChannel","ByteLengthQueuingStrategy","CAPTURING_PHASE","CCW","CDATASection","CDATA_SECTION_NODE","CHANGE","CHARSET_RULE","CHECKING","CLAMP_TO_EDGE","CLICK","CLOSED","CLOSING","COLOR","COLOR_ATTACHMENT0","COLOR_ATTACHMENT1","COLOR_ATTACHMENT10","COLOR_ATTACHMENT11","COLOR_ATTACHMENT12","COLOR_ATTACHMENT13","COLOR_ATTACHMENT14","COLOR_ATTACHMENT15","COLOR_ATTACHMENT2","COLOR_ATTACHMENT3","COLOR_ATTACHMENT4","COLOR_ATTACHMENT5","COLOR_ATTACHMENT6","COLOR_ATTACHMENT7","COLOR_ATTACHMENT8","COLOR_ATTACHMENT9","COLOR_BUFFER_BIT","COLOR_CLEAR_VALUE","COLOR_WRITEMASK","COMMENT_NODE","COMPARE_REF_TO_TEXTURE","COMPILE_STATUS","COMPRESSED_RGBA_S3TC_DXT1_EXT","COMPRESSED_RGBA_S3TC_DXT3_EXT","COMPRESSED_RGBA_S3TC_DXT5_EXT","COMPRESSED_RGB_S3TC_DXT1_EXT","COMPRESSED_TEXTURE_FORMATS","CONDITION_SATISFIED","CONFIGURATION_UNSUPPORTED","CONNECTING","CONSTANT_ALPHA","CONSTANT_COLOR","CONSTRAINT_ERR","CONTEXT_LOST_WEBGL","CONTROL_MASK","COPY_READ_BUFFER","COPY_READ_BUFFER_BINDING","COPY_WRITE_BUFFER","COPY_WRITE_BUFFER_BINDING","COUNTER_STYLE_RULE","CSS","CSS2Properties","CSSAnimation","CSSCharsetRule","CSSConditionRule","CSSCounterStyleRule","CSSFontFaceRule","CSSFontFeatureValuesRule","CSSGroupingRule","CSSImageValue","CSSImportRule","CSSKeyframeRule","CSSKeyframesRule","CSSKeywordValue","CSSMathInvert","CSSMathMax","CSSMathMin","CSSMathNegate","CSSMathProduct","CSSMathSum","CSSMathValue","CSSMatrixComponent","CSSMediaRule","CSSMozDocumentRule","CSSNameSpaceRule","CSSNamespaceRule","CSSNumericArray","CSSNumericValue","CSSPageRule","CSSPerspective","CSSPositionValue","CSSPrimitiveValue","CSSRotate","CSSRule","CSSRuleList","CSSScale","CSSSkew","CSSSkewX","CSSSkewY","CSSStyleDeclaration","CSSStyleRule","CSSStyleSheet","CSSStyleValue","CSSSupportsRule","CSSTransformComponent","CSSTransformValue","CSSTransition","CSSTranslate","CSSUnitValue","CSSUnknownRule","CSSUnparsedValue","CSSValue","CSSValueList","CSSVariableReferenceValue","CSSVariablesDeclaration","CSSVariablesRule","CSSViewportRule","CSS_ATTR","CSS_CM","CSS_COUNTER","CSS_CUSTOM","CSS_DEG","CSS_DIMENSION","CSS_EMS","CSS_EXS","CSS_FILTER_BLUR","CSS_FILTER_BRIGHTNESS","CSS_FILTER_CONTRAST","CSS_FILTER_CUSTOM","CSS_FILTER_DROP_SHADOW","CSS_FILTER_GRAYSCALE","CSS_FILTER_HUE_ROTATE","CSS_FILTER_INVERT","CSS_FILTER_OPACITY","CSS_FILTER_REFERENCE","CSS_FILTER_SATURATE","CSS_FILTER_SEPIA","CSS_GRAD","CSS_HZ","CSS_IDENT","CSS_IN","CSS_INHERIT","CSS_KHZ","CSS_MATRIX","CSS_MATRIX3D","CSS_MM","CSS_MS","CSS_NUMBER","CSS_PC","CSS_PERCENTAGE","CSS_PERSPECTIVE","CSS_PRIMITIVE_VALUE","CSS_PT","CSS_PX","CSS_RAD","CSS_RECT","CSS_RGBCOLOR","CSS_ROTATE","CSS_ROTATE3D","CSS_ROTATEX","CSS_ROTATEY","CSS_ROTATEZ","CSS_S","CSS_SCALE","CSS_SCALE3D","CSS_SCALEX","CSS_SCALEY","CSS_SCALEZ","CSS_SKEW","CSS_SKEWX","CSS_SKEWY","CSS_STRING","CSS_TRANSLATE","CSS_TRANSLATE3D","CSS_TRANSLATEX","CSS_TRANSLATEY","CSS_TRANSLATEZ","CSS_UNKNOWN","CSS_URI","CSS_VALUE_LIST","CSS_VH","CSS_VMAX","CSS_VMIN","CSS_VW","CULL_FACE","CULL_FACE_MODE","CURRENT_PROGRAM","CURRENT_QUERY","CURRENT_VERTEX_ATTRIB","CUSTOM","CW","Cache","CacheStorage","CanvasCaptureMediaStream","CanvasCaptureMediaStreamTrack","CanvasGradient","CanvasPattern","CanvasRenderingContext2D","CaretPosition","ChannelMergerNode","ChannelSplitterNode","CharacterData","ClientRect","ClientRectList","Clipboard","ClipboardEvent","ClipboardItem","CloseEvent","Collator","CommandEvent","Comment","CompileError","CompositionEvent","CompressionStream","Console","ConstantSourceNode","Controllers","ConvolverNode","CountQueuingStrategy","Counter","Credential","CredentialsContainer","Crypto","CryptoKey","CustomElementRegistry","CustomEvent","DATABASE_ERR","DATA_CLONE_ERR","DATA_ERR","DBLCLICK","DECR","DECR_WRAP","DELETE_STATUS","DEPTH","DEPTH24_STENCIL8","DEPTH32F_STENCIL8","DEPTH_ATTACHMENT","DEPTH_BITS","DEPTH_BUFFER_BIT","DEPTH_CLEAR_VALUE","DEPTH_COMPONENT","DEPTH_COMPONENT16","DEPTH_COMPONENT24","DEPTH_COMPONENT32F","DEPTH_FUNC","DEPTH_RANGE","DEPTH_STENCIL","DEPTH_STENCIL_ATTACHMENT","DEPTH_TEST","DEPTH_WRITEMASK","DEVICE_INELIGIBLE","DIRECTION_DOWN","DIRECTION_LEFT","DIRECTION_RIGHT","DIRECTION_UP","DISABLED","DISPATCH_REQUEST_ERR","DITHER","DOCUMENT_FRAGMENT_NODE","DOCUMENT_NODE","DOCUMENT_POSITION_CONTAINED_BY","DOCUMENT_POSITION_CONTAINS","DOCUMENT_POSITION_DISCONNECTED","DOCUMENT_POSITION_FOLLOWING","DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC","DOCUMENT_POSITION_PRECEDING","DOCUMENT_TYPE_NODE","DOMCursor","DOMError","DOMException","DOMImplementation","DOMImplementationLS","DOMMatrix","DOMMatrixReadOnly","DOMParser","DOMPoint","DOMPointReadOnly","DOMQuad","DOMRect","DOMRectList","DOMRectReadOnly","DOMRequest","DOMSTRING_SIZE_ERR","DOMSettableTokenList","DOMStringList","DOMStringMap","DOMTokenList","DOMTransactionEvent","DOM_DELTA_LINE","DOM_DELTA_PAGE","DOM_DELTA_PIXEL","DOM_INPUT_METHOD_DROP","DOM_INPUT_METHOD_HANDWRITING","DOM_INPUT_METHOD_IME","DOM_INPUT_METHOD_KEYBOARD","DOM_INPUT_METHOD_MULTIMODAL","DOM_INPUT_METHOD_OPTION","DOM_INPUT_METHOD_PASTE","DOM_INPUT_METHOD_SCRIPT","DOM_INPUT_METHOD_UNKNOWN","DOM_INPUT_METHOD_VOICE","DOM_KEY_LOCATION_JOYSTICK","DOM_KEY_LOCATION_LEFT","DOM_KEY_LOCATION_MOBILE","DOM_KEY_LOCATION_NUMPAD","DOM_KEY_LOCATION_RIGHT","DOM_KEY_LOCATION_STANDARD","DOM_VK_0","DOM_VK_1","DOM_VK_2","DOM_VK_3","DOM_VK_4","DOM_VK_5","DOM_VK_6","DOM_VK_7","DOM_VK_8","DOM_VK_9","DOM_VK_A","DOM_VK_ACCEPT","DOM_VK_ADD","DOM_VK_ALT","DOM_VK_ALTGR","DOM_VK_AMPERSAND","DOM_VK_ASTERISK","DOM_VK_AT","DOM_VK_ATTN","DOM_VK_B","DOM_VK_BACKSPACE","DOM_VK_BACK_QUOTE","DOM_VK_BACK_SLASH","DOM_VK_BACK_SPACE","DOM_VK_C","DOM_VK_CANCEL","DOM_VK_CAPS_LOCK","DOM_VK_CIRCUMFLEX","DOM_VK_CLEAR","DOM_VK_CLOSE_BRACKET","DOM_VK_CLOSE_CURLY_BRACKET","DOM_VK_CLOSE_PAREN","DOM_VK_COLON","DOM_VK_COMMA","DOM_VK_CONTEXT_MENU","DOM_VK_CONTROL","DOM_VK_CONVERT","DOM_VK_CRSEL","DOM_VK_CTRL","DOM_VK_D","DOM_VK_DECIMAL","DOM_VK_DELETE","DOM_VK_DIVIDE","DOM_VK_DOLLAR","DOM_VK_DOUBLE_QUOTE","DOM_VK_DOWN","DOM_VK_E","DOM_VK_EISU","DOM_VK_END","DOM_VK_ENTER","DOM_VK_EQUALS","DOM_VK_EREOF","DOM_VK_ESCAPE","DOM_VK_EXCLAMATION","DOM_VK_EXECUTE","DOM_VK_EXSEL","DOM_VK_F","DOM_VK_F1","DOM_VK_F10","DOM_VK_F11","DOM_VK_F12","DOM_VK_F13","DOM_VK_F14","DOM_VK_F15","DOM_VK_F16","DOM_VK_F17","DOM_VK_F18","DOM_VK_F19","DOM_VK_F2","DOM_VK_F20","DOM_VK_F21","DOM_VK_F22","DOM_VK_F23","DOM_VK_F24","DOM_VK_F25","DOM_VK_F26","DOM_VK_F27","DOM_VK_F28","DOM_VK_F29","DOM_VK_F3","DOM_VK_F30","DOM_VK_F31","DOM_VK_F32","DOM_VK_F33","DOM_VK_F34","DOM_VK_F35","DOM_VK_F36","DOM_VK_F4","DOM_VK_F5","DOM_VK_F6","DOM_VK_F7","DOM_VK_F8","DOM_VK_F9","DOM_VK_FINAL","DOM_VK_FRONT","DOM_VK_G","DOM_VK_GREATER_THAN","DOM_VK_H","DOM_VK_HANGUL","DOM_VK_HANJA","DOM_VK_HASH","DOM_VK_HELP","DOM_VK_HK_TOGGLE","DOM_VK_HOME","DOM_VK_HYPHEN_MINUS","DOM_VK_I","DOM_VK_INSERT","DOM_VK_J","DOM_VK_JUNJA","DOM_VK_K","DOM_VK_KANA","DOM_VK_KANJI","DOM_VK_L","DOM_VK_LEFT","DOM_VK_LEFT_TAB","DOM_VK_LESS_THAN","DOM_VK_M","DOM_VK_META","DOM_VK_MODECHANGE","DOM_VK_MULTIPLY","DOM_VK_N","DOM_VK_NONCONVERT","DOM_VK_NUMPAD0","DOM_VK_NUMPAD1","DOM_VK_NUMPAD2","DOM_VK_NUMPAD3","DOM_VK_NUMPAD4","DOM_VK_NUMPAD5","DOM_VK_NUMPAD6","DOM_VK_NUMPAD7","DOM_VK_NUMPAD8","DOM_VK_NUMPAD9","DOM_VK_NUM_LOCK","DOM_VK_O","DOM_VK_OEM_1","DOM_VK_OEM_102","DOM_VK_OEM_2","DOM_VK_OEM_3","DOM_VK_OEM_4","DOM_VK_OEM_5","DOM_VK_OEM_6","DOM_VK_OEM_7","DOM_VK_OEM_8","DOM_VK_OEM_COMMA","DOM_VK_OEM_MINUS","DOM_VK_OEM_PERIOD","DOM_VK_OEM_PLUS","DOM_VK_OPEN_BRACKET","DOM_VK_OPEN_CURLY_BRACKET","DOM_VK_OPEN_PAREN","DOM_VK_P","DOM_VK_PA1","DOM_VK_PAGEDOWN","DOM_VK_PAGEUP","DOM_VK_PAGE_DOWN","DOM_VK_PAGE_UP","DOM_VK_PAUSE","DOM_VK_PERCENT","DOM_VK_PERIOD","DOM_VK_PIPE","DOM_VK_PLAY","DOM_VK_PLUS","DOM_VK_PRINT","DOM_VK_PRINTSCREEN","DOM_VK_PROCESSKEY","DOM_VK_PROPERITES","DOM_VK_Q","DOM_VK_QUESTION_MARK","DOM_VK_QUOTE","DOM_VK_R","DOM_VK_REDO","DOM_VK_RETURN","DOM_VK_RIGHT","DOM_VK_S","DOM_VK_SCROLL_LOCK","DOM_VK_SELECT","DOM_VK_SEMICOLON","DOM_VK_SEPARATOR","DOM_VK_SHIFT","DOM_VK_SLASH","DOM_VK_SLEEP","DOM_VK_SPACE","DOM_VK_SUBTRACT","DOM_VK_T","DOM_VK_TAB","DOM_VK_TILDE","DOM_VK_U","DOM_VK_UNDERSCORE","DOM_VK_UNDO","DOM_VK_UNICODE","DOM_VK_UP","DOM_VK_V","DOM_VK_VOLUME_DOWN","DOM_VK_VOLUME_MUTE","DOM_VK_VOLUME_UP","DOM_VK_W","DOM_VK_WIN","DOM_VK_WINDOW","DOM_VK_WIN_ICO_00","DOM_VK_WIN_ICO_CLEAR","DOM_VK_WIN_ICO_HELP","DOM_VK_WIN_OEM_ATTN","DOM_VK_WIN_OEM_AUTO","DOM_VK_WIN_OEM_BACKTAB","DOM_VK_WIN_OEM_CLEAR","DOM_VK_WIN_OEM_COPY","DOM_VK_WIN_OEM_CUSEL","DOM_VK_WIN_OEM_ENLW","DOM_VK_WIN_OEM_FINISH","DOM_VK_WIN_OEM_FJ_JISHO","DOM_VK_WIN_OEM_FJ_LOYA","DOM_VK_WIN_OEM_FJ_MASSHOU","DOM_VK_WIN_OEM_FJ_ROYA","DOM_VK_WIN_OEM_FJ_TOUROKU","DOM_VK_WIN_OEM_JUMP","DOM_VK_WIN_OEM_PA1","DOM_VK_WIN_OEM_PA2","DOM_VK_WIN_OEM_PA3","DOM_VK_WIN_OEM_RESET","DOM_VK_WIN_OEM_WSCTRL","DOM_VK_X","DOM_VK_XF86XK_ADD_FAVORITE","DOM_VK_XF86XK_APPLICATION_LEFT","DOM_VK_XF86XK_APPLICATION_RIGHT","DOM_VK_XF86XK_AUDIO_CYCLE_TRACK","DOM_VK_XF86XK_AUDIO_FORWARD","DOM_VK_XF86XK_AUDIO_LOWER_VOLUME","DOM_VK_XF86XK_AUDIO_MEDIA","DOM_VK_XF86XK_AUDIO_MUTE","DOM_VK_XF86XK_AUDIO_NEXT","DOM_VK_XF86XK_AUDIO_PAUSE","DOM_VK_XF86XK_AUDIO_PLAY","DOM_VK_XF86XK_AUDIO_PREV","DOM_VK_XF86XK_AUDIO_RAISE_VOLUME","DOM_VK_XF86XK_AUDIO_RANDOM_PLAY","DOM_VK_XF86XK_AUDIO_RECORD","DOM_VK_XF86XK_AUDIO_REPEAT","DOM_VK_XF86XK_AUDIO_REWIND","DOM_VK_XF86XK_AUDIO_STOP","DOM_VK_XF86XK_AWAY","DOM_VK_XF86XK_BACK","DOM_VK_XF86XK_BACK_FORWARD","DOM_VK_XF86XK_BATTERY","DOM_VK_XF86XK_BLUE","DOM_VK_XF86XK_BLUETOOTH","DOM_VK_XF86XK_BOOK","DOM_VK_XF86XK_BRIGHTNESS_ADJUST","DOM_VK_XF86XK_CALCULATOR","DOM_VK_XF86XK_CALENDAR","DOM_VK_XF86XK_CD","DOM_VK_XF86XK_CLOSE","DOM_VK_XF86XK_COMMUNITY","DOM_VK_XF86XK_CONTRAST_ADJUST","DOM_VK_XF86XK_COPY","DOM_VK_XF86XK_CUT","DOM_VK_XF86XK_CYCLE_ANGLE","DOM_VK_XF86XK_DISPLAY","DOM_VK_XF86XK_DOCUMENTS","DOM_VK_XF86XK_DOS","DOM_VK_XF86XK_EJECT","DOM_VK_XF86XK_EXCEL","DOM_VK_XF86XK_EXPLORER","DOM_VK_XF86XK_FAVORITES","DOM_VK_XF86XK_FINANCE","DOM_VK_XF86XK_FORWARD","DOM_VK_XF86XK_FRAME_BACK","DOM_VK_XF86XK_FRAME_FORWARD","DOM_VK_XF86XK_GAME","DOM_VK_XF86XK_GO","DOM_VK_XF86XK_GREEN","DOM_VK_XF86XK_HIBERNATE","DOM_VK_XF86XK_HISTORY","DOM_VK_XF86XK_HOME_PAGE","DOM_VK_XF86XK_HOT_LINKS","DOM_VK_XF86XK_I_TOUCH","DOM_VK_XF86XK_KBD_BRIGHTNESS_DOWN","DOM_VK_XF86XK_KBD_BRIGHTNESS_UP","DOM_VK_XF86XK_KBD_LIGHT_ON_OFF","DOM_VK_XF86XK_LAUNCH0","DOM_VK_XF86XK_LAUNCH1","DOM_VK_XF86XK_LAUNCH2","DOM_VK_XF86XK_LAUNCH3","DOM_VK_XF86XK_LAUNCH4","DOM_VK_XF86XK_LAUNCH5","DOM_VK_XF86XK_LAUNCH6","DOM_VK_XF86XK_LAUNCH7","DOM_VK_XF86XK_LAUNCH8","DOM_VK_XF86XK_LAUNCH9","DOM_VK_XF86XK_LAUNCH_A","DOM_VK_XF86XK_LAUNCH_B","DOM_VK_XF86XK_LAUNCH_C","DOM_VK_XF86XK_LAUNCH_D","DOM_VK_XF86XK_LAUNCH_E","DOM_VK_XF86XK_LAUNCH_F","DOM_VK_XF86XK_LIGHT_BULB","DOM_VK_XF86XK_LOG_OFF","DOM_VK_XF86XK_MAIL","DOM_VK_XF86XK_MAIL_FORWARD","DOM_VK_XF86XK_MARKET","DOM_VK_XF86XK_MEETING","DOM_VK_XF86XK_MEMO","DOM_VK_XF86XK_MENU_KB","DOM_VK_XF86XK_MENU_PB","DOM_VK_XF86XK_MESSENGER","DOM_VK_XF86XK_MON_BRIGHTNESS_DOWN","DOM_VK_XF86XK_MON_BRIGHTNESS_UP","DOM_VK_XF86XK_MUSIC","DOM_VK_XF86XK_MY_COMPUTER","DOM_VK_XF86XK_MY_SITES","DOM_VK_XF86XK_NEW","DOM_VK_XF86XK_NEWS","DOM_VK_XF86XK_OFFICE_HOME","DOM_VK_XF86XK_OPEN","DOM_VK_XF86XK_OPEN_URL","DOM_VK_XF86XK_OPTION","DOM_VK_XF86XK_PASTE","DOM_VK_XF86XK_PHONE","DOM_VK_XF86XK_PICTURES","DOM_VK_XF86XK_POWER_DOWN","DOM_VK_XF86XK_POWER_OFF","DOM_VK_XF86XK_RED","DOM_VK_XF86XK_REFRESH","DOM_VK_XF86XK_RELOAD","DOM_VK_XF86XK_REPLY","DOM_VK_XF86XK_ROCKER_DOWN","DOM_VK_XF86XK_ROCKER_ENTER","DOM_VK_XF86XK_ROCKER_UP","DOM_VK_XF86XK_ROTATE_WINDOWS","DOM_VK_XF86XK_ROTATION_KB","DOM_VK_XF86XK_ROTATION_PB","DOM_VK_XF86XK_SAVE","DOM_VK_XF86XK_SCREEN_SAVER","DOM_VK_XF86XK_SCROLL_CLICK","DOM_VK_XF86XK_SCROLL_DOWN","DOM_VK_XF86XK_SCROLL_UP","DOM_VK_XF86XK_SEARCH","DOM_VK_XF86XK_SEND","DOM_VK_XF86XK_SHOP","DOM_VK_XF86XK_SPELL","DOM_VK_XF86XK_SPLIT_SCREEN","DOM_VK_XF86XK_STANDBY","DOM_VK_XF86XK_START","DOM_VK_XF86XK_STOP","DOM_VK_XF86XK_SUBTITLE","DOM_VK_XF86XK_SUPPORT","DOM_VK_XF86XK_SUSPEND","DOM_VK_XF86XK_TASK_PANE","DOM_VK_XF86XK_TERMINAL","DOM_VK_XF86XK_TIME","DOM_VK_XF86XK_TOOLS","DOM_VK_XF86XK_TOP_MENU","DOM_VK_XF86XK_TO_DO_LIST","DOM_VK_XF86XK_TRAVEL","DOM_VK_XF86XK_USER1KB","DOM_VK_XF86XK_USER2KB","DOM_VK_XF86XK_USER_PB","DOM_VK_XF86XK_UWB","DOM_VK_XF86XK_VENDOR_HOME","DOM_VK_XF86XK_VIDEO","DOM_VK_XF86XK_VIEW","DOM_VK_XF86XK_WAKE_UP","DOM_VK_XF86XK_WEB_CAM","DOM_VK_XF86XK_WHEEL_BUTTON","DOM_VK_XF86XK_WLAN","DOM_VK_XF86XK_WORD","DOM_VK_XF86XK_WWW","DOM_VK_XF86XK_XFER","DOM_VK_XF86XK_YELLOW","DOM_VK_XF86XK_ZOOM_IN","DOM_VK_XF86XK_ZOOM_OUT","DOM_VK_Y","DOM_VK_Z","DOM_VK_ZOOM","DONE","DONT_CARE","DOWNLOADING","DRAGDROP","DRAW_BUFFER0","DRAW_BUFFER1","DRAW_BUFFER10","DRAW_BUFFER11","DRAW_BUFFER12","DRAW_BUFFER13","DRAW_BUFFER14","DRAW_BUFFER15","DRAW_BUFFER2","DRAW_BUFFER3","DRAW_BUFFER4","DRAW_BUFFER5","DRAW_BUFFER6","DRAW_BUFFER7","DRAW_BUFFER8","DRAW_BUFFER9","DRAW_FRAMEBUFFER","DRAW_FRAMEBUFFER_BINDING","DST_ALPHA","DST_COLOR","DYNAMIC_COPY","DYNAMIC_DRAW","DYNAMIC_READ","DataChannel","DataTransfer","DataTransferItem","DataTransferItemList","DataView","Date","DateTimeFormat","DecompressionStream","DelayNode","DeprecationReportBody","DesktopNotification","DesktopNotificationCenter","DeviceLightEvent","DeviceMotionEvent","DeviceMotionEventAcceleration","DeviceMotionEventRotationRate","DeviceOrientationEvent","DeviceProximityEvent","DeviceStorage","DeviceStorageChangeEvent","Directory","DisplayNames","Document","DocumentFragment","DocumentTimeline","DocumentType","DragEvent","DynamicsCompressorNode","E","ELEMENT_ARRAY_BUFFER","ELEMENT_ARRAY_BUFFER_BINDING","ELEMENT_NODE","EMPTY","ENCODING_ERR","ENDED","END_TO_END","END_TO_START","ENTITY_NODE","ENTITY_REFERENCE_NODE","EPSILON","EQUAL","EQUALPOWER","ERROR","EXPONENTIAL_DISTANCE","Element","ElementInternals","ElementQuery","EnterPictureInPictureEvent","Entity","EntityReference","Error","ErrorEvent","EvalError","Event","EventException","EventSource","EventTarget","External","FASTEST","FIDOSDK","FILTER_ACCEPT","FILTER_INTERRUPT","FILTER_REJECT","FILTER_SKIP","FINISHED_STATE","FIRST_ORDERED_NODE_TYPE","FLOAT","FLOAT_32_UNSIGNED_INT_24_8_REV","FLOAT_MAT2","FLOAT_MAT2x3","FLOAT_MAT2x4","FLOAT_MAT3","FLOAT_MAT3x2","FLOAT_MAT3x4","FLOAT_MAT4","FLOAT_MAT4x2","FLOAT_MAT4x3","FLOAT_VEC2","FLOAT_VEC3","FLOAT_VEC4","FOCUS","FONT_FACE_RULE","FONT_FEATURE_VALUES_RULE","FRAGMENT_SHADER","FRAGMENT_SHADER_DERIVATIVE_HINT","FRAGMENT_SHADER_DERIVATIVE_HINT_OES","FRAMEBUFFER","FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE","FRAMEBUFFER_ATTACHMENT_BLUE_SIZE","FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING","FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE","FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE","FRAMEBUFFER_ATTACHMENT_GREEN_SIZE","FRAMEBUFFER_ATTACHMENT_OBJECT_NAME","FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE","FRAMEBUFFER_ATTACHMENT_RED_SIZE","FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE","FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE","FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER","FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL","FRAMEBUFFER_BINDING","FRAMEBUFFER_COMPLETE","FRAMEBUFFER_DEFAULT","FRAMEBUFFER_INCOMPLETE_ATTACHMENT","FRAMEBUFFER_INCOMPLETE_DIMENSIONS","FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT","FRAMEBUFFER_INCOMPLETE_MULTISAMPLE","FRAMEBUFFER_UNSUPPORTED","FRONT","FRONT_AND_BACK","FRONT_FACE","FUNC_ADD","FUNC_REVERSE_SUBTRACT","FUNC_SUBTRACT","FeaturePolicy","FeaturePolicyViolationReportBody","FederatedCredential","Feed","FeedEntry","File","FileError","FileList","FileReader","FileSystem","FileSystemDirectoryEntry","FileSystemDirectoryReader","FileSystemEntry","FileSystemFileEntry","FinalizationRegistry","FindInPage","Float32Array","Float64Array","FocusEvent","FontFace","FontFaceSet","FontFaceSetLoadEvent","FormData","FormDataEvent","FragmentDirective","Function","GENERATE_MIPMAP_HINT","GEQUAL","GREATER","GREEN_BITS","GainNode","Gamepad","GamepadAxisMoveEvent","GamepadButton","GamepadButtonEvent","GamepadEvent","GamepadHapticActuator","GamepadPose","Geolocation","GeolocationCoordinates","GeolocationPosition","GeolocationPositionError","GestureEvent","Global","Gyroscope","HALF_FLOAT","HAVE_CURRENT_DATA","HAVE_ENOUGH_DATA","HAVE_FUTURE_DATA","HAVE_METADATA","HAVE_NOTHING","HEADERS_RECEIVED","HIDDEN","HIERARCHY_REQUEST_ERR","HIGHPASS","HIGHSHELF","HIGH_FLOAT","HIGH_INT","HORIZONTAL","HORIZONTAL_AXIS","HRTF","HTMLAllCollection","HTMLAnchorElement","HTMLAppletElement","HTMLAreaElement","HTMLAudioElement","HTMLBRElement","HTMLBaseElement","HTMLBaseFontElement","HTMLBlockquoteElement","HTMLBodyElement","HTMLButtonElement","HTMLCanvasElement","HTMLCollection","HTMLCommandElement","HTMLContentElement","HTMLDListElement","HTMLDataElement","HTMLDataListElement","HTMLDetailsElement","HTMLDialogElement","HTMLDirectoryElement","HTMLDivElement","HTMLDocument","HTMLElement","HTMLEmbedElement","HTMLFieldSetElement","HTMLFontElement","HTMLFormControlsCollection","HTMLFormElement","HTMLFrameElement","HTMLFrameSetElement","HTMLHRElement","HTMLHeadElement","HTMLHeadingElement","HTMLHtmlElement","HTMLIFrameElement","HTMLImageElement","HTMLInputElement","HTMLIsIndexElement","HTMLKeygenElement","HTMLLIElement","HTMLLabelElement","HTMLLegendElement","HTMLLinkElement","HTMLMapElement","HTMLMarqueeElement","HTMLMediaElement","HTMLMenuElement","HTMLMenuItemElement","HTMLMetaElement","HTMLMeterElement","HTMLModElement","HTMLOListElement","HTMLObjectElement","HTMLOptGroupElement","HTMLOptionElement","HTMLOptionsCollection","HTMLOutputElement","HTMLParagraphElement","HTMLParamElement","HTMLPictureElement","HTMLPreElement","HTMLProgressElement","HTMLPropertiesCollection","HTMLQuoteElement","HTMLScriptElement","HTMLSelectElement","HTMLShadowElement","HTMLSlotElement","HTMLSourceElement","HTMLSpanElement","HTMLStyleElement","HTMLTableCaptionElement","HTMLTableCellElement","HTMLTableColElement","HTMLTableElement","HTMLTableRowElement","HTMLTableSectionElement","HTMLTemplateElement","HTMLTextAreaElement","HTMLTimeElement","HTMLTitleElement","HTMLTrackElement","HTMLUListElement","HTMLUnknownElement","HTMLVideoElement","HashChangeEvent","Headers","History","Hz","ICE_CHECKING","ICE_CLOSED","ICE_COMPLETED","ICE_CONNECTED","ICE_FAILED","ICE_GATHERING","ICE_WAITING","IDBCursor","IDBCursorWithValue","IDBDatabase","IDBDatabaseException","IDBFactory","IDBFileHandle","IDBFileRequest","IDBIndex","IDBKeyRange","IDBMutableFile","IDBObjectStore","IDBOpenDBRequest","IDBRequest","IDBTransaction","IDBVersionChangeEvent","IDLE","IIRFilterNode","IMPLEMENTATION_COLOR_READ_FORMAT","IMPLEMENTATION_COLOR_READ_TYPE","IMPORT_RULE","INCR","INCR_WRAP","INDEX_SIZE_ERR","INT","INTERLEAVED_ATTRIBS","INT_2_10_10_10_REV","INT_SAMPLER_2D","INT_SAMPLER_2D_ARRAY","INT_SAMPLER_3D","INT_SAMPLER_CUBE","INT_VEC2","INT_VEC3","INT_VEC4","INUSE_ATTRIBUTE_ERR","INVALID_ACCESS_ERR","INVALID_CHARACTER_ERR","INVALID_ENUM","INVALID_EXPRESSION_ERR","INVALID_FRAMEBUFFER_OPERATION","INVALID_INDEX","INVALID_MODIFICATION_ERR","INVALID_NODE_TYPE_ERR","INVALID_OPERATION","INVALID_STATE_ERR","INVALID_VALUE","INVERSE_DISTANCE","INVERT","IceCandidate","IdleDeadline","Image","ImageBitmap","ImageBitmapRenderingContext","ImageCapture","ImageData","Infinity","InputDeviceCapabilities","InputDeviceInfo","InputEvent","InputMethodContext","InstallTrigger","InstallTriggerImpl","Instance","Int16Array","Int32Array","Int8Array","Intent","InternalError","IntersectionObserver","IntersectionObserverEntry","Intl","IsSearchProviderInstalled","Iterator","JSON","KEEP","KEYDOWN","KEYFRAMES_RULE","KEYFRAME_RULE","KEYPRESS","KEYUP","KeyEvent","Keyboard","KeyboardEvent","KeyboardLayoutMap","KeyframeEffect","LENGTHADJUST_SPACING","LENGTHADJUST_SPACINGANDGLYPHS","LENGTHADJUST_UNKNOWN","LEQUAL","LESS","LINEAR","LINEAR_DISTANCE","LINEAR_MIPMAP_LINEAR","LINEAR_MIPMAP_NEAREST","LINES","LINE_LOOP","LINE_STRIP","LINE_WIDTH","LINK_STATUS","LIVE","LN10","LN2","LOADED","LOADING","LOG10E","LOG2E","LOWPASS","LOWSHELF","LOW_FLOAT","LOW_INT","LSException","LSParserFilter","LUMINANCE","LUMINANCE_ALPHA","LargestContentfulPaint","LayoutShift","LayoutShiftAttribution","LinearAccelerationSensor","LinkError","ListFormat","LocalMediaStream","Locale","Location","Lock","LockManager","MAX","MAX_3D_TEXTURE_SIZE","MAX_ARRAY_TEXTURE_LAYERS","MAX_CLIENT_WAIT_TIMEOUT_WEBGL","MAX_COLOR_ATTACHMENTS","MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS","MAX_COMBINED_TEXTURE_IMAGE_UNITS","MAX_COMBINED_UNIFORM_BLOCKS","MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS","MAX_CUBE_MAP_TEXTURE_SIZE","MAX_DRAW_BUFFERS","MAX_ELEMENTS_INDICES","MAX_ELEMENTS_VERTICES","MAX_ELEMENT_INDEX","MAX_FRAGMENT_INPUT_COMPONENTS","MAX_FRAGMENT_UNIFORM_BLOCKS","MAX_FRAGMENT_UNIFORM_COMPONENTS","MAX_FRAGMENT_UNIFORM_VECTORS","MAX_PROGRAM_TEXEL_OFFSET","MAX_RENDERBUFFER_SIZE","MAX_SAFE_INTEGER","MAX_SAMPLES","MAX_SERVER_WAIT_TIMEOUT","MAX_TEXTURE_IMAGE_UNITS","MAX_TEXTURE_LOD_BIAS","MAX_TEXTURE_MAX_ANISOTROPY_EXT","MAX_TEXTURE_SIZE","MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS","MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS","MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS","MAX_UNIFORM_BLOCK_SIZE","MAX_UNIFORM_BUFFER_BINDINGS","MAX_VALUE","MAX_VARYING_COMPONENTS","MAX_VARYING_VECTORS","MAX_VERTEX_ATTRIBS","MAX_VERTEX_OUTPUT_COMPONENTS","MAX_VERTEX_TEXTURE_IMAGE_UNITS","MAX_VERTEX_UNIFORM_BLOCKS","MAX_VERTEX_UNIFORM_COMPONENTS","MAX_VERTEX_UNIFORM_VECTORS","MAX_VIEWPORT_DIMS","MEDIA_ERR_ABORTED","MEDIA_ERR_DECODE","MEDIA_ERR_ENCRYPTED","MEDIA_ERR_NETWORK","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_KEYERR_CLIENT","MEDIA_KEYERR_DOMAIN","MEDIA_KEYERR_HARDWARECHANGE","MEDIA_KEYERR_OUTPUT","MEDIA_KEYERR_SERVICE","MEDIA_KEYERR_UNKNOWN","MEDIA_RULE","MEDIUM_FLOAT","MEDIUM_INT","META_MASK","MIDIAccess","MIDIConnectionEvent","MIDIInput","MIDIInputMap","MIDIMessageEvent","MIDIOutput","MIDIOutputMap","MIDIPort","MIN","MIN_PROGRAM_TEXEL_OFFSET","MIN_SAFE_INTEGER","MIN_VALUE","MIRRORED_REPEAT","MODE_ASYNCHRONOUS","MODE_SYNCHRONOUS","MODIFICATION","MOUSEDOWN","MOUSEDRAG","MOUSEMOVE","MOUSEOUT","MOUSEOVER","MOUSEUP","MOZ_KEYFRAMES_RULE","MOZ_KEYFRAME_RULE","MOZ_SOURCE_CURSOR","MOZ_SOURCE_ERASER","MOZ_SOURCE_KEYBOARD","MOZ_SOURCE_MOUSE","MOZ_SOURCE_PEN","MOZ_SOURCE_TOUCH","MOZ_SOURCE_UNKNOWN","MSGESTURE_FLAG_BEGIN","MSGESTURE_FLAG_CANCEL","MSGESTURE_FLAG_END","MSGESTURE_FLAG_INERTIA","MSGESTURE_FLAG_NONE","MSPOINTER_TYPE_MOUSE","MSPOINTER_TYPE_PEN","MSPOINTER_TYPE_TOUCH","MS_ASYNC_CALLBACK_STATUS_ASSIGN_DELEGATE","MS_ASYNC_CALLBACK_STATUS_CANCEL","MS_ASYNC_CALLBACK_STATUS_CHOOSEANY","MS_ASYNC_CALLBACK_STATUS_ERROR","MS_ASYNC_CALLBACK_STATUS_JOIN","MS_ASYNC_OP_STATUS_CANCELED","MS_ASYNC_OP_STATUS_ERROR","MS_ASYNC_OP_STATUS_SUCCESS","MS_MANIPULATION_STATE_ACTIVE","MS_MANIPULATION_STATE_CANCELLED","MS_MANIPULATION_STATE_COMMITTED","MS_MANIPULATION_STATE_DRAGGING","MS_MANIPULATION_STATE_INERTIA","MS_MANIPULATION_STATE_PRESELECT","MS_MANIPULATION_STATE_SELECTING","MS_MANIPULATION_STATE_STOPPED","MS_MEDIA_ERR_ENCRYPTED","MS_MEDIA_KEYERR_CLIENT","MS_MEDIA_KEYERR_DOMAIN","MS_MEDIA_KEYERR_HARDWARECHANGE","MS_MEDIA_KEYERR_OUTPUT","MS_MEDIA_KEYERR_SERVICE","MS_MEDIA_KEYERR_UNKNOWN","Map","Math","MathMLElement","MediaCapabilities","MediaCapabilitiesInfo","MediaController","MediaDeviceInfo","MediaDevices","MediaElementAudioSourceNode","MediaEncryptedEvent","MediaError","MediaKeyError","MediaKeyEvent","MediaKeyMessageEvent","MediaKeyNeededEvent","MediaKeySession","MediaKeyStatusMap","MediaKeySystemAccess","MediaKeys","MediaList","MediaMetadata","MediaQueryList","MediaQueryListEvent","MediaRecorder","MediaRecorderErrorEvent","MediaSession","MediaSettingsRange","MediaSource","MediaStream","MediaStreamAudioDestinationNode","MediaStreamAudioSourceNode","MediaStreamEvent","MediaStreamTrack","MediaStreamTrackAudioSourceNode","MediaStreamTrackEvent","Memory","MessageChannel","MessageEvent","MessagePort","Methods","MimeType","MimeTypeArray","Module","MouseEvent","MouseScrollEvent","MozAnimation","MozAnimationDelay","MozAnimationDirection","MozAnimationDuration","MozAnimationFillMode","MozAnimationIterationCount","MozAnimationName","MozAnimationPlayState","MozAnimationTimingFunction","MozAppearance","MozBackfaceVisibility","MozBinding","MozBorderBottomColors","MozBorderEnd","MozBorderEndColor","MozBorderEndStyle","MozBorderEndWidth","MozBorderImage","MozBorderLeftColors","MozBorderRightColors","MozBorderStart","MozBorderStartColor","MozBorderStartStyle","MozBorderStartWidth","MozBorderTopColors","MozBoxAlign","MozBoxDirection","MozBoxFlex","MozBoxOrdinalGroup","MozBoxOrient","MozBoxPack","MozBoxSizing","MozCSSKeyframeRule","MozCSSKeyframesRule","MozColumnCount","MozColumnFill","MozColumnGap","MozColumnRule","MozColumnRuleColor","MozColumnRuleStyle","MozColumnRuleWidth","MozColumnWidth","MozColumns","MozContactChangeEvent","MozFloatEdge","MozFontFeatureSettings","MozFontLanguageOverride","MozForceBrokenImageIcon","MozHyphens","MozImageRegion","MozMarginEnd","MozMarginStart","MozMmsEvent","MozMmsMessage","MozMobileMessageThread","MozOSXFontSmoothing","MozOrient","MozOsxFontSmoothing","MozOutlineRadius","MozOutlineRadiusBottomleft","MozOutlineRadiusBottomright","MozOutlineRadiusTopleft","MozOutlineRadiusTopright","MozPaddingEnd","MozPaddingStart","MozPerspective","MozPerspectiveOrigin","MozPowerManager","MozSettingsEvent","MozSmsEvent","MozSmsMessage","MozStackSizing","MozTabSize","MozTextAlignLast","MozTextDecorationColor","MozTextDecorationLine","MozTextDecorationStyle","MozTextSizeAdjust","MozTransform","MozTransformOrigin","MozTransformStyle","MozTransition","MozTransitionDelay","MozTransitionDuration","MozTransitionProperty","MozTransitionTimingFunction","MozUserFocus","MozUserInput","MozUserModify","MozUserSelect","MozWindowDragging","MozWindowShadow","MutationEvent","MutationObserver","MutationRecord","NAMESPACE_ERR","NAMESPACE_RULE","NEAREST","NEAREST_MIPMAP_LINEAR","NEAREST_MIPMAP_NEAREST","NEGATIVE_INFINITY","NETWORK_EMPTY","NETWORK_ERR","NETWORK_IDLE","NETWORK_LOADED","NETWORK_LOADING","NETWORK_NO_SOURCE","NEVER","NEW","NEXT","NEXT_NO_DUPLICATE","NICEST","NODE_AFTER","NODE_BEFORE","NODE_BEFORE_AND_AFTER","NODE_INSIDE","NONE","NON_TRANSIENT_ERR","NOTATION_NODE","NOTCH","NOTEQUAL","NOT_ALLOWED_ERR","NOT_FOUND_ERR","NOT_READABLE_ERR","NOT_SUPPORTED_ERR","NO_DATA_ALLOWED_ERR","NO_ERR","NO_ERROR","NO_MODIFICATION_ALLOWED_ERR","NUMBER_TYPE","NUM_COMPRESSED_TEXTURE_FORMATS","NaN","NamedNodeMap","NavigationPreloadManager","Navigator","NearbyLinks","NetworkInformation","Node","NodeFilter","NodeIterator","NodeList","Notation","Notification","NotifyPaintEvent","Number","NumberFormat","OBJECT_TYPE","OBSOLETE","OK","ONE","ONE_MINUS_CONSTANT_ALPHA","ONE_MINUS_CONSTANT_COLOR","ONE_MINUS_DST_ALPHA","ONE_MINUS_DST_COLOR","ONE_MINUS_SRC_ALPHA","ONE_MINUS_SRC_COLOR","OPEN","OPENED","OPENING","ORDERED_NODE_ITERATOR_TYPE","ORDERED_NODE_SNAPSHOT_TYPE","OTHER_ERROR","OUT_OF_MEMORY","Object","OfflineAudioCompletionEvent","OfflineAudioContext","OfflineResourceList","OffscreenCanvas","OffscreenCanvasRenderingContext2D","Option","OrientationSensor","OscillatorNode","OverconstrainedError","OverflowEvent","PACK_ALIGNMENT","PACK_ROW_LENGTH","PACK_SKIP_PIXELS","PACK_SKIP_ROWS","PAGE_RULE","PARSE_ERR","PATHSEG_ARC_ABS","PATHSEG_ARC_REL","PATHSEG_CLOSEPATH","PATHSEG_CURVETO_CUBIC_ABS","PATHSEG_CURVETO_CUBIC_REL","PATHSEG_CURVETO_CUBIC_SMOOTH_ABS","PATHSEG_CURVETO_CUBIC_SMOOTH_REL","PATHSEG_CURVETO_QUADRATIC_ABS","PATHSEG_CURVETO_QUADRATIC_REL","PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS","PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL","PATHSEG_LINETO_ABS","PATHSEG_LINETO_HORIZONTAL_ABS","PATHSEG_LINETO_HORIZONTAL_REL","PATHSEG_LINETO_REL","PATHSEG_LINETO_VERTICAL_ABS","PATHSEG_LINETO_VERTICAL_REL","PATHSEG_MOVETO_ABS","PATHSEG_MOVETO_REL","PATHSEG_UNKNOWN","PATH_EXISTS_ERR","PEAKING","PERMISSION_DENIED","PERSISTENT","PI","PIXEL_PACK_BUFFER","PIXEL_PACK_BUFFER_BINDING","PIXEL_UNPACK_BUFFER","PIXEL_UNPACK_BUFFER_BINDING","PLAYING_STATE","POINTS","POLYGON_OFFSET_FACTOR","POLYGON_OFFSET_FILL","POLYGON_OFFSET_UNITS","POSITION_UNAVAILABLE","POSITIVE_INFINITY","PREV","PREV_NO_DUPLICATE","PROCESSING_INSTRUCTION_NODE","PageChangeEvent","PageTransitionEvent","PaintRequest","PaintRequestList","PannerNode","PasswordCredential","Path2D","PaymentAddress","PaymentInstruments","PaymentManager","PaymentMethodChangeEvent","PaymentRequest","PaymentRequestUpdateEvent","PaymentResponse","Performance","PerformanceElementTiming","PerformanceEntry","PerformanceEventTiming","PerformanceLongTaskTiming","PerformanceMark","PerformanceMeasure","PerformanceNavigation","PerformanceNavigationTiming","PerformanceObserver","PerformanceObserverEntryList","PerformancePaintTiming","PerformanceResourceTiming","PerformanceServerTiming","PerformanceTiming","PeriodicSyncManager","PeriodicWave","PermissionStatus","Permissions","PhotoCapabilities","PictureInPictureWindow","Plugin","PluginArray","PluralRules","PointerEvent","PopStateEvent","PopupBlockedEvent","Presentation","PresentationAvailability","PresentationConnection","PresentationConnectionAvailableEvent","PresentationConnectionCloseEvent","PresentationConnectionList","PresentationReceiver","PresentationRequest","ProcessingInstruction","ProgressEvent","Promise","PromiseRejectionEvent","PropertyNodeList","Proxy","PublicKeyCredential","PushManager","PushSubscription","PushSubscriptionOptions","Q","QUERY_RESULT","QUERY_RESULT_AVAILABLE","QUOTA_ERR","QUOTA_EXCEEDED_ERR","QueryInterface","R11F_G11F_B10F","R16F","R16I","R16UI","R32F","R32I","R32UI","R8","R8I","R8UI","R8_SNORM","RASTERIZER_DISCARD","READ_BUFFER","READ_FRAMEBUFFER","READ_FRAMEBUFFER_BINDING","READ_ONLY","READ_ONLY_ERR","READ_WRITE","RED","RED_BITS","RED_INTEGER","REMOVAL","RENDERBUFFER","RENDERBUFFER_ALPHA_SIZE","RENDERBUFFER_BINDING","RENDERBUFFER_BLUE_SIZE","RENDERBUFFER_DEPTH_SIZE","RENDERBUFFER_GREEN_SIZE","RENDERBUFFER_HEIGHT","RENDERBUFFER_INTERNAL_FORMAT","RENDERBUFFER_RED_SIZE","RENDERBUFFER_SAMPLES","RENDERBUFFER_STENCIL_SIZE","RENDERBUFFER_WIDTH","RENDERER","RENDERING_INTENT_ABSOLUTE_COLORIMETRIC","RENDERING_INTENT_AUTO","RENDERING_INTENT_PERCEPTUAL","RENDERING_INTENT_RELATIVE_COLORIMETRIC","RENDERING_INTENT_SATURATION","RENDERING_INTENT_UNKNOWN","REPEAT","REPLACE","RG","RG16F","RG16I","RG16UI","RG32F","RG32I","RG32UI","RG8","RG8I","RG8UI","RG8_SNORM","RGB","RGB10_A2","RGB10_A2UI","RGB16F","RGB16I","RGB16UI","RGB32F","RGB32I","RGB32UI","RGB565","RGB5_A1","RGB8","RGB8I","RGB8UI","RGB8_SNORM","RGB9_E5","RGBA","RGBA16F","RGBA16I","RGBA16UI","RGBA32F","RGBA32I","RGBA32UI","RGBA4","RGBA8","RGBA8I","RGBA8UI","RGBA8_SNORM","RGBA_INTEGER","RGBColor","RGB_INTEGER","RG_INTEGER","ROTATION_CLOCKWISE","ROTATION_COUNTERCLOCKWISE","RTCCertificate","RTCDTMFSender","RTCDTMFToneChangeEvent","RTCDataChannel","RTCDataChannelEvent","RTCDtlsTransport","RTCError","RTCErrorEvent","RTCIceCandidate","RTCIceTransport","RTCPeerConnection","RTCPeerConnectionIceErrorEvent","RTCPeerConnectionIceEvent","RTCRtpReceiver","RTCRtpSender","RTCRtpTransceiver","RTCSctpTransport","RTCSessionDescription","RTCStatsReport","RTCTrackEvent","RadioNodeList","Range","RangeError","RangeException","ReadableStream","ReadableStreamDefaultReader","RecordErrorEvent","Rect","ReferenceError","Reflect","RegExp","RelativeOrientationSensor","RelativeTimeFormat","RemotePlayback","Report","ReportBody","ReportingObserver","Request","ResizeObserver","ResizeObserverEntry","ResizeObserverSize","Response","RuntimeError","SAMPLER_2D","SAMPLER_2D_ARRAY","SAMPLER_2D_ARRAY_SHADOW","SAMPLER_2D_SHADOW","SAMPLER_3D","SAMPLER_BINDING","SAMPLER_CUBE","SAMPLER_CUBE_SHADOW","SAMPLES","SAMPLE_ALPHA_TO_COVERAGE","SAMPLE_BUFFERS","SAMPLE_COVERAGE","SAMPLE_COVERAGE_INVERT","SAMPLE_COVERAGE_VALUE","SAWTOOTH","SCHEDULED_STATE","SCISSOR_BOX","SCISSOR_TEST","SCROLL_PAGE_DOWN","SCROLL_PAGE_UP","SDP_ANSWER","SDP_OFFER","SDP_PRANSWER","SECURITY_ERR","SELECT","SEPARATE_ATTRIBS","SERIALIZE_ERR","SEVERITY_ERROR","SEVERITY_FATAL_ERROR","SEVERITY_WARNING","SHADER_COMPILER","SHADER_TYPE","SHADING_LANGUAGE_VERSION","SHIFT_MASK","SHORT","SHOWING","SHOW_ALL","SHOW_ATTRIBUTE","SHOW_CDATA_SECTION","SHOW_COMMENT","SHOW_DOCUMENT","SHOW_DOCUMENT_FRAGMENT","SHOW_DOCUMENT_TYPE","SHOW_ELEMENT","SHOW_ENTITY","SHOW_ENTITY_REFERENCE","SHOW_NOTATION","SHOW_PROCESSING_INSTRUCTION","SHOW_TEXT","SIGNALED","SIGNED_NORMALIZED","SINE","SOUNDFIELD","SQLException","SQRT1_2","SQRT2","SQUARE","SRC_ALPHA","SRC_ALPHA_SATURATE","SRC_COLOR","SRGB","SRGB8","SRGB8_ALPHA8","START_TO_END","START_TO_START","STATIC_COPY","STATIC_DRAW","STATIC_READ","STENCIL","STENCIL_ATTACHMENT","STENCIL_BACK_FAIL","STENCIL_BACK_FUNC","STENCIL_BACK_PASS_DEPTH_FAIL","STENCIL_BACK_PASS_DEPTH_PASS","STENCIL_BACK_REF","STENCIL_BACK_VALUE_MASK","STENCIL_BACK_WRITEMASK","STENCIL_BITS","STENCIL_BUFFER_BIT","STENCIL_CLEAR_VALUE","STENCIL_FAIL","STENCIL_FUNC","STENCIL_INDEX","STENCIL_INDEX8","STENCIL_PASS_DEPTH_FAIL","STENCIL_PASS_DEPTH_PASS","STENCIL_REF","STENCIL_TEST","STENCIL_VALUE_MASK","STENCIL_WRITEMASK","STREAM_COPY","STREAM_DRAW","STREAM_READ","STRING_TYPE","STYLE_RULE","SUBPIXEL_BITS","SUPPORTS_RULE","SVGAElement","SVGAltGlyphDefElement","SVGAltGlyphElement","SVGAltGlyphItemElement","SVGAngle","SVGAnimateColorElement","SVGAnimateElement","SVGAnimateMotionElement","SVGAnimateTransformElement","SVGAnimatedAngle","SVGAnimatedBoolean","SVGAnimatedEnumeration","SVGAnimatedInteger","SVGAnimatedLength","SVGAnimatedLengthList","SVGAnimatedNumber","SVGAnimatedNumberList","SVGAnimatedPreserveAspectRatio","SVGAnimatedRect","SVGAnimatedString","SVGAnimatedTransformList","SVGAnimationElement","SVGCircleElement","SVGClipPathElement","SVGColor","SVGComponentTransferFunctionElement","SVGCursorElement","SVGDefsElement","SVGDescElement","SVGDiscardElement","SVGDocument","SVGElement","SVGElementInstance","SVGElementInstanceList","SVGEllipseElement","SVGException","SVGFEBlendElement","SVGFEColorMatrixElement","SVGFEComponentTransferElement","SVGFECompositeElement","SVGFEConvolveMatrixElement","SVGFEDiffuseLightingElement","SVGFEDisplacementMapElement","SVGFEDistantLightElement","SVGFEDropShadowElement","SVGFEFloodElement","SVGFEFuncAElement","SVGFEFuncBElement","SVGFEFuncGElement","SVGFEFuncRElement","SVGFEGaussianBlurElement","SVGFEImageElement","SVGFEMergeElement","SVGFEMergeNodeElement","SVGFEMorphologyElement","SVGFEOffsetElement","SVGFEPointLightElement","SVGFESpecularLightingElement","SVGFESpotLightElement","SVGFETileElement","SVGFETurbulenceElement","SVGFilterElement","SVGFontElement","SVGFontFaceElement","SVGFontFaceFormatElement","SVGFontFaceNameElement","SVGFontFaceSrcElement","SVGFontFaceUriElement","SVGForeignObjectElement","SVGGElement","SVGGeometryElement","SVGGlyphElement","SVGGlyphRefElement","SVGGradientElement","SVGGraphicsElement","SVGHKernElement","SVGImageElement","SVGLength","SVGLengthList","SVGLineElement","SVGLinearGradientElement","SVGMPathElement","SVGMarkerElement","SVGMaskElement","SVGMatrix","SVGMetadataElement","SVGMissingGlyphElement","SVGNumber","SVGNumberList","SVGPaint","SVGPathElement","SVGPathSeg","SVGPathSegArcAbs","SVGPathSegArcRel","SVGPathSegClosePath","SVGPathSegCurvetoCubicAbs","SVGPathSegCurvetoCubicRel","SVGPathSegCurvetoCubicSmoothAbs","SVGPathSegCurvetoCubicSmoothRel","SVGPathSegCurvetoQuadraticAbs","SVGPathSegCurvetoQuadraticRel","SVGPathSegCurvetoQuadraticSmoothAbs","SVGPathSegCurvetoQuadraticSmoothRel","SVGPathSegLinetoAbs","SVGPathSegLinetoHorizontalAbs","SVGPathSegLinetoHorizontalRel","SVGPathSegLinetoRel","SVGPathSegLinetoVerticalAbs","SVGPathSegLinetoVerticalRel","SVGPathSegList","SVGPathSegMovetoAbs","SVGPathSegMovetoRel","SVGPatternElement","SVGPoint","SVGPointList","SVGPolygonElement","SVGPolylineElement","SVGPreserveAspectRatio","SVGRadialGradientElement","SVGRect","SVGRectElement","SVGRenderingIntent","SVGSVGElement","SVGScriptElement","SVGSetElement","SVGStopElement","SVGStringList","SVGStyleElement","SVGSwitchElement","SVGSymbolElement","SVGTRefElement","SVGTSpanElement","SVGTextContentElement","SVGTextElement","SVGTextPathElement","SVGTextPositioningElement","SVGTitleElement","SVGTransform","SVGTransformList","SVGUnitTypes","SVGUseElement","SVGVKernElement","SVGViewElement","SVGViewSpec","SVGZoomAndPan","SVGZoomEvent","SVG_ANGLETYPE_DEG","SVG_ANGLETYPE_GRAD","SVG_ANGLETYPE_RAD","SVG_ANGLETYPE_UNKNOWN","SVG_ANGLETYPE_UNSPECIFIED","SVG_CHANNEL_A","SVG_CHANNEL_B","SVG_CHANNEL_G","SVG_CHANNEL_R","SVG_CHANNEL_UNKNOWN","SVG_COLORTYPE_CURRENTCOLOR","SVG_COLORTYPE_RGBCOLOR","SVG_COLORTYPE_RGBCOLOR_ICCCOLOR","SVG_COLORTYPE_UNKNOWN","SVG_EDGEMODE_DUPLICATE","SVG_EDGEMODE_NONE","SVG_EDGEMODE_UNKNOWN","SVG_EDGEMODE_WRAP","SVG_FEBLEND_MODE_COLOR","SVG_FEBLEND_MODE_COLOR_BURN","SVG_FEBLEND_MODE_COLOR_DODGE","SVG_FEBLEND_MODE_DARKEN","SVG_FEBLEND_MODE_DIFFERENCE","SVG_FEBLEND_MODE_EXCLUSION","SVG_FEBLEND_MODE_HARD_LIGHT","SVG_FEBLEND_MODE_HUE","SVG_FEBLEND_MODE_LIGHTEN","SVG_FEBLEND_MODE_LUMINOSITY","SVG_FEBLEND_MODE_MULTIPLY","SVG_FEBLEND_MODE_NORMAL","SVG_FEBLEND_MODE_OVERLAY","SVG_FEBLEND_MODE_SATURATION","SVG_FEBLEND_MODE_SCREEN","SVG_FEBLEND_MODE_SOFT_LIGHT","SVG_FEBLEND_MODE_UNKNOWN","SVG_FECOLORMATRIX_TYPE_HUEROTATE","SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA","SVG_FECOLORMATRIX_TYPE_MATRIX","SVG_FECOLORMATRIX_TYPE_SATURATE","SVG_FECOLORMATRIX_TYPE_UNKNOWN","SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE","SVG_FECOMPONENTTRANSFER_TYPE_GAMMA","SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY","SVG_FECOMPONENTTRANSFER_TYPE_LINEAR","SVG_FECOMPONENTTRANSFER_TYPE_TABLE","SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN","SVG_FECOMPOSITE_OPERATOR_ARITHMETIC","SVG_FECOMPOSITE_OPERATOR_ATOP","SVG_FECOMPOSITE_OPERATOR_IN","SVG_FECOMPOSITE_OPERATOR_OUT","SVG_FECOMPOSITE_OPERATOR_OVER","SVG_FECOMPOSITE_OPERATOR_UNKNOWN","SVG_FECOMPOSITE_OPERATOR_XOR","SVG_INVALID_VALUE_ERR","SVG_LENGTHTYPE_CM","SVG_LENGTHTYPE_EMS","SVG_LENGTHTYPE_EXS","SVG_LENGTHTYPE_IN","SVG_LENGTHTYPE_MM","SVG_LENGTHTYPE_NUMBER","SVG_LENGTHTYPE_PC","SVG_LENGTHTYPE_PERCENTAGE","SVG_LENGTHTYPE_PT","SVG_LENGTHTYPE_PX","SVG_LENGTHTYPE_UNKNOWN","SVG_MARKERUNITS_STROKEWIDTH","SVG_MARKERUNITS_UNKNOWN","SVG_MARKERUNITS_USERSPACEONUSE","SVG_MARKER_ORIENT_ANGLE","SVG_MARKER_ORIENT_AUTO","SVG_MARKER_ORIENT_UNKNOWN","SVG_MASKTYPE_ALPHA","SVG_MASKTYPE_LUMINANCE","SVG_MATRIX_NOT_INVERTABLE","SVG_MEETORSLICE_MEET","SVG_MEETORSLICE_SLICE","SVG_MEETORSLICE_UNKNOWN","SVG_MORPHOLOGY_OPERATOR_DILATE","SVG_MORPHOLOGY_OPERATOR_ERODE","SVG_MORPHOLOGY_OPERATOR_UNKNOWN","SVG_PAINTTYPE_CURRENTCOLOR","SVG_PAINTTYPE_NONE","SVG_PAINTTYPE_RGBCOLOR","SVG_PAINTTYPE_RGBCOLOR_ICCCOLOR","SVG_PAINTTYPE_UNKNOWN","SVG_PAINTTYPE_URI","SVG_PAINTTYPE_URI_CURRENTCOLOR","SVG_PAINTTYPE_URI_NONE","SVG_PAINTTYPE_URI_RGBCOLOR","SVG_PAINTTYPE_URI_RGBCOLOR_ICCCOLOR","SVG_PRESERVEASPECTRATIO_NONE","SVG_PRESERVEASPECTRATIO_UNKNOWN","SVG_PRESERVEASPECTRATIO_XMAXYMAX","SVG_PRESERVEASPECTRATIO_XMAXYMID","SVG_PRESERVEASPECTRATIO_XMAXYMIN","SVG_PRESERVEASPECTRATIO_XMIDYMAX","SVG_PRESERVEASPECTRATIO_XMIDYMID","SVG_PRESERVEASPECTRATIO_XMIDYMIN","SVG_PRESERVEASPECTRATIO_XMINYMAX","SVG_PRESERVEASPECTRATIO_XMINYMID","SVG_PRESERVEASPECTRATIO_XMINYMIN","SVG_SPREADMETHOD_PAD","SVG_SPREADMETHOD_REFLECT","SVG_SPREADMETHOD_REPEAT","SVG_SPREADMETHOD_UNKNOWN","SVG_STITCHTYPE_NOSTITCH","SVG_STITCHTYPE_STITCH","SVG_STITCHTYPE_UNKNOWN","SVG_TRANSFORM_MATRIX","SVG_TRANSFORM_ROTATE","SVG_TRANSFORM_SCALE","SVG_TRANSFORM_SKEWX","SVG_TRANSFORM_SKEWY","SVG_TRANSFORM_TRANSLATE","SVG_TRANSFORM_UNKNOWN","SVG_TURBULENCE_TYPE_FRACTALNOISE","SVG_TURBULENCE_TYPE_TURBULENCE","SVG_TURBULENCE_TYPE_UNKNOWN","SVG_UNIT_TYPE_OBJECTBOUNDINGBOX","SVG_UNIT_TYPE_UNKNOWN","SVG_UNIT_TYPE_USERSPACEONUSE","SVG_WRONG_TYPE_ERR","SVG_ZOOMANDPAN_DISABLE","SVG_ZOOMANDPAN_MAGNIFY","SVG_ZOOMANDPAN_UNKNOWN","SYNC_CONDITION","SYNC_FENCE","SYNC_FLAGS","SYNC_FLUSH_COMMANDS_BIT","SYNC_GPU_COMMANDS_COMPLETE","SYNC_STATUS","SYNTAX_ERR","SavedPages","Screen","ScreenOrientation","Script","ScriptProcessorNode","ScrollAreaEvent","SecurityPolicyViolationEvent","Selection","Sensor","SensorErrorEvent","ServiceWorker","ServiceWorkerContainer","ServiceWorkerRegistration","SessionDescription","Set","ShadowRoot","SharedArrayBuffer","SharedWorker","SimpleGestureEvent","SourceBuffer","SourceBufferList","SpeechSynthesis","SpeechSynthesisErrorEvent","SpeechSynthesisEvent","SpeechSynthesisUtterance","SpeechSynthesisVoice","StaticRange","StereoPannerNode","StopIteration","Storage","StorageEvent","StorageManager","String","StructType","StylePropertyMap","StylePropertyMapReadOnly","StyleSheet","StyleSheetList","SubmitEvent","SubtleCrypto","Symbol","SyncManager","SyntaxError","TEMPORARY","TEXTPATH_METHODTYPE_ALIGN","TEXTPATH_METHODTYPE_STRETCH","TEXTPATH_METHODTYPE_UNKNOWN","TEXTPATH_SPACINGTYPE_AUTO","TEXTPATH_SPACINGTYPE_EXACT","TEXTPATH_SPACINGTYPE_UNKNOWN","TEXTURE","TEXTURE0","TEXTURE1","TEXTURE10","TEXTURE11","TEXTURE12","TEXTURE13","TEXTURE14","TEXTURE15","TEXTURE16","TEXTURE17","TEXTURE18","TEXTURE19","TEXTURE2","TEXTURE20","TEXTURE21","TEXTURE22","TEXTURE23","TEXTURE24","TEXTURE25","TEXTURE26","TEXTURE27","TEXTURE28","TEXTURE29","TEXTURE3","TEXTURE30","TEXTURE31","TEXTURE4","TEXTURE5","TEXTURE6","TEXTURE7","TEXTURE8","TEXTURE9","TEXTURE_2D","TEXTURE_2D_ARRAY","TEXTURE_3D","TEXTURE_BASE_LEVEL","TEXTURE_BINDING_2D","TEXTURE_BINDING_2D_ARRAY","TEXTURE_BINDING_3D","TEXTURE_BINDING_CUBE_MAP","TEXTURE_COMPARE_FUNC","TEXTURE_COMPARE_MODE","TEXTURE_CUBE_MAP","TEXTURE_CUBE_MAP_NEGATIVE_X","TEXTURE_CUBE_MAP_NEGATIVE_Y","TEXTURE_CUBE_MAP_NEGATIVE_Z","TEXTURE_CUBE_MAP_POSITIVE_X","TEXTURE_CUBE_MAP_POSITIVE_Y","TEXTURE_CUBE_MAP_POSITIVE_Z","TEXTURE_IMMUTABLE_FORMAT","TEXTURE_IMMUTABLE_LEVELS","TEXTURE_MAG_FILTER","TEXTURE_MAX_ANISOTROPY_EXT","TEXTURE_MAX_LEVEL","TEXTURE_MAX_LOD","TEXTURE_MIN_FILTER","TEXTURE_MIN_LOD","TEXTURE_WRAP_R","TEXTURE_WRAP_S","TEXTURE_WRAP_T","TEXT_NODE","TIMEOUT","TIMEOUT_ERR","TIMEOUT_EXPIRED","TIMEOUT_IGNORED","TOO_LARGE_ERR","TRANSACTION_INACTIVE_ERR","TRANSFORM_FEEDBACK","TRANSFORM_FEEDBACK_ACTIVE","TRANSFORM_FEEDBACK_BINDING","TRANSFORM_FEEDBACK_BUFFER","TRANSFORM_FEEDBACK_BUFFER_BINDING","TRANSFORM_FEEDBACK_BUFFER_MODE","TRANSFORM_FEEDBACK_BUFFER_SIZE","TRANSFORM_FEEDBACK_BUFFER_START","TRANSFORM_FEEDBACK_PAUSED","TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN","TRANSFORM_FEEDBACK_VARYINGS","TRIANGLE","TRIANGLES","TRIANGLE_FAN","TRIANGLE_STRIP","TYPE_BACK_FORWARD","TYPE_ERR","TYPE_MISMATCH_ERR","TYPE_NAVIGATE","TYPE_RELOAD","TYPE_RESERVED","Table","TaskAttributionTiming","Text","TextDecoder","TextDecoderStream","TextEncoder","TextEncoderStream","TextEvent","TextMetrics","TextTrack","TextTrackCue","TextTrackCueList","TextTrackList","TimeEvent","TimeRanges","Touch","TouchEvent","TouchList","TrackEvent","TransformStream","TransitionEvent","TreeWalker","TrustedHTML","TrustedScript","TrustedScriptURL","TrustedTypePolicy","TrustedTypePolicyFactory","TypeError","TypedObject","U2F","UIEvent","UNCACHED","UNIFORM_ARRAY_STRIDE","UNIFORM_BLOCK_ACTIVE_UNIFORMS","UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES","UNIFORM_BLOCK_BINDING","UNIFORM_BLOCK_DATA_SIZE","UNIFORM_BLOCK_INDEX","UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER","UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER","UNIFORM_BUFFER","UNIFORM_BUFFER_BINDING","UNIFORM_BUFFER_OFFSET_ALIGNMENT","UNIFORM_BUFFER_SIZE","UNIFORM_BUFFER_START","UNIFORM_IS_ROW_MAJOR","UNIFORM_MATRIX_STRIDE","UNIFORM_OFFSET","UNIFORM_SIZE","UNIFORM_TYPE","UNKNOWN_ERR","UNKNOWN_RULE","UNMASKED_RENDERER_WEBGL","UNMASKED_VENDOR_WEBGL","UNORDERED_NODE_ITERATOR_TYPE","UNORDERED_NODE_SNAPSHOT_TYPE","UNPACK_ALIGNMENT","UNPACK_COLORSPACE_CONVERSION_WEBGL","UNPACK_FLIP_Y_WEBGL","UNPACK_IMAGE_HEIGHT","UNPACK_PREMULTIPLY_ALPHA_WEBGL","UNPACK_ROW_LENGTH","UNPACK_SKIP_IMAGES","UNPACK_SKIP_PIXELS","UNPACK_SKIP_ROWS","UNSCHEDULED_STATE","UNSENT","UNSIGNALED","UNSIGNED_BYTE","UNSIGNED_INT","UNSIGNED_INT_10F_11F_11F_REV","UNSIGNED_INT_24_8","UNSIGNED_INT_2_10_10_10_REV","UNSIGNED_INT_5_9_9_9_REV","UNSIGNED_INT_SAMPLER_2D","UNSIGNED_INT_SAMPLER_2D_ARRAY","UNSIGNED_INT_SAMPLER_3D","UNSIGNED_INT_SAMPLER_CUBE","UNSIGNED_INT_VEC2","UNSIGNED_INT_VEC3","UNSIGNED_INT_VEC4","UNSIGNED_NORMALIZED","UNSIGNED_SHORT","UNSIGNED_SHORT_4_4_4_4","UNSIGNED_SHORT_5_5_5_1","UNSIGNED_SHORT_5_6_5","UNSPECIFIED_EVENT_TYPE_ERR","UPDATEREADY","URIError","URL","URLSearchParams","URLUnencoded","URL_MISMATCH_ERR","USB","USBAlternateInterface","USBConfiguration","USBConnectionEvent","USBDevice","USBEndpoint","USBInTransferResult","USBInterface","USBIsochronousInTransferPacket","USBIsochronousInTransferResult","USBIsochronousOutTransferPacket","USBIsochronousOutTransferResult","USBOutTransferResult","UTC","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray","UserActivation","UserMessageHandler","UserMessageHandlersNamespace","UserProximityEvent","VALIDATE_STATUS","VALIDATION_ERR","VARIABLES_RULE","VENDOR","VERSION","VERSION_CHANGE","VERSION_ERR","VERTEX_ARRAY_BINDING","VERTEX_ATTRIB_ARRAY_BUFFER_BINDING","VERTEX_ATTRIB_ARRAY_DIVISOR","VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE","VERTEX_ATTRIB_ARRAY_ENABLED","VERTEX_ATTRIB_ARRAY_INTEGER","VERTEX_ATTRIB_ARRAY_NORMALIZED","VERTEX_ATTRIB_ARRAY_POINTER","VERTEX_ATTRIB_ARRAY_SIZE","VERTEX_ATTRIB_ARRAY_STRIDE","VERTEX_ATTRIB_ARRAY_TYPE","VERTEX_SHADER","VERTICAL","VERTICAL_AXIS","VER_ERR","VIEWPORT","VIEWPORT_RULE","VRDisplay","VRDisplayCapabilities","VRDisplayEvent","VREyeParameters","VRFieldOfView","VRFrameData","VRPose","VRStageParameters","VTTCue","VTTRegion","ValidityState","VideoPlaybackQuality","VideoStreamTrack","VisualViewport","WAIT_FAILED","WEBKIT_FILTER_RULE","WEBKIT_KEYFRAMES_RULE","WEBKIT_KEYFRAME_RULE","WEBKIT_REGION_RULE","WRONG_DOCUMENT_ERR","WakeLock","WakeLockSentinel","WasmAnyRef","WaveShaperNode","WeakMap","WeakRef","WeakSet","WebAssembly","WebGL2RenderingContext","WebGLActiveInfo","WebGLBuffer","WebGLContextEvent","WebGLFramebuffer","WebGLProgram","WebGLQuery","WebGLRenderbuffer","WebGLRenderingContext","WebGLSampler","WebGLShader","WebGLShaderPrecisionFormat","WebGLSync","WebGLTexture","WebGLTransformFeedback","WebGLUniformLocation","WebGLVertexArray","WebGLVertexArrayObject","WebKitAnimationEvent","WebKitBlobBuilder","WebKitCSSFilterRule","WebKitCSSFilterValue","WebKitCSSKeyframeRule","WebKitCSSKeyframesRule","WebKitCSSMatrix","WebKitCSSRegionRule","WebKitCSSTransformValue","WebKitDataCue","WebKitGamepad","WebKitMediaKeyError","WebKitMediaKeyMessageEvent","WebKitMediaKeySession","WebKitMediaKeys","WebKitMediaSource","WebKitMutationObserver","WebKitNamespace","WebKitPlaybackTargetAvailabilityEvent","WebKitPoint","WebKitShadowRoot","WebKitSourceBuffer","WebKitSourceBufferList","WebKitTransitionEvent","WebSocket","WebkitAlignContent","WebkitAlignItems","WebkitAlignSelf","WebkitAnimation","WebkitAnimationDelay","WebkitAnimationDirection","WebkitAnimationDuration","WebkitAnimationFillMode","WebkitAnimationIterationCount","WebkitAnimationName","WebkitAnimationPlayState","WebkitAnimationTimingFunction","WebkitAppearance","WebkitBackfaceVisibility","WebkitBackgroundClip","WebkitBackgroundOrigin","WebkitBackgroundSize","WebkitBorderBottomLeftRadius","WebkitBorderBottomRightRadius","WebkitBorderImage","WebkitBorderRadius","WebkitBorderTopLeftRadius","WebkitBorderTopRightRadius","WebkitBoxAlign","WebkitBoxDirection","WebkitBoxFlex","WebkitBoxOrdinalGroup","WebkitBoxOrient","WebkitBoxPack","WebkitBoxShadow","WebkitBoxSizing","WebkitFilter","WebkitFlex","WebkitFlexBasis","WebkitFlexDirection","WebkitFlexFlow","WebkitFlexGrow","WebkitFlexShrink","WebkitFlexWrap","WebkitJustifyContent","WebkitLineClamp","WebkitMask","WebkitMaskClip","WebkitMaskComposite","WebkitMaskImage","WebkitMaskOrigin","WebkitMaskPosition","WebkitMaskPositionX","WebkitMaskPositionY","WebkitMaskRepeat","WebkitMaskSize","WebkitOrder","WebkitPerspective","WebkitPerspectiveOrigin","WebkitTextFillColor","WebkitTextSizeAdjust","WebkitTextStroke","WebkitTextStrokeColor","WebkitTextStrokeWidth","WebkitTransform","WebkitTransformOrigin","WebkitTransformStyle","WebkitTransition","WebkitTransitionDelay","WebkitTransitionDuration","WebkitTransitionProperty","WebkitTransitionTimingFunction","WebkitUserSelect","WheelEvent","Window","Worker","Worklet","WritableStream","WritableStreamDefaultWriter","XMLDocument","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestException","XMLHttpRequestProgressEvent","XMLHttpRequestUpload","XMLSerializer","XMLStylesheetProcessingInstruction","XPathEvaluator","XPathException","XPathExpression","XPathNSResolver","XPathResult","XRBoundedReferenceSpace","XRDOMOverlayState","XRFrame","XRHitTestResult","XRHitTestSource","XRInputSource","XRInputSourceArray","XRInputSourceEvent","XRInputSourcesChangeEvent","XRLayer","XRPose","XRRay","XRReferenceSpace","XRReferenceSpaceEvent","XRRenderState","XRRigidTransform","XRSession","XRSessionEvent","XRSpace","XRSystem","XRTransientInputHitTestResult","XRTransientInputHitTestSource","XRView","XRViewerPose","XRViewport","XRWebGLLayer","XSLTProcessor","ZERO","_XD0M_","_YD0M_","__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__","__opera","__proto__","_browserjsran","a","aLink","abbr","abort","aborted","abs","absolute","acceleration","accelerationIncludingGravity","accelerator","accept","acceptCharset","acceptNode","accessKey","accessKeyLabel","accuracy","acos","acosh","action","actionURL","actions","activated","active","activeCues","activeElement","activeSourceBuffers","activeSourceCount","activeTexture","activeVRDisplays","actualBoundingBoxAscent","actualBoundingBoxDescent","actualBoundingBoxLeft","actualBoundingBoxRight","add","addAll","addBehavior","addCandidate","addColorStop","addCue","addElement","addEventListener","addFilter","addFromString","addFromUri","addIceCandidate","addImport","addListener","addModule","addNamed","addPageRule","addPath","addPointer","addRange","addRegion","addRule","addSearchEngine","addSourceBuffer","addStream","addTextTrack","addTrack","addTransceiver","addWakeLockListener","added","addedNodes","additionalName","additiveSymbols","addons","address","addressLine","adoptNode","adoptedStyleSheets","adr","advance","after","album","alert","algorithm","align","align-content","align-items","align-self","alignContent","alignItems","alignSelf","alignmentBaseline","alinkColor","all","allSettled","allow","allowFullscreen","allowPaymentRequest","allowedDirections","allowedFeatures","allowedToPlay","allowsFeature","alpha","alt","altGraphKey","altHtml","altKey","altLeft","alternate","alternateSetting","alternates","altitude","altitudeAccuracy","amplitude","ancestorOrigins","anchor","anchorNode","anchorOffset","anchors","and","angle","angularAcceleration","angularVelocity","animVal","animate","animatedInstanceRoot","animatedNormalizedPathSegList","animatedPathSegList","animatedPoints","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","animationDelay","animationDirection","animationDuration","animationFillMode","animationIterationCount","animationName","animationPlayState","animationStartTime","animationTimingFunction","animationsPaused","anniversary","antialias","anticipatedRemoval","any","app","appCodeName","appMinorVersion","appName","appNotifications","appVersion","appearance","append","appendBuffer","appendChild","appendData","appendItem","appendMedium","appendNamed","appendRule","appendStream","appendWindowEnd","appendWindowStart","applets","applicationCache","applicationServerKey","apply","applyConstraints","applyElement","arc","arcTo","archive","areas","arguments","ariaAtomic","ariaAutoComplete","ariaBusy","ariaChecked","ariaColCount","ariaColIndex","ariaColSpan","ariaCurrent","ariaDescription","ariaDisabled","ariaExpanded","ariaHasPopup","ariaHidden","ariaKeyShortcuts","ariaLabel","ariaLevel","ariaLive","ariaModal","ariaMultiLine","ariaMultiSelectable","ariaOrientation","ariaPlaceholder","ariaPosInSet","ariaPressed","ariaReadOnly","ariaRelevant","ariaRequired","ariaRoleDescription","ariaRowCount","ariaRowIndex","ariaRowSpan","ariaSelected","ariaSetSize","ariaSort","ariaValueMax","ariaValueMin","ariaValueNow","ariaValueText","arrayBuffer","artist","artwork","as","asIntN","asUintN","asin","asinh","assert","assign","assignedElements","assignedNodes","assignedSlot","async","asyncIterator","atEnd","atan","atan2","atanh","atob","attachEvent","attachInternals","attachShader","attachShadow","attachments","attack","attestationObject","attrChange","attrName","attributeFilter","attributeName","attributeNamespace","attributeOldValue","attributeStyleMap","attributes","attribution","audioBitsPerSecond","audioTracks","audioWorklet","authenticatedSignedWrites","authenticatorData","autoIncrement","autobuffer","autocapitalize","autocomplete","autocorrect","autofocus","automationRate","autoplay","availHeight","availLeft","availTop","availWidth","availability","available","aversion","ax","axes","axis","ay","azimuth","b","back","backface-visibility","backfaceVisibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","backgroundAttachment","backgroundBlendMode","backgroundClip","backgroundColor","backgroundFetch","backgroundImage","backgroundOrigin","backgroundPosition","backgroundPositionX","backgroundPositionY","backgroundRepeat","backgroundSize","badInput","badge","balance","baseFrequencyX","baseFrequencyY","baseLatency","baseLayer","baseNode","baseOffset","baseURI","baseVal","baselineShift","battery","bday","before","beginElement","beginElementAt","beginPath","beginQuery","beginTransformFeedback","behavior","behaviorCookie","behaviorPart","behaviorUrns","beta","bezierCurveTo","bgColor","bgProperties","bias","big","bigint64","biguint64","binaryType","bind","bindAttribLocation","bindBuffer","bindBufferBase","bindBufferRange","bindFramebuffer","bindRenderbuffer","bindSampler","bindTexture","bindTransformFeedback","bindVertexArray","blendColor","blendEquation","blendEquationSeparate","blendFunc","blendFuncSeparate","blink","blitFramebuffer","blob","block-size","blockDirection","blockSize","blockedURI","blue","bluetooth","blur","body","bodyUsed","bold","bookmarks","booleanValue","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","borderBlock","borderBlockColor","borderBlockEnd","borderBlockEndColor","borderBlockEndStyle","borderBlockEndWidth","borderBlockStart","borderBlockStartColor","borderBlockStartStyle","borderBlockStartWidth","borderBlockStyle","borderBlockWidth","borderBottom","borderBottomColor","borderBottomLeftRadius","borderBottomRightRadius","borderBottomStyle","borderBottomWidth","borderBoxSize","borderCollapse","borderColor","borderColorDark","borderColorLight","borderEndEndRadius","borderEndStartRadius","borderImage","borderImageOutset","borderImageRepeat","borderImageSlice","borderImageSource","borderImageWidth","borderInline","borderInlineColor","borderInlineEnd","borderInlineEndColor","borderInlineEndStyle","borderInlineEndWidth","borderInlineStart","borderInlineStartColor","borderInlineStartStyle","borderInlineStartWidth","borderInlineStyle","borderInlineWidth","borderLeft","borderLeftColor","borderLeftStyle","borderLeftWidth","borderRadius","borderRight","borderRightColor","borderRightStyle","borderRightWidth","borderSpacing","borderStartEndRadius","borderStartStartRadius","borderStyle","borderTop","borderTopColor","borderTopLeftRadius","borderTopRightRadius","borderTopStyle","borderTopWidth","borderWidth","bottom","bottomMargin","bound","boundElements","boundingClientRect","boundingHeight","boundingLeft","boundingTop","boundingWidth","bounds","boundsGeometry","box-decoration-break","box-shadow","box-sizing","boxDecorationBreak","boxShadow","boxSizing","break-after","break-before","break-inside","breakAfter","breakBefore","breakInside","broadcast","browserLanguage","btoa","bubbles","buffer","bufferData","bufferDepth","bufferSize","bufferSubData","buffered","bufferedAmount","bufferedAmountLowThreshold","buildID","buildNumber","button","buttonID","buttons","byteLength","byteOffset","bytesWritten","c","cache","caches","call","caller","canBeFormatted","canBeMounted","canBeShared","canHaveChildren","canHaveHTML","canInsertDTMF","canMakePayment","canPlayType","canPresent","canTrickleIceCandidates","cancel","cancelAndHoldAtTime","cancelAnimationFrame","cancelBubble","cancelIdleCallback","cancelScheduledValues","cancelVideoFrameCallback","cancelWatchAvailability","cancelable","candidate","canonicalUUID","canvas","capabilities","caption","caption-side","captionSide","capture","captureEvents","captureStackTrace","captureStream","caret-color","caretBidiLevel","caretColor","caretPositionFromPoint","caretRangeFromPoint","cast","catch","category","cbrt","cd","ceil","cellIndex","cellPadding","cellSpacing","cells","ch","chOff","chain","challenge","changeType","changedTouches","channel","channelCount","channelCountMode","channelInterpretation","char","charAt","charCode","charCodeAt","charIndex","charLength","characterData","characterDataOldValue","characterSet","characteristic","charging","chargingTime","charset","check","checkEnclosure","checkFramebufferStatus","checkIntersection","checkValidity","checked","childElementCount","childList","childNodes","children","chrome","ciphertext","cite","city","claimInterface","claimed","classList","className","classid","clear","clearAppBadge","clearAttributes","clearBufferfi","clearBufferfv","clearBufferiv","clearBufferuiv","clearColor","clearData","clearDepth","clearHalt","clearImmediate","clearInterval","clearLiveSeekableRange","clearMarks","clearMaxGCPauseAccumulator","clearMeasures","clearParameters","clearRect","clearResourceTimings","clearShadow","clearStencil","clearTimeout","clearWatch","click","clickCount","clientDataJSON","clientHeight","clientInformation","clientLeft","clientRect","clientRects","clientTop","clientWaitSync","clientWidth","clientX","clientY","clip","clip-path","clip-rule","clipBottom","clipLeft","clipPath","clipPathUnits","clipRight","clipRule","clipTop","clipboard","clipboardData","clone","cloneContents","cloneNode","cloneRange","close","closePath","closed","closest","clz","clz32","cm","cmp","code","codeBase","codePointAt","codeType","colSpan","collapse","collapseToEnd","collapseToStart","collapsed","collect","colno","color","color-adjust","color-interpolation","color-interpolation-filters","colorAdjust","colorDepth","colorInterpolation","colorInterpolationFilters","colorMask","colorType","cols","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columnCount","columnFill","columnGap","columnNumber","columnRule","columnRuleColor","columnRuleStyle","columnRuleWidth","columnSpan","columnWidth","columns","command","commit","commitPreferences","commitStyles","commonAncestorContainer","compact","compareBoundaryPoints","compareDocumentPosition","compareEndPoints","compareExchange","compareNode","comparePoint","compatMode","compatible","compile","compileShader","compileStreaming","complete","component","componentFromPoint","composed","composedPath","composite","compositionEndOffset","compositionStartOffset","compressedTexImage2D","compressedTexImage3D","compressedTexSubImage2D","compressedTexSubImage3D","computedStyleMap","concat","conditionText","coneInnerAngle","coneOuterAngle","coneOuterGain","configuration","configurationName","configurationValue","configurations","confirm","confirmComposition","confirmSiteSpecificTrackingException","confirmWebWideTrackingException","connect","connectEnd","connectShark","connectStart","connected","connection","connectionList","connectionSpeed","connectionState","connections","console","consolidate","constraint","constrictionActive","construct","constructor","contactID","contain","containerId","containerName","containerSrc","containerType","contains","containsNode","content","contentBoxSize","contentDocument","contentEditable","contentHint","contentOverflow","contentRect","contentScriptType","contentStyleType","contentType","contentWindow","context","contextMenu","contextmenu","continue","continuePrimaryKey","continuous","control","controlTransferIn","controlTransferOut","controller","controls","controlsList","convertPointFromNode","convertQuadFromNode","convertRectFromNode","convertToBlob","convertToSpecifiedUnits","cookie","cookieEnabled","coords","copyBufferSubData","copyFromChannel","copyTexImage2D","copyTexSubImage2D","copyTexSubImage3D","copyToChannel","copyWithin","correspondingElement","correspondingUseElement","corruptedVideoFrames","cos","cosh","count","countReset","counter-increment","counter-reset","counter-set","counterIncrement","counterReset","counterSet","country","cpuClass","cpuSleepAllowed","create","createAnalyser","createAnswer","createAttribute","createAttributeNS","createBiquadFilter","createBuffer","createBufferSource","createCDATASection","createCSSStyleSheet","createCaption","createChannelMerger","createChannelSplitter","createComment","createConstantSource","createContextualFragment","createControlRange","createConvolver","createDTMFSender","createDataChannel","createDelay","createDelayNode","createDocument","createDocumentFragment","createDocumentType","createDynamicsCompressor","createElement","createElementNS","createEntityReference","createEvent","createEventObject","createExpression","createFramebuffer","createFunction","createGain","createGainNode","createHTML","createHTMLDocument","createIIRFilter","createImageBitmap","createImageData","createIndex","createJavaScriptNode","createLinearGradient","createMediaElementSource","createMediaKeys","createMediaStreamDestination","createMediaStreamSource","createMediaStreamTrackSource","createMutableFile","createNSResolver","createNodeIterator","createNotification","createObjectStore","createObjectURL","createOffer","createOscillator","createPanner","createPattern","createPeriodicWave","createPolicy","createPopup","createProcessingInstruction","createProgram","createQuery","createRadialGradient","createRange","createRangeCollection","createReader","createRenderbuffer","createSVGAngle","createSVGLength","createSVGMatrix","createSVGNumber","createSVGPathSegArcAbs","createSVGPathSegArcRel","createSVGPathSegClosePath","createSVGPathSegCurvetoCubicAbs","createSVGPathSegCurvetoCubicRel","createSVGPathSegCurvetoCubicSmoothAbs","createSVGPathSegCurvetoCubicSmoothRel","createSVGPathSegCurvetoQuadraticAbs","createSVGPathSegCurvetoQuadraticRel","createSVGPathSegCurvetoQuadraticSmoothAbs","createSVGPathSegCurvetoQuadraticSmoothRel","createSVGPathSegLinetoAbs","createSVGPathSegLinetoHorizontalAbs","createSVGPathSegLinetoHorizontalRel","createSVGPathSegLinetoRel","createSVGPathSegLinetoVerticalAbs","createSVGPathSegLinetoVerticalRel","createSVGPathSegMovetoAbs","createSVGPathSegMovetoRel","createSVGPoint","createSVGRect","createSVGTransform","createSVGTransformFromMatrix","createSampler","createScript","createScriptProcessor","createScriptURL","createSession","createShader","createShadowRoot","createStereoPanner","createStyleSheet","createTBody","createTFoot","createTHead","createTextNode","createTextRange","createTexture","createTouch","createTouchList","createTransformFeedback","createTreeWalker","createVertexArray","createWaveShaper","creationTime","credentials","crossOrigin","crossOriginIsolated","crypto","csi","csp","cssFloat","cssRules","cssText","cssValueType","ctrlKey","ctrlLeft","cues","cullFace","currentDirection","currentLocalDescription","currentNode","currentPage","currentRect","currentRemoteDescription","currentScale","currentScript","currentSrc","currentState","currentStyle","currentTarget","currentTime","currentTranslate","currentView","cursor","curve","customElements","customError","cx","cy","d","data","dataFld","dataFormatAs","dataLoss","dataLossMessage","dataPageSize","dataSrc","dataTransfer","database","databases","dataset","dateTime","db","debug","debuggerEnabled","declare","decode","decodeAudioData","decodeURI","decodeURIComponent","decodedBodySize","decoding","decodingInfo","decrypt","default","defaultCharset","defaultChecked","defaultMuted","defaultPlaybackRate","defaultPolicy","defaultPrevented","defaultRequest","defaultSelected","defaultStatus","defaultURL","defaultValue","defaultView","defaultstatus","defer","define","defineMagicFunction","defineMagicVariable","defineProperties","defineProperty","deg","delay","delayTime","delegatesFocus","delete","deleteBuffer","deleteCaption","deleteCell","deleteContents","deleteData","deleteDatabase","deleteFramebuffer","deleteFromDocument","deleteIndex","deleteMedium","deleteObjectStore","deleteProgram","deleteProperty","deleteQuery","deleteRenderbuffer","deleteRow","deleteRule","deleteSampler","deleteShader","deleteSync","deleteTFoot","deleteTHead","deleteTexture","deleteTransformFeedback","deleteVertexArray","deliverChangeRecords","delivery","deliveryInfo","deliveryStatus","deliveryTimestamp","delta","deltaMode","deltaX","deltaY","deltaZ","dependentLocality","depthFar","depthFunc","depthMask","depthNear","depthRange","deref","deriveBits","deriveKey","description","deselectAll","designMode","desiredSize","destination","destinationURL","detach","detachEvent","detachShader","detail","details","detect","detune","device","deviceClass","deviceId","deviceMemory","devicePixelContentBoxSize","devicePixelRatio","deviceProtocol","deviceSubclass","deviceVersionMajor","deviceVersionMinor","deviceVersionSubminor","deviceXDPI","deviceYDPI","didTimeout","diffuseConstant","digest","dimensions","dir","dirName","direction","dirxml","disable","disablePictureInPicture","disableRemotePlayback","disableVertexAttribArray","disabled","dischargingTime","disconnect","disconnectShark","dispatchEvent","display","displayId","displayName","disposition","distanceModel","div","divisor","djsapi","djsproxy","doImport","doNotTrack","doScroll","doctype","document","documentElement","documentMode","documentURI","dolphin","dolphinGameCenter","dolphininfo","dolphinmeta","domComplete","domContentLoadedEventEnd","domContentLoadedEventStart","domInteractive","domLoading","domOverlayState","domain","domainLookupEnd","domainLookupStart","dominant-baseline","dominantBaseline","done","dopplerFactor","dotAll","downDegrees","downlink","download","downloadTotal","downloaded","dpcm","dpi","dppx","dragDrop","draggable","drawArrays","drawArraysInstanced","drawArraysInstancedANGLE","drawBuffers","drawCustomFocusRing","drawElements","drawElementsInstanced","drawElementsInstancedANGLE","drawFocusIfNeeded","drawImage","drawImageFromRect","drawRangeElements","drawSystemFocusRing","drawingBufferHeight","drawingBufferWidth","dropEffect","droppedVideoFrames","dropzone","dtmf","dump","dumpProfile","duplicate","durability","duration","dvname","dvnum","dx","dy","dynsrc","e","edgeMode","effect","effectAllowed","effectiveDirective","effectiveType","elapsedTime","element","elementFromPoint","elementTiming","elements","elementsFromPoint","elevation","ellipse","em","email","embeds","emma","empty","empty-cells","emptyCells","emptyHTML","emptyScript","emulatedPosition","enable","enableBackground","enableDelegations","enableStyleSheetsForSet","enableVertexAttribArray","enabled","enabledPlugin","encode","encodeInto","encodeURI","encodeURIComponent","encodedBodySize","encoding","encodingInfo","encrypt","enctype","end","endContainer","endElement","endElementAt","endOfStream","endOffset","endQuery","endTime","endTransformFeedback","ended","endpoint","endpointNumber","endpoints","endsWith","enterKeyHint","entities","entries","entryType","enumerate","enumerateDevices","enumerateEditable","environmentBlendMode","equals","error","errorCode","errorDetail","errorText","escape","estimate","eval","evaluate","event","eventPhase","every","ex","exception","exchange","exec","execCommand","execCommandShowHelp","execScript","exitFullscreen","exitPictureInPicture","exitPointerLock","exitPresent","exp","expand","expandEntityReferences","expando","expansion","expiration","expirationTime","expires","expiryDate","explicitOriginalTarget","expm1","exponent","exponentialRampToValueAtTime","exportKey","exports","extend","extensions","extentNode","extentOffset","external","externalResourcesRequired","extractContents","extractable","eye","f","face","factoryReset","failureReason","fallback","family","familyName","farthestViewportElement","fastSeek","fatal","featureId","featurePolicy","featureSettings","features","fenceSync","fetch","fetchStart","fftSize","fgColor","fieldOfView","file","fileCreatedDate","fileHandle","fileModifiedDate","fileName","fileSize","fileUpdatedDate","filename","files","filesystem","fill","fill-opacity","fill-rule","fillLightMode","fillOpacity","fillRect","fillRule","fillStyle","fillText","filter","filterResX","filterResY","filterUnits","filters","finally","find","findIndex","findRule","findText","finish","finished","fireEvent","firesTouchEvents","firstChild","firstElementChild","firstPage","fixed","flags","flat","flatMap","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","flexBasis","flexDirection","flexFlow","flexGrow","flexShrink","flexWrap","flipX","flipY","float","float32","float64","flood-color","flood-opacity","floodColor","floodOpacity","floor","flush","focus","focusNode","focusOffset","font","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","fontFamily","fontFeatureSettings","fontKerning","fontLanguageOverride","fontOpticalSizing","fontSize","fontSizeAdjust","fontSmoothingEnabled","fontStretch","fontStyle","fontSynthesis","fontVariant","fontVariantAlternates","fontVariantCaps","fontVariantEastAsian","fontVariantLigatures","fontVariantNumeric","fontVariantPosition","fontVariationSettings","fontWeight","fontcolor","fontfaces","fonts","fontsize","for","forEach","force","forceRedraw","form","formAction","formData","formEnctype","formMethod","formNoValidate","formTarget","format","formatToParts","forms","forward","forwardX","forwardY","forwardZ","foundation","fr","fragmentDirective","frame","frameBorder","frameElement","frameSpacing","framebuffer","framebufferHeight","framebufferRenderbuffer","framebufferTexture2D","framebufferTextureLayer","framebufferWidth","frames","freeSpace","freeze","frequency","frequencyBinCount","from","fromCharCode","fromCodePoint","fromElement","fromEntries","fromFloat32Array","fromFloat64Array","fromMatrix","fromPoint","fromQuad","fromRect","frontFace","fround","fullPath","fullScreen","fullscreen","fullscreenElement","fullscreenEnabled","fx","fy","gain","gamepad","gamma","gap","gatheringState","gatt","genderIdentity","generateCertificate","generateKey","generateMipmap","generateRequest","geolocation","gestureObject","get","getActiveAttrib","getActiveUniform","getActiveUniformBlockName","getActiveUniformBlockParameter","getActiveUniforms","getAdjacentText","getAll","getAllKeys","getAllResponseHeaders","getAllowlistForFeature","getAnimations","getAsFile","getAsString","getAttachedShaders","getAttribLocation","getAttribute","getAttributeNS","getAttributeNames","getAttributeNode","getAttributeNodeNS","getAttributeType","getAudioTracks","getAvailability","getBBox","getBattery","getBigInt64","getBigUint64","getBlob","getBookmark","getBoundingClientRect","getBounds","getBoxQuads","getBufferParameter","getBufferSubData","getByteFrequencyData","getByteTimeDomainData","getCSSCanvasContext","getCTM","getCandidateWindowClientRect","getCanonicalLocales","getCapabilities","getChannelData","getCharNumAtPosition","getCharacteristic","getCharacteristics","getClientExtensionResults","getClientRect","getClientRects","getCoalescedEvents","getCompositionAlternatives","getComputedStyle","getComputedTextLength","getComputedTiming","getConfiguration","getConstraints","getContext","getContextAttributes","getContributingSources","getCounterValue","getCueAsHTML","getCueById","getCurrentPosition","getCurrentTime","getData","getDatabaseNames","getDate","getDay","getDefaultComputedStyle","getDescriptor","getDescriptors","getDestinationInsertionPoints","getDevices","getDirectory","getDisplayMedia","getDistributedNodes","getEditable","getElementById","getElementsByClassName","getElementsByName","getElementsByTagName","getElementsByTagNameNS","getEnclosureList","getEndPositionOfChar","getEntries","getEntriesByName","getEntriesByType","getError","getExtension","getExtentOfChar","getEyeParameters","getFeature","getFile","getFiles","getFilesAndDirectories","getFingerprints","getFloat32","getFloat64","getFloatFrequencyData","getFloatTimeDomainData","getFloatValue","getFragDataLocation","getFrameData","getFramebufferAttachmentParameter","getFrequencyResponse","getFullYear","getGamepads","getHitTestResults","getHitTestResultsForTransientInput","getHours","getIdentityAssertion","getIds","getImageData","getIndexedParameter","getInstalledRelatedApps","getInt16","getInt32","getInt8","getInternalformatParameter","getIntersectionList","getItem","getItems","getKey","getKeyframes","getLayers","getLayoutMap","getLineDash","getLocalCandidates","getLocalParameters","getLocalStreams","getMarks","getMatchedCSSRules","getMaxGCPauseSinceClear","getMeasures","getMetadata","getMilliseconds","getMinutes","getModifierState","getMonth","getNamedItem","getNamedItemNS","getNativeFramebufferScaleFactor","getNotifications","getNotifier","getNumberOfChars","getOffsetReferenceSpace","getOutputTimestamp","getOverrideHistoryNavigationMode","getOverrideStyle","getOwnPropertyDescriptor","getOwnPropertyDescriptors","getOwnPropertyNames","getOwnPropertySymbols","getParameter","getParameters","getParent","getPathSegAtLength","getPhotoCapabilities","getPhotoSettings","getPointAtLength","getPose","getPredictedEvents","getPreference","getPreferenceDefault","getPresentationAttribute","getPreventDefault","getPrimaryService","getPrimaryServices","getProgramInfoLog","getProgramParameter","getPropertyCSSValue","getPropertyPriority","getPropertyShorthand","getPropertyType","getPropertyValue","getPrototypeOf","getQuery","getQueryParameter","getRGBColorValue","getRandomValues","getRangeAt","getReader","getReceivers","getRectValue","getRegistration","getRegistrations","getRemoteCandidates","getRemoteCertificates","getRemoteParameters","getRemoteStreams","getRenderbufferParameter","getResponseHeader","getRoot","getRootNode","getRotationOfChar","getSVGDocument","getSamplerParameter","getScreenCTM","getSeconds","getSelectedCandidatePair","getSelection","getSenders","getService","getSettings","getShaderInfoLog","getShaderParameter","getShaderPrecisionFormat","getShaderSource","getSimpleDuration","getSiteIcons","getSources","getSpeculativeParserUrls","getStartPositionOfChar","getStartTime","getState","getStats","getStatusForPolicy","getStorageUpdates","getStreamById","getStringValue","getSubStringLength","getSubscription","getSupportedConstraints","getSupportedExtensions","getSupportedFormats","getSyncParameter","getSynchronizationSources","getTags","getTargetRanges","getTexParameter","getTime","getTimezoneOffset","getTiming","getTotalLength","getTrackById","getTracks","getTransceivers","getTransform","getTransformFeedbackVarying","getTransformToElement","getTransports","getType","getTypeMapping","getUTCDate","getUTCDay","getUTCFullYear","getUTCHours","getUTCMilliseconds","getUTCMinutes","getUTCMonth","getUTCSeconds","getUint16","getUint32","getUint8","getUniform","getUniformBlockIndex","getUniformIndices","getUniformLocation","getUserMedia","getVRDisplays","getValues","getVarDate","getVariableValue","getVertexAttrib","getVertexAttribOffset","getVideoPlaybackQuality","getVideoTracks","getViewerPose","getViewport","getVoices","getWakeLockState","getWriter","getYear","givenName","global","globalAlpha","globalCompositeOperation","globalThis","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","go","grabFrame","grad","gradientTransform","gradientUnits","grammars","green","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-gap","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-gap","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","gridArea","gridAutoColumns","gridAutoFlow","gridAutoRows","gridColumn","gridColumnEnd","gridColumnGap","gridColumnStart","gridGap","gridRow","gridRowEnd","gridRowGap","gridRowStart","gridTemplate","gridTemplateAreas","gridTemplateColumns","gridTemplateRows","gripSpace","group","groupCollapsed","groupEnd","groupId","hadRecentInput","hand","handedness","hapticActuators","hardwareConcurrency","has","hasAttribute","hasAttributeNS","hasAttributes","hasBeenActive","hasChildNodes","hasComposition","hasEnrolledInstrument","hasExtension","hasExternalDisplay","hasFeature","hasFocus","hasInstance","hasLayout","hasOrientation","hasOwnProperty","hasPointerCapture","hasPosition","hasReading","hasStorageAccess","hash","head","headers","heading","height","hidden","hide","hideFocus","high","highWaterMark","hint","history","honorificPrefix","honorificSuffix","horizontalOverflow","host","hostCandidate","hostname","href","hrefTranslate","hreflang","hspace","html5TagCheckInerface","htmlFor","htmlText","httpEquiv","httpRequestStatusCode","hwTimestamp","hyphens","hypot","iccId","iceConnectionState","iceGatheringState","iceTransport","icon","iconURL","id","identifier","identity","idpLoginUrl","ignoreBOM","ignoreCase","ignoreDepthValues","image-orientation","image-rendering","imageHeight","imageOrientation","imageRendering","imageSizes","imageSmoothingEnabled","imageSmoothingQuality","imageSrcset","imageWidth","images","ime-mode","imeMode","implementation","importKey","importNode","importStylesheet","imports","impp","imul","in","in1","in2","inBandMetadataTrackDispatchType","inRange","includes","incremental","indeterminate","index","indexNames","indexOf","indexedDB","indicate","inertiaDestinationX","inertiaDestinationY","info","init","initAnimationEvent","initBeforeLoadEvent","initClipboardEvent","initCloseEvent","initCommandEvent","initCompositionEvent","initCustomEvent","initData","initDataType","initDeviceMotionEvent","initDeviceOrientationEvent","initDragEvent","initErrorEvent","initEvent","initFocusEvent","initGestureEvent","initHashChangeEvent","initKeyEvent","initKeyboardEvent","initMSManipulationEvent","initMessageEvent","initMouseEvent","initMouseScrollEvent","initMouseWheelEvent","initMutationEvent","initNSMouseEvent","initOverflowEvent","initPageEvent","initPageTransitionEvent","initPointerEvent","initPopStateEvent","initProgressEvent","initScrollAreaEvent","initSimpleGestureEvent","initStorageEvent","initTextEvent","initTimeEvent","initTouchEvent","initTransitionEvent","initUIEvent","initWebKitAnimationEvent","initWebKitTransitionEvent","initWebKitWheelEvent","initWheelEvent","initialTime","initialize","initiatorType","inline-size","inlineSize","inlineVerticalFieldOfView","inner","innerHTML","innerHeight","innerText","innerWidth","input","inputBuffer","inputEncoding","inputMethod","inputMode","inputSource","inputSources","inputType","inputs","insertAdjacentElement","insertAdjacentHTML","insertAdjacentText","insertBefore","insertCell","insertDTMF","insertData","insertItemBefore","insertNode","insertRow","insertRule","inset","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","insetBlock","insetBlockEnd","insetBlockStart","insetInline","insetInlineEnd","insetInlineStart","installing","instanceRoot","instantiate","instantiateStreaming","instruments","int16","int32","int8","integrity","interactionMode","intercept","interfaceClass","interfaceName","interfaceNumber","interfaceProtocol","interfaceSubclass","interfaces","interimResults","internalSubset","interpretation","intersectionRatio","intersectionRect","intersectsNode","interval","invalidIteratorState","invalidateFramebuffer","invalidateSubFramebuffer","inverse","invertSelf","is","is2D","isActive","isAlternate","isArray","isBingCurrentSearchDefault","isBuffer","isCandidateWindowVisible","isChar","isCollapsed","isComposing","isConcatSpreadable","isConnected","isContentEditable","isContentHandlerRegistered","isContextLost","isDefaultNamespace","isDirectory","isDisabled","isEnabled","isEqual","isEqualNode","isExtensible","isExternalCTAP2SecurityKeySupported","isFile","isFinite","isFramebuffer","isFrozen","isGenerator","isHTML","isHistoryNavigation","isId","isIdentity","isInjected","isInteger","isIntersecting","isLockFree","isMap","isMultiLine","isNaN","isOpen","isPointInFill","isPointInPath","isPointInRange","isPointInStroke","isPrefAlternate","isPresenting","isPrimary","isProgram","isPropertyImplicit","isProtocolHandlerRegistered","isPrototypeOf","isQuery","isRenderbuffer","isSafeInteger","isSameNode","isSampler","isScript","isScriptURL","isSealed","isSecureContext","isSessionSupported","isShader","isSupported","isSync","isTextEdit","isTexture","isTransformFeedback","isTrusted","isTypeSupported","isUserVerifyingPlatformAuthenticatorAvailable","isVertexArray","isView","isVisible","isochronousTransferIn","isochronousTransferOut","isolation","italics","item","itemId","itemProp","itemRef","itemScope","itemType","itemValue","items","iterateNext","iterationComposite","iterator","javaEnabled","jobTitle","join","json","justify-content","justify-items","justify-self","justifyContent","justifyItems","justifySelf","k1","k2","k3","k4","kHz","keepalive","kernelMatrix","kernelUnitLengthX","kernelUnitLengthY","kerning","key","keyCode","keyFor","keyIdentifier","keyLightEnabled","keyLocation","keyPath","keyStatuses","keySystem","keyText","keyUsage","keyboard","keys","keytype","kind","knee","label","labels","lang","language","languages","largeArcFlag","lastChild","lastElementChild","lastEventId","lastIndex","lastIndexOf","lastInputTime","lastMatch","lastMessageSubject","lastMessageType","lastModified","lastModifiedDate","lastPage","lastParen","lastState","lastStyleSheetSet","latitude","layerX","layerY","layoutFlow","layoutGrid","layoutGridChar","layoutGridLine","layoutGridMode","layoutGridType","lbound","left","leftContext","leftDegrees","leftMargin","leftProjectionMatrix","leftViewMatrix","length","lengthAdjust","lengthComputable","letter-spacing","letterSpacing","level","lighting-color","lightingColor","limitingConeAngle","line","line-break","line-height","lineAlign","lineBreak","lineCap","lineDashOffset","lineHeight","lineJoin","lineNumber","lineTo","lineWidth","linearAcceleration","linearRampToValueAtTime","linearVelocity","lineno","lines","link","linkColor","linkProgram","links","list","list-style","list-style-image","list-style-position","list-style-type","listStyle","listStyleImage","listStylePosition","listStyleType","listener","load","loadEventEnd","loadEventStart","loadTime","loadTimes","loaded","loading","localDescription","localName","localService","localStorage","locale","localeCompare","location","locationbar","lock","locked","lockedFile","locks","log","log10","log1p","log2","logicalXDPI","logicalYDPI","longDesc","longitude","lookupNamespaceURI","lookupPrefix","loop","loopEnd","loopStart","looping","low","lower","lowerBound","lowerOpen","lowsrc","m11","m12","m13","m14","m21","m22","m23","m24","m31","m32","m33","m34","m41","m42","m43","m44","makeXRCompatible","manifest","manufacturer","manufacturerName","map","mapping","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","marginBlock","marginBlockEnd","marginBlockStart","marginBottom","marginHeight","marginInline","marginInlineEnd","marginInlineStart","marginLeft","marginRight","marginTop","marginWidth","mark","marker","marker-end","marker-mid","marker-offset","marker-start","markerEnd","markerHeight","markerMid","markerOffset","markerStart","markerUnits","markerWidth","marks","mask","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-position-x","mask-position-y","mask-repeat","mask-size","mask-type","maskClip","maskComposite","maskContentUnits","maskImage","maskMode","maskOrigin","maskPosition","maskPositionX","maskPositionY","maskRepeat","maskSize","maskType","maskUnits","match","matchAll","matchMedia","matchMedium","matches","matrix","matrixTransform","max","max-block-size","max-height","max-inline-size","max-width","maxActions","maxAlternatives","maxBlockSize","maxChannelCount","maxChannels","maxConnectionsPerServer","maxDecibels","maxDistance","maxHeight","maxInlineSize","maxLayers","maxLength","maxMessageSize","maxPacketLifeTime","maxRetransmits","maxTouchPoints","maxValue","maxWidth","measure","measureText","media","mediaCapabilities","mediaDevices","mediaElement","mediaGroup","mediaKeys","mediaSession","mediaStream","mediaText","meetOrSlice","memory","menubar","mergeAttributes","message","messageClass","messageHandlers","messageType","metaKey","metadata","method","methodDetails","methodName","mid","mimeType","mimeTypes","min","min-block-size","min-height","min-inline-size","min-width","minBlockSize","minDecibels","minHeight","minInlineSize","minLength","minValue","minWidth","miterLimit","mix-blend-mode","mixBlendMode","mm","mode","modify","mount","move","moveBy","moveEnd","moveFirst","moveFocusDown","moveFocusLeft","moveFocusRight","moveFocusUp","moveNext","moveRow","moveStart","moveTo","moveToBookmark","moveToElementText","moveToPoint","movementX","movementY","mozAdd","mozAnimationStartTime","mozAnon","mozApps","mozAudioCaptured","mozAudioChannelType","mozAutoplayEnabled","mozCancelAnimationFrame","mozCancelFullScreen","mozCancelRequestAnimationFrame","mozCaptureStream","mozCaptureStreamUntilEnded","mozClearDataAt","mozContact","mozContacts","mozCreateFileHandle","mozCurrentTransform","mozCurrentTransformInverse","mozCursor","mozDash","mozDashOffset","mozDecodedFrames","mozExitPointerLock","mozFillRule","mozFragmentEnd","mozFrameDelay","mozFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozGetAll","mozGetAllKeys","mozGetAsFile","mozGetDataAt","mozGetMetadata","mozGetUserMedia","mozHasAudio","mozHasItem","mozHidden","mozImageSmoothingEnabled","mozIndexedDB","mozInnerScreenX","mozInnerScreenY","mozInputSource","mozIsTextField","mozItem","mozItemCount","mozItems","mozLength","mozLockOrientation","mozMatchesSelector","mozMovementX","mozMovementY","mozOpaque","mozOrientation","mozPaintCount","mozPaintedFrames","mozParsedFrames","mozPay","mozPointerLockElement","mozPresentedFrames","mozPreservesPitch","mozPressure","mozPrintCallback","mozRTCIceCandidate","mozRTCPeerConnection","mozRTCSessionDescription","mozRemove","mozRequestAnimationFrame","mozRequestFullScreen","mozRequestPointerLock","mozSetDataAt","mozSetImageElement","mozSourceNode","mozSrcObject","mozSystem","mozTCPSocket","mozTextStyle","mozTypesAt","mozUnlockOrientation","mozUserCancelled","mozVisibilityState","ms","msAnimation","msAnimationDelay","msAnimationDirection","msAnimationDuration","msAnimationFillMode","msAnimationIterationCount","msAnimationName","msAnimationPlayState","msAnimationStartTime","msAnimationTimingFunction","msBackfaceVisibility","msBlockProgression","msCSSOMElementFloatMetrics","msCaching","msCachingEnabled","msCancelRequestAnimationFrame","msCapsLockWarningOff","msClearImmediate","msClose","msContentZoomChaining","msContentZoomFactor","msContentZoomLimit","msContentZoomLimitMax","msContentZoomLimitMin","msContentZoomSnap","msContentZoomSnapPoints","msContentZoomSnapType","msContentZooming","msConvertURL","msCrypto","msDoNotTrack","msElementsFromPoint","msElementsFromRect","msExitFullscreen","msExtendedCode","msFillRule","msFirstPaint","msFlex","msFlexAlign","msFlexDirection","msFlexFlow","msFlexItemAlign","msFlexLinePack","msFlexNegative","msFlexOrder","msFlexPack","msFlexPositive","msFlexPreferredSize","msFlexWrap","msFlowFrom","msFlowInto","msFontFeatureSettings","msFullscreenElement","msFullscreenEnabled","msGetInputContext","msGetRegionContent","msGetUntransformedBounds","msGraphicsTrustStatus","msGridColumn","msGridColumnAlign","msGridColumnSpan","msGridColumns","msGridRow","msGridRowAlign","msGridRowSpan","msGridRows","msHidden","msHighContrastAdjust","msHyphenateLimitChars","msHyphenateLimitLines","msHyphenateLimitZone","msHyphens","msImageSmoothingEnabled","msImeAlign","msIndexedDB","msInterpolationMode","msIsStaticHTML","msKeySystem","msKeys","msLaunchUri","msLockOrientation","msManipulationViewsEnabled","msMatchMedia","msMatchesSelector","msMaxTouchPoints","msOrientation","msOverflowStyle","msPerspective","msPerspectiveOrigin","msPlayToDisabled","msPlayToPreferredSourceUri","msPlayToPrimary","msPointerEnabled","msRegionOverflow","msReleasePointerCapture","msRequestAnimationFrame","msRequestFullscreen","msSaveBlob","msSaveOrOpenBlob","msScrollChaining","msScrollLimit","msScrollLimitXMax","msScrollLimitXMin","msScrollLimitYMax","msScrollLimitYMin","msScrollRails","msScrollSnapPointsX","msScrollSnapPointsY","msScrollSnapType","msScrollSnapX","msScrollSnapY","msScrollTranslation","msSetImmediate","msSetMediaKeys","msSetPointerCapture","msTextCombineHorizontal","msTextSizeAdjust","msToBlob","msTouchAction","msTouchSelect","msTraceAsyncCallbackCompleted","msTraceAsyncCallbackStarting","msTraceAsyncOperationCompleted","msTraceAsyncOperationStarting","msTransform","msTransformOrigin","msTransformStyle","msTransition","msTransitionDelay","msTransitionDuration","msTransitionProperty","msTransitionTimingFunction","msUnlockOrientation","msUpdateAsyncCallbackRelation","msUserSelect","msVisibilityState","msWrapFlow","msWrapMargin","msWrapThrough","msWriteProfilerMark","msZoom","msZoomTo","mt","mul","multiEntry","multiSelectionObj","multiline","multiple","multiply","multiplySelf","mutableFile","muted","n","name","nameProp","namedItem","namedRecordset","names","namespaceURI","namespaces","naturalHeight","naturalWidth","navigate","navigation","navigationMode","navigationPreload","navigationStart","navigator","near","nearestViewportElement","negative","negotiated","netscape","networkState","newScale","newTranslate","newURL","newValue","newValueSpecifiedUnits","newVersion","newhome","next","nextElementSibling","nextHopProtocol","nextNode","nextPage","nextSibling","nickname","noHref","noModule","noResize","noShade","noValidate","noWrap","node","nodeName","nodeType","nodeValue","nonce","normalize","normalizedPathSegList","notationName","notations","note","noteGrainOn","noteOff","noteOn","notify","now","numOctaves","number","numberOfChannels","numberOfInputs","numberOfItems","numberOfOutputs","numberValue","oMatchesSelector","object","object-fit","object-position","objectFit","objectPosition","objectStore","objectStoreNames","objectType","observe","of","offscreenBuffering","offset","offset-anchor","offset-distance","offset-path","offset-rotate","offsetAnchor","offsetDistance","offsetHeight","offsetLeft","offsetNode","offsetParent","offsetPath","offsetRotate","offsetTop","offsetWidth","offsetX","offsetY","ok","oldURL","oldValue","oldVersion","olderShadowRoot","onLine","onabort","onabsolutedeviceorientation","onactivate","onactive","onaddsourcebuffer","onaddstream","onaddtrack","onafterprint","onafterscriptexecute","onafterupdate","onanimationcancel","onanimationend","onanimationiteration","onanimationstart","onappinstalled","onaudioend","onaudioprocess","onaudiostart","onautocomplete","onautocompleteerror","onauxclick","onbeforeactivate","onbeforecopy","onbeforecut","onbeforedeactivate","onbeforeeditfocus","onbeforeinstallprompt","onbeforepaste","onbeforeprint","onbeforescriptexecute","onbeforeunload","onbeforeupdate","onbeforexrselect","onbegin","onblocked","onblur","onbounce","onboundary","onbufferedamountlow","oncached","oncancel","oncandidatewindowhide","oncandidatewindowshow","oncandidatewindowupdate","oncanplay","oncanplaythrough","once","oncellchange","onchange","oncharacteristicvaluechanged","onchargingchange","onchargingtimechange","onchecking","onclick","onclose","onclosing","oncompassneedscalibration","oncomplete","onconnect","onconnecting","onconnectionavailable","onconnectionstatechange","oncontextmenu","oncontrollerchange","oncontrolselect","oncopy","oncuechange","oncut","ondataavailable","ondatachannel","ondatasetchanged","ondatasetcomplete","ondblclick","ondeactivate","ondevicechange","ondevicelight","ondevicemotion","ondeviceorientation","ondeviceorientationabsolute","ondeviceproximity","ondischargingtimechange","ondisconnect","ondisplay","ondownloading","ondrag","ondragend","ondragenter","ondragexit","ondragleave","ondragover","ondragstart","ondrop","ondurationchange","onemptied","onencrypted","onend","onended","onenter","onenterpictureinpicture","onerror","onerrorupdate","onexit","onfilterchange","onfinish","onfocus","onfocusin","onfocusout","onformdata","onfreeze","onfullscreenchange","onfullscreenerror","ongatheringstatechange","ongattserverdisconnected","ongesturechange","ongestureend","ongesturestart","ongotpointercapture","onhashchange","onhelp","onicecandidate","onicecandidateerror","oniceconnectionstatechange","onicegatheringstatechange","oninactive","oninput","oninputsourceschange","oninvalid","onkeydown","onkeypress","onkeystatuseschange","onkeyup","onlanguagechange","onlayoutcomplete","onleavepictureinpicture","onlevelchange","onload","onloadeddata","onloadedmetadata","onloadend","onloading","onloadingdone","onloadingerror","onloadstart","onlosecapture","onlostpointercapture","only","onmark","onmessage","onmessageerror","onmidimessage","onmousedown","onmouseenter","onmouseleave","onmousemove","onmouseout","onmouseover","onmouseup","onmousewheel","onmove","onmoveend","onmovestart","onmozfullscreenchange","onmozfullscreenerror","onmozorientationchange","onmozpointerlockchange","onmozpointerlockerror","onmscontentzoom","onmsfullscreenchange","onmsfullscreenerror","onmsgesturechange","onmsgesturedoubletap","onmsgestureend","onmsgesturehold","onmsgesturestart","onmsgesturetap","onmsgotpointercapture","onmsinertiastart","onmslostpointercapture","onmsmanipulationstatechanged","onmsneedkey","onmsorientationchange","onmspointercancel","onmspointerdown","onmspointerenter","onmspointerhover","onmspointerleave","onmspointermove","onmspointerout","onmspointerover","onmspointerup","onmssitemodejumplistitemremoved","onmsthumbnailclick","onmute","onnegotiationneeded","onnomatch","onnoupdate","onobsolete","onoffline","ononline","onopen","onorientationchange","onpagechange","onpagehide","onpageshow","onpaste","onpause","onpayerdetailchange","onpaymentmethodchange","onplay","onplaying","onpluginstreamstart","onpointercancel","onpointerdown","onpointerenter","onpointerleave","onpointerlockchange","onpointerlockerror","onpointermove","onpointerout","onpointerover","onpointerrawupdate","onpointerup","onpopstate","onprocessorerror","onprogress","onpropertychange","onratechange","onreading","onreadystatechange","onrejectionhandled","onrelease","onremove","onremovesourcebuffer","onremovestream","onremovetrack","onrepeat","onreset","onresize","onresizeend","onresizestart","onresourcetimingbufferfull","onresult","onresume","onrowenter","onrowexit","onrowsdelete","onrowsinserted","onscroll","onsearch","onsecuritypolicyviolation","onseeked","onseeking","onselect","onselectedcandidatepairchange","onselectend","onselectionchange","onselectstart","onshippingaddresschange","onshippingoptionchange","onshow","onsignalingstatechange","onsoundend","onsoundstart","onsourceclose","onsourceclosed","onsourceended","onsourceopen","onspeechend","onspeechstart","onsqueeze","onsqueezeend","onsqueezestart","onstalled","onstart","onstatechange","onstop","onstorage","onstoragecommit","onsubmit","onsuccess","onsuspend","onterminate","ontextinput","ontimeout","ontimeupdate","ontoggle","ontonechange","ontouchcancel","ontouchend","ontouchmove","ontouchstart","ontrack","ontransitioncancel","ontransitionend","ontransitionrun","ontransitionstart","onunhandledrejection","onunload","onunmute","onupdate","onupdateend","onupdatefound","onupdateready","onupdatestart","onupgradeneeded","onuserproximity","onversionchange","onvisibilitychange","onvoiceschanged","onvolumechange","onvrdisplayactivate","onvrdisplayconnect","onvrdisplaydeactivate","onvrdisplaydisconnect","onvrdisplaypresentchange","onwaiting","onwaitingforkey","onwarning","onwebkitanimationend","onwebkitanimationiteration","onwebkitanimationstart","onwebkitcurrentplaybacktargetiswirelesschanged","onwebkitfullscreenchange","onwebkitfullscreenerror","onwebkitkeyadded","onwebkitkeyerror","onwebkitkeymessage","onwebkitneedkey","onwebkitorientationchange","onwebkitplaybacktargetavailabilitychanged","onwebkitpointerlockchange","onwebkitpointerlockerror","onwebkitresourcetimingbufferfull","onwebkittransitionend","onwheel","onzoom","opacity","open","openCursor","openDatabase","openKeyCursor","opened","opener","opera","operationType","operator","opr","optimum","options","or","order","orderX","orderY","ordered","org","organization","orient","orientAngle","orientType","orientation","orientationX","orientationY","orientationZ","origin","originalPolicy","originalTarget","orphans","oscpu","outerHTML","outerHeight","outerText","outerWidth","outline","outline-color","outline-offset","outline-style","outline-width","outlineColor","outlineOffset","outlineStyle","outlineWidth","outputBuffer","outputLatency","outputs","overflow","overflow-anchor","overflow-block","overflow-inline","overflow-wrap","overflow-x","overflow-y","overflowAnchor","overflowBlock","overflowInline","overflowWrap","overflowX","overflowY","overrideMimeType","oversample","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","overscrollBehavior","overscrollBehaviorBlock","overscrollBehaviorInline","overscrollBehaviorX","overscrollBehaviorY","ownKeys","ownerDocument","ownerElement","ownerNode","ownerRule","ownerSVGElement","owningElement","p1","p2","p3","p4","packetSize","packets","pad","padEnd","padStart","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","paddingBlock","paddingBlockEnd","paddingBlockStart","paddingBottom","paddingInline","paddingInlineEnd","paddingInlineStart","paddingLeft","paddingRight","paddingTop","page","page-break-after","page-break-before","page-break-inside","pageBreakAfter","pageBreakBefore","pageBreakInside","pageCount","pageLeft","pageTop","pageX","pageXOffset","pageY","pageYOffset","pages","paint-order","paintOrder","paintRequests","paintType","paintWorklet","palette","pan","panningModel","parameters","parent","parentElement","parentNode","parentRule","parentStyleSheet","parentTextEdit","parentWindow","parse","parseAll","parseFloat","parseFromString","parseInt","part","participants","passive","password","pasteHTML","path","pathLength","pathSegList","pathSegType","pathSegTypeAsLetter","pathname","pattern","patternContentUnits","patternMismatch","patternTransform","patternUnits","pause","pauseAnimations","pauseOnExit","pauseProfilers","pauseTransformFeedback","paused","payerEmail","payerName","payerPhone","paymentManager","pc","peerIdentity","pending","pendingLocalDescription","pendingRemoteDescription","percent","performance","periodicSync","permission","permissionState","permissions","persist","persisted","personalbar","perspective","perspective-origin","perspectiveOrigin","phone","phoneticFamilyName","phoneticGivenName","photo","pictureInPictureElement","pictureInPictureEnabled","pictureInPictureWindow","ping","pipeThrough","pipeTo","pitch","pixelBottom","pixelDepth","pixelHeight","pixelLeft","pixelRight","pixelStorei","pixelTop","pixelUnitToMillimeterX","pixelUnitToMillimeterY","pixelWidth","place-content","place-items","place-self","placeContent","placeItems","placeSelf","placeholder","platform","platforms","play","playEffect","playState","playbackRate","playbackState","playbackTime","played","playoutDelayHint","playsInline","plugins","pluginspage","pname","pointer-events","pointerBeforeReferenceNode","pointerEnabled","pointerEvents","pointerId","pointerLockElement","pointerType","points","pointsAtX","pointsAtY","pointsAtZ","polygonOffset","pop","populateMatrix","popupWindowFeatures","popupWindowName","popupWindowURI","port","port1","port2","ports","posBottom","posHeight","posLeft","posRight","posTop","posWidth","pose","position","positionAlign","positionX","positionY","positionZ","postError","postMessage","postalCode","poster","pow","powerEfficient","powerOff","preMultiplySelf","precision","preferredStyleSheetSet","preferredStylesheetSet","prefix","preload","prepend","presentation","preserveAlpha","preserveAspectRatio","preserveAspectRatioString","pressed","pressure","prevValue","preventDefault","preventExtensions","preventSilentAccess","previousElementSibling","previousNode","previousPage","previousRect","previousScale","previousSibling","previousTranslate","primaryKey","primitiveType","primitiveUnits","principals","print","priority","privateKey","probablySupportsContext","process","processIceMessage","processingEnd","processingStart","product","productId","productName","productSub","profile","profileEnd","profiles","projectionMatrix","promise","prompt","properties","propertyIsEnumerable","propertyName","protocol","protocolLong","prototype","provider","pseudoClass","pseudoElement","pt","publicId","publicKey","published","pulse","push","pushManager","pushNotification","pushState","put","putImageData","px","quadraticCurveTo","qualifier","quaternion","query","queryCommandEnabled","queryCommandIndeterm","queryCommandState","queryCommandSupported","queryCommandText","queryCommandValue","querySelector","querySelectorAll","queueMicrotask","quote","quotes","r","r1","r2","race","rad","radiogroup","radiusX","radiusY","random","range","rangeCount","rangeMax","rangeMin","rangeOffset","rangeOverflow","rangeParent","rangeUnderflow","rate","ratio","raw","rawId","read","readAsArrayBuffer","readAsBinaryString","readAsBlob","readAsDataURL","readAsText","readBuffer","readEntries","readOnly","readPixels","readReportRequested","readText","readValue","readable","ready","readyState","reason","reboot","receivedAlert","receiver","receivers","recipient","reconnect","recordNumber","recordsAvailable","recordset","rect","red","redEyeReduction","redirect","redirectCount","redirectEnd","redirectStart","redirected","reduce","reduceRight","reduction","refDistance","refX","refY","referenceNode","referenceSpace","referrer","referrerPolicy","refresh","region","regionAnchorX","regionAnchorY","regionId","regions","register","registerContentHandler","registerElement","registerProperty","registerProtocolHandler","reject","rel","relList","relatedAddress","relatedNode","relatedPort","relatedTarget","release","releaseCapture","releaseEvents","releaseInterface","releaseLock","releasePointerCapture","releaseShaderCompiler","reliable","reliableWrite","reload","rem","remainingSpace","remote","remoteDescription","remove","removeAllRanges","removeAttribute","removeAttributeNS","removeAttributeNode","removeBehavior","removeChild","removeCue","removeEventListener","removeFilter","removeImport","removeItem","removeListener","removeNamedItem","removeNamedItemNS","removeNode","removeParameter","removeProperty","removeRange","removeRegion","removeRule","removeSiteSpecificTrackingException","removeSourceBuffer","removeStream","removeTrack","removeVariable","removeWakeLockListener","removeWebWideTrackingException","removed","removedNodes","renderHeight","renderState","renderTime","renderWidth","renderbufferStorage","renderbufferStorageMultisample","renderedBuffer","renderingMode","renotify","repeat","replace","replaceAdjacentText","replaceAll","replaceChild","replaceChildren","replaceData","replaceId","replaceItem","replaceNode","replaceState","replaceSync","replaceTrack","replaceWholeText","replaceWith","reportValidity","request","requestAnimationFrame","requestAutocomplete","requestData","requestDevice","requestFrame","requestFullscreen","requestHitTestSource","requestHitTestSourceForTransientInput","requestId","requestIdleCallback","requestMIDIAccess","requestMediaKeySystemAccess","requestPermission","requestPictureInPicture","requestPointerLock","requestPresent","requestReferenceSpace","requestSession","requestStart","requestStorageAccess","requestSubmit","requestVideoFrameCallback","requestingWindow","requireInteraction","required","requiredExtensions","requiredFeatures","reset","resetPose","resetTransform","resize","resizeBy","resizeTo","resolve","response","responseBody","responseEnd","responseReady","responseStart","responseText","responseType","responseURL","responseXML","restartIce","restore","result","resultIndex","resultType","results","resume","resumeProfilers","resumeTransformFeedback","retry","returnValue","rev","reverse","reversed","revocable","revokeObjectURL","rgbColor","right","rightContext","rightDegrees","rightMargin","rightProjectionMatrix","rightViewMatrix","role","rolloffFactor","root","rootBounds","rootElement","rootMargin","rotate","rotateAxisAngle","rotateAxisAngleSelf","rotateFromVector","rotateFromVectorSelf","rotateSelf","rotation","rotationAngle","rotationRate","round","row-gap","rowGap","rowIndex","rowSpan","rows","rtcpTransport","rtt","ruby-align","ruby-position","rubyAlign","rubyOverhang","rubyPosition","rules","runtime","runtimeStyle","rx","ry","s","safari","sample","sampleCoverage","sampleRate","samplerParameterf","samplerParameteri","sandbox","save","saveData","scale","scale3d","scale3dSelf","scaleNonUniform","scaleNonUniformSelf","scaleSelf","scheme","scissor","scope","scopeName","scoped","screen","screenBrightness","screenEnabled","screenLeft","screenPixelToMillimeterX","screenPixelToMillimeterY","screenTop","screenX","screenY","scriptURL","scripts","scroll","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-type","scrollAmount","scrollBehavior","scrollBy","scrollByLines","scrollByPages","scrollDelay","scrollHeight","scrollIntoView","scrollIntoViewIfNeeded","scrollLeft","scrollLeftMax","scrollMargin","scrollMarginBlock","scrollMarginBlockEnd","scrollMarginBlockStart","scrollMarginBottom","scrollMarginInline","scrollMarginInlineEnd","scrollMarginInlineStart","scrollMarginLeft","scrollMarginRight","scrollMarginTop","scrollMaxX","scrollMaxY","scrollPadding","scrollPaddingBlock","scrollPaddingBlockEnd","scrollPaddingBlockStart","scrollPaddingBottom","scrollPaddingInline","scrollPaddingInlineEnd","scrollPaddingInlineStart","scrollPaddingLeft","scrollPaddingRight","scrollPaddingTop","scrollRestoration","scrollSnapAlign","scrollSnapType","scrollTo","scrollTop","scrollTopMax","scrollWidth","scrollX","scrollY","scrollbar-color","scrollbar-width","scrollbar3dLightColor","scrollbarArrowColor","scrollbarBaseColor","scrollbarColor","scrollbarDarkShadowColor","scrollbarFaceColor","scrollbarHighlightColor","scrollbarShadowColor","scrollbarTrackColor","scrollbarWidth","scrollbars","scrolling","scrollingElement","sctp","sctpCauseCode","sdp","sdpLineNumber","sdpMLineIndex","sdpMid","seal","search","searchBox","searchBoxJavaBridge_","searchParams","sectionRowIndex","secureConnectionStart","security","seed","seekToNextFrame","seekable","seeking","select","selectAllChildren","selectAlternateInterface","selectConfiguration","selectNode","selectNodeContents","selectNodes","selectSingleNode","selectSubString","selected","selectedIndex","selectedOptions","selectedStyleSheetSet","selectedStylesheetSet","selection","selectionDirection","selectionEnd","selectionStart","selector","selectorText","self","send","sendAsBinary","sendBeacon","sender","sentAlert","sentTimestamp","separator","serialNumber","serializeToString","serverTiming","service","serviceWorker","session","sessionId","sessionStorage","set","setActionHandler","setActive","setAlpha","setAppBadge","setAttribute","setAttributeNS","setAttributeNode","setAttributeNodeNS","setBaseAndExtent","setBigInt64","setBigUint64","setBingCurrentSearchDefault","setCapture","setCodecPreferences","setColor","setCompositeOperation","setConfiguration","setCurrentTime","setCustomValidity","setData","setDate","setDragImage","setEnd","setEndAfter","setEndBefore","setEndPoint","setFillColor","setFilterRes","setFloat32","setFloat64","setFloatValue","setFormValue","setFullYear","setHeaderValue","setHours","setIdentityProvider","setImmediate","setInt16","setInt32","setInt8","setInterval","setItem","setKeyframes","setLineCap","setLineDash","setLineJoin","setLineWidth","setLiveSeekableRange","setLocalDescription","setMatrix","setMatrixValue","setMediaKeys","setMilliseconds","setMinutes","setMiterLimit","setMonth","setNamedItem","setNamedItemNS","setNonUserCodeExceptions","setOrientToAngle","setOrientToAuto","setOrientation","setOverrideHistoryNavigationMode","setPaint","setParameter","setParameters","setPeriodicWave","setPointerCapture","setPosition","setPositionState","setPreference","setProperty","setPrototypeOf","setRGBColor","setRGBColorICCColor","setRadius","setRangeText","setRemoteDescription","setRequestHeader","setResizable","setResourceTimingBufferSize","setRotate","setScale","setSeconds","setSelectionRange","setServerCertificate","setShadow","setSinkId","setSkewX","setSkewY","setStart","setStartAfter","setStartBefore","setStdDeviation","setStreams","setStringValue","setStrokeColor","setSuggestResult","setTargetAtTime","setTargetValueAtTime","setTime","setTimeout","setTransform","setTranslate","setUTCDate","setUTCFullYear","setUTCHours","setUTCMilliseconds","setUTCMinutes","setUTCMonth","setUTCSeconds","setUint16","setUint32","setUint8","setUri","setValidity","setValueAtTime","setValueCurveAtTime","setVariable","setVelocity","setVersion","setYear","settingName","settingValue","sex","shaderSource","shadowBlur","shadowColor","shadowOffsetX","shadowOffsetY","shadowRoot","shape","shape-image-threshold","shape-margin","shape-outside","shape-rendering","shapeImageThreshold","shapeMargin","shapeOutside","shapeRendering","sheet","shift","shiftKey","shiftLeft","shippingAddress","shippingOption","shippingType","show","showHelp","showModal","showModalDialog","showModelessDialog","showNotification","sidebar","sign","signal","signalingState","signature","silent","sin","singleNodeValue","sinh","sinkId","sittingToStandingTransform","size","sizeToContent","sizeX","sizeZ","sizes","skewX","skewXSelf","skewY","skewYSelf","slice","slope","slot","small","smil","smooth","smoothingTimeConstant","snapToLines","snapshotItem","snapshotLength","some","sort","sortingCode","source","sourceBuffer","sourceBuffers","sourceCapabilities","sourceFile","sourceIndex","sources","spacing","span","speak","speakAs","speaking","species","specified","specularConstant","specularExponent","speechSynthesis","speed","speedOfSound","spellcheck","splice","split","splitText","spreadMethod","sqrt","src","srcElement","srcFilter","srcObject","srcUrn","srcdoc","srclang","srcset","stack","stackTraceLimit","stacktrace","stageParameters","standalone","standby","start","startContainer","startIce","startMessages","startNotifications","startOffset","startProfiling","startRendering","startShark","startTime","startsWith","state","status","statusCode","statusMessage","statusText","statusbar","stdDeviationX","stdDeviationY","stencilFunc","stencilFuncSeparate","stencilMask","stencilMaskSeparate","stencilOp","stencilOpSeparate","step","stepDown","stepMismatch","stepUp","sticky","stitchTiles","stop","stop-color","stop-opacity","stopColor","stopImmediatePropagation","stopNotifications","stopOpacity","stopProfiling","stopPropagation","stopShark","stopped","storage","storageArea","storageName","storageStatus","store","storeSiteSpecificTrackingException","storeWebWideTrackingException","stpVersion","stream","streams","stretch","strike","string","stringValue","stringify","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeRect","strokeStyle","strokeText","strokeWidth","style","styleFloat","styleMap","styleMedia","styleSheet","styleSheetSets","styleSheets","sub","subarray","subject","submit","submitFrame","submitter","subscribe","substr","substring","substringData","subtle","subtree","suffix","suffixes","summary","sup","supported","supportedContentEncodings","supportedEntryTypes","supports","supportsSession","surfaceScale","surroundContents","suspend","suspendRedraw","swapCache","swapNode","sweepFlag","symbols","sync","sysexEnabled","system","systemCode","systemId","systemLanguage","systemXDPI","systemYDPI","tBodies","tFoot","tHead","tabIndex","table","table-layout","tableLayout","tableValues","tag","tagName","tagUrn","tags","taintEnabled","takePhoto","takeRecords","tan","tangentialPressure","tanh","target","targetElement","targetRayMode","targetRaySpace","targetTouches","targetX","targetY","tcpType","tee","tel","terminate","test","texImage2D","texImage3D","texParameterf","texParameteri","texStorage2D","texStorage3D","texSubImage2D","texSubImage3D","text","text-align","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-transform","text-underline-offset","text-underline-position","textAlign","textAlignLast","textAnchor","textAutospace","textBaseline","textCombineUpright","textContent","textDecoration","textDecorationBlink","textDecorationColor","textDecorationLine","textDecorationLineThrough","textDecorationNone","textDecorationOverline","textDecorationSkipInk","textDecorationStyle","textDecorationThickness","textDecorationUnderline","textEmphasis","textEmphasisColor","textEmphasisPosition","textEmphasisStyle","textIndent","textJustify","textJustifyTrim","textKashida","textKashidaSpace","textLength","textOrientation","textOverflow","textRendering","textShadow","textTracks","textTransform","textUnderlineOffset","textUnderlinePosition","then","threadId","threshold","thresholds","tiltX","tiltY","time","timeEnd","timeLog","timeOrigin","timeRemaining","timeStamp","timecode","timeline","timelineTime","timeout","timestamp","timestampOffset","timing","title","to","toArray","toBlob","toDataURL","toDateString","toElement","toExponential","toFixed","toFloat32Array","toFloat64Array","toGMTString","toISOString","toJSON","toLocaleDateString","toLocaleFormat","toLocaleLowerCase","toLocaleString","toLocaleTimeString","toLocaleUpperCase","toLowerCase","toMatrix","toMethod","toPrecision","toPrimitive","toSdp","toSource","toStaticHTML","toString","toStringTag","toSum","toTimeString","toUTCString","toUpperCase","toggle","toggleAttribute","toggleLongPressEnabled","tone","toneBuffer","tooLong","tooShort","toolbar","top","topMargin","total","totalFrameDelay","totalVideoFrames","touch-action","touchAction","touched","touches","trace","track","trackVisibility","transaction","transactions","transceiver","transferControlToOffscreen","transferFromImageBitmap","transferImageBitmap","transferIn","transferOut","transferSize","transferToImageBitmap","transform","transform-box","transform-origin","transform-style","transformBox","transformFeedbackVaryings","transformOrigin","transformPoint","transformString","transformStyle","transformToDocument","transformToFragment","transition","transition-delay","transition-duration","transition-property","transition-timing-function","transitionDelay","transitionDuration","transitionProperty","transitionTimingFunction","translate","translateSelf","translationX","translationY","transport","trim","trimEnd","trimLeft","trimRight","trimStart","trueSpeed","trunc","truncate","trustedTypes","turn","twist","type","typeDetail","typeMismatch","typeMustMatch","types","u2f","ubound","uint16","uint32","uint8","uint8Clamped","undefined","unescape","uneval","unicode","unicode-bidi","unicodeBidi","unicodeRange","uniform1f","uniform1fv","uniform1i","uniform1iv","uniform1ui","uniform1uiv","uniform2f","uniform2fv","uniform2i","uniform2iv","uniform2ui","uniform2uiv","uniform3f","uniform3fv","uniform3i","uniform3iv","uniform3ui","uniform3uiv","uniform4f","uniform4fv","uniform4i","uniform4iv","uniform4ui","uniform4uiv","uniformBlockBinding","uniformMatrix2fv","uniformMatrix2x3fv","uniformMatrix2x4fv","uniformMatrix3fv","uniformMatrix3x2fv","uniformMatrix3x4fv","uniformMatrix4fv","uniformMatrix4x2fv","uniformMatrix4x3fv","unique","uniqueID","uniqueNumber","unit","unitType","units","unloadEventEnd","unloadEventStart","unlock","unmount","unobserve","unpause","unpauseAnimations","unreadCount","unregister","unregisterContentHandler","unregisterProtocolHandler","unscopables","unselectable","unshift","unsubscribe","unsuspendRedraw","unsuspendRedrawAll","unwatch","unwrapKey","upDegrees","upX","upY","upZ","update","updateCommands","updateIce","updateInterval","updatePlaybackRate","updateRenderState","updateSettings","updateTiming","updateViaCache","updateWith","updated","updating","upgrade","upload","uploadTotal","uploaded","upper","upperBound","upperOpen","uri","url","urn","urns","usages","usb","usbVersionMajor","usbVersionMinor","usbVersionSubminor","useCurrentView","useMap","useProgram","usedSpace","user-select","userActivation","userAgent","userChoice","userHandle","userHint","userLanguage","userSelect","userVisibleOnly","username","usernameFragment","utterance","uuid","v8BreakIterator","vAlign","vLink","valid","validate","validateProgram","validationMessage","validity","value","valueAsDate","valueAsNumber","valueAsString","valueInSpecifiedUnits","valueMissing","valueOf","valueText","valueType","values","variable","variant","variationSettings","vector-effect","vectorEffect","velocityAngular","velocityExpansion","velocityX","velocityY","vendor","vendorId","vendorSub","verify","version","vertexAttrib1f","vertexAttrib1fv","vertexAttrib2f","vertexAttrib2fv","vertexAttrib3f","vertexAttrib3fv","vertexAttrib4f","vertexAttrib4fv","vertexAttribDivisor","vertexAttribDivisorANGLE","vertexAttribI4i","vertexAttribI4iv","vertexAttribI4ui","vertexAttribI4uiv","vertexAttribIPointer","vertexAttribPointer","vertical","vertical-align","verticalAlign","verticalOverflow","vh","vibrate","vibrationActuator","videoBitsPerSecond","videoHeight","videoTracks","videoWidth","view","viewBox","viewBoxString","viewTarget","viewTargetString","viewport","viewportAnchorX","viewportAnchorY","viewportElement","views","violatedDirective","visibility","visibilityState","visible","visualViewport","vlinkColor","vmax","vmin","voice","voiceURI","volume","vrml","vspace","vw","w","wait","waitSync","waiting","wake","wakeLock","wand","warn","wasClean","wasDiscarded","watch","watchAvailability","watchPosition","webdriver","webkitAddKey","webkitAlignContent","webkitAlignItems","webkitAlignSelf","webkitAnimation","webkitAnimationDelay","webkitAnimationDirection","webkitAnimationDuration","webkitAnimationFillMode","webkitAnimationIterationCount","webkitAnimationName","webkitAnimationPlayState","webkitAnimationTimingFunction","webkitAppearance","webkitAudioContext","webkitAudioDecodedByteCount","webkitAudioPannerNode","webkitBackfaceVisibility","webkitBackground","webkitBackgroundAttachment","webkitBackgroundClip","webkitBackgroundColor","webkitBackgroundImage","webkitBackgroundOrigin","webkitBackgroundPosition","webkitBackgroundPositionX","webkitBackgroundPositionY","webkitBackgroundRepeat","webkitBackgroundSize","webkitBackingStorePixelRatio","webkitBorderBottomLeftRadius","webkitBorderBottomRightRadius","webkitBorderImage","webkitBorderImageOutset","webkitBorderImageRepeat","webkitBorderImageSlice","webkitBorderImageSource","webkitBorderImageWidth","webkitBorderRadius","webkitBorderTopLeftRadius","webkitBorderTopRightRadius","webkitBoxAlign","webkitBoxDirection","webkitBoxFlex","webkitBoxOrdinalGroup","webkitBoxOrient","webkitBoxPack","webkitBoxShadow","webkitBoxSizing","webkitCancelAnimationFrame","webkitCancelFullScreen","webkitCancelKeyRequest","webkitCancelRequestAnimationFrame","webkitClearResourceTimings","webkitClosedCaptionsVisible","webkitConvertPointFromNodeToPage","webkitConvertPointFromPageToNode","webkitCreateShadowRoot","webkitCurrentFullScreenElement","webkitCurrentPlaybackTargetIsWireless","webkitDecodedFrameCount","webkitDirectionInvertedFromDevice","webkitDisplayingFullscreen","webkitDroppedFrameCount","webkitEnterFullScreen","webkitEnterFullscreen","webkitEntries","webkitExitFullScreen","webkitExitFullscreen","webkitExitPointerLock","webkitFilter","webkitFlex","webkitFlexBasis","webkitFlexDirection","webkitFlexFlow","webkitFlexGrow","webkitFlexShrink","webkitFlexWrap","webkitFullScreenKeyboardInputAllowed","webkitFullscreenElement","webkitFullscreenEnabled","webkitGenerateKeyRequest","webkitGetAsEntry","webkitGetDatabaseNames","webkitGetEntries","webkitGetEntriesByName","webkitGetEntriesByType","webkitGetFlowByName","webkitGetGamepads","webkitGetImageDataHD","webkitGetNamedFlows","webkitGetRegionFlowRanges","webkitGetUserMedia","webkitHasClosedCaptions","webkitHidden","webkitIDBCursor","webkitIDBDatabase","webkitIDBDatabaseError","webkitIDBDatabaseException","webkitIDBFactory","webkitIDBIndex","webkitIDBKeyRange","webkitIDBObjectStore","webkitIDBRequest","webkitIDBTransaction","webkitImageSmoothingEnabled","webkitIndexedDB","webkitInitMessageEvent","webkitIsFullScreen","webkitJustifyContent","webkitKeys","webkitLineClamp","webkitLineDashOffset","webkitLockOrientation","webkitMask","webkitMaskClip","webkitMaskComposite","webkitMaskImage","webkitMaskOrigin","webkitMaskPosition","webkitMaskPositionX","webkitMaskPositionY","webkitMaskRepeat","webkitMaskSize","webkitMatchesSelector","webkitMediaStream","webkitNotifications","webkitOfflineAudioContext","webkitOrder","webkitOrientation","webkitPeerConnection00","webkitPersistentStorage","webkitPerspective","webkitPerspectiveOrigin","webkitPointerLockElement","webkitPostMessage","webkitPreservesPitch","webkitPutImageDataHD","webkitRTCPeerConnection","webkitRegionOverset","webkitRelativePath","webkitRequestAnimationFrame","webkitRequestFileSystem","webkitRequestFullScreen","webkitRequestFullscreen","webkitRequestPointerLock","webkitResolveLocalFileSystemURL","webkitSetMediaKeys","webkitSetResourceTimingBufferSize","webkitShadowRoot","webkitShowPlaybackTargetPicker","webkitSlice","webkitSpeechGrammar","webkitSpeechGrammarList","webkitSpeechRecognition","webkitSpeechRecognitionError","webkitSpeechRecognitionEvent","webkitStorageInfo","webkitSupportsFullscreen","webkitTemporaryStorage","webkitTextFillColor","webkitTextSizeAdjust","webkitTextStroke","webkitTextStrokeColor","webkitTextStrokeWidth","webkitTransform","webkitTransformOrigin","webkitTransformStyle","webkitTransition","webkitTransitionDelay","webkitTransitionDuration","webkitTransitionProperty","webkitTransitionTimingFunction","webkitURL","webkitUnlockOrientation","webkitUserSelect","webkitVideoDecodedByteCount","webkitVisibilityState","webkitWirelessVideoPlaybackDisabled","webkitdirectory","webkitdropzone","webstore","weight","whatToShow","wheelDelta","wheelDeltaX","wheelDeltaY","whenDefined","which","white-space","whiteSpace","wholeText","widows","width","will-change","willChange","willValidate","window","withCredentials","word-break","word-spacing","word-wrap","wordBreak","wordSpacing","wordWrap","workerStart","wrap","wrapKey","writable","writableAuxiliaries","write","writeText","writeValue","writeWithoutResponse","writeln","writing-mode","writingMode","x","x1","x2","xChannelSelector","xmlEncoding","xmlStandalone","xmlVersion","xmlbase","xmllang","xmlspace","xor","xr","y","y1","y2","yChannelSelector","yandex","z","z-index","zIndex","zoom","zoomAndPan","zoomRectScreen"];function find_builtins(e){domprops.forEach(o);var t={},n="object"==typeof global?global:self;function o(t){e.add(t);}["Symbol","Map","Promise","Proxy","Reflect","Set","WeakMap","WeakSet"].forEach((function(e){t[e]=n[e]||new Function;})),["null","true","false","NaN","Infinity","-Infinity","undefined"].forEach(o),[Object,Array,Function,Number,String,Boolean,Error,Math,Date,RegExp,t.Symbol,ArrayBuffer,DataView,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,eval,EvalError,Float32Array,Float64Array,Int8Array,Int16Array,Int32Array,isFinite,isNaN,JSON,t.Map,parseFloat,parseInt,t.Promise,t.Proxy,RangeError,ReferenceError,t.Reflect,t.Set,SyntaxError,TypeError,Uint8Array,Uint8ClampedArray,Uint16Array,Uint32Array,URIError,t.WeakMap,t.WeakSet].forEach((function(e){Object.getOwnPropertyNames(e).map(o),e.prototype&&Object.getOwnPropertyNames(e.prototype).map(o);}));}function reserve_quoted_keys(e,t){function n(e){push_uniq(t,e);}e.walk(new TreeWalker((function(e){e instanceof AST_ObjectKeyVal&&e.quote?n(e.key):e instanceof AST_ObjectProperty&&e.quote?n(e.key.name):e instanceof AST_Sub&&addStrings(e.property,n);})));}function addStrings(e,t){e.walk(new TreeWalker((function(e){return e instanceof AST_Sequence?addStrings(e.tail_node(),t):e instanceof AST_String?t(e.value):e instanceof AST_Conditional&&(addStrings(e.consequent,t),addStrings(e.alternative,t)),!0})));}function mangle_properties(e,t){var n=(t=defaults$1(t,{builtins:!1,cache:null,debug:!1,keep_quoted:!1,only_cache:!1,regex:null,reserved:null,undeclared:!1},!0)).reserved;Array.isArray(n)||(n=[n]);var o=new Set(n);t.builtins||find_builtins(o);var i,r=-1,a=-1,s=new Map;t.cache?(i=t.cache.props).forEach((function(e){o.add(e);})):i=new Map;var u,l=t.regex&&new RegExp(t.regex),_=!1!==t.debug;_&&(u=!0===t.debug?"":t.debug);var c=new Set,f=new Set,p=new Set,d="strict"===t.keep_quoted;return e.walk(new TreeWalker((function(e){if(e instanceof AST_ClassPrivateProperty||e instanceof AST_PrivateMethod)p.add(e.key.name);else if(e instanceof AST_DotHash)p.add(e.property);else if(e instanceof AST_ObjectKeyVal)"string"!=typeof e.key||d&&e.quote||A(e.key);else if(e instanceof AST_ObjectProperty)d&&e.key.end.quote||A(e.key.name);else if(e instanceof AST_Dot){var n=!!t.undeclared;if(!n){for(var o=e;o.expression;)o=o.expression;n=!(o.thedef&&o.thedef.undeclared);}!n||d&&e.quote||A(e.property);}else e instanceof AST_Sub?d||addStrings(e.property,A):e instanceof AST_Call&&"Object.defineProperty"==e.expression.print_to_string()?addStrings(e.args[1],A):e instanceof AST_Binary&&"in"===e.operator&&addStrings(e.left,A);}))),e.transform(new TreeTransformer((function(e){e instanceof AST_ClassPrivateProperty||e instanceof AST_PrivateMethod?e.key.name=h(e.key.name):e instanceof AST_DotHash?e.property=h(e.property):e instanceof AST_ObjectKeyVal?"string"!=typeof e.key||d&&e.quote||(e.key=T(e.key)):e instanceof AST_ObjectProperty?d&&e.key.end.quote||(e.key.name=T(e.key.name)):e instanceof AST_Dot?d&&e.quote||(e.property=T(e.property)):!t.keep_quoted&&e instanceof AST_Sub?e.property=E(e.property):e instanceof AST_Call&&"Object.defineProperty"==e.expression.print_to_string()?e.args[1]=E(e.args[1]):e instanceof AST_Binary&&"in"===e.operator&&(e.left=E(e.left));})));function S(e){return !f.has(e)&&!o.has(e)&&(t.only_cache?i.has(e):!/^-?[0-9]+(\.[0-9]+)?(e[+-][0-9]+)?$/.test(e))}function m(e){return !(l&&!l.test(e))&&!o.has(e)&&(i.has(e)||c.has(e))}function A(e){S(e)&&c.add(e),m(e)||f.add(e);}function T(e){if(!m(e))return e;var t=i.get(e);if(!t){if(_){var n="_$"+e+"$"+u+"_";S(n)&&(t=n);}if(!t)do{t=base54(++r);}while(!S(t));i.set(e,t);}return t}function h(e){let t=s.get(e);return t||(t=base54(++a),s.set(e,t)),t}function E(e){return e.transform(new TreeTransformer((function(e){if(e instanceof AST_Sequence){var t=e.expressions.length-1;e.expressions[t]=E(e.expressions[t]);}else e instanceof AST_String?e.value=T(e.value):e instanceof AST_Conditional&&(e.consequent=E(e.consequent),e.alternative=E(e.alternative));return e})))}}var to_ascii="undefined"==typeof atob?function(e){return Buffer.from(e,"base64").toString()}:atob,to_base64="undefined"==typeof btoa?function(e){return Buffer.from(e).toString("base64")}:btoa;function read_source_map(e){var t=/(?:^|[^.])\/\/# sourceMappingURL=data:application\/json(;[\w=-]*)?;base64,([+/0-9A-Za-z]*=*)\s*$/.exec(e);return t?to_ascii(t[2]):(console.warn("inline source map not found"),null)}function set_shorthand(e,t,n){t[e]&&n.forEach((function(n){t[n]&&("object"!=typeof t[n]&&(t[n]={}),e in t[n]||(t[n][e]=t[e]));}));}function init_cache(e){e&&("props"in e?e.props instanceof Map||(e.props=map_from_object(e.props)):e.props=new Map);}function cache_to_json(e){return {props:map_to_object(e.props)}}async function minify(e,t){var n,o,i=(t=defaults$1(t,{compress:{},ecma:void 0,enclose:!1,ie8:!1,keep_classnames:void 0,keep_fnames:!1,mangle:{},module:!1,nameCache:null,output:null,format:null,parse:{},rename:void 0,safari10:!1,sourceMap:!1,timings:!1,toplevel:!1,warnings:!1,wrap:!1},!0)).timings&&{start:Date.now()};if(void 0===t.keep_classnames&&(t.keep_classnames=t.keep_fnames),void 0===t.rename&&(t.rename=t.compress&&t.mangle),t.output&&t.format)throw new Error("Please only specify either output or format option, preferrably format.");if(t.format=t.format||t.output||{},set_shorthand("ecma",t,["parse","compress","format"]),set_shorthand("ie8",t,["compress","mangle","format"]),set_shorthand("keep_classnames",t,["compress","mangle"]),set_shorthand("keep_fnames",t,["compress","mangle"]),set_shorthand("module",t,["parse","compress","mangle"]),set_shorthand("safari10",t,["mangle","format"]),set_shorthand("toplevel",t,["compress","mangle"]),set_shorthand("warnings",t,["compress"]),t.mangle&&(t.mangle=defaults$1(t.mangle,{cache:t.nameCache&&(t.nameCache.vars||{}),eval:!1,ie8:!1,keep_classnames:!1,keep_fnames:!1,module:!1,properties:!1,reserved:[],safari10:!1,toplevel:!1},!0),t.mangle.properties&&("object"!=typeof t.mangle.properties&&(t.mangle.properties={}),t.mangle.properties.keep_quoted&&(n=t.mangle.properties.reserved,Array.isArray(n)||(n=[]),t.mangle.properties.reserved=n),t.nameCache&&!("cache"in t.mangle.properties)&&(t.mangle.properties.cache=t.nameCache.props||{})),init_cache(t.mangle.cache),init_cache(t.mangle.properties.cache)),t.sourceMap&&(t.sourceMap=defaults$1(t.sourceMap,{asObject:!1,content:null,filename:null,includeSources:!1,root:null,url:null},!0)),i&&(i.parse=Date.now()),e instanceof AST_Toplevel)o=e;else {for(var r in "string"==typeof e&&(e=[e]),t.parse=t.parse||{},t.parse.toplevel=null,e)if(HOP(e,r)&&(t.parse.filename=r,t.parse.toplevel=parse$5(e[r],t.parse),t.sourceMap&&"inline"==t.sourceMap.content)){if(Object.keys(e).length>1)throw new Error("inline source map only works with singular input");t.sourceMap.content=read_source_map(e[r]);}o=t.parse.toplevel;}n&&"strict"!==t.mangle.properties.keep_quoted&&reserve_quoted_keys(o,n),t.wrap&&(o=o.wrap_commonjs(t.wrap)),t.enclose&&(o=o.wrap_enclose(t.enclose)),i&&(i.rename=Date.now()),i&&(i.compress=Date.now()),t.compress&&(o=new Compressor(t.compress,{mangle_options:t.mangle}).compress(o)),i&&(i.scope=Date.now()),t.mangle&&o.figure_out_scope(t.mangle),i&&(i.mangle=Date.now()),t.mangle&&(base54.reset(),o.compute_char_frequency(t.mangle),o.mangle_names(t.mangle)),i&&(i.properties=Date.now()),t.mangle&&t.mangle.properties&&(o=mangle_properties(o,t.mangle.properties)),i&&(i.format=Date.now());var a={};if(t.format.ast&&(a.ast=o),!HOP(t.format,"code")||t.format.code){if(t.sourceMap&&(t.format.source_map=await SourceMap$3({file:t.sourceMap.filename,orig:t.sourceMap.content,root:t.sourceMap.root}),t.sourceMap.includeSources)){if(e instanceof AST_Toplevel)throw new Error("original source content unavailable");for(var r in e)HOP(e,r)&&t.format.source_map.get().setSourceContent(r,e[r]);}delete t.format.ast,delete t.format.code;var s=OutputStream(t.format);if(o.print(s),a.code=s.get(),t.sourceMap)if(t.sourceMap.asObject?a.map=t.format.source_map.get().toJSON():a.map=t.format.source_map.toString(),"inline"==t.sourceMap.url){var u="object"==typeof a.map?JSON.stringify(a.map):a.map;a.code+="\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,"+to_base64(u);}else t.sourceMap.url&&(a.code+="\n//# sourceMappingURL="+t.sourceMap.url);}return t.nameCache&&t.mangle&&(t.mangle.cache&&(t.nameCache.vars=cache_to_json(t.mangle.cache)),t.mangle.properties&&t.mangle.properties.cache&&(t.nameCache.props=cache_to_json(t.mangle.properties.cache))),t.format&&t.format.source_map&&t.format.source_map.destroy(),i&&(i.end=Date.now(),a.timings={parse:.001*(i.rename-i.parse),rename:.001*(i.compress-i.rename),compress:.001*(i.scope-i.compress),scope:.001*(i.mangle-i.scope),mangle:.001*(i.properties-i.mangle),properties:.001*(i.format-i.properties),format:.001*(i.end-i.format),total:.001*(i.end-i.start)}),a}
  8013. /**
  8014. * Performs the minification of JavaScript source
  8015. * @param input the JavaScript source to minify
  8016. * @param opts the options used by the minifier
  8017. * @returns the resulting minified JavaScript
  8018. */
  8019. const minifyJs = async (input, opts) => {
  8020. const results = {
  8021. output: input,
  8022. sourceMap: null,
  8023. diagnostics: [],
  8024. };
  8025. if (opts) {
  8026. const mangle = opts.mangle;
  8027. if (mangle) {
  8028. const mangleProperties = mangle.properties;
  8029. if (mangleProperties && mangleProperties.regex) {
  8030. mangleProperties.regex = new RegExp(mangleProperties.regex);
  8031. }
  8032. }
  8033. if (opts.sourceMap) {
  8034. /**
  8035. * sourceMap, when used in conjunction with compress, can lead to sourcemaps that don't in every browser. despite
  8036. * there being a sourcemap spec, each browser has it's own tricks for trying to get sourcemaps to properly map
  8037. * minified JS back to its original form. for the most consistent results across all browsers, explicitly disable
  8038. * compress.
  8039. */
  8040. opts.compress = undefined;
  8041. }
  8042. }
  8043. try {
  8044. const minifyResults = await minify(input, opts);
  8045. results.output = minifyResults.code;
  8046. results.sourceMap = typeof minifyResults.map === 'string' ? JSON.parse(minifyResults.map) : minifyResults.map;
  8047. const compress = opts.compress;
  8048. if (compress && compress.module && results.output.endsWith('};')) {
  8049. // stripping the semicolon here _shouldn't_ be of significant consequence for the already generated sourcemap
  8050. results.output = results.output.substring(0, results.output.length - 1);
  8051. }
  8052. }
  8053. catch (e) {
  8054. if (e instanceof Error) {
  8055. console.log(e.stack);
  8056. }
  8057. loadMinifyJsDiagnostics(input, results.diagnostics, e);
  8058. }
  8059. return results;
  8060. };
  8061. const loadMinifyJsDiagnostics = (sourceText, diagnostics, error) => {
  8062. const d = {
  8063. level: 'error',
  8064. type: 'build',
  8065. language: 'javascript',
  8066. header: 'Minify JS',
  8067. code: '',
  8068. messageText: error.message,
  8069. absFilePath: null,
  8070. relFilePath: null,
  8071. lines: [],
  8072. };
  8073. const err = error;
  8074. if (typeof err.line === 'number' && err.line > -1) {
  8075. const srcLines = splitLineBreaks(sourceText);
  8076. const errorLine = {
  8077. lineIndex: err.line - 1,
  8078. lineNumber: err.line,
  8079. text: srcLines[err.line - 1],
  8080. errorCharStart: err.col,
  8081. errorLength: 0,
  8082. };
  8083. d.lineNumber = errorLine.lineNumber;
  8084. d.columnNumber = errorLine.errorCharStart;
  8085. const highlightLine = errorLine.text.slice(d.columnNumber);
  8086. for (let i = 0; i < highlightLine.length; i++) {
  8087. if (MINIFY_CHAR_BREAK.has(highlightLine.charAt(i))) {
  8088. break;
  8089. }
  8090. errorLine.errorLength++;
  8091. }
  8092. d.lines.push(errorLine);
  8093. if (errorLine.errorLength === 0 && errorLine.errorCharStart > 0) {
  8094. errorLine.errorLength = 1;
  8095. errorLine.errorCharStart--;
  8096. }
  8097. if (errorLine.lineIndex > 0) {
  8098. const previousLine = {
  8099. lineIndex: errorLine.lineIndex - 1,
  8100. lineNumber: errorLine.lineNumber - 1,
  8101. text: srcLines[errorLine.lineIndex - 1],
  8102. errorCharStart: -1,
  8103. errorLength: -1,
  8104. };
  8105. d.lines.unshift(previousLine);
  8106. }
  8107. if (errorLine.lineIndex + 1 < srcLines.length) {
  8108. const nextLine = {
  8109. lineIndex: errorLine.lineIndex + 1,
  8110. lineNumber: errorLine.lineNumber + 1,
  8111. text: srcLines[errorLine.lineIndex + 1],
  8112. errorCharStart: -1,
  8113. errorLength: -1,
  8114. };
  8115. d.lines.push(nextLine);
  8116. }
  8117. }
  8118. diagnostics.push(d);
  8119. };
  8120. const MINIFY_CHAR_BREAK = new Set([
  8121. ' ',
  8122. '=',
  8123. '.',
  8124. ',',
  8125. '?',
  8126. ':',
  8127. ';',
  8128. '(',
  8129. ')',
  8130. '{',
  8131. '}',
  8132. '[',
  8133. ']',
  8134. '|',
  8135. `'`,
  8136. `"`,
  8137. '`',
  8138. ]);
  8139. var SourceMapConsumer = sourceMap.SourceMapConsumer;
  8140. var SourceMapGenerator = sourceMap.SourceMapGenerator;
  8141. var mergeSourceMap = merge;
  8142. /**
  8143. * Merge old source map and new source map and return merged.
  8144. * If old or new source map value is falsy, return another one as it is.
  8145. *
  8146. * @param {object|string} [oldMap] old source map object
  8147. * @param {object|string} [newmap] new source map object
  8148. * @return {object|undefined} merged source map object, or undefined when both old and new source map are undefined
  8149. */
  8150. function merge(oldMap, newMap) {
  8151. if (!oldMap) return newMap
  8152. if (!newMap) return oldMap
  8153. var oldMapConsumer = new SourceMapConsumer(oldMap);
  8154. var newMapConsumer = new SourceMapConsumer(newMap);
  8155. var mergedMapGenerator = new SourceMapGenerator();
  8156. // iterate on new map and overwrite original position of new map with one of old map
  8157. newMapConsumer.eachMapping(function(m) {
  8158. // pass when `originalLine` is null.
  8159. // It occurs in case that the node does not have origin in original code.
  8160. if (m.originalLine == null) return
  8161. var origPosInOldMap = oldMapConsumer.originalPositionFor({
  8162. line: m.originalLine,
  8163. column: m.originalColumn
  8164. });
  8165. if (origPosInOldMap.source == null) return
  8166. mergedMapGenerator.addMapping({
  8167. original: {
  8168. line: origPosInOldMap.line,
  8169. column: origPosInOldMap.column
  8170. },
  8171. generated: {
  8172. line: m.generatedLine,
  8173. column: m.generatedColumn
  8174. },
  8175. source: origPosInOldMap.source,
  8176. name: origPosInOldMap.name
  8177. });
  8178. });
  8179. var consumers = [oldMapConsumer, newMapConsumer];
  8180. consumers.forEach(function(consumer) {
  8181. consumer.sources.forEach(function(sourceFile) {
  8182. mergedMapGenerator._sources.add(sourceFile);
  8183. var sourceContent = consumer.sourceContentFor(sourceFile);
  8184. if (sourceContent != null) {
  8185. mergedMapGenerator.setSourceContent(sourceFile, sourceContent);
  8186. }
  8187. });
  8188. });
  8189. mergedMapGenerator._sourceRoot = oldMap.sourceRoot;
  8190. mergedMapGenerator._file = oldMap.file;
  8191. return JSON.parse(mergedMapGenerator.toString())
  8192. }
  8193. process.browser=!IS_NODE_ENV;const t={};var r,n$3=undefined&&undefined.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,i=0,a=t.length;i<a;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))},i$1=undefined&&undefined.__assign||function(){return (i$1=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},a=undefined&&undefined.__makeTemplateObject||function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},o=undefined&&undefined.__generator||function(e,t){var r,n,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,n=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o);}catch(e){a=[6,e],n=0;}finally{r=i=0;}if(5&a[0])throw a[1];return {value:a[0]?a[1]:void 0,done:!0}}([a,s])}}},s=undefined&&undefined.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);}return r},c=undefined&&undefined.__extends||(r=function(e,t){return (r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t;}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e;}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n);});!function(e){function t(){var e={};return e.prev=e,{head:e,tail:e,size:0}}function r(e,t){return e===t||e!=e&&t!=t}function n(e){var t=e.prev;if(!t||t===e)throw new Error("Illegal state");return t}function i(e){for(;e;){var t=!e.prev;if(e=e.next,!t)return e}}function a(e,t){for(var i=e.tail;i!==e.head;i=n(i))if(r(i.key,t))return i}function o(e,t,r){var n=a(e,t);if(!n){var i=function(e,t){return {key:e,value:t,next:void 0,prev:void 0}}(t,r);return i.prev=e.tail,e.tail.next=i,e.tail=i,e.size++,i}n.value=r;}function s(e,t){for(var i=e.tail;i!==e.head;i=n(i)){if(void 0===i.prev)throw new Error("Illegal state");if(r(i.key,t)){if(i.next)i.next.prev=i.prev;else {if(e.tail!==i)throw new Error("Illegal state");e.tail=i.prev;}return i.prev.next=i.next,i.next=i.prev,i.prev=void 0,e.size--,i}}}function c(e){for(var t=e.tail;t!==e.head;){var r=n(t);t.next=e.head,t.prev=void 0,t=r;}e.head.next=void 0,e.tail=e.head,e.size=0;}function l(e,t){for(var r=e.head;r;)(r=i(r))&&t(r.value,r.key);}function u(e,t){if(e)for(var r=e.next();!r.done;r=e.next())t(r.value);}function _(e,t){return {current:e.head,selector:t}}function d(e){return e.current=i(e.current),e.current?{value:e.selector(e.current.key,e.current.value),done:!1}:{value:void 0,done:!0}}var p;(p=e.ShimCollections||(e.ShimCollections={})).createMapShim=function(e){var r=function(){function e(e,t){this._data=_(e,t);}return e.prototype.next=function(){return d(this._data)},e}();return function(){function n(r){var n=this;this._mapData=t(),u(e(r),(function(e){var t=e[0],r=e[1];return n.set(t,r)}));}return Object.defineProperty(n.prototype,"size",{get:function(){return this._mapData.size},enumerable:!1,configurable:!0}),n.prototype.get=function(e){var t;return null===(t=a(this._mapData,e))||void 0===t?void 0:t.value},n.prototype.set=function(e,t){return o(this._mapData,e,t),this},n.prototype.has=function(e){return !!a(this._mapData,e)},n.prototype.delete=function(e){return !!s(this._mapData,e)},n.prototype.clear=function(){c(this._mapData);},n.prototype.keys=function(){return new r(this._mapData,(function(e,t){return e}))},n.prototype.values=function(){return new r(this._mapData,(function(e,t){return t}))},n.prototype.entries=function(){return new r(this._mapData,(function(e,t){return [e,t]}))},n.prototype.forEach=function(e){l(this._mapData,e);},n}()},p.createSetShim=function(e){var r=function(){function e(e,t){this._data=_(e,t);}return e.prototype.next=function(){return d(this._data)},e}();return function(){function n(r){var n=this;this._mapData=t(),u(e(r),(function(e){return n.add(e)}));}return Object.defineProperty(n.prototype,"size",{get:function(){return this._mapData.size},enumerable:!1,configurable:!0}),n.prototype.add=function(e){return o(this._mapData,e,e),this},n.prototype.has=function(e){return !!a(this._mapData,e)},n.prototype.delete=function(e){return !!s(this._mapData,e)},n.prototype.clear=function(){c(this._mapData);},n.prototype.keys=function(){return new r(this._mapData,(function(e,t){return e}))},n.prototype.values=function(){return new r(this._mapData,(function(e,t){return t}))},n.prototype.entries=function(){return new r(this._mapData,(function(e,t){return [e,t]}))},n.prototype.forEach=function(e){l(this._mapData,e);},n}()};}(t),function(e){var t,r;function n(r,n,i){var a,o=null!==(a=t[n]())&&void 0!==a?a:null===e.ShimCollections||void 0===e.ShimCollections?void 0:e.ShimCollections[i](e.getIterator);if(o)return o;throw new Error("TypeScript requires an environment that provides a compatible native ".concat(r," implementation."))}e.versionMajorMinor="4.5",e.version="4.5.4",(r=e.Comparison||(e.Comparison={}))[r.LessThan=-1]="LessThan",r[r.EqualTo=0]="EqualTo",r[r.GreaterThan=1]="GreaterThan",function(e){e.tryGetNativeMap=function(){return "undefined"!=typeof Map&&"entries"in Map.prototype&&1===new Map([[0,0]]).size?Map:void 0},e.tryGetNativeSet=function(){return "undefined"!=typeof Set&&"entries"in Set.prototype&&1===new Set([0]).size?Set:void 0};}(t||(t={})),e.Map=n("Map","tryGetNativeMap","createMapShim"),e.Set=n("Set","tryGetNativeSet","createSetShim");}(t),function(e){function t(e,t,r){if(void 0===r&&(r=I),e)for(var n=0,i=e;n<i.length;n++)if(r(i[n],t))return !0;return !1}function r(e,t){if(e){if(!t)return e.length>0;for(var r=0,n=e;r<n.length;r++)if(t(n[r]))return !0}return !1}function i(e,t){return r(t)?r(e)?n$3(n$3([],e,!0),t,!0):t:e}function a(e,t){return t}function o(e){return e.map(a)}function s(e,t){return void 0===t?e:void 0===e?[t]:(e.push(t),e)}function c(e,t){return t<0?e.length+t:t}function l(e,t,r,n){if(void 0===t||0===t.length)return e;if(void 0===e)return t.slice(r,n);r=void 0===r?0:c(t,r),n=void 0===n?t.length:c(t,n);for(var i=r;i<n&&i<t.length;i++)void 0!==t[i]&&e.push(t[i]);return e}function u(e,r,n){return !t(e,r,n)&&(e.push(r),!0)}function _(e,t,r){t.sort((function(t,n){return r(e[t],e[n])||M(t,n)}));}function d(e,t){return 0===e.length?e:e.slice().sort(t)}function p(e){var t=0;return {next:function(){return t===e.length?{value:void 0,done:!0}:(t++,{value:e[t-1],done:!1})}}}function f(e,t,r,n,i){return g(e,r(t),r,n,i)}function g(e,t,n,i,a){if(!r(e))return -1;for(var o=a||0,s=e.length-1;o<=s;){var c=o+(s-o>>1);switch(i(n(e[c],c),t)){case-1:o=c+1;break;case 0:return c;case 1:s=c-1;}}return ~o}function m(e,t,r,n,i){if(e&&e.length>0){var a=e.length;if(a>0){var o=void 0===n||n<0?0:n,s=void 0===i||o+i>a-1?a-1:o+i,c=void 0;for(arguments.length<=2?(c=e[o],o++):c=r;o<=s;)c=t(c,e[o],o),o++;return c}}return r}e.getIterator=function(t){if(t){if(E(t))return p(t);if(t instanceof e.Map)return t.entries();if(t instanceof e.Set)return t.values();throw new Error("Iteration not supported.")}},e.emptyArray=[],e.emptyMap=new e.Map,e.emptySet=new e.Set,e.createMap=function(){return new e.Map},e.createMapFromTemplate=function(t){var r=new e.Map;for(var n in t)y.call(t,n)&&r.set(n,t[n]);return r},e.length=function(e){return e?e.length:0},e.forEach=function(e,t){if(e)for(var r=0;r<e.length;r++){var n=t(e[r],r);if(n)return n}},e.forEachRight=function(e,t){if(e)for(var r=e.length-1;r>=0;r--){var n=t(e[r],r);if(n)return n}},e.firstDefined=function(e,t){if(void 0!==e)for(var r=0;r<e.length;r++){var n=t(e[r],r);if(void 0!==n)return n}},e.firstDefinedIterator=function(e,t){for(;;){var r=e.next();if(r.done)return;var n=t(r.value);if(void 0!==n)return n}},e.reduceLeftIterator=function(e,t,r){var n=r;if(e)for(var i=e.next(),a=0;!i.done;i=e.next(),a++)n=t(n,i.value,a);return n},e.zipWith=function(t,r,n){var i=[];e.Debug.assertEqual(t.length,r.length);for(var a=0;a<t.length;a++)i.push(n(t[a],r[a],a));return i},e.zipToIterator=function(t,r){e.Debug.assertEqual(t.length,r.length);var n=0;return {next:function(){return n===t.length?{value:void 0,done:!0}:(n++,{value:[t[n-1],r[n-1]],done:!1})}}},e.zipToMap=function(t,r){e.Debug.assert(t.length===r.length);for(var n=new e.Map,i=0;i<t.length;++i)n.set(t[i],r[i]);return n},e.intersperse=function(e,t){if(e.length<=1)return e;for(var r=[],n=0,i=e.length;n<i;n++)n&&r.push(t),r.push(e[n]);return r},e.every=function(e,t){if(e)for(var r=0;r<e.length;r++)if(!t(e[r],r))return !1;return !0},e.find=function(e,t){for(var r=0;r<e.length;r++){var n=e[r];if(t(n,r))return n}},e.findLast=function(e,t){for(var r=e.length-1;r>=0;r--){var n=e[r];if(t(n,r))return n}},e.findIndex=function(e,t,r){for(var n=r||0;n<e.length;n++)if(t(e[n],n))return n;return -1},e.findLastIndex=function(e,t,r){for(var n=void 0===r?e.length-1:r;n>=0;n--)if(t(e[n],n))return n;return -1},e.findMap=function(t,r){for(var n=0;n<t.length;n++){var i=r(t[n],n);if(i)return i}return e.Debug.fail()},e.contains=t,e.arraysEqual=function(e,t,r){return void 0===r&&(r=I),e.length===t.length&&e.every((function(e,n){return r(e,t[n])}))},e.indexOfAnyCharCode=function(e,r,n){for(var i=n||0;i<e.length;i++)if(t(r,e.charCodeAt(i)))return i;return -1},e.countWhere=function(e,t){var r=0;if(e)for(var n=0;n<e.length;n++)t(e[n],n)&&r++;return r},e.filter=function(e,t){if(e){for(var r=e.length,n=0;n<r&&t(e[n]);)n++;if(n<r){var i=e.slice(0,n);for(n++;n<r;){var a=e[n];t(a)&&i.push(a),n++;}return i}}return e},e.filterMutate=function(e,t){for(var r=0,n=0;n<e.length;n++)t(e[n],n,e)&&(e[r]=e[n],r++);e.length=r;},e.clear=function(e){e.length=0;},e.map=function(e,t){var r;if(e){r=[];for(var n=0;n<e.length;n++)r.push(t(e[n],n));}return r},e.mapIterator=function(e,t){return {next:function(){var r=e.next();return r.done?r:{value:t(r.value),done:!1}}}},e.sameMap=function(e,t){if(e)for(var r=0;r<e.length;r++){var n=e[r],i=t(n,r);if(n!==i){var a=e.slice(0,r);for(a.push(i),r++;r<e.length;r++)a.push(t(e[r],r));return a}}return e},e.flatten=function(e){for(var t=[],r=0,n=e;r<n.length;r++){var i=n[r];i&&(E(i)?l(t,i):t.push(i));}return t},e.flatMap=function(t,r){var n;if(t)for(var i=0;i<t.length;i++){var a=r(t[i],i);a&&(n=E(a)?l(n,a):s(n,a));}return n||e.emptyArray},e.flatMapToMutable=function(e,t){var r=[];if(e)for(var n=0;n<e.length;n++){var i=t(e[n],n);i&&(E(i)?l(r,i):r.push(i));}return r},e.flatMapIterator=function(t,r){var n=t.next();if(n.done)return e.emptyIterator;var i=a(n.value);return {next:function(){for(;;){var e=i.next();if(!e.done)return e;var r=t.next();if(r.done)return r;i=a(r.value);}}};function a(t){var n=r(t);return void 0===n?e.emptyIterator:E(n)?p(n):n}},e.sameFlatMap=function(e,t){var r;if(e)for(var n=0;n<e.length;n++){var i=e[n],a=t(i,n);(r||i!==a||E(a))&&(r||(r=e.slice(0,n)),E(a)?l(r,a):r.push(a));}return r||e},e.mapAllOrFail=function(e,t){for(var r=[],n=0;n<e.length;n++){var i=t(e[n],n);if(void 0===i)return;r.push(i);}return r},e.mapDefined=function(e,t){var r=[];if(e)for(var n=0;n<e.length;n++){var i=t(e[n],n);void 0!==i&&r.push(i);}return r},e.mapDefinedIterator=function(e,t){return {next:function(){for(;;){var r=e.next();if(r.done)return r;var n=t(r.value);if(void 0!==n)return {value:n,done:!1}}}}},e.mapDefinedEntries=function(t,r){if(t){var n=new e.Map;return t.forEach((function(e,t){var i=r(t,e);if(void 0!==i){var a=i[0],o=i[1];void 0!==a&&void 0!==o&&n.set(a,o);}})),n}},e.mapDefinedValues=function(t,r){if(t){var n=new e.Set;return t.forEach((function(e){var t=r(e);void 0!==t&&n.add(t);})),n}},e.getOrUpdate=function(e,t,r){if(e.has(t))return e.get(t);var n=r();return e.set(t,n),n},e.tryAddToSet=function(e,t){return !e.has(t)&&(e.add(t),!0)},e.emptyIterator={next:function(){return {value:void 0,done:!0}}},e.singleIterator=function(e){var t=!1;return {next:function(){var r=t;return t=!0,r?{value:void 0,done:!0}:{value:e,done:!1}}}},e.spanMap=function(e,t,r){var n;if(e){n=[];for(var i=e.length,a=void 0,o=void 0,s=0,c=0;s<i;){for(;c<i;){if(o=t(e[c],c),0===c)a=o;else if(o!==a)break;c++;}if(s<c){var l=r(e.slice(s,c),a,s,c);l&&n.push(l),s=c;}a=o,c++;}}return n},e.mapEntries=function(t,r){if(t){var n=new e.Map;return t.forEach((function(e,t){var i=r(t,e),a=i[0],o=i[1];n.set(a,o);})),n}},e.some=r,e.getRangesWhere=function(e,t,r){for(var n,i=0;i<e.length;i++)t(e[i])?n=void 0===n?i:n:void 0!==n&&(r(n,i),n=void 0);void 0!==n&&r(n,e.length);},e.concatenate=i,e.indicesOf=o,e.deduplicate=function(e,t,r){return 0===e.length?[]:1===e.length?e.slice():r?function(e,t,r){var n=o(e);_(e,n,r);for(var i=e[n[0]],a=[n[0]],s=1;s<n.length;s++){var c=n[s],l=e[c];t(i,l)||(a.push(c),i=l);}return a.sort(),a.map((function(t){return e[t]}))}(e,t,r):function(e,t){for(var r=[],n=0,i=e;n<i.length;n++)u(r,i[n],t);return r}(e,t)},e.insertSorted=function(e,t,r){if(0!==e.length){var n=f(e,t,N,r);n<0&&e.splice(~n,0,t);}else e.push(t);},e.sortAndDeduplicate=function(t,r,n){return function(t,r){if(0===t.length)return e.emptyArray;for(var n=t[0],i=[n],a=1;a<t.length;a++){var o=t[a];switch(r(o,n)){case!0:case 0:continue;case-1:return e.Debug.fail("Array is unsorted.")}i.push(n=o);}return i}(d(t,r),n||r||R)},e.arrayIsSorted=function(e,t){if(e.length<2)return !0;for(var r=e[0],n=0,i=e.slice(1);n<i.length;n++){var a=i[n];if(1===t(r,a))return !1;r=a;}return !0},e.arrayIsEqualTo=function(e,t,r){if(void 0===r&&(r=I),!e||!t)return e===t;if(e.length!==t.length)return !1;for(var n=0;n<e.length;n++)if(!r(e[n],t[n],n))return !1;return !0},e.compact=function(e){var t;if(e)for(var r=0;r<e.length;r++){var n=e[r];!t&&n||(t||(t=e.slice(0,r)),n&&t.push(n));}return t||e},e.relativeComplement=function(t,r,n){if(!r||!t||0===r.length||0===t.length)return r;var i=[];e:for(var a=0,o=0;o<r.length;o++){o>0&&e.Debug.assertGreaterThanOrEqual(n(r[o],r[o-1]),0);t:for(var s=a;a<t.length;a++)switch(a>s&&e.Debug.assertGreaterThanOrEqual(n(t[a],t[a-1]),0),n(r[o],t[a])){case-1:i.push(r[o]);continue e;case 0:continue e;case 1:continue t}}return i},e.sum=function(e,t){for(var r=0,n=0,i=e;n<i.length;n++)r+=i[n][t];return r},e.append=s,e.combine=function(e,t){return void 0===e?t:void 0===t?e:E(e)?E(t)?i(e,t):s(e,t):E(t)?s(t,e):[e,t]},e.addRange=l,e.pushIfUnique=u,e.appendIfUnique=function(e,t,r){return e?(u(e,t,r),e):[t]},e.sort=d,e.arrayIterator=p,e.arrayReverseIterator=function(e){var t=e.length;return {next:function(){return 0===t?{value:void 0,done:!0}:(t--,{value:e[t],done:!1})}}},e.stableSort=function(e,t){var r=o(e);return _(e,r,t),r.map((function(t){return e[t]}))},e.rangeEquals=function(e,t,r,n){for(;r<n;){if(e[r]!==t[r])return !1;r++;}return !0},e.elementAt=function(e,t){if(e&&(t=c(e,t))<e.length)return e[t]},e.firstOrUndefined=function(e){return 0===e.length?void 0:e[0]},e.first=function(t){return e.Debug.assert(0!==t.length),t[0]},e.lastOrUndefined=function(e){return 0===e.length?void 0:e[e.length-1]},e.last=function(t){return e.Debug.assert(0!==t.length),t[t.length-1]},e.singleOrUndefined=function(e){return e&&1===e.length?e[0]:void 0},e.singleOrMany=function(e){return e&&1===e.length?e[0]:e},e.replaceElement=function(e,t,r){var n=e.slice(0);return n[t]=r,n},e.binarySearch=f,e.binarySearchKey=g,e.reduceLeft=m;var y=Object.prototype.hasOwnProperty;function v(e,t){return y.call(e,t)}function h(e){var t=[];for(var r in e)y.call(e,r)&&t.push(r);return t}e.hasProperty=v,e.getProperty=function(e,t){return y.call(e,t)?e[t]:void 0},e.getOwnKeys=h,e.getAllKeys=function(e){var t=[];do{for(var r=0,n=Object.getOwnPropertyNames(e);r<n.length;r++)u(t,n[r]);}while(e=Object.getPrototypeOf(e));return t},e.getOwnValues=function(e){var t=[];for(var r in e)y.call(e,r)&&t.push(e[r]);return t};var b=Object.entries||function(e){for(var t=h(e),r=Array(t.length),n=0;n<t.length;n++)r[n]=[t[n],e[t[n]]];return r};function x(e,t){for(var r=[],n=e.next();!n.done;n=e.next())r.push(t?t(n.value):n.value);return r}function D(e,t,r){void 0===r&&(r=N);for(var n=S(),i=0,a=e;i<a.length;i++){var o=a[i];n.add(t(o),r(o));}return n}function S(){var t=new e.Map;return t.add=T,t.remove=C,t}function T(e,t){var r=this.get(e);return r?r.push(t):this.set(e,r=[t]),r}function C(e,t){var r=this.get(e);r&&(q(r,t),r.length||this.delete(e));}function E(e){return Array.isArray?Array.isArray(e):e instanceof Array}function k(e){}function N(e){return e}function F(e){return e.toLowerCase()}e.getEntries=function(e){return e?b(e):[]},e.arrayOf=function(e,t){for(var r=new Array(e),n=0;n<e;n++)r[n]=t(n);return r},e.arrayFrom=x,e.assign=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];for(var n=0,i=t;n<i.length;n++){var a=i[n];if(void 0!==a)for(var o in a)v(a,o)&&(e[o]=a[o]);}return e},e.equalOwnProperties=function(e,t,r){if(void 0===r&&(r=I),e===t)return !0;if(!e||!t)return !1;for(var n in e)if(y.call(e,n)){if(!y.call(t,n))return !1;if(!r(e[n],t[n]))return !1}for(var n in t)if(y.call(t,n)&&!y.call(e,n))return !1;return !0},e.arrayToMap=function(t,r,n){void 0===n&&(n=N);for(var i=new e.Map,a=0,o=t;a<o.length;a++){var s=o[a],c=r(s);void 0!==c&&i.set(c,n(s));}return i},e.arrayToNumericMap=function(e,t,r){void 0===r&&(r=N);for(var n=[],i=0,a=e;i<a.length;i++){var o=a[i];n[t(o)]=r(o);}return n},e.arrayToMultiMap=D,e.group=function(e,t,r){return void 0===r&&(r=N),x(D(e,t).values(),r)},e.clone=function(e){var t={};for(var r in e)y.call(e,r)&&(t[r]=e[r]);return t},e.extend=function(e,t){var r={};for(var n in t)y.call(t,n)&&(r[n]=t[n]);for(var n in e)y.call(e,n)&&(r[n]=e[n]);return r},e.copyProperties=function(e,t){for(var r in t)y.call(t,r)&&(e[r]=t[r]);},e.maybeBind=function(e,t){return t?t.bind(e):void 0},e.createMultiMap=S,e.createUnderscoreEscapedMultiMap=function(){return S()},e.isArray=E,e.toArray=function(e){return E(e)?e:[e]},e.isString=function(e){return "string"==typeof e},e.isNumber=function(e){return "number"==typeof e},e.tryCast=function(e,t){return void 0!==e&&t(e)?e:void 0},e.cast=function(t,r){return void 0!==t&&r(t)?t:e.Debug.fail("Invalid cast. The supplied value ".concat(t," did not pass the test '").concat(e.Debug.getFunctionName(r),"'."))},e.noop=k,e.returnFalse=function(){return !1},e.returnTrue=function(){return !0},e.returnUndefined=function(){},e.identity=N,e.toLowerCase=F;var A,P=/[^\u0130\u0131\u00DFa-z0-9\\/:\-_\. ]+/g;function w(e){return P.test(e)?e.replace(P,F):e}function I(e,t){return e===t}function O(e,t){return e===t?0:void 0===e?-1:void 0===t?1:e<t?-1:1}function M(e,t){return O(e,t)}function L(e,t){return e===t?0:void 0===e?-1:void 0===t?1:(e=e.toUpperCase())<(t=t.toUpperCase())?-1:e>t?1:0}function R(e,t){return O(e,t)}e.toFileNameLowerCase=w,e.notImplemented=function(){throw new Error("Not implemented")},e.memoize=function(e){var t;return function(){return e&&(t=e(),e=void 0),t}},e.memoizeOne=function(t){var r=new e.Map;return function(e){var n="".concat(typeof e,":").concat(e),i=r.get(n);return void 0!==i||r.has(n)||(i=t(e),r.set(n,i)),i}},e.compose=function(e,t,r,n,i){if(i){for(var a=[],o=0;o<arguments.length;o++)a[o]=arguments[o];return function(e){return m(a,(function(e,t){return t(e)}),e)}}return n?function(i){return n(r(t(e(i))))}:r?function(n){return r(t(e(n)))}:t?function(r){return t(e(r))}:e?function(t){return e(t)}:function(e){return e}},(A=e.AssertionLevel||(e.AssertionLevel={}))[A.None=0]="None",A[A.Normal=1]="Normal",A[A.Aggressive=2]="Aggressive",A[A.VeryAggressive=3]="VeryAggressive",e.equateValues=I,e.equateStringsCaseInsensitive=function(e,t){return e===t||void 0!==e&&void 0!==t&&e.toUpperCase()===t.toUpperCase()},e.equateStringsCaseSensitive=function(e,t){return I(e,t)},e.compareValues=M,e.compareTextSpans=function(e,t){return M(null==e?void 0:e.start,null==t?void 0:t.start)||M(null==e?void 0:e.length,null==t?void 0:t.length)},e.min=function(e,t,r){return -1===r(e,t)?e:t},e.compareStringsCaseInsensitive=L,e.compareStringsCaseSensitive=R,e.getStringComparer=function(e){return e?L:R};var B,j,J=function(){var e,t,r="object"==typeof Intl&&"function"==typeof Intl.Collator?i:"function"==typeof String.prototype.localeCompare&&"function"==typeof String.prototype.toLocaleUpperCase&&"a".localeCompare("B")<0?a:o;return function(n){return void 0===n?e||(e=r(n)):"en-US"===n?t||(t=r(n)):r(n)};function n(e,t,r){if(e===t)return 0;if(void 0===e)return -1;if(void 0===t)return 1;var n=r(e,t);return n<0?-1:n>0?1:0}function i(e){var t=new Intl.Collator(e,{usage:"sort",sensitivity:"variant"}).compare;return function(e,r){return n(e,r,t)}}function a(e){return void 0!==e?o():function(e,r){return n(e,r,t)};function t(e,t){return e.localeCompare(t)}}function o(){return function(t,r){return n(t,r,e)};function e(e,r){return t(e.toUpperCase(),r.toUpperCase())||t(e,r)}function t(e,t){return e<t?-1:e>t?1:0}}}();function z(e,t,r){for(var n=new Array(t.length+1),i=new Array(t.length+1),a=r+.01,o=0;o<=t.length;o++)n[o]=o;for(o=1;o<=e.length;o++){var s=e.charCodeAt(o-1),c=Math.ceil(o>r?o-r:1),l=Math.floor(t.length>r+o?r+o:t.length);i[0]=o;for(var u=o,_=1;_<c;_++)i[_]=a;for(_=c;_<=l;_++){var d=e[o-1].toLowerCase()===t[_-1].toLowerCase()?n[_-1]+.1:n[_-1]+2,p=s===t.charCodeAt(_-1)?n[_-1]:Math.min(n[_]+1,i[_-1]+1,d);i[_]=p,u=Math.min(u,p);}for(_=l+1;_<=t.length;_++)i[_]=a;if(u>r)return;var f=n;n=i,i=f;}var g=n[t.length];return g>r?void 0:g}function U(e,t){var r=e.length-t.length;return r>=0&&e.indexOf(t,r)===r}function K(e,t){for(var r=t;r<e.length-1;r++)e[r]=e[r+1];e.pop();}function V(e,t){e[t]=e[e.length-1],e.pop();}function q(e,t){return function(e,r){for(var n=0;n<e.length;n++)if(e[n]===t)return V(e,n),!0;return !1}(e)}function W(e,t){return 0===e.lastIndexOf(t,0)}function H(e,t){var r=e.prefix,n=e.suffix;return t.length>=r.length+n.length&&W(t,r)&&U(t,n)}function G(e,t,r,n){for(var i=0,a=e[n];i<a.length;i++){var o=a[i],s=void 0;r?(s=r.slice()).push(o):s=[o],n===e.length-1?t.push(s):G(e,t,s,n+1);}}e.getUILocale=function(){return j},e.setUILocale=function(e){j!==e&&(j=e,B=void 0);},e.compareStringsCaseSensitiveUI=function(e,t){return (B||(B=J(j)))(e,t)},e.compareProperties=function(e,t,r,n){return e===t?0:void 0===e?-1:void 0===t?1:n(e[r],t[r])},e.compareBooleans=function(e,t){return M(e?1:0,t?1:0)},e.getSpellingSuggestion=function(t,r,n){for(var i,a=Math.min(2,Math.floor(.34*t.length)),o=Math.floor(.4*t.length)+1,s=0,c=r;s<c.length;s++){var l=c[s],u=n(l);if(void 0!==u&&Math.abs(u.length-t.length)<=a){if(u===t)continue;if(u.length<3&&u.toLowerCase()!==t.toLowerCase())continue;var _=z(t,u,o-.1);if(void 0===_)continue;e.Debug.assert(_<o),o=_,i=l;}}return i},e.endsWith=U,e.removeSuffix=function(e,t){return U(e,t)?e.slice(0,e.length-t.length):e},e.tryRemoveSuffix=function(e,t){return U(e,t)?e.slice(0,e.length-t.length):void 0},e.stringContains=function(e,t){return -1!==e.indexOf(t)},e.removeMinAndVersionNumbers=function(e){for(var t=e.length,r=t-1;r>0;r--){var n=e.charCodeAt(r);if(n>=48&&n<=57)do{--r,n=e.charCodeAt(r);}while(r>0&&n>=48&&n<=57);else {if(!(r>4)||110!==n&&78!==n)break;if(--r,105!==(n=e.charCodeAt(r))&&73!==n)break;if(--r,109!==(n=e.charCodeAt(r))&&77!==n)break;--r,n=e.charCodeAt(r);}if(45!==n&&46!==n)break;t=r;}return t===e.length?e:e.slice(0,t)},e.orderedRemoveItem=function(e,t){for(var r=0;r<e.length;r++)if(e[r]===t)return K(e,r),!0;return !1},e.orderedRemoveItemAt=K,e.unorderedRemoveItemAt=V,e.unorderedRemoveItem=q,e.createGetCanonicalFileName=function(e){return e?N:w},e.patternText=function(e){var t=e.prefix,r=e.suffix;return "".concat(t,"*").concat(r)},e.matchedText=function(t,r){return e.Debug.assert(H(t,r)),r.substring(t.prefix.length,r.length-t.suffix.length)},e.findBestPatternMatch=function(e,t,r){for(var n,i=-1,a=0,o=e;a<o.length;a++){var s=o[a],c=t(s);H(c,r)&&c.prefix.length>i&&(i=c.prefix.length,n=s);}return n},e.startsWith=W,e.removePrefix=function(e,t){return W(e,t)?e.substr(t.length):e},e.tryRemovePrefix=function(e,t,r){return void 0===r&&(r=N),W(r(e),r(t))?e.substring(t.length):void 0},e.and=function(e,t){return function(r){return e(r)&&t(r)}},e.or=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];for(var n=0,i=e;n<i.length;n++){var a=i[n];if(a.apply(void 0,t))return !0}return !1}},e.not=function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return !e.apply(void 0,t)}},e.assertType=function(e){},e.singleElementArray=function(e){return void 0===e?void 0:[e]},e.enumerateInsertsAndDeletes=function(e,t,r,n,i,a){a=a||k;for(var o=0,s=0,c=e.length,l=t.length,u=!1;o<c&&s<l;){var _=e[o],d=t[s],p=r(_,d);-1===p?(n(_),o++,u=!0):1===p?(i(d),s++,u=!0):(a(d,_),o++,s++);}for(;o<c;)n(e[o++]),u=!0;for(;s<l;)i(t[s++]),u=!0;return u},e.fill=function(e,t){for(var r=Array(e),n=0;n<e;n++)r[n]=t(n);return r},e.cartesianProduct=function(e){var t=[];return G(e,t,void 0,0),t},e.padLeft=function(e,t,r){return void 0===r&&(r=" "),t<=e.length?e:r.repeat(t-e.length)+e},e.padRight=function(e,t,r){return void 0===r&&(r=" "),t<=e.length?e:e+r.repeat(t-e.length)},e.takeWhile=function(e,t){for(var r=e.length,n=0;n<r&&t(e[n]);)n++;return e.slice(0,n)},e.trimString=String.prototype.trim?function(e){return e.trim()}:function(t){return e.trimStringEnd(e.trimStringStart(t))},e.trimStringEnd=String.prototype.trimEnd?function(e){return e.trimEnd()}:function(t){for(var r=t.length-1;r>=0&&e.isWhiteSpaceLike(t.charCodeAt(r));)r--;return t.slice(0,r+1)},e.trimStringStart=String.prototype.trimStart?function(e){return e.trimStart()}:function(e){return e.replace(/^\s+/g,"")};}(t),function(e){var t;!function(e){e[e.Off=0]="Off",e[e.Error=1]="Error",e[e.Warning=2]="Warning",e[e.Info=3]="Info",e[e.Verbose=4]="Verbose";}(t=e.LogLevel||(e.LogLevel={})),function(r){var n,i,a=0;function o(){return null!=n?n:n=new e.Version(e.version)}function s(e){return r.currentLogLevel<=e}function c(e,t){r.loggingHost&&s(e)&&r.loggingHost.log(e,t);}function l(e){c(t.Info,e);}r.currentLogLevel=t.Warning,r.isDebugging=!1,r.getTypeScriptVersion=o,r.shouldLog=s,r.log=l,(i=l=r.log||(r.log={})).error=function(e){c(t.Error,e);},i.warn=function(e){c(t.Warning,e);},i.log=function(e){c(t.Info,e);},i.trace=function(e){c(t.Verbose,e);};var u={};function _(e){return a>=e}function d(t,n){return !!_(t)||(u[n]={level:t,assertion:r[n]},r[n]=e.noop,!1)}function p(e,t){var r=new Error(e?"Debug Failure. ".concat(e):"Debug Failure.");throw Error.captureStackTrace&&Error.captureStackTrace(r,t||p),r}function f(e,t,r,n){e||(t=t?"False expression: ".concat(t):"False expression.",r&&(t+="\r\nVerbose Debug Information: "+("string"==typeof r?r:r())),p(t,n||f));}function g(e,t,r){null==e&&p(t,r||g);}function m(e,t,r){return g(e,t,r||m),e}function y(e,t,r){for(var n=0,i=e;n<i.length;n++)g(i[n],t,r||y);}function v(e,t,r){return y(e,t,r||v),e}function h(e){if("function"!=typeof e)return "";if(e.hasOwnProperty("name"))return e.name;var t=Function.prototype.toString.call(e),r=/^function\s+([\w\$]+)\s*\(/.exec(t);return r?r[1]:""}function b(t,r,n){void 0===t&&(t=0);var i=function(t){var r=[];for(var n in t){var i=t[n];"number"==typeof i&&r.push([i,n]);}return e.stableSort(r,(function(t,r){return e.compareValues(t[0],r[0])}))}(r);if(0===t)return i.length>0&&0===i[0][0]?i[0][1]:"0";if(n){for(var a="",o=t,s=0,c=i;s<c.length;s++){var l=c[s],u=l[0],_=l[1];if(u>t)break;0!==u&&u&t&&(a="".concat(a).concat(a?"|":"").concat(_),o&=~u);}if(0===o)return a}else for(var d=0,p=i;d<p.length;d++){var f=p[d];if(u=f[0],_=f[1],u===t)return _}return t.toString()}function x(t){return b(t,e.SyntaxKind,!1)}function D(t){return b(t,e.NodeFlags,!0)}function S(t){return b(t,e.ModifierFlags,!0)}function T(t){return b(t,e.TransformFlags,!0)}function C(t){return b(t,e.EmitFlags,!0)}function E(t){return b(t,e.SymbolFlags,!0)}function k(t){return b(t,e.TypeFlags,!0)}function N(t){return b(t,e.SignatureFlags,!0)}function F(t){return b(t,e.ObjectFlags,!0)}function A(t){return b(t,e.FlowFlags,!0)}r.getAssertionLevel=function(){return a},r.setAssertionLevel=function(t){var n=a;if(a=t,t>n)for(var i=0,o=e.getOwnKeys(u);i<o.length;i++){var s=o[i],c=u[s];void 0!==c&&r[s]!==c.assertion&&t>=c.level&&(r[s]=c,u[s]=void 0);}},r.shouldAssert=_,r.fail=p,r.failBadSyntaxKind=function e(t,r,n){return p("".concat(r||"Unexpected node.","\r\nNode ").concat(x(t.kind)," was unexpected."),n||e)},r.assert=f,r.assertEqual=function e(t,r,n,i,a){if(t!==r){var o=n?i?"".concat(n," ").concat(i):n:"";p("Expected ".concat(t," === ").concat(r,". ").concat(o),a||e);}},r.assertLessThan=function e(t,r,n,i){t>=r&&p("Expected ".concat(t," < ").concat(r,". ").concat(n||""),i||e);},r.assertLessThanOrEqual=function e(t,r,n){t>r&&p("Expected ".concat(t," <= ").concat(r),n||e);},r.assertGreaterThanOrEqual=function e(t,r,n){t<r&&p("Expected ".concat(t," >= ").concat(r),n||e);},r.assertIsDefined=g,r.checkDefined=m,r.assertDefined=m,r.assertEachIsDefined=y,r.checkEachDefined=v,r.assertEachDefined=v,r.assertNever=function t(r,n,i){void 0===n&&(n="Illegal value:");var a="object"==typeof r&&e.hasProperty(r,"kind")&&e.hasProperty(r,"pos")&&x?"SyntaxKind: "+x(r.kind):JSON.stringify(r);return p("".concat(n," ").concat(a),i||t)},r.assertEachNode=function t(r,n,i,a){d(1,"assertEachNode")&&f(void 0===n||e.every(r,n),i||"Unexpected node.",(function(){return "Node array did not pass test '".concat(h(n),"'.")}),a||t);},r.assertNode=function e(t,r,n,i){d(1,"assertNode")&&f(void 0!==t&&(void 0===r||r(t)),n||"Unexpected node.",(function(){return "Node ".concat(x(null==t?void 0:t.kind)," did not pass test '").concat(h(r),"'.")}),i||e);},r.assertNotNode=function e(t,r,n,i){d(1,"assertNotNode")&&f(void 0===t||void 0===r||!r(t),n||"Unexpected node.",(function(){return "Node ".concat(x(t.kind)," should not have passed test '").concat(h(r),"'.")}),i||e);},r.assertOptionalNode=function e(t,r,n,i){d(1,"assertOptionalNode")&&f(void 0===r||void 0===t||r(t),n||"Unexpected node.",(function(){return "Node ".concat(x(null==t?void 0:t.kind)," did not pass test '").concat(h(r),"'.")}),i||e);},r.assertOptionalToken=function e(t,r,n,i){d(1,"assertOptionalToken")&&f(void 0===r||void 0===t||t.kind===r,n||"Unexpected node.",(function(){return "Node ".concat(x(null==t?void 0:t.kind)," was not a '").concat(x(r),"' token.")}),i||e);},r.assertMissingNode=function e(t,r,n){d(1,"assertMissingNode")&&f(void 0===t,r||"Unexpected node.",(function(){return "Node ".concat(x(t.kind)," was unexpected'.")}),n||e);},r.type=function(e){},r.getFunctionName=h,r.formatSymbol=function(t){return "{ name: ".concat(e.unescapeLeadingUnderscores(t.escapedName),"; flags: ").concat(E(t.flags),"; declarations: ").concat(e.map(t.declarations,(function(e){return x(e.kind)}))," }")},r.formatEnum=b,r.formatSyntaxKind=x,r.formatSnippetKind=function(t){return b(t,e.SnippetKind,!1)},r.formatNodeFlags=D,r.formatModifierFlags=S,r.formatTransformFlags=T,r.formatEmitFlags=C,r.formatSymbolFlags=E,r.formatTypeFlags=k,r.formatSignatureFlags=N,r.formatObjectFlags=F,r.formatFlowFlags=A;var P,w,I,O=!1;function M(e){return function(){if(B(),!P)throw new Error("Debugging helpers could not be loaded.");return P}().formatControlFlowGraph(e)}function L(t){"__debugFlowFlags"in t||Object.defineProperties(t,{__tsDebuggerDisplay:{value:function(){var e=2&this.flags?"FlowStart":4&this.flags?"FlowBranchLabel":8&this.flags?"FlowLoopLabel":16&this.flags?"FlowAssignment":32&this.flags?"FlowTrueCondition":64&this.flags?"FlowFalseCondition":128&this.flags?"FlowSwitchClause":256&this.flags?"FlowArrayMutation":512&this.flags?"FlowCall":1024&this.flags?"FlowReduceLabel":1&this.flags?"FlowUnreachable":"UnknownFlow",t=-2048&this.flags;return "".concat(e).concat(t?" (".concat(A(t),")"):"")}},__debugFlowFlags:{get:function(){return b(this.flags,e.FlowFlags,!0)}},__debugToString:{value:function(){return M(this)}}});}function R(e){"__tsDebuggerDisplay"in e||Object.defineProperties(e,{__tsDebuggerDisplay:{value:function(e){return e=String(e).replace(/(?:,[\s\w\d_]+:[^,]+)+\]$/,"]"),"NodeArray ".concat(e)}}});}function B(){if(!O){var t,r;Object.defineProperties(e.objectAllocator.getSymbolConstructor().prototype,{__tsDebuggerDisplay:{value:function(){var t=33554432&this.flags?"TransientSymbol":"Symbol",r=-33554433&this.flags;return "".concat(t," '").concat(e.symbolName(this),"'").concat(r?" (".concat(E(r),")"):"")}},__debugFlags:{get:function(){return E(this.flags)}}}),Object.defineProperties(e.objectAllocator.getTypeConstructor().prototype,{__tsDebuggerDisplay:{value:function(){var t=98304&this.flags?"NullableType":384&this.flags?"LiteralType ".concat(JSON.stringify(this.value)):2048&this.flags?"LiteralType ".concat(this.value.negative?"-":"").concat(this.value.base10Value,"n"):8192&this.flags?"UniqueESSymbolType":32&this.flags?"EnumType":67359327&this.flags?"IntrinsicType ".concat(this.intrinsicName):1048576&this.flags?"UnionType":2097152&this.flags?"IntersectionType":4194304&this.flags?"IndexType":8388608&this.flags?"IndexedAccessType":16777216&this.flags?"ConditionalType":33554432&this.flags?"SubstitutionType":262144&this.flags?"TypeParameter":524288&this.flags?3&this.objectFlags?"InterfaceType":4&this.objectFlags?"TypeReference":8&this.objectFlags?"TupleType":16&this.objectFlags?"AnonymousType":32&this.objectFlags?"MappedType":1024&this.objectFlags?"ReverseMappedType":256&this.objectFlags?"EvolvingArrayType":"ObjectType":"Type",r=524288&this.flags?-1344&this.objectFlags:0;return "".concat(t).concat(this.symbol?" '".concat(e.symbolName(this.symbol),"'"):"").concat(r?" (".concat(F(r),")"):"")}},__debugFlags:{get:function(){return k(this.flags)}},__debugObjectFlags:{get:function(){return 524288&this.flags?F(this.objectFlags):""}},__debugTypeToString:{value:function(){var e=(void 0===t&&"function"==typeof WeakMap&&(t=new WeakMap),t),r=null==e?void 0:e.get(this);return void 0===r&&(r=this.checker.typeToString(this),null==e||e.set(this,r)),r}}}),Object.defineProperties(e.objectAllocator.getSignatureConstructor().prototype,{__debugFlags:{get:function(){return N(this.flags)}},__debugSignatureToString:{value:function(){var e;return null===(e=this.checker)||void 0===e?void 0:e.signatureToString(this)}}});for(var n=0,i=[e.objectAllocator.getNodeConstructor(),e.objectAllocator.getIdentifierConstructor(),e.objectAllocator.getTokenConstructor(),e.objectAllocator.getSourceFileConstructor()];n<i.length;n++){var a=i[n];a.prototype.hasOwnProperty("__debugKind")||Object.defineProperties(a.prototype,{__tsDebuggerDisplay:{value:function(){var t=e.isGeneratedIdentifier(this)?"GeneratedIdentifier":e.isIdentifier(this)?"Identifier '".concat(e.idText(this),"'"):e.isPrivateIdentifier(this)?"PrivateIdentifier '".concat(e.idText(this),"'"):e.isStringLiteral(this)?"StringLiteral ".concat(JSON.stringify(this.text.length<10?this.text:this.text.slice(10)+"...")):e.isNumericLiteral(this)?"NumericLiteral ".concat(this.text):e.isBigIntLiteral(this)?"BigIntLiteral ".concat(this.text,"n"):e.isTypeParameterDeclaration(this)?"TypeParameterDeclaration":e.isParameter(this)?"ParameterDeclaration":e.isConstructorDeclaration(this)?"ConstructorDeclaration":e.isGetAccessorDeclaration(this)?"GetAccessorDeclaration":e.isSetAccessorDeclaration(this)?"SetAccessorDeclaration":e.isCallSignatureDeclaration(this)?"CallSignatureDeclaration":e.isConstructSignatureDeclaration(this)?"ConstructSignatureDeclaration":e.isIndexSignatureDeclaration(this)?"IndexSignatureDeclaration":e.isTypePredicateNode(this)?"TypePredicateNode":e.isTypeReferenceNode(this)?"TypeReferenceNode":e.isFunctionTypeNode(this)?"FunctionTypeNode":e.isConstructorTypeNode(this)?"ConstructorTypeNode":e.isTypeQueryNode(this)?"TypeQueryNode":e.isTypeLiteralNode(this)?"TypeLiteralNode":e.isArrayTypeNode(this)?"ArrayTypeNode":e.isTupleTypeNode(this)?"TupleTypeNode":e.isOptionalTypeNode(this)?"OptionalTypeNode":e.isRestTypeNode(this)?"RestTypeNode":e.isUnionTypeNode(this)?"UnionTypeNode":e.isIntersectionTypeNode(this)?"IntersectionTypeNode":e.isConditionalTypeNode(this)?"ConditionalTypeNode":e.isInferTypeNode(this)?"InferTypeNode":e.isParenthesizedTypeNode(this)?"ParenthesizedTypeNode":e.isThisTypeNode(this)?"ThisTypeNode":e.isTypeOperatorNode(this)?"TypeOperatorNode":e.isIndexedAccessTypeNode(this)?"IndexedAccessTypeNode":e.isMappedTypeNode(this)?"MappedTypeNode":e.isLiteralTypeNode(this)?"LiteralTypeNode":e.isNamedTupleMember(this)?"NamedTupleMember":e.isImportTypeNode(this)?"ImportTypeNode":x(this.kind);return "".concat(t).concat(this.flags?" (".concat(D(this.flags),")"):"")}},__debugKind:{get:function(){return x(this.kind)}},__debugNodeFlags:{get:function(){return D(this.flags)}},__debugModifierFlags:{get:function(){return S(e.getEffectiveModifierFlagsNoCache(this))}},__debugTransformFlags:{get:function(){return T(this.transformFlags)}},__debugIsParseTreeNode:{get:function(){return e.isParseTreeNode(this)}},__debugEmitFlags:{get:function(){return C(e.getEmitFlags(this))}},__debugGetText:{value:function(t){if(e.nodeIsSynthesized(this))return "";var n=(void 0===r&&"function"==typeof WeakMap&&(r=new WeakMap),r),i=null==n?void 0:n.get(this);if(void 0===i){var a=e.getParseTreeNode(this),o=a&&e.getSourceFileOfNode(a);i=o?e.getSourceTextOfNodeFromSourceFile(o,a,t):"",null==n||n.set(this,i);}return i}}});}try{if(e.sys&&e.sys.require){var o=e.getDirectoryPath(e.resolvePath(e.sys.getExecutingFilePath())),s=e.sys.require(o,"./compiler-debug");s.error||(s.module.init(e),P=s.module);}}catch(e){}O=!0;}}function j(t,r,n,i,a){var o=r?"DeprecationError: ":"DeprecationWarning: ";return o+="'".concat(t,"' "),o+=i?"has been deprecated since v".concat(i):"is deprecated",(o+=r?" and can no longer be used.":n?" and will no longer be usable after v".concat(n,"."):".")+(a?" ".concat(e.formatStringFromArgs(a,[t],0)):"")}r.printControlFlowGraph=function(e){return console.log(M(e))},r.formatControlFlowGraph=M,r.attachFlowNodeDebugInfo=function(e){O&&("function"==typeof Object.setPrototypeOf?(w||L(w=Object.create(Object.prototype)),Object.setPrototypeOf(e,w)):L(e));},r.attachNodeArrayDebugInfo=function(e){O&&("function"==typeof Object.setPrototypeOf?(I||R(I=Object.create(Array.prototype)),Object.setPrototypeOf(e,I)):R(e));},r.enableDebugInfo=B,r.deprecate=function(t,r){return function(e,t){return function(){return e(),t.apply(this,arguments)}}(function(t,r){var n,i;void 0===r&&(r={});var a="string"==typeof r.typeScriptVersion?new e.Version(r.typeScriptVersion):null!==(n=r.typeScriptVersion)&&void 0!==n?n:o(),s="string"==typeof r.errorAfter?new e.Version(r.errorAfter):r.errorAfter,c="string"==typeof r.warnAfter?new e.Version(r.warnAfter):r.warnAfter,u="string"==typeof r.since?new e.Version(r.since):null!==(i=r.since)&&void 0!==i?i:c,_=r.error||s&&a.compareTo(s)<=0,d=!c||a.compareTo(c)>=0;return _?function(e,t,r,n){var i=j(e,!0,t,r,n);return function(){throw new TypeError(i)}}(t,s,u,r.message):d?function(e,t,r,n){var i=!1;return function(){i||(l.warn(j(e,!1,t,r,n)),i=!0);}}(t,s,u,r.message):e.noop}(h(t),r),t)};}(e.Debug||(e.Debug={}));}(t),function(e){var t=/^(0|[1-9]\d*)(?:\.(0|[1-9]\d*)(?:\.(0|[1-9]\d*)(?:\-([a-z0-9-.]+))?(?:\+([a-z0-9-.]+))?)?)?$/i,r=/^(?:0|[1-9]\d*|[a-z-][a-z0-9-]*)(?:\.(?:0|[1-9]\d*|[a-z-][a-z0-9-]*))*$/i,n=/^[a-z0-9-]+(?:\.[a-z0-9-]+)*$/i,i=/^(0|[1-9]\d*)$/,a=function(){function t(t,i,a,s,c){if(void 0===i&&(i=0),void 0===a&&(a=0),void 0===s&&(s=""),void 0===c&&(c=""),"string"==typeof t){var l=e.Debug.checkDefined(o(t),"Invalid version");t=l.major,i=l.minor,a=l.patch,s=l.prerelease,c=l.build;}e.Debug.assert(t>=0,"Invalid argument: major"),e.Debug.assert(i>=0,"Invalid argument: minor"),e.Debug.assert(a>=0,"Invalid argument: patch"),e.Debug.assert(!s||r.test(s),"Invalid argument: prerelease"),e.Debug.assert(!c||n.test(c),"Invalid argument: build"),this.major=t,this.minor=i,this.patch=a,this.prerelease=s?s.split("."):e.emptyArray,this.build=c?c.split("."):e.emptyArray;}return t.tryParse=function(e){var r=o(e);if(r)return new t(r.major,r.minor,r.patch,r.prerelease,r.build)},t.prototype.compareTo=function(t){return this===t?0:void 0===t?1:e.compareValues(this.major,t.major)||e.compareValues(this.minor,t.minor)||e.compareValues(this.patch,t.patch)||function(t,r){if(t===r)return 0;if(0===t.length)return 0===r.length?0:1;if(0===r.length)return -1;for(var n=Math.min(t.length,r.length),a=0;a<n;a++){var o=t[a],s=r[a];if(o!==s){var c=i.test(o),l=i.test(s);if(c||l){if(c!==l)return c?-1:1;if(u=e.compareValues(+o,+s))return u}else {var u;if(u=e.compareStringsCaseSensitive(o,s))return u}}}return e.compareValues(t.length,r.length)}(this.prerelease,t.prerelease)},t.prototype.increment=function(r){switch(r){case"major":return new t(this.major+1,0,0);case"minor":return new t(this.major,this.minor+1,0);case"patch":return new t(this.major,this.minor,this.patch+1);default:return e.Debug.assertNever(r)}},t.prototype.toString=function(){var t="".concat(this.major,".").concat(this.minor,".").concat(this.patch);return e.some(this.prerelease)&&(t+="-".concat(this.prerelease.join("."))),e.some(this.build)&&(t+="+".concat(this.build.join("."))),t},t.zero=new t(0,0,0),t}();function o(e){var i=t.exec(e);if(i){var a=i[1],o=i[2],s=void 0===o?"0":o,c=i[3],l=void 0===c?"0":c,u=i[4],_=void 0===u?"":u,d=i[5],p=void 0===d?"":d;if((!_||r.test(_))&&(!p||n.test(p)))return {major:parseInt(a,10),minor:parseInt(s,10),patch:parseInt(l,10),prerelease:_,build:p}}}e.Version=a;var s=function(){function t(t){this._alternatives=t?e.Debug.checkDefined(p(t),"Invalid range spec."):e.emptyArray;}return t.tryParse=function(e){var r=p(e);if(r){var n=new t("");return n._alternatives=r,n}},t.prototype.test=function(e){return "string"==typeof e&&(e=new a(e)),function(e,t){if(0===t.length)return !0;for(var r=0,n=t;r<n.length;r++)if(h(e,n[r]))return !0;return !1}(e,this._alternatives)},t.prototype.toString=function(){return t=this._alternatives,e.map(t,x).join(" || ")||"*";var t;},t}();e.VersionRange=s;var c=/\|\|/g,l=/\s+/g,u=/^([xX*0]|[1-9]\d*)(?:\.([xX*0]|[1-9]\d*)(?:\.([xX*0]|[1-9]\d*)(?:-([a-z0-9-.]+))?(?:\+([a-z0-9-.]+))?)?)?$/i,_=/^\s*([a-z0-9-+.*]+)\s+-\s+([a-z0-9-+.*]+)\s*$/i,d=/^(~|\^|<|<=|>|>=|=)?\s*([a-z0-9-+.*]+)$/i;function p(t){for(var r=[],n=0,i=e.trimString(t).split(c);n<i.length;n++){var a=i[n];if(a){var o=[];a=e.trimString(a);var s=_.exec(a);if(s){if(!g(s[1],s[2],o))return}else for(var u=0,p=a.split(l);u<p.length;u++){var f=p[u],y=d.exec(e.trimString(f));if(!y||!m(y[1],y[2],o))return}r.push(o);}}return r}function f(e){var t=u.exec(e);if(t){var r=t[1],n=t[2],i=void 0===n?"*":n,o=t[3],s=void 0===o?"*":o,c=t[4],l=t[5];return {version:new a(y(r)?0:parseInt(r,10),y(r)||y(i)?0:parseInt(i,10),y(r)||y(i)||y(s)?0:parseInt(s,10),c,l),major:r,minor:i,patch:s}}}function g(e,t,r){var n=f(e);if(!n)return !1;var i=f(t);return !!i&&(y(n.major)||r.push(v(">=",n.version)),y(i.major)||r.push(y(i.minor)?v("<",i.version.increment("major")):y(i.patch)?v("<",i.version.increment("minor")):v("<=",i.version)),!0)}function m(e,t,r){var n=f(t);if(!n)return !1;var i=n.version,o=n.major,s=n.minor,c=n.patch;if(y(o))"<"!==e&&">"!==e||r.push(v("<",a.zero));else switch(e){case"~":r.push(v(">=",i)),r.push(v("<",i.increment(y(s)?"major":"minor")));break;case"^":r.push(v(">=",i)),r.push(v("<",i.increment(i.major>0||y(s)?"major":i.minor>0||y(c)?"minor":"patch")));break;case"<":case">=":r.push(v(e,i));break;case"<=":case">":r.push(y(s)?v("<="===e?"<":">=",i.increment("major")):y(c)?v("<="===e?"<":">=",i.increment("minor")):v(e,i));break;case"=":case void 0:y(s)||y(c)?(r.push(v(">=",i)),r.push(v("<",i.increment(y(s)?"major":"minor")))):r.push(v("=",i));break;default:return !1}return !0}function y(e){return "*"===e||"x"===e||"X"===e}function v(e,t){return {operator:e,operand:t}}function h(e,t){for(var r=0,n=t;r<n.length;r++){var i=n[r];if(!b(e,i.operator,i.operand))return !1}return !0}function b(t,r,n){var i=t.compareTo(n);switch(r){case"<":return i<0;case"<=":return i<=0;case">":return i>0;case">=":return i>=0;case"=":return 0===i;default:return e.Debug.assertNever(r)}}function x(t){return e.map(t,D).join(" ")}function D(e){return "".concat(e.operator).concat(e.operand)}}(t),function(e){function t(e,t){return "object"==typeof e&&"number"==typeof e.timeOrigin&&"function"==typeof e.mark&&"function"==typeof e.measure&&"function"==typeof e.now&&"function"==typeof t}var r=function(){if("object"==typeof performance&&"function"==typeof PerformanceObserver&&t(performance,PerformanceObserver))return {shouldWriteNativeEvents:!0,performance,PerformanceObserver}}()||function(){if("undefined"!=typeof process&&process.nextTick&&!process.browser&&"object"==typeof module&&"function"==typeof require)try{var r,n=require("perf_hooks"),i=n.performance,a=n.PerformanceObserver;if(t(i,a)){r=i;var o=new e.Version(process.versions.node);return new e.VersionRange("<12.16.3 || 13 <13.13").test(o)&&(r={get timeOrigin(){return i.timeOrigin},now:function(){return i.now()},mark:function(e){return i.mark(e)},measure:function(e,t,r){void 0===t&&(t="nodeStart"),void 0===r&&(r="__performance.measure-fix__",i.mark(r)),i.measure(e,t,r),"__performance.measure-fix__"===r&&i.clearMarks("__performance.measure-fix__");}}),{shouldWriteNativeEvents:!1,performance:r,PerformanceObserver:a}}}catch(e){}}(),n=null==r?void 0:r.performance;e.tryGetNativePerformanceHooks=function(){return r},e.timestamp=n?function(){return n.now()}:Date.now?Date.now:function(){return +new Date};}(t),function(e){!function(t){var r,n;function i(t,r,n){var i=0;return {enter:function(){1==++i&&u(r);},exit:function(){0==--i?(u(n),_(t,r,n)):i<0&&e.Debug.fail("enter/exit count does not match.");}}}t.createTimerIf=function(e,r,n,a){return e?i(r,n,a):t.nullTimer},t.createTimer=i,t.nullTimer={enter:e.noop,exit:e.noop};var a=!1,o=e.timestamp(),s=new e.Map,c=new e.Map,l=new e.Map;function u(t){var r;if(a){var i=null!==(r=c.get(t))&&void 0!==r?r:0;c.set(t,i+1),s.set(t,e.timestamp()),null==n||n.mark(t);}}function _(t,r,i){var c,u;if(a){var _=null!==(c=void 0!==i?s.get(i):void 0)&&void 0!==c?c:e.timestamp(),d=null!==(u=void 0!==r?s.get(r):void 0)&&void 0!==u?u:o,p=l.get(t)||0;l.set(t,p+(_-d)),null==n||n.measure(t,r,i);}}t.mark=u,t.measure=_,t.getCount=function(e){return c.get(e)||0},t.getDuration=function(e){return l.get(e)||0},t.forEachMeasure=function(e){l.forEach((function(t,r){return e(r,t)}));},t.isEnabled=function(){return a},t.enable=function(t){var i;return void 0===t&&(t=e.sys),a||(a=!0,r||(r=e.tryGetNativePerformanceHooks()),r&&(o=r.performance.timeOrigin,(r.shouldWriteNativeEvents||(null===(i=null==t?void 0:t.cpuProfilingEnabled)||void 0===i?void 0:i.call(t))||(null==t?void 0:t.debugMode))&&(n=r.performance))),!0},t.disable=function(){a&&(s.clear(),c.clear(),l.clear(),n=void 0,a=!1);};}(e.performance||(e.performance={}));}(t),function(e){var t,r,n={logEvent:e.noop,logErrEvent:e.noop,logPerfEvent:e.noop,logInfoEvent:e.noop,logStartCommand:e.noop,logStopCommand:e.noop,logStartUpdateProgram:e.noop,logStopUpdateProgram:e.noop,logStartUpdateGraph:e.noop,logStopUpdateGraph:e.noop,logStartResolveModule:e.noop,logStopResolveModule:e.noop,logStartParseSourceFile:e.noop,logStopParseSourceFile:e.noop,logStartReadFile:e.noop,logStopReadFile:e.noop,logStartBindFile:e.noop,logStopBindFile:e.noop,logStartScheduledOperation:e.noop,logStopScheduledOperation:e.noop};try{var i=null!==(t=process.env.TS_ETW_MODULE_PATH)&&void 0!==t?t:"./node_modules/@microsoft/typescript-etw";r=require(i);}catch(e){r=void 0;}e.perfLogger=r&&r.logEvent?r:n;}(t),function(e){var t;!function(t){var r,n,a,o,s=0,c=0,l=[],u=[];t.startTracing=function(o,_,d){if(e.Debug.assert(!e.tracing,"Tracing already started"),void 0===r)try{r=require("fs");}catch(e){throw new Error("tracing requires having fs\n(original error: ".concat(e.message||e,")"))}n=o,l.length=0,void 0===a&&(a=e.combinePaths(_,"legend.json")),r.existsSync(_)||r.mkdirSync(_,{recursive:!0});var p="build"===n?".".concat(process.pid,"-").concat(++s):"server"===n?".".concat(process.pid):"",f=e.combinePaths(_,"trace".concat(p,".json")),g=e.combinePaths(_,"types".concat(p,".json"));u.push({configFilePath:d,tracePath:f,typesPath:g}),c=r.openSync(f,"w"),e.tracing=t;var m={cat:"__metadata",ph:"M",ts:1e3*e.timestamp(),pid:1,tid:1};r.writeSync(c,"[\n"+[i$1({name:"process_name",args:{name:"tsc"}},m),i$1({name:"thread_name",args:{name:"Main"}},m),i$1(i$1({name:"TracingStartedInBrowser"},m),{cat:"disabled-by-default-devtools.timeline"})].map((function(e){return JSON.stringify(e)})).join(",\n"));},t.stopTracing=function(){e.Debug.assert(e.tracing,"Tracing is not in progress"),e.Debug.assert(!!l.length==("server"!==n)),r.writeSync(c,"\n]\n"),r.closeSync(c),e.tracing=void 0,l.length?function(t){var n,a,o,s,c,l,_,d,p,g,m,y,v,h,b,x,D,S,T,C,E,k;e.performance.mark("beginDumpTypes");var N=u[u.length-1].typesPath,F=r.openSync(N,"w"),A=new e.Map;r.writeSync(F,"[");for(var P=t.length,w=0;w<P;w++){var I=t[w],O=I.objectFlags,M=null!==(n=I.aliasSymbol)&&void 0!==n?n:I.symbol,L=void 0;if(16&O|2944&I.flags)try{L=null===(a=I.checker)||void 0===a?void 0:a.typeToString(I);}catch(e){L=void 0;}var R={};if(8388608&I.flags){var B=I;R={indexedAccessObjectType:null===(o=B.objectType)||void 0===o?void 0:o.id,indexedAccessIndexType:null===(s=B.indexType)||void 0===s?void 0:s.id};}var j={};if(4&O){var J=I;j={instantiatedType:null===(c=J.target)||void 0===c?void 0:c.id,typeArguments:null===(l=J.resolvedTypeArguments)||void 0===l?void 0:l.map((function(e){return e.id})),referenceLocation:f(J.node)};}var z={};if(16777216&I.flags){var U=I;z={conditionalCheckType:null===(_=U.checkType)||void 0===_?void 0:_.id,conditionalExtendsType:null===(d=U.extendsType)||void 0===d?void 0:d.id,conditionalTrueType:null!==(g=null===(p=U.resolvedTrueType)||void 0===p?void 0:p.id)&&void 0!==g?g:-1,conditionalFalseType:null!==(y=null===(m=U.resolvedFalseType)||void 0===m?void 0:m.id)&&void 0!==y?y:-1};}var K={};if(33554432&I.flags){var V=I;K={substitutionBaseType:null===(v=V.baseType)||void 0===v?void 0:v.id,substituteType:null===(h=V.substitute)||void 0===h?void 0:h.id};}var q={};if(1024&O){var W=I;q={reverseMappedSourceType:null===(b=W.source)||void 0===b?void 0:b.id,reverseMappedMappedType:null===(x=W.mappedType)||void 0===x?void 0:x.id,reverseMappedConstraintType:null===(D=W.constraintType)||void 0===D?void 0:D.id};}var H={};if(256&O){var G=I;H={evolvingArrayElementType:G.elementType.id,evolvingArrayFinalType:null===(S=G.finalArrayType)||void 0===S?void 0:S.id};}var Q=void 0,X=I.checker.getRecursionIdentity(I);X&&((Q=A.get(X))||(Q=A.size,A.set(X,Q)));var Y=i$1(i$1(i$1(i$1(i$1(i$1(i$1({id:I.id,intrinsicName:I.intrinsicName,symbolName:(null==M?void 0:M.escapedName)&&e.unescapeLeadingUnderscores(M.escapedName),recursionId:Q,isTuple:!!(8&O)||void 0,unionTypes:1048576&I.flags?null===(T=I.types)||void 0===T?void 0:T.map((function(e){return e.id})):void 0,intersectionTypes:2097152&I.flags?I.types.map((function(e){return e.id})):void 0,aliasTypeArguments:null===(C=I.aliasTypeArguments)||void 0===C?void 0:C.map((function(e){return e.id})),keyofType:4194304&I.flags?null===(E=I.type)||void 0===E?void 0:E.id:void 0},R),j),z),K),q),H),{destructuringPattern:f(I.pattern),firstDeclaration:f(null===(k=null==M?void 0:M.declarations)||void 0===k?void 0:k[0]),flags:e.Debug.formatTypeFlags(I.flags).split("|"),display:L});r.writeSync(F,JSON.stringify(Y)),w<P-1&&r.writeSync(F,",\n");}r.writeSync(F,"]\n"),r.closeSync(F),e.performance.mark("endDumpTypes"),e.performance.measure("Dump types","beginDumpTypes","endDumpTypes");}(l):u[u.length-1].typesPath=void 0;},t.recordType=function(e){"server"!==n&&l.push(e);},(o=t.Phase||(t.Phase={})).Parse="parse",o.Program="program",o.Bind="bind",o.Check="check",o.CheckTypes="checkTypes",o.Emit="emit",o.Session="session",t.instant=function(e,t,r){p("I",e,t,r,'"s":"g"');};var _=[];function d(e,t){var r=_[e],n=r.phase,i=r.name,a=r.args,o=r.time;r.separateBeginAndEnd?p("E",n,i,a,void 0,t):1e4-o%1e4<=t-o&&p("X",n,i,a,'"dur":'.concat(t-o),o);}function p(t,i,a,o,s,l){void 0===l&&(l=1e3*e.timestamp()),"server"===n&&"checkTypes"===i||(e.performance.mark("beginTracing"),r.writeSync(c,',\n{"pid":1,"tid":1,"ph":"'.concat(t,'","cat":"').concat(i,'","ts":').concat(l,',"name":"').concat(a,'"')),s&&r.writeSync(c,",".concat(s)),o&&r.writeSync(c,',"args":'.concat(JSON.stringify(o))),r.writeSync(c,"}"),e.performance.mark("endTracing"),e.performance.measure("Tracing","beginTracing","endTracing"));}function f(t){var r=e.getSourceFileOfNode(t);return r?{path:r.path,start:n(e.getLineAndCharacterOfPosition(r,t.pos)),end:n(e.getLineAndCharacterOfPosition(r,t.end))}:void 0;function n(e){return {line:e.line+1,character:e.character+1}}}t.push=function(t,r,n,i){void 0===i&&(i=!1),i&&p("B",t,r,n),_.push({phase:t,name:r,args:n,time:1e3*e.timestamp(),separateBeginAndEnd:i});},t.pop=function(){e.Debug.assert(_.length>0),d(_.length-1,1e3*e.timestamp()),_.length--;},t.popAll=function(){for(var t=1e3*e.timestamp(),r=_.length-1;r>=0;r--)d(r,t);_.length=0;},t.dumpLegend=function(){a&&r.writeFileSync(a,JSON.stringify(u));};}(t||(t={})),e.startTracing=t.startTracing,e.dumpTracingLegend=t.dumpLegend;}(t),function(e){var t,r,n,i,a,o,s,c,l;(l=e.SyntaxKind||(e.SyntaxKind={}))[l.Unknown=0]="Unknown",l[l.EndOfFileToken=1]="EndOfFileToken",l[l.SingleLineCommentTrivia=2]="SingleLineCommentTrivia",l[l.MultiLineCommentTrivia=3]="MultiLineCommentTrivia",l[l.NewLineTrivia=4]="NewLineTrivia",l[l.WhitespaceTrivia=5]="WhitespaceTrivia",l[l.ShebangTrivia=6]="ShebangTrivia",l[l.ConflictMarkerTrivia=7]="ConflictMarkerTrivia",l[l.NumericLiteral=8]="NumericLiteral",l[l.BigIntLiteral=9]="BigIntLiteral",l[l.StringLiteral=10]="StringLiteral",l[l.JsxText=11]="JsxText",l[l.JsxTextAllWhiteSpaces=12]="JsxTextAllWhiteSpaces",l[l.RegularExpressionLiteral=13]="RegularExpressionLiteral",l[l.NoSubstitutionTemplateLiteral=14]="NoSubstitutionTemplateLiteral",l[l.TemplateHead=15]="TemplateHead",l[l.TemplateMiddle=16]="TemplateMiddle",l[l.TemplateTail=17]="TemplateTail",l[l.OpenBraceToken=18]="OpenBraceToken",l[l.CloseBraceToken=19]="CloseBraceToken",l[l.OpenParenToken=20]="OpenParenToken",l[l.CloseParenToken=21]="CloseParenToken",l[l.OpenBracketToken=22]="OpenBracketToken",l[l.CloseBracketToken=23]="CloseBracketToken",l[l.DotToken=24]="DotToken",l[l.DotDotDotToken=25]="DotDotDotToken",l[l.SemicolonToken=26]="SemicolonToken",l[l.CommaToken=27]="CommaToken",l[l.QuestionDotToken=28]="QuestionDotToken",l[l.LessThanToken=29]="LessThanToken",l[l.LessThanSlashToken=30]="LessThanSlashToken",l[l.GreaterThanToken=31]="GreaterThanToken",l[l.LessThanEqualsToken=32]="LessThanEqualsToken",l[l.GreaterThanEqualsToken=33]="GreaterThanEqualsToken",l[l.EqualsEqualsToken=34]="EqualsEqualsToken",l[l.ExclamationEqualsToken=35]="ExclamationEqualsToken",l[l.EqualsEqualsEqualsToken=36]="EqualsEqualsEqualsToken",l[l.ExclamationEqualsEqualsToken=37]="ExclamationEqualsEqualsToken",l[l.EqualsGreaterThanToken=38]="EqualsGreaterThanToken",l[l.PlusToken=39]="PlusToken",l[l.MinusToken=40]="MinusToken",l[l.AsteriskToken=41]="AsteriskToken",l[l.AsteriskAsteriskToken=42]="AsteriskAsteriskToken",l[l.SlashToken=43]="SlashToken",l[l.PercentToken=44]="PercentToken",l[l.PlusPlusToken=45]="PlusPlusToken",l[l.MinusMinusToken=46]="MinusMinusToken",l[l.LessThanLessThanToken=47]="LessThanLessThanToken",l[l.GreaterThanGreaterThanToken=48]="GreaterThanGreaterThanToken",l[l.GreaterThanGreaterThanGreaterThanToken=49]="GreaterThanGreaterThanGreaterThanToken",l[l.AmpersandToken=50]="AmpersandToken",l[l.BarToken=51]="BarToken",l[l.CaretToken=52]="CaretToken",l[l.ExclamationToken=53]="ExclamationToken",l[l.TildeToken=54]="TildeToken",l[l.AmpersandAmpersandToken=55]="AmpersandAmpersandToken",l[l.BarBarToken=56]="BarBarToken",l[l.QuestionToken=57]="QuestionToken",l[l.ColonToken=58]="ColonToken",l[l.AtToken=59]="AtToken",l[l.QuestionQuestionToken=60]="QuestionQuestionToken",l[l.BacktickToken=61]="BacktickToken",l[l.HashToken=62]="HashToken",l[l.EqualsToken=63]="EqualsToken",l[l.PlusEqualsToken=64]="PlusEqualsToken",l[l.MinusEqualsToken=65]="MinusEqualsToken",l[l.AsteriskEqualsToken=66]="AsteriskEqualsToken",l[l.AsteriskAsteriskEqualsToken=67]="AsteriskAsteriskEqualsToken",l[l.SlashEqualsToken=68]="SlashEqualsToken",l[l.PercentEqualsToken=69]="PercentEqualsToken",l[l.LessThanLessThanEqualsToken=70]="LessThanLessThanEqualsToken",l[l.GreaterThanGreaterThanEqualsToken=71]="GreaterThanGreaterThanEqualsToken",l[l.GreaterThanGreaterThanGreaterThanEqualsToken=72]="GreaterThanGreaterThanGreaterThanEqualsToken",l[l.AmpersandEqualsToken=73]="AmpersandEqualsToken",l[l.BarEqualsToken=74]="BarEqualsToken",l[l.BarBarEqualsToken=75]="BarBarEqualsToken",l[l.AmpersandAmpersandEqualsToken=76]="AmpersandAmpersandEqualsToken",l[l.QuestionQuestionEqualsToken=77]="QuestionQuestionEqualsToken",l[l.CaretEqualsToken=78]="CaretEqualsToken",l[l.Identifier=79]="Identifier",l[l.PrivateIdentifier=80]="PrivateIdentifier",l[l.BreakKeyword=81]="BreakKeyword",l[l.CaseKeyword=82]="CaseKeyword",l[l.CatchKeyword=83]="CatchKeyword",l[l.ClassKeyword=84]="ClassKeyword",l[l.ConstKeyword=85]="ConstKeyword",l[l.ContinueKeyword=86]="ContinueKeyword",l[l.DebuggerKeyword=87]="DebuggerKeyword",l[l.DefaultKeyword=88]="DefaultKeyword",l[l.DeleteKeyword=89]="DeleteKeyword",l[l.DoKeyword=90]="DoKeyword",l[l.ElseKeyword=91]="ElseKeyword",l[l.EnumKeyword=92]="EnumKeyword",l[l.ExportKeyword=93]="ExportKeyword",l[l.ExtendsKeyword=94]="ExtendsKeyword",l[l.FalseKeyword=95]="FalseKeyword",l[l.FinallyKeyword=96]="FinallyKeyword",l[l.ForKeyword=97]="ForKeyword",l[l.FunctionKeyword=98]="FunctionKeyword",l[l.IfKeyword=99]="IfKeyword",l[l.ImportKeyword=100]="ImportKeyword",l[l.InKeyword=101]="InKeyword",l[l.InstanceOfKeyword=102]="InstanceOfKeyword",l[l.NewKeyword=103]="NewKeyword",l[l.NullKeyword=104]="NullKeyword",l[l.ReturnKeyword=105]="ReturnKeyword",l[l.SuperKeyword=106]="SuperKeyword",l[l.SwitchKeyword=107]="SwitchKeyword",l[l.ThisKeyword=108]="ThisKeyword",l[l.ThrowKeyword=109]="ThrowKeyword",l[l.TrueKeyword=110]="TrueKeyword",l[l.TryKeyword=111]="TryKeyword",l[l.TypeOfKeyword=112]="TypeOfKeyword",l[l.VarKeyword=113]="VarKeyword",l[l.VoidKeyword=114]="VoidKeyword",l[l.WhileKeyword=115]="WhileKeyword",l[l.WithKeyword=116]="WithKeyword",l[l.ImplementsKeyword=117]="ImplementsKeyword",l[l.InterfaceKeyword=118]="InterfaceKeyword",l[l.LetKeyword=119]="LetKeyword",l[l.PackageKeyword=120]="PackageKeyword",l[l.PrivateKeyword=121]="PrivateKeyword",l[l.ProtectedKeyword=122]="ProtectedKeyword",l[l.PublicKeyword=123]="PublicKeyword",l[l.StaticKeyword=124]="StaticKeyword",l[l.YieldKeyword=125]="YieldKeyword",l[l.AbstractKeyword=126]="AbstractKeyword",l[l.AsKeyword=127]="AsKeyword",l[l.AssertsKeyword=128]="AssertsKeyword",l[l.AssertKeyword=129]="AssertKeyword",l[l.AnyKeyword=130]="AnyKeyword",l[l.AsyncKeyword=131]="AsyncKeyword",l[l.AwaitKeyword=132]="AwaitKeyword",l[l.BooleanKeyword=133]="BooleanKeyword",l[l.ConstructorKeyword=134]="ConstructorKeyword",l[l.DeclareKeyword=135]="DeclareKeyword",l[l.GetKeyword=136]="GetKeyword",l[l.InferKeyword=137]="InferKeyword",l[l.IntrinsicKeyword=138]="IntrinsicKeyword",l[l.IsKeyword=139]="IsKeyword",l[l.KeyOfKeyword=140]="KeyOfKeyword",l[l.ModuleKeyword=141]="ModuleKeyword",l[l.NamespaceKeyword=142]="NamespaceKeyword",l[l.NeverKeyword=143]="NeverKeyword",l[l.ReadonlyKeyword=144]="ReadonlyKeyword",l[l.RequireKeyword=145]="RequireKeyword",l[l.NumberKeyword=146]="NumberKeyword",l[l.ObjectKeyword=147]="ObjectKeyword",l[l.SetKeyword=148]="SetKeyword",l[l.StringKeyword=149]="StringKeyword",l[l.SymbolKeyword=150]="SymbolKeyword",l[l.TypeKeyword=151]="TypeKeyword",l[l.UndefinedKeyword=152]="UndefinedKeyword",l[l.UniqueKeyword=153]="UniqueKeyword",l[l.UnknownKeyword=154]="UnknownKeyword",l[l.FromKeyword=155]="FromKeyword",l[l.GlobalKeyword=156]="GlobalKeyword",l[l.BigIntKeyword=157]="BigIntKeyword",l[l.OverrideKeyword=158]="OverrideKeyword",l[l.OfKeyword=159]="OfKeyword",l[l.QualifiedName=160]="QualifiedName",l[l.ComputedPropertyName=161]="ComputedPropertyName",l[l.TypeParameter=162]="TypeParameter",l[l.Parameter=163]="Parameter",l[l.Decorator=164]="Decorator",l[l.PropertySignature=165]="PropertySignature",l[l.PropertyDeclaration=166]="PropertyDeclaration",l[l.MethodSignature=167]="MethodSignature",l[l.MethodDeclaration=168]="MethodDeclaration",l[l.ClassStaticBlockDeclaration=169]="ClassStaticBlockDeclaration",l[l.Constructor=170]="Constructor",l[l.GetAccessor=171]="GetAccessor",l[l.SetAccessor=172]="SetAccessor",l[l.CallSignature=173]="CallSignature",l[l.ConstructSignature=174]="ConstructSignature",l[l.IndexSignature=175]="IndexSignature",l[l.TypePredicate=176]="TypePredicate",l[l.TypeReference=177]="TypeReference",l[l.FunctionType=178]="FunctionType",l[l.ConstructorType=179]="ConstructorType",l[l.TypeQuery=180]="TypeQuery",l[l.TypeLiteral=181]="TypeLiteral",l[l.ArrayType=182]="ArrayType",l[l.TupleType=183]="TupleType",l[l.OptionalType=184]="OptionalType",l[l.RestType=185]="RestType",l[l.UnionType=186]="UnionType",l[l.IntersectionType=187]="IntersectionType",l[l.ConditionalType=188]="ConditionalType",l[l.InferType=189]="InferType",l[l.ParenthesizedType=190]="ParenthesizedType",l[l.ThisType=191]="ThisType",l[l.TypeOperator=192]="TypeOperator",l[l.IndexedAccessType=193]="IndexedAccessType",l[l.MappedType=194]="MappedType",l[l.LiteralType=195]="LiteralType",l[l.NamedTupleMember=196]="NamedTupleMember",l[l.TemplateLiteralType=197]="TemplateLiteralType",l[l.TemplateLiteralTypeSpan=198]="TemplateLiteralTypeSpan",l[l.ImportType=199]="ImportType",l[l.ObjectBindingPattern=200]="ObjectBindingPattern",l[l.ArrayBindingPattern=201]="ArrayBindingPattern",l[l.BindingElement=202]="BindingElement",l[l.ArrayLiteralExpression=203]="ArrayLiteralExpression",l[l.ObjectLiteralExpression=204]="ObjectLiteralExpression",l[l.PropertyAccessExpression=205]="PropertyAccessExpression",l[l.ElementAccessExpression=206]="ElementAccessExpression",l[l.CallExpression=207]="CallExpression",l[l.NewExpression=208]="NewExpression",l[l.TaggedTemplateExpression=209]="TaggedTemplateExpression",l[l.TypeAssertionExpression=210]="TypeAssertionExpression",l[l.ParenthesizedExpression=211]="ParenthesizedExpression",l[l.FunctionExpression=212]="FunctionExpression",l[l.ArrowFunction=213]="ArrowFunction",l[l.DeleteExpression=214]="DeleteExpression",l[l.TypeOfExpression=215]="TypeOfExpression",l[l.VoidExpression=216]="VoidExpression",l[l.AwaitExpression=217]="AwaitExpression",l[l.PrefixUnaryExpression=218]="PrefixUnaryExpression",l[l.PostfixUnaryExpression=219]="PostfixUnaryExpression",l[l.BinaryExpression=220]="BinaryExpression",l[l.ConditionalExpression=221]="ConditionalExpression",l[l.TemplateExpression=222]="TemplateExpression",l[l.YieldExpression=223]="YieldExpression",l[l.SpreadElement=224]="SpreadElement",l[l.ClassExpression=225]="ClassExpression",l[l.OmittedExpression=226]="OmittedExpression",l[l.ExpressionWithTypeArguments=227]="ExpressionWithTypeArguments",l[l.AsExpression=228]="AsExpression",l[l.NonNullExpression=229]="NonNullExpression",l[l.MetaProperty=230]="MetaProperty",l[l.SyntheticExpression=231]="SyntheticExpression",l[l.TemplateSpan=232]="TemplateSpan",l[l.SemicolonClassElement=233]="SemicolonClassElement",l[l.Block=234]="Block",l[l.EmptyStatement=235]="EmptyStatement",l[l.VariableStatement=236]="VariableStatement",l[l.ExpressionStatement=237]="ExpressionStatement",l[l.IfStatement=238]="IfStatement",l[l.DoStatement=239]="DoStatement",l[l.WhileStatement=240]="WhileStatement",l[l.ForStatement=241]="ForStatement",l[l.ForInStatement=242]="ForInStatement",l[l.ForOfStatement=243]="ForOfStatement",l[l.ContinueStatement=244]="ContinueStatement",l[l.BreakStatement=245]="BreakStatement",l[l.ReturnStatement=246]="ReturnStatement",l[l.WithStatement=247]="WithStatement",l[l.SwitchStatement=248]="SwitchStatement",l[l.LabeledStatement=249]="LabeledStatement",l[l.ThrowStatement=250]="ThrowStatement",l[l.TryStatement=251]="TryStatement",l[l.DebuggerStatement=252]="DebuggerStatement",l[l.VariableDeclaration=253]="VariableDeclaration",l[l.VariableDeclarationList=254]="VariableDeclarationList",l[l.FunctionDeclaration=255]="FunctionDeclaration",l[l.ClassDeclaration=256]="ClassDeclaration",l[l.InterfaceDeclaration=257]="InterfaceDeclaration",l[l.TypeAliasDeclaration=258]="TypeAliasDeclaration",l[l.EnumDeclaration=259]="EnumDeclaration",l[l.ModuleDeclaration=260]="ModuleDeclaration",l[l.ModuleBlock=261]="ModuleBlock",l[l.CaseBlock=262]="CaseBlock",l[l.NamespaceExportDeclaration=263]="NamespaceExportDeclaration",l[l.ImportEqualsDeclaration=264]="ImportEqualsDeclaration",l[l.ImportDeclaration=265]="ImportDeclaration",l[l.ImportClause=266]="ImportClause",l[l.NamespaceImport=267]="NamespaceImport",l[l.NamedImports=268]="NamedImports",l[l.ImportSpecifier=269]="ImportSpecifier",l[l.ExportAssignment=270]="ExportAssignment",l[l.ExportDeclaration=271]="ExportDeclaration",l[l.NamedExports=272]="NamedExports",l[l.NamespaceExport=273]="NamespaceExport",l[l.ExportSpecifier=274]="ExportSpecifier",l[l.MissingDeclaration=275]="MissingDeclaration",l[l.ExternalModuleReference=276]="ExternalModuleReference",l[l.JsxElement=277]="JsxElement",l[l.JsxSelfClosingElement=278]="JsxSelfClosingElement",l[l.JsxOpeningElement=279]="JsxOpeningElement",l[l.JsxClosingElement=280]="JsxClosingElement",l[l.JsxFragment=281]="JsxFragment",l[l.JsxOpeningFragment=282]="JsxOpeningFragment",l[l.JsxClosingFragment=283]="JsxClosingFragment",l[l.JsxAttribute=284]="JsxAttribute",l[l.JsxAttributes=285]="JsxAttributes",l[l.JsxSpreadAttribute=286]="JsxSpreadAttribute",l[l.JsxExpression=287]="JsxExpression",l[l.CaseClause=288]="CaseClause",l[l.DefaultClause=289]="DefaultClause",l[l.HeritageClause=290]="HeritageClause",l[l.CatchClause=291]="CatchClause",l[l.AssertClause=292]="AssertClause",l[l.AssertEntry=293]="AssertEntry",l[l.PropertyAssignment=294]="PropertyAssignment",l[l.ShorthandPropertyAssignment=295]="ShorthandPropertyAssignment",l[l.SpreadAssignment=296]="SpreadAssignment",l[l.EnumMember=297]="EnumMember",l[l.UnparsedPrologue=298]="UnparsedPrologue",l[l.UnparsedPrepend=299]="UnparsedPrepend",l[l.UnparsedText=300]="UnparsedText",l[l.UnparsedInternalText=301]="UnparsedInternalText",l[l.UnparsedSyntheticReference=302]="UnparsedSyntheticReference",l[l.SourceFile=303]="SourceFile",l[l.Bundle=304]="Bundle",l[l.UnparsedSource=305]="UnparsedSource",l[l.InputFiles=306]="InputFiles",l[l.JSDocTypeExpression=307]="JSDocTypeExpression",l[l.JSDocNameReference=308]="JSDocNameReference",l[l.JSDocMemberName=309]="JSDocMemberName",l[l.JSDocAllType=310]="JSDocAllType",l[l.JSDocUnknownType=311]="JSDocUnknownType",l[l.JSDocNullableType=312]="JSDocNullableType",l[l.JSDocNonNullableType=313]="JSDocNonNullableType",l[l.JSDocOptionalType=314]="JSDocOptionalType",l[l.JSDocFunctionType=315]="JSDocFunctionType",l[l.JSDocVariadicType=316]="JSDocVariadicType",l[l.JSDocNamepathType=317]="JSDocNamepathType",l[l.JSDocComment=318]="JSDocComment",l[l.JSDocText=319]="JSDocText",l[l.JSDocTypeLiteral=320]="JSDocTypeLiteral",l[l.JSDocSignature=321]="JSDocSignature",l[l.JSDocLink=322]="JSDocLink",l[l.JSDocLinkCode=323]="JSDocLinkCode",l[l.JSDocLinkPlain=324]="JSDocLinkPlain",l[l.JSDocTag=325]="JSDocTag",l[l.JSDocAugmentsTag=326]="JSDocAugmentsTag",l[l.JSDocImplementsTag=327]="JSDocImplementsTag",l[l.JSDocAuthorTag=328]="JSDocAuthorTag",l[l.JSDocDeprecatedTag=329]="JSDocDeprecatedTag",l[l.JSDocClassTag=330]="JSDocClassTag",l[l.JSDocPublicTag=331]="JSDocPublicTag",l[l.JSDocPrivateTag=332]="JSDocPrivateTag",l[l.JSDocProtectedTag=333]="JSDocProtectedTag",l[l.JSDocReadonlyTag=334]="JSDocReadonlyTag",l[l.JSDocOverrideTag=335]="JSDocOverrideTag",l[l.JSDocCallbackTag=336]="JSDocCallbackTag",l[l.JSDocEnumTag=337]="JSDocEnumTag",l[l.JSDocParameterTag=338]="JSDocParameterTag",l[l.JSDocReturnTag=339]="JSDocReturnTag",l[l.JSDocThisTag=340]="JSDocThisTag",l[l.JSDocTypeTag=341]="JSDocTypeTag",l[l.JSDocTemplateTag=342]="JSDocTemplateTag",l[l.JSDocTypedefTag=343]="JSDocTypedefTag",l[l.JSDocSeeTag=344]="JSDocSeeTag",l[l.JSDocPropertyTag=345]="JSDocPropertyTag",l[l.SyntaxList=346]="SyntaxList",l[l.NotEmittedStatement=347]="NotEmittedStatement",l[l.PartiallyEmittedExpression=348]="PartiallyEmittedExpression",l[l.CommaListExpression=349]="CommaListExpression",l[l.MergeDeclarationMarker=350]="MergeDeclarationMarker",l[l.EndOfDeclarationMarker=351]="EndOfDeclarationMarker",l[l.SyntheticReferenceExpression=352]="SyntheticReferenceExpression",l[l.Count=353]="Count",l[l.FirstAssignment=63]="FirstAssignment",l[l.LastAssignment=78]="LastAssignment",l[l.FirstCompoundAssignment=64]="FirstCompoundAssignment",l[l.LastCompoundAssignment=78]="LastCompoundAssignment",l[l.FirstReservedWord=81]="FirstReservedWord",l[l.LastReservedWord=116]="LastReservedWord",l[l.FirstKeyword=81]="FirstKeyword",l[l.LastKeyword=159]="LastKeyword",l[l.FirstFutureReservedWord=117]="FirstFutureReservedWord",l[l.LastFutureReservedWord=125]="LastFutureReservedWord",l[l.FirstTypeNode=176]="FirstTypeNode",l[l.LastTypeNode=199]="LastTypeNode",l[l.FirstPunctuation=18]="FirstPunctuation",l[l.LastPunctuation=78]="LastPunctuation",l[l.FirstToken=0]="FirstToken",l[l.LastToken=159]="LastToken",l[l.FirstTriviaToken=2]="FirstTriviaToken",l[l.LastTriviaToken=7]="LastTriviaToken",l[l.FirstLiteralToken=8]="FirstLiteralToken",l[l.LastLiteralToken=14]="LastLiteralToken",l[l.FirstTemplateToken=14]="FirstTemplateToken",l[l.LastTemplateToken=17]="LastTemplateToken",l[l.FirstBinaryOperator=29]="FirstBinaryOperator",l[l.LastBinaryOperator=78]="LastBinaryOperator",l[l.FirstStatement=236]="FirstStatement",l[l.LastStatement=252]="LastStatement",l[l.FirstNode=160]="FirstNode",l[l.FirstJSDocNode=307]="FirstJSDocNode",l[l.LastJSDocNode=345]="LastJSDocNode",l[l.FirstJSDocTagNode=325]="FirstJSDocTagNode",l[l.LastJSDocTagNode=345]="LastJSDocTagNode",l[l.FirstContextualKeyword=126]="FirstContextualKeyword",l[l.LastContextualKeyword=159]="LastContextualKeyword",(c=e.NodeFlags||(e.NodeFlags={}))[c.None=0]="None",c[c.Let=1]="Let",c[c.Const=2]="Const",c[c.NestedNamespace=4]="NestedNamespace",c[c.Synthesized=8]="Synthesized",c[c.Namespace=16]="Namespace",c[c.OptionalChain=32]="OptionalChain",c[c.ExportContext=64]="ExportContext",c[c.ContainsThis=128]="ContainsThis",c[c.HasImplicitReturn=256]="HasImplicitReturn",c[c.HasExplicitReturn=512]="HasExplicitReturn",c[c.GlobalAugmentation=1024]="GlobalAugmentation",c[c.HasAsyncFunctions=2048]="HasAsyncFunctions",c[c.DisallowInContext=4096]="DisallowInContext",c[c.YieldContext=8192]="YieldContext",c[c.DecoratorContext=16384]="DecoratorContext",c[c.AwaitContext=32768]="AwaitContext",c[c.ThisNodeHasError=65536]="ThisNodeHasError",c[c.JavaScriptFile=131072]="JavaScriptFile",c[c.ThisNodeOrAnySubNodesHasError=262144]="ThisNodeOrAnySubNodesHasError",c[c.HasAggregatedChildData=524288]="HasAggregatedChildData",c[c.PossiblyContainsDynamicImport=1048576]="PossiblyContainsDynamicImport",c[c.PossiblyContainsImportMeta=2097152]="PossiblyContainsImportMeta",c[c.JSDoc=4194304]="JSDoc",c[c.Ambient=8388608]="Ambient",c[c.InWithStatement=16777216]="InWithStatement",c[c.JsonFile=33554432]="JsonFile",c[c.TypeCached=67108864]="TypeCached",c[c.Deprecated=134217728]="Deprecated",c[c.BlockScoped=3]="BlockScoped",c[c.ReachabilityCheckFlags=768]="ReachabilityCheckFlags",c[c.ReachabilityAndEmitFlags=2816]="ReachabilityAndEmitFlags",c[c.ContextFlags=25358336]="ContextFlags",c[c.TypeExcludesFlags=40960]="TypeExcludesFlags",c[c.PermanentlySetIncrementalFlags=3145728]="PermanentlySetIncrementalFlags",(s=e.ModifierFlags||(e.ModifierFlags={}))[s.None=0]="None",s[s.Export=1]="Export",s[s.Ambient=2]="Ambient",s[s.Public=4]="Public",s[s.Private=8]="Private",s[s.Protected=16]="Protected",s[s.Static=32]="Static",s[s.Readonly=64]="Readonly",s[s.Abstract=128]="Abstract",s[s.Async=256]="Async",s[s.Default=512]="Default",s[s.Const=2048]="Const",s[s.HasComputedJSDocModifiers=4096]="HasComputedJSDocModifiers",s[s.Deprecated=8192]="Deprecated",s[s.Override=16384]="Override",s[s.HasComputedFlags=536870912]="HasComputedFlags",s[s.AccessibilityModifier=28]="AccessibilityModifier",s[s.ParameterPropertyModifier=16476]="ParameterPropertyModifier",s[s.NonPublicAccessibilityModifier=24]="NonPublicAccessibilityModifier",s[s.TypeScriptModifier=18654]="TypeScriptModifier",s[s.ExportDefault=513]="ExportDefault",s[s.All=27647]="All",(o=e.JsxFlags||(e.JsxFlags={}))[o.None=0]="None",o[o.IntrinsicNamedElement=1]="IntrinsicNamedElement",o[o.IntrinsicIndexedElement=2]="IntrinsicIndexedElement",o[o.IntrinsicElement=3]="IntrinsicElement",(a=e.RelationComparisonResult||(e.RelationComparisonResult={}))[a.Succeeded=1]="Succeeded",a[a.Failed=2]="Failed",a[a.Reported=4]="Reported",a[a.ReportsUnmeasurable=8]="ReportsUnmeasurable",a[a.ReportsUnreliable=16]="ReportsUnreliable",a[a.ReportsMask=24]="ReportsMask",(i=e.GeneratedIdentifierFlags||(e.GeneratedIdentifierFlags={}))[i.None=0]="None",i[i.Auto=1]="Auto",i[i.Loop=2]="Loop",i[i.Unique=3]="Unique",i[i.Node=4]="Node",i[i.KindMask=7]="KindMask",i[i.ReservedInNestedScopes=8]="ReservedInNestedScopes",i[i.Optimistic=16]="Optimistic",i[i.FileLevel=32]="FileLevel",i[i.AllowNameSubstitution=64]="AllowNameSubstitution",(n=e.TokenFlags||(e.TokenFlags={}))[n.None=0]="None",n[n.PrecedingLineBreak=1]="PrecedingLineBreak",n[n.PrecedingJSDocComment=2]="PrecedingJSDocComment",n[n.Unterminated=4]="Unterminated",n[n.ExtendedUnicodeEscape=8]="ExtendedUnicodeEscape",n[n.Scientific=16]="Scientific",n[n.Octal=32]="Octal",n[n.HexSpecifier=64]="HexSpecifier",n[n.BinarySpecifier=128]="BinarySpecifier",n[n.OctalSpecifier=256]="OctalSpecifier",n[n.ContainsSeparator=512]="ContainsSeparator",n[n.UnicodeEscape=1024]="UnicodeEscape",n[n.ContainsInvalidEscape=2048]="ContainsInvalidEscape",n[n.BinaryOrOctalSpecifier=384]="BinaryOrOctalSpecifier",n[n.NumericLiteralFlags=1008]="NumericLiteralFlags",n[n.TemplateLiteralLikeFlags=2048]="TemplateLiteralLikeFlags",(r=e.FlowFlags||(e.FlowFlags={}))[r.Unreachable=1]="Unreachable",r[r.Start=2]="Start",r[r.BranchLabel=4]="BranchLabel",r[r.LoopLabel=8]="LoopLabel",r[r.Assignment=16]="Assignment",r[r.TrueCondition=32]="TrueCondition",r[r.FalseCondition=64]="FalseCondition",r[r.SwitchClause=128]="SwitchClause",r[r.ArrayMutation=256]="ArrayMutation",r[r.Call=512]="Call",r[r.ReduceLabel=1024]="ReduceLabel",r[r.Referenced=2048]="Referenced",r[r.Shared=4096]="Shared",r[r.Label=12]="Label",r[r.Condition=96]="Condition",(t=e.CommentDirectiveType||(e.CommentDirectiveType={}))[t.ExpectError=0]="ExpectError",t[t.Ignore=1]="Ignore";var u,_,d,p,f,g,m,y,v,h,b,x,D,S,T,C,E,k,N,F,A,P,w,I,O,M,L,R,B,j,J,z,U,K,V,q,W,H,G,Q,X,Y,Z,$,ee,te,re,ne,ie,ae,oe,se,ce,le,ue,_e,de,pe;e.OperationCanceledException=function(){},(pe=e.FileIncludeKind||(e.FileIncludeKind={}))[pe.RootFile=0]="RootFile",pe[pe.SourceFromProjectReference=1]="SourceFromProjectReference",pe[pe.OutputFromProjectReference=2]="OutputFromProjectReference",pe[pe.Import=3]="Import",pe[pe.ReferenceFile=4]="ReferenceFile",pe[pe.TypeReferenceDirective=5]="TypeReferenceDirective",pe[pe.LibFile=6]="LibFile",pe[pe.LibReferenceDirective=7]="LibReferenceDirective",pe[pe.AutomaticTypeDirectiveFile=8]="AutomaticTypeDirectiveFile",(de=e.FilePreprocessingDiagnosticsKind||(e.FilePreprocessingDiagnosticsKind={}))[de.FilePreprocessingReferencedDiagnostic=0]="FilePreprocessingReferencedDiagnostic",de[de.FilePreprocessingFileExplainingDiagnostic=1]="FilePreprocessingFileExplainingDiagnostic",(_e=e.StructureIsReused||(e.StructureIsReused={}))[_e.Not=0]="Not",_e[_e.SafeModules=1]="SafeModules",_e[_e.Completely=2]="Completely",(ue=e.ExitStatus||(e.ExitStatus={}))[ue.Success=0]="Success",ue[ue.DiagnosticsPresent_OutputsSkipped=1]="DiagnosticsPresent_OutputsSkipped",ue[ue.DiagnosticsPresent_OutputsGenerated=2]="DiagnosticsPresent_OutputsGenerated",ue[ue.InvalidProject_OutputsSkipped=3]="InvalidProject_OutputsSkipped",ue[ue.ProjectReferenceCycle_OutputsSkipped=4]="ProjectReferenceCycle_OutputsSkipped",ue[ue.ProjectReferenceCycle_OutputsSkupped=4]="ProjectReferenceCycle_OutputsSkupped",(le=e.MemberOverrideStatus||(e.MemberOverrideStatus={}))[le.Ok=0]="Ok",le[le.NeedsOverride=1]="NeedsOverride",le[le.HasInvalidOverride=2]="HasInvalidOverride",(ce=e.UnionReduction||(e.UnionReduction={}))[ce.None=0]="None",ce[ce.Literal=1]="Literal",ce[ce.Subtype=2]="Subtype",(se=e.ContextFlags||(e.ContextFlags={}))[se.None=0]="None",se[se.Signature=1]="Signature",se[se.NoConstraints=2]="NoConstraints",se[se.Completions=4]="Completions",se[se.SkipBindingPatterns=8]="SkipBindingPatterns",(oe=e.NodeBuilderFlags||(e.NodeBuilderFlags={}))[oe.None=0]="None",oe[oe.NoTruncation=1]="NoTruncation",oe[oe.WriteArrayAsGenericType=2]="WriteArrayAsGenericType",oe[oe.GenerateNamesForShadowedTypeParams=4]="GenerateNamesForShadowedTypeParams",oe[oe.UseStructuralFallback=8]="UseStructuralFallback",oe[oe.ForbidIndexedAccessSymbolReferences=16]="ForbidIndexedAccessSymbolReferences",oe[oe.WriteTypeArgumentsOfSignature=32]="WriteTypeArgumentsOfSignature",oe[oe.UseFullyQualifiedType=64]="UseFullyQualifiedType",oe[oe.UseOnlyExternalAliasing=128]="UseOnlyExternalAliasing",oe[oe.SuppressAnyReturnType=256]="SuppressAnyReturnType",oe[oe.WriteTypeParametersInQualifiedName=512]="WriteTypeParametersInQualifiedName",oe[oe.MultilineObjectLiterals=1024]="MultilineObjectLiterals",oe[oe.WriteClassExpressionAsTypeLiteral=2048]="WriteClassExpressionAsTypeLiteral",oe[oe.UseTypeOfFunction=4096]="UseTypeOfFunction",oe[oe.OmitParameterModifiers=8192]="OmitParameterModifiers",oe[oe.UseAliasDefinedOutsideCurrentScope=16384]="UseAliasDefinedOutsideCurrentScope",oe[oe.UseSingleQuotesForStringLiteralType=268435456]="UseSingleQuotesForStringLiteralType",oe[oe.NoTypeReduction=536870912]="NoTypeReduction",oe[oe.NoUndefinedOptionalParameterType=1073741824]="NoUndefinedOptionalParameterType",oe[oe.AllowThisInObjectLiteral=32768]="AllowThisInObjectLiteral",oe[oe.AllowQualifiedNameInPlaceOfIdentifier=65536]="AllowQualifiedNameInPlaceOfIdentifier",oe[oe.AllowQualifedNameInPlaceOfIdentifier=65536]="AllowQualifedNameInPlaceOfIdentifier",oe[oe.AllowAnonymousIdentifier=131072]="AllowAnonymousIdentifier",oe[oe.AllowEmptyUnionOrIntersection=262144]="AllowEmptyUnionOrIntersection",oe[oe.AllowEmptyTuple=524288]="AllowEmptyTuple",oe[oe.AllowUniqueESSymbolType=1048576]="AllowUniqueESSymbolType",oe[oe.AllowEmptyIndexInfoType=2097152]="AllowEmptyIndexInfoType",oe[oe.AllowNodeModulesRelativePaths=67108864]="AllowNodeModulesRelativePaths",oe[oe.DoNotIncludeSymbolChain=134217728]="DoNotIncludeSymbolChain",oe[oe.IgnoreErrors=70221824]="IgnoreErrors",oe[oe.InObjectTypeLiteral=4194304]="InObjectTypeLiteral",oe[oe.InTypeAlias=8388608]="InTypeAlias",oe[oe.InInitialEntityName=16777216]="InInitialEntityName",(ae=e.TypeFormatFlags||(e.TypeFormatFlags={}))[ae.None=0]="None",ae[ae.NoTruncation=1]="NoTruncation",ae[ae.WriteArrayAsGenericType=2]="WriteArrayAsGenericType",ae[ae.UseStructuralFallback=8]="UseStructuralFallback",ae[ae.WriteTypeArgumentsOfSignature=32]="WriteTypeArgumentsOfSignature",ae[ae.UseFullyQualifiedType=64]="UseFullyQualifiedType",ae[ae.SuppressAnyReturnType=256]="SuppressAnyReturnType",ae[ae.MultilineObjectLiterals=1024]="MultilineObjectLiterals",ae[ae.WriteClassExpressionAsTypeLiteral=2048]="WriteClassExpressionAsTypeLiteral",ae[ae.UseTypeOfFunction=4096]="UseTypeOfFunction",ae[ae.OmitParameterModifiers=8192]="OmitParameterModifiers",ae[ae.UseAliasDefinedOutsideCurrentScope=16384]="UseAliasDefinedOutsideCurrentScope",ae[ae.UseSingleQuotesForStringLiteralType=268435456]="UseSingleQuotesForStringLiteralType",ae[ae.NoTypeReduction=536870912]="NoTypeReduction",ae[ae.AllowUniqueESSymbolType=1048576]="AllowUniqueESSymbolType",ae[ae.AddUndefined=131072]="AddUndefined",ae[ae.WriteArrowStyleSignature=262144]="WriteArrowStyleSignature",ae[ae.InArrayType=524288]="InArrayType",ae[ae.InElementType=2097152]="InElementType",ae[ae.InFirstTypeArgument=4194304]="InFirstTypeArgument",ae[ae.InTypeAlias=8388608]="InTypeAlias",ae[ae.WriteOwnNameForAnyLike=0]="WriteOwnNameForAnyLike",ae[ae.NodeBuilderFlagsMask=814775659]="NodeBuilderFlagsMask",(ie=e.SymbolFormatFlags||(e.SymbolFormatFlags={}))[ie.None=0]="None",ie[ie.WriteTypeParametersOrArguments=1]="WriteTypeParametersOrArguments",ie[ie.UseOnlyExternalAliasing=2]="UseOnlyExternalAliasing",ie[ie.AllowAnyNodeKind=4]="AllowAnyNodeKind",ie[ie.UseAliasDefinedOutsideCurrentScope=8]="UseAliasDefinedOutsideCurrentScope",ie[ie.DoNotIncludeSymbolChain=16]="DoNotIncludeSymbolChain",(ne=e.SymbolAccessibility||(e.SymbolAccessibility={}))[ne.Accessible=0]="Accessible",ne[ne.NotAccessible=1]="NotAccessible",ne[ne.CannotBeNamed=2]="CannotBeNamed",(re=e.SyntheticSymbolKind||(e.SyntheticSymbolKind={}))[re.UnionOrIntersection=0]="UnionOrIntersection",re[re.Spread=1]="Spread",(te=e.TypePredicateKind||(e.TypePredicateKind={}))[te.This=0]="This",te[te.Identifier=1]="Identifier",te[te.AssertsThis=2]="AssertsThis",te[te.AssertsIdentifier=3]="AssertsIdentifier",(ee=e.TypeReferenceSerializationKind||(e.TypeReferenceSerializationKind={}))[ee.Unknown=0]="Unknown",ee[ee.TypeWithConstructSignatureAndValue=1]="TypeWithConstructSignatureAndValue",ee[ee.VoidNullableOrNeverType=2]="VoidNullableOrNeverType",ee[ee.NumberLikeType=3]="NumberLikeType",ee[ee.BigIntLikeType=4]="BigIntLikeType",ee[ee.StringLikeType=5]="StringLikeType",ee[ee.BooleanType=6]="BooleanType",ee[ee.ArrayLikeType=7]="ArrayLikeType",ee[ee.ESSymbolType=8]="ESSymbolType",ee[ee.Promise=9]="Promise",ee[ee.TypeWithCallSignature=10]="TypeWithCallSignature",ee[ee.ObjectType=11]="ObjectType",($=e.SymbolFlags||(e.SymbolFlags={}))[$.None=0]="None",$[$.FunctionScopedVariable=1]="FunctionScopedVariable",$[$.BlockScopedVariable=2]="BlockScopedVariable",$[$.Property=4]="Property",$[$.EnumMember=8]="EnumMember",$[$.Function=16]="Function",$[$.Class=32]="Class",$[$.Interface=64]="Interface",$[$.ConstEnum=128]="ConstEnum",$[$.RegularEnum=256]="RegularEnum",$[$.ValueModule=512]="ValueModule",$[$.NamespaceModule=1024]="NamespaceModule",$[$.TypeLiteral=2048]="TypeLiteral",$[$.ObjectLiteral=4096]="ObjectLiteral",$[$.Method=8192]="Method",$[$.Constructor=16384]="Constructor",$[$.GetAccessor=32768]="GetAccessor",$[$.SetAccessor=65536]="SetAccessor",$[$.Signature=131072]="Signature",$[$.TypeParameter=262144]="TypeParameter",$[$.TypeAlias=524288]="TypeAlias",$[$.ExportValue=1048576]="ExportValue",$[$.Alias=2097152]="Alias",$[$.Prototype=4194304]="Prototype",$[$.ExportStar=8388608]="ExportStar",$[$.Optional=16777216]="Optional",$[$.Transient=33554432]="Transient",$[$.Assignment=67108864]="Assignment",$[$.ModuleExports=134217728]="ModuleExports",$[$.All=67108863]="All",$[$.Enum=384]="Enum",$[$.Variable=3]="Variable",$[$.Value=111551]="Value",$[$.Type=788968]="Type",$[$.Namespace=1920]="Namespace",$[$.Module=1536]="Module",$[$.Accessor=98304]="Accessor",$[$.FunctionScopedVariableExcludes=111550]="FunctionScopedVariableExcludes",$[$.BlockScopedVariableExcludes=111551]="BlockScopedVariableExcludes",$[$.ParameterExcludes=111551]="ParameterExcludes",$[$.PropertyExcludes=0]="PropertyExcludes",$[$.EnumMemberExcludes=900095]="EnumMemberExcludes",$[$.FunctionExcludes=110991]="FunctionExcludes",$[$.ClassExcludes=899503]="ClassExcludes",$[$.InterfaceExcludes=788872]="InterfaceExcludes",$[$.RegularEnumExcludes=899327]="RegularEnumExcludes",$[$.ConstEnumExcludes=899967]="ConstEnumExcludes",$[$.ValueModuleExcludes=110735]="ValueModuleExcludes",$[$.NamespaceModuleExcludes=0]="NamespaceModuleExcludes",$[$.MethodExcludes=103359]="MethodExcludes",$[$.GetAccessorExcludes=46015]="GetAccessorExcludes",$[$.SetAccessorExcludes=78783]="SetAccessorExcludes",$[$.TypeParameterExcludes=526824]="TypeParameterExcludes",$[$.TypeAliasExcludes=788968]="TypeAliasExcludes",$[$.AliasExcludes=2097152]="AliasExcludes",$[$.ModuleMember=2623475]="ModuleMember",$[$.ExportHasLocal=944]="ExportHasLocal",$[$.BlockScoped=418]="BlockScoped",$[$.PropertyOrAccessor=98308]="PropertyOrAccessor",$[$.ClassMember=106500]="ClassMember",$[$.ExportSupportsDefaultModifier=112]="ExportSupportsDefaultModifier",$[$.ExportDoesNotSupportDefaultModifier=-113]="ExportDoesNotSupportDefaultModifier",$[$.Classifiable=2885600]="Classifiable",$[$.LateBindingContainer=6256]="LateBindingContainer",(Z=e.EnumKind||(e.EnumKind={}))[Z.Numeric=0]="Numeric",Z[Z.Literal=1]="Literal",(Y=e.CheckFlags||(e.CheckFlags={}))[Y.Instantiated=1]="Instantiated",Y[Y.SyntheticProperty=2]="SyntheticProperty",Y[Y.SyntheticMethod=4]="SyntheticMethod",Y[Y.Readonly=8]="Readonly",Y[Y.ReadPartial=16]="ReadPartial",Y[Y.WritePartial=32]="WritePartial",Y[Y.HasNonUniformType=64]="HasNonUniformType",Y[Y.HasLiteralType=128]="HasLiteralType",Y[Y.ContainsPublic=256]="ContainsPublic",Y[Y.ContainsProtected=512]="ContainsProtected",Y[Y.ContainsPrivate=1024]="ContainsPrivate",Y[Y.ContainsStatic=2048]="ContainsStatic",Y[Y.Late=4096]="Late",Y[Y.ReverseMapped=8192]="ReverseMapped",Y[Y.OptionalParameter=16384]="OptionalParameter",Y[Y.RestParameter=32768]="RestParameter",Y[Y.DeferredType=65536]="DeferredType",Y[Y.HasNeverType=131072]="HasNeverType",Y[Y.Mapped=262144]="Mapped",Y[Y.StripOptional=524288]="StripOptional",Y[Y.Unresolved=1048576]="Unresolved",Y[Y.Synthetic=6]="Synthetic",Y[Y.Discriminant=192]="Discriminant",Y[Y.Partial=48]="Partial",(X=e.InternalSymbolName||(e.InternalSymbolName={})).Call="__call",X.Constructor="__constructor",X.New="__new",X.Index="__index",X.ExportStar="__export",X.Global="__global",X.Missing="__missing",X.Type="__type",X.Object="__object",X.JSXAttributes="__jsxAttributes",X.Class="__class",X.Function="__function",X.Computed="__computed",X.Resolving="__resolving__",X.ExportEquals="export=",X.Default="default",X.This="this",(Q=e.NodeCheckFlags||(e.NodeCheckFlags={}))[Q.TypeChecked=1]="TypeChecked",Q[Q.LexicalThis=2]="LexicalThis",Q[Q.CaptureThis=4]="CaptureThis",Q[Q.CaptureNewTarget=8]="CaptureNewTarget",Q[Q.SuperInstance=256]="SuperInstance",Q[Q.SuperStatic=512]="SuperStatic",Q[Q.ContextChecked=1024]="ContextChecked",Q[Q.AsyncMethodWithSuper=2048]="AsyncMethodWithSuper",Q[Q.AsyncMethodWithSuperBinding=4096]="AsyncMethodWithSuperBinding",Q[Q.CaptureArguments=8192]="CaptureArguments",Q[Q.EnumValuesComputed=16384]="EnumValuesComputed",Q[Q.LexicalModuleMergesWithClass=32768]="LexicalModuleMergesWithClass",Q[Q.LoopWithCapturedBlockScopedBinding=65536]="LoopWithCapturedBlockScopedBinding",Q[Q.ContainsCapturedBlockScopeBinding=131072]="ContainsCapturedBlockScopeBinding",Q[Q.CapturedBlockScopedBinding=262144]="CapturedBlockScopedBinding",Q[Q.BlockScopedBindingInLoop=524288]="BlockScopedBindingInLoop",Q[Q.ClassWithBodyScopedClassBinding=1048576]="ClassWithBodyScopedClassBinding",Q[Q.BodyScopedClassBinding=2097152]="BodyScopedClassBinding",Q[Q.NeedsLoopOutParameter=4194304]="NeedsLoopOutParameter",Q[Q.AssignmentsMarked=8388608]="AssignmentsMarked",Q[Q.ClassWithConstructorReference=16777216]="ClassWithConstructorReference",Q[Q.ConstructorReferenceInClass=33554432]="ConstructorReferenceInClass",Q[Q.ContainsClassWithPrivateIdentifiers=67108864]="ContainsClassWithPrivateIdentifiers",Q[Q.ContainsSuperPropertyInStaticInitializer=134217728]="ContainsSuperPropertyInStaticInitializer",(G=e.TypeFlags||(e.TypeFlags={}))[G.Any=1]="Any",G[G.Unknown=2]="Unknown",G[G.String=4]="String",G[G.Number=8]="Number",G[G.Boolean=16]="Boolean",G[G.Enum=32]="Enum",G[G.BigInt=64]="BigInt",G[G.StringLiteral=128]="StringLiteral",G[G.NumberLiteral=256]="NumberLiteral",G[G.BooleanLiteral=512]="BooleanLiteral",G[G.EnumLiteral=1024]="EnumLiteral",G[G.BigIntLiteral=2048]="BigIntLiteral",G[G.ESSymbol=4096]="ESSymbol",G[G.UniqueESSymbol=8192]="UniqueESSymbol",G[G.Void=16384]="Void",G[G.Undefined=32768]="Undefined",G[G.Null=65536]="Null",G[G.Never=131072]="Never",G[G.TypeParameter=262144]="TypeParameter",G[G.Object=524288]="Object",G[G.Union=1048576]="Union",G[G.Intersection=2097152]="Intersection",G[G.Index=4194304]="Index",G[G.IndexedAccess=8388608]="IndexedAccess",G[G.Conditional=16777216]="Conditional",G[G.Substitution=33554432]="Substitution",G[G.NonPrimitive=67108864]="NonPrimitive",G[G.TemplateLiteral=134217728]="TemplateLiteral",G[G.StringMapping=268435456]="StringMapping",G[G.AnyOrUnknown=3]="AnyOrUnknown",G[G.Nullable=98304]="Nullable",G[G.Literal=2944]="Literal",G[G.Unit=109440]="Unit",G[G.StringOrNumberLiteral=384]="StringOrNumberLiteral",G[G.StringOrNumberLiteralOrUnique=8576]="StringOrNumberLiteralOrUnique",G[G.DefinitelyFalsy=117632]="DefinitelyFalsy",G[G.PossiblyFalsy=117724]="PossiblyFalsy",G[G.Intrinsic=67359327]="Intrinsic",G[G.Primitive=131068]="Primitive",G[G.StringLike=402653316]="StringLike",G[G.NumberLike=296]="NumberLike",G[G.BigIntLike=2112]="BigIntLike",G[G.BooleanLike=528]="BooleanLike",G[G.EnumLike=1056]="EnumLike",G[G.ESSymbolLike=12288]="ESSymbolLike",G[G.VoidLike=49152]="VoidLike",G[G.DisjointDomains=469892092]="DisjointDomains",G[G.UnionOrIntersection=3145728]="UnionOrIntersection",G[G.StructuredType=3670016]="StructuredType",G[G.TypeVariable=8650752]="TypeVariable",G[G.InstantiableNonPrimitive=58982400]="InstantiableNonPrimitive",G[G.InstantiablePrimitive=406847488]="InstantiablePrimitive",G[G.Instantiable=465829888]="Instantiable",G[G.StructuredOrInstantiable=469499904]="StructuredOrInstantiable",G[G.ObjectFlagsType=3899393]="ObjectFlagsType",G[G.Simplifiable=25165824]="Simplifiable",G[G.Singleton=67358815]="Singleton",G[G.Narrowable=536624127]="Narrowable",G[G.IncludesMask=205258751]="IncludesMask",G[G.IncludesMissingType=262144]="IncludesMissingType",G[G.IncludesNonWideningType=4194304]="IncludesNonWideningType",G[G.IncludesWildcard=8388608]="IncludesWildcard",G[G.IncludesEmptyObject=16777216]="IncludesEmptyObject",G[G.IncludesInstantiable=33554432]="IncludesInstantiable",G[G.NotPrimitiveUnion=36323363]="NotPrimitiveUnion",(H=e.ObjectFlags||(e.ObjectFlags={}))[H.Class=1]="Class",H[H.Interface=2]="Interface",H[H.Reference=4]="Reference",H[H.Tuple=8]="Tuple",H[H.Anonymous=16]="Anonymous",H[H.Mapped=32]="Mapped",H[H.Instantiated=64]="Instantiated",H[H.ObjectLiteral=128]="ObjectLiteral",H[H.EvolvingArray=256]="EvolvingArray",H[H.ObjectLiteralPatternWithComputedProperties=512]="ObjectLiteralPatternWithComputedProperties",H[H.ReverseMapped=1024]="ReverseMapped",H[H.JsxAttributes=2048]="JsxAttributes",H[H.MarkerType=4096]="MarkerType",H[H.JSLiteral=8192]="JSLiteral",H[H.FreshLiteral=16384]="FreshLiteral",H[H.ArrayLiteral=32768]="ArrayLiteral",H[H.PrimitiveUnion=65536]="PrimitiveUnion",H[H.ContainsWideningType=131072]="ContainsWideningType",H[H.ContainsObjectOrArrayLiteral=262144]="ContainsObjectOrArrayLiteral",H[H.NonInferrableType=524288]="NonInferrableType",H[H.CouldContainTypeVariablesComputed=1048576]="CouldContainTypeVariablesComputed",H[H.CouldContainTypeVariables=2097152]="CouldContainTypeVariables",H[H.ClassOrInterface=3]="ClassOrInterface",H[H.RequiresWidening=393216]="RequiresWidening",H[H.PropagatingFlags=917504]="PropagatingFlags",H[H.ObjectTypeKindMask=1343]="ObjectTypeKindMask",H[H.ContainsSpread=4194304]="ContainsSpread",H[H.ObjectRestType=8388608]="ObjectRestType",H[H.IsClassInstanceClone=16777216]="IsClassInstanceClone",H[H.IdenticalBaseTypeCalculated=33554432]="IdenticalBaseTypeCalculated",H[H.IdenticalBaseTypeExists=67108864]="IdenticalBaseTypeExists",H[H.IsGenericTypeComputed=4194304]="IsGenericTypeComputed",H[H.IsGenericObjectType=8388608]="IsGenericObjectType",H[H.IsGenericIndexType=16777216]="IsGenericIndexType",H[H.IsGenericType=25165824]="IsGenericType",H[H.ContainsIntersections=33554432]="ContainsIntersections",H[H.IsNeverIntersectionComputed=33554432]="IsNeverIntersectionComputed",H[H.IsNeverIntersection=67108864]="IsNeverIntersection",(W=e.VarianceFlags||(e.VarianceFlags={}))[W.Invariant=0]="Invariant",W[W.Covariant=1]="Covariant",W[W.Contravariant=2]="Contravariant",W[W.Bivariant=3]="Bivariant",W[W.Independent=4]="Independent",W[W.VarianceMask=7]="VarianceMask",W[W.Unmeasurable=8]="Unmeasurable",W[W.Unreliable=16]="Unreliable",W[W.AllowsStructuralFallback=24]="AllowsStructuralFallback",(q=e.ElementFlags||(e.ElementFlags={}))[q.Required=1]="Required",q[q.Optional=2]="Optional",q[q.Rest=4]="Rest",q[q.Variadic=8]="Variadic",q[q.Fixed=3]="Fixed",q[q.Variable=12]="Variable",q[q.NonRequired=14]="NonRequired",q[q.NonRest=11]="NonRest",(V=e.AccessFlags||(e.AccessFlags={}))[V.None=0]="None",V[V.IncludeUndefined=1]="IncludeUndefined",V[V.NoIndexSignatures=2]="NoIndexSignatures",V[V.Writing=4]="Writing",V[V.CacheSymbol=8]="CacheSymbol",V[V.NoTupleBoundsCheck=16]="NoTupleBoundsCheck",V[V.ExpressionPosition=32]="ExpressionPosition",V[V.ReportDeprecated=64]="ReportDeprecated",V[V.SuppressNoImplicitAnyError=128]="SuppressNoImplicitAnyError",V[V.Contextual=256]="Contextual",V[V.Persistent=1]="Persistent",(K=e.JsxReferenceKind||(e.JsxReferenceKind={}))[K.Component=0]="Component",K[K.Function=1]="Function",K[K.Mixed=2]="Mixed",(U=e.SignatureKind||(e.SignatureKind={}))[U.Call=0]="Call",U[U.Construct=1]="Construct",(z=e.SignatureFlags||(e.SignatureFlags={}))[z.None=0]="None",z[z.HasRestParameter=1]="HasRestParameter",z[z.HasLiteralTypes=2]="HasLiteralTypes",z[z.Abstract=4]="Abstract",z[z.IsInnerCallChain=8]="IsInnerCallChain",z[z.IsOuterCallChain=16]="IsOuterCallChain",z[z.IsUntypedSignatureInJSFile=32]="IsUntypedSignatureInJSFile",z[z.PropagatingFlags=39]="PropagatingFlags",z[z.CallChainFlags=24]="CallChainFlags",(J=e.IndexKind||(e.IndexKind={}))[J.String=0]="String",J[J.Number=1]="Number",(j=e.TypeMapKind||(e.TypeMapKind={}))[j.Simple=0]="Simple",j[j.Array=1]="Array",j[j.Function=2]="Function",j[j.Composite=3]="Composite",j[j.Merged=4]="Merged",(B=e.InferencePriority||(e.InferencePriority={}))[B.NakedTypeVariable=1]="NakedTypeVariable",B[B.SpeculativeTuple=2]="SpeculativeTuple",B[B.SubstituteSource=4]="SubstituteSource",B[B.HomomorphicMappedType=8]="HomomorphicMappedType",B[B.PartialHomomorphicMappedType=16]="PartialHomomorphicMappedType",B[B.MappedTypeConstraint=32]="MappedTypeConstraint",B[B.ContravariantConditional=64]="ContravariantConditional",B[B.ReturnType=128]="ReturnType",B[B.LiteralKeyof=256]="LiteralKeyof",B[B.NoConstraints=512]="NoConstraints",B[B.AlwaysStrict=1024]="AlwaysStrict",B[B.MaxValue=2048]="MaxValue",B[B.PriorityImpliesCombination=416]="PriorityImpliesCombination",B[B.Circularity=-1]="Circularity",(R=e.InferenceFlags||(e.InferenceFlags={}))[R.None=0]="None",R[R.NoDefault=1]="NoDefault",R[R.AnyDefault=2]="AnyDefault",R[R.SkippedGenericFunction=4]="SkippedGenericFunction",(L=e.Ternary||(e.Ternary={}))[L.False=0]="False",L[L.Unknown=1]="Unknown",L[L.Maybe=3]="Maybe",L[L.True=-1]="True",(M=e.AssignmentDeclarationKind||(e.AssignmentDeclarationKind={}))[M.None=0]="None",M[M.ExportsProperty=1]="ExportsProperty",M[M.ModuleExports=2]="ModuleExports",M[M.PrototypeProperty=3]="PrototypeProperty",M[M.ThisProperty=4]="ThisProperty",M[M.Property=5]="Property",M[M.Prototype=6]="Prototype",M[M.ObjectDefinePropertyValue=7]="ObjectDefinePropertyValue",M[M.ObjectDefinePropertyExports=8]="ObjectDefinePropertyExports",M[M.ObjectDefinePrototypeProperty=9]="ObjectDefinePrototypeProperty",function(e){e[e.Warning=0]="Warning",e[e.Error=1]="Error",e[e.Suggestion=2]="Suggestion",e[e.Message=3]="Message";}(u=e.DiagnosticCategory||(e.DiagnosticCategory={})),e.diagnosticCategoryName=function(e,t){void 0===t&&(t=!0);var r=u[e.category];return t?r.toLowerCase():r},(O=e.ModuleResolutionKind||(e.ModuleResolutionKind={}))[O.Classic=1]="Classic",O[O.NodeJs=2]="NodeJs",O[O.Node12=3]="Node12",O[O.NodeNext=99]="NodeNext",(I=e.WatchFileKind||(e.WatchFileKind={}))[I.FixedPollingInterval=0]="FixedPollingInterval",I[I.PriorityPollingInterval=1]="PriorityPollingInterval",I[I.DynamicPriorityPolling=2]="DynamicPriorityPolling",I[I.FixedChunkSizePolling=3]="FixedChunkSizePolling",I[I.UseFsEvents=4]="UseFsEvents",I[I.UseFsEventsOnParentDirectory=5]="UseFsEventsOnParentDirectory",(w=e.WatchDirectoryKind||(e.WatchDirectoryKind={}))[w.UseFsEvents=0]="UseFsEvents",w[w.FixedPollingInterval=1]="FixedPollingInterval",w[w.DynamicPriorityPolling=2]="DynamicPriorityPolling",w[w.FixedChunkSizePolling=3]="FixedChunkSizePolling",(P=e.PollingWatchKind||(e.PollingWatchKind={}))[P.FixedInterval=0]="FixedInterval",P[P.PriorityInterval=1]="PriorityInterval",P[P.DynamicPriority=2]="DynamicPriority",P[P.FixedChunkSize=3]="FixedChunkSize",(A=e.ModuleKind||(e.ModuleKind={}))[A.None=0]="None",A[A.CommonJS=1]="CommonJS",A[A.AMD=2]="AMD",A[A.UMD=3]="UMD",A[A.System=4]="System",A[A.ES2015=5]="ES2015",A[A.ES2020=6]="ES2020",A[A.ES2022=7]="ES2022",A[A.ESNext=99]="ESNext",A[A.Node12=100]="Node12",A[A.NodeNext=199]="NodeNext",(F=e.JsxEmit||(e.JsxEmit={}))[F.None=0]="None",F[F.Preserve=1]="Preserve",F[F.React=2]="React",F[F.ReactNative=3]="ReactNative",F[F.ReactJSX=4]="ReactJSX",F[F.ReactJSXDev=5]="ReactJSXDev",(N=e.ImportsNotUsedAsValues||(e.ImportsNotUsedAsValues={}))[N.Remove=0]="Remove",N[N.Preserve=1]="Preserve",N[N.Error=2]="Error",(k=e.NewLineKind||(e.NewLineKind={}))[k.CarriageReturnLineFeed=0]="CarriageReturnLineFeed",k[k.LineFeed=1]="LineFeed",(E=e.ScriptKind||(e.ScriptKind={}))[E.Unknown=0]="Unknown",E[E.JS=1]="JS",E[E.JSX=2]="JSX",E[E.TS=3]="TS",E[E.TSX=4]="TSX",E[E.External=5]="External",E[E.JSON=6]="JSON",E[E.Deferred=7]="Deferred",(C=e.ScriptTarget||(e.ScriptTarget={}))[C.ES3=0]="ES3",C[C.ES5=1]="ES5",C[C.ES2015=2]="ES2015",C[C.ES2016=3]="ES2016",C[C.ES2017=4]="ES2017",C[C.ES2018=5]="ES2018",C[C.ES2019=6]="ES2019",C[C.ES2020=7]="ES2020",C[C.ES2021=8]="ES2021",C[C.ESNext=99]="ESNext",C[C.JSON=100]="JSON",C[C.Latest=99]="Latest",(T=e.LanguageVariant||(e.LanguageVariant={}))[T.Standard=0]="Standard",T[T.JSX=1]="JSX",(S=e.WatchDirectoryFlags||(e.WatchDirectoryFlags={}))[S.None=0]="None",S[S.Recursive=1]="Recursive",(D=e.CharacterCodes||(e.CharacterCodes={}))[D.nullCharacter=0]="nullCharacter",D[D.maxAsciiCharacter=127]="maxAsciiCharacter",D[D.lineFeed=10]="lineFeed",D[D.carriageReturn=13]="carriageReturn",D[D.lineSeparator=8232]="lineSeparator",D[D.paragraphSeparator=8233]="paragraphSeparator",D[D.nextLine=133]="nextLine",D[D.space=32]="space",D[D.nonBreakingSpace=160]="nonBreakingSpace",D[D.enQuad=8192]="enQuad",D[D.emQuad=8193]="emQuad",D[D.enSpace=8194]="enSpace",D[D.emSpace=8195]="emSpace",D[D.threePerEmSpace=8196]="threePerEmSpace",D[D.fourPerEmSpace=8197]="fourPerEmSpace",D[D.sixPerEmSpace=8198]="sixPerEmSpace",D[D.figureSpace=8199]="figureSpace",D[D.punctuationSpace=8200]="punctuationSpace",D[D.thinSpace=8201]="thinSpace",D[D.hairSpace=8202]="hairSpace",D[D.zeroWidthSpace=8203]="zeroWidthSpace",D[D.narrowNoBreakSpace=8239]="narrowNoBreakSpace",D[D.ideographicSpace=12288]="ideographicSpace",D[D.mathematicalSpace=8287]="mathematicalSpace",D[D.ogham=5760]="ogham",D[D._=95]="_",D[D.$=36]="$",D[D._0=48]="_0",D[D._1=49]="_1",D[D._2=50]="_2",D[D._3=51]="_3",D[D._4=52]="_4",D[D._5=53]="_5",D[D._6=54]="_6",D[D._7=55]="_7",D[D._8=56]="_8",D[D._9=57]="_9",D[D.a=97]="a",D[D.b=98]="b",D[D.c=99]="c",D[D.d=100]="d",D[D.e=101]="e",D[D.f=102]="f",D[D.g=103]="g",D[D.h=104]="h",D[D.i=105]="i",D[D.j=106]="j",D[D.k=107]="k",D[D.l=108]="l",D[D.m=109]="m",D[D.n=110]="n",D[D.o=111]="o",D[D.p=112]="p",D[D.q=113]="q",D[D.r=114]="r",D[D.s=115]="s",D[D.t=116]="t",D[D.u=117]="u",D[D.v=118]="v",D[D.w=119]="w",D[D.x=120]="x",D[D.y=121]="y",D[D.z=122]="z",D[D.A=65]="A",D[D.B=66]="B",D[D.C=67]="C",D[D.D=68]="D",D[D.E=69]="E",D[D.F=70]="F",D[D.G=71]="G",D[D.H=72]="H",D[D.I=73]="I",D[D.J=74]="J",D[D.K=75]="K",D[D.L=76]="L",D[D.M=77]="M",D[D.N=78]="N",D[D.O=79]="O",D[D.P=80]="P",D[D.Q=81]="Q",D[D.R=82]="R",D[D.S=83]="S",D[D.T=84]="T",D[D.U=85]="U",D[D.V=86]="V",D[D.W=87]="W",D[D.X=88]="X",D[D.Y=89]="Y",D[D.Z=90]="Z",D[D.ampersand=38]="ampersand",D[D.asterisk=42]="asterisk",D[D.at=64]="at",D[D.backslash=92]="backslash",D[D.backtick=96]="backtick",D[D.bar=124]="bar",D[D.caret=94]="caret",D[D.closeBrace=125]="closeBrace",D[D.closeBracket=93]="closeBracket",D[D.closeParen=41]="closeParen",D[D.colon=58]="colon",D[D.comma=44]="comma",D[D.dot=46]="dot",D[D.doubleQuote=34]="doubleQuote",D[D.equals=61]="equals",D[D.exclamation=33]="exclamation",D[D.greaterThan=62]="greaterThan",D[D.hash=35]="hash",D[D.lessThan=60]="lessThan",D[D.minus=45]="minus",D[D.openBrace=123]="openBrace",D[D.openBracket=91]="openBracket",D[D.openParen=40]="openParen",D[D.percent=37]="percent",D[D.plus=43]="plus",D[D.question=63]="question",D[D.semicolon=59]="semicolon",D[D.singleQuote=39]="singleQuote",D[D.slash=47]="slash",D[D.tilde=126]="tilde",D[D.backspace=8]="backspace",D[D.formFeed=12]="formFeed",D[D.byteOrderMark=65279]="byteOrderMark",D[D.tab=9]="tab",D[D.verticalTab=11]="verticalTab",(x=e.Extension||(e.Extension={})).Ts=".ts",x.Tsx=".tsx",x.Dts=".d.ts",x.Js=".js",x.Jsx=".jsx",x.Json=".json",x.TsBuildInfo=".tsbuildinfo",x.Mjs=".mjs",x.Mts=".mts",x.Dmts=".d.mts",x.Cjs=".cjs",x.Cts=".cts",x.Dcts=".d.cts",(b=e.TransformFlags||(e.TransformFlags={}))[b.None=0]="None",b[b.ContainsTypeScript=1]="ContainsTypeScript",b[b.ContainsJsx=2]="ContainsJsx",b[b.ContainsESNext=4]="ContainsESNext",b[b.ContainsES2021=8]="ContainsES2021",b[b.ContainsES2020=16]="ContainsES2020",b[b.ContainsES2019=32]="ContainsES2019",b[b.ContainsES2018=64]="ContainsES2018",b[b.ContainsES2017=128]="ContainsES2017",b[b.ContainsES2016=256]="ContainsES2016",b[b.ContainsES2015=512]="ContainsES2015",b[b.ContainsGenerator=1024]="ContainsGenerator",b[b.ContainsDestructuringAssignment=2048]="ContainsDestructuringAssignment",b[b.ContainsTypeScriptClassSyntax=4096]="ContainsTypeScriptClassSyntax",b[b.ContainsLexicalThis=8192]="ContainsLexicalThis",b[b.ContainsRestOrSpread=16384]="ContainsRestOrSpread",b[b.ContainsObjectRestOrSpread=32768]="ContainsObjectRestOrSpread",b[b.ContainsComputedPropertyName=65536]="ContainsComputedPropertyName",b[b.ContainsBlockScopedBinding=131072]="ContainsBlockScopedBinding",b[b.ContainsBindingPattern=262144]="ContainsBindingPattern",b[b.ContainsYield=524288]="ContainsYield",b[b.ContainsAwait=1048576]="ContainsAwait",b[b.ContainsHoistedDeclarationOrCompletion=2097152]="ContainsHoistedDeclarationOrCompletion",b[b.ContainsDynamicImport=4194304]="ContainsDynamicImport",b[b.ContainsClassFields=8388608]="ContainsClassFields",b[b.ContainsPossibleTopLevelAwait=16777216]="ContainsPossibleTopLevelAwait",b[b.ContainsLexicalSuper=33554432]="ContainsLexicalSuper",b[b.ContainsUpdateExpressionForIdentifier=67108864]="ContainsUpdateExpressionForIdentifier",b[b.HasComputedFlags=536870912]="HasComputedFlags",b[b.AssertTypeScript=1]="AssertTypeScript",b[b.AssertJsx=2]="AssertJsx",b[b.AssertESNext=4]="AssertESNext",b[b.AssertES2021=8]="AssertES2021",b[b.AssertES2020=16]="AssertES2020",b[b.AssertES2019=32]="AssertES2019",b[b.AssertES2018=64]="AssertES2018",b[b.AssertES2017=128]="AssertES2017",b[b.AssertES2016=256]="AssertES2016",b[b.AssertES2015=512]="AssertES2015",b[b.AssertGenerator=1024]="AssertGenerator",b[b.AssertDestructuringAssignment=2048]="AssertDestructuringAssignment",b[b.OuterExpressionExcludes=536870912]="OuterExpressionExcludes",b[b.PropertyAccessExcludes=536870912]="PropertyAccessExcludes",b[b.NodeExcludes=536870912]="NodeExcludes",b[b.ArrowFunctionExcludes=557748224]="ArrowFunctionExcludes",b[b.FunctionExcludes=591310848]="FunctionExcludes",b[b.ConstructorExcludes=591306752]="ConstructorExcludes",b[b.MethodOrAccessorExcludes=574529536]="MethodOrAccessorExcludes",b[b.PropertyExcludes=570433536]="PropertyExcludes",b[b.ClassExcludes=536940544]="ClassExcludes",b[b.ModuleExcludes=589443072]="ModuleExcludes",b[b.TypeExcludes=-2]="TypeExcludes",b[b.ObjectLiteralExcludes=536973312]="ObjectLiteralExcludes",b[b.ArrayLiteralOrCallOrNewExcludes=536887296]="ArrayLiteralOrCallOrNewExcludes",b[b.VariableDeclarationListExcludes=537165824]="VariableDeclarationListExcludes",b[b.ParameterExcludes=536870912]="ParameterExcludes",b[b.CatchClauseExcludes=536903680]="CatchClauseExcludes",b[b.BindingPatternExcludes=536887296]="BindingPatternExcludes",b[b.ContainsLexicalThisOrSuper=33562624]="ContainsLexicalThisOrSuper",b[b.PropertyNamePropagatingFlags=33562624]="PropertyNamePropagatingFlags",(h=e.SnippetKind||(e.SnippetKind={}))[h.TabStop=0]="TabStop",h[h.Placeholder=1]="Placeholder",h[h.Choice=2]="Choice",h[h.Variable=3]="Variable",(v=e.EmitFlags||(e.EmitFlags={}))[v.None=0]="None",v[v.SingleLine=1]="SingleLine",v[v.AdviseOnEmitNode=2]="AdviseOnEmitNode",v[v.NoSubstitution=4]="NoSubstitution",v[v.CapturesThis=8]="CapturesThis",v[v.NoLeadingSourceMap=16]="NoLeadingSourceMap",v[v.NoTrailingSourceMap=32]="NoTrailingSourceMap",v[v.NoSourceMap=48]="NoSourceMap",v[v.NoNestedSourceMaps=64]="NoNestedSourceMaps",v[v.NoTokenLeadingSourceMaps=128]="NoTokenLeadingSourceMaps",v[v.NoTokenTrailingSourceMaps=256]="NoTokenTrailingSourceMaps",v[v.NoTokenSourceMaps=384]="NoTokenSourceMaps",v[v.NoLeadingComments=512]="NoLeadingComments",v[v.NoTrailingComments=1024]="NoTrailingComments",v[v.NoComments=1536]="NoComments",v[v.NoNestedComments=2048]="NoNestedComments",v[v.HelperName=4096]="HelperName",v[v.ExportName=8192]="ExportName",v[v.LocalName=16384]="LocalName",v[v.InternalName=32768]="InternalName",v[v.Indented=65536]="Indented",v[v.NoIndentation=131072]="NoIndentation",v[v.AsyncFunctionBody=262144]="AsyncFunctionBody",v[v.ReuseTempVariableScope=524288]="ReuseTempVariableScope",v[v.CustomPrologue=1048576]="CustomPrologue",v[v.NoHoisting=2097152]="NoHoisting",v[v.HasEndOfDeclarationMarker=4194304]="HasEndOfDeclarationMarker",v[v.Iterator=8388608]="Iterator",v[v.NoAsciiEscaping=16777216]="NoAsciiEscaping",v[v.TypeScriptClassWrapper=33554432]="TypeScriptClassWrapper",v[v.NeverApplyImportHelper=67108864]="NeverApplyImportHelper",v[v.IgnoreSourceNewlines=134217728]="IgnoreSourceNewlines",v[v.Immutable=268435456]="Immutable",v[v.IndirectCall=536870912]="IndirectCall",(y=e.ExternalEmitHelpers||(e.ExternalEmitHelpers={}))[y.Extends=1]="Extends",y[y.Assign=2]="Assign",y[y.Rest=4]="Rest",y[y.Decorate=8]="Decorate",y[y.Metadata=16]="Metadata",y[y.Param=32]="Param",y[y.Awaiter=64]="Awaiter",y[y.Generator=128]="Generator",y[y.Values=256]="Values",y[y.Read=512]="Read",y[y.SpreadArray=1024]="SpreadArray",y[y.Await=2048]="Await",y[y.AsyncGenerator=4096]="AsyncGenerator",y[y.AsyncDelegator=8192]="AsyncDelegator",y[y.AsyncValues=16384]="AsyncValues",y[y.ExportStar=32768]="ExportStar",y[y.ImportStar=65536]="ImportStar",y[y.ImportDefault=131072]="ImportDefault",y[y.MakeTemplateObject=262144]="MakeTemplateObject",y[y.ClassPrivateFieldGet=524288]="ClassPrivateFieldGet",y[y.ClassPrivateFieldSet=1048576]="ClassPrivateFieldSet",y[y.ClassPrivateFieldIn=2097152]="ClassPrivateFieldIn",y[y.CreateBinding=4194304]="CreateBinding",y[y.FirstEmitHelper=1]="FirstEmitHelper",y[y.LastEmitHelper=4194304]="LastEmitHelper",y[y.ForOfIncludes=256]="ForOfIncludes",y[y.ForAwaitOfIncludes=16384]="ForAwaitOfIncludes",y[y.AsyncGeneratorIncludes=6144]="AsyncGeneratorIncludes",y[y.AsyncDelegatorIncludes=26624]="AsyncDelegatorIncludes",y[y.SpreadIncludes=1536]="SpreadIncludes",(m=e.EmitHint||(e.EmitHint={}))[m.SourceFile=0]="SourceFile",m[m.Expression=1]="Expression",m[m.IdentifierName=2]="IdentifierName",m[m.MappedTypeParameter=3]="MappedTypeParameter",m[m.Unspecified=4]="Unspecified",m[m.EmbeddedStatement=5]="EmbeddedStatement",m[m.JsxAttributeValue=6]="JsxAttributeValue",(g=e.OuterExpressionKinds||(e.OuterExpressionKinds={}))[g.Parentheses=1]="Parentheses",g[g.TypeAssertions=2]="TypeAssertions",g[g.NonNullAssertions=4]="NonNullAssertions",g[g.PartiallyEmittedExpressions=8]="PartiallyEmittedExpressions",g[g.Assertions=6]="Assertions",g[g.All=15]="All",g[g.ExcludeJSDocTypeAssertion=16]="ExcludeJSDocTypeAssertion",(f=e.LexicalEnvironmentFlags||(e.LexicalEnvironmentFlags={}))[f.None=0]="None",f[f.InParameters=1]="InParameters",f[f.VariablesHoistedInParameters=2]="VariablesHoistedInParameters",(p=e.BundleFileSectionKind||(e.BundleFileSectionKind={})).Prologue="prologue",p.EmitHelpers="emitHelpers",p.NoDefaultLib="no-default-lib",p.Reference="reference",p.Type="type",p.Lib="lib",p.Prepend="prepend",p.Text="text",p.Internal="internal",(d=e.ListFormat||(e.ListFormat={}))[d.None=0]="None",d[d.SingleLine=0]="SingleLine",d[d.MultiLine=1]="MultiLine",d[d.PreserveLines=2]="PreserveLines",d[d.LinesMask=3]="LinesMask",d[d.NotDelimited=0]="NotDelimited",d[d.BarDelimited=4]="BarDelimited",d[d.AmpersandDelimited=8]="AmpersandDelimited",d[d.CommaDelimited=16]="CommaDelimited",d[d.AsteriskDelimited=32]="AsteriskDelimited",d[d.DelimitersMask=60]="DelimitersMask",d[d.AllowTrailingComma=64]="AllowTrailingComma",d[d.Indented=128]="Indented",d[d.SpaceBetweenBraces=256]="SpaceBetweenBraces",d[d.SpaceBetweenSiblings=512]="SpaceBetweenSiblings",d[d.Braces=1024]="Braces",d[d.Parenthesis=2048]="Parenthesis",d[d.AngleBrackets=4096]="AngleBrackets",d[d.SquareBrackets=8192]="SquareBrackets",d[d.BracketsMask=15360]="BracketsMask",d[d.OptionalIfUndefined=16384]="OptionalIfUndefined",d[d.OptionalIfEmpty=32768]="OptionalIfEmpty",d[d.Optional=49152]="Optional",d[d.PreferNewLine=65536]="PreferNewLine",d[d.NoTrailingNewLine=131072]="NoTrailingNewLine",d[d.NoInterveningComments=262144]="NoInterveningComments",d[d.NoSpaceIfEmpty=524288]="NoSpaceIfEmpty",d[d.SingleElement=1048576]="SingleElement",d[d.SpaceAfterList=2097152]="SpaceAfterList",d[d.Modifiers=262656]="Modifiers",d[d.HeritageClauses=512]="HeritageClauses",d[d.SingleLineTypeLiteralMembers=768]="SingleLineTypeLiteralMembers",d[d.MultiLineTypeLiteralMembers=32897]="MultiLineTypeLiteralMembers",d[d.SingleLineTupleTypeElements=528]="SingleLineTupleTypeElements",d[d.MultiLineTupleTypeElements=657]="MultiLineTupleTypeElements",d[d.UnionTypeConstituents=516]="UnionTypeConstituents",d[d.IntersectionTypeConstituents=520]="IntersectionTypeConstituents",d[d.ObjectBindingPatternElements=525136]="ObjectBindingPatternElements",d[d.ArrayBindingPatternElements=524880]="ArrayBindingPatternElements",d[d.ObjectLiteralExpressionProperties=526226]="ObjectLiteralExpressionProperties",d[d.ImportClauseEntries=526226]="ImportClauseEntries",d[d.ArrayLiteralExpressionElements=8914]="ArrayLiteralExpressionElements",d[d.CommaListElements=528]="CommaListElements",d[d.CallExpressionArguments=2576]="CallExpressionArguments",d[d.NewExpressionArguments=18960]="NewExpressionArguments",d[d.TemplateExpressionSpans=262144]="TemplateExpressionSpans",d[d.SingleLineBlockStatements=768]="SingleLineBlockStatements",d[d.MultiLineBlockStatements=129]="MultiLineBlockStatements",d[d.VariableDeclarationList=528]="VariableDeclarationList",d[d.SingleLineFunctionBodyStatements=768]="SingleLineFunctionBodyStatements",d[d.MultiLineFunctionBodyStatements=1]="MultiLineFunctionBodyStatements",d[d.ClassHeritageClauses=0]="ClassHeritageClauses",d[d.ClassMembers=129]="ClassMembers",d[d.InterfaceMembers=129]="InterfaceMembers",d[d.EnumMembers=145]="EnumMembers",d[d.CaseBlockClauses=129]="CaseBlockClauses",d[d.NamedImportsOrExportsElements=525136]="NamedImportsOrExportsElements",d[d.JsxElementOrFragmentChildren=262144]="JsxElementOrFragmentChildren",d[d.JsxElementAttributes=262656]="JsxElementAttributes",d[d.CaseOrDefaultClauseStatements=163969]="CaseOrDefaultClauseStatements",d[d.HeritageClauseTypes=528]="HeritageClauseTypes",d[d.SourceFileStatements=131073]="SourceFileStatements",d[d.Decorators=2146305]="Decorators",d[d.TypeArguments=53776]="TypeArguments",d[d.TypeParameters=53776]="TypeParameters",d[d.Parameters=2576]="Parameters",d[d.IndexSignatureParameters=8848]="IndexSignatureParameters",d[d.JSDocComment=33]="JSDocComment",(_=e.PragmaKindFlags||(e.PragmaKindFlags={}))[_.None=0]="None",_[_.TripleSlashXML=1]="TripleSlashXML",_[_.SingleLine=2]="SingleLine",_[_.MultiLine=4]="MultiLine",_[_.All=7]="All",_[_.Default=7]="Default",e.commentPragmas={reference:{args:[{name:"types",optional:!0,captureSpan:!0},{name:"lib",optional:!0,captureSpan:!0},{name:"path",optional:!0,captureSpan:!0},{name:"no-default-lib",optional:!0}],kind:1},"amd-dependency":{args:[{name:"path"},{name:"name",optional:!0}],kind:1},"amd-module":{args:[{name:"name"}],kind:1},"ts-check":{kind:2},"ts-nocheck":{kind:2},jsx:{args:[{name:"factory"}],kind:4},jsxfrag:{args:[{name:"factory"}],kind:4},jsximportsource:{args:[{name:"factory"}],kind:4},jsxruntime:{args:[{name:"factory"}],kind:4}};}(t),function(e){e.directorySeparator="/",e.altDirectorySeparator="\\";var t=/\\/g;function r(e){return 47===e||92===e}function i(e){return u(e)>0}function a(e){return 0!==u(e)}function o(e){return /^\.\.?($|[\\/])/.test(e)}function s(t,r){return t.length>r.length&&e.endsWith(t,r)}function c(e){return e.length>0&&r(e.charCodeAt(e.length-1))}function l(e){return e>=97&&e<=122||e>=65&&e<=90}function u(t){if(!t)return 0;var r=t.charCodeAt(0);if(47===r||92===r){if(t.charCodeAt(1)!==r)return 1;var n=t.indexOf(47===r?e.directorySeparator:e.altDirectorySeparator,2);return n<0?t.length:n+1}if(l(r)&&58===t.charCodeAt(1)){var i=t.charCodeAt(2);if(47===i||92===i)return 3;if(2===t.length)return 2}var a=t.indexOf("://");if(-1!==a){var o=a+"://".length,s=t.indexOf(e.directorySeparator,o);if(-1!==s){var c=t.slice(0,a),u=t.slice(o,s);if("file"===c&&(""===u||"localhost"===u)&&l(t.charCodeAt(s+1))){var _=function(e,t){var r=e.charCodeAt(t);if(58===r)return t+1;if(37===r&&51===e.charCodeAt(t+1)){var n=e.charCodeAt(t+2);if(97===n||65===n)return t+3}return -1}(t,s+2);if(-1!==_){if(47===t.charCodeAt(_))return ~(_+1);if(_===t.length)return ~_}}return ~(s+1)}return ~t.length}return 0}function _(e){var t=u(e);return t<0?~t:t}function d(t){var r=_(t=v(t));return r===t.length?t:(t=C(t)).slice(0,Math.max(r,t.lastIndexOf(e.directorySeparator)))}function p(t,r,n){if(_(t=v(t))===t.length)return "";var i=(t=C(t)).slice(Math.max(_(t),t.lastIndexOf(e.directorySeparator)+1)),a=void 0!==r&&void 0!==n?g(i,r,n):void 0;return a?i.slice(0,i.length-a.length):i}function f(t,r,n){if(e.startsWith(r,".")||(r="."+r),t.length>=r.length&&46===t.charCodeAt(t.length-r.length)){var i=t.slice(t.length-r.length);if(n(i,r))return i}}function g(t,r,n){if(r)return function(e,t,r){if("string"==typeof t)return f(e,t,r)||"";for(var n=0,i=t;n<i.length;n++){var a=f(e,i[n],r);if(a)return a}return ""}(C(t),r,n?e.equateStringsCaseInsensitive:e.equateStringsCaseSensitive);var i=p(t),a=i.lastIndexOf(".");return a>=0?i.substring(a):""}function m(t,r){return void 0===r&&(r=""),function(t,r){var i=t.substring(0,r),a=t.substring(r).split(e.directorySeparator);return a.length&&!e.lastOrUndefined(a)&&a.pop(),n$3([i],a,!0)}(t=b(r,t),_(t))}function y(t){return 0===t.length?"":(t[0]&&E(t[0]))+t.slice(1).join(e.directorySeparator)}function v(r){var n=r.indexOf("\\");return -1===n?r:(t.lastIndex=n,r.replace(t,e.directorySeparator))}function h(t){if(!e.some(t))return [];for(var r=[t[0]],n=1;n<t.length;n++){var i=t[n];if(i&&"."!==i){if(".."===i)if(r.length>1){if(".."!==r[r.length-1]){r.pop();continue}}else if(r[0])continue;r.push(i);}}return r}function b(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];e&&(e=v(e));for(var n=0,i=t;n<i.length;n++){var a=i[n];a&&(a=v(a),e=e&&0===_(a)?E(e)+a:a);}return e}function x(t){for(var r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];return T(e.some(r)?b.apply(void 0,n$3([t],r,!1)):v(t))}function D(e,t){return h(m(e,t))}function S(e,t){return y(D(e,t))}function T(e){if(e=v(e),!N.test(e))return e;var t=e.replace(/\/\.\//g,"/").replace(/^\.\//,"");if(t!==e&&(e=t,!N.test(e)))return e;var r=y(h(m(e)));return r&&c(e)?E(r):r}function C(e){return c(e)?e.substr(0,e.length-1):e}function E(t){return c(t)?t:t+e.directorySeparator}function k(e){return a(e)||o(e)?e:"./"+e}e.isAnyDirectorySeparator=r,e.isUrl=function(e){return u(e)<0},e.isRootedDiskPath=i,e.isDiskPathRoot=function(e){var t=u(e);return t>0&&t===e.length},e.pathIsAbsolute=a,e.pathIsRelative=o,e.pathIsBareSpecifier=function(e){return !a(e)&&!o(e)},e.hasExtension=function(t){return e.stringContains(p(t),".")},e.fileExtensionIs=s,e.fileExtensionIsOneOf=function(e,t){for(var r=0,n=t;r<n.length;r++)if(s(e,n[r]))return !0;return !1},e.hasTrailingDirectorySeparator=c,e.getRootLength=_,e.getDirectoryPath=d,e.getBaseFileName=p,e.getAnyExtensionFromPath=g,e.getPathComponents=m,e.getPathFromPathComponents=y,e.normalizeSlashes=v,e.reducePathComponents=h,e.combinePaths=b,e.resolvePath=x,e.getNormalizedPathComponents=D,e.getNormalizedAbsolutePath=S,e.normalizePath=T,e.getNormalizedAbsolutePathWithoutRoot=function(t,r){return 0===(n=D(t,r)).length?"":n.slice(1).join(e.directorySeparator);var n;},e.toPath=function(e,t,r){return r(i(e)?T(e):S(e,t))},e.normalizePathAndParts=function(t){var r=h(m(t=v(t))),n=r[0],i=r.slice(1);if(i.length){var a=n+i.join(e.directorySeparator);return {path:c(t)?E(a):a,parts:i}}return {path:n,parts:i}},e.removeTrailingDirectorySeparator=C,e.ensureTrailingDirectorySeparator=E,e.ensurePathIsNonModuleName=k,e.changeAnyExtension=function(t,r,n,i){var a=void 0!==n&&void 0!==i?g(t,n,i):g(t);return a?t.slice(0,t.length-a.length)+(e.startsWith(r,".")?r:"."+r):t};var N=/(?:\/\/)|(?:^|\/)\.\.?(?:$|\/)/;function F(t,r,n){if(t===r)return 0;if(void 0===t)return -1;if(void 0===r)return 1;var i=t.substring(0,_(t)),a=r.substring(0,_(r)),o=e.compareStringsCaseInsensitive(i,a);if(0!==o)return o;var s=t.substring(i.length),c=r.substring(a.length);if(!N.test(s)&&!N.test(c))return n(s,c);for(var l=h(m(t)),u=h(m(r)),d=Math.min(l.length,u.length),p=1;p<d;p++){var f=n(l[p],u[p]);if(0!==f)return f}return e.compareValues(l.length,u.length)}function A(t,r,i,a){var o,s=h(m(t)),c=h(m(r));for(o=0;o<s.length&&o<c.length;o++){var l=a(s[o]),u=a(c[o]);if(!(0===o?e.equateStringsCaseInsensitive:i)(l,u))break}if(0===o)return c;for(var _=c.slice(o),d=[];o<s.length;o++)d.push("..");return n$3(n$3([""],d,!0),_,!0)}function P(t,r,n){e.Debug.assert(_(t)>0==_(r)>0,"Paths must either both be absolute or both be relative");var i="function"==typeof n?n:e.identity;return y(A(t,r,"boolean"==typeof n&&n?e.equateStringsCaseInsensitive:e.equateStringsCaseSensitive,i))}function w(t,r,n,a,o){var s=A(x(n,t),x(n,r),e.equateStringsCaseSensitive,a),c=s[0];if(o&&i(c)){var l=c.charAt(0)===e.directorySeparator?"file://":"file:///";s[0]=l+c;}return y(s)}e.comparePathsCaseSensitive=function(t,r){return F(t,r,e.compareStringsCaseSensitive)},e.comparePathsCaseInsensitive=function(t,r){return F(t,r,e.compareStringsCaseInsensitive)},e.comparePaths=function(t,r,n,i){return "string"==typeof n?(t=b(n,t),r=b(n,r)):"boolean"==typeof n&&(i=n),F(t,r,e.getStringComparer(i))},e.containsPath=function(t,r,n,i){if("string"==typeof n?(t=b(n,t),r=b(n,r)):"boolean"==typeof n&&(i=n),void 0===t||void 0===r)return !1;if(t===r)return !0;var a=h(m(t)),o=h(m(r));if(o.length<a.length)return !1;for(var s=i?e.equateStringsCaseInsensitive:e.equateStringsCaseSensitive,c=0;c<a.length;c++)if(!(0===c?e.equateStringsCaseInsensitive:s)(a[c],o[c]))return !1;return !0},e.startsWithDirectory=function(t,r,n){var i=n(t),a=n(r);return e.startsWith(i,a+"/")||e.startsWith(i,a+"\\")},e.getPathComponentsRelativeTo=A,e.getRelativePathFromDirectory=P,e.convertToRelativePath=function(e,t,r){return i(e)?w(t,e,t,r,!1):e},e.getRelativePathFromFile=function(e,t,r){return k(P(d(e),t,r))},e.getRelativePathToDirectoryOrUrl=w,e.forEachAncestorDirectory=function(e,t){for(;;){var r=t(e);if(void 0!==r)return r;var n=d(e);if(n===e)return;e=n;}},e.isNodeModulesDirectory=function(t){return e.endsWith(t,"/node_modules")};}(t),function(e){function t(e){for(var t=5381,r=0;r<e.length;r++)t=(t<<5)+t+e.charCodeAt(r);return t.toString()}var r,n;function a(t,r){return t.getModifiedTime(r)||e.missingFileModifiedTime}function o(e){var t;return (t={})[n.Low]=e.Low,t[n.Medium]=e.Medium,t[n.High]=e.High,t}e.generateDjb2Hash=t,e.setStackTraceLimit=function(){Error.stackTraceLimit<100&&(Error.stackTraceLimit=100);},function(e){e[e.Created=0]="Created",e[e.Changed=1]="Changed",e[e.Deleted=2]="Deleted";}(r=e.FileWatcherEventKind||(e.FileWatcherEventKind={})),function(e){e[e.High=2e3]="High",e[e.Medium=500]="Medium",e[e.Low=250]="Low";}(n=e.PollingInterval||(e.PollingInterval={})),e.missingFileModifiedTime=new Date(0),e.getModifiedTime=a;var s,c,l={Low:32,Medium:64,High:256},u=o(l);function _(t){if(t.getEnvironmentVariable){var r=function(e,t){var r=a("TSC_WATCH_POLLINGINTERVAL");return !!r&&(n("Low"),n("Medium"),n("High"),!0);function n(e){t[e]=r[e]||t[e];}}(0,n);u=s("TSC_WATCH_POLLINGCHUNKSIZE",l)||u,e.unchangedPollThresholds=s("TSC_WATCH_UNCHANGEDPOLLTHRESHOLDS",l)||e.unchangedPollThresholds;}function a(e){var r;return n("Low"),n("Medium"),n("High"),r;function n(n){var i=function(e,r){return t.getEnvironmentVariable("".concat(e,"_").concat(r.toUpperCase()))}(e,n);i&&((r||(r={}))[n]=Number(i));}}function s(e,t){var n=a(e);return (r||n)&&o(n?i$1(i$1({},t),n):t)}}function d(e,t,r,n,i){for(var o=r,s=t.length;n&&s;++r===t.length&&(o<r&&(t.length=o),r=0,o=0),s--){var c=t[r];if(c)if(c.isClosed)t[r]=void 0;else {n--;var l=m(c,a(e,c.fileName));c.isClosed?t[r]=void 0:(null==i||i(c,r,l),t[r]&&(o<r&&(t[o]=c,t[r]=void 0),o++));}}return r}function p(t){var r=[],i=[],o=l(n.Low),s=l(n.Medium),c=l(n.High);return function(n,i,o){var s={fileName:n,callback:i,unchangedPolls:0,mtime:a(t,n)};return r.push(s),m(s,o),{close:function(){s.isClosed=!0,e.unorderedRemoveItem(r,s);}}};function l(e){var t=[];return t.pollingInterval=e,t.pollIndex=0,t.pollScheduled=!1,t}function _(t){t.pollIndex=f(t,t.pollingInterval,t.pollIndex,u[t.pollingInterval]),t.length?v(t.pollingInterval):(e.Debug.assert(0===t.pollIndex),t.pollScheduled=!1);}function p(e){f(i,n.Low,0,i.length),_(e),!e.pollScheduled&&i.length&&v(n.Low);}function f(r,a,o,s){return d(t,r,o,s,(function(t,o,s){var c;s?(t.unchangedPolls=0,r!==i&&(r[o]=void 0,c=t,i.push(c),y(n.Low))):t.unchangedPolls!==e.unchangedPollThresholds[a]?t.unchangedPolls++:r===i?(t.unchangedPolls=1,r[o]=void 0,m(t,n.Low)):a!==n.High&&(t.unchangedPolls++,r[o]=void 0,m(t,a===n.Low?n.Medium:n.High));}))}function g(e){switch(e){case n.Low:return o;case n.Medium:return s;case n.High:return c}}function m(e,t){g(t).push(e),y(t);}function y(e){g(e).pollScheduled||v(e);}function v(e){g(e).pollScheduled=t.setTimeout(e===n.Low?p:_,e,g(e));}}function f(t){var r,i=[],o=0;return function(r,n){var o={fileName:r,callback:n,mtime:a(t,r)};return i.push(o),c(),{close:function(){o.isClosed=!0,e.unorderedRemoveItem(i,o);}}};function s(){r=void 0,o=d(t,i,o,u[n.Low]),c();}function c(){i.length&&!r&&(r=t.setTimeout(s,n.High));}}function g(t,r){var n=new e.Map,i=e.createMultiMap(),a=e.createGetCanonicalFileName(r);return function(r,o,s,c){var l=a(r),u=n.get(l);return u?u.refCount++:n.set(l,{watcher:t(r,(function(t,r){return e.forEach(i.get(l),(function(e){return e(t,r)}))}),s,c),refCount:1}),i.add(l,o),{close:function(){var t=e.Debug.checkDefined(n.get(l));i.remove(l,o),t.refCount--,t.refCount||(n.delete(l),e.closeFileWatcherOf(t));}}}}function m(e,t){var r=e.mtime.getTime(),n=t.getTime();return r!==n&&(e.mtime=t,e.callback(e.fileName,y(r,n)),!0)}function y(e,t){return 0===e?r.Created:0===t?r.Deleted:r.Changed}function v(t){var r,n=t.watchDirectory,i=t.useCaseSensitiveFileNames,a=t.getCurrentDirectory,o=t.getAccessibleSortedChildDirectories,s=t.directoryExists,c=t.realpath,l=t.setTimeout,u=t.clearTimeout,_=new e.Map,d=e.createMultiMap(),p=new e.Map,f=e.getStringComparer(!i),g=e.createGetCanonicalFileName(i);return function(e,t,r,i){return r?m(e,i,t):n(e,t,r,i)};function m(t,i,a){var o=g(t),c=_.get(o);c?c.refCount++:(c={watcher:n(t,(function(e){D(e,i)||((null==i?void 0:i.synchronousWatchDirectory)?(y(o,e),x(t,o,i)):function(e,t,n,i){var a=_.get(t);a&&s(e)?function(e,t,n,i){var a=p.get(t);a?a.fileNames.push(n):p.set(t,{dirName:e,options:i,fileNames:[n]}),r&&(u(r),r=void 0),r=l(v,1e3);}(e,t,n,i):(y(t,n),h(a));}(t,o,e,i));}),!1,i),refCount:1,childWatches:e.emptyArray},_.set(o,c),x(t,o,i));var f=a&&{dirName:t,callback:a};return f&&d.add(o,f),{dirName:t,close:function(){var t=e.Debug.checkDefined(_.get(o));f&&d.remove(o,f),t.refCount--,t.refCount||(_.delete(o),e.closeFileWatcherOf(t),t.childWatches.forEach(e.closeFileWatcher));}}}function y(t,r,n){var i,a;e.isString(r)?i=r:a=r,d.forEach((function(r,o){var s;if((!a||!0!==a.get(o))&&(o===t||e.startsWith(t,o)&&t[o.length]===e.directorySeparator))if(a)if(n){var c=a.get(o);c?(s=c).push.apply(s,n):a.set(o,n.slice());}else a.set(o,!0);else r.forEach((function(e){return (0, e.callback)(i)}));}));}function v(){r=void 0,e.sysLog("sysLog:: onTimerToUpdateChildWatches:: ".concat(p.size));for(var t=e.timestamp(),n=new e.Map;!r&&p.size;){var i=p.entries().next();e.Debug.assert(!i.done);var a=i.value,o=a[0],s=a[1],c=s.dirName,l=s.options,u=s.fileNames;p.delete(o);var _=x(c,o,l);y(o,n,_?void 0:u);}e.sysLog("sysLog:: invokingWatchers:: Elapsed:: ".concat(e.timestamp()-t,"ms:: ").concat(p.size)),d.forEach((function(t,r){var i=n.get(r);i&&t.forEach((function(t){var r=t.callback,n=t.dirName;e.isArray(i)?i.forEach(r):r(n);}));}));var f=e.timestamp()-t;e.sysLog("sysLog:: Elapsed:: ".concat(f,"ms:: onTimerToUpdateChildWatches:: ").concat(p.size," ").concat(r));}function h(t){if(t){var r=t.childWatches;t.childWatches=e.emptyArray;for(var n=0,i=r;n<i.length;n++){var a=i[n];a.close(),h(_.get(g(a.dirName)));}}}function x(t,r,n){var i,a=_.get(r);if(!a)return !1;var l=e.enumerateInsertsAndDeletes(s(t)?e.mapDefined(o(t),(function(r){var i=e.getNormalizedAbsolutePath(r,t);return D(i,n)||0!==f(i,e.normalizePath(c(i)))?void 0:i})):e.emptyArray,a.childWatches,(function(e,t){return f(e,t.dirName)}),(function(e){u(m(e,n));}),e.closeFileWatcher,u);return a.childWatches=i||e.emptyArray,l;function u(e){(i||(i=[])).push(e);}}function D(t,r){return e.some(e.ignoredPaths,(function(r){return function(t,r){return !!e.stringContains(t,r)||!i&&e.stringContains(g(t),r)}(t,r)}))||b(t,r,i,a)}}function h(e){return function(t,n){return e(n===r.Changed?"change":"rename","")}}function b(t,r,n,i){return ((null==r?void 0:r.excludeDirectories)||(null==r?void 0:r.excludeFiles))&&(e.matchesExclude(t,null==r?void 0:r.excludeFiles,n,i())||e.matchesExclude(t,null==r?void 0:r.excludeDirectories,n,i()))}function x(t,r,n,i,a){return function(o,s){if("rename"===o){var c=s?e.normalizePath(e.combinePaths(t,s)):t;s&&b(c,n,i,a)||r(c);}}}function D(t){var i,a,o,s,c=t.pollingWatchFile,l=t.getModifiedTime,u=t.setTimeout,_=t.clearTimeout,d=t.fsWatch,g=t.fileExists,m=t.useCaseSensitiveFileNames,y=t.getCurrentDirectory,h=t.fsSupportsRecursiveFsWatch,b=t.directoryExists,D=t.getAccessibleSortedChildDirectories,S=t.realpath,T=t.tscWatchFile,C=t.useNonPollingWatchers,E=t.tscWatchDirectory,k=t.defaultWatchFileKind;return {watchFile:function(t,i,a,s){s=function(t,r){if(t&&void 0!==t.watchFile)return t;switch(T){case"PriorityPollingInterval":return {watchFile:e.WatchFileKind.PriorityPollingInterval};case"DynamicPriorityPolling":return {watchFile:e.WatchFileKind.DynamicPriorityPolling};case"UseFsEvents":return A(e.WatchFileKind.UseFsEvents,e.PollingWatchKind.PriorityInterval,t);case"UseFsEventsWithFallbackDynamicPolling":return A(e.WatchFileKind.UseFsEvents,e.PollingWatchKind.DynamicPriority,t);case"UseFsEventsOnParentDirectory":r=!0;default:return r?A(e.WatchFileKind.UseFsEventsOnParentDirectory,e.PollingWatchKind.PriorityInterval,t):{watchFile:(null==k?void 0:k())||e.WatchFileKind.FixedPollingInterval}}}(s,C);var l=e.Debug.checkDefined(s.watchFile);switch(l){case e.WatchFileKind.FixedPollingInterval:return c(t,i,n.Low,void 0);case e.WatchFileKind.PriorityPollingInterval:return c(t,i,a,void 0);case e.WatchFileKind.DynamicPriorityPolling:return N()(t,i,a,void 0);case e.WatchFileKind.FixedChunkSizePolling:return F()(t,i,void 0,void 0);case e.WatchFileKind.UseFsEvents:return d(t,0,function(e,t,n){return function(i){t(e,"rename"===i?n(e)?r.Created:r.Deleted:r.Changed);}}(t,i,g),!1,a,e.getFallbackOptions(s));case e.WatchFileKind.UseFsEventsOnParentDirectory:return o||(o=function(t,i){var a=e.createMultiMap(),o=new e.Map,s=e.createGetCanonicalFileName(i);return function(i,c,l,u){var _=s(i);a.add(_,c);var d=e.getDirectoryPath(_)||".",p=o.get(d)||function(i,c,l){var u=t(i,1,(function(t,n){if(e.isString(n)){var o=e.getNormalizedAbsolutePath(n,i),c=o&&a.get(s(o));if(c)for(var l=0,u=c;l<u.length;l++)(0, u[l])(o,r.Changed);}}),!1,n.Medium,l);return u.referenceCount=0,o.set(c,u),u}(e.getDirectoryPath(i)||".",d,u);return p.referenceCount++,{close:function(){1===p.referenceCount?(p.close(),o.delete(d)):p.referenceCount--,a.remove(_,c);}}}}(d,m)),o(t,i,a,e.getFallbackOptions(s));default:e.Debug.assertNever(l);}},watchDirectory:function(t,r,i,a){return h?d(t,1,x(t,r,a,m,y),i,n.Medium,e.getFallbackOptions(a)):(s||(s=v({useCaseSensitiveFileNames:m,getCurrentDirectory:y,directoryExists:b,getAccessibleSortedChildDirectories:D,watchDirectory:P,realpath:S,setTimeout:u,clearTimeout:_})),s(t,r,i,a))}};function N(){return i||(i=p({getModifiedTime:l,setTimeout:u}))}function F(){return a||(a=f({getModifiedTime:l,setTimeout:u}))}function A(e,t,r){var n=null==r?void 0:r.fallbackPolling;return {watchFile:e,fallbackPolling:void 0===n?t:n}}function P(t,r,i,a){e.Debug.assert(!i);var o=function(t){if(t&&void 0!==t.watchDirectory)return t;switch(E){case"RecursiveDirectoryUsingFsWatchFile":return {watchDirectory:e.WatchDirectoryKind.FixedPollingInterval};case"RecursiveDirectoryUsingDynamicPriorityPolling":return {watchDirectory:e.WatchDirectoryKind.DynamicPriorityPolling};default:var r=null==t?void 0:t.fallbackPolling;return {watchDirectory:e.WatchDirectoryKind.UseFsEvents,fallbackPolling:void 0!==r?r:void 0}}}(a),s=e.Debug.checkDefined(o.watchDirectory);switch(s){case e.WatchDirectoryKind.FixedPollingInterval:return c(t,(function(){return r(t)}),n.Medium,void 0);case e.WatchDirectoryKind.DynamicPriorityPolling:return N()(t,(function(){return r(t)}),n.Medium,void 0);case e.WatchDirectoryKind.FixedChunkSizePolling:return F()(t,(function(){return r(t)}),void 0,void 0);case e.WatchDirectoryKind.UseFsEvents:return d(t,1,x(t,r,a,m,y),i,n.Medium,e.getFallbackOptions(o));default:e.Debug.assertNever(s);}}}function S(t){var r=t.writeFile;t.writeFile=function(n,i,a){return e.writeFileEnsuringDirectories(n,i,!!a,(function(e,n,i){return r.call(t,e,n,i)}),(function(e){return t.createDirectory(e)}),(function(e){return t.directoryExists(e)}))};}function T(){if("undefined"!=typeof process){var e=process.version;if(e){var t=e.indexOf(".");if(-1!==t)return parseInt(e.substring(1,t))}}}e.unchangedPollThresholds=o(l),e.setCustomPollingValues=_,e.createDynamicPriorityPollingWatchFile=p,e.createSingleFileWatcherPerName=g,e.onWatchedFileStat=m,e.getFileWatcherEventKind=y,e.ignoredPaths=["/node_modules/.","/.git","/.#"],e.sysLog=e.noop,e.setSysLog=function(t){e.sysLog=t;},e.createDirectoryWatcherSupportingRecursive=v,(c=e.FileSystemEntryKind||(e.FileSystemEntryKind={}))[c.File=0]="File",c[c.Directory=1]="Directory",e.createFileWatcherCallback=h,e.createSystemWatchFunctions=D,e.patchWriteFileEnsuringDirectory=S,e.getNodeMajorVersion=T,e.sys=("undefined"!=typeof process&&process.nextTick&&!process.browser&&"undefined"!=typeof require&&(s=function(){var n,i,c=require("fs"),l=require("path"),u=require("os");try{i=require("crypto");}catch(e){i=void 0;}var _,p=!1,f=require("buffer").Buffer,m=T()>=4,y="linux"===process.platform||"darwin"===process.platform,v=u.platform(),b="win32"!==v&&"win64"!==v&&!O((_=__filename,_.replace(/\w/g,(function(e){var t=e.toUpperCase();return e===t?e.toLowerCase():t})))),x=null!==(n=c.realpathSync.native)&&void 0!==n?n:c.realpathSync,S=m&&("win32"===process.platform||"darwin"===process.platform),C=e.memoize((function(){return process.cwd()})),E=D({pollingWatchFile:g((function(e,t,n){var i;return c.watchFile(e,{persistent:!0,interval:n},a),{close:function(){return c.unwatchFile(e,a)}};function a(n,a){var o=0==+a.mtime||i===r.Deleted;if(0==+n.mtime){if(o)return;i=r.Deleted;}else if(o)i=r.Created;else {if(+n.mtime==+a.mtime)return;i=r.Changed;}t(e,i);}}),b),getModifiedTime:R,setTimeout,clearTimeout,fsWatch:function(t,n,i,a,o,s){var l,u,_;y&&(u=t.substr(t.lastIndexOf(e.directorySeparator)),_=u.slice(e.directorySeparator.length));var d=I(t,n)?g():b();return {close:function(){d.close(),d=void 0;}};function f(r){e.sysLog("sysLog:: ".concat(t,":: Changing watcher to ").concat(r===g?"Present":"Missing","FileSystemEntryWatcher")),i("rename",""),d&&(d.close(),d=r());}function g(){if(void 0===l&&(l=S?{persistent:!0,recursive:!!a}:{persistent:!0}),p)return e.sysLog("sysLog:: ".concat(t,":: Defaulting to fsWatchFile")),v();try{var r=c.watch(t,l,y?m:i);return r.on("error",(function(){return f(b)})),r}catch(r){return p||(p="ENOSPC"===r.code),e.sysLog("sysLog:: ".concat(t,":: Changing to fsWatchFile")),v()}}function m(e,r){return "rename"!==e||r&&r!==_&&(-1===r.lastIndexOf(u)||r.lastIndexOf(u)!==r.length-u.length)||I(t,n)?i(e,r):f(b)}function v(){return k(t,h(i),o,s)}function b(){return k(t,(function(e,i){i===r.Created&&I(t,n)&&f(g);}),o,s)}},useCaseSensitiveFileNames:b,getCurrentDirectory:C,fileExists:O,fsSupportsRecursiveFsWatch:S,directoryExists:M,getAccessibleSortedChildDirectories:function(e){return w(e).directories},realpath:L,tscWatchFile:process.env.TSC_WATCHFILE,useNonPollingWatchers:process.env.TSC_NONPOLLING_WATCHER,tscWatchDirectory:process.env.TSC_WATCHDIRECTORY,defaultWatchFileKind:function(){var e,t;return null===(t=(e=s).defaultWatchFileKind)||void 0===t?void 0:t.call(e)}}),k=E.watchFile,N=E.watchDirectory,F={args:process.argv.slice(2),newLine:u.EOL,useCaseSensitiveFileNames:b,write:function(e){process.stdout.write(e);},getWidthOfTerminal:function(){return process.stdout.columns},writeOutputIsTTY:function(){return process.stdout.isTTY},readFile:function(t,r){e.perfLogger.logStartReadFile(t);var n=function(e,t){var r;try{r=c.readFileSync(e);}catch(e){return}var n=r.length;if(n>=2&&254===r[0]&&255===r[1]){n&=-2;for(var i=0;i<n;i+=2){var a=r[i];r[i]=r[i+1],r[i+1]=a;}return r.toString("utf16le",2)}return n>=2&&255===r[0]&&254===r[1]?r.toString("utf16le",2):n>=3&&239===r[0]&&187===r[1]&&191===r[2]?r.toString("utf8",3):r.toString("utf8")}(t);return e.perfLogger.logStopReadFile(),n},writeFile:function(t,r,n){var i;e.perfLogger.logEvent("WriteFile: "+t),n&&(r="\ufeff"+r);try{i=c.openSync(t,"w"),c.writeSync(i,r,void 0,"utf8");}finally{void 0!==i&&c.closeSync(i);}},watchFile:k,watchDirectory:N,resolvePath:function(e){return l.resolve(e)},fileExists:O,directoryExists:M,createDirectory:function(e){if(!F.directoryExists(e))try{c.mkdirSync(e);}catch(e){if("EEXIST"!==e.code)throw e}},getExecutingFilePath:function(){return __filename},getCurrentDirectory:C,getDirectories:function(e){return w(e).directories.slice()},getEnvironmentVariable:function(e){return process.env[e]||""},readDirectory:function(t,r,n,i,a){return e.matchFiles(t,r,n,i,b,process.cwd(),a,w,L)},getModifiedTime:R,setModifiedTime:function(e,t){try{c.utimesSync(e,t,t);}catch(e){return}},deleteFile:function(e){try{return c.unlinkSync(e)}catch(e){return}},createHash:i?B:t,createSHA256Hash:i?B:void 0,getMemoryUsage:function(){return global.gc&&global.gc(),process.memoryUsage().heapUsed},getFileSize:function(e){try{var t=A(e);if(null==t?void 0:t.isFile())return t.size}catch(e){}return 0},exit:function(t){!function(t){t();}((function(){return process.exit(t)}));},cpuProfilingEnabled:function(){return e.contains(process.execArgv,"--cpu-prof")||e.contains(process.execArgv,"--prof")},realpath:L,debugMode:!!process.env.NODE_INSPECTOR_IPC||!!process.env.VSCODE_INSPECTOR_OPTIONS||e.some(process.execArgv,(function(e){return /^--(inspect|debug)(-brk)?(=\d+)?$/i.test(e)})),tryEnableSourceMapsForHost:function(){try{require("source-map-support").install();}catch(e){}},setTimeout,clearTimeout,clearScreen:function(){process.stdout.write("c");},setBlocking:function(){process.stdout&&process.stdout._handle&&process.stdout._handle.setBlocking&&process.stdout._handle.setBlocking(!0);},bufferFrom:P,base64decode:function(e){return P(e,"base64").toString("utf8")},base64encode:function(e){return P(e).toString("base64")},require:function(t,r){try{var n=e.resolveJSModule(r,t,F);return {module:require(n),modulePath:n,error:void 0}}catch(e){return {module:void 0,modulePath:void 0,error:e}}}};return F;function A(e){return c.statSync(e,{throwIfNoEntry:!1})}function P(e,t){return f.from&&f.from!==Int8Array.from?f.from(e,t):new f(e,t)}function w(t){e.perfLogger.logEvent("ReadDir: "+(t||"."));try{for(var r=c.readdirSync(t||".",{withFileTypes:!0}),n=[],i=[],a=0,o=r;a<o.length;a++){var s=o[a],l="string"==typeof s?s:s.name;if("."!==l&&".."!==l){var u=void 0;if("string"==typeof s||s.isSymbolicLink()){var _=e.combinePaths(t,l);try{if(!(u=A(_)))continue}catch(e){continue}}else u=s;u.isFile()?n.push(l):u.isDirectory()&&i.push(l);}}return n.sort(),i.sort(),{files:n,directories:i}}catch(t){return e.emptyFileSystemEntries}}function I(e,t){var r=Error.stackTraceLimit;Error.stackTraceLimit=0;try{var n=A(e);if(!n)return !1;switch(t){case 0:return n.isFile();case 1:return n.isDirectory();default:return !1}}catch(e){return !1}finally{Error.stackTraceLimit=r;}}function O(e){return I(e,0)}function M(e){return I(e,1)}function L(e){try{return x(e)}catch(t){return e}}function R(e){var t;try{return null===(t=A(e))||void 0===t?void 0:t.mtime}catch(e){return}}function B(e){var t=i.createHash("sha256");return t.update(e),t.digest("hex")}}()),s&&S(s),s),e.setSys=function(t){e.sys=t;},e.sys&&e.sys.getEnvironmentVariable&&(_(e.sys),e.Debug.setAssertionLevel(/^development$/i.test(e.sys.getEnvironmentVariable("NODE_ENV"))?1:0)),e.sys&&e.sys.debugMode&&(e.Debug.isDebugging=!0);}(t),function(e){function t(e,t,r,n,i,a,o){return {code:e,category:t,key:r,message:n,reportsUnnecessary:i,elidedInCompatabilityPyramid:a,reportsDeprecated:o}}e.Diagnostics={Unterminated_string_literal:t(1002,e.DiagnosticCategory.Error,"Unterminated_string_literal_1002","Unterminated string literal."),Identifier_expected:t(1003,e.DiagnosticCategory.Error,"Identifier_expected_1003","Identifier expected."),_0_expected:t(1005,e.DiagnosticCategory.Error,"_0_expected_1005","'{0}' expected."),A_file_cannot_have_a_reference_to_itself:t(1006,e.DiagnosticCategory.Error,"A_file_cannot_have_a_reference_to_itself_1006","A file cannot have a reference to itself."),The_parser_expected_to_find_a_to_match_the_token_here:t(1007,e.DiagnosticCategory.Error,"The_parser_expected_to_find_a_to_match_the_token_here_1007","The parser expected to find a '}' to match the '{' token here."),Trailing_comma_not_allowed:t(1009,e.DiagnosticCategory.Error,"Trailing_comma_not_allowed_1009","Trailing comma not allowed."),Asterisk_Slash_expected:t(1010,e.DiagnosticCategory.Error,"Asterisk_Slash_expected_1010","'*/' expected."),An_element_access_expression_should_take_an_argument:t(1011,e.DiagnosticCategory.Error,"An_element_access_expression_should_take_an_argument_1011","An element access expression should take an argument."),Unexpected_token:t(1012,e.DiagnosticCategory.Error,"Unexpected_token_1012","Unexpected token."),A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma:t(1013,e.DiagnosticCategory.Error,"A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma_1013","A rest parameter or binding pattern may not have a trailing comma."),A_rest_parameter_must_be_last_in_a_parameter_list:t(1014,e.DiagnosticCategory.Error,"A_rest_parameter_must_be_last_in_a_parameter_list_1014","A rest parameter must be last in a parameter list."),Parameter_cannot_have_question_mark_and_initializer:t(1015,e.DiagnosticCategory.Error,"Parameter_cannot_have_question_mark_and_initializer_1015","Parameter cannot have question mark and initializer."),A_required_parameter_cannot_follow_an_optional_parameter:t(1016,e.DiagnosticCategory.Error,"A_required_parameter_cannot_follow_an_optional_parameter_1016","A required parameter cannot follow an optional parameter."),An_index_signature_cannot_have_a_rest_parameter:t(1017,e.DiagnosticCategory.Error,"An_index_signature_cannot_have_a_rest_parameter_1017","An index signature cannot have a rest parameter."),An_index_signature_parameter_cannot_have_an_accessibility_modifier:t(1018,e.DiagnosticCategory.Error,"An_index_signature_parameter_cannot_have_an_accessibility_modifier_1018","An index signature parameter cannot have an accessibility modifier."),An_index_signature_parameter_cannot_have_a_question_mark:t(1019,e.DiagnosticCategory.Error,"An_index_signature_parameter_cannot_have_a_question_mark_1019","An index signature parameter cannot have a question mark."),An_index_signature_parameter_cannot_have_an_initializer:t(1020,e.DiagnosticCategory.Error,"An_index_signature_parameter_cannot_have_an_initializer_1020","An index signature parameter cannot have an initializer."),An_index_signature_must_have_a_type_annotation:t(1021,e.DiagnosticCategory.Error,"An_index_signature_must_have_a_type_annotation_1021","An index signature must have a type annotation."),An_index_signature_parameter_must_have_a_type_annotation:t(1022,e.DiagnosticCategory.Error,"An_index_signature_parameter_must_have_a_type_annotation_1022","An index signature parameter must have a type annotation."),readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature:t(1024,e.DiagnosticCategory.Error,"readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature_1024","'readonly' modifier can only appear on a property declaration or index signature."),An_index_signature_cannot_have_a_trailing_comma:t(1025,e.DiagnosticCategory.Error,"An_index_signature_cannot_have_a_trailing_comma_1025","An index signature cannot have a trailing comma."),Accessibility_modifier_already_seen:t(1028,e.DiagnosticCategory.Error,"Accessibility_modifier_already_seen_1028","Accessibility modifier already seen."),_0_modifier_must_precede_1_modifier:t(1029,e.DiagnosticCategory.Error,"_0_modifier_must_precede_1_modifier_1029","'{0}' modifier must precede '{1}' modifier."),_0_modifier_already_seen:t(1030,e.DiagnosticCategory.Error,"_0_modifier_already_seen_1030","'{0}' modifier already seen."),_0_modifier_cannot_appear_on_class_elements_of_this_kind:t(1031,e.DiagnosticCategory.Error,"_0_modifier_cannot_appear_on_class_elements_of_this_kind_1031","'{0}' modifier cannot appear on class elements of this kind."),super_must_be_followed_by_an_argument_list_or_member_access:t(1034,e.DiagnosticCategory.Error,"super_must_be_followed_by_an_argument_list_or_member_access_1034","'super' must be followed by an argument list or member access."),Only_ambient_modules_can_use_quoted_names:t(1035,e.DiagnosticCategory.Error,"Only_ambient_modules_can_use_quoted_names_1035","Only ambient modules can use quoted names."),Statements_are_not_allowed_in_ambient_contexts:t(1036,e.DiagnosticCategory.Error,"Statements_are_not_allowed_in_ambient_contexts_1036","Statements are not allowed in ambient contexts."),A_declare_modifier_cannot_be_used_in_an_already_ambient_context:t(1038,e.DiagnosticCategory.Error,"A_declare_modifier_cannot_be_used_in_an_already_ambient_context_1038","A 'declare' modifier cannot be used in an already ambient context."),Initializers_are_not_allowed_in_ambient_contexts:t(1039,e.DiagnosticCategory.Error,"Initializers_are_not_allowed_in_ambient_contexts_1039","Initializers are not allowed in ambient contexts."),_0_modifier_cannot_be_used_in_an_ambient_context:t(1040,e.DiagnosticCategory.Error,"_0_modifier_cannot_be_used_in_an_ambient_context_1040","'{0}' modifier cannot be used in an ambient context."),_0_modifier_cannot_be_used_here:t(1042,e.DiagnosticCategory.Error,"_0_modifier_cannot_be_used_here_1042","'{0}' modifier cannot be used here."),_0_modifier_cannot_appear_on_a_module_or_namespace_element:t(1044,e.DiagnosticCategory.Error,"_0_modifier_cannot_appear_on_a_module_or_namespace_element_1044","'{0}' modifier cannot appear on a module or namespace element."),Top_level_declarations_in_d_ts_files_must_start_with_either_a_declare_or_export_modifier:t(1046,e.DiagnosticCategory.Error,"Top_level_declarations_in_d_ts_files_must_start_with_either_a_declare_or_export_modifier_1046","Top-level declarations in .d.ts files must start with either a 'declare' or 'export' modifier."),A_rest_parameter_cannot_be_optional:t(1047,e.DiagnosticCategory.Error,"A_rest_parameter_cannot_be_optional_1047","A rest parameter cannot be optional."),A_rest_parameter_cannot_have_an_initializer:t(1048,e.DiagnosticCategory.Error,"A_rest_parameter_cannot_have_an_initializer_1048","A rest parameter cannot have an initializer."),A_set_accessor_must_have_exactly_one_parameter:t(1049,e.DiagnosticCategory.Error,"A_set_accessor_must_have_exactly_one_parameter_1049","A 'set' accessor must have exactly one parameter."),A_set_accessor_cannot_have_an_optional_parameter:t(1051,e.DiagnosticCategory.Error,"A_set_accessor_cannot_have_an_optional_parameter_1051","A 'set' accessor cannot have an optional parameter."),A_set_accessor_parameter_cannot_have_an_initializer:t(1052,e.DiagnosticCategory.Error,"A_set_accessor_parameter_cannot_have_an_initializer_1052","A 'set' accessor parameter cannot have an initializer."),A_set_accessor_cannot_have_rest_parameter:t(1053,e.DiagnosticCategory.Error,"A_set_accessor_cannot_have_rest_parameter_1053","A 'set' accessor cannot have rest parameter."),A_get_accessor_cannot_have_parameters:t(1054,e.DiagnosticCategory.Error,"A_get_accessor_cannot_have_parameters_1054","A 'get' accessor cannot have parameters."),Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Promise_compatible_constructor_value:t(1055,e.DiagnosticCategory.Error,"Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Prom_1055","Type '{0}' is not a valid async function return type in ES5/ES3 because it does not refer to a Promise-compatible constructor value."),Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher:t(1056,e.DiagnosticCategory.Error,"Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher_1056","Accessors are only available when targeting ECMAScript 5 and higher."),The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member:t(1058,e.DiagnosticCategory.Error,"The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_t_1058","The return type of an async function must either be a valid promise or must not contain a callable 'then' member."),A_promise_must_have_a_then_method:t(1059,e.DiagnosticCategory.Error,"A_promise_must_have_a_then_method_1059","A promise must have a 'then' method."),The_first_parameter_of_the_then_method_of_a_promise_must_be_a_callback:t(1060,e.DiagnosticCategory.Error,"The_first_parameter_of_the_then_method_of_a_promise_must_be_a_callback_1060","The first parameter of the 'then' method of a promise must be a callback."),Enum_member_must_have_initializer:t(1061,e.DiagnosticCategory.Error,"Enum_member_must_have_initializer_1061","Enum member must have initializer."),Type_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method:t(1062,e.DiagnosticCategory.Error,"Type_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method_1062","Type is referenced directly or indirectly in the fulfillment callback of its own 'then' method."),An_export_assignment_cannot_be_used_in_a_namespace:t(1063,e.DiagnosticCategory.Error,"An_export_assignment_cannot_be_used_in_a_namespace_1063","An export assignment cannot be used in a namespace."),The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type_Did_you_mean_to_write_Promise_0:t(1064,e.DiagnosticCategory.Error,"The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type_Did_you_mean_to_wri_1064","The return type of an async function or method must be the global Promise<T> type. Did you mean to write 'Promise<{0}>'?"),In_ambient_enum_declarations_member_initializer_must_be_constant_expression:t(1066,e.DiagnosticCategory.Error,"In_ambient_enum_declarations_member_initializer_must_be_constant_expression_1066","In ambient enum declarations member initializer must be constant expression."),Unexpected_token_A_constructor_method_accessor_or_property_was_expected:t(1068,e.DiagnosticCategory.Error,"Unexpected_token_A_constructor_method_accessor_or_property_was_expected_1068","Unexpected token. A constructor, method, accessor, or property was expected."),Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces:t(1069,e.DiagnosticCategory.Error,"Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces_1069","Unexpected token. A type parameter name was expected without curly braces."),_0_modifier_cannot_appear_on_a_type_member:t(1070,e.DiagnosticCategory.Error,"_0_modifier_cannot_appear_on_a_type_member_1070","'{0}' modifier cannot appear on a type member."),_0_modifier_cannot_appear_on_an_index_signature:t(1071,e.DiagnosticCategory.Error,"_0_modifier_cannot_appear_on_an_index_signature_1071","'{0}' modifier cannot appear on an index signature."),A_0_modifier_cannot_be_used_with_an_import_declaration:t(1079,e.DiagnosticCategory.Error,"A_0_modifier_cannot_be_used_with_an_import_declaration_1079","A '{0}' modifier cannot be used with an import declaration."),Invalid_reference_directive_syntax:t(1084,e.DiagnosticCategory.Error,"Invalid_reference_directive_syntax_1084","Invalid 'reference' directive syntax."),Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher_Use_the_syntax_0:t(1085,e.DiagnosticCategory.Error,"Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher_Use_the_syntax_0_1085","Octal literals are not available when targeting ECMAScript 5 and higher. Use the syntax '{0}'."),_0_modifier_cannot_appear_on_a_constructor_declaration:t(1089,e.DiagnosticCategory.Error,"_0_modifier_cannot_appear_on_a_constructor_declaration_1089","'{0}' modifier cannot appear on a constructor declaration."),_0_modifier_cannot_appear_on_a_parameter:t(1090,e.DiagnosticCategory.Error,"_0_modifier_cannot_appear_on_a_parameter_1090","'{0}' modifier cannot appear on a parameter."),Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement:t(1091,e.DiagnosticCategory.Error,"Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement_1091","Only a single variable declaration is allowed in a 'for...in' statement."),Type_parameters_cannot_appear_on_a_constructor_declaration:t(1092,e.DiagnosticCategory.Error,"Type_parameters_cannot_appear_on_a_constructor_declaration_1092","Type parameters cannot appear on a constructor declaration."),Type_annotation_cannot_appear_on_a_constructor_declaration:t(1093,e.DiagnosticCategory.Error,"Type_annotation_cannot_appear_on_a_constructor_declaration_1093","Type annotation cannot appear on a constructor declaration."),An_accessor_cannot_have_type_parameters:t(1094,e.DiagnosticCategory.Error,"An_accessor_cannot_have_type_parameters_1094","An accessor cannot have type parameters."),A_set_accessor_cannot_have_a_return_type_annotation:t(1095,e.DiagnosticCategory.Error,"A_set_accessor_cannot_have_a_return_type_annotation_1095","A 'set' accessor cannot have a return type annotation."),An_index_signature_must_have_exactly_one_parameter:t(1096,e.DiagnosticCategory.Error,"An_index_signature_must_have_exactly_one_parameter_1096","An index signature must have exactly one parameter."),_0_list_cannot_be_empty:t(1097,e.DiagnosticCategory.Error,"_0_list_cannot_be_empty_1097","'{0}' list cannot be empty."),Type_parameter_list_cannot_be_empty:t(1098,e.DiagnosticCategory.Error,"Type_parameter_list_cannot_be_empty_1098","Type parameter list cannot be empty."),Type_argument_list_cannot_be_empty:t(1099,e.DiagnosticCategory.Error,"Type_argument_list_cannot_be_empty_1099","Type argument list cannot be empty."),Invalid_use_of_0_in_strict_mode:t(1100,e.DiagnosticCategory.Error,"Invalid_use_of_0_in_strict_mode_1100","Invalid use of '{0}' in strict mode."),with_statements_are_not_allowed_in_strict_mode:t(1101,e.DiagnosticCategory.Error,"with_statements_are_not_allowed_in_strict_mode_1101","'with' statements are not allowed in strict mode."),delete_cannot_be_called_on_an_identifier_in_strict_mode:t(1102,e.DiagnosticCategory.Error,"delete_cannot_be_called_on_an_identifier_in_strict_mode_1102","'delete' cannot be called on an identifier in strict mode."),for_await_loops_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules:t(1103,e.DiagnosticCategory.Error,"for_await_loops_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_1103","'for await' loops are only allowed within async functions and at the top levels of modules."),A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement:t(1104,e.DiagnosticCategory.Error,"A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement_1104","A 'continue' statement can only be used within an enclosing iteration statement."),A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement:t(1105,e.DiagnosticCategory.Error,"A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement_1105","A 'break' statement can only be used within an enclosing iteration or switch statement."),The_left_hand_side_of_a_for_of_statement_may_not_be_async:t(1106,e.DiagnosticCategory.Error,"The_left_hand_side_of_a_for_of_statement_may_not_be_async_1106","The left-hand side of a 'for...of' statement may not be 'async'."),Jump_target_cannot_cross_function_boundary:t(1107,e.DiagnosticCategory.Error,"Jump_target_cannot_cross_function_boundary_1107","Jump target cannot cross function boundary."),A_return_statement_can_only_be_used_within_a_function_body:t(1108,e.DiagnosticCategory.Error,"A_return_statement_can_only_be_used_within_a_function_body_1108","A 'return' statement can only be used within a function body."),Expression_expected:t(1109,e.DiagnosticCategory.Error,"Expression_expected_1109","Expression expected."),Type_expected:t(1110,e.DiagnosticCategory.Error,"Type_expected_1110","Type expected."),A_default_clause_cannot_appear_more_than_once_in_a_switch_statement:t(1113,e.DiagnosticCategory.Error,"A_default_clause_cannot_appear_more_than_once_in_a_switch_statement_1113","A 'default' clause cannot appear more than once in a 'switch' statement."),Duplicate_label_0:t(1114,e.DiagnosticCategory.Error,"Duplicate_label_0_1114","Duplicate label '{0}'."),A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement:t(1115,e.DiagnosticCategory.Error,"A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement_1115","A 'continue' statement can only jump to a label of an enclosing iteration statement."),A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement:t(1116,e.DiagnosticCategory.Error,"A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement_1116","A 'break' statement can only jump to a label of an enclosing statement."),An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode:t(1117,e.DiagnosticCategory.Error,"An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode_1117","An object literal cannot have multiple properties with the same name in strict mode."),An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name:t(1118,e.DiagnosticCategory.Error,"An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name_1118","An object literal cannot have multiple get/set accessors with the same name."),An_object_literal_cannot_have_property_and_accessor_with_the_same_name:t(1119,e.DiagnosticCategory.Error,"An_object_literal_cannot_have_property_and_accessor_with_the_same_name_1119","An object literal cannot have property and accessor with the same name."),An_export_assignment_cannot_have_modifiers:t(1120,e.DiagnosticCategory.Error,"An_export_assignment_cannot_have_modifiers_1120","An export assignment cannot have modifiers."),Octal_literals_are_not_allowed_in_strict_mode:t(1121,e.DiagnosticCategory.Error,"Octal_literals_are_not_allowed_in_strict_mode_1121","Octal literals are not allowed in strict mode."),Variable_declaration_list_cannot_be_empty:t(1123,e.DiagnosticCategory.Error,"Variable_declaration_list_cannot_be_empty_1123","Variable declaration list cannot be empty."),Digit_expected:t(1124,e.DiagnosticCategory.Error,"Digit_expected_1124","Digit expected."),Hexadecimal_digit_expected:t(1125,e.DiagnosticCategory.Error,"Hexadecimal_digit_expected_1125","Hexadecimal digit expected."),Unexpected_end_of_text:t(1126,e.DiagnosticCategory.Error,"Unexpected_end_of_text_1126","Unexpected end of text."),Invalid_character:t(1127,e.DiagnosticCategory.Error,"Invalid_character_1127","Invalid character."),Declaration_or_statement_expected:t(1128,e.DiagnosticCategory.Error,"Declaration_or_statement_expected_1128","Declaration or statement expected."),Statement_expected:t(1129,e.DiagnosticCategory.Error,"Statement_expected_1129","Statement expected."),case_or_default_expected:t(1130,e.DiagnosticCategory.Error,"case_or_default_expected_1130","'case' or 'default' expected."),Property_or_signature_expected:t(1131,e.DiagnosticCategory.Error,"Property_or_signature_expected_1131","Property or signature expected."),Enum_member_expected:t(1132,e.DiagnosticCategory.Error,"Enum_member_expected_1132","Enum member expected."),Variable_declaration_expected:t(1134,e.DiagnosticCategory.Error,"Variable_declaration_expected_1134","Variable declaration expected."),Argument_expression_expected:t(1135,e.DiagnosticCategory.Error,"Argument_expression_expected_1135","Argument expression expected."),Property_assignment_expected:t(1136,e.DiagnosticCategory.Error,"Property_assignment_expected_1136","Property assignment expected."),Expression_or_comma_expected:t(1137,e.DiagnosticCategory.Error,"Expression_or_comma_expected_1137","Expression or comma expected."),Parameter_declaration_expected:t(1138,e.DiagnosticCategory.Error,"Parameter_declaration_expected_1138","Parameter declaration expected."),Type_parameter_declaration_expected:t(1139,e.DiagnosticCategory.Error,"Type_parameter_declaration_expected_1139","Type parameter declaration expected."),Type_argument_expected:t(1140,e.DiagnosticCategory.Error,"Type_argument_expected_1140","Type argument expected."),String_literal_expected:t(1141,e.DiagnosticCategory.Error,"String_literal_expected_1141","String literal expected."),Line_break_not_permitted_here:t(1142,e.DiagnosticCategory.Error,"Line_break_not_permitted_here_1142","Line break not permitted here."),or_expected:t(1144,e.DiagnosticCategory.Error,"or_expected_1144","'{' or ';' expected."),Declaration_expected:t(1146,e.DiagnosticCategory.Error,"Declaration_expected_1146","Declaration expected."),Import_declarations_in_a_namespace_cannot_reference_a_module:t(1147,e.DiagnosticCategory.Error,"Import_declarations_in_a_namespace_cannot_reference_a_module_1147","Import declarations in a namespace cannot reference a module."),Cannot_use_imports_exports_or_module_augmentations_when_module_is_none:t(1148,e.DiagnosticCategory.Error,"Cannot_use_imports_exports_or_module_augmentations_when_module_is_none_1148","Cannot use imports, exports, or module augmentations when '--module' is 'none'."),File_name_0_differs_from_already_included_file_name_1_only_in_casing:t(1149,e.DiagnosticCategory.Error,"File_name_0_differs_from_already_included_file_name_1_only_in_casing_1149","File name '{0}' differs from already included file name '{1}' only in casing."),const_declarations_must_be_initialized:t(1155,e.DiagnosticCategory.Error,"const_declarations_must_be_initialized_1155","'const' declarations must be initialized."),const_declarations_can_only_be_declared_inside_a_block:t(1156,e.DiagnosticCategory.Error,"const_declarations_can_only_be_declared_inside_a_block_1156","'const' declarations can only be declared inside a block."),let_declarations_can_only_be_declared_inside_a_block:t(1157,e.DiagnosticCategory.Error,"let_declarations_can_only_be_declared_inside_a_block_1157","'let' declarations can only be declared inside a block."),Unterminated_template_literal:t(1160,e.DiagnosticCategory.Error,"Unterminated_template_literal_1160","Unterminated template literal."),Unterminated_regular_expression_literal:t(1161,e.DiagnosticCategory.Error,"Unterminated_regular_expression_literal_1161","Unterminated regular expression literal."),An_object_member_cannot_be_declared_optional:t(1162,e.DiagnosticCategory.Error,"An_object_member_cannot_be_declared_optional_1162","An object member cannot be declared optional."),A_yield_expression_is_only_allowed_in_a_generator_body:t(1163,e.DiagnosticCategory.Error,"A_yield_expression_is_only_allowed_in_a_generator_body_1163","A 'yield' expression is only allowed in a generator body."),Computed_property_names_are_not_allowed_in_enums:t(1164,e.DiagnosticCategory.Error,"Computed_property_names_are_not_allowed_in_enums_1164","Computed property names are not allowed in enums."),A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type:t(1165,e.DiagnosticCategory.Error,"A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_t_1165","A computed property name in an ambient context must refer to an expression whose type is a literal type or a 'unique symbol' type."),A_computed_property_name_in_a_class_property_declaration_must_have_a_simple_literal_type_or_a_unique_symbol_type:t(1166,e.DiagnosticCategory.Error,"A_computed_property_name_in_a_class_property_declaration_must_have_a_simple_literal_type_or_a_unique_1166","A computed property name in a class property declaration must have a simple literal type or a 'unique symbol' type."),A_computed_property_name_in_a_method_overload_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type:t(1168,e.DiagnosticCategory.Error,"A_computed_property_name_in_a_method_overload_must_refer_to_an_expression_whose_type_is_a_literal_ty_1168","A computed property name in a method overload must refer to an expression whose type is a literal type or a 'unique symbol' type."),A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type:t(1169,e.DiagnosticCategory.Error,"A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_1169","A computed property name in an interface must refer to an expression whose type is a literal type or a 'unique symbol' type."),A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type:t(1170,e.DiagnosticCategory.Error,"A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type__1170","A computed property name in a type literal must refer to an expression whose type is a literal type or a 'unique symbol' type."),A_comma_expression_is_not_allowed_in_a_computed_property_name:t(1171,e.DiagnosticCategory.Error,"A_comma_expression_is_not_allowed_in_a_computed_property_name_1171","A comma expression is not allowed in a computed property name."),extends_clause_already_seen:t(1172,e.DiagnosticCategory.Error,"extends_clause_already_seen_1172","'extends' clause already seen."),extends_clause_must_precede_implements_clause:t(1173,e.DiagnosticCategory.Error,"extends_clause_must_precede_implements_clause_1173","'extends' clause must precede 'implements' clause."),Classes_can_only_extend_a_single_class:t(1174,e.DiagnosticCategory.Error,"Classes_can_only_extend_a_single_class_1174","Classes can only extend a single class."),implements_clause_already_seen:t(1175,e.DiagnosticCategory.Error,"implements_clause_already_seen_1175","'implements' clause already seen."),Interface_declaration_cannot_have_implements_clause:t(1176,e.DiagnosticCategory.Error,"Interface_declaration_cannot_have_implements_clause_1176","Interface declaration cannot have 'implements' clause."),Binary_digit_expected:t(1177,e.DiagnosticCategory.Error,"Binary_digit_expected_1177","Binary digit expected."),Octal_digit_expected:t(1178,e.DiagnosticCategory.Error,"Octal_digit_expected_1178","Octal digit expected."),Unexpected_token_expected:t(1179,e.DiagnosticCategory.Error,"Unexpected_token_expected_1179","Unexpected token. '{' expected."),Property_destructuring_pattern_expected:t(1180,e.DiagnosticCategory.Error,"Property_destructuring_pattern_expected_1180","Property destructuring pattern expected."),Array_element_destructuring_pattern_expected:t(1181,e.DiagnosticCategory.Error,"Array_element_destructuring_pattern_expected_1181","Array element destructuring pattern expected."),A_destructuring_declaration_must_have_an_initializer:t(1182,e.DiagnosticCategory.Error,"A_destructuring_declaration_must_have_an_initializer_1182","A destructuring declaration must have an initializer."),An_implementation_cannot_be_declared_in_ambient_contexts:t(1183,e.DiagnosticCategory.Error,"An_implementation_cannot_be_declared_in_ambient_contexts_1183","An implementation cannot be declared in ambient contexts."),Modifiers_cannot_appear_here:t(1184,e.DiagnosticCategory.Error,"Modifiers_cannot_appear_here_1184","Modifiers cannot appear here."),Merge_conflict_marker_encountered:t(1185,e.DiagnosticCategory.Error,"Merge_conflict_marker_encountered_1185","Merge conflict marker encountered."),A_rest_element_cannot_have_an_initializer:t(1186,e.DiagnosticCategory.Error,"A_rest_element_cannot_have_an_initializer_1186","A rest element cannot have an initializer."),A_parameter_property_may_not_be_declared_using_a_binding_pattern:t(1187,e.DiagnosticCategory.Error,"A_parameter_property_may_not_be_declared_using_a_binding_pattern_1187","A parameter property may not be declared using a binding pattern."),Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement:t(1188,e.DiagnosticCategory.Error,"Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement_1188","Only a single variable declaration is allowed in a 'for...of' statement."),The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer:t(1189,e.DiagnosticCategory.Error,"The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer_1189","The variable declaration of a 'for...in' statement cannot have an initializer."),The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer:t(1190,e.DiagnosticCategory.Error,"The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer_1190","The variable declaration of a 'for...of' statement cannot have an initializer."),An_import_declaration_cannot_have_modifiers:t(1191,e.DiagnosticCategory.Error,"An_import_declaration_cannot_have_modifiers_1191","An import declaration cannot have modifiers."),Module_0_has_no_default_export:t(1192,e.DiagnosticCategory.Error,"Module_0_has_no_default_export_1192","Module '{0}' has no default export."),An_export_declaration_cannot_have_modifiers:t(1193,e.DiagnosticCategory.Error,"An_export_declaration_cannot_have_modifiers_1193","An export declaration cannot have modifiers."),Export_declarations_are_not_permitted_in_a_namespace:t(1194,e.DiagnosticCategory.Error,"Export_declarations_are_not_permitted_in_a_namespace_1194","Export declarations are not permitted in a namespace."),export_Asterisk_does_not_re_export_a_default:t(1195,e.DiagnosticCategory.Error,"export_Asterisk_does_not_re_export_a_default_1195","'export *' does not re-export a default."),Catch_clause_variable_type_annotation_must_be_any_or_unknown_if_specified:t(1196,e.DiagnosticCategory.Error,"Catch_clause_variable_type_annotation_must_be_any_or_unknown_if_specified_1196","Catch clause variable type annotation must be 'any' or 'unknown' if specified."),Catch_clause_variable_cannot_have_an_initializer:t(1197,e.DiagnosticCategory.Error,"Catch_clause_variable_cannot_have_an_initializer_1197","Catch clause variable cannot have an initializer."),An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive:t(1198,e.DiagnosticCategory.Error,"An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive_1198","An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive."),Unterminated_Unicode_escape_sequence:t(1199,e.DiagnosticCategory.Error,"Unterminated_Unicode_escape_sequence_1199","Unterminated Unicode escape sequence."),Line_terminator_not_permitted_before_arrow:t(1200,e.DiagnosticCategory.Error,"Line_terminator_not_permitted_before_arrow_1200","Line terminator not permitted before arrow."),Import_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_import_Asterisk_as_ns_from_mod_import_a_from_mod_import_d_from_mod_or_another_module_format_instead:t(1202,e.DiagnosticCategory.Error,"Import_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_import_Asterisk_as_1202","Import assignment cannot be used when targeting ECMAScript modules. Consider using 'import * as ns from \"mod\"', 'import {a} from \"mod\"', 'import d from \"mod\"', or another module format instead."),Export_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_export_default_or_another_module_format_instead:t(1203,e.DiagnosticCategory.Error,"Export_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_export_default_or__1203","Export assignment cannot be used when targeting ECMAScript modules. Consider using 'export default' or another module format instead."),Re_exporting_a_type_when_the_isolatedModules_flag_is_provided_requires_using_export_type:t(1205,e.DiagnosticCategory.Error,"Re_exporting_a_type_when_the_isolatedModules_flag_is_provided_requires_using_export_type_1205","Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'."),Decorators_are_not_valid_here:t(1206,e.DiagnosticCategory.Error,"Decorators_are_not_valid_here_1206","Decorators are not valid here."),Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name:t(1207,e.DiagnosticCategory.Error,"Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name_1207","Decorators cannot be applied to multiple get/set accessors of the same name."),_0_cannot_be_compiled_under_isolatedModules_because_it_is_considered_a_global_script_file_Add_an_import_export_or_an_empty_export_statement_to_make_it_a_module:t(1208,e.DiagnosticCategory.Error,"_0_cannot_be_compiled_under_isolatedModules_because_it_is_considered_a_global_script_file_Add_an_imp_1208","'{0}' cannot be compiled under '--isolatedModules' because it is considered a global script file. Add an import, export, or an empty 'export {}' statement to make it a module."),Code_contained_in_a_class_is_evaluated_in_JavaScript_s_strict_mode_which_does_not_allow_this_use_of_0_For_more_information_see_https_Colon_Slash_Slashdeveloper_mozilla_org_Slashen_US_Slashdocs_SlashWeb_SlashJavaScript_SlashReference_SlashStrict_mode:t(1210,e.DiagnosticCategory.Error,"Code_contained_in_a_class_is_evaluated_in_JavaScript_s_strict_mode_which_does_not_allow_this_use_of__1210","Code contained in a class is evaluated in JavaScript's strict mode which does not allow this use of '{0}'. For more information, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode."),A_class_declaration_without_the_default_modifier_must_have_a_name:t(1211,e.DiagnosticCategory.Error,"A_class_declaration_without_the_default_modifier_must_have_a_name_1211","A class declaration without the 'default' modifier must have a name."),Identifier_expected_0_is_a_reserved_word_in_strict_mode:t(1212,e.DiagnosticCategory.Error,"Identifier_expected_0_is_a_reserved_word_in_strict_mode_1212","Identifier expected. '{0}' is a reserved word in strict mode."),Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode:t(1213,e.DiagnosticCategory.Error,"Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_stric_1213","Identifier expected. '{0}' is a reserved word in strict mode. Class definitions are automatically in strict mode."),Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode:t(1214,e.DiagnosticCategory.Error,"Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode_1214","Identifier expected. '{0}' is a reserved word in strict mode. Modules are automatically in strict mode."),Invalid_use_of_0_Modules_are_automatically_in_strict_mode:t(1215,e.DiagnosticCategory.Error,"Invalid_use_of_0_Modules_are_automatically_in_strict_mode_1215","Invalid use of '{0}'. Modules are automatically in strict mode."),Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules:t(1216,e.DiagnosticCategory.Error,"Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules_1216","Identifier expected. '__esModule' is reserved as an exported marker when transforming ECMAScript modules."),Export_assignment_is_not_supported_when_module_flag_is_system:t(1218,e.DiagnosticCategory.Error,"Export_assignment_is_not_supported_when_module_flag_is_system_1218","Export assignment is not supported when '--module' flag is 'system'."),Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_in_your_tsconfig_or_jsconfig_to_remove_this_warning:t(1219,e.DiagnosticCategory.Error,"Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_t_1219","Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option in your 'tsconfig' or 'jsconfig' to remove this warning."),Generators_are_not_allowed_in_an_ambient_context:t(1221,e.DiagnosticCategory.Error,"Generators_are_not_allowed_in_an_ambient_context_1221","Generators are not allowed in an ambient context."),An_overload_signature_cannot_be_declared_as_a_generator:t(1222,e.DiagnosticCategory.Error,"An_overload_signature_cannot_be_declared_as_a_generator_1222","An overload signature cannot be declared as a generator."),_0_tag_already_specified:t(1223,e.DiagnosticCategory.Error,"_0_tag_already_specified_1223","'{0}' tag already specified."),Signature_0_must_be_a_type_predicate:t(1224,e.DiagnosticCategory.Error,"Signature_0_must_be_a_type_predicate_1224","Signature '{0}' must be a type predicate."),Cannot_find_parameter_0:t(1225,e.DiagnosticCategory.Error,"Cannot_find_parameter_0_1225","Cannot find parameter '{0}'."),Type_predicate_0_is_not_assignable_to_1:t(1226,e.DiagnosticCategory.Error,"Type_predicate_0_is_not_assignable_to_1_1226","Type predicate '{0}' is not assignable to '{1}'."),Parameter_0_is_not_in_the_same_position_as_parameter_1:t(1227,e.DiagnosticCategory.Error,"Parameter_0_is_not_in_the_same_position_as_parameter_1_1227","Parameter '{0}' is not in the same position as parameter '{1}'."),A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods:t(1228,e.DiagnosticCategory.Error,"A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods_1228","A type predicate is only allowed in return type position for functions and methods."),A_type_predicate_cannot_reference_a_rest_parameter:t(1229,e.DiagnosticCategory.Error,"A_type_predicate_cannot_reference_a_rest_parameter_1229","A type predicate cannot reference a rest parameter."),A_type_predicate_cannot_reference_element_0_in_a_binding_pattern:t(1230,e.DiagnosticCategory.Error,"A_type_predicate_cannot_reference_element_0_in_a_binding_pattern_1230","A type predicate cannot reference element '{0}' in a binding pattern."),An_export_assignment_must_be_at_the_top_level_of_a_file_or_module_declaration:t(1231,e.DiagnosticCategory.Error,"An_export_assignment_must_be_at_the_top_level_of_a_file_or_module_declaration_1231","An export assignment must be at the top level of a file or module declaration."),An_import_declaration_can_only_be_used_in_a_namespace_or_module:t(1232,e.DiagnosticCategory.Error,"An_import_declaration_can_only_be_used_in_a_namespace_or_module_1232","An import declaration can only be used in a namespace or module."),An_export_declaration_can_only_be_used_in_a_module:t(1233,e.DiagnosticCategory.Error,"An_export_declaration_can_only_be_used_in_a_module_1233","An export declaration can only be used in a module."),An_ambient_module_declaration_is_only_allowed_at_the_top_level_in_a_file:t(1234,e.DiagnosticCategory.Error,"An_ambient_module_declaration_is_only_allowed_at_the_top_level_in_a_file_1234","An ambient module declaration is only allowed at the top level in a file."),A_namespace_declaration_is_only_allowed_in_a_namespace_or_module:t(1235,e.DiagnosticCategory.Error,"A_namespace_declaration_is_only_allowed_in_a_namespace_or_module_1235","A namespace declaration is only allowed in a namespace or module."),The_return_type_of_a_property_decorator_function_must_be_either_void_or_any:t(1236,e.DiagnosticCategory.Error,"The_return_type_of_a_property_decorator_function_must_be_either_void_or_any_1236","The return type of a property decorator function must be either 'void' or 'any'."),The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any:t(1237,e.DiagnosticCategory.Error,"The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any_1237","The return type of a parameter decorator function must be either 'void' or 'any'."),Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression:t(1238,e.DiagnosticCategory.Error,"Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression_1238","Unable to resolve signature of class decorator when called as an expression."),Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression:t(1239,e.DiagnosticCategory.Error,"Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression_1239","Unable to resolve signature of parameter decorator when called as an expression."),Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression:t(1240,e.DiagnosticCategory.Error,"Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression_1240","Unable to resolve signature of property decorator when called as an expression."),Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression:t(1241,e.DiagnosticCategory.Error,"Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression_1241","Unable to resolve signature of method decorator when called as an expression."),abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration:t(1242,e.DiagnosticCategory.Error,"abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration_1242","'abstract' modifier can only appear on a class, method, or property declaration."),_0_modifier_cannot_be_used_with_1_modifier:t(1243,e.DiagnosticCategory.Error,"_0_modifier_cannot_be_used_with_1_modifier_1243","'{0}' modifier cannot be used with '{1}' modifier."),Abstract_methods_can_only_appear_within_an_abstract_class:t(1244,e.DiagnosticCategory.Error,"Abstract_methods_can_only_appear_within_an_abstract_class_1244","Abstract methods can only appear within an abstract class."),Method_0_cannot_have_an_implementation_because_it_is_marked_abstract:t(1245,e.DiagnosticCategory.Error,"Method_0_cannot_have_an_implementation_because_it_is_marked_abstract_1245","Method '{0}' cannot have an implementation because it is marked abstract."),An_interface_property_cannot_have_an_initializer:t(1246,e.DiagnosticCategory.Error,"An_interface_property_cannot_have_an_initializer_1246","An interface property cannot have an initializer."),A_type_literal_property_cannot_have_an_initializer:t(1247,e.DiagnosticCategory.Error,"A_type_literal_property_cannot_have_an_initializer_1247","A type literal property cannot have an initializer."),A_class_member_cannot_have_the_0_keyword:t(1248,e.DiagnosticCategory.Error,"A_class_member_cannot_have_the_0_keyword_1248","A class member cannot have the '{0}' keyword."),A_decorator_can_only_decorate_a_method_implementation_not_an_overload:t(1249,e.DiagnosticCategory.Error,"A_decorator_can_only_decorate_a_method_implementation_not_an_overload_1249","A decorator can only decorate a method implementation, not an overload."),Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5:t(1250,e.DiagnosticCategory.Error,"Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_1250","Function declarations are not allowed inside blocks in strict mode when targeting 'ES3' or 'ES5'."),Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Class_definitions_are_automatically_in_strict_mode:t(1251,e.DiagnosticCategory.Error,"Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Class_d_1251","Function declarations are not allowed inside blocks in strict mode when targeting 'ES3' or 'ES5'. Class definitions are automatically in strict mode."),Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Modules_are_automatically_in_strict_mode:t(1252,e.DiagnosticCategory.Error,"Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Modules_1252","Function declarations are not allowed inside blocks in strict mode when targeting 'ES3' or 'ES5'. Modules are automatically in strict mode."),A_const_initializer_in_an_ambient_context_must_be_a_string_or_numeric_literal_or_literal_enum_reference:t(1254,e.DiagnosticCategory.Error,"A_const_initializer_in_an_ambient_context_must_be_a_string_or_numeric_literal_or_literal_enum_refere_1254","A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference."),A_definite_assignment_assertion_is_not_permitted_in_this_context:t(1255,e.DiagnosticCategory.Error,"A_definite_assignment_assertion_is_not_permitted_in_this_context_1255","A definite assignment assertion '!' is not permitted in this context."),A_required_element_cannot_follow_an_optional_element:t(1257,e.DiagnosticCategory.Error,"A_required_element_cannot_follow_an_optional_element_1257","A required element cannot follow an optional element."),A_default_export_must_be_at_the_top_level_of_a_file_or_module_declaration:t(1258,e.DiagnosticCategory.Error,"A_default_export_must_be_at_the_top_level_of_a_file_or_module_declaration_1258","A default export must be at the top level of a file or module declaration."),Module_0_can_only_be_default_imported_using_the_1_flag:t(1259,e.DiagnosticCategory.Error,"Module_0_can_only_be_default_imported_using_the_1_flag_1259","Module '{0}' can only be default-imported using the '{1}' flag"),Keywords_cannot_contain_escape_characters:t(1260,e.DiagnosticCategory.Error,"Keywords_cannot_contain_escape_characters_1260","Keywords cannot contain escape characters."),Already_included_file_name_0_differs_from_file_name_1_only_in_casing:t(1261,e.DiagnosticCategory.Error,"Already_included_file_name_0_differs_from_file_name_1_only_in_casing_1261","Already included file name '{0}' differs from file name '{1}' only in casing."),Identifier_expected_0_is_a_reserved_word_at_the_top_level_of_a_module:t(1262,e.DiagnosticCategory.Error,"Identifier_expected_0_is_a_reserved_word_at_the_top_level_of_a_module_1262","Identifier expected. '{0}' is a reserved word at the top-level of a module."),Declarations_with_initializers_cannot_also_have_definite_assignment_assertions:t(1263,e.DiagnosticCategory.Error,"Declarations_with_initializers_cannot_also_have_definite_assignment_assertions_1263","Declarations with initializers cannot also have definite assignment assertions."),Declarations_with_definite_assignment_assertions_must_also_have_type_annotations:t(1264,e.DiagnosticCategory.Error,"Declarations_with_definite_assignment_assertions_must_also_have_type_annotations_1264","Declarations with definite assignment assertions must also have type annotations."),A_rest_element_cannot_follow_another_rest_element:t(1265,e.DiagnosticCategory.Error,"A_rest_element_cannot_follow_another_rest_element_1265","A rest element cannot follow another rest element."),An_optional_element_cannot_follow_a_rest_element:t(1266,e.DiagnosticCategory.Error,"An_optional_element_cannot_follow_a_rest_element_1266","An optional element cannot follow a rest element."),Property_0_cannot_have_an_initializer_because_it_is_marked_abstract:t(1267,e.DiagnosticCategory.Error,"Property_0_cannot_have_an_initializer_because_it_is_marked_abstract_1267","Property '{0}' cannot have an initializer because it is marked abstract."),An_index_signature_parameter_type_must_be_string_number_symbol_or_a_template_literal_type:t(1268,e.DiagnosticCategory.Error,"An_index_signature_parameter_type_must_be_string_number_symbol_or_a_template_literal_type_1268","An index signature parameter type must be 'string', 'number', 'symbol', or a template literal type."),with_statements_are_not_allowed_in_an_async_function_block:t(1300,e.DiagnosticCategory.Error,"with_statements_are_not_allowed_in_an_async_function_block_1300","'with' statements are not allowed in an async function block."),await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules:t(1308,e.DiagnosticCategory.Error,"await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_1308","'await' expressions are only allowed within async functions and at the top levels of modules."),Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_part_of_a_destructuring_pattern:t(1312,e.DiagnosticCategory.Error,"Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_1312","Did you mean to use a ':'? An '=' can only follow a property name when the containing object literal is part of a destructuring pattern."),The_body_of_an_if_statement_cannot_be_the_empty_statement:t(1313,e.DiagnosticCategory.Error,"The_body_of_an_if_statement_cannot_be_the_empty_statement_1313","The body of an 'if' statement cannot be the empty statement."),Global_module_exports_may_only_appear_in_module_files:t(1314,e.DiagnosticCategory.Error,"Global_module_exports_may_only_appear_in_module_files_1314","Global module exports may only appear in module files."),Global_module_exports_may_only_appear_in_declaration_files:t(1315,e.DiagnosticCategory.Error,"Global_module_exports_may_only_appear_in_declaration_files_1315","Global module exports may only appear in declaration files."),Global_module_exports_may_only_appear_at_top_level:t(1316,e.DiagnosticCategory.Error,"Global_module_exports_may_only_appear_at_top_level_1316","Global module exports may only appear at top level."),A_parameter_property_cannot_be_declared_using_a_rest_parameter:t(1317,e.DiagnosticCategory.Error,"A_parameter_property_cannot_be_declared_using_a_rest_parameter_1317","A parameter property cannot be declared using a rest parameter."),An_abstract_accessor_cannot_have_an_implementation:t(1318,e.DiagnosticCategory.Error,"An_abstract_accessor_cannot_have_an_implementation_1318","An abstract accessor cannot have an implementation."),A_default_export_can_only_be_used_in_an_ECMAScript_style_module:t(1319,e.DiagnosticCategory.Error,"A_default_export_can_only_be_used_in_an_ECMAScript_style_module_1319","A default export can only be used in an ECMAScript-style module."),Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member:t(1320,e.DiagnosticCategory.Error,"Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member_1320","Type of 'await' operand must either be a valid promise or must not contain a callable 'then' member."),Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member:t(1321,e.DiagnosticCategory.Error,"Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_cal_1321","Type of 'yield' operand in an async generator must either be a valid promise or must not contain a callable 'then' member."),Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member:t(1322,e.DiagnosticCategory.Error,"Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_con_1322","Type of iterated elements of a 'yield*' operand must either be a valid promise or must not contain a callable 'then' member."),Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd_system_umd_node12_or_nodenext:t(1323,e.DiagnosticCategory.Error,"Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd__1323","Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node12', or 'nodenext'."),Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext:t(1324,e.DiagnosticCategory.Error,"Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_1324","Dynamic imports only support a second argument when the '--module' option is set to 'esnext'."),Argument_of_dynamic_import_cannot_be_spread_element:t(1325,e.DiagnosticCategory.Error,"Argument_of_dynamic_import_cannot_be_spread_element_1325","Argument of dynamic import cannot be spread element."),Dynamic_import_cannot_have_type_arguments:t(1326,e.DiagnosticCategory.Error,"Dynamic_import_cannot_have_type_arguments_1326","Dynamic import cannot have type arguments."),String_literal_with_double_quotes_expected:t(1327,e.DiagnosticCategory.Error,"String_literal_with_double_quotes_expected_1327","String literal with double quotes expected."),Property_value_can_only_be_string_literal_numeric_literal_true_false_null_object_literal_or_array_literal:t(1328,e.DiagnosticCategory.Error,"Property_value_can_only_be_string_literal_numeric_literal_true_false_null_object_literal_or_array_li_1328","Property value can only be string literal, numeric literal, 'true', 'false', 'null', object literal or array literal."),_0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write_0:t(1329,e.DiagnosticCategory.Error,"_0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write__1329","'{0}' accepts too few arguments to be used as a decorator here. Did you mean to call it first and write '@{0}()'?"),A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly:t(1330,e.DiagnosticCategory.Error,"A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly_1330","A property of an interface or type literal whose type is a 'unique symbol' type must be 'readonly'."),A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly:t(1331,e.DiagnosticCategory.Error,"A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly_1331","A property of a class whose type is a 'unique symbol' type must be both 'static' and 'readonly'."),A_variable_whose_type_is_a_unique_symbol_type_must_be_const:t(1332,e.DiagnosticCategory.Error,"A_variable_whose_type_is_a_unique_symbol_type_must_be_const_1332","A variable whose type is a 'unique symbol' type must be 'const'."),unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name:t(1333,e.DiagnosticCategory.Error,"unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name_1333","'unique symbol' types may not be used on a variable declaration with a binding name."),unique_symbol_types_are_only_allowed_on_variables_in_a_variable_statement:t(1334,e.DiagnosticCategory.Error,"unique_symbol_types_are_only_allowed_on_variables_in_a_variable_statement_1334","'unique symbol' types are only allowed on variables in a variable statement."),unique_symbol_types_are_not_allowed_here:t(1335,e.DiagnosticCategory.Error,"unique_symbol_types_are_not_allowed_here_1335","'unique symbol' types are not allowed here."),An_index_signature_parameter_type_cannot_be_a_literal_type_or_generic_type_Consider_using_a_mapped_object_type_instead:t(1337,e.DiagnosticCategory.Error,"An_index_signature_parameter_type_cannot_be_a_literal_type_or_generic_type_Consider_using_a_mapped_o_1337","An index signature parameter type cannot be a literal type or generic type. Consider using a mapped object type instead."),infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type:t(1338,e.DiagnosticCategory.Error,"infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type_1338","'infer' declarations are only permitted in the 'extends' clause of a conditional type."),Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here:t(1339,e.DiagnosticCategory.Error,"Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here_1339","Module '{0}' does not refer to a value, but is used as a value here."),Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0:t(1340,e.DiagnosticCategory.Error,"Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0_1340","Module '{0}' does not refer to a type, but is used as a type here. Did you mean 'typeof import('{0}')'?"),Type_arguments_cannot_be_used_here:t(1342,e.DiagnosticCategory.Error,"Type_arguments_cannot_be_used_here_1342","Type arguments cannot be used here."),The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system_node12_or_nodenext:t(1343,e.DiagnosticCategory.Error,"The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system__1343","The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node12', or 'nodenext'."),A_label_is_not_allowed_here:t(1344,e.DiagnosticCategory.Error,"A_label_is_not_allowed_here_1344","'A label is not allowed here."),An_expression_of_type_void_cannot_be_tested_for_truthiness:t(1345,e.DiagnosticCategory.Error,"An_expression_of_type_void_cannot_be_tested_for_truthiness_1345","An expression of type 'void' cannot be tested for truthiness."),This_parameter_is_not_allowed_with_use_strict_directive:t(1346,e.DiagnosticCategory.Error,"This_parameter_is_not_allowed_with_use_strict_directive_1346","This parameter is not allowed with 'use strict' directive."),use_strict_directive_cannot_be_used_with_non_simple_parameter_list:t(1347,e.DiagnosticCategory.Error,"use_strict_directive_cannot_be_used_with_non_simple_parameter_list_1347","'use strict' directive cannot be used with non-simple parameter list."),Non_simple_parameter_declared_here:t(1348,e.DiagnosticCategory.Error,"Non_simple_parameter_declared_here_1348","Non-simple parameter declared here."),use_strict_directive_used_here:t(1349,e.DiagnosticCategory.Error,"use_strict_directive_used_here_1349","'use strict' directive used here."),Print_the_final_configuration_instead_of_building:t(1350,e.DiagnosticCategory.Message,"Print_the_final_configuration_instead_of_building_1350","Print the final configuration instead of building."),An_identifier_or_keyword_cannot_immediately_follow_a_numeric_literal:t(1351,e.DiagnosticCategory.Error,"An_identifier_or_keyword_cannot_immediately_follow_a_numeric_literal_1351","An identifier or keyword cannot immediately follow a numeric literal."),A_bigint_literal_cannot_use_exponential_notation:t(1352,e.DiagnosticCategory.Error,"A_bigint_literal_cannot_use_exponential_notation_1352","A bigint literal cannot use exponential notation."),A_bigint_literal_must_be_an_integer:t(1353,e.DiagnosticCategory.Error,"A_bigint_literal_must_be_an_integer_1353","A bigint literal must be an integer."),readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types:t(1354,e.DiagnosticCategory.Error,"readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types_1354","'readonly' type modifier is only permitted on array and tuple literal types."),A_const_assertions_can_only_be_applied_to_references_to_enum_members_or_string_number_boolean_array_or_object_literals:t(1355,e.DiagnosticCategory.Error,"A_const_assertions_can_only_be_applied_to_references_to_enum_members_or_string_number_boolean_array__1355","A 'const' assertions can only be applied to references to enum members, or string, number, boolean, array, or object literals."),Did_you_mean_to_mark_this_function_as_async:t(1356,e.DiagnosticCategory.Error,"Did_you_mean_to_mark_this_function_as_async_1356","Did you mean to mark this function as 'async'?"),An_enum_member_name_must_be_followed_by_a_or:t(1357,e.DiagnosticCategory.Error,"An_enum_member_name_must_be_followed_by_a_or_1357","An enum member name must be followed by a ',', '=', or '}'."),Tagged_template_expressions_are_not_permitted_in_an_optional_chain:t(1358,e.DiagnosticCategory.Error,"Tagged_template_expressions_are_not_permitted_in_an_optional_chain_1358","Tagged template expressions are not permitted in an optional chain."),Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here:t(1359,e.DiagnosticCategory.Error,"Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here_1359","Identifier expected. '{0}' is a reserved word that cannot be used here."),_0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type:t(1361,e.DiagnosticCategory.Error,"_0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type_1361","'{0}' cannot be used as a value because it was imported using 'import type'."),_0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type:t(1362,e.DiagnosticCategory.Error,"_0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type_1362","'{0}' cannot be used as a value because it was exported using 'export type'."),A_type_only_import_can_specify_a_default_import_or_named_bindings_but_not_both:t(1363,e.DiagnosticCategory.Error,"A_type_only_import_can_specify_a_default_import_or_named_bindings_but_not_both_1363","A type-only import can specify a default import or named bindings, but not both."),Convert_to_type_only_export:t(1364,e.DiagnosticCategory.Message,"Convert_to_type_only_export_1364","Convert to type-only export"),Convert_all_re_exported_types_to_type_only_exports:t(1365,e.DiagnosticCategory.Message,"Convert_all_re_exported_types_to_type_only_exports_1365","Convert all re-exported types to type-only exports"),Split_into_two_separate_import_declarations:t(1366,e.DiagnosticCategory.Message,"Split_into_two_separate_import_declarations_1366","Split into two separate import declarations"),Split_all_invalid_type_only_imports:t(1367,e.DiagnosticCategory.Message,"Split_all_invalid_type_only_imports_1367","Split all invalid type-only imports"),Did_you_mean_0:t(1369,e.DiagnosticCategory.Message,"Did_you_mean_0_1369","Did you mean '{0}'?"),This_import_is_never_used_as_a_value_and_must_use_import_type_because_importsNotUsedAsValues_is_set_to_error:t(1371,e.DiagnosticCategory.Error,"This_import_is_never_used_as_a_value_and_must_use_import_type_because_importsNotUsedAsValues_is_set__1371","This import is never used as a value and must use 'import type' because 'importsNotUsedAsValues' is set to 'error'."),Convert_to_type_only_import:t(1373,e.DiagnosticCategory.Message,"Convert_to_type_only_import_1373","Convert to type-only import"),Convert_all_imports_not_used_as_a_value_to_type_only_imports:t(1374,e.DiagnosticCategory.Message,"Convert_all_imports_not_used_as_a_value_to_type_only_imports_1374","Convert all imports not used as a value to type-only imports"),await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module:t(1375,e.DiagnosticCategory.Error,"await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_fi_1375","'await' expressions are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module."),_0_was_imported_here:t(1376,e.DiagnosticCategory.Message,"_0_was_imported_here_1376","'{0}' was imported here."),_0_was_exported_here:t(1377,e.DiagnosticCategory.Message,"_0_was_exported_here_1377","'{0}' was exported here."),Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher:t(1378,e.DiagnosticCategory.Error,"Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_o_1378","Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher."),An_import_alias_cannot_reference_a_declaration_that_was_exported_using_export_type:t(1379,e.DiagnosticCategory.Error,"An_import_alias_cannot_reference_a_declaration_that_was_exported_using_export_type_1379","An import alias cannot reference a declaration that was exported using 'export type'."),An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type:t(1380,e.DiagnosticCategory.Error,"An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type_1380","An import alias cannot reference a declaration that was imported using 'import type'."),Unexpected_token_Did_you_mean_or_rbrace:t(1381,e.DiagnosticCategory.Error,"Unexpected_token_Did_you_mean_or_rbrace_1381","Unexpected token. Did you mean `{'}'}` or `&rbrace;`?"),Unexpected_token_Did_you_mean_or_gt:t(1382,e.DiagnosticCategory.Error,"Unexpected_token_Did_you_mean_or_gt_1382","Unexpected token. Did you mean `{'>'}` or `&gt;`?"),Only_named_exports_may_use_export_type:t(1383,e.DiagnosticCategory.Error,"Only_named_exports_may_use_export_type_1383","Only named exports may use 'export type'."),A_new_expression_with_type_arguments_must_always_be_followed_by_a_parenthesized_argument_list:t(1384,e.DiagnosticCategory.Error,"A_new_expression_with_type_arguments_must_always_be_followed_by_a_parenthesized_argument_list_1384","A 'new' expression with type arguments must always be followed by a parenthesized argument list."),Function_type_notation_must_be_parenthesized_when_used_in_a_union_type:t(1385,e.DiagnosticCategory.Error,"Function_type_notation_must_be_parenthesized_when_used_in_a_union_type_1385","Function type notation must be parenthesized when used in a union type."),Constructor_type_notation_must_be_parenthesized_when_used_in_a_union_type:t(1386,e.DiagnosticCategory.Error,"Constructor_type_notation_must_be_parenthesized_when_used_in_a_union_type_1386","Constructor type notation must be parenthesized when used in a union type."),Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type:t(1387,e.DiagnosticCategory.Error,"Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type_1387","Function type notation must be parenthesized when used in an intersection type."),Constructor_type_notation_must_be_parenthesized_when_used_in_an_intersection_type:t(1388,e.DiagnosticCategory.Error,"Constructor_type_notation_must_be_parenthesized_when_used_in_an_intersection_type_1388","Constructor type notation must be parenthesized when used in an intersection type."),_0_is_not_allowed_as_a_variable_declaration_name:t(1389,e.DiagnosticCategory.Error,"_0_is_not_allowed_as_a_variable_declaration_name_1389","'{0}' is not allowed as a variable declaration name."),_0_is_not_allowed_as_a_parameter_name:t(1390,e.DiagnosticCategory.Error,"_0_is_not_allowed_as_a_parameter_name_1390","'{0}' is not allowed as a parameter name."),An_import_alias_cannot_use_import_type:t(1392,e.DiagnosticCategory.Error,"An_import_alias_cannot_use_import_type_1392","An import alias cannot use 'import type'"),Imported_via_0_from_file_1:t(1393,e.DiagnosticCategory.Message,"Imported_via_0_from_file_1_1393","Imported via {0} from file '{1}'"),Imported_via_0_from_file_1_with_packageId_2:t(1394,e.DiagnosticCategory.Message,"Imported_via_0_from_file_1_with_packageId_2_1394","Imported via {0} from file '{1}' with packageId '{2}'"),Imported_via_0_from_file_1_to_import_importHelpers_as_specified_in_compilerOptions:t(1395,e.DiagnosticCategory.Message,"Imported_via_0_from_file_1_to_import_importHelpers_as_specified_in_compilerOptions_1395","Imported via {0} from file '{1}' to import 'importHelpers' as specified in compilerOptions"),Imported_via_0_from_file_1_with_packageId_2_to_import_importHelpers_as_specified_in_compilerOptions:t(1396,e.DiagnosticCategory.Message,"Imported_via_0_from_file_1_with_packageId_2_to_import_importHelpers_as_specified_in_compilerOptions_1396","Imported via {0} from file '{1}' with packageId '{2}' to import 'importHelpers' as specified in compilerOptions"),Imported_via_0_from_file_1_to_import_jsx_and_jsxs_factory_functions:t(1397,e.DiagnosticCategory.Message,"Imported_via_0_from_file_1_to_import_jsx_and_jsxs_factory_functions_1397","Imported via {0} from file '{1}' to import 'jsx' and 'jsxs' factory functions"),Imported_via_0_from_file_1_with_packageId_2_to_import_jsx_and_jsxs_factory_functions:t(1398,e.DiagnosticCategory.Message,"Imported_via_0_from_file_1_with_packageId_2_to_import_jsx_and_jsxs_factory_functions_1398","Imported via {0} from file '{1}' with packageId '{2}' to import 'jsx' and 'jsxs' factory functions"),File_is_included_via_import_here:t(1399,e.DiagnosticCategory.Message,"File_is_included_via_import_here_1399","File is included via import here."),Referenced_via_0_from_file_1:t(1400,e.DiagnosticCategory.Message,"Referenced_via_0_from_file_1_1400","Referenced via '{0}' from file '{1}'"),File_is_included_via_reference_here:t(1401,e.DiagnosticCategory.Message,"File_is_included_via_reference_here_1401","File is included via reference here."),Type_library_referenced_via_0_from_file_1:t(1402,e.DiagnosticCategory.Message,"Type_library_referenced_via_0_from_file_1_1402","Type library referenced via '{0}' from file '{1}'"),Type_library_referenced_via_0_from_file_1_with_packageId_2:t(1403,e.DiagnosticCategory.Message,"Type_library_referenced_via_0_from_file_1_with_packageId_2_1403","Type library referenced via '{0}' from file '{1}' with packageId '{2}'"),File_is_included_via_type_library_reference_here:t(1404,e.DiagnosticCategory.Message,"File_is_included_via_type_library_reference_here_1404","File is included via type library reference here."),Library_referenced_via_0_from_file_1:t(1405,e.DiagnosticCategory.Message,"Library_referenced_via_0_from_file_1_1405","Library referenced via '{0}' from file '{1}'"),File_is_included_via_library_reference_here:t(1406,e.DiagnosticCategory.Message,"File_is_included_via_library_reference_here_1406","File is included via library reference here."),Matched_by_include_pattern_0_in_1:t(1407,e.DiagnosticCategory.Message,"Matched_by_include_pattern_0_in_1_1407","Matched by include pattern '{0}' in '{1}'"),File_is_matched_by_include_pattern_specified_here:t(1408,e.DiagnosticCategory.Message,"File_is_matched_by_include_pattern_specified_here_1408","File is matched by include pattern specified here."),Part_of_files_list_in_tsconfig_json:t(1409,e.DiagnosticCategory.Message,"Part_of_files_list_in_tsconfig_json_1409","Part of 'files' list in tsconfig.json"),File_is_matched_by_files_list_specified_here:t(1410,e.DiagnosticCategory.Message,"File_is_matched_by_files_list_specified_here_1410","File is matched by 'files' list specified here."),Output_from_referenced_project_0_included_because_1_specified:t(1411,e.DiagnosticCategory.Message,"Output_from_referenced_project_0_included_because_1_specified_1411","Output from referenced project '{0}' included because '{1}' specified"),Output_from_referenced_project_0_included_because_module_is_specified_as_none:t(1412,e.DiagnosticCategory.Message,"Output_from_referenced_project_0_included_because_module_is_specified_as_none_1412","Output from referenced project '{0}' included because '--module' is specified as 'none'"),File_is_output_from_referenced_project_specified_here:t(1413,e.DiagnosticCategory.Message,"File_is_output_from_referenced_project_specified_here_1413","File is output from referenced project specified here."),Source_from_referenced_project_0_included_because_1_specified:t(1414,e.DiagnosticCategory.Message,"Source_from_referenced_project_0_included_because_1_specified_1414","Source from referenced project '{0}' included because '{1}' specified"),Source_from_referenced_project_0_included_because_module_is_specified_as_none:t(1415,e.DiagnosticCategory.Message,"Source_from_referenced_project_0_included_because_module_is_specified_as_none_1415","Source from referenced project '{0}' included because '--module' is specified as 'none'"),File_is_source_from_referenced_project_specified_here:t(1416,e.DiagnosticCategory.Message,"File_is_source_from_referenced_project_specified_here_1416","File is source from referenced project specified here."),Entry_point_of_type_library_0_specified_in_compilerOptions:t(1417,e.DiagnosticCategory.Message,"Entry_point_of_type_library_0_specified_in_compilerOptions_1417","Entry point of type library '{0}' specified in compilerOptions"),Entry_point_of_type_library_0_specified_in_compilerOptions_with_packageId_1:t(1418,e.DiagnosticCategory.Message,"Entry_point_of_type_library_0_specified_in_compilerOptions_with_packageId_1_1418","Entry point of type library '{0}' specified in compilerOptions with packageId '{1}'"),File_is_entry_point_of_type_library_specified_here:t(1419,e.DiagnosticCategory.Message,"File_is_entry_point_of_type_library_specified_here_1419","File is entry point of type library specified here."),Entry_point_for_implicit_type_library_0:t(1420,e.DiagnosticCategory.Message,"Entry_point_for_implicit_type_library_0_1420","Entry point for implicit type library '{0}'"),Entry_point_for_implicit_type_library_0_with_packageId_1:t(1421,e.DiagnosticCategory.Message,"Entry_point_for_implicit_type_library_0_with_packageId_1_1421","Entry point for implicit type library '{0}' with packageId '{1}'"),Library_0_specified_in_compilerOptions:t(1422,e.DiagnosticCategory.Message,"Library_0_specified_in_compilerOptions_1422","Library '{0}' specified in compilerOptions"),File_is_library_specified_here:t(1423,e.DiagnosticCategory.Message,"File_is_library_specified_here_1423","File is library specified here."),Default_library:t(1424,e.DiagnosticCategory.Message,"Default_library_1424","Default library"),Default_library_for_target_0:t(1425,e.DiagnosticCategory.Message,"Default_library_for_target_0_1425","Default library for target '{0}'"),File_is_default_library_for_target_specified_here:t(1426,e.DiagnosticCategory.Message,"File_is_default_library_for_target_specified_here_1426","File is default library for target specified here."),Root_file_specified_for_compilation:t(1427,e.DiagnosticCategory.Message,"Root_file_specified_for_compilation_1427","Root file specified for compilation"),File_is_output_of_project_reference_source_0:t(1428,e.DiagnosticCategory.Message,"File_is_output_of_project_reference_source_0_1428","File is output of project reference source '{0}'"),File_redirects_to_file_0:t(1429,e.DiagnosticCategory.Message,"File_redirects_to_file_0_1429","File redirects to file '{0}'"),The_file_is_in_the_program_because_Colon:t(1430,e.DiagnosticCategory.Message,"The_file_is_in_the_program_because_Colon_1430","The file is in the program because:"),for_await_loops_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module:t(1431,e.DiagnosticCategory.Error,"for_await_loops_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_1431","'for await' loops are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module."),Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher:t(1432,e.DiagnosticCategory.Error,"Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_or__1432","Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher."),Decorators_may_not_be_applied_to_this_parameters:t(1433,e.DiagnosticCategory.Error,"Decorators_may_not_be_applied_to_this_parameters_1433","Decorators may not be applied to 'this' parameters."),Unexpected_keyword_or_identifier:t(1434,e.DiagnosticCategory.Error,"Unexpected_keyword_or_identifier_1434","Unexpected keyword or identifier."),Unknown_keyword_or_identifier_Did_you_mean_0:t(1435,e.DiagnosticCategory.Error,"Unknown_keyword_or_identifier_Did_you_mean_0_1435","Unknown keyword or identifier. Did you mean '{0}'?"),Decorators_must_precede_the_name_and_all_keywords_of_property_declarations:t(1436,e.DiagnosticCategory.Error,"Decorators_must_precede_the_name_and_all_keywords_of_property_declarations_1436","Decorators must precede the name and all keywords of property declarations."),Namespace_must_be_given_a_name:t(1437,e.DiagnosticCategory.Error,"Namespace_must_be_given_a_name_1437","Namespace must be given a name."),Interface_must_be_given_a_name:t(1438,e.DiagnosticCategory.Error,"Interface_must_be_given_a_name_1438","Interface must be given a name."),Type_alias_must_be_given_a_name:t(1439,e.DiagnosticCategory.Error,"Type_alias_must_be_given_a_name_1439","Type alias must be given a name."),Variable_declaration_not_allowed_at_this_location:t(1440,e.DiagnosticCategory.Error,"Variable_declaration_not_allowed_at_this_location_1440","Variable declaration not allowed at this location."),Cannot_start_a_function_call_in_a_type_annotation:t(1441,e.DiagnosticCategory.Error,"Cannot_start_a_function_call_in_a_type_annotation_1441","Cannot start a function call in a type annotation."),Expected_for_property_initializer:t(1442,e.DiagnosticCategory.Error,"Expected_for_property_initializer_1442","Expected '=' for property initializer."),Module_declaration_names_may_only_use_or_quoted_strings:t(1443,e.DiagnosticCategory.Error,"Module_declaration_names_may_only_use_or_quoted_strings_1443","Module declaration names may only use ' or \" quoted strings."),_0_is_a_type_and_must_be_imported_using_a_type_only_import_when_preserveValueImports_and_isolatedModules_are_both_enabled:t(1444,e.DiagnosticCategory.Error,"_0_is_a_type_and_must_be_imported_using_a_type_only_import_when_preserveValueImports_and_isolatedMod_1444","'{0}' is a type and must be imported using a type-only import when 'preserveValueImports' and 'isolatedModules' are both enabled."),_0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_preserveValueImports_and_isolatedModules_are_both_enabled:t(1446,e.DiagnosticCategory.Error,"_0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_preserveVa_1446","'{0}' resolves to a type-only declaration and must be imported using a type-only import when 'preserveValueImports' and 'isolatedModules' are both enabled."),_0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_isolatedModules_is_enabled:t(1448,e.DiagnosticCategory.Error,"_0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_isol_1448","'{0}' resolves to a type-only declaration and must be re-exported using a type-only re-export when 'isolatedModules' is enabled."),Preserve_unused_imported_values_in_the_JavaScript_output_that_would_otherwise_be_removed:t(1449,e.DiagnosticCategory.Message,"Preserve_unused_imported_values_in_the_JavaScript_output_that_would_otherwise_be_removed_1449","Preserve unused imported values in the JavaScript output that would otherwise be removed."),Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_assertion_as_arguments:t(1450,e.DiagnosticCategory.Message,"Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_assertion_as_arguments_1450","Dynamic imports can only accept a module specifier and an optional assertion as arguments"),Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member_declaration_property_access_or_on_the_left_hand_side_of_an_in_expression:t(1451,e.DiagnosticCategory.Error,"Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member__1451","Private identifiers are only allowed in class bodies and may only be used as part of a class member declaration, property access, or on the left-hand-side of an 'in' expression"),The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output:t(1470,e.DiagnosticCategory.Error,"The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output_1470","The 'import.meta' meta-property is not allowed in files which will build into CommonJS output."),Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_cannot_be_imported_synchronously_Use_dynamic_import_instead:t(1471,e.DiagnosticCategory.Error,"Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_c_1471","Module '{0}' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead."),The_types_of_0_are_incompatible_between_these_types:t(2200,e.DiagnosticCategory.Error,"The_types_of_0_are_incompatible_between_these_types_2200","The types of '{0}' are incompatible between these types."),The_types_returned_by_0_are_incompatible_between_these_types:t(2201,e.DiagnosticCategory.Error,"The_types_returned_by_0_are_incompatible_between_these_types_2201","The types returned by '{0}' are incompatible between these types."),Call_signature_return_types_0_and_1_are_incompatible:t(2202,e.DiagnosticCategory.Error,"Call_signature_return_types_0_and_1_are_incompatible_2202","Call signature return types '{0}' and '{1}' are incompatible.",void 0,!0),Construct_signature_return_types_0_and_1_are_incompatible:t(2203,e.DiagnosticCategory.Error,"Construct_signature_return_types_0_and_1_are_incompatible_2203","Construct signature return types '{0}' and '{1}' are incompatible.",void 0,!0),Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1:t(2204,e.DiagnosticCategory.Error,"Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1_2204","Call signatures with no arguments have incompatible return types '{0}' and '{1}'.",void 0,!0),Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1:t(2205,e.DiagnosticCategory.Error,"Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1_2205","Construct signatures with no arguments have incompatible return types '{0}' and '{1}'.",void 0,!0),The_type_modifier_cannot_be_used_on_a_named_import_when_import_type_is_used_on_its_import_statement:t(2206,e.DiagnosticCategory.Error,"The_type_modifier_cannot_be_used_on_a_named_import_when_import_type_is_used_on_its_import_statement_2206","The 'type' modifier cannot be used on a named import when 'import type' is used on its import statement."),The_type_modifier_cannot_be_used_on_a_named_export_when_export_type_is_used_on_its_export_statement:t(2207,e.DiagnosticCategory.Error,"The_type_modifier_cannot_be_used_on_a_named_export_when_export_type_is_used_on_its_export_statement_2207","The 'type' modifier cannot be used on a named export when 'export type' is used on its export statement."),Duplicate_identifier_0:t(2300,e.DiagnosticCategory.Error,"Duplicate_identifier_0_2300","Duplicate identifier '{0}'."),Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor:t(2301,e.DiagnosticCategory.Error,"Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2301","Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor."),Static_members_cannot_reference_class_type_parameters:t(2302,e.DiagnosticCategory.Error,"Static_members_cannot_reference_class_type_parameters_2302","Static members cannot reference class type parameters."),Circular_definition_of_import_alias_0:t(2303,e.DiagnosticCategory.Error,"Circular_definition_of_import_alias_0_2303","Circular definition of import alias '{0}'."),Cannot_find_name_0:t(2304,e.DiagnosticCategory.Error,"Cannot_find_name_0_2304","Cannot find name '{0}'."),Module_0_has_no_exported_member_1:t(2305,e.DiagnosticCategory.Error,"Module_0_has_no_exported_member_1_2305","Module '{0}' has no exported member '{1}'."),File_0_is_not_a_module:t(2306,e.DiagnosticCategory.Error,"File_0_is_not_a_module_2306","File '{0}' is not a module."),Cannot_find_module_0_or_its_corresponding_type_declarations:t(2307,e.DiagnosticCategory.Error,"Cannot_find_module_0_or_its_corresponding_type_declarations_2307","Cannot find module '{0}' or its corresponding type declarations."),Module_0_has_already_exported_a_member_named_1_Consider_explicitly_re_exporting_to_resolve_the_ambiguity:t(2308,e.DiagnosticCategory.Error,"Module_0_has_already_exported_a_member_named_1_Consider_explicitly_re_exporting_to_resolve_the_ambig_2308","Module {0} has already exported a member named '{1}'. Consider explicitly re-exporting to resolve the ambiguity."),An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements:t(2309,e.DiagnosticCategory.Error,"An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements_2309","An export assignment cannot be used in a module with other exported elements."),Type_0_recursively_references_itself_as_a_base_type:t(2310,e.DiagnosticCategory.Error,"Type_0_recursively_references_itself_as_a_base_type_2310","Type '{0}' recursively references itself as a base type."),An_interface_can_only_extend_an_object_type_or_intersection_of_object_types_with_statically_known_members:t(2312,e.DiagnosticCategory.Error,"An_interface_can_only_extend_an_object_type_or_intersection_of_object_types_with_statically_known_me_2312","An interface can only extend an object type or intersection of object types with statically known members."),Type_parameter_0_has_a_circular_constraint:t(2313,e.DiagnosticCategory.Error,"Type_parameter_0_has_a_circular_constraint_2313","Type parameter '{0}' has a circular constraint."),Generic_type_0_requires_1_type_argument_s:t(2314,e.DiagnosticCategory.Error,"Generic_type_0_requires_1_type_argument_s_2314","Generic type '{0}' requires {1} type argument(s)."),Type_0_is_not_generic:t(2315,e.DiagnosticCategory.Error,"Type_0_is_not_generic_2315","Type '{0}' is not generic."),Global_type_0_must_be_a_class_or_interface_type:t(2316,e.DiagnosticCategory.Error,"Global_type_0_must_be_a_class_or_interface_type_2316","Global type '{0}' must be a class or interface type."),Global_type_0_must_have_1_type_parameter_s:t(2317,e.DiagnosticCategory.Error,"Global_type_0_must_have_1_type_parameter_s_2317","Global type '{0}' must have {1} type parameter(s)."),Cannot_find_global_type_0:t(2318,e.DiagnosticCategory.Error,"Cannot_find_global_type_0_2318","Cannot find global type '{0}'."),Named_property_0_of_types_1_and_2_are_not_identical:t(2319,e.DiagnosticCategory.Error,"Named_property_0_of_types_1_and_2_are_not_identical_2319","Named property '{0}' of types '{1}' and '{2}' are not identical."),Interface_0_cannot_simultaneously_extend_types_1_and_2:t(2320,e.DiagnosticCategory.Error,"Interface_0_cannot_simultaneously_extend_types_1_and_2_2320","Interface '{0}' cannot simultaneously extend types '{1}' and '{2}'."),Excessive_stack_depth_comparing_types_0_and_1:t(2321,e.DiagnosticCategory.Error,"Excessive_stack_depth_comparing_types_0_and_1_2321","Excessive stack depth comparing types '{0}' and '{1}'."),Type_0_is_not_assignable_to_type_1:t(2322,e.DiagnosticCategory.Error,"Type_0_is_not_assignable_to_type_1_2322","Type '{0}' is not assignable to type '{1}'."),Cannot_redeclare_exported_variable_0:t(2323,e.DiagnosticCategory.Error,"Cannot_redeclare_exported_variable_0_2323","Cannot redeclare exported variable '{0}'."),Property_0_is_missing_in_type_1:t(2324,e.DiagnosticCategory.Error,"Property_0_is_missing_in_type_1_2324","Property '{0}' is missing in type '{1}'."),Property_0_is_private_in_type_1_but_not_in_type_2:t(2325,e.DiagnosticCategory.Error,"Property_0_is_private_in_type_1_but_not_in_type_2_2325","Property '{0}' is private in type '{1}' but not in type '{2}'."),Types_of_property_0_are_incompatible:t(2326,e.DiagnosticCategory.Error,"Types_of_property_0_are_incompatible_2326","Types of property '{0}' are incompatible."),Property_0_is_optional_in_type_1_but_required_in_type_2:t(2327,e.DiagnosticCategory.Error,"Property_0_is_optional_in_type_1_but_required_in_type_2_2327","Property '{0}' is optional in type '{1}' but required in type '{2}'."),Types_of_parameters_0_and_1_are_incompatible:t(2328,e.DiagnosticCategory.Error,"Types_of_parameters_0_and_1_are_incompatible_2328","Types of parameters '{0}' and '{1}' are incompatible."),Index_signature_for_type_0_is_missing_in_type_1:t(2329,e.DiagnosticCategory.Error,"Index_signature_for_type_0_is_missing_in_type_1_2329","Index signature for type '{0}' is missing in type '{1}'."),_0_and_1_index_signatures_are_incompatible:t(2330,e.DiagnosticCategory.Error,"_0_and_1_index_signatures_are_incompatible_2330","'{0}' and '{1}' index signatures are incompatible."),this_cannot_be_referenced_in_a_module_or_namespace_body:t(2331,e.DiagnosticCategory.Error,"this_cannot_be_referenced_in_a_module_or_namespace_body_2331","'this' cannot be referenced in a module or namespace body."),this_cannot_be_referenced_in_current_location:t(2332,e.DiagnosticCategory.Error,"this_cannot_be_referenced_in_current_location_2332","'this' cannot be referenced in current location."),this_cannot_be_referenced_in_constructor_arguments:t(2333,e.DiagnosticCategory.Error,"this_cannot_be_referenced_in_constructor_arguments_2333","'this' cannot be referenced in constructor arguments."),this_cannot_be_referenced_in_a_static_property_initializer:t(2334,e.DiagnosticCategory.Error,"this_cannot_be_referenced_in_a_static_property_initializer_2334","'this' cannot be referenced in a static property initializer."),super_can_only_be_referenced_in_a_derived_class:t(2335,e.DiagnosticCategory.Error,"super_can_only_be_referenced_in_a_derived_class_2335","'super' can only be referenced in a derived class."),super_cannot_be_referenced_in_constructor_arguments:t(2336,e.DiagnosticCategory.Error,"super_cannot_be_referenced_in_constructor_arguments_2336","'super' cannot be referenced in constructor arguments."),Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors:t(2337,e.DiagnosticCategory.Error,"Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors_2337","Super calls are not permitted outside constructors or in nested functions inside constructors."),super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_derived_class:t(2338,e.DiagnosticCategory.Error,"super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_der_2338","'super' property access is permitted only in a constructor, member function, or member accessor of a derived class."),Property_0_does_not_exist_on_type_1:t(2339,e.DiagnosticCategory.Error,"Property_0_does_not_exist_on_type_1_2339","Property '{0}' does not exist on type '{1}'."),Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword:t(2340,e.DiagnosticCategory.Error,"Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword_2340","Only public and protected methods of the base class are accessible via the 'super' keyword."),Property_0_is_private_and_only_accessible_within_class_1:t(2341,e.DiagnosticCategory.Error,"Property_0_is_private_and_only_accessible_within_class_1_2341","Property '{0}' is private and only accessible within class '{1}'."),This_syntax_requires_an_imported_helper_named_1_which_does_not_exist_in_0_Consider_upgrading_your_version_of_0:t(2343,e.DiagnosticCategory.Error,"This_syntax_requires_an_imported_helper_named_1_which_does_not_exist_in_0_Consider_upgrading_your_ve_2343","This syntax requires an imported helper named '{1}' which does not exist in '{0}'. Consider upgrading your version of '{0}'."),Type_0_does_not_satisfy_the_constraint_1:t(2344,e.DiagnosticCategory.Error,"Type_0_does_not_satisfy_the_constraint_1_2344","Type '{0}' does not satisfy the constraint '{1}'."),Argument_of_type_0_is_not_assignable_to_parameter_of_type_1:t(2345,e.DiagnosticCategory.Error,"Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_2345","Argument of type '{0}' is not assignable to parameter of type '{1}'."),Call_target_does_not_contain_any_signatures:t(2346,e.DiagnosticCategory.Error,"Call_target_does_not_contain_any_signatures_2346","Call target does not contain any signatures."),Untyped_function_calls_may_not_accept_type_arguments:t(2347,e.DiagnosticCategory.Error,"Untyped_function_calls_may_not_accept_type_arguments_2347","Untyped function calls may not accept type arguments."),Value_of_type_0_is_not_callable_Did_you_mean_to_include_new:t(2348,e.DiagnosticCategory.Error,"Value_of_type_0_is_not_callable_Did_you_mean_to_include_new_2348","Value of type '{0}' is not callable. Did you mean to include 'new'?"),This_expression_is_not_callable:t(2349,e.DiagnosticCategory.Error,"This_expression_is_not_callable_2349","This expression is not callable."),Only_a_void_function_can_be_called_with_the_new_keyword:t(2350,e.DiagnosticCategory.Error,"Only_a_void_function_can_be_called_with_the_new_keyword_2350","Only a void function can be called with the 'new' keyword."),This_expression_is_not_constructable:t(2351,e.DiagnosticCategory.Error,"This_expression_is_not_constructable_2351","This expression is not constructable."),Conversion_of_type_0_to_type_1_may_be_a_mistake_because_neither_type_sufficiently_overlaps_with_the_other_If_this_was_intentional_convert_the_expression_to_unknown_first:t(2352,e.DiagnosticCategory.Error,"Conversion_of_type_0_to_type_1_may_be_a_mistake_because_neither_type_sufficiently_overlaps_with_the__2352","Conversion of type '{0}' to type '{1}' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first."),Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1:t(2353,e.DiagnosticCategory.Error,"Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1_2353","Object literal may only specify known properties, and '{0}' does not exist in type '{1}'."),This_syntax_requires_an_imported_helper_but_module_0_cannot_be_found:t(2354,e.DiagnosticCategory.Error,"This_syntax_requires_an_imported_helper_but_module_0_cannot_be_found_2354","This syntax requires an imported helper but module '{0}' cannot be found."),A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value:t(2355,e.DiagnosticCategory.Error,"A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value_2355","A function whose declared type is neither 'void' nor 'any' must return a value."),An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type:t(2356,e.DiagnosticCategory.Error,"An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type_2356","An arithmetic operand must be of type 'any', 'number', 'bigint' or an enum type."),The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access:t(2357,e.DiagnosticCategory.Error,"The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access_2357","The operand of an increment or decrement operator must be a variable or a property access."),The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter:t(2358,e.DiagnosticCategory.Error,"The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_paramete_2358","The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter."),The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type:t(2359,e.DiagnosticCategory.Error,"The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_F_2359","The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type."),The_left_hand_side_of_an_in_expression_must_be_a_private_identifier_or_of_type_any_string_number_or_symbol:t(2360,e.DiagnosticCategory.Error,"The_left_hand_side_of_an_in_expression_must_be_a_private_identifier_or_of_type_any_string_number_or__2360","The left-hand side of an 'in' expression must be a private identifier or of type 'any', 'string', 'number', or 'symbol'."),The_right_hand_side_of_an_in_expression_must_not_be_a_primitive:t(2361,e.DiagnosticCategory.Error,"The_right_hand_side_of_an_in_expression_must_not_be_a_primitive_2361","The right-hand side of an 'in' expression must not be a primitive."),The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type:t(2362,e.DiagnosticCategory.Error,"The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type_2362","The left-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type."),The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type:t(2363,e.DiagnosticCategory.Error,"The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type_2363","The right-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type."),The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access:t(2364,e.DiagnosticCategory.Error,"The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access_2364","The left-hand side of an assignment expression must be a variable or a property access."),Operator_0_cannot_be_applied_to_types_1_and_2:t(2365,e.DiagnosticCategory.Error,"Operator_0_cannot_be_applied_to_types_1_and_2_2365","Operator '{0}' cannot be applied to types '{1}' and '{2}'."),Function_lacks_ending_return_statement_and_return_type_does_not_include_undefined:t(2366,e.DiagnosticCategory.Error,"Function_lacks_ending_return_statement_and_return_type_does_not_include_undefined_2366","Function lacks ending return statement and return type does not include 'undefined'."),This_condition_will_always_return_0_since_the_types_1_and_2_have_no_overlap:t(2367,e.DiagnosticCategory.Error,"This_condition_will_always_return_0_since_the_types_1_and_2_have_no_overlap_2367","This condition will always return '{0}' since the types '{1}' and '{2}' have no overlap."),Type_parameter_name_cannot_be_0:t(2368,e.DiagnosticCategory.Error,"Type_parameter_name_cannot_be_0_2368","Type parameter name cannot be '{0}'."),A_parameter_property_is_only_allowed_in_a_constructor_implementation:t(2369,e.DiagnosticCategory.Error,"A_parameter_property_is_only_allowed_in_a_constructor_implementation_2369","A parameter property is only allowed in a constructor implementation."),A_rest_parameter_must_be_of_an_array_type:t(2370,e.DiagnosticCategory.Error,"A_rest_parameter_must_be_of_an_array_type_2370","A rest parameter must be of an array type."),A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation:t(2371,e.DiagnosticCategory.Error,"A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation_2371","A parameter initializer is only allowed in a function or constructor implementation."),Parameter_0_cannot_reference_itself:t(2372,e.DiagnosticCategory.Error,"Parameter_0_cannot_reference_itself_2372","Parameter '{0}' cannot reference itself."),Parameter_0_cannot_reference_identifier_1_declared_after_it:t(2373,e.DiagnosticCategory.Error,"Parameter_0_cannot_reference_identifier_1_declared_after_it_2373","Parameter '{0}' cannot reference identifier '{1}' declared after it."),Duplicate_index_signature_for_type_0:t(2374,e.DiagnosticCategory.Error,"Duplicate_index_signature_for_type_0_2374","Duplicate index signature for type '{0}'."),Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties:t(2375,e.DiagnosticCategory.Error,"Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefi_2375","Type '{0}' is not assignable to type '{1}' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the types of the target's properties."),A_super_call_must_be_the_first_statement_in_the_constructor_when_a_class_contains_initialized_properties_parameter_properties_or_private_identifiers:t(2376,e.DiagnosticCategory.Error,"A_super_call_must_be_the_first_statement_in_the_constructor_when_a_class_contains_initialized_proper_2376","A 'super' call must be the first statement in the constructor when a class contains initialized properties, parameter properties, or private identifiers."),Constructors_for_derived_classes_must_contain_a_super_call:t(2377,e.DiagnosticCategory.Error,"Constructors_for_derived_classes_must_contain_a_super_call_2377","Constructors for derived classes must contain a 'super' call."),A_get_accessor_must_return_a_value:t(2378,e.DiagnosticCategory.Error,"A_get_accessor_must_return_a_value_2378","A 'get' accessor must return a value."),Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties:t(2379,e.DiagnosticCategory.Error,"Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_with_exactOptionalPropertyTypes_Colon_tr_2379","Argument of type '{0}' is not assignable to parameter of type '{1}' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the types of the target's properties."),The_return_type_of_a_get_accessor_must_be_assignable_to_its_set_accessor_type:t(2380,e.DiagnosticCategory.Error,"The_return_type_of_a_get_accessor_must_be_assignable_to_its_set_accessor_type_2380","The return type of a 'get' accessor must be assignable to its 'set' accessor type"),Overload_signatures_must_all_be_exported_or_non_exported:t(2383,e.DiagnosticCategory.Error,"Overload_signatures_must_all_be_exported_or_non_exported_2383","Overload signatures must all be exported or non-exported."),Overload_signatures_must_all_be_ambient_or_non_ambient:t(2384,e.DiagnosticCategory.Error,"Overload_signatures_must_all_be_ambient_or_non_ambient_2384","Overload signatures must all be ambient or non-ambient."),Overload_signatures_must_all_be_public_private_or_protected:t(2385,e.DiagnosticCategory.Error,"Overload_signatures_must_all_be_public_private_or_protected_2385","Overload signatures must all be public, private or protected."),Overload_signatures_must_all_be_optional_or_required:t(2386,e.DiagnosticCategory.Error,"Overload_signatures_must_all_be_optional_or_required_2386","Overload signatures must all be optional or required."),Function_overload_must_be_static:t(2387,e.DiagnosticCategory.Error,"Function_overload_must_be_static_2387","Function overload must be static."),Function_overload_must_not_be_static:t(2388,e.DiagnosticCategory.Error,"Function_overload_must_not_be_static_2388","Function overload must not be static."),Function_implementation_name_must_be_0:t(2389,e.DiagnosticCategory.Error,"Function_implementation_name_must_be_0_2389","Function implementation name must be '{0}'."),Constructor_implementation_is_missing:t(2390,e.DiagnosticCategory.Error,"Constructor_implementation_is_missing_2390","Constructor implementation is missing."),Function_implementation_is_missing_or_not_immediately_following_the_declaration:t(2391,e.DiagnosticCategory.Error,"Function_implementation_is_missing_or_not_immediately_following_the_declaration_2391","Function implementation is missing or not immediately following the declaration."),Multiple_constructor_implementations_are_not_allowed:t(2392,e.DiagnosticCategory.Error,"Multiple_constructor_implementations_are_not_allowed_2392","Multiple constructor implementations are not allowed."),Duplicate_function_implementation:t(2393,e.DiagnosticCategory.Error,"Duplicate_function_implementation_2393","Duplicate function implementation."),This_overload_signature_is_not_compatible_with_its_implementation_signature:t(2394,e.DiagnosticCategory.Error,"This_overload_signature_is_not_compatible_with_its_implementation_signature_2394","This overload signature is not compatible with its implementation signature."),Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local:t(2395,e.DiagnosticCategory.Error,"Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local_2395","Individual declarations in merged declaration '{0}' must be all exported or all local."),Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters:t(2396,e.DiagnosticCategory.Error,"Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters_2396","Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters."),Declaration_name_conflicts_with_built_in_global_identifier_0:t(2397,e.DiagnosticCategory.Error,"Declaration_name_conflicts_with_built_in_global_identifier_0_2397","Declaration name conflicts with built-in global identifier '{0}'."),constructor_cannot_be_used_as_a_parameter_property_name:t(2398,e.DiagnosticCategory.Error,"constructor_cannot_be_used_as_a_parameter_property_name_2398","'constructor' cannot be used as a parameter property name."),Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference:t(2399,e.DiagnosticCategory.Error,"Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference_2399","Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference."),Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference:t(2400,e.DiagnosticCategory.Error,"Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference_2400","Expression resolves to variable declaration '_this' that compiler uses to capture 'this' reference."),Expression_resolves_to_super_that_compiler_uses_to_capture_base_class_reference:t(2402,e.DiagnosticCategory.Error,"Expression_resolves_to_super_that_compiler_uses_to_capture_base_class_reference_2402","Expression resolves to '_super' that compiler uses to capture base class reference."),Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2:t(2403,e.DiagnosticCategory.Error,"Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_t_2403","Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'."),The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation:t(2404,e.DiagnosticCategory.Error,"The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation_2404","The left-hand side of a 'for...in' statement cannot use a type annotation."),The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any:t(2405,e.DiagnosticCategory.Error,"The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any_2405","The left-hand side of a 'for...in' statement must be of type 'string' or 'any'."),The_left_hand_side_of_a_for_in_statement_must_be_a_variable_or_a_property_access:t(2406,e.DiagnosticCategory.Error,"The_left_hand_side_of_a_for_in_statement_must_be_a_variable_or_a_property_access_2406","The left-hand side of a 'for...in' statement must be a variable or a property access."),The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter_but_here_has_type_0:t(2407,e.DiagnosticCategory.Error,"The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter_but_2407","The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter, but here has type '{0}'."),Setters_cannot_return_a_value:t(2408,e.DiagnosticCategory.Error,"Setters_cannot_return_a_value_2408","Setters cannot return a value."),Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class:t(2409,e.DiagnosticCategory.Error,"Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class_2409","Return type of constructor signature must be assignable to the instance type of the class."),The_with_statement_is_not_supported_All_symbols_in_a_with_block_will_have_type_any:t(2410,e.DiagnosticCategory.Error,"The_with_statement_is_not_supported_All_symbols_in_a_with_block_will_have_type_any_2410","The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'."),Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_type_of_the_target:t(2412,e.DiagnosticCategory.Error,"Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefi_2412","Type '{0}' is not assignable to type '{1}' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the type of the target."),Property_0_of_type_1_is_not_assignable_to_2_index_type_3:t(2411,e.DiagnosticCategory.Error,"Property_0_of_type_1_is_not_assignable_to_2_index_type_3_2411","Property '{0}' of type '{1}' is not assignable to '{2}' index type '{3}'."),_0_index_type_1_is_not_assignable_to_2_index_type_3:t(2413,e.DiagnosticCategory.Error,"_0_index_type_1_is_not_assignable_to_2_index_type_3_2413","'{0}' index type '{1}' is not assignable to '{2}' index type '{3}'."),Class_name_cannot_be_0:t(2414,e.DiagnosticCategory.Error,"Class_name_cannot_be_0_2414","Class name cannot be '{0}'."),Class_0_incorrectly_extends_base_class_1:t(2415,e.DiagnosticCategory.Error,"Class_0_incorrectly_extends_base_class_1_2415","Class '{0}' incorrectly extends base class '{1}'."),Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2:t(2416,e.DiagnosticCategory.Error,"Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2_2416","Property '{0}' in type '{1}' is not assignable to the same property in base type '{2}'."),Class_static_side_0_incorrectly_extends_base_class_static_side_1:t(2417,e.DiagnosticCategory.Error,"Class_static_side_0_incorrectly_extends_base_class_static_side_1_2417","Class static side '{0}' incorrectly extends base class static side '{1}'."),Type_of_computed_property_s_value_is_0_which_is_not_assignable_to_type_1:t(2418,e.DiagnosticCategory.Error,"Type_of_computed_property_s_value_is_0_which_is_not_assignable_to_type_1_2418","Type of computed property's value is '{0}', which is not assignable to type '{1}'."),Types_of_construct_signatures_are_incompatible:t(2419,e.DiagnosticCategory.Error,"Types_of_construct_signatures_are_incompatible_2419","Types of construct signatures are incompatible."),Class_0_incorrectly_implements_interface_1:t(2420,e.DiagnosticCategory.Error,"Class_0_incorrectly_implements_interface_1_2420","Class '{0}' incorrectly implements interface '{1}'."),A_class_can_only_implement_an_object_type_or_intersection_of_object_types_with_statically_known_members:t(2422,e.DiagnosticCategory.Error,"A_class_can_only_implement_an_object_type_or_intersection_of_object_types_with_statically_known_memb_2422","A class can only implement an object type or intersection of object types with statically known members."),Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor:t(2423,e.DiagnosticCategory.Error,"Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_access_2423","Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor."),Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function:t(2425,e.DiagnosticCategory.Error,"Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_functi_2425","Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function."),Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function:t(2426,e.DiagnosticCategory.Error,"Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_functi_2426","Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function."),Interface_name_cannot_be_0:t(2427,e.DiagnosticCategory.Error,"Interface_name_cannot_be_0_2427","Interface name cannot be '{0}'."),All_declarations_of_0_must_have_identical_type_parameters:t(2428,e.DiagnosticCategory.Error,"All_declarations_of_0_must_have_identical_type_parameters_2428","All declarations of '{0}' must have identical type parameters."),Interface_0_incorrectly_extends_interface_1:t(2430,e.DiagnosticCategory.Error,"Interface_0_incorrectly_extends_interface_1_2430","Interface '{0}' incorrectly extends interface '{1}'."),Enum_name_cannot_be_0:t(2431,e.DiagnosticCategory.Error,"Enum_name_cannot_be_0_2431","Enum name cannot be '{0}'."),In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enum_element:t(2432,e.DiagnosticCategory.Error,"In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enu_2432","In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element."),A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged:t(2433,e.DiagnosticCategory.Error,"A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merg_2433","A namespace declaration cannot be in a different file from a class or function with which it is merged."),A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged:t(2434,e.DiagnosticCategory.Error,"A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged_2434","A namespace declaration cannot be located prior to a class or function with which it is merged."),Ambient_modules_cannot_be_nested_in_other_modules_or_namespaces:t(2435,e.DiagnosticCategory.Error,"Ambient_modules_cannot_be_nested_in_other_modules_or_namespaces_2435","Ambient modules cannot be nested in other modules or namespaces."),Ambient_module_declaration_cannot_specify_relative_module_name:t(2436,e.DiagnosticCategory.Error,"Ambient_module_declaration_cannot_specify_relative_module_name_2436","Ambient module declaration cannot specify relative module name."),Module_0_is_hidden_by_a_local_declaration_with_the_same_name:t(2437,e.DiagnosticCategory.Error,"Module_0_is_hidden_by_a_local_declaration_with_the_same_name_2437","Module '{0}' is hidden by a local declaration with the same name."),Import_name_cannot_be_0:t(2438,e.DiagnosticCategory.Error,"Import_name_cannot_be_0_2438","Import name cannot be '{0}'."),Import_or_export_declaration_in_an_ambient_module_declaration_cannot_reference_module_through_relative_module_name:t(2439,e.DiagnosticCategory.Error,"Import_or_export_declaration_in_an_ambient_module_declaration_cannot_reference_module_through_relati_2439","Import or export declaration in an ambient module declaration cannot reference module through relative module name."),Import_declaration_conflicts_with_local_declaration_of_0:t(2440,e.DiagnosticCategory.Error,"Import_declaration_conflicts_with_local_declaration_of_0_2440","Import declaration conflicts with local declaration of '{0}'."),Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module:t(2441,e.DiagnosticCategory.Error,"Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_2441","Duplicate identifier '{0}'. Compiler reserves name '{1}' in top level scope of a module."),Types_have_separate_declarations_of_a_private_property_0:t(2442,e.DiagnosticCategory.Error,"Types_have_separate_declarations_of_a_private_property_0_2442","Types have separate declarations of a private property '{0}'."),Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2:t(2443,e.DiagnosticCategory.Error,"Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2_2443","Property '{0}' is protected but type '{1}' is not a class derived from '{2}'."),Property_0_is_protected_in_type_1_but_public_in_type_2:t(2444,e.DiagnosticCategory.Error,"Property_0_is_protected_in_type_1_but_public_in_type_2_2444","Property '{0}' is protected in type '{1}' but public in type '{2}'."),Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses:t(2445,e.DiagnosticCategory.Error,"Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses_2445","Property '{0}' is protected and only accessible within class '{1}' and its subclasses."),Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1_This_is_an_instance_of_class_2:t(2446,e.DiagnosticCategory.Error,"Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1_This_is_an_instance_of_cl_2446","Property '{0}' is protected and only accessible through an instance of class '{1}'. This is an instance of class '{2}'."),The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead:t(2447,e.DiagnosticCategory.Error,"The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead_2447","The '{0}' operator is not allowed for boolean types. Consider using '{1}' instead."),Block_scoped_variable_0_used_before_its_declaration:t(2448,e.DiagnosticCategory.Error,"Block_scoped_variable_0_used_before_its_declaration_2448","Block-scoped variable '{0}' used before its declaration."),Class_0_used_before_its_declaration:t(2449,e.DiagnosticCategory.Error,"Class_0_used_before_its_declaration_2449","Class '{0}' used before its declaration."),Enum_0_used_before_its_declaration:t(2450,e.DiagnosticCategory.Error,"Enum_0_used_before_its_declaration_2450","Enum '{0}' used before its declaration."),Cannot_redeclare_block_scoped_variable_0:t(2451,e.DiagnosticCategory.Error,"Cannot_redeclare_block_scoped_variable_0_2451","Cannot redeclare block-scoped variable '{0}'."),An_enum_member_cannot_have_a_numeric_name:t(2452,e.DiagnosticCategory.Error,"An_enum_member_cannot_have_a_numeric_name_2452","An enum member cannot have a numeric name."),Variable_0_is_used_before_being_assigned:t(2454,e.DiagnosticCategory.Error,"Variable_0_is_used_before_being_assigned_2454","Variable '{0}' is used before being assigned."),Type_alias_0_circularly_references_itself:t(2456,e.DiagnosticCategory.Error,"Type_alias_0_circularly_references_itself_2456","Type alias '{0}' circularly references itself."),Type_alias_name_cannot_be_0:t(2457,e.DiagnosticCategory.Error,"Type_alias_name_cannot_be_0_2457","Type alias name cannot be '{0}'."),An_AMD_module_cannot_have_multiple_name_assignments:t(2458,e.DiagnosticCategory.Error,"An_AMD_module_cannot_have_multiple_name_assignments_2458","An AMD module cannot have multiple name assignments."),Module_0_declares_1_locally_but_it_is_not_exported:t(2459,e.DiagnosticCategory.Error,"Module_0_declares_1_locally_but_it_is_not_exported_2459","Module '{0}' declares '{1}' locally, but it is not exported."),Module_0_declares_1_locally_but_it_is_exported_as_2:t(2460,e.DiagnosticCategory.Error,"Module_0_declares_1_locally_but_it_is_exported_as_2_2460","Module '{0}' declares '{1}' locally, but it is exported as '{2}'."),Type_0_is_not_an_array_type:t(2461,e.DiagnosticCategory.Error,"Type_0_is_not_an_array_type_2461","Type '{0}' is not an array type."),A_rest_element_must_be_last_in_a_destructuring_pattern:t(2462,e.DiagnosticCategory.Error,"A_rest_element_must_be_last_in_a_destructuring_pattern_2462","A rest element must be last in a destructuring pattern."),A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature:t(2463,e.DiagnosticCategory.Error,"A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature_2463","A binding pattern parameter cannot be optional in an implementation signature."),A_computed_property_name_must_be_of_type_string_number_symbol_or_any:t(2464,e.DiagnosticCategory.Error,"A_computed_property_name_must_be_of_type_string_number_symbol_or_any_2464","A computed property name must be of type 'string', 'number', 'symbol', or 'any'."),this_cannot_be_referenced_in_a_computed_property_name:t(2465,e.DiagnosticCategory.Error,"this_cannot_be_referenced_in_a_computed_property_name_2465","'this' cannot be referenced in a computed property name."),super_cannot_be_referenced_in_a_computed_property_name:t(2466,e.DiagnosticCategory.Error,"super_cannot_be_referenced_in_a_computed_property_name_2466","'super' cannot be referenced in a computed property name."),A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type:t(2467,e.DiagnosticCategory.Error,"A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type_2467","A computed property name cannot reference a type parameter from its containing type."),Cannot_find_global_value_0:t(2468,e.DiagnosticCategory.Error,"Cannot_find_global_value_0_2468","Cannot find global value '{0}'."),The_0_operator_cannot_be_applied_to_type_symbol:t(2469,e.DiagnosticCategory.Error,"The_0_operator_cannot_be_applied_to_type_symbol_2469","The '{0}' operator cannot be applied to type 'symbol'."),Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_5_and_higher:t(2472,e.DiagnosticCategory.Error,"Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_5_and_higher_2472","Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher."),Enum_declarations_must_all_be_const_or_non_const:t(2473,e.DiagnosticCategory.Error,"Enum_declarations_must_all_be_const_or_non_const_2473","Enum declarations must all be const or non-const."),const_enum_member_initializers_can_only_contain_literal_values_and_other_computed_enum_values:t(2474,e.DiagnosticCategory.Error,"const_enum_member_initializers_can_only_contain_literal_values_and_other_computed_enum_values_2474","const enum member initializers can only contain literal values and other computed enum values."),const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment_or_type_query:t(2475,e.DiagnosticCategory.Error,"const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_im_2475","'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment or type query."),A_const_enum_member_can_only_be_accessed_using_a_string_literal:t(2476,e.DiagnosticCategory.Error,"A_const_enum_member_can_only_be_accessed_using_a_string_literal_2476","A const enum member can only be accessed using a string literal."),const_enum_member_initializer_was_evaluated_to_a_non_finite_value:t(2477,e.DiagnosticCategory.Error,"const_enum_member_initializer_was_evaluated_to_a_non_finite_value_2477","'const' enum member initializer was evaluated to a non-finite value."),const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN:t(2478,e.DiagnosticCategory.Error,"const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN_2478","'const' enum member initializer was evaluated to disallowed value 'NaN'."),let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations:t(2480,e.DiagnosticCategory.Error,"let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations_2480","'let' is not allowed to be used as a name in 'let' or 'const' declarations."),Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1:t(2481,e.DiagnosticCategory.Error,"Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1_2481","Cannot initialize outer scoped variable '{0}' in the same scope as block scoped declaration '{1}'."),The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation:t(2483,e.DiagnosticCategory.Error,"The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation_2483","The left-hand side of a 'for...of' statement cannot use a type annotation."),Export_declaration_conflicts_with_exported_declaration_of_0:t(2484,e.DiagnosticCategory.Error,"Export_declaration_conflicts_with_exported_declaration_of_0_2484","Export declaration conflicts with exported declaration of '{0}'."),The_left_hand_side_of_a_for_of_statement_must_be_a_variable_or_a_property_access:t(2487,e.DiagnosticCategory.Error,"The_left_hand_side_of_a_for_of_statement_must_be_a_variable_or_a_property_access_2487","The left-hand side of a 'for...of' statement must be a variable or a property access."),Type_0_must_have_a_Symbol_iterator_method_that_returns_an_iterator:t(2488,e.DiagnosticCategory.Error,"Type_0_must_have_a_Symbol_iterator_method_that_returns_an_iterator_2488","Type '{0}' must have a '[Symbol.iterator]()' method that returns an iterator."),An_iterator_must_have_a_next_method:t(2489,e.DiagnosticCategory.Error,"An_iterator_must_have_a_next_method_2489","An iterator must have a 'next()' method."),The_type_returned_by_the_0_method_of_an_iterator_must_have_a_value_property:t(2490,e.DiagnosticCategory.Error,"The_type_returned_by_the_0_method_of_an_iterator_must_have_a_value_property_2490","The type returned by the '{0}()' method of an iterator must have a 'value' property."),The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern:t(2491,e.DiagnosticCategory.Error,"The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern_2491","The left-hand side of a 'for...in' statement cannot be a destructuring pattern."),Cannot_redeclare_identifier_0_in_catch_clause:t(2492,e.DiagnosticCategory.Error,"Cannot_redeclare_identifier_0_in_catch_clause_2492","Cannot redeclare identifier '{0}' in catch clause."),Tuple_type_0_of_length_1_has_no_element_at_index_2:t(2493,e.DiagnosticCategory.Error,"Tuple_type_0_of_length_1_has_no_element_at_index_2_2493","Tuple type '{0}' of length '{1}' has no element at index '{2}'."),Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher:t(2494,e.DiagnosticCategory.Error,"Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher_2494","Using a string in a 'for...of' statement is only supported in ECMAScript 5 and higher."),Type_0_is_not_an_array_type_or_a_string_type:t(2495,e.DiagnosticCategory.Error,"Type_0_is_not_an_array_type_or_a_string_type_2495","Type '{0}' is not an array type or a string type."),The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_standard_function_expression:t(2496,e.DiagnosticCategory.Error,"The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_stand_2496","The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression."),This_module_can_only_be_referenced_with_ECMAScript_imports_Slashexports_by_turning_on_the_0_flag_and_referencing_its_default_export:t(2497,e.DiagnosticCategory.Error,"This_module_can_only_be_referenced_with_ECMAScript_imports_Slashexports_by_turning_on_the_0_flag_and_2497","This module can only be referenced with ECMAScript imports/exports by turning on the '{0}' flag and referencing its default export."),Module_0_uses_export_and_cannot_be_used_with_export_Asterisk:t(2498,e.DiagnosticCategory.Error,"Module_0_uses_export_and_cannot_be_used_with_export_Asterisk_2498","Module '{0}' uses 'export =' and cannot be used with 'export *'."),An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments:t(2499,e.DiagnosticCategory.Error,"An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments_2499","An interface can only extend an identifier/qualified-name with optional type arguments."),A_class_can_only_implement_an_identifier_Slashqualified_name_with_optional_type_arguments:t(2500,e.DiagnosticCategory.Error,"A_class_can_only_implement_an_identifier_Slashqualified_name_with_optional_type_arguments_2500","A class can only implement an identifier/qualified-name with optional type arguments."),A_rest_element_cannot_contain_a_binding_pattern:t(2501,e.DiagnosticCategory.Error,"A_rest_element_cannot_contain_a_binding_pattern_2501","A rest element cannot contain a binding pattern."),_0_is_referenced_directly_or_indirectly_in_its_own_type_annotation:t(2502,e.DiagnosticCategory.Error,"_0_is_referenced_directly_or_indirectly_in_its_own_type_annotation_2502","'{0}' is referenced directly or indirectly in its own type annotation."),Cannot_find_namespace_0:t(2503,e.DiagnosticCategory.Error,"Cannot_find_namespace_0_2503","Cannot find namespace '{0}'."),Type_0_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator:t(2504,e.DiagnosticCategory.Error,"Type_0_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator_2504","Type '{0}' must have a '[Symbol.asyncIterator]()' method that returns an async iterator."),A_generator_cannot_have_a_void_type_annotation:t(2505,e.DiagnosticCategory.Error,"A_generator_cannot_have_a_void_type_annotation_2505","A generator cannot have a 'void' type annotation."),_0_is_referenced_directly_or_indirectly_in_its_own_base_expression:t(2506,e.DiagnosticCategory.Error,"_0_is_referenced_directly_or_indirectly_in_its_own_base_expression_2506","'{0}' is referenced directly or indirectly in its own base expression."),Type_0_is_not_a_constructor_function_type:t(2507,e.DiagnosticCategory.Error,"Type_0_is_not_a_constructor_function_type_2507","Type '{0}' is not a constructor function type."),No_base_constructor_has_the_specified_number_of_type_arguments:t(2508,e.DiagnosticCategory.Error,"No_base_constructor_has_the_specified_number_of_type_arguments_2508","No base constructor has the specified number of type arguments."),Base_constructor_return_type_0_is_not_an_object_type_or_intersection_of_object_types_with_statically_known_members:t(2509,e.DiagnosticCategory.Error,"Base_constructor_return_type_0_is_not_an_object_type_or_intersection_of_object_types_with_statically_2509","Base constructor return type '{0}' is not an object type or intersection of object types with statically known members."),Base_constructors_must_all_have_the_same_return_type:t(2510,e.DiagnosticCategory.Error,"Base_constructors_must_all_have_the_same_return_type_2510","Base constructors must all have the same return type."),Cannot_create_an_instance_of_an_abstract_class:t(2511,e.DiagnosticCategory.Error,"Cannot_create_an_instance_of_an_abstract_class_2511","Cannot create an instance of an abstract class."),Overload_signatures_must_all_be_abstract_or_non_abstract:t(2512,e.DiagnosticCategory.Error,"Overload_signatures_must_all_be_abstract_or_non_abstract_2512","Overload signatures must all be abstract or non-abstract."),Abstract_method_0_in_class_1_cannot_be_accessed_via_super_expression:t(2513,e.DiagnosticCategory.Error,"Abstract_method_0_in_class_1_cannot_be_accessed_via_super_expression_2513","Abstract method '{0}' in class '{1}' cannot be accessed via super expression."),Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2:t(2515,e.DiagnosticCategory.Error,"Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2_2515","Non-abstract class '{0}' does not implement inherited abstract member '{1}' from class '{2}'."),All_declarations_of_an_abstract_method_must_be_consecutive:t(2516,e.DiagnosticCategory.Error,"All_declarations_of_an_abstract_method_must_be_consecutive_2516","All declarations of an abstract method must be consecutive."),Cannot_assign_an_abstract_constructor_type_to_a_non_abstract_constructor_type:t(2517,e.DiagnosticCategory.Error,"Cannot_assign_an_abstract_constructor_type_to_a_non_abstract_constructor_type_2517","Cannot assign an abstract constructor type to a non-abstract constructor type."),A_this_based_type_guard_is_not_compatible_with_a_parameter_based_type_guard:t(2518,e.DiagnosticCategory.Error,"A_this_based_type_guard_is_not_compatible_with_a_parameter_based_type_guard_2518","A 'this'-based type guard is not compatible with a parameter-based type guard."),An_async_iterator_must_have_a_next_method:t(2519,e.DiagnosticCategory.Error,"An_async_iterator_must_have_a_next_method_2519","An async iterator must have a 'next()' method."),Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions:t(2520,e.DiagnosticCategory.Error,"Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions_2520","Duplicate identifier '{0}'. Compiler uses declaration '{1}' to support async functions."),The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES3_and_ES5_Consider_using_a_standard_function_or_method:t(2522,e.DiagnosticCategory.Error,"The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES3_and_ES5_Consider_usi_2522","The 'arguments' object cannot be referenced in an async function or method in ES3 and ES5. Consider using a standard function or method."),yield_expressions_cannot_be_used_in_a_parameter_initializer:t(2523,e.DiagnosticCategory.Error,"yield_expressions_cannot_be_used_in_a_parameter_initializer_2523","'yield' expressions cannot be used in a parameter initializer."),await_expressions_cannot_be_used_in_a_parameter_initializer:t(2524,e.DiagnosticCategory.Error,"await_expressions_cannot_be_used_in_a_parameter_initializer_2524","'await' expressions cannot be used in a parameter initializer."),Initializer_provides_no_value_for_this_binding_element_and_the_binding_element_has_no_default_value:t(2525,e.DiagnosticCategory.Error,"Initializer_provides_no_value_for_this_binding_element_and_the_binding_element_has_no_default_value_2525","Initializer provides no value for this binding element and the binding element has no default value."),A_this_type_is_available_only_in_a_non_static_member_of_a_class_or_interface:t(2526,e.DiagnosticCategory.Error,"A_this_type_is_available_only_in_a_non_static_member_of_a_class_or_interface_2526","A 'this' type is available only in a non-static member of a class or interface."),The_inferred_type_of_0_references_an_inaccessible_1_type_A_type_annotation_is_necessary:t(2527,e.DiagnosticCategory.Error,"The_inferred_type_of_0_references_an_inaccessible_1_type_A_type_annotation_is_necessary_2527","The inferred type of '{0}' references an inaccessible '{1}' type. A type annotation is necessary."),A_module_cannot_have_multiple_default_exports:t(2528,e.DiagnosticCategory.Error,"A_module_cannot_have_multiple_default_exports_2528","A module cannot have multiple default exports."),Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_containing_async_functions:t(2529,e.DiagnosticCategory.Error,"Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_containing_async_func_2529","Duplicate identifier '{0}'. Compiler reserves name '{1}' in top level scope of a module containing async functions."),Property_0_is_incompatible_with_index_signature:t(2530,e.DiagnosticCategory.Error,"Property_0_is_incompatible_with_index_signature_2530","Property '{0}' is incompatible with index signature."),Object_is_possibly_null:t(2531,e.DiagnosticCategory.Error,"Object_is_possibly_null_2531","Object is possibly 'null'."),Object_is_possibly_undefined:t(2532,e.DiagnosticCategory.Error,"Object_is_possibly_undefined_2532","Object is possibly 'undefined'."),Object_is_possibly_null_or_undefined:t(2533,e.DiagnosticCategory.Error,"Object_is_possibly_null_or_undefined_2533","Object is possibly 'null' or 'undefined'."),A_function_returning_never_cannot_have_a_reachable_end_point:t(2534,e.DiagnosticCategory.Error,"A_function_returning_never_cannot_have_a_reachable_end_point_2534","A function returning 'never' cannot have a reachable end point."),Enum_type_0_has_members_with_initializers_that_are_not_literals:t(2535,e.DiagnosticCategory.Error,"Enum_type_0_has_members_with_initializers_that_are_not_literals_2535","Enum type '{0}' has members with initializers that are not literals."),Type_0_cannot_be_used_to_index_type_1:t(2536,e.DiagnosticCategory.Error,"Type_0_cannot_be_used_to_index_type_1_2536","Type '{0}' cannot be used to index type '{1}'."),Type_0_has_no_matching_index_signature_for_type_1:t(2537,e.DiagnosticCategory.Error,"Type_0_has_no_matching_index_signature_for_type_1_2537","Type '{0}' has no matching index signature for type '{1}'."),Type_0_cannot_be_used_as_an_index_type:t(2538,e.DiagnosticCategory.Error,"Type_0_cannot_be_used_as_an_index_type_2538","Type '{0}' cannot be used as an index type."),Cannot_assign_to_0_because_it_is_not_a_variable:t(2539,e.DiagnosticCategory.Error,"Cannot_assign_to_0_because_it_is_not_a_variable_2539","Cannot assign to '{0}' because it is not a variable."),Cannot_assign_to_0_because_it_is_a_read_only_property:t(2540,e.DiagnosticCategory.Error,"Cannot_assign_to_0_because_it_is_a_read_only_property_2540","Cannot assign to '{0}' because it is a read-only property."),Index_signature_in_type_0_only_permits_reading:t(2542,e.DiagnosticCategory.Error,"Index_signature_in_type_0_only_permits_reading_2542","Index signature in type '{0}' only permits reading."),Duplicate_identifier_newTarget_Compiler_uses_variable_declaration_newTarget_to_capture_new_target_meta_property_reference:t(2543,e.DiagnosticCategory.Error,"Duplicate_identifier_newTarget_Compiler_uses_variable_declaration_newTarget_to_capture_new_target_me_2543","Duplicate identifier '_newTarget'. Compiler uses variable declaration '_newTarget' to capture 'new.target' meta-property reference."),Expression_resolves_to_variable_declaration_newTarget_that_compiler_uses_to_capture_new_target_meta_property_reference:t(2544,e.DiagnosticCategory.Error,"Expression_resolves_to_variable_declaration_newTarget_that_compiler_uses_to_capture_new_target_meta__2544","Expression resolves to variable declaration '_newTarget' that compiler uses to capture 'new.target' meta-property reference."),A_mixin_class_must_have_a_constructor_with_a_single_rest_parameter_of_type_any:t(2545,e.DiagnosticCategory.Error,"A_mixin_class_must_have_a_constructor_with_a_single_rest_parameter_of_type_any_2545","A mixin class must have a constructor with a single rest parameter of type 'any[]'."),The_type_returned_by_the_0_method_of_an_async_iterator_must_be_a_promise_for_a_type_with_a_value_property:t(2547,e.DiagnosticCategory.Error,"The_type_returned_by_the_0_method_of_an_async_iterator_must_be_a_promise_for_a_type_with_a_value_pro_2547","The type returned by the '{0}()' method of an async iterator must be a promise for a type with a 'value' property."),Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator:t(2548,e.DiagnosticCategory.Error,"Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator_2548","Type '{0}' is not an array type or does not have a '[Symbol.iterator]()' method that returns an iterator."),Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator:t(2549,e.DiagnosticCategory.Error,"Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns__2549","Type '{0}' is not an array type or a string type or does not have a '[Symbol.iterator]()' method that returns an iterator."),Property_0_does_not_exist_on_type_1_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2_or_later:t(2550,e.DiagnosticCategory.Error,"Property_0_does_not_exist_on_type_1_Do_you_need_to_change_your_target_library_Try_changing_the_lib_c_2550","Property '{0}' does not exist on type '{1}'. Do you need to change your target library? Try changing the 'lib' compiler option to '{2}' or later."),Property_0_does_not_exist_on_type_1_Did_you_mean_2:t(2551,e.DiagnosticCategory.Error,"Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551","Property '{0}' does not exist on type '{1}'. Did you mean '{2}'?"),Cannot_find_name_0_Did_you_mean_1:t(2552,e.DiagnosticCategory.Error,"Cannot_find_name_0_Did_you_mean_1_2552","Cannot find name '{0}'. Did you mean '{1}'?"),Computed_values_are_not_permitted_in_an_enum_with_string_valued_members:t(2553,e.DiagnosticCategory.Error,"Computed_values_are_not_permitted_in_an_enum_with_string_valued_members_2553","Computed values are not permitted in an enum with string valued members."),Expected_0_arguments_but_got_1:t(2554,e.DiagnosticCategory.Error,"Expected_0_arguments_but_got_1_2554","Expected {0} arguments, but got {1}."),Expected_at_least_0_arguments_but_got_1:t(2555,e.DiagnosticCategory.Error,"Expected_at_least_0_arguments_but_got_1_2555","Expected at least {0} arguments, but got {1}."),A_spread_argument_must_either_have_a_tuple_type_or_be_passed_to_a_rest_parameter:t(2556,e.DiagnosticCategory.Error,"A_spread_argument_must_either_have_a_tuple_type_or_be_passed_to_a_rest_parameter_2556","A spread argument must either have a tuple type or be passed to a rest parameter."),Expected_0_type_arguments_but_got_1:t(2558,e.DiagnosticCategory.Error,"Expected_0_type_arguments_but_got_1_2558","Expected {0} type arguments, but got {1}."),Type_0_has_no_properties_in_common_with_type_1:t(2559,e.DiagnosticCategory.Error,"Type_0_has_no_properties_in_common_with_type_1_2559","Type '{0}' has no properties in common with type '{1}'."),Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it:t(2560,e.DiagnosticCategory.Error,"Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it_2560","Value of type '{0}' has no properties in common with type '{1}'. Did you mean to call it?"),Object_literal_may_only_specify_known_properties_but_0_does_not_exist_in_type_1_Did_you_mean_to_write_2:t(2561,e.DiagnosticCategory.Error,"Object_literal_may_only_specify_known_properties_but_0_does_not_exist_in_type_1_Did_you_mean_to_writ_2561","Object literal may only specify known properties, but '{0}' does not exist in type '{1}'. Did you mean to write '{2}'?"),Base_class_expressions_cannot_reference_class_type_parameters:t(2562,e.DiagnosticCategory.Error,"Base_class_expressions_cannot_reference_class_type_parameters_2562","Base class expressions cannot reference class type parameters."),The_containing_function_or_module_body_is_too_large_for_control_flow_analysis:t(2563,e.DiagnosticCategory.Error,"The_containing_function_or_module_body_is_too_large_for_control_flow_analysis_2563","The containing function or module body is too large for control flow analysis."),Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor:t(2564,e.DiagnosticCategory.Error,"Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor_2564","Property '{0}' has no initializer and is not definitely assigned in the constructor."),Property_0_is_used_before_being_assigned:t(2565,e.DiagnosticCategory.Error,"Property_0_is_used_before_being_assigned_2565","Property '{0}' is used before being assigned."),A_rest_element_cannot_have_a_property_name:t(2566,e.DiagnosticCategory.Error,"A_rest_element_cannot_have_a_property_name_2566","A rest element cannot have a property name."),Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations:t(2567,e.DiagnosticCategory.Error,"Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations_2567","Enum declarations can only merge with namespace or other enum declarations."),Property_0_may_not_exist_on_type_1_Did_you_mean_2:t(2568,e.DiagnosticCategory.Error,"Property_0_may_not_exist_on_type_1_Did_you_mean_2_2568","Property '{0}' may not exist on type '{1}'. Did you mean '{2}'?"),Type_0_is_not_an_array_type_or_a_string_type_Use_compiler_option_downlevelIteration_to_allow_iterating_of_iterators:t(2569,e.DiagnosticCategory.Error,"Type_0_is_not_an_array_type_or_a_string_type_Use_compiler_option_downlevelIteration_to_allow_iterati_2569","Type '{0}' is not an array type or a string type. Use compiler option '--downlevelIteration' to allow iterating of iterators."),Could_not_find_name_0_Did_you_mean_1:t(2570,e.DiagnosticCategory.Error,"Could_not_find_name_0_Did_you_mean_1_2570","Could not find name '{0}'. Did you mean '{1}'?"),Object_is_of_type_unknown:t(2571,e.DiagnosticCategory.Error,"Object_is_of_type_unknown_2571","Object is of type 'unknown'."),A_rest_element_type_must_be_an_array_type:t(2574,e.DiagnosticCategory.Error,"A_rest_element_type_must_be_an_array_type_2574","A rest element type must be an array type."),No_overload_expects_0_arguments_but_overloads_do_exist_that_expect_either_1_or_2_arguments:t(2575,e.DiagnosticCategory.Error,"No_overload_expects_0_arguments_but_overloads_do_exist_that_expect_either_1_or_2_arguments_2575","No overload expects {0} arguments, but overloads do exist that expect either {1} or {2} arguments."),Property_0_does_not_exist_on_type_1_Did_you_mean_to_access_the_static_member_2_instead:t(2576,e.DiagnosticCategory.Error,"Property_0_does_not_exist_on_type_1_Did_you_mean_to_access_the_static_member_2_instead_2576","Property '{0}' does not exist on type '{1}'. Did you mean to access the static member '{2}' instead?"),Return_type_annotation_circularly_references_itself:t(2577,e.DiagnosticCategory.Error,"Return_type_annotation_circularly_references_itself_2577","Return type annotation circularly references itself."),Unused_ts_expect_error_directive:t(2578,e.DiagnosticCategory.Error,"Unused_ts_expect_error_directive_2578","Unused '@ts-expect-error' directive."),Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode:t(2580,e.DiagnosticCategory.Error,"Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2580","Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`."),Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery:t(2581,e.DiagnosticCategory.Error,"Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2581","Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery`."),Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_types_Slashjest_or_npm_i_save_dev_types_Slashmocha:t(2582,e.DiagnosticCategory.Error,"Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2582","Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`."),Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_1_or_later:t(2583,e.DiagnosticCategory.Error,"Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2583","Cannot find name '{0}'. Do you need to change your target library? Try changing the 'lib' compiler option to '{1}' or later."),Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_include_dom:t(2584,e.DiagnosticCategory.Error,"Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2584","Cannot find name '{0}'. Do you need to change your target library? Try changing the 'lib' compiler option to include 'dom'."),_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_es2015_or_later:t(2585,e.DiagnosticCategory.Error,"_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_2585","'{0}' only refers to a type, but is being used as a value here. Do you need to change your target library? Try changing the 'lib' compiler option to es2015 or later."),Cannot_assign_to_0_because_it_is_a_constant:t(2588,e.DiagnosticCategory.Error,"Cannot_assign_to_0_because_it_is_a_constant_2588","Cannot assign to '{0}' because it is a constant."),Type_instantiation_is_excessively_deep_and_possibly_infinite:t(2589,e.DiagnosticCategory.Error,"Type_instantiation_is_excessively_deep_and_possibly_infinite_2589","Type instantiation is excessively deep and possibly infinite."),Expression_produces_a_union_type_that_is_too_complex_to_represent:t(2590,e.DiagnosticCategory.Error,"Expression_produces_a_union_type_that_is_too_complex_to_represent_2590","Expression produces a union type that is too complex to represent."),Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode_and_then_add_node_to_the_types_field_in_your_tsconfig:t(2591,e.DiagnosticCategory.Error,"Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2591","Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig."),Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery_and_then_add_jquery_to_the_types_field_in_your_tsconfig:t(2592,e.DiagnosticCategory.Error,"Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2592","Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery` and then add 'jquery' to the types field in your tsconfig."),Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_types_Slashjest_or_npm_i_save_dev_types_Slashmocha_and_then_add_jest_or_mocha_to_the_types_field_in_your_tsconfig:t(2593,e.DiagnosticCategory.Error,"Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2593","Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add 'jest' or 'mocha' to the types field in your tsconfig."),This_module_is_declared_with_using_export_and_can_only_be_used_with_a_default_import_when_using_the_0_flag:t(2594,e.DiagnosticCategory.Error,"This_module_is_declared_with_using_export_and_can_only_be_used_with_a_default_import_when_using_the__2594","This module is declared with using 'export =', and can only be used with a default import when using the '{0}' flag."),_0_can_only_be_imported_by_using_a_default_import:t(2595,e.DiagnosticCategory.Error,"_0_can_only_be_imported_by_using_a_default_import_2595","'{0}' can only be imported by using a default import."),_0_can_only_be_imported_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import:t(2596,e.DiagnosticCategory.Error,"_0_can_only_be_imported_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import_2596","'{0}' can only be imported by turning on the 'esModuleInterop' flag and using a default import."),_0_can_only_be_imported_by_using_a_require_call_or_by_using_a_default_import:t(2597,e.DiagnosticCategory.Error,"_0_can_only_be_imported_by_using_a_require_call_or_by_using_a_default_import_2597","'{0}' can only be imported by using a 'require' call or by using a default import."),_0_can_only_be_imported_by_using_a_require_call_or_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import:t(2598,e.DiagnosticCategory.Error,"_0_can_only_be_imported_by_using_a_require_call_or_by_turning_on_the_esModuleInterop_flag_and_using__2598","'{0}' can only be imported by using a 'require' call or by turning on the 'esModuleInterop' flag and using a default import."),JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist:t(2602,e.DiagnosticCategory.Error,"JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist_2602","JSX element implicitly has type 'any' because the global type 'JSX.Element' does not exist."),Property_0_in_type_1_is_not_assignable_to_type_2:t(2603,e.DiagnosticCategory.Error,"Property_0_in_type_1_is_not_assignable_to_type_2_2603","Property '{0}' in type '{1}' is not assignable to type '{2}'."),JSX_element_type_0_does_not_have_any_construct_or_call_signatures:t(2604,e.DiagnosticCategory.Error,"JSX_element_type_0_does_not_have_any_construct_or_call_signatures_2604","JSX element type '{0}' does not have any construct or call signatures."),Property_0_of_JSX_spread_attribute_is_not_assignable_to_target_property:t(2606,e.DiagnosticCategory.Error,"Property_0_of_JSX_spread_attribute_is_not_assignable_to_target_property_2606","Property '{0}' of JSX spread attribute is not assignable to target property."),JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property:t(2607,e.DiagnosticCategory.Error,"JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property_2607","JSX element class does not support attributes because it does not have a '{0}' property."),The_global_type_JSX_0_may_not_have_more_than_one_property:t(2608,e.DiagnosticCategory.Error,"The_global_type_JSX_0_may_not_have_more_than_one_property_2608","The global type 'JSX.{0}' may not have more than one property."),JSX_spread_child_must_be_an_array_type:t(2609,e.DiagnosticCategory.Error,"JSX_spread_child_must_be_an_array_type_2609","JSX spread child must be an array type."),_0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property:t(2610,e.DiagnosticCategory.Error,"_0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property_2610","'{0}' is defined as an accessor in class '{1}', but is overridden here in '{2}' as an instance property."),_0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor:t(2611,e.DiagnosticCategory.Error,"_0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor_2611","'{0}' is defined as a property in class '{1}', but is overridden here in '{2}' as an accessor."),Property_0_will_overwrite_the_base_property_in_1_If_this_is_intentional_add_an_initializer_Otherwise_add_a_declare_modifier_or_remove_the_redundant_declaration:t(2612,e.DiagnosticCategory.Error,"Property_0_will_overwrite_the_base_property_in_1_If_this_is_intentional_add_an_initializer_Otherwise_2612","Property '{0}' will overwrite the base property in '{1}'. If this is intentional, add an initializer. Otherwise, add a 'declare' modifier or remove the redundant declaration."),Module_0_has_no_default_export_Did_you_mean_to_use_import_1_from_0_instead:t(2613,e.DiagnosticCategory.Error,"Module_0_has_no_default_export_Did_you_mean_to_use_import_1_from_0_instead_2613","Module '{0}' has no default export. Did you mean to use 'import { {1} } from {0}' instead?"),Module_0_has_no_exported_member_1_Did_you_mean_to_use_import_1_from_0_instead:t(2614,e.DiagnosticCategory.Error,"Module_0_has_no_exported_member_1_Did_you_mean_to_use_import_1_from_0_instead_2614","Module '{0}' has no exported member '{1}'. Did you mean to use 'import {1} from {0}' instead?"),Type_of_property_0_circularly_references_itself_in_mapped_type_1:t(2615,e.DiagnosticCategory.Error,"Type_of_property_0_circularly_references_itself_in_mapped_type_1_2615","Type of property '{0}' circularly references itself in mapped type '{1}'."),_0_can_only_be_imported_by_using_import_1_require_2_or_a_default_import:t(2616,e.DiagnosticCategory.Error,"_0_can_only_be_imported_by_using_import_1_require_2_or_a_default_import_2616","'{0}' can only be imported by using 'import {1} = require({2})' or a default import."),_0_can_only_be_imported_by_using_import_1_require_2_or_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import:t(2617,e.DiagnosticCategory.Error,"_0_can_only_be_imported_by_using_import_1_require_2_or_by_turning_on_the_esModuleInterop_flag_and_us_2617","'{0}' can only be imported by using 'import {1} = require({2})' or by turning on the 'esModuleInterop' flag and using a default import."),Source_has_0_element_s_but_target_requires_1:t(2618,e.DiagnosticCategory.Error,"Source_has_0_element_s_but_target_requires_1_2618","Source has {0} element(s) but target requires {1}."),Source_has_0_element_s_but_target_allows_only_1:t(2619,e.DiagnosticCategory.Error,"Source_has_0_element_s_but_target_allows_only_1_2619","Source has {0} element(s) but target allows only {1}."),Target_requires_0_element_s_but_source_may_have_fewer:t(2620,e.DiagnosticCategory.Error,"Target_requires_0_element_s_but_source_may_have_fewer_2620","Target requires {0} element(s) but source may have fewer."),Target_allows_only_0_element_s_but_source_may_have_more:t(2621,e.DiagnosticCategory.Error,"Target_allows_only_0_element_s_but_source_may_have_more_2621","Target allows only {0} element(s) but source may have more."),Source_provides_no_match_for_required_element_at_position_0_in_target:t(2623,e.DiagnosticCategory.Error,"Source_provides_no_match_for_required_element_at_position_0_in_target_2623","Source provides no match for required element at position {0} in target."),Source_provides_no_match_for_variadic_element_at_position_0_in_target:t(2624,e.DiagnosticCategory.Error,"Source_provides_no_match_for_variadic_element_at_position_0_in_target_2624","Source provides no match for variadic element at position {0} in target."),Variadic_element_at_position_0_in_source_does_not_match_element_at_position_1_in_target:t(2625,e.DiagnosticCategory.Error,"Variadic_element_at_position_0_in_source_does_not_match_element_at_position_1_in_target_2625","Variadic element at position {0} in source does not match element at position {1} in target."),Type_at_position_0_in_source_is_not_compatible_with_type_at_position_1_in_target:t(2626,e.DiagnosticCategory.Error,"Type_at_position_0_in_source_is_not_compatible_with_type_at_position_1_in_target_2626","Type at position {0} in source is not compatible with type at position {1} in target."),Type_at_positions_0_through_1_in_source_is_not_compatible_with_type_at_position_2_in_target:t(2627,e.DiagnosticCategory.Error,"Type_at_positions_0_through_1_in_source_is_not_compatible_with_type_at_position_2_in_target_2627","Type at positions {0} through {1} in source is not compatible with type at position {2} in target."),Cannot_assign_to_0_because_it_is_an_enum:t(2628,e.DiagnosticCategory.Error,"Cannot_assign_to_0_because_it_is_an_enum_2628","Cannot assign to '{0}' because it is an enum."),Cannot_assign_to_0_because_it_is_a_class:t(2629,e.DiagnosticCategory.Error,"Cannot_assign_to_0_because_it_is_a_class_2629","Cannot assign to '{0}' because it is a class."),Cannot_assign_to_0_because_it_is_a_function:t(2630,e.DiagnosticCategory.Error,"Cannot_assign_to_0_because_it_is_a_function_2630","Cannot assign to '{0}' because it is a function."),Cannot_assign_to_0_because_it_is_a_namespace:t(2631,e.DiagnosticCategory.Error,"Cannot_assign_to_0_because_it_is_a_namespace_2631","Cannot assign to '{0}' because it is a namespace."),Cannot_assign_to_0_because_it_is_an_import:t(2632,e.DiagnosticCategory.Error,"Cannot_assign_to_0_because_it_is_an_import_2632","Cannot assign to '{0}' because it is an import."),JSX_property_access_expressions_cannot_include_JSX_namespace_names:t(2633,e.DiagnosticCategory.Error,"JSX_property_access_expressions_cannot_include_JSX_namespace_names_2633","JSX property access expressions cannot include JSX namespace names"),_0_index_signatures_are_incompatible:t(2634,e.DiagnosticCategory.Error,"_0_index_signatures_are_incompatible_2634","'{0}' index signatures are incompatible."),Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity:t(2649,e.DiagnosticCategory.Error,"Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity_2649","Cannot augment module '{0}' with value exports because it resolves to a non-module entity."),A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_members_defined_in_other_enums:t(2651,e.DiagnosticCategory.Error,"A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_memb_2651","A member initializer in a enum declaration cannot reference members declared after it, including members defined in other enums."),Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_default_0_declaration_instead:t(2652,e.DiagnosticCategory.Error,"Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_d_2652","Merged declaration '{0}' cannot include a default export declaration. Consider adding a separate 'export default {0}' declaration instead."),Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1:t(2653,e.DiagnosticCategory.Error,"Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1_2653","Non-abstract class expression does not implement inherited abstract member '{0}' from class '{1}'."),JSX_expressions_must_have_one_parent_element:t(2657,e.DiagnosticCategory.Error,"JSX_expressions_must_have_one_parent_element_2657","JSX expressions must have one parent element."),Type_0_provides_no_match_for_the_signature_1:t(2658,e.DiagnosticCategory.Error,"Type_0_provides_no_match_for_the_signature_1_2658","Type '{0}' provides no match for the signature '{1}'."),super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher:t(2659,e.DiagnosticCategory.Error,"super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_highe_2659","'super' is only allowed in members of object literal expressions when option 'target' is 'ES2015' or higher."),super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions:t(2660,e.DiagnosticCategory.Error,"super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions_2660","'super' can only be referenced in members of derived classes or object literal expressions."),Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module:t(2661,e.DiagnosticCategory.Error,"Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module_2661","Cannot export '{0}'. Only local declarations can be exported from a module."),Cannot_find_name_0_Did_you_mean_the_static_member_1_0:t(2662,e.DiagnosticCategory.Error,"Cannot_find_name_0_Did_you_mean_the_static_member_1_0_2662","Cannot find name '{0}'. Did you mean the static member '{1}.{0}'?"),Cannot_find_name_0_Did_you_mean_the_instance_member_this_0:t(2663,e.DiagnosticCategory.Error,"Cannot_find_name_0_Did_you_mean_the_instance_member_this_0_2663","Cannot find name '{0}'. Did you mean the instance member 'this.{0}'?"),Invalid_module_name_in_augmentation_module_0_cannot_be_found:t(2664,e.DiagnosticCategory.Error,"Invalid_module_name_in_augmentation_module_0_cannot_be_found_2664","Invalid module name in augmentation, module '{0}' cannot be found."),Invalid_module_name_in_augmentation_Module_0_resolves_to_an_untyped_module_at_1_which_cannot_be_augmented:t(2665,e.DiagnosticCategory.Error,"Invalid_module_name_in_augmentation_Module_0_resolves_to_an_untyped_module_at_1_which_cannot_be_augm_2665","Invalid module name in augmentation. Module '{0}' resolves to an untyped module at '{1}', which cannot be augmented."),Exports_and_export_assignments_are_not_permitted_in_module_augmentations:t(2666,e.DiagnosticCategory.Error,"Exports_and_export_assignments_are_not_permitted_in_module_augmentations_2666","Exports and export assignments are not permitted in module augmentations."),Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_module:t(2667,e.DiagnosticCategory.Error,"Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_mod_2667","Imports are not permitted in module augmentations. Consider moving them to the enclosing external module."),export_modifier_cannot_be_applied_to_ambient_modules_and_module_augmentations_since_they_are_always_visible:t(2668,e.DiagnosticCategory.Error,"export_modifier_cannot_be_applied_to_ambient_modules_and_module_augmentations_since_they_are_always__2668","'export' modifier cannot be applied to ambient modules and module augmentations since they are always visible."),Augmentations_for_the_global_scope_can_only_be_directly_nested_in_external_modules_or_ambient_module_declarations:t(2669,e.DiagnosticCategory.Error,"Augmentations_for_the_global_scope_can_only_be_directly_nested_in_external_modules_or_ambient_module_2669","Augmentations for the global scope can only be directly nested in external modules or ambient module declarations."),Augmentations_for_the_global_scope_should_have_declare_modifier_unless_they_appear_in_already_ambient_context:t(2670,e.DiagnosticCategory.Error,"Augmentations_for_the_global_scope_should_have_declare_modifier_unless_they_appear_in_already_ambien_2670","Augmentations for the global scope should have 'declare' modifier unless they appear in already ambient context."),Cannot_augment_module_0_because_it_resolves_to_a_non_module_entity:t(2671,e.DiagnosticCategory.Error,"Cannot_augment_module_0_because_it_resolves_to_a_non_module_entity_2671","Cannot augment module '{0}' because it resolves to a non-module entity."),Cannot_assign_a_0_constructor_type_to_a_1_constructor_type:t(2672,e.DiagnosticCategory.Error,"Cannot_assign_a_0_constructor_type_to_a_1_constructor_type_2672","Cannot assign a '{0}' constructor type to a '{1}' constructor type."),Constructor_of_class_0_is_private_and_only_accessible_within_the_class_declaration:t(2673,e.DiagnosticCategory.Error,"Constructor_of_class_0_is_private_and_only_accessible_within_the_class_declaration_2673","Constructor of class '{0}' is private and only accessible within the class declaration."),Constructor_of_class_0_is_protected_and_only_accessible_within_the_class_declaration:t(2674,e.DiagnosticCategory.Error,"Constructor_of_class_0_is_protected_and_only_accessible_within_the_class_declaration_2674","Constructor of class '{0}' is protected and only accessible within the class declaration."),Cannot_extend_a_class_0_Class_constructor_is_marked_as_private:t(2675,e.DiagnosticCategory.Error,"Cannot_extend_a_class_0_Class_constructor_is_marked_as_private_2675","Cannot extend a class '{0}'. Class constructor is marked as private."),Accessors_must_both_be_abstract_or_non_abstract:t(2676,e.DiagnosticCategory.Error,"Accessors_must_both_be_abstract_or_non_abstract_2676","Accessors must both be abstract or non-abstract."),A_type_predicate_s_type_must_be_assignable_to_its_parameter_s_type:t(2677,e.DiagnosticCategory.Error,"A_type_predicate_s_type_must_be_assignable_to_its_parameter_s_type_2677","A type predicate's type must be assignable to its parameter's type."),Type_0_is_not_comparable_to_type_1:t(2678,e.DiagnosticCategory.Error,"Type_0_is_not_comparable_to_type_1_2678","Type '{0}' is not comparable to type '{1}'."),A_function_that_is_called_with_the_new_keyword_cannot_have_a_this_type_that_is_void:t(2679,e.DiagnosticCategory.Error,"A_function_that_is_called_with_the_new_keyword_cannot_have_a_this_type_that_is_void_2679","A function that is called with the 'new' keyword cannot have a 'this' type that is 'void'."),A_0_parameter_must_be_the_first_parameter:t(2680,e.DiagnosticCategory.Error,"A_0_parameter_must_be_the_first_parameter_2680","A '{0}' parameter must be the first parameter."),A_constructor_cannot_have_a_this_parameter:t(2681,e.DiagnosticCategory.Error,"A_constructor_cannot_have_a_this_parameter_2681","A constructor cannot have a 'this' parameter."),this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation:t(2683,e.DiagnosticCategory.Error,"this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_2683","'this' implicitly has type 'any' because it does not have a type annotation."),The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1:t(2684,e.DiagnosticCategory.Error,"The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1_2684","The 'this' context of type '{0}' is not assignable to method's 'this' of type '{1}'."),The_this_types_of_each_signature_are_incompatible:t(2685,e.DiagnosticCategory.Error,"The_this_types_of_each_signature_are_incompatible_2685","The 'this' types of each signature are incompatible."),_0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead:t(2686,e.DiagnosticCategory.Error,"_0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead_2686","'{0}' refers to a UMD global, but the current file is a module. Consider adding an import instead."),All_declarations_of_0_must_have_identical_modifiers:t(2687,e.DiagnosticCategory.Error,"All_declarations_of_0_must_have_identical_modifiers_2687","All declarations of '{0}' must have identical modifiers."),Cannot_find_type_definition_file_for_0:t(2688,e.DiagnosticCategory.Error,"Cannot_find_type_definition_file_for_0_2688","Cannot find type definition file for '{0}'."),Cannot_extend_an_interface_0_Did_you_mean_implements:t(2689,e.DiagnosticCategory.Error,"Cannot_extend_an_interface_0_Did_you_mean_implements_2689","Cannot extend an interface '{0}'. Did you mean 'implements'?"),_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0:t(2690,e.DiagnosticCategory.Error,"_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0_2690","'{0}' only refers to a type, but is being used as a value here. Did you mean to use '{1} in {0}'?"),An_import_path_cannot_end_with_a_0_extension_Consider_importing_1_instead:t(2691,e.DiagnosticCategory.Error,"An_import_path_cannot_end_with_a_0_extension_Consider_importing_1_instead_2691","An import path cannot end with a '{0}' extension. Consider importing '{1}' instead."),_0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible:t(2692,e.DiagnosticCategory.Error,"_0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible_2692","'{0}' is a primitive, but '{1}' is a wrapper object. Prefer using '{0}' when possible."),_0_only_refers_to_a_type_but_is_being_used_as_a_value_here:t(2693,e.DiagnosticCategory.Error,"_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_2693","'{0}' only refers to a type, but is being used as a value here."),Namespace_0_has_no_exported_member_1:t(2694,e.DiagnosticCategory.Error,"Namespace_0_has_no_exported_member_1_2694","Namespace '{0}' has no exported member '{1}'."),Left_side_of_comma_operator_is_unused_and_has_no_side_effects:t(2695,e.DiagnosticCategory.Error,"Left_side_of_comma_operator_is_unused_and_has_no_side_effects_2695","Left side of comma operator is unused and has no side effects.",!0),The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead:t(2696,e.DiagnosticCategory.Error,"The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead_2696","The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?"),An_async_function_or_method_must_return_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES2015_in_your_lib_option:t(2697,e.DiagnosticCategory.Error,"An_async_function_or_method_must_return_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_in_2697","An async function or method must return a 'Promise'. Make sure you have a declaration for 'Promise' or include 'ES2015' in your '--lib' option."),Spread_types_may_only_be_created_from_object_types:t(2698,e.DiagnosticCategory.Error,"Spread_types_may_only_be_created_from_object_types_2698","Spread types may only be created from object types."),Static_property_0_conflicts_with_built_in_property_Function_0_of_constructor_function_1:t(2699,e.DiagnosticCategory.Error,"Static_property_0_conflicts_with_built_in_property_Function_0_of_constructor_function_1_2699","Static property '{0}' conflicts with built-in property 'Function.{0}' of constructor function '{1}'."),Rest_types_may_only_be_created_from_object_types:t(2700,e.DiagnosticCategory.Error,"Rest_types_may_only_be_created_from_object_types_2700","Rest types may only be created from object types."),The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access:t(2701,e.DiagnosticCategory.Error,"The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access_2701","The target of an object rest assignment must be a variable or a property access."),_0_only_refers_to_a_type_but_is_being_used_as_a_namespace_here:t(2702,e.DiagnosticCategory.Error,"_0_only_refers_to_a_type_but_is_being_used_as_a_namespace_here_2702","'{0}' only refers to a type, but is being used as a namespace here."),The_operand_of_a_delete_operator_must_be_a_property_reference:t(2703,e.DiagnosticCategory.Error,"The_operand_of_a_delete_operator_must_be_a_property_reference_2703","The operand of a 'delete' operator must be a property reference."),The_operand_of_a_delete_operator_cannot_be_a_read_only_property:t(2704,e.DiagnosticCategory.Error,"The_operand_of_a_delete_operator_cannot_be_a_read_only_property_2704","The operand of a 'delete' operator cannot be a read-only property."),An_async_function_or_method_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option:t(2705,e.DiagnosticCategory.Error,"An_async_function_or_method_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_de_2705","An async function or method in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option."),Required_type_parameters_may_not_follow_optional_type_parameters:t(2706,e.DiagnosticCategory.Error,"Required_type_parameters_may_not_follow_optional_type_parameters_2706","Required type parameters may not follow optional type parameters."),Generic_type_0_requires_between_1_and_2_type_arguments:t(2707,e.DiagnosticCategory.Error,"Generic_type_0_requires_between_1_and_2_type_arguments_2707","Generic type '{0}' requires between {1} and {2} type arguments."),Cannot_use_namespace_0_as_a_value:t(2708,e.DiagnosticCategory.Error,"Cannot_use_namespace_0_as_a_value_2708","Cannot use namespace '{0}' as a value."),Cannot_use_namespace_0_as_a_type:t(2709,e.DiagnosticCategory.Error,"Cannot_use_namespace_0_as_a_type_2709","Cannot use namespace '{0}' as a type."),_0_are_specified_twice_The_attribute_named_0_will_be_overwritten:t(2710,e.DiagnosticCategory.Error,"_0_are_specified_twice_The_attribute_named_0_will_be_overwritten_2710","'{0}' are specified twice. The attribute named '{0}' will be overwritten."),A_dynamic_import_call_returns_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES2015_in_your_lib_option:t(2711,e.DiagnosticCategory.Error,"A_dynamic_import_call_returns_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES20_2711","A dynamic import call returns a 'Promise'. Make sure you have a declaration for 'Promise' or include 'ES2015' in your '--lib' option."),A_dynamic_import_call_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option:t(2712,e.DiagnosticCategory.Error,"A_dynamic_import_call_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declarat_2712","A dynamic import call in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option."),Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_property_1_in_0_with_0_1:t(2713,e.DiagnosticCategory.Error,"Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_p_2713","Cannot access '{0}.{1}' because '{0}' is a type, but not a namespace. Did you mean to retrieve the type of the property '{1}' in '{0}' with '{0}[\"{1}\"]'?"),The_expression_of_an_export_assignment_must_be_an_identifier_or_qualified_name_in_an_ambient_context:t(2714,e.DiagnosticCategory.Error,"The_expression_of_an_export_assignment_must_be_an_identifier_or_qualified_name_in_an_ambient_context_2714","The expression of an export assignment must be an identifier or qualified name in an ambient context."),Abstract_property_0_in_class_1_cannot_be_accessed_in_the_constructor:t(2715,e.DiagnosticCategory.Error,"Abstract_property_0_in_class_1_cannot_be_accessed_in_the_constructor_2715","Abstract property '{0}' in class '{1}' cannot be accessed in the constructor."),Type_parameter_0_has_a_circular_default:t(2716,e.DiagnosticCategory.Error,"Type_parameter_0_has_a_circular_default_2716","Type parameter '{0}' has a circular default."),Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_type_2:t(2717,e.DiagnosticCategory.Error,"Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_t_2717","Subsequent property declarations must have the same type. Property '{0}' must be of type '{1}', but here has type '{2}'."),Duplicate_property_0:t(2718,e.DiagnosticCategory.Error,"Duplicate_property_0_2718","Duplicate property '{0}'."),Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated:t(2719,e.DiagnosticCategory.Error,"Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated_2719","Type '{0}' is not assignable to type '{1}'. Two different types with this name exist, but they are unrelated."),Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclass:t(2720,e.DiagnosticCategory.Error,"Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclas_2720","Class '{0}' incorrectly implements class '{1}'. Did you mean to extend '{1}' and inherit its members as a subclass?"),Cannot_invoke_an_object_which_is_possibly_null:t(2721,e.DiagnosticCategory.Error,"Cannot_invoke_an_object_which_is_possibly_null_2721","Cannot invoke an object which is possibly 'null'."),Cannot_invoke_an_object_which_is_possibly_undefined:t(2722,e.DiagnosticCategory.Error,"Cannot_invoke_an_object_which_is_possibly_undefined_2722","Cannot invoke an object which is possibly 'undefined'."),Cannot_invoke_an_object_which_is_possibly_null_or_undefined:t(2723,e.DiagnosticCategory.Error,"Cannot_invoke_an_object_which_is_possibly_null_or_undefined_2723","Cannot invoke an object which is possibly 'null' or 'undefined'."),_0_has_no_exported_member_named_1_Did_you_mean_2:t(2724,e.DiagnosticCategory.Error,"_0_has_no_exported_member_named_1_Did_you_mean_2_2724","'{0}' has no exported member named '{1}'. Did you mean '{2}'?"),Class_name_cannot_be_Object_when_targeting_ES5_with_module_0:t(2725,e.DiagnosticCategory.Error,"Class_name_cannot_be_Object_when_targeting_ES5_with_module_0_2725","Class name cannot be 'Object' when targeting ES5 with module {0}."),Cannot_find_lib_definition_for_0:t(2726,e.DiagnosticCategory.Error,"Cannot_find_lib_definition_for_0_2726","Cannot find lib definition for '{0}'."),Cannot_find_lib_definition_for_0_Did_you_mean_1:t(2727,e.DiagnosticCategory.Error,"Cannot_find_lib_definition_for_0_Did_you_mean_1_2727","Cannot find lib definition for '{0}'. Did you mean '{1}'?"),_0_is_declared_here:t(2728,e.DiagnosticCategory.Message,"_0_is_declared_here_2728","'{0}' is declared here."),Property_0_is_used_before_its_initialization:t(2729,e.DiagnosticCategory.Error,"Property_0_is_used_before_its_initialization_2729","Property '{0}' is used before its initialization."),An_arrow_function_cannot_have_a_this_parameter:t(2730,e.DiagnosticCategory.Error,"An_arrow_function_cannot_have_a_this_parameter_2730","An arrow function cannot have a 'this' parameter."),Implicit_conversion_of_a_symbol_to_a_string_will_fail_at_runtime_Consider_wrapping_this_expression_in_String:t(2731,e.DiagnosticCategory.Error,"Implicit_conversion_of_a_symbol_to_a_string_will_fail_at_runtime_Consider_wrapping_this_expression_i_2731","Implicit conversion of a 'symbol' to a 'string' will fail at runtime. Consider wrapping this expression in 'String(...)'."),Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension:t(2732,e.DiagnosticCategory.Error,"Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension_2732","Cannot find module '{0}'. Consider using '--resolveJsonModule' to import module with '.json' extension."),Property_0_was_also_declared_here:t(2733,e.DiagnosticCategory.Error,"Property_0_was_also_declared_here_2733","Property '{0}' was also declared here."),Are_you_missing_a_semicolon:t(2734,e.DiagnosticCategory.Error,"Are_you_missing_a_semicolon_2734","Are you missing a semicolon?"),Did_you_mean_for_0_to_be_constrained_to_type_new_args_Colon_any_1:t(2735,e.DiagnosticCategory.Error,"Did_you_mean_for_0_to_be_constrained_to_type_new_args_Colon_any_1_2735","Did you mean for '{0}' to be constrained to type 'new (...args: any[]) => {1}'?"),Operator_0_cannot_be_applied_to_type_1:t(2736,e.DiagnosticCategory.Error,"Operator_0_cannot_be_applied_to_type_1_2736","Operator '{0}' cannot be applied to type '{1}'."),BigInt_literals_are_not_available_when_targeting_lower_than_ES2020:t(2737,e.DiagnosticCategory.Error,"BigInt_literals_are_not_available_when_targeting_lower_than_ES2020_2737","BigInt literals are not available when targeting lower than ES2020."),An_outer_value_of_this_is_shadowed_by_this_container:t(2738,e.DiagnosticCategory.Message,"An_outer_value_of_this_is_shadowed_by_this_container_2738","An outer value of 'this' is shadowed by this container."),Type_0_is_missing_the_following_properties_from_type_1_Colon_2:t(2739,e.DiagnosticCategory.Error,"Type_0_is_missing_the_following_properties_from_type_1_Colon_2_2739","Type '{0}' is missing the following properties from type '{1}': {2}"),Type_0_is_missing_the_following_properties_from_type_1_Colon_2_and_3_more:t(2740,e.DiagnosticCategory.Error,"Type_0_is_missing_the_following_properties_from_type_1_Colon_2_and_3_more_2740","Type '{0}' is missing the following properties from type '{1}': {2}, and {3} more."),Property_0_is_missing_in_type_1_but_required_in_type_2:t(2741,e.DiagnosticCategory.Error,"Property_0_is_missing_in_type_1_but_required_in_type_2_2741","Property '{0}' is missing in type '{1}' but required in type '{2}'."),The_inferred_type_of_0_cannot_be_named_without_a_reference_to_1_This_is_likely_not_portable_A_type_annotation_is_necessary:t(2742,e.DiagnosticCategory.Error,"The_inferred_type_of_0_cannot_be_named_without_a_reference_to_1_This_is_likely_not_portable_A_type_a_2742","The inferred type of '{0}' cannot be named without a reference to '{1}'. This is likely not portable. A type annotation is necessary."),No_overload_expects_0_type_arguments_but_overloads_do_exist_that_expect_either_1_or_2_type_arguments:t(2743,e.DiagnosticCategory.Error,"No_overload_expects_0_type_arguments_but_overloads_do_exist_that_expect_either_1_or_2_type_arguments_2743","No overload expects {0} type arguments, but overloads do exist that expect either {1} or {2} type arguments."),Type_parameter_defaults_can_only_reference_previously_declared_type_parameters:t(2744,e.DiagnosticCategory.Error,"Type_parameter_defaults_can_only_reference_previously_declared_type_parameters_2744","Type parameter defaults can only reference previously declared type parameters."),This_JSX_tag_s_0_prop_expects_type_1_which_requires_multiple_children_but_only_a_single_child_was_provided:t(2745,e.DiagnosticCategory.Error,"This_JSX_tag_s_0_prop_expects_type_1_which_requires_multiple_children_but_only_a_single_child_was_pr_2745","This JSX tag's '{0}' prop expects type '{1}' which requires multiple children, but only a single child was provided."),This_JSX_tag_s_0_prop_expects_a_single_child_of_type_1_but_multiple_children_were_provided:t(2746,e.DiagnosticCategory.Error,"This_JSX_tag_s_0_prop_expects_a_single_child_of_type_1_but_multiple_children_were_provided_2746","This JSX tag's '{0}' prop expects a single child of type '{1}', but multiple children were provided."),_0_components_don_t_accept_text_as_child_elements_Text_in_JSX_has_the_type_string_but_the_expected_type_of_1_is_2:t(2747,e.DiagnosticCategory.Error,"_0_components_don_t_accept_text_as_child_elements_Text_in_JSX_has_the_type_string_but_the_expected_t_2747","'{0}' components don't accept text as child elements. Text in JSX has the type 'string', but the expected type of '{1}' is '{2}'."),Cannot_access_ambient_const_enums_when_the_isolatedModules_flag_is_provided:t(2748,e.DiagnosticCategory.Error,"Cannot_access_ambient_const_enums_when_the_isolatedModules_flag_is_provided_2748","Cannot access ambient const enums when the '--isolatedModules' flag is provided."),_0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0:t(2749,e.DiagnosticCategory.Error,"_0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0_2749","'{0}' refers to a value, but is being used as a type here. Did you mean 'typeof {0}'?"),The_implementation_signature_is_declared_here:t(2750,e.DiagnosticCategory.Error,"The_implementation_signature_is_declared_here_2750","The implementation signature is declared here."),Circularity_originates_in_type_at_this_location:t(2751,e.DiagnosticCategory.Error,"Circularity_originates_in_type_at_this_location_2751","Circularity originates in type at this location."),The_first_export_default_is_here:t(2752,e.DiagnosticCategory.Error,"The_first_export_default_is_here_2752","The first export default is here."),Another_export_default_is_here:t(2753,e.DiagnosticCategory.Error,"Another_export_default_is_here_2753","Another export default is here."),super_may_not_use_type_arguments:t(2754,e.DiagnosticCategory.Error,"super_may_not_use_type_arguments_2754","'super' may not use type arguments."),No_constituent_of_type_0_is_callable:t(2755,e.DiagnosticCategory.Error,"No_constituent_of_type_0_is_callable_2755","No constituent of type '{0}' is callable."),Not_all_constituents_of_type_0_are_callable:t(2756,e.DiagnosticCategory.Error,"Not_all_constituents_of_type_0_are_callable_2756","Not all constituents of type '{0}' are callable."),Type_0_has_no_call_signatures:t(2757,e.DiagnosticCategory.Error,"Type_0_has_no_call_signatures_2757","Type '{0}' has no call signatures."),Each_member_of_the_union_type_0_has_signatures_but_none_of_those_signatures_are_compatible_with_each_other:t(2758,e.DiagnosticCategory.Error,"Each_member_of_the_union_type_0_has_signatures_but_none_of_those_signatures_are_compatible_with_each_2758","Each member of the union type '{0}' has signatures, but none of those signatures are compatible with each other."),No_constituent_of_type_0_is_constructable:t(2759,e.DiagnosticCategory.Error,"No_constituent_of_type_0_is_constructable_2759","No constituent of type '{0}' is constructable."),Not_all_constituents_of_type_0_are_constructable:t(2760,e.DiagnosticCategory.Error,"Not_all_constituents_of_type_0_are_constructable_2760","Not all constituents of type '{0}' are constructable."),Type_0_has_no_construct_signatures:t(2761,e.DiagnosticCategory.Error,"Type_0_has_no_construct_signatures_2761","Type '{0}' has no construct signatures."),Each_member_of_the_union_type_0_has_construct_signatures_but_none_of_those_signatures_are_compatible_with_each_other:t(2762,e.DiagnosticCategory.Error,"Each_member_of_the_union_type_0_has_construct_signatures_but_none_of_those_signatures_are_compatible_2762","Each member of the union type '{0}' has construct signatures, but none of those signatures are compatible with each other."),Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_for_of_will_always_send_0:t(2763,e.DiagnosticCategory.Error,"Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_for_of_will_always_s_2763","Cannot iterate value because the 'next' method of its iterator expects type '{1}', but for-of will always send '{0}'."),Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_array_spread_will_always_send_0:t(2764,e.DiagnosticCategory.Error,"Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_array_spread_will_al_2764","Cannot iterate value because the 'next' method of its iterator expects type '{1}', but array spread will always send '{0}'."),Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_array_destructuring_will_always_send_0:t(2765,e.DiagnosticCategory.Error,"Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_array_destructuring__2765","Cannot iterate value because the 'next' method of its iterator expects type '{1}', but array destructuring will always send '{0}'."),Cannot_delegate_iteration_to_value_because_the_next_method_of_its_iterator_expects_type_1_but_the_containing_generator_will_always_send_0:t(2766,e.DiagnosticCategory.Error,"Cannot_delegate_iteration_to_value_because_the_next_method_of_its_iterator_expects_type_1_but_the_co_2766","Cannot delegate iteration to value because the 'next' method of its iterator expects type '{1}', but the containing generator will always send '{0}'."),The_0_property_of_an_iterator_must_be_a_method:t(2767,e.DiagnosticCategory.Error,"The_0_property_of_an_iterator_must_be_a_method_2767","The '{0}' property of an iterator must be a method."),The_0_property_of_an_async_iterator_must_be_a_method:t(2768,e.DiagnosticCategory.Error,"The_0_property_of_an_async_iterator_must_be_a_method_2768","The '{0}' property of an async iterator must be a method."),No_overload_matches_this_call:t(2769,e.DiagnosticCategory.Error,"No_overload_matches_this_call_2769","No overload matches this call."),The_last_overload_gave_the_following_error:t(2770,e.DiagnosticCategory.Error,"The_last_overload_gave_the_following_error_2770","The last overload gave the following error."),The_last_overload_is_declared_here:t(2771,e.DiagnosticCategory.Error,"The_last_overload_is_declared_here_2771","The last overload is declared here."),Overload_0_of_1_2_gave_the_following_error:t(2772,e.DiagnosticCategory.Error,"Overload_0_of_1_2_gave_the_following_error_2772","Overload {0} of {1}, '{2}', gave the following error."),Did_you_forget_to_use_await:t(2773,e.DiagnosticCategory.Error,"Did_you_forget_to_use_await_2773","Did you forget to use 'await'?"),This_condition_will_always_return_true_since_this_function_is_always_defined_Did_you_mean_to_call_it_instead:t(2774,e.DiagnosticCategory.Error,"This_condition_will_always_return_true_since_this_function_is_always_defined_Did_you_mean_to_call_it_2774","This condition will always return true since this function is always defined. Did you mean to call it instead?"),Assertions_require_every_name_in_the_call_target_to_be_declared_with_an_explicit_type_annotation:t(2775,e.DiagnosticCategory.Error,"Assertions_require_every_name_in_the_call_target_to_be_declared_with_an_explicit_type_annotation_2775","Assertions require every name in the call target to be declared with an explicit type annotation."),Assertions_require_the_call_target_to_be_an_identifier_or_qualified_name:t(2776,e.DiagnosticCategory.Error,"Assertions_require_the_call_target_to_be_an_identifier_or_qualified_name_2776","Assertions require the call target to be an identifier or qualified name."),The_operand_of_an_increment_or_decrement_operator_may_not_be_an_optional_property_access:t(2777,e.DiagnosticCategory.Error,"The_operand_of_an_increment_or_decrement_operator_may_not_be_an_optional_property_access_2777","The operand of an increment or decrement operator may not be an optional property access."),The_target_of_an_object_rest_assignment_may_not_be_an_optional_property_access:t(2778,e.DiagnosticCategory.Error,"The_target_of_an_object_rest_assignment_may_not_be_an_optional_property_access_2778","The target of an object rest assignment may not be an optional property access."),The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access:t(2779,e.DiagnosticCategory.Error,"The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access_2779","The left-hand side of an assignment expression may not be an optional property access."),The_left_hand_side_of_a_for_in_statement_may_not_be_an_optional_property_access:t(2780,e.DiagnosticCategory.Error,"The_left_hand_side_of_a_for_in_statement_may_not_be_an_optional_property_access_2780","The left-hand side of a 'for...in' statement may not be an optional property access."),The_left_hand_side_of_a_for_of_statement_may_not_be_an_optional_property_access:t(2781,e.DiagnosticCategory.Error,"The_left_hand_side_of_a_for_of_statement_may_not_be_an_optional_property_access_2781","The left-hand side of a 'for...of' statement may not be an optional property access."),_0_needs_an_explicit_type_annotation:t(2782,e.DiagnosticCategory.Message,"_0_needs_an_explicit_type_annotation_2782","'{0}' needs an explicit type annotation."),_0_is_specified_more_than_once_so_this_usage_will_be_overwritten:t(2783,e.DiagnosticCategory.Error,"_0_is_specified_more_than_once_so_this_usage_will_be_overwritten_2783","'{0}' is specified more than once, so this usage will be overwritten."),get_and_set_accessors_cannot_declare_this_parameters:t(2784,e.DiagnosticCategory.Error,"get_and_set_accessors_cannot_declare_this_parameters_2784","'get' and 'set' accessors cannot declare 'this' parameters."),This_spread_always_overwrites_this_property:t(2785,e.DiagnosticCategory.Error,"This_spread_always_overwrites_this_property_2785","This spread always overwrites this property."),_0_cannot_be_used_as_a_JSX_component:t(2786,e.DiagnosticCategory.Error,"_0_cannot_be_used_as_a_JSX_component_2786","'{0}' cannot be used as a JSX component."),Its_return_type_0_is_not_a_valid_JSX_element:t(2787,e.DiagnosticCategory.Error,"Its_return_type_0_is_not_a_valid_JSX_element_2787","Its return type '{0}' is not a valid JSX element."),Its_instance_type_0_is_not_a_valid_JSX_element:t(2788,e.DiagnosticCategory.Error,"Its_instance_type_0_is_not_a_valid_JSX_element_2788","Its instance type '{0}' is not a valid JSX element."),Its_element_type_0_is_not_a_valid_JSX_element:t(2789,e.DiagnosticCategory.Error,"Its_element_type_0_is_not_a_valid_JSX_element_2789","Its element type '{0}' is not a valid JSX element."),The_operand_of_a_delete_operator_must_be_optional:t(2790,e.DiagnosticCategory.Error,"The_operand_of_a_delete_operator_must_be_optional_2790","The operand of a 'delete' operator must be optional."),Exponentiation_cannot_be_performed_on_bigint_values_unless_the_target_option_is_set_to_es2016_or_later:t(2791,e.DiagnosticCategory.Error,"Exponentiation_cannot_be_performed_on_bigint_values_unless_the_target_option_is_set_to_es2016_or_lat_2791","Exponentiation cannot be performed on 'bigint' values unless the 'target' option is set to 'es2016' or later."),Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_node_or_to_add_aliases_to_the_paths_option:t(2792,e.DiagnosticCategory.Error,"Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_node_or_to_add_aliases_to_th_2792","Cannot find module '{0}'. Did you mean to set the 'moduleResolution' option to 'node', or to add aliases to the 'paths' option?"),The_call_would_have_succeeded_against_this_implementation_but_implementation_signatures_of_overloads_are_not_externally_visible:t(2793,e.DiagnosticCategory.Error,"The_call_would_have_succeeded_against_this_implementation_but_implementation_signatures_of_overloads_2793","The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible."),Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise:t(2794,e.DiagnosticCategory.Error,"Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise_2794","Expected {0} arguments, but got {1}. Did you forget to include 'void' in your type argument to 'Promise'?"),The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types:t(2795,e.DiagnosticCategory.Error,"The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types_2795","The 'intrinsic' keyword can only be used to declare compiler provided intrinsic types."),It_is_likely_that_you_are_missing_a_comma_to_separate_these_two_template_expressions_They_form_a_tagged_template_expression_which_cannot_be_invoked:t(2796,e.DiagnosticCategory.Error,"It_is_likely_that_you_are_missing_a_comma_to_separate_these_two_template_expressions_They_form_a_tag_2796","It is likely that you are missing a comma to separate these two template expressions. They form a tagged template expression which cannot be invoked."),A_mixin_class_that_extends_from_a_type_variable_containing_an_abstract_construct_signature_must_also_be_declared_abstract:t(2797,e.DiagnosticCategory.Error,"A_mixin_class_that_extends_from_a_type_variable_containing_an_abstract_construct_signature_must_also_2797","A mixin class that extends from a type variable containing an abstract construct signature must also be declared 'abstract'."),The_declaration_was_marked_as_deprecated_here:t(2798,e.DiagnosticCategory.Error,"The_declaration_was_marked_as_deprecated_here_2798","The declaration was marked as deprecated here."),Type_produces_a_tuple_type_that_is_too_large_to_represent:t(2799,e.DiagnosticCategory.Error,"Type_produces_a_tuple_type_that_is_too_large_to_represent_2799","Type produces a tuple type that is too large to represent."),Expression_produces_a_tuple_type_that_is_too_large_to_represent:t(2800,e.DiagnosticCategory.Error,"Expression_produces_a_tuple_type_that_is_too_large_to_represent_2800","Expression produces a tuple type that is too large to represent."),This_condition_will_always_return_true_since_this_0_is_always_defined:t(2801,e.DiagnosticCategory.Error,"This_condition_will_always_return_true_since_this_0_is_always_defined_2801","This condition will always return true since this '{0}' is always defined."),Type_0_can_only_be_iterated_through_when_using_the_downlevelIteration_flag_or_with_a_target_of_es2015_or_higher:t(2802,e.DiagnosticCategory.Error,"Type_0_can_only_be_iterated_through_when_using_the_downlevelIteration_flag_or_with_a_target_of_es201_2802","Type '{0}' can only be iterated through when using the '--downlevelIteration' flag or with a '--target' of 'es2015' or higher."),Cannot_assign_to_private_method_0_Private_methods_are_not_writable:t(2803,e.DiagnosticCategory.Error,"Cannot_assign_to_private_method_0_Private_methods_are_not_writable_2803","Cannot assign to private method '{0}'. Private methods are not writable."),Duplicate_identifier_0_Static_and_instance_elements_cannot_share_the_same_private_name:t(2804,e.DiagnosticCategory.Error,"Duplicate_identifier_0_Static_and_instance_elements_cannot_share_the_same_private_name_2804","Duplicate identifier '{0}'. Static and instance elements cannot share the same private name."),Static_fields_with_private_names_can_t_have_initializers_when_the_useDefineForClassFields_flag_is_not_specified_with_a_target_of_esnext_Consider_adding_the_useDefineForClassFields_flag:t(2805,e.DiagnosticCategory.Error,"Static_fields_with_private_names_can_t_have_initializers_when_the_useDefineForClassFields_flag_is_no_2805","Static fields with private names can't have initializers when the '--useDefineForClassFields' flag is not specified with a '--target' of 'esnext'. Consider adding the '--useDefineForClassFields' flag."),Private_accessor_was_defined_without_a_getter:t(2806,e.DiagnosticCategory.Error,"Private_accessor_was_defined_without_a_getter_2806","Private accessor was defined without a getter."),This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_one_in_0_Consider_upgrading_your_version_of_0:t(2807,e.DiagnosticCategory.Error,"This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_o_2807","This syntax requires an imported helper named '{1}' with {2} parameters, which is not compatible with the one in '{0}'. Consider upgrading your version of '{0}'."),A_get_accessor_must_be_at_least_as_accessible_as_the_setter:t(2808,e.DiagnosticCategory.Error,"A_get_accessor_must_be_at_least_as_accessible_as_the_setter_2808","A get accessor must be at least as accessible as the setter"),Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_destructuring_assignment_you_might_need_to_wrap_the_the_whole_assignment_in_parentheses:t(2809,e.DiagnosticCategory.Error,"Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_d_2809","Declaration or statement expected. This '=' follows a block of statements, so if you intended to write a destructuring assignment, you might need to wrap the the whole assignment in parentheses."),Property_0_may_not_be_used_in_a_static_property_s_initializer_in_the_same_class_when_target_is_esnext_and_useDefineForClassFields_is_false:t(2810,e.DiagnosticCategory.Error,"Property_0_may_not_be_used_in_a_static_property_s_initializer_in_the_same_class_when_target_is_esnex_2810","Property '{0}' may not be used in a static property's initializer in the same class when 'target' is 'esnext' and 'useDefineForClassFields' is 'false'."),Initializer_for_property_0:t(2811,e.DiagnosticCategory.Error,"Initializer_for_property_0_2811","Initializer for property '{0}'"),Property_0_does_not_exist_on_type_1_Try_changing_the_lib_compiler_option_to_include_dom:t(2812,e.DiagnosticCategory.Error,"Property_0_does_not_exist_on_type_1_Try_changing_the_lib_compiler_option_to_include_dom_2812","Property '{0}' does not exist on type '{1}'. Try changing the 'lib' compiler option to include 'dom'."),Class_declaration_cannot_implement_overload_list_for_0:t(2813,e.DiagnosticCategory.Error,"Class_declaration_cannot_implement_overload_list_for_0_2813","Class declaration cannot implement overload list for '{0}'."),Function_with_bodies_can_only_merge_with_classes_that_are_ambient:t(2814,e.DiagnosticCategory.Error,"Function_with_bodies_can_only_merge_with_classes_that_are_ambient_2814","Function with bodies can only merge with classes that are ambient."),arguments_cannot_be_referenced_in_property_initializers:t(2815,e.DiagnosticCategory.Error,"arguments_cannot_be_referenced_in_property_initializers_2815","'arguments' cannot be referenced in property initializers."),Cannot_use_this_in_a_static_property_initializer_of_a_decorated_class:t(2816,e.DiagnosticCategory.Error,"Cannot_use_this_in_a_static_property_initializer_of_a_decorated_class_2816","Cannot use 'this' in a static property initializer of a decorated class."),Property_0_has_no_initializer_and_is_not_definitely_assigned_in_a_class_static_block:t(2817,e.DiagnosticCategory.Error,"Property_0_has_no_initializer_and_is_not_definitely_assigned_in_a_class_static_block_2817","Property '{0}' has no initializer and is not definitely assigned in a class static block."),Duplicate_identifier_0_Compiler_reserves_name_1_when_emitting_super_references_in_static_initializers:t(2818,e.DiagnosticCategory.Error,"Duplicate_identifier_0_Compiler_reserves_name_1_when_emitting_super_references_in_static_initializer_2818","Duplicate identifier '{0}'. Compiler reserves name '{1}' when emitting 'super' references in static initializers."),Namespace_name_cannot_be_0:t(2819,e.DiagnosticCategory.Error,"Namespace_name_cannot_be_0_2819","Namespace name cannot be '{0}'."),Type_0_is_not_assignable_to_type_1_Did_you_mean_2:t(2820,e.DiagnosticCategory.Error,"Type_0_is_not_assignable_to_type_1_Did_you_mean_2_2820","Type '{0}' is not assignable to type '{1}'. Did you mean '{2}'?"),Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext:t(2821,e.DiagnosticCategory.Error,"Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_2821","Import assertions are only supported when the '--module' option is set to 'esnext'."),Import_assertions_cannot_be_used_with_type_only_imports_or_exports:t(2822,e.DiagnosticCategory.Error,"Import_assertions_cannot_be_used_with_type_only_imports_or_exports_2822","Import assertions cannot be used with type-only imports or exports."),Cannot_find_namespace_0_Did_you_mean_1:t(2833,e.DiagnosticCategory.Error,"Cannot_find_namespace_0_Did_you_mean_1_2833","Cannot find namespace '{0}'. Did you mean '{1}'?"),Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_node12_or_nodenext_Consider_adding_an_extension_to_the_import_path:t(2834,e.DiagnosticCategory.Error,"Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_n_2834","Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path."),Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_node12_or_nodenext_Did_you_mean_0:t(2835,e.DiagnosticCategory.Error,"Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_n_2835","Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean '{0}'?"),Import_declaration_0_is_using_private_name_1:t(4e3,e.DiagnosticCategory.Error,"Import_declaration_0_is_using_private_name_1_4000","Import declaration '{0}' is using private name '{1}'."),Type_parameter_0_of_exported_class_has_or_is_using_private_name_1:t(4002,e.DiagnosticCategory.Error,"Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002","Type parameter '{0}' of exported class has or is using private name '{1}'."),Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1:t(4004,e.DiagnosticCategory.Error,"Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004","Type parameter '{0}' of exported interface has or is using private name '{1}'."),Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1:t(4006,e.DiagnosticCategory.Error,"Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1_4006","Type parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'."),Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1:t(4008,e.DiagnosticCategory.Error,"Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1_4008","Type parameter '{0}' of call signature from exported interface has or is using private name '{1}'."),Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1:t(4010,e.DiagnosticCategory.Error,"Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1_4010","Type parameter '{0}' of public static method from exported class has or is using private name '{1}'."),Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1:t(4012,e.DiagnosticCategory.Error,"Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1_4012","Type parameter '{0}' of public method from exported class has or is using private name '{1}'."),Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1:t(4014,e.DiagnosticCategory.Error,"Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1_4014","Type parameter '{0}' of method from exported interface has or is using private name '{1}'."),Type_parameter_0_of_exported_function_has_or_is_using_private_name_1:t(4016,e.DiagnosticCategory.Error,"Type_parameter_0_of_exported_function_has_or_is_using_private_name_1_4016","Type parameter '{0}' of exported function has or is using private name '{1}'."),Implements_clause_of_exported_class_0_has_or_is_using_private_name_1:t(4019,e.DiagnosticCategory.Error,"Implements_clause_of_exported_class_0_has_or_is_using_private_name_1_4019","Implements clause of exported class '{0}' has or is using private name '{1}'."),extends_clause_of_exported_class_0_has_or_is_using_private_name_1:t(4020,e.DiagnosticCategory.Error,"extends_clause_of_exported_class_0_has_or_is_using_private_name_1_4020","'extends' clause of exported class '{0}' has or is using private name '{1}'."),extends_clause_of_exported_class_has_or_is_using_private_name_0:t(4021,e.DiagnosticCategory.Error,"extends_clause_of_exported_class_has_or_is_using_private_name_0_4021","'extends' clause of exported class has or is using private name '{0}'."),extends_clause_of_exported_interface_0_has_or_is_using_private_name_1:t(4022,e.DiagnosticCategory.Error,"extends_clause_of_exported_interface_0_has_or_is_using_private_name_1_4022","'extends' clause of exported interface '{0}' has or is using private name '{1}'."),Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:t(4023,e.DiagnosticCategory.Error,"Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4023","Exported variable '{0}' has or is using name '{1}' from external module {2} but cannot be named."),Exported_variable_0_has_or_is_using_name_1_from_private_module_2:t(4024,e.DiagnosticCategory.Error,"Exported_variable_0_has_or_is_using_name_1_from_private_module_2_4024","Exported variable '{0}' has or is using name '{1}' from private module '{2}'."),Exported_variable_0_has_or_is_using_private_name_1:t(4025,e.DiagnosticCategory.Error,"Exported_variable_0_has_or_is_using_private_name_1_4025","Exported variable '{0}' has or is using private name '{1}'."),Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:t(4026,e.DiagnosticCategory.Error,"Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot__4026","Public static property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named."),Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2:t(4027,e.DiagnosticCategory.Error,"Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2_4027","Public static property '{0}' of exported class has or is using name '{1}' from private module '{2}'."),Public_static_property_0_of_exported_class_has_or_is_using_private_name_1:t(4028,e.DiagnosticCategory.Error,"Public_static_property_0_of_exported_class_has_or_is_using_private_name_1_4028","Public static property '{0}' of exported class has or is using private name '{1}'."),Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:t(4029,e.DiagnosticCategory.Error,"Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_name_4029","Public property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named."),Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2:t(4030,e.DiagnosticCategory.Error,"Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2_4030","Public property '{0}' of exported class has or is using name '{1}' from private module '{2}'."),Public_property_0_of_exported_class_has_or_is_using_private_name_1:t(4031,e.DiagnosticCategory.Error,"Public_property_0_of_exported_class_has_or_is_using_private_name_1_4031","Public property '{0}' of exported class has or is using private name '{1}'."),Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2:t(4032,e.DiagnosticCategory.Error,"Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2_4032","Property '{0}' of exported interface has or is using name '{1}' from private module '{2}'."),Property_0_of_exported_interface_has_or_is_using_private_name_1:t(4033,e.DiagnosticCategory.Error,"Property_0_of_exported_interface_has_or_is_using_private_name_1_4033","Property '{0}' of exported interface has or is using private name '{1}'."),Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2:t(4034,e.DiagnosticCategory.Error,"Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_name_1_from_private_mod_4034","Parameter type of public static setter '{0}' from exported class has or is using name '{1}' from private module '{2}'."),Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_private_name_1:t(4035,e.DiagnosticCategory.Error,"Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_private_name_1_4035","Parameter type of public static setter '{0}' from exported class has or is using private name '{1}'."),Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2:t(4036,e.DiagnosticCategory.Error,"Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2_4036","Parameter type of public setter '{0}' from exported class has or is using name '{1}' from private module '{2}'."),Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_private_name_1:t(4037,e.DiagnosticCategory.Error,"Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_private_name_1_4037","Parameter type of public setter '{0}' from exported class has or is using private name '{1}'."),Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:t(4038,e.DiagnosticCategory.Error,"Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_external_modul_4038","Return type of public static getter '{0}' from exported class has or is using name '{1}' from external module {2} but cannot be named."),Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2:t(4039,e.DiagnosticCategory.Error,"Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_4039","Return type of public static getter '{0}' from exported class has or is using name '{1}' from private module '{2}'."),Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_private_name_1:t(4040,e.DiagnosticCategory.Error,"Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_private_name_1_4040","Return type of public static getter '{0}' from exported class has or is using private name '{1}'."),Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:t(4041,e.DiagnosticCategory.Error,"Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_4041","Return type of public getter '{0}' from exported class has or is using name '{1}' from external module {2} but cannot be named."),Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2:t(4042,e.DiagnosticCategory.Error,"Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2_4042","Return type of public getter '{0}' from exported class has or is using name '{1}' from private module '{2}'."),Return_type_of_public_getter_0_from_exported_class_has_or_is_using_private_name_1:t(4043,e.DiagnosticCategory.Error,"Return_type_of_public_getter_0_from_exported_class_has_or_is_using_private_name_1_4043","Return type of public getter '{0}' from exported class has or is using private name '{1}'."),Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1:t(4044,e.DiagnosticCategory.Error,"Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_mod_4044","Return type of constructor signature from exported interface has or is using name '{0}' from private module '{1}'."),Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0:t(4045,e.DiagnosticCategory.Error,"Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0_4045","Return type of constructor signature from exported interface has or is using private name '{0}'."),Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1:t(4046,e.DiagnosticCategory.Error,"Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1_4046","Return type of call signature from exported interface has or is using name '{0}' from private module '{1}'."),Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0:t(4047,e.DiagnosticCategory.Error,"Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0_4047","Return type of call signature from exported interface has or is using private name '{0}'."),Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1:t(4048,e.DiagnosticCategory.Error,"Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1_4048","Return type of index signature from exported interface has or is using name '{0}' from private module '{1}'."),Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0:t(4049,e.DiagnosticCategory.Error,"Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0_4049","Return type of index signature from exported interface has or is using private name '{0}'."),Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named:t(4050,e.DiagnosticCategory.Error,"Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module__4050","Return type of public static method from exported class has or is using name '{0}' from external module {1} but cannot be named."),Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1:t(4051,e.DiagnosticCategory.Error,"Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1_4051","Return type of public static method from exported class has or is using name '{0}' from private module '{1}'."),Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0:t(4052,e.DiagnosticCategory.Error,"Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0_4052","Return type of public static method from exported class has or is using private name '{0}'."),Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named:t(4053,e.DiagnosticCategory.Error,"Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_c_4053","Return type of public method from exported class has or is using name '{0}' from external module {1} but cannot be named."),Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1:t(4054,e.DiagnosticCategory.Error,"Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1_4054","Return type of public method from exported class has or is using name '{0}' from private module '{1}'."),Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0:t(4055,e.DiagnosticCategory.Error,"Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0_4055","Return type of public method from exported class has or is using private name '{0}'."),Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1:t(4056,e.DiagnosticCategory.Error,"Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1_4056","Return type of method from exported interface has or is using name '{0}' from private module '{1}'."),Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0:t(4057,e.DiagnosticCategory.Error,"Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0_4057","Return type of method from exported interface has or is using private name '{0}'."),Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named:t(4058,e.DiagnosticCategory.Error,"Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named_4058","Return type of exported function has or is using name '{0}' from external module {1} but cannot be named."),Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1:t(4059,e.DiagnosticCategory.Error,"Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1_4059","Return type of exported function has or is using name '{0}' from private module '{1}'."),Return_type_of_exported_function_has_or_is_using_private_name_0:t(4060,e.DiagnosticCategory.Error,"Return_type_of_exported_function_has_or_is_using_private_name_0_4060","Return type of exported function has or is using private name '{0}'."),Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:t(4061,e.DiagnosticCategory.Error,"Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_can_4061","Parameter '{0}' of constructor from exported class has or is using name '{1}' from external module {2} but cannot be named."),Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2:t(4062,e.DiagnosticCategory.Error,"Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2_4062","Parameter '{0}' of constructor from exported class has or is using name '{1}' from private module '{2}'."),Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1:t(4063,e.DiagnosticCategory.Error,"Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1_4063","Parameter '{0}' of constructor from exported class has or is using private name '{1}'."),Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2:t(4064,e.DiagnosticCategory.Error,"Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_mod_4064","Parameter '{0}' of constructor signature from exported interface has or is using name '{1}' from private module '{2}'."),Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1:t(4065,e.DiagnosticCategory.Error,"Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1_4065","Parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'."),Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2:t(4066,e.DiagnosticCategory.Error,"Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2_4066","Parameter '{0}' of call signature from exported interface has or is using name '{1}' from private module '{2}'."),Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1:t(4067,e.DiagnosticCategory.Error,"Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1_4067","Parameter '{0}' of call signature from exported interface has or is using private name '{1}'."),Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:t(4068,e.DiagnosticCategory.Error,"Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module__4068","Parameter '{0}' of public static method from exported class has or is using name '{1}' from external module {2} but cannot be named."),Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2:t(4069,e.DiagnosticCategory.Error,"Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2_4069","Parameter '{0}' of public static method from exported class has or is using name '{1}' from private module '{2}'."),Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1:t(4070,e.DiagnosticCategory.Error,"Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1_4070","Parameter '{0}' of public static method from exported class has or is using private name '{1}'."),Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:t(4071,e.DiagnosticCategory.Error,"Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_c_4071","Parameter '{0}' of public method from exported class has or is using name '{1}' from external module {2} but cannot be named."),Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2:t(4072,e.DiagnosticCategory.Error,"Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2_4072","Parameter '{0}' of public method from exported class has or is using name '{1}' from private module '{2}'."),Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1:t(4073,e.DiagnosticCategory.Error,"Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1_4073","Parameter '{0}' of public method from exported class has or is using private name '{1}'."),Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2:t(4074,e.DiagnosticCategory.Error,"Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2_4074","Parameter '{0}' of method from exported interface has or is using name '{1}' from private module '{2}'."),Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1:t(4075,e.DiagnosticCategory.Error,"Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1_4075","Parameter '{0}' of method from exported interface has or is using private name '{1}'."),Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:t(4076,e.DiagnosticCategory.Error,"Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4076","Parameter '{0}' of exported function has or is using name '{1}' from external module {2} but cannot be named."),Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2:t(4077,e.DiagnosticCategory.Error,"Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2_4077","Parameter '{0}' of exported function has or is using name '{1}' from private module '{2}'."),Parameter_0_of_exported_function_has_or_is_using_private_name_1:t(4078,e.DiagnosticCategory.Error,"Parameter_0_of_exported_function_has_or_is_using_private_name_1_4078","Parameter '{0}' of exported function has or is using private name '{1}'."),Exported_type_alias_0_has_or_is_using_private_name_1:t(4081,e.DiagnosticCategory.Error,"Exported_type_alias_0_has_or_is_using_private_name_1_4081","Exported type alias '{0}' has or is using private name '{1}'."),Default_export_of_the_module_has_or_is_using_private_name_0:t(4082,e.DiagnosticCategory.Error,"Default_export_of_the_module_has_or_is_using_private_name_0_4082","Default export of the module has or is using private name '{0}'."),Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1:t(4083,e.DiagnosticCategory.Error,"Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1_4083","Type parameter '{0}' of exported type alias has or is using private name '{1}'."),Exported_type_alias_0_has_or_is_using_private_name_1_from_module_2:t(4084,e.DiagnosticCategory.Error,"Exported_type_alias_0_has_or_is_using_private_name_1_from_module_2_4084","Exported type alias '{0}' has or is using private name '{1}' from module {2}."),Conflicting_definitions_for_0_found_at_1_and_2_Consider_installing_a_specific_version_of_this_library_to_resolve_the_conflict:t(4090,e.DiagnosticCategory.Error,"Conflicting_definitions_for_0_found_at_1_and_2_Consider_installing_a_specific_version_of_this_librar_4090","Conflicting definitions for '{0}' found at '{1}' and '{2}'. Consider installing a specific version of this library to resolve the conflict."),Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2:t(4091,e.DiagnosticCategory.Error,"Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2_4091","Parameter '{0}' of index signature from exported interface has or is using name '{1}' from private module '{2}'."),Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1:t(4092,e.DiagnosticCategory.Error,"Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1_4092","Parameter '{0}' of index signature from exported interface has or is using private name '{1}'."),Property_0_of_exported_class_expression_may_not_be_private_or_protected:t(4094,e.DiagnosticCategory.Error,"Property_0_of_exported_class_expression_may_not_be_private_or_protected_4094","Property '{0}' of exported class expression may not be private or protected."),Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:t(4095,e.DiagnosticCategory.Error,"Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_4095","Public static method '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named."),Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2:t(4096,e.DiagnosticCategory.Error,"Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2_4096","Public static method '{0}' of exported class has or is using name '{1}' from private module '{2}'."),Public_static_method_0_of_exported_class_has_or_is_using_private_name_1:t(4097,e.DiagnosticCategory.Error,"Public_static_method_0_of_exported_class_has_or_is_using_private_name_1_4097","Public static method '{0}' of exported class has or is using private name '{1}'."),Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:t(4098,e.DiagnosticCategory.Error,"Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4098","Public method '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named."),Public_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2:t(4099,e.DiagnosticCategory.Error,"Public_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2_4099","Public method '{0}' of exported class has or is using name '{1}' from private module '{2}'."),Public_method_0_of_exported_class_has_or_is_using_private_name_1:t(4100,e.DiagnosticCategory.Error,"Public_method_0_of_exported_class_has_or_is_using_private_name_1_4100","Public method '{0}' of exported class has or is using private name '{1}'."),Method_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2:t(4101,e.DiagnosticCategory.Error,"Method_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2_4101","Method '{0}' of exported interface has or is using name '{1}' from private module '{2}'."),Method_0_of_exported_interface_has_or_is_using_private_name_1:t(4102,e.DiagnosticCategory.Error,"Method_0_of_exported_interface_has_or_is_using_private_name_1_4102","Method '{0}' of exported interface has or is using private name '{1}'."),Type_parameter_0_of_exported_mapped_object_type_is_using_private_name_1:t(4103,e.DiagnosticCategory.Error,"Type_parameter_0_of_exported_mapped_object_type_is_using_private_name_1_4103","Type parameter '{0}' of exported mapped object type is using private name '{1}'."),The_type_0_is_readonly_and_cannot_be_assigned_to_the_mutable_type_1:t(4104,e.DiagnosticCategory.Error,"The_type_0_is_readonly_and_cannot_be_assigned_to_the_mutable_type_1_4104","The type '{0}' is 'readonly' and cannot be assigned to the mutable type '{1}'."),Private_or_protected_member_0_cannot_be_accessed_on_a_type_parameter:t(4105,e.DiagnosticCategory.Error,"Private_or_protected_member_0_cannot_be_accessed_on_a_type_parameter_4105","Private or protected member '{0}' cannot be accessed on a type parameter."),Parameter_0_of_accessor_has_or_is_using_private_name_1:t(4106,e.DiagnosticCategory.Error,"Parameter_0_of_accessor_has_or_is_using_private_name_1_4106","Parameter '{0}' of accessor has or is using private name '{1}'."),Parameter_0_of_accessor_has_or_is_using_name_1_from_private_module_2:t(4107,e.DiagnosticCategory.Error,"Parameter_0_of_accessor_has_or_is_using_name_1_from_private_module_2_4107","Parameter '{0}' of accessor has or is using name '{1}' from private module '{2}'."),Parameter_0_of_accessor_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:t(4108,e.DiagnosticCategory.Error,"Parameter_0_of_accessor_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4108","Parameter '{0}' of accessor has or is using name '{1}' from external module '{2}' but cannot be named."),Type_arguments_for_0_circularly_reference_themselves:t(4109,e.DiagnosticCategory.Error,"Type_arguments_for_0_circularly_reference_themselves_4109","Type arguments for '{0}' circularly reference themselves."),Tuple_type_arguments_circularly_reference_themselves:t(4110,e.DiagnosticCategory.Error,"Tuple_type_arguments_circularly_reference_themselves_4110","Tuple type arguments circularly reference themselves."),Property_0_comes_from_an_index_signature_so_it_must_be_accessed_with_0:t(4111,e.DiagnosticCategory.Error,"Property_0_comes_from_an_index_signature_so_it_must_be_accessed_with_0_4111","Property '{0}' comes from an index signature, so it must be accessed with ['{0}']."),This_member_cannot_have_an_override_modifier_because_its_containing_class_0_does_not_extend_another_class:t(4112,e.DiagnosticCategory.Error,"This_member_cannot_have_an_override_modifier_because_its_containing_class_0_does_not_extend_another__4112","This member cannot have an 'override' modifier because its containing class '{0}' does not extend another class."),This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0:t(4113,e.DiagnosticCategory.Error,"This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0_4113","This member cannot have an 'override' modifier because it is not declared in the base class '{0}'."),This_member_must_have_an_override_modifier_because_it_overrides_a_member_in_the_base_class_0:t(4114,e.DiagnosticCategory.Error,"This_member_must_have_an_override_modifier_because_it_overrides_a_member_in_the_base_class_0_4114","This member must have an 'override' modifier because it overrides a member in the base class '{0}'."),This_parameter_property_must_have_an_override_modifier_because_it_overrides_a_member_in_base_class_0:t(4115,e.DiagnosticCategory.Error,"This_parameter_property_must_have_an_override_modifier_because_it_overrides_a_member_in_base_class_0_4115","This parameter property must have an 'override' modifier because it overrides a member in base class '{0}'."),This_member_must_have_an_override_modifier_because_it_overrides_an_abstract_method_that_is_declared_in_the_base_class_0:t(4116,e.DiagnosticCategory.Error,"This_member_must_have_an_override_modifier_because_it_overrides_an_abstract_method_that_is_declared__4116","This member must have an 'override' modifier because it overrides an abstract method that is declared in the base class '{0}'."),This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1:t(4117,e.DiagnosticCategory.Error,"This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0_Did_you__4117","This member cannot have an 'override' modifier because it is not declared in the base class '{0}'. Did you mean '{1}'?"),The_type_of_this_node_cannot_be_serialized_because_its_property_0_cannot_be_serialized:t(4118,e.DiagnosticCategory.Error,"The_type_of_this_node_cannot_be_serialized_because_its_property_0_cannot_be_serialized_4118","The type of this node cannot be serialized because its property '{0}' cannot be serialized."),This_member_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0:t(4119,e.DiagnosticCategory.Error,"This_member_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_4119","This member must have a JSDoc comment with an '@override' tag because it overrides a member in the base class '{0}'."),This_parameter_property_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0:t(4120,e.DiagnosticCategory.Error,"This_parameter_property_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_4120","This parameter property must have a JSDoc comment with an '@override' tag because it overrides a member in the base class '{0}'."),This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_containing_class_0_does_not_extend_another_class:t(4121,e.DiagnosticCategory.Error,"This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_containing_class_0_does_not_4121","This member cannot have a JSDoc comment with an '@override' tag because its containing class '{0}' does not extend another class."),This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0:t(4122,e.DiagnosticCategory.Error,"This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base__4122","This member cannot have a JSDoc comment with an '@override' tag because it is not declared in the base class '{0}'."),This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1:t(4123,e.DiagnosticCategory.Error,"This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base__4123","This member cannot have a JSDoc comment with an 'override' tag because it is not declared in the base class '{0}'. Did you mean '{1}'?"),Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next:t(4124,e.DiagnosticCategory.Error,"Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_w_4124","Compiler option '{0}' of value '{1}' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'."),The_current_host_does_not_support_the_0_option:t(5001,e.DiagnosticCategory.Error,"The_current_host_does_not_support_the_0_option_5001","The current host does not support the '{0}' option."),Cannot_find_the_common_subdirectory_path_for_the_input_files:t(5009,e.DiagnosticCategory.Error,"Cannot_find_the_common_subdirectory_path_for_the_input_files_5009","Cannot find the common subdirectory path for the input files."),File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0:t(5010,e.DiagnosticCategory.Error,"File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0_5010","File specification cannot end in a recursive directory wildcard ('**'): '{0}'."),Cannot_read_file_0_Colon_1:t(5012,e.DiagnosticCategory.Error,"Cannot_read_file_0_Colon_1_5012","Cannot read file '{0}': {1}."),Failed_to_parse_file_0_Colon_1:t(5014,e.DiagnosticCategory.Error,"Failed_to_parse_file_0_Colon_1_5014","Failed to parse file '{0}': {1}."),Unknown_compiler_option_0:t(5023,e.DiagnosticCategory.Error,"Unknown_compiler_option_0_5023","Unknown compiler option '{0}'."),Compiler_option_0_requires_a_value_of_type_1:t(5024,e.DiagnosticCategory.Error,"Compiler_option_0_requires_a_value_of_type_1_5024","Compiler option '{0}' requires a value of type {1}."),Unknown_compiler_option_0_Did_you_mean_1:t(5025,e.DiagnosticCategory.Error,"Unknown_compiler_option_0_Did_you_mean_1_5025","Unknown compiler option '{0}'. Did you mean '{1}'?"),Could_not_write_file_0_Colon_1:t(5033,e.DiagnosticCategory.Error,"Could_not_write_file_0_Colon_1_5033","Could not write file '{0}': {1}."),Option_project_cannot_be_mixed_with_source_files_on_a_command_line:t(5042,e.DiagnosticCategory.Error,"Option_project_cannot_be_mixed_with_source_files_on_a_command_line_5042","Option 'project' cannot be mixed with source files on a command line."),Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES2015_or_higher:t(5047,e.DiagnosticCategory.Error,"Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES_5047","Option 'isolatedModules' can only be used when either option '--module' is provided or option 'target' is 'ES2015' or higher."),Option_0_cannot_be_specified_when_option_target_is_ES3:t(5048,e.DiagnosticCategory.Error,"Option_0_cannot_be_specified_when_option_target_is_ES3_5048","Option '{0}' cannot be specified when option 'target' is 'ES3'."),Option_0_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided:t(5051,e.DiagnosticCategory.Error,"Option_0_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided_5051","Option '{0} can only be used when either option '--inlineSourceMap' or option '--sourceMap' is provided."),Option_0_cannot_be_specified_without_specifying_option_1:t(5052,e.DiagnosticCategory.Error,"Option_0_cannot_be_specified_without_specifying_option_1_5052","Option '{0}' cannot be specified without specifying option '{1}'."),Option_0_cannot_be_specified_with_option_1:t(5053,e.DiagnosticCategory.Error,"Option_0_cannot_be_specified_with_option_1_5053","Option '{0}' cannot be specified with option '{1}'."),A_tsconfig_json_file_is_already_defined_at_Colon_0:t(5054,e.DiagnosticCategory.Error,"A_tsconfig_json_file_is_already_defined_at_Colon_0_5054","A 'tsconfig.json' file is already defined at: '{0}'."),Cannot_write_file_0_because_it_would_overwrite_input_file:t(5055,e.DiagnosticCategory.Error,"Cannot_write_file_0_because_it_would_overwrite_input_file_5055","Cannot write file '{0}' because it would overwrite input file."),Cannot_write_file_0_because_it_would_be_overwritten_by_multiple_input_files:t(5056,e.DiagnosticCategory.Error,"Cannot_write_file_0_because_it_would_be_overwritten_by_multiple_input_files_5056","Cannot write file '{0}' because it would be overwritten by multiple input files."),Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0:t(5057,e.DiagnosticCategory.Error,"Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0_5057","Cannot find a tsconfig.json file at the specified directory: '{0}'."),The_specified_path_does_not_exist_Colon_0:t(5058,e.DiagnosticCategory.Error,"The_specified_path_does_not_exist_Colon_0_5058","The specified path does not exist: '{0}'."),Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier:t(5059,e.DiagnosticCategory.Error,"Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier_5059","Invalid value for '--reactNamespace'. '{0}' is not a valid identifier."),Pattern_0_can_have_at_most_one_Asterisk_character:t(5061,e.DiagnosticCategory.Error,"Pattern_0_can_have_at_most_one_Asterisk_character_5061","Pattern '{0}' can have at most one '*' character."),Substitution_0_in_pattern_1_can_have_at_most_one_Asterisk_character:t(5062,e.DiagnosticCategory.Error,"Substitution_0_in_pattern_1_can_have_at_most_one_Asterisk_character_5062","Substitution '{0}' in pattern '{1}' can have at most one '*' character."),Substitutions_for_pattern_0_should_be_an_array:t(5063,e.DiagnosticCategory.Error,"Substitutions_for_pattern_0_should_be_an_array_5063","Substitutions for pattern '{0}' should be an array."),Substitution_0_for_pattern_1_has_incorrect_type_expected_string_got_2:t(5064,e.DiagnosticCategory.Error,"Substitution_0_for_pattern_1_has_incorrect_type_expected_string_got_2_5064","Substitution '{0}' for pattern '{1}' has incorrect type, expected 'string', got '{2}'."),File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0:t(5065,e.DiagnosticCategory.Error,"File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildca_5065","File specification cannot contain a parent directory ('..') that appears after a recursive directory wildcard ('**'): '{0}'."),Substitutions_for_pattern_0_shouldn_t_be_an_empty_array:t(5066,e.DiagnosticCategory.Error,"Substitutions_for_pattern_0_shouldn_t_be_an_empty_array_5066","Substitutions for pattern '{0}' shouldn't be an empty array."),Invalid_value_for_jsxFactory_0_is_not_a_valid_identifier_or_qualified_name:t(5067,e.DiagnosticCategory.Error,"Invalid_value_for_jsxFactory_0_is_not_a_valid_identifier_or_qualified_name_5067","Invalid value for 'jsxFactory'. '{0}' is not a valid identifier or qualified-name."),Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript_files_Learn_more_at_https_Colon_Slash_Slashaka_ms_Slashtsconfig:t(5068,e.DiagnosticCategory.Error,"Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__5068","Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig."),Option_0_cannot_be_specified_without_specifying_option_1_or_option_2:t(5069,e.DiagnosticCategory.Error,"Option_0_cannot_be_specified_without_specifying_option_1_or_option_2_5069","Option '{0}' cannot be specified without specifying option '{1}' or option '{2}'."),Option_resolveJsonModule_cannot_be_specified_without_node_module_resolution_strategy:t(5070,e.DiagnosticCategory.Error,"Option_resolveJsonModule_cannot_be_specified_without_node_module_resolution_strategy_5070","Option '--resolveJsonModule' cannot be specified without 'node' module resolution strategy."),Option_resolveJsonModule_can_only_be_specified_when_module_code_generation_is_commonjs_amd_es2015_or_esNext:t(5071,e.DiagnosticCategory.Error,"Option_resolveJsonModule_can_only_be_specified_when_module_code_generation_is_commonjs_amd_es2015_or_5071","Option '--resolveJsonModule' can only be specified when module code generation is 'commonjs', 'amd', 'es2015' or 'esNext'."),Unknown_build_option_0:t(5072,e.DiagnosticCategory.Error,"Unknown_build_option_0_5072","Unknown build option '{0}'."),Build_option_0_requires_a_value_of_type_1:t(5073,e.DiagnosticCategory.Error,"Build_option_0_requires_a_value_of_type_1_5073","Build option '{0}' requires a value of type {1}."),Option_incremental_can_only_be_specified_using_tsconfig_emitting_to_single_file_or_when_option_tsBuildInfoFile_is_specified:t(5074,e.DiagnosticCategory.Error,"Option_incremental_can_only_be_specified_using_tsconfig_emitting_to_single_file_or_when_option_tsBui_5074","Option '--incremental' can only be specified using tsconfig, emitting to single file or when option '--tsBuildInfoFile' is specified."),_0_is_assignable_to_the_constraint_of_type_1_but_1_could_be_instantiated_with_a_different_subtype_of_constraint_2:t(5075,e.DiagnosticCategory.Error,"_0_is_assignable_to_the_constraint_of_type_1_but_1_could_be_instantiated_with_a_different_subtype_of_5075","'{0}' is assignable to the constraint of type '{1}', but '{1}' could be instantiated with a different subtype of constraint '{2}'."),_0_and_1_operations_cannot_be_mixed_without_parentheses:t(5076,e.DiagnosticCategory.Error,"_0_and_1_operations_cannot_be_mixed_without_parentheses_5076","'{0}' and '{1}' operations cannot be mixed without parentheses."),Unknown_build_option_0_Did_you_mean_1:t(5077,e.DiagnosticCategory.Error,"Unknown_build_option_0_Did_you_mean_1_5077","Unknown build option '{0}'. Did you mean '{1}'?"),Unknown_watch_option_0:t(5078,e.DiagnosticCategory.Error,"Unknown_watch_option_0_5078","Unknown watch option '{0}'."),Unknown_watch_option_0_Did_you_mean_1:t(5079,e.DiagnosticCategory.Error,"Unknown_watch_option_0_Did_you_mean_1_5079","Unknown watch option '{0}'. Did you mean '{1}'?"),Watch_option_0_requires_a_value_of_type_1:t(5080,e.DiagnosticCategory.Error,"Watch_option_0_requires_a_value_of_type_1_5080","Watch option '{0}' requires a value of type {1}."),Cannot_find_a_tsconfig_json_file_at_the_current_directory_Colon_0:t(5081,e.DiagnosticCategory.Error,"Cannot_find_a_tsconfig_json_file_at_the_current_directory_Colon_0_5081","Cannot find a tsconfig.json file at the current directory: {0}."),_0_could_be_instantiated_with_an_arbitrary_type_which_could_be_unrelated_to_1:t(5082,e.DiagnosticCategory.Error,"_0_could_be_instantiated_with_an_arbitrary_type_which_could_be_unrelated_to_1_5082","'{0}' could be instantiated with an arbitrary type which could be unrelated to '{1}'."),Cannot_read_file_0:t(5083,e.DiagnosticCategory.Error,"Cannot_read_file_0_5083","Cannot read file '{0}'."),Tuple_members_must_all_have_names_or_all_not_have_names:t(5084,e.DiagnosticCategory.Error,"Tuple_members_must_all_have_names_or_all_not_have_names_5084","Tuple members must all have names or all not have names."),A_tuple_member_cannot_be_both_optional_and_rest:t(5085,e.DiagnosticCategory.Error,"A_tuple_member_cannot_be_both_optional_and_rest_5085","A tuple member cannot be both optional and rest."),A_labeled_tuple_element_is_declared_as_optional_with_a_question_mark_after_the_name_and_before_the_colon_rather_than_after_the_type:t(5086,e.DiagnosticCategory.Error,"A_labeled_tuple_element_is_declared_as_optional_with_a_question_mark_after_the_name_and_before_the_c_5086","A labeled tuple element is declared as optional with a question mark after the name and before the colon, rather than after the type."),A_labeled_tuple_element_is_declared_as_rest_with_a_before_the_name_rather_than_before_the_type:t(5087,e.DiagnosticCategory.Error,"A_labeled_tuple_element_is_declared_as_rest_with_a_before_the_name_rather_than_before_the_type_5087","A labeled tuple element is declared as rest with a '...' before the name, rather than before the type."),The_inferred_type_of_0_references_a_type_with_a_cyclic_structure_which_cannot_be_trivially_serialized_A_type_annotation_is_necessary:t(5088,e.DiagnosticCategory.Error,"The_inferred_type_of_0_references_a_type_with_a_cyclic_structure_which_cannot_be_trivially_serialize_5088","The inferred type of '{0}' references a type with a cyclic structure which cannot be trivially serialized. A type annotation is necessary."),Option_0_cannot_be_specified_when_option_jsx_is_1:t(5089,e.DiagnosticCategory.Error,"Option_0_cannot_be_specified_when_option_jsx_is_1_5089","Option '{0}' cannot be specified when option 'jsx' is '{1}'."),Non_relative_paths_are_not_allowed_when_baseUrl_is_not_set_Did_you_forget_a_leading_Slash:t(5090,e.DiagnosticCategory.Error,"Non_relative_paths_are_not_allowed_when_baseUrl_is_not_set_Did_you_forget_a_leading_Slash_5090","Non-relative paths are not allowed when 'baseUrl' is not set. Did you forget a leading './'?"),Option_preserveConstEnums_cannot_be_disabled_when_isolatedModules_is_enabled:t(5091,e.DiagnosticCategory.Error,"Option_preserveConstEnums_cannot_be_disabled_when_isolatedModules_is_enabled_5091","Option 'preserveConstEnums' cannot be disabled when 'isolatedModules' is enabled."),The_root_value_of_a_0_file_must_be_an_object:t(5092,e.DiagnosticCategory.Error,"The_root_value_of_a_0_file_must_be_an_object_5092","The root value of a '{0}' file must be an object."),Compiler_option_0_may_only_be_used_with_build:t(5093,e.DiagnosticCategory.Error,"Compiler_option_0_may_only_be_used_with_build_5093","Compiler option '--{0}' may only be used with '--build'."),Compiler_option_0_may_not_be_used_with_build:t(5094,e.DiagnosticCategory.Error,"Compiler_option_0_may_not_be_used_with_build_5094","Compiler option '--{0}' may not be used with '--build'."),Option_preserveValueImports_can_only_be_used_when_module_is_set_to_es2015_or_later:t(5095,e.DiagnosticCategory.Error,"Option_preserveValueImports_can_only_be_used_when_module_is_set_to_es2015_or_later_5095","Option 'preserveValueImports' can only be used when 'module' is set to 'es2015' or later."),Generates_a_sourcemap_for_each_corresponding_d_ts_file:t(6e3,e.DiagnosticCategory.Message,"Generates_a_sourcemap_for_each_corresponding_d_ts_file_6000","Generates a sourcemap for each corresponding '.d.ts' file."),Concatenate_and_emit_output_to_single_file:t(6001,e.DiagnosticCategory.Message,"Concatenate_and_emit_output_to_single_file_6001","Concatenate and emit output to single file."),Generates_corresponding_d_ts_file:t(6002,e.DiagnosticCategory.Message,"Generates_corresponding_d_ts_file_6002","Generates corresponding '.d.ts' file."),Specify_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations:t(6004,e.DiagnosticCategory.Message,"Specify_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations_6004","Specify the location where debugger should locate TypeScript files instead of source locations."),Watch_input_files:t(6005,e.DiagnosticCategory.Message,"Watch_input_files_6005","Watch input files."),Redirect_output_structure_to_the_directory:t(6006,e.DiagnosticCategory.Message,"Redirect_output_structure_to_the_directory_6006","Redirect output structure to the directory."),Do_not_erase_const_enum_declarations_in_generated_code:t(6007,e.DiagnosticCategory.Message,"Do_not_erase_const_enum_declarations_in_generated_code_6007","Do not erase const enum declarations in generated code."),Do_not_emit_outputs_if_any_errors_were_reported:t(6008,e.DiagnosticCategory.Message,"Do_not_emit_outputs_if_any_errors_were_reported_6008","Do not emit outputs if any errors were reported."),Do_not_emit_comments_to_output:t(6009,e.DiagnosticCategory.Message,"Do_not_emit_comments_to_output_6009","Do not emit comments to output."),Do_not_emit_outputs:t(6010,e.DiagnosticCategory.Message,"Do_not_emit_outputs_6010","Do not emit outputs."),Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typechecking:t(6011,e.DiagnosticCategory.Message,"Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typech_6011","Allow default imports from modules with no default export. This does not affect code emit, just typechecking."),Skip_type_checking_of_declaration_files:t(6012,e.DiagnosticCategory.Message,"Skip_type_checking_of_declaration_files_6012","Skip type checking of declaration files."),Do_not_resolve_the_real_path_of_symlinks:t(6013,e.DiagnosticCategory.Message,"Do_not_resolve_the_real_path_of_symlinks_6013","Do not resolve the real path of symlinks."),Only_emit_d_ts_declaration_files:t(6014,e.DiagnosticCategory.Message,"Only_emit_d_ts_declaration_files_6014","Only emit '.d.ts' declaration files."),Specify_ECMAScript_target_version:t(6015,e.DiagnosticCategory.Message,"Specify_ECMAScript_target_version_6015","Specify ECMAScript target version."),Specify_module_code_generation:t(6016,e.DiagnosticCategory.Message,"Specify_module_code_generation_6016","Specify module code generation."),Print_this_message:t(6017,e.DiagnosticCategory.Message,"Print_this_message_6017","Print this message."),Print_the_compiler_s_version:t(6019,e.DiagnosticCategory.Message,"Print_the_compiler_s_version_6019","Print the compiler's version."),Compile_the_project_given_the_path_to_its_configuration_file_or_to_a_folder_with_a_tsconfig_json:t(6020,e.DiagnosticCategory.Message,"Compile_the_project_given_the_path_to_its_configuration_file_or_to_a_folder_with_a_tsconfig_json_6020","Compile the project given the path to its configuration file, or to a folder with a 'tsconfig.json'."),Syntax_Colon_0:t(6023,e.DiagnosticCategory.Message,"Syntax_Colon_0_6023","Syntax: {0}"),options:t(6024,e.DiagnosticCategory.Message,"options_6024","options"),file:t(6025,e.DiagnosticCategory.Message,"file_6025","file"),Examples_Colon_0:t(6026,e.DiagnosticCategory.Message,"Examples_Colon_0_6026","Examples: {0}"),Options_Colon:t(6027,e.DiagnosticCategory.Message,"Options_Colon_6027","Options:"),Version_0:t(6029,e.DiagnosticCategory.Message,"Version_0_6029","Version {0}"),Insert_command_line_options_and_files_from_a_file:t(6030,e.DiagnosticCategory.Message,"Insert_command_line_options_and_files_from_a_file_6030","Insert command line options and files from a file."),Starting_compilation_in_watch_mode:t(6031,e.DiagnosticCategory.Message,"Starting_compilation_in_watch_mode_6031","Starting compilation in watch mode..."),File_change_detected_Starting_incremental_compilation:t(6032,e.DiagnosticCategory.Message,"File_change_detected_Starting_incremental_compilation_6032","File change detected. Starting incremental compilation..."),KIND:t(6034,e.DiagnosticCategory.Message,"KIND_6034","KIND"),FILE:t(6035,e.DiagnosticCategory.Message,"FILE_6035","FILE"),VERSION:t(6036,e.DiagnosticCategory.Message,"VERSION_6036","VERSION"),LOCATION:t(6037,e.DiagnosticCategory.Message,"LOCATION_6037","LOCATION"),DIRECTORY:t(6038,e.DiagnosticCategory.Message,"DIRECTORY_6038","DIRECTORY"),STRATEGY:t(6039,e.DiagnosticCategory.Message,"STRATEGY_6039","STRATEGY"),FILE_OR_DIRECTORY:t(6040,e.DiagnosticCategory.Message,"FILE_OR_DIRECTORY_6040","FILE OR DIRECTORY"),Generates_corresponding_map_file:t(6043,e.DiagnosticCategory.Message,"Generates_corresponding_map_file_6043","Generates corresponding '.map' file."),Compiler_option_0_expects_an_argument:t(6044,e.DiagnosticCategory.Error,"Compiler_option_0_expects_an_argument_6044","Compiler option '{0}' expects an argument."),Unterminated_quoted_string_in_response_file_0:t(6045,e.DiagnosticCategory.Error,"Unterminated_quoted_string_in_response_file_0_6045","Unterminated quoted string in response file '{0}'."),Argument_for_0_option_must_be_Colon_1:t(6046,e.DiagnosticCategory.Error,"Argument_for_0_option_must_be_Colon_1_6046","Argument for '{0}' option must be: {1}."),Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1:t(6048,e.DiagnosticCategory.Error,"Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1_6048","Locale must be of the form <language> or <language>-<territory>. For example '{0}' or '{1}'."),Unable_to_open_file_0:t(6050,e.DiagnosticCategory.Error,"Unable_to_open_file_0_6050","Unable to open file '{0}'."),Corrupted_locale_file_0:t(6051,e.DiagnosticCategory.Error,"Corrupted_locale_file_0_6051","Corrupted locale file {0}."),Raise_error_on_expressions_and_declarations_with_an_implied_any_type:t(6052,e.DiagnosticCategory.Message,"Raise_error_on_expressions_and_declarations_with_an_implied_any_type_6052","Raise error on expressions and declarations with an implied 'any' type."),File_0_not_found:t(6053,e.DiagnosticCategory.Error,"File_0_not_found_6053","File '{0}' not found."),File_0_has_an_unsupported_extension_The_only_supported_extensions_are_1:t(6054,e.DiagnosticCategory.Error,"File_0_has_an_unsupported_extension_The_only_supported_extensions_are_1_6054","File '{0}' has an unsupported extension. The only supported extensions are {1}."),Suppress_noImplicitAny_errors_for_indexing_objects_lacking_index_signatures:t(6055,e.DiagnosticCategory.Message,"Suppress_noImplicitAny_errors_for_indexing_objects_lacking_index_signatures_6055","Suppress noImplicitAny errors for indexing objects lacking index signatures."),Do_not_emit_declarations_for_code_that_has_an_internal_annotation:t(6056,e.DiagnosticCategory.Message,"Do_not_emit_declarations_for_code_that_has_an_internal_annotation_6056","Do not emit declarations for code that has an '@internal' annotation."),Specify_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir:t(6058,e.DiagnosticCategory.Message,"Specify_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir_6058","Specify the root directory of input files. Use to control the output directory structure with --outDir."),File_0_is_not_under_rootDir_1_rootDir_is_expected_to_contain_all_source_files:t(6059,e.DiagnosticCategory.Error,"File_0_is_not_under_rootDir_1_rootDir_is_expected_to_contain_all_source_files_6059","File '{0}' is not under 'rootDir' '{1}'. 'rootDir' is expected to contain all source files."),Specify_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix:t(6060,e.DiagnosticCategory.Message,"Specify_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix_6060","Specify the end of line sequence to be used when emitting files: 'CRLF' (dos) or 'LF' (unix)."),NEWLINE:t(6061,e.DiagnosticCategory.Message,"NEWLINE_6061","NEWLINE"),Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_null_on_command_line:t(6064,e.DiagnosticCategory.Error,"Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_null_on_command_line_6064","Option '{0}' can only be specified in 'tsconfig.json' file or set to 'null' on command line."),Enables_experimental_support_for_ES7_decorators:t(6065,e.DiagnosticCategory.Message,"Enables_experimental_support_for_ES7_decorators_6065","Enables experimental support for ES7 decorators."),Enables_experimental_support_for_emitting_type_metadata_for_decorators:t(6066,e.DiagnosticCategory.Message,"Enables_experimental_support_for_emitting_type_metadata_for_decorators_6066","Enables experimental support for emitting type metadata for decorators."),Specify_module_resolution_strategy_Colon_node_Node_js_or_classic_TypeScript_pre_1_6:t(6069,e.DiagnosticCategory.Message,"Specify_module_resolution_strategy_Colon_node_Node_js_or_classic_TypeScript_pre_1_6_6069","Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6)."),Initializes_a_TypeScript_project_and_creates_a_tsconfig_json_file:t(6070,e.DiagnosticCategory.Message,"Initializes_a_TypeScript_project_and_creates_a_tsconfig_json_file_6070","Initializes a TypeScript project and creates a tsconfig.json file."),Successfully_created_a_tsconfig_json_file:t(6071,e.DiagnosticCategory.Message,"Successfully_created_a_tsconfig_json_file_6071","Successfully created a tsconfig.json file."),Suppress_excess_property_checks_for_object_literals:t(6072,e.DiagnosticCategory.Message,"Suppress_excess_property_checks_for_object_literals_6072","Suppress excess property checks for object literals."),Stylize_errors_and_messages_using_color_and_context_experimental:t(6073,e.DiagnosticCategory.Message,"Stylize_errors_and_messages_using_color_and_context_experimental_6073","Stylize errors and messages using color and context (experimental)."),Do_not_report_errors_on_unused_labels:t(6074,e.DiagnosticCategory.Message,"Do_not_report_errors_on_unused_labels_6074","Do not report errors on unused labels."),Report_error_when_not_all_code_paths_in_function_return_a_value:t(6075,e.DiagnosticCategory.Message,"Report_error_when_not_all_code_paths_in_function_return_a_value_6075","Report error when not all code paths in function return a value."),Report_errors_for_fallthrough_cases_in_switch_statement:t(6076,e.DiagnosticCategory.Message,"Report_errors_for_fallthrough_cases_in_switch_statement_6076","Report errors for fallthrough cases in switch statement."),Do_not_report_errors_on_unreachable_code:t(6077,e.DiagnosticCategory.Message,"Do_not_report_errors_on_unreachable_code_6077","Do not report errors on unreachable code."),Disallow_inconsistently_cased_references_to_the_same_file:t(6078,e.DiagnosticCategory.Message,"Disallow_inconsistently_cased_references_to_the_same_file_6078","Disallow inconsistently-cased references to the same file."),Specify_library_files_to_be_included_in_the_compilation:t(6079,e.DiagnosticCategory.Message,"Specify_library_files_to_be_included_in_the_compilation_6079","Specify library files to be included in the compilation."),Specify_JSX_code_generation:t(6080,e.DiagnosticCategory.Message,"Specify_JSX_code_generation_6080","Specify JSX code generation."),File_0_has_an_unsupported_extension_so_skipping_it:t(6081,e.DiagnosticCategory.Message,"File_0_has_an_unsupported_extension_so_skipping_it_6081","File '{0}' has an unsupported extension, so skipping it."),Only_amd_and_system_modules_are_supported_alongside_0:t(6082,e.DiagnosticCategory.Error,"Only_amd_and_system_modules_are_supported_alongside_0_6082","Only 'amd' and 'system' modules are supported alongside --{0}."),Base_directory_to_resolve_non_absolute_module_names:t(6083,e.DiagnosticCategory.Message,"Base_directory_to_resolve_non_absolute_module_names_6083","Base directory to resolve non-absolute module names."),Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react_JSX_emit:t(6084,e.DiagnosticCategory.Message,"Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react__6084","[Deprecated] Use '--jsxFactory' instead. Specify the object invoked for createElement when targeting 'react' JSX emit"),Enable_tracing_of_the_name_resolution_process:t(6085,e.DiagnosticCategory.Message,"Enable_tracing_of_the_name_resolution_process_6085","Enable tracing of the name resolution process."),Resolving_module_0_from_1:t(6086,e.DiagnosticCategory.Message,"Resolving_module_0_from_1_6086","======== Resolving module '{0}' from '{1}'. ========"),Explicitly_specified_module_resolution_kind_Colon_0:t(6087,e.DiagnosticCategory.Message,"Explicitly_specified_module_resolution_kind_Colon_0_6087","Explicitly specified module resolution kind: '{0}'."),Module_resolution_kind_is_not_specified_using_0:t(6088,e.DiagnosticCategory.Message,"Module_resolution_kind_is_not_specified_using_0_6088","Module resolution kind is not specified, using '{0}'."),Module_name_0_was_successfully_resolved_to_1:t(6089,e.DiagnosticCategory.Message,"Module_name_0_was_successfully_resolved_to_1_6089","======== Module name '{0}' was successfully resolved to '{1}'. ========"),Module_name_0_was_not_resolved:t(6090,e.DiagnosticCategory.Message,"Module_name_0_was_not_resolved_6090","======== Module name '{0}' was not resolved. ========"),paths_option_is_specified_looking_for_a_pattern_to_match_module_name_0:t(6091,e.DiagnosticCategory.Message,"paths_option_is_specified_looking_for_a_pattern_to_match_module_name_0_6091","'paths' option is specified, looking for a pattern to match module name '{0}'."),Module_name_0_matched_pattern_1:t(6092,e.DiagnosticCategory.Message,"Module_name_0_matched_pattern_1_6092","Module name '{0}', matched pattern '{1}'."),Trying_substitution_0_candidate_module_location_Colon_1:t(6093,e.DiagnosticCategory.Message,"Trying_substitution_0_candidate_module_location_Colon_1_6093","Trying substitution '{0}', candidate module location: '{1}'."),Resolving_module_name_0_relative_to_base_url_1_2:t(6094,e.DiagnosticCategory.Message,"Resolving_module_name_0_relative_to_base_url_1_2_6094","Resolving module name '{0}' relative to base url '{1}' - '{2}'."),Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_type_1:t(6095,e.DiagnosticCategory.Message,"Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_type_1_6095","Loading module as file / folder, candidate module location '{0}', target file type '{1}'."),File_0_does_not_exist:t(6096,e.DiagnosticCategory.Message,"File_0_does_not_exist_6096","File '{0}' does not exist."),File_0_exist_use_it_as_a_name_resolution_result:t(6097,e.DiagnosticCategory.Message,"File_0_exist_use_it_as_a_name_resolution_result_6097","File '{0}' exist - use it as a name resolution result."),Loading_module_0_from_node_modules_folder_target_file_type_1:t(6098,e.DiagnosticCategory.Message,"Loading_module_0_from_node_modules_folder_target_file_type_1_6098","Loading module '{0}' from 'node_modules' folder, target file type '{1}'."),Found_package_json_at_0:t(6099,e.DiagnosticCategory.Message,"Found_package_json_at_0_6099","Found 'package.json' at '{0}'."),package_json_does_not_have_a_0_field:t(6100,e.DiagnosticCategory.Message,"package_json_does_not_have_a_0_field_6100","'package.json' does not have a '{0}' field."),package_json_has_0_field_1_that_references_2:t(6101,e.DiagnosticCategory.Message,"package_json_has_0_field_1_that_references_2_6101","'package.json' has '{0}' field '{1}' that references '{2}'."),Allow_javascript_files_to_be_compiled:t(6102,e.DiagnosticCategory.Message,"Allow_javascript_files_to_be_compiled_6102","Allow javascript files to be compiled."),Checking_if_0_is_the_longest_matching_prefix_for_1_2:t(6104,e.DiagnosticCategory.Message,"Checking_if_0_is_the_longest_matching_prefix_for_1_2_6104","Checking if '{0}' is the longest matching prefix for '{1}' - '{2}'."),Expected_type_of_0_field_in_package_json_to_be_1_got_2:t(6105,e.DiagnosticCategory.Message,"Expected_type_of_0_field_in_package_json_to_be_1_got_2_6105","Expected type of '{0}' field in 'package.json' to be '{1}', got '{2}'."),baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1:t(6106,e.DiagnosticCategory.Message,"baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1_6106","'baseUrl' option is set to '{0}', using this value to resolve non-relative module name '{1}'."),rootDirs_option_is_set_using_it_to_resolve_relative_module_name_0:t(6107,e.DiagnosticCategory.Message,"rootDirs_option_is_set_using_it_to_resolve_relative_module_name_0_6107","'rootDirs' option is set, using it to resolve relative module name '{0}'."),Longest_matching_prefix_for_0_is_1:t(6108,e.DiagnosticCategory.Message,"Longest_matching_prefix_for_0_is_1_6108","Longest matching prefix for '{0}' is '{1}'."),Loading_0_from_the_root_dir_1_candidate_location_2:t(6109,e.DiagnosticCategory.Message,"Loading_0_from_the_root_dir_1_candidate_location_2_6109","Loading '{0}' from the root dir '{1}', candidate location '{2}'."),Trying_other_entries_in_rootDirs:t(6110,e.DiagnosticCategory.Message,"Trying_other_entries_in_rootDirs_6110","Trying other entries in 'rootDirs'."),Module_resolution_using_rootDirs_has_failed:t(6111,e.DiagnosticCategory.Message,"Module_resolution_using_rootDirs_has_failed_6111","Module resolution using 'rootDirs' has failed."),Do_not_emit_use_strict_directives_in_module_output:t(6112,e.DiagnosticCategory.Message,"Do_not_emit_use_strict_directives_in_module_output_6112","Do not emit 'use strict' directives in module output."),Enable_strict_null_checks:t(6113,e.DiagnosticCategory.Message,"Enable_strict_null_checks_6113","Enable strict null checks."),Unknown_option_excludes_Did_you_mean_exclude:t(6114,e.DiagnosticCategory.Error,"Unknown_option_excludes_Did_you_mean_exclude_6114","Unknown option 'excludes'. Did you mean 'exclude'?"),Raise_error_on_this_expressions_with_an_implied_any_type:t(6115,e.DiagnosticCategory.Message,"Raise_error_on_this_expressions_with_an_implied_any_type_6115","Raise error on 'this' expressions with an implied 'any' type."),Resolving_type_reference_directive_0_containing_file_1_root_directory_2:t(6116,e.DiagnosticCategory.Message,"Resolving_type_reference_directive_0_containing_file_1_root_directory_2_6116","======== Resolving type reference directive '{0}', containing file '{1}', root directory '{2}'. ========"),Type_reference_directive_0_was_successfully_resolved_to_1_primary_Colon_2:t(6119,e.DiagnosticCategory.Message,"Type_reference_directive_0_was_successfully_resolved_to_1_primary_Colon_2_6119","======== Type reference directive '{0}' was successfully resolved to '{1}', primary: {2}. ========"),Type_reference_directive_0_was_not_resolved:t(6120,e.DiagnosticCategory.Message,"Type_reference_directive_0_was_not_resolved_6120","======== Type reference directive '{0}' was not resolved. ========"),Resolving_with_primary_search_path_0:t(6121,e.DiagnosticCategory.Message,"Resolving_with_primary_search_path_0_6121","Resolving with primary search path '{0}'."),Root_directory_cannot_be_determined_skipping_primary_search_paths:t(6122,e.DiagnosticCategory.Message,"Root_directory_cannot_be_determined_skipping_primary_search_paths_6122","Root directory cannot be determined, skipping primary search paths."),Resolving_type_reference_directive_0_containing_file_1_root_directory_not_set:t(6123,e.DiagnosticCategory.Message,"Resolving_type_reference_directive_0_containing_file_1_root_directory_not_set_6123","======== Resolving type reference directive '{0}', containing file '{1}', root directory not set. ========"),Type_declaration_files_to_be_included_in_compilation:t(6124,e.DiagnosticCategory.Message,"Type_declaration_files_to_be_included_in_compilation_6124","Type declaration files to be included in compilation."),Looking_up_in_node_modules_folder_initial_location_0:t(6125,e.DiagnosticCategory.Message,"Looking_up_in_node_modules_folder_initial_location_0_6125","Looking up in 'node_modules' folder, initial location '{0}'."),Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_modules_folder:t(6126,e.DiagnosticCategory.Message,"Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_mod_6126","Containing file is not specified and root directory cannot be determined, skipping lookup in 'node_modules' folder."),Resolving_type_reference_directive_0_containing_file_not_set_root_directory_1:t(6127,e.DiagnosticCategory.Message,"Resolving_type_reference_directive_0_containing_file_not_set_root_directory_1_6127","======== Resolving type reference directive '{0}', containing file not set, root directory '{1}'. ========"),Resolving_type_reference_directive_0_containing_file_not_set_root_directory_not_set:t(6128,e.DiagnosticCategory.Message,"Resolving_type_reference_directive_0_containing_file_not_set_root_directory_not_set_6128","======== Resolving type reference directive '{0}', containing file not set, root directory not set. ========"),Resolving_real_path_for_0_result_1:t(6130,e.DiagnosticCategory.Message,"Resolving_real_path_for_0_result_1_6130","Resolving real path for '{0}', result '{1}'."),Cannot_compile_modules_using_option_0_unless_the_module_flag_is_amd_or_system:t(6131,e.DiagnosticCategory.Error,"Cannot_compile_modules_using_option_0_unless_the_module_flag_is_amd_or_system_6131","Cannot compile modules using option '{0}' unless the '--module' flag is 'amd' or 'system'."),File_name_0_has_a_1_extension_stripping_it:t(6132,e.DiagnosticCategory.Message,"File_name_0_has_a_1_extension_stripping_it_6132","File name '{0}' has a '{1}' extension - stripping it."),_0_is_declared_but_its_value_is_never_read:t(6133,e.DiagnosticCategory.Error,"_0_is_declared_but_its_value_is_never_read_6133","'{0}' is declared but its value is never read.",!0),Report_errors_on_unused_locals:t(6134,e.DiagnosticCategory.Message,"Report_errors_on_unused_locals_6134","Report errors on unused locals."),Report_errors_on_unused_parameters:t(6135,e.DiagnosticCategory.Message,"Report_errors_on_unused_parameters_6135","Report errors on unused parameters."),The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files:t(6136,e.DiagnosticCategory.Message,"The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files_6136","The maximum dependency depth to search under node_modules and load JavaScript files."),Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1:t(6137,e.DiagnosticCategory.Error,"Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1_6137","Cannot import type declaration files. Consider importing '{0}' instead of '{1}'."),Property_0_is_declared_but_its_value_is_never_read:t(6138,e.DiagnosticCategory.Error,"Property_0_is_declared_but_its_value_is_never_read_6138","Property '{0}' is declared but its value is never read.",!0),Import_emit_helpers_from_tslib:t(6139,e.DiagnosticCategory.Message,"Import_emit_helpers_from_tslib_6139","Import emit helpers from 'tslib'."),Auto_discovery_for_typings_is_enabled_in_project_0_Running_extra_resolution_pass_for_module_1_using_cache_location_2:t(6140,e.DiagnosticCategory.Error,"Auto_discovery_for_typings_is_enabled_in_project_0_Running_extra_resolution_pass_for_module_1_using__6140","Auto discovery for typings is enabled in project '{0}'. Running extra resolution pass for module '{1}' using cache location '{2}'."),Parse_in_strict_mode_and_emit_use_strict_for_each_source_file:t(6141,e.DiagnosticCategory.Message,"Parse_in_strict_mode_and_emit_use_strict_for_each_source_file_6141",'Parse in strict mode and emit "use strict" for each source file.'),Module_0_was_resolved_to_1_but_jsx_is_not_set:t(6142,e.DiagnosticCategory.Error,"Module_0_was_resolved_to_1_but_jsx_is_not_set_6142","Module '{0}' was resolved to '{1}', but '--jsx' is not set."),Module_0_was_resolved_as_locally_declared_ambient_module_in_file_1:t(6144,e.DiagnosticCategory.Message,"Module_0_was_resolved_as_locally_declared_ambient_module_in_file_1_6144","Module '{0}' was resolved as locally declared ambient module in file '{1}'."),Module_0_was_resolved_as_ambient_module_declared_in_1_since_this_file_was_not_modified:t(6145,e.DiagnosticCategory.Message,"Module_0_was_resolved_as_ambient_module_declared_in_1_since_this_file_was_not_modified_6145","Module '{0}' was resolved as ambient module declared in '{1}' since this file was not modified."),Specify_the_JSX_factory_function_to_use_when_targeting_react_JSX_emit_e_g_React_createElement_or_h:t(6146,e.DiagnosticCategory.Message,"Specify_the_JSX_factory_function_to_use_when_targeting_react_JSX_emit_e_g_React_createElement_or_h_6146","Specify the JSX factory function to use when targeting 'react' JSX emit, e.g. 'React.createElement' or 'h'."),Resolution_for_module_0_was_found_in_cache_from_location_1:t(6147,e.DiagnosticCategory.Message,"Resolution_for_module_0_was_found_in_cache_from_location_1_6147","Resolution for module '{0}' was found in cache from location '{1}'."),Directory_0_does_not_exist_skipping_all_lookups_in_it:t(6148,e.DiagnosticCategory.Message,"Directory_0_does_not_exist_skipping_all_lookups_in_it_6148","Directory '{0}' does not exist, skipping all lookups in it."),Show_diagnostic_information:t(6149,e.DiagnosticCategory.Message,"Show_diagnostic_information_6149","Show diagnostic information."),Show_verbose_diagnostic_information:t(6150,e.DiagnosticCategory.Message,"Show_verbose_diagnostic_information_6150","Show verbose diagnostic information."),Emit_a_single_file_with_source_maps_instead_of_having_a_separate_file:t(6151,e.DiagnosticCategory.Message,"Emit_a_single_file_with_source_maps_instead_of_having_a_separate_file_6151","Emit a single file with source maps instead of having a separate file."),Emit_the_source_alongside_the_sourcemaps_within_a_single_file_requires_inlineSourceMap_or_sourceMap_to_be_set:t(6152,e.DiagnosticCategory.Message,"Emit_the_source_alongside_the_sourcemaps_within_a_single_file_requires_inlineSourceMap_or_sourceMap__6152","Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set."),Transpile_each_file_as_a_separate_module_similar_to_ts_transpileModule:t(6153,e.DiagnosticCategory.Message,"Transpile_each_file_as_a_separate_module_similar_to_ts_transpileModule_6153","Transpile each file as a separate module (similar to 'ts.transpileModule')."),Print_names_of_generated_files_part_of_the_compilation:t(6154,e.DiagnosticCategory.Message,"Print_names_of_generated_files_part_of_the_compilation_6154","Print names of generated files part of the compilation."),Print_names_of_files_part_of_the_compilation:t(6155,e.DiagnosticCategory.Message,"Print_names_of_files_part_of_the_compilation_6155","Print names of files part of the compilation."),The_locale_used_when_displaying_messages_to_the_user_e_g_en_us:t(6156,e.DiagnosticCategory.Message,"The_locale_used_when_displaying_messages_to_the_user_e_g_en_us_6156","The locale used when displaying messages to the user (e.g. 'en-us')"),Do_not_generate_custom_helper_functions_like_extends_in_compiled_output:t(6157,e.DiagnosticCategory.Message,"Do_not_generate_custom_helper_functions_like_extends_in_compiled_output_6157","Do not generate custom helper functions like '__extends' in compiled output."),Do_not_include_the_default_library_file_lib_d_ts:t(6158,e.DiagnosticCategory.Message,"Do_not_include_the_default_library_file_lib_d_ts_6158","Do not include the default library file (lib.d.ts)."),Do_not_add_triple_slash_references_or_imported_modules_to_the_list_of_compiled_files:t(6159,e.DiagnosticCategory.Message,"Do_not_add_triple_slash_references_or_imported_modules_to_the_list_of_compiled_files_6159","Do not add triple-slash references or imported modules to the list of compiled files."),Deprecated_Use_skipLibCheck_instead_Skip_type_checking_of_default_library_declaration_files:t(6160,e.DiagnosticCategory.Message,"Deprecated_Use_skipLibCheck_instead_Skip_type_checking_of_default_library_declaration_files_6160","[Deprecated] Use '--skipLibCheck' instead. Skip type checking of default library declaration files."),List_of_folders_to_include_type_definitions_from:t(6161,e.DiagnosticCategory.Message,"List_of_folders_to_include_type_definitions_from_6161","List of folders to include type definitions from."),Disable_size_limitations_on_JavaScript_projects:t(6162,e.DiagnosticCategory.Message,"Disable_size_limitations_on_JavaScript_projects_6162","Disable size limitations on JavaScript projects."),The_character_set_of_the_input_files:t(6163,e.DiagnosticCategory.Message,"The_character_set_of_the_input_files_6163","The character set of the input files."),Do_not_truncate_error_messages:t(6165,e.DiagnosticCategory.Message,"Do_not_truncate_error_messages_6165","Do not truncate error messages."),Output_directory_for_generated_declaration_files:t(6166,e.DiagnosticCategory.Message,"Output_directory_for_generated_declaration_files_6166","Output directory for generated declaration files."),A_series_of_entries_which_re_map_imports_to_lookup_locations_relative_to_the_baseUrl:t(6167,e.DiagnosticCategory.Message,"A_series_of_entries_which_re_map_imports_to_lookup_locations_relative_to_the_baseUrl_6167","A series of entries which re-map imports to lookup locations relative to the 'baseUrl'."),List_of_root_folders_whose_combined_content_represents_the_structure_of_the_project_at_runtime:t(6168,e.DiagnosticCategory.Message,"List_of_root_folders_whose_combined_content_represents_the_structure_of_the_project_at_runtime_6168","List of root folders whose combined content represents the structure of the project at runtime."),Show_all_compiler_options:t(6169,e.DiagnosticCategory.Message,"Show_all_compiler_options_6169","Show all compiler options."),Deprecated_Use_outFile_instead_Concatenate_and_emit_output_to_single_file:t(6170,e.DiagnosticCategory.Message,"Deprecated_Use_outFile_instead_Concatenate_and_emit_output_to_single_file_6170","[Deprecated] Use '--outFile' instead. Concatenate and emit output to single file"),Command_line_Options:t(6171,e.DiagnosticCategory.Message,"Command_line_Options_6171","Command-line Options"),Provide_full_support_for_iterables_in_for_of_spread_and_destructuring_when_targeting_ES5_or_ES3:t(6179,e.DiagnosticCategory.Message,"Provide_full_support_for_iterables_in_for_of_spread_and_destructuring_when_targeting_ES5_or_ES3_6179","Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'."),Enable_all_strict_type_checking_options:t(6180,e.DiagnosticCategory.Message,"Enable_all_strict_type_checking_options_6180","Enable all strict type-checking options."),List_of_language_service_plugins:t(6181,e.DiagnosticCategory.Message,"List_of_language_service_plugins_6181","List of language service plugins."),Scoped_package_detected_looking_in_0:t(6182,e.DiagnosticCategory.Message,"Scoped_package_detected_looking_in_0_6182","Scoped package detected, looking in '{0}'"),Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2:t(6183,e.DiagnosticCategory.Message,"Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2_6183","Reusing resolution of module '{0}' from '{1}' of old program, it was successfully resolved to '{2}'."),Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package_ID_3:t(6184,e.DiagnosticCategory.Message,"Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package__6184","Reusing resolution of module '{0}' from '{1}' of old program, it was successfully resolved to '{2}' with Package ID '{3}'."),Enable_strict_checking_of_function_types:t(6186,e.DiagnosticCategory.Message,"Enable_strict_checking_of_function_types_6186","Enable strict checking of function types."),Enable_strict_checking_of_property_initialization_in_classes:t(6187,e.DiagnosticCategory.Message,"Enable_strict_checking_of_property_initialization_in_classes_6187","Enable strict checking of property initialization in classes."),Numeric_separators_are_not_allowed_here:t(6188,e.DiagnosticCategory.Error,"Numeric_separators_are_not_allowed_here_6188","Numeric separators are not allowed here."),Multiple_consecutive_numeric_separators_are_not_permitted:t(6189,e.DiagnosticCategory.Error,"Multiple_consecutive_numeric_separators_are_not_permitted_6189","Multiple consecutive numeric separators are not permitted."),Whether_to_keep_outdated_console_output_in_watch_mode_instead_of_clearing_the_screen:t(6191,e.DiagnosticCategory.Message,"Whether_to_keep_outdated_console_output_in_watch_mode_instead_of_clearing_the_screen_6191","Whether to keep outdated console output in watch mode instead of clearing the screen."),All_imports_in_import_declaration_are_unused:t(6192,e.DiagnosticCategory.Error,"All_imports_in_import_declaration_are_unused_6192","All imports in import declaration are unused.",!0),Found_1_error_Watching_for_file_changes:t(6193,e.DiagnosticCategory.Message,"Found_1_error_Watching_for_file_changes_6193","Found 1 error. Watching for file changes."),Found_0_errors_Watching_for_file_changes:t(6194,e.DiagnosticCategory.Message,"Found_0_errors_Watching_for_file_changes_6194","Found {0} errors. Watching for file changes."),Resolve_keyof_to_string_valued_property_names_only_no_numbers_or_symbols:t(6195,e.DiagnosticCategory.Message,"Resolve_keyof_to_string_valued_property_names_only_no_numbers_or_symbols_6195","Resolve 'keyof' to string valued property names only (no numbers or symbols)."),_0_is_declared_but_never_used:t(6196,e.DiagnosticCategory.Error,"_0_is_declared_but_never_used_6196","'{0}' is declared but never used.",!0),Include_modules_imported_with_json_extension:t(6197,e.DiagnosticCategory.Message,"Include_modules_imported_with_json_extension_6197","Include modules imported with '.json' extension"),All_destructured_elements_are_unused:t(6198,e.DiagnosticCategory.Error,"All_destructured_elements_are_unused_6198","All destructured elements are unused.",!0),All_variables_are_unused:t(6199,e.DiagnosticCategory.Error,"All_variables_are_unused_6199","All variables are unused.",!0),Definitions_of_the_following_identifiers_conflict_with_those_in_another_file_Colon_0:t(6200,e.DiagnosticCategory.Error,"Definitions_of_the_following_identifiers_conflict_with_those_in_another_file_Colon_0_6200","Definitions of the following identifiers conflict with those in another file: {0}"),Conflicts_are_in_this_file:t(6201,e.DiagnosticCategory.Message,"Conflicts_are_in_this_file_6201","Conflicts are in this file."),Project_references_may_not_form_a_circular_graph_Cycle_detected_Colon_0:t(6202,e.DiagnosticCategory.Error,"Project_references_may_not_form_a_circular_graph_Cycle_detected_Colon_0_6202","Project references may not form a circular graph. Cycle detected: {0}"),_0_was_also_declared_here:t(6203,e.DiagnosticCategory.Message,"_0_was_also_declared_here_6203","'{0}' was also declared here."),and_here:t(6204,e.DiagnosticCategory.Message,"and_here_6204","and here."),All_type_parameters_are_unused:t(6205,e.DiagnosticCategory.Error,"All_type_parameters_are_unused_6205","All type parameters are unused."),package_json_has_a_typesVersions_field_with_version_specific_path_mappings:t(6206,e.DiagnosticCategory.Message,"package_json_has_a_typesVersions_field_with_version_specific_path_mappings_6206","'package.json' has a 'typesVersions' field with version-specific path mappings."),package_json_does_not_have_a_typesVersions_entry_that_matches_version_0:t(6207,e.DiagnosticCategory.Message,"package_json_does_not_have_a_typesVersions_entry_that_matches_version_0_6207","'package.json' does not have a 'typesVersions' entry that matches version '{0}'."),package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_match_module_name_2:t(6208,e.DiagnosticCategory.Message,"package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_ma_6208","'package.json' has a 'typesVersions' entry '{0}' that matches compiler version '{1}', looking for a pattern to match module name '{2}'."),package_json_has_a_typesVersions_entry_0_that_is_not_a_valid_semver_range:t(6209,e.DiagnosticCategory.Message,"package_json_has_a_typesVersions_entry_0_that_is_not_a_valid_semver_range_6209","'package.json' has a 'typesVersions' entry '{0}' that is not a valid semver range."),An_argument_for_0_was_not_provided:t(6210,e.DiagnosticCategory.Message,"An_argument_for_0_was_not_provided_6210","An argument for '{0}' was not provided."),An_argument_matching_this_binding_pattern_was_not_provided:t(6211,e.DiagnosticCategory.Message,"An_argument_matching_this_binding_pattern_was_not_provided_6211","An argument matching this binding pattern was not provided."),Did_you_mean_to_call_this_expression:t(6212,e.DiagnosticCategory.Message,"Did_you_mean_to_call_this_expression_6212","Did you mean to call this expression?"),Did_you_mean_to_use_new_with_this_expression:t(6213,e.DiagnosticCategory.Message,"Did_you_mean_to_use_new_with_this_expression_6213","Did you mean to use 'new' with this expression?"),Enable_strict_bind_call_and_apply_methods_on_functions:t(6214,e.DiagnosticCategory.Message,"Enable_strict_bind_call_and_apply_methods_on_functions_6214","Enable strict 'bind', 'call', and 'apply' methods on functions."),Using_compiler_options_of_project_reference_redirect_0:t(6215,e.DiagnosticCategory.Message,"Using_compiler_options_of_project_reference_redirect_0_6215","Using compiler options of project reference redirect '{0}'."),Found_1_error:t(6216,e.DiagnosticCategory.Message,"Found_1_error_6216","Found 1 error."),Found_0_errors:t(6217,e.DiagnosticCategory.Message,"Found_0_errors_6217","Found {0} errors."),Module_name_0_was_successfully_resolved_to_1_with_Package_ID_2:t(6218,e.DiagnosticCategory.Message,"Module_name_0_was_successfully_resolved_to_1_with_Package_ID_2_6218","======== Module name '{0}' was successfully resolved to '{1}' with Package ID '{2}'. ========"),Type_reference_directive_0_was_successfully_resolved_to_1_with_Package_ID_2_primary_Colon_3:t(6219,e.DiagnosticCategory.Message,"Type_reference_directive_0_was_successfully_resolved_to_1_with_Package_ID_2_primary_Colon_3_6219","======== Type reference directive '{0}' was successfully resolved to '{1}' with Package ID '{2}', primary: {3}. ========"),package_json_had_a_falsy_0_field:t(6220,e.DiagnosticCategory.Message,"package_json_had_a_falsy_0_field_6220","'package.json' had a falsy '{0}' field."),Disable_use_of_source_files_instead_of_declaration_files_from_referenced_projects:t(6221,e.DiagnosticCategory.Message,"Disable_use_of_source_files_instead_of_declaration_files_from_referenced_projects_6221","Disable use of source files instead of declaration files from referenced projects."),Emit_class_fields_with_Define_instead_of_Set:t(6222,e.DiagnosticCategory.Message,"Emit_class_fields_with_Define_instead_of_Set_6222","Emit class fields with Define instead of Set."),Generates_a_CPU_profile:t(6223,e.DiagnosticCategory.Message,"Generates_a_CPU_profile_6223","Generates a CPU profile."),Disable_solution_searching_for_this_project:t(6224,e.DiagnosticCategory.Message,"Disable_solution_searching_for_this_project_6224","Disable solution searching for this project."),Specify_strategy_for_watching_file_Colon_FixedPollingInterval_default_PriorityPollingInterval_DynamicPriorityPolling_FixedChunkSizePolling_UseFsEvents_UseFsEventsOnParentDirectory:t(6225,e.DiagnosticCategory.Message,"Specify_strategy_for_watching_file_Colon_FixedPollingInterval_default_PriorityPollingInterval_Dynami_6225","Specify strategy for watching file: 'FixedPollingInterval' (default), 'PriorityPollingInterval', 'DynamicPriorityPolling', 'FixedChunkSizePolling', 'UseFsEvents', 'UseFsEventsOnParentDirectory'."),Specify_strategy_for_watching_directory_on_platforms_that_don_t_support_recursive_watching_natively_Colon_UseFsEvents_default_FixedPollingInterval_DynamicPriorityPolling_FixedChunkSizePolling:t(6226,e.DiagnosticCategory.Message,"Specify_strategy_for_watching_directory_on_platforms_that_don_t_support_recursive_watching_natively__6226","Specify strategy for watching directory on platforms that don't support recursive watching natively: 'UseFsEvents' (default), 'FixedPollingInterval', 'DynamicPriorityPolling', 'FixedChunkSizePolling'."),Specify_strategy_for_creating_a_polling_watch_when_it_fails_to_create_using_file_system_events_Colon_FixedInterval_default_PriorityInterval_DynamicPriority_FixedChunkSize:t(6227,e.DiagnosticCategory.Message,"Specify_strategy_for_creating_a_polling_watch_when_it_fails_to_create_using_file_system_events_Colon_6227","Specify strategy for creating a polling watch when it fails to create using file system events: 'FixedInterval' (default), 'PriorityInterval', 'DynamicPriority', 'FixedChunkSize'."),Tag_0_expects_at_least_1_arguments_but_the_JSX_factory_2_provides_at_most_3:t(6229,e.DiagnosticCategory.Error,"Tag_0_expects_at_least_1_arguments_but_the_JSX_factory_2_provides_at_most_3_6229","Tag '{0}' expects at least '{1}' arguments, but the JSX factory '{2}' provides at most '{3}'."),Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_false_or_null_on_command_line:t(6230,e.DiagnosticCategory.Error,"Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_false_or_null_on_command_line_6230","Option '{0}' can only be specified in 'tsconfig.json' file or set to 'false' or 'null' on command line."),Could_not_resolve_the_path_0_with_the_extensions_Colon_1:t(6231,e.DiagnosticCategory.Error,"Could_not_resolve_the_path_0_with_the_extensions_Colon_1_6231","Could not resolve the path '{0}' with the extensions: {1}."),Declaration_augments_declaration_in_another_file_This_cannot_be_serialized:t(6232,e.DiagnosticCategory.Error,"Declaration_augments_declaration_in_another_file_This_cannot_be_serialized_6232","Declaration augments declaration in another file. This cannot be serialized."),This_is_the_declaration_being_augmented_Consider_moving_the_augmenting_declaration_into_the_same_file:t(6233,e.DiagnosticCategory.Error,"This_is_the_declaration_being_augmented_Consider_moving_the_augmenting_declaration_into_the_same_fil_6233","This is the declaration being augmented. Consider moving the augmenting declaration into the same file."),This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without:t(6234,e.DiagnosticCategory.Error,"This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without_6234","This expression is not callable because it is a 'get' accessor. Did you mean to use it without '()'?"),Disable_loading_referenced_projects:t(6235,e.DiagnosticCategory.Message,"Disable_loading_referenced_projects_6235","Disable loading referenced projects."),Arguments_for_the_rest_parameter_0_were_not_provided:t(6236,e.DiagnosticCategory.Error,"Arguments_for_the_rest_parameter_0_were_not_provided_6236","Arguments for the rest parameter '{0}' were not provided."),Generates_an_event_trace_and_a_list_of_types:t(6237,e.DiagnosticCategory.Message,"Generates_an_event_trace_and_a_list_of_types_6237","Generates an event trace and a list of types."),Specify_the_module_specifier_to_be_used_to_import_the_jsx_and_jsxs_factory_functions_from_eg_react:t(6238,e.DiagnosticCategory.Error,"Specify_the_module_specifier_to_be_used_to_import_the_jsx_and_jsxs_factory_functions_from_eg_react_6238","Specify the module specifier to be used to import the 'jsx' and 'jsxs' factory functions from. eg, react"),File_0_exists_according_to_earlier_cached_lookups:t(6239,e.DiagnosticCategory.Message,"File_0_exists_according_to_earlier_cached_lookups_6239","File '{0}' exists according to earlier cached lookups."),File_0_does_not_exist_according_to_earlier_cached_lookups:t(6240,e.DiagnosticCategory.Message,"File_0_does_not_exist_according_to_earlier_cached_lookups_6240","File '{0}' does not exist according to earlier cached lookups."),Resolution_for_type_reference_directive_0_was_found_in_cache_from_location_1:t(6241,e.DiagnosticCategory.Message,"Resolution_for_type_reference_directive_0_was_found_in_cache_from_location_1_6241","Resolution for type reference directive '{0}' was found in cache from location '{1}'."),Resolving_type_reference_directive_0_containing_file_1:t(6242,e.DiagnosticCategory.Message,"Resolving_type_reference_directive_0_containing_file_1_6242","======== Resolving type reference directive '{0}', containing file '{1}'. ========"),Interpret_optional_property_types_as_written_rather_than_adding_undefined:t(6243,e.DiagnosticCategory.Message,"Interpret_optional_property_types_as_written_rather_than_adding_undefined_6243","Interpret optional property types as written, rather than adding 'undefined'."),Modules:t(6244,e.DiagnosticCategory.Message,"Modules_6244","Modules"),File_Management:t(6245,e.DiagnosticCategory.Message,"File_Management_6245","File Management"),Emit:t(6246,e.DiagnosticCategory.Message,"Emit_6246","Emit"),JavaScript_Support:t(6247,e.DiagnosticCategory.Message,"JavaScript_Support_6247","JavaScript Support"),Type_Checking:t(6248,e.DiagnosticCategory.Message,"Type_Checking_6248","Type Checking"),Editor_Support:t(6249,e.DiagnosticCategory.Message,"Editor_Support_6249","Editor Support"),Watch_and_Build_Modes:t(6250,e.DiagnosticCategory.Message,"Watch_and_Build_Modes_6250","Watch and Build Modes"),Compiler_Diagnostics:t(6251,e.DiagnosticCategory.Message,"Compiler_Diagnostics_6251","Compiler Diagnostics"),Interop_Constraints:t(6252,e.DiagnosticCategory.Message,"Interop_Constraints_6252","Interop Constraints"),Backwards_Compatibility:t(6253,e.DiagnosticCategory.Message,"Backwards_Compatibility_6253","Backwards Compatibility"),Language_and_Environment:t(6254,e.DiagnosticCategory.Message,"Language_and_Environment_6254","Language and Environment"),Projects:t(6255,e.DiagnosticCategory.Message,"Projects_6255","Projects"),Output_Formatting:t(6256,e.DiagnosticCategory.Message,"Output_Formatting_6256","Output Formatting"),Completeness:t(6257,e.DiagnosticCategory.Message,"Completeness_6257","Completeness"),_0_should_be_set_inside_the_compilerOptions_object_of_the_config_json_file:t(6258,e.DiagnosticCategory.Error,"_0_should_be_set_inside_the_compilerOptions_object_of_the_config_json_file_6258","'{0}' should be set inside the 'compilerOptions' object of the config json file"),Directory_0_has_no_containing_package_json_scope_Imports_will_not_resolve:t(6270,e.DiagnosticCategory.Message,"Directory_0_has_no_containing_package_json_scope_Imports_will_not_resolve_6270","Directory '{0}' has no containing package.json scope. Imports will not resolve."),Import_specifier_0_does_not_exist_in_package_json_scope_at_path_1:t(6271,e.DiagnosticCategory.Message,"Import_specifier_0_does_not_exist_in_package_json_scope_at_path_1_6271","Import specifier '{0}' does not exist in package.json scope at path '{1}'."),Invalid_import_specifier_0_has_no_possible_resolutions:t(6272,e.DiagnosticCategory.Message,"Invalid_import_specifier_0_has_no_possible_resolutions_6272","Invalid import specifier '{0}' has no possible resolutions."),package_json_scope_0_has_no_imports_defined:t(6273,e.DiagnosticCategory.Message,"package_json_scope_0_has_no_imports_defined_6273","package.json scope '{0}' has no imports defined."),package_json_scope_0_explicitly_maps_specifier_1_to_null:t(6274,e.DiagnosticCategory.Message,"package_json_scope_0_explicitly_maps_specifier_1_to_null_6274","package.json scope '{0}' explicitly maps specifier '{1}' to null."),package_json_scope_0_has_invalid_type_for_target_of_specifier_1:t(6275,e.DiagnosticCategory.Message,"package_json_scope_0_has_invalid_type_for_target_of_specifier_1_6275","package.json scope '{0}' has invalid type for target of specifier '{1}'"),Export_specifier_0_does_not_exist_in_package_json_scope_at_path_1:t(6276,e.DiagnosticCategory.Message,"Export_specifier_0_does_not_exist_in_package_json_scope_at_path_1_6276","Export specifier '{0}' does not exist in package.json scope at path '{1}'."),Enable_project_compilation:t(6302,e.DiagnosticCategory.Message,"Enable_project_compilation_6302","Enable project compilation"),Composite_projects_may_not_disable_declaration_emit:t(6304,e.DiagnosticCategory.Error,"Composite_projects_may_not_disable_declaration_emit_6304","Composite projects may not disable declaration emit."),Output_file_0_has_not_been_built_from_source_file_1:t(6305,e.DiagnosticCategory.Error,"Output_file_0_has_not_been_built_from_source_file_1_6305","Output file '{0}' has not been built from source file '{1}'."),Referenced_project_0_must_have_setting_composite_Colon_true:t(6306,e.DiagnosticCategory.Error,"Referenced_project_0_must_have_setting_composite_Colon_true_6306","Referenced project '{0}' must have setting \"composite\": true."),File_0_is_not_listed_within_the_file_list_of_project_1_Projects_must_list_all_files_or_use_an_include_pattern:t(6307,e.DiagnosticCategory.Error,"File_0_is_not_listed_within_the_file_list_of_project_1_Projects_must_list_all_files_or_use_an_includ_6307","File '{0}' is not listed within the file list of project '{1}'. Projects must list all files or use an 'include' pattern."),Cannot_prepend_project_0_because_it_does_not_have_outFile_set:t(6308,e.DiagnosticCategory.Error,"Cannot_prepend_project_0_because_it_does_not_have_outFile_set_6308","Cannot prepend project '{0}' because it does not have 'outFile' set"),Output_file_0_from_project_1_does_not_exist:t(6309,e.DiagnosticCategory.Error,"Output_file_0_from_project_1_does_not_exist_6309","Output file '{0}' from project '{1}' does not exist"),Referenced_project_0_may_not_disable_emit:t(6310,e.DiagnosticCategory.Error,"Referenced_project_0_may_not_disable_emit_6310","Referenced project '{0}' may not disable emit."),Project_0_is_out_of_date_because_oldest_output_1_is_older_than_newest_input_2:t(6350,e.DiagnosticCategory.Message,"Project_0_is_out_of_date_because_oldest_output_1_is_older_than_newest_input_2_6350","Project '{0}' is out of date because oldest output '{1}' is older than newest input '{2}'"),Project_0_is_up_to_date_because_newest_input_1_is_older_than_oldest_output_2:t(6351,e.DiagnosticCategory.Message,"Project_0_is_up_to_date_because_newest_input_1_is_older_than_oldest_output_2_6351","Project '{0}' is up to date because newest input '{1}' is older than oldest output '{2}'"),Project_0_is_out_of_date_because_output_file_1_does_not_exist:t(6352,e.DiagnosticCategory.Message,"Project_0_is_out_of_date_because_output_file_1_does_not_exist_6352","Project '{0}' is out of date because output file '{1}' does not exist"),Project_0_is_out_of_date_because_its_dependency_1_is_out_of_date:t(6353,e.DiagnosticCategory.Message,"Project_0_is_out_of_date_because_its_dependency_1_is_out_of_date_6353","Project '{0}' is out of date because its dependency '{1}' is out of date"),Project_0_is_up_to_date_with_d_ts_files_from_its_dependencies:t(6354,e.DiagnosticCategory.Message,"Project_0_is_up_to_date_with_d_ts_files_from_its_dependencies_6354","Project '{0}' is up to date with .d.ts files from its dependencies"),Projects_in_this_build_Colon_0:t(6355,e.DiagnosticCategory.Message,"Projects_in_this_build_Colon_0_6355","Projects in this build: {0}"),A_non_dry_build_would_delete_the_following_files_Colon_0:t(6356,e.DiagnosticCategory.Message,"A_non_dry_build_would_delete_the_following_files_Colon_0_6356","A non-dry build would delete the following files: {0}"),A_non_dry_build_would_build_project_0:t(6357,e.DiagnosticCategory.Message,"A_non_dry_build_would_build_project_0_6357","A non-dry build would build project '{0}'"),Building_project_0:t(6358,e.DiagnosticCategory.Message,"Building_project_0_6358","Building project '{0}'..."),Updating_output_timestamps_of_project_0:t(6359,e.DiagnosticCategory.Message,"Updating_output_timestamps_of_project_0_6359","Updating output timestamps of project '{0}'..."),Project_0_is_up_to_date:t(6361,e.DiagnosticCategory.Message,"Project_0_is_up_to_date_6361","Project '{0}' is up to date"),Skipping_build_of_project_0_because_its_dependency_1_has_errors:t(6362,e.DiagnosticCategory.Message,"Skipping_build_of_project_0_because_its_dependency_1_has_errors_6362","Skipping build of project '{0}' because its dependency '{1}' has errors"),Project_0_can_t_be_built_because_its_dependency_1_has_errors:t(6363,e.DiagnosticCategory.Message,"Project_0_can_t_be_built_because_its_dependency_1_has_errors_6363","Project '{0}' can't be built because its dependency '{1}' has errors"),Build_one_or_more_projects_and_their_dependencies_if_out_of_date:t(6364,e.DiagnosticCategory.Message,"Build_one_or_more_projects_and_their_dependencies_if_out_of_date_6364","Build one or more projects and their dependencies, if out of date"),Delete_the_outputs_of_all_projects:t(6365,e.DiagnosticCategory.Message,"Delete_the_outputs_of_all_projects_6365","Delete the outputs of all projects"),Show_what_would_be_built_or_deleted_if_specified_with_clean:t(6367,e.DiagnosticCategory.Message,"Show_what_would_be_built_or_deleted_if_specified_with_clean_6367","Show what would be built (or deleted, if specified with '--clean')"),Option_build_must_be_the_first_command_line_argument:t(6369,e.DiagnosticCategory.Error,"Option_build_must_be_the_first_command_line_argument_6369","Option '--build' must be the first command line argument."),Options_0_and_1_cannot_be_combined:t(6370,e.DiagnosticCategory.Error,"Options_0_and_1_cannot_be_combined_6370","Options '{0}' and '{1}' cannot be combined."),Updating_unchanged_output_timestamps_of_project_0:t(6371,e.DiagnosticCategory.Message,"Updating_unchanged_output_timestamps_of_project_0_6371","Updating unchanged output timestamps of project '{0}'..."),Project_0_is_out_of_date_because_output_of_its_dependency_1_has_changed:t(6372,e.DiagnosticCategory.Message,"Project_0_is_out_of_date_because_output_of_its_dependency_1_has_changed_6372","Project '{0}' is out of date because output of its dependency '{1}' has changed"),Updating_output_of_project_0:t(6373,e.DiagnosticCategory.Message,"Updating_output_of_project_0_6373","Updating output of project '{0}'..."),A_non_dry_build_would_update_timestamps_for_output_of_project_0:t(6374,e.DiagnosticCategory.Message,"A_non_dry_build_would_update_timestamps_for_output_of_project_0_6374","A non-dry build would update timestamps for output of project '{0}'"),A_non_dry_build_would_update_output_of_project_0:t(6375,e.DiagnosticCategory.Message,"A_non_dry_build_would_update_output_of_project_0_6375","A non-dry build would update output of project '{0}'"),Cannot_update_output_of_project_0_because_there_was_error_reading_file_1:t(6376,e.DiagnosticCategory.Message,"Cannot_update_output_of_project_0_because_there_was_error_reading_file_1_6376","Cannot update output of project '{0}' because there was error reading file '{1}'"),Cannot_write_file_0_because_it_will_overwrite_tsbuildinfo_file_generated_by_referenced_project_1:t(6377,e.DiagnosticCategory.Error,"Cannot_write_file_0_because_it_will_overwrite_tsbuildinfo_file_generated_by_referenced_project_1_6377","Cannot write file '{0}' because it will overwrite '.tsbuildinfo' file generated by referenced project '{1}'"),Enable_incremental_compilation:t(6378,e.DiagnosticCategory.Message,"Enable_incremental_compilation_6378","Enable incremental compilation"),Composite_projects_may_not_disable_incremental_compilation:t(6379,e.DiagnosticCategory.Error,"Composite_projects_may_not_disable_incremental_compilation_6379","Composite projects may not disable incremental compilation."),Specify_file_to_store_incremental_compilation_information:t(6380,e.DiagnosticCategory.Message,"Specify_file_to_store_incremental_compilation_information_6380","Specify file to store incremental compilation information"),Project_0_is_out_of_date_because_output_for_it_was_generated_with_version_1_that_differs_with_current_version_2:t(6381,e.DiagnosticCategory.Message,"Project_0_is_out_of_date_because_output_for_it_was_generated_with_version_1_that_differs_with_curren_6381","Project '{0}' is out of date because output for it was generated with version '{1}' that differs with current version '{2}'"),Skipping_build_of_project_0_because_its_dependency_1_was_not_built:t(6382,e.DiagnosticCategory.Message,"Skipping_build_of_project_0_because_its_dependency_1_was_not_built_6382","Skipping build of project '{0}' because its dependency '{1}' was not built"),Project_0_can_t_be_built_because_its_dependency_1_was_not_built:t(6383,e.DiagnosticCategory.Message,"Project_0_can_t_be_built_because_its_dependency_1_was_not_built_6383","Project '{0}' can't be built because its dependency '{1}' was not built"),Have_recompiles_in_incremental_and_watch_assume_that_changes_within_a_file_will_only_affect_files_directly_depending_on_it:t(6384,e.DiagnosticCategory.Message,"Have_recompiles_in_incremental_and_watch_assume_that_changes_within_a_file_will_only_affect_files_di_6384","Have recompiles in '--incremental' and '--watch' assume that changes within a file will only affect files directly depending on it."),_0_is_deprecated:t(6385,e.DiagnosticCategory.Suggestion,"_0_is_deprecated_6385","'{0}' is deprecated.",void 0,void 0,!0),Performance_timings_for_diagnostics_or_extendedDiagnostics_are_not_available_in_this_session_A_native_implementation_of_the_Web_Performance_API_could_not_be_found:t(6386,e.DiagnosticCategory.Message,"Performance_timings_for_diagnostics_or_extendedDiagnostics_are_not_available_in_this_session_A_nativ_6386","Performance timings for '--diagnostics' or '--extendedDiagnostics' are not available in this session. A native implementation of the Web Performance API could not be found."),The_signature_0_of_1_is_deprecated:t(6387,e.DiagnosticCategory.Suggestion,"The_signature_0_of_1_is_deprecated_6387","The signature '{0}' of '{1}' is deprecated.",void 0,void 0,!0),Project_0_is_being_forcibly_rebuilt:t(6388,e.DiagnosticCategory.Message,"Project_0_is_being_forcibly_rebuilt_6388","Project '{0}' is being forcibly rebuilt"),Reusing_resolution_of_module_0_from_1_of_old_program_it_was_not_resolved:t(6389,e.DiagnosticCategory.Message,"Reusing_resolution_of_module_0_from_1_of_old_program_it_was_not_resolved_6389","Reusing resolution of module '{0}' from '{1}' of old program, it was not resolved."),Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_successfully_resolved_to_2:t(6390,e.DiagnosticCategory.Message,"Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_successfully_resolved__6390","Reusing resolution of type reference directive '{0}' from '{1}' of old program, it was successfully resolved to '{2}'."),Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package_ID_3:t(6391,e.DiagnosticCategory.Message,"Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_successfully_resolved__6391","Reusing resolution of type reference directive '{0}' from '{1}' of old program, it was successfully resolved to '{2}' with Package ID '{3}'."),Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_not_resolved:t(6392,e.DiagnosticCategory.Message,"Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_not_resolved_6392","Reusing resolution of type reference directive '{0}' from '{1}' of old program, it was not resolved."),Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_3:t(6393,e.DiagnosticCategory.Message,"Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_6393","Reusing resolution of module '{0}' from '{1}' found in cache from location '{2}', it was successfully resolved to '{3}'."),Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_3_with_Package_ID_4:t(6394,e.DiagnosticCategory.Message,"Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_6394","Reusing resolution of module '{0}' from '{1}' found in cache from location '{2}', it was successfully resolved to '{3}' with Package ID '{4}'."),Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_not_resolved:t(6395,e.DiagnosticCategory.Message,"Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_not_resolved_6395","Reusing resolution of module '{0}' from '{1}' found in cache from location '{2}', it was not resolved."),Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_3:t(6396,e.DiagnosticCategory.Message,"Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_succes_6396","Reusing resolution of type reference directive '{0}' from '{1}' found in cache from location '{2}', it was successfully resolved to '{3}'."),Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_3_with_Package_ID_4:t(6397,e.DiagnosticCategory.Message,"Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_succes_6397","Reusing resolution of type reference directive '{0}' from '{1}' found in cache from location '{2}', it was successfully resolved to '{3}' with Package ID '{4}'."),Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_not_resolved:t(6398,e.DiagnosticCategory.Message,"Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_not_re_6398","Reusing resolution of type reference directive '{0}' from '{1}' found in cache from location '{2}', it was not resolved."),The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1:t(6500,e.DiagnosticCategory.Message,"The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1_6500","The expected type comes from property '{0}' which is declared here on type '{1}'"),The_expected_type_comes_from_this_index_signature:t(6501,e.DiagnosticCategory.Message,"The_expected_type_comes_from_this_index_signature_6501","The expected type comes from this index signature."),The_expected_type_comes_from_the_return_type_of_this_signature:t(6502,e.DiagnosticCategory.Message,"The_expected_type_comes_from_the_return_type_of_this_signature_6502","The expected type comes from the return type of this signature."),Print_names_of_files_that_are_part_of_the_compilation_and_then_stop_processing:t(6503,e.DiagnosticCategory.Message,"Print_names_of_files_that_are_part_of_the_compilation_and_then_stop_processing_6503","Print names of files that are part of the compilation and then stop processing."),File_0_is_a_JavaScript_file_Did_you_mean_to_enable_the_allowJs_option:t(6504,e.DiagnosticCategory.Error,"File_0_is_a_JavaScript_file_Did_you_mean_to_enable_the_allowJs_option_6504","File '{0}' is a JavaScript file. Did you mean to enable the 'allowJs' option?"),Print_names_of_files_and_the_reason_they_are_part_of_the_compilation:t(6505,e.DiagnosticCategory.Message,"Print_names_of_files_and_the_reason_they_are_part_of_the_compilation_6505","Print names of files and the reason they are part of the compilation."),Consider_adding_a_declare_modifier_to_this_class:t(6506,e.DiagnosticCategory.Message,"Consider_adding_a_declare_modifier_to_this_class_6506","Consider adding a 'declare' modifier to this class."),Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJS_option_to_get_errors_from_these_files:t(6600,e.DiagnosticCategory.Message,"Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJS_option_to_get_errors_from_these__6600","Allow JavaScript files to be a part of your program. Use the `checkJS` option to get errors from these files."),Allow_import_x_from_y_when_a_module_doesn_t_have_a_default_export:t(6601,e.DiagnosticCategory.Message,"Allow_import_x_from_y_when_a_module_doesn_t_have_a_default_export_6601","Allow 'import x from y' when a module doesn't have a default export."),Allow_accessing_UMD_globals_from_modules:t(6602,e.DiagnosticCategory.Message,"Allow_accessing_UMD_globals_from_modules_6602","Allow accessing UMD globals from modules."),Disable_error_reporting_for_unreachable_code:t(6603,e.DiagnosticCategory.Message,"Disable_error_reporting_for_unreachable_code_6603","Disable error reporting for unreachable code."),Disable_error_reporting_for_unused_labels:t(6604,e.DiagnosticCategory.Message,"Disable_error_reporting_for_unused_labels_6604","Disable error reporting for unused labels."),Ensure_use_strict_is_always_emitted:t(6605,e.DiagnosticCategory.Message,"Ensure_use_strict_is_always_emitted_6605","Ensure 'use strict' is always emitted."),Have_recompiles_in_projects_that_use_incremental_and_watch_mode_assume_that_changes_within_a_file_will_only_affect_files_directly_depending_on_it:t(6606,e.DiagnosticCategory.Message,"Have_recompiles_in_projects_that_use_incremental_and_watch_mode_assume_that_changes_within_a_file_wi_6606","Have recompiles in projects that use `incremental` and `watch` mode assume that changes within a file will only affect files directly depending on it."),Specify_the_base_directory_to_resolve_non_relative_module_names:t(6607,e.DiagnosticCategory.Message,"Specify_the_base_directory_to_resolve_non_relative_module_names_6607","Specify the base directory to resolve non-relative module names."),No_longer_supported_In_early_versions_manually_set_the_text_encoding_for_reading_files:t(6608,e.DiagnosticCategory.Message,"No_longer_supported_In_early_versions_manually_set_the_text_encoding_for_reading_files_6608","No longer supported. In early versions, manually set the text encoding for reading files."),Enable_error_reporting_in_type_checked_JavaScript_files:t(6609,e.DiagnosticCategory.Message,"Enable_error_reporting_in_type_checked_JavaScript_files_6609","Enable error reporting in type-checked JavaScript files."),Enable_constraints_that_allow_a_TypeScript_project_to_be_used_with_project_references:t(6611,e.DiagnosticCategory.Message,"Enable_constraints_that_allow_a_TypeScript_project_to_be_used_with_project_references_6611","Enable constraints that allow a TypeScript project to be used with project references."),Generate_d_ts_files_from_TypeScript_and_JavaScript_files_in_your_project:t(6612,e.DiagnosticCategory.Message,"Generate_d_ts_files_from_TypeScript_and_JavaScript_files_in_your_project_6612","Generate .d.ts files from TypeScript and JavaScript files in your project."),Specify_the_output_directory_for_generated_declaration_files:t(6613,e.DiagnosticCategory.Message,"Specify_the_output_directory_for_generated_declaration_files_6613","Specify the output directory for generated declaration files."),Create_sourcemaps_for_d_ts_files:t(6614,e.DiagnosticCategory.Message,"Create_sourcemaps_for_d_ts_files_6614","Create sourcemaps for d.ts files."),Output_compiler_performance_information_after_building:t(6615,e.DiagnosticCategory.Message,"Output_compiler_performance_information_after_building_6615","Output compiler performance information after building."),Disables_inference_for_type_acquisition_by_looking_at_filenames_in_a_project:t(6616,e.DiagnosticCategory.Message,"Disables_inference_for_type_acquisition_by_looking_at_filenames_in_a_project_6616","Disables inference for type acquisition by looking at filenames in a project."),Reduce_the_number_of_projects_loaded_automatically_by_TypeScript:t(6617,e.DiagnosticCategory.Message,"Reduce_the_number_of_projects_loaded_automatically_by_TypeScript_6617","Reduce the number of projects loaded automatically by TypeScript."),Remove_the_20mb_cap_on_total_source_code_size_for_JavaScript_files_in_the_TypeScript_language_server:t(6618,e.DiagnosticCategory.Message,"Remove_the_20mb_cap_on_total_source_code_size_for_JavaScript_files_in_the_TypeScript_language_server_6618","Remove the 20mb cap on total source code size for JavaScript files in the TypeScript language server."),Opt_a_project_out_of_multi_project_reference_checking_when_editing:t(6619,e.DiagnosticCategory.Message,"Opt_a_project_out_of_multi_project_reference_checking_when_editing_6619","Opt a project out of multi-project reference checking when editing."),Disable_preferring_source_files_instead_of_declaration_files_when_referencing_composite_projects:t(6620,e.DiagnosticCategory.Message,"Disable_preferring_source_files_instead_of_declaration_files_when_referencing_composite_projects_6620","Disable preferring source files instead of declaration files when referencing composite projects"),Emit_more_compliant_but_verbose_and_less_performant_JavaScript_for_iteration:t(6621,e.DiagnosticCategory.Message,"Emit_more_compliant_but_verbose_and_less_performant_JavaScript_for_iteration_6621","Emit more compliant, but verbose and less performant JavaScript for iteration."),Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files:t(6622,e.DiagnosticCategory.Message,"Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files_6622","Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files."),Only_output_d_ts_files_and_not_JavaScript_files:t(6623,e.DiagnosticCategory.Message,"Only_output_d_ts_files_and_not_JavaScript_files_6623","Only output d.ts files and not JavaScript files."),Emit_design_type_metadata_for_decorated_declarations_in_source_files:t(6624,e.DiagnosticCategory.Message,"Emit_design_type_metadata_for_decorated_declarations_in_source_files_6624","Emit design-type metadata for decorated declarations in source files."),Disable_the_type_acquisition_for_JavaScript_projects:t(6625,e.DiagnosticCategory.Message,"Disable_the_type_acquisition_for_JavaScript_projects_6625","Disable the type acquisition for JavaScript projects"),Emit_additional_JavaScript_to_ease_support_for_importing_CommonJS_modules_This_enables_allowSyntheticDefaultImports_for_type_compatibility:t(6626,e.DiagnosticCategory.Message,"Emit_additional_JavaScript_to_ease_support_for_importing_CommonJS_modules_This_enables_allowSyntheti_6626","Emit additional JavaScript to ease support for importing CommonJS modules. This enables `allowSyntheticDefaultImports` for type compatibility."),Filters_results_from_the_include_option:t(6627,e.DiagnosticCategory.Message,"Filters_results_from_the_include_option_6627","Filters results from the `include` option."),Remove_a_list_of_directories_from_the_watch_process:t(6628,e.DiagnosticCategory.Message,"Remove_a_list_of_directories_from_the_watch_process_6628","Remove a list of directories from the watch process."),Remove_a_list_of_files_from_the_watch_mode_s_processing:t(6629,e.DiagnosticCategory.Message,"Remove_a_list_of_files_from_the_watch_mode_s_processing_6629","Remove a list of files from the watch mode's processing."),Enable_experimental_support_for_TC39_stage_2_draft_decorators:t(6630,e.DiagnosticCategory.Message,"Enable_experimental_support_for_TC39_stage_2_draft_decorators_6630","Enable experimental support for TC39 stage 2 draft decorators."),Print_files_read_during_the_compilation_including_why_it_was_included:t(6631,e.DiagnosticCategory.Message,"Print_files_read_during_the_compilation_including_why_it_was_included_6631","Print files read during the compilation including why it was included."),Output_more_detailed_compiler_performance_information_after_building:t(6632,e.DiagnosticCategory.Message,"Output_more_detailed_compiler_performance_information_after_building_6632","Output more detailed compiler performance information after building."),Specify_one_or_more_path_or_node_module_references_to_base_configuration_files_from_which_settings_are_inherited:t(6633,e.DiagnosticCategory.Message,"Specify_one_or_more_path_or_node_module_references_to_base_configuration_files_from_which_settings_a_6633","Specify one or more path or node module references to base configuration files from which settings are inherited."),Specify_what_approach_the_watcher_should_use_if_the_system_runs_out_of_native_file_watchers:t(6634,e.DiagnosticCategory.Message,"Specify_what_approach_the_watcher_should_use_if_the_system_runs_out_of_native_file_watchers_6634","Specify what approach the watcher should use if the system runs out of native file watchers."),Include_a_list_of_files_This_does_not_support_glob_patterns_as_opposed_to_include:t(6635,e.DiagnosticCategory.Message,"Include_a_list_of_files_This_does_not_support_glob_patterns_as_opposed_to_include_6635","Include a list of files. This does not support glob patterns, as opposed to `include`."),Build_all_projects_including_those_that_appear_to_be_up_to_date:t(6636,e.DiagnosticCategory.Message,"Build_all_projects_including_those_that_appear_to_be_up_to_date_6636","Build all projects, including those that appear to be up to date"),Ensure_that_casing_is_correct_in_imports:t(6637,e.DiagnosticCategory.Message,"Ensure_that_casing_is_correct_in_imports_6637","Ensure that casing is correct in imports."),Emit_a_v8_CPU_profile_of_the_compiler_run_for_debugging:t(6638,e.DiagnosticCategory.Message,"Emit_a_v8_CPU_profile_of_the_compiler_run_for_debugging_6638","Emit a v8 CPU profile of the compiler run for debugging."),Allow_importing_helper_functions_from_tslib_once_per_project_instead_of_including_them_per_file:t(6639,e.DiagnosticCategory.Message,"Allow_importing_helper_functions_from_tslib_once_per_project_instead_of_including_them_per_file_6639","Allow importing helper functions from tslib once per project, instead of including them per-file."),Specify_a_list_of_glob_patterns_that_match_files_to_be_included_in_compilation:t(6641,e.DiagnosticCategory.Message,"Specify_a_list_of_glob_patterns_that_match_files_to_be_included_in_compilation_6641","Specify a list of glob patterns that match files to be included in compilation."),Save_tsbuildinfo_files_to_allow_for_incremental_compilation_of_projects:t(6642,e.DiagnosticCategory.Message,"Save_tsbuildinfo_files_to_allow_for_incremental_compilation_of_projects_6642","Save .tsbuildinfo files to allow for incremental compilation of projects."),Include_sourcemap_files_inside_the_emitted_JavaScript:t(6643,e.DiagnosticCategory.Message,"Include_sourcemap_files_inside_the_emitted_JavaScript_6643","Include sourcemap files inside the emitted JavaScript."),Include_source_code_in_the_sourcemaps_inside_the_emitted_JavaScript:t(6644,e.DiagnosticCategory.Message,"Include_source_code_in_the_sourcemaps_inside_the_emitted_JavaScript_6644","Include source code in the sourcemaps inside the emitted JavaScript."),Ensure_that_each_file_can_be_safely_transpiled_without_relying_on_other_imports:t(6645,e.DiagnosticCategory.Message,"Ensure_that_each_file_can_be_safely_transpiled_without_relying_on_other_imports_6645","Ensure that each file can be safely transpiled without relying on other imports."),Specify_what_JSX_code_is_generated:t(6646,e.DiagnosticCategory.Message,"Specify_what_JSX_code_is_generated_6646","Specify what JSX code is generated."),Specify_the_JSX_factory_function_used_when_targeting_React_JSX_emit_e_g_React_createElement_or_h:t(6647,e.DiagnosticCategory.Message,"Specify_the_JSX_factory_function_used_when_targeting_React_JSX_emit_e_g_React_createElement_or_h_6647","Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'"),Specify_the_JSX_Fragment_reference_used_for_fragments_when_targeting_React_JSX_emit_e_g_React_Fragment_or_Fragment:t(6648,e.DiagnosticCategory.Message,"Specify_the_JSX_Fragment_reference_used_for_fragments_when_targeting_React_JSX_emit_e_g_React_Fragme_6648","Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'."),Specify_module_specifier_used_to_import_the_JSX_factory_functions_when_using_jsx_Colon_react_jsx_Asterisk:t(6649,e.DiagnosticCategory.Message,"Specify_module_specifier_used_to_import_the_JSX_factory_functions_when_using_jsx_Colon_react_jsx_Ast_6649","Specify module specifier used to import the JSX factory functions when using `jsx: react-jsx*`.`"),Make_keyof_only_return_strings_instead_of_string_numbers_or_symbols_Legacy_option:t(6650,e.DiagnosticCategory.Message,"Make_keyof_only_return_strings_instead_of_string_numbers_or_symbols_Legacy_option_6650","Make keyof only return strings instead of string, numbers or symbols. Legacy option."),Specify_a_set_of_bundled_library_declaration_files_that_describe_the_target_runtime_environment:t(6651,e.DiagnosticCategory.Message,"Specify_a_set_of_bundled_library_declaration_files_that_describe_the_target_runtime_environment_6651","Specify a set of bundled library declaration files that describe the target runtime environment."),Print_the_names_of_emitted_files_after_a_compilation:t(6652,e.DiagnosticCategory.Message,"Print_the_names_of_emitted_files_after_a_compilation_6652","Print the names of emitted files after a compilation."),Print_all_of_the_files_read_during_the_compilation:t(6653,e.DiagnosticCategory.Message,"Print_all_of_the_files_read_during_the_compilation_6653","Print all of the files read during the compilation."),Set_the_language_of_the_messaging_from_TypeScript_This_does_not_affect_emit:t(6654,e.DiagnosticCategory.Message,"Set_the_language_of_the_messaging_from_TypeScript_This_does_not_affect_emit_6654","Set the language of the messaging from TypeScript. This does not affect emit."),Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations:t(6655,e.DiagnosticCategory.Message,"Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations_6655","Specify the location where debugger should locate map files instead of generated locations."),Specify_the_maximum_folder_depth_used_for_checking_JavaScript_files_from_node_modules_Only_applicable_with_allowJs:t(6656,e.DiagnosticCategory.Message,"Specify_the_maximum_folder_depth_used_for_checking_JavaScript_files_from_node_modules_Only_applicabl_6656","Specify the maximum folder depth used for checking JavaScript files from `node_modules`. Only applicable with `allowJs`."),Specify_what_module_code_is_generated:t(6657,e.DiagnosticCategory.Message,"Specify_what_module_code_is_generated_6657","Specify what module code is generated."),Specify_how_TypeScript_looks_up_a_file_from_a_given_module_specifier:t(6658,e.DiagnosticCategory.Message,"Specify_how_TypeScript_looks_up_a_file_from_a_given_module_specifier_6658","Specify how TypeScript looks up a file from a given module specifier."),Set_the_newline_character_for_emitting_files:t(6659,e.DiagnosticCategory.Message,"Set_the_newline_character_for_emitting_files_6659","Set the newline character for emitting files."),Disable_emitting_files_from_a_compilation:t(6660,e.DiagnosticCategory.Message,"Disable_emitting_files_from_a_compilation_6660","Disable emitting files from a compilation."),Disable_generating_custom_helper_functions_like_extends_in_compiled_output:t(6661,e.DiagnosticCategory.Message,"Disable_generating_custom_helper_functions_like_extends_in_compiled_output_6661","Disable generating custom helper functions like `__extends` in compiled output."),Disable_emitting_files_if_any_type_checking_errors_are_reported:t(6662,e.DiagnosticCategory.Message,"Disable_emitting_files_if_any_type_checking_errors_are_reported_6662","Disable emitting files if any type checking errors are reported."),Disable_truncating_types_in_error_messages:t(6663,e.DiagnosticCategory.Message,"Disable_truncating_types_in_error_messages_6663","Disable truncating types in error messages."),Enable_error_reporting_for_fallthrough_cases_in_switch_statements:t(6664,e.DiagnosticCategory.Message,"Enable_error_reporting_for_fallthrough_cases_in_switch_statements_6664","Enable error reporting for fallthrough cases in switch statements."),Enable_error_reporting_for_expressions_and_declarations_with_an_implied_any_type:t(6665,e.DiagnosticCategory.Message,"Enable_error_reporting_for_expressions_and_declarations_with_an_implied_any_type_6665","Enable error reporting for expressions and declarations with an implied `any` type.."),Ensure_overriding_members_in_derived_classes_are_marked_with_an_override_modifier:t(6666,e.DiagnosticCategory.Message,"Ensure_overriding_members_in_derived_classes_are_marked_with_an_override_modifier_6666","Ensure overriding members in derived classes are marked with an override modifier."),Enable_error_reporting_for_codepaths_that_do_not_explicitly_return_in_a_function:t(6667,e.DiagnosticCategory.Message,"Enable_error_reporting_for_codepaths_that_do_not_explicitly_return_in_a_function_6667","Enable error reporting for codepaths that do not explicitly return in a function."),Enable_error_reporting_when_this_is_given_the_type_any:t(6668,e.DiagnosticCategory.Message,"Enable_error_reporting_when_this_is_given_the_type_any_6668","Enable error reporting when `this` is given the type `any`."),Disable_adding_use_strict_directives_in_emitted_JavaScript_files:t(6669,e.DiagnosticCategory.Message,"Disable_adding_use_strict_directives_in_emitted_JavaScript_files_6669","Disable adding 'use strict' directives in emitted JavaScript files."),Disable_including_any_library_files_including_the_default_lib_d_ts:t(6670,e.DiagnosticCategory.Message,"Disable_including_any_library_files_including_the_default_lib_d_ts_6670","Disable including any library files, including the default lib.d.ts."),Enforces_using_indexed_accessors_for_keys_declared_using_an_indexed_type:t(6671,e.DiagnosticCategory.Message,"Enforces_using_indexed_accessors_for_keys_declared_using_an_indexed_type_6671","Enforces using indexed accessors for keys declared using an indexed type"),Disallow_import_s_require_s_or_reference_s_from_expanding_the_number_of_files_TypeScript_should_add_to_a_project:t(6672,e.DiagnosticCategory.Message,"Disallow_import_s_require_s_or_reference_s_from_expanding_the_number_of_files_TypeScript_should_add__6672","Disallow `import`s, `require`s or `<reference>`s from expanding the number of files TypeScript should add to a project."),Disable_strict_checking_of_generic_signatures_in_function_types:t(6673,e.DiagnosticCategory.Message,"Disable_strict_checking_of_generic_signatures_in_function_types_6673","Disable strict checking of generic signatures in function types."),Add_undefined_to_a_type_when_accessed_using_an_index:t(6674,e.DiagnosticCategory.Message,"Add_undefined_to_a_type_when_accessed_using_an_index_6674","Add `undefined` to a type when accessed using an index."),Enable_error_reporting_when_a_local_variables_aren_t_read:t(6675,e.DiagnosticCategory.Message,"Enable_error_reporting_when_a_local_variables_aren_t_read_6675","Enable error reporting when a local variables aren't read."),Raise_an_error_when_a_function_parameter_isn_t_read:t(6676,e.DiagnosticCategory.Message,"Raise_an_error_when_a_function_parameter_isn_t_read_6676","Raise an error when a function parameter isn't read"),Deprecated_setting_Use_outFile_instead:t(6677,e.DiagnosticCategory.Message,"Deprecated_setting_Use_outFile_instead_6677","Deprecated setting. Use `outFile` instead."),Specify_an_output_folder_for_all_emitted_files:t(6678,e.DiagnosticCategory.Message,"Specify_an_output_folder_for_all_emitted_files_6678","Specify an output folder for all emitted files."),Specify_a_file_that_bundles_all_outputs_into_one_JavaScript_file_If_declaration_is_true_also_designates_a_file_that_bundles_all_d_ts_output:t(6679,e.DiagnosticCategory.Message,"Specify_a_file_that_bundles_all_outputs_into_one_JavaScript_file_If_declaration_is_true_also_designa_6679","Specify a file that bundles all outputs into one JavaScript file. If `declaration` is true, also designates a file that bundles all .d.ts output."),Specify_a_set_of_entries_that_re_map_imports_to_additional_lookup_locations:t(6680,e.DiagnosticCategory.Message,"Specify_a_set_of_entries_that_re_map_imports_to_additional_lookup_locations_6680","Specify a set of entries that re-map imports to additional lookup locations."),Specify_a_list_of_language_service_plugins_to_include:t(6681,e.DiagnosticCategory.Message,"Specify_a_list_of_language_service_plugins_to_include_6681","Specify a list of language service plugins to include."),Disable_erasing_const_enum_declarations_in_generated_code:t(6682,e.DiagnosticCategory.Message,"Disable_erasing_const_enum_declarations_in_generated_code_6682","Disable erasing `const enum` declarations in generated code."),Disable_resolving_symlinks_to_their_realpath_This_correlates_to_the_same_flag_in_node:t(6683,e.DiagnosticCategory.Message,"Disable_resolving_symlinks_to_their_realpath_This_correlates_to_the_same_flag_in_node_6683","Disable resolving symlinks to their realpath. This correlates to the same flag in node."),Disable_wiping_the_console_in_watch_mode:t(6684,e.DiagnosticCategory.Message,"Disable_wiping_the_console_in_watch_mode_6684","Disable wiping the console in watch mode"),Enable_color_and_formatting_in_TypeScript_s_output_to_make_compiler_errors_easier_to_read:t(6685,e.DiagnosticCategory.Message,"Enable_color_and_formatting_in_TypeScript_s_output_to_make_compiler_errors_easier_to_read_6685","Enable color and formatting in TypeScript's output to make compiler errors easier to read"),Specify_the_object_invoked_for_createElement_This_only_applies_when_targeting_react_JSX_emit:t(6686,e.DiagnosticCategory.Message,"Specify_the_object_invoked_for_createElement_This_only_applies_when_targeting_react_JSX_emit_6686","Specify the object invoked for `createElement`. This only applies when targeting `react` JSX emit."),Specify_an_array_of_objects_that_specify_paths_for_projects_Used_in_project_references:t(6687,e.DiagnosticCategory.Message,"Specify_an_array_of_objects_that_specify_paths_for_projects_Used_in_project_references_6687","Specify an array of objects that specify paths for projects. Used in project references."),Disable_emitting_comments:t(6688,e.DiagnosticCategory.Message,"Disable_emitting_comments_6688","Disable emitting comments."),Enable_importing_json_files:t(6689,e.DiagnosticCategory.Message,"Enable_importing_json_files_6689","Enable importing .json files"),Specify_the_root_folder_within_your_source_files:t(6690,e.DiagnosticCategory.Message,"Specify_the_root_folder_within_your_source_files_6690","Specify the root folder within your source files."),Allow_multiple_folders_to_be_treated_as_one_when_resolving_modules:t(6691,e.DiagnosticCategory.Message,"Allow_multiple_folders_to_be_treated_as_one_when_resolving_modules_6691","Allow multiple folders to be treated as one when resolving modules."),Skip_type_checking_d_ts_files_that_are_included_with_TypeScript:t(6692,e.DiagnosticCategory.Message,"Skip_type_checking_d_ts_files_that_are_included_with_TypeScript_6692","Skip type checking .d.ts files that are included with TypeScript."),Skip_type_checking_all_d_ts_files:t(6693,e.DiagnosticCategory.Message,"Skip_type_checking_all_d_ts_files_6693","Skip type checking all .d.ts files."),Create_source_map_files_for_emitted_JavaScript_files:t(6694,e.DiagnosticCategory.Message,"Create_source_map_files_for_emitted_JavaScript_files_6694","Create source map files for emitted JavaScript files."),Specify_the_root_path_for_debuggers_to_find_the_reference_source_code:t(6695,e.DiagnosticCategory.Message,"Specify_the_root_path_for_debuggers_to_find_the_reference_source_code_6695","Specify the root path for debuggers to find the reference source code."),Check_that_the_arguments_for_bind_call_and_apply_methods_match_the_original_function:t(6697,e.DiagnosticCategory.Message,"Check_that_the_arguments_for_bind_call_and_apply_methods_match_the_original_function_6697","Check that the arguments for `bind`, `call`, and `apply` methods match the original function."),When_assigning_functions_check_to_ensure_parameters_and_the_return_values_are_subtype_compatible:t(6698,e.DiagnosticCategory.Message,"When_assigning_functions_check_to_ensure_parameters_and_the_return_values_are_subtype_compatible_6698","When assigning functions, check to ensure parameters and the return values are subtype-compatible."),When_type_checking_take_into_account_null_and_undefined:t(6699,e.DiagnosticCategory.Message,"When_type_checking_take_into_account_null_and_undefined_6699","When type checking, take into account `null` and `undefined`."),Check_for_class_properties_that_are_declared_but_not_set_in_the_constructor:t(6700,e.DiagnosticCategory.Message,"Check_for_class_properties_that_are_declared_but_not_set_in_the_constructor_6700","Check for class properties that are declared but not set in the constructor."),Disable_emitting_declarations_that_have_internal_in_their_JSDoc_comments:t(6701,e.DiagnosticCategory.Message,"Disable_emitting_declarations_that_have_internal_in_their_JSDoc_comments_6701","Disable emitting declarations that have `@internal` in their JSDoc comments."),Disable_reporting_of_excess_property_errors_during_the_creation_of_object_literals:t(6702,e.DiagnosticCategory.Message,"Disable_reporting_of_excess_property_errors_during_the_creation_of_object_literals_6702","Disable reporting of excess property errors during the creation of object literals."),Suppress_noImplicitAny_errors_when_indexing_objects_that_lack_index_signatures:t(6703,e.DiagnosticCategory.Message,"Suppress_noImplicitAny_errors_when_indexing_objects_that_lack_index_signatures_6703","Suppress `noImplicitAny` errors when indexing objects that lack index signatures."),Synchronously_call_callbacks_and_update_the_state_of_directory_watchers_on_platforms_that_don_t_support_recursive_watching_natively:t(6704,e.DiagnosticCategory.Message,"Synchronously_call_callbacks_and_update_the_state_of_directory_watchers_on_platforms_that_don_t_supp_6704","Synchronously call callbacks and update the state of directory watchers on platforms that don`t support recursive watching natively."),Set_the_JavaScript_language_version_for_emitted_JavaScript_and_include_compatible_library_declarations:t(6705,e.DiagnosticCategory.Message,"Set_the_JavaScript_language_version_for_emitted_JavaScript_and_include_compatible_library_declaratio_6705","Set the JavaScript language version for emitted JavaScript and include compatible library declarations."),Log_paths_used_during_the_moduleResolution_process:t(6706,e.DiagnosticCategory.Message,"Log_paths_used_during_the_moduleResolution_process_6706","Log paths used during the `moduleResolution` process."),Specify_the_folder_for_tsbuildinfo_incremental_compilation_files:t(6707,e.DiagnosticCategory.Message,"Specify_the_folder_for_tsbuildinfo_incremental_compilation_files_6707","Specify the folder for .tsbuildinfo incremental compilation files."),Specify_options_for_automatic_acquisition_of_declaration_files:t(6709,e.DiagnosticCategory.Message,"Specify_options_for_automatic_acquisition_of_declaration_files_6709","Specify options for automatic acquisition of declaration files."),Specify_multiple_folders_that_act_like_Slashnode_modules_Slash_types:t(6710,e.DiagnosticCategory.Message,"Specify_multiple_folders_that_act_like_Slashnode_modules_Slash_types_6710","Specify multiple folders that act like `./node_modules/@types`."),Specify_type_package_names_to_be_included_without_being_referenced_in_a_source_file:t(6711,e.DiagnosticCategory.Message,"Specify_type_package_names_to_be_included_without_being_referenced_in_a_source_file_6711","Specify type package names to be included without being referenced in a source file."),Emit_ECMAScript_standard_compliant_class_fields:t(6712,e.DiagnosticCategory.Message,"Emit_ECMAScript_standard_compliant_class_fields_6712","Emit ECMAScript-standard-compliant class fields."),Enable_verbose_logging:t(6713,e.DiagnosticCategory.Message,"Enable_verbose_logging_6713","Enable verbose logging"),Specify_how_directories_are_watched_on_systems_that_lack_recursive_file_watching_functionality:t(6714,e.DiagnosticCategory.Message,"Specify_how_directories_are_watched_on_systems_that_lack_recursive_file_watching_functionality_6714","Specify how directories are watched on systems that lack recursive file-watching functionality."),Specify_how_the_TypeScript_watch_mode_works:t(6715,e.DiagnosticCategory.Message,"Specify_how_the_TypeScript_watch_mode_works_6715","Specify how the TypeScript watch mode works."),Include_undefined_in_index_signature_results:t(6716,e.DiagnosticCategory.Message,"Include_undefined_in_index_signature_results_6716","Include 'undefined' in index signature results"),Require_undeclared_properties_from_index_signatures_to_use_element_accesses:t(6717,e.DiagnosticCategory.Message,"Require_undeclared_properties_from_index_signatures_to_use_element_accesses_6717","Require undeclared properties from index signatures to use element accesses."),Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types:t(6718,e.DiagnosticCategory.Message,"Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types_6718","Specify emit/checking behavior for imports that are only used for types"),Type_catch_clause_variables_as_unknown_instead_of_any:t(6803,e.DiagnosticCategory.Message,"Type_catch_clause_variables_as_unknown_instead_of_any_6803","Type catch clause variables as 'unknown' instead of 'any'."),one_of_Colon:t(6900,e.DiagnosticCategory.Message,"one_of_Colon_6900","one of:"),one_or_more_Colon:t(6901,e.DiagnosticCategory.Message,"one_or_more_Colon_6901","one or more:"),type_Colon:t(6902,e.DiagnosticCategory.Message,"type_Colon_6902","type:"),default_Colon:t(6903,e.DiagnosticCategory.Message,"default_Colon_6903","default:"),module_system_or_esModuleInterop:t(6904,e.DiagnosticCategory.Message,"module_system_or_esModuleInterop_6904",'module === "system" or esModuleInterop'),false_unless_strict_is_set:t(6905,e.DiagnosticCategory.Message,"false_unless_strict_is_set_6905","`false`, unless `strict` is set"),false_unless_composite_is_set:t(6906,e.DiagnosticCategory.Message,"false_unless_composite_is_set_6906","`false`, unless `composite` is set"),node_modules_bower_components_jspm_packages_plus_the_value_of_outDir_if_one_is_specified:t(6907,e.DiagnosticCategory.Message,"node_modules_bower_components_jspm_packages_plus_the_value_of_outDir_if_one_is_specified_6907",'`["node_modules", "bower_components", "jspm_packages"]`, plus the value of `outDir` if one is specified.'),if_files_is_specified_otherwise_Asterisk_Asterisk_Slash_Asterisk:t(6908,e.DiagnosticCategory.Message,"if_files_is_specified_otherwise_Asterisk_Asterisk_Slash_Asterisk_6908",'`[]` if `files` is specified, otherwise `["**/*"]`'),true_if_composite_false_otherwise:t(6909,e.DiagnosticCategory.Message,"true_if_composite_false_otherwise_6909","`true` if `composite`, `false` otherwise"),module_AMD_or_UMD_or_System_or_ES6_then_Classic_Otherwise_Node:t(69010,e.DiagnosticCategory.Message,"module_AMD_or_UMD_or_System_or_ES6_then_Classic_Otherwise_Node_69010","module === `AMD` or `UMD` or `System` or `ES6`, then `Classic`, Otherwise `Node`"),Computed_from_the_list_of_input_files:t(6911,e.DiagnosticCategory.Message,"Computed_from_the_list_of_input_files_6911","Computed from the list of input files"),Platform_specific:t(6912,e.DiagnosticCategory.Message,"Platform_specific_6912","Platform specific"),You_can_learn_about_all_of_the_compiler_options_at_0:t(6913,e.DiagnosticCategory.Message,"You_can_learn_about_all_of_the_compiler_options_at_0_6913","You can learn about all of the compiler options at {0}"),Including_watch_w_will_start_watching_the_current_project_for_the_file_changes_Once_set_you_can_config_watch_mode_with_Colon:t(6914,e.DiagnosticCategory.Message,"Including_watch_w_will_start_watching_the_current_project_for_the_file_changes_Once_set_you_can_conf_6914","Including --watch, -w will start watching the current project for the file changes. Once set, you can config watch mode with:"),Using_build_b_will_make_tsc_behave_more_like_a_build_orchestrator_than_a_compiler_This_is_used_to_trigger_building_composite_projects_which_you_can_learn_more_about_at_0:t(6915,e.DiagnosticCategory.Message,"Using_build_b_will_make_tsc_behave_more_like_a_build_orchestrator_than_a_compiler_This_is_used_to_tr_6915","Using --build, -b will make tsc behave more like a build orchestrator than a compiler. This is used to trigger building composite projects which you can learn more about at {0}"),COMMON_COMMANDS:t(6916,e.DiagnosticCategory.Message,"COMMON_COMMANDS_6916","COMMON COMMANDS"),ALL_COMPILER_OPTIONS:t(6917,e.DiagnosticCategory.Message,"ALL_COMPILER_OPTIONS_6917","ALL COMPILER OPTIONS"),WATCH_OPTIONS:t(6918,e.DiagnosticCategory.Message,"WATCH_OPTIONS_6918","WATCH OPTIONS"),BUILD_OPTIONS:t(6919,e.DiagnosticCategory.Message,"BUILD_OPTIONS_6919","BUILD OPTIONS"),COMMON_COMPILER_OPTIONS:t(6920,e.DiagnosticCategory.Message,"COMMON_COMPILER_OPTIONS_6920","COMMON COMPILER OPTIONS"),COMMAND_LINE_FLAGS:t(6921,e.DiagnosticCategory.Message,"COMMAND_LINE_FLAGS_6921","COMMAND LINE FLAGS"),tsc_Colon_The_TypeScript_Compiler:t(6922,e.DiagnosticCategory.Message,"tsc_Colon_The_TypeScript_Compiler_6922","tsc: The TypeScript Compiler"),Compiles_the_current_project_tsconfig_json_in_the_working_directory:t(6923,e.DiagnosticCategory.Message,"Compiles_the_current_project_tsconfig_json_in_the_working_directory_6923","Compiles the current project (tsconfig.json in the working directory.)"),Ignoring_tsconfig_json_compiles_the_specified_files_with_default_compiler_options:t(6924,e.DiagnosticCategory.Message,"Ignoring_tsconfig_json_compiles_the_specified_files_with_default_compiler_options_6924","Ignoring tsconfig.json, compiles the specified files with default compiler options."),Build_a_composite_project_in_the_working_directory:t(6925,e.DiagnosticCategory.Message,"Build_a_composite_project_in_the_working_directory_6925","Build a composite project in the working directory."),Creates_a_tsconfig_json_with_the_recommended_settings_in_the_working_directory:t(6926,e.DiagnosticCategory.Message,"Creates_a_tsconfig_json_with_the_recommended_settings_in_the_working_directory_6926","Creates a tsconfig.json with the recommended settings in the working directory."),Compiles_the_TypeScript_project_located_at_the_specified_path:t(6927,e.DiagnosticCategory.Message,"Compiles_the_TypeScript_project_located_at_the_specified_path_6927","Compiles the TypeScript project located at the specified path."),An_expanded_version_of_this_information_showing_all_possible_compiler_options:t(6928,e.DiagnosticCategory.Message,"An_expanded_version_of_this_information_showing_all_possible_compiler_options_6928","An expanded version of this information, showing all possible compiler options"),Compiles_the_current_project_with_additional_settings:t(6929,e.DiagnosticCategory.Message,"Compiles_the_current_project_with_additional_settings_6929","Compiles the current project, with additional settings."),true_for_ES2022_and_above_including_ESNext:t(6930,e.DiagnosticCategory.Message,"true_for_ES2022_and_above_including_ESNext_6930","`true` for ES2022 and above, including ESNext."),Variable_0_implicitly_has_an_1_type:t(7005,e.DiagnosticCategory.Error,"Variable_0_implicitly_has_an_1_type_7005","Variable '{0}' implicitly has an '{1}' type."),Parameter_0_implicitly_has_an_1_type:t(7006,e.DiagnosticCategory.Error,"Parameter_0_implicitly_has_an_1_type_7006","Parameter '{0}' implicitly has an '{1}' type."),Member_0_implicitly_has_an_1_type:t(7008,e.DiagnosticCategory.Error,"Member_0_implicitly_has_an_1_type_7008","Member '{0}' implicitly has an '{1}' type."),new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type:t(7009,e.DiagnosticCategory.Error,"new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type_7009","'new' expression, whose target lacks a construct signature, implicitly has an 'any' type."),_0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type:t(7010,e.DiagnosticCategory.Error,"_0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type_7010","'{0}', which lacks return-type annotation, implicitly has an '{1}' return type."),Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type:t(7011,e.DiagnosticCategory.Error,"Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type_7011","Function expression, which lacks return-type annotation, implicitly has an '{0}' return type."),Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type:t(7013,e.DiagnosticCategory.Error,"Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7013","Construct signature, which lacks return-type annotation, implicitly has an 'any' return type."),Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type:t(7014,e.DiagnosticCategory.Error,"Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type_7014","Function type, which lacks return-type annotation, implicitly has an '{0}' return type."),Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number:t(7015,e.DiagnosticCategory.Error,"Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number_7015","Element implicitly has an 'any' type because index expression is not of type 'number'."),Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type:t(7016,e.DiagnosticCategory.Error,"Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type_7016","Could not find a declaration file for module '{0}'. '{1}' implicitly has an 'any' type."),Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature:t(7017,e.DiagnosticCategory.Error,"Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature_7017","Element implicitly has an 'any' type because type '{0}' has no index signature."),Object_literal_s_property_0_implicitly_has_an_1_type:t(7018,e.DiagnosticCategory.Error,"Object_literal_s_property_0_implicitly_has_an_1_type_7018","Object literal's property '{0}' implicitly has an '{1}' type."),Rest_parameter_0_implicitly_has_an_any_type:t(7019,e.DiagnosticCategory.Error,"Rest_parameter_0_implicitly_has_an_any_type_7019","Rest parameter '{0}' implicitly has an 'any[]' type."),Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type:t(7020,e.DiagnosticCategory.Error,"Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7020","Call signature, which lacks return-type annotation, implicitly has an 'any' return type."),_0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer:t(7022,e.DiagnosticCategory.Error,"_0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or__7022","'{0}' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer."),_0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions:t(7023,e.DiagnosticCategory.Error,"_0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_reference_7023","'{0}' implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions."),Function_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions:t(7024,e.DiagnosticCategory.Error,"Function_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_ref_7024","Function implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions."),Generator_implicitly_has_yield_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_return_type_annotation:t(7025,e.DiagnosticCategory.Error,"Generator_implicitly_has_yield_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_retu_7025","Generator implicitly has yield type '{0}' because it does not yield any values. Consider supplying a return type annotation."),JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists:t(7026,e.DiagnosticCategory.Error,"JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists_7026","JSX element implicitly has type 'any' because no interface 'JSX.{0}' exists."),Unreachable_code_detected:t(7027,e.DiagnosticCategory.Error,"Unreachable_code_detected_7027","Unreachable code detected.",!0),Unused_label:t(7028,e.DiagnosticCategory.Error,"Unused_label_7028","Unused label.",!0),Fallthrough_case_in_switch:t(7029,e.DiagnosticCategory.Error,"Fallthrough_case_in_switch_7029","Fallthrough case in switch."),Not_all_code_paths_return_a_value:t(7030,e.DiagnosticCategory.Error,"Not_all_code_paths_return_a_value_7030","Not all code paths return a value."),Binding_element_0_implicitly_has_an_1_type:t(7031,e.DiagnosticCategory.Error,"Binding_element_0_implicitly_has_an_1_type_7031","Binding element '{0}' implicitly has an '{1}' type."),Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation:t(7032,e.DiagnosticCategory.Error,"Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation_7032","Property '{0}' implicitly has type 'any', because its set accessor lacks a parameter type annotation."),Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation:t(7033,e.DiagnosticCategory.Error,"Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation_7033","Property '{0}' implicitly has type 'any', because its get accessor lacks a return type annotation."),Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined:t(7034,e.DiagnosticCategory.Error,"Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined_7034","Variable '{0}' implicitly has type '{1}' in some locations where its type cannot be determined."),Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_module_0:t(7035,e.DiagnosticCategory.Error,"Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare__7035","Try `npm i --save-dev @types/{1}` if it exists or add a new declaration (.d.ts) file containing `declare module '{0}';`"),Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0:t(7036,e.DiagnosticCategory.Error,"Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0_7036","Dynamic import's specifier must be of type 'string', but here has type '{0}'."),Enables_emit_interoperability_between_CommonJS_and_ES_Modules_via_creation_of_namespace_objects_for_all_imports_Implies_allowSyntheticDefaultImports:t(7037,e.DiagnosticCategory.Message,"Enables_emit_interoperability_between_CommonJS_and_ES_Modules_via_creation_of_namespace_objects_for__7037","Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'."),Type_originates_at_this_import_A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime_Consider_using_a_default_import_or_import_require_here_instead:t(7038,e.DiagnosticCategory.Message,"Type_originates_at_this_import_A_namespace_style_import_cannot_be_called_or_constructed_and_will_cau_7038","Type originates at this import. A namespace-style import cannot be called or constructed, and will cause a failure at runtime. Consider using a default import or import require here instead."),Mapped_object_type_implicitly_has_an_any_template_type:t(7039,e.DiagnosticCategory.Error,"Mapped_object_type_implicitly_has_an_any_template_type_7039","Mapped object type implicitly has an 'any' template type."),If_the_0_package_actually_exposes_this_module_consider_sending_a_pull_request_to_amend_https_Colon_Slash_Slashgithub_com_SlashDefinitelyTyped_SlashDefinitelyTyped_Slashtree_Slashmaster_Slashtypes_Slash_1:t(7040,e.DiagnosticCategory.Error,"If_the_0_package_actually_exposes_this_module_consider_sending_a_pull_request_to_amend_https_Colon_S_7040","If the '{0}' package actually exposes this module, consider sending a pull request to amend 'https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/{1}'"),The_containing_arrow_function_captures_the_global_value_of_this:t(7041,e.DiagnosticCategory.Error,"The_containing_arrow_function_captures_the_global_value_of_this_7041","The containing arrow function captures the global value of 'this'."),Module_0_was_resolved_to_1_but_resolveJsonModule_is_not_used:t(7042,e.DiagnosticCategory.Error,"Module_0_was_resolved_to_1_but_resolveJsonModule_is_not_used_7042","Module '{0}' was resolved to '{1}', but '--resolveJsonModule' is not used."),Variable_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage:t(7043,e.DiagnosticCategory.Suggestion,"Variable_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage_7043","Variable '{0}' implicitly has an '{1}' type, but a better type may be inferred from usage."),Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage:t(7044,e.DiagnosticCategory.Suggestion,"Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage_7044","Parameter '{0}' implicitly has an '{1}' type, but a better type may be inferred from usage."),Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage:t(7045,e.DiagnosticCategory.Suggestion,"Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage_7045","Member '{0}' implicitly has an '{1}' type, but a better type may be inferred from usage."),Variable_0_implicitly_has_type_1_in_some_locations_but_a_better_type_may_be_inferred_from_usage:t(7046,e.DiagnosticCategory.Suggestion,"Variable_0_implicitly_has_type_1_in_some_locations_but_a_better_type_may_be_inferred_from_usage_7046","Variable '{0}' implicitly has type '{1}' in some locations, but a better type may be inferred from usage."),Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage:t(7047,e.DiagnosticCategory.Suggestion,"Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage_7047","Rest parameter '{0}' implicitly has an 'any[]' type, but a better type may be inferred from usage."),Property_0_implicitly_has_type_any_but_a_better_type_for_its_get_accessor_may_be_inferred_from_usage:t(7048,e.DiagnosticCategory.Suggestion,"Property_0_implicitly_has_type_any_but_a_better_type_for_its_get_accessor_may_be_inferred_from_usage_7048","Property '{0}' implicitly has type 'any', but a better type for its get accessor may be inferred from usage."),Property_0_implicitly_has_type_any_but_a_better_type_for_its_set_accessor_may_be_inferred_from_usage:t(7049,e.DiagnosticCategory.Suggestion,"Property_0_implicitly_has_type_any_but_a_better_type_for_its_set_accessor_may_be_inferred_from_usage_7049","Property '{0}' implicitly has type 'any', but a better type for its set accessor may be inferred from usage."),_0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage:t(7050,e.DiagnosticCategory.Suggestion,"_0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage_7050","'{0}' implicitly has an '{1}' return type, but a better type may be inferred from usage."),Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1:t(7051,e.DiagnosticCategory.Error,"Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1_7051","Parameter has a name but no type. Did you mean '{0}: {1}'?"),Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature_Did_you_mean_to_call_1:t(7052,e.DiagnosticCategory.Error,"Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature_Did_you_mean_to_call_1_7052","Element implicitly has an 'any' type because type '{0}' has no index signature. Did you mean to call '{1}'?"),Element_implicitly_has_an_any_type_because_expression_of_type_0_can_t_be_used_to_index_type_1:t(7053,e.DiagnosticCategory.Error,"Element_implicitly_has_an_any_type_because_expression_of_type_0_can_t_be_used_to_index_type_1_7053","Element implicitly has an 'any' type because expression of type '{0}' can't be used to index type '{1}'."),No_index_signature_with_a_parameter_of_type_0_was_found_on_type_1:t(7054,e.DiagnosticCategory.Error,"No_index_signature_with_a_parameter_of_type_0_was_found_on_type_1_7054","No index signature with a parameter of type '{0}' was found on type '{1}'."),_0_which_lacks_return_type_annotation_implicitly_has_an_1_yield_type:t(7055,e.DiagnosticCategory.Error,"_0_which_lacks_return_type_annotation_implicitly_has_an_1_yield_type_7055","'{0}', which lacks return-type annotation, implicitly has an '{1}' yield type."),The_inferred_type_of_this_node_exceeds_the_maximum_length_the_compiler_will_serialize_An_explicit_type_annotation_is_needed:t(7056,e.DiagnosticCategory.Error,"The_inferred_type_of_this_node_exceeds_the_maximum_length_the_compiler_will_serialize_An_explicit_ty_7056","The inferred type of this node exceeds the maximum length the compiler will serialize. An explicit type annotation is needed."),yield_expression_implicitly_results_in_an_any_type_because_its_containing_generator_lacks_a_return_type_annotation:t(7057,e.DiagnosticCategory.Error,"yield_expression_implicitly_results_in_an_any_type_because_its_containing_generator_lacks_a_return_t_7057","'yield' expression implicitly results in an 'any' type because its containing generator lacks a return-type annotation."),If_the_0_package_actually_exposes_this_module_try_adding_a_new_declaration_d_ts_file_containing_declare_module_1:t(7058,e.DiagnosticCategory.Error,"If_the_0_package_actually_exposes_this_module_try_adding_a_new_declaration_d_ts_file_containing_decl_7058","If the '{0}' package actually exposes this module, try adding a new declaration (.d.ts) file containing `declare module '{1}';`"),This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Use_an_as_expression_instead:t(7059,e.DiagnosticCategory.Error,"This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Use_an_as_expression_instead_7059","This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead."),This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Add_a_trailing_comma_or_explicit_constraint:t(7060,e.DiagnosticCategory.Error,"This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Add_a_trailing_comma_or_explicit_cons_7060","This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma or explicit constraint."),A_mapped_type_may_not_declare_properties_or_methods:t(7061,e.DiagnosticCategory.Error,"A_mapped_type_may_not_declare_properties_or_methods_7061","A mapped type may not declare properties or methods."),JSON_imports_are_experimental_in_ES_module_mode_imports:t(7062,e.DiagnosticCategory.Error,"JSON_imports_are_experimental_in_ES_module_mode_imports_7062","JSON imports are experimental in ES module mode imports."),You_cannot_rename_this_element:t(8e3,e.DiagnosticCategory.Error,"You_cannot_rename_this_element_8000","You cannot rename this element."),You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library:t(8001,e.DiagnosticCategory.Error,"You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library_8001","You cannot rename elements that are defined in the standard TypeScript library."),import_can_only_be_used_in_TypeScript_files:t(8002,e.DiagnosticCategory.Error,"import_can_only_be_used_in_TypeScript_files_8002","'import ... =' can only be used in TypeScript files."),export_can_only_be_used_in_TypeScript_files:t(8003,e.DiagnosticCategory.Error,"export_can_only_be_used_in_TypeScript_files_8003","'export =' can only be used in TypeScript files."),Type_parameter_declarations_can_only_be_used_in_TypeScript_files:t(8004,e.DiagnosticCategory.Error,"Type_parameter_declarations_can_only_be_used_in_TypeScript_files_8004","Type parameter declarations can only be used in TypeScript files."),implements_clauses_can_only_be_used_in_TypeScript_files:t(8005,e.DiagnosticCategory.Error,"implements_clauses_can_only_be_used_in_TypeScript_files_8005","'implements' clauses can only be used in TypeScript files."),_0_declarations_can_only_be_used_in_TypeScript_files:t(8006,e.DiagnosticCategory.Error,"_0_declarations_can_only_be_used_in_TypeScript_files_8006","'{0}' declarations can only be used in TypeScript files."),Type_aliases_can_only_be_used_in_TypeScript_files:t(8008,e.DiagnosticCategory.Error,"Type_aliases_can_only_be_used_in_TypeScript_files_8008","Type aliases can only be used in TypeScript files."),The_0_modifier_can_only_be_used_in_TypeScript_files:t(8009,e.DiagnosticCategory.Error,"The_0_modifier_can_only_be_used_in_TypeScript_files_8009","The '{0}' modifier can only be used in TypeScript files."),Type_annotations_can_only_be_used_in_TypeScript_files:t(8010,e.DiagnosticCategory.Error,"Type_annotations_can_only_be_used_in_TypeScript_files_8010","Type annotations can only be used in TypeScript files."),Type_arguments_can_only_be_used_in_TypeScript_files:t(8011,e.DiagnosticCategory.Error,"Type_arguments_can_only_be_used_in_TypeScript_files_8011","Type arguments can only be used in TypeScript files."),Parameter_modifiers_can_only_be_used_in_TypeScript_files:t(8012,e.DiagnosticCategory.Error,"Parameter_modifiers_can_only_be_used_in_TypeScript_files_8012","Parameter modifiers can only be used in TypeScript files."),Non_null_assertions_can_only_be_used_in_TypeScript_files:t(8013,e.DiagnosticCategory.Error,"Non_null_assertions_can_only_be_used_in_TypeScript_files_8013","Non-null assertions can only be used in TypeScript files."),Type_assertion_expressions_can_only_be_used_in_TypeScript_files:t(8016,e.DiagnosticCategory.Error,"Type_assertion_expressions_can_only_be_used_in_TypeScript_files_8016","Type assertion expressions can only be used in TypeScript files."),Octal_literal_types_must_use_ES2015_syntax_Use_the_syntax_0:t(8017,e.DiagnosticCategory.Error,"Octal_literal_types_must_use_ES2015_syntax_Use_the_syntax_0_8017","Octal literal types must use ES2015 syntax. Use the syntax '{0}'."),Octal_literals_are_not_allowed_in_enums_members_initializer_Use_the_syntax_0:t(8018,e.DiagnosticCategory.Error,"Octal_literals_are_not_allowed_in_enums_members_initializer_Use_the_syntax_0_8018","Octal literals are not allowed in enums members initializer. Use the syntax '{0}'."),Report_errors_in_js_files:t(8019,e.DiagnosticCategory.Message,"Report_errors_in_js_files_8019","Report errors in .js files."),JSDoc_types_can_only_be_used_inside_documentation_comments:t(8020,e.DiagnosticCategory.Error,"JSDoc_types_can_only_be_used_inside_documentation_comments_8020","JSDoc types can only be used inside documentation comments."),JSDoc_typedef_tag_should_either_have_a_type_annotation_or_be_followed_by_property_or_member_tags:t(8021,e.DiagnosticCategory.Error,"JSDoc_typedef_tag_should_either_have_a_type_annotation_or_be_followed_by_property_or_member_tags_8021","JSDoc '@typedef' tag should either have a type annotation or be followed by '@property' or '@member' tags."),JSDoc_0_is_not_attached_to_a_class:t(8022,e.DiagnosticCategory.Error,"JSDoc_0_is_not_attached_to_a_class_8022","JSDoc '@{0}' is not attached to a class."),JSDoc_0_1_does_not_match_the_extends_2_clause:t(8023,e.DiagnosticCategory.Error,"JSDoc_0_1_does_not_match_the_extends_2_clause_8023","JSDoc '@{0} {1}' does not match the 'extends {2}' clause."),JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name:t(8024,e.DiagnosticCategory.Error,"JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_8024","JSDoc '@param' tag has name '{0}', but there is no parameter with that name."),Class_declarations_cannot_have_more_than_one_augments_or_extends_tag:t(8025,e.DiagnosticCategory.Error,"Class_declarations_cannot_have_more_than_one_augments_or_extends_tag_8025","Class declarations cannot have more than one '@augments' or '@extends' tag."),Expected_0_type_arguments_provide_these_with_an_extends_tag:t(8026,e.DiagnosticCategory.Error,"Expected_0_type_arguments_provide_these_with_an_extends_tag_8026","Expected {0} type arguments; provide these with an '@extends' tag."),Expected_0_1_type_arguments_provide_these_with_an_extends_tag:t(8027,e.DiagnosticCategory.Error,"Expected_0_1_type_arguments_provide_these_with_an_extends_tag_8027","Expected {0}-{1} type arguments; provide these with an '@extends' tag."),JSDoc_may_only_appear_in_the_last_parameter_of_a_signature:t(8028,e.DiagnosticCategory.Error,"JSDoc_may_only_appear_in_the_last_parameter_of_a_signature_8028","JSDoc '...' may only appear in the last parameter of a signature."),JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_had_an_array_type:t(8029,e.DiagnosticCategory.Error,"JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_h_8029","JSDoc '@param' tag has name '{0}', but there is no parameter with that name. It would match 'arguments' if it had an array type."),The_type_of_a_function_declaration_must_match_the_function_s_signature:t(8030,e.DiagnosticCategory.Error,"The_type_of_a_function_declaration_must_match_the_function_s_signature_8030","The type of a function declaration must match the function's signature."),You_cannot_rename_a_module_via_a_global_import:t(8031,e.DiagnosticCategory.Error,"You_cannot_rename_a_module_via_a_global_import_8031","You cannot rename a module via a global import."),Qualified_name_0_is_not_allowed_without_a_leading_param_object_1:t(8032,e.DiagnosticCategory.Error,"Qualified_name_0_is_not_allowed_without_a_leading_param_object_1_8032","Qualified name '{0}' is not allowed without a leading '@param {object} {1}'."),A_JSDoc_typedef_comment_may_not_contain_multiple_type_tags:t(8033,e.DiagnosticCategory.Error,"A_JSDoc_typedef_comment_may_not_contain_multiple_type_tags_8033","A JSDoc '@typedef' comment may not contain multiple '@type' tags."),The_tag_was_first_specified_here:t(8034,e.DiagnosticCategory.Error,"The_tag_was_first_specified_here_8034","The tag was first specified here."),Declaration_emit_for_this_file_requires_using_private_name_0_An_explicit_type_annotation_may_unblock_declaration_emit:t(9005,e.DiagnosticCategory.Error,"Declaration_emit_for_this_file_requires_using_private_name_0_An_explicit_type_annotation_may_unblock_9005","Declaration emit for this file requires using private name '{0}'. An explicit type annotation may unblock declaration emit."),Declaration_emit_for_this_file_requires_using_private_name_0_from_module_1_An_explicit_type_annotation_may_unblock_declaration_emit:t(9006,e.DiagnosticCategory.Error,"Declaration_emit_for_this_file_requires_using_private_name_0_from_module_1_An_explicit_type_annotati_9006","Declaration emit for this file requires using private name '{0}' from module '{1}'. An explicit type annotation may unblock declaration emit."),JSX_attributes_must_only_be_assigned_a_non_empty_expression:t(17e3,e.DiagnosticCategory.Error,"JSX_attributes_must_only_be_assigned_a_non_empty_expression_17000","JSX attributes must only be assigned a non-empty 'expression'."),JSX_elements_cannot_have_multiple_attributes_with_the_same_name:t(17001,e.DiagnosticCategory.Error,"JSX_elements_cannot_have_multiple_attributes_with_the_same_name_17001","JSX elements cannot have multiple attributes with the same name."),Expected_corresponding_JSX_closing_tag_for_0:t(17002,e.DiagnosticCategory.Error,"Expected_corresponding_JSX_closing_tag_for_0_17002","Expected corresponding JSX closing tag for '{0}'."),Cannot_use_JSX_unless_the_jsx_flag_is_provided:t(17004,e.DiagnosticCategory.Error,"Cannot_use_JSX_unless_the_jsx_flag_is_provided_17004","Cannot use JSX unless the '--jsx' flag is provided."),A_constructor_cannot_contain_a_super_call_when_its_class_extends_null:t(17005,e.DiagnosticCategory.Error,"A_constructor_cannot_contain_a_super_call_when_its_class_extends_null_17005","A constructor cannot contain a 'super' call when its class extends 'null'."),An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses:t(17006,e.DiagnosticCategory.Error,"An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_ex_17006","An unary expression with the '{0}' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses."),A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses:t(17007,e.DiagnosticCategory.Error,"A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Con_17007","A type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses."),JSX_element_0_has_no_corresponding_closing_tag:t(17008,e.DiagnosticCategory.Error,"JSX_element_0_has_no_corresponding_closing_tag_17008","JSX element '{0}' has no corresponding closing tag."),super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class:t(17009,e.DiagnosticCategory.Error,"super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class_17009","'super' must be called before accessing 'this' in the constructor of a derived class."),Unknown_type_acquisition_option_0:t(17010,e.DiagnosticCategory.Error,"Unknown_type_acquisition_option_0_17010","Unknown type acquisition option '{0}'."),super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class:t(17011,e.DiagnosticCategory.Error,"super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class_17011","'super' must be called before accessing a property of 'super' in the constructor of a derived class."),_0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2:t(17012,e.DiagnosticCategory.Error,"_0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2_17012","'{0}' is not a valid meta-property for keyword '{1}'. Did you mean '{2}'?"),Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constructor:t(17013,e.DiagnosticCategory.Error,"Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constru_17013","Meta-property '{0}' is only allowed in the body of a function declaration, function expression, or constructor."),JSX_fragment_has_no_corresponding_closing_tag:t(17014,e.DiagnosticCategory.Error,"JSX_fragment_has_no_corresponding_closing_tag_17014","JSX fragment has no corresponding closing tag."),Expected_corresponding_closing_tag_for_JSX_fragment:t(17015,e.DiagnosticCategory.Error,"Expected_corresponding_closing_tag_for_JSX_fragment_17015","Expected corresponding closing tag for JSX fragment."),The_jsxFragmentFactory_compiler_option_must_be_provided_to_use_JSX_fragments_with_the_jsxFactory_compiler_option:t(17016,e.DiagnosticCategory.Error,"The_jsxFragmentFactory_compiler_option_must_be_provided_to_use_JSX_fragments_with_the_jsxFactory_com_17016","The 'jsxFragmentFactory' compiler option must be provided to use JSX fragments with the 'jsxFactory' compiler option."),An_jsxFrag_pragma_is_required_when_using_an_jsx_pragma_with_JSX_fragments:t(17017,e.DiagnosticCategory.Error,"An_jsxFrag_pragma_is_required_when_using_an_jsx_pragma_with_JSX_fragments_17017","An @jsxFrag pragma is required when using an @jsx pragma with JSX fragments."),Unknown_type_acquisition_option_0_Did_you_mean_1:t(17018,e.DiagnosticCategory.Error,"Unknown_type_acquisition_option_0_Did_you_mean_1_17018","Unknown type acquisition option '{0}'. Did you mean '{1}'?"),Circularity_detected_while_resolving_configuration_Colon_0:t(18e3,e.DiagnosticCategory.Error,"Circularity_detected_while_resolving_configuration_Colon_0_18000","Circularity detected while resolving configuration: {0}"),The_files_list_in_config_file_0_is_empty:t(18002,e.DiagnosticCategory.Error,"The_files_list_in_config_file_0_is_empty_18002","The 'files' list in config file '{0}' is empty."),No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2:t(18003,e.DiagnosticCategory.Error,"No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2_18003","No inputs were found in config file '{0}'. Specified 'include' paths were '{1}' and 'exclude' paths were '{2}'."),File_is_a_CommonJS_module_it_may_be_converted_to_an_ES_module:t(80001,e.DiagnosticCategory.Suggestion,"File_is_a_CommonJS_module_it_may_be_converted_to_an_ES_module_80001","File is a CommonJS module; it may be converted to an ES module."),This_constructor_function_may_be_converted_to_a_class_declaration:t(80002,e.DiagnosticCategory.Suggestion,"This_constructor_function_may_be_converted_to_a_class_declaration_80002","This constructor function may be converted to a class declaration."),Import_may_be_converted_to_a_default_import:t(80003,e.DiagnosticCategory.Suggestion,"Import_may_be_converted_to_a_default_import_80003","Import may be converted to a default import."),JSDoc_types_may_be_moved_to_TypeScript_types:t(80004,e.DiagnosticCategory.Suggestion,"JSDoc_types_may_be_moved_to_TypeScript_types_80004","JSDoc types may be moved to TypeScript types."),require_call_may_be_converted_to_an_import:t(80005,e.DiagnosticCategory.Suggestion,"require_call_may_be_converted_to_an_import_80005","'require' call may be converted to an import."),This_may_be_converted_to_an_async_function:t(80006,e.DiagnosticCategory.Suggestion,"This_may_be_converted_to_an_async_function_80006","This may be converted to an async function."),await_has_no_effect_on_the_type_of_this_expression:t(80007,e.DiagnosticCategory.Suggestion,"await_has_no_effect_on_the_type_of_this_expression_80007","'await' has no effect on the type of this expression."),Numeric_literals_with_absolute_values_equal_to_2_53_or_greater_are_too_large_to_be_represented_accurately_as_integers:t(80008,e.DiagnosticCategory.Suggestion,"Numeric_literals_with_absolute_values_equal_to_2_53_or_greater_are_too_large_to_be_represented_accur_80008","Numeric literals with absolute values equal to 2^53 or greater are too large to be represented accurately as integers."),Add_missing_super_call:t(90001,e.DiagnosticCategory.Message,"Add_missing_super_call_90001","Add missing 'super()' call"),Make_super_call_the_first_statement_in_the_constructor:t(90002,e.DiagnosticCategory.Message,"Make_super_call_the_first_statement_in_the_constructor_90002","Make 'super()' call the first statement in the constructor"),Change_extends_to_implements:t(90003,e.DiagnosticCategory.Message,"Change_extends_to_implements_90003","Change 'extends' to 'implements'"),Remove_unused_declaration_for_Colon_0:t(90004,e.DiagnosticCategory.Message,"Remove_unused_declaration_for_Colon_0_90004","Remove unused declaration for: '{0}'"),Remove_import_from_0:t(90005,e.DiagnosticCategory.Message,"Remove_import_from_0_90005","Remove import from '{0}'"),Implement_interface_0:t(90006,e.DiagnosticCategory.Message,"Implement_interface_0_90006","Implement interface '{0}'"),Implement_inherited_abstract_class:t(90007,e.DiagnosticCategory.Message,"Implement_inherited_abstract_class_90007","Implement inherited abstract class"),Add_0_to_unresolved_variable:t(90008,e.DiagnosticCategory.Message,"Add_0_to_unresolved_variable_90008","Add '{0}.' to unresolved variable"),Remove_variable_statement:t(90010,e.DiagnosticCategory.Message,"Remove_variable_statement_90010","Remove variable statement"),Remove_template_tag:t(90011,e.DiagnosticCategory.Message,"Remove_template_tag_90011","Remove template tag"),Remove_type_parameters:t(90012,e.DiagnosticCategory.Message,"Remove_type_parameters_90012","Remove type parameters"),Import_0_from_module_1:t(90013,e.DiagnosticCategory.Message,"Import_0_from_module_1_90013","Import '{0}' from module \"{1}\""),Change_0_to_1:t(90014,e.DiagnosticCategory.Message,"Change_0_to_1_90014","Change '{0}' to '{1}'"),Add_0_to_existing_import_declaration_from_1:t(90015,e.DiagnosticCategory.Message,"Add_0_to_existing_import_declaration_from_1_90015","Add '{0}' to existing import declaration from \"{1}\""),Declare_property_0:t(90016,e.DiagnosticCategory.Message,"Declare_property_0_90016","Declare property '{0}'"),Add_index_signature_for_property_0:t(90017,e.DiagnosticCategory.Message,"Add_index_signature_for_property_0_90017","Add index signature for property '{0}'"),Disable_checking_for_this_file:t(90018,e.DiagnosticCategory.Message,"Disable_checking_for_this_file_90018","Disable checking for this file"),Ignore_this_error_message:t(90019,e.DiagnosticCategory.Message,"Ignore_this_error_message_90019","Ignore this error message"),Initialize_property_0_in_the_constructor:t(90020,e.DiagnosticCategory.Message,"Initialize_property_0_in_the_constructor_90020","Initialize property '{0}' in the constructor"),Initialize_static_property_0:t(90021,e.DiagnosticCategory.Message,"Initialize_static_property_0_90021","Initialize static property '{0}'"),Change_spelling_to_0:t(90022,e.DiagnosticCategory.Message,"Change_spelling_to_0_90022","Change spelling to '{0}'"),Declare_method_0:t(90023,e.DiagnosticCategory.Message,"Declare_method_0_90023","Declare method '{0}'"),Declare_static_method_0:t(90024,e.DiagnosticCategory.Message,"Declare_static_method_0_90024","Declare static method '{0}'"),Prefix_0_with_an_underscore:t(90025,e.DiagnosticCategory.Message,"Prefix_0_with_an_underscore_90025","Prefix '{0}' with an underscore"),Rewrite_as_the_indexed_access_type_0:t(90026,e.DiagnosticCategory.Message,"Rewrite_as_the_indexed_access_type_0_90026","Rewrite as the indexed access type '{0}'"),Declare_static_property_0:t(90027,e.DiagnosticCategory.Message,"Declare_static_property_0_90027","Declare static property '{0}'"),Call_decorator_expression:t(90028,e.DiagnosticCategory.Message,"Call_decorator_expression_90028","Call decorator expression"),Add_async_modifier_to_containing_function:t(90029,e.DiagnosticCategory.Message,"Add_async_modifier_to_containing_function_90029","Add async modifier to containing function"),Replace_infer_0_with_unknown:t(90030,e.DiagnosticCategory.Message,"Replace_infer_0_with_unknown_90030","Replace 'infer {0}' with 'unknown'"),Replace_all_unused_infer_with_unknown:t(90031,e.DiagnosticCategory.Message,"Replace_all_unused_infer_with_unknown_90031","Replace all unused 'infer' with 'unknown'"),Import_default_0_from_module_1:t(90032,e.DiagnosticCategory.Message,"Import_default_0_from_module_1_90032","Import default '{0}' from module \"{1}\""),Add_default_import_0_to_existing_import_declaration_from_1:t(90033,e.DiagnosticCategory.Message,"Add_default_import_0_to_existing_import_declaration_from_1_90033","Add default import '{0}' to existing import declaration from \"{1}\""),Add_parameter_name:t(90034,e.DiagnosticCategory.Message,"Add_parameter_name_90034","Add parameter name"),Declare_private_property_0:t(90035,e.DiagnosticCategory.Message,"Declare_private_property_0_90035","Declare private property '{0}'"),Replace_0_with_Promise_1:t(90036,e.DiagnosticCategory.Message,"Replace_0_with_Promise_1_90036","Replace '{0}' with 'Promise<{1}>'"),Fix_all_incorrect_return_type_of_an_async_functions:t(90037,e.DiagnosticCategory.Message,"Fix_all_incorrect_return_type_of_an_async_functions_90037","Fix all incorrect return type of an async functions"),Declare_private_method_0:t(90038,e.DiagnosticCategory.Message,"Declare_private_method_0_90038","Declare private method '{0}'"),Remove_unused_destructuring_declaration:t(90039,e.DiagnosticCategory.Message,"Remove_unused_destructuring_declaration_90039","Remove unused destructuring declaration"),Remove_unused_declarations_for_Colon_0:t(90041,e.DiagnosticCategory.Message,"Remove_unused_declarations_for_Colon_0_90041","Remove unused declarations for: '{0}'"),Declare_a_private_field_named_0:t(90053,e.DiagnosticCategory.Message,"Declare_a_private_field_named_0_90053","Declare a private field named '{0}'."),Includes_imports_of_types_referenced_by_0:t(90054,e.DiagnosticCategory.Message,"Includes_imports_of_types_referenced_by_0_90054","Includes imports of types referenced by '{0}'"),Convert_function_to_an_ES2015_class:t(95001,e.DiagnosticCategory.Message,"Convert_function_to_an_ES2015_class_95001","Convert function to an ES2015 class"),Convert_0_to_1_in_0:t(95003,e.DiagnosticCategory.Message,"Convert_0_to_1_in_0_95003","Convert '{0}' to '{1} in {0}'"),Extract_to_0_in_1:t(95004,e.DiagnosticCategory.Message,"Extract_to_0_in_1_95004","Extract to {0} in {1}"),Extract_function:t(95005,e.DiagnosticCategory.Message,"Extract_function_95005","Extract function"),Extract_constant:t(95006,e.DiagnosticCategory.Message,"Extract_constant_95006","Extract constant"),Extract_to_0_in_enclosing_scope:t(95007,e.DiagnosticCategory.Message,"Extract_to_0_in_enclosing_scope_95007","Extract to {0} in enclosing scope"),Extract_to_0_in_1_scope:t(95008,e.DiagnosticCategory.Message,"Extract_to_0_in_1_scope_95008","Extract to {0} in {1} scope"),Annotate_with_type_from_JSDoc:t(95009,e.DiagnosticCategory.Message,"Annotate_with_type_from_JSDoc_95009","Annotate with type from JSDoc"),Infer_type_of_0_from_usage:t(95011,e.DiagnosticCategory.Message,"Infer_type_of_0_from_usage_95011","Infer type of '{0}' from usage"),Infer_parameter_types_from_usage:t(95012,e.DiagnosticCategory.Message,"Infer_parameter_types_from_usage_95012","Infer parameter types from usage"),Convert_to_default_import:t(95013,e.DiagnosticCategory.Message,"Convert_to_default_import_95013","Convert to default import"),Install_0:t(95014,e.DiagnosticCategory.Message,"Install_0_95014","Install '{0}'"),Replace_import_with_0:t(95015,e.DiagnosticCategory.Message,"Replace_import_with_0_95015","Replace import with '{0}'."),Use_synthetic_default_member:t(95016,e.DiagnosticCategory.Message,"Use_synthetic_default_member_95016","Use synthetic 'default' member."),Convert_to_ES_module:t(95017,e.DiagnosticCategory.Message,"Convert_to_ES_module_95017","Convert to ES module"),Add_undefined_type_to_property_0:t(95018,e.DiagnosticCategory.Message,"Add_undefined_type_to_property_0_95018","Add 'undefined' type to property '{0}'"),Add_initializer_to_property_0:t(95019,e.DiagnosticCategory.Message,"Add_initializer_to_property_0_95019","Add initializer to property '{0}'"),Add_definite_assignment_assertion_to_property_0:t(95020,e.DiagnosticCategory.Message,"Add_definite_assignment_assertion_to_property_0_95020","Add definite assignment assertion to property '{0}'"),Convert_all_type_literals_to_mapped_type:t(95021,e.DiagnosticCategory.Message,"Convert_all_type_literals_to_mapped_type_95021","Convert all type literals to mapped type"),Add_all_missing_members:t(95022,e.DiagnosticCategory.Message,"Add_all_missing_members_95022","Add all missing members"),Infer_all_types_from_usage:t(95023,e.DiagnosticCategory.Message,"Infer_all_types_from_usage_95023","Infer all types from usage"),Delete_all_unused_declarations:t(95024,e.DiagnosticCategory.Message,"Delete_all_unused_declarations_95024","Delete all unused declarations"),Prefix_all_unused_declarations_with_where_possible:t(95025,e.DiagnosticCategory.Message,"Prefix_all_unused_declarations_with_where_possible_95025","Prefix all unused declarations with '_' where possible"),Fix_all_detected_spelling_errors:t(95026,e.DiagnosticCategory.Message,"Fix_all_detected_spelling_errors_95026","Fix all detected spelling errors"),Add_initializers_to_all_uninitialized_properties:t(95027,e.DiagnosticCategory.Message,"Add_initializers_to_all_uninitialized_properties_95027","Add initializers to all uninitialized properties"),Add_definite_assignment_assertions_to_all_uninitialized_properties:t(95028,e.DiagnosticCategory.Message,"Add_definite_assignment_assertions_to_all_uninitialized_properties_95028","Add definite assignment assertions to all uninitialized properties"),Add_undefined_type_to_all_uninitialized_properties:t(95029,e.DiagnosticCategory.Message,"Add_undefined_type_to_all_uninitialized_properties_95029","Add undefined type to all uninitialized properties"),Change_all_jsdoc_style_types_to_TypeScript:t(95030,e.DiagnosticCategory.Message,"Change_all_jsdoc_style_types_to_TypeScript_95030","Change all jsdoc-style types to TypeScript"),Change_all_jsdoc_style_types_to_TypeScript_and_add_undefined_to_nullable_types:t(95031,e.DiagnosticCategory.Message,"Change_all_jsdoc_style_types_to_TypeScript_and_add_undefined_to_nullable_types_95031","Change all jsdoc-style types to TypeScript (and add '| undefined' to nullable types)"),Implement_all_unimplemented_interfaces:t(95032,e.DiagnosticCategory.Message,"Implement_all_unimplemented_interfaces_95032","Implement all unimplemented interfaces"),Install_all_missing_types_packages:t(95033,e.DiagnosticCategory.Message,"Install_all_missing_types_packages_95033","Install all missing types packages"),Rewrite_all_as_indexed_access_types:t(95034,e.DiagnosticCategory.Message,"Rewrite_all_as_indexed_access_types_95034","Rewrite all as indexed access types"),Convert_all_to_default_imports:t(95035,e.DiagnosticCategory.Message,"Convert_all_to_default_imports_95035","Convert all to default imports"),Make_all_super_calls_the_first_statement_in_their_constructor:t(95036,e.DiagnosticCategory.Message,"Make_all_super_calls_the_first_statement_in_their_constructor_95036","Make all 'super()' calls the first statement in their constructor"),Add_qualifier_to_all_unresolved_variables_matching_a_member_name:t(95037,e.DiagnosticCategory.Message,"Add_qualifier_to_all_unresolved_variables_matching_a_member_name_95037","Add qualifier to all unresolved variables matching a member name"),Change_all_extended_interfaces_to_implements:t(95038,e.DiagnosticCategory.Message,"Change_all_extended_interfaces_to_implements_95038","Change all extended interfaces to 'implements'"),Add_all_missing_super_calls:t(95039,e.DiagnosticCategory.Message,"Add_all_missing_super_calls_95039","Add all missing super calls"),Implement_all_inherited_abstract_classes:t(95040,e.DiagnosticCategory.Message,"Implement_all_inherited_abstract_classes_95040","Implement all inherited abstract classes"),Add_all_missing_async_modifiers:t(95041,e.DiagnosticCategory.Message,"Add_all_missing_async_modifiers_95041","Add all missing 'async' modifiers"),Add_ts_ignore_to_all_error_messages:t(95042,e.DiagnosticCategory.Message,"Add_ts_ignore_to_all_error_messages_95042","Add '@ts-ignore' to all error messages"),Annotate_everything_with_types_from_JSDoc:t(95043,e.DiagnosticCategory.Message,"Annotate_everything_with_types_from_JSDoc_95043","Annotate everything with types from JSDoc"),Add_to_all_uncalled_decorators:t(95044,e.DiagnosticCategory.Message,"Add_to_all_uncalled_decorators_95044","Add '()' to all uncalled decorators"),Convert_all_constructor_functions_to_classes:t(95045,e.DiagnosticCategory.Message,"Convert_all_constructor_functions_to_classes_95045","Convert all constructor functions to classes"),Generate_get_and_set_accessors:t(95046,e.DiagnosticCategory.Message,"Generate_get_and_set_accessors_95046","Generate 'get' and 'set' accessors"),Convert_require_to_import:t(95047,e.DiagnosticCategory.Message,"Convert_require_to_import_95047","Convert 'require' to 'import'"),Convert_all_require_to_import:t(95048,e.DiagnosticCategory.Message,"Convert_all_require_to_import_95048","Convert all 'require' to 'import'"),Move_to_a_new_file:t(95049,e.DiagnosticCategory.Message,"Move_to_a_new_file_95049","Move to a new file"),Remove_unreachable_code:t(95050,e.DiagnosticCategory.Message,"Remove_unreachable_code_95050","Remove unreachable code"),Remove_all_unreachable_code:t(95051,e.DiagnosticCategory.Message,"Remove_all_unreachable_code_95051","Remove all unreachable code"),Add_missing_typeof:t(95052,e.DiagnosticCategory.Message,"Add_missing_typeof_95052","Add missing 'typeof'"),Remove_unused_label:t(95053,e.DiagnosticCategory.Message,"Remove_unused_label_95053","Remove unused label"),Remove_all_unused_labels:t(95054,e.DiagnosticCategory.Message,"Remove_all_unused_labels_95054","Remove all unused labels"),Convert_0_to_mapped_object_type:t(95055,e.DiagnosticCategory.Message,"Convert_0_to_mapped_object_type_95055","Convert '{0}' to mapped object type"),Convert_namespace_import_to_named_imports:t(95056,e.DiagnosticCategory.Message,"Convert_namespace_import_to_named_imports_95056","Convert namespace import to named imports"),Convert_named_imports_to_namespace_import:t(95057,e.DiagnosticCategory.Message,"Convert_named_imports_to_namespace_import_95057","Convert named imports to namespace import"),Add_or_remove_braces_in_an_arrow_function:t(95058,e.DiagnosticCategory.Message,"Add_or_remove_braces_in_an_arrow_function_95058","Add or remove braces in an arrow function"),Add_braces_to_arrow_function:t(95059,e.DiagnosticCategory.Message,"Add_braces_to_arrow_function_95059","Add braces to arrow function"),Remove_braces_from_arrow_function:t(95060,e.DiagnosticCategory.Message,"Remove_braces_from_arrow_function_95060","Remove braces from arrow function"),Convert_default_export_to_named_export:t(95061,e.DiagnosticCategory.Message,"Convert_default_export_to_named_export_95061","Convert default export to named export"),Convert_named_export_to_default_export:t(95062,e.DiagnosticCategory.Message,"Convert_named_export_to_default_export_95062","Convert named export to default export"),Add_missing_enum_member_0:t(95063,e.DiagnosticCategory.Message,"Add_missing_enum_member_0_95063","Add missing enum member '{0}'"),Add_all_missing_imports:t(95064,e.DiagnosticCategory.Message,"Add_all_missing_imports_95064","Add all missing imports"),Convert_to_async_function:t(95065,e.DiagnosticCategory.Message,"Convert_to_async_function_95065","Convert to async function"),Convert_all_to_async_functions:t(95066,e.DiagnosticCategory.Message,"Convert_all_to_async_functions_95066","Convert all to async functions"),Add_missing_call_parentheses:t(95067,e.DiagnosticCategory.Message,"Add_missing_call_parentheses_95067","Add missing call parentheses"),Add_all_missing_call_parentheses:t(95068,e.DiagnosticCategory.Message,"Add_all_missing_call_parentheses_95068","Add all missing call parentheses"),Add_unknown_conversion_for_non_overlapping_types:t(95069,e.DiagnosticCategory.Message,"Add_unknown_conversion_for_non_overlapping_types_95069","Add 'unknown' conversion for non-overlapping types"),Add_unknown_to_all_conversions_of_non_overlapping_types:t(95070,e.DiagnosticCategory.Message,"Add_unknown_to_all_conversions_of_non_overlapping_types_95070","Add 'unknown' to all conversions of non-overlapping types"),Add_missing_new_operator_to_call:t(95071,e.DiagnosticCategory.Message,"Add_missing_new_operator_to_call_95071","Add missing 'new' operator to call"),Add_missing_new_operator_to_all_calls:t(95072,e.DiagnosticCategory.Message,"Add_missing_new_operator_to_all_calls_95072","Add missing 'new' operator to all calls"),Add_names_to_all_parameters_without_names:t(95073,e.DiagnosticCategory.Message,"Add_names_to_all_parameters_without_names_95073","Add names to all parameters without names"),Enable_the_experimentalDecorators_option_in_your_configuration_file:t(95074,e.DiagnosticCategory.Message,"Enable_the_experimentalDecorators_option_in_your_configuration_file_95074","Enable the 'experimentalDecorators' option in your configuration file"),Convert_parameters_to_destructured_object:t(95075,e.DiagnosticCategory.Message,"Convert_parameters_to_destructured_object_95075","Convert parameters to destructured object"),Extract_type:t(95077,e.DiagnosticCategory.Message,"Extract_type_95077","Extract type"),Extract_to_type_alias:t(95078,e.DiagnosticCategory.Message,"Extract_to_type_alias_95078","Extract to type alias"),Extract_to_typedef:t(95079,e.DiagnosticCategory.Message,"Extract_to_typedef_95079","Extract to typedef"),Infer_this_type_of_0_from_usage:t(95080,e.DiagnosticCategory.Message,"Infer_this_type_of_0_from_usage_95080","Infer 'this' type of '{0}' from usage"),Add_const_to_unresolved_variable:t(95081,e.DiagnosticCategory.Message,"Add_const_to_unresolved_variable_95081","Add 'const' to unresolved variable"),Add_const_to_all_unresolved_variables:t(95082,e.DiagnosticCategory.Message,"Add_const_to_all_unresolved_variables_95082","Add 'const' to all unresolved variables"),Add_await:t(95083,e.DiagnosticCategory.Message,"Add_await_95083","Add 'await'"),Add_await_to_initializer_for_0:t(95084,e.DiagnosticCategory.Message,"Add_await_to_initializer_for_0_95084","Add 'await' to initializer for '{0}'"),Fix_all_expressions_possibly_missing_await:t(95085,e.DiagnosticCategory.Message,"Fix_all_expressions_possibly_missing_await_95085","Fix all expressions possibly missing 'await'"),Remove_unnecessary_await:t(95086,e.DiagnosticCategory.Message,"Remove_unnecessary_await_95086","Remove unnecessary 'await'"),Remove_all_unnecessary_uses_of_await:t(95087,e.DiagnosticCategory.Message,"Remove_all_unnecessary_uses_of_await_95087","Remove all unnecessary uses of 'await'"),Enable_the_jsx_flag_in_your_configuration_file:t(95088,e.DiagnosticCategory.Message,"Enable_the_jsx_flag_in_your_configuration_file_95088","Enable the '--jsx' flag in your configuration file"),Add_await_to_initializers:t(95089,e.DiagnosticCategory.Message,"Add_await_to_initializers_95089","Add 'await' to initializers"),Extract_to_interface:t(95090,e.DiagnosticCategory.Message,"Extract_to_interface_95090","Extract to interface"),Convert_to_a_bigint_numeric_literal:t(95091,e.DiagnosticCategory.Message,"Convert_to_a_bigint_numeric_literal_95091","Convert to a bigint numeric literal"),Convert_all_to_bigint_numeric_literals:t(95092,e.DiagnosticCategory.Message,"Convert_all_to_bigint_numeric_literals_95092","Convert all to bigint numeric literals"),Convert_const_to_let:t(95093,e.DiagnosticCategory.Message,"Convert_const_to_let_95093","Convert 'const' to 'let'"),Prefix_with_declare:t(95094,e.DiagnosticCategory.Message,"Prefix_with_declare_95094","Prefix with 'declare'"),Prefix_all_incorrect_property_declarations_with_declare:t(95095,e.DiagnosticCategory.Message,"Prefix_all_incorrect_property_declarations_with_declare_95095","Prefix all incorrect property declarations with 'declare'"),Convert_to_template_string:t(95096,e.DiagnosticCategory.Message,"Convert_to_template_string_95096","Convert to template string"),Add_export_to_make_this_file_into_a_module:t(95097,e.DiagnosticCategory.Message,"Add_export_to_make_this_file_into_a_module_95097","Add 'export {}' to make this file into a module"),Set_the_target_option_in_your_configuration_file_to_0:t(95098,e.DiagnosticCategory.Message,"Set_the_target_option_in_your_configuration_file_to_0_95098","Set the 'target' option in your configuration file to '{0}'"),Set_the_module_option_in_your_configuration_file_to_0:t(95099,e.DiagnosticCategory.Message,"Set_the_module_option_in_your_configuration_file_to_0_95099","Set the 'module' option in your configuration file to '{0}'"),Convert_invalid_character_to_its_html_entity_code:t(95100,e.DiagnosticCategory.Message,"Convert_invalid_character_to_its_html_entity_code_95100","Convert invalid character to its html entity code"),Convert_all_invalid_characters_to_HTML_entity_code:t(95101,e.DiagnosticCategory.Message,"Convert_all_invalid_characters_to_HTML_entity_code_95101","Convert all invalid characters to HTML entity code"),Convert_function_expression_0_to_arrow_function:t(95105,e.DiagnosticCategory.Message,"Convert_function_expression_0_to_arrow_function_95105","Convert function expression '{0}' to arrow function"),Convert_function_declaration_0_to_arrow_function:t(95106,e.DiagnosticCategory.Message,"Convert_function_declaration_0_to_arrow_function_95106","Convert function declaration '{0}' to arrow function"),Fix_all_implicit_this_errors:t(95107,e.DiagnosticCategory.Message,"Fix_all_implicit_this_errors_95107","Fix all implicit-'this' errors"),Wrap_invalid_character_in_an_expression_container:t(95108,e.DiagnosticCategory.Message,"Wrap_invalid_character_in_an_expression_container_95108","Wrap invalid character in an expression container"),Wrap_all_invalid_characters_in_an_expression_container:t(95109,e.DiagnosticCategory.Message,"Wrap_all_invalid_characters_in_an_expression_container_95109","Wrap all invalid characters in an expression container"),Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_json_to_read_more_about_this_file:t(95110,e.DiagnosticCategory.Message,"Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_json_to_read_more_about_this_file_95110","Visit https://aka.ms/tsconfig.json to read more about this file"),Add_a_return_statement:t(95111,e.DiagnosticCategory.Message,"Add_a_return_statement_95111","Add a return statement"),Remove_braces_from_arrow_function_body:t(95112,e.DiagnosticCategory.Message,"Remove_braces_from_arrow_function_body_95112","Remove braces from arrow function body"),Wrap_the_following_body_with_parentheses_which_should_be_an_object_literal:t(95113,e.DiagnosticCategory.Message,"Wrap_the_following_body_with_parentheses_which_should_be_an_object_literal_95113","Wrap the following body with parentheses which should be an object literal"),Add_all_missing_return_statement:t(95114,e.DiagnosticCategory.Message,"Add_all_missing_return_statement_95114","Add all missing return statement"),Remove_braces_from_all_arrow_function_bodies_with_relevant_issues:t(95115,e.DiagnosticCategory.Message,"Remove_braces_from_all_arrow_function_bodies_with_relevant_issues_95115","Remove braces from all arrow function bodies with relevant issues"),Wrap_all_object_literal_with_parentheses:t(95116,e.DiagnosticCategory.Message,"Wrap_all_object_literal_with_parentheses_95116","Wrap all object literal with parentheses"),Move_labeled_tuple_element_modifiers_to_labels:t(95117,e.DiagnosticCategory.Message,"Move_labeled_tuple_element_modifiers_to_labels_95117","Move labeled tuple element modifiers to labels"),Convert_overload_list_to_single_signature:t(95118,e.DiagnosticCategory.Message,"Convert_overload_list_to_single_signature_95118","Convert overload list to single signature"),Generate_get_and_set_accessors_for_all_overriding_properties:t(95119,e.DiagnosticCategory.Message,"Generate_get_and_set_accessors_for_all_overriding_properties_95119","Generate 'get' and 'set' accessors for all overriding properties"),Wrap_in_JSX_fragment:t(95120,e.DiagnosticCategory.Message,"Wrap_in_JSX_fragment_95120","Wrap in JSX fragment"),Wrap_all_unparented_JSX_in_JSX_fragment:t(95121,e.DiagnosticCategory.Message,"Wrap_all_unparented_JSX_in_JSX_fragment_95121","Wrap all unparented JSX in JSX fragment"),Convert_arrow_function_or_function_expression:t(95122,e.DiagnosticCategory.Message,"Convert_arrow_function_or_function_expression_95122","Convert arrow function or function expression"),Convert_to_anonymous_function:t(95123,e.DiagnosticCategory.Message,"Convert_to_anonymous_function_95123","Convert to anonymous function"),Convert_to_named_function:t(95124,e.DiagnosticCategory.Message,"Convert_to_named_function_95124","Convert to named function"),Convert_to_arrow_function:t(95125,e.DiagnosticCategory.Message,"Convert_to_arrow_function_95125","Convert to arrow function"),Remove_parentheses:t(95126,e.DiagnosticCategory.Message,"Remove_parentheses_95126","Remove parentheses"),Could_not_find_a_containing_arrow_function:t(95127,e.DiagnosticCategory.Message,"Could_not_find_a_containing_arrow_function_95127","Could not find a containing arrow function"),Containing_function_is_not_an_arrow_function:t(95128,e.DiagnosticCategory.Message,"Containing_function_is_not_an_arrow_function_95128","Containing function is not an arrow function"),Could_not_find_export_statement:t(95129,e.DiagnosticCategory.Message,"Could_not_find_export_statement_95129","Could not find export statement"),This_file_already_has_a_default_export:t(95130,e.DiagnosticCategory.Message,"This_file_already_has_a_default_export_95130","This file already has a default export"),Could_not_find_import_clause:t(95131,e.DiagnosticCategory.Message,"Could_not_find_import_clause_95131","Could not find import clause"),Could_not_find_namespace_import_or_named_imports:t(95132,e.DiagnosticCategory.Message,"Could_not_find_namespace_import_or_named_imports_95132","Could not find namespace import or named imports"),Selection_is_not_a_valid_type_node:t(95133,e.DiagnosticCategory.Message,"Selection_is_not_a_valid_type_node_95133","Selection is not a valid type node"),No_type_could_be_extracted_from_this_type_node:t(95134,e.DiagnosticCategory.Message,"No_type_could_be_extracted_from_this_type_node_95134","No type could be extracted from this type node"),Could_not_find_property_for_which_to_generate_accessor:t(95135,e.DiagnosticCategory.Message,"Could_not_find_property_for_which_to_generate_accessor_95135","Could not find property for which to generate accessor"),Name_is_not_valid:t(95136,e.DiagnosticCategory.Message,"Name_is_not_valid_95136","Name is not valid"),Can_only_convert_property_with_modifier:t(95137,e.DiagnosticCategory.Message,"Can_only_convert_property_with_modifier_95137","Can only convert property with modifier"),Switch_each_misused_0_to_1:t(95138,e.DiagnosticCategory.Message,"Switch_each_misused_0_to_1_95138","Switch each misused '{0}' to '{1}'"),Convert_to_optional_chain_expression:t(95139,e.DiagnosticCategory.Message,"Convert_to_optional_chain_expression_95139","Convert to optional chain expression"),Could_not_find_convertible_access_expression:t(95140,e.DiagnosticCategory.Message,"Could_not_find_convertible_access_expression_95140","Could not find convertible access expression"),Could_not_find_matching_access_expressions:t(95141,e.DiagnosticCategory.Message,"Could_not_find_matching_access_expressions_95141","Could not find matching access expressions"),Can_only_convert_logical_AND_access_chains:t(95142,e.DiagnosticCategory.Message,"Can_only_convert_logical_AND_access_chains_95142","Can only convert logical AND access chains"),Add_void_to_Promise_resolved_without_a_value:t(95143,e.DiagnosticCategory.Message,"Add_void_to_Promise_resolved_without_a_value_95143","Add 'void' to Promise resolved without a value"),Add_void_to_all_Promises_resolved_without_a_value:t(95144,e.DiagnosticCategory.Message,"Add_void_to_all_Promises_resolved_without_a_value_95144","Add 'void' to all Promises resolved without a value"),Use_element_access_for_0:t(95145,e.DiagnosticCategory.Message,"Use_element_access_for_0_95145","Use element access for '{0}'"),Use_element_access_for_all_undeclared_properties:t(95146,e.DiagnosticCategory.Message,"Use_element_access_for_all_undeclared_properties_95146","Use element access for all undeclared properties."),Delete_all_unused_imports:t(95147,e.DiagnosticCategory.Message,"Delete_all_unused_imports_95147","Delete all unused imports"),Infer_function_return_type:t(95148,e.DiagnosticCategory.Message,"Infer_function_return_type_95148","Infer function return type"),Return_type_must_be_inferred_from_a_function:t(95149,e.DiagnosticCategory.Message,"Return_type_must_be_inferred_from_a_function_95149","Return type must be inferred from a function"),Could_not_determine_function_return_type:t(95150,e.DiagnosticCategory.Message,"Could_not_determine_function_return_type_95150","Could not determine function return type"),Could_not_convert_to_arrow_function:t(95151,e.DiagnosticCategory.Message,"Could_not_convert_to_arrow_function_95151","Could not convert to arrow function"),Could_not_convert_to_named_function:t(95152,e.DiagnosticCategory.Message,"Could_not_convert_to_named_function_95152","Could not convert to named function"),Could_not_convert_to_anonymous_function:t(95153,e.DiagnosticCategory.Message,"Could_not_convert_to_anonymous_function_95153","Could not convert to anonymous function"),Can_only_convert_string_concatenation:t(95154,e.DiagnosticCategory.Message,"Can_only_convert_string_concatenation_95154","Can only convert string concatenation"),Selection_is_not_a_valid_statement_or_statements:t(95155,e.DiagnosticCategory.Message,"Selection_is_not_a_valid_statement_or_statements_95155","Selection is not a valid statement or statements"),Add_missing_function_declaration_0:t(95156,e.DiagnosticCategory.Message,"Add_missing_function_declaration_0_95156","Add missing function declaration '{0}'"),Add_all_missing_function_declarations:t(95157,e.DiagnosticCategory.Message,"Add_all_missing_function_declarations_95157","Add all missing function declarations"),Method_not_implemented:t(95158,e.DiagnosticCategory.Message,"Method_not_implemented_95158","Method not implemented."),Function_not_implemented:t(95159,e.DiagnosticCategory.Message,"Function_not_implemented_95159","Function not implemented."),Add_override_modifier:t(95160,e.DiagnosticCategory.Message,"Add_override_modifier_95160","Add 'override' modifier"),Remove_override_modifier:t(95161,e.DiagnosticCategory.Message,"Remove_override_modifier_95161","Remove 'override' modifier"),Add_all_missing_override_modifiers:t(95162,e.DiagnosticCategory.Message,"Add_all_missing_override_modifiers_95162","Add all missing 'override' modifiers"),Remove_all_unnecessary_override_modifiers:t(95163,e.DiagnosticCategory.Message,"Remove_all_unnecessary_override_modifiers_95163","Remove all unnecessary 'override' modifiers"),Can_only_convert_named_export:t(95164,e.DiagnosticCategory.Message,"Can_only_convert_named_export_95164","Can only convert named export"),Add_missing_properties:t(95165,e.DiagnosticCategory.Message,"Add_missing_properties_95165","Add missing properties"),Add_all_missing_properties:t(95166,e.DiagnosticCategory.Message,"Add_all_missing_properties_95166","Add all missing properties"),Add_missing_attributes:t(95167,e.DiagnosticCategory.Message,"Add_missing_attributes_95167","Add missing attributes"),Add_all_missing_attributes:t(95168,e.DiagnosticCategory.Message,"Add_all_missing_attributes_95168","Add all missing attributes"),Add_undefined_to_optional_property_type:t(95169,e.DiagnosticCategory.Message,"Add_undefined_to_optional_property_type_95169","Add 'undefined' to optional property type"),No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer:t(18004,e.DiagnosticCategory.Error,"No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer_18004","No value exists in scope for the shorthand property '{0}'. Either declare one or provide an initializer."),Classes_may_not_have_a_field_named_constructor:t(18006,e.DiagnosticCategory.Error,"Classes_may_not_have_a_field_named_constructor_18006","Classes may not have a field named 'constructor'."),JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array:t(18007,e.DiagnosticCategory.Error,"JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array_18007","JSX expressions may not use the comma operator. Did you mean to write an array?"),Private_identifiers_cannot_be_used_as_parameters:t(18009,e.DiagnosticCategory.Error,"Private_identifiers_cannot_be_used_as_parameters_18009","Private identifiers cannot be used as parameters."),An_accessibility_modifier_cannot_be_used_with_a_private_identifier:t(18010,e.DiagnosticCategory.Error,"An_accessibility_modifier_cannot_be_used_with_a_private_identifier_18010","An accessibility modifier cannot be used with a private identifier."),The_operand_of_a_delete_operator_cannot_be_a_private_identifier:t(18011,e.DiagnosticCategory.Error,"The_operand_of_a_delete_operator_cannot_be_a_private_identifier_18011","The operand of a 'delete' operator cannot be a private identifier."),constructor_is_a_reserved_word:t(18012,e.DiagnosticCategory.Error,"constructor_is_a_reserved_word_18012","'#constructor' is a reserved word."),Property_0_is_not_accessible_outside_class_1_because_it_has_a_private_identifier:t(18013,e.DiagnosticCategory.Error,"Property_0_is_not_accessible_outside_class_1_because_it_has_a_private_identifier_18013","Property '{0}' is not accessible outside class '{1}' because it has a private identifier."),The_property_0_cannot_be_accessed_on_type_1_within_this_class_because_it_is_shadowed_by_another_private_identifier_with_the_same_spelling:t(18014,e.DiagnosticCategory.Error,"The_property_0_cannot_be_accessed_on_type_1_within_this_class_because_it_is_shadowed_by_another_priv_18014","The property '{0}' cannot be accessed on type '{1}' within this class because it is shadowed by another private identifier with the same spelling."),Property_0_in_type_1_refers_to_a_different_member_that_cannot_be_accessed_from_within_type_2:t(18015,e.DiagnosticCategory.Error,"Property_0_in_type_1_refers_to_a_different_member_that_cannot_be_accessed_from_within_type_2_18015","Property '{0}' in type '{1}' refers to a different member that cannot be accessed from within type '{2}'."),Private_identifiers_are_not_allowed_outside_class_bodies:t(18016,e.DiagnosticCategory.Error,"Private_identifiers_are_not_allowed_outside_class_bodies_18016","Private identifiers are not allowed outside class bodies."),The_shadowing_declaration_of_0_is_defined_here:t(18017,e.DiagnosticCategory.Error,"The_shadowing_declaration_of_0_is_defined_here_18017","The shadowing declaration of '{0}' is defined here"),The_declaration_of_0_that_you_probably_intended_to_use_is_defined_here:t(18018,e.DiagnosticCategory.Error,"The_declaration_of_0_that_you_probably_intended_to_use_is_defined_here_18018","The declaration of '{0}' that you probably intended to use is defined here"),_0_modifier_cannot_be_used_with_a_private_identifier:t(18019,e.DiagnosticCategory.Error,"_0_modifier_cannot_be_used_with_a_private_identifier_18019","'{0}' modifier cannot be used with a private identifier."),An_enum_member_cannot_be_named_with_a_private_identifier:t(18024,e.DiagnosticCategory.Error,"An_enum_member_cannot_be_named_with_a_private_identifier_18024","An enum member cannot be named with a private identifier."),can_only_be_used_at_the_start_of_a_file:t(18026,e.DiagnosticCategory.Error,"can_only_be_used_at_the_start_of_a_file_18026","'#!' can only be used at the start of a file."),Compiler_reserves_name_0_when_emitting_private_identifier_downlevel:t(18027,e.DiagnosticCategory.Error,"Compiler_reserves_name_0_when_emitting_private_identifier_downlevel_18027","Compiler reserves name '{0}' when emitting private identifier downlevel."),Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher:t(18028,e.DiagnosticCategory.Error,"Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher_18028","Private identifiers are only available when targeting ECMAScript 2015 and higher."),Private_identifiers_are_not_allowed_in_variable_declarations:t(18029,e.DiagnosticCategory.Error,"Private_identifiers_are_not_allowed_in_variable_declarations_18029","Private identifiers are not allowed in variable declarations."),An_optional_chain_cannot_contain_private_identifiers:t(18030,e.DiagnosticCategory.Error,"An_optional_chain_cannot_contain_private_identifiers_18030","An optional chain cannot contain private identifiers."),The_intersection_0_was_reduced_to_never_because_property_1_has_conflicting_types_in_some_constituents:t(18031,e.DiagnosticCategory.Error,"The_intersection_0_was_reduced_to_never_because_property_1_has_conflicting_types_in_some_constituent_18031","The intersection '{0}' was reduced to 'never' because property '{1}' has conflicting types in some constituents."),The_intersection_0_was_reduced_to_never_because_property_1_exists_in_multiple_constituents_and_is_private_in_some:t(18032,e.DiagnosticCategory.Error,"The_intersection_0_was_reduced_to_never_because_property_1_exists_in_multiple_constituents_and_is_pr_18032","The intersection '{0}' was reduced to 'never' because property '{1}' exists in multiple constituents and is private in some."),Only_numeric_enums_can_have_computed_members_but_this_expression_has_type_0_If_you_do_not_need_exhaustiveness_checks_consider_using_an_object_literal_instead:t(18033,e.DiagnosticCategory.Error,"Only_numeric_enums_can_have_computed_members_but_this_expression_has_type_0_If_you_do_not_need_exhau_18033","Only numeric enums can have computed members, but this expression has type '{0}'. If you do not need exhaustiveness checks, consider using an object literal instead."),Specify_the_JSX_fragment_factory_function_to_use_when_targeting_react_JSX_emit_with_jsxFactory_compiler_option_is_specified_e_g_Fragment:t(18034,e.DiagnosticCategory.Message,"Specify_the_JSX_fragment_factory_function_to_use_when_targeting_react_JSX_emit_with_jsxFactory_compi_18034","Specify the JSX fragment factory function to use when targeting 'react' JSX emit with 'jsxFactory' compiler option is specified, e.g. 'Fragment'."),Invalid_value_for_jsxFragmentFactory_0_is_not_a_valid_identifier_or_qualified_name:t(18035,e.DiagnosticCategory.Error,"Invalid_value_for_jsxFragmentFactory_0_is_not_a_valid_identifier_or_qualified_name_18035","Invalid value for 'jsxFragmentFactory'. '{0}' is not a valid identifier or qualified-name."),Class_decorators_can_t_be_used_with_static_private_identifier_Consider_removing_the_experimental_decorator:t(18036,e.DiagnosticCategory.Error,"Class_decorators_can_t_be_used_with_static_private_identifier_Consider_removing_the_experimental_dec_18036","Class decorators can't be used with static private identifier. Consider removing the experimental decorator."),Await_expression_cannot_be_used_inside_a_class_static_block:t(18037,e.DiagnosticCategory.Error,"Await_expression_cannot_be_used_inside_a_class_static_block_18037","Await expression cannot be used inside a class static block."),For_await_loops_cannot_be_used_inside_a_class_static_block:t(18038,e.DiagnosticCategory.Error,"For_await_loops_cannot_be_used_inside_a_class_static_block_18038","'For await' loops cannot be used inside a class static block."),Invalid_use_of_0_It_cannot_be_used_inside_a_class_static_block:t(18039,e.DiagnosticCategory.Error,"Invalid_use_of_0_It_cannot_be_used_inside_a_class_static_block_18039","Invalid use of '{0}'. It cannot be used inside a class static block."),A_return_statement_cannot_be_used_inside_a_class_static_block:t(18041,e.DiagnosticCategory.Error,"A_return_statement_cannot_be_used_inside_a_class_static_block_18041","A 'return' statement cannot be used inside a class static block.")};}(t),function(e){var t;function r(e){return e>=79}e.tokenIsIdentifierOrKeyword=r,e.tokenIsIdentifierOrKeywordOrGreaterThan=function(e){return 31===e||r(e)},e.textToKeywordObj=((t={abstract:126,any:130,as:127,asserts:128,assert:129,bigint:157,boolean:133,break:81,case:82,catch:83,class:84,continue:86,const:85}).constructor=134,t.debugger=87,t.declare=135,t.default=88,t.delete=89,t.do=90,t.else=91,t.enum=92,t.export=93,t.extends=94,t.false=95,t.finally=96,t.for=97,t.from=155,t.function=98,t.get=136,t.if=99,t.implements=117,t.import=100,t.in=101,t.infer=137,t.instanceof=102,t.interface=118,t.intrinsic=138,t.is=139,t.keyof=140,t.let=119,t.module=141,t.namespace=142,t.never=143,t.new=103,t.null=104,t.number=146,t.object=147,t.package=120,t.private=121,t.protected=122,t.public=123,t.override=158,t.readonly=144,t.require=145,t.global=156,t.return=105,t.set=148,t.static=124,t.string=149,t.super=106,t.switch=107,t.symbol=150,t.this=108,t.throw=109,t.true=110,t.try=111,t.type=151,t.typeof=112,t.undefined=152,t.unique=153,t.unknown=154,t.var=113,t.void=114,t.while=115,t.with=116,t.yield=125,t.async=131,t.await=132,t.of=159,t);var n=new e.Map(e.getEntries(e.textToKeywordObj)),a=new e.Map(e.getEntries(i$1(i$1({},e.textToKeywordObj),{"{":18,"}":19,"(":20,")":21,"[":22,"]":23,".":24,"...":25,";":26,",":27,"<":29,">":31,"<=":32,">=":33,"==":34,"!=":35,"===":36,"!==":37,"=>":38,"+":39,"-":40,"**":42,"*":41,"/":43,"%":44,"++":45,"--":46,"<<":47,"</":30,">>":48,">>>":49,"&":50,"|":51,"^":52,"!":53,"~":54,"&&":55,"||":56,"?":57,"??":60,"?.":28,":":58,"=":63,"+=":64,"-=":65,"*=":66,"**=":67,"/=":68,"%=":69,"<<=":70,">>=":71,">>>=":72,"&=":73,"|=":74,"^=":78,"||=":75,"&&=":76,"??=":77,"@":59,"#":62,"`":61}))),o=[170,170,181,181,186,186,192,214,216,246,248,543,546,563,592,685,688,696,699,705,720,721,736,740,750,750,890,890,902,902,904,906,908,908,910,929,931,974,976,983,986,1011,1024,1153,1164,1220,1223,1224,1227,1228,1232,1269,1272,1273,1329,1366,1369,1369,1377,1415,1488,1514,1520,1522,1569,1594,1600,1610,1649,1747,1749,1749,1765,1766,1786,1788,1808,1808,1810,1836,1920,1957,2309,2361,2365,2365,2384,2384,2392,2401,2437,2444,2447,2448,2451,2472,2474,2480,2482,2482,2486,2489,2524,2525,2527,2529,2544,2545,2565,2570,2575,2576,2579,2600,2602,2608,2610,2611,2613,2614,2616,2617,2649,2652,2654,2654,2674,2676,2693,2699,2701,2701,2703,2705,2707,2728,2730,2736,2738,2739,2741,2745,2749,2749,2768,2768,2784,2784,2821,2828,2831,2832,2835,2856,2858,2864,2866,2867,2870,2873,2877,2877,2908,2909,2911,2913,2949,2954,2958,2960,2962,2965,2969,2970,2972,2972,2974,2975,2979,2980,2984,2986,2990,2997,2999,3001,3077,3084,3086,3088,3090,3112,3114,3123,3125,3129,3168,3169,3205,3212,3214,3216,3218,3240,3242,3251,3253,3257,3294,3294,3296,3297,3333,3340,3342,3344,3346,3368,3370,3385,3424,3425,3461,3478,3482,3505,3507,3515,3517,3517,3520,3526,3585,3632,3634,3635,3648,3654,3713,3714,3716,3716,3719,3720,3722,3722,3725,3725,3732,3735,3737,3743,3745,3747,3749,3749,3751,3751,3754,3755,3757,3760,3762,3763,3773,3773,3776,3780,3782,3782,3804,3805,3840,3840,3904,3911,3913,3946,3976,3979,4096,4129,4131,4135,4137,4138,4176,4181,4256,4293,4304,4342,4352,4441,4447,4514,4520,4601,4608,4614,4616,4678,4680,4680,4682,4685,4688,4694,4696,4696,4698,4701,4704,4742,4744,4744,4746,4749,4752,4782,4784,4784,4786,4789,4792,4798,4800,4800,4802,4805,4808,4814,4816,4822,4824,4846,4848,4878,4880,4880,4882,4885,4888,4894,4896,4934,4936,4954,5024,5108,5121,5740,5743,5750,5761,5786,5792,5866,6016,6067,6176,6263,6272,6312,7680,7835,7840,7929,7936,7957,7960,7965,7968,8005,8008,8013,8016,8023,8025,8025,8027,8027,8029,8029,8031,8061,8064,8116,8118,8124,8126,8126,8130,8132,8134,8140,8144,8147,8150,8155,8160,8172,8178,8180,8182,8188,8319,8319,8450,8450,8455,8455,8458,8467,8469,8469,8473,8477,8484,8484,8486,8486,8488,8488,8490,8493,8495,8497,8499,8505,8544,8579,12293,12295,12321,12329,12337,12341,12344,12346,12353,12436,12445,12446,12449,12538,12540,12542,12549,12588,12593,12686,12704,12727,13312,19893,19968,40869,40960,42124,44032,55203,63744,64045,64256,64262,64275,64279,64285,64285,64287,64296,64298,64310,64312,64316,64318,64318,64320,64321,64323,64324,64326,64433,64467,64829,64848,64911,64914,64967,65008,65019,65136,65138,65140,65140,65142,65276,65313,65338,65345,65370,65382,65470,65474,65479,65482,65487,65490,65495,65498,65500],s=[170,170,181,181,186,186,192,214,216,246,248,543,546,563,592,685,688,696,699,705,720,721,736,740,750,750,768,846,864,866,890,890,902,902,904,906,908,908,910,929,931,974,976,983,986,1011,1024,1153,1155,1158,1164,1220,1223,1224,1227,1228,1232,1269,1272,1273,1329,1366,1369,1369,1377,1415,1425,1441,1443,1465,1467,1469,1471,1471,1473,1474,1476,1476,1488,1514,1520,1522,1569,1594,1600,1621,1632,1641,1648,1747,1749,1756,1759,1768,1770,1773,1776,1788,1808,1836,1840,1866,1920,1968,2305,2307,2309,2361,2364,2381,2384,2388,2392,2403,2406,2415,2433,2435,2437,2444,2447,2448,2451,2472,2474,2480,2482,2482,2486,2489,2492,2492,2494,2500,2503,2504,2507,2509,2519,2519,2524,2525,2527,2531,2534,2545,2562,2562,2565,2570,2575,2576,2579,2600,2602,2608,2610,2611,2613,2614,2616,2617,2620,2620,2622,2626,2631,2632,2635,2637,2649,2652,2654,2654,2662,2676,2689,2691,2693,2699,2701,2701,2703,2705,2707,2728,2730,2736,2738,2739,2741,2745,2748,2757,2759,2761,2763,2765,2768,2768,2784,2784,2790,2799,2817,2819,2821,2828,2831,2832,2835,2856,2858,2864,2866,2867,2870,2873,2876,2883,2887,2888,2891,2893,2902,2903,2908,2909,2911,2913,2918,2927,2946,2947,2949,2954,2958,2960,2962,2965,2969,2970,2972,2972,2974,2975,2979,2980,2984,2986,2990,2997,2999,3001,3006,3010,3014,3016,3018,3021,3031,3031,3047,3055,3073,3075,3077,3084,3086,3088,3090,3112,3114,3123,3125,3129,3134,3140,3142,3144,3146,3149,3157,3158,3168,3169,3174,3183,3202,3203,3205,3212,3214,3216,3218,3240,3242,3251,3253,3257,3262,3268,3270,3272,3274,3277,3285,3286,3294,3294,3296,3297,3302,3311,3330,3331,3333,3340,3342,3344,3346,3368,3370,3385,3390,3395,3398,3400,3402,3405,3415,3415,3424,3425,3430,3439,3458,3459,3461,3478,3482,3505,3507,3515,3517,3517,3520,3526,3530,3530,3535,3540,3542,3542,3544,3551,3570,3571,3585,3642,3648,3662,3664,3673,3713,3714,3716,3716,3719,3720,3722,3722,3725,3725,3732,3735,3737,3743,3745,3747,3749,3749,3751,3751,3754,3755,3757,3769,3771,3773,3776,3780,3782,3782,3784,3789,3792,3801,3804,3805,3840,3840,3864,3865,3872,3881,3893,3893,3895,3895,3897,3897,3902,3911,3913,3946,3953,3972,3974,3979,3984,3991,3993,4028,4038,4038,4096,4129,4131,4135,4137,4138,4140,4146,4150,4153,4160,4169,4176,4185,4256,4293,4304,4342,4352,4441,4447,4514,4520,4601,4608,4614,4616,4678,4680,4680,4682,4685,4688,4694,4696,4696,4698,4701,4704,4742,4744,4744,4746,4749,4752,4782,4784,4784,4786,4789,4792,4798,4800,4800,4802,4805,4808,4814,4816,4822,4824,4846,4848,4878,4880,4880,4882,4885,4888,4894,4896,4934,4936,4954,4969,4977,5024,5108,5121,5740,5743,5750,5761,5786,5792,5866,6016,6099,6112,6121,6160,6169,6176,6263,6272,6313,7680,7835,7840,7929,7936,7957,7960,7965,7968,8005,8008,8013,8016,8023,8025,8025,8027,8027,8029,8029,8031,8061,8064,8116,8118,8124,8126,8126,8130,8132,8134,8140,8144,8147,8150,8155,8160,8172,8178,8180,8182,8188,8255,8256,8319,8319,8400,8412,8417,8417,8450,8450,8455,8455,8458,8467,8469,8469,8473,8477,8484,8484,8486,8486,8488,8488,8490,8493,8495,8497,8499,8505,8544,8579,12293,12295,12321,12335,12337,12341,12344,12346,12353,12436,12441,12442,12445,12446,12449,12542,12549,12588,12593,12686,12704,12727,13312,19893,19968,40869,40960,42124,44032,55203,63744,64045,64256,64262,64275,64279,64285,64296,64298,64310,64312,64316,64318,64318,64320,64321,64323,64324,64326,64433,64467,64829,64848,64911,64914,64967,65008,65019,65056,65059,65075,65076,65101,65103,65136,65138,65140,65140,65142,65276,65296,65305,65313,65338,65343,65343,65345,65370,65381,65470,65474,65479,65482,65487,65490,65495,65498,65500],c=[170,170,181,181,186,186,192,214,216,246,248,705,710,721,736,740,748,748,750,750,880,884,886,887,890,893,902,902,904,906,908,908,910,929,931,1013,1015,1153,1162,1319,1329,1366,1369,1369,1377,1415,1488,1514,1520,1522,1568,1610,1646,1647,1649,1747,1749,1749,1765,1766,1774,1775,1786,1788,1791,1791,1808,1808,1810,1839,1869,1957,1969,1969,1994,2026,2036,2037,2042,2042,2048,2069,2074,2074,2084,2084,2088,2088,2112,2136,2208,2208,2210,2220,2308,2361,2365,2365,2384,2384,2392,2401,2417,2423,2425,2431,2437,2444,2447,2448,2451,2472,2474,2480,2482,2482,2486,2489,2493,2493,2510,2510,2524,2525,2527,2529,2544,2545,2565,2570,2575,2576,2579,2600,2602,2608,2610,2611,2613,2614,2616,2617,2649,2652,2654,2654,2674,2676,2693,2701,2703,2705,2707,2728,2730,2736,2738,2739,2741,2745,2749,2749,2768,2768,2784,2785,2821,2828,2831,2832,2835,2856,2858,2864,2866,2867,2869,2873,2877,2877,2908,2909,2911,2913,2929,2929,2947,2947,2949,2954,2958,2960,2962,2965,2969,2970,2972,2972,2974,2975,2979,2980,2984,2986,2990,3001,3024,3024,3077,3084,3086,3088,3090,3112,3114,3123,3125,3129,3133,3133,3160,3161,3168,3169,3205,3212,3214,3216,3218,3240,3242,3251,3253,3257,3261,3261,3294,3294,3296,3297,3313,3314,3333,3340,3342,3344,3346,3386,3389,3389,3406,3406,3424,3425,3450,3455,3461,3478,3482,3505,3507,3515,3517,3517,3520,3526,3585,3632,3634,3635,3648,3654,3713,3714,3716,3716,3719,3720,3722,3722,3725,3725,3732,3735,3737,3743,3745,3747,3749,3749,3751,3751,3754,3755,3757,3760,3762,3763,3773,3773,3776,3780,3782,3782,3804,3807,3840,3840,3904,3911,3913,3948,3976,3980,4096,4138,4159,4159,4176,4181,4186,4189,4193,4193,4197,4198,4206,4208,4213,4225,4238,4238,4256,4293,4295,4295,4301,4301,4304,4346,4348,4680,4682,4685,4688,4694,4696,4696,4698,4701,4704,4744,4746,4749,4752,4784,4786,4789,4792,4798,4800,4800,4802,4805,4808,4822,4824,4880,4882,4885,4888,4954,4992,5007,5024,5108,5121,5740,5743,5759,5761,5786,5792,5866,5870,5872,5888,5900,5902,5905,5920,5937,5952,5969,5984,5996,5998,6e3,6016,6067,6103,6103,6108,6108,6176,6263,6272,6312,6314,6314,6320,6389,6400,6428,6480,6509,6512,6516,6528,6571,6593,6599,6656,6678,6688,6740,6823,6823,6917,6963,6981,6987,7043,7072,7086,7087,7098,7141,7168,7203,7245,7247,7258,7293,7401,7404,7406,7409,7413,7414,7424,7615,7680,7957,7960,7965,7968,8005,8008,8013,8016,8023,8025,8025,8027,8027,8029,8029,8031,8061,8064,8116,8118,8124,8126,8126,8130,8132,8134,8140,8144,8147,8150,8155,8160,8172,8178,8180,8182,8188,8305,8305,8319,8319,8336,8348,8450,8450,8455,8455,8458,8467,8469,8469,8473,8477,8484,8484,8486,8486,8488,8488,8490,8493,8495,8505,8508,8511,8517,8521,8526,8526,8544,8584,11264,11310,11312,11358,11360,11492,11499,11502,11506,11507,11520,11557,11559,11559,11565,11565,11568,11623,11631,11631,11648,11670,11680,11686,11688,11694,11696,11702,11704,11710,11712,11718,11720,11726,11728,11734,11736,11742,11823,11823,12293,12295,12321,12329,12337,12341,12344,12348,12353,12438,12445,12447,12449,12538,12540,12543,12549,12589,12593,12686,12704,12730,12784,12799,13312,19893,19968,40908,40960,42124,42192,42237,42240,42508,42512,42527,42538,42539,42560,42606,42623,42647,42656,42735,42775,42783,42786,42888,42891,42894,42896,42899,42912,42922,43e3,43009,43011,43013,43015,43018,43020,43042,43072,43123,43138,43187,43250,43255,43259,43259,43274,43301,43312,43334,43360,43388,43396,43442,43471,43471,43520,43560,43584,43586,43588,43595,43616,43638,43642,43642,43648,43695,43697,43697,43701,43702,43705,43709,43712,43712,43714,43714,43739,43741,43744,43754,43762,43764,43777,43782,43785,43790,43793,43798,43808,43814,43816,43822,43968,44002,44032,55203,55216,55238,55243,55291,63744,64109,64112,64217,64256,64262,64275,64279,64285,64285,64287,64296,64298,64310,64312,64316,64318,64318,64320,64321,64323,64324,64326,64433,64467,64829,64848,64911,64914,64967,65008,65019,65136,65140,65142,65276,65313,65338,65345,65370,65382,65470,65474,65479,65482,65487,65490,65495,65498,65500],l=[170,170,181,181,186,186,192,214,216,246,248,705,710,721,736,740,748,748,750,750,768,884,886,887,890,893,902,902,904,906,908,908,910,929,931,1013,1015,1153,1155,1159,1162,1319,1329,1366,1369,1369,1377,1415,1425,1469,1471,1471,1473,1474,1476,1477,1479,1479,1488,1514,1520,1522,1552,1562,1568,1641,1646,1747,1749,1756,1759,1768,1770,1788,1791,1791,1808,1866,1869,1969,1984,2037,2042,2042,2048,2093,2112,2139,2208,2208,2210,2220,2276,2302,2304,2403,2406,2415,2417,2423,2425,2431,2433,2435,2437,2444,2447,2448,2451,2472,2474,2480,2482,2482,2486,2489,2492,2500,2503,2504,2507,2510,2519,2519,2524,2525,2527,2531,2534,2545,2561,2563,2565,2570,2575,2576,2579,2600,2602,2608,2610,2611,2613,2614,2616,2617,2620,2620,2622,2626,2631,2632,2635,2637,2641,2641,2649,2652,2654,2654,2662,2677,2689,2691,2693,2701,2703,2705,2707,2728,2730,2736,2738,2739,2741,2745,2748,2757,2759,2761,2763,2765,2768,2768,2784,2787,2790,2799,2817,2819,2821,2828,2831,2832,2835,2856,2858,2864,2866,2867,2869,2873,2876,2884,2887,2888,2891,2893,2902,2903,2908,2909,2911,2915,2918,2927,2929,2929,2946,2947,2949,2954,2958,2960,2962,2965,2969,2970,2972,2972,2974,2975,2979,2980,2984,2986,2990,3001,3006,3010,3014,3016,3018,3021,3024,3024,3031,3031,3046,3055,3073,3075,3077,3084,3086,3088,3090,3112,3114,3123,3125,3129,3133,3140,3142,3144,3146,3149,3157,3158,3160,3161,3168,3171,3174,3183,3202,3203,3205,3212,3214,3216,3218,3240,3242,3251,3253,3257,3260,3268,3270,3272,3274,3277,3285,3286,3294,3294,3296,3299,3302,3311,3313,3314,3330,3331,3333,3340,3342,3344,3346,3386,3389,3396,3398,3400,3402,3406,3415,3415,3424,3427,3430,3439,3450,3455,3458,3459,3461,3478,3482,3505,3507,3515,3517,3517,3520,3526,3530,3530,3535,3540,3542,3542,3544,3551,3570,3571,3585,3642,3648,3662,3664,3673,3713,3714,3716,3716,3719,3720,3722,3722,3725,3725,3732,3735,3737,3743,3745,3747,3749,3749,3751,3751,3754,3755,3757,3769,3771,3773,3776,3780,3782,3782,3784,3789,3792,3801,3804,3807,3840,3840,3864,3865,3872,3881,3893,3893,3895,3895,3897,3897,3902,3911,3913,3948,3953,3972,3974,3991,3993,4028,4038,4038,4096,4169,4176,4253,4256,4293,4295,4295,4301,4301,4304,4346,4348,4680,4682,4685,4688,4694,4696,4696,4698,4701,4704,4744,4746,4749,4752,4784,4786,4789,4792,4798,4800,4800,4802,4805,4808,4822,4824,4880,4882,4885,4888,4954,4957,4959,4992,5007,5024,5108,5121,5740,5743,5759,5761,5786,5792,5866,5870,5872,5888,5900,5902,5908,5920,5940,5952,5971,5984,5996,5998,6e3,6002,6003,6016,6099,6103,6103,6108,6109,6112,6121,6155,6157,6160,6169,6176,6263,6272,6314,6320,6389,6400,6428,6432,6443,6448,6459,6470,6509,6512,6516,6528,6571,6576,6601,6608,6617,6656,6683,6688,6750,6752,6780,6783,6793,6800,6809,6823,6823,6912,6987,6992,7001,7019,7027,7040,7155,7168,7223,7232,7241,7245,7293,7376,7378,7380,7414,7424,7654,7676,7957,7960,7965,7968,8005,8008,8013,8016,8023,8025,8025,8027,8027,8029,8029,8031,8061,8064,8116,8118,8124,8126,8126,8130,8132,8134,8140,8144,8147,8150,8155,8160,8172,8178,8180,8182,8188,8204,8205,8255,8256,8276,8276,8305,8305,8319,8319,8336,8348,8400,8412,8417,8417,8421,8432,8450,8450,8455,8455,8458,8467,8469,8469,8473,8477,8484,8484,8486,8486,8488,8488,8490,8493,8495,8505,8508,8511,8517,8521,8526,8526,8544,8584,11264,11310,11312,11358,11360,11492,11499,11507,11520,11557,11559,11559,11565,11565,11568,11623,11631,11631,11647,11670,11680,11686,11688,11694,11696,11702,11704,11710,11712,11718,11720,11726,11728,11734,11736,11742,11744,11775,11823,11823,12293,12295,12321,12335,12337,12341,12344,12348,12353,12438,12441,12442,12445,12447,12449,12538,12540,12543,12549,12589,12593,12686,12704,12730,12784,12799,13312,19893,19968,40908,40960,42124,42192,42237,42240,42508,42512,42539,42560,42607,42612,42621,42623,42647,42655,42737,42775,42783,42786,42888,42891,42894,42896,42899,42912,42922,43e3,43047,43072,43123,43136,43204,43216,43225,43232,43255,43259,43259,43264,43309,43312,43347,43360,43388,43392,43456,43471,43481,43520,43574,43584,43597,43600,43609,43616,43638,43642,43643,43648,43714,43739,43741,43744,43759,43762,43766,43777,43782,43785,43790,43793,43798,43808,43814,43816,43822,43968,44010,44012,44013,44016,44025,44032,55203,55216,55238,55243,55291,63744,64109,64112,64217,64256,64262,64275,64279,64285,64296,64298,64310,64312,64316,64318,64318,64320,64321,64323,64324,64326,64433,64467,64829,64848,64911,64914,64967,65008,65019,65024,65039,65056,65062,65075,65076,65101,65103,65136,65140,65142,65276,65296,65305,65313,65338,65343,65343,65345,65370,65382,65470,65474,65479,65482,65487,65490,65495,65498,65500],u=[65,90,97,122,170,170,181,181,186,186,192,214,216,246,248,705,710,721,736,740,748,748,750,750,880,884,886,887,890,893,895,895,902,902,904,906,908,908,910,929,931,1013,1015,1153,1162,1327,1329,1366,1369,1369,1376,1416,1488,1514,1519,1522,1568,1610,1646,1647,1649,1747,1749,1749,1765,1766,1774,1775,1786,1788,1791,1791,1808,1808,1810,1839,1869,1957,1969,1969,1994,2026,2036,2037,2042,2042,2048,2069,2074,2074,2084,2084,2088,2088,2112,2136,2144,2154,2208,2228,2230,2237,2308,2361,2365,2365,2384,2384,2392,2401,2417,2432,2437,2444,2447,2448,2451,2472,2474,2480,2482,2482,2486,2489,2493,2493,2510,2510,2524,2525,2527,2529,2544,2545,2556,2556,2565,2570,2575,2576,2579,2600,2602,2608,2610,2611,2613,2614,2616,2617,2649,2652,2654,2654,2674,2676,2693,2701,2703,2705,2707,2728,2730,2736,2738,2739,2741,2745,2749,2749,2768,2768,2784,2785,2809,2809,2821,2828,2831,2832,2835,2856,2858,2864,2866,2867,2869,2873,2877,2877,2908,2909,2911,2913,2929,2929,2947,2947,2949,2954,2958,2960,2962,2965,2969,2970,2972,2972,2974,2975,2979,2980,2984,2986,2990,3001,3024,3024,3077,3084,3086,3088,3090,3112,3114,3129,3133,3133,3160,3162,3168,3169,3200,3200,3205,3212,3214,3216,3218,3240,3242,3251,3253,3257,3261,3261,3294,3294,3296,3297,3313,3314,3333,3340,3342,3344,3346,3386,3389,3389,3406,3406,3412,3414,3423,3425,3450,3455,3461,3478,3482,3505,3507,3515,3517,3517,3520,3526,3585,3632,3634,3635,3648,3654,3713,3714,3716,3716,3718,3722,3724,3747,3749,3749,3751,3760,3762,3763,3773,3773,3776,3780,3782,3782,3804,3807,3840,3840,3904,3911,3913,3948,3976,3980,4096,4138,4159,4159,4176,4181,4186,4189,4193,4193,4197,4198,4206,4208,4213,4225,4238,4238,4256,4293,4295,4295,4301,4301,4304,4346,4348,4680,4682,4685,4688,4694,4696,4696,4698,4701,4704,4744,4746,4749,4752,4784,4786,4789,4792,4798,4800,4800,4802,4805,4808,4822,4824,4880,4882,4885,4888,4954,4992,5007,5024,5109,5112,5117,5121,5740,5743,5759,5761,5786,5792,5866,5870,5880,5888,5900,5902,5905,5920,5937,5952,5969,5984,5996,5998,6e3,6016,6067,6103,6103,6108,6108,6176,6264,6272,6312,6314,6314,6320,6389,6400,6430,6480,6509,6512,6516,6528,6571,6576,6601,6656,6678,6688,6740,6823,6823,6917,6963,6981,6987,7043,7072,7086,7087,7098,7141,7168,7203,7245,7247,7258,7293,7296,7304,7312,7354,7357,7359,7401,7404,7406,7411,7413,7414,7418,7418,7424,7615,7680,7957,7960,7965,7968,8005,8008,8013,8016,8023,8025,8025,8027,8027,8029,8029,8031,8061,8064,8116,8118,8124,8126,8126,8130,8132,8134,8140,8144,8147,8150,8155,8160,8172,8178,8180,8182,8188,8305,8305,8319,8319,8336,8348,8450,8450,8455,8455,8458,8467,8469,8469,8472,8477,8484,8484,8486,8486,8488,8488,8490,8505,8508,8511,8517,8521,8526,8526,8544,8584,11264,11310,11312,11358,11360,11492,11499,11502,11506,11507,11520,11557,11559,11559,11565,11565,11568,11623,11631,11631,11648,11670,11680,11686,11688,11694,11696,11702,11704,11710,11712,11718,11720,11726,11728,11734,11736,11742,12293,12295,12321,12329,12337,12341,12344,12348,12353,12438,12443,12447,12449,12538,12540,12543,12549,12591,12593,12686,12704,12730,12784,12799,13312,19893,19968,40943,40960,42124,42192,42237,42240,42508,42512,42527,42538,42539,42560,42606,42623,42653,42656,42735,42775,42783,42786,42888,42891,42943,42946,42950,42999,43009,43011,43013,43015,43018,43020,43042,43072,43123,43138,43187,43250,43255,43259,43259,43261,43262,43274,43301,43312,43334,43360,43388,43396,43442,43471,43471,43488,43492,43494,43503,43514,43518,43520,43560,43584,43586,43588,43595,43616,43638,43642,43642,43646,43695,43697,43697,43701,43702,43705,43709,43712,43712,43714,43714,43739,43741,43744,43754,43762,43764,43777,43782,43785,43790,43793,43798,43808,43814,43816,43822,43824,43866,43868,43879,43888,44002,44032,55203,55216,55238,55243,55291,63744,64109,64112,64217,64256,64262,64275,64279,64285,64285,64287,64296,64298,64310,64312,64316,64318,64318,64320,64321,64323,64324,64326,64433,64467,64829,64848,64911,64914,64967,65008,65019,65136,65140,65142,65276,65313,65338,65345,65370,65382,65470,65474,65479,65482,65487,65490,65495,65498,65500,65536,65547,65549,65574,65576,65594,65596,65597,65599,65613,65616,65629,65664,65786,65856,65908,66176,66204,66208,66256,66304,66335,66349,66378,66384,66421,66432,66461,66464,66499,66504,66511,66513,66517,66560,66717,66736,66771,66776,66811,66816,66855,66864,66915,67072,67382,67392,67413,67424,67431,67584,67589,67592,67592,67594,67637,67639,67640,67644,67644,67647,67669,67680,67702,67712,67742,67808,67826,67828,67829,67840,67861,67872,67897,67968,68023,68030,68031,68096,68096,68112,68115,68117,68119,68121,68149,68192,68220,68224,68252,68288,68295,68297,68324,68352,68405,68416,68437,68448,68466,68480,68497,68608,68680,68736,68786,68800,68850,68864,68899,69376,69404,69415,69415,69424,69445,69600,69622,69635,69687,69763,69807,69840,69864,69891,69926,69956,69956,69968,70002,70006,70006,70019,70066,70081,70084,70106,70106,70108,70108,70144,70161,70163,70187,70272,70278,70280,70280,70282,70285,70287,70301,70303,70312,70320,70366,70405,70412,70415,70416,70419,70440,70442,70448,70450,70451,70453,70457,70461,70461,70480,70480,70493,70497,70656,70708,70727,70730,70751,70751,70784,70831,70852,70853,70855,70855,71040,71086,71128,71131,71168,71215,71236,71236,71296,71338,71352,71352,71424,71450,71680,71723,71840,71903,71935,71935,72096,72103,72106,72144,72161,72161,72163,72163,72192,72192,72203,72242,72250,72250,72272,72272,72284,72329,72349,72349,72384,72440,72704,72712,72714,72750,72768,72768,72818,72847,72960,72966,72968,72969,72971,73008,73030,73030,73056,73061,73063,73064,73066,73097,73112,73112,73440,73458,73728,74649,74752,74862,74880,75075,77824,78894,82944,83526,92160,92728,92736,92766,92880,92909,92928,92975,92992,92995,93027,93047,93053,93071,93760,93823,93952,94026,94032,94032,94099,94111,94176,94177,94179,94179,94208,100343,100352,101106,110592,110878,110928,110930,110948,110951,110960,111355,113664,113770,113776,113788,113792,113800,113808,113817,119808,119892,119894,119964,119966,119967,119970,119970,119973,119974,119977,119980,119982,119993,119995,119995,119997,120003,120005,120069,120071,120074,120077,120084,120086,120092,120094,120121,120123,120126,120128,120132,120134,120134,120138,120144,120146,120485,120488,120512,120514,120538,120540,120570,120572,120596,120598,120628,120630,120654,120656,120686,120688,120712,120714,120744,120746,120770,120772,120779,123136,123180,123191,123197,123214,123214,123584,123627,124928,125124,125184,125251,125259,125259,126464,126467,126469,126495,126497,126498,126500,126500,126503,126503,126505,126514,126516,126519,126521,126521,126523,126523,126530,126530,126535,126535,126537,126537,126539,126539,126541,126543,126545,126546,126548,126548,126551,126551,126553,126553,126555,126555,126557,126557,126559,126559,126561,126562,126564,126564,126567,126570,126572,126578,126580,126583,126585,126588,126590,126590,126592,126601,126603,126619,126625,126627,126629,126633,126635,126651,131072,173782,173824,177972,177984,178205,178208,183969,183984,191456,194560,195101],_=[48,57,65,90,95,95,97,122,170,170,181,181,183,183,186,186,192,214,216,246,248,705,710,721,736,740,748,748,750,750,768,884,886,887,890,893,895,895,902,906,908,908,910,929,931,1013,1015,1153,1155,1159,1162,1327,1329,1366,1369,1369,1376,1416,1425,1469,1471,1471,1473,1474,1476,1477,1479,1479,1488,1514,1519,1522,1552,1562,1568,1641,1646,1747,1749,1756,1759,1768,1770,1788,1791,1791,1808,1866,1869,1969,1984,2037,2042,2042,2045,2045,2048,2093,2112,2139,2144,2154,2208,2228,2230,2237,2259,2273,2275,2403,2406,2415,2417,2435,2437,2444,2447,2448,2451,2472,2474,2480,2482,2482,2486,2489,2492,2500,2503,2504,2507,2510,2519,2519,2524,2525,2527,2531,2534,2545,2556,2556,2558,2558,2561,2563,2565,2570,2575,2576,2579,2600,2602,2608,2610,2611,2613,2614,2616,2617,2620,2620,2622,2626,2631,2632,2635,2637,2641,2641,2649,2652,2654,2654,2662,2677,2689,2691,2693,2701,2703,2705,2707,2728,2730,2736,2738,2739,2741,2745,2748,2757,2759,2761,2763,2765,2768,2768,2784,2787,2790,2799,2809,2815,2817,2819,2821,2828,2831,2832,2835,2856,2858,2864,2866,2867,2869,2873,2876,2884,2887,2888,2891,2893,2902,2903,2908,2909,2911,2915,2918,2927,2929,2929,2946,2947,2949,2954,2958,2960,2962,2965,2969,2970,2972,2972,2974,2975,2979,2980,2984,2986,2990,3001,3006,3010,3014,3016,3018,3021,3024,3024,3031,3031,3046,3055,3072,3084,3086,3088,3090,3112,3114,3129,3133,3140,3142,3144,3146,3149,3157,3158,3160,3162,3168,3171,3174,3183,3200,3203,3205,3212,3214,3216,3218,3240,3242,3251,3253,3257,3260,3268,3270,3272,3274,3277,3285,3286,3294,3294,3296,3299,3302,3311,3313,3314,3328,3331,3333,3340,3342,3344,3346,3396,3398,3400,3402,3406,3412,3415,3423,3427,3430,3439,3450,3455,3458,3459,3461,3478,3482,3505,3507,3515,3517,3517,3520,3526,3530,3530,3535,3540,3542,3542,3544,3551,3558,3567,3570,3571,3585,3642,3648,3662,3664,3673,3713,3714,3716,3716,3718,3722,3724,3747,3749,3749,3751,3773,3776,3780,3782,3782,3784,3789,3792,3801,3804,3807,3840,3840,3864,3865,3872,3881,3893,3893,3895,3895,3897,3897,3902,3911,3913,3948,3953,3972,3974,3991,3993,4028,4038,4038,4096,4169,4176,4253,4256,4293,4295,4295,4301,4301,4304,4346,4348,4680,4682,4685,4688,4694,4696,4696,4698,4701,4704,4744,4746,4749,4752,4784,4786,4789,4792,4798,4800,4800,4802,4805,4808,4822,4824,4880,4882,4885,4888,4954,4957,4959,4969,4977,4992,5007,5024,5109,5112,5117,5121,5740,5743,5759,5761,5786,5792,5866,5870,5880,5888,5900,5902,5908,5920,5940,5952,5971,5984,5996,5998,6e3,6002,6003,6016,6099,6103,6103,6108,6109,6112,6121,6155,6157,6160,6169,6176,6264,6272,6314,6320,6389,6400,6430,6432,6443,6448,6459,6470,6509,6512,6516,6528,6571,6576,6601,6608,6618,6656,6683,6688,6750,6752,6780,6783,6793,6800,6809,6823,6823,6832,6845,6912,6987,6992,7001,7019,7027,7040,7155,7168,7223,7232,7241,7245,7293,7296,7304,7312,7354,7357,7359,7376,7378,7380,7418,7424,7673,7675,7957,7960,7965,7968,8005,8008,8013,8016,8023,8025,8025,8027,8027,8029,8029,8031,8061,8064,8116,8118,8124,8126,8126,8130,8132,8134,8140,8144,8147,8150,8155,8160,8172,8178,8180,8182,8188,8255,8256,8276,8276,8305,8305,8319,8319,8336,8348,8400,8412,8417,8417,8421,8432,8450,8450,8455,8455,8458,8467,8469,8469,8472,8477,8484,8484,8486,8486,8488,8488,8490,8505,8508,8511,8517,8521,8526,8526,8544,8584,11264,11310,11312,11358,11360,11492,11499,11507,11520,11557,11559,11559,11565,11565,11568,11623,11631,11631,11647,11670,11680,11686,11688,11694,11696,11702,11704,11710,11712,11718,11720,11726,11728,11734,11736,11742,11744,11775,12293,12295,12321,12335,12337,12341,12344,12348,12353,12438,12441,12447,12449,12538,12540,12543,12549,12591,12593,12686,12704,12730,12784,12799,13312,19893,19968,40943,40960,42124,42192,42237,42240,42508,42512,42539,42560,42607,42612,42621,42623,42737,42775,42783,42786,42888,42891,42943,42946,42950,42999,43047,43072,43123,43136,43205,43216,43225,43232,43255,43259,43259,43261,43309,43312,43347,43360,43388,43392,43456,43471,43481,43488,43518,43520,43574,43584,43597,43600,43609,43616,43638,43642,43714,43739,43741,43744,43759,43762,43766,43777,43782,43785,43790,43793,43798,43808,43814,43816,43822,43824,43866,43868,43879,43888,44010,44012,44013,44016,44025,44032,55203,55216,55238,55243,55291,63744,64109,64112,64217,64256,64262,64275,64279,64285,64296,64298,64310,64312,64316,64318,64318,64320,64321,64323,64324,64326,64433,64467,64829,64848,64911,64914,64967,65008,65019,65024,65039,65056,65071,65075,65076,65101,65103,65136,65140,65142,65276,65296,65305,65313,65338,65343,65343,65345,65370,65382,65470,65474,65479,65482,65487,65490,65495,65498,65500,65536,65547,65549,65574,65576,65594,65596,65597,65599,65613,65616,65629,65664,65786,65856,65908,66045,66045,66176,66204,66208,66256,66272,66272,66304,66335,66349,66378,66384,66426,66432,66461,66464,66499,66504,66511,66513,66517,66560,66717,66720,66729,66736,66771,66776,66811,66816,66855,66864,66915,67072,67382,67392,67413,67424,67431,67584,67589,67592,67592,67594,67637,67639,67640,67644,67644,67647,67669,67680,67702,67712,67742,67808,67826,67828,67829,67840,67861,67872,67897,67968,68023,68030,68031,68096,68099,68101,68102,68108,68115,68117,68119,68121,68149,68152,68154,68159,68159,68192,68220,68224,68252,68288,68295,68297,68326,68352,68405,68416,68437,68448,68466,68480,68497,68608,68680,68736,68786,68800,68850,68864,68903,68912,68921,69376,69404,69415,69415,69424,69456,69600,69622,69632,69702,69734,69743,69759,69818,69840,69864,69872,69881,69888,69940,69942,69951,69956,69958,69968,70003,70006,70006,70016,70084,70089,70092,70096,70106,70108,70108,70144,70161,70163,70199,70206,70206,70272,70278,70280,70280,70282,70285,70287,70301,70303,70312,70320,70378,70384,70393,70400,70403,70405,70412,70415,70416,70419,70440,70442,70448,70450,70451,70453,70457,70459,70468,70471,70472,70475,70477,70480,70480,70487,70487,70493,70499,70502,70508,70512,70516,70656,70730,70736,70745,70750,70751,70784,70853,70855,70855,70864,70873,71040,71093,71096,71104,71128,71133,71168,71232,71236,71236,71248,71257,71296,71352,71360,71369,71424,71450,71453,71467,71472,71481,71680,71738,71840,71913,71935,71935,72096,72103,72106,72151,72154,72161,72163,72164,72192,72254,72263,72263,72272,72345,72349,72349,72384,72440,72704,72712,72714,72758,72760,72768,72784,72793,72818,72847,72850,72871,72873,72886,72960,72966,72968,72969,72971,73014,73018,73018,73020,73021,73023,73031,73040,73049,73056,73061,73063,73064,73066,73102,73104,73105,73107,73112,73120,73129,73440,73462,73728,74649,74752,74862,74880,75075,77824,78894,82944,83526,92160,92728,92736,92766,92768,92777,92880,92909,92912,92916,92928,92982,92992,92995,93008,93017,93027,93047,93053,93071,93760,93823,93952,94026,94031,94087,94095,94111,94176,94177,94179,94179,94208,100343,100352,101106,110592,110878,110928,110930,110948,110951,110960,111355,113664,113770,113776,113788,113792,113800,113808,113817,113821,113822,119141,119145,119149,119154,119163,119170,119173,119179,119210,119213,119362,119364,119808,119892,119894,119964,119966,119967,119970,119970,119973,119974,119977,119980,119982,119993,119995,119995,119997,120003,120005,120069,120071,120074,120077,120084,120086,120092,120094,120121,120123,120126,120128,120132,120134,120134,120138,120144,120146,120485,120488,120512,120514,120538,120540,120570,120572,120596,120598,120628,120630,120654,120656,120686,120688,120712,120714,120744,120746,120770,120772,120779,120782,120831,121344,121398,121403,121452,121461,121461,121476,121476,121499,121503,121505,121519,122880,122886,122888,122904,122907,122913,122915,122916,122918,122922,123136,123180,123184,123197,123200,123209,123214,123214,123584,123641,124928,125124,125136,125142,125184,125259,125264,125273,126464,126467,126469,126495,126497,126498,126500,126500,126503,126503,126505,126514,126516,126519,126521,126521,126523,126523,126530,126530,126535,126535,126537,126537,126539,126539,126541,126543,126545,126546,126548,126548,126551,126551,126553,126553,126555,126555,126557,126557,126559,126559,126561,126562,126564,126564,126567,126570,126572,126578,126580,126583,126585,126588,126590,126590,126592,126601,126603,126619,126625,126627,126629,126633,126635,126651,131072,173782,173824,177972,177984,178205,178208,183969,183984,191456,194560,195101,917760,917999],d=/^\/\/\/?\s*@(ts-expect-error|ts-ignore)/,p=/^(?:\/|\*)*\s*@(ts-expect-error|ts-ignore)/;function f(e,t){if(e<t[0])return !1;for(var r,n=0,i=t.length;n+1<i;){if(r=n+(i-n)/2,t[r-=r%2]<=e&&e<=t[r+1])return !0;e<t[r]?i=r:n=r+2;}return !1}function g(e,t){return f(e,t>=2?u:1===t?c:o)}e.isUnicodeIdentifierStart=g;var m,y=(m=[],a.forEach((function(e,t){m[e]=t;})),m);function v(e){for(var t=new Array,r=0,n=0;r<e.length;){var i=e.charCodeAt(r);switch(r++,i){case 13:10===e.charCodeAt(r)&&r++;case 10:t.push(n),n=r;break;default:i>127&&C(i)&&(t.push(n),n=r);}}return t.push(n),t}function h(t,r,n,i,a){(r<0||r>=t.length)&&(a?r=r<0?0:r>=t.length?t.length-1:r:e.Debug.fail("Bad line number. Line: ".concat(r,", lineStarts.length: ").concat(t.length," , line map is correct? ").concat(void 0!==i?e.arraysEqual(t,v(i)):"unknown")));var o=t[r]+n;return a?o>t[r+1]?t[r+1]:"string"==typeof i&&o>i.length?i.length:o:(r<t.length-1?e.Debug.assert(o<t[r+1]):void 0!==i&&e.Debug.assert(o<=i.length),o)}function b(e){return e.lineMap||(e.lineMap=v(e.text))}function x(e,t){var r=D(e,t);return {line:r,character:t-e[r]}}function D(t,r,n){var i=e.binarySearch(t,r,e.identity,e.compareValues,n);return i<0&&(i=~i-1,e.Debug.assert(-1!==i,"position cannot precede the beginning of the file")),i}function S(e){return T(e)||C(e)}function T(e){return 32===e||9===e||11===e||12===e||160===e||133===e||5760===e||e>=8192&&e<=8203||8239===e||8287===e||12288===e||65279===e}function C(e){return 10===e||13===e||8232===e||8233===e}function E(e){return e>=48&&e<=57}function k(e){return E(e)||e>=65&&e<=70||e>=97&&e<=102}function N(e){return e>=48&&e<=55}e.tokenToString=function(e){return y[e]},e.stringToToken=function(e){return a.get(e)},e.computeLineStarts=v,e.getPositionOfLineAndCharacter=function(e,t,r,n){return e.getPositionOfLineAndCharacter?e.getPositionOfLineAndCharacter(t,r,n):h(b(e),t,r,e.text,n)},e.computePositionOfLineAndCharacter=h,e.getLineStarts=b,e.computeLineAndCharacterOfPosition=x,e.computeLineOfPosition=D,e.getLinesBetweenPositions=function(e,t,r){if(t===r)return 0;var n=b(e),i=Math.min(t,r),a=i===r,o=a?t:r,s=D(n,i),c=D(n,o,s);return a?s-c:c-s},e.getLineAndCharacterOfPosition=function(e,t){return x(b(e),t)},e.isWhiteSpaceLike=S,e.isWhiteSpaceSingleLine=T,e.isLineBreak=C,e.isOctalDigit=N,e.couldStartTrivia=function(e,t){var r=e.charCodeAt(t);switch(r){case 13:case 10:case 9:case 11:case 12:case 32:case 47:case 60:case 124:case 61:case 62:return !0;case 35:return 0===t;default:return r>127}},e.skipTrivia=function(t,r,n,i,a){if(e.positionIsSynthesized(r))return r;for(var o=!1;;){var s=t.charCodeAt(r);switch(s){case 13:10===t.charCodeAt(r+1)&&r++;case 10:if(r++,n)return r;o=!!a;continue;case 9:case 11:case 12:case 32:r++;continue;case 47:if(i)break;if(47===t.charCodeAt(r+1)){for(r+=2;r<t.length&&!C(t.charCodeAt(r));)r++;o=!1;continue}if(42===t.charCodeAt(r+1)){for(r+=2;r<t.length;){if(42===t.charCodeAt(r)&&47===t.charCodeAt(r+1)){r+=2;break}r++;}o=!1;continue}break;case 60:case 124:case 61:case 62:if(A(t,r)){r=P(t,r),o=!1;continue}break;case 35:if(0===r&&I(t,r)){r=O(t,r),o=!1;continue}break;case 42:if(o){r++,o=!1;continue}break;default:if(s>127&&S(s)){r++;continue}}return r}};var F="<<<<<<<".length;function A(t,r){if(e.Debug.assert(r>=0),0===r||C(t.charCodeAt(r-1))){var n=t.charCodeAt(r);if(r+F<t.length){for(var i=0;i<F;i++)if(t.charCodeAt(r+i)!==n)return !1;return 61===n||32===t.charCodeAt(r+F)}}return !1}function P(t,r,n){n&&n(e.Diagnostics.Merge_conflict_marker_encountered,r,F);var i=t.charCodeAt(r),a=t.length;if(60===i||62===i)for(;r<a&&!C(t.charCodeAt(r));)r++;else for(e.Debug.assert(124===i||61===i);r<a;){var o=t.charCodeAt(r);if((61===o||62===o)&&o!==i&&A(t,r))break;r++;}return r}var w=/^#!.*/;function I(t,r){return e.Debug.assert(0===r),w.test(t)}function O(e,t){return t+w.exec(e)[0].length}function M(e,t,r,n,i,a,o){var s,c,l,u,_=!1,d=n,p=o;if(0===r){d=!0;var f=j(t);f&&(r=f.length);}e:for(;r>=0&&r<t.length;){var g=t.charCodeAt(r);switch(g){case 13:10===t.charCodeAt(r+1)&&r++;case 10:if(r++,n)break e;d=!0,_&&(u=!0);continue;case 9:case 11:case 12:case 32:r++;continue;case 47:var m=t.charCodeAt(r+1),y=!1;if(47===m||42===m){var v=47===m?2:3,h=r;if(r+=2,47===m)for(;r<t.length;){if(C(t.charCodeAt(r))){y=!0;break}r++;}else for(;r<t.length;){if(42===t.charCodeAt(r)&&47===t.charCodeAt(r+1)){r+=2;break}r++;}if(d){if(_&&(p=i(s,c,l,u,a,p),!e&&p))return p;s=h,c=r,l=v,u=y,_=!0;}continue}break e;default:if(g>127&&S(g)){_&&C(g)&&(u=!0),r++;continue}break e}}return _&&(p=i(s,c,l,u,a,p)),p}function L(e,t,r,n,i){return M(!0,e,t,!1,r,n,i)}function R(e,t,r,n,i){return M(!0,e,t,!0,r,n,i)}function B(e,t,r,n,i,a){return a||(a=[]),a.push({kind:r,pos:e,end:t,hasTrailingNewLine:n}),a}function j(e){var t=w.exec(e);if(t)return t[0]}function J(e,t){return e>=65&&e<=90||e>=97&&e<=122||36===e||95===e||e>127&&g(e,t)}function z(e,t,r){return e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||36===e||95===e||1===r&&(45===e||58===e)||e>127&&function(e,t){return f(e,t>=2?_:1===t?l:s)}(e,t)}e.isShebangTrivia=I,e.scanShebangTrivia=O,e.forEachLeadingCommentRange=function(e,t,r,n){return M(!1,e,t,!1,r,n)},e.forEachTrailingCommentRange=function(e,t,r,n){return M(!1,e,t,!0,r,n)},e.reduceEachLeadingCommentRange=L,e.reduceEachTrailingCommentRange=R,e.getLeadingCommentRanges=function(e,t){return L(e,t,B,void 0,void 0)},e.getTrailingCommentRanges=function(e,t){return R(e,t,B,void 0,void 0)},e.getShebang=j,e.isIdentifierStart=J,e.isIdentifierPart=z,e.isIdentifierText=function(e,t,r){var n=U(e,0);if(!J(n,t))return !1;for(var i=K(n);i<e.length;i+=K(n))if(!z(n=U(e,i),t,r))return !1;return !0},e.createScanner=function(t,i,a,o,s,c,l){void 0===a&&(a=0);var u,_,f,g,m,y,v,h,b=o,x=0;le(b,c,l);var D={getStartPos:function(){return f},getTextPos:function(){return u},getToken:function(){return m},getTokenPos:function(){return g},getTokenText:function(){return b.substring(g,u)},getTokenValue:function(){return y},hasUnicodeEscape:function(){return 0!=(1024&v)},hasExtendedUnicodeEscape:function(){return 0!=(8&v)},hasPrecedingLineBreak:function(){return 0!=(1&v)},hasPrecedingJSDocComment:function(){return 0!=(2&v)},isIdentifier:function(){return 79===m||m>116},isReservedWord:function(){return m>=81&&m<=116},isUnterminated:function(){return 0!=(4&v)},getCommentDirectives:function(){return h},getNumericLiteralFlags:function(){return 1008&v},getTokenFlags:function(){return v},reScanGreaterToken:function(){if(31===m){if(62===b.charCodeAt(u))return 62===b.charCodeAt(u+1)?61===b.charCodeAt(u+2)?(u+=3,m=72):(u+=2,m=49):61===b.charCodeAt(u+1)?(u+=2,m=71):(u++,m=48);if(61===b.charCodeAt(u))return u++,m=33}return m},reScanAsteriskEqualsToken:function(){return e.Debug.assert(66===m,"'reScanAsteriskEqualsToken' should only be called on a '*='"),u=g+1,m=63},reScanSlashToken:function(){if(43===m||68===m){for(var r=g+1,n=!1,i=!1;;){if(r>=_){v|=4,F(e.Diagnostics.Unterminated_regular_expression_literal);break}var a=b.charCodeAt(r);if(C(a)){v|=4,F(e.Diagnostics.Unterminated_regular_expression_literal);break}if(n)n=!1;else {if(47===a&&!i){r++;break}91===a?i=!0:92===a?n=!0:93===a&&(i=!1);}r++;}for(;r<_&&z(b.charCodeAt(r),t);)r++;u=r,y=b.substring(g,u),m=13;}return m},reScanTemplateToken:function(t){return e.Debug.assert(19===m,"'reScanTemplateToken' should only be called on a '}'"),u=g,m=H(t)},reScanTemplateHeadOrNoSubstitutionTemplate:function(){return u=g,m=H(!0)},scanJsxIdentifier:function(){if(r(m)){for(var e=!1;u<_;){var t=b.charCodeAt(u);if(45!==t)if(58!==t||e){var n=u;if(y+=$(),u===n)break}else y+=":",u++,e=!0,m=79;else y+="-",u++;}":"===y.slice(-1)&&(y=y.slice(0,-1),u--);}return m},scanJsxAttributeValue:se,reScanJsxAttributeValue:function(){return u=g=f,se()},reScanJsxToken:function(e){return void 0===e&&(e=!0),u=g=f,m=oe(e)},reScanLessThanToken:function(){return 47===m?(u=g+1,m=29):m},reScanHashToken:function(){return 80===m?(u=g+1,m=62):m},reScanQuestionToken:function(){return e.Debug.assert(60===m,"'reScanQuestionToken' should only be called on a '??'"),u=g+1,m=57},reScanInvalidIdentifier:function(){e.Debug.assert(0===m,"'reScanInvalidIdentifier' should only be called when the current token is 'SyntaxKind.Unknown'."),u=g=f,v=0;var t=U(b,u),r=ie(t,99);return r?m=r:(u+=K(t),m)},scanJsxToken:oe,scanJsDocToken:function(){if(f=g=u,v=0,u>=_)return m=1;var e=U(b,u);switch(u+=K(e),e){case 9:case 11:case 12:case 32:for(;u<_&&T(b.charCodeAt(u));)u++;return m=5;case 64:return m=59;case 13:10===b.charCodeAt(u)&&u++;case 10:return v|=1,m=4;case 42:return m=41;case 123:return m=18;case 125:return m=19;case 91:return m=22;case 93:return m=23;case 60:return m=29;case 62:return m=31;case 61:return m=63;case 44:return m=27;case 46:return m=24;case 96:return m=61;case 35:return m=62;case 92:u--;var r=Z();if(r>=0&&J(r,t))return u+=3,v|=8,y=X()+$(),m=ee();var n=Y();return n>=0&&J(n,t)?(u+=6,v|=1024,y=String.fromCharCode(n)+$(),m=ee()):(u++,m=0)}if(J(e,t)){for(var i=e;u<_&&z(i=U(b,u),t)||45===b.charCodeAt(u);)u+=K(i);return y=b.substring(g,u),92===i&&(y+=$()),m=ee()}return m=0},scan:ne,getText:function(){return b},clearCommentDirectives:function(){h=void 0;},setText:le,setScriptTarget:function(e){t=e;},setLanguageVariant:function(e){a=e;},setOnError:function(e){s=e;},setTextPos:ue,setInJSDocType:function(e){x+=e?1:-1;},tryScan:function(e){return ce(e,!1)},lookAhead:function(e){return ce(e,!0)},scanRange:function(e,t,r){var n=_,i=u,a=f,o=g,s=m,c=y,l=v,d=h;le(b,e,t);var p=r();return _=n,u=i,f=a,g=o,m=s,y=c,v=l,h=d,p}};return e.Debug.isDebugging&&Object.defineProperty(D,"__debugShowCurrentPositionInText",{get:function(){var e=D.getText();return e.slice(0,D.getStartPos())+"║"+e.slice(D.getStartPos())}}),D;function F(e,t,r){if(void 0===t&&(t=u),s){var n=u;u=t,s(e,r||0),u=n;}}function w(){for(var t=u,r=!1,n=!1,i="";;){var a=b.charCodeAt(u);if(95!==a){if(!E(a))break;r=!0,n=!1,u++;}else v|=512,r?(r=!1,n=!0,i+=b.substring(t,u)):F(n?e.Diagnostics.Multiple_consecutive_numeric_separators_are_not_permitted:e.Diagnostics.Numeric_separators_are_not_allowed_here,u,1),t=++u;}return 95===b.charCodeAt(u-1)&&F(e.Diagnostics.Numeric_separators_are_not_allowed_here,u-1,1),i+b.substring(t,u)}function M(){var t,r,n=u,i=w();46===b.charCodeAt(u)&&(u++,t=w());var a,o=u;if(69===b.charCodeAt(u)||101===b.charCodeAt(u)){u++,v|=16,43!==b.charCodeAt(u)&&45!==b.charCodeAt(u)||u++;var s=u,c=w();c?(r=b.substring(o,s)+c,o=u):F(e.Diagnostics.Digit_expected);}if(512&v?(a=i,t&&(a+="."+t),r&&(a+=r)):a=b.substring(n,o),void 0!==t||16&v)return L(n,void 0===t&&!!(16&v)),{type:8,value:""+ +a};y=a;var l=re();return L(n),{type:l,value:y}}function L(r,n){if(J(U(b,u),t)){var i=u,a=$().length;1===a&&"n"===b[i]?F(n?e.Diagnostics.A_bigint_literal_cannot_use_exponential_notation:e.Diagnostics.A_bigint_literal_must_be_an_integer,r,i-r+1):(F(e.Diagnostics.An_identifier_or_keyword_cannot_immediately_follow_a_numeric_literal,i,a),u=i);}}function R(){for(var e=u;N(b.charCodeAt(u));)u++;return +b.substring(e,u)}function B(e,t){var r=V(e,!1,t);return r?parseInt(r,16):-1}function j(e,t){return V(e,!0,t)}function V(t,r,n){for(var i=[],a=!1,o=!1;i.length<t||r;){var s=b.charCodeAt(u);if(n&&95===s)v|=512,a?(a=!1,o=!0):F(o?e.Diagnostics.Multiple_consecutive_numeric_separators_are_not_permitted:e.Diagnostics.Numeric_separators_are_not_allowed_here,u,1),u++;else {if(a=n,s>=65&&s<=70)s+=32;else if(!(s>=48&&s<=57||s>=97&&s<=102))break;i.push(s),u++,o=!1;}}return i.length<t&&(i=[]),95===b.charCodeAt(u-1)&&F(e.Diagnostics.Numeric_separators_are_not_allowed_here,u-1,1),String.fromCharCode.apply(String,i)}function W(t){void 0===t&&(t=!1);for(var r=b.charCodeAt(u),n="",i=++u;;){if(u>=_){n+=b.substring(i,u),v|=4,F(e.Diagnostics.Unterminated_string_literal);break}var a=b.charCodeAt(u);if(a===r){n+=b.substring(i,u),u++;break}if(92!==a||t){if(C(a)&&!t){n+=b.substring(i,u),v|=4,F(e.Diagnostics.Unterminated_string_literal);break}u++;}else n+=b.substring(i,u),n+=G(),i=u;}return n}function H(t){for(var r,n=96===b.charCodeAt(u),i=++u,a="";;){if(u>=_){a+=b.substring(i,u),v|=4,F(e.Diagnostics.Unterminated_template_literal),r=n?14:17;break}var o=b.charCodeAt(u);if(96===o){a+=b.substring(i,u),u++,r=n?14:17;break}if(36===o&&u+1<_&&123===b.charCodeAt(u+1)){a+=b.substring(i,u),u+=2,r=n?15:16;break}92!==o?13!==o?u++:(a+=b.substring(i,u),++u<_&&10===b.charCodeAt(u)&&u++,a+="\n",i=u):(a+=b.substring(i,u),a+=G(t),i=u);}return e.Debug.assert(void 0!==r),y=a,r}function G(t){var r=u;if(++u>=_)return F(e.Diagnostics.Unexpected_end_of_text),"";var n=b.charCodeAt(u);switch(u++,n){case 48:return t&&u<_&&E(b.charCodeAt(u))?(u++,v|=2048,b.substring(r,u)):"\0";case 98:return "\b";case 116:return "\t";case 110:return "\n";case 118:return "\v";case 102:return "\f";case 114:return "\r";case 39:return "'";case 34:return '"';case 117:if(t)for(var i=u;i<u+4;i++)if(i<_&&!k(b.charCodeAt(i))&&123!==b.charCodeAt(i))return u=i,v|=2048,b.substring(r,u);if(u<_&&123===b.charCodeAt(u)){if(u++,t&&!k(b.charCodeAt(u)))return v|=2048,b.substring(r,u);if(t){var a=u,o=j(1,!1);if(!((o?parseInt(o,16):-1)<=1114111&&125===b.charCodeAt(u)))return v|=2048,b.substring(r,u);u=a;}return v|=8,X()}return v|=1024,Q(4);case 120:if(t){if(!k(b.charCodeAt(u)))return v|=2048,b.substring(r,u);if(!k(b.charCodeAt(u+1)))return u++,v|=2048,b.substring(r,u)}return Q(2);case 13:u<_&&10===b.charCodeAt(u)&&u++;case 10:case 8232:case 8233:return "";default:return String.fromCharCode(n)}}function Q(t){var r=B(t,!1);return r>=0?String.fromCharCode(r):(F(e.Diagnostics.Hexadecimal_digit_expected),"")}function X(){var t=j(1,!1),r=t?parseInt(t,16):-1,n=!1;return r<0?(F(e.Diagnostics.Hexadecimal_digit_expected),n=!0):r>1114111&&(F(e.Diagnostics.An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive),n=!0),u>=_?(F(e.Diagnostics.Unexpected_end_of_text),n=!0):125===b.charCodeAt(u)?u++:(F(e.Diagnostics.Unterminated_Unicode_escape_sequence),n=!0),n?"":q(r)}function Y(){if(u+5<_&&117===b.charCodeAt(u+1)){var e=u;u+=2;var t=B(4,!1);return u=e,t}return -1}function Z(){if(t>=2&&117===U(b,u+1)&&123===U(b,u+2)){var e=u;u+=3;var r=j(1,!1),n=r?parseInt(r,16):-1;return u=e,n}return -1}function $(){for(var e="",r=u;u<_;){var n=U(b,u);if(z(n,t))u+=K(n);else {if(92!==n)break;if((n=Z())>=0&&z(n,t)){u+=3,v|=8,e+=X(),r=u;continue}if(!((n=Y())>=0&&z(n,t)))break;v|=1024,e+=b.substring(r,u),e+=q(n),r=u+=6;}}return e+b.substring(r,u)}function ee(){var e=y.length;if(e>=2&&e<=12){var t=y.charCodeAt(0);if(t>=97&&t<=122){var r=n.get(y);if(void 0!==r)return m=r}}return m=79}function te(t){for(var r="",n=!1,i=!1;;){var a=b.charCodeAt(u);if(95!==a){if(n=!0,!E(a)||a-48>=t)break;r+=b[u],u++,i=!1;}else v|=512,n?(n=!1,i=!0):F(i?e.Diagnostics.Multiple_consecutive_numeric_separators_are_not_permitted:e.Diagnostics.Numeric_separators_are_not_allowed_here,u,1),u++;}return 95===b.charCodeAt(u-1)&&F(e.Diagnostics.Numeric_separators_are_not_allowed_here,u-1,1),r}function re(){if(110===b.charCodeAt(u))return y+="n",384&v&&(y=e.parsePseudoBigInt(y)+"n"),u++,9;var t=128&v?parseInt(y.slice(2),2):256&v?parseInt(y.slice(2),8):+y;return y=""+t,8}function ne(){var r;f=u,v=0;for(var n=!1;;){if(g=u,u>=_)return m=1;var o=U(b,u);if(35===o&&0===u&&I(b,u)){if(u=O(b,u),i)continue;return m=6}switch(o){case 10:case 13:if(v|=1,i){u++;continue}return 13===o&&u+1<_&&10===b.charCodeAt(u+1)?u+=2:u++,m=4;case 9:case 11:case 12:case 32:case 160:case 5760:case 8192:case 8193:case 8194:case 8195:case 8196:case 8197:case 8198:case 8199:case 8200:case 8201:case 8202:case 8203:case 8239:case 8287:case 12288:case 65279:if(i){u++;continue}for(;u<_&&T(b.charCodeAt(u));)u++;return m=5;case 33:return 61===b.charCodeAt(u+1)?61===b.charCodeAt(u+2)?(u+=3,m=37):(u+=2,m=35):(u++,m=53);case 34:case 39:return y=W(),m=10;case 96:return m=H(!1);case 37:return 61===b.charCodeAt(u+1)?(u+=2,m=69):(u++,m=44);case 38:return 38===b.charCodeAt(u+1)?61===b.charCodeAt(u+2)?(u+=3,m=76):(u+=2,m=55):61===b.charCodeAt(u+1)?(u+=2,m=73):(u++,m=50);case 40:return u++,m=20;case 41:return u++,m=21;case 42:if(61===b.charCodeAt(u+1))return u+=2,m=66;if(42===b.charCodeAt(u+1))return 61===b.charCodeAt(u+2)?(u+=3,m=67):(u+=2,m=42);if(u++,x&&!n&&1&v){n=!0;continue}return m=41;case 43:return 43===b.charCodeAt(u+1)?(u+=2,m=45):61===b.charCodeAt(u+1)?(u+=2,m=64):(u++,m=39);case 44:return u++,m=27;case 45:return 45===b.charCodeAt(u+1)?(u+=2,m=46):61===b.charCodeAt(u+1)?(u+=2,m=65):(u++,m=40);case 46:return E(b.charCodeAt(u+1))?(y=M().value,m=8):46===b.charCodeAt(u+1)&&46===b.charCodeAt(u+2)?(u+=3,m=25):(u++,m=24);case 47:if(47===b.charCodeAt(u+1)){for(u+=2;u<_&&!C(b.charCodeAt(u));)u++;if(h=ae(h,b.slice(g,u),d,g),i)continue;return m=2}if(42===b.charCodeAt(u+1)){u+=2,42===b.charCodeAt(u)&&47!==b.charCodeAt(u+1)&&(v|=2);for(var s=!1,c=g;u<_;){var l=b.charCodeAt(u);if(42===l&&47===b.charCodeAt(u+1)){u+=2,s=!0;break}u++,C(l)&&(c=u,v|=1);}if(h=ae(h,b.slice(c,u),p,c),s||F(e.Diagnostics.Asterisk_Slash_expected),i)continue;return s||(v|=4),m=3}return 61===b.charCodeAt(u+1)?(u+=2,m=68):(u++,m=43);case 48:if(u+2<_&&(88===b.charCodeAt(u+1)||120===b.charCodeAt(u+1)))return u+=2,(y=j(1,!0))||(F(e.Diagnostics.Hexadecimal_digit_expected),y="0"),y="0x"+y,v|=64,m=re();if(u+2<_&&(66===b.charCodeAt(u+1)||98===b.charCodeAt(u+1)))return u+=2,(y=te(2))||(F(e.Diagnostics.Binary_digit_expected),y="0"),y="0b"+y,v|=128,m=re();if(u+2<_&&(79===b.charCodeAt(u+1)||111===b.charCodeAt(u+1)))return u+=2,(y=te(8))||(F(e.Diagnostics.Octal_digit_expected),y="0"),y="0o"+y,v|=256,m=re();if(u+1<_&&N(b.charCodeAt(u+1)))return y=""+R(),v|=32,m=8;case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return r=M(),m=r.type,y=r.value,m;case 58:return u++,m=58;case 59:return u++,m=26;case 60:if(A(b,u)){if(u=P(b,u,F),i)continue;return m=7}return 60===b.charCodeAt(u+1)?61===b.charCodeAt(u+2)?(u+=3,m=70):(u+=2,m=47):61===b.charCodeAt(u+1)?(u+=2,m=32):1===a&&47===b.charCodeAt(u+1)&&42!==b.charCodeAt(u+2)?(u+=2,m=30):(u++,m=29);case 61:if(A(b,u)){if(u=P(b,u,F),i)continue;return m=7}return 61===b.charCodeAt(u+1)?61===b.charCodeAt(u+2)?(u+=3,m=36):(u+=2,m=34):62===b.charCodeAt(u+1)?(u+=2,m=38):(u++,m=63);case 62:if(A(b,u)){if(u=P(b,u,F),i)continue;return m=7}return u++,m=31;case 63:return 46!==b.charCodeAt(u+1)||E(b.charCodeAt(u+2))?63===b.charCodeAt(u+1)?61===b.charCodeAt(u+2)?(u+=3,m=77):(u+=2,m=60):(u++,m=57):(u+=2,m=28);case 91:return u++,m=22;case 93:return u++,m=23;case 94:return 61===b.charCodeAt(u+1)?(u+=2,m=78):(u++,m=52);case 123:return u++,m=18;case 124:if(A(b,u)){if(u=P(b,u,F),i)continue;return m=7}return 124===b.charCodeAt(u+1)?61===b.charCodeAt(u+2)?(u+=3,m=75):(u+=2,m=56):61===b.charCodeAt(u+1)?(u+=2,m=74):(u++,m=51);case 125:return u++,m=19;case 126:return u++,m=54;case 64:return u++,m=59;case 92:var D=Z();if(D>=0&&J(D,t))return u+=3,v|=8,y=X()+$(),m=ee();var S=Y();return S>=0&&J(S,t)?(u+=6,v|=1024,y=String.fromCharCode(S)+$(),m=ee()):(F(e.Diagnostics.Invalid_character),u++,m=0);case 35:return 0!==u&&"!"===b[u+1]?(F(e.Diagnostics.can_only_be_used_at_the_start_of_a_file),u++,m=0):(J(U(b,u+1),t)?(u++,ie(U(b,u),t)):(y=String.fromCharCode(U(b,u)),F(e.Diagnostics.Invalid_character,u++,K(o))),m=80);default:var k=ie(o,t);if(k)return m=k;if(T(o)){u+=K(o);continue}if(C(o)){v|=1,u+=K(o);continue}var w=K(o);return F(e.Diagnostics.Invalid_character,u,w),u+=w,m=0}}}function ie(e,t){var r=e;if(J(r,t)){for(u+=K(r);u<_&&z(r=U(b,u),t);)u+=K(r);return y=b.substring(g,u),92===r&&(y+=$()),ee()}}function ae(t,r,n,i){var a=function(e,t){var r=t.exec(e);if(r)switch(r[1]){case"ts-expect-error":return 0;case"ts-ignore":return 1}}(e.trimStringStart(r),n);return void 0===a?t:e.append(t,{range:{pos:i,end:u},type:a})}function oe(t){if(void 0===t&&(t=!0),f=g=u,u>=_)return m=1;var r=b.charCodeAt(u);if(60===r)return 47===b.charCodeAt(u+1)?(u+=2,m=30):(u++,m=29);if(123===r)return u++,m=18;for(var n=0;u<_&&123!==(r=b.charCodeAt(u));){if(60===r){if(A(b,u))return u=P(b,u,F),m=7;break}if(62===r&&F(e.Diagnostics.Unexpected_token_Did_you_mean_or_gt,u,1),125===r&&F(e.Diagnostics.Unexpected_token_Did_you_mean_or_rbrace,u,1),C(r)&&0===n)n=-1;else {if(!t&&C(r)&&n>0)break;S(r)||(n=u);}u++;}return y=b.substring(f,u),-1===n?12:11}function se(){switch(f=u,b.charCodeAt(u)){case 34:case 39:return y=W(!0),m=10;default:return ne()}}function ce(e,t){var r=u,n=f,i=g,a=m,o=y,s=v,c=e();return c&&!t||(u=r,f=n,g=i,m=a,y=o,v=s),c}function le(e,t,r){b=e||"",_=void 0===r?b.length:t+r,ue(t||0);}function ue(t){e.Debug.assert(t>=0),u=t,f=t,g=t,m=0,y=void 0,v=0;}};var U=String.prototype.codePointAt?function(e,t){return e.codePointAt(t)}:function(e,t){var r=e.length;if(!(t<0||t>=r)){var n=e.charCodeAt(t);if(n>=55296&&n<=56319&&r>t+1){var i=e.charCodeAt(t+1);if(i>=56320&&i<=57343)return 1024*(n-55296)+i-56320+65536}return n}};function K(e){return e>=65536?2:1}var V=String.fromCodePoint?function(e){return String.fromCodePoint(e)}:function(t){if(e.Debug.assert(0<=t&&t<=1114111),t<=65535)return String.fromCharCode(t);var r=Math.floor((t-65536)/1024)+55296,n=(t-65536)%1024+56320;return String.fromCharCode(r,n)};function q(e){return V(e)}e.utf16EncodeAsString=q;}(t),function(e){function t(e){return e.start+e.length}function r(e){return 0===e.length}function n(e,t){var r=a(e,t);return r&&0===r.length?void 0:r}function i(e,t,r,n){return r<=e+t&&r+n>=e}function a(e,r){var n=Math.max(e.start,r.start),i=Math.min(t(e),t(r));return n<=i?s(n,i):void 0}function o(e,t){if(e<0)throw new Error("start < 0");if(t<0)throw new Error("length < 0");return {start:e,length:t}}function s(e,t){return o(e,t-e)}function c(e,t){if(t<0)throw new Error("newLength < 0");return {span:e,newLength:t}}function l(t){return !!Z(t)&&e.every(t.elements,u)}function u(t){return !!e.isOmittedExpression(t)||l(t.name)}function _(t){for(var r=t.parent;e.isBindingElement(r.parent);)r=r.parent.parent;return r.parent}function d(t,r){e.isBindingElement(t)&&(t=_(t));var n=r(t);return 253===t.kind&&(t=t.parent),t&&254===t.kind&&(n|=r(t),t=t.parent),t&&236===t.kind&&(n|=r(t)),n}function p(e){return 0==(8&e.flags)}function f(e){var t=e;return t.length>=3&&95===t.charCodeAt(0)&&95===t.charCodeAt(1)&&95===t.charCodeAt(2)?t.substr(1):t}function g(e){return f(e.escapedText)}function m(t){var r=t.parent.parent;if(r){if(se(r))return y(r);switch(r.kind){case 236:if(r.declarationList&&r.declarationList.declarations[0])return y(r.declarationList.declarations[0]);break;case 237:var n=r.expression;switch(220===n.kind&&63===n.operatorToken.kind&&(n=n.left),n.kind){case 205:return n.name;case 206:var i=n.argumentExpression;if(e.isIdentifier(i))return i}break;case 211:return y(r.expression);case 249:if(se(r.statement)||ne(r.statement))return y(r.statement)}}}function y(t){var r=x(t);return r&&e.isIdentifier(r)?r:void 0}function v(e){return e.name||m(e)}function h(e){return !!e.name}function b(t){switch(t.kind){case 79:return t;case 345:case 338:var r=t.name;if(160===r.kind)return r.right;break;case 207:case 220:var n=t;switch(e.getAssignmentDeclarationKind(n)){case 1:case 4:case 5:case 3:return e.getElementOrPropertyAccessArgumentExpressionOrName(n.left);case 7:case 8:case 9:return n.arguments[1];default:return}case 343:return v(t);case 337:return m(t);case 270:var i=t.expression;return e.isIdentifier(i)?i:void 0;case 206:var a=t;if(e.isBindableStaticElementAccessExpression(a))return a.argumentExpression}return t.name}function x(t){if(void 0!==t)return b(t)||(e.isFunctionExpression(t)||e.isArrowFunction(t)||e.isClassExpression(t)?D(t):void 0)}function D(t){if(t.parent){if(e.isPropertyAssignment(t.parent)||e.isBindingElement(t.parent))return t.parent.name;if(e.isBinaryExpression(t.parent)&&t===t.parent.right){if(e.isIdentifier(t.parent.left))return t.parent.left;if(e.isAccessExpression(t.parent.left))return e.getElementOrPropertyAccessArgumentExpressionOrName(t.parent.left)}else if(e.isVariableDeclaration(t.parent)&&e.isIdentifier(t.parent.name))return t.parent.name}}function S(t,r){if(t.name){if(e.isIdentifier(t.name)){var n=t.name.escapedText;return F(t.parent,r).filter((function(t){return e.isJSDocParameterTag(t)&&e.isIdentifier(t.name)&&t.name.escapedText===n}))}var i=t.parent.parameters.indexOf(t);e.Debug.assert(i>-1,"Parameters should always be in their parents' parameter list");var a=F(t.parent,r).filter(e.isJSDocParameterTag);if(i<a.length)return [a[i]]}return e.emptyArray}function T(e){return S(e,!1)}function C(t,r){var n=t.name.escapedText;return F(t.parent,r).filter((function(t){return e.isJSDocTemplateTag(t)&&t.typeParameters.some((function(e){return e.name.escapedText===n}))}))}function E(t){return P(t,e.isJSDocReturnTag)}function k(t){var r=P(t,e.isJSDocTypeTag);if(r&&r.typeExpression&&r.typeExpression.type)return r}function N(t){var r=P(t,e.isJSDocTypeTag);return !r&&e.isParameter(t)&&(r=e.find(T(t),(function(e){return !!e.typeExpression}))),r&&r.typeExpression&&r.typeExpression.type}function F(t,r){var n=t.jsDocCache;if(void 0===n||r){var i=e.getJSDocCommentsAndTags(t,r);e.Debug.assert(i.length<2||i[0]!==i[1]),n=e.flatMap(i,(function(t){return e.isJSDoc(t)?t.tags:t})),r||(t.jsDocCache=n);}return n}function A(e){return F(e,!1)}function P(t,r,n){return e.find(F(t,n),r)}function w(e,t){return A(e).filter(t)}function I(e){var t=e.kind;return !!(32&e.flags)&&(205===t||206===t||207===t||229===t)}function O(t){return I(t)&&!e.isNonNullExpression(t)&&!!t.questionDotToken}function M(t){return e.skipOuterExpressions(t,8)}function L(e){switch(e.kind){case 300:case 301:return !0;default:return !1}}function R(e){return e>=160}function B(e){return e>=0&&e<=159}function j(e){return 8<=e&&e<=14}function J(e){return 14<=e&&e<=17}function z(t){return (e.isPropertyDeclaration(t)||Q(t))&&e.isPrivateIdentifier(t.name)}function U(e){switch(e){case 126:case 131:case 85:case 135:case 88:case 93:case 123:case 121:case 122:case 144:case 124:case 158:return !0}return !1}function K(t){return !!(16476&e.modifierToFlag(t))}function V(e){return !!e&&W(e.kind)}function q(e){switch(e){case 255:case 168:case 170:case 171:case 172:case 212:case 213:return !0;default:return !1}}function W(e){switch(e){case 167:case 173:case 321:case 174:case 175:case 178:case 315:case 179:return !0;default:return q(e)}}function H(e){var t=e.kind;return 170===t||166===t||168===t||171===t||172===t||175===t||169===t||233===t}function G(e){return e&&(256===e.kind||225===e.kind)}function Q(e){switch(e.kind){case 168:case 171:case 172:return !0;default:return !1}}function X(e){var t=e.kind;return 174===t||173===t||165===t||167===t||175===t}function Y(e){var t=e.kind;return 294===t||295===t||296===t||168===t||171===t||172===t}function Z(e){if(e){var t=e.kind;return 201===t||200===t}return !1}function $(e){switch(e.kind){case 200:case 204:return !0}return !1}function ee(e){switch(e.kind){case 201:case 203:return !0}return !1}function te(e){switch(e){case 205:case 206:case 208:case 207:case 277:case 278:case 281:case 209:case 203:case 211:case 204:case 225:case 212:case 79:case 80:case 13:case 8:case 9:case 10:case 14:case 222:case 95:case 104:case 108:case 110:case 106:case 229:case 230:case 100:return !0;default:return !1}}function re(e){switch(e){case 218:case 219:case 214:case 215:case 216:case 217:case 210:return !0;default:return te(e)}}function ne(e){return function(e){switch(e){case 221:case 223:case 213:case 220:case 224:case 228:case 226:case 349:case 348:return !0;default:return re(e)}}(M(e).kind)}function ie(t){return e.isExportAssignment(t)||e.isExportDeclaration(t)}function ae(e){return 255===e||275===e||256===e||257===e||258===e||259===e||260===e||265===e||264===e||271===e||270===e||263===e}function oe(e){return 245===e||244===e||252===e||239===e||237===e||235===e||242===e||243===e||241===e||238===e||249===e||246===e||248===e||250===e||251===e||236===e||240===e||247===e||347===e||351===e||350===e}function se(t){return 162===t.kind?t.parent&&342!==t.parent.kind||e.isInJSFile(t):213===(r=t.kind)||202===r||256===r||225===r||169===r||170===r||259===r||297===r||274===r||255===r||212===r||171===r||266===r||264===r||269===r||257===r||284===r||168===r||167===r||260===r||263===r||267===r||273===r||163===r||294===r||166===r||165===r||172===r||295===r||258===r||162===r||253===r||343===r||336===r||345===r;var r;}function ce(e){return e.kind>=325&&e.kind<=345}e.isExternalModuleNameRelative=function(t){return e.pathIsRelative(t)||e.isRootedDiskPath(t)},e.sortAndDeduplicateDiagnostics=function(t){return e.sortAndDeduplicate(t,e.compareDiagnostics)},e.getDefaultLibFileName=function(t){switch(e.getEmitScriptTarget(t)){case 99:return "lib.esnext.full.d.ts";case 8:return "lib.es2021.full.d.ts";case 7:return "lib.es2020.full.d.ts";case 6:return "lib.es2019.full.d.ts";case 5:return "lib.es2018.full.d.ts";case 4:return "lib.es2017.full.d.ts";case 3:return "lib.es2016.full.d.ts";case 2:return "lib.es6.d.ts";default:return "lib.d.ts"}},e.textSpanEnd=t,e.textSpanIsEmpty=r,e.textSpanContainsPosition=function(e,r){return r>=e.start&&r<t(e)},e.textRangeContainsPositionInclusive=function(e,t){return t>=e.pos&&t<=e.end},e.textSpanContainsTextSpan=function(e,r){return r.start>=e.start&&t(r)<=t(e)},e.textSpanOverlapsWith=function(e,t){return void 0!==n(e,t)},e.textSpanOverlap=n,e.textSpanIntersectsWithTextSpan=function(e,t){return i(e.start,e.length,t.start,t.length)},e.textSpanIntersectsWith=function(e,t,r){return i(e.start,e.length,t,r)},e.decodedTextSpanIntersectsWith=i,e.textSpanIntersectsWithPosition=function(e,r){return r<=t(e)&&r>=e.start},e.textSpanIntersection=a,e.createTextSpan=o,e.createTextSpanFromBounds=s,e.textChangeRangeNewSpan=function(e){return o(e.span.start,e.newLength)},e.textChangeRangeIsUnchanged=function(e){return r(e.span)&&0===e.newLength},e.createTextChangeRange=c,e.unchangedTextChangeRange=c(o(0,0),0),e.collapseTextChangeRangesAcrossMultipleVersions=function(r){if(0===r.length)return e.unchangedTextChangeRange;if(1===r.length)return r[0];for(var n=r[0],i=n.span.start,a=t(n.span),o=i+n.newLength,l=1;l<r.length;l++){var u=r[l],_=i,d=a,p=o,f=u.span.start,g=t(u.span),m=f+u.newLength;i=Math.min(_,f),a=Math.max(d,d+(g-p)),o=Math.max(m,m+(p-g));}return c(s(i,a),o-i)},e.getTypeParameterOwner=function(e){if(e&&162===e.kind)for(var t=e;t;t=t.parent)if(V(t)||G(t)||257===t.kind)return t},e.isParameterPropertyDeclaration=function(t,r){return e.hasSyntacticModifier(t,16476)&&170===r.kind},e.isEmptyBindingPattern=l,e.isEmptyBindingElement=u,e.walkUpBindingElementsAndPatterns=_,e.getCombinedModifierFlags=function(t){return d(t,e.getEffectiveModifierFlags)},e.getCombinedNodeFlagsAlwaysIncludeJSDoc=function(t){return d(t,e.getEffectiveModifierFlagsAlwaysIncludeJSDoc)},e.getCombinedNodeFlags=function(e){return d(e,(function(e){return e.flags}))},e.supportedLocaleDirectories=["cs","de","es","fr","it","ja","ko","pl","pt-br","ru","tr","zh-cn","zh-tw"],e.validateLocaleAndSetLanguage=function(t,r,n){var i=t.toLowerCase(),a=/^([a-z]+)([_\-]([a-z]+))?$/.exec(i);if(a){var o=a[1],s=a[3];e.contains(e.supportedLocaleDirectories,i)&&!c(o,s,n)&&c(o,void 0,n),e.setUILocale(t);}else n&&n.push(e.createCompilerDiagnostic(e.Diagnostics.Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1,"en","ja-jp"));function c(t,n,i){var a=e.normalizePath(r.getExecutingFilePath()),o=e.getDirectoryPath(a),s=e.combinePaths(o,t);if(n&&(s=s+"-"+n),s=r.resolvePath(e.combinePaths(s,"diagnosticMessages.generated.json")),!r.fileExists(s))return !1;var c="";try{c=r.readFile(s);}catch(t){return i&&i.push(e.createCompilerDiagnostic(e.Diagnostics.Unable_to_open_file_0,s)),!1}try{e.setLocalizedDiagnosticMessages(JSON.parse(c));}catch(t){return i&&i.push(e.createCompilerDiagnostic(e.Diagnostics.Corrupted_locale_file_0,s)),!1}return !0}},e.getOriginalNode=function(e,t){if(e)for(;void 0!==e.original;)e=e.original;return !t||t(e)?e:void 0},e.findAncestor=function(e,t){for(;e;){var r=t(e);if("quit"===r)return;if(r)return e;e=e.parent;}},e.isParseTreeNode=p,e.getParseTreeNode=function(e,t){if(void 0===e||p(e))return e;for(e=e.original;e;){if(p(e))return !t||t(e)?e:void 0;e=e.original;}},e.escapeLeadingUnderscores=function(e){return e.length>=2&&95===e.charCodeAt(0)&&95===e.charCodeAt(1)?"_"+e:e},e.unescapeLeadingUnderscores=f,e.idText=g,e.symbolName=function(e){return e.valueDeclaration&&z(e.valueDeclaration)?g(e.valueDeclaration.name):f(e.escapedName)},e.nodeHasName=function t(r,n){return !(!h(r)||!e.isIdentifier(r.name)||g(r.name)!==g(n))||!(!e.isVariableStatement(r)||!e.some(r.declarationList.declarations,(function(e){return t(e,n)})))},e.getNameOfJSDocTypedef=v,e.isNamedDeclaration=h,e.getNonAssignedNameOfDeclaration=b,e.getNameOfDeclaration=x,e.getAssignedName=D,e.getJSDocParameterTags=T,e.getJSDocParameterTagsNoCache=function(e){return S(e,!0)},e.getJSDocTypeParameterTags=function(e){return C(e,!1)},e.getJSDocTypeParameterTagsNoCache=function(e){return C(e,!0)},e.hasJSDocParameterTags=function(t){return !!P(t,e.isJSDocParameterTag)},e.getJSDocAugmentsTag=function(t){return P(t,e.isJSDocAugmentsTag)},e.getJSDocImplementsTags=function(t){return w(t,e.isJSDocImplementsTag)},e.getJSDocClassTag=function(t){return P(t,e.isJSDocClassTag)},e.getJSDocPublicTag=function(t){return P(t,e.isJSDocPublicTag)},e.getJSDocPublicTagNoCache=function(t){return P(t,e.isJSDocPublicTag,!0)},e.getJSDocPrivateTag=function(t){return P(t,e.isJSDocPrivateTag)},e.getJSDocPrivateTagNoCache=function(t){return P(t,e.isJSDocPrivateTag,!0)},e.getJSDocProtectedTag=function(t){return P(t,e.isJSDocProtectedTag)},e.getJSDocProtectedTagNoCache=function(t){return P(t,e.isJSDocProtectedTag,!0)},e.getJSDocReadonlyTag=function(t){return P(t,e.isJSDocReadonlyTag)},e.getJSDocReadonlyTagNoCache=function(t){return P(t,e.isJSDocReadonlyTag,!0)},e.getJSDocOverrideTagNoCache=function(t){return P(t,e.isJSDocOverrideTag,!0)},e.getJSDocDeprecatedTag=function(t){return P(t,e.isJSDocDeprecatedTag)},e.getJSDocDeprecatedTagNoCache=function(t){return P(t,e.isJSDocDeprecatedTag,!0)},e.getJSDocEnumTag=function(t){return P(t,e.isJSDocEnumTag)},e.getJSDocThisTag=function(t){return P(t,e.isJSDocThisTag)},e.getJSDocReturnTag=E,e.getJSDocTemplateTag=function(t){return P(t,e.isJSDocTemplateTag)},e.getJSDocTypeTag=k,e.getJSDocType=N,e.getJSDocReturnType=function(t){var r=E(t);if(r&&r.typeExpression)return r.typeExpression.type;var n=k(t);if(n&&n.typeExpression){var i=n.typeExpression.type;if(e.isTypeLiteralNode(i)){var a=e.find(i.members,e.isCallSignatureDeclaration);return a&&a.type}if(e.isFunctionTypeNode(i)||e.isJSDocFunctionType(i))return i.type}},e.getJSDocTags=A,e.getJSDocTagsNoCache=function(e){return F(e,!0)},e.getAllJSDocTags=w,e.getAllJSDocTagsOfKind=function(e,t){return A(e).filter((function(e){return e.kind===t}))},e.getTextOfJSDocComment=function(t){return "string"==typeof t?t:null==t?void 0:t.map((function(t){return 319===t.kind?t.text:"{@link ".concat(t.name?e.entityNameToString(t.name)+" ":"").concat(t.text,"}")})).join("")},e.getEffectiveTypeParameterDeclarations=function(t){if(e.isJSDocSignature(t))return e.emptyArray;if(e.isJSDocTypeAlias(t))return e.Debug.assert(318===t.parent.kind),e.flatMap(t.parent.tags,(function(t){return e.isJSDocTemplateTag(t)?t.typeParameters:void 0}));if(t.typeParameters)return t.typeParameters;if(e.isInJSFile(t)){var r=e.getJSDocTypeParameterDeclarations(t);if(r.length)return r;var n=N(t);if(n&&e.isFunctionTypeNode(n)&&n.typeParameters)return n.typeParameters}return e.emptyArray},e.getEffectiveConstraintOfTypeParameter=function(t){return t.constraint?t.constraint:e.isJSDocTemplateTag(t.parent)&&t===t.parent.typeParameters[0]?t.parent.constraint:void 0},e.isMemberName=function(e){return 79===e.kind||80===e.kind},e.isGetOrSetAccessorDeclaration=function(e){return 172===e.kind||171===e.kind},e.isPropertyAccessChain=function(t){return e.isPropertyAccessExpression(t)&&!!(32&t.flags)},e.isElementAccessChain=function(t){return e.isElementAccessExpression(t)&&!!(32&t.flags)},e.isCallChain=function(t){return e.isCallExpression(t)&&!!(32&t.flags)},e.isOptionalChain=I,e.isOptionalChainRoot=O,e.isExpressionOfOptionalChainRoot=function(e){return O(e.parent)&&e.parent.expression===e},e.isOutermostOptionalChain=function(e){return !I(e.parent)||O(e.parent)||e!==e.parent.expression},e.isNullishCoalesce=function(e){return 220===e.kind&&60===e.operatorToken.kind},e.isConstTypeReference=function(t){return e.isTypeReferenceNode(t)&&e.isIdentifier(t.typeName)&&"const"===t.typeName.escapedText&&!t.typeArguments},e.skipPartiallyEmittedExpressions=M,e.isNonNullChain=function(t){return e.isNonNullExpression(t)&&!!(32&t.flags)},e.isBreakOrContinueStatement=function(e){return 245===e.kind||244===e.kind},e.isNamedExportBindings=function(e){return 273===e.kind||272===e.kind},e.isUnparsedTextLike=L,e.isUnparsedNode=function(e){return L(e)||298===e.kind||302===e.kind},e.isJSDocPropertyLikeTag=function(e){return 345===e.kind||338===e.kind},e.isNode=function(e){return R(e.kind)},e.isNodeKind=R,e.isTokenKind=B,e.isToken=function(e){return B(e.kind)},e.isNodeArray=function(e){return e.hasOwnProperty("pos")&&e.hasOwnProperty("end")},e.isLiteralKind=j,e.isLiteralExpression=function(e){return j(e.kind)},e.isTemplateLiteralKind=J,e.isTemplateLiteralToken=function(e){return J(e.kind)},e.isTemplateMiddleOrTemplateTail=function(e){var t=e.kind;return 16===t||17===t},e.isImportOrExportSpecifier=function(t){return e.isImportSpecifier(t)||e.isExportSpecifier(t)},e.isTypeOnlyImportOrExportDeclaration=function(e){switch(e.kind){case 269:case 274:return e.isTypeOnly||e.parent.parent.isTypeOnly;case 267:return e.parent.isTypeOnly;case 266:case 264:return e.isTypeOnly;default:return !1}},e.isAssertionKey=function(t){return e.isStringLiteral(t)||e.isIdentifier(t)},e.isStringTextContainingNode=function(e){return 10===e.kind||J(e.kind)},e.isGeneratedIdentifier=function(t){return e.isIdentifier(t)&&(7&t.autoGenerateFlags)>0},e.isPrivateIdentifierClassElementDeclaration=z,e.isPrivateIdentifierPropertyAccessExpression=function(t){return e.isPropertyAccessExpression(t)&&e.isPrivateIdentifier(t.name)},e.isModifierKind=U,e.isParameterPropertyModifier=K,e.isClassMemberModifier=function(e){return K(e)||124===e||158===e},e.isModifier=function(e){return U(e.kind)},e.isEntityName=function(e){var t=e.kind;return 160===t||79===t},e.isPropertyName=function(e){var t=e.kind;return 79===t||80===t||10===t||8===t||161===t},e.isBindingName=function(e){var t=e.kind;return 79===t||200===t||201===t},e.isFunctionLike=V,e.isFunctionLikeOrClassStaticBlockDeclaration=function(t){return !!t&&(W(t.kind)||e.isClassStaticBlockDeclaration(t))},e.isFunctionLikeDeclaration=function(e){return e&&q(e.kind)},e.isBooleanLiteral=function(e){return 110===e.kind||95===e.kind},e.isFunctionLikeKind=W,e.isFunctionOrModuleBlock=function(t){return e.isSourceFile(t)||e.isModuleBlock(t)||e.isBlock(t)&&V(t.parent)},e.isClassElement=H,e.isClassLike=G,e.isAccessor=function(e){return e&&(171===e.kind||172===e.kind)},e.isMethodOrAccessor=Q,e.isTypeElement=X,e.isClassOrTypeElement=function(e){return X(e)||H(e)},e.isObjectLiteralElementLike=Y,e.isTypeNode=function(t){return e.isTypeNodeKind(t.kind)},e.isFunctionOrConstructorTypeNode=function(e){switch(e.kind){case 178:case 179:return !0}return !1},e.isBindingPattern=Z,e.isAssignmentPattern=function(e){var t=e.kind;return 203===t||204===t},e.isArrayBindingElement=function(e){var t=e.kind;return 202===t||226===t},e.isDeclarationBindingElement=function(e){switch(e.kind){case 253:case 163:case 202:return !0}return !1},e.isBindingOrAssignmentPattern=function(e){return $(e)||ee(e)},e.isObjectBindingOrAssignmentPattern=$,e.isObjectBindingOrAssignmentElement=function(e){switch(e.kind){case 202:case 294:case 295:case 296:return !0}return !1},e.isArrayBindingOrAssignmentPattern=ee,e.isPropertyAccessOrQualifiedNameOrImportTypeNode=function(e){var t=e.kind;return 205===t||160===t||199===t},e.isPropertyAccessOrQualifiedName=function(e){var t=e.kind;return 205===t||160===t},e.isCallLikeExpression=function(e){switch(e.kind){case 279:case 278:case 207:case 208:case 209:case 164:return !0;default:return !1}},e.isCallOrNewExpression=function(e){return 207===e.kind||208===e.kind},e.isTemplateLiteral=function(e){var t=e.kind;return 222===t||14===t},e.isLeftHandSideExpression=function(e){return te(M(e).kind)},e.isUnaryExpression=function(e){return re(M(e).kind)},e.isUnaryExpressionWithWrite=function(e){switch(e.kind){case 219:return !0;case 218:return 45===e.operator||46===e.operator;default:return !1}},e.isExpression=ne,e.isAssertionExpression=function(e){var t=e.kind;return 210===t||228===t},e.isNotEmittedOrPartiallyEmittedNode=function(t){return e.isNotEmittedStatement(t)||e.isPartiallyEmittedExpression(t)},e.isIterationStatement=function e(t,r){switch(t.kind){case 241:case 242:case 243:case 239:case 240:return !0;case 249:return r&&e(t.statement,r)}return !1},e.isScopeMarker=ie,e.hasScopeMarker=function(t){return e.some(t,ie)},e.needsScopeMarker=function(t){return !(e.isAnyImportOrReExport(t)||e.isExportAssignment(t)||e.hasSyntacticModifier(t,1)||e.isAmbientModule(t))},e.isExternalModuleIndicator=function(t){return e.isAnyImportOrReExport(t)||e.isExportAssignment(t)||e.hasSyntacticModifier(t,1)},e.isForInOrOfStatement=function(e){return 242===e.kind||243===e.kind},e.isConciseBody=function(t){return e.isBlock(t)||ne(t)},e.isFunctionBody=function(t){return e.isBlock(t)},e.isForInitializer=function(t){return e.isVariableDeclarationList(t)||ne(t)},e.isModuleBody=function(e){var t=e.kind;return 261===t||260===t||79===t},e.isNamespaceBody=function(e){var t=e.kind;return 261===t||260===t},e.isJSDocNamespaceBody=function(e){var t=e.kind;return 79===t||260===t},e.isNamedImportBindings=function(e){var t=e.kind;return 268===t||267===t},e.isModuleOrEnumDeclaration=function(e){return 260===e.kind||259===e.kind},e.isDeclaration=se,e.isDeclarationStatement=function(e){return ae(e.kind)},e.isStatementButNotDeclaration=function(e){return oe(e.kind)},e.isStatement=function(t){var r=t.kind;return oe(r)||ae(r)||function(t){return 234===t.kind&&((void 0===t.parent||251!==t.parent.kind&&291!==t.parent.kind)&&!e.isFunctionBlock(t))}(t)},e.isStatementOrBlock=function(e){var t=e.kind;return oe(t)||ae(t)||234===t},e.isModuleReference=function(e){var t=e.kind;return 276===t||160===t||79===t},e.isJsxTagNameExpression=function(e){var t=e.kind;return 108===t||79===t||205===t},e.isJsxChild=function(e){var t=e.kind;return 277===t||287===t||278===t||11===t||281===t},e.isJsxAttributeLike=function(e){var t=e.kind;return 284===t||286===t},e.isStringLiteralOrJsxExpression=function(e){var t=e.kind;return 10===t||287===t},e.isJsxOpeningLikeElement=function(e){var t=e.kind;return 279===t||278===t},e.isCaseOrDefaultClause=function(e){var t=e.kind;return 288===t||289===t},e.isJSDocNode=function(e){return e.kind>=307&&e.kind<=345},e.isJSDocCommentContainingNode=function(t){return 318===t.kind||317===t.kind||319===t.kind||ue(t)||ce(t)||e.isJSDocTypeLiteral(t)||e.isJSDocSignature(t)},e.isJSDocTag=ce,e.isSetAccessor=function(e){return 172===e.kind},e.isGetAccessor=function(e){return 171===e.kind},e.hasJSDocNodes=function(e){var t=e.jsDoc;return !!t&&t.length>0},e.hasType=function(e){return !!e.type},e.hasInitializer=function(e){return !!e.initializer},e.hasOnlyExpressionInitializer=function(e){switch(e.kind){case 253:case 163:case 202:case 165:case 166:case 294:case 297:return !0;default:return !1}},e.isObjectLiteralElement=function(e){return 284===e.kind||286===e.kind||Y(e)},e.isTypeReferenceType=function(e){return 177===e.kind||227===e.kind};var le=1073741823;function ue(e){return 322===e.kind||323===e.kind||324===e.kind}e.guessIndentation=function(t){for(var r=le,n=0,i=t;n<i.length;n++){var a=i[n];if(a.length){for(var o=0;o<a.length&&o<r&&e.isWhiteSpaceLike(a.charCodeAt(o));o++);if(o<r&&(r=o),0===r)return 0}}return r===le?void 0:r},e.isStringLiteralLike=function(e){return 10===e.kind||14===e.kind},e.isJSDocLinkLike=ue;}(t),function(e){e.resolvingEmptyArray=[],e.externalHelpersModuleNameText="tslib",e.defaultMaximumTruncationLength=160,e.noTruncationMaximumTruncationLength=1e6,e.getDeclarationOfKind=function(e,t){var r=e.declarations;if(r)for(var n=0,i=r;n<i.length;n++){var a=i[n];if(a.kind===t)return a}},e.createUnderscoreEscapedMap=function(){return new e.Map},e.hasEntries=function(e){return !!e&&!!e.size},e.createSymbolTable=function(t){var r=new e.Map;if(t)for(var n=0,i=t;n<i.length;n++){var a=i[n];r.set(a.escapedName,a);}return r},e.isTransientSymbol=function(e){return 0!=(33554432&e.flags)};var t,r,a,o=(t="",{getText:function(){return t},write:r=function(e){return t+=e},rawWrite:r,writeKeyword:r,writeOperator:r,writePunctuation:r,writeSpace:r,writeStringLiteral:r,writeLiteral:r,writeParameter:r,writeProperty:r,writeSymbol:function(e,t){return r(e)},writeTrailingSemicolon:r,writeComment:r,getTextPos:function(){return t.length},getLine:function(){return 0},getColumn:function(){return 0},getIndent:function(){return 0},isAtStartOfLine:function(){return !1},hasTrailingComment:function(){return !1},hasTrailingWhitespace:function(){return !!t.length&&e.isWhiteSpaceLike(t.charCodeAt(t.length-1))},writeLine:function(){return t+=" "},increaseIndent:e.noop,decreaseIndent:e.noop,clear:function(){return t=""},trackSymbol:function(){return !1},reportInaccessibleThisError:e.noop,reportInaccessibleUniqueSymbolError:e.noop,reportPrivateInBaseOfClassExpression:e.noop});function s(t,r){return c(t,r,e.moduleResolutionOptionDeclarations)}function c(e,t,r){return e!==t&&r.some((function(r){return !di(An(e,r),An(t,r))}))}function l(e){return e.end-e.pos}function u(e){for(;e&&303!==e.kind;)e=e.parent;return e}function _(t,r){e.Debug.assert(t>=0);var n=e.getLineStarts(r),i=t,a=r.text;if(i+1===n.length)return a.length-1;var o=n[i],s=n[i+1]-1;for(e.Debug.assert(e.isLineBreak(a.charCodeAt(s)));o<=s&&e.isLineBreak(a.charCodeAt(s));)s--;return s}function d(e){return void 0===e||e.pos===e.end&&e.pos>=0&&1!==e.kind}function p(e){return !d(e)}function f(e,t,r){if(void 0===t||0===t.length)return e;for(var i=0;i<e.length&&r(e[i]);++i);return e.splice.apply(e,n$3([i,0],t,!1)),e}function g(e,t,r){if(void 0===t)return e;for(var n=0;n<e.length&&r(e[n]);++n);return e.splice(n,0,t),e}function m(e){return G(e)||!!(1048576&S(e))}function y(e,t){return 42===e.charCodeAt(t+1)&&33===e.charCodeAt(t+2)}function v(t,r,n){return d(t)?t.pos:e.isJSDocNode(t)||11===t.kind?e.skipTrivia((r||u(t)).text,t.pos,!1,!0):n&&e.hasJSDocNodes(t)?v(t.jsDoc[0],r):346===t.kind&&t._children.length>0?v(t._children[0],r,n):e.skipTrivia((r||u(t)).text,t.pos,!1,!1,De(t))}function h(e,t,r){return void 0===r&&(r=!1),b(e.text,t,r)}function b(t,r,n){if(void 0===n&&(n=!1),d(r))return "";var i=t.substring(n?r.pos:e.skipTrivia(t,r.pos),r.end);return function(t){return !!e.findAncestor(t,e.isJSDocTypeExpression)}(r)&&(i=i.split(/\r\n|\n|\r/).map((function(t){return e.trimStringStart(t.replace(/^\s*\*/,""))})).join("\n")),i}function x(e,t){return void 0===t&&(t=!1),h(u(e),e,t)}function D(e){return e.pos}function S(e){var t=e.emitNode;return t&&t.flags||0}function T(e){var t=Nt(e);return 253===t.kind&&291===t.parent.kind}function C(t){return e.isModuleDeclaration(t)&&(10===t.name.kind||k(t))}function E(t){return e.isModuleDeclaration(t)||e.isIdentifier(t)}function k(e){return !!(1024&e.flags)}function N(e){return C(e)&&F(e)}function F(t){switch(t.parent.kind){case 303:return e.isExternalModule(t.parent);case 261:return C(t.parent.parent)&&e.isSourceFile(t.parent.parent.parent)&&!e.isExternalModule(t.parent.parent.parent)}return !1}function A(t){var r;return null===(r=t.declarations)||void 0===r?void 0:r.find((function(t){return !(N(t)||e.isModuleDeclaration(t)&&k(t))}))}function P(t,r){switch(t.kind){case 303:case 262:case 291:case 260:case 241:case 242:case 243:case 170:case 168:case 171:case 172:case 255:case 212:case 213:case 166:case 169:return !0;case 234:return !e.isFunctionLikeOrClassStaticBlockDeclaration(r)}return !1}function w(t){switch(t.kind){case 173:case 174:case 167:case 175:case 178:case 179:case 315:case 256:case 225:case 257:case 258:case 342:case 255:case 168:case 170:case 171:case 172:case 212:case 213:return !0;default:return e.assertType(t),!1}}function I(e){switch(e.kind){case 265:case 264:return !0;default:return !1}}function O(t){return I(t)||e.isExportDeclaration(t)}function M(t){return e.findAncestor(t.parent,(function(e){return P(e,e.parent)}))}function L(e){return e&&0!==l(e)?x(e):"(Missing)"}function R(t){switch(t.kind){case 79:case 80:return t.escapedText;case 10:case 8:case 14:return e.escapeLeadingUnderscores(t.text);case 161:return xt(t.expression)?e.escapeLeadingUnderscores(t.expression.text):e.Debug.fail("Text of property name cannot be read from non-literal-valued ComputedPropertyNames");default:return e.Debug.assertNever(t)}}function B(t){switch(t.kind){case 108:return "this";case 80:case 79:return 0===l(t)?e.idText(t):x(t);case 160:return B(t.left)+"."+B(t.right);case 205:return e.isIdentifier(t.name)||e.isPrivateIdentifier(t.name)?B(t.expression)+"."+B(t.name):e.Debug.assertNever(t.name);case 309:return B(t.left)+B(t.right);default:return e.Debug.assertNever(t)}}function j(e,t,r,n,i,a,o){var s=K(e,t);return vn(e,s.start,s.length,r,n,i,a,o)}function J(t,r,n){e.Debug.assertGreaterThanOrEqual(r,0),e.Debug.assertGreaterThanOrEqual(n,0),t&&(e.Debug.assertLessThanOrEqual(r,t.text.length),e.Debug.assertLessThanOrEqual(r+n,t.text.length));}function z(e,t,r,n,i){return J(e,t,r),{file:e,start:t,length:r,code:n.code,category:n.category,messageText:n.next?n:n.messageText,relatedInformation:i}}function U(t,r){var n=e.createScanner(t.languageVersion,!0,t.languageVariant,t.text,void 0,r);n.scan();var i=n.getTokenPos();return e.createTextSpanFromBounds(i,n.getTextPos())}function K(t,r){var n=r;switch(r.kind){case 303:var i=e.skipTrivia(t.text,0,!1);return i===t.text.length?e.createTextSpan(0,0):U(t,i);case 253:case 202:case 256:case 225:case 257:case 260:case 259:case 297:case 255:case 212:case 168:case 171:case 172:case 258:case 166:case 165:case 267:n=r.name;break;case 213:return function(t,r){var n=e.skipTrivia(t.text,r.pos);if(r.body&&234===r.body.kind){var i=e.getLineAndCharacterOfPosition(t,r.body.pos).line;if(i<e.getLineAndCharacterOfPosition(t,r.body.end).line)return e.createTextSpan(n,_(i,t)-n+1)}return e.createTextSpanFromBounds(n,r.end)}(t,r);case 288:case 289:var a=e.skipTrivia(t.text,r.pos),o=r.statements.length>0?r.statements[0].pos:r.end;return e.createTextSpanFromBounds(a,o)}if(void 0===n)return U(t,r.pos);e.Debug.assert(!e.isJSDoc(n));var s=d(n),c=s||e.isJsxText(r)?n.pos:e.skipTrivia(t.text,n.pos);return s?(e.Debug.assert(c===n.pos,"This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809"),e.Debug.assert(c===n.end,"This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809")):(e.Debug.assert(c>=n.pos,"This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809"),e.Debug.assert(c<=n.end,"This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809")),e.createTextSpanFromBounds(c,n.end)}function V(e){return 6===e.scriptKind}function q(t){return !!(2&e.getCombinedNodeFlags(t))}function W(e){return 207===e.kind&&100===e.expression.kind}function H(t){return e.isImportTypeNode(t)&&e.isLiteralTypeNode(t.argument)&&e.isStringLiteral(t.argument.literal)}function G(e){return 237===e.kind&&10===e.expression.kind}function Q(e){return !!(1048576&S(e))}function X(t){return e.isIdentifier(t.name)&&!t.initializer}e.changesAffectModuleResolution=function(e,t){return e.configFilePath!==t.configFilePath||s(e,t)},e.optionsHaveModuleResolutionChanges=s,e.changesAffectingProgramStructure=function(t,r){return c(t,r,e.optionsAffectingProgramStructure)},e.optionsHaveChanges=c,e.forEachAncestor=function(t,r){for(;;){var n=r(t);if("quit"===n)return;if(void 0!==n)return n;if(e.isSourceFile(t))return;t=t.parent;}},e.forEachEntry=function(e,t){for(var r=e.entries(),n=r.next();!n.done;n=r.next()){var i=n.value,a=i[0],o=t(i[1],a);if(o)return o}},e.forEachKey=function(e,t){for(var r=e.keys(),n=r.next();!n.done;n=r.next()){var i=t(n.value);if(i)return i}},e.copyEntries=function(e,t){e.forEach((function(e,r){t.set(r,e);}));},e.usingSingleLineStringWriter=function(e){var t=o.getText();try{return e(o),o.getText()}finally{o.clear(),o.writeKeyword(t);}},e.getFullWidth=l,e.getResolvedModule=function(e,t,r){return e&&e.resolvedModules&&e.resolvedModules.get(t,r)},e.setResolvedModule=function(t,r,n,i){t.resolvedModules||(t.resolvedModules=e.createModeAwareCache()),t.resolvedModules.set(r,i,n);},e.setResolvedTypeReferenceDirective=function(t,r,n){t.resolvedTypeReferenceDirectiveNames||(t.resolvedTypeReferenceDirectiveNames=e.createModeAwareCache()),t.resolvedTypeReferenceDirectiveNames.set(r,void 0,n);},e.projectReferenceIsEqualTo=function(e,t){return e.path===t.path&&!e.prepend==!t.prepend&&!e.circular==!t.circular},e.moduleResolutionIsEqualTo=function(e,t){return e.isExternalLibraryImport===t.isExternalLibraryImport&&e.extension===t.extension&&e.resolvedFileName===t.resolvedFileName&&e.originalPath===t.originalPath&&((r=e.packageId)===(n=t.packageId)||!!r&&!!n&&r.name===n.name&&r.subModuleName===n.subModuleName&&r.version===n.version);var r,n;},e.packageIdToString=function(e){var t=e.name,r=e.subModuleName,n=e.version,i=r?"".concat(t,"/").concat(r):t;return "".concat(i,"@").concat(n)},e.typeDirectiveIsEqualTo=function(e,t){return e.resolvedFileName===t.resolvedFileName&&e.primary===t.primary&&e.originalPath===t.originalPath},e.hasChangesInResolutions=function(t,r,n,i,a){e.Debug.assert(t.length===r.length);for(var o=0;o<t.length;o++){var s=r[o],c=n&&n.get(t[o],i&&e.getModeForResolutionAtIndex(i,o));if(c?!s||!a(c,s):s)return !0}return !1},e.containsParseError=function t(r){return function(r){524288&r.flags||((0!=(65536&r.flags)||e.forEachChild(r,t))&&(r.flags|=262144),r.flags|=524288);}(r),0!=(262144&r.flags)},e.getSourceFileOfNode=u,e.getSourceFileOfModule=function(e){return u(e.valueDeclaration||A(e))},e.isStatementWithLocals=function(e){switch(e.kind){case 234:case 262:case 241:case 242:case 243:return !0}return !1},e.getStartPositionOfLine=function(t,r){return e.Debug.assert(t>=0),e.getLineStarts(r)[t]},e.nodePosToString=function(t){var r=u(t),n=e.getLineAndCharacterOfPosition(r,t.pos);return "".concat(r.fileName,"(").concat(n.line+1,",").concat(n.character+1,")")},e.getEndLinePosition=_,e.isFileLevelUniqueName=function(e,t,r){return !(r&&r(t)||e.identifiers.has(t))},e.nodeIsMissing=d,e.nodeIsPresent=p,e.insertStatementsAfterStandardPrologue=function(e,t){return f(e,t,G)},e.insertStatementsAfterCustomPrologue=function(e,t){return f(e,t,m)},e.insertStatementAfterStandardPrologue=function(e,t){return g(e,t,G)},e.insertStatementAfterCustomPrologue=function(e,t){return g(e,t,m)},e.isRecognizedTripleSlashComment=function(t,r,n){if(47===t.charCodeAt(r+1)&&r+2<n&&47===t.charCodeAt(r+2)){var i=t.substring(r,n);return !!(e.fullTripleSlashReferencePathRegEx.test(i)||e.fullTripleSlashAMDReferencePathRegEx.test(i)||Y.test(i)||re.test(i))}return !1},e.isPinnedComment=y,e.createCommentDirectivesMap=function(t,r){var n=new e.Map(r.map((function(r){return ["".concat(e.getLineAndCharacterOfPosition(t,r.range.end).line),r]}))),i=new e.Map;return {getUnusedExpectations:function(){return e.arrayFrom(n.entries()).filter((function(e){var t=e[0];return 0===e[1].type&&!i.get(t)})).map((function(e){return e[1]}))},markUsed:function(e){return !!n.has("".concat(e))&&(i.set("".concat(e),!0),!0)}}},e.getTokenPosOfNode=v,e.getNonDecoratorTokenPosOfNode=function(t,r){return d(t)||!t.decorators?v(t,r):e.skipTrivia((r||u(t)).text,t.decorators.end)},e.getSourceTextOfNodeFromSourceFile=h,e.isExportNamespaceAsDefaultDeclaration=function(t){return !!(e.isExportDeclaration(t)&&t.exportClause&&e.isNamespaceExport(t.exportClause)&&"default"===t.exportClause.name.escapedText)},e.getTextOfNodeFromSourceText=b,e.getTextOfNode=x,e.indexOfNode=function(t,r){return e.binarySearch(t,r,D,e.compareValues)},e.getEmitFlags=S,e.getScriptTargetFeatures=function(){return {es2015:{Array:["find","findIndex","fill","copyWithin","entries","keys","values"],RegExp:["flags","sticky","unicode"],Reflect:["apply","construct","defineProperty","deleteProperty","get"," getOwnPropertyDescriptor","getPrototypeOf","has","isExtensible","ownKeys","preventExtensions","set","setPrototypeOf"],ArrayConstructor:["from","of"],ObjectConstructor:["assign","getOwnPropertySymbols","keys","is","setPrototypeOf"],NumberConstructor:["isFinite","isInteger","isNaN","isSafeInteger","parseFloat","parseInt"],Math:["clz32","imul","sign","log10","log2","log1p","expm1","cosh","sinh","tanh","acosh","asinh","atanh","hypot","trunc","fround","cbrt"],Map:["entries","keys","values"],Set:["entries","keys","values"],Promise:e.emptyArray,PromiseConstructor:["all","race","reject","resolve"],Symbol:["for","keyFor"],WeakMap:["entries","keys","values"],WeakSet:["entries","keys","values"],Iterator:e.emptyArray,AsyncIterator:e.emptyArray,String:["codePointAt","includes","endsWith","normalize","repeat","startsWith","anchor","big","blink","bold","fixed","fontcolor","fontsize","italics","link","small","strike","sub","sup"],StringConstructor:["fromCodePoint","raw"]},es2016:{Array:["includes"]},es2017:{Atomics:e.emptyArray,SharedArrayBuffer:e.emptyArray,String:["padStart","padEnd"],ObjectConstructor:["values","entries","getOwnPropertyDescriptors"],DateTimeFormat:["formatToParts"]},es2018:{Promise:["finally"],RegExpMatchArray:["groups"],RegExpExecArray:["groups"],RegExp:["dotAll"],Intl:["PluralRules"],AsyncIterable:e.emptyArray,AsyncIterableIterator:e.emptyArray,AsyncGenerator:e.emptyArray,AsyncGeneratorFunction:e.emptyArray},es2019:{Array:["flat","flatMap"],ObjectConstructor:["fromEntries"],String:["trimStart","trimEnd","trimLeft","trimRight"],Symbol:["description"]},es2020:{BigInt:e.emptyArray,BigInt64Array:e.emptyArray,BigUint64Array:e.emptyArray,PromiseConstructor:["allSettled"],SymbolConstructor:["matchAll"],String:["matchAll"],DataView:["setBigInt64","setBigUint64","getBigInt64","getBigUint64"],RelativeTimeFormat:["format","formatToParts","resolvedOptions"]},es2021:{PromiseConstructor:["any"],String:["replaceAll"]},esnext:{NumberFormat:["formatToParts"]}}},(a=e.GetLiteralTextFlags||(e.GetLiteralTextFlags={}))[a.None=0]="None",a[a.NeverAsciiEscape=1]="NeverAsciiEscape",a[a.JsxAttributeEscape=2]="JsxAttributeEscape",a[a.TerminateUnterminatedLiterals=4]="TerminateUnterminatedLiterals",a[a.AllowNumericSeparator=8]="AllowNumericSeparator",e.getLiteralText=function(t,r,n){var i;if(function(t,r){return !(Ft(t)||!t.parent||4&r&&t.isUnterminated)&&(e.isNumericLiteral(t)&&512&t.numericLiteralFlags?!!(8&r):!e.isBigIntLiteral(t))}(t,n))return h(r,t);switch(t.kind){case 10:var a=2&n?Gt:1&n||16777216&S(t)?zt:Kt;return t.singleQuote?"'"+a(t.text,39)+"'":'"'+a(t.text,34)+'"';case 14:case 15:case 16:case 17:a=1&n||16777216&S(t)?zt:Kt;var o=null!==(i=t.rawText)&&void 0!==i?i:function(e){return e.replace(Ot,"\\${")}(a(t.text,96));switch(t.kind){case 14:return "`"+o+"`";case 15:return "`"+o+"${";case 16:return "}"+o+"${";case 17:return "}"+o+"`"}break;case 8:case 9:return t.text;case 13:return 4&n&&t.isUnterminated?t.text+(92===t.text.charCodeAt(t.text.length-1)?" /":"/"):t.text}return e.Debug.fail("Literal kind '".concat(t.kind,"' not accounted for."))},e.getTextOfConstantValue=function(t){return e.isString(t)?'"'+Kt(t)+'"':""+t},e.makeIdentifierFromModuleName=function(t){return e.getBaseFileName(t).replace(/^(\d)/,"_$1").replace(/\W/g,"_")},e.isBlockOrCatchScoped=function(t){return 0!=(3&e.getCombinedNodeFlags(t))||T(t)},e.isCatchClauseVariableDeclarationOrBindingElement=T,e.isAmbientModule=C,e.isModuleWithStringLiteralName=function(t){return e.isModuleDeclaration(t)&&10===t.name.kind},e.isNonGlobalAmbientModule=function(t){return e.isModuleDeclaration(t)&&e.isStringLiteral(t.name)},e.isEffectiveModuleDeclaration=E,e.isShorthandAmbientModuleSymbol=function(e){return !!(t=e.valueDeclaration)&&260===t.kind&&!t.body;var t;},e.isBlockScopedContainerTopLevel=function(t){return 303===t.kind||260===t.kind||e.isFunctionLikeOrClassStaticBlockDeclaration(t)},e.isGlobalScopeAugmentation=k,e.isExternalModuleAugmentation=N,e.isModuleAugmentationExternal=F,e.getNonAugmentationDeclaration=A,e.isEffectiveExternalModule=function(t,r){return e.isExternalModule(t)||r.isolatedModules||((n=Cn(r))===e.ModuleKind.CommonJS||n===e.ModuleKind.Node12||n===e.ModuleKind.NodeNext)&&!!t.commonJsModuleIndicator;var n;},e.isEffectiveStrictModeSourceFile=function(t,r){switch(t.scriptKind){case 1:case 3:case 2:case 4:break;default:return !1}return !(t.isDeclarationFile||!Nn(r,"alwaysStrict")&&!e.startsWithUseStrict(t.statements)&&(!e.isExternalModule(t)&&!r.isolatedModules||!(Cn(r)>=e.ModuleKind.ES2015)&&r.noImplicitUseStrict))},e.isBlockScope=P,e.isDeclarationWithTypeParameters=function(t){switch(t.kind){case 336:case 343:case 321:return !0;default:return e.assertType(t),w(t)}},e.isDeclarationWithTypeParameterChildren=w,e.isAnyImportSyntax=I,e.isLateVisibilityPaintedStatement=function(e){switch(e.kind){case 265:case 264:case 236:case 256:case 255:case 260:case 258:case 257:case 259:return !0;default:return !1}},e.hasPossibleExternalModuleReference=function(t){return O(t)||e.isModuleDeclaration(t)||e.isImportTypeNode(t)||W(t)},e.isAnyImportOrReExport=O,e.getEnclosingBlockScopeContainer=M,e.forEachEnclosingBlockScopeContainer=function(e,t){for(var r=M(e);r;)t(r),r=M(r);},e.declarationNameToString=L,e.getNameFromIndexInfo=function(e){return e.declaration?L(e.declaration.parameters[0].name):void 0},e.isComputedNonLiteralName=function(e){return 161===e.kind&&!xt(e.expression)},e.getTextOfPropertyName=R,e.entityNameToString=B,e.createDiagnosticForNode=function(e,t,r,n,i,a){return j(u(e),e,t,r,n,i,a)},e.createDiagnosticForNodeArray=function(t,r,n,i,a,o,s){var c=e.skipTrivia(t.text,r.pos);return vn(t,c,r.end-c,n,i,a,o,s)},e.createDiagnosticForNodeInSourceFile=j,e.createDiagnosticForNodeFromMessageChain=function(e,t,r){var n=u(e),i=K(n,e);return z(n,i.start,i.length,t,r)},e.createFileDiagnosticFromMessageChain=z,e.createDiagnosticForFileFromMessageChain=function(e,t,r){return {file:e,start:0,length:0,code:t.code,category:t.category,messageText:t.next?t:t.messageText,relatedInformation:r}},e.createDiagnosticForRange=function(e,t,r){return {file:e,start:t.pos,length:t.end-t.pos,code:r.code,category:r.category,messageText:r.message}},e.getSpanOfTokenAtPosition=U,e.getErrorSpanForNode=K,e.isExternalOrCommonJsModule=function(e){return void 0!==(e.externalModuleIndicator||e.commonJsModuleIndicator)},e.isJsonSourceFile=V,e.isEnumConst=function(t){return !!(2048&e.getCombinedModifierFlags(t))},e.isDeclarationReadonly=function(t){return !(!(64&e.getCombinedModifierFlags(t))||e.isParameterPropertyDeclaration(t,t.parent))},e.isVarConst=q,e.isLet=function(t){return !!(1&e.getCombinedNodeFlags(t))},e.isSuperCall=function(e){return 207===e.kind&&106===e.expression.kind},e.isImportCall=W,e.isImportMeta=function(t){return e.isMetaProperty(t)&&100===t.keywordToken&&"meta"===t.name.escapedText},e.isLiteralImportTypeNode=H,e.isPrologueDirective=G,e.isCustomPrologue=Q,e.isHoistedFunction=function(t){return Q(t)&&e.isFunctionDeclaration(t)},e.isHoistedVariableStatement=function(t){return Q(t)&&e.isVariableStatement(t)&&e.every(t.declarationList.declarations,X)},e.getLeadingCommentRangesOfNode=function(t,r){return 11!==t.kind?e.getLeadingCommentRanges(r.text,t.pos):void 0},e.getJSDocCommentRanges=function(t,r){var n=163===t.kind||162===t.kind||212===t.kind||213===t.kind||211===t.kind||253===t.kind?e.concatenate(e.getTrailingCommentRanges(r,t.pos),e.getLeadingCommentRanges(r,t.pos)):e.getLeadingCommentRanges(r,t.pos);return e.filter(n,(function(e){return 42===r.charCodeAt(e.pos+1)&&42===r.charCodeAt(e.pos+2)&&47!==r.charCodeAt(e.pos+3)}))},e.fullTripleSlashReferencePathRegEx=/^(\/\/\/\s*<reference\s+path\s*=\s*)(('[^']*')|("[^"]*")).*?\/>/;var Y=/^(\/\/\/\s*<reference\s+types\s*=\s*)(('[^']*')|("[^"]*")).*?\/>/;e.fullTripleSlashAMDReferencePathRegEx=/^(\/\/\/\s*<amd-dependency\s+path\s*=\s*)(('[^']*')|("[^"]*")).*?\/>/;var Z,$,ee,te,re=/^(\/\/\/\s*<reference\s+no-default-lib\s*=\s*)(('[^']*')|("[^"]*"))\s*\/>/;function ne(t){if(176<=t.kind&&t.kind<=199)return !0;switch(t.kind){case 130:case 154:case 146:case 157:case 149:case 133:case 150:case 147:case 152:case 143:return !0;case 114:return 216!==t.parent.kind;case 227:return !Jr(t);case 162:return 194===t.parent.kind||189===t.parent.kind;case 79:(160===t.parent.kind&&t.parent.right===t||205===t.parent.kind&&t.parent.name===t)&&(t=t.parent),e.Debug.assert(79===t.kind||160===t.kind||205===t.kind,"'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'.");case 160:case 205:case 108:var r=t.parent;if(180===r.kind)return !1;if(199===r.kind)return !r.isTypeOf;if(176<=r.kind&&r.kind<=199)return !0;switch(r.kind){case 227:return !Jr(r);case 162:case 342:return t===r.constraint;case 166:case 165:case 163:case 253:return t===r.type;case 255:case 212:case 213:case 170:case 168:case 167:case 171:case 172:return t===r.type;case 173:case 174:case 175:case 210:return t===r.type;case 207:case 208:return e.contains(r.typeArguments,t);case 209:return !1}}return !1}function ie(e){if(e)switch(e.kind){case 202:case 297:case 163:case 294:case 166:case 165:case 295:case 253:return !0}return !1}function ae(e){return 254===e.parent.kind&&236===e.parent.parent.kind}function oe(e,t,r){return e.properties.filter((function(e){if(294===e.kind){var n=R(e.name);return t===n||!!r&&r===n}return !1}))}function se(t){if(t&&t.statements.length){var r=t.statements[0].expression;return e.tryCast(r,e.isObjectLiteralExpression)}}function ce(t,r){var n=se(t);return n?oe(n,r):e.emptyArray}function le(t,r){for(e.Debug.assert(303!==t.kind);;){if(!(t=t.parent))return e.Debug.fail();switch(t.kind){case 161:if(e.isClassLike(t.parent.parent))return t;t=t.parent;break;case 164:163===t.parent.kind&&e.isClassElement(t.parent.parent)?t=t.parent.parent:e.isClassElement(t.parent)&&(t=t.parent);break;case 213:if(!r)continue;case 255:case 212:case 260:case 169:case 166:case 165:case 168:case 167:case 170:case 171:case 172:case 173:case 174:case 175:case 259:case 303:return t}}}function ue(e){var t=e.kind;return (205===t||206===t)&&106===e.expression.kind}function _e(t,r,n){if(e.isNamedDeclaration(t)&&e.isPrivateIdentifier(t.name))return !1;switch(t.kind){case 256:return !0;case 166:return 256===r.kind;case 171:case 172:case 168:return void 0!==t.body&&256===r.kind;case 163:return void 0!==r.body&&(170===r.kind||168===r.kind||172===r.kind)&&256===n.kind}return !1}function de(e,t,r){return void 0!==e.decorators&&_e(e,t,r)}function pe(e,t,r){return de(e,t,r)||fe(e,t)}function fe(t,r){switch(t.kind){case 256:return e.some(t.members,(function(e){return pe(e,t,r)}));case 168:case 172:case 170:return e.some(t.parameters,(function(e){return de(e,t,r)}));default:return !1}}function ge(e){var t=e.parent;return (279===t.kind||278===t.kind||280===t.kind)&&t.tagName===e}function me(t){switch(t.kind){case 106:case 104:case 110:case 95:case 13:case 203:case 204:case 205:case 206:case 207:case 208:case 209:case 228:case 210:case 229:case 211:case 212:case 225:case 213:case 216:case 214:case 215:case 218:case 219:case 220:case 221:case 224:case 222:case 226:case 277:case 278:case 281:case 223:case 217:case 230:return !0;case 160:for(;160===t.parent.kind;)t=t.parent;return 180===t.parent.kind||e.isJSDocLinkLike(t.parent)||e.isJSDocNameReference(t.parent)||e.isJSDocMemberName(t.parent)||ge(t);case 309:for(;e.isJSDocMemberName(t.parent);)t=t.parent;return 180===t.parent.kind||e.isJSDocLinkLike(t.parent)||e.isJSDocNameReference(t.parent)||e.isJSDocMemberName(t.parent)||ge(t);case 80:return e.isBinaryExpression(t.parent)&&t.parent.left===t&&101===t.parent.operatorToken.kind;case 79:if(180===t.parent.kind||e.isJSDocLinkLike(t.parent)||e.isJSDocNameReference(t.parent)||e.isJSDocMemberName(t.parent)||ge(t))return !0;case 8:case 9:case 10:case 14:case 108:return ye(t);default:return !1}}function ye(e){var t=e.parent;switch(t.kind){case 253:case 163:case 166:case 165:case 297:case 294:case 202:return t.initializer===e;case 237:case 238:case 239:case 240:case 246:case 247:case 248:case 288:case 250:return t.expression===e;case 241:var r=t;return r.initializer===e&&254!==r.initializer.kind||r.condition===e||r.incrementor===e;case 242:case 243:var n=t;return n.initializer===e&&254!==n.initializer.kind||n.expression===e;case 210:case 228:case 232:case 161:return e===t.expression;case 164:case 287:case 286:case 296:return !0;case 227:return t.expression===e&&Jr(t);case 295:return t.objectAssignmentInitializer===e;default:return me(t)}}function ve(e){for(;160===e.kind||79===e.kind;)e=e.parent;return 180===e.kind}function he(e){return 264===e.kind&&276===e.moduleReference.kind}function be(e){return xe(e)}function xe(e){return !!e&&!!(131072&e.flags)}function De(e){return !!e&&!!(4194304&e.flags)}function Se(t,r){if(207!==t.kind)return !1;var n=t,i=n.expression,a=n.arguments;if(79!==i.kind||"require"!==i.escapedText)return !1;if(1!==a.length)return !1;var o=a[0];return !r||e.isStringLiteralLike(o)}function Te(t){return 202===t.kind&&(t=t.parent.parent),e.isVariableDeclaration(t)&&!!t.initializer&&Se(on(t.initializer),!0)}function Ce(t){return e.isBinaryExpression(t)||an(t)||e.isIdentifier(t)||e.isCallExpression(t)}function Ee(t){return xe(t)&&t.initializer&&e.isBinaryExpression(t.initializer)&&(56===t.initializer.operatorToken.kind||60===t.initializer.operatorToken.kind)&&t.name&&zr(t.name)&&Ne(t.name,t.initializer.left)?t.initializer.right:t.initializer}function ke(t,r){if(e.isCallExpression(t)){var n=lt(t.expression);return 212===n.kind||213===n.kind?t:void 0}return 212===t.kind||225===t.kind||213===t.kind||e.isObjectLiteralExpression(t)&&(0===t.properties.length||r)?t:void 0}function Ne(t,r){if(Et(t)&&Et(r))return kt(t)===kt(r);if(e.isIdentifier(t)&&Me(r)&&(108===r.expression.kind||e.isIdentifier(r.expression)&&("window"===r.expression.escapedText||"self"===r.expression.escapedText||"global"===r.expression.escapedText))){var n=Je(r);return e.isPrivateIdentifier(n)&&e.Debug.fail("Unexpected PrivateIdentifier in name expression with literal-like access."),Ne(t,n)}return !(!Me(t)||!Me(r))&&Ue(t)===Ue(r)&&Ne(t.expression,r.expression)}function Fe(e){for(;jr(e,!0);)e=e.right;return e}function Ae(t){return e.isIdentifier(t)&&"exports"===t.escapedText}function Pe(t){return e.isIdentifier(t)&&"module"===t.escapedText}function we(t){return (e.isPropertyAccessExpression(t)||Le(t))&&Pe(t.expression)&&"exports"===Ue(t)}function Ie(t){var r=function(t){if(e.isCallExpression(t)){if(!Oe(t))return 0;var r=t.arguments[0];return Ae(r)||we(r)?8:Re(r)&&"prototype"===Ue(r)?9:7}return 63!==t.operatorToken.kind||!an(t.left)||(n=Fe(t),e.isVoidExpression(n)&&e.isNumericLiteral(n.expression)&&"0"===n.expression.text)?0:je(t.left.expression,!0)&&"prototype"===Ue(t.left)&&e.isObjectLiteralExpression(Ve(t))?6:Ke(t.left);var n;}(t);return 5===r||xe(t)?r:0}function Oe(t){return 3===e.length(t.arguments)&&e.isPropertyAccessExpression(t.expression)&&e.isIdentifier(t.expression.expression)&&"Object"===e.idText(t.expression.expression)&&"defineProperty"===e.idText(t.expression.name)&&xt(t.arguments[1])&&je(t.arguments[0],!0)}function Me(t){return e.isPropertyAccessExpression(t)||Le(t)}function Le(t){return e.isElementAccessExpression(t)&&xt(t.argumentExpression)}function Re(t,r){return e.isPropertyAccessExpression(t)&&(!r&&108===t.expression.kind||e.isIdentifier(t.name)&&je(t.expression,!0))||Be(t,r)}function Be(e,t){return Le(e)&&(!t&&108===e.expression.kind||zr(e.expression)||Re(e.expression,!0))}function je(e,t){return zr(e)||Re(e,t)}function Je(t){return e.isPropertyAccessExpression(t)?t.name:t.argumentExpression}function ze(t){if(e.isPropertyAccessExpression(t))return t.name;var r=lt(t.argumentExpression);return e.isNumericLiteral(r)||e.isStringLiteralLike(r)?r:t}function Ue(t){var r=ze(t);if(r){if(e.isIdentifier(r))return r.escapedText;if(e.isStringLiteralLike(r)||e.isNumericLiteral(r))return e.escapeLeadingUnderscores(r.text)}}function Ke(t){if(108===t.expression.kind)return 4;if(we(t))return 2;if(je(t.expression,!0)){if(Kr(t.expression))return 3;for(var r=t;!e.isIdentifier(r.expression);)r=r.expression;var n=r.expression;if(("exports"===n.escapedText||"module"===n.escapedText&&"exports"===Ue(r))&&Re(t))return 1;if(je(t,!0)||e.isElementAccessExpression(t)&&Tt(t))return 5}return 0}function Ve(t){for(;e.isBinaryExpression(t.right);)t=t.right;return t.right}function qe(t){switch(t.parent.kind){case 265:case 271:return t.parent;case 276:return t.parent.parent;case 207:return W(t.parent)||Se(t.parent,!1)?t.parent:void 0;case 195:return e.Debug.assert(e.isStringLiteral(t)),e.tryCast(t.parent.parent,e.isImportTypeNode);default:return}}function We(t){switch(t.kind){case 265:case 271:return t.moduleSpecifier;case 264:return 276===t.moduleReference.kind?t.moduleReference.expression:void 0;case 199:return H(t)?t.argument.literal:void 0;case 207:return t.arguments[0];case 260:return 10===t.name.kind?t.name:void 0;default:return e.Debug.assertNever(t)}}function He(e){return 343===e.kind||336===e.kind||337===e.kind}function Ge(t){return e.isExpressionStatement(t)&&e.isBinaryExpression(t.expression)&&0!==Ie(t.expression)&&e.isBinaryExpression(t.expression.right)&&(56===t.expression.right.operatorToken.kind||60===t.expression.right.operatorToken.kind)?t.expression.right.right:void 0}function Qe(e){switch(e.kind){case 236:var t=Xe(e);return t&&t.initializer;case 166:case 294:return e.initializer}}function Xe(t){return e.isVariableStatement(t)?e.firstOrUndefined(t.declarationList.declarations):void 0}function Ye(t){return e.isModuleDeclaration(t)&&t.body&&260===t.body.kind?t.body:void 0}function Ze(t,r){if(e.isJSDoc(r)){var n=e.filter(r.tags,(function(e){return $e(t,e)}));return r.tags===n?[r]:n}return $e(t,r)?[r]:void 0}function $e(t,r){return !(e.isJSDocTypeTag(r)&&r.parent&&e.isJSDoc(r.parent)&&e.isParenthesizedExpression(r.parent.parent)&&r.parent.parent!==t)}function et(t){var r=t.parent;return 294===r.kind||270===r.kind||166===r.kind||237===r.kind&&205===t.kind||246===r.kind||Ye(r)||e.isBinaryExpression(t)&&63===t.operatorToken.kind?r:r.parent&&(Xe(r.parent)===t||e.isBinaryExpression(r)&&63===r.operatorToken.kind)?r.parent:r.parent&&r.parent.parent&&(Xe(r.parent.parent)||Qe(r.parent.parent)===t||Ge(r.parent.parent))?r.parent.parent:void 0}function tt(t){var r=rt(t);return r&&e.isFunctionLike(r)?r:void 0}function rt(t){var r=nt(t);if(r)return Ge(r)||function(t){return e.isExpressionStatement(t)&&e.isBinaryExpression(t.expression)&&63===t.expression.operatorToken.kind?Fe(t.expression):void 0}(r)||Qe(r)||Xe(r)||Ye(r)||r}function nt(t){var r=it(t);if(r){var n=r.parent;return n&&n.jsDoc&&r===e.lastOrUndefined(n.jsDoc)?n:void 0}}function it(t){return e.findAncestor(t.parent,e.isJSDoc)}function at(t){var r=e.isJSDocParameterTag(t)?t.typeExpression&&t.typeExpression.type:t.type;return void 0!==t.dotDotDotToken||!!r&&316===r.kind}function ot(e){for(var t=e.parent;;){switch(t.kind){case 220:var r=t.operatorToken.kind;return Lr(r)&&t.left===e?63===r||Mr(r)?1:2:0;case 218:case 219:var n=t.operator;return 45===n||46===n?2:0;case 242:case 243:return t.initializer===e?1:0;case 211:case 203:case 224:case 229:e=t;break;case 296:e=t.parent;break;case 295:if(t.name!==e)return 0;e=t.parent;break;case 294:if(t.name===e)return 0;e=t.parent;break;default:return 0}t=e.parent;}}function st(e,t){for(;e&&e.kind===t;)e=e.parent;return e}function ct(e){return st(e,211)}function lt(t,r){var n=r?17:1;return e.skipOuterExpressions(t,n)}function ut(t){return zr(t)||e.isClassExpression(t)}function _t(e){return ut(dt(e))}function dt(t){return e.isExportAssignment(t)?t.expression:t.right}function pt(t){var r=ft(t);if(r&&xe(t)){var n=e.getJSDocAugmentsTag(t);if(n)return n.class}return r}function ft(e){var t=yt(e.heritageClauses,94);return t&&t.types.length>0?t.types[0]:void 0}function gt(t){if(xe(t))return e.getJSDocImplementsTags(t).map((function(e){return e.class}));var r=yt(t.heritageClauses,117);return null==r?void 0:r.types}function mt(e){var t=yt(e.heritageClauses,94);return t?t.types:void 0}function yt(e,t){if(e)for(var r=0,n=e;r<n.length;r++){var i=n[r];if(i.token===t)return i}}function vt(e){return 81<=e&&e<=159}function ht(e){return 126<=e&&e<=159}function bt(e){return vt(e)&&!ht(e)}function xt(t){return e.isStringLiteralLike(t)||e.isNumericLiteral(t)}function Dt(t){return e.isPrefixUnaryExpression(t)&&(39===t.operator||40===t.operator)&&e.isNumericLiteral(t.operand)}function St(t){var r=e.getNameOfDeclaration(t);return !!r&&Tt(r)}function Tt(t){if(161!==t.kind&&206!==t.kind)return !1;var r=e.isElementAccessExpression(t)?lt(t.argumentExpression):t.expression;return !xt(r)&&!Dt(r)}function Ct(t){switch(t.kind){case 79:case 80:return t.escapedText;case 10:case 8:return e.escapeLeadingUnderscores(t.text);case 161:var r=t.expression;return xt(r)?e.escapeLeadingUnderscores(r.text):Dt(r)?40===r.operator?e.tokenToString(r.operator)+r.operand.text:r.operand.text:void 0;default:return e.Debug.assertNever(t)}}function Et(e){switch(e.kind){case 79:case 10:case 14:case 8:return !0;default:return !1}}function kt(t){return e.isMemberName(t)?e.idText(t):t.text}function Nt(e){for(;202===e.kind;)e=e.parent.parent;return e}function Ft(e){return li(e.pos)||li(e.end)}function At(e,t,r){switch(e){case 208:return r?0:1;case 218:case 215:case 216:case 214:case 217:case 221:case 223:return 1;case 220:switch(t){case 42:case 63:case 64:case 65:case 67:case 66:case 68:case 69:case 70:case 71:case 72:case 73:case 78:case 74:case 75:case 76:case 77:return 1}}return 0}function Pt(e){return 220===e.kind?e.operatorToken.kind:218===e.kind||219===e.kind?e.operator:e.kind}function wt(e,t,r){switch(e){case 349:return 0;case 224:return 1;case 223:return 2;case 221:return 4;case 220:switch(t){case 27:return 0;case 63:case 64:case 65:case 67:case 66:case 68:case 69:case 70:case 71:case 72:case 73:case 78:case 74:case 75:case 76:case 77:return 3;default:return It(t)}case 210:case 229:case 218:case 215:case 216:case 214:case 217:return 16;case 219:return 17;case 207:return 18;case 208:return r?19:18;case 209:case 205:case 206:case 230:return 19;case 228:return 11;case 108:case 106:case 79:case 80:case 104:case 110:case 95:case 8:case 9:case 10:case 203:case 204:case 212:case 213:case 225:case 13:case 14:case 222:case 211:case 226:case 277:case 278:case 281:return 20;default:return -1}}function It(e){switch(e){case 60:return 4;case 56:return 5;case 55:return 6;case 51:return 7;case 52:return 8;case 50:return 9;case 34:case 35:case 36:case 37:return 10;case 29:case 31:case 32:case 33:case 102:case 101:case 127:return 11;case 47:case 48:case 49:return 12;case 39:case 40:return 13;case 41:case 43:case 44:return 14;case 42:return 15}return -1}e.isPartOfTypeNode=ne,e.isChildOfNodeWithKind=function(e,t){for(;e;){if(e.kind===t)return !0;e=e.parent;}return !1},e.forEachReturnStatement=function(t,r){return function t(n){switch(n.kind){case 246:return r(n);case 262:case 234:case 238:case 239:case 240:case 241:case 242:case 243:case 247:case 248:case 288:case 289:case 249:case 251:case 291:return e.forEachChild(n,t)}}(t)},e.forEachYieldExpression=function(t,r){return function t(n){switch(n.kind){case 223:r(n);var i=n.expression;return void(i&&t(i));case 259:case 257:case 260:case 258:return;default:if(e.isFunctionLike(n)){if(n.name&&161===n.name.kind)return void t(n.name.expression)}else ne(n)||e.forEachChild(n,t);}}(t)},e.getRestParameterElementType=function(t){return t&&182===t.kind?t.elementType:t&&177===t.kind?e.singleOrUndefined(t.typeArguments):void 0},e.getMembersOfDeclaration=function(e){switch(e.kind){case 257:case 256:case 225:case 181:return e.members;case 204:return e.properties}},e.isVariableLike=ie,e.isVariableLikeOrAccessor=function(t){return ie(t)||e.isAccessor(t)},e.isVariableDeclarationInVariableStatement=ae,e.isValidESSymbolDeclaration=function(t){return e.isVariableDeclaration(t)?q(t)&&e.isIdentifier(t.name)&&ae(t):e.isPropertyDeclaration(t)?Cr(t)&&Tr(t):e.isPropertySignature(t)&&Cr(t)},e.introducesArgumentsExoticObject=function(e){switch(e.kind){case 168:case 167:case 170:case 171:case 172:case 255:case 212:return !0}return !1},e.unwrapInnermostStatementOfLabel=function(e,t){for(;;){if(t&&t(e),249!==e.statement.kind)return e.statement;e=e.statement;}},e.isFunctionBlock=function(t){return t&&234===t.kind&&e.isFunctionLike(t.parent)},e.isObjectLiteralMethod=function(e){return e&&168===e.kind&&204===e.parent.kind},e.isObjectLiteralOrClassExpressionMethodOrAccessor=function(e){return !(168!==e.kind&&171!==e.kind&&172!==e.kind||204!==e.parent.kind&&225!==e.parent.kind)},e.isIdentifierTypePredicate=function(e){return e&&1===e.kind},e.isThisTypePredicate=function(e){return e&&0===e.kind},e.getPropertyAssignment=oe,e.getPropertyArrayElementValue=function(t,r,n){return e.firstDefined(oe(t,r),(function(t){return e.isArrayLiteralExpression(t.initializer)?e.find(t.initializer.elements,(function(t){return e.isStringLiteral(t)&&t.text===n})):void 0}))},e.getTsConfigObjectLiteralExpression=se,e.getTsConfigPropArrayElementValue=function(t,r,n){return e.firstDefined(ce(t,r),(function(t){return e.isArrayLiteralExpression(t.initializer)?e.find(t.initializer.elements,(function(t){return e.isStringLiteral(t)&&t.text===n})):void 0}))},e.getTsConfigPropArray=ce,e.getContainingFunction=function(t){return e.findAncestor(t.parent,e.isFunctionLike)},e.getContainingFunctionDeclaration=function(t){return e.findAncestor(t.parent,e.isFunctionLikeDeclaration)},e.getContainingClass=function(t){return e.findAncestor(t.parent,e.isClassLike)},e.getContainingClassStaticBlock=function(t){return e.findAncestor(t.parent,(function(t){return e.isClassLike(t)||e.isFunctionLike(t)?"quit":e.isClassStaticBlockDeclaration(t)}))},e.getContainingFunctionOrClassStaticBlock=function(t){return e.findAncestor(t.parent,e.isFunctionLikeOrClassStaticBlockDeclaration)},e.getThisContainer=le,e.isInTopLevelContext=function(t){e.isIdentifier(t)&&(e.isClassDeclaration(t.parent)||e.isFunctionDeclaration(t.parent))&&t.parent.name===t&&(t=t.parent);var r=le(t,!0);return e.isSourceFile(r)},e.getNewTargetContainer=function(e){var t=le(e,!1);if(t)switch(t.kind){case 170:case 255:case 212:return t}},e.getSuperContainer=function(t,r){for(;;){if(!(t=t.parent))return t;switch(t.kind){case 161:t=t.parent;break;case 255:case 212:case 213:if(!r)continue;case 166:case 165:case 168:case 167:case 170:case 171:case 172:case 169:return t;case 164:163===t.parent.kind&&e.isClassElement(t.parent.parent)?t=t.parent.parent:e.isClassElement(t.parent)&&(t=t.parent);}}},e.getImmediatelyInvokedFunctionExpression=function(e){if(212===e.kind||213===e.kind){for(var t=e,r=e.parent;211===r.kind;)t=r,r=r.parent;if(207===r.kind&&r.expression===t)return r}},e.isSuperOrSuperProperty=function(e){return 106===e.kind||ue(e)},e.isSuperProperty=ue,e.isThisProperty=function(e){var t=e.kind;return (205===t||206===t)&&108===e.expression.kind},e.isThisInitializedDeclaration=function(t){var r;return !!t&&e.isVariableDeclaration(t)&&108===(null===(r=t.initializer)||void 0===r?void 0:r.kind)},e.isThisInitializedObjectBindingExpression=function(t){return !!t&&(e.isShorthandPropertyAssignment(t)||e.isPropertyAssignment(t))&&e.isBinaryExpression(t.parent.parent)&&63===t.parent.parent.operatorToken.kind&&108===t.parent.parent.right.kind},e.getEntityNameFromTypeNode=function(e){switch(e.kind){case 177:return e.typeName;case 227:return zr(e.expression)?e.expression:void 0;case 79:case 160:return e}},e.getInvokedExpression=function(e){switch(e.kind){case 209:return e.tag;case 279:case 278:return e.tagName;default:return e.expression}},e.nodeCanBeDecorated=_e,e.nodeIsDecorated=de,e.nodeOrChildIsDecorated=pe,e.childIsDecorated=fe,e.classOrConstructorParameterIsDecorated=function(e){if(de(e))return !0;var t=ur(e);return !!t&&fe(t,e)},e.isJSXTagName=ge,e.isExpressionNode=me,e.isInExpressionContext=ye,e.isPartOfTypeQuery=ve,e.isNamespaceReexportDeclaration=function(t){return e.isNamespaceExport(t)&&!!t.parent.moduleSpecifier},e.isExternalModuleImportEqualsDeclaration=he,e.getExternalModuleImportEqualsDeclarationExpression=function(t){return e.Debug.assert(he(t)),t.moduleReference.expression},e.getExternalModuleRequireArgument=function(e){return Te(e)&&on(e.initializer).arguments[0]},e.isInternalModuleImportEqualsDeclaration=function(e){return 264===e.kind&&276!==e.moduleReference.kind},e.isSourceFileJS=be,e.isSourceFileNotJS=function(e){return !xe(e)},e.isInJSFile=xe,e.isInJsonFile=function(e){return !!e&&!!(33554432&e.flags)},e.isSourceFileNotJson=function(e){return !V(e)},e.isInJSDoc=De,e.isJSDocIndexSignature=function(t){return e.isTypeReferenceNode(t)&&e.isIdentifier(t.typeName)&&"Object"===t.typeName.escapedText&&t.typeArguments&&2===t.typeArguments.length&&(149===t.typeArguments[0].kind||146===t.typeArguments[0].kind)},e.isRequireCall=Se,e.isRequireVariableDeclaration=Te,e.isRequireVariableStatement=function(t){return e.isVariableStatement(t)&&t.declarationList.declarations.length>0&&e.every(t.declarationList.declarations,(function(e){return Te(e)}))},e.isSingleOrDoubleQuote=function(e){return 39===e||34===e},e.isStringDoubleQuoted=function(e,t){return 34===h(t,e).charCodeAt(0)},e.isAssignmentDeclaration=Ce,e.getEffectiveInitializer=Ee,e.getDeclaredExpandoInitializer=function(e){var t=Ee(e);return t&&ke(t,Kr(e.name))},e.getAssignedExpandoInitializer=function(t){if(t&&t.parent&&e.isBinaryExpression(t.parent)&&63===t.parent.operatorToken.kind){var r=Kr(t.parent.left);return ke(t.parent.right,r)||function(t,r,n){var i=e.isBinaryExpression(r)&&(56===r.operatorToken.kind||60===r.operatorToken.kind)&&ke(r.right,n);if(i&&Ne(t,r.left))return i}(t.parent.left,t.parent.right,r)}if(t&&e.isCallExpression(t)&&Oe(t)){var n=function(t,r){return e.forEach(t.properties,(function(t){return e.isPropertyAssignment(t)&&e.isIdentifier(t.name)&&"value"===t.name.escapedText&&t.initializer&&ke(t.initializer,r)}))}(t.arguments[2],"prototype"===t.arguments[1].text);if(n)return n}},e.getExpandoInitializer=ke,e.isDefaultedExpandoInitializer=function(t){var r=e.isVariableDeclaration(t.parent)?t.parent.name:e.isBinaryExpression(t.parent)&&63===t.parent.operatorToken.kind?t.parent.left:void 0;return r&&ke(t.right,Kr(r))&&zr(r)&&Ne(r,t.left)},e.getNameOfExpando=function(t){if(e.isBinaryExpression(t.parent)){var r=56!==t.parent.operatorToken.kind&&60!==t.parent.operatorToken.kind||!e.isBinaryExpression(t.parent.parent)?t.parent:t.parent.parent;if(63===r.operatorToken.kind&&e.isIdentifier(r.left))return r.left}else if(e.isVariableDeclaration(t.parent))return t.parent.name},e.isSameEntityName=Ne,e.getRightMostAssignedExpression=Fe,e.isExportsIdentifier=Ae,e.isModuleIdentifier=Pe,e.isModuleExportsAccessExpression=we,e.getAssignmentDeclarationKind=Ie,e.isBindableObjectDefinePropertyCall=Oe,e.isLiteralLikeAccess=Me,e.isLiteralLikeElementAccess=Le,e.isBindableStaticAccessExpression=Re,e.isBindableStaticElementAccessExpression=Be,e.isBindableStaticNameExpression=je,e.getNameOrArgument=Je,e.getElementOrPropertyAccessArgumentExpressionOrName=ze,e.getElementOrPropertyAccessName=Ue,e.getAssignmentDeclarationPropertyAccessKind=Ke,e.getInitializerOfBinaryExpression=Ve,e.isPrototypePropertyAssignment=function(t){return e.isBinaryExpression(t)&&3===Ie(t)},e.isSpecialPropertyDeclaration=function(t){return xe(t)&&t.parent&&237===t.parent.kind&&(!e.isElementAccessExpression(t)||Le(t))&&!!e.getJSDocTypeTag(t.parent)},e.setValueDeclaration=function(e,t){var r=e.valueDeclaration;(!r||(!(8388608&t.flags)||8388608&r.flags)&&Ce(r)&&!Ce(t)||r.kind!==t.kind&&E(r))&&(e.valueDeclaration=t);},e.isFunctionSymbol=function(t){if(!t||!t.valueDeclaration)return !1;var r=t.valueDeclaration;return 255===r.kind||e.isVariableDeclaration(r)&&r.initializer&&e.isFunctionLike(r.initializer)},e.tryGetModuleSpecifierFromDeclaration=function(t){var r,n,i;switch(t.kind){case 253:return t.initializer.arguments[0].text;case 265:return null===(r=e.tryCast(t.moduleSpecifier,e.isStringLiteralLike))||void 0===r?void 0:r.text;case 264:return null===(i=e.tryCast(null===(n=e.tryCast(t.moduleReference,e.isExternalModuleReference))||void 0===n?void 0:n.expression,e.isStringLiteralLike))||void 0===i?void 0:i.text;default:e.Debug.assertNever(t);}},e.importFromModuleSpecifier=function(t){return qe(t)||e.Debug.failBadSyntaxKind(t.parent)},e.tryGetImportFromModuleSpecifier=qe,e.getExternalModuleName=We,e.getNamespaceDeclarationNode=function(t){switch(t.kind){case 265:return t.importClause&&e.tryCast(t.importClause.namedBindings,e.isNamespaceImport);case 264:return t;case 271:return t.exportClause&&e.tryCast(t.exportClause,e.isNamespaceExport);default:return e.Debug.assertNever(t)}},e.isDefaultImport=function(e){return 265===e.kind&&!!e.importClause&&!!e.importClause.name},e.forEachImportClauseDeclaration=function(t,r){var n;return t.name&&(n=r(t))||t.namedBindings&&(n=e.isNamespaceImport(t.namedBindings)?r(t.namedBindings):e.forEach(t.namedBindings.elements,r))?n:void 0},e.hasQuestionToken=function(e){if(e)switch(e.kind){case 163:case 168:case 167:case 295:case 294:case 166:case 165:return void 0!==e.questionToken}return !1},e.isJSDocConstructSignature=function(t){var r=e.isJSDocFunctionType(t)?e.firstOrUndefined(t.parameters):void 0,n=e.tryCast(r&&r.name,e.isIdentifier);return !!n&&"new"===n.escapedText},e.isJSDocTypeAlias=He,e.isTypeAlias=function(t){return He(t)||e.isTypeAliasDeclaration(t)},e.getSingleInitializerOfVariableStatementOrPropertyDeclaration=Qe,e.getSingleVariableOfVariableStatement=Xe,e.getJSDocCommentsAndTags=function(t,r){var n;ie(t)&&e.hasInitializer(t)&&e.hasJSDocNodes(t.initializer)&&(n=e.addRange(n,Ze(t,e.last(t.initializer.jsDoc))));for(var i=t;i&&i.parent;){if(e.hasJSDocNodes(i)&&(n=e.addRange(n,Ze(t,e.last(i.jsDoc)))),163===i.kind){n=e.addRange(n,(r?e.getJSDocParameterTagsNoCache:e.getJSDocParameterTags)(i));break}if(162===i.kind){n=e.addRange(n,(r?e.getJSDocTypeParameterTagsNoCache:e.getJSDocTypeParameterTags)(i));break}i=et(i);}return n||e.emptyArray},e.getNextJSDocCommentLocation=et,e.getParameterSymbolFromJSDoc=function(t){if(t.symbol)return t.symbol;if(e.isIdentifier(t.name)){var r=t.name.escapedText,n=tt(t);if(n){var i=e.find(n.parameters,(function(e){return 79===e.name.kind&&e.name.escapedText===r}));return i&&i.symbol}}},e.getEffectiveContainerForJSDocTemplateTag=function(t){if(e.isJSDoc(t.parent)&&t.parent.tags){var r=e.find(t.parent.tags,He);if(r)return r}return tt(t)},e.getHostSignatureFromJSDoc=tt,e.getEffectiveJSDocHost=rt,e.getJSDocHost=nt,e.getJSDocRoot=it,e.getTypeParameterFromJsDoc=function(t){var r=t.name.escapedText,n=t.parent.parent.parent.typeParameters;return n&&e.find(n,(function(e){return e.name.escapedText===r}))},e.hasRestParameter=function(t){var r=e.lastOrUndefined(t.parameters);return !!r&&at(r)},e.isRestParameter=at,e.hasTypeArguments=function(e){return !!e.typeArguments},(te=e.AssignmentKind||(e.AssignmentKind={}))[te.None=0]="None",te[te.Definite=1]="Definite",te[te.Compound=2]="Compound",e.getAssignmentTargetKind=ot,e.isAssignmentTarget=function(e){return 0!==ot(e)},e.isNodeWithPossibleHoistedDeclaration=function(e){switch(e.kind){case 234:case 236:case 247:case 238:case 248:case 262:case 288:case 289:case 249:case 241:case 242:case 243:case 239:case 240:case 251:case 291:return !0}return !1},e.isValueSignatureDeclaration=function(t){return e.isFunctionExpression(t)||e.isArrowFunction(t)||e.isMethodOrAccessor(t)||e.isFunctionDeclaration(t)||e.isConstructorDeclaration(t)},e.walkUpParenthesizedTypes=function(e){return st(e,190)},e.walkUpParenthesizedExpressions=ct,e.walkUpParenthesizedTypesAndGetParentAndChild=function(e){for(var t;e&&190===e.kind;)t=e,e=e.parent;return [t,e]},e.skipParentheses=lt,e.isDeleteTarget=function(e){return (205===e.kind||206===e.kind)&&(e=ct(e.parent))&&214===e.kind},e.isNodeDescendantOf=function(e,t){for(;e;){if(e===t)return !0;e=e.parent;}return !1},e.isDeclarationName=function(t){return !e.isSourceFile(t)&&!e.isBindingPattern(t)&&e.isDeclaration(t.parent)&&t.parent.name===t},e.getDeclarationFromName=function(t){var r=t.parent;switch(t.kind){case 10:case 14:case 8:if(e.isComputedPropertyName(r))return r.parent;case 79:if(e.isDeclaration(r))return r.name===t?r:void 0;if(e.isQualifiedName(r)){var n=r.parent;return e.isJSDocParameterTag(n)&&n.name===r?n:void 0}var i=r.parent;return e.isBinaryExpression(i)&&0!==Ie(i)&&(i.left.symbol||i.symbol)&&e.getNameOfDeclaration(i)===t?i:void 0;case 80:return e.isDeclaration(r)&&r.name===t?r:void 0;default:return}},e.isLiteralComputedPropertyDeclarationName=function(t){return xt(t)&&161===t.parent.kind&&e.isDeclaration(t.parent.parent)},e.isIdentifierName=function(e){var t=e.parent;switch(t.kind){case 166:case 165:case 168:case 167:case 171:case 172:case 297:case 294:case 205:return t.name===e;case 160:return t.right===e;case 202:case 269:return t.propertyName===e;case 274:case 284:return !0}return !1},e.isAliasSymbolDeclaration=function(t){return 264===t.kind||263===t.kind||266===t.kind&&!!t.name||267===t.kind||273===t.kind||269===t.kind||274===t.kind||270===t.kind&&_t(t)||e.isBinaryExpression(t)&&2===Ie(t)&&_t(t)||e.isPropertyAccessExpression(t)&&e.isBinaryExpression(t.parent)&&t.parent.left===t&&63===t.parent.operatorToken.kind&&ut(t.parent.right)||295===t.kind||294===t.kind&&ut(t.initializer)},e.getAliasDeclarationFromName=function e(t){switch(t.parent.kind){case 266:case 269:case 267:case 274:case 270:case 264:return t.parent;case 160:do{t=t.parent;}while(160===t.parent.kind);return e(t)}},e.isAliasableExpression=ut,e.exportAssignmentIsAlias=_t,e.getExportAssignmentExpression=dt,e.getPropertyAssignmentAliasLikeExpression=function(e){return 295===e.kind?e.name:294===e.kind?e.initializer:e.parent.right},e.getEffectiveBaseTypeNode=pt,e.getClassExtendsHeritageElement=ft,e.getEffectiveImplementsTypeNodes=gt,e.getAllSuperTypeNodes=function(t){return e.isInterfaceDeclaration(t)?mt(t)||e.emptyArray:e.isClassLike(t)&&e.concatenate(e.singleElementArray(pt(t)),gt(t))||e.emptyArray},e.getInterfaceBaseTypeNodes=mt,e.getHeritageClause=yt,e.getAncestor=function(e,t){for(;e;){if(e.kind===t)return e;e=e.parent;}},e.isKeyword=vt,e.isContextualKeyword=ht,e.isNonContextualKeyword=bt,e.isFutureReservedKeyword=function(e){return 117<=e&&e<=125},e.isStringANonContextualKeyword=function(t){var r=e.stringToToken(t);return void 0!==r&&bt(r)},e.isStringAKeyword=function(t){var r=e.stringToToken(t);return void 0!==r&&vt(r)},e.isIdentifierANonContextualKeyword=function(e){var t=e.originalKeywordKind;return !!t&&!ht(t)},e.isTrivia=function(e){return 2<=e&&e<=7},(ee=e.FunctionFlags||(e.FunctionFlags={}))[ee.Normal=0]="Normal",ee[ee.Generator=1]="Generator",ee[ee.Async=2]="Async",ee[ee.Invalid=4]="Invalid",ee[ee.AsyncGenerator=3]="AsyncGenerator",e.getFunctionFlags=function(e){if(!e)return 4;var t=0;switch(e.kind){case 255:case 212:case 168:e.asteriskToken&&(t|=1);case 213:Dr(e,256)&&(t|=2);}return e.body||(t|=4),t},e.isAsyncFunction=function(e){switch(e.kind){case 255:case 212:case 213:case 168:return void 0!==e.body&&void 0===e.asteriskToken&&Dr(e,256)}return !1},e.isStringOrNumericLiteralLike=xt,e.isSignedNumericLiteral=Dt,e.hasDynamicName=St,e.isDynamicName=Tt,e.getPropertyNameForPropertyNameNode=Ct,e.isPropertyNameLiteral=Et,e.getTextOfIdentifierOrLiteral=kt,e.getEscapedTextOfIdentifierOrLiteral=function(t){return e.isMemberName(t)?t.escapedText:e.escapeLeadingUnderscores(t.text)},e.getPropertyNameForUniqueESSymbol=function(t){return "__@".concat(e.getSymbolId(t),"@").concat(t.escapedName)},e.getSymbolNameForPrivateIdentifier=function(t,r){return "__#".concat(e.getSymbolId(t),"@").concat(r)},e.isKnownSymbol=function(t){return e.startsWith(t.escapedName,"__@")},e.isPrivateIdentifierSymbol=function(t){return e.startsWith(t.escapedName,"__#")},e.isESSymbolIdentifier=function(e){return 79===e.kind&&"Symbol"===e.escapedText},e.isPushOrUnshiftIdentifier=function(e){return "push"===e.escapedText||"unshift"===e.escapedText},e.isParameterDeclaration=function(e){return 163===Nt(e).kind},e.getRootDeclaration=Nt,e.nodeStartsNewLexicalEnvironment=function(e){var t=e.kind;return 170===t||212===t||255===t||213===t||168===t||171===t||172===t||260===t||303===t},e.nodeIsSynthesized=Ft,e.getOriginalSourceFile=function(t){return e.getParseTreeNode(t,e.isSourceFile)||t},($=e.Associativity||(e.Associativity={}))[$.Left=0]="Left",$[$.Right=1]="Right",e.getExpressionAssociativity=function(e){var t=Pt(e),r=208===e.kind&&void 0!==e.arguments;return At(e.kind,t,r)},e.getOperatorAssociativity=At,e.getExpressionPrecedence=function(e){var t=Pt(e),r=208===e.kind&&void 0!==e.arguments;return wt(e.kind,t,r)},e.getOperator=Pt,(Z=e.OperatorPrecedence||(e.OperatorPrecedence={}))[Z.Comma=0]="Comma",Z[Z.Spread=1]="Spread",Z[Z.Yield=2]="Yield",Z[Z.Assignment=3]="Assignment",Z[Z.Conditional=4]="Conditional",Z[Z.Coalesce=4]="Coalesce",Z[Z.LogicalOR=5]="LogicalOR",Z[Z.LogicalAND=6]="LogicalAND",Z[Z.BitwiseOR=7]="BitwiseOR",Z[Z.BitwiseXOR=8]="BitwiseXOR",Z[Z.BitwiseAND=9]="BitwiseAND",Z[Z.Equality=10]="Equality",Z[Z.Relational=11]="Relational",Z[Z.Shift=12]="Shift",Z[Z.Additive=13]="Additive",Z[Z.Multiplicative=14]="Multiplicative",Z[Z.Exponentiation=15]="Exponentiation",Z[Z.Unary=16]="Unary",Z[Z.Update=17]="Update",Z[Z.LeftHandSide=18]="LeftHandSide",Z[Z.Member=19]="Member",Z[Z.Primary=20]="Primary",Z[Z.Highest=20]="Highest",Z[Z.Lowest=0]="Lowest",Z[Z.Invalid=-1]="Invalid",e.getOperatorPrecedence=wt,e.getBinaryOperatorPrecedence=It,e.getSemanticJsxChildren=function(t){return e.filter(t,(function(e){switch(e.kind){case 287:return !!e.expression;case 11:return !e.containsOnlyTriviaWhiteSpaces;default:return !0}}))},e.createDiagnosticCollection=function(){var t=[],r=[],n=new e.Map,i=!1;return {add:function(a){var o;a.file?(o=n.get(a.file.fileName))||(o=[],n.set(a.file.fileName,o),e.insertSorted(r,a.file.fileName,e.compareStringsCaseSensitive)):(i&&(i=!1,t=t.slice()),o=t),e.insertSorted(o,a,xn);},lookup:function(r){var i;if(i=r.file?n.get(r.file.fileName):t){var a=e.binarySearch(i,r,e.identity,Dn);return a>=0?i[a]:void 0}},getGlobalDiagnostics:function(){return i=!0,t},getDiagnostics:function(i){if(i)return n.get(i)||[];var a=e.flatMapToMutable(r,(function(e){return n.get(e)}));return t.length?(a.unshift.apply(a,t),a):a}}};var Ot=/\$\{/g;e.hasInvalidEscape=function(t){return t&&!!(e.isNoSubstitutionTemplateLiteral(t)?t.templateFlags:t.head.templateFlags||e.some(t.templateSpans,(function(e){return !!e.literal.templateFlags})))};var Mt=/[\\\"\u0000-\u001f\t\v\f\b\r\n\u2028\u2029\u0085]/g,Lt=/[\\\'\u0000-\u001f\t\v\f\b\r\n\u2028\u2029\u0085]/g,Rt=/\r\n|[\\\`\u0000-\u001f\t\v\f\b\r\u2028\u2029\u0085]/g,Bt=new e.Map(e.getEntries({"\t":"\\t","\v":"\\v","\f":"\\f","\b":"\\b","\r":"\\r","\n":"\\n","\\":"\\\\",'"':'\\"',"'":"\\'","`":"\\`","\u2028":"\\u2028","\u2029":"\\u2029","…":"\\u0085","\r\n":"\\r\\n"}));function jt(e){return "\\u"+("0000"+e.toString(16).toUpperCase()).slice(-4)}function Jt(e,t,r){if(0===e.charCodeAt(0)){var n=r.charCodeAt(t+e.length);return n>=48&&n<=57?"\\x00":"\\0"}return Bt.get(e)||jt(e.charCodeAt(0))}function zt(e,t){var r=96===t?Rt:39===t?Lt:Mt;return e.replace(r,Jt)}e.escapeString=zt;var Ut=/[^\u0000-\u007F]/g;function Kt(e,t){return e=zt(e,t),Ut.test(e)?e.replace(Ut,(function(e){return jt(e.charCodeAt(0))})):e}e.escapeNonAsciiString=Kt;var Vt=/[\"\u0000-\u001f\u2028\u2029\u0085]/g,qt=/[\'\u0000-\u001f\u2028\u2029\u0085]/g,Wt=new e.Map(e.getEntries({'"':"&quot;","'":"&apos;"}));function Ht(e){return 0===e.charCodeAt(0)?"&#0;":Wt.get(e)||"&#x"+e.charCodeAt(0).toString(16).toUpperCase()+";"}function Gt(e,t){var r=39===t?qt:Vt;return e.replace(r,Ht)}e.escapeJsxAttributeString=Gt,e.stripQuotes=function(e){var t,r=e.length;return r>=2&&e.charCodeAt(0)===e.charCodeAt(r-1)&&(39===(t=e.charCodeAt(0))||34===t||96===t)?e.substring(1,r-1):e},e.isIntrinsicJsxName=function(t){var r=t.charCodeAt(0);return r>=97&&r<=122||e.stringContains(t,"-")||e.stringContains(t,":")};var Qt=[""," "];function Xt(e){for(var t=Qt[1],r=Qt.length;r<=e;r++)Qt.push(Qt[r-1]+t);return Qt[e]}function Yt(){return Qt[1].length}function Zt(e){return !!e.useCaseSensitiveFileNames&&e.useCaseSensitiveFileNames()}function $t(e,t,r){return t.moduleName||tr(e,t.fileName,r&&r.fileName)}function er(t,r){return t.getCanonicalFileName(e.getNormalizedAbsolutePath(r,t.getCurrentDirectory()))}function tr(t,r,n){var i=function(e){return t.getCanonicalFileName(e)},a=e.toPath(n?e.getDirectoryPath(n):t.getCommonSourceDirectory(),t.getCurrentDirectory(),i),o=e.getNormalizedAbsolutePath(r,t.getCurrentDirectory()),s=ai(e.getRelativePathToDirectoryOrUrl(a,o,a,i,!1));return n?e.ensurePathIsNonModuleName(s):s}function rr(e,t,r,n,i){var a=t.declarationDir||t.outDir,o=a?sr(e,a,r,n,i):e,s=nr(o);return ai(o)+s}function nr(t){return e.fileExtensionIsOneOf(t,[".mjs",".mts"])?".d.mts":e.fileExtensionIsOneOf(t,[".cjs",".cts"])?".d.cts":e.fileExtensionIsOneOf(t,[".json"])?".json.d.ts":".d.ts"}function ir(e){return e.outFile||e.out}function ar(e,t,r){return !(t.getCompilerOptions().noEmitForJsFiles&&be(e))&&!e.isDeclarationFile&&!t.isSourceFileFromExternalLibrary(e)&&(r||!(V(e)&&t.getResolvedProjectReferenceToRedirect(e.fileName))&&!t.isSourceOfProjectReferenceRedirect(e.fileName))}function or(e,t,r){return sr(e,r,t.getCurrentDirectory(),t.getCommonSourceDirectory(),(function(e){return t.getCanonicalFileName(e)}))}function sr(t,r,n,i,a){var o=e.getNormalizedAbsolutePath(t,n);return o=0===a(o).indexOf(a(i))?o.substring(i.length):o,e.combinePaths(r,o)}function cr(t,r,n){t.length>e.getRootLength(t)&&!n(t)&&(cr(e.getDirectoryPath(t),r,n),r(t));}function lr(t,r){return e.computeLineOfPosition(t,r)}function ur(t){return e.find(t.members,(function(t){return e.isConstructorDeclaration(t)&&p(t.body)}))}function _r(e){if(e&&e.parameters.length>0){var t=2===e.parameters.length&&dr(e.parameters[0]);return e.parameters[t?1:0]}}function dr(e){return pr(e.name)}function pr(e){return !!e&&79===e.kind&&fr(e)}function fr(e){return 108===e.originalKeywordKind}function gr(t){if(xe(t)||!e.isFunctionDeclaration(t)){var r=t.type;return r||!xe(t)?r:e.isJSDocPropertyLikeTag(t)?t.typeExpression&&t.typeExpression.type:e.getJSDocType(t)}}function mr(e,t,r,n){yr(e,t,r.pos,n);}function yr(e,t,r,n){n&&n.length&&r!==n[0].pos&&lr(e,r)!==lr(e,n[0].pos)&&t.writeLine();}function vr(e,t,r,n,i,a,o,s){if(n&&n.length>0){i&&r.writeSpace(" ");for(var c=!1,l=0,u=n;l<u.length;l++){var _=u[l];c&&(r.writeSpace(" "),c=!1),s(e,t,r,_.pos,_.end,o),_.hasTrailingNewLine?r.writeLine():c=!0;}c&&a&&r.writeSpace(" ");}}function hr(t,r,n,i,a,o){var s=Math.min(r,o-1),c=e.trimString(t.substring(a,s));c?(n.writeComment(c),s!==r&&n.writeLine()):n.rawWrite(i);}function br(t,r,n){for(var i=0;r<n&&e.isWhiteSpaceSingleLine(t.charCodeAt(r));r++)9===t.charCodeAt(r)?i+=Yt()-i%Yt():i++;return i}function xr(e,t){return !!Er(e,t)}function Dr(e,t){return !!kr(e,t)}function Sr(t){return e.isClassElement(t)&&Tr(t)||e.isClassStaticBlockDeclaration(t)}function Tr(e){return Dr(e,32)}function Cr(e){return xr(e,64)}function Er(e,t){return Fr(e)&t}function kr(e,t){return Ar(e)&t}function Nr(e,t,r){return e.kind>=0&&e.kind<=159?0:(536870912&e.modifierFlagsCache||(e.modifierFlagsCache=536870912|wr(e)),!t||4096&e.modifierFlagsCache||!r&&!xe(e)||!e.parent||(e.modifierFlagsCache|=4096|Pr(e)),-536875009&e.modifierFlagsCache)}function Fr(e){return Nr(e,!0)}function Ar(e){return Nr(e,!1)}function Pr(t){var r=0;return t.parent&&!e.isParameter(t)&&(xe(t)&&(e.getJSDocPublicTagNoCache(t)&&(r|=4),e.getJSDocPrivateTagNoCache(t)&&(r|=8),e.getJSDocProtectedTagNoCache(t)&&(r|=16),e.getJSDocReadonlyTagNoCache(t)&&(r|=64),e.getJSDocOverrideTagNoCache(t)&&(r|=16384)),e.getJSDocDeprecatedTagNoCache(t)&&(r|=8192)),r}function wr(e){var t=Ir(e.modifiers);return (4&e.flags||79===e.kind&&e.isInJSDocNamespace)&&(t|=1),t}function Ir(e){var t=0;if(e)for(var r=0,n=e;r<n.length;r++)t|=Or(n[r].kind);return t}function Or(e){switch(e){case 124:return 32;case 123:return 4;case 122:return 16;case 121:return 8;case 126:return 128;case 93:return 1;case 135:return 2;case 85:return 2048;case 88:return 512;case 131:return 256;case 144:return 64;case 158:return 16384}return 0}function Mr(e){return 75===e||76===e||77===e}function Lr(e){return e>=63&&e<=78}function Rr(e){var t=Br(e);return t&&!t.isImplements?t.class:void 0}function Br(t){return e.isExpressionWithTypeArguments(t)&&e.isHeritageClause(t.parent)&&e.isClassLike(t.parent.parent)?{class:t.parent.parent,isImplements:117===t.parent.token}:void 0}function jr(t,r){return e.isBinaryExpression(t)&&(r?63===t.operatorToken.kind:Lr(t.operatorToken.kind))&&e.isLeftHandSideExpression(t.left)}function Jr(e){return void 0!==Rr(e)}function zr(e){return 79===e.kind||Ur(e)}function Ur(t){return e.isPropertyAccessExpression(t)&&e.isIdentifier(t.name)&&zr(t.expression)}function Kr(e){return Re(e)&&"prototype"===Ue(e)}e.getIndentString=Xt,e.getIndentSize=Yt,e.createTextWriter=function(t){var r,n,i,a,o,s=!1;function c(t){var n=e.computeLineStarts(t);n.length>1?(a=a+n.length-1,o=r.length-t.length+e.last(n),i=o-r.length==0):i=!1;}function l(e){e&&e.length&&(i&&(e=Xt(n)+e,i=!1),r+=e,c(e));}function u(e){e&&(s=!1),l(e);}function _(){r="",n=0,i=!0,a=0,o=0,s=!1;}return _(),{write:u,rawWrite:function(e){void 0!==e&&(r+=e,c(e),s=!1);},writeLiteral:function(e){e&&e.length&&u(e);},writeLine:function(e){i&&!e||(a++,o=(r+=t).length,i=!0,s=!1);},increaseIndent:function(){n++;},decreaseIndent:function(){n--;},getIndent:function(){return n},getTextPos:function(){return r.length},getLine:function(){return a},getColumn:function(){return i?n*Yt():r.length-o},getText:function(){return r},isAtStartOfLine:function(){return i},hasTrailingComment:function(){return s},hasTrailingWhitespace:function(){return !!r.length&&e.isWhiteSpaceLike(r.charCodeAt(r.length-1))},clear:_,reportInaccessibleThisError:e.noop,reportPrivateInBaseOfClassExpression:e.noop,reportInaccessibleUniqueSymbolError:e.noop,trackSymbol:function(){return !1},writeKeyword:u,writeOperator:u,writeParameter:u,writeProperty:u,writePunctuation:u,writeSpace:u,writeStringLiteral:u,writeSymbol:function(e,t){return u(e)},writeTrailingSemicolon:u,writeComment:function(e){e&&(s=!0),l(e);},getTextPosWithWriteLine:function(){return i?r.length:r.length+t.length}}},e.getTrailingSemicolonDeferringWriter=function(e){var t=!1;function r(){t&&(e.writeTrailingSemicolon(";"),t=!1);}return i$1(i$1({},e),{writeTrailingSemicolon:function(){t=!0;},writeLiteral:function(t){r(),e.writeLiteral(t);},writeStringLiteral:function(t){r(),e.writeStringLiteral(t);},writeSymbol:function(t,n){r(),e.writeSymbol(t,n);},writePunctuation:function(t){r(),e.writePunctuation(t);},writeKeyword:function(t){r(),e.writeKeyword(t);},writeOperator:function(t){r(),e.writeOperator(t);},writeParameter:function(t){r(),e.writeParameter(t);},writeSpace:function(t){r(),e.writeSpace(t);},writeProperty:function(t){r(),e.writeProperty(t);},writeComment:function(t){r(),e.writeComment(t);},writeLine:function(){r(),e.writeLine();},increaseIndent:function(){r(),e.increaseIndent();},decreaseIndent:function(){r(),e.decreaseIndent();}})},e.hostUsesCaseSensitiveFileNames=Zt,e.hostGetCanonicalFileName=function(t){return e.createGetCanonicalFileName(Zt(t))},e.getResolvedExternalModuleName=$t,e.getExternalModuleNameFromDeclaration=function(t,r,n){var i=r.getExternalModuleFileFromDeclaration(n);if(i&&!i.isDeclarationFile){var a=We(n);if(!a||!e.isStringLiteralLike(a)||e.pathIsRelative(a.text)||-1!==er(t,i.path).indexOf(er(t,e.ensureTrailingDirectorySeparator(t.getCommonSourceDirectory()))))return $t(t,i)}},e.getExternalModuleNameFromPath=tr,e.getOwnEmitOutputFilePath=function(e,t,r){var n=t.getCompilerOptions();return (n.outDir?ai(or(e,t,n.outDir)):ai(e))+r},e.getDeclarationEmitOutputFilePath=function(e,t){return rr(e,t.getCompilerOptions(),t.getCurrentDirectory(),t.getCommonSourceDirectory(),(function(e){return t.getCanonicalFileName(e)}))},e.getDeclarationEmitOutputFilePathWorker=rr,e.getDeclarationEmitExtensionForPath=nr,e.outFile=ir,e.getPathsBasePath=function(t,r){var n,i;if(t.paths)return null!==(n=t.baseUrl)&&void 0!==n?n:e.Debug.checkDefined(t.pathsBasePath||(null===(i=r.getCurrentDirectory)||void 0===i?void 0:i.call(r)),"Encountered 'paths' without a 'baseUrl', config file, or host 'getCurrentDirectory'.")},e.getSourceFilesToEmit=function(t,r,n){var i=t.getCompilerOptions();if(ir(i)){var a=Cn(i),o=i.emitDeclarationOnly||a===e.ModuleKind.AMD||a===e.ModuleKind.System;return e.filter(t.getSourceFiles(),(function(r){return (o||!e.isExternalModule(r))&&ar(r,t,n)}))}var s=void 0===r?t.getSourceFiles():[r];return e.filter(s,(function(e){return ar(e,t,n)}))},e.sourceFileMayBeEmitted=ar,e.getSourceFilePathInNewDir=or,e.getSourceFilePathInNewDirWorker=sr,e.writeFile=function(t,r,n,i,a,o){t.writeFile(n,i,a,(function(t){r.add(hn(e.Diagnostics.Could_not_write_file_0_Colon_1,n,t));}),o);},e.writeFileEnsuringDirectories=function(t,r,n,i,a,o){try{i(t,r,n);}catch(s){cr(e.getDirectoryPath(e.normalizePath(t)),a,o),i(t,r,n);}},e.getLineOfLocalPosition=function(t,r){var n=e.getLineStarts(t);return e.computeLineOfPosition(n,r)},e.getLineOfLocalPositionFromLineMap=lr,e.getFirstConstructorWithBody=ur,e.getSetAccessorValueParameter=_r,e.getSetAccessorTypeAnnotationNode=function(e){var t=_r(e);return t&&t.type},e.getThisParameter=function(t){if(t.parameters.length&&!e.isJSDocSignature(t)){var r=t.parameters[0];if(dr(r))return r}},e.parameterIsThisKeyword=dr,e.isThisIdentifier=pr,e.isThisInTypeQuery=function(t){if(!pr(t))return !1;for(;e.isQualifiedName(t.parent)&&t.parent.left===t;)t=t.parent;return 180===t.parent.kind},e.identifierIsThisKeyword=fr,e.getAllAccessorDeclarations=function(t,r){var n,i,a,o;return St(r)?(n=r,171===r.kind?a=r:172===r.kind?o=r:e.Debug.fail("Accessor has wrong kind")):e.forEach(t,(function(t){e.isAccessor(t)&&Sr(t)===Sr(r)&&Ct(t.name)===Ct(r.name)&&(n?i||(i=t):n=t,171!==t.kind||a||(a=t),172!==t.kind||o||(o=t));})),{firstAccessor:n,secondAccessor:i,getAccessor:a,setAccessor:o}},e.getEffectiveTypeAnnotationNode=gr,e.getTypeAnnotationNode=function(e){return e.type},e.getEffectiveReturnTypeNode=function(t){return e.isJSDocSignature(t)?t.type&&t.type.typeExpression&&t.type.typeExpression.type:t.type||(xe(t)?e.getJSDocReturnType(t):void 0)},e.getJSDocTypeParameterDeclarations=function(t){return e.flatMap(e.getJSDocTags(t),(function(t){return function(t){return e.isJSDocTemplateTag(t)&&!(318===t.parent.kind&&t.parent.tags.some(He))}(t)?t.typeParameters:void 0}))},e.getEffectiveSetAccessorTypeAnnotationNode=function(e){var t=_r(e);return t&&gr(t)},e.emitNewLineBeforeLeadingComments=mr,e.emitNewLineBeforeLeadingCommentsOfPosition=yr,e.emitNewLineBeforeLeadingCommentOfPosition=function(e,t,r,n){r!==n&&lr(e,r)!==lr(e,n)&&t.writeLine();},e.emitComments=vr,e.emitDetachedComments=function(t,r,n,i,a,o,s){var c,l;if(s?0===a.pos&&(c=e.filter(e.getLeadingCommentRanges(t,a.pos),(function(e){return y(t,e.pos)}))):c=e.getLeadingCommentRanges(t,a.pos),c){for(var u=[],_=void 0,d=0,p=c;d<p.length;d++){var f=p[d];if(_){var g=lr(r,_.end);if(lr(r,f.pos)>=g+2)break}u.push(f),_=f;}u.length&&(g=lr(r,e.last(u).end),lr(r,e.skipTrivia(t,a.pos))>=g+2&&(mr(r,n,a,c),vr(t,r,n,u,!1,!0,o,i),l={nodePos:a.pos,detachedCommentEndPos:e.last(u).end}));}return l},e.writeCommentRange=function(t,r,n,i,a,o){if(42===t.charCodeAt(i+1))for(var s=e.computeLineAndCharacterOfPosition(r,i),c=r.length,l=void 0,u=i,_=s.line;u<a;_++){var d=_+1===c?t.length+1:r[_+1];if(u!==i){void 0===l&&(l=br(t,r[s.line],i));var p=n.getIndent()*Yt()-l+br(t,u,d);if(p>0){var f=p%Yt(),g=Xt((p-f)/Yt());for(n.rawWrite(g);f;)n.rawWrite(" "),f--;}else n.rawWrite("");}hr(t,a,n,o,u,d),u=d;}else n.writeComment(t.substring(i,a));},e.hasEffectiveModifiers=function(e){return 0!==Fr(e)},e.hasSyntacticModifiers=function(e){return 0!==Ar(e)},e.hasEffectiveModifier=xr,e.hasSyntacticModifier=Dr,e.isStatic=Sr,e.hasStaticModifier=Tr,e.hasOverrideModifier=function(e){return xr(e,16384)},e.hasAbstractModifier=function(e){return Dr(e,128)},e.hasAmbientModifier=function(e){return Dr(e,2)},e.hasEffectiveReadonlyModifier=Cr,e.getSelectedEffectiveModifierFlags=Er,e.getSelectedSyntacticModifierFlags=kr,e.getEffectiveModifierFlags=Fr,e.getEffectiveModifierFlagsAlwaysIncludeJSDoc=function(e){return Nr(e,!0,!0)},e.getSyntacticModifierFlags=Ar,e.getEffectiveModifierFlagsNoCache=function(e){return wr(e)|Pr(e)},e.getSyntacticModifierFlagsNoCache=wr,e.modifiersToFlags=Ir,e.modifierToFlag=Or,e.createModifiers=function(t){return t?e.factory.createNodeArray(e.factory.createModifiersFromModifierFlags(t)):void 0},e.isLogicalOperator=function(e){return 56===e||55===e||53===e},e.isLogicalOrCoalescingAssignmentOperator=Mr,e.isLogicalOrCoalescingAssignmentExpression=function(e){return Mr(e.operatorToken.kind)},e.isAssignmentOperator=Lr,e.tryGetClassExtendingExpressionWithTypeArguments=Rr,e.tryGetClassImplementingOrExtendingExpressionWithTypeArguments=Br,e.isAssignmentExpression=jr,e.isLeftHandSideOfAssignment=function(e){return jr(e.parent)&&e.parent.left===e},e.isDestructuringAssignment=function(e){if(jr(e,!0)){var t=e.left.kind;return 204===t||203===t}return !1},e.isExpressionWithTypeArgumentsInClassExtendsClause=Jr,e.isEntityNameExpression=zr,e.getFirstIdentifier=function(e){switch(e.kind){case 79:return e;case 160:do{e=e.left;}while(79!==e.kind);return e;case 205:do{e=e.expression;}while(79!==e.kind);return e}},e.isDottedName=function e(t){return 79===t.kind||108===t.kind||106===t.kind||230===t.kind||205===t.kind&&e(t.expression)||211===t.kind&&e(t.expression)},e.isPropertyAccessEntityNameExpression=Ur,e.tryGetPropertyAccessOrIdentifierToString=function t(r){if(e.isPropertyAccessExpression(r)){if(void 0!==(n=t(r.expression)))return n+"."+B(r.name)}else if(e.isElementAccessExpression(r)){var n;if(void 0!==(n=t(r.expression))&&e.isPropertyName(r.argumentExpression))return n+"."+Ct(r.argumentExpression)}else if(e.isIdentifier(r))return e.unescapeLeadingUnderscores(r.escapedText)},e.isPrototypeAccess=Kr,e.isRightSideOfQualifiedNameOrPropertyAccess=function(e){return 160===e.parent.kind&&e.parent.right===e||205===e.parent.kind&&e.parent.name===e},e.isRightSideOfQualifiedNameOrPropertyAccessOrJSDocMemberName=function(t){return e.isQualifiedName(t.parent)&&t.parent.right===t||e.isPropertyAccessExpression(t.parent)&&t.parent.name===t||e.isJSDocMemberName(t.parent)&&t.parent.right===t},e.isEmptyObjectLiteral=function(e){return 204===e.kind&&0===e.properties.length},e.isEmptyArrayLiteral=function(e){return 203===e.kind&&0===e.elements.length},e.getLocalSymbolForExportDefault=function(t){if(function(t){return t&&e.length(t.declarations)>0&&Dr(t.declarations[0],512)}(t)&&t.declarations)for(var r=0,n=t.declarations;r<n.length;r++){var i=n[r];if(i.localSymbol)return i.localSymbol}},e.tryExtractTSExtension=function(t){return e.find(Zn,(function(r){return e.fileExtensionIs(t,r)}))};var Vr,qr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function Wr(t){for(var r,n,i,a,o="",s=function(t){for(var r=[],n=t.length,i=0;i<n;i++){var a=t.charCodeAt(i);a<128?r.push(a):a<2048?(r.push(a>>6|192),r.push(63&a|128)):a<65536?(r.push(a>>12|224),r.push(a>>6&63|128),r.push(63&a|128)):a<131072?(r.push(a>>18|240),r.push(a>>12&63|128),r.push(a>>6&63|128),r.push(63&a|128)):e.Debug.assert(!1,"Unexpected code point");}return r}(t),c=0,l=s.length;c<l;)r=s[c]>>2,n=(3&s[c])<<4|s[c+1]>>4,i=(15&s[c+1])<<2|s[c+2]>>6,a=63&s[c+2],c+1>=l?i=a=64:c+2>=l&&(a=64),o+=qr.charAt(r)+qr.charAt(n)+qr.charAt(i)+qr.charAt(a),c+=3;return o}function Hr(t,r){return void 0===r&&(r=t),e.Debug.assert(r>=t||-1===r),{pos:t,end:r}}function Gr(e,t){return Hr(t,e.end)}function Qr(e){return e.decorators&&e.decorators.length>0?Gr(e,e.decorators.end):e}function Xr(e,t,r){return Yr(Zr(e,r,!1),t.end,r)}function Yr(t,r,n){return 0===e.getLinesBetweenPositions(n,t,r)}function Zr(t,r,n){return li(t.pos)?-1:e.skipTrivia(r.text,t.pos,!1,n)}function $r(e){return void 0!==e.initializer}function en(e){return 33554432&e.flags?e.checkFlags:0}function tn(t){var r=t.parent;if(!r)return 0;switch(r.kind){case 211:return tn(r);case 219:case 218:var n=r.operator;return 45===n||46===n?c():0;case 220:var i=r,a=i.left,o=i.operatorToken;return a===t&&Lr(o.kind)?63===o.kind?1:c():0;case 205:return r.name!==t?0:tn(r);case 294:var s=tn(r.parent);return t===r.name?function(t){switch(t){case 0:return 1;case 1:return 0;case 2:return 2;default:return e.Debug.assertNever(t)}}(s):s;case 295:return t===r.objectAssignmentInitializer?0:tn(r.parent);case 203:return tn(r);default:return 0}function c(){return r.parent&&237===ct(r.parent).kind?1:2}}function rn(e,t,r){var n=r.onDeleteValue,i=r.onExistingValue;e.forEach((function(r,a){var o=t.get(a);void 0===o?(e.delete(a),n(r,a)):i&&i(r,o,a);}));}function nn(t){var r;return null===(r=t.declarations)||void 0===r?void 0:r.find(e.isClassLike)}function an(e){return 205===e.kind||206===e.kind}function on(e){for(;an(e);)e=e.expression;return e}function sn(e,t){this.flags=e,this.escapedName=t,this.declarations=void 0,this.valueDeclaration=void 0,this.id=void 0,this.mergeId=void 0,this.parent=void 0;}function cn(t,r){this.flags=r,(e.Debug.isDebugging||e.tracing)&&(this.checker=t);}function ln(t,r){this.flags=r,e.Debug.isDebugging&&(this.checker=t);}function un(e,t,r){this.pos=t,this.end=r,this.kind=e,this.id=0,this.flags=0,this.modifierFlagsCache=0,this.transformFlags=0,this.parent=void 0,this.original=void 0;}function _n(e,t,r){this.pos=t,this.end=r,this.kind=e,this.id=0,this.flags=0,this.transformFlags=0,this.parent=void 0;}function dn(e,t,r){this.pos=t,this.end=r,this.kind=e,this.id=0,this.flags=0,this.transformFlags=0,this.parent=void 0,this.original=void 0,this.flowNode=void 0;}function pn(e,t,r){this.fileName=e,this.text=t,this.skipTrivia=r||function(e){return e};}function fn(t,r,n){return void 0===n&&(n=0),t.replace(/{(\d+)}/g,(function(t,i){return ""+e.Debug.checkDefined(r[+i+n])}))}function gn(t){return e.localizedDiagnosticMessages&&e.localizedDiagnosticMessages[t.key]||t.message}function mn(e){return void 0===e.file&&void 0!==e.start&&void 0!==e.length&&"string"==typeof e.fileName}function yn(t,r){var n=r.fileName||"",i=r.text.length;e.Debug.assertEqual(t.fileName,n),e.Debug.assertLessThanOrEqual(t.start,i),e.Debug.assertLessThanOrEqual(t.start+t.length,i);var a={file:r,start:t.start,length:t.length,messageText:t.messageText,category:t.category,code:t.code,reportsUnnecessary:t.reportsUnnecessary};if(t.relatedInformation){a.relatedInformation=[];for(var o=0,s=t.relatedInformation;o<s.length;o++){var c=s[o];mn(c)&&c.fileName===n?(e.Debug.assertLessThanOrEqual(c.start,i),e.Debug.assertLessThanOrEqual(c.start+c.length,i),a.relatedInformation.push(yn(c,r))):a.relatedInformation.push(c);}}return a}function vn(e,t,r,n){J(e,t,r);var i=gn(n);return arguments.length>4&&(i=fn(i,arguments,4)),{file:e,start:t,length:r,messageText:i,category:n.category,code:n.code,reportsUnnecessary:n.reportsUnnecessary,reportsDeprecated:n.reportsDeprecated}}function hn(e){var t=gn(e);return arguments.length>1&&(t=fn(t,arguments,1)),{file:void 0,start:void 0,length:void 0,messageText:t,category:e.category,code:e.code,reportsUnnecessary:e.reportsUnnecessary,reportsDeprecated:e.reportsDeprecated}}function bn(e){return e.file?e.file.path:void 0}function xn(t,r){return Dn(t,r)||function(t,r){return t.relatedInformation||r.relatedInformation?t.relatedInformation&&r.relatedInformation?e.compareValues(t.relatedInformation.length,r.relatedInformation.length)||e.forEach(t.relatedInformation,(function(e,t){return xn(e,r.relatedInformation[t])}))||0:t.relatedInformation?-1:1:0}(t,r)||0}function Dn(t,r){return e.compareStringsCaseSensitive(bn(t),bn(r))||e.compareValues(t.start,r.start)||e.compareValues(t.length,r.length)||e.compareValues(t.code,r.code)||Sn(t.messageText,r.messageText)||0}function Sn(t,r){if("string"==typeof t&&"string"==typeof r)return e.compareStringsCaseSensitive(t,r);if("string"==typeof t)return -1;if("string"==typeof r)return 1;var n=e.compareStringsCaseSensitive(t.messageText,r.messageText);if(n)return n;if(!t.next&&!r.next)return 0;if(!t.next)return -1;if(!r.next)return 1;for(var i=Math.min(t.next.length,r.next.length),a=0;a<i;a++)if(n=Sn(t.next[a],r.next[a]))return n;return t.next.length<r.next.length?-1:t.next.length>r.next.length?1:0}function Tn(t){return t.target||t.module===e.ModuleKind.Node12&&7||t.module===e.ModuleKind.NodeNext&&99||0}function Cn(t){return "number"==typeof t.module?t.module:Tn(t)>=2?e.ModuleKind.ES2015:e.ModuleKind.CommonJS}function En(t){if(void 0!==t.esModuleInterop)return t.esModuleInterop;switch(Cn(t)){case e.ModuleKind.Node12:case e.ModuleKind.NodeNext:return !0}}function kn(e){return !(!e.declaration&&!e.composite)}function Nn(e,t){return void 0===e[t]?!!e.strict:!!e[t]}function Fn(e){return void 0===e.allowJs?!!e.checkJs:e.allowJs}function An(e,t){return t.strictFlag?Nn(e,t.name):e[t.name]}function Pn(t,r,n,i){for(var a=e.getPathComponents(e.getNormalizedAbsolutePath(t,n)),o=e.getPathComponents(e.getNormalizedAbsolutePath(r,n)),s=!1;a.length>=2&&o.length>=2&&!wn(a[a.length-2],i)&&!wn(o[o.length-2],i)&&i(a[a.length-1])===i(o[o.length-1]);)a.pop(),o.pop(),s=!0;return s?[e.getPathFromPathComponents(a),e.getPathFromPathComponents(o)]:void 0}function wn(t,r){return void 0!==t&&("node_modules"===r(t)||e.startsWith(t,"@"))}e.convertToBase64=Wr,e.base64encode=function(e,t){return e&&e.base64encode?e.base64encode(t):Wr(t)},e.base64decode=function(e,t){if(e&&e.base64decode)return e.base64decode(t);for(var r=t.length,n=[],i=0;i<r&&t.charCodeAt(i)!==qr.charCodeAt(64);){var a=qr.indexOf(t[i]),o=qr.indexOf(t[i+1]),s=qr.indexOf(t[i+2]),c=qr.indexOf(t[i+3]),l=(63&a)<<2|o>>4&3,u=(15&o)<<4|s>>2&15,_=(3&s)<<6|63&c;0===u&&0!==s?n.push(l):0===_&&0!==c?n.push(l,u):n.push(l,u,_),i+=4;}return function(e){for(var t="",r=0,n=e.length;r<n;){var i=e[r];if(i<128)t+=String.fromCharCode(i),r++;else if(192==(192&i)){for(var a=63&i,o=e[++r];128==(192&o);)a=a<<6|63&o,o=e[++r];t+=String.fromCharCode(a);}else t+=String.fromCharCode(i),r++;}return t}(n)},e.readJson=function(t,r){try{var n=r.readFile(t);if(!n)return {};var i=e.parseConfigFileTextToJson(t,n);return i.error?{}:i.config}catch(e){return {}}},e.directoryProbablyExists=function(e,t){return !t.directoryExists||t.directoryExists(e)},e.getNewLineCharacter=function(t,r){switch(t.newLine){case 0:return "\r\n";case 1:return "\n"}return r?r():e.sys?e.sys.newLine:"\r\n"},e.createRange=Hr,e.moveRangeEnd=function(e,t){return Hr(e.pos,t)},e.moveRangePos=Gr,e.moveRangePastDecorators=Qr,e.moveRangePastModifiers=function(e){return e.modifiers&&e.modifiers.length>0?Gr(e,e.modifiers.end):Qr(e)},e.isCollapsedRange=function(e){return e.pos===e.end},e.createTokenRange=function(t,r){return Hr(t,t+e.tokenToString(r).length)},e.rangeIsOnSingleLine=function(e,t){return Xr(e,e,t)},e.rangeStartPositionsAreOnSameLine=function(e,t,r){return Yr(Zr(e,r,!1),Zr(t,r,!1),r)},e.rangeEndPositionsAreOnSameLine=function(e,t,r){return Yr(e.end,t.end,r)},e.rangeStartIsOnSameLineAsRangeEnd=Xr,e.rangeEndIsOnSameLineAsRangeStart=function(e,t,r){return Yr(e.end,Zr(t,r,!1),r)},e.getLinesBetweenRangeEndAndRangeStart=function(t,r,n,i){var a=Zr(r,n,i);return e.getLinesBetweenPositions(n,t.end,a)},e.getLinesBetweenRangeEndPositions=function(t,r,n){return e.getLinesBetweenPositions(n,t.end,r.end)},e.isNodeArrayMultiLine=function(e,t){return !Yr(e.pos,e.end,t)},e.positionsAreOnSameLine=Yr,e.getStartPositionOfRange=Zr,e.getLinesBetweenPositionAndPrecedingNonWhitespaceCharacter=function(t,r,n,i){var a=e.skipTrivia(n.text,t,!1,i),o=function(t,r,n){for(void 0===r&&(r=0);t-- >r;)if(!e.isWhiteSpaceLike(n.text.charCodeAt(t)))return t}(a,r,n);return e.getLinesBetweenPositions(n,null!=o?o:r,a)},e.getLinesBetweenPositionAndNextNonWhitespaceCharacter=function(t,r,n,i){var a=e.skipTrivia(n.text,t,!1,i);return e.getLinesBetweenPositions(n,t,Math.min(r,a))},e.isDeclarationNameOfEnumOrNamespace=function(t){var r=e.getParseTreeNode(t);if(r)switch(r.parent.kind){case 259:case 260:return r===r.parent.name}return !1},e.getInitializedVariables=function(t){return e.filter(t.declarations,$r)},e.isWatchSet=function(e){return e.watch&&e.hasOwnProperty("watch")},e.closeFileWatcher=function(e){e.close();},e.getCheckFlags=en,e.getDeclarationModifierFlagsFromSymbol=function(t,r){if(void 0===r&&(r=!1),t.valueDeclaration){var n=r&&t.declarations&&e.find(t.declarations,(function(e){return 172===e.kind}))||t.valueDeclaration,i=e.getCombinedModifierFlags(n);return t.parent&&32&t.parent.flags?i:-29&i}if(6&en(t)){var a=t.checkFlags;return (1024&a?8:256&a?4:16)|(2048&a?32:0)}return 4194304&t.flags?36:0},e.skipAlias=function(e,t){return 2097152&e.flags?t.getAliasedSymbol(e):e},e.getCombinedLocalAndExportSymbolFlags=function(e){return e.exportSymbol?e.exportSymbol.flags|e.flags:e.flags},e.isWriteOnlyAccess=function(e){return 1===tn(e)},e.isWriteAccess=function(e){return 0!==tn(e)},function(e){e[e.Read=0]="Read",e[e.Write=1]="Write",e[e.ReadWrite=2]="ReadWrite";}(Vr||(Vr={})),e.compareDataObjects=function e(t,r){if(!t||!r||Object.keys(t).length!==Object.keys(r).length)return !1;for(var n in t)if("object"==typeof t[n]){if(!e(t[n],r[n]))return !1}else if("function"!=typeof t[n]&&t[n]!==r[n])return !1;return !0},e.clearMap=function(e,t){e.forEach(t),e.clear();},e.mutateMapSkippingNewValues=rn,e.mutateMap=function(e,t,r){rn(e,t,r);var n=r.createNewValue;t.forEach((function(t,r){e.has(r)||e.set(r,n(r,t));}));},e.isAbstractConstructorSymbol=function(e){if(32&e.flags){var t=nn(e);return !!t&&Dr(t,128)}return !1},e.getClassLikeDeclarationOfSymbol=nn,e.getObjectFlags=function(e){return 3899393&e.flags?e.objectFlags:0},e.typeHasCallOrConstructSignatures=function(e,t){return 0!==t.getSignaturesOfType(e,0).length||0!==t.getSignaturesOfType(e,1).length},e.forSomeAncestorDirectory=function(t,r){return !!e.forEachAncestorDirectory(t,(function(e){return !!r(e)||void 0}))},e.isUMDExportSymbol=function(t){return !!t&&!!t.declarations&&!!t.declarations[0]&&e.isNamespaceExportDeclaration(t.declarations[0])},e.showModuleSpecifier=function(t){var r=t.moduleSpecifier;return e.isStringLiteral(r)?r.text:x(r)},e.getLastChild=function(t){var r;return e.forEachChild(t,(function(e){p(e)&&(r=e);}),(function(e){for(var t=e.length-1;t>=0;t--)if(p(e[t])){r=e[t];break}})),r},e.addToSeen=function(e,t,r){return void 0===r&&(r=!0),!e.has(t)&&(e.set(t,r),!0)},e.isObjectTypeDeclaration=function(t){return e.isClassLike(t)||e.isInterfaceDeclaration(t)||e.isTypeLiteralNode(t)},e.isTypeNodeKind=function(e){return e>=176&&e<=199||130===e||154===e||146===e||157===e||147===e||133===e||149===e||150===e||114===e||152===e||143===e||227===e||310===e||311===e||312===e||313===e||314===e||315===e||316===e},e.isAccessExpression=an,e.getNameOfAccessExpression=function(t){return 205===t.kind?t.name:(e.Debug.assert(206===t.kind),t.argumentExpression)},e.isBundleFileTextLike=function(e){switch(e.kind){case"text":case"internal":return !0;default:return !1}},e.isNamedImportsOrExports=function(e){return 268===e.kind||272===e.kind},e.getLeftmostAccessExpression=on,e.getLeftmostExpression=function(e,t){for(;;){switch(e.kind){case 219:e=e.operand;continue;case 220:e=e.left;continue;case 221:e=e.condition;continue;case 209:e=e.tag;continue;case 207:if(t)return e;case 228:case 206:case 205:case 229:case 348:e=e.expression;continue}return e}},e.objectAllocator={getNodeConstructor:function(){return un},getTokenConstructor:function(){return _n},getIdentifierConstructor:function(){return dn},getPrivateIdentifierConstructor:function(){return un},getSourceFileConstructor:function(){return un},getSymbolConstructor:function(){return sn},getTypeConstructor:function(){return cn},getSignatureConstructor:function(){return ln},getSourceMapSourceConstructor:function(){return pn}},e.setObjectAllocator=function(t){e.objectAllocator=t;},e.formatStringFromArgs=fn,e.setLocalizedDiagnosticMessages=function(t){e.localizedDiagnosticMessages=t;},e.getLocaleSpecificMessage=gn,e.createDetachedDiagnostic=function(e,t,r,n){J(void 0,t,r);var i=gn(n);return arguments.length>4&&(i=fn(i,arguments,4)),{file:void 0,start:t,length:r,messageText:i,category:n.category,code:n.code,reportsUnnecessary:n.reportsUnnecessary,fileName:e}},e.attachFileToDiagnostics=function(e,t){for(var r=[],n=0,i=e;n<i.length;n++){var a=i[n];r.push(yn(a,t));}return r},e.createFileDiagnostic=vn,e.formatMessage=function(e,t){var r=gn(t);return arguments.length>2&&(r=fn(r,arguments,2)),r},e.createCompilerDiagnostic=hn,e.createCompilerDiagnosticFromMessageChain=function(e,t){return {file:void 0,start:void 0,length:void 0,code:e.code,category:e.category,messageText:e.next?e:e.messageText,relatedInformation:t}},e.chainDiagnosticMessages=function(e,t){var r=gn(t);return arguments.length>2&&(r=fn(r,arguments,2)),{messageText:r,category:t.category,code:t.code,next:void 0===e||Array.isArray(e)?e:[e]}},e.concatenateDiagnosticMessageChains=function(e,t){for(var r=e;r.next;)r=r.next[0];r.next=[t];},e.compareDiagnostics=xn,e.compareDiagnosticsSkipRelatedInformation=Dn,e.getLanguageVariant=function(e){return 4===e||2===e||1===e||6===e?1:0},e.getEmitScriptTarget=Tn,e.getEmitModuleKind=Cn,e.getEmitModuleResolutionKind=function(t){var r=t.moduleResolution;if(void 0===r)switch(Cn(t)){case e.ModuleKind.CommonJS:r=e.ModuleResolutionKind.NodeJs;break;case e.ModuleKind.Node12:r=e.ModuleResolutionKind.Node12;break;case e.ModuleKind.NodeNext:r=e.ModuleResolutionKind.NodeNext;break;default:r=e.ModuleResolutionKind.Classic;}return r},e.hasJsonModuleEmitEnabled=function(t){switch(Cn(t)){case e.ModuleKind.CommonJS:case e.ModuleKind.AMD:case e.ModuleKind.ES2015:case e.ModuleKind.ES2020:case e.ModuleKind.ES2022:case e.ModuleKind.ESNext:case e.ModuleKind.Node12:case e.ModuleKind.NodeNext:return !0;default:return !1}},e.unreachableCodeIsError=function(e){return !1===e.allowUnreachableCode},e.unusedLabelIsError=function(e){return !1===e.allowUnusedLabels},e.getAreDeclarationMapsEnabled=function(e){return !(!kn(e)||!e.declarationMap)},e.getESModuleInterop=En,e.getAllowSyntheticDefaultImports=function(t){var r=Cn(t);return void 0!==t.allowSyntheticDefaultImports?t.allowSyntheticDefaultImports:En(t)||r===e.ModuleKind.System},e.getEmitDeclarations=kn,e.shouldPreserveConstEnums=function(e){return !(!e.preserveConstEnums&&!e.isolatedModules)},e.isIncrementalCompilation=function(e){return !(!e.incremental&&!e.composite)},e.getStrictOptionValue=Nn,e.getAllowJSCompilerOption=Fn,e.getUseDefineForClassFields=function(e){return void 0===e.useDefineForClassFields?99===Tn(e):e.useDefineForClassFields},e.compilerOptionsAffectSemanticDiagnostics=function(t,r){return c(r,t,e.semanticDiagnosticsOptionDeclarations)},e.compilerOptionsAffectEmit=function(t,r){return c(r,t,e.affectsEmitOptionDeclarations)},e.getCompilerOptionValue=An,e.getJSXTransformEnabled=function(e){var t=e.jsx;return 2===t||4===t||5===t},e.getJSXImplicitImportBase=function(t,r){var n=null==r?void 0:r.pragmas.get("jsximportsource"),i=e.isArray(n)?n[n.length-1]:n;return 4===t.jsx||5===t.jsx||t.jsxImportSource||i?(null==i?void 0:i.arguments.factory)||t.jsxImportSource||"react":void 0},e.getJSXRuntimeImport=function(e,t){return e?"".concat(e,"/").concat(5===t.jsx?"jsx-dev-runtime":"jsx-runtime"):void 0},e.hasZeroOrOneAsteriskCharacter=function(e){for(var t=!1,r=0;r<e.length;r++)if(42===e.charCodeAt(r)){if(t)return !1;t=!0;}return !0},e.createSymlinkCache=function(t,r){var n,i,a,o=!1;return {getSymlinkedFiles:function(){return a},getSymlinkedDirectories:function(){return n},getSymlinkedDirectoriesByRealpath:function(){return i},setSymlinkedFile:function(t,r){return (a||(a=new e.Map)).set(t,r)},setSymlinkedDirectory:function(a,o){var s=e.toPath(a,t,r);vi(s)||(s=e.ensureTrailingDirectorySeparator(s),!1===o||(null==n?void 0:n.has(s))||(i||(i=e.createMultiMap())).add(e.ensureTrailingDirectorySeparator(o.realPath),a),(n||(n=new e.Map)).set(s,o));},setSymlinkedDirectoryFromSymlinkedFile:function(n,i){this.setSymlinkedFile(e.toPath(n,t,r),i);var a=Pn(i,n,t,r)||e.emptyArray,o=a[0],s=a[1];o&&s&&this.setSymlinkedDirectory(s,{real:o,realPath:e.toPath(o,t,r)});},setSymlinksFromResolutions:function(t,r){var n,i=this;e.Debug.assert(!o),o=!0;for(var a=0,c=t;a<c.length;a++)null===(n=c[a].resolvedModules)||void 0===n||n.forEach((function(e){return s(i,e)}));null==r||r.forEach((function(e){return s(i,e)}));},hasProcessedResolutions:function(){return o}};function s(n,i){if(i&&i.originalPath&&i.resolvedFileName){var a=i.resolvedFileName,o=i.originalPath;n.setSymlinkedFile(e.toPath(o,t,r),a);var s=Pn(a,o,t,r)||e.emptyArray,c=s[0],l=s[1];c&&l&&n.setSymlinkedDirectory(l,{real:c,realPath:e.toPath(c,t,r)});}}},e.tryRemoveDirectoryPrefix=function(t,r,n){var i,a=e.tryRemovePrefix(t,r,n);return void 0===a?void 0:(i=a,e.isAnyDirectorySeparator(i.charCodeAt(0))?i.slice(1):void 0)};var In=/[^\w\s\/]/g;function On(e){return "\\"+e}e.regExpEscape=function(e){return e.replace(In,On)};var Mn=[42,63];e.commonPackageFolders=["node_modules","bower_components","jspm_packages"];var Ln="(?!(".concat(e.commonPackageFolders.join("|"),")(/|$))"),Rn={singleAsteriskRegexFragment:"([^./]|(\\.(?!min\\.js$))?)*",doubleAsteriskRegexFragment:"(/".concat(Ln,"[^/.][^/]*)*?"),replaceWildcardCharacter:function(e){return qn(e,Rn.singleAsteriskRegexFragment)}},Bn={singleAsteriskRegexFragment:"[^/]*",doubleAsteriskRegexFragment:"(/".concat(Ln,"[^/.][^/]*)*?"),replaceWildcardCharacter:function(e){return qn(e,Bn.singleAsteriskRegexFragment)}},jn={singleAsteriskRegexFragment:"[^/]*",doubleAsteriskRegexFragment:"(/.+?)?",replaceWildcardCharacter:function(e){return qn(e,jn.singleAsteriskRegexFragment)}},Jn={files:Rn,directories:Bn,exclude:jn};function zn(e,t,r){var n=Un(e,t,r);if(n&&n.length){var i=n.map((function(e){return "(".concat(e,")")})).join("|"),a="exclude"===r?"($|/)":"$";return "^(".concat(i,")").concat(a)}}function Un(t,r,n){if(void 0!==t&&0!==t.length)return e.flatMap(t,(function(e){return e&&Vn(e,r,n,Jn[n])}))}function Kn(e){return !/[.*?]/.test(e)}function Vn(t,r,n,i){var a=i.singleAsteriskRegexFragment,o=i.doubleAsteriskRegexFragment,s=i.replaceWildcardCharacter,c="",l=!1,u=e.getNormalizedPathComponents(t,r),_=e.last(u);if("exclude"===n||"**"!==_){u[0]=e.removeTrailingDirectorySeparator(u[0]),Kn(_)&&u.push("**","*");for(var d=0,p=0,f=u;p<f.length;p++){var g=f[p];if("**"===g)c+=o;else if("directories"===n&&(c+="(",d++),l&&(c+=e.directorySeparator),"exclude"!==n){var m="";42===g.charCodeAt(0)?(m+="([^./]"+a+")?",g=g.substr(1)):63===g.charCodeAt(0)&&(m+="[^./]",g=g.substr(1)),(m+=g.replace(In,s))!==g&&(c+=Ln),c+=m;}else c+=g.replace(In,s);l=!0;}for(;d>0;)c+=")?",d--;return c}}function qn(e,t){return "*"===e?t:"?"===e?"[^/]":"\\"+e}function Wn(t,r,n,i,a){t=e.normalizePath(t),a=e.normalizePath(a);var o=e.combinePaths(a,t);return {includeFilePatterns:e.map(Un(n,o,"files"),(function(e){return "^".concat(e,"$")})),includeFilePattern:zn(n,o,"files"),includeDirectoryPattern:zn(n,o,"directories"),excludePattern:zn(r,o,"exclude"),basePaths:Gn(t,n,i)}}function Hn(e,t){return new RegExp(e,t?"":"i")}function Gn(t,r,n){var i=[t];if(r){for(var a=[],o=0,s=r;o<s.length;o++){var c=s[o],l=e.isRootedDiskPath(c)?c:e.normalizePath(e.combinePaths(t,c));a.push(Qn(l));}a.sort(e.getStringComparer(!n));for(var u=function(r){e.every(i,(function(i){return !e.containsPath(i,r,t,!n)}))&&i.push(r);},_=0,d=a;_<d.length;_++)u(d[_]);}return i}function Qn(t){var r=e.indexOfAnyCharCode(t,Mn);return r<0?e.hasExtension(t)?e.removeTrailingDirectorySeparator(e.getDirectoryPath(t)):t:t.substring(0,t.lastIndexOf(e.directorySeparator,r))}function Xn(e){switch(e.substr(e.lastIndexOf(".")).toLowerCase()){case".js":case".cjs":case".mjs":return 1;case".jsx":return 2;case".ts":case".cts":case".mts":return 3;case".tsx":return 4;case".json":return 6;default:return 0}}e.getRegularExpressionForWildcard=zn,e.getRegularExpressionsForWildcards=Un,e.isImplicitGlob=Kn,e.getPatternFromSpec=function(e,t,r){var n=e&&Vn(e,t,r,Jn[r]);return n&&"^(".concat(n,")").concat("exclude"===r?"($|/)":"$")},e.getFileMatcherPatterns=Wn,e.getRegexFromPattern=Hn,e.matchFiles=function(t,r,n,i,a,o,s,c,l){t=e.normalizePath(t),o=e.normalizePath(o);for(var u=Wn(t,n,i,a,o),_=u.includeFilePatterns&&u.includeFilePatterns.map((function(e){return Hn(e,a)})),d=u.includeDirectoryPattern&&Hn(u.includeDirectoryPattern,a),p=u.excludePattern&&Hn(u.excludePattern,a),f=_?_.map((function(){return []})):[[]],g=new e.Map,m=e.createGetCanonicalFileName(a),y=0,v=u.basePaths;y<v.length;y++){var h=v[y];b(h,e.combinePaths(o,h),s);}return e.flatten(f);function b(t,n,i){var a=m(l(n));if(!g.has(a)){g.set(a,!0);for(var o=c(t),s=o.files,u=o.directories,y=function(i){var a=e.combinePaths(t,i),o=e.combinePaths(n,i);if(r&&!e.fileExtensionIsOneOf(a,r))return "continue";if(p&&p.test(o))return "continue";if(_){var s=e.findIndex(_,(function(e){return e.test(o)}));-1!==s&&f[s].push(a);}else f[0].push(a);},v=0,h=e.sort(s,e.compareStringsCaseSensitive);v<h.length;v++)y(S=h[v]);if(void 0===i||0!=--i)for(var x=0,D=e.sort(u,e.compareStringsCaseSensitive);x<D.length;x++){var S=D[x],T=e.combinePaths(t,S),C=e.combinePaths(n,S);d&&!d.test(C)||p&&p.test(C)||b(T,C,i);}}}},e.ensureScriptKind=function(e,t){return t||Xn(e)||3},e.getScriptKindFromFileName=Xn,e.supportedTSExtensions=[[".ts",".tsx",".d.ts"],[".cts",".d.cts"],[".mts",".d.mts"]],e.supportedTSExtensionsFlat=e.flatten(e.supportedTSExtensions);var Yn=n$3(n$3([],e.supportedTSExtensions,!0),[[".json"]],!1),Zn=[".d.ts",".d.cts",".d.mts",".cts",".mts",".ts",".tsx",".cts",".mts"];e.supportedJSExtensions=[[".js",".jsx"],[".mjs"],[".cjs"]],e.supportedJSExtensionsFlat=e.flatten(e.supportedJSExtensions);var $n=[[".ts",".tsx",".d.ts",".js",".jsx"],[".cts",".d.cts",".cjs"],[".mts",".d.mts",".mjs"]],ei=n$3(n$3([],$n,!0),[[".json"]],!1);function ti(t,r){var i=t&&Fn(t);if(!r||0===r.length)return i?$n:e.supportedTSExtensions;var a=i?$n:e.supportedTSExtensions,o=e.flatten(a);return n$3(n$3([],a,!0),e.mapDefined(r,(function(e){return 7===e.scriptKind||i&&(1===(t=e.scriptKind)||2===t)&&-1===o.indexOf(e.extension)?[e.extension]:void 0;var t;})),!0)}function ri(t,r){return t&&t.resolveJsonModule?r===$n?ei:r===e.supportedTSExtensions?Yn:n$3(n$3([],r,!0),[[".json"]],!1):r}function ni(e){var t=e.match(/\//g);return t?t.length:0}e.getSupportedExtensions=ti,e.getSupportedExtensionsWithJsonIfResolveJsonModule=ri,e.hasJSFileExtension=function(t){return e.some(e.supportedJSExtensionsFlat,(function(r){return e.fileExtensionIs(t,r)}))},e.hasTSFileExtension=function(t){return e.some(e.supportedTSExtensionsFlat,(function(r){return e.fileExtensionIs(t,r)}))},e.isSupportedSourceFileName=function(t,r,n){if(!t)return !1;for(var i=ti(r,n),a=0,o=e.flatten(ri(r,i));a<o.length;a++){var s=o[a];if(e.fileExtensionIs(t,s))return !0}return !1},e.compareNumberOfDirectorySeparators=function(t,r){return e.compareValues(ni(t),ni(r))};var ii=[".d.ts",".d.mts",".d.cts",".mjs",".mts",".cjs",".cts",".ts",".js",".tsx",".jsx",".json"];function ai(e){for(var t=0,r=ii;t<r.length;t++){var n=oi(e,r[t]);if(void 0!==n)return n}return e}function oi(t,r){return e.fileExtensionIs(t,r)?si(t,r):void 0}function si(e,t){return e.substring(0,e.length-t.length)}function ci(e){var t=e.indexOf("*");return -1===t?e:-1!==e.indexOf("*",t+1)?void 0:{prefix:e.substr(0,t),suffix:e.substr(t+1)}}function li(e){return !(e>=0)}function ui(e){return ".ts"===e||".tsx"===e||".d.ts"===e||".cts"===e||".mts"===e||".d.mts"===e||".d.cts"===e}function _i(t){return e.find(ii,(function(r){return e.fileExtensionIs(t,r)}))}function di(t,r){return t===r||"object"==typeof t&&null!==t&&"object"==typeof r&&null!==r&&e.equalOwnProperties(t,r,di)}function pi(e,t){return e.pos=t,e}function fi(e,t){return e.end=t,e}function gi(e,t,r){return fi(pi(e,t),r)}function mi(e,t){return e&&t&&(e.parent=t),e}function yi(t){return !e.isOmittedExpression(t)}function vi(t){return e.some(e.ignoredPaths,(function(r){return e.stringContains(t,r)}))}function hi(e){return 253===e.kind&&291===e.parent.kind}e.removeFileExtension=ai,e.tryRemoveExtension=oi,e.removeExtension=si,e.changeExtension=function(t,r){return e.changeAnyExtension(t,r,ii,!1)},e.tryParsePattern=ci,e.tryParsePatterns=function(t){return e.mapDefined(e.getOwnKeys(t),(function(e){return ci(e)}))},e.positionIsSynthesized=li,e.extensionIsTS=ui,e.resolutionExtensionIsTSOrJson=function(e){return ui(e)||".json"===e},e.extensionFromPath=function(t){var r=_i(t);return void 0!==r?r:e.Debug.fail("File ".concat(t," has unknown extension."))},e.isAnySupportedFileExtension=function(e){return void 0!==_i(e)},e.tryGetExtensionFromPath=_i,e.isCheckJsEnabledForFile=function(e,t){return e.checkJsDirective?e.checkJsDirective.enabled:t.checkJs},e.emptyFileSystemEntries={files:e.emptyArray,directories:e.emptyArray},e.matchPatternOrExact=function(t,r){for(var n=[],i=0,a=t;i<a.length;i++){var o=a[i];if(o===r)return r;e.isString(o)||n.push(o);}return e.findBestPatternMatch(n,(function(e){return e}),r)},e.sliceAfter=function(t,r){var n=t.indexOf(r);return e.Debug.assert(-1!==n),t.slice(n)},e.addRelatedInfo=function(t){for(var r,n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];return n.length?(t.relatedInformation||(t.relatedInformation=[]),e.Debug.assert(t.relatedInformation!==e.emptyArray,"Diagnostic had empty array singleton for related info, but is still being constructed!"),(r=t.relatedInformation).push.apply(r,n),t):t},e.minAndMax=function(t,r){e.Debug.assert(0!==t.length);for(var n=r(t[0]),i=n,a=1;a<t.length;a++){var o=r(t[a]);o<n?n=o:o>i&&(i=o);}return {min:n,max:i}},e.rangeOfNode=function(e){return {pos:v(e),end:e.end}},e.rangeOfTypeParameters=function(t,r){return {pos:r.pos-1,end:e.skipTrivia(t.text,r.end)+1}},e.skipTypeChecking=function(e,t,r){return t.skipLibCheck&&e.isDeclarationFile||t.skipDefaultLibCheck&&e.hasNoDefaultLib||r.isSourceOfProjectReferenceRedirect(e.fileName)},e.isJsonEqual=di,e.parsePseudoBigInt=function(e){var t;switch(e.charCodeAt(1)){case 98:case 66:t=1;break;case 111:case 79:t=3;break;case 120:case 88:t=4;break;default:for(var r=e.length-1,n=0;48===e.charCodeAt(n);)n++;return e.slice(n,r)||"0"}for(var i=e.length-1,a=(i-2)*t,o=new Uint16Array((a>>>4)+(15&a?1:0)),s=i-1,c=0;s>=2;s--,c+=t){var l=c>>>4,u=e.charCodeAt(s),_=(u<=57?u-48:10+u-(u<=70?65:97))<<(15&c);o[l]|=_;var d=_>>>16;d&&(o[l+1]|=d);}for(var p="",f=o.length-1,g=!0;g;){var m=0;for(g=!1,l=f;l>=0;l--){var y=m<<16|o[l],v=y/10|0;o[l]=v,m=y-10*v,v&&!g&&(f=l,g=!0);}p=m+p;}return p},e.pseudoBigIntToString=function(e){var t=e.negative,r=e.base10Value;return (t&&"0"!==r?"-":"")+r},e.isValidTypeOnlyAliasUseSite=function(t){return !!(8388608&t.flags)||ve(t)||function(t){if(79!==t.kind)return !1;var r=e.findAncestor(t.parent,(function(e){switch(e.kind){case 290:return !0;case 205:case 227:return !1;default:return "quit"}}));return 117===(null==r?void 0:r.token)||257===(null==r?void 0:r.parent.kind)}(t)||function(e){for(;79===e.kind||205===e.kind;)e=e.parent;if(161!==e.kind)return !1;if(Dr(e.parent,128))return !0;var t=e.parent.parent.kind;return 257===t||181===t}(t)||!(me(t)||function(t){return e.isIdentifier(t)&&e.isShorthandPropertyAssignment(t.parent)&&t.parent.name===t}(t))},e.isIdentifierTypeReference=function(t){return e.isTypeReferenceNode(t)&&e.isIdentifier(t.typeName)},e.arrayIsHomogeneous=function(t,r){if(void 0===r&&(r=e.equateValues),t.length<2)return !0;for(var n=t[0],i=1,a=t.length;i<a;i++)if(!r(n,t[i]))return !1;return !0},e.setTextRangePos=pi,e.setTextRangeEnd=fi,e.setTextRangePosEnd=gi,e.setTextRangePosWidth=function(e,t,r){return gi(e,t,t+r)},e.setNodeFlags=function(e,t){return e&&(e.flags=t),e},e.setParent=mi,e.setEachParent=function(e,t){if(e)for(var r=0,n=e;r<n.length;r++)mi(n[r],t);return e},e.setParentRecursive=function(t,r){return t?(e.forEachChildRecursively(t,e.isJSDocNode(t)?n:function(t,r){return n(t,r)||function(t){if(e.hasJSDocNodes(t))for(var r=0,i=t.jsDoc;r<i.length;r++){var a=i[r];n(a,t),e.forEachChildRecursively(a,n);}}(t)}),t):t;function n(e,t){if(r&&e.parent===t)return "skip";mi(e,t);}},e.isPackedArrayLiteral=function(t){return e.isArrayLiteralExpression(t)&&e.every(t.elements,yi)},e.expressionResultIsUnused=function(t){for(e.Debug.assertIsDefined(t.parent);;){var r=t.parent;if(e.isParenthesizedExpression(r))t=r;else {if(e.isExpressionStatement(r)||e.isVoidExpression(r)||e.isForStatement(r)&&(r.initializer===t||r.incrementor===t))return !0;if(e.isCommaListExpression(r)){if(t!==e.last(r.elements))return !0;t=r;}else {if(!e.isBinaryExpression(r)||27!==r.operatorToken.kind)return !1;if(t===r.left)return !0;t=r;}}}},e.containsIgnoredPath=vi,e.getContainingNodeArray=function(t){if(t.parent){switch(t.kind){case 162:var r=t.parent;return 189===r.kind?void 0:r.typeParameters;case 163:return t.parent.parameters;case 198:case 232:return t.parent.templateSpans;case 164:return t.parent.decorators;case 290:return t.parent.heritageClauses}var n=t.parent;if(e.isJSDocTag(t))return e.isJSDocTypeLiteral(t.parent)?void 0:t.parent.tags;switch(n.kind){case 181:case 257:return e.isTypeElement(t)?n.members:void 0;case 186:case 187:return n.types;case 183:case 203:case 349:case 268:case 272:return n.elements;case 204:case 285:return n.properties;case 207:case 208:return e.isTypeNode(t)?n.typeArguments:n.expression===t?void 0:n.arguments;case 277:case 281:return e.isJsxChild(t)?n.children:void 0;case 279:case 278:return e.isTypeNode(t)?n.typeArguments:void 0;case 234:case 288:case 289:case 261:return n.statements;case 262:return n.clauses;case 256:case 225:return e.isClassElement(t)?n.members:void 0;case 259:return e.isEnumMember(t)?n.members:void 0;case 303:return n.statements}}},e.hasContextSensitiveParameters=function(t){if(!t.typeParameters){if(e.some(t.parameters,(function(e){return !gr(e)})))return !0;if(213!==t.kind){var r=e.firstOrUndefined(t.parameters);if(!r||!dr(r))return !0}}return !1},e.isInfinityOrNaNString=function(e){return "Infinity"===e||"-Infinity"===e||"NaN"===e},e.isCatchClauseVariableDeclaration=hi,e.isParameterOrCatchClauseVariable=function(t){var r=t.valueDeclaration&&Nt(t.valueDeclaration);return !!r&&(e.isParameter(r)||hi(r))},e.isFunctionExpressionOrArrowFunction=function(e){return 212===e.kind||213===e.kind},e.escapeSnippetText=function(e){return e.replace(/\$/gm,"\\$")};}(t),function(e){e.createBaseNodeFactory=function(){var t,r,n,i,a;return {createBaseSourceFileNode:function(t){return new(a||(a=e.objectAllocator.getSourceFileConstructor()))(t,-1,-1)},createBaseIdentifierNode:function(t){return new(n||(n=e.objectAllocator.getIdentifierConstructor()))(t,-1,-1)},createBasePrivateIdentifierNode:function(t){return new(i||(i=e.objectAllocator.getPrivateIdentifierConstructor()))(t,-1,-1)},createBaseTokenNode:function(t){return new(r||(r=e.objectAllocator.getTokenConstructor()))(t,-1,-1)},createBaseNode:function(r){return new(t||(t=e.objectAllocator.getNodeConstructor()))(r,-1,-1)}}};}(t),function(e){e.createParenthesizerRules=function(t){var r,n;return {getParenthesizeLeftSideOfBinaryForOperator:function(t){r||(r=new e.Map);var n=r.get(t);return n||(n=function(e){return o(t,e)},r.set(t,n)),n},getParenthesizeRightSideOfBinaryForOperator:function(t){n||(n=new e.Map);var r=n.get(t);return r||(r=function(e){return s(t,void 0,e)},n.set(t,r)),r},parenthesizeLeftSideOfBinary:o,parenthesizeRightSideOfBinary:s,parenthesizeExpressionOfComputedPropertyName:function(r){return e.isCommaSequence(r)?t.createParenthesizedExpression(r):r},parenthesizeConditionOfConditionalExpression:function(r){var n=e.getOperatorPrecedence(221,57),i=e.skipPartiallyEmittedExpressions(r),a=e.getExpressionPrecedence(i);return 1!==e.compareValues(a,n)?t.createParenthesizedExpression(r):r},parenthesizeBranchOfConditionalExpression:function(r){var n=e.skipPartiallyEmittedExpressions(r);return e.isCommaSequence(n)?t.createParenthesizedExpression(r):r},parenthesizeExpressionOfExportDefault:function(r){var n=e.skipPartiallyEmittedExpressions(r),i=e.isCommaSequence(n);if(!i)switch(e.getLeftmostExpression(n,!1).kind){case 225:case 212:i=!0;}return i?t.createParenthesizedExpression(r):r},parenthesizeExpressionOfNew:function(r){var n=e.getLeftmostExpression(r,!0);switch(n.kind){case 207:return t.createParenthesizedExpression(r);case 208:return n.arguments?r:t.createParenthesizedExpression(r)}return c(r)},parenthesizeLeftSideOfAccess:c,parenthesizeOperandOfPostfixUnary:function(r){return e.isLeftHandSideExpression(r)?r:e.setTextRange(t.createParenthesizedExpression(r),r)},parenthesizeOperandOfPrefixUnary:function(r){return e.isUnaryExpression(r)?r:e.setTextRange(t.createParenthesizedExpression(r),r)},parenthesizeExpressionsOfCommaDelimitedList:function(r){var n=e.sameMap(r,l);return e.setTextRange(t.createNodeArray(n,r.hasTrailingComma),r)},parenthesizeExpressionForDisallowedComma:l,parenthesizeExpressionOfExpressionStatement:function(r){var n=e.skipPartiallyEmittedExpressions(r);if(e.isCallExpression(n)){var i=n.expression,a=e.skipPartiallyEmittedExpressions(i).kind;if(212===a||213===a){var o=t.updateCallExpression(n,e.setTextRange(t.createParenthesizedExpression(i),i),n.typeArguments,n.arguments);return t.restoreOuterExpressions(r,o,8)}}var s=e.getLeftmostExpression(n,!1).kind;return 204===s||212===s?e.setTextRange(t.createParenthesizedExpression(r),r):r},parenthesizeConciseBodyOfArrowFunction:function(r){return e.isBlock(r)||!e.isCommaSequence(r)&&204!==e.getLeftmostExpression(r,!1).kind?r:e.setTextRange(t.createParenthesizedExpression(r),r)},parenthesizeMemberOfConditionalType:u,parenthesizeMemberOfElementType:_,parenthesizeElementTypeOfArrayType:function(e){switch(e.kind){case 180:case 192:case 189:return t.createParenthesizedType(e)}return _(e)},parenthesizeConstituentTypesOfUnionOrIntersectionType:function(r){return t.createNodeArray(e.sameMap(r,_))},parenthesizeTypeArguments:function(r){if(e.some(r))return t.createNodeArray(e.sameMap(r,d))}};function i(t){if(t=e.skipPartiallyEmittedExpressions(t),e.isLiteralKind(t.kind))return t.kind;if(220===t.kind&&39===t.operatorToken.kind){if(void 0!==t.cachedLiteralKind)return t.cachedLiteralKind;var r=i(t.left),n=e.isLiteralKind(r)&&r===i(t.right)?r:0;return t.cachedLiteralKind=n,n}return 0}function a(r,n,a,o){return 211===e.skipPartiallyEmittedExpressions(n).kind?n:function(t,r,n,a){var o=e.getOperatorPrecedence(220,t),s=e.getOperatorAssociativity(220,t),c=e.skipPartiallyEmittedExpressions(r);if(!n&&213===r.kind&&o>3)return !0;var l=e.getExpressionPrecedence(c);switch(e.compareValues(l,o)){case-1:return !(!n&&1===s&&223===r.kind);case 1:return !1;case 0:if(n)return 1===s;if(e.isBinaryExpression(c)&&c.operatorToken.kind===t){if(function(e){return 41===e||51===e||50===e||52===e}(t))return !1;if(39===t){var u=a?i(a):0;if(e.isLiteralKind(u)&&u===i(c))return !1}}return 0===e.getExpressionAssociativity(c)}}(r,n,a,o)?t.createParenthesizedExpression(n):n}function o(e,t){return a(e,t,!0)}function s(e,t,r){return a(e,r,!1,t)}function c(r){var n=e.skipPartiallyEmittedExpressions(r);return e.isLeftHandSideExpression(n)&&(208!==n.kind||n.arguments)?r:e.setTextRange(t.createParenthesizedExpression(r),r)}function l(r){var n=e.skipPartiallyEmittedExpressions(r);return e.getExpressionPrecedence(n)>e.getOperatorPrecedence(220,27)?r:e.setTextRange(t.createParenthesizedExpression(r),r)}function u(e){return 188===e.kind?t.createParenthesizedType(e):e}function _(e){switch(e.kind){case 186:case 187:case 178:case 179:return t.createParenthesizedType(e)}return u(e)}function d(r,n){return 0===n&&e.isFunctionOrConstructorTypeNode(r)&&r.typeParameters?t.createParenthesizedType(r):r}},e.nullParenthesizerRules={getParenthesizeLeftSideOfBinaryForOperator:function(t){return e.identity},getParenthesizeRightSideOfBinaryForOperator:function(t){return e.identity},parenthesizeLeftSideOfBinary:function(e,t){return t},parenthesizeRightSideOfBinary:function(e,t,r){return r},parenthesizeExpressionOfComputedPropertyName:e.identity,parenthesizeConditionOfConditionalExpression:e.identity,parenthesizeBranchOfConditionalExpression:e.identity,parenthesizeExpressionOfExportDefault:e.identity,parenthesizeExpressionOfNew:function(t){return e.cast(t,e.isLeftHandSideExpression)},parenthesizeLeftSideOfAccess:function(t){return e.cast(t,e.isLeftHandSideExpression)},parenthesizeOperandOfPostfixUnary:function(t){return e.cast(t,e.isLeftHandSideExpression)},parenthesizeOperandOfPrefixUnary:function(t){return e.cast(t,e.isUnaryExpression)},parenthesizeExpressionsOfCommaDelimitedList:function(t){return e.cast(t,e.isNodeArray)},parenthesizeExpressionForDisallowedComma:e.identity,parenthesizeExpressionOfExpressionStatement:e.identity,parenthesizeConciseBodyOfArrowFunction:e.identity,parenthesizeMemberOfConditionalType:e.identity,parenthesizeMemberOfElementType:e.identity,parenthesizeElementTypeOfArrayType:e.identity,parenthesizeConstituentTypesOfUnionOrIntersectionType:function(t){return e.cast(t,e.isNodeArray)},parenthesizeTypeArguments:function(t){return t&&e.cast(t,e.isNodeArray)}};}(t),function(e){e.createNodeConverters=function(t){return {convertToFunctionBlock:function(r,n){if(e.isBlock(r))return r;var i=t.createReturnStatement(r);e.setTextRange(i,r);var a=t.createBlock([i],n);return e.setTextRange(a,r),a},convertToFunctionExpression:function(r){if(!r.body)return e.Debug.fail("Cannot convert a FunctionDeclaration without a body");var n=t.createFunctionExpression(r.modifiers,r.asteriskToken,r.name,r.typeParameters,r.parameters,r.type,r.body);return e.setOriginalNode(n,r),e.setTextRange(n,r),e.getStartsOnNewLine(r)&&e.setStartsOnNewLine(n,!0),n},convertToArrayAssignmentElement:r,convertToObjectAssignmentElement:n,convertToAssignmentPattern:i,convertToObjectAssignmentPattern:a,convertToArrayAssignmentPattern:o,convertToAssignmentElementTarget:s};function r(r){if(e.isBindingElement(r)){if(r.dotDotDotToken)return e.Debug.assertNode(r.name,e.isIdentifier),e.setOriginalNode(e.setTextRange(t.createSpreadElement(r.name),r),r);var n=s(r.name);return r.initializer?e.setOriginalNode(e.setTextRange(t.createAssignment(n,r.initializer),r),r):n}return e.cast(r,e.isExpression)}function n(r){if(e.isBindingElement(r)){if(r.dotDotDotToken)return e.Debug.assertNode(r.name,e.isIdentifier),e.setOriginalNode(e.setTextRange(t.createSpreadAssignment(r.name),r),r);if(r.propertyName){var n=s(r.name);return e.setOriginalNode(e.setTextRange(t.createPropertyAssignment(r.propertyName,r.initializer?t.createAssignment(n,r.initializer):n),r),r)}return e.Debug.assertNode(r.name,e.isIdentifier),e.setOriginalNode(e.setTextRange(t.createShorthandPropertyAssignment(r.name,r.initializer),r),r)}return e.cast(r,e.isObjectLiteralElementLike)}function i(e){switch(e.kind){case 201:case 203:return o(e);case 200:case 204:return a(e)}}function a(r){return e.isObjectBindingPattern(r)?e.setOriginalNode(e.setTextRange(t.createObjectLiteralExpression(e.map(r.elements,n)),r),r):e.cast(r,e.isObjectLiteralExpression)}function o(n){return e.isArrayBindingPattern(n)?e.setOriginalNode(e.setTextRange(t.createArrayLiteralExpression(e.map(n.elements,r)),n),n):e.cast(n,e.isArrayLiteralExpression)}function s(t){return e.isBindingPattern(t)?i(t):e.cast(t,e.isExpression)}},e.nullNodeConverters={convertToFunctionBlock:e.notImplemented,convertToFunctionExpression:e.notImplemented,convertToArrayAssignmentElement:e.notImplemented,convertToObjectAssignmentElement:e.notImplemented,convertToAssignmentPattern:e.notImplemented,convertToObjectAssignmentPattern:e.notImplemented,convertToArrayAssignmentPattern:e.notImplemented,convertToAssignmentElementTarget:e.notImplemented};}(t),function(e){var t,r,i=0;function a(r,a){var f=8&r?o:s,g=e.memoize((function(){return 1&r?e.nullParenthesizerRules:e.createParenthesizerRules(N)})),m=e.memoize((function(){return 2&r?e.nullNodeConverters:e.createNodeConverters(N)})),y=e.memoizeOne((function(e){return function(t,r){return Mt(t,e,r)}})),v=e.memoizeOne((function(e){return function(t){return It(e,t)}})),b=e.memoizeOne((function(e){return function(t){return Ot(t,e)}})),x=e.memoizeOne((function(e){return function(){return function(e){return A(e)}(e)}})),D=e.memoizeOne((function(e){return function(t){return tn(e,t)}})),S=e.memoizeOne((function(e){return function(t,r){return function(e,t,r){return t.type!==r?f(tn(e,r),t):t}(e,t,r)}})),T=e.memoizeOne((function(e){return function(t,r){return Dn(e,t,r)}})),C=e.memoizeOne((function(e){return function(t,r,n){return function(e,t,r,n){return void 0===r&&(r=sn(t)),t.tagName!==r||t.comment!==n?f(Dn(e,r,n),t):t}(e,t,r,n)}})),E=e.memoizeOne((function(e){return function(t,r,n){return Sn(e,t,r,n)}})),k=e.memoizeOne((function(e){return function(t,r,n,i){return function(e,t,r,n,i){return void 0===r&&(r=sn(t)),t.tagName!==r||t.typeExpression!==n||t.comment!==i?f(Sn(e,r,n,i),t):t}(e,t,r,n,i)}})),N={get parenthesizer(){return g()},get converters(){return m()},createNodeArray:F,createNumericLiteral:K,createBigIntLiteral:V,createStringLiteral:W,createStringLiteralFromNode:function(t){var r=q(e.getTextOfIdentifierOrLiteral(t),void 0);return r.textSourceNode=t,r},createRegularExpressionLiteral:H,createLiteralLikeNode:function(e,t){switch(e){case 8:return K(t,0);case 9:return V(t);case 10:return W(t,void 0);case 11:return wn(t,!1);case 12:return wn(t,!0);case 13:return H(t);case 14:return Jt(e,t,void 0,0)}},createIdentifier:X,updateIdentifier:function(t,r){return t.typeArguments!==r?f(X(e.idText(t),r),t):t},createTempVariable:Y,createLoopVariable:function(e){var t=2;return e&&(t|=8),Q("",t)},createUniqueName:function(t,r){return void 0===r&&(r=0),e.Debug.assert(!(7&r),"Argument out of range: flags"),e.Debug.assert(32!=(48&r),"GeneratedIdentifierFlags.FileLevel cannot be set without also setting GeneratedIdentifierFlags.Optimistic"),Q(t,3|r)},getGeneratedNameForNode:Z,createPrivateIdentifier:function(t){e.startsWith(t,"#")||e.Debug.fail("First character of private identifier must be #: "+t);var r=a.createBasePrivateIdentifierNode(80);return r.escapedText=e.escapeLeadingUnderscores(t),r.transformFlags|=8388608,r},createToken:ee,createSuper:function(){return ee(106)},createThis:te,createNull:function(){return ee(104)},createTrue:re,createFalse:ne,createModifier:ie,createModifiersFromModifierFlags:ae,createQualifiedName:oe,updateQualifiedName:function(e,t,r){return e.left!==t||e.right!==r?f(oe(t,r),e):e},createComputedPropertyName:se,updateComputedPropertyName:function(e,t){return e.expression!==t?f(se(t),e):e},createTypeParameterDeclaration:ce,updateTypeParameterDeclaration:function(e,t,r,n){return e.name!==t||e.constraint!==r||e.default!==n?f(ce(t,r,n),e):e},createParameterDeclaration:le,updateParameterDeclaration:ue,createDecorator:_e,updateDecorator:function(e,t){return e.expression!==t?f(_e(t),e):e},createPropertySignature:de,updatePropertySignature:pe,createPropertyDeclaration:fe,updatePropertyDeclaration:ge,createMethodSignature:me,updateMethodSignature:ye,createMethodDeclaration:ve,updateMethodDeclaration:he,createConstructorDeclaration:xe,updateConstructorDeclaration:De,createGetAccessorDeclaration:Se,updateGetAccessorDeclaration:Te,createSetAccessorDeclaration:Ce,updateSetAccessorDeclaration:Ee,createCallSignature:ke,updateCallSignature:function(e,t,r,n){return e.typeParameters!==t||e.parameters!==r||e.type!==n?M(ke(t,r,n),e):e},createConstructSignature:Ne,updateConstructSignature:function(e,t,r,n){return e.typeParameters!==t||e.parameters!==r||e.type!==n?M(Ne(t,r,n),e):e},createIndexSignature:Fe,updateIndexSignature:Ae,createClassStaticBlockDeclaration:be,updateClassStaticBlockDeclaration:function(e,t,r,n){return e.decorators!==t||e.modifier!==r||e.body!==n?f(be(t,r,n),e):e},createTemplateLiteralTypeSpan:Pe,updateTemplateLiteralTypeSpan:function(e,t,r){return e.type!==t||e.literal!==r?f(Pe(t,r),e):e},createKeywordTypeNode:function(e){return ee(e)},createTypePredicateNode:we,updateTypePredicateNode:function(e,t,r,n){return e.assertsModifier!==t||e.parameterName!==r||e.type!==n?f(we(t,r,n),e):e},createTypeReferenceNode:Ie,updateTypeReferenceNode:function(e,t,r){return e.typeName!==t||e.typeArguments!==r?f(Ie(t,r),e):e},createFunctionTypeNode:Oe,updateFunctionTypeNode:function(e,t,r,n){return e.typeParameters!==t||e.parameters!==r||e.type!==n?M(Oe(t,r,n),e):e},createConstructorTypeNode:Me,updateConstructorTypeNode:function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return 5===t.length?Be.apply(void 0,t):4===t.length?je.apply(void 0,t):e.Debug.fail("Incorrect number of arguments specified.")},createTypeQueryNode:Je,updateTypeQueryNode:function(e,t){return e.exprName!==t?f(Je(t),e):e},createTypeLiteralNode:ze,updateTypeLiteralNode:function(e,t){return e.members!==t?f(ze(t),e):e},createArrayTypeNode:Ue,updateArrayTypeNode:function(e,t){return e.elementType!==t?f(Ue(t),e):e},createTupleTypeNode:Ke,updateTupleTypeNode:function(e,t){return e.elements!==t?f(Ke(t),e):e},createNamedTupleMember:Ve,updateNamedTupleMember:function(e,t,r,n,i){return e.dotDotDotToken!==t||e.name!==r||e.questionToken!==n||e.type!==i?f(Ve(t,r,n,i),e):e},createOptionalTypeNode:qe,updateOptionalTypeNode:function(e,t){return e.type!==t?f(qe(t),e):e},createRestTypeNode:We,updateRestTypeNode:function(e,t){return e.type!==t?f(We(t),e):e},createUnionTypeNode:function(e){return He(186,e)},updateUnionTypeNode:function(e,t){return Ge(e,t)},createIntersectionTypeNode:function(e){return He(187,e)},updateIntersectionTypeNode:function(e,t){return Ge(e,t)},createConditionalTypeNode:Qe,updateConditionalTypeNode:function(e,t,r,n,i){return e.checkType!==t||e.extendsType!==r||e.trueType!==n||e.falseType!==i?f(Qe(t,r,n,i),e):e},createInferTypeNode:Xe,updateInferTypeNode:function(e,t){return e.typeParameter!==t?f(Xe(t),e):e},createImportTypeNode:Ze,updateImportTypeNode:function(e,t,r,n,i){return void 0===i&&(i=e.isTypeOf),e.argument!==t||e.qualifier!==r||e.typeArguments!==n||e.isTypeOf!==i?f(Ze(t,r,n,i),e):e},createParenthesizedType:$e,updateParenthesizedType:function(e,t){return e.type!==t?f($e(t),e):e},createThisTypeNode:function(){var e=A(191);return e.transformFlags=1,e},createTypeOperatorNode:et,updateTypeOperatorNode:function(e,t){return e.type!==t?f(et(e.operator,t),e):e},createIndexedAccessTypeNode:tt,updateIndexedAccessTypeNode:function(e,t,r){return e.objectType!==t||e.indexType!==r?f(tt(t,r),e):e},createMappedTypeNode:rt,updateMappedTypeNode:function(e,t,r,n,i,a,o){return e.readonlyToken!==t||e.typeParameter!==r||e.nameType!==n||e.questionToken!==i||e.type!==a||e.members!==o?f(rt(t,r,n,i,a,o),e):e},createLiteralTypeNode:nt,updateLiteralTypeNode:function(e,t){return e.literal!==t?f(nt(t),e):e},createTemplateLiteralType:Ye,updateTemplateLiteralType:function(e,t,r){return e.head!==t||e.templateSpans!==r?f(Ye(t,r),e):e},createObjectBindingPattern:it,updateObjectBindingPattern:function(e,t){return e.elements!==t?f(it(t),e):e},createArrayBindingPattern:at,updateArrayBindingPattern:function(e,t){return e.elements!==t?f(at(t),e):e},createBindingElement:ot,updateBindingElement:function(e,t,r,n,i){return e.propertyName!==r||e.dotDotDotToken!==t||e.name!==n||e.initializer!==i?f(ot(t,r,n,i),e):e},createArrayLiteralExpression:ct,updateArrayLiteralExpression:function(e,t){return e.elements!==t?f(ct(t,e.multiLine),e):e},createObjectLiteralExpression:lt,updateObjectLiteralExpression:function(e,t){return e.properties!==t?f(lt(t,e.multiLine),e):e},createPropertyAccessExpression:4&r?function(t,r){return e.setEmitFlags(ut(t,r),131072)}:ut,updatePropertyAccessExpression:function(t,r,n){return e.isPropertyAccessChain(t)?dt(t,r,t.questionDotToken,e.cast(n,e.isIdentifier)):t.expression!==r||t.name!==n?f(ut(r,n),t):t},createPropertyAccessChain:4&r?function(t,r,n){return e.setEmitFlags(_t(t,r,n),131072)}:_t,updatePropertyAccessChain:dt,createElementAccessExpression:pt,updateElementAccessExpression:function(t,r,n){return e.isElementAccessChain(t)?gt(t,r,t.questionDotToken,n):t.expression!==r||t.argumentExpression!==n?f(pt(r,n),t):t},createElementAccessChain:ft,updateElementAccessChain:gt,createCallExpression:mt,updateCallExpression:function(t,r,n,i){return e.isCallChain(t)?vt(t,r,t.questionDotToken,n,i):t.expression!==r||t.typeArguments!==n||t.arguments!==i?f(mt(r,n,i),t):t},createCallChain:yt,updateCallChain:vt,createNewExpression:ht,updateNewExpression:function(e,t,r,n){return e.expression!==t||e.typeArguments!==r||e.arguments!==n?f(ht(t,r,n),e):e},createTaggedTemplateExpression:bt,updateTaggedTemplateExpression:function(e,t,r,n){return e.tag!==t||e.typeArguments!==r||e.template!==n?f(bt(t,r,n),e):e},createTypeAssertion:xt,updateTypeAssertion:Dt,createParenthesizedExpression:St,updateParenthesizedExpression:Tt,createFunctionExpression:Ct,updateFunctionExpression:Et,createArrowFunction:kt,updateArrowFunction:Nt,createDeleteExpression:Ft,updateDeleteExpression:function(e,t){return e.expression!==t?f(Ft(t),e):e},createTypeOfExpression:At,updateTypeOfExpression:function(e,t){return e.expression!==t?f(At(t),e):e},createVoidExpression:Pt,updateVoidExpression:function(e,t){return e.expression!==t?f(Pt(t),e):e},createAwaitExpression:wt,updateAwaitExpression:function(e,t){return e.expression!==t?f(wt(t),e):e},createPrefixUnaryExpression:It,updatePrefixUnaryExpression:function(e,t){return e.operand!==t?f(It(e.operator,t),e):e},createPostfixUnaryExpression:Ot,updatePostfixUnaryExpression:function(e,t){return e.operand!==t?f(Ot(t,e.operator),e):e},createBinaryExpression:Mt,updateBinaryExpression:function(e,t,r,n){return e.left!==t||e.operatorToken!==r||e.right!==n?f(Mt(t,r,n),e):e},createConditionalExpression:Rt,updateConditionalExpression:function(e,t,r,n,i,a){return e.condition!==t||e.questionToken!==r||e.whenTrue!==n||e.colonToken!==i||e.whenFalse!==a?f(Rt(t,r,n,i,a),e):e},createTemplateExpression:Bt,updateTemplateExpression:function(e,t,r){return e.head!==t||e.templateSpans!==r?f(Bt(t,r),e):e},createTemplateHead:function(e,t,r){return jt(15,e,t,r)},createTemplateMiddle:function(e,t,r){return jt(16,e,t,r)},createTemplateTail:function(e,t,r){return jt(17,e,t,r)},createNoSubstitutionTemplateLiteral:function(e,t,r){return jt(14,e,t,r)},createTemplateLiteralLikeNode:Jt,createYieldExpression:zt,updateYieldExpression:function(e,t,r){return e.expression!==r||e.asteriskToken!==t?f(zt(t,r),e):e},createSpreadElement:Ut,updateSpreadElement:function(e,t){return e.expression!==t?f(Ut(t),e):e},createClassExpression:Kt,updateClassExpression:Vt,createOmittedExpression:function(){return st(226)},createExpressionWithTypeArguments:qt,updateExpressionWithTypeArguments:function(e,t,r){return e.expression!==t||e.typeArguments!==r?f(qt(t,r),e):e},createAsExpression:Wt,updateAsExpression:Ht,createNonNullExpression:Gt,updateNonNullExpression:Qt,createNonNullChain:Xt,updateNonNullChain:Yt,createMetaProperty:Zt,updateMetaProperty:function(e,t){return e.name!==t?f(Zt(e.keywordToken,t),e):e},createTemplateSpan:$t,updateTemplateSpan:function(e,t,r){return e.expression!==t||e.literal!==r?f($t(t,r),e):e},createSemicolonClassElement:function(){var e=A(233);return e.transformFlags|=512,e},createBlock:er,updateBlock:function(e,t){return e.statements!==t?f(er(t,e.multiLine),e):e},createVariableStatement:tr,updateVariableStatement:rr,createEmptyStatement:nr,createExpressionStatement:ir,updateExpressionStatement:function(e,t){return e.expression!==t?f(ir(t),e):e},createIfStatement:ar,updateIfStatement:function(e,t,r,n){return e.expression!==t||e.thenStatement!==r||e.elseStatement!==n?f(ar(t,r,n),e):e},createDoStatement:or,updateDoStatement:function(e,t,r){return e.statement!==t||e.expression!==r?f(or(t,r),e):e},createWhileStatement:sr,updateWhileStatement:function(e,t,r){return e.expression!==t||e.statement!==r?f(sr(t,r),e):e},createForStatement:cr,updateForStatement:function(e,t,r,n,i){return e.initializer!==t||e.condition!==r||e.incrementor!==n||e.statement!==i?f(cr(t,r,n,i),e):e},createForInStatement:lr,updateForInStatement:function(e,t,r,n){return e.initializer!==t||e.expression!==r||e.statement!==n?f(lr(t,r,n),e):e},createForOfStatement:ur,updateForOfStatement:function(e,t,r,n,i){return e.awaitModifier!==t||e.initializer!==r||e.expression!==n||e.statement!==i?f(ur(t,r,n,i),e):e},createContinueStatement:_r,updateContinueStatement:function(e,t){return e.label!==t?f(_r(t),e):e},createBreakStatement:dr,updateBreakStatement:function(e,t){return e.label!==t?f(dr(t),e):e},createReturnStatement:pr,updateReturnStatement:function(e,t){return e.expression!==t?f(pr(t),e):e},createWithStatement:fr,updateWithStatement:function(e,t,r){return e.expression!==t||e.statement!==r?f(fr(t,r),e):e},createSwitchStatement:gr,updateSwitchStatement:function(e,t,r){return e.expression!==t||e.caseBlock!==r?f(gr(t,r),e):e},createLabeledStatement:mr,updateLabeledStatement:yr,createThrowStatement:vr,updateThrowStatement:function(e,t){return e.expression!==t?f(vr(t),e):e},createTryStatement:hr,updateTryStatement:function(e,t,r,n){return e.tryBlock!==t||e.catchClause!==r||e.finallyBlock!==n?f(hr(t,r,n),e):e},createDebuggerStatement:function(){return A(252)},createVariableDeclaration:br,updateVariableDeclaration:function(e,t,r,n,i){return e.name!==t||e.type!==n||e.exclamationToken!==r||e.initializer!==i?f(br(t,r,n,i),e):e},createVariableDeclarationList:xr,updateVariableDeclarationList:function(e,t){return e.declarations!==t?f(xr(t,e.flags),e):e},createFunctionDeclaration:Dr,updateFunctionDeclaration:Sr,createClassDeclaration:Tr,updateClassDeclaration:Cr,createInterfaceDeclaration:Er,updateInterfaceDeclaration:kr,createTypeAliasDeclaration:Nr,updateTypeAliasDeclaration:Fr,createEnumDeclaration:Ar,updateEnumDeclaration:Pr,createModuleDeclaration:wr,updateModuleDeclaration:Ir,createModuleBlock:Or,updateModuleBlock:function(e,t){return e.statements!==t?f(Or(t),e):e},createCaseBlock:Mr,updateCaseBlock:function(e,t){return e.clauses!==t?f(Mr(t),e):e},createNamespaceExportDeclaration:Lr,updateNamespaceExportDeclaration:function(e,t){return e.name!==t?f(Lr(t),e):e},createImportEqualsDeclaration:Rr,updateImportEqualsDeclaration:Br,createImportDeclaration:jr,updateImportDeclaration:Jr,createImportClause:zr,updateImportClause:function(e,t,r,n){return e.isTypeOnly!==t||e.name!==r||e.namedBindings!==n?f(zr(t,r,n),e):e},createAssertClause:Ur,updateAssertClause:function(e,t,r){return e.elements!==t||e.multiLine!==r?f(Ur(t,r),e):e},createAssertEntry:Kr,updateAssertEntry:function(e,t,r){return e.name!==t||e.value!==r?f(Kr(t,r),e):e},createNamespaceImport:Vr,updateNamespaceImport:function(e,t){return e.name!==t?f(Vr(t),e):e},createNamespaceExport:qr,updateNamespaceExport:function(e,t){return e.name!==t?f(qr(t),e):e},createNamedImports:Wr,updateNamedImports:function(e,t){return e.elements!==t?f(Wr(t),e):e},createImportSpecifier:Hr,updateImportSpecifier:function(e,t,r,n){return e.isTypeOnly!==t||e.propertyName!==r||e.name!==n?f(Hr(t,r,n),e):e},createExportAssignment:Gr,updateExportAssignment:Qr,createExportDeclaration:Xr,updateExportDeclaration:Yr,createNamedExports:Zr,updateNamedExports:function(e,t){return e.elements!==t?f(Zr(t),e):e},createExportSpecifier:$r,updateExportSpecifier:function(e,t,r,n){return e.isTypeOnly!==t||e.propertyName!==r||e.name!==n?f($r(t,r,n),e):e},createMissingDeclaration:function(){return P(275,void 0,void 0)},createExternalModuleReference:en,updateExternalModuleReference:function(e,t){return e.expression!==t?f(en(t),e):e},get createJSDocAllType(){return x(310)},get createJSDocUnknownType(){return x(311)},get createJSDocNonNullableType(){return D(313)},get updateJSDocNonNullableType(){return S(313)},get createJSDocNullableType(){return D(312)},get updateJSDocNullableType(){return S(312)},get createJSDocOptionalType(){return D(314)},get updateJSDocOptionalType(){return S(314)},get createJSDocVariadicType(){return D(316)},get updateJSDocVariadicType(){return S(316)},get createJSDocNamepathType(){return D(317)},get updateJSDocNamepathType(){return S(317)},createJSDocFunctionType:rn,updateJSDocFunctionType:function(e,t,r){return e.parameters!==t||e.type!==r?f(rn(t,r),e):e},createJSDocTypeLiteral:nn,updateJSDocTypeLiteral:function(e,t,r){return e.jsDocPropertyTags!==t||e.isArrayType!==r?f(nn(t,r),e):e},createJSDocTypeExpression:an,updateJSDocTypeExpression:function(e,t){return e.type!==t?f(an(t),e):e},createJSDocSignature:on,updateJSDocSignature:function(e,t,r,n){return e.typeParameters!==t||e.parameters!==r||e.type!==n?f(on(t,r,n),e):e},createJSDocTemplateTag:ln,updateJSDocTemplateTag:function(e,t,r,n,i){return void 0===t&&(t=sn(e)),e.tagName!==t||e.constraint!==r||e.typeParameters!==n||e.comment!==i?f(ln(t,r,n,i),e):e},createJSDocTypedefTag:un,updateJSDocTypedefTag:function(e,t,r,n,i){return void 0===t&&(t=sn(e)),e.tagName!==t||e.typeExpression!==r||e.fullName!==n||e.comment!==i?f(un(t,r,n,i),e):e},createJSDocParameterTag:_n,updateJSDocParameterTag:function(e,t,r,n,i,a,o){return void 0===t&&(t=sn(e)),e.tagName!==t||e.name!==r||e.isBracketed!==n||e.typeExpression!==i||e.isNameFirst!==a||e.comment!==o?f(_n(t,r,n,i,a,o),e):e},createJSDocPropertyTag:dn,updateJSDocPropertyTag:function(e,t,r,n,i,a,o){return void 0===t&&(t=sn(e)),e.tagName!==t||e.name!==r||e.isBracketed!==n||e.typeExpression!==i||e.isNameFirst!==a||e.comment!==o?f(dn(t,r,n,i,a,o),e):e},createJSDocCallbackTag:pn,updateJSDocCallbackTag:function(e,t,r,n,i){return void 0===t&&(t=sn(e)),e.tagName!==t||e.typeExpression!==r||e.fullName!==n||e.comment!==i?f(pn(t,r,n,i),e):e},createJSDocAugmentsTag:fn,updateJSDocAugmentsTag:function(e,t,r,n){return void 0===t&&(t=sn(e)),e.tagName!==t||e.class!==r||e.comment!==n?f(fn(t,r,n),e):e},createJSDocImplementsTag:gn,updateJSDocImplementsTag:function(e,t,r,n){return void 0===t&&(t=sn(e)),e.tagName!==t||e.class!==r||e.comment!==n?f(gn(t,r,n),e):e},createJSDocSeeTag:mn,updateJSDocSeeTag:function(e,t,r,n){return e.tagName!==t||e.name!==r||e.comment!==n?f(mn(t,r,n),e):e},createJSDocNameReference:yn,updateJSDocNameReference:function(e,t){return e.name!==t?f(yn(t),e):e},createJSDocMemberName:vn,updateJSDocMemberName:function(e,t,r){return e.left!==t||e.right!==r?f(vn(t,r),e):e},createJSDocLink:hn,updateJSDocLink:function(e,t,r){return e.name!==t?f(hn(t,r),e):e},createJSDocLinkCode:bn,updateJSDocLinkCode:function(e,t,r){return e.name!==t?f(bn(t,r),e):e},createJSDocLinkPlain:xn,updateJSDocLinkPlain:function(e,t,r){return e.name!==t?f(xn(t,r),e):e},get createJSDocTypeTag(){return E(341)},get updateJSDocTypeTag(){return k(341)},get createJSDocReturnTag(){return E(339)},get updateJSDocReturnTag(){return k(339)},get createJSDocThisTag(){return E(340)},get updateJSDocThisTag(){return k(340)},get createJSDocEnumTag(){return E(337)},get updateJSDocEnumTag(){return k(337)},get createJSDocAuthorTag(){return T(328)},get updateJSDocAuthorTag(){return C(328)},get createJSDocClassTag(){return T(330)},get updateJSDocClassTag(){return C(330)},get createJSDocPublicTag(){return T(331)},get updateJSDocPublicTag(){return C(331)},get createJSDocPrivateTag(){return T(332)},get updateJSDocPrivateTag(){return C(332)},get createJSDocProtectedTag(){return T(333)},get updateJSDocProtectedTag(){return C(333)},get createJSDocReadonlyTag(){return T(334)},get updateJSDocReadonlyTag(){return C(334)},get createJSDocOverrideTag(){return T(335)},get updateJSDocOverrideTag(){return C(335)},get createJSDocDeprecatedTag(){return T(329)},get updateJSDocDeprecatedTag(){return C(329)},createJSDocUnknownTag:Tn,updateJSDocUnknownTag:function(e,t,r){return e.tagName!==t||e.comment!==r?f(Tn(t,r),e):e},createJSDocText:Cn,updateJSDocText:function(e,t){return e.text!==t?f(Cn(t),e):e},createJSDocComment:En,updateJSDocComment:function(e,t,r){return e.comment!==t||e.tags!==r?f(En(t,r),e):e},createJsxElement:kn,updateJsxElement:function(e,t,r,n){return e.openingElement!==t||e.children!==r||e.closingElement!==n?f(kn(t,r,n),e):e},createJsxSelfClosingElement:Nn,updateJsxSelfClosingElement:function(e,t,r,n){return e.tagName!==t||e.typeArguments!==r||e.attributes!==n?f(Nn(t,r,n),e):e},createJsxOpeningElement:Fn,updateJsxOpeningElement:function(e,t,r,n){return e.tagName!==t||e.typeArguments!==r||e.attributes!==n?f(Fn(t,r,n),e):e},createJsxClosingElement:An,updateJsxClosingElement:function(e,t){return e.tagName!==t?f(An(t),e):e},createJsxFragment:Pn,createJsxText:wn,updateJsxText:function(e,t,r){return e.text!==t||e.containsOnlyTriviaWhiteSpaces!==r?f(wn(t,r),e):e},createJsxOpeningFragment:function(){var e=A(282);return e.transformFlags|=2,e},createJsxJsxClosingFragment:function(){var e=A(283);return e.transformFlags|=2,e},updateJsxFragment:function(e,t,r,n){return e.openingFragment!==t||e.children!==r||e.closingFragment!==n?f(Pn(t,r,n),e):e},createJsxAttribute:In,updateJsxAttribute:function(e,t,r){return e.name!==t||e.initializer!==r?f(In(t,r),e):e},createJsxAttributes:On,updateJsxAttributes:function(e,t){return e.properties!==t?f(On(t),e):e},createJsxSpreadAttribute:Mn,updateJsxSpreadAttribute:function(e,t){return e.expression!==t?f(Mn(t),e):e},createJsxExpression:Ln,updateJsxExpression:function(e,t){return e.expression!==t?f(Ln(e.dotDotDotToken,t),e):e},createCaseClause:Rn,updateCaseClause:function(e,t,r){return e.expression!==t||e.statements!==r?f(Rn(t,r),e):e},createDefaultClause:Bn,updateDefaultClause:function(e,t){return e.statements!==t?f(Bn(t),e):e},createHeritageClause:jn,updateHeritageClause:function(e,t){return e.types!==t?f(jn(e.token,t),e):e},createCatchClause:Jn,updateCatchClause:function(e,t,r){return e.variableDeclaration!==t||e.block!==r?f(Jn(t,r),e):e},createPropertyAssignment:zn,updatePropertyAssignment:function(e,t,r){return e.name!==t||e.initializer!==r?(n=zn(t,r),(i=e).decorators&&(n.decorators=i.decorators),i.modifiers&&(n.modifiers=i.modifiers),i.questionToken&&(n.questionToken=i.questionToken),i.exclamationToken&&(n.exclamationToken=i.exclamationToken),f(n,i)):e;var n,i;},createShorthandPropertyAssignment:Un,updateShorthandPropertyAssignment:function(e,t,r){return e.name!==t||e.objectAssignmentInitializer!==r?(n=Un(t,r),(i=e).decorators&&(n.decorators=i.decorators),i.modifiers&&(n.modifiers=i.modifiers),i.equalsToken&&(n.equalsToken=i.equalsToken),i.questionToken&&(n.questionToken=i.questionToken),i.exclamationToken&&(n.exclamationToken=i.exclamationToken),f(n,i)):e;var n,i;},createSpreadAssignment:Kn,updateSpreadAssignment:function(e,t){return e.expression!==t?f(Kn(t),e):e},createEnumMember:Vn,updateEnumMember:function(e,t,r){return e.name!==t||e.initializer!==r?f(Vn(t,r),e):e},createSourceFile:function(e,t,r){var n=a.createBaseSourceFileNode(303);return n.statements=F(e),n.endOfFileToken=t,n.flags|=r,n.fileName="",n.text="",n.languageVersion=0,n.languageVariant=0,n.scriptKind=0,n.isDeclarationFile=!1,n.hasNoDefaultLib=!1,n.transformFlags|=d(n.statements)|_(n.endOfFileToken),n},updateSourceFile:function(t,r,n,i,o,s,c){return void 0===n&&(n=t.isDeclarationFile),void 0===i&&(i=t.referencedFiles),void 0===o&&(o=t.typeReferenceDirectives),void 0===s&&(s=t.hasNoDefaultLib),void 0===c&&(c=t.libReferenceDirectives),t.statements!==r||t.isDeclarationFile!==n||t.referencedFiles!==i||t.typeReferenceDirectives!==o||t.hasNoDefaultLib!==s||t.libReferenceDirectives!==c?f(function(t,r,n,i,o,s,c){var l=a.createBaseSourceFileNode(303);for(var u in t)"emitNode"!==u&&!e.hasProperty(l,u)&&e.hasProperty(t,u)&&(l[u]=t[u]);return l.flags|=t.flags,l.statements=F(r),l.endOfFileToken=t.endOfFileToken,l.isDeclarationFile=n,l.referencedFiles=i,l.typeReferenceDirectives=o,l.hasNoDefaultLib=s,l.libReferenceDirectives=c,l.transformFlags=d(l.statements)|_(l.endOfFileToken),l.impliedNodeFormat=t.impliedNodeFormat,l}(t,r,n,i,o,s,c),t):t},createBundle:qn,updateBundle:function(t,r,n){return void 0===n&&(n=e.emptyArray),t.sourceFiles!==r||t.prepends!==n?f(qn(r,n),t):t},createUnparsedSource:function(t,r,n){var i=A(305);return i.prologues=t,i.syntheticReferences=r,i.texts=n,i.fileName="",i.text="",i.referencedFiles=e.emptyArray,i.libReferenceDirectives=e.emptyArray,i.getLineAndCharacterOfPosition=function(t){return e.getLineAndCharacterOfPosition(i,t)},i},createUnparsedPrologue:function(e){return Wn(298,e)},createUnparsedPrepend:function(e,t){var r=Wn(299,e);return r.texts=t,r},createUnparsedTextLike:function(e,t){return Wn(t?301:300,e)},createUnparsedSyntheticReference:function(e){var t=A(302);return t.data=e.data,t.section=e,t},createInputFiles:function(){var e=A(306);return e.javascriptText="",e.declarationText="",e},createSyntheticExpression:function(e,t,r){void 0===t&&(t=!1);var n=A(231);return n.type=e,n.isSpread=t,n.tupleNameSource=r,n},createSyntaxList:function(e){var t=A(346);return t._children=e,t},createNotEmittedStatement:function(t){var r=A(347);return r.original=t,e.setTextRange(r,t),r},createPartiallyEmittedExpression:Hn,updatePartiallyEmittedExpression:Gn,createCommaListExpression:Xn,updateCommaListExpression:function(e,t){return e.elements!==t?f(Xn(t),e):e},createEndOfDeclarationMarker:function(e){var t=A(351);return t.emitNode={},t.original=e,t},createMergeDeclarationMarker:function(e){var t=A(350);return t.emitNode={},t.original=e,t},createSyntheticReferenceExpression:Yn,updateSyntheticReferenceExpression:function(e,t,r){return e.expression!==t||e.thisArg!==r?f(Yn(t,r),e):e},cloneNode:Zn,get createComma(){return y(27)},get createAssignment(){return y(63)},get createLogicalOr(){return y(56)},get createLogicalAnd(){return y(55)},get createBitwiseOr(){return y(51)},get createBitwiseXor(){return y(52)},get createBitwiseAnd(){return y(50)},get createStrictEquality(){return y(36)},get createStrictInequality(){return y(37)},get createEquality(){return y(34)},get createInequality(){return y(35)},get createLessThan(){return y(29)},get createLessThanEquals(){return y(32)},get createGreaterThan(){return y(31)},get createGreaterThanEquals(){return y(33)},get createLeftShift(){return y(47)},get createRightShift(){return y(48)},get createUnsignedRightShift(){return y(49)},get createAdd(){return y(39)},get createSubtract(){return y(40)},get createMultiply(){return y(41)},get createDivide(){return y(43)},get createModulo(){return y(44)},get createExponent(){return y(42)},get createPrefixPlus(){return v(39)},get createPrefixMinus(){return v(40)},get createPrefixIncrement(){return v(45)},get createPrefixDecrement(){return v(46)},get createBitwiseNot(){return v(54)},get createLogicalNot(){return v(53)},get createPostfixIncrement(){return b(45)},get createPostfixDecrement(){return b(46)},createImmediatelyInvokedFunctionExpression:function(e,t,r){return mt(Ct(void 0,void 0,void 0,void 0,t?[t]:[],void 0,er(e,!0)),void 0,r?[r]:[])},createImmediatelyInvokedArrowFunction:function(e,t,r){return mt(kt(void 0,void 0,t?[t]:[],void 0,void 0,er(e,!0)),void 0,r?[r]:[])},createVoidZero:$n,createExportDefault:function(e){return Gr(void 0,void 0,!1,e)},createExternalModuleExport:function(e){return Xr(void 0,void 0,!1,Zr([$r(!1,void 0,e)]))},createTypeCheck:function(e,t){return "undefined"===t?N.createStrictEquality(e,$n()):N.createStrictEquality(At(e),W(t))},createMethodCall:ei,createGlobalMethodCall:ti,createFunctionBindCall:function(e,t,r){return ei(e,"bind",n$3([t],r,!0))},createFunctionCallCall:function(e,t,r){return ei(e,"call",n$3([t],r,!0))},createFunctionApplyCall:function(e,t,r){return ei(e,"apply",[t,r])},createArraySliceCall:function(e,t){return ei(e,"slice",void 0===t?[]:[pi(t)])},createArrayConcatCall:function(e,t){return ei(e,"concat",t)},createObjectDefinePropertyCall:function(e,t,r){return ti("Object","defineProperty",[e,pi(t),r])},createReflectGetCall:function(e,t,r){return ti("Reflect","get",r?[e,t,r]:[e,t])},createReflectSetCall:function(e,t,r,n){return ti("Reflect","set",n?[e,t,r,n]:[e,t,r])},createPropertyDescriptor:function(t,r){var n=[];ri(n,"enumerable",pi(t.enumerable)),ri(n,"configurable",pi(t.configurable));var i=ri(n,"writable",pi(t.writable));i=ri(n,"value",t.value)||i;var a=ri(n,"get",t.get);return a=ri(n,"set",t.set)||a,e.Debug.assert(!(i&&a),"A PropertyDescriptor may not be both an accessor descriptor and a data descriptor."),lt(n,!r)},createCallBinding:function(t,r,n,i){void 0===i&&(i=!1);var a,o,s=e.skipOuterExpressions(t,15);return e.isSuperProperty(s)?(a=te(),o=s):e.isSuperKeyword(s)?(a=te(),o=void 0!==n&&n<2?e.setTextRange(X("_super"),s):s):4096&e.getEmitFlags(s)?(a=$n(),o=g().parenthesizeLeftSideOfAccess(s)):e.isPropertyAccessExpression(s)?ni(s.expression,i)?(a=Y(r),o=ut(e.setTextRange(N.createAssignment(a,s.expression),s.expression),s.name),e.setTextRange(o,s)):(a=s.expression,o=s):e.isElementAccessExpression(s)?ni(s.expression,i)?(a=Y(r),o=pt(e.setTextRange(N.createAssignment(a,s.expression),s.expression),s.argumentExpression),e.setTextRange(o,s)):(a=s.expression,o=s):(a=$n(),o=g().parenthesizeLeftSideOfAccess(t)),{target:o,thisArg:a}},createAssignmentTargetWrapper:function(e,t){return ut(St(lt([Ce(void 0,void 0,"value",[le(void 0,void 0,void 0,e,void 0,void 0,void 0)],er([ir(t)]))])),"value")},inlineExpressions:function(t){return t.length>10?Xn(t):e.reduceLeft(t,N.createComma)},getInternalName:function(e,t,r){return ii(e,t,r,49152)},getLocalName:function(e,t,r){return ii(e,t,r,16384)},getExportName:ai,getDeclarationName:function(e,t,r){return ii(e,t,r)},getNamespaceMemberName:oi,getExternalModuleOrNamespaceExportName:function(t,r,n,i){return t&&e.hasSyntacticModifier(r,1)?oi(t,ii(r),n,i):ai(r,n,i)},restoreOuterExpressions:function t(r,n,i){return void 0===i&&(i=15),r&&e.isOuterExpression(r,i)&&(a=r,!(e.isParenthesizedExpression(a)&&e.nodeIsSynthesized(a)&&e.nodeIsSynthesized(e.getSourceMapRange(a))&&e.nodeIsSynthesized(e.getCommentRange(a)))||e.some(e.getSyntheticLeadingComments(a))||e.some(e.getSyntheticTrailingComments(a)))?function(e,t){switch(e.kind){case 211:return Tt(e,t);case 210:return Dt(e,e.type,t);case 228:return Ht(e,t,e.type);case 229:return Qt(e,t);case 348:return Gn(e,t)}}(r,t(r.expression,n)):n;var a;},restoreEnclosingLabel:function t(r,n,i){if(!n)return r;var a=yr(n,n.label,e.isLabeledStatement(n.statement)?t(r,n.statement):r);return i&&i(n),a},createUseStrictPrologue:si,copyPrologue:function(e,t,r,n){return li(e,t,ci(e,t,r),n)},copyStandardPrologue:ci,copyCustomPrologue:li,ensureUseStrict:function(t){return e.findUseStrictPrologue(t)?t:e.setTextRange(F(n$3([si()],t,!0)),t)},liftToBlock:function(t){return e.Debug.assert(e.every(t,e.isStatementOrBlock),"Cannot lift nodes to a Block."),e.singleOrUndefined(t)||er(t)},mergeLexicalEnvironment:function(t,r){if(!e.some(r))return t;var i=ui(t,e.isPrologueDirective,0),a=ui(t,e.isHoistedFunction,i),o=ui(t,e.isHoistedVariableStatement,a),s=ui(r,e.isPrologueDirective,0),c=ui(r,e.isHoistedFunction,s),l=ui(r,e.isHoistedVariableStatement,c),u=ui(r,e.isCustomPrologue,l);e.Debug.assert(u===r.length,"Expected declarations to be valid standard or custom prologues");var _=e.isNodeArray(t)?t.slice():t;if(u>l&&_.splice.apply(_,n$3([o,0],r.slice(l,u),!1)),l>c&&_.splice.apply(_,n$3([a,0],r.slice(c,l),!1)),c>s&&_.splice.apply(_,n$3([i,0],r.slice(s,c),!1)),s>0)if(0===i)_.splice.apply(_,n$3([0,0],r.slice(0,s),!1));else {for(var d=new e.Map,p=0;p<i;p++){var f=t[p];d.set(f.expression.text,!0);}for(p=s-1;p>=0;p--){var g=r[p];d.has(g.expression.text)||_.unshift(g);}}return e.isNodeArray(t)?e.setTextRange(F(_,t.hasTrailingComma),t):t},updateModifiers:function(t,r){var n;return "number"==typeof r&&(r=ae(r)),e.isParameter(t)?ue(t,t.decorators,r,t.dotDotDotToken,t.name,t.questionToken,t.type,t.initializer):e.isPropertySignature(t)?pe(t,r,t.name,t.questionToken,t.type):e.isPropertyDeclaration(t)?ge(t,t.decorators,r,t.name,null!==(n=t.questionToken)&&void 0!==n?n:t.exclamationToken,t.type,t.initializer):e.isMethodSignature(t)?ye(t,r,t.name,t.questionToken,t.typeParameters,t.parameters,t.type):e.isMethodDeclaration(t)?he(t,t.decorators,r,t.asteriskToken,t.name,t.questionToken,t.typeParameters,t.parameters,t.type,t.body):e.isConstructorDeclaration(t)?De(t,t.decorators,r,t.parameters,t.body):e.isGetAccessorDeclaration(t)?Te(t,t.decorators,r,t.name,t.parameters,t.type,t.body):e.isSetAccessorDeclaration(t)?Ee(t,t.decorators,r,t.name,t.parameters,t.body):e.isIndexSignatureDeclaration(t)?Ae(t,t.decorators,r,t.parameters,t.type):e.isFunctionExpression(t)?Et(t,r,t.asteriskToken,t.name,t.typeParameters,t.parameters,t.type,t.body):e.isArrowFunction(t)?Nt(t,r,t.typeParameters,t.parameters,t.type,t.equalsGreaterThanToken,t.body):e.isClassExpression(t)?Vt(t,t.decorators,r,t.name,t.typeParameters,t.heritageClauses,t.members):e.isVariableStatement(t)?rr(t,r,t.declarationList):e.isFunctionDeclaration(t)?Sr(t,t.decorators,r,t.asteriskToken,t.name,t.typeParameters,t.parameters,t.type,t.body):e.isClassDeclaration(t)?Cr(t,t.decorators,r,t.name,t.typeParameters,t.heritageClauses,t.members):e.isInterfaceDeclaration(t)?kr(t,t.decorators,r,t.name,t.typeParameters,t.heritageClauses,t.members):e.isTypeAliasDeclaration(t)?Fr(t,t.decorators,r,t.name,t.typeParameters,t.type):e.isEnumDeclaration(t)?Pr(t,t.decorators,r,t.name,t.members):e.isModuleDeclaration(t)?Ir(t,t.decorators,r,t.name,t.body):e.isImportEqualsDeclaration(t)?Br(t,t.decorators,r,t.isTypeOnly,t.name,t.moduleReference):e.isImportDeclaration(t)?Jr(t,t.decorators,r,t.importClause,t.moduleSpecifier,t.assertClause):e.isExportAssignment(t)?Qr(t,t.decorators,r,t.expression):e.isExportDeclaration(t)?Yr(t,t.decorators,r,t.isTypeOnly,t.exportClause,t.moduleSpecifier,t.assertClause):e.Debug.assertNever(t)}};return N;function F(t,r){if(void 0===t||t===e.emptyArray)t=[];else if(e.isNodeArray(t)){if(void 0===r||t.hasTrailingComma===r)return void 0===t.transformFlags&&p(t),e.Debug.attachNodeArrayDebugInfo(t),t;var n=t.slice();return n.pos=t.pos,n.end=t.end,n.hasTrailingComma=r,n.transformFlags=t.transformFlags,e.Debug.attachNodeArrayDebugInfo(n),n}var i=t.length,a=i>=1&&i<=4?t.slice():t;return e.setTextRangePosEnd(a,-1,-1),a.hasTrailingComma=!!r,p(a),e.Debug.attachNodeArrayDebugInfo(a),a}function A(e){return a.createBaseNode(e)}function P(e,t,r){var n=A(e);return n.decorators=_i(t),n.modifiers=_i(r),n.transformFlags|=d(n.decorators)|d(n.modifiers),n.symbol=void 0,n.localSymbol=void 0,n.locals=void 0,n.nextContainer=void 0,n}function w(t,r,n,i){var a=P(t,r,n);if(i=di(i),a.name=i,i)switch(a.kind){case 168:case 171:case 172:case 166:case 294:if(e.isIdentifier(i)){a.transformFlags|=u(i);break}default:a.transformFlags|=_(i);}return a}function I(e,t,r,n,i){var a=w(e,t,r,n);return a.typeParameters=_i(i),a.transformFlags|=d(a.typeParameters),i&&(a.transformFlags|=1),a}function O(e,t,r,n,i,a,o){var s=I(e,t,r,n,i);return s.parameters=F(a),s.type=o,s.transformFlags|=d(s.parameters)|_(s.type),o&&(s.transformFlags|=1),s}function M(e,t){return t.typeArguments&&(e.typeArguments=t.typeArguments),f(e,t)}function L(e,t,r,n,i,a,o,s){var c=O(e,t,r,n,i,a,o);return c.body=s,c.transformFlags|=-16777217&_(c.body),s||(c.transformFlags|=1),c}function R(e,t){return t.exclamationToken&&(e.exclamationToken=t.exclamationToken),t.typeArguments&&(e.typeArguments=t.typeArguments),M(e,t)}function B(e,t,r,n,i,a){var o=I(e,t,r,n,i);return o.heritageClauses=_i(a),o.transformFlags|=d(o.heritageClauses),o}function j(e,t,r,n,i,a,o){var s=B(e,t,r,n,i,a);return s.members=F(o),s.transformFlags|=d(s.members),s}function J(e,t,r,n,i){var a=w(e,t,r,n);return a.initializer=i,a.transformFlags|=_(a.initializer),a}function z(e,t,r,n,i,a){var o=J(e,t,r,n,a);return o.type=i,o.transformFlags|=_(i),i&&(o.transformFlags|=1),o}function U(e,t){var r=$(e);return r.text=t,r}function K(e,t){void 0===t&&(t=0);var r=U(8,"number"==typeof e?e+"":e);return r.numericLiteralFlags=t,384&t&&(r.transformFlags|=512),r}function V(t){var r=U(9,"string"==typeof t?t:e.pseudoBigIntToString(t)+"n");return r.transformFlags|=4,r}function q(e,t){var r=U(10,e);return r.singleQuote=t,r}function W(e,t,r){var n=q(e,t);return n.hasExtendedUnicodeEscape=r,r&&(n.transformFlags|=512),n}function H(e){return U(13,e)}function G(t,r){void 0===r&&t&&(r=e.stringToToken(t)),79===r&&(r=void 0);var n=a.createBaseIdentifierNode(79);return n.originalKeywordKind=r,n.escapedText=e.escapeLeadingUnderscores(t),n}function Q(e,t){var r=G(e,void 0);return r.autoGenerateFlags=t,r.autoGenerateId=i,i++,r}function X(e,t,r){var n=G(e,r);return t&&(n.typeArguments=F(t)),132===n.originalKeywordKind&&(n.transformFlags|=16777216),n}function Y(e,t){var r=1;t&&(r|=8);var n=Q("",r);return e&&e(n),n}function Z(t,r){void 0===r&&(r=0),e.Debug.assert(!(7&r),"Argument out of range: flags");var n=Q(t&&e.isIdentifier(t)?e.idText(t):"",4|r);return n.original=t,n}function $(e){return a.createBaseTokenNode(e)}function ee(t){e.Debug.assert(t>=0&&t<=159,"Invalid token"),e.Debug.assert(t<=14||t>=17,"Invalid token. Use 'createTemplateLiteralLikeNode' to create template literals."),e.Debug.assert(t<=8||t>=14,"Invalid token. Use 'createLiteralLikeNode' to create literals."),e.Debug.assert(79!==t,"Invalid token. Use 'createIdentifier' to create identifiers");var r=$(t),n=0;switch(t){case 131:n=192;break;case 123:case 121:case 122:case 144:case 126:case 135:case 85:case 130:case 146:case 157:case 143:case 147:case 158:case 149:case 133:case 150:case 114:case 154:case 152:n=1;break;case 106:n=33554944;break;case 124:n=512;break;case 108:n=8192;}return n&&(r.transformFlags|=n),r}function te(){return ee(108)}function re(){return ee(110)}function ne(){return ee(95)}function ie(e){return ee(e)}function ae(e){var t=[];return 1&e&&t.push(ie(93)),2&e&&t.push(ie(135)),512&e&&t.push(ie(88)),2048&e&&t.push(ie(85)),4&e&&t.push(ie(123)),8&e&&t.push(ie(121)),16&e&&t.push(ie(122)),128&e&&t.push(ie(126)),32&e&&t.push(ie(124)),16384&e&&t.push(ie(158)),64&e&&t.push(ie(144)),256&e&&t.push(ie(131)),t}function oe(e,t){var r=A(160);return r.left=e,r.right=di(t),r.transformFlags|=_(r.left)|u(r.right),r}function se(e){var t=A(161);return t.expression=g().parenthesizeExpressionOfComputedPropertyName(e),t.transformFlags|=66048|_(t.expression),t}function ce(e,t,r){var n=w(162,void 0,void 0,e);return n.constraint=t,n.default=r,n.transformFlags=1,n}function le(t,r,n,i,a,o,s){var c=z(163,t,r,i,o,s&&g().parenthesizeExpressionForDisallowedComma(s));return c.dotDotDotToken=n,c.questionToken=a,e.isThisIdentifier(c.name)?c.transformFlags=1:(c.transformFlags|=_(c.dotDotDotToken)|_(c.questionToken),a&&(c.transformFlags|=1),16476&e.modifiersToFlags(c.modifiers)&&(c.transformFlags|=4096),(s||n)&&(c.transformFlags|=512)),c}function ue(e,t,r,n,i,a,o,s){return e.decorators!==t||e.modifiers!==r||e.dotDotDotToken!==n||e.name!==i||e.questionToken!==a||e.type!==o||e.initializer!==s?f(le(t,r,n,i,a,o,s),e):e}function _e(e){var t=A(164);return t.expression=g().parenthesizeLeftSideOfAccess(e),t.transformFlags|=4097|_(t.expression),t}function de(e,t,r,n){var i=w(165,void 0,e,t);return i.type=n,i.questionToken=r,i.transformFlags=1,i}function pe(e,t,r,n,i){return e.modifiers!==t||e.name!==r||e.questionToken!==n||e.type!==i?f(de(t,r,n,i),e):e}function fe(t,r,n,i,a,o){var s=z(166,t,r,n,a,o);return s.questionToken=i&&e.isQuestionToken(i)?i:void 0,s.exclamationToken=i&&e.isExclamationToken(i)?i:void 0,s.transformFlags|=_(s.questionToken)|_(s.exclamationToken)|8388608,(e.isComputedPropertyName(s.name)||e.hasStaticModifier(s)&&s.initializer)&&(s.transformFlags|=4096),(i||2&e.modifiersToFlags(s.modifiers))&&(s.transformFlags|=1),s}function ge(t,r,n,i,a,o,s){return t.decorators!==r||t.modifiers!==n||t.name!==i||t.questionToken!==(void 0!==a&&e.isQuestionToken(a)?a:void 0)||t.exclamationToken!==(void 0!==a&&e.isExclamationToken(a)?a:void 0)||t.type!==o||t.initializer!==s?f(fe(r,n,i,a,o,s),t):t}function me(e,t,r,n,i,a){var o=O(167,void 0,e,t,n,i,a);return o.questionToken=r,o.transformFlags=1,o}function ye(e,t,r,n,i,a,o){return e.modifiers!==t||e.name!==r||e.questionToken!==n||e.typeParameters!==i||e.parameters!==a||e.type!==o?M(me(t,r,n,i,a,o),e):e}function ve(t,r,n,i,a,o,s,c,l){var u=L(168,t,r,i,o,s,c,l);return u.asteriskToken=n,u.questionToken=a,u.transformFlags|=_(u.asteriskToken)|_(u.questionToken)|512,a&&(u.transformFlags|=1),256&e.modifiersToFlags(u.modifiers)?u.transformFlags|=n?64:128:n&&(u.transformFlags|=1024),u}function he(e,t,r,n,i,a,o,s,c,l){return e.decorators!==t||e.modifiers!==r||e.asteriskToken!==n||e.name!==i||e.questionToken!==a||e.typeParameters!==o||e.parameters!==s||e.type!==c||e.body!==l?R(ve(t,r,n,i,a,o,s,c,l),e):e}function be(e,t,r){var n=I(169,e,t,void 0,void 0);return n.body=r,n.transformFlags=8388608|_(r),n}function xe(e,t,r,n){var i=L(170,e,t,void 0,void 0,r,void 0,n);return i.transformFlags|=512,i}function De(e,t,r,n,i){return e.decorators!==t||e.modifiers!==r||e.parameters!==n||e.body!==i?R(xe(t,r,n,i),e):e}function Se(e,t,r,n,i,a){return L(171,e,t,r,void 0,n,i,a)}function Te(e,t,r,n,i,a,o){return e.decorators!==t||e.modifiers!==r||e.name!==n||e.parameters!==i||e.type!==a||e.body!==o?R(Se(t,r,n,i,a,o),e):e}function Ce(e,t,r,n,i){return L(172,e,t,r,void 0,n,void 0,i)}function Ee(e,t,r,n,i,a){return e.decorators!==t||e.modifiers!==r||e.name!==n||e.parameters!==i||e.body!==a?R(Ce(t,r,n,i,a),e):e}function ke(e,t,r){var n=O(173,void 0,void 0,void 0,e,t,r);return n.transformFlags=1,n}function Ne(e,t,r){var n=O(174,void 0,void 0,void 0,e,t,r);return n.transformFlags=1,n}function Fe(e,t,r,n){var i=O(175,e,t,void 0,void 0,r,n);return i.transformFlags=1,i}function Ae(e,t,r,n,i){return e.parameters!==n||e.type!==i||e.decorators!==t||e.modifiers!==r?M(Fe(t,r,n,i),e):e}function Pe(e,t){var r=A(198);return r.type=e,r.literal=t,r.transformFlags=1,r}function we(e,t,r){var n=A(176);return n.assertsModifier=e,n.parameterName=di(t),n.type=r,n.transformFlags=1,n}function Ie(e,t){var r=A(177);return r.typeName=di(e),r.typeArguments=t&&g().parenthesizeTypeArguments(F(t)),r.transformFlags=1,r}function Oe(e,t,r){var n=O(178,void 0,void 0,void 0,e,t,r);return n.transformFlags=1,n}function Me(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return 4===t.length?Le.apply(void 0,t):3===t.length?Re.apply(void 0,t):e.Debug.fail("Incorrect number of arguments specified.")}function Le(e,t,r,n){var i=O(179,void 0,e,void 0,t,r,n);return i.transformFlags=1,i}function Re(e,t,r){return Le(void 0,e,t,r)}function Be(e,t,r,n,i){return e.modifiers!==t||e.typeParameters!==r||e.parameters!==n||e.type!==i?M(Me(t,r,n,i),e):e}function je(e,t,r,n){return Be(e,e.modifiers,t,r,n)}function Je(e){var t=A(180);return t.exprName=e,t.transformFlags=1,t}function ze(e){var t=A(181);return t.members=F(e),t.transformFlags=1,t}function Ue(e){var t=A(182);return t.elementType=g().parenthesizeElementTypeOfArrayType(e),t.transformFlags=1,t}function Ke(e){var t=A(183);return t.elements=F(e),t.transformFlags=1,t}function Ve(e,t,r,n){var i=A(196);return i.dotDotDotToken=e,i.name=t,i.questionToken=r,i.type=n,i.transformFlags=1,i}function qe(e){var t=A(184);return t.type=g().parenthesizeElementTypeOfArrayType(e),t.transformFlags=1,t}function We(e){var t=A(185);return t.type=e,t.transformFlags=1,t}function He(e,t){var r=A(e);return r.types=g().parenthesizeConstituentTypesOfUnionOrIntersectionType(t),r.transformFlags=1,r}function Ge(e,t){return e.types!==t?f(He(e.kind,t),e):e}function Qe(e,t,r,n){var i=A(188);return i.checkType=g().parenthesizeMemberOfConditionalType(e),i.extendsType=g().parenthesizeMemberOfConditionalType(t),i.trueType=r,i.falseType=n,i.transformFlags=1,i}function Xe(e){var t=A(189);return t.typeParameter=e,t.transformFlags=1,t}function Ye(e,t){var r=A(197);return r.head=e,r.templateSpans=F(t),r.transformFlags=1,r}function Ze(e,t,r,n){void 0===n&&(n=!1);var i=A(199);return i.argument=e,i.qualifier=t,i.typeArguments=r&&g().parenthesizeTypeArguments(r),i.isTypeOf=n,i.transformFlags=1,i}function $e(e){var t=A(190);return t.type=e,t.transformFlags=1,t}function et(e,t){var r=A(192);return r.operator=e,r.type=g().parenthesizeMemberOfElementType(t),r.transformFlags=1,r}function tt(e,t){var r=A(193);return r.objectType=g().parenthesizeMemberOfElementType(e),r.indexType=t,r.transformFlags=1,r}function rt(e,t,r,n,i,a){var o=A(194);return o.readonlyToken=e,o.typeParameter=t,o.nameType=r,o.questionToken=n,o.type=i,o.members=a&&F(a),o.transformFlags=1,o}function nt(e){var t=A(195);return t.literal=e,t.transformFlags=1,t}function it(e){var t=A(200);return t.elements=F(e),t.transformFlags|=262656|d(t.elements),16384&t.transformFlags&&(t.transformFlags|=32832),t}function at(e){var t=A(201);return t.elements=F(e),t.transformFlags|=262656|d(t.elements),t}function ot(t,r,n,i){var a=J(202,void 0,void 0,n,i&&g().parenthesizeExpressionForDisallowedComma(i));return a.propertyName=di(r),a.dotDotDotToken=t,a.transformFlags|=512|_(a.dotDotDotToken),a.propertyName&&(a.transformFlags|=e.isIdentifier(a.propertyName)?u(a.propertyName):_(a.propertyName)),t&&(a.transformFlags|=16384),a}function st(e){return A(e)}function ct(t,r){var n=st(203),i=t&&e.lastOrUndefined(t),a=F(t,!(!i||!e.isOmittedExpression(i))||void 0);return n.elements=g().parenthesizeExpressionsOfCommaDelimitedList(a),n.multiLine=r,n.transformFlags|=d(n.elements),n}function lt(e,t){var r=st(204);return r.properties=F(e),r.multiLine=t,r.transformFlags|=d(r.properties),r}function ut(t,r){var n=st(205);return n.expression=g().parenthesizeLeftSideOfAccess(t),n.name=di(r),n.transformFlags=_(n.expression)|(e.isIdentifier(n.name)?u(n.name):_(n.name)),e.isSuperKeyword(t)&&(n.transformFlags|=192),n}function _t(t,r,n){var i=st(205);return i.flags|=32,i.expression=g().parenthesizeLeftSideOfAccess(t),i.questionDotToken=r,i.name=di(n),i.transformFlags|=16|_(i.expression)|_(i.questionDotToken)|(e.isIdentifier(i.name)?u(i.name):_(i.name)),i}function dt(t,r,n,i){return e.Debug.assert(!!(32&t.flags),"Cannot update a PropertyAccessExpression using updatePropertyAccessChain. Use updatePropertyAccess instead."),t.expression!==r||t.questionDotToken!==n||t.name!==i?f(_t(r,n,i),t):t}function pt(t,r){var n=st(206);return n.expression=g().parenthesizeLeftSideOfAccess(t),n.argumentExpression=pi(r),n.transformFlags|=_(n.expression)|_(n.argumentExpression),e.isSuperKeyword(t)&&(n.transformFlags|=192),n}function ft(e,t,r){var n=st(206);return n.flags|=32,n.expression=g().parenthesizeLeftSideOfAccess(e),n.questionDotToken=t,n.argumentExpression=pi(r),n.transformFlags|=_(n.expression)|_(n.questionDotToken)|_(n.argumentExpression)|16,n}function gt(t,r,n,i){return e.Debug.assert(!!(32&t.flags),"Cannot update a ElementAccessExpression using updateElementAccessChain. Use updateElementAccess instead."),t.expression!==r||t.questionDotToken!==n||t.argumentExpression!==i?f(ft(r,n,i),t):t}function mt(t,r,n){var i=st(207);return i.expression=g().parenthesizeLeftSideOfAccess(t),i.typeArguments=_i(r),i.arguments=g().parenthesizeExpressionsOfCommaDelimitedList(F(n)),i.transformFlags|=_(i.expression)|d(i.typeArguments)|d(i.arguments),i.typeArguments&&(i.transformFlags|=1),e.isImportKeyword(i.expression)?i.transformFlags|=4194304:e.isSuperProperty(i.expression)&&(i.transformFlags|=8192),i}function yt(t,r,n,i){var a=st(207);return a.flags|=32,a.expression=g().parenthesizeLeftSideOfAccess(t),a.questionDotToken=r,a.typeArguments=_i(n),a.arguments=g().parenthesizeExpressionsOfCommaDelimitedList(F(i)),a.transformFlags|=_(a.expression)|_(a.questionDotToken)|d(a.typeArguments)|d(a.arguments)|16,a.typeArguments&&(a.transformFlags|=1),e.isSuperProperty(a.expression)&&(a.transformFlags|=8192),a}function vt(t,r,n,i,a){return e.Debug.assert(!!(32&t.flags),"Cannot update a CallExpression using updateCallChain. Use updateCall instead."),t.expression!==r||t.questionDotToken!==n||t.typeArguments!==i||t.arguments!==a?f(yt(r,n,i,a),t):t}function ht(e,t,r){var n=st(208);return n.expression=g().parenthesizeExpressionOfNew(e),n.typeArguments=_i(t),n.arguments=r?g().parenthesizeExpressionsOfCommaDelimitedList(r):void 0,n.transformFlags|=_(n.expression)|d(n.typeArguments)|d(n.arguments)|16,n.typeArguments&&(n.transformFlags|=1),n}function bt(t,r,n){var i=st(209);return i.tag=g().parenthesizeLeftSideOfAccess(t),i.typeArguments=_i(r),i.template=n,i.transformFlags|=_(i.tag)|d(i.typeArguments)|_(i.template)|512,i.typeArguments&&(i.transformFlags|=1),e.hasInvalidEscape(i.template)&&(i.transformFlags|=64),i}function xt(e,t){var r=st(210);return r.expression=g().parenthesizeOperandOfPrefixUnary(t),r.type=e,r.transformFlags|=_(r.expression)|_(r.type)|1,r}function Dt(e,t,r){return e.type!==t||e.expression!==r?f(xt(t,r),e):e}function St(e){var t=st(211);return t.expression=e,t.transformFlags=_(t.expression),t}function Tt(e,t){return e.expression!==t?f(St(t),e):e}function Ct(t,r,n,i,a,o,s){var c=L(212,void 0,t,n,i,a,o,s);return c.asteriskToken=r,c.transformFlags|=_(c.asteriskToken),c.typeParameters&&(c.transformFlags|=1),256&e.modifiersToFlags(c.modifiers)?c.asteriskToken?c.transformFlags|=64:c.transformFlags|=128:c.asteriskToken&&(c.transformFlags|=1024),c}function Et(e,t,r,n,i,a,o,s){return e.name!==n||e.modifiers!==t||e.asteriskToken!==r||e.typeParameters!==i||e.parameters!==a||e.type!==o||e.body!==s?R(Ct(t,r,n,i,a,o,s),e):e}function kt(t,r,n,i,a,o){var s=L(213,void 0,t,void 0,r,n,i,g().parenthesizeConciseBodyOfArrowFunction(o));return s.equalsGreaterThanToken=null!=a?a:ee(38),s.transformFlags|=512|_(s.equalsGreaterThanToken),256&e.modifiersToFlags(s.modifiers)&&(s.transformFlags|=8320),s}function Nt(e,t,r,n,i,a,o){return e.modifiers!==t||e.typeParameters!==r||e.parameters!==n||e.type!==i||e.equalsGreaterThanToken!==a||e.body!==o?R(kt(t,r,n,i,a,o),e):e}function Ft(e){var t=st(214);return t.expression=g().parenthesizeOperandOfPrefixUnary(e),t.transformFlags|=_(t.expression),t}function At(e){var t=st(215);return t.expression=g().parenthesizeOperandOfPrefixUnary(e),t.transformFlags|=_(t.expression),t}function Pt(e){var t=st(216);return t.expression=g().parenthesizeOperandOfPrefixUnary(e),t.transformFlags|=_(t.expression),t}function wt(e){var t=st(217);return t.expression=g().parenthesizeOperandOfPrefixUnary(e),t.transformFlags|=1048768|_(t.expression),t}function It(t,r){var n=st(218);return n.operator=t,n.operand=g().parenthesizeOperandOfPrefixUnary(r),n.transformFlags|=_(n.operand),45!==t&&46!==t||!e.isIdentifier(n.operand)||e.isGeneratedIdentifier(n.operand)||e.isLocalName(n.operand)||(n.transformFlags|=67108864),n}function Ot(t,r){var n=st(219);return n.operator=r,n.operand=g().parenthesizeOperandOfPostfixUnary(t),n.transformFlags|=_(n.operand),!e.isIdentifier(n.operand)||e.isGeneratedIdentifier(n.operand)||e.isLocalName(n.operand)||(n.transformFlags|=67108864),n}function Mt(t,r,n){var i,a=st(220),o="number"==typeof(i=r)?ee(i):i,s=o.kind;return a.left=g().parenthesizeLeftSideOfBinary(s,t),a.operatorToken=o,a.right=g().parenthesizeRightSideOfBinary(s,a.left,n),a.transformFlags|=_(a.left)|_(a.operatorToken)|_(a.right),60===s?a.transformFlags|=16:63===s?e.isObjectLiteralExpression(a.left)?a.transformFlags|=2624|Lt(a.left):e.isArrayLiteralExpression(a.left)&&(a.transformFlags|=2560|Lt(a.left)):42===s||67===s?a.transformFlags|=256:e.isLogicalOrCoalescingAssignmentOperator(s)&&(a.transformFlags|=8),a}function Lt(t){if(32768&t.transformFlags)return 32768;if(64&t.transformFlags)for(var r=0,n=e.getElementsOfBindingOrAssignmentPattern(t);r<n.length;r++){var i=n[r],a=e.getTargetOfBindingOrAssignmentElement(i);if(a&&e.isAssignmentPattern(a)){if(32768&a.transformFlags)return 32768;if(64&a.transformFlags){var o=Lt(a);if(o)return o}}}return 0}function Rt(e,t,r,n,i){var a=st(221);return a.condition=g().parenthesizeConditionOfConditionalExpression(e),a.questionToken=null!=t?t:ee(57),a.whenTrue=g().parenthesizeBranchOfConditionalExpression(r),a.colonToken=null!=n?n:ee(58),a.whenFalse=g().parenthesizeBranchOfConditionalExpression(i),a.transformFlags|=_(a.condition)|_(a.questionToken)|_(a.whenTrue)|_(a.colonToken)|_(a.whenFalse),a}function Bt(e,t){var r=st(222);return r.head=e,r.templateSpans=F(t),r.transformFlags|=_(r.head)|d(r.templateSpans)|512,r}function jt(r,n,i,a){void 0===a&&(a=0),e.Debug.assert(!(-2049&a),"Unsupported template flags.");var o=void 0;if(void 0!==i&&i!==n&&"object"==typeof(o=function(r,n){switch(t||(t=e.createScanner(99,!1,0)),r){case 14:t.setText("`"+n+"`");break;case 15:t.setText("`"+n+"${");break;case 16:t.setText("}"+n+"${");break;case 17:t.setText("}"+n+"`");}var i,a=t.scan();if(19===a&&(a=t.reScanTemplateToken(!1)),t.isUnterminated())return t.setText(void 0),l;switch(a){case 14:case 15:case 16:case 17:i=t.getTokenValue();}return void 0===i||1!==t.scan()?(t.setText(void 0),l):(t.setText(void 0),i)}(r,i)))return e.Debug.fail("Invalid raw text");if(void 0===n){if(void 0===o)return e.Debug.fail("Arguments 'text' and 'rawText' may not both be undefined.");n=o;}else void 0!==o&&e.Debug.assert(n===o,"Expected argument 'text' to be the normalized (i.e. 'cooked') version of argument 'rawText'.");return Jt(r,n,i,a)}function Jt(e,t,r,n){var i=$(e);return i.text=t,i.rawText=r,i.templateFlags=2048&n,i.transformFlags|=512,i.templateFlags&&(i.transformFlags|=64),i}function zt(t,r){e.Debug.assert(!t||!!r,"A `YieldExpression` with an asteriskToken must have an expression.");var n=st(223);return n.expression=r&&g().parenthesizeExpressionForDisallowedComma(r),n.asteriskToken=t,n.transformFlags|=_(n.expression)|_(n.asteriskToken)|524864,n}function Ut(e){var t=st(224);return t.expression=g().parenthesizeExpressionForDisallowedComma(e),t.transformFlags|=16896|_(t.expression),t}function Kt(e,t,r,n,i,a){var o=j(225,e,t,r,n,i,a);return o.transformFlags|=512,o}function Vt(e,t,r,n,i,a,o){return e.decorators!==t||e.modifiers!==r||e.name!==n||e.typeParameters!==i||e.heritageClauses!==a||e.members!==o?f(Kt(t,r,n,i,a,o),e):e}function qt(e,t){var r=A(227);return r.expression=g().parenthesizeLeftSideOfAccess(e),r.typeArguments=t&&g().parenthesizeTypeArguments(t),r.transformFlags|=_(r.expression)|d(r.typeArguments)|512,r}function Wt(e,t){var r=st(228);return r.expression=e,r.type=t,r.transformFlags|=_(r.expression)|_(r.type)|1,r}function Ht(e,t,r){return e.expression!==t||e.type!==r?f(Wt(t,r),e):e}function Gt(e){var t=st(229);return t.expression=g().parenthesizeLeftSideOfAccess(e),t.transformFlags|=1|_(t.expression),t}function Qt(t,r){return e.isNonNullChain(t)?Yt(t,r):t.expression!==r?f(Gt(r),t):t}function Xt(e){var t=st(229);return t.flags|=32,t.expression=g().parenthesizeLeftSideOfAccess(e),t.transformFlags|=1|_(t.expression),t}function Yt(t,r){return e.Debug.assert(!!(32&t.flags),"Cannot update a NonNullExpression using updateNonNullChain. Use updateNonNullExpression instead."),t.expression!==r?f(Xt(r),t):t}function Zt(t,r){var n=st(230);switch(n.keywordToken=t,n.name=r,n.transformFlags|=_(n.name),t){case 103:n.transformFlags|=512;break;case 100:n.transformFlags|=4;break;default:return e.Debug.assertNever(t)}return n}function $t(e,t){var r=A(232);return r.expression=e,r.literal=t,r.transformFlags|=_(r.expression)|_(r.literal)|512,r}function er(e,t){var r=A(234);return r.statements=F(e),r.multiLine=t,r.transformFlags|=d(r.statements),r}function tr(t,r){var n=P(236,void 0,t);return n.declarationList=e.isArray(r)?xr(r):r,n.transformFlags|=_(n.declarationList),2&e.modifiersToFlags(n.modifiers)&&(n.transformFlags=1),n}function rr(e,t,r){return e.modifiers!==t||e.declarationList!==r?f(tr(t,r),e):e}function nr(){return A(235)}function ir(e){var t=A(237);return t.expression=g().parenthesizeExpressionOfExpressionStatement(e),t.transformFlags|=_(t.expression),t}function ar(e,t,r){var n=A(238);return n.expression=e,n.thenStatement=fi(t),n.elseStatement=fi(r),n.transformFlags|=_(n.expression)|_(n.thenStatement)|_(n.elseStatement),n}function or(e,t){var r=A(239);return r.statement=fi(e),r.expression=t,r.transformFlags|=_(r.statement)|_(r.expression),r}function sr(e,t){var r=A(240);return r.expression=e,r.statement=fi(t),r.transformFlags|=_(r.expression)|_(r.statement),r}function cr(e,t,r,n){var i=A(241);return i.initializer=e,i.condition=t,i.incrementor=r,i.statement=fi(n),i.transformFlags|=_(i.initializer)|_(i.condition)|_(i.incrementor)|_(i.statement),i}function lr(e,t,r){var n=A(242);return n.initializer=e,n.expression=t,n.statement=fi(r),n.transformFlags|=_(n.initializer)|_(n.expression)|_(n.statement),n}function ur(e,t,r,n){var i=A(243);return i.awaitModifier=e,i.initializer=t,i.expression=g().parenthesizeExpressionForDisallowedComma(r),i.statement=fi(n),i.transformFlags|=_(i.awaitModifier)|_(i.initializer)|_(i.expression)|_(i.statement)|512,e&&(i.transformFlags|=64),i}function _r(e){var t=A(244);return t.label=di(e),t.transformFlags|=2097152|_(t.label),t}function dr(e){var t=A(245);return t.label=di(e),t.transformFlags|=2097152|_(t.label),t}function pr(e){var t=A(246);return t.expression=e,t.transformFlags|=2097216|_(t.expression),t}function fr(e,t){var r=A(247);return r.expression=e,r.statement=fi(t),r.transformFlags|=_(r.expression)|_(r.statement),r}function gr(e,t){var r=A(248);return r.expression=g().parenthesizeExpressionForDisallowedComma(e),r.caseBlock=t,r.transformFlags|=_(r.expression)|_(r.caseBlock),r}function mr(e,t){var r=A(249);return r.label=di(e),r.statement=fi(t),r.transformFlags|=_(r.label)|_(r.statement),r}function yr(e,t,r){return e.label!==t||e.statement!==r?f(mr(t,r),e):e}function vr(e){var t=A(250);return t.expression=e,t.transformFlags|=_(t.expression),t}function hr(e,t,r){var n=A(251);return n.tryBlock=e,n.catchClause=t,n.finallyBlock=r,n.transformFlags|=_(n.tryBlock)|_(n.catchClause)|_(n.finallyBlock),n}function br(e,t,r,n){var i=z(253,void 0,void 0,e,r,n&&g().parenthesizeExpressionForDisallowedComma(n));return i.exclamationToken=t,i.transformFlags|=_(i.exclamationToken),t&&(i.transformFlags|=1),i}function xr(e,t){void 0===t&&(t=0);var r=A(254);return r.flags|=3&t,r.declarations=F(e),r.transformFlags|=2097152|d(r.declarations),3&t&&(r.transformFlags|=131584),r}function Dr(t,r,n,i,a,o,s,c){var l=L(255,t,r,i,a,o,s,c);return l.asteriskToken=n,!l.body||2&e.modifiersToFlags(l.modifiers)?l.transformFlags=1:(l.transformFlags|=2097152|_(l.asteriskToken),256&e.modifiersToFlags(l.modifiers)?l.asteriskToken?l.transformFlags|=64:l.transformFlags|=128:l.asteriskToken&&(l.transformFlags|=1024)),l}function Sr(e,t,r,n,i,a,o,s,c){return e.decorators!==t||e.modifiers!==r||e.asteriskToken!==n||e.name!==i||e.typeParameters!==a||e.parameters!==o||e.type!==s||e.body!==c?R(Dr(t,r,n,i,a,o,s,c),e):e}function Tr(t,r,n,i,a,o){var s=j(256,t,r,n,i,a,o);return 2&e.modifiersToFlags(s.modifiers)?s.transformFlags=1:(s.transformFlags|=512,4096&s.transformFlags&&(s.transformFlags|=1)),s}function Cr(e,t,r,n,i,a,o){return e.decorators!==t||e.modifiers!==r||e.name!==n||e.typeParameters!==i||e.heritageClauses!==a||e.members!==o?f(Tr(t,r,n,i,a,o),e):e}function Er(e,t,r,n,i,a){var o=B(257,e,t,r,n,i);return o.members=F(a),o.transformFlags=1,o}function kr(e,t,r,n,i,a,o){return e.decorators!==t||e.modifiers!==r||e.name!==n||e.typeParameters!==i||e.heritageClauses!==a||e.members!==o?f(Er(t,r,n,i,a,o),e):e}function Nr(e,t,r,n,i){var a=I(258,e,t,r,n);return a.type=i,a.transformFlags=1,a}function Fr(e,t,r,n,i,a){return e.decorators!==t||e.modifiers!==r||e.name!==n||e.typeParameters!==i||e.type!==a?f(Nr(t,r,n,i,a),e):e}function Ar(e,t,r,n){var i=w(259,e,t,r);return i.members=F(n),i.transformFlags|=1|d(i.members),i.transformFlags&=-16777217,i}function Pr(e,t,r,n,i){return e.decorators!==t||e.modifiers!==r||e.name!==n||e.members!==i?f(Ar(t,r,n,i),e):e}function wr(t,r,n,i,a){void 0===a&&(a=0);var o=P(260,t,r);return o.flags|=1044&a,o.name=n,o.body=i,2&e.modifiersToFlags(o.modifiers)?o.transformFlags=1:o.transformFlags|=_(o.name)|_(o.body)|1,o.transformFlags&=-16777217,o}function Ir(e,t,r,n,i){return e.decorators!==t||e.modifiers!==r||e.name!==n||e.body!==i?f(wr(t,r,n,i,e.flags),e):e}function Or(e){var t=A(261);return t.statements=F(e),t.transformFlags|=d(t.statements),t}function Mr(e){var t=A(262);return t.clauses=F(e),t.transformFlags|=d(t.clauses),t}function Lr(e){var t=w(263,void 0,void 0,e);return t.transformFlags=1,t}function Rr(t,r,n,i,a){var o=w(264,t,r,i);return o.isTypeOnly=n,o.moduleReference=a,o.transformFlags|=_(o.moduleReference),e.isExternalModuleReference(o.moduleReference)||(o.transformFlags|=1),o.transformFlags&=-16777217,o}function Br(e,t,r,n,i,a){return e.decorators!==t||e.modifiers!==r||e.isTypeOnly!==n||e.name!==i||e.moduleReference!==a?f(Rr(t,r,n,i,a),e):e}function jr(e,t,r,n,i){var a=P(265,e,t);return a.importClause=r,a.moduleSpecifier=n,a.assertClause=i,a.transformFlags|=_(a.importClause)|_(a.moduleSpecifier),a.transformFlags&=-16777217,a}function Jr(e,t,r,n,i,a){return e.decorators!==t||e.modifiers!==r||e.importClause!==n||e.moduleSpecifier!==i||e.assertClause!==a?f(jr(t,r,n,i,a),e):e}function zr(e,t,r){var n=A(266);return n.isTypeOnly=e,n.name=t,n.namedBindings=r,n.transformFlags|=_(n.name)|_(n.namedBindings),e&&(n.transformFlags|=1),n.transformFlags&=-16777217,n}function Ur(e,t){var r=A(292);return r.elements=e,r.multiLine=t,r.transformFlags|=4,r}function Kr(e,t){var r=A(293);return r.name=e,r.value=t,r.transformFlags|=4,r}function Vr(e){var t=A(267);return t.name=e,t.transformFlags|=_(t.name),t.transformFlags&=-16777217,t}function qr(e){var t=A(273);return t.name=e,t.transformFlags|=4|_(t.name),t.transformFlags&=-16777217,t}function Wr(e){var t=A(268);return t.elements=F(e),t.transformFlags|=d(t.elements),t.transformFlags&=-16777217,t}function Hr(e,t,r){var n=A(269);return n.isTypeOnly=e,n.propertyName=t,n.name=r,n.transformFlags|=_(n.propertyName)|_(n.name),n.transformFlags&=-16777217,n}function Gr(e,t,r,n){var i=P(270,e,t);return i.isExportEquals=r,i.expression=r?g().parenthesizeRightSideOfBinary(63,void 0,n):g().parenthesizeExpressionOfExportDefault(n),i.transformFlags|=_(i.expression),i.transformFlags&=-16777217,i}function Qr(e,t,r,n){return e.decorators!==t||e.modifiers!==r||e.expression!==n?f(Gr(t,r,e.isExportEquals,n),e):e}function Xr(e,t,r,n,i,a){var o=P(271,e,t);return o.isTypeOnly=r,o.exportClause=n,o.moduleSpecifier=i,o.assertClause=a,o.transformFlags|=_(o.exportClause)|_(o.moduleSpecifier),o.transformFlags&=-16777217,o}function Yr(e,t,r,n,i,a,o){return e.decorators!==t||e.modifiers!==r||e.isTypeOnly!==n||e.exportClause!==i||e.moduleSpecifier!==a||e.assertClause!==o?f(Xr(t,r,n,i,a,o),e):e}function Zr(e){var t=A(272);return t.elements=F(e),t.transformFlags|=d(t.elements),t.transformFlags&=-16777217,t}function $r(e,t,r){var n=A(274);return n.isTypeOnly=e,n.propertyName=di(t),n.name=di(r),n.transformFlags|=_(n.propertyName)|_(n.name),n.transformFlags&=-16777217,n}function en(e){var t=A(276);return t.expression=e,t.transformFlags|=_(t.expression),t.transformFlags&=-16777217,t}function tn(e,t){var r=A(e);return r.type=t,r}function rn(e,t){return O(315,void 0,void 0,void 0,void 0,e,t)}function nn(e,t){void 0===t&&(t=!1);var r=A(320);return r.jsDocPropertyTags=_i(e),r.isArrayType=t,r}function an(e){var t=A(307);return t.type=e,t}function on(e,t,r){var n=A(321);return n.typeParameters=_i(e),n.parameters=F(t),n.type=r,n}function sn(t){var r=c(t.kind);return t.tagName.escapedText===e.escapeLeadingUnderscores(r)?t.tagName:X(r)}function cn(e,t,r){var n=A(e);return n.tagName=t,n.comment=r,n}function ln(e,t,r,n){var i=cn(342,null!=e?e:X("template"),n);return i.constraint=t,i.typeParameters=F(r),i}function un(t,r,n,i){var a=cn(343,null!=t?t:X("typedef"),i);return a.typeExpression=r,a.fullName=n,a.name=e.getJSDocTypeAliasName(n),a}function _n(e,t,r,n,i,a){var o=cn(338,null!=e?e:X("param"),a);return o.typeExpression=n,o.name=t,o.isNameFirst=!!i,o.isBracketed=r,o}function dn(e,t,r,n,i,a){var o=cn(345,null!=e?e:X("prop"),a);return o.typeExpression=n,o.name=t,o.isNameFirst=!!i,o.isBracketed=r,o}function pn(t,r,n,i){var a=cn(336,null!=t?t:X("callback"),i);return a.typeExpression=r,a.fullName=n,a.name=e.getJSDocTypeAliasName(n),a}function fn(e,t,r){var n=cn(326,null!=e?e:X("augments"),r);return n.class=t,n}function gn(e,t,r){var n=cn(327,null!=e?e:X("implements"),r);return n.class=t,n}function mn(e,t,r){var n=cn(344,null!=e?e:X("see"),r);return n.name=t,n}function yn(e){var t=A(308);return t.name=e,t}function vn(e,t){var r=A(309);return r.left=e,r.right=t,r.transformFlags|=_(r.left)|_(r.right),r}function hn(e,t){var r=A(322);return r.name=e,r.text=t,r}function bn(e,t){var r=A(323);return r.name=e,r.text=t,r}function xn(e,t){var r=A(324);return r.name=e,r.text=t,r}function Dn(e,t,r){return cn(e,null!=t?t:X(c(e)),r)}function Sn(e,t,r,n){var i=cn(e,null!=t?t:X(c(e)),n);return i.typeExpression=r,i}function Tn(e,t){return cn(325,e,t)}function Cn(e){var t=A(319);return t.text=e,t}function En(e,t){var r=A(318);return r.comment=e,r.tags=_i(t),r}function kn(e,t,r){var n=A(277);return n.openingElement=e,n.children=F(t),n.closingElement=r,n.transformFlags|=_(n.openingElement)|d(n.children)|_(n.closingElement)|2,n}function Nn(e,t,r){var n=A(278);return n.tagName=e,n.typeArguments=_i(t),n.attributes=r,n.transformFlags|=_(n.tagName)|d(n.typeArguments)|_(n.attributes)|2,n.typeArguments&&(n.transformFlags|=1),n}function Fn(e,t,r){var n=A(279);return n.tagName=e,n.typeArguments=_i(t),n.attributes=r,n.transformFlags|=_(n.tagName)|d(n.typeArguments)|_(n.attributes)|2,t&&(n.transformFlags|=1),n}function An(e){var t=A(280);return t.tagName=e,t.transformFlags|=2|_(t.tagName),t}function Pn(e,t,r){var n=A(281);return n.openingFragment=e,n.children=F(t),n.closingFragment=r,n.transformFlags|=_(n.openingFragment)|d(n.children)|_(n.closingFragment)|2,n}function wn(e,t){var r=A(11);return r.text=e,r.containsOnlyTriviaWhiteSpaces=!!t,r.transformFlags|=2,r}function In(e,t){var r=A(284);return r.name=e,r.initializer=t,r.transformFlags|=_(r.name)|_(r.initializer)|2,r}function On(e){var t=A(285);return t.properties=F(e),t.transformFlags|=2|d(t.properties),t}function Mn(e){var t=A(286);return t.expression=e,t.transformFlags|=2|_(t.expression),t}function Ln(e,t){var r=A(287);return r.dotDotDotToken=e,r.expression=t,r.transformFlags|=_(r.dotDotDotToken)|_(r.expression)|2,r}function Rn(e,t){var r=A(288);return r.expression=g().parenthesizeExpressionForDisallowedComma(e),r.statements=F(t),r.transformFlags|=_(r.expression)|d(r.statements),r}function Bn(e){var t=A(289);return t.statements=F(e),t.transformFlags=d(t.statements),t}function jn(t,r){var n=A(290);switch(n.token=t,n.types=F(r),n.transformFlags|=d(n.types),t){case 94:n.transformFlags|=512;break;case 117:n.transformFlags|=1;break;default:return e.Debug.assertNever(t)}return n}function Jn(t,r){var n=A(291);return ("string"==typeof t||t&&!e.isVariableDeclaration(t))&&(t=br(t,void 0,void 0,void 0)),n.variableDeclaration=t,n.block=r,n.transformFlags|=_(n.variableDeclaration)|_(n.block),t||(n.transformFlags|=32),n}function zn(e,t){var r=w(294,void 0,void 0,e);return r.initializer=g().parenthesizeExpressionForDisallowedComma(t),r.transformFlags|=_(r.name)|_(r.initializer),r}function Un(e,t){var r=w(295,void 0,void 0,e);return r.objectAssignmentInitializer=t&&g().parenthesizeExpressionForDisallowedComma(t),r.transformFlags|=512|_(r.objectAssignmentInitializer),r}function Kn(e){var t=A(296);return t.expression=g().parenthesizeExpressionForDisallowedComma(e),t.transformFlags|=32832|_(t.expression),t}function Vn(e,t){var r=A(297);return r.name=di(e),r.initializer=t&&g().parenthesizeExpressionForDisallowedComma(t),r.transformFlags|=_(r.name)|_(r.initializer)|1,r}function qn(t,r){void 0===r&&(r=e.emptyArray);var n=A(304);return n.prepends=r,n.sourceFiles=t,n}function Wn(e,t){var r=A(e);return r.data=t,r}function Hn(t,r){var n=A(348);return n.expression=t,n.original=r,n.transformFlags|=1|_(n.expression),e.setTextRange(n,r),n}function Gn(e,t){return e.expression!==t?f(Hn(t,e.original),e):e}function Qn(t){if(e.nodeIsSynthesized(t)&&!e.isParseTreeNode(t)&&!t.original&&!t.emitNode&&!t.id){if(e.isCommaListExpression(t))return t.elements;if(e.isBinaryExpression(t)&&e.isCommaToken(t.operatorToken))return [t.left,t.right]}return t}function Xn(t){var r=A(349);return r.elements=F(e.sameFlatMap(t,Qn)),r.transformFlags|=d(r.elements),r}function Yn(e,t){var r=A(352);return r.expression=e,r.thisArg=t,r.transformFlags|=_(r.expression)|_(r.thisArg),r}function Zn(t){if(void 0===t)return t;var r=e.isSourceFile(t)?a.createBaseSourceFileNode(303):e.isIdentifier(t)?a.createBaseIdentifierNode(79):e.isPrivateIdentifier(t)?a.createBasePrivateIdentifierNode(80):e.isNodeKind(t.kind)?a.createBaseNode(t.kind):a.createBaseTokenNode(t.kind);for(var n in r.flags|=-9&t.flags,r.transformFlags=t.transformFlags,h(r,t),t)!r.hasOwnProperty(n)&&t.hasOwnProperty(n)&&(r[n]=t[n]);return r}function $n(){return Pt(K("0"))}function ei(t,r,n){return e.isCallChain(t)?yt(_t(t,void 0,r),void 0,void 0,n):mt(ut(t,r),void 0,n)}function ti(e,t,r){return ei(X(e),t,r)}function ri(e,t,r){return !!r&&(e.push(zn(t,r)),!0)}function ni(t,r){var n=e.skipParentheses(t);switch(n.kind){case 79:return r;case 108:case 8:case 9:case 10:return !1;case 203:return 0!==n.elements.length;case 204:return n.properties.length>0;default:return !0}}function ii(t,r,n,i){void 0===i&&(i=0);var a=e.getNameOfDeclaration(t);if(a&&e.isIdentifier(a)&&!e.isGeneratedIdentifier(a)){var o=e.setParent(e.setTextRange(Zn(a),a),a.parent);return i|=e.getEmitFlags(a),n||(i|=48),r||(i|=1536),i&&e.setEmitFlags(o,i),o}return Z(t)}function ai(e,t,r){return ii(e,t,r,8192)}function oi(t,r,n,i){var a=ut(t,e.nodeIsSynthesized(r)?r:Zn(r));e.setTextRange(a,r);var o=0;return i||(o|=48),n||(o|=1536),o&&e.setEmitFlags(a,o),a}function si(){return e.startOnNewLine(ir(W("use strict")))}function ci(t,r,n){e.Debug.assert(0===r.length,"Prologue directives should be at the first statement in the target statements array");for(var i,a=!1,o=0,s=t.length;o<s;){var c=t[o];if(!e.isPrologueDirective(c))break;i=c,e.isStringLiteral(i.expression)&&"use strict"===i.expression.text&&(a=!0),r.push(c),o++;}return n&&!a&&r.push(si()),o}function li(t,r,n,i,a){void 0===a&&(a=e.returnTrue);for(var o=t.length;void 0!==n&&n<o;){var s=t[n];if(!(1048576&e.getEmitFlags(s)&&a(s)))break;e.append(r,i?e.visitNode(s,i,e.isStatement):s),n++;}return n}function ui(e,t,r){for(var n=r;n<e.length&&t(e[n]);)n++;return n}function _i(e){return e?F(e):void 0}function di(e){return "string"==typeof e?X(e):e}function pi(e){return "string"==typeof e?W(e):"number"==typeof e?K(e):"boolean"==typeof e?e?re():ne():e}function fi(t){return t&&e.isNotEmittedStatement(t)?e.setTextRange(h(nr(),t),t):t}}function o(t,r){return t!==r&&e.setTextRange(t,r),t}function s(t,r){return t!==r&&(h(t,r),e.setTextRange(t,r)),t}function c(t){switch(t){case 341:return "type";case 339:return "returns";case 340:return "this";case 337:return "enum";case 328:return "author";case 330:return "class";case 331:return "public";case 332:return "private";case 333:return "protected";case 334:return "readonly";case 335:return "override";case 342:return "template";case 343:return "typedef";case 338:return "param";case 345:return "prop";case 336:return "callback";case 326:return "augments";case 327:return "implements";default:return e.Debug.fail("Unsupported kind: ".concat(e.Debug.formatSyntaxKind(t)))}}(r=e.NodeFactoryFlags||(e.NodeFactoryFlags={}))[r.None=0]="None",r[r.NoParenthesizerRules=1]="NoParenthesizerRules",r[r.NoNodeConverters=2]="NoNodeConverters",r[r.NoIndentationOnFreshPropertyAccess=4]="NoIndentationOnFreshPropertyAccess",r[r.NoOriginalNode=8]="NoOriginalNode",e.createNodeFactory=a;var l={};function u(e){return -16777217&_(e)}function _(t){if(!t)return 0;var r=t.transformFlags&~f(t.kind);return e.isNamedDeclaration(t)&&e.isPropertyName(t.name)?r|33562624&t.name.transformFlags:r}function d(e){return e?e.transformFlags:0}function p(e){for(var t=0,r=0,n=e;r<n.length;r++)t|=_(n[r]);e.transformFlags=t;}function f(e){if(e>=176&&e<=199)return -2;switch(e){case 207:case 208:case 203:return 536887296;case 260:return 589443072;case 163:return 536870912;case 213:return 557748224;case 212:case 255:return 591310848;case 254:return 537165824;case 256:case 225:return 536940544;case 170:return 591306752;case 166:return 570433536;case 168:case 171:case 172:return 574529536;case 130:case 146:case 157:case 143:case 149:case 147:case 133:case 150:case 114:case 162:case 165:case 167:case 173:case 174:case 175:case 257:case 258:return -2;case 204:return 536973312;case 291:return 536903680;case 200:case 201:return 536887296;case 210:case 228:case 348:case 211:case 106:return 536870912;case 205:case 206:default:return 536870912}}e.getTransformFlagsSubtreeExclusions=f;var g=e.createBaseNodeFactory();function m(e){return e.flags|=8,e}var y,v={createBaseSourceFileNode:function(e){return m(g.createBaseSourceFileNode(e))},createBaseIdentifierNode:function(e){return m(g.createBaseIdentifierNode(e))},createBasePrivateIdentifierNode:function(e){return m(g.createBasePrivateIdentifierNode(e))},createBaseTokenNode:function(e){return m(g.createBaseTokenNode(e))},createBaseNode:function(e){return m(g.createBaseNode(e))}};function h(t,r){if(t.original=r,r){var n=r.emitNode;n&&(t.emitNode=function(t,r){var n=t.flags,i=t.leadingComments,a=t.trailingComments,o=t.commentRange,s=t.sourceMapRange,c=t.tokenSourceMapRanges,l=t.constantValue,u=t.helpers,_=t.startsOnNewLine;if(r||(r={}),i&&(r.leadingComments=e.addRange(i.slice(),r.leadingComments)),a&&(r.trailingComments=e.addRange(a.slice(),r.trailingComments)),n&&(r.flags=-268435457&n),o&&(r.commentRange=o),s&&(r.sourceMapRange=s),c&&(r.tokenSourceMapRanges=function(e,t){for(var r in t||(t=[]),e)t[r]=e[r];return t}(c,r.tokenSourceMapRanges)),void 0!==l&&(r.constantValue=l),u)for(var d=0,p=u;d<p.length;d++){var f=p[d];r.helpers=e.appendIfUnique(r.helpers,f);}return void 0!==_&&(r.startsOnNewLine=_),r}(n,t.emitNode));}return t}e.factory=a(4,v),e.createUnparsedSourceFile=function(t,r,n){var i,a,o,s,c,l,u,_,d,p;e.isString(t)?(o="",s=t,c=t.length,l=r,u=n):(e.Debug.assert("js"===r||"dts"===r),o=("js"===r?t.javascriptPath:t.declarationPath)||"",l="js"===r?t.javascriptMapPath:t.declarationMapPath,_=function(){return "js"===r?t.javascriptText:t.declarationText},d=function(){return "js"===r?t.javascriptMapText:t.declarationMapText},c=function(){return _().length},t.buildInfo&&t.buildInfo.bundle&&(e.Debug.assert(void 0===n||"boolean"==typeof n),i=n,a="js"===r?t.buildInfo.bundle.js:t.buildInfo.bundle.dts,p=t.oldFileOfCurrentEmit));var f=p?function(t){for(var r,n,i=0,a=t.sections;i<a.length;i++){var o=a[i];switch(o.kind){case"internal":case"text":r=e.append(r,e.setTextRange(e.factory.createUnparsedTextLike(o.data,"internal"===o.kind),o));break;case"no-default-lib":case"reference":case"type":case"lib":n=e.append(n,e.setTextRange(e.factory.createUnparsedSyntheticReference(o),o));break;case"prologue":case"emitHelpers":case"prepend":break;default:e.Debug.assertNever(o);}}var s=e.factory.createUnparsedSource(e.emptyArray,n,null!=r?r:e.emptyArray);return e.setEachParent(n,s),e.setEachParent(r,s),s.helpers=e.map(t.sources&&t.sources.helpers,(function(t){return e.getAllUnscopedEmitHelpers().get(t)})),s}(e.Debug.assertDefined(a)):function(t,r,n){for(var i,a,o,s,c,l,u,_,d=0,p=t?t.sections:e.emptyArray;d<p.length;d++){var f=p[d];switch(f.kind){case"prologue":i=e.append(i,e.setTextRange(e.factory.createUnparsedPrologue(f.data),f));break;case"emitHelpers":a=e.append(a,e.getAllUnscopedEmitHelpers().get(f.data));break;case"no-default-lib":_=!0;break;case"reference":o=e.append(o,{pos:-1,end:-1,fileName:f.data});break;case"type":s=e.append(s,f.data);break;case"lib":c=e.append(c,{pos:-1,end:-1,fileName:f.data});break;case"prepend":for(var g=void 0,m=0,y=f.texts;m<y.length;m++){var v=y[m];r&&"internal"===v.kind||(g=e.append(g,e.setTextRange(e.factory.createUnparsedTextLike(v.data,"internal"===v.kind),v)));}l=e.addRange(l,g),u=e.append(u,e.factory.createUnparsedPrepend(f.data,null!=g?g:e.emptyArray));break;case"internal":if(r){u||(u=[]);break}case"text":u=e.append(u,e.setTextRange(e.factory.createUnparsedTextLike(f.data,"internal"===f.kind),f));break;default:e.Debug.assertNever(f);}}if(!u){var h=e.factory.createUnparsedTextLike(void 0,!1);e.setTextRangePosWidth(h,0,"function"==typeof n?n():n),u=[h];}var b=e.parseNodeFactory.createUnparsedSource(null!=i?i:e.emptyArray,void 0,u);return e.setEachParent(i,b),e.setEachParent(u,b),e.setEachParent(l,b),b.hasNoDefaultLib=_,b.helpers=a,b.referencedFiles=o||e.emptyArray,b.typeReferenceDirectives=s,b.libReferenceDirectives=c||e.emptyArray,b}(a,i,c);return f.fileName=o,f.sourceMapPath=l,f.oldFileOfCurrentEmit=p,_&&d?(Object.defineProperty(f,"text",{get:_}),Object.defineProperty(f,"sourceMapText",{get:d})):(e.Debug.assert(!p),f.text=null!=s?s:"",f.sourceMapText=u),f},e.createInputFiles=function(t,r,n,i,a,o,s,c,l,u,_){var d=e.parseNodeFactory.createInputFiles();if(e.isString(t))d.javascriptText=t,d.javascriptMapPath=n,d.javascriptMapText=i,d.declarationText=r,d.declarationMapPath=a,d.declarationMapText=o,d.javascriptPath=s,d.declarationPath=c,d.buildInfoPath=l,d.buildInfo=u,d.oldFileOfCurrentEmit=_;else {var p,f=new e.Map,g=function(e){if(void 0!==e){var r=f.get(e);return void 0===r&&(r=t(e),f.set(e,void 0!==r&&r)),!1!==r?r:void 0}},m=function(e){var t=g(e);return void 0!==t?t:"/* Input file ".concat(e," was missing */\r\n")};d.javascriptPath=r,d.javascriptMapPath=n,d.declarationPath=e.Debug.assertDefined(i),d.declarationMapPath=a,d.buildInfoPath=o,Object.defineProperties(d,{javascriptText:{get:function(){return m(r)}},javascriptMapText:{get:function(){return g(n)}},declarationText:{get:function(){return m(e.Debug.assertDefined(i))}},declarationMapText:{get:function(){return g(a)}},buildInfo:{get:function(){return function(t){if(void 0===p){var r=g(o);p=void 0!==r&&e.getBuildInfo(r);}return p||void 0}()}}});}return d},e.createSourceMapSource=function(t,r,n){return new(y||(y=e.objectAllocator.getSourceMapSourceConstructor()))(t,r,n)},e.setOriginalNode=h;}(t),function(e){function t(r){var n;if(r.emitNode)e.Debug.assert(!(268435456&r.emitNode.flags),"Invalid attempt to mutate an immutable node.");else {if(e.isParseTreeNode(r)){if(303===r.kind)return r.emitNode={annotatedNodes:[r]};t(null!==(n=e.getSourceFileOfNode(e.getParseTreeNode(e.getSourceFileOfNode(r))))&&void 0!==n?n:e.Debug.fail("Could not determine parsed source file.")).annotatedNodes.push(r);}r.emitNode={};}return r.emitNode}function r(e){var t;return null===(t=e.emitNode)||void 0===t?void 0:t.leadingComments}function n(e,r){return t(e).leadingComments=r,e}function i(e){var t;return null===(t=e.emitNode)||void 0===t?void 0:t.trailingComments}function a(e,r){return t(e).trailingComments=r,e}e.getOrCreateEmitNode=t,e.disposeEmitNodes=function(t){var r,n,i=null===(n=null===(r=e.getSourceFileOfNode(e.getParseTreeNode(t)))||void 0===r?void 0:r.emitNode)||void 0===n?void 0:n.annotatedNodes;if(i)for(var a=0,o=i;a<o.length;a++)o[a].emitNode=void 0;},e.removeAllComments=function(e){var r=t(e);return r.flags|=1536,r.leadingComments=void 0,r.trailingComments=void 0,e},e.setEmitFlags=function(e,r){return t(e).flags=r,e},e.addEmitFlags=function(e,r){var n=t(e);return n.flags=n.flags|r,e},e.getSourceMapRange=function(e){var t,r;return null!==(r=null===(t=e.emitNode)||void 0===t?void 0:t.sourceMapRange)&&void 0!==r?r:e},e.setSourceMapRange=function(e,r){return t(e).sourceMapRange=r,e},e.getTokenSourceMapRange=function(e,t){var r,n;return null===(n=null===(r=e.emitNode)||void 0===r?void 0:r.tokenSourceMapRanges)||void 0===n?void 0:n[t]},e.setTokenSourceMapRange=function(e,r,n){var i,a=t(e);return (null!==(i=a.tokenSourceMapRanges)&&void 0!==i?i:a.tokenSourceMapRanges=[])[r]=n,e},e.getStartsOnNewLine=function(e){var t;return null===(t=e.emitNode)||void 0===t?void 0:t.startsOnNewLine},e.setStartsOnNewLine=function(e,r){return t(e).startsOnNewLine=r,e},e.getCommentRange=function(e){var t,r;return null!==(r=null===(t=e.emitNode)||void 0===t?void 0:t.commentRange)&&void 0!==r?r:e},e.setCommentRange=function(e,r){return t(e).commentRange=r,e},e.getSyntheticLeadingComments=r,e.setSyntheticLeadingComments=n,e.addSyntheticLeadingComment=function(t,i,a,o){return n(t,e.append(r(t),{kind:i,pos:-1,end:-1,hasTrailingNewLine:o,text:a}))},e.getSyntheticTrailingComments=i,e.setSyntheticTrailingComments=a,e.addSyntheticTrailingComment=function(t,r,n,o){return a(t,e.append(i(t),{kind:r,pos:-1,end:-1,hasTrailingNewLine:o,text:n}))},e.moveSyntheticComments=function(e,o){n(e,r(o)),a(e,i(o));var s=t(o);return s.leadingComments=void 0,s.trailingComments=void 0,e},e.getConstantValue=function(e){var t;return null===(t=e.emitNode)||void 0===t?void 0:t.constantValue},e.setConstantValue=function(e,r){return t(e).constantValue=r,e},e.addEmitHelper=function(r,n){var i=t(r);return i.helpers=e.append(i.helpers,n),r},e.addEmitHelpers=function(r,n){if(e.some(n))for(var i=t(r),a=0,o=n;a<o.length;a++){var s=o[a];i.helpers=e.appendIfUnique(i.helpers,s);}return r},e.removeEmitHelper=function(t,r){var n,i=null===(n=t.emitNode)||void 0===n?void 0:n.helpers;return !!i&&e.orderedRemoveItem(i,r)},e.getEmitHelpers=function(e){var t;return null===(t=e.emitNode)||void 0===t?void 0:t.helpers},e.moveEmitHelpers=function(r,n,i){var a=r.emitNode,o=a&&a.helpers;if(e.some(o)){for(var s=t(n),c=0,l=0;l<o.length;l++){var u=o[l];i(u)?(c++,s.helpers=e.appendIfUnique(s.helpers,u)):c>0&&(o[l-c]=u);}c>0&&(o.length-=c);}},e.getSnippetElement=function(e){var t;return null===(t=e.emitNode)||void 0===t?void 0:t.snippetElement},e.setSnippetElement=function(e,r){return t(e).snippetElement=r,e},e.ignoreSourceNewlines=function(e){return t(e).flags|=134217728,e};}(t),function(e){function t(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return function(r){for(var n="",i=0;i<t.length;i++)n+=e[i],n+=r(t[i]);return n+e[e.length-1]}}var r;e.createEmitHelperFactory=function(t){var r=t.factory,i=e.memoize((function(){return e.setEmitFlags(r.createTrue(),268435456)})),a=e.memoize((function(){return e.setEmitFlags(r.createFalse(),268435456)}));return {getUnscopedHelperName:o,createDecorateHelper:function(n,i,a,s){t.requestEmitHelper(e.decorateHelper);var c=[];return c.push(r.createArrayLiteralExpression(n,!0)),c.push(i),a&&(c.push(a),s&&c.push(s)),r.createCallExpression(o("__decorate"),void 0,c)},createMetadataHelper:function(n,i){return t.requestEmitHelper(e.metadataHelper),r.createCallExpression(o("__metadata"),void 0,[r.createStringLiteral(n),i])},createParamHelper:function(n,i,a){return t.requestEmitHelper(e.paramHelper),e.setTextRange(r.createCallExpression(o("__param"),void 0,[r.createNumericLiteral(i+""),n]),a)},createAssignHelper:function(n){return e.getEmitScriptTarget(t.getCompilerOptions())>=2?r.createCallExpression(r.createPropertyAccessExpression(r.createIdentifier("Object"),"assign"),void 0,n):(t.requestEmitHelper(e.assignHelper),r.createCallExpression(o("__assign"),void 0,n))},createAwaitHelper:function(n){return t.requestEmitHelper(e.awaitHelper),r.createCallExpression(o("__await"),void 0,[n])},createAsyncGeneratorHelper:function(n,i){return t.requestEmitHelper(e.awaitHelper),t.requestEmitHelper(e.asyncGeneratorHelper),(n.emitNode||(n.emitNode={})).flags|=786432,r.createCallExpression(o("__asyncGenerator"),void 0,[i?r.createThis():r.createVoidZero(),r.createIdentifier("arguments"),n])},createAsyncDelegatorHelper:function(n){return t.requestEmitHelper(e.awaitHelper),t.requestEmitHelper(e.asyncDelegator),r.createCallExpression(o("__asyncDelegator"),void 0,[n])},createAsyncValuesHelper:function(n){return t.requestEmitHelper(e.asyncValues),r.createCallExpression(o("__asyncValues"),void 0,[n])},createRestHelper:function(n,i,a,s){t.requestEmitHelper(e.restHelper);for(var c=[],l=0,u=0;u<i.length-1;u++){var _=e.getPropertyNameOfBindingOrAssignmentElement(i[u]);if(_)if(e.isComputedPropertyName(_)){e.Debug.assertIsDefined(a,"Encountered computed property name but 'computedTempVariables' argument was not provided.");var d=a[l];l++,c.push(r.createConditionalExpression(r.createTypeCheck(d,"symbol"),void 0,d,void 0,r.createAdd(d,r.createStringLiteral(""))));}else c.push(r.createStringLiteralFromNode(_));}return r.createCallExpression(o("__rest"),void 0,[n,e.setTextRange(r.createArrayLiteralExpression(c),s)])},createAwaiterHelper:function(n,i,a,s){t.requestEmitHelper(e.awaiterHelper);var c=r.createFunctionExpression(void 0,r.createToken(41),void 0,void 0,[],void 0,s);return (c.emitNode||(c.emitNode={})).flags|=786432,r.createCallExpression(o("__awaiter"),void 0,[n?r.createThis():r.createVoidZero(),i?r.createIdentifier("arguments"):r.createVoidZero(),a?e.createExpressionFromEntityName(r,a):r.createVoidZero(),c])},createExtendsHelper:function(n){return t.requestEmitHelper(e.extendsHelper),r.createCallExpression(o("__extends"),void 0,[n,r.createUniqueName("_super",48)])},createTemplateObjectHelper:function(n,i){return t.requestEmitHelper(e.templateObjectHelper),r.createCallExpression(o("__makeTemplateObject"),void 0,[n,i])},createSpreadArrayHelper:function(n,s,c){return t.requestEmitHelper(e.spreadArrayHelper),r.createCallExpression(o("__spreadArray"),void 0,[n,s,c?i():a()])},createValuesHelper:function(n){return t.requestEmitHelper(e.valuesHelper),r.createCallExpression(o("__values"),void 0,[n])},createReadHelper:function(n,i){return t.requestEmitHelper(e.readHelper),r.createCallExpression(o("__read"),void 0,void 0!==i?[n,r.createNumericLiteral(i+"")]:[n])},createGeneratorHelper:function(n){return t.requestEmitHelper(e.generatorHelper),r.createCallExpression(o("__generator"),void 0,[r.createThis(),n])},createCreateBindingHelper:function(i,a,s){return t.requestEmitHelper(e.createBindingHelper),r.createCallExpression(o("__createBinding"),void 0,n$3([r.createIdentifier("exports"),i,a],s?[s]:[],!0))},createImportStarHelper:function(n){return t.requestEmitHelper(e.importStarHelper),r.createCallExpression(o("__importStar"),void 0,[n])},createImportStarCallbackHelper:function(){return t.requestEmitHelper(e.importStarHelper),o("__importStar")},createImportDefaultHelper:function(n){return t.requestEmitHelper(e.importDefaultHelper),r.createCallExpression(o("__importDefault"),void 0,[n])},createExportStarHelper:function(n,i){return void 0===i&&(i=r.createIdentifier("exports")),t.requestEmitHelper(e.exportStarHelper),t.requestEmitHelper(e.createBindingHelper),r.createCallExpression(o("__exportStar"),void 0,[n,i])},createClassPrivateFieldGetHelper:function(n,i,a,s){var c;return t.requestEmitHelper(e.classPrivateFieldGetHelper),c=s?[n,i,r.createStringLiteral(a),s]:[n,i,r.createStringLiteral(a)],r.createCallExpression(o("__classPrivateFieldGet"),void 0,c)},createClassPrivateFieldSetHelper:function(n,i,a,s,c){var l;return t.requestEmitHelper(e.classPrivateFieldSetHelper),l=c?[n,i,a,r.createStringLiteral(s),c]:[n,i,a,r.createStringLiteral(s)],r.createCallExpression(o("__classPrivateFieldSet"),void 0,l)},createClassPrivateFieldInHelper:function(n,i){return t.requestEmitHelper(e.classPrivateFieldInHelper),r.createCallExpression(o("__classPrivateFieldIn"),void 0,[n,i])}};function o(t){return e.setEmitFlags(r.createIdentifier(t),4098)}},e.compareEmitHelpers=function(t,r){return t===r||t.priority===r.priority?0:void 0===t.priority?1:void 0===r.priority?-1:e.compareValues(t.priority,r.priority)},e.helperString=t,e.decorateHelper={name:"typescript:decorate",importName:"__decorate",scoped:!1,priority:2,text:'\n var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n };'},e.metadataHelper={name:"typescript:metadata",importName:"__metadata",scoped:!1,priority:3,text:'\n var __metadata = (this && this.__metadata) || function (k, v) {\n if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);\n };'},e.paramHelper={name:"typescript:param",importName:"__param",scoped:!1,priority:4,text:"\n var __param = (this && this.__param) || function (paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n };"},e.assignHelper={name:"typescript:assign",importName:"__assign",scoped:!1,priority:1,text:"\n var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n };"},e.awaitHelper={name:"typescript:await",importName:"__await",scoped:!1,text:"\n var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }"},e.asyncGeneratorHelper={name:"typescript:asyncGenerator",importName:"__asyncGenerator",scoped:!1,dependencies:[e.awaitHelper],text:'\n var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume("next", value); }\n function reject(value) { resume("throw", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n };'},e.asyncDelegator={name:"typescript:asyncDelegator",importName:"__asyncDelegator",scoped:!1,dependencies:[e.awaitHelper],text:'\n var __asyncDelegator = (this && this.__asyncDelegator) || function (o) {\n var i, p;\n return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }\n };'},e.asyncValues={name:"typescript:asyncValues",importName:"__asyncValues",scoped:!1,text:'\n var __asyncValues = (this && this.__asyncValues) || function (o) {\n if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n };'},e.restHelper={name:"typescript:rest",importName:"__rest",scoped:!1,text:'\n var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === "function")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n };'},e.awaiterHelper={name:"typescript:awaiter",importName:"__awaiter",scoped:!1,priority:5,text:'\n var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n };'},e.extendsHelper={name:"typescript:extends",importName:"__extends",scoped:!1,priority:0,text:'\n var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n })();'},e.templateObjectHelper={name:"typescript:makeTemplateObject",importName:"__makeTemplateObject",scoped:!1,priority:0,text:'\n var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n };'},e.readHelper={name:"typescript:read",importName:"__read",scoped:!1,text:'\n var __read = (this && this.__read) || function (o, n) {\n var m = typeof Symbol === "function" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i["return"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n };'},e.spreadArrayHelper={name:"typescript:spreadArray",importName:"__spreadArray",scoped:!1,text:"\n var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n };"},e.valuesHelper={name:"typescript:values",importName:"__values",scoped:!1,text:'\n var __values = (this && this.__values) || function(o) {\n var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === "number") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");\n };'},e.generatorHelper={name:"typescript:generator",importName:"__generator",scoped:!1,priority:6,text:'\n var __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError("Generator is already executing.");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n };'},e.createBindingHelper={name:"typescript:commonjscreatebinding",importName:"__createBinding",scoped:!1,priority:1,text:"\n var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n }) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n }));"},e.setModuleDefaultHelper={name:"typescript:commonjscreatevalue",importName:"__setModuleDefault",scoped:!1,priority:1,text:'\n var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, "default", { enumerable: true, value: v });\n }) : function(o, v) {\n o["default"] = v;\n });'},e.importStarHelper={name:"typescript:commonjsimportstar",importName:"__importStar",scoped:!1,dependencies:[e.createBindingHelper,e.setModuleDefaultHelper],priority:2,text:'\n var __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n };'},e.importDefaultHelper={name:"typescript:commonjsimportdefault",importName:"__importDefault",scoped:!1,text:'\n var __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { "default": mod };\n };'},e.exportStarHelper={name:"typescript:export-star",importName:"__exportStar",scoped:!1,dependencies:[e.createBindingHelper],priority:2,text:'\n var __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n };'},e.classPrivateFieldGetHelper={name:"typescript:classPrivateFieldGet",importName:"__classPrivateFieldGet",scoped:!1,text:'\n var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {\n if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");\n if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");\n return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);\n };'},e.classPrivateFieldSetHelper={name:"typescript:classPrivateFieldSet",importName:"__classPrivateFieldSet",scoped:!1,text:'\n var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {\n if (kind === "m") throw new TypeError("Private method is not writable");\n if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");\n if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");\n return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n };'},e.classPrivateFieldInHelper={name:"typescript:classPrivateFieldIn",importName:"__classPrivateFieldIn",scoped:!1,text:'\n var __classPrivateFieldIn = (this && this.__classPrivateFieldIn) || function(state, receiver) {\n if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use \'in\' operator on non-object");\n return typeof state === "function" ? receiver === state : state.has(receiver);\n };'},e.getAllUnscopedEmitHelpers=function(){return r||(r=e.arrayToMap([e.decorateHelper,e.metadataHelper,e.paramHelper,e.assignHelper,e.awaitHelper,e.asyncGeneratorHelper,e.asyncDelegator,e.asyncValues,e.restHelper,e.awaiterHelper,e.extendsHelper,e.templateObjectHelper,e.spreadArrayHelper,e.valuesHelper,e.readHelper,e.generatorHelper,e.importStarHelper,e.importDefaultHelper,e.exportStarHelper,e.classPrivateFieldGetHelper,e.classPrivateFieldSetHelper,e.classPrivateFieldInHelper,e.createBindingHelper,e.setModuleDefaultHelper],(function(e){return e.name})))},e.asyncSuperHelper={name:"typescript:async-super",scoped:!0,text:t(a(["\n const "," = name => super[name];"],["\n const "," = name => super[name];"]),"_superIndex")},e.advancedAsyncSuperHelper={name:"typescript:advanced-async-super",scoped:!0,text:t(a(["\n const "," = (function (geti, seti) {\n const cache = Object.create(null);\n return name => cache[name] || (cache[name] = { get value() { return geti(name); }, set value(v) { seti(name, v); } });\n })(name => super[name], (name, value) => super[name] = value);"],["\n const "," = (function (geti, seti) {\n const cache = Object.create(null);\n return name => cache[name] || (cache[name] = { get value() { return geti(name); }, set value(v) { seti(name, v); } });\n })(name => super[name], (name, value) => super[name] = value);"]),"_superIndex")},e.isCallToHelper=function(t,r){return e.isCallExpression(t)&&e.isIdentifier(t.expression)&&0!=(4096&e.getEmitFlags(t.expression))&&t.expression.escapedText===r};}(t),function(e){e.isNumericLiteral=function(e){return 8===e.kind},e.isBigIntLiteral=function(e){return 9===e.kind},e.isStringLiteral=function(e){return 10===e.kind},e.isJsxText=function(e){return 11===e.kind},e.isRegularExpressionLiteral=function(e){return 13===e.kind},e.isNoSubstitutionTemplateLiteral=function(e){return 14===e.kind},e.isTemplateHead=function(e){return 15===e.kind},e.isTemplateMiddle=function(e){return 16===e.kind},e.isTemplateTail=function(e){return 17===e.kind},e.isDotDotDotToken=function(e){return 25===e.kind},e.isCommaToken=function(e){return 27===e.kind},e.isPlusToken=function(e){return 39===e.kind},e.isMinusToken=function(e){return 40===e.kind},e.isAsteriskToken=function(e){return 41===e.kind},e.isExclamationToken=function(e){return 53===e.kind},e.isQuestionToken=function(e){return 57===e.kind},e.isColonToken=function(e){return 58===e.kind},e.isQuestionDotToken=function(e){return 28===e.kind},e.isEqualsGreaterThanToken=function(e){return 38===e.kind},e.isIdentifier=function(e){return 79===e.kind},e.isPrivateIdentifier=function(e){return 80===e.kind},e.isExportModifier=function(e){return 93===e.kind},e.isAsyncModifier=function(e){return 131===e.kind},e.isAssertsKeyword=function(e){return 128===e.kind},e.isAwaitKeyword=function(e){return 132===e.kind},e.isReadonlyKeyword=function(e){return 144===e.kind},e.isStaticModifier=function(e){return 124===e.kind},e.isAbstractModifier=function(e){return 126===e.kind},e.isSuperKeyword=function(e){return 106===e.kind},e.isImportKeyword=function(e){return 100===e.kind},e.isQualifiedName=function(e){return 160===e.kind},e.isComputedPropertyName=function(e){return 161===e.kind},e.isTypeParameterDeclaration=function(e){return 162===e.kind},e.isParameter=function(e){return 163===e.kind},e.isDecorator=function(e){return 164===e.kind},e.isPropertySignature=function(e){return 165===e.kind},e.isPropertyDeclaration=function(e){return 166===e.kind},e.isMethodSignature=function(e){return 167===e.kind},e.isMethodDeclaration=function(e){return 168===e.kind},e.isClassStaticBlockDeclaration=function(e){return 169===e.kind},e.isConstructorDeclaration=function(e){return 170===e.kind},e.isGetAccessorDeclaration=function(e){return 171===e.kind},e.isSetAccessorDeclaration=function(e){return 172===e.kind},e.isCallSignatureDeclaration=function(e){return 173===e.kind},e.isConstructSignatureDeclaration=function(e){return 174===e.kind},e.isIndexSignatureDeclaration=function(e){return 175===e.kind},e.isTypePredicateNode=function(e){return 176===e.kind},e.isTypeReferenceNode=function(e){return 177===e.kind},e.isFunctionTypeNode=function(e){return 178===e.kind},e.isConstructorTypeNode=function(e){return 179===e.kind},e.isTypeQueryNode=function(e){return 180===e.kind},e.isTypeLiteralNode=function(e){return 181===e.kind},e.isArrayTypeNode=function(e){return 182===e.kind},e.isTupleTypeNode=function(e){return 183===e.kind},e.isNamedTupleMember=function(e){return 196===e.kind},e.isOptionalTypeNode=function(e){return 184===e.kind},e.isRestTypeNode=function(e){return 185===e.kind},e.isUnionTypeNode=function(e){return 186===e.kind},e.isIntersectionTypeNode=function(e){return 187===e.kind},e.isConditionalTypeNode=function(e){return 188===e.kind},e.isInferTypeNode=function(e){return 189===e.kind},e.isParenthesizedTypeNode=function(e){return 190===e.kind},e.isThisTypeNode=function(e){return 191===e.kind},e.isTypeOperatorNode=function(e){return 192===e.kind},e.isIndexedAccessTypeNode=function(e){return 193===e.kind},e.isMappedTypeNode=function(e){return 194===e.kind},e.isLiteralTypeNode=function(e){return 195===e.kind},e.isImportTypeNode=function(e){return 199===e.kind},e.isTemplateLiteralTypeSpan=function(e){return 198===e.kind},e.isTemplateLiteralTypeNode=function(e){return 197===e.kind},e.isObjectBindingPattern=function(e){return 200===e.kind},e.isArrayBindingPattern=function(e){return 201===e.kind},e.isBindingElement=function(e){return 202===e.kind},e.isArrayLiteralExpression=function(e){return 203===e.kind},e.isObjectLiteralExpression=function(e){return 204===e.kind},e.isPropertyAccessExpression=function(e){return 205===e.kind},e.isElementAccessExpression=function(e){return 206===e.kind},e.isCallExpression=function(e){return 207===e.kind},e.isNewExpression=function(e){return 208===e.kind},e.isTaggedTemplateExpression=function(e){return 209===e.kind},e.isTypeAssertionExpression=function(e){return 210===e.kind},e.isParenthesizedExpression=function(e){return 211===e.kind},e.isFunctionExpression=function(e){return 212===e.kind},e.isArrowFunction=function(e){return 213===e.kind},e.isDeleteExpression=function(e){return 214===e.kind},e.isTypeOfExpression=function(e){return 215===e.kind},e.isVoidExpression=function(e){return 216===e.kind},e.isAwaitExpression=function(e){return 217===e.kind},e.isPrefixUnaryExpression=function(e){return 218===e.kind},e.isPostfixUnaryExpression=function(e){return 219===e.kind},e.isBinaryExpression=function(e){return 220===e.kind},e.isConditionalExpression=function(e){return 221===e.kind},e.isTemplateExpression=function(e){return 222===e.kind},e.isYieldExpression=function(e){return 223===e.kind},e.isSpreadElement=function(e){return 224===e.kind},e.isClassExpression=function(e){return 225===e.kind},e.isOmittedExpression=function(e){return 226===e.kind},e.isExpressionWithTypeArguments=function(e){return 227===e.kind},e.isAsExpression=function(e){return 228===e.kind},e.isNonNullExpression=function(e){return 229===e.kind},e.isMetaProperty=function(e){return 230===e.kind},e.isSyntheticExpression=function(e){return 231===e.kind},e.isPartiallyEmittedExpression=function(e){return 348===e.kind},e.isCommaListExpression=function(e){return 349===e.kind},e.isTemplateSpan=function(e){return 232===e.kind},e.isSemicolonClassElement=function(e){return 233===e.kind},e.isBlock=function(e){return 234===e.kind},e.isVariableStatement=function(e){return 236===e.kind},e.isEmptyStatement=function(e){return 235===e.kind},e.isExpressionStatement=function(e){return 237===e.kind},e.isIfStatement=function(e){return 238===e.kind},e.isDoStatement=function(e){return 239===e.kind},e.isWhileStatement=function(e){return 240===e.kind},e.isForStatement=function(e){return 241===e.kind},e.isForInStatement=function(e){return 242===e.kind},e.isForOfStatement=function(e){return 243===e.kind},e.isContinueStatement=function(e){return 244===e.kind},e.isBreakStatement=function(e){return 245===e.kind},e.isReturnStatement=function(e){return 246===e.kind},e.isWithStatement=function(e){return 247===e.kind},e.isSwitchStatement=function(e){return 248===e.kind},e.isLabeledStatement=function(e){return 249===e.kind},e.isThrowStatement=function(e){return 250===e.kind},e.isTryStatement=function(e){return 251===e.kind},e.isDebuggerStatement=function(e){return 252===e.kind},e.isVariableDeclaration=function(e){return 253===e.kind},e.isVariableDeclarationList=function(e){return 254===e.kind},e.isFunctionDeclaration=function(e){return 255===e.kind},e.isClassDeclaration=function(e){return 256===e.kind},e.isInterfaceDeclaration=function(e){return 257===e.kind},e.isTypeAliasDeclaration=function(e){return 258===e.kind},e.isEnumDeclaration=function(e){return 259===e.kind},e.isModuleDeclaration=function(e){return 260===e.kind},e.isModuleBlock=function(e){return 261===e.kind},e.isCaseBlock=function(e){return 262===e.kind},e.isNamespaceExportDeclaration=function(e){return 263===e.kind},e.isImportEqualsDeclaration=function(e){return 264===e.kind},e.isImportDeclaration=function(e){return 265===e.kind},e.isImportClause=function(e){return 266===e.kind},e.isAssertClause=function(e){return 292===e.kind},e.isAssertEntry=function(e){return 293===e.kind},e.isNamespaceImport=function(e){return 267===e.kind},e.isNamespaceExport=function(e){return 273===e.kind},e.isNamedImports=function(e){return 268===e.kind},e.isImportSpecifier=function(e){return 269===e.kind},e.isExportAssignment=function(e){return 270===e.kind},e.isExportDeclaration=function(e){return 271===e.kind},e.isNamedExports=function(e){return 272===e.kind},e.isExportSpecifier=function(e){return 274===e.kind},e.isMissingDeclaration=function(e){return 275===e.kind},e.isNotEmittedStatement=function(e){return 347===e.kind},e.isSyntheticReference=function(e){return 352===e.kind},e.isMergeDeclarationMarker=function(e){return 350===e.kind},e.isEndOfDeclarationMarker=function(e){return 351===e.kind},e.isExternalModuleReference=function(e){return 276===e.kind},e.isJsxElement=function(e){return 277===e.kind},e.isJsxSelfClosingElement=function(e){return 278===e.kind},e.isJsxOpeningElement=function(e){return 279===e.kind},e.isJsxClosingElement=function(e){return 280===e.kind},e.isJsxFragment=function(e){return 281===e.kind},e.isJsxOpeningFragment=function(e){return 282===e.kind},e.isJsxClosingFragment=function(e){return 283===e.kind},e.isJsxAttribute=function(e){return 284===e.kind},e.isJsxAttributes=function(e){return 285===e.kind},e.isJsxSpreadAttribute=function(e){return 286===e.kind},e.isJsxExpression=function(e){return 287===e.kind},e.isCaseClause=function(e){return 288===e.kind},e.isDefaultClause=function(e){return 289===e.kind},e.isHeritageClause=function(e){return 290===e.kind},e.isCatchClause=function(e){return 291===e.kind},e.isPropertyAssignment=function(e){return 294===e.kind},e.isShorthandPropertyAssignment=function(e){return 295===e.kind},e.isSpreadAssignment=function(e){return 296===e.kind},e.isEnumMember=function(e){return 297===e.kind},e.isUnparsedPrepend=function(e){return 299===e.kind},e.isSourceFile=function(e){return 303===e.kind},e.isBundle=function(e){return 304===e.kind},e.isUnparsedSource=function(e){return 305===e.kind},e.isJSDocTypeExpression=function(e){return 307===e.kind},e.isJSDocNameReference=function(e){return 308===e.kind},e.isJSDocMemberName=function(e){return 309===e.kind},e.isJSDocLink=function(e){return 322===e.kind},e.isJSDocLinkCode=function(e){return 323===e.kind},e.isJSDocLinkPlain=function(e){return 324===e.kind},e.isJSDocAllType=function(e){return 310===e.kind},e.isJSDocUnknownType=function(e){return 311===e.kind},e.isJSDocNullableType=function(e){return 312===e.kind},e.isJSDocNonNullableType=function(e){return 313===e.kind},e.isJSDocOptionalType=function(e){return 314===e.kind},e.isJSDocFunctionType=function(e){return 315===e.kind},e.isJSDocVariadicType=function(e){return 316===e.kind},e.isJSDocNamepathType=function(e){return 317===e.kind},e.isJSDoc=function(e){return 318===e.kind},e.isJSDocTypeLiteral=function(e){return 320===e.kind},e.isJSDocSignature=function(e){return 321===e.kind},e.isJSDocAugmentsTag=function(e){return 326===e.kind},e.isJSDocAuthorTag=function(e){return 328===e.kind},e.isJSDocClassTag=function(e){return 330===e.kind},e.isJSDocCallbackTag=function(e){return 336===e.kind},e.isJSDocPublicTag=function(e){return 331===e.kind},e.isJSDocPrivateTag=function(e){return 332===e.kind},e.isJSDocProtectedTag=function(e){return 333===e.kind},e.isJSDocReadonlyTag=function(e){return 334===e.kind},e.isJSDocOverrideTag=function(e){return 335===e.kind},e.isJSDocDeprecatedTag=function(e){return 329===e.kind},e.isJSDocSeeTag=function(e){return 344===e.kind},e.isJSDocEnumTag=function(e){return 337===e.kind},e.isJSDocParameterTag=function(e){return 338===e.kind},e.isJSDocReturnTag=function(e){return 339===e.kind},e.isJSDocThisTag=function(e){return 340===e.kind},e.isJSDocTypeTag=function(e){return 341===e.kind},e.isJSDocTemplateTag=function(e){return 342===e.kind},e.isJSDocTypedefTag=function(e){return 343===e.kind},e.isJSDocUnknownTag=function(e){return 325===e.kind},e.isJSDocPropertyTag=function(e){return 345===e.kind},e.isJSDocImplementsTag=function(e){return 327===e.kind},e.isSyntaxList=function(e){return 346===e.kind};}(t),function(e){function t(t,r,n,i){if(e.isComputedPropertyName(n))return e.setTextRange(t.createElementAccessExpression(r,n.expression),i);var a=e.setTextRange(e.isMemberName(n)?t.createPropertyAccessExpression(r,n):t.createElementAccessExpression(r,n),n);return e.getOrCreateEmitNode(a).flags|=64,a}function r(t,r){var n=e.parseNodeFactory.createIdentifier(t||"React");return e.setParent(n,e.getParseTreeNode(r)),n}function i(t,n,a){if(e.isQualifiedName(n)){var o=i(t,n.left,a),s=t.createIdentifier(e.idText(n.right));return s.escapedText=n.right.escapedText,t.createPropertyAccessExpression(o,s)}return r(e.idText(n),a)}function a(e,t,n,a){return t?i(e,t,a):e.createPropertyAccessExpression(r(n,a),"createElement")}function o(t,r){return e.isIdentifier(r)?t.createStringLiteralFromNode(r):e.isComputedPropertyName(r)?e.setParent(e.setTextRange(t.cloneNode(r.expression),r.expression),r.expression.parent):e.setParent(e.setTextRange(t.cloneNode(r),r),r.parent)}function s(t){return e.isStringLiteral(t.expression)&&"use strict"===t.expression.text}function c(t){return e.isParenthesizedExpression(t)&&e.isInJSFile(t)&&!!e.getJSDocTypeTag(t)}function l(e,t){switch(void 0===t&&(t=15),e.kind){case 211:return !(16&t&&c(e))&&0!=(1&t);case 210:case 228:return 0!=(2&t);case 229:return 0!=(4&t);case 348:return 0!=(8&t)}return !1}function u(e,t){for(void 0===t&&(t=15);l(e,t);)e=e.expression;return e}function _(t){return e.setStartsOnNewLine(t,!0)}function d(t){var r=e.getOriginalNode(t,e.isSourceFile),n=r&&r.emitNode;return n&&n.externalHelpersModuleName}function p(t,r,n,i,a){if(n.importHelpers&&e.isEffectiveExternalModule(r,n)){var o=d(r);if(o)return o;var s=e.getEmitModuleKind(n),c=(i||e.getESModuleInterop(n)&&a)&&s!==e.ModuleKind.System&&(s<e.ModuleKind.ES2015||r.impliedNodeFormat===e.ModuleKind.CommonJS);if(!c){var l=e.getEmitHelpers(r);if(l)for(var u=0,_=l;u<_.length;u++)if(!_[u].scoped){c=!0;break}}if(c){var p=e.getOriginalNode(r,e.isSourceFile),f=e.getOrCreateEmitNode(p);return f.externalHelpersModuleName||(f.externalHelpersModuleName=t.createUniqueName(e.externalHelpersModuleNameText))}}}function f(t,r,n,i){if(r)return r.moduleName?t.createStringLiteral(r.moduleName):!r.isDeclarationFile&&e.outFile(i)?t.createStringLiteral(e.getExternalModuleNameFromPath(n,r.fileName)):void 0}function g(t){if(e.isDeclarationBindingElement(t))return t.name;if(!e.isObjectLiteralElementLike(t))return e.isAssignmentExpression(t,!0)?g(t.left):e.isSpreadElement(t)?g(t.expression):t;switch(t.kind){case 294:return g(t.initializer);case 295:return t.name;case 296:return g(t.expression)}}function m(t){switch(t.kind){case 202:if(t.propertyName){var r=t.propertyName;return e.isPrivateIdentifier(r)?e.Debug.failBadSyntaxKind(r):e.isComputedPropertyName(r)&&y(r.expression)?r.expression:r}break;case 294:if(t.name)return r=t.name,e.isPrivateIdentifier(r)?e.Debug.failBadSyntaxKind(r):e.isComputedPropertyName(r)&&y(r.expression)?r.expression:r;break;case 296:return t.name&&e.isPrivateIdentifier(t.name)?e.Debug.failBadSyntaxKind(t.name):t.name}var n=g(t);if(n&&e.isPropertyName(n))return n}function y(e){var t=e.kind;return 10===t||8===t}var v;e.createEmptyExports=function(e){return e.createExportDeclaration(void 0,void 0,!1,e.createNamedExports([]),void 0)},e.createMemberAccessForPropertyName=t,e.createJsxFactoryExpression=a,e.createExpressionForJsxElement=function(t,r,n,i,a,o){var s=[n];if(i&&s.push(i),a&&a.length>0)if(i||s.push(t.createNull()),a.length>1)for(var c=0,l=a;c<l.length;c++){var u=l[c];_(u),s.push(u);}else s.push(a[0]);return e.setTextRange(t.createCallExpression(r,void 0,s),o)},e.createExpressionForJsxFragment=function(t,n,o,s,c,l,u){var d=[function(e,t,n,a){return t?i(e,t,a):e.createPropertyAccessExpression(r(n,a),"Fragment")}(t,o,s,l),t.createNull()];if(c&&c.length>0)if(c.length>1)for(var p=0,f=c;p<f.length;p++){var g=f[p];_(g),d.push(g);}else d.push(c[0]);return e.setTextRange(t.createCallExpression(a(t,n,s,l),void 0,d),u)},e.createForOfBindingStatement=function(t,r,n){if(e.isVariableDeclarationList(r)){var i=e.first(r.declarations),a=t.updateVariableDeclaration(i,i.name,void 0,void 0,n);return e.setTextRange(t.createVariableStatement(void 0,t.updateVariableDeclarationList(r,[a])),r)}var o=e.setTextRange(t.createAssignment(r,n),r);return e.setTextRange(t.createExpressionStatement(o),r)},e.insertLeadingStatement=function(t,r,i){return e.isBlock(r)?t.updateBlock(r,e.setTextRange(t.createNodeArray(n$3([i],r.statements,!0)),r.statements)):t.createBlock(t.createNodeArray([r,i]),!0)},e.createExpressionFromEntityName=function t(r,n){if(e.isQualifiedName(n)){var i=t(r,n.left),a=e.setParent(e.setTextRange(r.cloneNode(n.right),n.right),n.right.parent);return e.setTextRange(r.createPropertyAccessExpression(i,a),n)}return e.setParent(e.setTextRange(r.cloneNode(n),n),n.parent)},e.createExpressionForPropertyName=o,e.createExpressionForObjectLiteralElementLike=function(r,n,i,a){switch(i.name&&e.isPrivateIdentifier(i.name)&&e.Debug.failBadSyntaxKind(i.name,"Private identifiers are not allowed in object literals."),i.kind){case 171:case 172:return function(t,r,n,i,a){var s=e.getAllAccessorDeclarations(r,n),c=s.firstAccessor,l=s.getAccessor,u=s.setAccessor;if(n===c)return e.setTextRange(t.createObjectDefinePropertyCall(i,o(t,n.name),t.createPropertyDescriptor({enumerable:t.createFalse(),configurable:!0,get:l&&e.setTextRange(e.setOriginalNode(t.createFunctionExpression(l.modifiers,void 0,void 0,void 0,l.parameters,void 0,l.body),l),l),set:u&&e.setTextRange(e.setOriginalNode(t.createFunctionExpression(u.modifiers,void 0,void 0,void 0,u.parameters,void 0,u.body),u),u)},!a)),c)}(r,n.properties,i,a,!!n.multiLine);case 294:return function(r,n,i){return e.setOriginalNode(e.setTextRange(r.createAssignment(t(r,i,n.name,n.name),n.initializer),n),n)}(r,i,a);case 295:return function(r,n,i){return e.setOriginalNode(e.setTextRange(r.createAssignment(t(r,i,n.name,n.name),r.cloneNode(n.name)),n),n)}(r,i,a);case 168:return function(r,n,i){return e.setOriginalNode(e.setTextRange(r.createAssignment(t(r,i,n.name,n.name),e.setOriginalNode(e.setTextRange(r.createFunctionExpression(n.modifiers,n.asteriskToken,void 0,void 0,n.parameters,void 0,n.body),n),n)),n),n)}(r,i,a)}},e.expandPreOrPostfixIncrementOrDecrementExpression=function(t,r,n,i,a){var o=r.operator;e.Debug.assert(45===o||46===o,"Expected 'node' to be a pre- or post-increment or pre- or post-decrement expression");var s=t.createTempVariable(i);n=t.createAssignment(s,n),e.setTextRange(n,r.operand);var c=e.isPrefixUnaryExpression(r)?t.createPrefixUnaryExpression(o,s):t.createPostfixUnaryExpression(s,o);return e.setTextRange(c,r),a&&(c=t.createAssignment(a,c),e.setTextRange(c,r)),n=t.createComma(n,c),e.setTextRange(n,r),e.isPostfixUnaryExpression(r)&&(n=t.createComma(n,s),e.setTextRange(n,r)),n},e.isInternalName=function(t){return 0!=(32768&e.getEmitFlags(t))},e.isLocalName=function(t){return 0!=(16384&e.getEmitFlags(t))},e.isExportName=function(t){return 0!=(8192&e.getEmitFlags(t))},e.findUseStrictPrologue=function(t){for(var r=0,n=t;r<n.length;r++){var i=n[r];if(!e.isPrologueDirective(i))break;if(s(i))return i}},e.startsWithUseStrict=function(t){var r=e.firstOrUndefined(t);return void 0!==r&&e.isPrologueDirective(r)&&s(r)},e.isCommaSequence=function(e){return 220===e.kind&&27===e.operatorToken.kind||349===e.kind},e.isJSDocTypeAssertion=c,e.getJSDocTypeAssertionType=function(t){var r=e.getJSDocType(t);return e.Debug.assertIsDefined(r),r},e.isOuterExpression=l,e.skipOuterExpressions=u,e.skipAssertions=function(e){return u(e,6)},e.startOnNewLine=_,e.getExternalHelpersModuleName=d,e.hasRecordedExternalHelpers=function(t){var r=e.getOriginalNode(t,e.isSourceFile),n=r&&r.emitNode;return !(!n||!n.externalHelpersModuleName&&!n.externalHelpers)},e.createExternalHelpersImportDeclarationIfNeeded=function(t,r,n,i,a,o,s){if(i.importHelpers&&e.isEffectiveExternalModule(n,i)){var c=void 0,l=e.getEmitModuleKind(i);if(l>=e.ModuleKind.ES2015&&l<=e.ModuleKind.ESNext||n.impliedNodeFormat===e.ModuleKind.ESNext){var u=e.getEmitHelpers(n);if(u){for(var _=[],d=0,f=u;d<f.length;d++){var g=f[d];if(!g.scoped){var m=g.importName;m&&e.pushIfUnique(_,m);}}if(e.some(_)){_.sort(e.compareStringsCaseSensitive),c=t.createNamedImports(e.map(_,(function(i){return e.isFileLevelUniqueName(n,i)?t.createImportSpecifier(!1,void 0,t.createIdentifier(i)):t.createImportSpecifier(!1,t.createIdentifier(i),r.getUnscopedHelperName(i))})));var y=e.getOriginalNode(n,e.isSourceFile);e.getOrCreateEmitNode(y).externalHelpers=!0;}}}else {var v=p(t,n,i,a,o||s);v&&(c=t.createNamespaceImport(v));}if(c){var h=t.createImportDeclaration(void 0,void 0,t.createImportClause(!1,void 0,c),t.createStringLiteral(e.externalHelpersModuleNameText),void 0);return e.addEmitFlags(h,67108864),h}}},e.getOrCreateExternalHelpersModuleNameIfNeeded=p,e.getLocalNameForExternalImport=function(t,r,n){var i=e.getNamespaceDeclarationNode(r);if(i&&!e.isDefaultImport(r)&&!e.isExportNamespaceAsDefaultDeclaration(r)){var a=i.name;return e.isGeneratedIdentifier(a)?a:t.createIdentifier(e.getSourceTextOfNodeFromSourceFile(n,a)||e.idText(a))}return 265===r.kind&&r.importClause||271===r.kind&&r.moduleSpecifier?t.getGeneratedNameForNode(r):void 0},e.getExternalModuleNameLiteral=function(t,r,n,i,a,o){var s=e.getExternalModuleName(r);if(s&&e.isStringLiteral(s))return function(e,t,r,n,i){return f(r,n.getExternalModuleFileFromDeclaration(e),t,i)}(r,i,t,a,o)||function(e,t,r){var n=r.renamedDependencies&&r.renamedDependencies.get(t.text);return n?e.createStringLiteral(n):void 0}(t,s,n)||t.cloneNode(s)},e.tryGetModuleNameFromFile=f,e.getInitializerOfBindingOrAssignmentElement=function t(r){if(e.isDeclarationBindingElement(r))return r.initializer;if(e.isPropertyAssignment(r)){var n=r.initializer;return e.isAssignmentExpression(n,!0)?n.right:void 0}return e.isShorthandPropertyAssignment(r)?r.objectAssignmentInitializer:e.isAssignmentExpression(r,!0)?r.right:e.isSpreadElement(r)?t(r.expression):void 0},e.getTargetOfBindingOrAssignmentElement=g,e.getRestIndicatorOfBindingOrAssignmentElement=function(e){switch(e.kind){case 163:case 202:return e.dotDotDotToken;case 224:case 296:return e}},e.getPropertyNameOfBindingOrAssignmentElement=function(t){var r=m(t);return e.Debug.assert(!!r||e.isSpreadAssignment(t),"Invalid property name for binding element."),r},e.tryGetPropertyNameOfBindingOrAssignmentElement=m,e.getElementsOfBindingOrAssignmentPattern=function(e){switch(e.kind){case 200:case 201:case 203:return e.elements;case 204:return e.properties}},e.getJSDocTypeAliasName=function(t){if(t)for(var r=t;;){if(e.isIdentifier(r)||!r.body)return e.isIdentifier(r)?r:r.name;r=r.body;}},e.canHaveModifiers=function(e){var t=e.kind;return 163===t||165===t||166===t||167===t||168===t||170===t||171===t||172===t||175===t||212===t||213===t||225===t||236===t||255===t||256===t||257===t||258===t||259===t||260===t||264===t||265===t||270===t||271===t},e.isTypeNodeOrTypeParameterDeclaration=e.or(e.isTypeNode,e.isTypeParameterDeclaration),e.isQuestionOrExclamationToken=e.or(e.isQuestionToken,e.isExclamationToken),e.isIdentifierOrThisTypeNode=e.or(e.isIdentifier,e.isThisTypeNode),e.isReadonlyKeywordOrPlusOrMinusToken=e.or(e.isReadonlyKeyword,e.isPlusToken,e.isMinusToken),e.isQuestionOrPlusOrMinusToken=e.or(e.isQuestionToken,e.isPlusToken,e.isMinusToken),e.isModuleName=e.or(e.isIdentifier,e.isStringLiteral),e.isLiteralTypeLikeExpression=function(t){var r=t.kind;return 104===r||110===r||95===r||e.isLiteralExpression(t)||e.isPrefixUnaryExpression(t)},e.isBinaryOperatorToken=function(t){return function(t){return 60===t||function(e){return function(e){return 55===e||56===e}(e)||function(e){return function(e){return 50===e||51===e||52===e}(e)||function(e){return function(e){return 34===e||36===e||35===e||37===e}(e)||function(e){return function(e){return 29===e||32===e||31===e||33===e||102===e||101===e}(e)||function(e){return function(e){return 47===e||48===e||49===e}(e)||function(e){return function(e){return 39===e||40===e}(e)||function(e){return function(e){return 42===e}(e)||function(e){return 41===e||43===e||44===e}(e)}(e)}(e)}(e)}(e)}(e)}(e)}(t)||e.isAssignmentOperator(t)}(r=t.kind)||27===r;var r;},function(t){function r(t,n,i,a,o,s,l){var u=n>0?o[n-1]:void 0;return e.Debug.assertEqual(i[n],r),o[n]=t.onEnter(a[n],u,l),i[n]=c(t,r),n}function n(t,r,i,a,o,s,_){e.Debug.assertEqual(i[r],n),e.Debug.assertIsDefined(t.onLeft),i[r]=c(t,n);var d=t.onLeft(a[r].left,o[r],a[r]);return d?(u(r,a,d),l(r,i,a,o,d)):r}function i(t,r,n,a,o,s,l){return e.Debug.assertEqual(n[r],i),e.Debug.assertIsDefined(t.onOperator),n[r]=c(t,i),t.onOperator(a[r].operatorToken,o[r],a[r]),r}function a(t,r,n,i,o,s,_){e.Debug.assertEqual(n[r],a),e.Debug.assertIsDefined(t.onRight),n[r]=c(t,a);var d=t.onRight(i[r].right,o[r],i[r]);return d?(u(r,i,d),l(r,n,i,o,d)):r}function o(t,r,n,i,a,s,l){e.Debug.assertEqual(n[r],o),n[r]=c(t,o);var u=t.onExit(i[r],a[r]);if(r>0){if(r--,t.foldState){var _=n[r]===o?"right":"left";a[r]=t.foldState(a[r],u,_);}}else s.value=u;return r}function s(t,r,n,i,a,o,c){return e.Debug.assertEqual(n[r],s),r}function c(t,c){switch(c){case r:if(t.onLeft)return n;case n:if(t.onOperator)return i;case i:if(t.onRight)return a;case a:return o;case o:case s:return s;default:e.Debug.fail("Invalid state");}}function l(e,t,n,i,a){return t[++e]=r,n[e]=a,i[e]=void 0,e}function u(t,r,n){if(e.Debug.shouldAssert(2))for(;t>=0;)e.Debug.assert(r[t]!==n,"Circular traversal detected."),t--;}t.enter=r,t.left=n,t.operator=i,t.right=a,t.exit=o,t.done=s,t.nextState=c;}(v||(v={}));var h=function(e,t,r,n,i,a){this.onEnter=e,this.onLeft=t,this.onOperator=r,this.onRight=n,this.onExit=i,this.foldState=a;};e.createBinaryExpressionTrampoline=function(t,r,n,i,a,o){var s=new h(t,r,n,i,a,o);return function(t,r){for(var n={value:void 0},i=[v.enter],a=[t],o=[void 0],c=0;i[c]!==v.done;)c=i[c](s,c,i,a,o,n,r);return e.Debug.assertEqual(c,0),n.value}};}(t),function(e){e.setTextRange=function(t,r){return r?e.setTextRangePosEnd(t,r.pos,r.end):t};}(t),function(e){var t,r,i,a,o,s,c,l,u;function _(e,t){return t&&e(t)}function d(e,t,r){if(r){if(t)return t(r);for(var n=0,i=r;n<i.length;n++){var a=e(i[n]);if(a)return a}}}function p(e,t){return 42===e.charCodeAt(t+1)&&42===e.charCodeAt(t+2)&&47!==e.charCodeAt(t+3)}function f(t,r,n){if(t&&!(t.kind<=159))switch(t.kind){case 160:return _(r,t.left)||_(r,t.right);case 162:return _(r,t.name)||_(r,t.constraint)||_(r,t.default)||_(r,t.expression);case 295:return d(r,n,t.decorators)||d(r,n,t.modifiers)||_(r,t.name)||_(r,t.questionToken)||_(r,t.exclamationToken)||_(r,t.equalsToken)||_(r,t.objectAssignmentInitializer);case 296:return _(r,t.expression);case 163:return d(r,n,t.decorators)||d(r,n,t.modifiers)||_(r,t.dotDotDotToken)||_(r,t.name)||_(r,t.questionToken)||_(r,t.type)||_(r,t.initializer);case 166:return d(r,n,t.decorators)||d(r,n,t.modifiers)||_(r,t.name)||_(r,t.questionToken)||_(r,t.exclamationToken)||_(r,t.type)||_(r,t.initializer);case 165:return d(r,n,t.decorators)||d(r,n,t.modifiers)||_(r,t.name)||_(r,t.questionToken)||_(r,t.type)||_(r,t.initializer);case 294:return d(r,n,t.decorators)||d(r,n,t.modifiers)||_(r,t.name)||_(r,t.questionToken)||_(r,t.initializer);case 253:return d(r,n,t.decorators)||d(r,n,t.modifiers)||_(r,t.name)||_(r,t.exclamationToken)||_(r,t.type)||_(r,t.initializer);case 202:return d(r,n,t.decorators)||d(r,n,t.modifiers)||_(r,t.dotDotDotToken)||_(r,t.propertyName)||_(r,t.name)||_(r,t.initializer);case 178:case 179:case 173:case 174:case 175:return d(r,n,t.decorators)||d(r,n,t.modifiers)||d(r,n,t.typeParameters)||d(r,n,t.parameters)||_(r,t.type);case 168:case 167:case 170:case 171:case 172:case 212:case 255:case 213:return d(r,n,t.decorators)||d(r,n,t.modifiers)||_(r,t.asteriskToken)||_(r,t.name)||_(r,t.questionToken)||_(r,t.exclamationToken)||d(r,n,t.typeParameters)||d(r,n,t.parameters)||_(r,t.type)||_(r,t.equalsGreaterThanToken)||_(r,t.body);case 169:return d(r,n,t.decorators)||d(r,n,t.modifiers)||_(r,t.body);case 177:return _(r,t.typeName)||d(r,n,t.typeArguments);case 176:return _(r,t.assertsModifier)||_(r,t.parameterName)||_(r,t.type);case 180:return _(r,t.exprName);case 181:return d(r,n,t.members);case 182:return _(r,t.elementType);case 183:return d(r,n,t.elements);case 186:case 187:return d(r,n,t.types);case 188:return _(r,t.checkType)||_(r,t.extendsType)||_(r,t.trueType)||_(r,t.falseType);case 189:return _(r,t.typeParameter);case 199:return _(r,t.argument)||_(r,t.qualifier)||d(r,n,t.typeArguments);case 190:case 192:return _(r,t.type);case 193:return _(r,t.objectType)||_(r,t.indexType);case 194:return _(r,t.readonlyToken)||_(r,t.typeParameter)||_(r,t.nameType)||_(r,t.questionToken)||_(r,t.type)||d(r,n,t.members);case 195:return _(r,t.literal);case 196:return _(r,t.dotDotDotToken)||_(r,t.name)||_(r,t.questionToken)||_(r,t.type);case 200:case 201:case 203:return d(r,n,t.elements);case 204:return d(r,n,t.properties);case 205:return _(r,t.expression)||_(r,t.questionDotToken)||_(r,t.name);case 206:return _(r,t.expression)||_(r,t.questionDotToken)||_(r,t.argumentExpression);case 207:case 208:return _(r,t.expression)||_(r,t.questionDotToken)||d(r,n,t.typeArguments)||d(r,n,t.arguments);case 209:return _(r,t.tag)||_(r,t.questionDotToken)||d(r,n,t.typeArguments)||_(r,t.template);case 210:return _(r,t.type)||_(r,t.expression);case 211:case 214:case 215:case 216:return _(r,t.expression);case 218:return _(r,t.operand);case 223:return _(r,t.asteriskToken)||_(r,t.expression);case 217:return _(r,t.expression);case 219:return _(r,t.operand);case 220:return _(r,t.left)||_(r,t.operatorToken)||_(r,t.right);case 228:return _(r,t.expression)||_(r,t.type);case 229:return _(r,t.expression);case 230:return _(r,t.name);case 221:return _(r,t.condition)||_(r,t.questionToken)||_(r,t.whenTrue)||_(r,t.colonToken)||_(r,t.whenFalse);case 224:return _(r,t.expression);case 234:case 261:return d(r,n,t.statements);case 303:return d(r,n,t.statements)||_(r,t.endOfFileToken);case 236:return d(r,n,t.decorators)||d(r,n,t.modifiers)||_(r,t.declarationList);case 254:return d(r,n,t.declarations);case 237:return _(r,t.expression);case 238:return _(r,t.expression)||_(r,t.thenStatement)||_(r,t.elseStatement);case 239:return _(r,t.statement)||_(r,t.expression);case 240:return _(r,t.expression)||_(r,t.statement);case 241:return _(r,t.initializer)||_(r,t.condition)||_(r,t.incrementor)||_(r,t.statement);case 242:return _(r,t.initializer)||_(r,t.expression)||_(r,t.statement);case 243:return _(r,t.awaitModifier)||_(r,t.initializer)||_(r,t.expression)||_(r,t.statement);case 244:case 245:return _(r,t.label);case 246:return _(r,t.expression);case 247:return _(r,t.expression)||_(r,t.statement);case 248:return _(r,t.expression)||_(r,t.caseBlock);case 262:return d(r,n,t.clauses);case 288:return _(r,t.expression)||d(r,n,t.statements);case 289:return d(r,n,t.statements);case 249:return _(r,t.label)||_(r,t.statement);case 250:return _(r,t.expression);case 251:return _(r,t.tryBlock)||_(r,t.catchClause)||_(r,t.finallyBlock);case 291:return _(r,t.variableDeclaration)||_(r,t.block);case 164:return _(r,t.expression);case 256:case 225:case 257:return d(r,n,t.decorators)||d(r,n,t.modifiers)||_(r,t.name)||d(r,n,t.typeParameters)||d(r,n,t.heritageClauses)||d(r,n,t.members);case 258:return d(r,n,t.decorators)||d(r,n,t.modifiers)||_(r,t.name)||d(r,n,t.typeParameters)||_(r,t.type);case 259:return d(r,n,t.decorators)||d(r,n,t.modifiers)||_(r,t.name)||d(r,n,t.members);case 297:return _(r,t.name)||_(r,t.initializer);case 260:return d(r,n,t.decorators)||d(r,n,t.modifiers)||_(r,t.name)||_(r,t.body);case 264:return d(r,n,t.decorators)||d(r,n,t.modifiers)||_(r,t.name)||_(r,t.moduleReference);case 265:return d(r,n,t.decorators)||d(r,n,t.modifiers)||_(r,t.importClause)||_(r,t.moduleSpecifier)||_(r,t.assertClause);case 266:return _(r,t.name)||_(r,t.namedBindings);case 292:return d(r,n,t.elements);case 293:return _(r,t.name)||_(r,t.value);case 263:case 267:case 273:return _(r,t.name);case 268:case 272:return d(r,n,t.elements);case 271:return d(r,n,t.decorators)||d(r,n,t.modifiers)||_(r,t.exportClause)||_(r,t.moduleSpecifier)||_(r,t.assertClause);case 269:case 274:return _(r,t.propertyName)||_(r,t.name);case 270:return d(r,n,t.decorators)||d(r,n,t.modifiers)||_(r,t.expression);case 222:return _(r,t.head)||d(r,n,t.templateSpans);case 232:return _(r,t.expression)||_(r,t.literal);case 197:return _(r,t.head)||d(r,n,t.templateSpans);case 198:return _(r,t.type)||_(r,t.literal);case 161:return _(r,t.expression);case 290:return d(r,n,t.types);case 227:return _(r,t.expression)||d(r,n,t.typeArguments);case 276:return _(r,t.expression);case 275:return d(r,n,t.decorators);case 349:return d(r,n,t.elements);case 277:return _(r,t.openingElement)||d(r,n,t.children)||_(r,t.closingElement);case 281:return _(r,t.openingFragment)||d(r,n,t.children)||_(r,t.closingFragment);case 278:case 279:return _(r,t.tagName)||d(r,n,t.typeArguments)||_(r,t.attributes);case 285:return d(r,n,t.properties);case 284:return _(r,t.name)||_(r,t.initializer);case 286:return _(r,t.expression);case 287:return _(r,t.dotDotDotToken)||_(r,t.expression);case 280:return _(r,t.tagName);case 184:case 185:case 307:case 313:case 312:case 314:case 316:return _(r,t.type);case 315:return d(r,n,t.parameters)||_(r,t.type);case 318:return ("string"==typeof t.comment?void 0:d(r,n,t.comment))||d(r,n,t.tags);case 344:return _(r,t.tagName)||_(r,t.name)||("string"==typeof t.comment?void 0:d(r,n,t.comment));case 308:return _(r,t.name);case 309:return _(r,t.left)||_(r,t.right);case 338:case 345:return _(r,t.tagName)||(t.isNameFirst?_(r,t.name)||_(r,t.typeExpression)||("string"==typeof t.comment?void 0:d(r,n,t.comment)):_(r,t.typeExpression)||_(r,t.name)||("string"==typeof t.comment?void 0:d(r,n,t.comment)));case 328:return _(r,t.tagName)||("string"==typeof t.comment?void 0:d(r,n,t.comment));case 327:case 326:return _(r,t.tagName)||_(r,t.class)||("string"==typeof t.comment?void 0:d(r,n,t.comment));case 342:return _(r,t.tagName)||_(r,t.constraint)||d(r,n,t.typeParameters)||("string"==typeof t.comment?void 0:d(r,n,t.comment));case 343:return _(r,t.tagName)||(t.typeExpression&&307===t.typeExpression.kind?_(r,t.typeExpression)||_(r,t.fullName)||("string"==typeof t.comment?void 0:d(r,n,t.comment)):_(r,t.fullName)||_(r,t.typeExpression)||("string"==typeof t.comment?void 0:d(r,n,t.comment)));case 336:return _(r,t.tagName)||_(r,t.fullName)||_(r,t.typeExpression)||("string"==typeof t.comment?void 0:d(r,n,t.comment));case 339:case 341:case 340:case 337:return _(r,t.tagName)||_(r,t.typeExpression)||("string"==typeof t.comment?void 0:d(r,n,t.comment));case 321:return e.forEach(t.typeParameters,r)||e.forEach(t.parameters,r)||_(r,t.type);case 322:case 323:case 324:return _(r,t.name);case 320:return e.forEach(t.jsDocPropertyTags,r);case 325:case 330:case 331:case 332:case 333:case 334:case 329:return _(r,t.tagName)||("string"==typeof t.comment?void 0:d(r,n,t.comment));case 348:return _(r,t.expression)}}function g(e){var t=[];return f(e,r,r),t;function r(e){t.unshift(e);}}function m(e){return void 0!==e.externalModuleIndicator}function y(t){return e.fileExtensionIsOneOf(t,[".d.ts",".d.mts",".d.cts"])}function v(t,r){for(var n=[],i=0,a=e.getLeadingCommentRanges(r,0)||e.emptyArray;i<a.length;i++){var o=a[i];T(n,o,r.substring(o.pos,o.end));}t.pragmas=new e.Map;for(var s=0,c=n;s<c.length;s++){var l=c[s];if(t.pragmas.has(l.name)){var u=t.pragmas.get(l.name);u instanceof Array?u.push(l.args):t.pragmas.set(l.name,[u,l.args]);}else t.pragmas.set(l.name,l.args);}}function h(t,r){t.checkJsDirective=void 0,t.referencedFiles=[],t.typeReferenceDirectives=[],t.libReferenceDirectives=[],t.amdDependencies=[],t.hasNoDefaultLib=!1,t.pragmas.forEach((function(n,i){switch(i){case"reference":var a=t.referencedFiles,o=t.typeReferenceDirectives,s=t.libReferenceDirectives;e.forEach(e.toArray(n),(function(n){var i=n.arguments,c=i.types,l=i.lib,u=i.path;n.arguments["no-default-lib"]?t.hasNoDefaultLib=!0:c?o.push({pos:c.pos,end:c.end,fileName:c.value}):l?s.push({pos:l.pos,end:l.end,fileName:l.value}):u?a.push({pos:u.pos,end:u.end,fileName:u.value}):r(n.range.pos,n.range.end-n.range.pos,e.Diagnostics.Invalid_reference_directive_syntax);}));break;case"amd-dependency":t.amdDependencies=e.map(e.toArray(n),(function(e){return {name:e.arguments.name,path:e.arguments.path}}));break;case"amd-module":if(n instanceof Array)for(var c=0,l=n;c<l.length;c++){var u=l[c];t.moduleName&&r(u.range.pos,u.range.end-u.range.pos,e.Diagnostics.An_AMD_module_cannot_have_multiple_name_assignments),t.moduleName=u.arguments.name;}else t.moduleName=n.arguments.name;break;case"ts-nocheck":case"ts-check":e.forEach(e.toArray(n),(function(e){(!t.checkJsDirective||e.range.pos>t.checkJsDirective.pos)&&(t.checkJsDirective={enabled:"ts-check"===i,end:e.range.end,pos:e.range.pos});}));break;case"jsx":case"jsxfrag":case"jsximportsource":case"jsxruntime":return;default:e.Debug.fail("Unhandled pragma kind");}}));}!function(e){e[e.None=0]="None",e[e.Yield=1]="Yield",e[e.Await=2]="Await",e[e.Type=4]="Type",e[e.IgnoreMissingOpenBrace=16]="IgnoreMissingOpenBrace",e[e.JSDoc=32]="JSDoc";}(t||(t={})),function(e){e[e.TryParse=0]="TryParse",e[e.Lookahead=1]="Lookahead",e[e.Reparse=2]="Reparse";}(r||(r={})),e.parseBaseNodeFactory={createBaseSourceFileNode:function(t){return new(c||(c=e.objectAllocator.getSourceFileConstructor()))(t,-1,-1)},createBaseIdentifierNode:function(t){return new(o||(o=e.objectAllocator.getIdentifierConstructor()))(t,-1,-1)},createBasePrivateIdentifierNode:function(t){return new(s||(s=e.objectAllocator.getPrivateIdentifierConstructor()))(t,-1,-1)},createBaseTokenNode:function(t){return new(a||(a=e.objectAllocator.getTokenConstructor()))(t,-1,-1)},createBaseNode:function(t){return new(i||(i=e.objectAllocator.getNodeConstructor()))(t,-1,-1)}},e.parseNodeFactory=e.createNodeFactory(1,e.parseBaseNodeFactory),e.isJSDocLikeText=p,e.forEachChild=f,e.forEachChildRecursively=function(t,r,n){for(var i=g(t),a=[];a.length<i.length;)a.push(t);for(;0!==i.length;){var o=i.pop(),s=a.pop();if(e.isArray(o)){if(n&&(l=n(o,s))){if("skip"===l)continue;return l}for(var c=o.length-1;c>=0;--c)i.push(o[c]),a.push(s);}else {var l;if(l=r(o,s)){if("skip"===l)continue;return l}if(o.kind>=160)for(var u=0,_=g(o);u<_.length;u++){var d=_[u];i.push(d),a.push(o);}}}},e.createSourceFile=function(t,r,n,i,a){var o;return void 0===i&&(i=!1),null===e.tracing||void 0===e.tracing||e.tracing.push("parse","createSourceFile",{path:t},!0),e.performance.mark("beforeParse"),e.perfLogger.logStartParseSourceFile(t),o=100===n?l.parseSourceFile(t,r,n,void 0,i,6):l.parseSourceFile(t,r,n,void 0,i,a),e.perfLogger.logStopParseSourceFile(),e.performance.mark("afterParse"),e.performance.measure("Parse","beforeParse","afterParse"),null===e.tracing||void 0===e.tracing||e.tracing.pop(),o},e.parseIsolatedEntityName=function(e,t){return l.parseIsolatedEntityName(e,t)},e.parseJsonText=function(e,t){return l.parseJsonText(e,t)},e.isExternalModule=m,e.updateSourceFile=function(e,t,r,n){void 0===n&&(n=!1);var i=u.updateSourceFile(e,t,r,n);return i.flags|=3145728&e.flags,i},e.parseIsolatedJSDocComment=function(e,t,r){var n=l.JSDocParser.parseIsolatedJSDocComment(e,t,r);return n&&n.jsDoc&&l.fixupParentReferences(n.jsDoc),n},e.parseJSDocTypeExpressionForTests=function(e,t,r){return l.JSDocParser.parseJSDocTypeExpressionForTests(e,t,r)},function(t){var r,i,a,o,s,c=e.createScanner(99,!0);function l(e){return N++,e}var _,d,g,b,x,D,S,T,C,k,N,F,A,P,w,I,O,M={createBaseSourceFileNode:function(e){return l(new s(e,0,0))},createBaseIdentifierNode:function(e){return l(new a(e,0,0))},createBasePrivateIdentifierNode:function(e){return l(new o(e,0,0))},createBaseTokenNode:function(e){return l(new i(e,0,0))},createBaseNode:function(e){return l(new r(e,0,0))}},L=e.createNodeFactory(11,M),R=!0,B=!1;function j(t,r,n,i,a){void 0===n&&(n=2),void 0===a&&(a=!1),J(t,r,n,i,6),d=O,ve();var o,s,c=pe();if(1===ge())o=We([],c,c),s=Ue();else {for(var l=void 0;1!==ge();){var u=void 0;switch(ge()){case 22:u=Tn();break;case 110:case 95:case 104:u=Ue();break;case 40:u=ke((function(){return 8===ve()&&58!==ve()}))?Zr():En();break;case 8:case 10:if(ke((function(){return 58!==ve()}))){u=Mt();break}default:u=En();}l&&e.isArray(l)?l.push(u):l?l=[l,u]:(l=u,1!==ge()&&ce(e.Diagnostics.Unexpected_token));}var _=e.isArray(l)?He(L.createArrayLiteralExpression(l),c):e.Debug.checkDefined(l),p=L.createExpressionStatement(_);He(p,c),o=We([p],c),s=ze(1,e.Diagnostics.Unexpected_token);}var f=H(t,2,6,!1,o,s,d);a&&W(f),f.nodeCount=N,f.identifierCount=P,f.identifiers=F,f.parseDiagnostics=e.attachFileToDiagnostics(S,f),T&&(f.jsDocDiagnostics=e.attachFileToDiagnostics(T,f));var g=f;return z(),g}function J(t,n,l,u,p){switch(r=e.objectAllocator.getNodeConstructor(),i=e.objectAllocator.getTokenConstructor(),a=e.objectAllocator.getIdentifierConstructor(),o=e.objectAllocator.getPrivateIdentifierConstructor(),s=e.objectAllocator.getSourceFileConstructor(),_=e.normalizePath(t),g=n,b=l,C=u,x=p,D=e.getLanguageVariant(p),S=[],w=0,F=new e.Map,A=new e.Map,P=0,N=0,d=0,R=!0,x){case 1:case 2:O=131072;break;case 6:O=33685504;break;default:O=0;}B=!1,c.setText(g),c.setOnError(de),c.setScriptTarget(b),c.setLanguageVariant(D);}function z(){c.clearCommentDirectives(),c.setText(""),c.setOnError(void 0),g=void 0,b=void 0,C=void 0,x=void 0,D=void 0,d=0,S=void 0,T=void 0,w=0,F=void 0,I=void 0,R=!0;}function U(t,r,n){var i=y(_);i&&(O|=8388608),d=O,ve();var a=ht(0,zn);e.Debug.assert(1===ge());var o=q(Ue()),s=H(_,t,n,i,a,o,d);return v(s,g),h(s,(function(t,r,n){S.push(e.createDetachedDiagnostic(_,t,r,n));})),s.commentDirectives=c.getCommentDirectives(),s.nodeCount=N,s.identifierCount=P,s.identifiers=F,s.parseDiagnostics=e.attachFileToDiagnostics(S,s),T&&(s.jsDocDiagnostics=e.attachFileToDiagnostics(T,s)),r&&W(s),s}function K(e,t){return t?q(e):e}t.parseSourceFile=function(t,r,n,i,a,o){var s;if(void 0===a&&(a=!1),6===(o=e.ensureScriptKind(t,o))){var c=j(t,r,n,i,a);return e.convertToObjectWorker(c,null===(s=c.statements[0])||void 0===s?void 0:s.expression,c.parseDiagnostics,!1,void 0,void 0),c.referencedFiles=e.emptyArray,c.typeReferenceDirectives=e.emptyArray,c.libReferenceDirectives=e.emptyArray,c.amdDependencies=e.emptyArray,c.hasNoDefaultLib=!1,c.pragmas=e.emptyMap,c}J(t,r,n,i,o);var l=U(n,a,o);return z(),l},t.parseIsolatedEntityName=function(e,t){J("",e,t,void 0,1),ve();var r=Nt(!0),n=1===ge()&&!S.length;return z(),n?r:void 0},t.parseJsonText=j;var V=!1;function q(t){e.Debug.assert(!t.jsDoc);var r=e.mapDefined(e.getJSDocCommentRanges(t,g),(function(e){return Oe.parseJSDocComment(t,e.pos,e.end-e.pos)}));return r.length&&(t.jsDoc=r),V&&(V=!1,t.flags|=134217728),t}function W(t){e.setParentRecursive(t,!0);}function H(t,r,n,i,a,o,s){var l=L.createSourceFile(a,o,s);return e.setTextRangePosWidth(l,0,g.length),function(t){t.externalModuleIndicator=e.forEach(t.statements,Mi)||function(e){return 2097152&e.flags?Li(e):void 0}(t);}(l),!i&&m(l)&&16777216&l.transformFlags&&(l=function(t){var r=C,n=u.createSyntaxCursor(t);C={currentNode:function(e){var t=n.currentNode(e);return R&&t&&p(t)&&(t.intersectsChange=!0),t}};var i=[],a=S;S=[];for(var o=0,s=f(t.statements,0),l=function(){var r=t.statements[o],n=t.statements[s];e.addRange(i,t.statements,o,s),o=g(t.statements,s);var l=e.findIndex(a,(function(e){return e.start>=r.pos})),u=l>=0?e.findIndex(a,(function(e){return e.start>=n.pos}),l):-1;l>=0&&e.addRange(S,a,l,u>=0?u:void 0),Ee((function(){var e=O;for(O|=32768,c.setTextPos(n.pos),ve();1!==ge();){var r=c.getStartPos(),a=bt(0,zn);if(i.push(a),r===c.getStartPos()&&ve(),o>=0){var s=t.statements[o];if(a.end===s.pos)break;a.end>s.pos&&(o=g(t.statements,o+1));}}O=e;}),2),s=o>=0?f(t.statements,o):-1;};-1!==s;)l();if(o>=0){var _=t.statements[o];e.addRange(i,t.statements,o);var d=e.findIndex(a,(function(e){return e.start>=_.pos}));d>=0&&e.addRange(S,a,d);}return C=r,L.updateSourceFile(t,e.setTextRange(L.createNodeArray(i),t.statements));function p(e){return !(32768&e.flags||!(16777216&e.transformFlags))}function f(e,t){for(var r=t;r<e.length;r++)if(p(e[r]))return r;return -1}function g(e,t){for(var r=t;r<e.length;r++)if(!p(e[r]))return r;return -1}}(l)),l.text=g,l.bindDiagnostics=[],l.bindSuggestionDiagnostics=void 0,l.languageVersion=r,l.fileName=t,l.languageVariant=e.getLanguageVariant(n),l.isDeclarationFile=i,l.scriptKind=n,l}function G(e,t){e?O|=t:O&=~t;}function Q(e){G(e,4096);}function X(e){G(e,8192);}function Y(e){G(e,16384);}function Z(e){G(e,32768);}function $(e,t){var r=e&O;if(r){G(!1,r);var n=t();return G(!0,r),n}return t()}function ee(e,t){var r=e&~O;if(r){G(!0,r);var n=t();return G(!1,r),n}return t()}function te(e){return $(4096,e)}function re(e){return ee(32768,e)}function ne(e){return 0!=(O&e)}function ie(){return ne(8192)}function ae(){return ne(4096)}function oe(){return ne(16384)}function se(){return ne(32768)}function ce(e,t){ue(c.getTokenPos(),c.getTextPos(),e,t);}function le(t,r,n,i){var a=e.lastOrUndefined(S);a&&t===a.start||S.push(e.createDetachedDiagnostic(_,t,r,n,i)),B=!0;}function ue(e,t,r,n){le(e,t-e,r,n);}function _e(e,t,r){ue(e.pos,e.end,t,r);}function de(e,t){le(c.getTextPos(),t,e);}function pe(){return c.getStartPos()}function fe(){return c.hasPrecedingJSDocComment()}function ge(){return k}function me(){return k=c.scan()}function ye(e){return ve(),e()}function ve(){return e.isKeyword(k)&&(c.hasUnicodeEscape()||c.hasExtendedUnicodeEscape())&&ue(c.getTokenPos(),c.getTextPos(),e.Diagnostics.Keywords_cannot_contain_escape_characters),me()}function he(){return k=c.scanJsDocToken()}function be(){return k=c.reScanGreaterToken()}function xe(){return k=c.reScanTemplateHeadOrNoSubstitutionTemplate()}function De(){return k=c.reScanLessThanToken()}function Se(){return k=c.reScanHashToken()}function Te(){return k=c.scanJsxIdentifier()}function Ce(){return k=c.scanJsxToken()}function Ee(t,r){var n=k,i=S.length,a=B,o=O,s=0!==r?c.lookAhead(t):c.tryScan(t);return e.Debug.assert(o===O),s&&0===r||(k=n,2!==r&&(S.length=i),B=a),s}function ke(e){return Ee(e,1)}function Ne(e){return Ee(e,0)}function Fe(){return 79===ge()||ge()>116}function Ae(){return 79===ge()||(125!==ge()||!ie())&&(132!==ge()||!se())&&ge()>116}function Pe(t,r,n){return void 0===n&&(n=!0),ge()===t?(n&&ve(),!0):(r?ce(r):ce(e.Diagnostics._0_expected,e.tokenToString(t)),!1)}t.fixupParentReferences=W;var we,Ie,Oe,Me=Object.keys(e.textToKeywordObj).filter((function(e){return e.length>2}));function Le(t){var r;if(e.isTaggedTemplateExpression(t))ue(e.skipTrivia(g,t.template.pos),t.template.end,e.Diagnostics.Module_declaration_names_may_only_use_or_quoted_strings);else {var n=e.isIdentifier(t)?e.idText(t):void 0;if(n&&e.isIdentifierText(n,b)){var i=e.skipTrivia(g,t.pos);switch(n){case"const":case"let":case"var":return void ue(i,t.end,e.Diagnostics.Variable_declaration_not_allowed_at_this_location);case"declare":return;case"interface":return void Re(e.Diagnostics.Interface_name_cannot_be_0,e.Diagnostics.Interface_must_be_given_a_name,18);case"is":return void ue(i,c.getTextPos(),e.Diagnostics.A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods);case"module":case"namespace":return void Re(e.Diagnostics.Namespace_name_cannot_be_0,e.Diagnostics.Namespace_must_be_given_a_name,18);case"type":return void Re(e.Diagnostics.Type_alias_name_cannot_be_0,e.Diagnostics.Type_alias_must_be_given_a_name,63)}var a=null!==(r=e.getSpellingSuggestion(n,Me,(function(e){return e})))&&void 0!==r?r:function(t){for(var r=0,n=Me;r<n.length;r++){var i=n[r];if(t.length>i.length+2&&e.startsWith(t,i))return "".concat(i," ").concat(t.slice(i.length))}}(n);a?ue(i,t.end,e.Diagnostics.Unknown_keyword_or_identifier_Did_you_mean_0,a):0!==ge()&&ue(i,t.end,e.Diagnostics.Unexpected_keyword_or_identifier);}else ce(e.Diagnostics._0_expected,e.tokenToString(26));}}function Re(e,t,r){ge()===r?ce(t):ce(e,c.getTokenValue());}function Be(t){return ge()===t?(he(),!0):(ce(e.Diagnostics._0_expected,e.tokenToString(t)),!1)}function je(e){return ge()===e&&(ve(),!0)}function Je(e){if(ge()===e)return Ue()}function ze(t,r,n){return Je(t)||Ge(t,!1,r||e.Diagnostics._0_expected,n||e.tokenToString(t))}function Ue(){var e=pe(),t=ge();return ve(),He(L.createToken(t),e)}function Ke(){return 26===ge()||19===ge()||1===ge()||c.hasPrecedingLineBreak()}function Ve(){return !!Ke()&&(26===ge()&&ve(),!0)}function qe(){return Ve()||Pe(26)}function We(t,r,n,i){var a=L.createNodeArray(t,i);return e.setTextRangePosEnd(a,r,null!=n?n:c.getStartPos()),a}function He(t,r,n){return e.setTextRangePosEnd(t,r,null!=n?n:c.getStartPos()),O&&(t.flags|=O),B&&(B=!1,t.flags|=65536),t}function Ge(t,r,n,i){r?le(c.getStartPos(),0,n,i):n&&ce(n,i);var a=pe();return He(79===t?L.createIdentifier("",void 0,void 0):e.isTemplateLiteralKind(t)?L.createTemplateLiteralLikeNode(t,"","",void 0):8===t?L.createNumericLiteral("",void 0):10===t?L.createStringLiteral("",void 0):275===t?L.createMissingDeclaration():L.createToken(t),a)}function Qe(e){var t=F.get(e);return void 0===t&&F.set(e,t=e),t}function Xe(t,r,n){if(t){P++;var i=pe(),a=ge(),o=Qe(c.getTokenValue());return me(),He(L.createIdentifier(o,void 0,a),i)}if(80===ge())return ce(n||e.Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies),Xe(!0);if(0===ge()&&c.tryScan((function(){return 79===c.reScanInvalidIdentifier()})))return Xe(!0);P++;var s=1===ge(),l=c.isReservedWord(),u=c.getTokenText(),_=l?e.Diagnostics.Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here:e.Diagnostics.Identifier_expected;return Ge(79,s,r||_,u)}function Ye(e){return Xe(Fe(),void 0,e)}function Ze(e,t){return Xe(Ae(),e,t)}function $e(t){return Xe(e.tokenIsIdentifierOrKeyword(ge()),t)}function et(){return e.tokenIsIdentifierOrKeyword(ge())||10===ge()||8===ge()}function tt(){return function(e){if(10===ge()||8===ge()){var t=Mt();return t.text=Qe(t.text),t}return e&&22===ge()?function(){var e=pe();Pe(22);var t=te(jr);return Pe(23),He(L.createComputedPropertyName(t),e)}():80===ge()?rt():$e()}(!0)}function rt(){var e,t,r=pe(),n=L.createPrivateIdentifier((e=c.getTokenText(),void 0===(t=A.get(e))&&A.set(e,t=e),t));return ve(),He(n,r)}function nt(e){return ge()===e&&Ne(at)}function it(){return ve(),!c.hasPrecedingLineBreak()&&ct()}function at(){switch(ge()){case 85:return 92===ve();case 93:return ve(),88===ge()?ke(lt):151===ge()?ke(st):ot();case 88:return lt();case 124:case 136:case 148:return ve(),ct();default:return it()}}function ot(){return 41!==ge()&&127!==ge()&&18!==ge()&&ct()}function st(){return ve(),ot()}function ct(){return 22===ge()||18===ge()||41===ge()||25===ge()||et()}function lt(){return ve(),84===ge()||98===ge()||118===ge()||126===ge()&&ke(On)||131===ge()&&ke(Mn)}function ut(t,r){if(xt(t))return !0;switch(t){case 0:case 1:case 3:return !(26===ge()&&r)&&jn();case 2:return 82===ge()||88===ge();case 4:return ke(ar);case 5:return ke(oi)||26===ge()&&!r;case 6:return 22===ge()||et();case 12:switch(ge()){case 22:case 41:case 25:case 24:return !0;default:return et()}case 18:return et();case 9:return 22===ge()||25===ge()||et();case 24:return e.tokenIsIdentifierOrKeyword(ge())||10===ge();case 7:return 18===ge()?ke(_t):r?Ae()&&!gt():Rr()&&!gt();case 8:return Gn();case 10:return 27===ge()||25===ge()||Gn();case 19:return Ae();case 15:switch(ge()){case 27:case 24:return !0}case 11:return 25===ge()||Br();case 16:return Ht(!1);case 17:return Ht(!0);case 20:case 21:return 27===ge()||Sr();case 22:return bi();case 23:return e.tokenIsIdentifierOrKeyword(ge());case 13:return e.tokenIsIdentifierOrKeyword(ge())||18===ge();case 14:return !0}return e.Debug.fail("Non-exhaustive case in 'isListElement'.")}function _t(){if(e.Debug.assert(18===ge()),19===ve()){var t=ve();return 27===t||18===t||94===t||117===t}return !0}function dt(){return ve(),Ae()}function pt(){return ve(),e.tokenIsIdentifierOrKeyword(ge())}function ft(){return ve(),e.tokenIsIdentifierOrKeywordOrGreaterThan(ge())}function gt(){return (117===ge()||94===ge())&&ke(mt)}function mt(){return ve(),Br()}function yt(){return ve(),Sr()}function vt(e){if(1===ge())return !0;switch(e){case 1:case 2:case 4:case 5:case 6:case 12:case 9:case 23:case 24:return 19===ge();case 3:return 19===ge()||82===ge()||88===ge();case 7:return 18===ge()||94===ge()||117===ge();case 8:return !!Ke()||!!Qr(ge())||38===ge();case 19:return 31===ge()||20===ge()||18===ge()||94===ge()||117===ge();case 11:return 21===ge()||26===ge();case 15:case 21:case 10:return 23===ge();case 17:case 16:case 18:return 21===ge()||23===ge();case 20:return 27!==ge();case 22:return 18===ge()||19===ge();case 13:return 31===ge()||43===ge();case 14:return 29===ge()&&ke(ki);default:return !1}}function ht(e,t){var r=w;w|=1<<e;for(var n=[],i=pe();!vt(e);)if(ut(e,!1))n.push(bt(e,t));else if(St(e))break;return w=r,We(n,i)}function bt(e,t){var r=xt(e);return r?Dt(r):t()}function xt(t){if(C&&function(e){switch(e){case 5:case 2:case 0:case 1:case 3:case 6:case 4:case 8:case 17:case 16:return !0}return !1}(t)&&!B){var r=C.currentNode(c.getStartPos());if(!(e.nodeIsMissing(r)||r.intersectsChange||e.containsParseError(r))&&(25358336&r.flags)===O&&function(e,t){switch(t){case 5:return function(e){if(e)switch(e.kind){case 170:case 175:case 171:case 172:case 166:case 233:return !0;case 168:var t=e;return !(79===t.name.kind&&134===t.name.originalKeywordKind)}return !1}(e);case 2:return function(e){if(e)switch(e.kind){case 288:case 289:return !0}return !1}(e);case 0:case 1:case 3:return function(e){if(e)switch(e.kind){case 255:case 236:case 234:case 238:case 237:case 250:case 246:case 248:case 245:case 244:case 242:case 243:case 241:case 240:case 247:case 235:case 251:case 249:case 239:case 252:case 265:case 264:case 271:case 270:case 260:case 256:case 257:case 259:case 258:return !0}return !1}(e);case 6:return function(e){return 297===e.kind}(e);case 4:return function(e){if(e)switch(e.kind){case 174:case 167:case 175:case 165:case 173:return !0}return !1}(e);case 8:return function(e){return 253===e.kind&&void 0===e.initializer}(e);case 17:case 16:return function(e){return 163===e.kind&&void 0===e.initializer}(e)}return !1}(r,t))return r.jsDocCache&&(r.jsDocCache=void 0),r}}function Dt(e){return c.setTextPos(e.end),ve(),e}function St(t){return function(t){switch(t){case 0:return 88===ge()?ce(e.Diagnostics._0_expected,e.tokenToString(93)):ce(e.Diagnostics.Declaration_or_statement_expected);case 1:return ce(e.Diagnostics.Declaration_or_statement_expected);case 2:return ce(e.Diagnostics.case_or_default_expected);case 3:return ce(e.Diagnostics.Statement_expected);case 18:case 4:return ce(e.Diagnostics.Property_or_signature_expected);case 5:return ce(e.Diagnostics.Unexpected_token_A_constructor_method_accessor_or_property_was_expected);case 6:return ce(e.Diagnostics.Enum_member_expected);case 7:return ce(e.Diagnostics.Expression_expected);case 8:return e.isKeyword(ge())?ce(e.Diagnostics._0_is_not_allowed_as_a_variable_declaration_name,e.tokenToString(ge())):ce(e.Diagnostics.Variable_declaration_expected);case 9:return ce(e.Diagnostics.Property_destructuring_pattern_expected);case 10:return ce(e.Diagnostics.Array_element_destructuring_pattern_expected);case 11:return ce(e.Diagnostics.Argument_expression_expected);case 12:return ce(e.Diagnostics.Property_assignment_expected);case 15:return ce(e.Diagnostics.Expression_or_comma_expected);case 17:return ce(e.Diagnostics.Parameter_declaration_expected);case 16:return e.isKeyword(ge())?ce(e.Diagnostics._0_is_not_allowed_as_a_parameter_name,e.tokenToString(ge())):ce(e.Diagnostics.Parameter_declaration_expected);case 19:return ce(e.Diagnostics.Type_parameter_declaration_expected);case 20:return ce(e.Diagnostics.Type_argument_expected);case 21:return ce(e.Diagnostics.Type_expected);case 22:return ce(e.Diagnostics.Unexpected_token_expected);case 23:case 13:case 14:ce(e.Diagnostics.Identifier_expected);}}(t),!!function(){for(var e=0;e<25;e++)if(w&1<<e&&(ut(e,!0)||vt(e)))return !0;return !1}()||(ve(),!1)}function Tt(e,t,r){var n=w;w|=1<<e;for(var i=[],a=pe(),o=-1;;)if(ut(e,!1)){var s=c.getStartPos();if(i.push(bt(e,t)),o=c.getTokenPos(),je(27))continue;if(o=-1,vt(e))break;Pe(27,Ct(e)),r&&26===ge()&&!c.hasPrecedingLineBreak()&&ve(),s===c.getStartPos()&&ve();}else {if(vt(e))break;if(St(e))break}return w=n,We(i,a,void 0,o>=0)}function Ct(t){return 6===t?e.Diagnostics.An_enum_member_name_must_be_followed_by_a_or:void 0}function Et(){var e=We([],pe());return e.isMissingList=!0,e}function kt(e,t,r,n){if(Pe(r)){var i=Tt(e,t);return Pe(n),i}return Et()}function Nt(e,t){for(var r=pe(),n=e?$e(t):Ze(t),i=pe();je(24);){if(29===ge()){n.jsdocDotPos=i;break}i=pe(),n=He(L.createQualifiedName(n,At(e,!1)),r);}return n}function Ft(e,t){return He(L.createQualifiedName(e,t),e.pos)}function At(t,r){if(c.hasPrecedingLineBreak()&&e.tokenIsIdentifierOrKeyword(ge())&&ke(In))return Ge(79,!0,e.Diagnostics.Identifier_expected);if(80===ge()){var n=rt();return r?n:Ge(79,!0,e.Diagnostics.Identifier_expected)}return t?$e():Ze()}function Pt(e){var t=pe();return He(L.createTemplateExpression(Lt(e),function(e){var t,r=pe(),n=[];do{t=Ot(e),n.push(t);}while(16===t.literal.kind);return We(n,r)}(e)),t)}function wt(){var e=pe();return He(L.createTemplateLiteralTypeSpan(Or(),It(!1)),e)}function It(t){return 19===ge()?(function(e){k=c.reScanTemplateToken(e);}(t),r=Rt(ge()),e.Debug.assert(16===r.kind||17===r.kind,"Template fragment has wrong token kind"),r):ze(17,e.Diagnostics._0_expected,e.tokenToString(19));var r;}function Ot(e){var t=pe();return He(L.createTemplateSpan(te(jr),It(e)),t)}function Mt(){return Rt(ge())}function Lt(t){t&&xe();var r=Rt(ge());return e.Debug.assert(15===r.kind,"Template head has wrong token kind"),r}function Rt(t){var r=pe(),n=e.isTemplateLiteralKind(t)?L.createTemplateLiteralLikeNode(t,c.getTokenValue(),function(e){var t=14===e||17===e,r=c.getTokenText();return r.substring(1,r.length-(c.isUnterminated()?0:t?1:2))}(t),2048&c.getTokenFlags()):8===t?L.createNumericLiteral(c.getTokenValue(),c.getNumericLiteralFlags()):10===t?L.createStringLiteral(c.getTokenValue(),void 0,c.hasExtendedUnicodeEscape()):e.isLiteralKind(t)?L.createLiteralLikeNode(t,c.getTokenValue()):e.Debug.fail();return c.hasExtendedUnicodeEscape()&&(n.hasExtendedUnicodeEscape=!0),c.isUnterminated()&&(n.isUnterminated=!0),ve(),He(n,r)}function Bt(){return Nt(!0,e.Diagnostics.Type_expected)}function jt(){if(!c.hasPrecedingLineBreak()&&29===De())return kt(20,Or,29,31)}function Jt(){var e=pe();return He(L.createTypeReferenceNode(Bt(),jt()),e)}function zt(t){switch(t.kind){case 177:return e.nodeIsMissing(t.typeName);case 178:case 179:var r=t,n=r.parameters,i=r.type;return !!n.isMissingList||zt(i);case 190:return zt(t.type);default:return !1}}function Ut(){var e=pe();return ve(),He(L.createThisTypeNode(),e)}function Kt(){var e,t=pe();return 108!==ge()&&103!==ge()||(e=$e(),Pe(58)),He(L.createParameterDeclaration(void 0,void 0,void 0,e,void 0,Vt(),void 0),t)}function Vt(){c.setInJSDocType(!0);var e=pe();if(je(141)){var t=L.createJSDocNamepathType(void 0);e:for(;;)switch(ge()){case 19:case 1:case 27:case 5:break e;default:he();}return c.setInJSDocType(!1),He(t,e)}var r=je(25),n=wr();return c.setInJSDocType(!1),r&&(n=He(L.createJSDocVariadicType(n),e)),63===ge()?(ve(),He(L.createJSDocOptionalType(n),e)):n}function qt(){var e,t,r=pe(),n=Ze();je(94)&&(Sr()||!Br()?e=Or():t=$r());var i=je(63)?Or():void 0,a=L.createTypeParameterDeclaration(n,e,i);return a.expression=t,He(a,r)}function Wt(){if(29===ge())return kt(19,qt,29,31)}function Ht(t){return 25===ge()||Gn()||e.isModifierKind(ge())||59===ge()||Sr(!t)}function Gt(){return Xt(!0)}function Qt(){return Xt(!1)}function Xt(t){var r=pe(),n=fe(),i=t?re(li):li();if(108===ge()){var a=L.createParameterDeclaration(i,void 0,void 0,Xe(!0),void 0,Lr(),void 0);return i&&_e(i[0],e.Diagnostics.Decorators_may_not_be_applied_to_this_parameters),K(He(a,r),n)}var o=R;R=!1;var s=_i(),c=K(He(L.createParameterDeclaration(i,s,Je(25),function(t){var r=Qn(e.Diagnostics.Private_identifiers_cannot_be_used_as_parameters);return 0===e.getFullWidth(r)&&!e.some(t)&&e.isModifierKind(ge())&&ve(),r}(s),Je(57),Lr(),Jr()),r),n);return R=o,c}function Yt(t,r){if(function(t,r){return 38===t?(Pe(t),!0):!!je(58)||!(!r||38!==ge())&&(ce(e.Diagnostics._0_expected,e.tokenToString(58)),ve(),!0)}(t,r))return wr()}function Zt(e){var t=ie(),r=se();X(!!(1&e)),Z(!!(2&e));var n=32&e?Tt(17,Kt):Tt(16,r?Gt:Qt);return X(t),Z(r),n}function $t(e){if(!Pe(20))return Et();var t=Zt(e);return Pe(21),t}function er(){je(27)||qe();}function tr(e){var t=pe(),r=fe();174===e&&Pe(103);var n=Wt(),i=$t(4),a=Yt(58,!0);return er(),K(He(173===e?L.createCallSignature(n,i,a):L.createConstructSignature(n,i,a),t),r)}function rr(){return 22===ge()&&ke(nr)}function nr(){if(ve(),25===ge()||23===ge())return !0;if(e.isModifierKind(ge())){if(ve(),Ae())return !0}else {if(!Ae())return !1;ve();}return 58===ge()||27===ge()||57===ge()&&(ve(),58===ge()||27===ge()||23===ge())}function ir(e,t,r,n){var i=kt(16,Qt,22,23),a=Lr();return er(),K(He(L.createIndexSignature(r,n,i,a),e),t)}function ar(){if(20===ge()||29===ge()||136===ge()||148===ge())return !0;for(var t=!1;e.isModifierKind(ge());)t=!0,ve();return 22===ge()||(et()&&(t=!0,ve()),!!t&&(20===ge()||29===ge()||57===ge()||58===ge()||27===ge()||Ke()))}function or(){if(20===ge()||29===ge())return tr(173);if(103===ge()&&ke(sr))return tr(174);var e=pe(),t=fe(),r=_i();return nt(136)?ai(e,t,void 0,r,171):nt(148)?ai(e,t,void 0,r,172):rr()?ir(e,t,void 0,r):function(e,t,r){var n,i=tt(),a=Je(57);if(20===ge()||29===ge()){var o=Wt(),s=$t(4),c=Yt(58,!0);n=L.createMethodSignature(r,i,a,o,s,c);}else c=Lr(),n=L.createPropertySignature(r,i,a,c),63===ge()&&(n.initializer=Jr());return er(),K(He(n,e),t)}(e,t,r)}function sr(){return ve(),20===ge()||29===ge()}function cr(){return 24===ve()}function lr(){switch(ve()){case 20:case 29:case 24:return !0}return !1}function ur(){var e;return Pe(18)?(e=ht(4,or),Pe(19)):e=Et(),e}function _r(){return ve(),39===ge()||40===ge()?144===ve():(144===ge()&&ve(),22===ge()&&dt()&&101===ve())}function dr(){var t=pe();if(je(25))return He(L.createRestTypeNode(Or()),t);var r=Or();if(e.isJSDocNullableType(r)&&r.pos===r.type.pos){var n=L.createOptionalTypeNode(r.type);return e.setTextRange(n,r),n.flags=r.flags,n}return r}function pr(){return 58===ve()||57===ge()&&58===ve()}function fr(){return 25===ge()?e.tokenIsIdentifierOrKeyword(ve())&&pr():e.tokenIsIdentifierOrKeyword(ge())&&pr()}function gr(){if(ke(fr)){var e=pe(),t=fe(),r=Je(25),n=$e(),i=Je(57);Pe(58);var a=dr();return K(He(L.createNamedTupleMember(r,n,i,a),e),t)}return dr()}function mr(){var e=pe(),t=fe(),r=function(){var e;if(126===ge()){var t=pe();ve(),e=We([He(L.createToken(126),t)],t);}return e}(),n=je(103),i=Wt(),a=$t(4),o=Yt(38,!1),s=n?L.createConstructorTypeNode(r,i,a,o):L.createFunctionTypeNode(i,a,o);return n||(s.modifiers=r),K(He(s,e),t)}function yr(){var e=Ue();return 24===ge()?void 0:e}function vr(e){var t=pe();e&&ve();var r=110===ge()||95===ge()||104===ge()?Ue():Rt(ge());return e&&(r=He(L.createPrefixUnaryExpression(40,r),t)),He(L.createLiteralTypeNode(r),t)}function hr(){return ve(),100===ge()}function br(){d|=1048576;var e=pe(),t=je(112);Pe(100),Pe(20);var r=Or();Pe(21);var n=je(24)?Bt():void 0,i=jt();return He(L.createImportTypeNode(r,n,i,t),e)}function xr(){return ve(),8===ge()||9===ge()}function Dr(){switch(ge()){case 130:case 154:case 149:case 146:case 157:case 150:case 133:case 152:case 143:case 147:return Ne(yr)||Jt();case 66:c.reScanAsteriskEqualsToken();case 41:return r=pe(),ve(),He(L.createJSDocAllType(),r);case 60:c.reScanQuestionToken();case 57:return function(){var e=pe();return ve(),27===ge()||19===ge()||21===ge()||31===ge()||63===ge()||51===ge()?He(L.createJSDocUnknownType(),e):He(L.createJSDocNullableType(Or()),e)}();case 98:return function(){var e=pe(),t=fe();if(ke(Ci)){ve();var r=$t(36),n=Yt(58,!1);return K(He(L.createJSDocFunctionType(r,n),e),t)}return He(L.createTypeReferenceNode($e(),void 0),e)}();case 53:return function(){var e=pe();return ve(),He(L.createJSDocNonNullableType(Dr()),e)}();case 14:case 10:case 8:case 9:case 110:case 95:case 104:return vr();case 40:return ke(xr)?vr(!0):Jt();case 114:return Ue();case 108:var e=Ut();return 139!==ge()||c.hasPrecedingLineBreak()?e:(t=e,ve(),He(L.createTypePredicateNode(void 0,t,Or()),t.pos));case 112:return ke(hr)?br():function(){var e=pe();return Pe(112),He(L.createTypeQueryNode(Nt(!0)),e)}();case 18:return ke(_r)?function(){var e,t=pe();Pe(18),144!==ge()&&39!==ge()&&40!==ge()||144!==(e=Ue()).kind&&Pe(144),Pe(22);var r,n=function(){var e=pe(),t=$e();Pe(101);var r=Or();return He(L.createTypeParameterDeclaration(t,r,void 0),e)}(),i=je(127)?Or():void 0;Pe(23),57!==ge()&&39!==ge()&&40!==ge()||57!==(r=Ue()).kind&&Pe(57);var a=Lr();qe();var o=ht(4,or);return Pe(19),He(L.createMappedTypeNode(e,n,i,r,a,o),t)}():function(){var e=pe();return He(L.createTypeLiteralNode(ur()),e)}();case 22:return function(){var e=pe();return He(L.createTupleTypeNode(kt(21,gr,22,23)),e)}();case 20:return function(){var e=pe();Pe(20);var t=Or();return Pe(21),He(L.createParenthesizedType(t),e)}();case 100:return br();case 128:return ke(In)?function(){var e=pe(),t=ze(128),r=108===ge()?Ut():Ze(),n=je(139)?Or():void 0;return He(L.createTypePredicateNode(t,r,n),e)}():Jt();case 15:return function(){var e=pe();return He(L.createTemplateLiteralType(Lt(!1),function(){var e,t=pe(),r=[];do{e=wt(),r.push(e);}while(16===e.literal.kind);return We(r,t)}()),e)}();default:return Jt()}var t,r;}function Sr(e){switch(ge()){case 130:case 154:case 149:case 146:case 157:case 133:case 144:case 150:case 153:case 114:case 152:case 104:case 108:case 112:case 143:case 18:case 22:case 29:case 51:case 50:case 103:case 10:case 8:case 9:case 110:case 95:case 147:case 41:case 57:case 53:case 25:case 137:case 100:case 128:case 14:case 15:return !0;case 98:return !e;case 40:return !e&&ke(xr);case 20:return !e&&ke(Tr);default:return Ae()}}function Tr(){return ve(),21===ge()||Ht(!1)||Sr()}function Cr(){var e,t=ge();switch(t){case 140:case 153:case 144:return function(e){var t=pe();return Pe(e),He(L.createTypeOperatorNode(e,Cr()),t)}(t);case 137:return e=pe(),Pe(137),He(L.createInferTypeNode(function(){var e=pe();return He(L.createTypeParameterDeclaration(Ze(),void 0,void 0),e)}()),e)}return function(){for(var e=pe(),t=Dr();!c.hasPrecedingLineBreak();)switch(ge()){case 53:ve(),t=He(L.createJSDocNonNullableType(t),e);break;case 57:if(ke(yt))return t;ve(),t=He(L.createJSDocNullableType(t),e);break;case 22:if(Pe(22),Sr()){var r=Or();Pe(23),t=He(L.createIndexedAccessTypeNode(t,r),e);}else Pe(23),t=He(L.createArrayTypeNode(t),e);break;default:return t}return t}()}function Er(t){if(Ar()){var r=mr();return _e(r,e.isFunctionTypeNode(r)?t?e.Diagnostics.Function_type_notation_must_be_parenthesized_when_used_in_a_union_type:e.Diagnostics.Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type:t?e.Diagnostics.Constructor_type_notation_must_be_parenthesized_when_used_in_a_union_type:e.Diagnostics.Constructor_type_notation_must_be_parenthesized_when_used_in_an_intersection_type),r}}function kr(e,t,r){var n=pe(),i=51===e,a=je(e),o=a&&Er(i)||t();if(ge()===e||a){for(var s=[o];je(e);)s.push(Er(i)||t());o=He(r(We(s,n)),n);}return o}function Nr(){return kr(50,Cr,L.createIntersectionTypeNode)}function Fr(){return ve(),103===ge()}function Ar(){return 29===ge()||!(20!==ge()||!ke(Pr))||103===ge()||126===ge()&&ke(Fr)}function Pr(){if(ve(),21===ge()||25===ge())return !0;if(function(){if(e.isModifierKind(ge())&&_i(),Ae()||108===ge())return ve(),!0;if(22===ge()||18===ge()){var t=S.length;return Qn(),t===S.length}return !1}()){if(58===ge()||27===ge()||57===ge()||63===ge())return !0;if(21===ge()&&(ve(),38===ge()))return !0}return !1}function wr(){var e=pe(),t=Ae()&&Ne(Ir),r=Or();return t?He(L.createTypePredicateNode(void 0,t,r),e):r}function Ir(){var e=Ze();if(139===ge()&&!c.hasPrecedingLineBreak())return ve(),e}function Or(){return $(40960,Mr)}function Mr(e){if(Ar())return mr();var t=pe(),r=kr(51,Nr,L.createUnionTypeNode);if(!e&&!c.hasPrecedingLineBreak()&&je(94)){var n=Mr(!0);Pe(57);var i=Mr();Pe(58);var a=Mr();return He(L.createConditionalTypeNode(r,n,i,a),t)}return r}function Lr(){return je(58)?Or():void 0}function Rr(){switch(ge()){case 108:case 106:case 104:case 110:case 95:case 8:case 9:case 10:case 14:case 15:case 20:case 22:case 18:case 98:case 84:case 103:case 43:case 68:case 79:return !0;case 100:return ke(lr);default:return Ae()}}function Br(){if(Rr())return !0;switch(ge()){case 39:case 40:case 54:case 53:case 89:case 112:case 114:case 45:case 46:case 29:case 132:case 125:case 80:return !0;default:return !(ae()&&101===ge()||!(e.getBinaryOperatorPrecedence(ge())>0))||Ae()}}function jr(){var e=oe();e&&Y(!1);for(var t,r=pe(),n=zr();t=Je(27);)n=Yr(n,t,zr(),r);return e&&Y(!0),n}function Jr(){return je(63)?zr():void 0}function zr(){if(125===ge()&&(ie()||ke(Ln)))return function(){var e=pe();return ve(),c.hasPrecedingLineBreak()||41!==ge()&&!Br()?He(L.createYieldExpression(void 0,void 0),e):He(L.createYieldExpression(Je(41),zr()),e)}();var t=function(){var e=20===ge()||29===ge()||131===ge()?ke(Kr):38===ge()?1:0;if(0!==e)return 1===e?Wr(!0):Ne(Vr)}()||function(){if(131===ge()&&1===ke(qr)){var e=pe(),t=di();return Ur(e,Gr(0),t)}}();if(t)return t;var r=pe(),n=Gr(0);return 79===n.kind&&38===ge()?Ur(r,n,void 0):e.isLeftHandSideExpression(n)&&e.isAssignmentOperator(be())?Yr(n,Ue(),zr(),r):function(t,r){var n,i=Je(57);return i?He(L.createConditionalExpression(t,i,$(20480,zr),n=ze(58),e.nodeIsPresent(n)?zr():Ge(79,!1,e.Diagnostics._0_expected,e.tokenToString(58))),r):t}(n,r)}function Ur(t,r,n){e.Debug.assert(38===ge(),"parseSimpleArrowFunctionExpression should only have been called if we had a =>");var i=L.createParameterDeclaration(void 0,void 0,void 0,r,void 0,void 0,void 0);He(i,r.pos);var a=We([i],i.pos,i.end),o=ze(38),s=Hr(!!n);return q(He(L.createArrowFunction(n,void 0,a,void 0,o,s),t))}function Kr(){if(131===ge()){if(ve(),c.hasPrecedingLineBreak())return 0;if(20!==ge()&&29!==ge())return 0}var t=ge(),r=ve();if(20===t){if(21===r)switch(ve()){case 38:case 58:case 18:return 1;default:return 0}if(22===r||18===r)return 2;if(25===r)return 1;if(e.isModifierKind(r)&&131!==r&&ke(dt))return 1;if(!Ae()&&108!==r)return 0;switch(ve()){case 58:return 1;case 57:return ve(),58===ge()||27===ge()||63===ge()||21===ge()?1:0;case 27:case 63:case 21:return 2}return 0}return e.Debug.assert(29===t),Ae()?1===D?ke((function(){var e=ve();if(94===e)switch(ve()){case 63:case 31:return !1;default:return !0}else if(27===e)return !0;return !1}))?1:0:2:0}function Vr(){var t=c.getTokenPos();if(!(null==I?void 0:I.has(t))){var r=Wr(!1);return r||(I||(I=new e.Set)).add(t),r}}function qr(){if(131===ge()){if(ve(),c.hasPrecedingLineBreak()||38===ge())return 0;var e=Gr(0);if(!c.hasPrecedingLineBreak()&&79===e.kind&&38===ge())return 1}return 0}function Wr(t){var r,n=pe(),i=fe(),a=di(),o=e.some(a,e.isAsyncModifier)?2:0,s=Wt();if(Pe(20)){if(r=Zt(o),!Pe(21)&&!t)return}else {if(!t)return;r=Et();}var c=Yt(58,!1);if(!c||t||!zt(c)){var l=c&&e.isJSDocFunctionType(c);if(t||38===ge()||!l&&18===ge()){var u=ge(),_=ze(38),d=38===u||18===u?Hr(e.some(a,e.isAsyncModifier)):Ze();return K(He(L.createArrowFunction(a,s,r,c,_,d),n),i)}}}function Hr(e){if(18===ge())return An(e?2:0);if(26!==ge()&&98!==ge()&&84!==ge()&&jn()&&(18===ge()||98===ge()||84===ge()||59===ge()||!Br()))return An(16|(e?2:0));var t=R;R=!1;var r=e?re(zr):$(32768,zr);return R=t,r}function Gr(e){var t=pe();return Xr(e,$r(),t)}function Qr(e){return 101===e||159===e}function Xr(t,r,n){for(;;){be();var i=e.getBinaryOperatorPrecedence(ge());if(!(42===ge()?i>=t:i>t))break;if(101===ge()&&ae())break;if(127===ge()){if(c.hasPrecedingLineBreak())break;ve(),a=r,o=Or(),r=He(L.createAsExpression(a,o),a.pos);}else r=Yr(r,Ue(),Gr(i),n);}var a,o;return r}function Yr(e,t,r,n){return He(L.createBinaryExpression(e,t,r),n)}function Zr(){var e=pe();return He(L.createPrefixUnaryExpression(ge(),ye(en)),e)}function $r(){if(function(){switch(ge()){case 39:case 40:case 54:case 53:case 89:case 112:case 114:case 132:return !1;case 29:if(1!==D)return !1;default:return !0}}()){var t=pe(),r=tn();return 42===ge()?Xr(e.getBinaryOperatorPrecedence(ge()),r,t):r}var n=ge(),i=en();if(42===ge()){t=e.skipTrivia(g,i.pos);var a=i.end;210===i.kind?ue(t,a,e.Diagnostics.A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses):ue(t,a,e.Diagnostics.An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses,e.tokenToString(n));}return i}function en(){switch(ge()){case 39:case 40:case 54:case 53:return Zr();case 89:return e=pe(),He(L.createDeleteExpression(ye(en)),e);case 112:return function(){var e=pe();return He(L.createTypeOfExpression(ye(en)),e)}();case 114:return function(){var e=pe();return He(L.createVoidExpression(ye(en)),e)}();case 29:return function(){var e=pe();Pe(29);var t=Or();Pe(31);var r=en();return He(L.createTypeAssertion(t,r),e)}();case 132:if(132===ge()&&(se()||ke(Ln)))return function(){var e=pe();return He(L.createAwaitExpression(ye(en)),e)}();default:return tn()}var e;}function tn(){if(45===ge()||46===ge()){var t=pe();return He(L.createPrefixUnaryExpression(ge(),ye(rn)),t)}if(1===D&&29===ge()&&ke(ft))return an(!0);var r=rn();if(e.Debug.assert(e.isLeftHandSideExpression(r)),(45===ge()||46===ge())&&!c.hasPrecedingLineBreak()){var n=ge();return ve(),He(L.createPostfixUnaryExpression(r,n),r.pos)}return r}function rn(){var t,r=pe();return 100===ge()?ke(sr)?(d|=1048576,t=Ue()):ke(cr)?(ve(),ve(),t=He(L.createMetaProperty(100,$e()),r),d|=2097152):t=nn():t=106===ge()?function(){var t=pe(),r=Ue();if(29===ge()){var n=pe();void 0!==Ne(bn)&&ue(n,pe(),e.Diagnostics.super_may_not_use_type_arguments);}return 20===ge()||24===ge()||22===ge()?r:(ze(24,e.Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access),He(L.createPropertyAccessExpression(r,At(!0,!0)),t))}():nn(),vn(r,t)}function nn(){return gn(pe(),xn(),!0)}function an(t,r,i){var a,o=pe(),s=function(e){var t=pe();if(Pe(29),31===ge())return Ce(),He(L.createJsxOpeningFragment(),t);var r,n=cn(),i=0==(131072&O)?hi():void 0,a=function(){var e=pe();return He(L.createJsxAttributes(ht(13,un)),e)}();return 31===ge()?(Ce(),r=L.createJsxOpeningElement(n,i,a)):(Pe(43),Pe(31,void 0,!1)&&(e?ve():Ce()),r=L.createJsxSelfClosingElement(n,i,a)),He(r,t)}(t);if(279===s.kind){var c=sn(s),l=void 0,u=c[c.length-1];if(277===(null==u?void 0:u.kind)&&!E(u.openingElement.tagName,u.closingElement.tagName)&&E(s.tagName,u.closingElement.tagName)){var _=u.children.end,d=He(L.createJsxElement(u.openingElement,u.children,He(L.createJsxClosingElement(He(L.createIdentifier(""),_,_)),_,_)),u.openingElement.pos,_);c=We(n$3(n$3([],c.slice(0,c.length-1),!0),[d],!1),c.pos,_),l=u.closingElement;}else l=function(e,t){var r=pe();Pe(30);var n=cn();return Pe(31,void 0,!1)&&(t||!E(e.tagName,n)?ve():Ce()),He(L.createJsxClosingElement(n),r)}(s,t),E(s.tagName,l.tagName)||(i&&e.isJsxOpeningElement(i)&&E(l.tagName,i.tagName)?_e(s.tagName,e.Diagnostics.JSX_element_0_has_no_corresponding_closing_tag,e.getTextOfNodeFromSourceText(g,s.tagName)):_e(l.tagName,e.Diagnostics.Expected_corresponding_JSX_closing_tag_for_0,e.getTextOfNodeFromSourceText(g,s.tagName)));a=He(L.createJsxElement(s,c,l),o);}else 282===s.kind?a=He(L.createJsxFragment(s,sn(s),function(t){var r=pe();return Pe(30),e.tokenIsIdentifierOrKeyword(ge())&&_e(cn(),e.Diagnostics.Expected_corresponding_closing_tag_for_JSX_fragment),Pe(31,void 0,!1)&&(t?ve():Ce()),He(L.createJsxJsxClosingFragment(),r)}(t)),o):(e.Debug.assert(278===s.kind),a=s);if(t&&29===ge()){var p=void 0===r?a.pos:r,f=Ne((function(){return an(!0,p)}));if(f){var m=Ge(27,!1);return e.setTextRangePosWidth(m,f.pos,0),ue(e.skipTrivia(g,p),f.end,e.Diagnostics.JSX_expressions_must_have_one_parent_element),He(L.createBinaryExpression(a,m,f),o)}}return a}function on(t,r){switch(r){case 1:if(e.isJsxOpeningFragment(t))_e(t,e.Diagnostics.JSX_fragment_has_no_corresponding_closing_tag);else {var n=t.tagName;ue(e.skipTrivia(g,n.pos),n.end,e.Diagnostics.JSX_element_0_has_no_corresponding_closing_tag,e.getTextOfNodeFromSourceText(g,t.tagName));}return;case 30:case 7:return;case 11:case 12:return i=pe(),a=L.createJsxText(c.getTokenValue(),12===k),k=c.scanJsxToken(),He(a,i);case 18:return ln(!1);case 29:return an(!1,void 0,t);default:return e.Debug.assertNever(r)}var i,a;}function sn(t){var r=[],n=pe(),i=w;for(w|=16384;;){var a=on(t,k=c.reScanJsxToken());if(!a)break;if(r.push(a),e.isJsxOpeningElement(t)&&277===(null==a?void 0:a.kind)&&!E(a.openingElement.tagName,a.closingElement.tagName)&&E(t.tagName,a.closingElement.tagName))break}return w=i,We(r,n)}function cn(){var e=pe();Te();for(var t=108===ge()?Ue():$e();je(24);)t=He(L.createPropertyAccessExpression(t,At(!0,!1)),e);return t}function ln(e){var t,r,n=pe();if(Pe(18))return 19!==ge()&&(t=Je(25),r=jr()),e?Pe(19):Pe(19,void 0,!1)&&Ce(),He(L.createJsxExpression(t,r),n)}function un(){if(18===ge())return function(){var e=pe();Pe(18),Pe(25);var t=jr();return Pe(19),He(L.createJsxSpreadAttribute(t),e)}();Te();var e=pe();return He(L.createJsxAttribute($e(),63!==ge()?void 0:10===(k=c.scanJsxAttributeValue())?Mt():ln(!0)),e)}function _n(){return ve(),e.tokenIsIdentifierOrKeyword(ge())||22===ge()||mn()}function dn(t){if(32&t.flags)return !0;if(e.isNonNullExpression(t)){for(var r=t.expression;e.isNonNullExpression(r)&&!(32&r.flags);)r=r.expression;if(32&r.flags){for(;e.isNonNullExpression(t);)t.flags|=32,t=t.expression;return !0}}return !1}function pn(t,r,n){var i=At(!0,!0),a=n||dn(r),o=a?L.createPropertyAccessChain(r,n,i):L.createPropertyAccessExpression(r,i);return a&&e.isPrivateIdentifier(o.name)&&_e(o.name,e.Diagnostics.An_optional_chain_cannot_contain_private_identifiers),He(o,t)}function fn(t,r,n){var i;if(23===ge())i=Ge(79,!0,e.Diagnostics.An_element_access_expression_should_take_an_argument);else {var a=te(jr);e.isStringOrNumericLiteralLike(a)&&(a.text=Qe(a.text)),i=a;}return Pe(23),He(n||dn(r)?L.createElementAccessChain(r,n,i):L.createElementAccessExpression(r,i),t)}function gn(t,r,n){for(;;){var i=void 0,a=!1;if(n&&28===ge()&&ke(_n)?(i=ze(28),a=e.tokenIsIdentifierOrKeyword(ge())):a=je(24),a)r=pn(t,r,i);else if(i||53!==ge()||c.hasPrecedingLineBreak())if(!i&&oe()||!je(22)){if(!mn())return r;r=yn(t,r,i,void 0);}else r=fn(t,r,i);else ve(),r=He(L.createNonNullExpression(r),t);}}function mn(){return 14===ge()||15===ge()}function yn(e,t,r,n){var i=L.createTaggedTemplateExpression(t,n,14===ge()?(xe(),Mt()):Pt(!0));return (r||32&t.flags)&&(i.flags|=32),i.questionDotToken=r,He(i,e)}function vn(t,r){for(;;){r=gn(t,r,!0);var n=Je(28);if(0!=(131072&O)||29!==ge()&&47!==ge()){if(20===ge()){a=hn(),r=He(n||dn(r)?L.createCallChain(r,n,void 0,a):L.createCallExpression(r,void 0,a),t);continue}}else {var i=Ne(bn);if(i){if(mn()){r=yn(t,r,n,i);continue}var a=hn();r=He(n||dn(r)?L.createCallChain(r,n,i,a):L.createCallExpression(r,i,a),t);continue}}if(n){var o=Ge(79,!1,e.Diagnostics.Identifier_expected);r=He(L.createPropertyAccessChain(r,n,o),t);}break}return r}function hn(){Pe(20);var e=Tt(11,Sn);return Pe(21),e}function bn(){if(0==(131072&O)&&29===De()){ve();var e=Tt(20,Or);if(Pe(31))return e&&function(){switch(ge()){case 20:case 14:case 15:case 24:case 21:case 23:case 58:case 26:case 57:case 34:case 36:case 35:case 37:case 55:case 56:case 60:case 52:case 50:case 51:case 19:case 1:return !0;case 27:case 18:default:return !1}}()?e:void 0}}function xn(){switch(ge()){case 8:case 9:case 10:case 14:return Mt();case 108:case 106:case 104:case 110:case 95:return Ue();case 20:return function(){var e=pe(),t=fe();Pe(20);var r=te(jr);return Pe(21),K(He(L.createParenthesizedExpression(r),e),t)}();case 22:return Tn();case 18:return En();case 131:if(!ke(Mn))break;return kn();case 84:return gi(pe(),fe(),void 0,void 0,225);case 98:return kn();case 103:return function(){var t=pe();if(Pe(103),je(24)){var r=$e();return He(L.createMetaProperty(103,r),t)}for(var n,i,a=pe(),o=xn();;){o=gn(a,o,!1),n=Ne(bn),mn()&&(e.Debug.assert(!!n,"Expected a type argument list; all plain tagged template starts should be consumed in 'parseMemberExpressionRest'"),o=yn(a,o,void 0,n),n=void 0);break}return 20===ge()?i=hn():n&&ue(t,c.getStartPos(),e.Diagnostics.A_new_expression_with_type_arguments_must_always_be_followed_by_a_parenthesized_argument_list),He(L.createNewExpression(o,n,i),t)}();case 43:case 68:if(13===(k=c.reScanSlashToken()))return Mt();break;case 15:return Pt(!1);case 80:return rt()}return Ze(e.Diagnostics.Expression_expected)}function Dn(){return 25===ge()?function(){var e=pe();Pe(25);var t=zr();return He(L.createSpreadElement(t),e)}():27===ge()?He(L.createOmittedExpression(),pe()):zr()}function Sn(){return $(20480,Dn)}function Tn(){var e=pe();Pe(22);var t=c.hasPrecedingLineBreak(),r=Tt(15,Dn);return Pe(23),He(L.createArrayLiteralExpression(r,t),e)}function Cn(){var e=pe(),t=fe();if(Je(25)){var r=zr();return K(He(L.createSpreadAssignment(r),e),t)}var n=li(),i=_i();if(nt(136))return ai(e,t,n,i,171);if(nt(148))return ai(e,t,n,i,172);var a,o=Je(41),s=Ae(),c=tt(),l=Je(57),u=Je(53);if(o||20===ge()||29===ge())return ri(e,t,n,i,o,c,l,u);if(s&&58!==ge()){var _=Je(63),d=_?te(zr):void 0;(a=L.createShorthandPropertyAssignment(c,d)).equalsToken=_;}else {Pe(58);var p=te(zr);a=L.createPropertyAssignment(c,p);}return a.decorators=n,a.modifiers=i,a.questionToken=l,a.exclamationToken=u,K(He(a,e),t)}function En(){var t=pe(),r=c.getTokenPos();Pe(18);var n=c.hasPrecedingLineBreak(),i=Tt(12,Cn,!0);if(!Pe(19)){var a=e.lastOrUndefined(S);a&&a.code===e.Diagnostics._0_expected.code&&e.addRelatedInfo(a,e.createDetachedDiagnostic(_,r,1,e.Diagnostics.The_parser_expected_to_find_a_to_match_the_token_here));}return He(L.createObjectLiteralExpression(i,n),t)}function kn(){var t=oe();Y(!1);var r=pe(),n=fe(),i=_i();Pe(98);var a=Je(41),o=a?1:0,s=e.some(i,e.isAsyncModifier)?2:0,c=o&&s?ee(40960,Nn):o?ee(8192,Nn):s?re(Nn):Nn(),l=Wt(),u=$t(o|s),_=Yt(58,!1),d=An(o|s);return Y(t),K(He(L.createFunctionExpression(i,a,c,l,u,_,d),r),n)}function Nn(){return Fe()?Ye():void 0}function Fn(t,r){var n=pe(),i=fe(),a=c.getTokenPos();if(Pe(18,r)||t){var o=c.hasPrecedingLineBreak(),s=ht(1,zn);if(!Pe(19)){var l=e.lastOrUndefined(S);l&&l.code===e.Diagnostics._0_expected.code&&e.addRelatedInfo(l,e.createDetachedDiagnostic(_,a,1,e.Diagnostics.The_parser_expected_to_find_a_to_match_the_token_here));}var u=K(He(L.createBlock(s,o),n),i);return 63===ge()&&(ce(e.Diagnostics.Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_destructuring_assignment_you_might_need_to_wrap_the_the_whole_assignment_in_parentheses),ve()),u}return s=Et(),K(He(L.createBlock(s,void 0),n),i)}function An(e,t){var r=ie();X(!!(1&e));var n=se();Z(!!(2&e));var i=R;R=!1;var a=oe();a&&Y(!1);var o=Fn(!!(16&e),t);return a&&Y(!0),R=i,X(r),Z(n),o}function Pn(e){var t=pe(),r=fe();Pe(245===e?81:86);var n=Ke()?void 0:Ze();return qe(),K(He(245===e?L.createBreakStatement(n):L.createContinueStatement(n),t),r)}function wn(){return 82===ge()?function(){var e=pe();Pe(82);var t=te(jr);Pe(58);var r=ht(3,zn);return He(L.createCaseClause(t,r),e)}():function(){var e=pe();Pe(88),Pe(58);var t=ht(3,zn);return He(L.createDefaultClause(t),e)}()}function In(){return ve(),e.tokenIsIdentifierOrKeyword(ge())&&!c.hasPrecedingLineBreak()}function On(){return ve(),84===ge()&&!c.hasPrecedingLineBreak()}function Mn(){return ve(),98===ge()&&!c.hasPrecedingLineBreak()}function Ln(){return ve(),(e.tokenIsIdentifierOrKeyword(ge())||8===ge()||9===ge()||10===ge())&&!c.hasPrecedingLineBreak()}function Rn(){for(;;)switch(ge()){case 113:case 119:case 85:case 98:case 84:case 92:return !0;case 118:case 151:return ve(),!c.hasPrecedingLineBreak()&&Ae();case 141:case 142:return ve(),!c.hasPrecedingLineBreak()&&(Ae()||10===ge());case 126:case 131:case 135:case 121:case 122:case 123:case 144:if(ve(),c.hasPrecedingLineBreak())return !1;continue;case 156:return ve(),18===ge()||79===ge()||93===ge();case 100:return ve(),10===ge()||41===ge()||18===ge()||e.tokenIsIdentifierOrKeyword(ge());case 93:var t=ve();if(151===t&&(t=ke(ve)),63===t||41===t||18===t||88===t||127===t)return !0;continue;case 124:ve();continue;default:return !1}}function Bn(){return ke(Rn)}function jn(){switch(ge()){case 59:case 26:case 18:case 113:case 119:case 98:case 84:case 92:case 99:case 90:case 115:case 97:case 86:case 81:case 105:case 116:case 107:case 109:case 111:case 87:case 83:case 96:return !0;case 100:return Bn()||ke(lr);case 85:case 93:return Bn();case 131:case 135:case 118:case 141:case 142:case 151:case 156:return !0;case 123:case 121:case 122:case 124:case 144:return Bn()||!ke(In);default:return Br()}}function Jn(){return ve(),Fe()||18===ge()||22===ge()}function zn(){switch(ge()){case 26:return t=pe(),r=fe(),Pe(26),K(He(L.createEmptyStatement(),t),r);case 18:return Fn(!1);case 113:return ei(pe(),fe(),void 0,void 0);case 119:if(ke(Jn))return ei(pe(),fe(),void 0,void 0);break;case 98:return ti(pe(),fe(),void 0,void 0);case 84:return fi(pe(),fe(),void 0,void 0);case 99:return function(){var e=pe(),t=fe();Pe(99),Pe(20);var r=te(jr);Pe(21);var n=zn(),i=je(91)?zn():void 0;return K(He(L.createIfStatement(r,n,i),e),t)}();case 90:return function(){var e=pe(),t=fe();Pe(90);var r=zn();Pe(115),Pe(20);var n=te(jr);return Pe(21),je(26),K(He(L.createDoStatement(r,n),e),t)}();case 115:return function(){var e=pe(),t=fe();Pe(115),Pe(20);var r=te(jr);Pe(21);var n=zn();return K(He(L.createWhileStatement(r,n),e),t)}();case 97:return function(){var e=pe(),t=fe();Pe(97);var r,n,i=Je(132);if(Pe(20),26!==ge()&&(r=113===ge()||119===ge()||85===ge()?Zn(!0):ee(4096,jr)),i?Pe(159):je(159)){var a=te(zr);Pe(21),n=L.createForOfStatement(i,r,a,zn());}else if(je(101))a=te(jr),Pe(21),n=L.createForInStatement(r,a,zn());else {Pe(26);var o=26!==ge()&&21!==ge()?te(jr):void 0;Pe(26);var s=21!==ge()?te(jr):void 0;Pe(21),n=L.createForStatement(r,o,s,zn());}return K(He(n,e),t)}();case 86:return Pn(244);case 81:return Pn(245);case 105:return function(){var e=pe(),t=fe();Pe(105);var r=Ke()?void 0:te(jr);return qe(),K(He(L.createReturnStatement(r),e),t)}();case 116:return function(){var e=pe(),t=fe();Pe(116),Pe(20);var r=te(jr);Pe(21);var n=ee(16777216,zn);return K(He(L.createWithStatement(r,n),e),t)}();case 107:return function(){var e=pe(),t=fe();Pe(107),Pe(20);var r=te(jr);Pe(21);var n=function(){var e=pe();Pe(18);var t=ht(2,wn);return Pe(19),He(L.createCaseBlock(t),e)}();return K(He(L.createSwitchStatement(r,n),e),t)}();case 109:return function(){var e=pe(),t=fe();Pe(109);var r=c.hasPrecedingLineBreak()?void 0:te(jr);return void 0===r&&(P++,r=He(L.createIdentifier(""),pe())),Ve()||Le(r),K(He(L.createThrowStatement(r),e),t)}();case 111:case 83:case 96:return function(){var e=pe(),t=fe();Pe(111);var r,n=Fn(!1),i=83===ge()?function(){var e,t=pe();Pe(83),je(20)?(e=Yn(),Pe(21)):e=void 0;var r=Fn(!1);return He(L.createCatchClause(e,r),t)}():void 0;return i&&96!==ge()||(Pe(96),r=Fn(!1)),K(He(L.createTryStatement(n,i,r),e),t)}();case 87:return function(){var e=pe(),t=fe();return Pe(87),qe(),K(He(L.createDebuggerStatement(),e),t)}();case 59:return Kn();case 131:case 118:case 151:case 141:case 142:case 135:case 85:case 92:case 93:case 100:case 121:case 122:case 123:case 126:case 124:case 144:case 156:if(Bn())return Kn()}var t,r;return function(){var t,r=pe(),n=fe(),i=20===ge(),a=te(jr);return e.isIdentifier(a)&&je(58)?t=L.createLabeledStatement(a,zn()):(Ve()||Le(a),t=L.createExpressionStatement(a),i&&(n=!1)),K(He(t,r),n)}()}function Un(e){return 135===e.kind}function Kn(){var t=e.some(ke((function(){return li(),_i()})),Un);if(t){var r=ee(8388608,(function(){var e=xt(w);if(e)return Dt(e)}));if(r)return r}var n=pe(),i=fe(),a=li(),o=_i();if(t){for(var s=0,c=o;s<c.length;s++)c[s].flags|=8388608;return ee(8388608,(function(){return Vn(n,i,a,o)}))}return Vn(n,i,a,o)}function Vn(t,r,n,i){switch(ge()){case 113:case 119:case 85:return ei(t,r,n,i);case 98:return ti(t,r,n,i);case 84:return fi(t,r,n,i);case 118:return function(e,t,r,n){Pe(118);var i=Ze(),a=Wt(),o=mi(),s=ur();return K(He(L.createInterfaceDeclaration(r,n,i,a,o,s),e),t)}(t,r,n,i);case 151:return function(e,t,r,n){Pe(151);var i=Ze(),a=Wt();Pe(63);var o=138===ge()&&Ne(yr)||Or();return qe(),K(He(L.createTypeAliasDeclaration(r,n,i,a,o),e),t)}(t,r,n,i);case 92:return function(e,t,r,n){Pe(92);var i,a=Ze();return Pe(18)?(i=$(40960,(function(){return Tt(6,xi)})),Pe(19)):i=Et(),K(He(L.createEnumDeclaration(r,n,a,i),e),t)}(t,r,n,i);case 156:case 141:case 142:return function(e,t,r,n){var i=0;if(156===ge())return Ti(e,t,r,n);if(je(142))i|=16;else if(Pe(141),10===ge())return Ti(e,t,r,n);return Si(e,t,r,n,i)}(t,r,n,i);case 100:return function(e,t,r,n){Pe(100);var i,a=c.getStartPos();Ae()&&(i=Ze());var o,s=!1;if(155===ge()||"type"!==(null==i?void 0:i.escapedText)||!Ae()&&41!==ge()&&18!==ge()||(s=!0,i=Ae()?Ze():void 0),i&&27!==ge()&&155!==ge())return function(e,t,r,n,i,a){Pe(63);var o=145===ge()&&ke(Ci)?function(){var e=pe();Pe(145),Pe(20);var t=Ai();return Pe(21),He(L.createExternalModuleReference(t),e)}():Nt(!1);return qe(),K(He(L.createImportEqualsDeclaration(r,n,a,i,o),e),t)}(e,t,r,n,i,s);(i||41===ge()||18===ge())&&(o=function(e,t,r){var n;return e&&!je(27)||(n=41===ge()?function(){var e=pe();Pe(41),Pe(127);var t=Ze();return He(L.createNamespaceImport(t),e)}():Pi(268)),He(L.createImportClause(r,e,n),t)}(i,a,s),Pe(155));var l,u=Ai();return 129!==ge()||c.hasPrecedingLineBreak()||(l=Fi()),qe(),K(He(L.createImportDeclaration(r,n,o,u,l),e),t)}(t,r,n,i);case 93:switch(ve(),ge()){case 88:case 63:return function(e,t,r,n){var i,a=se();Z(!0),je(63)?i=!0:Pe(88);var o=zr();return qe(),Z(a),K(He(L.createExportAssignment(r,n,i,o),e),t)}(t,r,n,i);case 127:return function(e,t,r,n){Pe(127),Pe(142);var i=Ze();qe();var a=L.createNamespaceExportDeclaration(i);return a.decorators=r,a.modifiers=n,K(He(a,e),t)}(t,r,n,i);default:return function(e,t,r,n){var i,a,o,s=se();Z(!0);var l=je(151),u=pe();return je(41)?(je(127)&&(i=function(e){return He(L.createNamespaceExport($e()),e)}(u)),Pe(155),a=Ai()):(i=Pi(272),(155===ge()||10===ge()&&!c.hasPrecedingLineBreak())&&(Pe(155),a=Ai())),a&&129===ge()&&!c.hasPrecedingLineBreak()&&(o=Fi()),qe(),Z(s),K(He(L.createExportDeclaration(r,n,l,i,a,o),e),t)}(t,r,n,i)}default:if(n||i){var a=Ge(275,!0,e.Diagnostics.Declaration_expected);return e.setTextRangePos(a,t),a.decorators=n,a.modifiers=i,a}return}}function qn(e,t){if(18===ge()||!Ke())return An(e,t);qe();}function Wn(){var e=pe();if(27===ge())return He(L.createOmittedExpression(),e);var t=Je(25),r=Qn(),n=Jr();return He(L.createBindingElement(t,void 0,r,n),e)}function Hn(){var e,t=pe(),r=Je(25),n=Fe(),i=tt();n&&58!==ge()?(e=i,i=void 0):(Pe(58),e=Qn());var a=Jr();return He(L.createBindingElement(r,i,e,a),t)}function Gn(){return 18===ge()||22===ge()||80===ge()||Fe()}function Qn(e){return 22===ge()?function(){var e=pe();Pe(22);var t=Tt(10,Wn);return Pe(23),He(L.createArrayBindingPattern(t),e)}():18===ge()?function(){var e=pe();Pe(18);var t=Tt(9,Hn);return Pe(19),He(L.createObjectBindingPattern(t),e)}():Ye(e)}function Xn(){return Yn(!0)}function Yn(t){var r,n=pe(),i=fe(),a=Qn(e.Diagnostics.Private_identifiers_are_not_allowed_in_variable_declarations);t&&79===a.kind&&53===ge()&&!c.hasPrecedingLineBreak()&&(r=Ue());var o=Lr(),s=Qr(ge())?void 0:Jr();return K(He(L.createVariableDeclaration(a,r,o,s),n),i)}function Zn(t){var r,n=pe(),i=0;switch(ge()){case 113:break;case 119:i|=1;break;case 85:i|=2;break;default:e.Debug.fail();}if(ve(),159===ge()&&ke($n))r=Et();else {var a=ae();Q(t),r=Tt(8,t?Yn:Xn),Q(a);}return He(L.createVariableDeclarationList(r,i),n)}function $n(){return dt()&&21===ve()}function ei(e,t,r,n){var i=Zn(!1);qe();var a=L.createVariableStatement(n,i);return a.decorators=r,K(He(a,e),t)}function ti(t,r,n,i){var a=se(),o=e.modifiersToFlags(i);Pe(98);var s=Je(41),c=512&o?Nn():Ye(),l=s?1:0,u=256&o?2:0,_=Wt();1&o&&Z(!0);var d=$t(l|u),p=Yt(58,!1),f=qn(l|u,e.Diagnostics.or_expected);return Z(a),K(He(L.createFunctionDeclaration(n,i,s,c,_,d,p,f),t),r)}function ri(t,r,n,i,a,o,s,c,l){var u=a?1:0,_=e.some(i,e.isAsyncModifier)?2:0,d=Wt(),p=$t(u|_),f=Yt(58,!1),g=qn(u|_,l),m=L.createMethodDeclaration(n,i,a,o,s,d,p,f,g);return m.exclamationToken=c,K(He(m,t),r)}function ni(t,r,n,i,a,o){var s=o||c.hasPrecedingLineBreak()?void 0:Je(53),l=Lr(),u=$(45056,Jr);return function(t,r,n){if(59!==ge()||c.hasPrecedingLineBreak())return 20===ge()?(ce(e.Diagnostics.Cannot_start_a_function_call_in_a_type_annotation),void ve()):void(!r||Ke()?Ve()||(n?18===ge()&&ce(e.Diagnostics._0_expected,e.tokenToString(26)):Le(t)):n?ce(e.Diagnostics._0_expected,e.tokenToString(26)):ce(e.Diagnostics.Expected_for_property_initializer));ce(e.Diagnostics.Decorators_must_precede_the_name_and_all_keywords_of_property_declarations);}(a,l,u),K(He(L.createPropertyDeclaration(n,i,a,o||s,l,u),t),r)}function ii(t,r,n,i){var a=Je(41),o=tt(),s=Je(57);return a||20===ge()||29===ge()?ri(t,r,n,i,a,o,s,void 0,e.Diagnostics.or_expected):ni(t,r,n,i,o,s)}function ai(e,t,r,n,i){var a=tt(),o=Wt(),s=$t(0),c=Yt(58,!1),l=qn(0),u=171===i?L.createGetAccessorDeclaration(r,n,a,s,c,l):L.createSetAccessorDeclaration(r,n,a,s,l);return u.typeParameters=o,c&&172===u.kind&&(u.type=c),K(He(u,e),t)}function oi(){var t;if(59===ge())return !0;for(;e.isModifierKind(ge());){if(t=ge(),e.isClassMemberModifier(t))return !0;ve();}if(41===ge())return !0;if(et()&&(t=ge(),ve()),22===ge())return !0;if(void 0!==t){if(!e.isKeyword(t)||148===t||136===t)return !0;switch(ge()){case 20:case 29:case 53:case 58:case 63:case 57:return !0;default:return Ke()}}return !1}function si(){if(se()&&132===ge()){var t=pe(),r=Ze(e.Diagnostics.Expression_expected);return ve(),vn(t,gn(t,r,!0))}return rn()}function ci(){var e=pe();if(je(59)){var t=ee(16384,si);return He(L.createDecorator(t),e)}}function li(){for(var t,r,n=pe();r=ci();)t=e.append(t,r);return t&&We(t,n)}function ui(t,r,n){var i=pe(),a=ge();if(85===ge()&&t){if(!Ne(it))return}else {if(r&&124===ge()&&ke(Ei))return;if(n&&124===ge())return;if(!e.isModifierKind(ge())||!Ne(at))return}return He(L.createToken(a),i)}function _i(t,r){for(var n,i,a=pe(),o=!1;i=ui(t,r,o);)124===i.kind&&(o=!0),n=e.append(n,i);return n&&We(n,a)}function di(){var e;if(131===ge()){var t=pe();ve(),e=We([He(L.createToken(131),t)],t);}return e}function pi(){var t=pe();if(26===ge())return ve(),He(L.createSemicolonClassElement(),t);var r=fe(),n=li(),i=_i(!0,!0);if(124===ge()&&ke(Ei))return function(e,t,r,n){ze(124);var i=function(){var e=ie(),t=se();X(!1),Z(!0);var r=Fn(!1);return X(e),Z(t),r}();return K(He(L.createClassStaticBlockDeclaration(r,n,i),e),t)}(t,r,n,i);if(nt(136))return ai(t,r,n,i,171);if(nt(148))return ai(t,r,n,i,172);if(134===ge()||10===ge()){var a=function(t,r,n,i){return Ne((function(){if(134===ge()?Pe(134):10===ge()&&20===ke(ve)?Ne((function(){var e=Mt();return "constructor"===e.text?e:void 0})):void 0){var a=Wt(),o=$t(0),s=Yt(58,!1),c=qn(0,e.Diagnostics.or_expected),l=L.createConstructorDeclaration(n,i,o,c);return l.typeParameters=a,l.type=s,K(He(l,t),r)}}))}(t,r,n,i);if(a)return a}if(rr())return ir(t,r,n,i);if(e.tokenIsIdentifierOrKeyword(ge())||10===ge()||8===ge()||41===ge()||22===ge()){if(e.some(i,Un)){for(var o=0,s=i;o<s.length;o++)s[o].flags|=8388608;return ee(8388608,(function(){return ii(t,r,n,i)}))}return ii(t,r,n,i)}if(n||i){var c=Ge(79,!0,e.Diagnostics.Declaration_expected);return ni(t,r,n,i,c,void 0)}return e.Debug.fail("Should not have attempted to parse class member declaration.")}function fi(e,t,r,n){return gi(e,t,r,n,256)}function gi(t,r,n,i,a){var o=se();Pe(84);var s=!Fe()||117===ge()&&ke(pt)?void 0:Xe(Fe()),c=Wt();e.some(i,e.isExportModifier)&&Z(!0);var l,u=mi();return Pe(18)?(l=ht(5,pi),Pe(19)):l=Et(),Z(o),K(He(256===a?L.createClassDeclaration(n,i,s,c,u,l):L.createClassExpression(n,i,s,c,u,l),t),r)}function mi(){if(bi())return ht(22,yi)}function yi(){var t=pe(),r=ge();e.Debug.assert(94===r||117===r),ve();var n=Tt(7,vi);return He(L.createHeritageClause(r,n),t)}function vi(){var e=pe(),t=rn(),r=hi();return He(L.createExpressionWithTypeArguments(t,r),e)}function hi(){return 29===ge()?kt(20,Or,29,31):void 0}function bi(){return 94===ge()||117===ge()}function xi(){var e=pe(),t=fe(),r=tt(),n=te(Jr);return K(He(L.createEnumMember(r,n),e),t)}function Di(){var e,t=pe();return Pe(18)?(e=ht(1,zn),Pe(19)):e=Et(),He(L.createModuleBlock(e),t)}function Si(e,t,r,n,i){var a=16&i,o=Ze(),s=je(24)?Si(pe(),!1,void 0,void 0,4|a):Di();return K(He(L.createModuleDeclaration(r,n,o,s,i),e),t)}function Ti(e,t,r,n){var i,a,o=0;return 156===ge()?(i=Ze(),o|=1024):(i=Mt()).text=Qe(i.text),18===ge()?a=Di():qe(),K(He(L.createModuleDeclaration(r,n,i,a,o),e),t)}function Ci(){return 20===ve()}function Ei(){return 18===ve()}function ki(){return 43===ve()}function Ni(){var t=pe(),r=e.tokenIsIdentifierOrKeyword(ge())?$e():Rt(10);Pe(58);var n=Rt(10);return He(L.createAssertEntry(r,n),t)}function Fi(){var t=pe();Pe(129);var r=c.getTokenPos();if(Pe(18)){var n=c.hasPrecedingLineBreak(),i=Tt(24,Ni,!0);if(!Pe(19)){var a=e.lastOrUndefined(S);a&&a.code===e.Diagnostics._0_expected.code&&e.addRelatedInfo(a,e.createDetachedDiagnostic(_,r,1,e.Diagnostics.The_parser_expected_to_find_a_to_match_the_token_here));}return He(L.createAssertClause(i,n),t)}return i=We([],pe(),void 0,!1),He(L.createAssertClause(i,!1),t)}function Ai(){if(10===ge()){var e=Mt();return e.text=Qe(e.text),e}return jr()}function Pi(e){var t=pe();return He(268===e?L.createNamedImports(kt(23,Ii,18,19)):L.createNamedExports(kt(23,wi,18,19)),t)}function wi(){return Oi(274)}function Ii(){return Oi(269)}function Oi(t){var r,n=pe(),i=e.isKeyword(ge())&&!Ae(),a=c.getTokenPos(),o=c.getTextPos(),s=!1,l=!0,u=$e();if("type"===u.escapedText)if(127===ge()){var _=$e();if(127===ge()){var d=$e();e.tokenIsIdentifierOrKeyword(ge())?(s=!0,r=_,u=p(),l=!1):(r=u,u=d,l=!1);}else e.tokenIsIdentifierOrKeyword(ge())?(r=u,l=!1,u=p()):(s=!0,u=_);}else e.tokenIsIdentifierOrKeyword(ge())&&(s=!0,u=p());return l&&127===ge()&&(r=u,Pe(127),u=p()),269===t&&i&&ue(a,o,e.Diagnostics.Identifier_expected),He(269===t?L.createImportSpecifier(s,r,u):L.createExportSpecifier(s,r,u),n);function p(){return i=e.isKeyword(ge())&&!Ae(),a=c.getTokenPos(),o=c.getTextPos(),$e()}}function Mi(t){return function(t,r){return e.some(t.modifiers,(function(e){return 93===e.kind}))}(t)||e.isImportEqualsDeclaration(t)&&e.isExternalModuleReference(t.moduleReference)||e.isImportDeclaration(t)||e.isExportAssignment(t)||e.isExportDeclaration(t)?t:void 0}function Li(t){return function(t){return e.isMetaProperty(t)&&100===t.keywordToken&&"meta"===t.name.escapedText}(t)?t:f(t,Li)}!function(e){e[e.SourceElements=0]="SourceElements",e[e.BlockStatements=1]="BlockStatements",e[e.SwitchClauses=2]="SwitchClauses",e[e.SwitchClauseStatements=3]="SwitchClauseStatements",e[e.TypeMembers=4]="TypeMembers",e[e.ClassMembers=5]="ClassMembers",e[e.EnumMembers=6]="EnumMembers",e[e.HeritageClauseElement=7]="HeritageClauseElement",e[e.VariableDeclarations=8]="VariableDeclarations",e[e.ObjectBindingElements=9]="ObjectBindingElements",e[e.ArrayBindingElements=10]="ArrayBindingElements",e[e.ArgumentExpressions=11]="ArgumentExpressions",e[e.ObjectLiteralMembers=12]="ObjectLiteralMembers",e[e.JsxAttributes=13]="JsxAttributes",e[e.JsxChildren=14]="JsxChildren",e[e.ArrayLiteralMembers=15]="ArrayLiteralMembers",e[e.Parameters=16]="Parameters",e[e.JSDocParameters=17]="JSDocParameters",e[e.RestProperties=18]="RestProperties",e[e.TypeParameters=19]="TypeParameters",e[e.TypeArguments=20]="TypeArguments",e[e.TupleElementTypes=21]="TupleElementTypes",e[e.HeritageClauses=22]="HeritageClauses",e[e.ImportOrExportSpecifiers=23]="ImportOrExportSpecifiers",e[e.AssertEntries=24]="AssertEntries",e[e.Count=25]="Count";}(we||(we={})),function(e){e[e.False=0]="False",e[e.True=1]="True",e[e.Unknown=2]="Unknown";}(Ie||(Ie={})),function(t){function r(e){var t=pe(),r=(e?je:Pe)(18),n=ee(4194304,Vt);e&&!r||Be(19);var i=L.createJSDocTypeExpression(n);return W(i),He(i,t)}function n(){for(var e=pe(),t=je(18),r=pe(),n=Nt(!1);80===ge();)Se(),he(),n=He(L.createJSDocMemberName(n,Ze()),r);t&&Be(19);var i=L.createJSDocNameReference(n);return W(i),He(i,e)}var i,a;function o(t,i){void 0===t&&(t=0);var a=g,o=void 0===i?a.length:t+i;if(i=o-t,e.Debug.assert(t>=0),e.Debug.assert(t<=o),e.Debug.assert(o<=a.length),p(a,t)){var s,l,u,d,f,m=[],y=[];return c.scanRange(t+3,i-5,(function(){var r,n,i=1,_=t-(a.lastIndexOf("\n",t)+1)+4;function p(e){r||(r=_),m.push(e),_+=e.length;}for(he();W(5););W(4)&&(i=0,_=0);e:for(;;){switch(ge()){case 59:0===i||1===i?(h(m),f||(f=pe()),(n=T(_))&&(s?s.push(n):(s=[n],l=n.pos),u=n.end),i=0,r=void 0):p(c.getTokenText());break;case 4:m.push(c.getTokenText()),i=0,_=0;break;case 41:var g=c.getTokenText();1===i||2===i?(i=2,p(g)):(i=1,_+=g.length);break;case 5:var b=c.getTokenText();2===i?m.push(b):void 0!==r&&_+b.length>r&&m.push(b.slice(r-_)),_+=b.length;break;case 1:break e;case 18:i=2;var x=c.getStartPos(),D=N(c.getTextPos()-1);if(D){d||v(m),y.push(He(L.createJSDocText(m.join("")),null!=d?d:t,x)),y.push(D),m=[],d=c.getTextPos();break}default:i=2,p(c.getTokenText());}he();}h(m),y.length&&m.length&&y.push(He(L.createJSDocText(m.join("")),null!=d?d:t,f)),y.length&&s&&e.Debug.assertIsDefined(f,"having parsed tags implies that the end of the comment span should be set");var S=s&&We(s,l,u);return He(L.createJSDocComment(y.length?We(y,t,f):m.length?m.join(""):void 0,S),t,o)}))}function v(e){for(;e.length&&("\n"===e[0]||"\r"===e[0]);)e.shift();}function h(e){for(;e.length&&""===e[e.length-1].trim();)e.pop();}function b(){for(;;){if(he(),1===ge())return !0;if(5!==ge()&&4!==ge())return !1}}function x(){if(5!==ge()&&4!==ge()||!ke(b))for(;5===ge()||4===ge();)he();}function D(){if((5===ge()||4===ge())&&ke(b))return "";for(var e=c.hasPrecedingLineBreak(),t=!1,r="";e&&41===ge()||5===ge()||4===ge();)r+=c.getTokenText(),4===ge()?(e=!0,t=!0,r=""):41===ge()&&(e=!1),he();return t?r:""}function T(t){e.Debug.assert(59===ge());var i=c.getTokenPos();he();var a,o=H(void 0),l=D();switch(o.escapedText){case"author":a=function(t,r,n,i){var a=pe(),o=function(){for(var e=[],t=!1,r=c.getToken();1!==r&&4!==r;){if(29===r)t=!0;else {if(59===r&&!t)break;if(31===r&&t){e.push(c.getTokenText()),c.setTextPos(c.getTokenPos()+1);break}}e.push(c.getTokenText()),r=he();}return L.createJSDocText(e.join(""))}(),s=c.getStartPos(),l=C(t,s,n,i);l||(s=c.getStartPos());var u="string"!=typeof l?We(e.concatenate([He(o,a,s)],l),a):o.text+l;return He(L.createJSDocAuthorTag(r,u),t)}(i,o,t,l);break;case"implements":a=function(e,t,r,n){var i=R();return He(L.createJSDocImplementsTag(t,i,C(e,pe(),r,n)),e)}(i,o,t,l);break;case"augments":case"extends":a=function(e,t,r,n){var i=R();return He(L.createJSDocAugmentsTag(t,i,C(e,pe(),r,n)),e)}(i,o,t,l);break;case"class":case"constructor":a=B(i,L.createJSDocClassTag,o,t,l);break;case"public":a=B(i,L.createJSDocPublicTag,o,t,l);break;case"private":a=B(i,L.createJSDocPrivateTag,o,t,l);break;case"protected":a=B(i,L.createJSDocProtectedTag,o,t,l);break;case"readonly":a=B(i,L.createJSDocReadonlyTag,o,t,l);break;case"override":a=B(i,L.createJSDocOverrideTag,o,t,l);break;case"deprecated":V=!0,a=B(i,L.createJSDocDeprecatedTag,o,t,l);break;case"this":a=function(e,t,n,i){var a=r(!0);return x(),He(L.createJSDocThisTag(t,a,C(e,pe(),n,i)),e)}(i,o,t,l);break;case"enum":a=function(e,t,n,i){var a=r(!0);return x(),He(L.createJSDocEnumTag(t,a,C(e,pe(),n,i)),e)}(i,o,t,l);break;case"arg":case"argument":case"param":return O(i,o,2,t);case"return":case"returns":a=function(t,r,n,i){e.some(s,e.isJSDocReturnTag)&&ue(r.pos,c.getTokenPos(),e.Diagnostics._0_tag_already_specified,r.escapedText);var a=A();return He(L.createJSDocReturnTag(r,a,C(t,pe(),n,i)),t)}(i,o,t,l);break;case"template":a=function(e,t,n,i){var a=18===ge()?r():void 0,o=function(){var e=pe(),t=[];do{x();var r=q();void 0!==r&&t.push(r),D();}while(W(27));return We(t,e)}();return He(L.createJSDocTemplateTag(t,a,o,C(e,pe(),n,i)),e)}(i,o,t,l);break;case"type":a=M(i,o,t,l);break;case"typedef":a=function(t,r,n,i){var a,o=A();D();var s=j();x();var c,l=E(n);if(!o||I(o.type)){for(var u=void 0,d=void 0,p=void 0,f=!1;u=Ne((function(){return z(n)}));)if(f=!0,341===u.kind){if(d){ce(e.Diagnostics.A_JSDoc_typedef_comment_may_not_contain_multiple_type_tags);var g=e.lastOrUndefined(S);g&&e.addRelatedInfo(g,e.createDetachedDiagnostic(_,0,0,e.Diagnostics.The_tag_was_first_specified_here));break}d=u;}else p=e.append(p,u);if(f){var m=o&&182===o.type.kind,y=L.createJSDocTypeLiteral(p,m);c=(o=d&&d.typeExpression&&!I(d.typeExpression.type)?d.typeExpression:He(y,t)).end;}}return c=c||void 0!==l?pe():(null!==(a=null!=s?s:o)&&void 0!==a?a:r).end,l||(l=C(t,c,n,i)),He(L.createJSDocTypedefTag(r,o,s,l),t,c)}(i,o,t,l);break;case"callback":a=function(t,r,n,i){var a=j();x();var o=E(n),s=function(t){for(var r,n,i=pe();r=Ne((function(){return U(4,t)}));)n=e.append(n,r);return We(n||[],i)}(n),c=Ne((function(){if(W(59)){var e=T(n);if(e&&339===e.kind)return e}})),l=He(L.createJSDocSignature(void 0,s,c),t);return o||(o=C(t,pe(),n,i)),He(L.createJSDocCallbackTag(r,l,a,o),t)}(i,o,t,l);break;case"see":a=function(t,r,i,a){var o=22===ge()||ke((function(){return 59===he()&&e.tokenIsIdentifierOrKeyword(he())&&"link"===c.getTokenValue()}))?void 0:n(),s=void 0!==i&&void 0!==a?C(t,pe(),i,a):void 0;return He(L.createJSDocSeeTag(r,o,s),t)}(i,o,t,l);break;default:a=function(e,t,r,n){return He(L.createJSDocUnknownTag(t,C(e,pe(),r,n)),e)}(i,o,t,l);}return a}function C(e,t,r,n){return n||(r+=t-e),E(r,n.slice(r))}function E(e,t){var r,n,i=pe(),a=[],o=[],s=0,l=!0;function u(t){n||(n=e),a.push(t),e+=t.length;}void 0!==t&&(""!==t&&u(t),s=1);var _=ge();e:for(;;){switch(_){case 4:s=0,a.push(c.getTokenText()),e=0;break;case 59:if(3===s||2===s&&(!l||ke(k))){a.push(c.getTokenText());break}c.setTextPos(c.getTextPos()-1);case 1:break e;case 5:if(2===s||3===s)u(c.getTokenText());else {var d=c.getTokenText();void 0!==n&&e+d.length>n&&a.push(d.slice(n-e)),e+=d.length;}break;case 18:s=2;var p=c.getStartPos(),f=N(c.getTextPos()-1);f?(o.push(He(L.createJSDocText(a.join("")),null!=r?r:i,p)),o.push(f),a=[],r=c.getTextPos()):u(c.getTokenText());break;case 61:s=3===s?2:3,u(c.getTokenText());break;case 41:if(0===s){s=1,e+=1;break}default:3!==s&&(s=2),u(c.getTokenText());}l=5===ge(),_=he();}return v(a),h(a),o.length?(a.length&&o.push(He(L.createJSDocText(a.join("")),null!=r?r:i)),We(o,i,c.getTextPos())):a.length?a.join(""):void 0}function k(){var e=he();return 5===e||4===e}function N(t){var r=Ne(F);if(r){he(),x();var n=pe(),i=e.tokenIsIdentifierOrKeyword(ge())?Nt(!0):void 0;if(i)for(;80===ge();)Se(),he(),i=He(L.createJSDocMemberName(i,Ze()),n);for(var a=[];19!==ge()&&4!==ge()&&1!==ge();)a.push(c.getTokenText()),he();return He(("link"===r?L.createJSDocLink:"linkcode"===r?L.createJSDocLinkCode:L.createJSDocLinkPlain)(i,a.join("")),t,c.getTextPos())}}function F(){if(D(),18===ge()&&59===he()&&e.tokenIsIdentifierOrKeyword(he())){var t=c.getTokenValue();if("link"===t||"linkcode"===t||"linkplain"===t)return t}}function A(){return D(),18===ge()?r():void 0}function w(){var t=W(22);t&&x();var r=W(61),n=function(){var e=H();for(je(22)&&Pe(23);je(24);){var t=H();je(22)&&Pe(23),e=Ft(e,t);}return e}();return r&&(function(e){if(ge()===e)return t=pe(),r=ge(),he(),He(L.createToken(r),t);var t,r;}(61)||Ge(61,!1,e.Diagnostics._0_expected,e.tokenToString(61))),t&&(x(),Je(63)&&jr(),Pe(23)),{name:n,isBracketed:t}}function I(t){switch(t.kind){case 147:return !0;case 182:return I(t.elementType);default:return e.isTypeReferenceNode(t)&&e.isIdentifier(t.typeName)&&"Object"===t.typeName.escapedText&&!t.typeArguments}}function O(t,r,n,i){var a=A(),o=!a;D();var s=w(),c=s.name,l=s.isBracketed,u=D();o&&!ke(F)&&(a=A());var _=C(t,pe(),i,u),d=4!==n&&function(t,r,n,i){if(t&&I(t.type)){for(var a=pe(),o=void 0,s=void 0;o=Ne((function(){return U(n,i,r)}));)338!==o.kind&&345!==o.kind||(s=e.append(s,o));if(s){var c=He(L.createJSDocTypeLiteral(s,182===t.type.kind),a);return He(L.createJSDocTypeExpression(c),a)}}}(a,c,n,i);return d&&(a=d,o=!0),He(1===n?L.createJSDocPropertyTag(r,c,l,a,o,_):L.createJSDocParameterTag(r,c,l,a,o,_),t)}function M(t,n,i,a){e.some(s,e.isJSDocTypeTag)&&ue(n.pos,c.getTokenPos(),e.Diagnostics._0_tag_already_specified,n.escapedText);var o=r(!0),l=void 0!==i&&void 0!==a?C(t,pe(),i,a):void 0;return He(L.createJSDocTypeTag(n,o,l),t)}function R(){var e=je(18),t=pe(),r=function(){for(var e=pe(),t=H();je(24);){var r=H();t=He(L.createPropertyAccessExpression(t,r),e);}return t}(),n=hi(),i=He(L.createExpressionWithTypeArguments(r,n),t);return e&&Pe(19),i}function B(e,t,r,n,i){return He(t(r,C(e,pe(),n,i)),e)}function j(t){var r=c.getTokenPos();if(e.tokenIsIdentifierOrKeyword(ge())){var n=H();if(je(24)){var i=j(!0);return He(L.createModuleDeclaration(void 0,void 0,n,i,t?4:void 0),r)}return t&&(n.isInJSDocNamespace=!0),n}}function J(t,r){for(;!e.isIdentifier(t)||!e.isIdentifier(r);){if(e.isIdentifier(t)||e.isIdentifier(r)||t.right.escapedText!==r.right.escapedText)return !1;t=t.left,r=r.left;}return t.escapedText===r.escapedText}function z(e){return U(1,e)}function U(t,r,n){for(var i=!0,a=!1;;)switch(he()){case 59:if(i){var o=K(t,r);return !(o&&(338===o.kind||345===o.kind)&&4!==t&&n&&(e.isIdentifier(o.name)||!J(n,o.name.left)))&&o}a=!1;break;case 4:i=!0,a=!1;break;case 41:a&&(i=!1),a=!0;break;case 79:i=!1;break;case 1:return !1}}function K(t,r){e.Debug.assert(59===ge());var n=c.getStartPos();he();var i,a=H();switch(x(),a.escapedText){case"type":return 1===t&&M(n,a);case"prop":case"property":i=1;break;case"arg":case"argument":case"param":i=6;break;default:return !1}return !!(t&i)&&O(n,a,t,r)}function q(){var t=pe(),r=W(22);r&&x();var n,i=H(e.Diagnostics.Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces);if(r&&(x(),Pe(63),n=ee(4194304,Vt),Pe(23)),!e.nodeIsMissing(i))return He(L.createTypeParameterDeclaration(i,void 0,n),t)}function W(e){return ge()===e&&(he(),!0)}function H(t){if(!e.tokenIsIdentifierOrKeyword(ge()))return Ge(79,!t,t||e.Diagnostics.Identifier_expected);P++;var r=c.getTokenPos(),n=c.getTextPos(),i=ge(),a=Qe(c.getTokenValue()),o=He(L.createIdentifier(a,void 0,i),r,n);return he(),o}}t.parseJSDocTypeExpressionForTests=function(t,n,i){J("file.js",t,99,void 0,1),c.setText(t,n,i),k=c.scan();var a=r(),o=H("file.js",99,1,!1,[],L.createToken(1),0),s=e.attachFileToDiagnostics(S,o);return T&&(o.jsDocDiagnostics=e.attachFileToDiagnostics(T,o)),z(),a?{jsDocTypeExpression:a,diagnostics:s}:void 0},t.parseJSDocTypeExpression=r,t.parseJSDocNameReference=n,t.parseIsolatedJSDocComment=function(t,r,n){J("",t,99,void 0,1);var i=ee(4194304,(function(){return o(r,n)})),a={languageVariant:0,text:t},s=e.attachFileToDiagnostics(S,a);return z(),i?{jsDoc:i,diagnostics:s}:void 0},t.parseJSDocComment=function(t,r,n){var i=k,a=S.length,s=B,c=ee(4194304,(function(){return o(r,n)}));return e.setParent(c,t),131072&O&&(T||(T=[]),T.push.apply(T,S)),k=i,S.length=a,B=s,c},function(e){e[e.BeginningOfLine=0]="BeginningOfLine",e[e.SawAsterisk=1]="SawAsterisk",e[e.SavingComments=2]="SavingComments",e[e.SavingBackticks=3]="SavingBackticks";}(i||(i={})),function(e){e[e.Property=1]="Property",e[e.Parameter=2]="Parameter",e[e.CallbackParameter=4]="CallbackParameter";}(a||(a={}));}(Oe=t.JSDocParser||(t.JSDocParser={}));}(l||(l={})),function(t){function r(t,r,i,o,s,c){return void(r?u(t):l(t));function l(t){var r="";if(c&&n(t)&&(r=o.substring(t.pos,t.end)),t._children&&(t._children=void 0),e.setTextRangePosEnd(t,t.pos+i,t.end+i),c&&n(t)&&e.Debug.assert(r===s.substring(t.pos,t.end)),f(t,l,u),e.hasJSDocNodes(t))for(var _=0,d=t.jsDoc;_<d.length;_++)l(d[_]);a(t,c);}function u(t){t._children=void 0,e.setTextRangePosEnd(t,t.pos+i,t.end+i);for(var r=0,n=t;r<n.length;r++)l(n[r]);}}function n(e){switch(e.kind){case 10:case 8:case 79:return !0}return !1}function i(t,r,n,i,a){e.Debug.assert(t.end>=r,"Adjusting an element that was entirely before the change range"),e.Debug.assert(t.pos<=n,"Adjusting an element that was entirely after the change range"),e.Debug.assert(t.pos<=t.end);var o=Math.min(t.pos,i),s=t.end>=n?t.end+a:Math.min(t.end,i);e.Debug.assert(o<=s),t.parent&&(e.Debug.assertGreaterThanOrEqual(o,t.parent.pos),e.Debug.assertLessThanOrEqual(s,t.parent.end)),e.setTextRangePosEnd(t,o,s);}function a(t,r){if(r){var n=t.pos,i=function(t){e.Debug.assert(t.pos>=n),n=t.end;};if(e.hasJSDocNodes(t))for(var a=0,o=t.jsDoc;a<o.length;a++)i(o[a]);f(t,i),e.Debug.assert(n<=t.end);}}function o(t,r){var n,i=t;if(f(t,(function t(a){if(!e.nodeIsMissing(a))return a.pos<=r?(a.pos>=i.pos&&(i=a),r<a.end?(f(a,t),!0):(e.Debug.assert(a.end<=r),void(n=a))):(e.Debug.assert(a.pos>r),!0)})),n){var a=function(t){for(;;){var r=e.getLastChild(t);if(!r)return t;t=r;}}(n);a.pos>i.pos&&(i=a);}return i}function s(t,r,n,i){var a=t.text;if(n&&(e.Debug.assert(a.length-n.span.length+n.newLength===r.length),i||e.Debug.shouldAssert(3))){var o=a.substr(0,n.span.start),s=r.substr(0,n.span.start);e.Debug.assert(o===s);var c=a.substring(e.textSpanEnd(n.span),a.length),l=r.substring(e.textSpanEnd(e.textChangeRangeNewSpan(n)),r.length);e.Debug.assert(c===l);}}function c(t){var r=t.statements,n=0;e.Debug.assert(n<r.length);var i=r[n],a=-1;return {currentNode:function(o){return o!==a&&(i&&i.end===o&&n<r.length-1&&(n++,i=r[n]),i&&i.pos===o||function(e){return r=void 0,n=-1,i=void 0,void f(t,a,o);function a(t){return e>=t.pos&&e<t.end&&(f(t,a,o),!0)}function o(t){if(e>=t.pos&&e<t.end)for(var s=0;s<t.length;s++){var c=t[s];if(c){if(c.pos===e)return r=t,n=s,i=c,!0;if(c.pos<e&&e<c.end)return f(c,a,o),!0}}return !1}}(o)),a=o,e.Debug.assert(!i||i.pos===o),i}}}var u;t.updateSourceFile=function(t,n,u,_){if(s(t,n,u,_=_||e.Debug.shouldAssert(2)),e.textChangeRangeIsUnchanged(u))return t;if(0===t.statements.length)return l.parseSourceFile(t.fileName,n,t.languageVersion,void 0,!0,t.scriptKind);var d=t;e.Debug.assert(!d.hasBeenIncrementallyParsed),d.hasBeenIncrementallyParsed=!0,l.fixupParentReferences(d);var p=t.text,g=c(t),m=function(t,r){for(var n=r.span.start,i=0;n>0&&i<=1;i++){var a=o(t,n);e.Debug.assert(a.pos<=n);var s=a.pos;n=Math.max(0,s-1);}var c=e.createTextSpanFromBounds(n,e.textSpanEnd(r.span)),l=r.newLength+(r.span.start-n);return e.createTextChangeRange(c,l)}(t,u);s(t,n,m,_),e.Debug.assert(m.span.start<=u.span.start),e.Debug.assert(e.textSpanEnd(m.span)===e.textSpanEnd(u.span)),e.Debug.assert(e.textSpanEnd(e.textChangeRangeNewSpan(m))===e.textSpanEnd(e.textChangeRangeNewSpan(u)));var y=e.textChangeRangeNewSpan(m).length-m.span.length;!function(t,n,o,s,c,l,u,_){return void d(t);function d(t){if(e.Debug.assert(t.pos<=t.end),t.pos>o)r(t,!1,c,l,u,_);else {var g=t.end;if(g>=n){if(t.intersectsChange=!0,t._children=void 0,i(t,n,o,s,c),f(t,d,p),e.hasJSDocNodes(t))for(var m=0,y=t.jsDoc;m<y.length;m++)d(y[m]);a(t,_);}else e.Debug.assert(g<n);}}function p(t){if(e.Debug.assert(t.pos<=t.end),t.pos>o)r(t,!0,c,l,u,_);else {var a=t.end;if(a>=n){t.intersectsChange=!0,t._children=void 0,i(t,n,o,s,c);for(var p=0,f=t;p<f.length;p++)d(f[p]);}else e.Debug.assert(a<n);}}}(d,m.span.start,e.textSpanEnd(m.span),e.textSpanEnd(e.textChangeRangeNewSpan(m)),y,p,n,_);var v=l.parseSourceFile(t.fileName,n,t.languageVersion,g,!0,t.scriptKind);return v.commentDirectives=function(t,r,n,i,a,o,s,c){if(!t)return r;for(var l,u=!1,_=0,d=t;_<d.length;_++){var p=d[_],f=p.range,g=p.type;if(f.end<n)l=e.append(l,p);else if(f.pos>i){y();var m={range:{pos:f.pos+a,end:f.end+a},type:g};l=e.append(l,m),c&&e.Debug.assert(o.substring(f.pos,f.end)===s.substring(m.range.pos,m.range.end));}}return y(),l;function y(){u||(u=!0,l?r&&l.push.apply(l,r):l=r);}}(t.commentDirectives,v.commentDirectives,m.span.start,e.textSpanEnd(m.span),y,p,n,_),v.impliedNodeFormat=t.impliedNodeFormat,v},t.createSyntaxCursor=c,function(e){e[e.Value=-1]="Value";}(u||(u={}));}(u||(u={})),e.isDeclarationFileName=y,e.processCommentPragmas=v,e.processPragmasIntoFields=h;var b=new e.Map;function x(e){if(b.has(e))return b.get(e);var t=new RegExp("(\\s".concat(e,"\\s*=\\s*)(?:(?:'([^']*)')|(?:\"([^\"]*)\"))"),"im");return b.set(e,t),t}var D=/^\/\/\/\s*<(\S+)\s.*?\/>/im,S=/^\/\/\/?\s*@(\S+)\s*(.*)\s*$/im;function T(t,r,n){var i=2===r.kind&&D.exec(n);if(i){var a=i[1].toLowerCase(),o=e.commentPragmas[a];if(!(o&&1&o.kind))return;if(o.args){for(var s={},c=0,l=o.args;c<l.length;c++){var u=l[c],_=x(u.name).exec(n);if(!_&&!u.optional)return;if(_){var d=_[2]||_[3];if(u.captureSpan){var p=r.pos+_.index+_[1].length+1;s[u.name]={value:d,pos:p,end:p+d.length};}else s[u.name]=d;}}t.push({name:a,args:{arguments:s,range:r}});}else t.push({name:a,args:{arguments:{},range:r}});}else {var f=2===r.kind&&S.exec(n);if(f)return C(t,r,2,f);if(3===r.kind)for(var g=/@(\S+)(\s+.*)?$/gim,m=void 0;m=g.exec(n);)C(t,r,4,m);}}function C(t,r,n,i){if(i){var a=i[1].toLowerCase(),o=e.commentPragmas[a];if(o&&o.kind&n){var s=function(t,r){if(!r)return {};if(!t.args)return {};for(var n=e.trimString(r).split(/\s+/),i={},a=0;a<t.args.length;a++){var o=t.args[a];if(!n[a]&&!o.optional)return "fail";if(o.captureSpan)return e.Debug.fail("Capture spans not yet implemented for non-xml pragmas");i[o.name]=n[a];}return i}(o,i[2]);"fail"!==s&&t.push({name:a,args:{arguments:s,range:r}});}}}function E(e,t){return e.kind===t.kind&&(79===e.kind?e.escapedText===t.escapedText:108===e.kind||e.name.escapedText===t.name.escapedText&&E(e.expression,t.expression))}e.tagNamesAreEquivalent=E;}(t),function(e){e.compileOnSaveCommandLineOption={name:"compileOnSave",type:"boolean",defaultValueDescription:"false"};var t=new e.Map(e.getEntries({preserve:1,"react-native":3,react:2,"react-jsx":4,"react-jsxdev":5}));e.inverseJsxOptionMap=new e.Map(e.arrayFrom(e.mapIterator(t.entries(),(function(e){var t=e[0];return [""+e[1],t]}))));var r=[["es5","lib.es5.d.ts"],["es6","lib.es2015.d.ts"],["es2015","lib.es2015.d.ts"],["es7","lib.es2016.d.ts"],["es2016","lib.es2016.d.ts"],["es2017","lib.es2017.d.ts"],["es2018","lib.es2018.d.ts"],["es2019","lib.es2019.d.ts"],["es2020","lib.es2020.d.ts"],["es2021","lib.es2021.d.ts"],["esnext","lib.esnext.d.ts"],["dom","lib.dom.d.ts"],["dom.iterable","lib.dom.iterable.d.ts"],["webworker","lib.webworker.d.ts"],["webworker.importscripts","lib.webworker.importscripts.d.ts"],["webworker.iterable","lib.webworker.iterable.d.ts"],["scripthost","lib.scripthost.d.ts"],["es2015.core","lib.es2015.core.d.ts"],["es2015.collection","lib.es2015.collection.d.ts"],["es2015.generator","lib.es2015.generator.d.ts"],["es2015.iterable","lib.es2015.iterable.d.ts"],["es2015.promise","lib.es2015.promise.d.ts"],["es2015.proxy","lib.es2015.proxy.d.ts"],["es2015.reflect","lib.es2015.reflect.d.ts"],["es2015.symbol","lib.es2015.symbol.d.ts"],["es2015.symbol.wellknown","lib.es2015.symbol.wellknown.d.ts"],["es2016.array.include","lib.es2016.array.include.d.ts"],["es2017.object","lib.es2017.object.d.ts"],["es2017.sharedmemory","lib.es2017.sharedmemory.d.ts"],["es2017.string","lib.es2017.string.d.ts"],["es2017.intl","lib.es2017.intl.d.ts"],["es2017.typedarrays","lib.es2017.typedarrays.d.ts"],["es2018.asyncgenerator","lib.es2018.asyncgenerator.d.ts"],["es2018.asynciterable","lib.es2018.asynciterable.d.ts"],["es2018.intl","lib.es2018.intl.d.ts"],["es2018.promise","lib.es2018.promise.d.ts"],["es2018.regexp","lib.es2018.regexp.d.ts"],["es2019.array","lib.es2019.array.d.ts"],["es2019.object","lib.es2019.object.d.ts"],["es2019.string","lib.es2019.string.d.ts"],["es2019.symbol","lib.es2019.symbol.d.ts"],["es2020.bigint","lib.es2020.bigint.d.ts"],["es2020.promise","lib.es2020.promise.d.ts"],["es2020.sharedmemory","lib.es2020.sharedmemory.d.ts"],["es2020.string","lib.es2020.string.d.ts"],["es2020.symbol.wellknown","lib.es2020.symbol.wellknown.d.ts"],["es2020.intl","lib.es2020.intl.d.ts"],["es2021.promise","lib.es2021.promise.d.ts"],["es2021.string","lib.es2021.string.d.ts"],["es2021.weakref","lib.es2021.weakref.d.ts"],["es2021.intl","lib.es2021.intl.d.ts"],["esnext.array","lib.es2019.array.d.ts"],["esnext.symbol","lib.es2019.symbol.d.ts"],["esnext.asynciterable","lib.es2018.asynciterable.d.ts"],["esnext.intl","lib.esnext.intl.d.ts"],["esnext.bigint","lib.es2020.bigint.d.ts"],["esnext.string","lib.es2021.string.d.ts"],["esnext.promise","lib.es2021.promise.d.ts"],["esnext.weakref","lib.es2021.weakref.d.ts"]];e.libs=r.map((function(e){return e[0]})),e.libMap=new e.Map(r),e.optionsForWatch=[{name:"watchFile",type:new e.Map(e.getEntries({fixedpollinginterval:e.WatchFileKind.FixedPollingInterval,prioritypollinginterval:e.WatchFileKind.PriorityPollingInterval,dynamicprioritypolling:e.WatchFileKind.DynamicPriorityPolling,fixedchunksizepolling:e.WatchFileKind.FixedChunkSizePolling,usefsevents:e.WatchFileKind.UseFsEvents,usefseventsonparentdirectory:e.WatchFileKind.UseFsEventsOnParentDirectory})),category:e.Diagnostics.Watch_and_Build_Modes,description:e.Diagnostics.Specify_how_the_TypeScript_watch_mode_works},{name:"watchDirectory",type:new e.Map(e.getEntries({usefsevents:e.WatchDirectoryKind.UseFsEvents,fixedpollinginterval:e.WatchDirectoryKind.FixedPollingInterval,dynamicprioritypolling:e.WatchDirectoryKind.DynamicPriorityPolling,fixedchunksizepolling:e.WatchDirectoryKind.FixedChunkSizePolling})),category:e.Diagnostics.Watch_and_Build_Modes,description:e.Diagnostics.Specify_how_directories_are_watched_on_systems_that_lack_recursive_file_watching_functionality},{name:"fallbackPolling",type:new e.Map(e.getEntries({fixedinterval:e.PollingWatchKind.FixedInterval,priorityinterval:e.PollingWatchKind.PriorityInterval,dynamicpriority:e.PollingWatchKind.DynamicPriority,fixedchunksize:e.PollingWatchKind.FixedChunkSize})),category:e.Diagnostics.Watch_and_Build_Modes,description:e.Diagnostics.Specify_what_approach_the_watcher_should_use_if_the_system_runs_out_of_native_file_watchers},{name:"synchronousWatchDirectory",type:"boolean",category:e.Diagnostics.Watch_and_Build_Modes,description:e.Diagnostics.Synchronously_call_callbacks_and_update_the_state_of_directory_watchers_on_platforms_that_don_t_support_recursive_watching_natively,defaultValueDescription:"false"},{name:"excludeDirectories",type:"list",element:{name:"excludeDirectory",type:"string",isFilePath:!0,extraValidation:Te},category:e.Diagnostics.Watch_and_Build_Modes,description:e.Diagnostics.Remove_a_list_of_directories_from_the_watch_process},{name:"excludeFiles",type:"list",element:{name:"excludeFile",type:"string",isFilePath:!0,extraValidation:Te},category:e.Diagnostics.Watch_and_Build_Modes,description:e.Diagnostics.Remove_a_list_of_files_from_the_watch_mode_s_processing}],e.commonOptionsWithBuild=[{name:"help",shortName:"h",type:"boolean",showInSimplifiedHelpView:!0,category:e.Diagnostics.Command_line_Options,description:e.Diagnostics.Print_this_message,defaultValueDescription:"false"},{name:"help",shortName:"?",type:"boolean",defaultValueDescription:"false"},{name:"watch",shortName:"w",type:"boolean",showInSimplifiedHelpView:!0,isCommandLineOnly:!0,category:e.Diagnostics.Command_line_Options,description:e.Diagnostics.Watch_input_files,defaultValueDescription:"false"},{name:"preserveWatchOutput",type:"boolean",showInSimplifiedHelpView:!1,category:e.Diagnostics.Output_Formatting,description:e.Diagnostics.Disable_wiping_the_console_in_watch_mode,defaultValueDescription:"false"},{name:"listFiles",type:"boolean",category:e.Diagnostics.Compiler_Diagnostics,description:e.Diagnostics.Print_all_of_the_files_read_during_the_compilation,defaultValueDescription:"false"},{name:"explainFiles",type:"boolean",category:e.Diagnostics.Compiler_Diagnostics,description:e.Diagnostics.Print_files_read_during_the_compilation_including_why_it_was_included,defaultValueDescription:"false"},{name:"listEmittedFiles",type:"boolean",category:e.Diagnostics.Compiler_Diagnostics,description:e.Diagnostics.Print_the_names_of_emitted_files_after_a_compilation,defaultValueDescription:"false"},{name:"pretty",type:"boolean",showInSimplifiedHelpView:!0,category:e.Diagnostics.Output_Formatting,description:e.Diagnostics.Enable_color_and_formatting_in_TypeScript_s_output_to_make_compiler_errors_easier_to_read,defaultValueDescription:"true"},{name:"traceResolution",type:"boolean",category:e.Diagnostics.Compiler_Diagnostics,description:e.Diagnostics.Log_paths_used_during_the_moduleResolution_process,defaultValueDescription:"false"},{name:"diagnostics",type:"boolean",category:e.Diagnostics.Compiler_Diagnostics,description:e.Diagnostics.Output_compiler_performance_information_after_building,defaultValueDescription:"false"},{name:"extendedDiagnostics",type:"boolean",category:e.Diagnostics.Compiler_Diagnostics,description:e.Diagnostics.Output_more_detailed_compiler_performance_information_after_building,defaultValueDescription:"false"},{name:"generateCpuProfile",type:"string",isFilePath:!0,paramType:e.Diagnostics.FILE_OR_DIRECTORY,category:e.Diagnostics.Compiler_Diagnostics,description:e.Diagnostics.Emit_a_v8_CPU_profile_of_the_compiler_run_for_debugging,defaultValueDescription:"profile.cpuprofile"},{name:"generateTrace",type:"string",isFilePath:!0,isCommandLineOnly:!0,paramType:e.Diagnostics.DIRECTORY,category:e.Diagnostics.Compiler_Diagnostics,description:e.Diagnostics.Generates_an_event_trace_and_a_list_of_types},{name:"incremental",shortName:"i",type:"boolean",category:e.Diagnostics.Projects,description:e.Diagnostics.Enable_incremental_compilation,transpileOptionValue:void 0,defaultValueDescription:e.Diagnostics.false_unless_composite_is_set},{name:"assumeChangesOnlyAffectDirectDependencies",type:"boolean",affectsSemanticDiagnostics:!0,affectsEmit:!0,category:e.Diagnostics.Watch_and_Build_Modes,description:e.Diagnostics.Have_recompiles_in_projects_that_use_incremental_and_watch_mode_assume_that_changes_within_a_file_will_only_affect_files_directly_depending_on_it,defaultValueDescription:"false"},{name:"locale",type:"string",category:e.Diagnostics.Command_line_Options,isCommandLineOnly:!0,description:e.Diagnostics.Set_the_language_of_the_messaging_from_TypeScript_This_does_not_affect_emit,defaultValueDescription:e.Diagnostics.Platform_specific}],e.targetOptionDeclaration={name:"target",shortName:"t",type:new e.Map(e.getEntries({es3:0,es5:1,es6:2,es2015:2,es2016:3,es2017:4,es2018:5,es2019:6,es2020:7,es2021:8,esnext:99})),affectsSourceFile:!0,affectsModuleResolution:!0,affectsEmit:!0,paramType:e.Diagnostics.VERSION,showInSimplifiedHelpView:!0,category:e.Diagnostics.Language_and_Environment,description:e.Diagnostics.Set_the_JavaScript_language_version_for_emitted_JavaScript_and_include_compatible_library_declarations,defaultValueDescription:"ES3"};var a,o=[{name:"all",type:"boolean",showInSimplifiedHelpView:!0,category:e.Diagnostics.Command_line_Options,description:e.Diagnostics.Show_all_compiler_options,defaultValueDescription:"false"},{name:"version",shortName:"v",type:"boolean",showInSimplifiedHelpView:!0,category:e.Diagnostics.Command_line_Options,description:e.Diagnostics.Print_the_compiler_s_version,defaultValueDescription:"false"},{name:"init",type:"boolean",showInSimplifiedHelpView:!0,category:e.Diagnostics.Command_line_Options,description:e.Diagnostics.Initializes_a_TypeScript_project_and_creates_a_tsconfig_json_file,defaultValueDescription:"false"},{name:"project",shortName:"p",type:"string",isFilePath:!0,showInSimplifiedHelpView:!0,category:e.Diagnostics.Command_line_Options,paramType:e.Diagnostics.FILE_OR_DIRECTORY,description:e.Diagnostics.Compile_the_project_given_the_path_to_its_configuration_file_or_to_a_folder_with_a_tsconfig_json},{name:"build",type:"boolean",shortName:"b",showInSimplifiedHelpView:!0,category:e.Diagnostics.Command_line_Options,description:e.Diagnostics.Build_one_or_more_projects_and_their_dependencies_if_out_of_date,defaultValueDescription:"false"},{name:"showConfig",type:"boolean",showInSimplifiedHelpView:!0,category:e.Diagnostics.Command_line_Options,isCommandLineOnly:!0,description:e.Diagnostics.Print_the_final_configuration_instead_of_building,defaultValueDescription:"false"},{name:"listFilesOnly",type:"boolean",category:e.Diagnostics.Command_line_Options,affectsSemanticDiagnostics:!0,affectsEmit:!0,isCommandLineOnly:!0,description:e.Diagnostics.Print_names_of_files_that_are_part_of_the_compilation_and_then_stop_processing,defaultValueDescription:"false"},e.targetOptionDeclaration,{name:"module",shortName:"m",type:new e.Map(e.getEntries({none:e.ModuleKind.None,commonjs:e.ModuleKind.CommonJS,amd:e.ModuleKind.AMD,system:e.ModuleKind.System,umd:e.ModuleKind.UMD,es6:e.ModuleKind.ES2015,es2015:e.ModuleKind.ES2015,es2020:e.ModuleKind.ES2020,es2022:e.ModuleKind.ES2022,esnext:e.ModuleKind.ESNext,node12:e.ModuleKind.Node12,nodenext:e.ModuleKind.NodeNext})),affectsModuleResolution:!0,affectsEmit:!0,paramType:e.Diagnostics.KIND,showInSimplifiedHelpView:!0,category:e.Diagnostics.Modules,description:e.Diagnostics.Specify_what_module_code_is_generated},{name:"lib",type:"list",element:{name:"lib",type:e.libMap},affectsProgramStructure:!0,showInSimplifiedHelpView:!0,category:e.Diagnostics.Language_and_Environment,description:e.Diagnostics.Specify_a_set_of_bundled_library_declaration_files_that_describe_the_target_runtime_environment,transpileOptionValue:void 0},{name:"allowJs",type:"boolean",affectsModuleResolution:!0,showInSimplifiedHelpView:!0,category:e.Diagnostics.JavaScript_Support,description:e.Diagnostics.Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJS_option_to_get_errors_from_these_files,defaultValueDescription:"false"},{name:"checkJs",type:"boolean",showInSimplifiedHelpView:!0,category:e.Diagnostics.JavaScript_Support,description:e.Diagnostics.Enable_error_reporting_in_type_checked_JavaScript_files,defaultValueDescription:"false"},{name:"jsx",type:t,affectsSourceFile:!0,affectsEmit:!0,affectsModuleResolution:!0,paramType:e.Diagnostics.KIND,showInSimplifiedHelpView:!0,category:e.Diagnostics.Language_and_Environment,description:e.Diagnostics.Specify_what_JSX_code_is_generated,defaultValueDescription:"undefined"},{name:"declaration",shortName:"d",type:"boolean",affectsEmit:!0,showInSimplifiedHelpView:!0,category:e.Diagnostics.Emit,transpileOptionValue:void 0,description:e.Diagnostics.Generate_d_ts_files_from_TypeScript_and_JavaScript_files_in_your_project,defaultValueDescription:e.Diagnostics.false_unless_composite_is_set},{name:"declarationMap",type:"boolean",affectsEmit:!0,showInSimplifiedHelpView:!0,category:e.Diagnostics.Emit,transpileOptionValue:void 0,defaultValueDescription:"false",description:e.Diagnostics.Create_sourcemaps_for_d_ts_files},{name:"emitDeclarationOnly",type:"boolean",affectsEmit:!0,showInSimplifiedHelpView:!0,category:e.Diagnostics.Emit,description:e.Diagnostics.Only_output_d_ts_files_and_not_JavaScript_files,transpileOptionValue:void 0,defaultValueDescription:"false"},{name:"sourceMap",type:"boolean",affectsEmit:!0,showInSimplifiedHelpView:!0,category:e.Diagnostics.Emit,defaultValueDescription:"false",description:e.Diagnostics.Create_source_map_files_for_emitted_JavaScript_files},{name:"outFile",type:"string",affectsEmit:!0,isFilePath:!0,paramType:e.Diagnostics.FILE,showInSimplifiedHelpView:!0,category:e.Diagnostics.Emit,description:e.Diagnostics.Specify_a_file_that_bundles_all_outputs_into_one_JavaScript_file_If_declaration_is_true_also_designates_a_file_that_bundles_all_d_ts_output,transpileOptionValue:void 0},{name:"outDir",type:"string",affectsEmit:!0,isFilePath:!0,paramType:e.Diagnostics.DIRECTORY,showInSimplifiedHelpView:!0,category:e.Diagnostics.Emit,description:e.Diagnostics.Specify_an_output_folder_for_all_emitted_files},{name:"rootDir",type:"string",affectsEmit:!0,isFilePath:!0,paramType:e.Diagnostics.LOCATION,category:e.Diagnostics.Modules,description:e.Diagnostics.Specify_the_root_folder_within_your_source_files,defaultValueDescription:e.Diagnostics.Computed_from_the_list_of_input_files},{name:"composite",type:"boolean",affectsEmit:!0,isTSConfigOnly:!0,category:e.Diagnostics.Projects,transpileOptionValue:void 0,defaultValueDescription:"false",description:e.Diagnostics.Enable_constraints_that_allow_a_TypeScript_project_to_be_used_with_project_references},{name:"tsBuildInfoFile",type:"string",affectsEmit:!0,isFilePath:!0,paramType:e.Diagnostics.FILE,category:e.Diagnostics.Projects,transpileOptionValue:void 0,defaultValueDescription:".tsbuildinfo",description:e.Diagnostics.Specify_the_folder_for_tsbuildinfo_incremental_compilation_files},{name:"removeComments",type:"boolean",affectsEmit:!0,showInSimplifiedHelpView:!0,category:e.Diagnostics.Emit,defaultValueDescription:"false",description:e.Diagnostics.Disable_emitting_comments},{name:"noEmit",type:"boolean",showInSimplifiedHelpView:!0,category:e.Diagnostics.Emit,description:e.Diagnostics.Disable_emitting_files_from_a_compilation,transpileOptionValue:void 0,defaultValueDescription:"false"},{name:"importHelpers",type:"boolean",affectsEmit:!0,category:e.Diagnostics.Emit,description:e.Diagnostics.Allow_importing_helper_functions_from_tslib_once_per_project_instead_of_including_them_per_file,defaultValueDescription:"false"},{name:"importsNotUsedAsValues",type:new e.Map(e.getEntries({remove:0,preserve:1,error:2})),affectsEmit:!0,affectsSemanticDiagnostics:!0,category:e.Diagnostics.Emit,description:e.Diagnostics.Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types},{name:"downlevelIteration",type:"boolean",affectsEmit:!0,category:e.Diagnostics.Emit,description:e.Diagnostics.Emit_more_compliant_but_verbose_and_less_performant_JavaScript_for_iteration,defaultValueDescription:"false"},{name:"isolatedModules",type:"boolean",category:e.Diagnostics.Interop_Constraints,description:e.Diagnostics.Ensure_that_each_file_can_be_safely_transpiled_without_relying_on_other_imports,transpileOptionValue:!0,defaultValueDescription:"false"},{name:"strict",type:"boolean",showInSimplifiedHelpView:!0,category:e.Diagnostics.Type_Checking,description:e.Diagnostics.Enable_all_strict_type_checking_options,defaultValueDescription:"false"},{name:"noImplicitAny",type:"boolean",affectsSemanticDiagnostics:!0,strictFlag:!0,category:e.Diagnostics.Type_Checking,description:e.Diagnostics.Enable_error_reporting_for_expressions_and_declarations_with_an_implied_any_type,defaultValueDescription:e.Diagnostics.false_unless_strict_is_set},{name:"strictNullChecks",type:"boolean",affectsSemanticDiagnostics:!0,strictFlag:!0,category:e.Diagnostics.Type_Checking,description:e.Diagnostics.When_type_checking_take_into_account_null_and_undefined,defaultValueDescription:e.Diagnostics.false_unless_strict_is_set},{name:"strictFunctionTypes",type:"boolean",strictFlag:!0,category:e.Diagnostics.Type_Checking,description:e.Diagnostics.When_assigning_functions_check_to_ensure_parameters_and_the_return_values_are_subtype_compatible,defaultValueDescription:e.Diagnostics.false_unless_strict_is_set},{name:"strictBindCallApply",type:"boolean",strictFlag:!0,category:e.Diagnostics.Type_Checking,description:e.Diagnostics.Check_that_the_arguments_for_bind_call_and_apply_methods_match_the_original_function,defaultValueDescription:e.Diagnostics.false_unless_strict_is_set},{name:"strictPropertyInitialization",type:"boolean",affectsSemanticDiagnostics:!0,strictFlag:!0,category:e.Diagnostics.Type_Checking,description:e.Diagnostics.Check_for_class_properties_that_are_declared_but_not_set_in_the_constructor,defaultValueDescription:e.Diagnostics.false_unless_strict_is_set},{name:"noImplicitThis",type:"boolean",affectsSemanticDiagnostics:!0,strictFlag:!0,category:e.Diagnostics.Type_Checking,description:e.Diagnostics.Enable_error_reporting_when_this_is_given_the_type_any,defaultValueDescription:e.Diagnostics.false_unless_strict_is_set},{name:"useUnknownInCatchVariables",type:"boolean",affectsSemanticDiagnostics:!0,strictFlag:!0,category:e.Diagnostics.Type_Checking,description:e.Diagnostics.Type_catch_clause_variables_as_unknown_instead_of_any,defaultValueDescription:"false"},{name:"alwaysStrict",type:"boolean",affectsSourceFile:!0,strictFlag:!0,category:e.Diagnostics.Type_Checking,description:e.Diagnostics.Ensure_use_strict_is_always_emitted,defaultValueDescription:e.Diagnostics.false_unless_strict_is_set},{name:"noUnusedLocals",type:"boolean",affectsSemanticDiagnostics:!0,category:e.Diagnostics.Type_Checking,description:e.Diagnostics.Enable_error_reporting_when_a_local_variables_aren_t_read,defaultValueDescription:"false"},{name:"noUnusedParameters",type:"boolean",affectsSemanticDiagnostics:!0,category:e.Diagnostics.Type_Checking,description:e.Diagnostics.Raise_an_error_when_a_function_parameter_isn_t_read,defaultValueDescription:"false"},{name:"exactOptionalPropertyTypes",type:"boolean",affectsSemanticDiagnostics:!0,category:e.Diagnostics.Type_Checking,description:e.Diagnostics.Interpret_optional_property_types_as_written_rather_than_adding_undefined,defaultValueDescription:"false"},{name:"noImplicitReturns",type:"boolean",affectsSemanticDiagnostics:!0,category:e.Diagnostics.Type_Checking,description:e.Diagnostics.Enable_error_reporting_for_codepaths_that_do_not_explicitly_return_in_a_function,defaultValueDescription:"false"},{name:"noFallthroughCasesInSwitch",type:"boolean",affectsBindDiagnostics:!0,affectsSemanticDiagnostics:!0,category:e.Diagnostics.Type_Checking,description:e.Diagnostics.Enable_error_reporting_for_fallthrough_cases_in_switch_statements,defaultValueDescription:"false"},{name:"noUncheckedIndexedAccess",type:"boolean",affectsSemanticDiagnostics:!0,category:e.Diagnostics.Type_Checking,description:e.Diagnostics.Include_undefined_in_index_signature_results,defaultValueDescription:"false"},{name:"noImplicitOverride",type:"boolean",affectsSemanticDiagnostics:!0,category:e.Diagnostics.Type_Checking,description:e.Diagnostics.Ensure_overriding_members_in_derived_classes_are_marked_with_an_override_modifier,defaultValueDescription:"false"},{name:"noPropertyAccessFromIndexSignature",type:"boolean",showInSimplifiedHelpView:!1,category:e.Diagnostics.Type_Checking,description:e.Diagnostics.Enforces_using_indexed_accessors_for_keys_declared_using_an_indexed_type,defaultValueDescription:"false"},{name:"moduleResolution",type:new e.Map(e.getEntries({node:e.ModuleResolutionKind.NodeJs,classic:e.ModuleResolutionKind.Classic,node12:e.ModuleResolutionKind.Node12,nodenext:e.ModuleResolutionKind.NodeNext})),affectsModuleResolution:!0,paramType:e.Diagnostics.STRATEGY,category:e.Diagnostics.Modules,description:e.Diagnostics.Specify_how_TypeScript_looks_up_a_file_from_a_given_module_specifier,defaultValueDescription:e.Diagnostics.module_AMD_or_UMD_or_System_or_ES6_then_Classic_Otherwise_Node},{name:"baseUrl",type:"string",affectsModuleResolution:!0,isFilePath:!0,category:e.Diagnostics.Modules,description:e.Diagnostics.Specify_the_base_directory_to_resolve_non_relative_module_names},{name:"paths",type:"object",affectsModuleResolution:!0,isTSConfigOnly:!0,category:e.Diagnostics.Modules,description:e.Diagnostics.Specify_a_set_of_entries_that_re_map_imports_to_additional_lookup_locations,transpileOptionValue:void 0},{name:"rootDirs",type:"list",isTSConfigOnly:!0,element:{name:"rootDirs",type:"string",isFilePath:!0},affectsModuleResolution:!0,category:e.Diagnostics.Modules,description:e.Diagnostics.Allow_multiple_folders_to_be_treated_as_one_when_resolving_modules,transpileOptionValue:void 0,defaultValueDescription:e.Diagnostics.Computed_from_the_list_of_input_files},{name:"typeRoots",type:"list",element:{name:"typeRoots",type:"string",isFilePath:!0},affectsModuleResolution:!0,category:e.Diagnostics.Modules,description:e.Diagnostics.Specify_multiple_folders_that_act_like_Slashnode_modules_Slash_types},{name:"types",type:"list",element:{name:"types",type:"string"},affectsProgramStructure:!0,showInSimplifiedHelpView:!0,category:e.Diagnostics.Modules,description:e.Diagnostics.Specify_type_package_names_to_be_included_without_being_referenced_in_a_source_file,transpileOptionValue:void 0},{name:"allowSyntheticDefaultImports",type:"boolean",affectsSemanticDiagnostics:!0,category:e.Diagnostics.Interop_Constraints,description:e.Diagnostics.Allow_import_x_from_y_when_a_module_doesn_t_have_a_default_export,defaultValueDescription:e.Diagnostics.module_system_or_esModuleInterop},{name:"esModuleInterop",type:"boolean",affectsSemanticDiagnostics:!0,affectsEmit:!0,showInSimplifiedHelpView:!0,category:e.Diagnostics.Interop_Constraints,description:e.Diagnostics.Emit_additional_JavaScript_to_ease_support_for_importing_CommonJS_modules_This_enables_allowSyntheticDefaultImports_for_type_compatibility,defaultValueDescription:"false"},{name:"preserveSymlinks",type:"boolean",category:e.Diagnostics.Interop_Constraints,description:e.Diagnostics.Disable_resolving_symlinks_to_their_realpath_This_correlates_to_the_same_flag_in_node,defaultValueDescription:"false"},{name:"allowUmdGlobalAccess",type:"boolean",affectsSemanticDiagnostics:!0,category:e.Diagnostics.Modules,description:e.Diagnostics.Allow_accessing_UMD_globals_from_modules,defaultValueDescription:"false"},{name:"sourceRoot",type:"string",affectsEmit:!0,paramType:e.Diagnostics.LOCATION,category:e.Diagnostics.Emit,description:e.Diagnostics.Specify_the_root_path_for_debuggers_to_find_the_reference_source_code},{name:"mapRoot",type:"string",affectsEmit:!0,paramType:e.Diagnostics.LOCATION,category:e.Diagnostics.Emit,description:e.Diagnostics.Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations},{name:"inlineSourceMap",type:"boolean",affectsEmit:!0,category:e.Diagnostics.Emit,description:e.Diagnostics.Include_sourcemap_files_inside_the_emitted_JavaScript,defaultValueDescription:"false"},{name:"inlineSources",type:"boolean",affectsEmit:!0,category:e.Diagnostics.Emit,description:e.Diagnostics.Include_source_code_in_the_sourcemaps_inside_the_emitted_JavaScript,defaultValueDescription:"false"},{name:"experimentalDecorators",type:"boolean",affectsSemanticDiagnostics:!0,category:e.Diagnostics.Language_and_Environment,description:e.Diagnostics.Enable_experimental_support_for_TC39_stage_2_draft_decorators,defaultValueDescription:"false"},{name:"emitDecoratorMetadata",type:"boolean",affectsSemanticDiagnostics:!0,affectsEmit:!0,category:e.Diagnostics.Language_and_Environment,description:e.Diagnostics.Emit_design_type_metadata_for_decorated_declarations_in_source_files,defaultValueDescription:"false"},{name:"jsxFactory",type:"string",category:e.Diagnostics.Language_and_Environment,description:e.Diagnostics.Specify_the_JSX_factory_function_used_when_targeting_React_JSX_emit_e_g_React_createElement_or_h,defaultValueDescription:"`React.createElement`"},{name:"jsxFragmentFactory",type:"string",category:e.Diagnostics.Language_and_Environment,description:e.Diagnostics.Specify_the_JSX_Fragment_reference_used_for_fragments_when_targeting_React_JSX_emit_e_g_React_Fragment_or_Fragment},{name:"jsxImportSource",type:"string",affectsSemanticDiagnostics:!0,affectsEmit:!0,affectsModuleResolution:!0,category:e.Diagnostics.Language_and_Environment,description:e.Diagnostics.Specify_module_specifier_used_to_import_the_JSX_factory_functions_when_using_jsx_Colon_react_jsx_Asterisk,defaultValueDescription:"react"},{name:"resolveJsonModule",type:"boolean",affectsModuleResolution:!0,category:e.Diagnostics.Modules,description:e.Diagnostics.Enable_importing_json_files,defaultValueDescription:"false"},{name:"out",type:"string",affectsEmit:!0,isFilePath:!1,category:e.Diagnostics.Backwards_Compatibility,paramType:e.Diagnostics.FILE,transpileOptionValue:void 0,description:e.Diagnostics.Deprecated_setting_Use_outFile_instead},{name:"reactNamespace",type:"string",affectsEmit:!0,category:e.Diagnostics.Language_and_Environment,description:e.Diagnostics.Specify_the_object_invoked_for_createElement_This_only_applies_when_targeting_react_JSX_emit,defaultValueDescription:"`React`"},{name:"skipDefaultLibCheck",type:"boolean",category:e.Diagnostics.Completeness,description:e.Diagnostics.Skip_type_checking_d_ts_files_that_are_included_with_TypeScript,defaultValueDescription:"false"},{name:"charset",type:"string",category:e.Diagnostics.Backwards_Compatibility,description:e.Diagnostics.No_longer_supported_In_early_versions_manually_set_the_text_encoding_for_reading_files,defaultValueDescription:"utf8"},{name:"emitBOM",type:"boolean",affectsEmit:!0,category:e.Diagnostics.Emit,description:e.Diagnostics.Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files,defaultValueDescription:"false"},{name:"newLine",type:new e.Map(e.getEntries({crlf:0,lf:1})),affectsEmit:!0,paramType:e.Diagnostics.NEWLINE,category:e.Diagnostics.Emit,description:e.Diagnostics.Set_the_newline_character_for_emitting_files,defaultValueDescription:e.Diagnostics.Platform_specific},{name:"noErrorTruncation",type:"boolean",affectsSemanticDiagnostics:!0,category:e.Diagnostics.Output_Formatting,description:e.Diagnostics.Disable_truncating_types_in_error_messages,defaultValueDescription:"false"},{name:"noLib",type:"boolean",category:e.Diagnostics.Language_and_Environment,affectsProgramStructure:!0,description:e.Diagnostics.Disable_including_any_library_files_including_the_default_lib_d_ts,transpileOptionValue:!0,defaultValueDescription:"false"},{name:"noResolve",type:"boolean",affectsModuleResolution:!0,category:e.Diagnostics.Modules,description:e.Diagnostics.Disallow_import_s_require_s_or_reference_s_from_expanding_the_number_of_files_TypeScript_should_add_to_a_project,transpileOptionValue:!0,defaultValueDescription:"false"},{name:"stripInternal",type:"boolean",affectsEmit:!0,category:e.Diagnostics.Emit,description:e.Diagnostics.Disable_emitting_declarations_that_have_internal_in_their_JSDoc_comments,defaultValueDescription:"false"},{name:"disableSizeLimit",type:"boolean",affectsProgramStructure:!0,category:e.Diagnostics.Editor_Support,description:e.Diagnostics.Remove_the_20mb_cap_on_total_source_code_size_for_JavaScript_files_in_the_TypeScript_language_server,defaultValueDescription:"false"},{name:"disableSourceOfProjectReferenceRedirect",type:"boolean",isTSConfigOnly:!0,category:e.Diagnostics.Projects,description:e.Diagnostics.Disable_preferring_source_files_instead_of_declaration_files_when_referencing_composite_projects,defaultValueDescription:"false"},{name:"disableSolutionSearching",type:"boolean",isTSConfigOnly:!0,category:e.Diagnostics.Projects,description:e.Diagnostics.Opt_a_project_out_of_multi_project_reference_checking_when_editing,defaultValueDescription:"false"},{name:"disableReferencedProjectLoad",type:"boolean",isTSConfigOnly:!0,category:e.Diagnostics.Projects,description:e.Diagnostics.Reduce_the_number_of_projects_loaded_automatically_by_TypeScript,defaultValueDescription:"false"},{name:"noImplicitUseStrict",type:"boolean",affectsSemanticDiagnostics:!0,category:e.Diagnostics.Backwards_Compatibility,description:e.Diagnostics.Disable_adding_use_strict_directives_in_emitted_JavaScript_files,defaultValueDescription:"false"},{name:"noEmitHelpers",type:"boolean",affectsEmit:!0,category:e.Diagnostics.Emit,description:e.Diagnostics.Disable_generating_custom_helper_functions_like_extends_in_compiled_output,defaultValueDescription:"false"},{name:"noEmitOnError",type:"boolean",affectsEmit:!0,category:e.Diagnostics.Emit,transpileOptionValue:void 0,description:e.Diagnostics.Disable_emitting_files_if_any_type_checking_errors_are_reported,defaultValueDescription:"false"},{name:"preserveConstEnums",type:"boolean",affectsEmit:!0,category:e.Diagnostics.Emit,description:e.Diagnostics.Disable_erasing_const_enum_declarations_in_generated_code,defaultValueDescription:"false"},{name:"declarationDir",type:"string",affectsEmit:!0,isFilePath:!0,paramType:e.Diagnostics.DIRECTORY,category:e.Diagnostics.Emit,transpileOptionValue:void 0,description:e.Diagnostics.Specify_the_output_directory_for_generated_declaration_files},{name:"skipLibCheck",type:"boolean",category:e.Diagnostics.Completeness,description:e.Diagnostics.Skip_type_checking_all_d_ts_files,defaultValueDescription:"false"},{name:"allowUnusedLabels",type:"boolean",affectsBindDiagnostics:!0,affectsSemanticDiagnostics:!0,category:e.Diagnostics.Type_Checking,description:e.Diagnostics.Disable_error_reporting_for_unused_labels,defaultValueDescription:"undefined"},{name:"allowUnreachableCode",type:"boolean",affectsBindDiagnostics:!0,affectsSemanticDiagnostics:!0,category:e.Diagnostics.Type_Checking,description:e.Diagnostics.Disable_error_reporting_for_unreachable_code,defaultValueDescription:"undefined"},{name:"suppressExcessPropertyErrors",type:"boolean",affectsSemanticDiagnostics:!0,category:e.Diagnostics.Backwards_Compatibility,description:e.Diagnostics.Disable_reporting_of_excess_property_errors_during_the_creation_of_object_literals,defaultValueDescription:"false"},{name:"suppressImplicitAnyIndexErrors",type:"boolean",affectsSemanticDiagnostics:!0,category:e.Diagnostics.Backwards_Compatibility,description:e.Diagnostics.Suppress_noImplicitAny_errors_when_indexing_objects_that_lack_index_signatures,defaultValueDescription:"false"},{name:"forceConsistentCasingInFileNames",type:"boolean",affectsModuleResolution:!0,category:e.Diagnostics.Interop_Constraints,description:e.Diagnostics.Ensure_that_casing_is_correct_in_imports,defaultValueDescription:"false"},{name:"maxNodeModuleJsDepth",type:"number",affectsModuleResolution:!0,category:e.Diagnostics.JavaScript_Support,description:e.Diagnostics.Specify_the_maximum_folder_depth_used_for_checking_JavaScript_files_from_node_modules_Only_applicable_with_allowJs,defaultValueDescription:"0"},{name:"noStrictGenericChecks",type:"boolean",affectsSemanticDiagnostics:!0,category:e.Diagnostics.Backwards_Compatibility,description:e.Diagnostics.Disable_strict_checking_of_generic_signatures_in_function_types,defaultValueDescription:"false"},{name:"useDefineForClassFields",type:"boolean",affectsSemanticDiagnostics:!0,affectsEmit:!0,category:e.Diagnostics.Language_and_Environment,description:e.Diagnostics.Emit_ECMAScript_standard_compliant_class_fields,defaultValueDescription:e.Diagnostics.true_for_ES2022_and_above_including_ESNext},{name:"preserveValueImports",type:"boolean",affectsEmit:!0,category:e.Diagnostics.Emit,description:e.Diagnostics.Preserve_unused_imported_values_in_the_JavaScript_output_that_would_otherwise_be_removed,defaultValueDescription:"false"},{name:"keyofStringsOnly",type:"boolean",category:e.Diagnostics.Backwards_Compatibility,description:e.Diagnostics.Make_keyof_only_return_strings_instead_of_string_numbers_or_symbols_Legacy_option,defaultValueDescription:"false"},{name:"plugins",type:"list",isTSConfigOnly:!0,element:{name:"plugin",type:"object"},description:e.Diagnostics.List_of_language_service_plugins,category:e.Diagnostics.Editor_Support}];function s(t){var r=new e.Map,n=new e.Map;return e.forEach(t,(function(e){r.set(e.name.toLowerCase(),e),e.shortName&&n.set(e.shortName,e.name);})),{optionsNameMap:r,shortOptionNames:n}}function c(){return a||(a=s(e.optionDeclarations))}e.optionDeclarations=n$3(n$3([],e.commonOptionsWithBuild,!0),o,!0),e.semanticDiagnosticsOptionDeclarations=e.optionDeclarations.filter((function(e){return !!e.affectsSemanticDiagnostics})),e.affectsEmitOptionDeclarations=e.optionDeclarations.filter((function(e){return !!e.affectsEmit})),e.moduleResolutionOptionDeclarations=e.optionDeclarations.filter((function(e){return !!e.affectsModuleResolution})),e.sourceFileAffectingCompilerOptions=e.optionDeclarations.filter((function(e){return !!e.affectsSourceFile||!!e.affectsModuleResolution||!!e.affectsBindDiagnostics})),e.optionsAffectingProgramStructure=e.optionDeclarations.filter((function(e){return !!e.affectsProgramStructure})),e.transpileOptionValueCompilerOptions=e.optionDeclarations.filter((function(t){return e.hasProperty(t,"transpileOptionValue")})),e.optionsForBuild=[{name:"verbose",shortName:"v",category:e.Diagnostics.Command_line_Options,description:e.Diagnostics.Enable_verbose_logging,type:"boolean",defaultValueDescription:"false"},{name:"dry",shortName:"d",category:e.Diagnostics.Command_line_Options,description:e.Diagnostics.Show_what_would_be_built_or_deleted_if_specified_with_clean,type:"boolean",defaultValueDescription:"false"},{name:"force",shortName:"f",category:e.Diagnostics.Command_line_Options,description:e.Diagnostics.Build_all_projects_including_those_that_appear_to_be_up_to_date,type:"boolean",defaultValueDescription:"false"},{name:"clean",category:e.Diagnostics.Command_line_Options,description:e.Diagnostics.Delete_the_outputs_of_all_projects,type:"boolean",defaultValueDescription:"false"}],e.buildOpts=n$3(n$3([],e.commonOptionsWithBuild,!0),e.optionsForBuild,!0),e.typeAcquisitionDeclarations=[{name:"enableAutoDiscovery",type:"boolean",defaultValueDescription:"false"},{name:"enable",type:"boolean",defaultValueDescription:"false"},{name:"include",type:"list",element:{name:"include",type:"string"}},{name:"exclude",type:"list",element:{name:"exclude",type:"string"}},{name:"disableFilenameBasedTypeAcquisition",type:"boolean",defaultValueDescription:"false"}],e.createOptionNameMap=s,e.getOptionsNameMap=c;var l,u={diagnostic:e.Diagnostics.Compiler_option_0_may_only_be_used_with_build,getOptionsNameMap:D};function _(e){return e&&void 0!==e.enableAutoDiscovery&&void 0===e.enable?{enable:e.enableAutoDiscovery,include:e.include||[],exclude:e.exclude||[]}:e}function d(t){return p(t,e.createCompilerDiagnostic)}function p(t,r){var n=e.arrayFrom(t.type.keys()).map((function(e){return "'".concat(e,"'")})).join(", ");return r(e.Diagnostics.Argument_for_0_option_must_be_Colon_1,"--".concat(t.name),n)}function f(t,r,n){return ye(t,e.trimString(r||""),n)}function g(t,r,n){if(void 0===r&&(r=""),r=e.trimString(r),!e.startsWith(r,"-")){if(""===r)return [];var i=r.split(",");switch(t.element.type){case"number":return e.mapDefined(i,(function(e){return me(t.element,parseInt(e),n)}));case"string":return e.mapDefined(i,(function(e){return me(t.element,e||"",n)}));default:return e.mapDefined(i,(function(e){return f(t.element,e,n)}))}}}function m(e){return e.name}function y(t,r,n,i){var a;if(null===(a=r.alternateMode)||void 0===a?void 0:a.getOptionsNameMap().optionsNameMap.has(t.toLowerCase()))return n(r.alternateMode.diagnostic,t);var o=e.getSpellingSuggestion(t,r.optionDeclarations,m);return o?n(r.unknownDidYouMeanDiagnostic,i||t,o.name):n(r.unknownOptionDiagnostic,i||t)}function v(t,r,n){var i,a={},o=[],s=[];return c(r),{options:a,watchOptions:i,fileNames:o,errors:s};function c(r){for(var n=0;n<r.length;){var c=r[n];if(n++,64===c.charCodeAt(0))l(c.slice(1));else if(45===c.charCodeAt(0)){var u=c.slice(45===c.charCodeAt(1)?2:1),_=x(t.getOptionsNameMap,u,!0);if(_)n=h(r,n,t,_,a,s);else {var d=x(M.getOptionsNameMap,u,!0);d?n=h(r,n,M,d,i||(i={}),s):s.push(y(u,t,e.createCompilerDiagnostic,c));}}else o.push(c);}}function l(t){var r=E(t,n||function(t){return e.sys.readFile(t)});if(e.isString(r)){for(var i=[],a=0;;){for(;a<r.length&&r.charCodeAt(a)<=32;)a++;if(a>=r.length)break;var o=a;if(34===r.charCodeAt(o)){for(a++;a<r.length&&34!==r.charCodeAt(a);)a++;a<r.length?(i.push(r.substring(o+1,a)),a++):s.push(e.createCompilerDiagnostic(e.Diagnostics.Unterminated_quoted_string_in_response_file_0,t));}else {for(;r.charCodeAt(a)>32;)a++;i.push(r.substring(o,a));}}c(i);}else s.push(r);}}function h(t,r,n,i,a,o){if(i.isTSConfigOnly)"null"===(s=t[r])?(a[i.name]=void 0,r++):"boolean"===i.type?"false"===s?(a[i.name]=me(i,!1,o),r++):("true"===s&&r++,o.push(e.createCompilerDiagnostic(e.Diagnostics.Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_false_or_null_on_command_line,i.name))):(o.push(e.createCompilerDiagnostic(e.Diagnostics.Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_null_on_command_line,i.name)),s&&!e.startsWith(s,"-")&&r++);else if(t[r]||"boolean"===i.type||o.push(e.createCompilerDiagnostic(n.optionTypeMismatchDiagnostic,i.name,U(i))),"null"!==t[r])switch(i.type){case"number":a[i.name]=me(i,parseInt(t[r]),o),r++;break;case"boolean":var s=t[r];a[i.name]=me(i,"false"!==s,o),"false"!==s&&"true"!==s||r++;break;case"string":a[i.name]=me(i,t[r]||"",o),r++;break;case"list":var c=g(i,t[r],o);a[i.name]=c||[],c&&r++;break;default:a[i.name]=f(i,t[r],o),r++;}else a[i.name]=void 0,r++;return r}function b(e,t){return x(c,e,t)}function x(e,t,r){void 0===r&&(r=!1),t=t.toLowerCase();var n=e(),i=n.optionsNameMap,a=n.shortOptionNames;if(r){var o=a.get(t);void 0!==o&&(t=o);}return i.get(t)}function D(){return l||(l=s(e.buildOpts))}e.defaultInitCompilerOptions={module:e.ModuleKind.CommonJS,target:3,strict:!0,esModuleInterop:!0,forceConsistentCasingInFileNames:!0,skipLibCheck:!0},e.convertEnableAutoDiscoveryToEnable=_,e.createCompilerDiagnosticForInvalidCustomType=d,e.parseCustomTypeOption=f,e.parseListTypeOption=g,e.parseCommandLineWorker=v,e.compilerOptionsDidYouMeanDiagnostics={alternateMode:u,getOptionsNameMap:c,optionDeclarations:e.optionDeclarations,unknownOptionDiagnostic:e.Diagnostics.Unknown_compiler_option_0,unknownDidYouMeanDiagnostic:e.Diagnostics.Unknown_compiler_option_0_Did_you_mean_1,optionTypeMismatchDiagnostic:e.Diagnostics.Compiler_option_0_expects_an_argument},e.parseCommandLine=function(t,r){return v(e.compilerOptionsDidYouMeanDiagnostics,t,r)},e.getOptionFromName=b;var S={alternateMode:{diagnostic:e.Diagnostics.Compiler_option_0_may_not_be_used_with_build,getOptionsNameMap:c},getOptionsNameMap:D,optionDeclarations:e.buildOpts,unknownOptionDiagnostic:e.Diagnostics.Unknown_build_option_0,unknownDidYouMeanDiagnostic:e.Diagnostics.Unknown_build_option_0_Did_you_mean_1,optionTypeMismatchDiagnostic:e.Diagnostics.Build_option_0_requires_a_value_of_type_1};function T(t,r){var n=e.parseJsonText(t,r);return {config:j(n,n.parseDiagnostics,!1,void 0),error:n.parseDiagnostics.length?n.parseDiagnostics[0]:void 0}}function C(t,r){var n=E(t,r);return e.isString(n)?e.parseJsonText(t,n):{fileName:t,parseDiagnostics:[n]}}function E(t,r){var n;try{n=r(t);}catch(r){return e.createCompilerDiagnostic(e.Diagnostics.Cannot_read_file_0_Colon_1,t,r.message)}return void 0===n?e.createCompilerDiagnostic(e.Diagnostics.Cannot_read_file_0,t):n}function k(t){return e.arrayToMap(t,m)}e.parseBuildCommand=function(t){var r=v(S,t),n=r.options,i=r.watchOptions,a=r.fileNames,o=r.errors,s=n;return 0===a.length&&a.push("."),s.clean&&s.force&&o.push(e.createCompilerDiagnostic(e.Diagnostics.Options_0_and_1_cannot_be_combined,"clean","force")),s.clean&&s.verbose&&o.push(e.createCompilerDiagnostic(e.Diagnostics.Options_0_and_1_cannot_be_combined,"clean","verbose")),s.clean&&s.watch&&o.push(e.createCompilerDiagnostic(e.Diagnostics.Options_0_and_1_cannot_be_combined,"clean","watch")),s.watch&&s.dry&&o.push(e.createCompilerDiagnostic(e.Diagnostics.Options_0_and_1_cannot_be_combined,"watch","dry")),{buildOptions:s,watchOptions:i,projects:a,errors:o}},e.getDiagnosticText=function(t){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];var i=e.createCompilerDiagnostic.apply(void 0,arguments);return i.messageText},e.getParsedCommandLineOfConfigFile=function(t,r,n,i,a,o){var s=E(t,(function(e){return n.readFile(e)}));if(e.isString(s)){var c=e.parseJsonText(t,s),l=n.getCurrentDirectory();return c.path=e.toPath(t,l,e.createGetCanonicalFileName(n.useCaseSensitiveFileNames)),c.resolvedPath=c.path,c.originalFileName=c.fileName,Z(c,n,e.getNormalizedAbsolutePath(e.getDirectoryPath(t),l),r,e.getNormalizedAbsolutePath(t,l),void 0,o,i,a)}n.onUnRecoverableConfigFileDiagnostic(s);},e.readConfigFile=function(t,r){var n=E(t,r);return e.isString(n)?T(t,n):{config:{},error:n}},e.parseConfigFileTextToJson=T,e.readJsonConfigFile=C,e.tryReadFile=E;var N,F={optionDeclarations:e.typeAcquisitionDeclarations,unknownOptionDiagnostic:e.Diagnostics.Unknown_type_acquisition_option_0,unknownDidYouMeanDiagnostic:e.Diagnostics.Unknown_type_acquisition_option_0_Did_you_mean_1};function A(){return N||(N=s(e.optionsForWatch))}var P,w,I,O,M={getOptionsNameMap:A,optionDeclarations:e.optionsForWatch,unknownOptionDiagnostic:e.Diagnostics.Unknown_watch_option_0,unknownDidYouMeanDiagnostic:e.Diagnostics.Unknown_watch_option_0_Did_you_mean_1,optionTypeMismatchDiagnostic:e.Diagnostics.Watch_option_0_requires_a_value_of_type_1};function L(){return P||(P=k(e.optionDeclarations))}function R(){return w||(w=k(e.optionsForWatch))}function B(){return I||(I=k(e.typeAcquisitionDeclarations))}function j(t,r,n,i){var a,o=null===(a=t.statements[0])||void 0===a?void 0:a.expression,s=n?(void 0===O&&(O={name:void 0,type:"object",elementOptions:k([{name:"compilerOptions",type:"object",elementOptions:L(),extraKeyDiagnostics:e.compilerOptionsDidYouMeanDiagnostics},{name:"watchOptions",type:"object",elementOptions:R(),extraKeyDiagnostics:M},{name:"typingOptions",type:"object",elementOptions:B(),extraKeyDiagnostics:F},{name:"typeAcquisition",type:"object",elementOptions:B(),extraKeyDiagnostics:F},{name:"extends",type:"string",category:e.Diagnostics.File_Management},{name:"references",type:"list",element:{name:"references",type:"object"},category:e.Diagnostics.Projects},{name:"files",type:"list",element:{name:"files",type:"string"},category:e.Diagnostics.File_Management},{name:"include",type:"list",element:{name:"include",type:"string"},category:e.Diagnostics.File_Management,defaultValueDescription:e.Diagnostics.if_files_is_specified_otherwise_Asterisk_Asterisk_Slash_Asterisk},{name:"exclude",type:"list",element:{name:"exclude",type:"string"},category:e.Diagnostics.File_Management,defaultValueDescription:e.Diagnostics.node_modules_bower_components_jspm_packages_plus_the_value_of_outDir_if_one_is_specified},e.compileOnSaveCommandLineOption])}),O):void 0;if(o&&204!==o.kind){if(r.push(e.createDiagnosticForNodeInSourceFile(t,o,e.Diagnostics.The_root_value_of_a_0_file_must_be_an_object,"jsconfig.json"===e.getBaseFileName(t.fileName)?"jsconfig.json":"tsconfig.json")),e.isArrayLiteralExpression(o)){var c=e.find(o.elements,e.isObjectLiteralExpression);if(c)return z(t,c,r,!0,s,i)}return {}}return z(t,o,r,!0,s,i)}function J(e,t){var r;return z(e,null===(r=e.statements[0])||void 0===r?void 0:r.expression,t,!0,void 0,void 0)}function z(t,r,i,a,o,s){return r?u(r,o):a?{}:void 0;function c(e){return o&&o.elementOptions===e}function l(r,n,o,l){for(var d=a?{}:void 0,p=function(r){if(294!==r.kind)return i.push(e.createDiagnosticForNodeInSourceFile(t,r,e.Diagnostics.Property_assignment_expected)),"continue";r.questionToken&&i.push(e.createDiagnosticForNodeInSourceFile(t,r.questionToken,e.Diagnostics.The_0_modifier_can_only_be_used_in_TypeScript_files,"?")),_(r.name)||i.push(e.createDiagnosticForNodeInSourceFile(t,r.name,e.Diagnostics.String_literal_with_double_quotes_expected));var p=e.isComputedNonLiteralName(r.name)?void 0:e.getTextOfPropertyName(r.name),f=p&&e.unescapeLeadingUnderscores(p),g=f&&n?n.get(f):void 0;f&&o&&!g&&(n?i.push(y(f,o,(function(n,i,a){return e.createDiagnosticForNodeInSourceFile(t,r.name,n,i,a)}))):i.push(e.createDiagnosticForNodeInSourceFile(t,r.name,o.unknownOptionDiagnostic,f)));var m=u(r.initializer,g);if(void 0!==f&&(a&&(d[f]=m),s&&(l||c(n)))){var v=K(g,m);l?v&&s.onSetValidOptionKeyValueInParent(l,g,m):c(n)&&(v?s.onSetValidOptionKeyValueInRoot(f,r.name,m,r.initializer):g||s.onSetUnknownOptionKeyValueInRoot(f,r.name,m,r.initializer));}},f=0,g=r.properties;f<g.length;f++)p(g[f]);return d}function u(r,o){var s;switch(r.kind){case 110:return y(o&&"boolean"!==o.type),m(!0);case 95:return y(o&&"boolean"!==o.type),m(!1);case 104:return y(o&&"extends"===o.name),m(null);case 10:_(r)||i.push(e.createDiagnosticForNodeInSourceFile(t,r,e.Diagnostics.String_literal_with_double_quotes_expected)),y(o&&e.isString(o.type)&&"string"!==o.type);var c=r.text;if(o&&!e.isString(o.type)){var d=o;d.type.has(c.toLowerCase())||(i.push(p(d,(function(n,i,a){return e.createDiagnosticForNodeInSourceFile(t,r,n,i,a)}))),s=!0);}return m(c);case 8:return y(o&&"number"!==o.type),m(Number(r.text));case 218:if(40!==r.operator||8!==r.operand.kind)break;return y(o&&"number"!==o.type),m(-Number(r.operand.text));case 204:y(o&&"object"!==o.type);var f=r;if(o){var g=o;return m(l(f,g.elementOptions,g.extraKeyDiagnostics,g.name))}return m(l(f,void 0,void 0,void 0));case 203:return y(o&&"list"!==o.type),m(function(t,r){if(a)return e.filter(t.map((function(e){return u(e,r)})),(function(e){return void 0!==e}));t.forEach((function(e){return u(e,r)}));}(r.elements,o&&o.element))}return void(o?y(!0):i.push(e.createDiagnosticForNodeInSourceFile(t,r,e.Diagnostics.Property_value_can_only_be_string_literal_numeric_literal_true_false_null_object_literal_or_array_literal)));function m(a){var c;if(!s){var l=null===(c=null==o?void 0:o.extraValidation)||void 0===c?void 0:c.call(o,a);if(l)return void i.push(e.createDiagnosticForNodeInSourceFile.apply(void 0,n$3([t,r],l,!1)))}return a}function y(n){n&&(i.push(e.createDiagnosticForNodeInSourceFile(t,r,e.Diagnostics.Compiler_option_0_requires_a_value_of_type_1,o.name,U(o))),s=!0);}}function _(r){return e.isStringLiteral(r)&&e.isStringDoubleQuoted(r,t)}}function U(t){return "list"===t.type?"Array":e.isString(t.type)?t.type:"string"}function K(t,r){return !!t&&(!!ee(r)||("list"===t.type?e.isArray(r):typeof r===(e.isString(t.type)?t.type:"string")))}function V(t){return i$1({},e.arrayFrom(t.entries()).reduce((function(e,t){var r;return i$1(i$1({},e),((r={})[t[0]]=t[1],r))}),{}))}function q(t){if(e.length(t)){if(1!==e.length(t))return t;if("**/*"!==t[0])return t}}function W(e){return "string"===e.type||"number"===e.type||"boolean"===e.type||"object"===e.type?void 0:"list"===e.type?W(e.element):e.type}function H(t,r){return e.forEachEntry(r,(function(e,r){if(e===t)return r}))}function G(e,t){return Q(e,c(),t)}function Q(t,r,n){var i=r.optionsNameMap,a=new e.Map,o=n&&e.createGetCanonicalFileName(n.useCaseSensitiveFileNames),s=function(r){if(e.hasProperty(t,r)){if(i.has(r)&&(i.get(r).category===e.Diagnostics.Command_line_Options||i.get(r).category===e.Diagnostics.Output_Formatting))return "continue";var s=t[r],c=i.get(r.toLowerCase());if(c){var l=W(c);l?"list"===c.type?a.set(r,s.map((function(e){return H(e,l)}))):a.set(r,H(s,l)):n&&c.isFilePath?a.set(r,e.getRelativePathFromFile(n.configFilePath,e.getNormalizedAbsolutePath(s,e.getDirectoryPath(n.configFilePath)),o)):a.set(r,s);}}};for(var c in t)s(c);return a}function X(t){return G(e.extend(t,e.defaultInitCompilerOptions))}function Y(e,t,r){if(e&&!ee(t))if("list"===e.type){var n=t;if(e.element.isFilePath&&n.length)return n.map(r)}else if(e.isFilePath)return r(t);return t}function Z(e,t,r,n,i,a,o,s,c){return re(void 0,e,t,r,n,c,i,a,o,s)}function $(e,t){t&&Object.defineProperty(e,"configFile",{enumerable:!1,writable:!1,value:t});}function ee(e){return null==e}function te(t,r){return e.getDirectoryPath(e.getNormalizedAbsolutePath(t,r))}function re(t,r,n,i,a,o,s,c,l,u){void 0===a&&(a={}),void 0===c&&(c=[]),void 0===l&&(l=[]),e.Debug.assert(void 0===t&&void 0!==r||void 0!==t&&void 0===r);var _=[],d=oe(t,r,n,i,s,c,_,u),p=d.raw,f=e.extend(a,d.options||{}),g=o&&d.watchOptions?e.extend(o,d.watchOptions):d.watchOptions||o;f.configFilePath=s&&e.normalizeSlashes(s);var m=function(){var t=b("references",(function(e){return "object"==typeof e}),"object"),n=v(h("files"));if(n){var i="no-prop"===t||e.isArray(t)&&0===t.length,a=e.hasProperty(p,"extends");if(0===n.length&&i&&!a)if(r){var o=s||"tsconfig.json",c=e.Diagnostics.The_files_list_in_config_file_0_is_empty,l=e.firstDefined(e.getTsConfigPropArray(r,"files"),(function(e){return e.initializer})),u=l?e.createDiagnosticForNodeInSourceFile(r,l,c,o):e.createCompilerDiagnostic(c,o);_.push(u);}else x(e.Diagnostics.The_files_list_in_config_file_0_is_empty,s||"tsconfig.json");}var d,f,g=v(h("include")),m=h("exclude"),y=v(m);if("no-prop"===m&&p.compilerOptions){var D=p.compilerOptions.outDir,S=p.compilerOptions.declarationDir;(D||S)&&(y=[D,S].filter((function(e){return !!e})));}return void 0===n&&void 0===g&&(g=["**/*"]),g&&(d=Se(g,_,!0,r,"include")),y&&(f=Se(y,_,!1,r,"exclude")),{filesSpecs:n,includeSpecs:g,excludeSpecs:y,validatedFilesSpec:e.filter(n,e.isString),validatedIncludeSpecs:d,validatedExcludeSpecs:f,pathPatterns:void 0}}();r&&(r.configFileSpecs=m),$(f,r);var y=e.normalizePath(s?te(s,i):i);return {options:f,watchOptions:g,fileNames:function(e){var t=be(m,e,f,n,l);return ie(t,ae(p),c)&&_.push(ne(m,s)),t}(y),projectReferences:function(t){var r,n=b("references",(function(e){return "object"==typeof e}),"object");if(e.isArray(n))for(var i=0,a=n;i<a.length;i++){var o=a[i];"string"!=typeof o.path?x(e.Diagnostics.Compiler_option_0_requires_a_value_of_type_1,"reference.path","string"):(r||(r=[])).push({path:e.getNormalizedAbsolutePath(o.path,t),originalPath:o.path,prepend:o.prepend,circular:o.circular});}return r}(y),typeAcquisition:d.typeAcquisition||ue(),raw:p,errors:_,wildcardDirectories:Ce(m,y,n.useCaseSensitiveFileNames),compileOnSave:!!p.compileOnSave};function v(t){return e.isArray(t)?t:void 0}function h(t){return b(t,e.isString,"string")}function b(t,n,i){if(e.hasProperty(p,t)&&!ee(p[t])){if(e.isArray(p[t])){var a=p[t];return r||e.every(a,n)||_.push(e.createCompilerDiagnostic(e.Diagnostics.Compiler_option_0_requires_a_value_of_type_1,t,i)),a}return x(e.Diagnostics.Compiler_option_0_requires_a_value_of_type_1,t,"Array"),"not-array"}return "no-prop"}function x(t,n,i){r||_.push(e.createCompilerDiagnostic(t,n,i));}}function ne(t,r){var n=t.includeSpecs,i=t.excludeSpecs;return e.createCompilerDiagnostic(e.Diagnostics.No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2,r||"tsconfig.json",JSON.stringify(n||[]),JSON.stringify(i||[]))}function ie(e,t,r){return 0===e.length&&t&&(!r||0===r.length)}function ae(t){return !e.hasProperty(t,"files")&&!e.hasProperty(t,"references")}function oe(t,r,i,a,s,c,l,u){var _;a=e.normalizeSlashes(a);var d=e.getNormalizedAbsolutePath(s||"",a);if(c.indexOf(d)>=0)return l.push(e.createCompilerDiagnostic(e.Diagnostics.Circularity_detected_while_resolving_configuration_Colon_0,n$3(n$3([],c,!0),[d],!1).join(" -> "))),{raw:t||J(r,l)};var p=t?function(t,r,n,i,a){e.hasProperty(t,"excludes")&&a.push(e.createCompilerDiagnostic(e.Diagnostics.Unknown_option_excludes_Did_you_mean_exclude));var o,s=le(t.compilerOptions,n,a,i),c=_e(t.typeAcquisition||t.typingOptions,n,a,i),l=function(e,t,r){return de(R(),e,t,void 0,M,r)}(t.watchOptions,n,a);if(t.compileOnSave=function(t,r,n){if(!e.hasProperty(t,e.compileOnSaveCommandLineOption.name))return !1;var i=pe(e.compileOnSaveCommandLineOption,t.compileOnSave,r,n);return "boolean"==typeof i&&i}(t,n,a),t.extends)if(e.isString(t.extends)){var u=i?te(i,n):n;o=se(t.extends,r,u,a,e.createCompilerDiagnostic);}else a.push(e.createCompilerDiagnostic(e.Diagnostics.Compiler_option_0_requires_a_value_of_type_1,"extends","string"));return {raw:t,options:s,watchOptions:l,typeAcquisition:c,extendedConfigPath:o}}(t,i,a,s,l):function(t,r,n,i,a){var s,c,l,u,_,d=ce(i),p={onSetValidOptionKeyValueInParent:function(t,r,a){var o;switch(t){case"compilerOptions":o=d;break;case"watchOptions":o=l||(l={});break;case"typeAcquisition":o=s||(s=ue(i));break;case"typingOptions":o=c||(c=ue(i));break;default:e.Debug.fail("Unknown option");}o[r.name]=fe(r,n,a);},onSetValidOptionKeyValueInRoot:function(o,s,c,l){switch(o){case"extends":var _=i?te(i,n):n;return void(u=se(c,r,_,a,(function(r,n){return e.createDiagnosticForNodeInSourceFile(t,l,r,n)})))}},onSetUnknownOptionKeyValueInRoot:function(r,n,i,s){"excludes"===r&&a.push(e.createDiagnosticForNodeInSourceFile(t,n,e.Diagnostics.Unknown_option_excludes_Did_you_mean_exclude)),e.find(o,(function(e){return e.name===r}))&&(_=e.append(_,n));}},f=j(t,a,!0,p);return s||(s=c?void 0!==c.enableAutoDiscovery?{enable:c.enableAutoDiscovery,include:c.include,exclude:c.exclude}:c:ue(i)),_&&f&&void 0===f.compilerOptions&&a.push(e.createDiagnosticForNodeInSourceFile(t,_[0],e.Diagnostics._0_should_be_set_inside_the_compilerOptions_object_of_the_config_json_file,e.getTextOfPropertyName(_[0]))),{raw:f,options:d,watchOptions:l,typeAcquisition:s,extendedConfigPath:u}}(r,i,a,s,l);if((null===(_=p.options)||void 0===_?void 0:_.paths)&&(p.options.pathsBasePath=a),p.extendedConfigPath){c=c.concat([d]);var f=function(t,r,n,i,a,o){var s,c,l,u,_=n.useCaseSensitiveFileNames?r:e.toFileNameLowerCase(r);if(o&&(c=o.get(_))?(l=c.extendedResult,u=c.extendedConfig):((l=C(r,(function(e){return n.readFile(e)}))).parseDiagnostics.length||(u=oe(void 0,l,n,e.getDirectoryPath(r),e.getBaseFileName(r),i,a,o)),o&&o.set(_,{extendedResult:l,extendedConfig:u})),t&&(t.extendedSourceFiles=[l.fileName],l.extendedSourceFiles&&(s=t.extendedSourceFiles).push.apply(s,l.extendedSourceFiles)),!l.parseDiagnostics.length)return u;a.push.apply(a,l.parseDiagnostics);}(r,p.extendedConfigPath,i,c,l,u);if(f&&f.options){var g,m=f.raw,y=p.raw,v=function(t){!y[t]&&m[t]&&(y[t]=e.map(m[t],(function(t){return e.isRootedDiskPath(t)?t:e.combinePaths(g||(g=e.convertToRelativePath(e.getDirectoryPath(p.extendedConfigPath),a,e.createGetCanonicalFileName(i.useCaseSensitiveFileNames))),t)})));};v("include"),v("exclude"),v("files"),void 0===y.compileOnSave&&(y.compileOnSave=m.compileOnSave),p.options=e.assign({},f.options,p.options),p.watchOptions=p.watchOptions&&f.watchOptions?e.assign({},f.watchOptions,p.watchOptions):p.watchOptions||f.watchOptions;}}return p}function se(t,r,n,i,a){if(t=e.normalizeSlashes(t),e.isRootedDiskPath(t)||e.startsWith(t,"./")||e.startsWith(t,"../")){var o=e.getNormalizedAbsolutePath(t,n);return r.fileExists(o)||e.endsWith(o,".json")||(o="".concat(o,".json"),r.fileExists(o))?o:void i.push(a(e.Diagnostics.File_0_not_found,t))}var s=e.nodeModuleNameResolver(t,e.combinePaths(n,"tsconfig.json"),{moduleResolution:e.ModuleResolutionKind.NodeJs},r,void 0,void 0,!0);if(s.resolvedModule)return s.resolvedModule.resolvedFileName;i.push(a(e.Diagnostics.File_0_not_found,t));}function ce(t){return t&&"jsconfig.json"===e.getBaseFileName(t)?{allowJs:!0,maxNodeModuleJsDepth:2,allowSyntheticDefaultImports:!0,skipLibCheck:!0,noEmit:!0}:{}}function le(t,r,n,i){var a=ce(i);return de(L(),t,r,a,e.compilerOptionsDidYouMeanDiagnostics,n),i&&(a.configFilePath=e.normalizeSlashes(i)),a}function ue(t){return {enable:!!t&&"jsconfig.json"===e.getBaseFileName(t),include:[],exclude:[]}}function _e(e,t,r,n){var i=ue(n),a=_(e);return de(B(),a,t,i,F,r),i}function de(t,r,n,i,a,o){if(r){for(var s in r){var c=t.get(s);c?(i||(i={}))[c.name]=pe(c,r[s],n,o):o.push(y(s,a,e.createCompilerDiagnostic));}return i}}function pe(t,r,n,i){if(K(t,r)){var a=t.type;if("list"===a&&e.isArray(r))return function(t,r,n,i){return e.filter(e.map(r,(function(e){return pe(t.element,e,n,i)})),(function(e){return !!e}))}(t,r,n,i);if(!e.isString(a))return ye(t,r,i);var o=me(t,r,i);return ee(o)?o:ge(t,n,o)}i.push(e.createCompilerDiagnostic(e.Diagnostics.Compiler_option_0_requires_a_value_of_type_1,t.name,U(t)));}function fe(t,r,n){if(!ee(n)){if("list"===t.type){var i=t;return i.element.isFilePath||!e.isString(i.element.type)?e.filter(e.map(n,(function(e){return fe(i.element,r,e)})),(function(e){return !!e})):n}return e.isString(t.type)?ge(t,r,n):t.type.get(e.isString(n)?n.toLowerCase():n)}}function ge(t,r,n){return t.isFilePath&&""===(n=e.getNormalizedAbsolutePath(n,r))&&(n="."),n}function me(t,r,n){var i;if(!ee(r)){var a=null===(i=t.extraValidation)||void 0===i?void 0:i.call(t,r);if(!a)return r;n.push(e.createCompilerDiagnostic.apply(void 0,a));}}function ye(e,t,r){if(!ee(t)){var n=t.toLowerCase(),i=e.type.get(n);if(void 0!==i)return me(e,i,r);r.push(d(e));}}e.convertToObject=J,e.convertToObjectWorker=z,e.convertToTSConfig=function(t,r,n){var a,o,s,c=e.createGetCanonicalFileName(n.useCaseSensitiveFileNames),l=e.map(e.filter(t.fileNames,(null===(o=null===(a=t.options.configFile)||void 0===a?void 0:a.configFileSpecs)||void 0===o?void 0:o.validatedIncludeSpecs)?function(t,r,n,i){if(!r)return e.returnTrue;var a=e.getFileMatcherPatterns(t,n,r,i.useCaseSensitiveFileNames,i.getCurrentDirectory()),o=a.excludePattern&&e.getRegexFromPattern(a.excludePattern,i.useCaseSensitiveFileNames),s=a.includeFilePattern&&e.getRegexFromPattern(a.includeFilePattern,i.useCaseSensitiveFileNames);return s?o?function(e){return !(s.test(e)&&!o.test(e))}:function(e){return !s.test(e)}:o?function(e){return o.test(e)}:e.returnTrue}(r,t.options.configFile.configFileSpecs.validatedIncludeSpecs,t.options.configFile.configFileSpecs.validatedExcludeSpecs,n):e.returnTrue),(function(t){return e.getRelativePathFromFile(e.getNormalizedAbsolutePath(r,n.getCurrentDirectory()),e.getNormalizedAbsolutePath(t,n.getCurrentDirectory()),c)})),u=G(t.options,{configFilePath:e.getNormalizedAbsolutePath(r,n.getCurrentDirectory()),useCaseSensitiveFileNames:n.useCaseSensitiveFileNames}),_=t.watchOptions&&Q(t.watchOptions,A());return i$1(i$1({compilerOptions:i$1(i$1({},V(u)),{showConfig:void 0,configFile:void 0,configFilePath:void 0,help:void 0,init:void 0,listFiles:void 0,listEmittedFiles:void 0,project:void 0,build:void 0,version:void 0}),watchOptions:_&&V(_),references:e.map(t.projectReferences,(function(e){return i$1(i$1({},e),{path:e.originalPath?e.originalPath:"",originalPath:void 0})})),files:e.length(l)?l:void 0},(null===(s=t.options.configFile)||void 0===s?void 0:s.configFileSpecs)?{include:q(t.options.configFile.configFileSpecs.validatedIncludeSpecs),exclude:t.options.configFile.configFileSpecs.validatedExcludeSpecs}:{}),{compileOnSave:!!t.compileOnSave||void 0})},e.getCompilerOptionsDiffValue=function(t,r){var n,i,a=X(t);return n=[],i=Array(3).join(" "),o.forEach((function(t){if(a.has(t.name)){var r=a.get(t.name),o=Ne(t);r!==o?n.push("".concat(i).concat(t.name,": ").concat(r)):e.hasProperty(e.defaultInitCompilerOptions,t.name)&&n.push("".concat(i).concat(t.name,": ").concat(o));}})),n.join(r)+r},e.generateTSConfig=function(t,r,n){var i=X(t);return function(){for(var t=e.createMultiMap(),s=0,c=e.optionDeclarations;s<c.length;s++){var l=c[s],u=l.category;o(l)&&t.add(e.getLocaleSpecificMessage(u),l);}var _=0,d=0,p=[];t.forEach((function(t,r){0!==p.length&&p.push({value:""}),p.push({value:"/* ".concat(r," */")});for(var n=0,a=t;n<a.length;n++){var o,s=a[n];o=i.has(s.name)?'"'.concat(s.name,'": ').concat(JSON.stringify(i.get(s.name))).concat((d+=1)===i.size?"":","):'// "'.concat(s.name,'": ').concat(JSON.stringify(Ne(s)),","),p.push({value:o,description:"/* ".concat(s.description&&e.getLocaleSpecificMessage(s.description)||s.name," */")}),_=Math.max(o.length,_);}}));var f=a(2),g=[];g.push("{"),g.push("".concat(f,'"compilerOptions": {')),g.push("".concat(f).concat(f,"/* ").concat(e.getLocaleSpecificMessage(e.Diagnostics.Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_json_to_read_more_about_this_file)," */")),g.push("");for(var m=0,y=p;m<y.length;m++){var v=y[m],h=v.value,b=v.description,x=void 0===b?"":b;g.push(h&&"".concat(f).concat(f).concat(h).concat(x&&a(_-h.length+2)+x));}if(r.length){g.push("".concat(f,"},")),g.push("".concat(f,'"files": ['));for(var D=0;D<r.length;D++)g.push("".concat(f).concat(f).concat(JSON.stringify(r[D])).concat(D===r.length-1?"":","));g.push("".concat(f,"]"));}else g.push("".concat(f,"}"));return g.push("}"),g.join(n)+n}();function a(e){return Array(e+1).join(" ")}function o(t){var r=t.category,n=t.name,a=t.isCommandLineOnly,o=[e.Diagnostics.Command_line_Options,e.Diagnostics.Editor_Support,e.Diagnostics.Compiler_Diagnostics,e.Diagnostics.Backwards_Compatibility,e.Diagnostics.Watch_and_Build_Modes,e.Diagnostics.Output_Formatting];return !a&&void 0!==r&&(!o.includes(r)||i.has(n))}},e.convertToOptionsWithAbsolutePaths=function(t,r){var n={},i=c().optionsNameMap;for(var a in t)e.hasProperty(t,a)&&(n[a]=Y(i.get(a.toLowerCase()),t[a],r));return n.configFilePath&&(n.configFilePath=r(n.configFilePath)),n},e.parseJsonConfigFileContent=function(e,t,r,n,i,a,o,s,c){return re(e,void 0,t,r,n,c,i,a,o,s)},e.parseJsonSourceFileConfigFileContent=Z,e.setConfigFileInOptions=$,e.canJsonReportNoInputFiles=ae,e.updateErrorForNoInputFiles=function(t,r,n,i,a){var o=i.length;return ie(t,a)?i.push(ne(n,r)):e.filterMutate(i,(function(t){return !function(t){return t.code===e.Diagnostics.No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2.code}(t)})),o!==i.length},e.convertCompilerOptionsFromJson=function(e,t,r){var n=[];return {options:le(e,t,n,r),errors:n}},e.convertTypeAcquisitionFromJson=function(e,t,r){var n=[];return {options:_e(e,t,n,r),errors:n}},e.convertJsonOption=pe;var ve=/(^|\/)\*\*\/?$/,he=/^[^*?]*(?=\/[^/]*[*?])/;function be(t,r,n,i,a){void 0===a&&(a=e.emptyArray),r=e.normalizePath(r);var o,s=e.createGetCanonicalFileName(i.useCaseSensitiveFileNames),c=new e.Map,l=new e.Map,u=new e.Map,_=t.validatedFilesSpec,d=t.validatedIncludeSpecs,p=t.validatedExcludeSpecs,f=e.getSupportedExtensions(n,a),g=e.getSupportedExtensionsWithJsonIfResolveJsonModule(n,f);if(_)for(var m=0,y=_;m<y.length;m++){var v=y[m],h=e.getNormalizedAbsolutePath(v,r);c.set(s(h),h);}if(d&&d.length>0)for(var b=function(t){if(e.fileExtensionIs(t,".json")){if(!o){var n=d.filter((function(t){return e.endsWith(t,".json")})),a=e.map(e.getRegularExpressionsForWildcards(n,r,"files"),(function(e){return "^".concat(e,"$")}));o=a?a.map((function(t){return e.getRegexFromPattern(t,i.useCaseSensitiveFileNames)})):e.emptyArray;}if(-1!==e.findIndex(o,(function(e){return e.test(t)}))){var _=s(t);c.has(_)||u.has(_)||u.set(_,t);}return "continue"}if(function(t,r,n,i,a){var o=e.forEach(i,(function(r){return e.fileExtensionIsOneOf(t,r)?r:void 0}));if(!o)return !1;for(var s=0,c=o;s<c.length;s++){var l=c[s];if(e.fileExtensionIs(t,l))return !1;var u=a(e.changeExtension(t,l));if(r.has(u)||n.has(u)){if(".d.ts"===l&&(e.fileExtensionIs(t,".js")||e.fileExtensionIs(t,".jsx")))continue;return !0}}return !1}(t,c,l,f,s))return "continue";!function(t,r,n,i){var a=e.forEach(n,(function(r){return e.fileExtensionIsOneOf(t,r)?r:void 0}));if(a)for(var o=a.length-1;o>=0;o--){var s=a[o];if(e.fileExtensionIs(t,s))return;var c=i(e.changeExtension(t,s));r.delete(c);}}(t,l,f,s);var p=s(t);c.has(p)||l.has(p)||l.set(p,t);},x=0,D=i.readDirectory(r,e.flatten(g),p,d,void 0);x<D.length;x++)b(h=D[x]);var S=e.arrayFrom(c.values()),T=e.arrayFrom(l.values());return S.concat(T,e.arrayFrom(u.values()))}function xe(t){var r=e.startsWith(t,"**/")?0:t.indexOf("/**/");return -1!==r&&(e.endsWith(t,"/..")?t.length:t.lastIndexOf("/../"))>r}function De(t,r,n,i,a){var o=e.getRegularExpressionForWildcard(r,e.combinePaths(e.normalizePath(i),a),"exclude"),s=o&&e.getRegexFromPattern(o,n);return !!s&&(!!s.test(t)||!e.hasExtension(t)&&s.test(e.ensureTrailingDirectorySeparator(t)))}function Se(t,r,n,i,a){return t.filter((function(t){if(!e.isString(t))return !1;var i=Te(t,n);return void 0!==i&&r.push(o.apply(void 0,i)),void 0===i}));function o(t,r){var n=e.getTsConfigPropArrayElementValue(i,a,r);return n?e.createDiagnosticForNodeInSourceFile(i,n,t,r):e.createCompilerDiagnostic(t,r)}}function Te(t,r){return r&&ve.test(t)?[e.Diagnostics.File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0,t]:xe(t)?[e.Diagnostics.File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0,t]:void 0}function Ce(t,r,n){var i=t.validatedIncludeSpecs,a=t.validatedExcludeSpecs,o=e.getRegularExpressionForWildcard(a,r,"exclude"),s=o&&new RegExp(o,n?"":"i"),c={};if(void 0!==i){for(var l=[],u=0,_=i;u<_.length;u++){var d=_[u],p=e.normalizePath(e.combinePaths(r,d));if(!s||!s.test(p)){var f=Ee(p,n);if(f){var g=f.key,m=f.flags,y=c[g];(void 0===y||y<m)&&(c[g]=m,1===m&&l.push(g));}}}for(var g in c)if(e.hasProperty(c,g))for(var v=0,h=l;v<h.length;v++){var b=h[v];g!==b&&e.containsPath(b,g,r,!n)&&delete c[g];}}return c}function Ee(t,r){var n=he.exec(t);if(n){var i=t.indexOf("?"),a=t.indexOf("*"),o=t.lastIndexOf(e.directorySeparator);return {key:r?n[0]:e.toFileNameLowerCase(n[0]),flags:-1!==i&&i<o||-1!==a&&a<o?1:0}}if(e.isImplicitGlob(t))return {key:r?t:e.toFileNameLowerCase(t),flags:1}}function ke(t,r){switch(r.type){case"object":case"string":return "";case"number":return "number"==typeof t?t:"";case"boolean":return "boolean"==typeof t?t:"";case"list":var n=r.element;return e.isArray(t)?t.map((function(e){return ke(e,n)})):"";default:return e.forEachEntry(r.type,(function(e,r){if(e===t)return r}))}}function Ne(t){switch(t.type){case"number":return 1;case"boolean":return !0;case"string":return t.isFilePath?"./":"";case"list":return [];case"object":return {};default:var r=t.type.keys().next();return r.done?e.Debug.fail("Expected 'option.type' to have entries."):r.value}}e.getFileNamesFromConfigSpecs=be,e.isExcludedFile=function(t,r,n,i,a){var o=r.validatedFilesSpec,s=r.validatedIncludeSpecs,c=r.validatedExcludeSpecs;if(!e.length(s)||!e.length(c))return !1;n=e.normalizePath(n);var l=e.createGetCanonicalFileName(i);if(o)for(var u=0,_=o;u<_.length;u++){var d=_[u];if(l(e.getNormalizedAbsolutePath(d,n))===t)return !1}return De(t,c,i,a,n)},e.matchesExclude=function(t,r,n,i){return De(t,e.filter(r,(function(e){return !xe(e)})),n,i)},e.convertCompilerOptionsForTelemetry=function(e){var t={};for(var r in e)if(e.hasOwnProperty(r)){var n=b(r);void 0!==n&&(t[r]=ke(e[r],n));}return t};}(t),function(e){function t(t){t.trace(e.formatMessage.apply(void 0,arguments));}function r(e,t){return !!e.traceResolution&&void 0!==t.trace}function a(t,r){var n;if(r&&t){var i=t.packageJsonContent;"string"==typeof i.name&&"string"==typeof i.version&&(n={name:i.name,subModuleName:r.path.slice(t.packageDirectory.length+e.directorySeparator.length),version:i.version});}return r&&{path:r.path,extension:r.ext,packageId:n}}function o(e){return a(void 0,e)}function s(t){if(t)return e.Debug.assert(void 0===t.packageId),{path:t.path,ext:t.extension}}var c,l;function u(t){if(t)return e.Debug.assert(e.extensionIsTS(t.extension)),{fileName:t.path,packageId:t.packageId}}function _(e,t,r,n){var i;return n?((i=n.failedLookupLocations).push.apply(i,r),n):{resolvedModule:e&&{resolvedFileName:e.path,originalPath:!0===e.originalPath?void 0:e.originalPath,extension:e.extension,isExternalLibraryImport:t,packageId:e.packageId},failedLookupLocations:r}}function d(r,n,i,a){if(e.hasProperty(r,n)){var o=r[n];if(typeof o===i&&null!==o)return o;a.traceEnabled&&t(a.host,e.Diagnostics.Expected_type_of_0_field_in_package_json_to_be_1_got_2,n,i,null===o?"null":typeof o);}else a.traceEnabled&&t(a.host,e.Diagnostics.package_json_does_not_have_a_0_field,n);}function p(r,n,i,a){var o=d(r,n,"string",a);if(void 0!==o){if(o){var s=e.normalizePath(e.combinePaths(i,o));return a.traceEnabled&&t(a.host,e.Diagnostics.package_json_has_0_field_1_that_references_2,n,o,s),s}a.traceEnabled&&t(a.host,e.Diagnostics.package_json_had_a_falsy_0_field,n);}}function f(e,t,r){return p(e,"typings",t,r)||p(e,"types",t,r)}function g(e,t,r){return p(e,"main",t,r)}function m(r,n){var i=function(r,n){var i=d(r,"typesVersions","object",n);if(void 0!==i)return n.traceEnabled&&t(n.host,e.Diagnostics.package_json_has_a_typesVersions_field_with_version_specific_path_mappings),i}(r,n);if(void 0!==i){if(n.traceEnabled)for(var a in i)e.hasProperty(i,a)&&!e.VersionRange.tryParse(a)&&t(n.host,e.Diagnostics.package_json_has_a_typesVersions_entry_0_that_is_not_a_valid_semver_range,a);var o=y(i);if(o){var s=o.version,c=o.paths;if("object"==typeof c)return o;n.traceEnabled&&t(n.host,e.Diagnostics.Expected_type_of_0_field_in_package_json_to_be_1_got_2,"typesVersions['".concat(s,"']"),"object",typeof c);}else n.traceEnabled&&t(n.host,e.Diagnostics.package_json_does_not_have_a_typesVersions_entry_that_matches_version_0,e.versionMajorMinor);}}function y(t){for(var r in l||(l=new e.Version(e.version)),t)if(e.hasProperty(t,r)){var n=e.VersionRange.tryParse(r);if(void 0!==n&&n.test(l))return {version:r,paths:t[r]}}}function v(t,r){return t.typeRoots?t.typeRoots:(t.configFilePath?n=e.getDirectoryPath(t.configFilePath):r.getCurrentDirectory&&(n=r.getCurrentDirectory()),void 0!==n?function(t,r){return r.directoryExists?(e.forEachAncestorDirectory(e.normalizePath(t),(function(t){var i=e.combinePaths(t,b);r.directoryExists(i)&&(n||(n=[])).push(i);})),n):[e.combinePaths(t,b)];var n;}(n,r):void 0);var n;}e.trace=t,e.isTraceEnabled=r,function(e){e[e.TypeScript=0]="TypeScript",e[e.JavaScript=1]="JavaScript",e[e.Json=2]="Json",e[e.TSConfig=3]="TSConfig",e[e.DtsOnly=4]="DtsOnly";}(c||(c={})),e.getPackageJsonTypesVersionsPaths=y,e.getEffectiveTypeRoots=v;var h,b=e.combinePaths("node_modules","@types");function x(t,r,n){var i="function"==typeof n.useCaseSensitiveFileNames?n.useCaseSensitiveFileNames():n.useCaseSensitiveFileNames;return 0===e.comparePaths(t,r,!i)}function D(t){var r=new e.Map,n=new e.Map;return {getOwnMap:function(){return r},redirectsMap:n,getOrCreateMapOfCacheRedirects:function(i){if(!i)return r;var a=i.sourceFile.path,o=n.get(a);return o||(o=!t||e.optionsHaveModuleResolutionChanges(t,i.commandLine.options)?new e.Map:r,n.set(a,o)),o},clear:function(){r.clear(),n.clear();},setOwnOptions:function(e){t=e;},setOwnMap:function(e){r=e;}}}function S(t,r){var n;return {getPackageJsonInfo:function(i){return null==n?void 0:n.get(e.toPath(i,t,r))},setPackageJsonInfo:function(i,a){(n||(n=new e.Map)).set(e.toPath(i,t,r),a);},clear:function(){n=void 0;},entries:function(){var t=null==n?void 0:n.entries();return t?e.arrayFrom(t):[]}}}function T(e,t,r,n){var i=e.getOrCreateMapOfCacheRedirects(t),a=i.get(r);return a||(a=n(),i.set(r,a)),a}function C(t,r,n){if(t.configFile){if(0===r.redirectsMap.size)e.Debug.assert(!n||0===n.redirectsMap.size),e.Debug.assert(0===r.getOwnMap().size),e.Debug.assert(!n||0===n.getOwnMap().size),r.redirectsMap.set(t.configFile.path,r.getOwnMap()),null==n||n.redirectsMap.set(t.configFile.path,n.getOwnMap());else {e.Debug.assert(!n||n.redirectsMap.size>0);var i={sourceFile:t.configFile,commandLine:{options:t}};r.setOwnMap(r.getOrCreateMapOfCacheRedirects(i)),null==n||n.setOwnMap(n.getOrCreateMapOfCacheRedirects(i));}r.setOwnOptions(t),null==n||n.setOwnOptions(t);}}function E(t,r,n){return {getOrCreateCacheForDirectory:function(i,a){var o=e.toPath(i,t,r);return T(n,a,o,(function(){return k()}))},clear:function(){n.clear();},update:function(e){C(e,n);}}}function k(){var t=new e.Map,r=new e.Map,n={get:function(e,r){return t.get(i(e,r))},set:function(e,r,a){return t.set(i(e,r),a),n},delete:function(e,r){return t.delete(i(e,r)),n},has:function(e,r){return t.has(i(e,r))},forEach:function(e){return t.forEach((function(t,n){var i=r.get(n),a=i[0],o=i[1];return e(t,a,o)}))},size:function(){return t.size}};return n;function i(e,t){var n=void 0===t?e:"".concat(t,"|").concat(e);return r.set(n,[e,t]),n}}function N(r,n,i,a,o){var s=function(r,n,i,a){var o,s=a.compilerOptions,c=s.baseUrl,l=s.paths,u=s.configFile;if(l&&!e.pathIsRelative(n))return a.traceEnabled&&(c&&t(a.host,e.Diagnostics.baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1,c,n),t(a.host,e.Diagnostics.paths_option_is_specified_looking_for_a_pattern_to_match_module_name_0,n)),se(r,n,e.getPathsBasePath(a.compilerOptions,a.host),l,(null==u?void 0:u.configFileSpecs)?(o=u.configFileSpecs).pathPatterns||(o.pathPatterns=e.tryParsePatterns(l)):void 0,i,!1,a)}(r,n,a,o);return s?s.value:e.isExternalModuleNameRelative(n)?function(r,n,i,a,o){if(o.compilerOptions.rootDirs){o.traceEnabled&&t(o.host,e.Diagnostics.rootDirs_option_is_set_using_it_to_resolve_relative_module_name_0,n);for(var s,c,l=e.normalizePath(e.combinePaths(i,n)),u=0,_=o.compilerOptions.rootDirs;u<_.length;u++){var d=_[u],p=e.normalizePath(d);e.endsWith(p,e.directorySeparator)||(p+=e.directorySeparator);var f=e.startsWith(l,p)&&(void 0===c||c.length<p.length);o.traceEnabled&&t(o.host,e.Diagnostics.Checking_if_0_is_the_longest_matching_prefix_for_1_2,p,l,f),f&&(c=p,s=d);}if(c){o.traceEnabled&&t(o.host,e.Diagnostics.Longest_matching_prefix_for_0_is_1,l,c);var g=l.substr(c.length);o.traceEnabled&&t(o.host,e.Diagnostics.Loading_0_from_the_root_dir_1_candidate_location_2,g,c,l);var m=a(r,l,!e.directoryProbablyExists(i,o.host),o);if(m)return m;o.traceEnabled&&t(o.host,e.Diagnostics.Trying_other_entries_in_rootDirs);for(var y=0,v=o.compilerOptions.rootDirs;y<v.length;y++)if((d=v[y])!==s){var h=e.combinePaths(e.normalizePath(d),g);o.traceEnabled&&t(o.host,e.Diagnostics.Loading_0_from_the_root_dir_1_candidate_location_2,g,d,h);var b=e.getDirectoryPath(h),x=a(r,h,!e.directoryProbablyExists(b,o.host),o);if(x)return x}o.traceEnabled&&t(o.host,e.Diagnostics.Module_resolution_using_rootDirs_has_failed);}}}(r,n,i,a,o):function(r,n,i,a){var o=a.compilerOptions.baseUrl;if(o){a.traceEnabled&&t(a.host,e.Diagnostics.baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1,o,n);var s=e.normalizePath(e.combinePaths(o,n));return a.traceEnabled&&t(a.host,e.Diagnostics.Resolving_module_name_0_relative_to_base_url_1_2,n,o,s),i(r,s,!e.directoryProbablyExists(e.getDirectoryPath(s),a.host),a)}}(r,n,a,o)}function F(t,r,n,i,a,o,s,c){var l=e.getDirectoryPath(n);return L(t|(c===e.ModuleKind.ESNext?h.EsmMode:0),r,l,i,a,o,i.resolveJsonModule?w:P,s)}e.resolveTypeReferenceDirective=function(n,i,a,o,s,l){var _=r(a,o);s&&(a=s.commandLine.options);var d=i?e.getDirectoryPath(i):void 0,p=d?l&&l.getOrCreateCacheForDirectory(d,s):void 0,f=p&&p.get(n,void 0);if(f)return _&&(t(o,e.Diagnostics.Resolving_type_reference_directive_0_containing_file_1,n,i),s&&t(o,e.Diagnostics.Using_compiler_options_of_project_reference_redirect_0,s.sourceFile.fileName),t(o,e.Diagnostics.Resolution_for_type_reference_directive_0_was_found_in_cache_from_location_1,n,d),N(f)),f;var g=v(a,o);_&&(void 0===i?void 0===g?t(o,e.Diagnostics.Resolving_type_reference_directive_0_containing_file_not_set_root_directory_not_set,n):t(o,e.Diagnostics.Resolving_type_reference_directive_0_containing_file_not_set_root_directory_1,n,g):void 0===g?t(o,e.Diagnostics.Resolving_type_reference_directive_0_containing_file_1_root_directory_not_set,n,i):t(o,e.Diagnostics.Resolving_type_reference_directive_0_containing_file_1_root_directory_2,n,i,g),s&&t(o,e.Diagnostics.Using_compiler_options_of_project_reference_redirect_0,s.sourceFile.fileName));var m,y=[],b=e.getEmitModuleResolutionKind(a)===e.ModuleResolutionKind.Node12?h.Node12Default:e.getEmitModuleResolutionKind(a)===e.ModuleResolutionKind.NodeNext?h.NodeNextDefault:h.None,D={compilerOptions:a,host:o,traceEnabled:_,failedLookupLocations:y,packageJsonInfoCache:l,features:b,conditions:["node","require","types"]},S=function(){if(g&&g.length)return _&&t(o,e.Diagnostics.Resolving_with_primary_search_path_0,g.join(", ")),e.firstDefined(g,(function(r){var i=e.combinePaths(r,n),a=e.getDirectoryPath(i),s=e.directoryProbablyExists(a,o);return !s&&_&&t(o,e.Diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it,a),u(H(c.DtsOnly,i,!s,D))}));_&&t(o,e.Diagnostics.Root_directory_cannot_be_determined_skipping_primary_search_paths);}(),T=!0;if(S||(S=function(){var r=i&&e.getDirectoryPath(i);if(void 0!==r){var a;if(_&&t(o,e.Diagnostics.Looking_up_in_node_modules_folder_initial_location_0,r),e.isExternalModuleNameRelative(n)){var s=e.normalizePathAndParts(e.combinePaths(r,n)).path;a=B(c.DtsOnly,s,!1,D,!0);}else {var l=ne(c.DtsOnly,n,r,D,void 0,void 0);a=l&&l.value;}return u(a)}_&&t(o,e.Diagnostics.Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_modules_folder);}(),T=!1),S){var C=S.fileName,E=S.packageId,k=a.preserveSymlinks?C:R(C,o,_);m={primary:T,resolvedFileName:k,originalPath:x(C,k,o)?void 0:C,packageId:E,isExternalLibraryImport:j(C)};}return f={resolvedTypeReferenceDirective:m,failedLookupLocations:y},null==p||p.set(n,void 0,f),_&&N(f),f;function N(r){var i;(null===(i=r.resolvedTypeReferenceDirective)||void 0===i?void 0:i.resolvedFileName)?r.resolvedTypeReferenceDirective.packageId?t(o,e.Diagnostics.Type_reference_directive_0_was_successfully_resolved_to_1_with_Package_ID_2_primary_Colon_3,n,r.resolvedTypeReferenceDirective.resolvedFileName,e.packageIdToString(r.resolvedTypeReferenceDirective.packageId),r.resolvedTypeReferenceDirective.primary):t(o,e.Diagnostics.Type_reference_directive_0_was_successfully_resolved_to_1_primary_Colon_2,n,r.resolvedTypeReferenceDirective.resolvedFileName,r.resolvedTypeReferenceDirective.primary):t(o,e.Diagnostics.Type_reference_directive_0_was_not_resolved,n);}},e.getAutomaticTypeDirectiveNames=function(t,r){if(t.types)return t.types;var n=[];if(r.directoryExists&&r.getDirectories){var i=v(t,r);if(i)for(var a=0,o=i;a<o.length;a++){var s=o[a];if(r.directoryExists(s))for(var c=0,l=r.getDirectories(s);c<l.length;c++){var u=l[c],_=e.normalizePath(u),d=e.combinePaths(s,_,"package.json");if(!r.fileExists(d)||null!==e.readJson(d,r).typings){var p=e.getBaseFileName(_);46!==p.charCodeAt(0)&&n.push(p);}}}}return n},e.createCacheWithRedirects=D,e.createModeAwareCache=k,e.zipToModeAwareCache=function(t,r,n){e.Debug.assert(r.length===n.length);for(var i=k(),a=0;a<r.length;++a)i.set(r[a],e.getModeForResolutionAtIndex(t,a),n[a]);return i},e.createModuleResolutionCache=function(t,r,n,a,o){var s=E(t,r,a||(a=D(n)));o||(o=D(n));var c=S(t,r);return i$1(i$1(i$1({},c),s),{getOrCreateCacheForModuleName:function(t,r,n){return e.Debug.assert(!e.isExternalModuleNameRelative(t)),T(o,n,void 0===r?t:"".concat(r,"|").concat(t),l)},clear:function(){s.clear(),o.clear(),c.clear();},update:function(e){C(e,a,o);},getPackageJsonInfoCache:function(){return c}});function l(){var n=new e.Map;return {get:function(i){return n.get(e.toPath(i,t,r))},set:function(i,a){var o=e.toPath(i,t,r);if(!n.has(o)){n.set(o,a);for(var s=a.resolvedModule&&(a.resolvedModule.originalPath||a.resolvedModule.resolvedFileName),c=s&&function(n,i){for(var a=e.toPath(e.getDirectoryPath(i),t,r),o=0,s=Math.min(n.length,a.length);o<s&&n.charCodeAt(o)===a.charCodeAt(o);)o++;if(o===n.length&&(a.length===o||a[o]===e.directorySeparator))return n;var c=e.getRootLength(n);if(!(o<c)){var l=n.lastIndexOf(e.directorySeparator,o-1);if(-1!==l)return n.substr(0,Math.max(l,c))}}(o,s),l=o;l!==c;){var u=e.getDirectoryPath(l);if(u===l||n.has(u))break;n.set(u,a),l=u;}}}}}},e.createTypeReferenceDirectiveResolutionCache=function(e,t,r,n,a){var o=E(e,t,a||(a=D(r)));return n||(n=S(e,t)),i$1(i$1(i$1({},n),o),{clear:function(){o.clear(),n.clear();}})},e.resolveModuleNameFromCache=function(t,r,n,i){var a=e.getDirectoryPath(r),o=n&&n.getOrCreateCacheForDirectory(a);if(o)return o.get(t,i)},e.resolveModuleName=function(n,i,a,o,s,c,l){var u=r(a,o);c&&(a=c.commandLine.options),u&&(t(o,e.Diagnostics.Resolving_module_0_from_1,n,i),c&&t(o,e.Diagnostics.Using_compiler_options_of_project_reference_redirect_0,c.sourceFile.fileName));var _=e.getDirectoryPath(i),d=s&&s.getOrCreateCacheForDirectory(_,c),p=d&&d.get(n,l);if(p)u&&t(o,e.Diagnostics.Resolution_for_module_0_was_found_in_cache_from_location_1,n,_);else {var f=a.moduleResolution;if(void 0===f){switch(e.getEmitModuleKind(a)){case e.ModuleKind.CommonJS:f=e.ModuleResolutionKind.NodeJs;break;case e.ModuleKind.Node12:f=e.ModuleResolutionKind.Node12;break;case e.ModuleKind.NodeNext:f=e.ModuleResolutionKind.NodeNext;break;default:f=e.ModuleResolutionKind.Classic;}u&&t(o,e.Diagnostics.Module_resolution_kind_is_not_specified_using_0,e.ModuleResolutionKind[f]);}else u&&t(o,e.Diagnostics.Explicitly_specified_module_resolution_kind_Colon_0,e.ModuleResolutionKind[f]);switch(e.perfLogger.logStartResolveModule(n),f){case e.ModuleResolutionKind.Node12:p=function(e,t,r,n,i,a,o){return F(h.Node12Default,e,t,r,n,i,a,o)}(n,i,a,o,s,c,l);break;case e.ModuleResolutionKind.NodeNext:p=function(e,t,r,n,i,a,o){return F(h.NodeNextDefault,e,t,r,n,i,a,o)}(n,i,a,o,s,c,l);break;case e.ModuleResolutionKind.NodeJs:p=M(n,i,a,o,s,c);break;case e.ModuleResolutionKind.Classic:p=de(n,i,a,o,s,c);break;default:return e.Debug.fail("Unexpected moduleResolution: ".concat(f))}p&&p.resolvedModule&&e.perfLogger.logInfoEvent('Module "'.concat(n,'" resolved to "').concat(p.resolvedModule.resolvedFileName,'"')),e.perfLogger.logStopResolveModule(p&&p.resolvedModule?""+p.resolvedModule.resolvedFileName:"null"),d&&(d.set(n,l,p),e.isExternalModuleNameRelative(n)||s.getOrCreateCacheForModuleName(n,l,c).set(_,p));}return u&&(p.resolvedModule?p.resolvedModule.packageId?t(o,e.Diagnostics.Module_name_0_was_successfully_resolved_to_1_with_Package_ID_2,n,p.resolvedModule.resolvedFileName,e.packageIdToString(p.resolvedModule.packageId)):t(o,e.Diagnostics.Module_name_0_was_successfully_resolved_to_1,n,p.resolvedModule.resolvedFileName):t(o,e.Diagnostics.Module_name_0_was_not_resolved,n)),p},e.resolveJSModule=function(e,t,r){var n=O(e,t,r),i=n.resolvedModule,a=n.failedLookupLocations;if(!i)throw new Error("Could not resolve JS module '".concat(e,"' starting at '").concat(t,"'. Looked in: ").concat(a.join(", ")));return i.resolvedFileName},e.tryResolveJSModule=function(e,t,r){return O(e,t,r).resolvedModule},function(e){e[e.None=0]="None",e[e.Imports=2]="Imports",e[e.SelfName=4]="SelfName",e[e.Exports=8]="Exports",e[e.ExportsPatternTrailers=16]="ExportsPatternTrailers",e[e.AllFeatures=30]="AllFeatures",e[e.Node12Default=14]="Node12Default",e[e.NodeNextDefault=30]="NodeNextDefault",e[e.EsmMode=32]="EsmMode";}(h||(h={}));var A=[c.JavaScript],P=[c.TypeScript,c.JavaScript],w=n$3(n$3([],P,!0),[c.Json],!1),I=[c.TSConfig];function O(t,r,n){return L(h.None,t,r,{moduleResolution:e.ModuleResolutionKind.NodeJs,allowJs:!0},n,void 0,A,void 0)}function M(t,r,n,i,a,o,s){return L(h.None,t,e.getDirectoryPath(r),n,i,a,s?I:n.resolveJsonModule?w:P,o)}function L(n,a,o,s,l,u,d,p){var f,g,m=r(s,l),y=[],v={compilerOptions:s,host:l,traceEnabled:m,failedLookupLocations:y,packageJsonInfoCache:u,features:n,conditions:n&h.EsmMode?["node","import","types"]:["node","require","types"]},b=e.forEach(d,(function(r){return function(r){var _,d=N(r,a,o,(function(e,t,r,n){return B(e,t,r,n,!0)}),v);if(d)return pe({resolved:d,isExternalLibraryImport:j(d.path)});if(e.isExternalModuleNameRelative(a)){var f=e.normalizePathAndParts(e.combinePaths(o,a)),g=f.path,y=f.parts,b=B(r,g,!1,v,!0);return b&&pe({resolved:b,isExternalLibraryImport:e.contains(y,"node_modules")})}if(n&h.Imports&&e.startsWith(a,"#")&&(_=function(r,n,i,a,o,s){var c,l;if("#"===n||e.startsWith(n,"#/"))return a.traceEnabled&&t(a.host,e.Diagnostics.Invalid_import_specifier_0_has_no_possible_resolutions,n),pe(void 0);var u="function"==typeof a.host.useCaseSensitiveFileNames?a.host.useCaseSensitiveFileNames():a.host.useCaseSensitiveFileNames,_=e.toPath(e.combinePaths(i,"dummy"),null===(l=(c=a.host).getCurrentDirectory)||void 0===l?void 0:l.call(c),e.createGetCanonicalFileName(void 0===u||u)),d=G(_,a.packageJsonInfoCache,a.host,a.compilerOptions);if(!d)return a.traceEnabled&&t(a.host,e.Diagnostics.Directory_0_has_no_containing_package_json_scope_Imports_will_not_resolve,_),pe(void 0);if(!d.packageJsonContent.imports)return a.traceEnabled&&t(a.host,e.Diagnostics.package_json_scope_0_has_no_imports_defined,d.packageDirectory),pe(void 0);var p=ee(r,a,o,s,n,d.packageJsonContent.imports,d,!0);return p||(a.traceEnabled&&t(a.host,e.Diagnostics.Import_specifier_0_does_not_exist_in_package_json_scope_at_path_1,n,d.packageDirectory),pe(void 0))}(r,a,o,v,u,p)),!_&&n&h.SelfName&&(_=function(t,r,n,i,a,o){var s,c,l="function"==typeof i.host.useCaseSensitiveFileNames?i.host.useCaseSensitiveFileNames():i.host.useCaseSensitiveFileNames,u=G(e.toPath(e.combinePaths(n,"dummy"),null===(c=(s=i.host).getCurrentDirectory)||void 0===c?void 0:c.call(s),e.createGetCanonicalFileName(void 0===l||l)),i.packageJsonInfoCache,i.host,i.compilerOptions);if(u&&u.packageJsonContent.exports&&"string"==typeof u.packageJsonContent.name){var _=e.getPathComponents(r),d=e.getPathComponents(u.packageJsonContent.name);if(e.every(d,(function(e,t){return _[t]===e}))){var p=_.slice(d.length);return $(u,t,e.length(p)?".".concat(e.directorySeparator).concat(p.join(e.directorySeparator)):".",i,a,o)}}}(r,a,o,v,u,p)),_||(m&&t(l,e.Diagnostics.Loading_module_0_from_node_modules_folder_target_file_type_1,a,c[r]),_=ne(r,a,o,v,u,p)),_){var D=_.value;if(!s.preserveSymlinks&&D&&!D.originalPath){var S=R(D.path,l,m),T=x(S,D.path,l)?void 0:D.path;D=i$1(i$1({},D),{path:S,originalPath:T});}return {value:D&&{resolved:D,isExternalLibraryImport:!0}}}}(r)}));return _(null===(f=null==b?void 0:b.value)||void 0===f?void 0:f.resolved,null===(g=null==b?void 0:b.value)||void 0===g?void 0:g.isExternalLibraryImport,y,v.resultFromCache)}function R(r,n,i){if(!n.realpath)return r;var a=e.normalizePath(n.realpath(r));return i&&t(n,e.Diagnostics.Resolving_real_path_for_0_result_1,r,a),e.Debug.assert(n.fileExists(a),"".concat(r," linked to nonexistent file ").concat(a)),a}function B(r,n,i,o,s){if(o.traceEnabled&&t(o.host,e.Diagnostics.Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_type_1,n,c[r]),!e.hasTrailingDirectorySeparator(n)){if(!i){var l=e.getDirectoryPath(n);e.directoryProbablyExists(l,o.host)||(o.traceEnabled&&t(o.host,e.Diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it,l),i=!0);}var u=K(r,n,i,o);if(u){var _=s?J(u.path):void 0;return a(_?Q(_,!1,o):void 0,u)}}return i||e.directoryProbablyExists(n,o.host)||(o.traceEnabled&&t(o.host,e.Diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it,n),i=!0),H(r,n,i,o,s)}function j(t){return e.stringContains(t,e.nodeModulesPathPart)}function J(t){var r=e.normalizePath(t),n=r.lastIndexOf(e.nodeModulesPathPart);if(-1!==n){var i=n+e.nodeModulesPathPart.length,a=z(r,i);return 64===r.charCodeAt(i)&&(a=z(r,a)),r.slice(0,a)}}function z(t,r){var n=t.indexOf(e.directorySeparator,r+1);return -1===n?r:n}function U(e,t,r,n){return o(K(e,t,r,n))}function K(t,r,n,i){if(t===c.Json||t===c.TSConfig){var a=e.tryRemoveExtension(r,".json"),o=a?r.substring(a.length):"";return void 0===a&&t===c.Json?void 0:q(a||r,t,o,n,i)}if(!(i.features&h.EsmMode)){var s=q(r,t,"",n,i);if(s)return s}return V(t,r,n,i)}function V(r,n,i,a){if(e.hasJSFileExtension(n)||e.fileExtensionIs(n,".json")&&a.compilerOptions.resolveJsonModule){var o=e.removeFileExtension(n),s=n.substring(o.length);return a.traceEnabled&&t(a.host,e.Diagnostics.File_name_0_has_a_1_extension_stripping_it,n,s),q(o,r,s,i,a)}}function q(t,r,n,i,a){if(!i){var o=e.getDirectoryPath(t);o&&(i=!e.directoryProbablyExists(o,a.host));}switch(r){case c.DtsOnly:switch(n){case".mjs":case".mts":case".d.mts":return s(".d.mts");case".cjs":case".cts":case".d.cts":return s(".d.cts");case".json":return t+=".json",s(".d.ts");default:return s(".d.ts")}case c.TypeScript:switch(n){case".mjs":case".mts":case".d.mts":return s(".mts")||s(".d.mts");case".cjs":case".cts":case".d.cts":return s(".cts")||s(".d.cts");case".json":return t+=".json",s(".d.ts");default:return s(".ts")||s(".tsx")||s(".d.ts")}case c.JavaScript:switch(n){case".mjs":case".mts":case".d.mts":return s(".mjs");case".cjs":case".cts":case".d.cts":return s(".cjs");case".json":return s(".json");default:return s(".js")||s(".jsx")}case c.TSConfig:case c.Json:return s(".json")}function s(e){var r=W(t+e,i,a);return void 0===r?void 0:{path:r,ext:e}}}function W(r,n,i){if(!n){if(i.host.fileExists(r))return i.traceEnabled&&t(i.host,e.Diagnostics.File_0_exist_use_it_as_a_name_resolution_result,r),r;i.traceEnabled&&t(i.host,e.Diagnostics.File_0_does_not_exist,r);}i.failedLookupLocations.push(r);}function H(e,t,r,n,i){void 0===i&&(i=!0);var o=i?Q(t,r,n):void 0;return a(o,X(e,t,r,n,o&&o.packageJsonContent,o&&o.versionPaths))}function G(t,n,i,a){var o={host:i,compilerOptions:a,traceEnabled:r(a,i),failedLookupLocations:[],packageJsonInfoCache:n,features:0,conditions:[]},s=e.getPathComponents(t);for(s.pop();s.length>0;){var c=Q(e.getPathFromPathComponents(s),!1,o);if(c)return c;s.pop();}}function Q(r,n,i){var a,o,s,c=i.host,l=i.traceEnabled,u=e.combinePaths(r,"package.json");if(n)i.failedLookupLocations.push(u);else {var _=null===(a=i.packageJsonInfoCache)||void 0===a?void 0:a.getPackageJsonInfo(u);if(void 0!==_)return "boolean"!=typeof _?(l&&t(c,e.Diagnostics.File_0_exists_according_to_earlier_cached_lookups,u),_):(_&&l&&t(c,e.Diagnostics.File_0_does_not_exist_according_to_earlier_cached_lookups,u),void i.failedLookupLocations.push(u));var d=e.directoryProbablyExists(r,c);if(d&&c.fileExists(u)){var p=e.readJson(u,c);l&&t(c,e.Diagnostics.Found_package_json_at_0,u);var f={packageDirectory:r,packageJsonContent:p,versionPaths:m(p,i)};return null===(o=i.packageJsonInfoCache)||void 0===o||o.setPackageJsonInfo(u,f),f}d&&l&&t(c,e.Diagnostics.File_0_does_not_exist,u),null===(s=i.packageJsonInfoCache)||void 0===s||s.setPackageJsonInfo(u,d),i.failedLookupLocations.push(u);}}function X(r,n,i,a,l,u){var _;if(l)switch(r){case c.JavaScript:case c.Json:_=g(l,n,a);break;case c.TypeScript:_=f(l,n,a)||g(l,n,a);break;case c.DtsOnly:_=f(l,n,a);break;case c.TSConfig:_=function(e,t,r){return p(e,"tsconfig",t,r)}(l,n,a);break;default:return e.Debug.assertNever(r)}var d=function(r,n,i,a){var s=W(n,i,a);if(s){var l=function(t,r){var n=e.tryGetExtensionFromPath(r);return void 0!==n&&function(e,t){switch(e){case c.JavaScript:return ".js"===t||".jsx"===t;case c.TSConfig:case c.Json:return ".json"===t;case c.TypeScript:return ".ts"===t||".tsx"===t||".d.ts"===t;case c.DtsOnly:return ".d.ts"===t}}(t,n)?{path:r,ext:n}:void 0}(r,s);if(l)return o(l);a.traceEnabled&&t(a.host,e.Diagnostics.File_0_has_an_unsupported_extension_so_skipping_it,s);}return B(r===c.DtsOnly?c.TypeScript:r,n,i,a,!1)},m=_?!e.directoryProbablyExists(e.getDirectoryPath(_),a.host):void 0,y=i||!e.directoryProbablyExists(n,a.host),v=e.combinePaths(n,r===c.TSConfig?"tsconfig":"index");if(u&&(!_||e.containsPath(n,_))){var b=e.getRelativePathFromDirectory(n,_||v,!1);a.traceEnabled&&t(a.host,e.Diagnostics.package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_match_module_name_2,u.version,e.version,b);var x=se(r,b,n,u.paths,void 0,d,m||y,a);if(x)return s(x.value)}return _&&s(d(r,_,m,a))||(a.features&h.EsmMode?void 0:K(r,v,y,a))}function Y(t){var r=t.indexOf(e.directorySeparator);return "@"===t[0]&&(r=t.indexOf(e.directorySeparator,r+1)),-1===r?{packageName:t,rest:""}:{packageName:t.slice(0,r),rest:t.slice(r+1)}}function Z(t){return e.every(e.getOwnKeys(t),(function(t){return e.startsWith(t,".")}))}function $(r,n,i,a,o,s){if(r.packageJsonContent.exports){if("."===i){var c=void 0;if("string"==typeof r.packageJsonContent.exports||Array.isArray(r.packageJsonContent.exports)||"object"==typeof r.packageJsonContent.exports&&(u=r.packageJsonContent.exports,!e.some(e.getOwnKeys(u),(function(t){return e.startsWith(t,".")})))?c=r.packageJsonContent.exports:e.hasProperty(r.packageJsonContent.exports,".")&&(c=r.packageJsonContent.exports["."]),c)return te(n,a,o,s,i,r,!1)(c,"",!1)}else if(Z(r.packageJsonContent.exports)){if("object"!=typeof r.packageJsonContent.exports)return a.traceEnabled&&t(a.host,e.Diagnostics.Export_specifier_0_does_not_exist_in_package_json_scope_at_path_1,i,r.packageDirectory),pe(void 0);var l=ee(n,a,o,s,i,r.packageJsonContent.exports,r,!1);if(l)return l}var u;return a.traceEnabled&&t(a.host,e.Diagnostics.Export_specifier_0_does_not_exist_in_package_json_scope_at_path_1,i,r.packageDirectory),pe(void 0)}}function ee(t,r,n,i,a,o,s,c){var l=te(t,r,n,i,a,s,c);if(!e.endsWith(a,e.directorySeparator)&&-1===a.indexOf("*")&&e.hasProperty(o,a))return l(p=o[a],"",!1);for(var u=0,_=e.sort(e.filter(e.getOwnKeys(o),(function(t){return -1!==t.indexOf("*")||e.endsWith(t,"/")})),(function(e,t){return e.length-t.length}));u<_.length;u++){var d=_[u];if(r.features&h.ExportsPatternTrailers&&g(d,a)){var p=o[d],f=d.indexOf("*");return l(p,a.substring(d.substring(0,f).length,a.length-(d.length-1-f)),!0)}if(e.endsWith(d,"*")&&e.startsWith(a,d.substring(0,d.length-1)))return l(p=o[d],a.substring(d.length-1),!0);if(e.startsWith(a,d))return l(p=o[d],a.substring(d.length),!1)}function g(t,r){if(e.endsWith(t,"*"))return !1;var n=t.indexOf("*");return -1!==n&&e.startsWith(r,t.substring(0,n))&&e.endsWith(r,t.substring(n+1))}}function te(r,n,i,o,s,l,u){return function _(d,p,f){var g,m;if("string"==typeof d){if(!f&&p.length>0&&!e.endsWith(d,"/"))return n.traceEnabled&&t(n.host,e.Diagnostics.package_json_scope_0_has_invalid_type_for_target_of_specifier_1,l.packageDirectory,s),pe(void 0);if(!e.startsWith(d,"./")){if(u&&!e.startsWith(d,"../")&&!e.startsWith(d,"/")&&!e.isRootedDiskPath(d)){var y=f?d.replace(/\*/g,p):d+p;return pe((k=L(n.features,y,l.packageDirectory+"/",n.compilerOptions,n.host,i,[r],o)).resolvedModule?{path:k.resolvedModule.resolvedFileName,extension:k.resolvedModule.extension,packageId:k.resolvedModule.packageId,originalPath:k.resolvedModule.originalPath}:void 0)}return n.traceEnabled&&t(n.host,e.Diagnostics.package_json_scope_0_has_invalid_type_for_target_of_specifier_1,l.packageDirectory,s),pe(void 0)}var v=(e.pathIsRelative(d)?e.getPathComponents(d).slice(1):e.getPathComponents(d)).slice(1);if(v.indexOf("..")>=0||v.indexOf(".")>=0||v.indexOf("node_modules")>=0)return n.traceEnabled&&t(n.host,e.Diagnostics.package_json_scope_0_has_invalid_type_for_target_of_specifier_1,l.packageDirectory,s),pe(void 0);var h=e.combinePaths(l.packageDirectory,d),b=e.getPathComponents(p);if(b.indexOf("..")>=0||b.indexOf(".")>=0||b.indexOf("node_modules")>=0)return n.traceEnabled&&t(n.host,e.Diagnostics.package_json_scope_0_has_invalid_type_for_target_of_specifier_1,l.packageDirectory,s),pe(void 0);var x=e.getNormalizedAbsolutePath(f?h.replace(/\*/g,p):h+p,null===(m=(g=n.host).getCurrentDirectory)||void 0===m?void 0:m.call(g));return pe(a(l,function(t,r,n,i){return t!==c.TypeScript&&t!==c.DtsOnly||!e.fileExtensionIsOneOf(r,[".d.ts",".d.cts",".d.mts"])?V(t,r,false,i):void 0!==W(r,false,i)?{path:r,ext:e.forEach([".d.ts",".d.cts",".d.mts"],(function(t){return e.fileExtensionIs(r,t)?t:void 0}))}:void 0}(r,x,0,n)))}if("object"==typeof d&&null!==d){if(!Array.isArray(d)){for(var D=0,S=e.getOwnKeys(d);D<S.length;D++){var T=S[D];if("default"===T||n.conditions.indexOf(T)>=0||re(n.conditions,T))if(k=_(d[T],p,f))return k}return}if(!e.length(d))return n.traceEnabled&&t(n.host,e.Diagnostics.package_json_scope_0_has_invalid_type_for_target_of_specifier_1,l.packageDirectory,s),pe(void 0);for(var C=0,E=d;C<E.length;C++){var k;if(k=_(E[C],p,f))return k}}else if(null===d)return n.traceEnabled&&t(n.host,e.Diagnostics.package_json_scope_0_explicitly_maps_specifier_1_to_null,l.packageDirectory,s),pe(void 0);return n.traceEnabled&&t(n.host,e.Diagnostics.package_json_scope_0_has_invalid_type_for_target_of_specifier_1,l.packageDirectory,s),pe(void 0)}}function re(t,r){if(-1===t.indexOf("types"))return !1;if(!e.startsWith(r,"types@"))return !1;var n=e.VersionRange.tryParse(r.substring("types@".length));return !!n&&n.test(e.version)}function ne(e,t,r,n,i,a){return ie(e,t,r,n,!1,i,a)}function ie(t,r,n,i,a,o,s){var c=o&&o.getOrCreateCacheForModuleName(r,0===i.features?void 0:i.features&h.EsmMode?e.ModuleKind.ESNext:e.ModuleKind.CommonJS,s);return e.forEachAncestorDirectory(e.normalizeSlashes(n),(function(n){if("node_modules"!==e.getBaseFileName(n))return _e(c,r,n,i)||pe(ae(t,r,n,i,a,o,s))}))}function ae(r,n,i,a,o,s,l){var u=e.combinePaths(i,"node_modules"),_=e.directoryProbablyExists(u,a.host);!_&&a.traceEnabled&&t(a.host,e.Diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it,u);var d=o?void 0:oe(r,n,u,_,a,s,l);if(d)return d;if(r===c.TypeScript||r===c.DtsOnly){var p=e.combinePaths(u,"@types"),f=_;return _&&!e.directoryProbablyExists(p,a.host)&&(a.traceEnabled&&t(a.host,e.Diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it,p),f=!1),oe(c.DtsOnly,function(r,n){var i=le(r);return n.traceEnabled&&i!==r&&t(n.host,e.Diagnostics.Scoped_package_detected_looking_in_0,i),i}(n,a),p,f,a,s,l)}}function oe(r,n,i,s,c,l,u){var _=e.normalizePath(e.combinePaths(i,n)),d=Q(_,!s,c);if(!(c.features&h.Exports)&&d){var p=K(r,_,!s,c);if(p)return o(p);var f=X(r,_,!s,c,d.packageJsonContent,d.versionPaths);return a(d,f)}var g=Y(n),m=g.packageName,y=g.rest,v=function(t,r,n,i){var o;if(d&&d.packageJsonContent.exports&&i.features&h.Exports)return null===(o=$(d,t,e.combinePaths(".",y),i,l,u))||void 0===o?void 0:o.value;var s=K(t,r,n,i)||X(t,r,n,i,d&&d.packageJsonContent,d&&d.versionPaths);return a(d,s)};if(""!==y){var b=e.combinePaths(i,m);if((d=Q(b,!s,c))&&d.versionPaths){c.traceEnabled&&t(c.host,e.Diagnostics.package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_match_module_name_2,d.versionPaths.version,e.version,y);var x=s&&e.directoryProbablyExists(b,c.host),D=se(r,y,b,d.versionPaths.paths,void 0,v,!x,c);if(D)return D.value}}return v(r,_,!s,c)}function se(r,n,i,a,s,c,l,u){s||(s=e.tryParsePatterns(a));var _=e.matchPatternOrExact(s,n);if(_){var d=e.isString(_)?void 0:e.matchedText(_,n),p=e.isString(_)?_:e.patternText(_);return u.traceEnabled&&t(u.host,e.Diagnostics.Module_name_0_matched_pattern_1,n,p),{value:e.forEach(a[p],(function(n){var a=d?n.replace("*",d):n,s=e.normalizePath(e.combinePaths(i,a));u.traceEnabled&&t(u.host,e.Diagnostics.Trying_substitution_0_candidate_module_location_Colon_1,n,a);var _=e.tryGetExtensionFromPath(n);if(void 0!==_){var p=W(s,l,u);if(void 0!==p)return o({path:p,ext:_})}return c(r,s,l||!e.directoryProbablyExists(e.getDirectoryPath(s),u.host),u)}))}}}e.nodeModuleNameResolver=M,e.nodeModulesPathPart="/node_modules/",e.pathContainsNodeModules=j,e.parseNodeModuleFromPath=J,e.getPackageScopeForPath=G,e.getPackageJsonInfo=Q,e.parsePackageName=Y,e.allKeysStartWithDot=Z,e.isApplicableVersionedTypesKey=re;var ce="__";function le(t){if(e.startsWith(t,"@")){var r=t.replace(e.directorySeparator,ce);if(r!==t)return r.slice(1)}return t}function ue(t){return e.stringContains(t,ce)?"@"+t.replace(ce,e.directorySeparator):t}function _e(r,n,i,a){var o=r&&r.get(i);if(o)return a.traceEnabled&&t(a.host,e.Diagnostics.Resolution_for_module_0_was_found_in_cache_from_location_1,n,i),a.resultFromCache=o,{value:o.resolvedModule&&{path:o.resolvedModule.resolvedFileName,originalPath:o.resolvedModule.originalPath||!0,extension:o.resolvedModule.extension,packageId:o.resolvedModule.packageId}}}function de(t,n,i,a,o,s){var l=[],u={compilerOptions:i,host:a,traceEnabled:r(i,a),failedLookupLocations:l,packageJsonInfoCache:o,features:h.None,conditions:[]},d=e.getDirectoryPath(n),p=f(c.TypeScript)||f(c.JavaScript);return _(p&&p.value,!1,l,u.resultFromCache);function f(r){var n=N(r,t,d,U,u);if(n)return {value:n};if(e.isExternalModuleNameRelative(t)){var i=e.normalizePath(e.combinePaths(d,t));return pe(U(r,i,!1,u))}var a=o&&o.getOrCreateCacheForModuleName(t,void 0,s);return e.forEachAncestorDirectory(d,(function(n){var i=_e(a,t,n,u);if(i)return i;var o=e.normalizePath(e.combinePaths(n,t));return pe(U(r,o,!1,u))}))||(r===c.TypeScript?function(e,t,r){return ie(c.DtsOnly,e,t,r,!0,void 0,void 0)}(t,d,u):void 0)}}function pe(e){return void 0!==e?{value:e}:void 0}e.getTypesPackageName=function(e){return "@types/".concat(le(e))},e.mangleScopedPackageName=le,e.getPackageNameFromTypesPackageName=function(t){var r=e.removePrefix(t,"@types/");return r!==t?ue(r):t},e.unmangleScopedPackageName=ue,e.classicNameResolver=de,e.loadModuleFromGlobalCache=function(n,i,a,o,s,l){var u=r(a,o);u&&t(o,e.Diagnostics.Auto_discovery_for_typings_is_enabled_in_project_0_Running_extra_resolution_pass_for_module_1_using_cache_location_2,i,n,s);var d=[],p={compilerOptions:a,host:o,traceEnabled:u,failedLookupLocations:d,packageJsonInfoCache:l,features:h.None,conditions:[]};return _(ae(c.DtsOnly,n,s,p,!1,void 0,void 0),!0,d,p.resultFromCache)};}(t),function(e){var t,r;function a(t,r){return t.body&&!t.body.parent&&(e.setParent(t.body,t),e.setParentRecursive(t.body,!1)),t.body?o(t.body,r):1}function o(t,r){void 0===r&&(r=new e.Map);var n=e.getNodeId(t);if(r.has(n))return r.get(n)||0;r.set(n,void 0);var i=function(t,r){switch(t.kind){case 257:case 258:return 0;case 259:if(e.isEnumConst(t))return 2;break;case 265:case 264:if(!e.hasSyntacticModifier(t,1))return 0;break;case 271:var n=t;if(!n.moduleSpecifier&&n.exportClause&&272===n.exportClause.kind){for(var i=0,c=0,l=n.exportClause.elements;c<l.length;c++){var u=s(l[c],r);if(u>i&&(i=u),1===i)return i}return i}break;case 261:var _=0;return e.forEachChild(t,(function(t){var n=o(t,r);switch(n){case 0:return;case 2:return void(_=2);case 1:return _=1,!0;default:e.Debug.assertNever(n);}})),_;case 260:return a(t,r);case 79:if(t.isInJSDocNamespace)return 0}return 1}(t,r);return r.set(n,i),i}function s(t,r){for(var n=t.propertyName||t.name,i=t.parent;i;){if(e.isBlock(i)||e.isModuleBlock(i)||e.isSourceFile(i)){for(var a=void 0,s=0,c=i.statements;s<c.length;s++){var l=c[s];if(e.nodeHasName(l,n)){l.parent||(e.setParent(l,i),e.setParentRecursive(l,!1));var u=o(l,r);if((void 0===a||u>a)&&(a=u),1===a)return a}}if(void 0!==a)return a}i=i.parent;}return 1}function c(t){return e.Debug.attachFlowNodeDebugInfo(t),t}(r=e.ModuleInstanceState||(e.ModuleInstanceState={}))[r.NonInstantiated=0]="NonInstantiated",r[r.Instantiated=1]="Instantiated",r[r.ConstEnumOnly=2]="ConstEnumOnly",e.getModuleInstanceState=a,function(e){e[e.None=0]="None",e[e.IsContainer=1]="IsContainer",e[e.IsBlockScopedContainer=2]="IsBlockScopedContainer",e[e.IsControlFlowContainer=4]="IsControlFlowContainer",e[e.IsFunctionLike=8]="IsFunctionLike",e[e.IsFunctionExpression=16]="IsFunctionExpression",e[e.HasLocals=32]="HasLocals",e[e.IsInterface=64]="IsInterface",e[e.IsObjectLiteralOrClassExpressionMethodOrAccessor=128]="IsObjectLiteralOrClassExpressionMethodOrAccessor";}(t||(t={}));var l=function(){var t,r,o,s,l,p,f,g,m,y,v,h,b,x,D,S,T,C,E,k,N,F,A,P,w=!1,I=0,O={flags:1},M={flags:1},L=function(){return e.createBinaryExpressionTrampoline((function(t,r){if(r){r.stackIndex++,e.setParent(t,s);var n=F;je(t);var i=s;s=t,r.skip=!1,r.inStrictModeStack[r.stackIndex]=n,r.parentStack[r.stackIndex]=i;}else r={stackIndex:0,skip:!1,inStrictModeStack:[void 0],parentStack:[void 0]};var a=t.operatorToken.kind;if(55===a||56===a||60===a||e.isLogicalOrCoalescingAssignmentOperator(a)){if(_e(t)){var o=$();be(t,o,o),v=ce(o);}else be(t,D,S);r.skip=!0;}return r}),(function(e,r,n){if(!r.skip)return t(e)}),(function(e,t,r){t.skip||(27===e.kind&&ye(r.left),Le(e));}),(function(e,r,n){if(!r.skip)return t(e)}),(function(t,r){if(!r.skip){var n=t.operatorToken.kind;e.isAssignmentOperator(n)&&!e.isAssignmentTarget(t)&&(he(t.left),63===n&&206===t.left.kind&&Z(t.left.expression)&&(v=oe(256,v,t)));}var i=r.inStrictModeStack[r.stackIndex],a=r.parentStack[r.stackIndex];void 0!==i&&(F=i),void 0!==a&&(s=a),r.skip=!1,r.stackIndex--;}),void 0);function t(t){if(t&&e.isBinaryExpression(t)&&!e.isDestructuringAssignment(t))return t;Le(t);}}();function R(r,n,i,a,o){return e.createDiagnosticForNodeInSourceFile(e.getSourceFileOfNode(r)||t,r,n,i,a,o)}return function(n,i){t=n,r=i,o=e.getEmitScriptTarget(r),F=function(t,r){return !(!e.getStrictOptionValue(r,"alwaysStrict")||t.isDeclarationFile)||!!t.externalModuleIndicator}(t,i),P=new e.Set,I=0,A=e.objectAllocator.getSymbolConstructor(),e.Debug.attachFlowNodeDebugInfo(O),e.Debug.attachFlowNodeDebugInfo(M),t.locals||(Le(t),t.symbolCount=I,t.classifiableNames=P,function(){if(m){for(var r=l,n=g,i=f,a=s,o=v,u=0,d=m;u<d.length;u++){var p=d[u],y=p.parent.parent;l=e.findAncestor(y.parent,(function(e){return !!(1&Ce(e))}))||t,f=e.getEnclosingBlockScopeContainer(y)||t,v=c({flags:2}),s=p,Le(p.typeExpression);var h=e.getNameOfDeclaration(p);if((e.isJSDocEnumTag(p)||!p.fullName)&&h&&e.isPropertyAccessEntityNameExpression(h.parent)){var b=Ye(h.parent);if(b){Qe(t.symbol,h.parent,b,!!e.findAncestor(h,(function(t){return e.isPropertyAccessExpression(t)&&"prototype"===t.name.escapedText})),!1);var x=l;switch(e.getAssignmentDeclarationPropertyAccessKind(h.parent)){case 1:case 2:l=e.isExternalOrCommonJsModule(t)?t:void 0;break;case 4:l=h.parent.expression;break;case 3:l=h.parent.expression.name;break;case 5:l=_(t,h.parent.expression)?t:e.isPropertyAccessExpression(h.parent.expression)?h.parent.expression.name:h.parent.expression;break;case 0:return e.Debug.fail("Shouldn't have detected typedef or enum on non-assignment declaration")}l&&K(p,524288,788968),l=x;}}else e.isJSDocEnumTag(p)||!p.fullName||79===p.fullName.kind?(s=p.parent,Pe(p,524288,788968)):Le(p.fullName);}l=r,g=n,f=i,s=a,v=o;}}()),t=void 0,r=void 0,o=void 0,s=void 0,l=void 0,p=void 0,f=void 0,g=void 0,m=void 0,y=!1,v=void 0,h=void 0,b=void 0,x=void 0,D=void 0,S=void 0,T=void 0,E=void 0,k=!1,w=!1,N=0;};function B(e,t){return I++,new A(e,t)}function j(t,r,n){t.flags|=n,r.symbol=t,t.declarations=e.appendIfUnique(t.declarations,r),1955&n&&!t.exports&&(t.exports=e.createSymbolTable()),6240&n&&!t.members&&(t.members=e.createSymbolTable()),t.constEnumOnlyModule&&304&t.flags&&(t.constEnumOnlyModule=!1),111551&n&&e.setValueDeclaration(t,r);}function J(t){if(270===t.kind)return t.isExportEquals?"export=":"default";var r=e.getNameOfDeclaration(t);if(r){if(e.isAmbientModule(t)){var n=e.getTextOfIdentifierOrLiteral(r);return e.isGlobalScopeAugmentation(t)?"__global":'"'.concat(n,'"')}if(161===r.kind){var i=r.expression;if(e.isStringOrNumericLiteralLike(i))return e.escapeLeadingUnderscores(i.text);if(e.isSignedNumericLiteral(i))return e.tokenToString(i.operator)+i.operand.text;e.Debug.fail("Only computed properties with literal names have declaration names");}if(e.isPrivateIdentifier(r)){var a=e.getContainingClass(t);if(!a)return;var o=a.symbol;return e.getSymbolNameForPrivateIdentifier(o,r.escapedText)}return e.isPropertyNameLiteral(r)?e.getEscapedTextOfIdentifierOrLiteral(r):void 0}switch(t.kind){case 170:return "__constructor";case 178:case 173:case 321:return "__call";case 179:case 174:return "__new";case 175:return "__index";case 271:return "__export";case 303:return "export=";case 220:if(2===e.getAssignmentDeclarationKind(t))return "export=";e.Debug.fail("Unknown binary declaration kind");break;case 315:return e.isJSDocConstructSignature(t)?"__new":"__call";case 163:return e.Debug.assert(315===t.parent.kind,"Impossible parameter parent kind",(function(){return "parent is: ".concat(e.SyntaxKind?e.SyntaxKind[t.parent.kind]:t.parent.kind,", expected JSDocFunctionType")})),"arg"+t.parent.parameters.indexOf(t)}}function z(t){return e.isNamedDeclaration(t)?e.declarationNameToString(t.name):e.unescapeLeadingUnderscores(e.Debug.checkDefined(J(t)))}function U(r,i,a,o,s,c,l){e.Debug.assert(l||!e.hasDynamicName(a));var u,_=e.hasSyntacticModifier(a,512)||e.isExportSpecifier(a)&&"default"===a.name.escapedText,d=l?"__computed":_&&i?"default":J(a);if(void 0===d)u=B(0,"__missing");else if(u=r.get(d),2885600&o&&P.add(d),u){if(c&&!u.isReplaceableByMethod)return u;if(u.flags&s)if(u.isReplaceableByMethod)r.set(d,u=B(0,d));else if(!(3&o&&67108864&u.flags)){e.isNamedDeclaration(a)&&e.setParent(a.name,a);var p=2&u.flags?e.Diagnostics.Cannot_redeclare_block_scoped_variable_0:e.Diagnostics.Duplicate_identifier_0,f=!0;(384&u.flags||384&o)&&(p=e.Diagnostics.Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations,f=!1);var g=!1;e.length(u.declarations)&&(_||u.declarations&&u.declarations.length&&270===a.kind&&!a.isExportEquals)&&(p=e.Diagnostics.A_module_cannot_have_multiple_default_exports,f=!1,g=!0);var m=[];e.isTypeAliasDeclaration(a)&&e.nodeIsMissing(a.type)&&e.hasSyntacticModifier(a,1)&&2887656&u.flags&&m.push(R(a,e.Diagnostics.Did_you_mean_0,"export type { ".concat(e.unescapeLeadingUnderscores(a.name.escapedText)," }")));var y=e.getNameOfDeclaration(a)||a;e.forEach(u.declarations,(function(r,n){var i=e.getNameOfDeclaration(r)||r,a=R(i,p,f?z(r):void 0);t.bindDiagnostics.push(g?e.addRelatedInfo(a,R(y,0===n?e.Diagnostics.Another_export_default_is_here:e.Diagnostics.and_here)):a),g&&m.push(R(i,e.Diagnostics.The_first_export_default_is_here));}));var v=R(y,p,f?z(a):void 0);t.bindDiagnostics.push(e.addRelatedInfo.apply(void 0,n$3([v],m,!1))),u=B(0,d);}}else r.set(d,u=B(0,d)),c&&(u.isReplaceableByMethod=!0);return j(u,a,o),u.parent?e.Debug.assert(u.parent===i,"Existing symbol parent should match new one"):u.parent=i,u}function K(t,r,n){var i=!!(1&e.getCombinedModifierFlags(t))||function(t){if(t.parent&&e.isModuleDeclaration(t)&&(t=t.parent),!e.isJSDocTypeAlias(t))return !1;if(!e.isJSDocEnumTag(t)&&t.fullName)return !0;var r=e.getNameOfDeclaration(t);return !!(r&&(e.isPropertyAccessEntityNameExpression(r.parent)&&Ye(r.parent)||e.isDeclaration(r.parent)&&1&e.getCombinedModifierFlags(r.parent)))}(t);if(2097152&r)return 274===t.kind||264===t.kind&&i?U(l.symbol.exports,l.symbol,t,r,n):U(l.locals,void 0,t,r,n);if(e.isJSDocTypeAlias(t)&&e.Debug.assert(e.isInJSFile(t)),!e.isAmbientModule(t)&&(i||64&l.flags)){if(!l.locals||e.hasSyntacticModifier(t,512)&&!J(t))return U(l.symbol.exports,l.symbol,t,r,n);var a=111551&r?1048576:0,o=U(l.locals,void 0,t,a,n);return o.exportSymbol=U(l.symbol.exports,l.symbol,t,r,n),t.localSymbol=o,o}return U(l.locals,void 0,t,r,n)}function V(e){q(e,(function(e){return 255===e.kind?Le(e):void 0})),q(e,(function(e){return 255!==e.kind?Le(e):void 0}));}function q(t,r){void 0===r&&(r=Le),void 0!==t&&e.forEach(t,r);}function W(t){e.forEachChild(t,Le,q);}function H(t){var n=w;if(w=!1,function(t){if(!(1&v.flags))return !1;if(v===O&&(e.isStatementButNotDeclaration(t)&&235!==t.kind||256===t.kind||260===t.kind&&function(t){var n=a(t);return 1===n||2===n&&e.shouldPreserveConstEnums(r)}(t))&&(v=M,!r.allowUnreachableCode)){var n=e.unreachableCodeIsError(r)&&!(8388608&t.flags)&&(!e.isVariableStatement(t)||!!(3&e.getCombinedNodeFlags(t.declarationList))||t.declarationList.declarations.some((function(e){return !!e.initializer})));!function(t,r){if(e.isStatement(t)&&u(t)&&e.isBlock(t.parent)){var n=t.parent.statements,i=e.sliceAfter(n,t);e.getRangesWhere(i,u,(function(e,t){return r(i[e],i[t-1])}));}else r(t,t);}(t,(function(t,r){return Me(n,t,r,e.Diagnostics.Unreachable_code_detected)}));}return !0}(t))return W(t),Re(t),void(w=n);switch(t.kind>=236&&t.kind<=252&&!r.allowUnreachableCode&&(t.flowNode=v),t.kind){case 240:!function(e){var t=ge(e,ee()),r=$(),n=$();ne(t,v),v=t,pe(e.expression,r,n),v=ce(r),fe(e.statement,n,t),ne(t,v),v=ce(n);}(t);break;case 239:!function(e){var t=ee(),r=ge(e,$()),n=$();ne(t,v),v=t,fe(e.statement,n,r),ne(r,v),v=ce(r),pe(e.expression,t,n),v=ce(n);}(t);break;case 241:!function(e){var t=ge(e,ee()),r=$(),n=$();Le(e.initializer),ne(t,v),v=t,pe(e.condition,r,n),v=ce(r),fe(e.statement,n,t),Le(e.incrementor),ne(t,v),v=ce(n);}(t);break;case 242:case 243:!function(e){var t=ge(e,ee()),r=$();Le(e.expression),ne(t,v),v=t,243===e.kind&&Le(e.awaitModifier),ne(r,v),Le(e.initializer),254!==e.initializer.kind&&he(e.initializer),fe(e.statement,r,t),ne(t,v),v=ce(r);}(t);break;case 238:!function(e){var t=$(),r=$(),n=$();pe(e.expression,t,r),v=ce(t),Le(e.thenStatement),ne(n,v),v=ce(r),Le(e.elseStatement),ne(n,v),v=ce(n);}(t);break;case 246:case 250:!function(e){Le(e.expression),246===e.kind&&(k=!0,x&&ne(x,v)),v=O;}(t);break;case 245:case 244:!function(e){if(Le(e.label),e.label){var t=function(e){for(var t=E;t;t=t.next)if(t.name===e)return t}(e.label.escapedText);t&&(t.referenced=!0,me(e,t.breakTarget,t.continueTarget));}else me(e,h,b);}(t);break;case 251:!function(t){var r=x,n=T,i=$(),a=$(),o=$();if(t.finallyBlock&&(x=a),ne(o,v),T=o,Le(t.tryBlock),ne(i,v),t.catchClause&&(v=ce(o),ne(o=$(),v),T=o,Le(t.catchClause),ne(i,v)),x=r,T=n,t.finallyBlock){var s=$();s.antecedents=e.concatenate(e.concatenate(i.antecedents,o.antecedents),a.antecedents),v=s,Le(t.finallyBlock),1&v.flags?v=O:(x&&a.antecedents&&ne(x,te(s,a.antecedents,v)),T&&o.antecedents&&ne(T,te(s,o.antecedents,v)),v=i.antecedents?te(s,i.antecedents,v):O);}else v=ce(i);}(t);break;case 248:!function(t){var r=$();Le(t.expression);var n=h,i=C;h=r,C=v,Le(t.caseBlock),ne(r,v);var a=e.forEach(t.caseBlock.clauses,(function(e){return 289===e.kind}));t.possiblyExhaustive=!a&&!r.antecedents,a||ne(r,ae(C,t,0,0)),h=n,C=i,v=ce(r);}(t);break;case 262:!function(e){for(var t=e.clauses,n=G(e.parent.expression),i=O,a=0;a<t.length;a++){for(var o=a;!t[a].statements.length&&a+1<t.length;)Le(t[a]),a++;var s=$();ne(s,n?ae(C,e.parent,o,a+1):C),ne(s,i),v=ce(s);var c=t[a];Le(c),i=v,1&v.flags||a===t.length-1||!r.noFallthroughCasesInSwitch||(c.fallthroughFlowNode=v);}}(t);break;case 288:!function(e){var t=v;v=C,Le(e.expression),v=t,q(e.statements);}(t);break;case 237:!function(e){Le(e.expression),ye(e.expression);}(t);break;case 249:!function(t){var n=$();E={next:E,name:t.label.escapedText,breakTarget:n,continueTarget:void 0,referenced:!1},Le(t.label),Le(t.statement),E.referenced||r.allowUnusedLabels||function(e,t,r){Me(e,t,t,r);}(e.unusedLabelIsError(r),t.label,e.Diagnostics.Unused_label),E=E.next,ne(n,v),v=ce(n);}(t);break;case 218:!function(e){if(53===e.operator){var t=D;D=S,S=t,W(e),S=D,D=t;}else W(e),45!==e.operator&&46!==e.operator||he(e.operand);}(t);break;case 219:!function(e){W(e),(45===e.operator||46===e.operator)&&he(e.operand);}(t);break;case 220:if(e.isDestructuringAssignment(t))return w=n,void function(e){w?(w=!1,Le(e.operatorToken),Le(e.right),w=!0,Le(e.left)):(w=!0,Le(e.left),w=!1,Le(e.operatorToken),Le(e.right)),he(e.left);}(t);L(t);break;case 214:!function(e){W(e),205===e.expression.kind&&he(e.expression);}(t);break;case 221:!function(e){var t=$(),r=$(),n=$();pe(e.condition,t,r),v=ce(t),Le(e.questionToken),Le(e.whenTrue),ne(n,v),v=ce(r),Le(e.colonToken),Le(e.whenFalse),ne(n,v),v=ce(n);}(t);break;case 253:!function(t){W(t),(t.initializer||e.isForInOrOfStatement(t.parent.parent))&&xe(t);}(t);break;case 205:case 206:!function(t){e.isOptionalChain(t)?Te(t):W(t);}(t);break;case 207:!function(t){if(e.isOptionalChain(t))Te(t);else {var r=e.skipParentheses(t.expression);212===r.kind||213===r.kind?(q(t.typeArguments),q(t.arguments),Le(t.expression)):(W(t),106===t.expression.kind&&(v=se(v,t)));}if(205===t.expression.kind){var n=t.expression;e.isIdentifier(n.name)&&Z(n.expression)&&e.isPushOrUnshiftIdentifier(n.name)&&(v=oe(256,v,t));}}(t);break;case 229:!function(t){e.isOptionalChain(t)?Te(t):W(t);}(t);break;case 343:case 336:case 337:!function(t){Le(t.tagName),337!==t.kind&&t.fullName&&(e.setParent(t.fullName,t),e.setParentRecursive(t.fullName,!1)),"string"!=typeof t.comment&&q(t.comment);}(t);break;case 303:V(t.statements),Le(t.endOfFileToken);break;case 234:case 261:V(t.statements);break;case 202:!function(t){e.isBindingPattern(t.name)?(q(t.decorators),q(t.modifiers),Le(t.dotDotDotToken),Le(t.propertyName),Le(t.initializer),Le(t.name)):W(t);}(t);break;case 204:case 203:case 294:case 224:w=n;default:W(t);}Re(t),w=n;}function G(e){switch(e.kind){case 79:case 80:case 108:case 205:case 206:return X(e);case 207:return function(e){if(e.arguments)for(var t=0,r=e.arguments;t<r.length;t++)if(X(r[t]))return !0;return !(205!==e.expression.kind||!X(e.expression.expression))}(e);case 211:case 229:return G(e.expression);case 220:return function(e){switch(e.operatorToken.kind){case 63:case 75:case 76:case 77:return X(e.left);case 34:case 35:case 36:case 37:return Z(e.left)||Z(e.right)||Y(e.right,e.left)||Y(e.left,e.right);case 102:return Z(e.left);case 101:case 27:return G(e.right)}return !1}(e);case 218:return 53===e.operator&&G(e.operand);case 215:return G(e.expression)}return !1}function Q(t){return e.isDottedName(t)||(e.isPropertyAccessExpression(t)||e.isNonNullExpression(t)||e.isParenthesizedExpression(t))&&Q(t.expression)||e.isBinaryExpression(t)&&27===t.operatorToken.kind&&Q(t.right)||e.isElementAccessExpression(t)&&e.isStringOrNumericLiteralLike(t.argumentExpression)&&Q(t.expression)||e.isAssignmentExpression(t)&&Q(t.left)}function X(t){return Q(t)||e.isOptionalChain(t)&&X(t.expression)}function Y(t,r){return e.isTypeOfExpression(t)&&Z(t.expression)&&e.isStringLiteralLike(r)}function Z(e){switch(e.kind){case 211:return Z(e.expression);case 220:switch(e.operatorToken.kind){case 63:return Z(e.left);case 27:return Z(e.right)}}return X(e)}function $(){return c({flags:4,antecedents:void 0})}function ee(){return c({flags:8,antecedents:void 0})}function te(e,t,r){return c({flags:1024,target:e,antecedents:t,antecedent:r})}function re(e){e.flags|=2048&e.flags?4096:2048;}function ne(t,r){1&r.flags||e.contains(t.antecedents,r)||((t.antecedents||(t.antecedents=[])).push(r),re(r));}function ie(t,r,n){return 1&r.flags?r:n?!(110===n.kind&&64&t||95===n.kind&&32&t)||e.isExpressionOfOptionalChainRoot(n)||e.isNullishCoalesce(n.parent)?G(n)?(re(r),c({flags:t,antecedent:r,node:n})):r:O:32&t?r:O}function ae(e,t,r,n){return re(e),c({flags:128,antecedent:e,switchStatement:t,clauseStart:r,clauseEnd:n})}function oe(e,t,r){re(t);var n=c({flags:e,antecedent:t,node:r});return T&&ne(T,n),n}function se(e,t){return re(e),c({flags:512,antecedent:e,node:t})}function ce(e){var t=e.antecedents;return t?1===t.length?t[0]:e:O}function le(e){for(;;)if(211===e.kind)e=e.expression;else {if(218!==e.kind||53!==e.operator)return 220===e.kind&&(55===e.operatorToken.kind||56===e.operatorToken.kind||60===e.operatorToken.kind);e=e.operand;}}function ue(t){return t=e.skipParentheses(t),e.isBinaryExpression(t)&&e.isLogicalOrCoalescingAssignmentOperator(t.operatorToken.kind)}function _e(t){for(;e.isParenthesizedExpression(t.parent)||e.isPrefixUnaryExpression(t.parent)&&53===t.parent.operator;)t=t.parent;return !(function(e){var t=e.parent;switch(t.kind){case 238:case 240:case 239:return t.expression===e;case 241:case 221:return t.condition===e}return !1}(t)||ue(t.parent)||le(t.parent)||e.isOptionalChain(t.parent)&&t.parent.expression===t)}function de(e,t,r,n){var i=D,a=S;D=r,S=n,e(t),D=i,S=a;}function pe(t,r,n){de(Le,t,r,n),t&&(ue(t)||le(t)||e.isOptionalChain(t)&&e.isOutermostOptionalChain(t))||(ne(r,ie(32,v,t)),ne(n,ie(64,v,t)));}function fe(e,t,r){var n=h,i=b;h=t,b=r,Le(e),h=n,b=i;}function ge(e,t){for(var r=E;r&&249===e.parent.kind;)r.continueTarget=t,r=r.next,e=e.parent;return t}function me(e,t,r){var n=245===e.kind?t:r;n&&(ne(n,v),v=O);}function ye(t){if(207===t.kind){var r=t;106!==r.expression.kind&&e.isDottedName(r.expression)&&(v=se(v,r));}}function ve(e){220===e.kind&&63===e.operatorToken.kind?he(e.left):he(e);}function he(e){if(Q(e))v=oe(16,v,e);else if(203===e.kind)for(var t=0,r=e.elements;t<r.length;t++){var n=r[t];224===n.kind?he(n.expression):ve(n);}else if(204===e.kind)for(var i=0,a=e.properties;i<a.length;i++){var o=a[i];294===o.kind?ve(o.initializer):295===o.kind?he(o.name):296===o.kind&&he(o.expression);}}function be(t,r,n){var i=$();55===t.operatorToken.kind||76===t.operatorToken.kind?pe(t.left,i,n):pe(t.left,r,i),v=ce(i),Le(t.operatorToken),e.isLogicalOrCoalescingAssignmentOperator(t.operatorToken.kind)?(de(Le,t.right,r,n),he(t.left),ne(r,ie(32,v,t)),ne(n,ie(64,v,t))):pe(t.right,r,n);}function xe(t){var r=e.isOmittedExpression(t)?void 0:t.name;if(e.isBindingPattern(r))for(var n=0,i=r.elements;n<i.length;n++)xe(i[n]);else v=oe(16,v,t);}function De(e){switch(e.kind){case 205:Le(e.questionDotToken),Le(e.name);break;case 206:Le(e.questionDotToken),Le(e.argumentExpression);break;case 207:Le(e.questionDotToken),q(e.typeArguments),q(e.arguments);}}function Se(t,r,n){var i=e.isOptionalChainRoot(t)?$():void 0;!function(t,r,n){de(Le,t,r,n),e.isOptionalChain(t)&&!e.isOutermostOptionalChain(t)||(ne(r,ie(32,v,t)),ne(n,ie(64,v,t)));}(t.expression,i||r,n),i&&(v=ce(i)),de(De,t,r,n),e.isOutermostOptionalChain(t)&&(ne(r,ie(32,v,t)),ne(n,ie(64,v,t)));}function Te(e){if(_e(e)){var t=$();Se(e,t,t),v=ce(t);}else Se(e,D,S);}function Ce(t){switch(t.kind){case 225:case 256:case 259:case 204:case 181:case 320:case 285:return 1;case 257:return 65;case 260:case 258:case 194:return 33;case 303:return 37;case 171:case 172:case 168:if(e.isObjectLiteralOrClassExpressionMethodOrAccessor(t))return 173;case 170:case 255:case 167:case 173:case 321:case 315:case 178:case 174:case 175:case 179:case 169:return 45;case 212:case 213:return 61;case 261:return 4;case 166:return t.initializer?4:0;case 291:case 241:case 242:case 243:case 262:return 2;case 234:return e.isFunctionLike(t.parent)||e.isClassStaticBlockDeclaration(t.parent)?0:2}return 0}function Ee(e){g&&(g.nextContainer=e),g=e;}function ke(r,n,i){switch(l.kind){case 260:return K(r,n,i);case 303:return function(r,n,i){return e.isExternalModule(t)?K(r,n,i):U(t.locals,void 0,r,n,i)}(r,n,i);case 225:case 256:return function(t,r,n){return e.isStatic(t)?U(l.symbol.exports,l.symbol,t,r,n):U(l.symbol.members,l.symbol,t,r,n)}(r,n,i);case 259:return U(l.symbol.exports,l.symbol,r,n,i);case 181:case 320:case 204:case 257:case 285:return U(l.symbol.members,l.symbol,r,n,i);case 178:case 179:case 173:case 174:case 321:case 175:case 168:case 167:case 170:case 171:case 172:case 255:case 212:case 213:case 315:case 343:case 336:case 169:case 258:case 194:return U(l.locals,void 0,r,n,i)}}function Ne(t){8388608&t.flags&&!function(t){var r=e.isSourceFile(t)?t:e.tryCast(t.body,e.isModuleBlock);return !!r&&r.statements.some((function(t){return e.isExportDeclaration(t)||e.isExportAssignment(t)}))}(t)?t.flags|=64:t.flags&=-65;}function Fe(e){var t=a(e),r=0!==t;return ke(e,r?512:1024,r?110735:0),t}function Ae(e,t,r){var n=B(t,r);return 106508&t&&(n.parent=l.symbol),j(n,e,t),n}function Pe(t,r,n){switch(f.kind){case 260:K(t,r,n);break;case 303:if(e.isExternalOrCommonJsModule(l)){K(t,r,n);break}default:f.locals||(f.locals=e.createSymbolTable(),Ee(f)),U(f.locals,void 0,t,r,n);}}function we(r,n){if(n&&79===n.kind){var i=n;if(o=i,e.isIdentifier(o)&&("eval"===o.escapedText||"arguments"===o.escapedText)){var a=e.getErrorSpanForNode(t,n);t.bindDiagnostics.push(e.createFileDiagnostic(t,a.start,a.length,function(r){return e.getContainingClass(r)?e.Diagnostics.Code_contained_in_a_class_is_evaluated_in_JavaScript_s_strict_mode_which_does_not_allow_this_use_of_0_For_more_information_see_https_Colon_Slash_Slashdeveloper_mozilla_org_Slashen_US_Slashdocs_SlashWeb_SlashJavaScript_SlashReference_SlashStrict_mode:t.externalModuleIndicator?e.Diagnostics.Invalid_use_of_0_Modules_are_automatically_in_strict_mode:e.Diagnostics.Invalid_use_of_0_in_strict_mode}(r),e.idText(i)));}}var o;}function Ie(e){F&&we(e,e.name);}function Oe(r,n,i,a,o){var s=e.getSpanOfTokenAtPosition(t,r.pos);t.bindDiagnostics.push(e.createFileDiagnostic(t,s.start,s.length,n,i,a,o));}function Me(r,n,a,o){!function(r,n,a){var o=e.createFileDiagnostic(t,n.pos,n.end-n.pos,a);r?t.bindDiagnostics.push(o):t.bindSuggestionDiagnostics=e.append(t.bindSuggestionDiagnostics,i$1(i$1({},o),{category:e.DiagnosticCategory.Suggestion}));}(r,{pos:e.getTokenPosOfNode(n,t),end:a.end},o);}function Le(t){if(t){e.setParent(t,s);var r=F;if(je(t),t.kind>159){var n=s;s=t;var i=Ce(t);0===i?H(t):function(t,r){var n=l,i=p,a=f;if(1&r?(213!==t.kind&&(p=l),l=f=t,32&r&&(l.locals=e.createSymbolTable()),Ee(l)):2&r&&((f=t).locals=void 0),4&r){var o=v,s=h,u=b,_=x,d=T,g=E,m=k,D=16&r&&!e.hasSyntacticModifier(t,256)&&!t.asteriskToken&&!!e.getImmediatelyInvokedFunctionExpression(t);D||(v=c({flags:2}),144&r&&(v.node=t)),x=D||170===t.kind||169===t.kind||e.isInJSFile(t)&&(255===t.kind||212===t.kind)?$():void 0,T=void 0,h=void 0,b=void 0,E=void 0,k=!1,H(t),t.flags&=-2817,!(1&v.flags)&&8&r&&e.nodeIsPresent(t.body)&&(t.flags|=256,k&&(t.flags|=512),t.endFlowNode=v),303===t.kind&&(t.flags|=N,t.endFlowNode=v),x&&(ne(x,v),v=ce(x),(170===t.kind||169===t.kind||e.isInJSFile(t)&&(255===t.kind||212===t.kind))&&(t.returnFlowNode=v)),D||(v=o),h=s,b=u,x=_,T=d,E=g,k=m;}else 64&r?(y=!1,H(t),t.flags=y?128|t.flags:-129&t.flags):H(t);l=n,p=i,f=a;}(t,i),s=n;}else n=s,1===t.kind&&(s=t),Re(t),s=n;F=r;}}function Re(t){if(e.hasJSDocNodes(t))if(e.isInJSFile(t))for(var r=0,n=t.jsDoc;r<n.length;r++)Le(o=n[r]);else for(var i=0,a=t.jsDoc;i<a.length;i++){var o=a[i];e.setParent(o,t),e.setParentRecursive(o,!1);}}function Be(r){if(!F)for(var n=0,i=r;n<i.length;n++){var a=i[n];if(!e.isPrologueDirective(a))return;if(o=a,'"use strict"'===(s=e.getSourceTextOfNodeFromSourceFile(t,o.expression))||"'use strict'"===s)return void(F=!0)}var o,s;}function je(n){switch(n.kind){case 79:if(n.isInJSDocNamespace){for(var i=n.parent;i&&!e.isJSDocTypeAlias(i);)i=i.parent;Pe(i,524288,788968);break}case 108:return v&&(e.isExpression(n)||295===s.kind)&&(n.flowNode=v),function(r){t.parseDiagnostics.length||8388608&r.flags||4194304&r.flags||e.isIdentifierName(r)||(F&&r.originalKeywordKind>=117&&r.originalKeywordKind<=125?t.bindDiagnostics.push(R(r,function(r){return e.getContainingClass(r)?e.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode:t.externalModuleIndicator?e.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode:e.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode}(r),e.declarationNameToString(r))):132===r.originalKeywordKind?e.isExternalModule(t)&&e.isInTopLevelContext(r)?t.bindDiagnostics.push(R(r,e.Diagnostics.Identifier_expected_0_is_a_reserved_word_at_the_top_level_of_a_module,e.declarationNameToString(r))):32768&r.flags&&t.bindDiagnostics.push(R(r,e.Diagnostics.Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here,e.declarationNameToString(r))):125===r.originalKeywordKind&&8192&r.flags&&t.bindDiagnostics.push(R(r,e.Diagnostics.Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here,e.declarationNameToString(r))));}(n);case 160:v&&e.isPartOfTypeQuery(n)&&(n.flowNode=v);break;case 230:case 106:n.flowNode=v;break;case 80:return function(r){"#constructor"===r.escapedText&&(t.parseDiagnostics.length||t.bindDiagnostics.push(R(r,e.Diagnostics.constructor_is_a_reserved_word,e.declarationNameToString(r))));}(n);case 205:case 206:var a=n;v&&Q(a)&&(a.flowNode=v),e.isSpecialPropertyDeclaration(a)&&function(t){108===t.expression.kind?Ve(t):e.isBindableStaticAccessExpression(t)&&303===t.parent.parent.kind&&(e.isPrototypeAccess(t.expression)?He(t,t.parent):Ge(t));}(a),e.isInJSFile(a)&&t.commonJsModuleIndicator&&e.isModuleExportsAccessExpression(a)&&!d(f,"module")&&U(t.locals,void 0,a.expression,134217729,111550);break;case 220:switch(e.getAssignmentDeclarationKind(n)){case 1:Ue(n);break;case 2:!function(r){if(ze(r)){var n=e.getRightMostAssignedExpression(r.right);if(!(e.isEmptyObjectLiteral(n)||l===t&&_(t,n)))if(e.isObjectLiteralExpression(n)&&e.every(n.properties,e.isShorthandPropertyAssignment))e.forEach(n.properties,Ke);else {var i=e.exportAssignmentIsAlias(r)?2097152:1049092,a=U(t.symbol.exports,t.symbol,r,67108864|i,0);e.setValueDeclaration(a,r);}}}(n);break;case 3:He(n.left,n);break;case 6:!function(t){e.setParent(t.left,t),e.setParent(t.right,t),Ze(t.left.expression,t.left,!1,!0);}(n);break;case 4:Ve(n);break;case 5:var c=n.left.expression;if(e.isInJSFile(n)&&e.isIdentifier(c)){var u=d(f,c.escapedText);if(e.isThisInitializedDeclaration(null==u?void 0:u.valueDeclaration)){Ve(n);break}}!function(r){var n,i=$e(r.left.expression,l)||$e(r.left.expression,f);if(e.isInJSFile(r)||e.isFunctionSymbol(i)){var a=e.getLeftmostAccessExpression(r.left);e.isIdentifier(a)&&2097152&(null===(n=d(l,a.escapedText))||void 0===n?void 0:n.flags)||(e.setParent(r.left,r),e.setParent(r.right,r),e.isIdentifier(r.left.expression)&&l===t&&_(t,r.left.expression)?Ue(r):e.hasDynamicName(r)?(Ae(r,67108868,"__computed"),We(r,Qe(i,r.left.expression,Ye(r.left),!1,!1))):Ge(e.cast(r.left,e.isBindableStaticNameExpression)));}}(n);break;case 0:break;default:e.Debug.fail("Unknown binary expression special property assignment kind");}return function(t){F&&e.isLeftHandSideExpression(t.left)&&e.isAssignmentOperator(t.operatorToken.kind)&&we(t,t.left);}(n);case 291:return function(e){F&&e.variableDeclaration&&we(e,e.variableDeclaration.name);}(n);case 214:return function(r){if(F&&79===r.expression.kind){var n=e.getErrorSpanForNode(t,r.expression);t.bindDiagnostics.push(e.createFileDiagnostic(t,n.start,n.length,e.Diagnostics.delete_cannot_be_called_on_an_identifier_in_strict_mode));}}(n);case 8:return function(r){F&&32&r.numericLiteralFlags&&t.bindDiagnostics.push(R(r,e.Diagnostics.Octal_literals_are_not_allowed_in_strict_mode));}(n);case 219:return function(e){F&&we(e,e.operand);}(n);case 218:return function(e){F&&(45!==e.operator&&46!==e.operator||we(e,e.operand));}(n);case 247:return function(t){F&&Oe(t,e.Diagnostics.with_statements_are_not_allowed_in_strict_mode);}(n);case 249:return function(t){F&&e.getEmitScriptTarget(r)>=2&&(e.isDeclarationStatement(t.statement)||e.isVariableStatement(t.statement))&&Oe(t.label,e.Diagnostics.A_label_is_not_allowed_here);}(n);case 191:return void(y=!0);case 176:break;case 162:return function(t){if(e.isJSDocTemplateTag(t.parent)){var r=e.getEffectiveContainerForJSDocTemplateTag(t.parent);r?(r.locals||(r.locals=e.createSymbolTable()),U(r.locals,void 0,t,262144,526824)):ke(t,262144,526824);}else if(189===t.parent.kind){var n=function(t){var r=e.findAncestor(t,(function(t){return t.parent&&e.isConditionalTypeNode(t.parent)&&t.parent.extendsType===t}));return r&&r.parent}(t.parent);n?(n.locals||(n.locals=e.createSymbolTable()),U(n.locals,void 0,t,262144,526824)):Ae(t,262144,J(t));}else ke(t,262144,526824);}(n);case 163:return rt(n);case 253:return tt(n);case 202:return n.flowNode=v,tt(n);case 166:case 165:return function(e){return nt(e,4|(e.questionToken?16777216:0),0)}(n);case 294:case 295:return nt(n,4,0);case 297:return nt(n,8,900095);case 173:case 174:case 175:return ke(n,131072,0);case 168:case 167:return nt(n,8192|(n.questionToken?16777216:0),e.isObjectLiteralMethod(n)?0:103359);case 255:return function(r){t.isDeclarationFile||8388608&r.flags||e.isAsyncFunction(r)&&(N|=2048),Ie(r),F?(function(r){if(o<2&&303!==f.kind&&260!==f.kind&&!e.isFunctionLikeOrClassStaticBlockDeclaration(f)){var n=e.getErrorSpanForNode(t,r);t.bindDiagnostics.push(e.createFileDiagnostic(t,n.start,n.length,function(r){return e.getContainingClass(r)?e.Diagnostics.Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Class_definitions_are_automatically_in_strict_mode:t.externalModuleIndicator?e.Diagnostics.Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Modules_are_automatically_in_strict_mode:e.Diagnostics.Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5}(r)));}}(r),Pe(r,16,110991)):ke(r,16,110991);}(n);case 170:return ke(n,16384,0);case 171:return nt(n,32768,46015);case 172:return nt(n,65536,78783);case 178:case 315:case 321:case 179:return function(t){var r=B(131072,J(t));j(r,t,131072);var n=B(2048,"__type");j(n,t,2048),n.members=e.createSymbolTable(),n.members.set(r.escapedName,r);}(n);case 181:case 320:case 194:return function(e){return Ae(e,2048,"__type")}(n);case 330:return function(t){W(t);var r=e.getHostSignatureFromJSDoc(t);r&&168!==r.kind&&j(r.symbol,r,32);}(n);case 204:return function(r){var n;if(function(e){e[e.Property=1]="Property",e[e.Accessor=2]="Accessor";}(n||(n={})),F&&!e.isAssignmentTarget(r))for(var i=new e.Map,a=0,o=r.properties;a<o.length;a++){var s=o[a];if(296!==s.kind&&79===s.name.kind){var c=s.name,l=294===s.kind||295===s.kind||168===s.kind?1:2,u=i.get(c.escapedText);if(u){if(1===l&&1===u){var _=e.getErrorSpanForNode(t,c);t.bindDiagnostics.push(e.createFileDiagnostic(t,_.start,_.length,e.Diagnostics.An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode));}}else i.set(c.escapedText,l);}}return Ae(r,4096,"__object")}(n);case 212:case 213:return function(r){return t.isDeclarationFile||8388608&r.flags||e.isAsyncFunction(r)&&(N|=2048),v&&(r.flowNode=v),Ie(r),Ae(r,16,r.name?r.name.escapedText:"__function")}(n);case 207:switch(e.getAssignmentDeclarationKind(n)){case 7:return function(e){var t=$e(e.arguments[0]),r=303===e.parent.parent.kind;Xe(e,t=Qe(t,e.arguments[0],r,!1,!1),!1);}(n);case 8:return function(e){if(ze(e)){var t=et(e.arguments[0],void 0,(function(e,t){return t&&j(t,e,67110400),t}));if(t){U(t.exports,t,e,1048580,0);}}}(n);case 9:return function(e){var t=$e(e.arguments[0].expression);t&&t.valueDeclaration&&j(t,t.valueDeclaration,32),Xe(e,t,!0);}(n);case 0:break;default:return e.Debug.fail("Unknown call expression assignment declaration kind")}e.isInJSFile(n)&&function(r){!t.commonJsModuleIndicator&&e.isRequireCall(r,!1)&&ze(r);}(n);break;case 225:case 256:return F=!0,function(r){256===r.kind?Pe(r,32,899503):(Ae(r,32,r.name?r.name.escapedText:"__class"),r.name&&P.add(r.name.escapedText));var n=r.symbol,i=B(4194308,"prototype"),a=n.exports.get(i.escapedName);a&&(r.name&&e.setParent(r.name,r),t.bindDiagnostics.push(R(a.declarations[0],e.Diagnostics.Duplicate_identifier_0,e.symbolName(i)))),n.exports.set(i.escapedName,i),i.parent=n;}(n);case 257:return Pe(n,64,788872);case 258:return Pe(n,524288,788968);case 259:return function(t){return e.isEnumConst(t)?Pe(t,128,899967):Pe(t,256,899327)}(n);case 260:return function(r){if(Ne(r),e.isAmbientModule(r))if(e.hasSyntacticModifier(r,1)&&Oe(r,e.Diagnostics.export_modifier_cannot_be_applied_to_ambient_modules_and_module_augmentations_since_they_are_always_visible),e.isModuleAugmentationExternal(r))Fe(r);else {var n=void 0;if(10===r.name.kind){var i=r.name.text;void 0===(n=e.tryParsePattern(i))&&Oe(r.name,e.Diagnostics.Pattern_0_can_have_at_most_one_Asterisk_character,i);}var a=ke(r,512,110735);t.patternAmbientModules=e.append(t.patternAmbientModules,n&&!e.isString(n)?{pattern:n,symbol:a}:void 0);}else {var o=Fe(r);0!==o&&((a=r.symbol).constEnumOnlyModule=!(304&a.flags)&&2===o&&!1!==a.constEnumOnlyModule);}}(n);case 285:return function(e){return Ae(e,4096,"__jsxAttributes")}(n);case 284:return function(e,t,r){return ke(e,4,0)}(n);case 264:case 267:case 269:case 274:return ke(n,2097152,2097152);case 263:return function(r){r.modifiers&&r.modifiers.length&&t.bindDiagnostics.push(R(r,e.Diagnostics.Modifiers_cannot_appear_here));var n=e.isSourceFile(r.parent)?e.isExternalModule(r.parent)?r.parent.isDeclarationFile?void 0:e.Diagnostics.Global_module_exports_may_only_appear_in_declaration_files:e.Diagnostics.Global_module_exports_may_only_appear_in_module_files:e.Diagnostics.Global_module_exports_may_only_appear_at_top_level;n?t.bindDiagnostics.push(R(r,n)):(t.symbol.globalExports=t.symbol.globalExports||e.createSymbolTable(),U(t.symbol.globalExports,t.symbol,r,2097152,2097152));}(n);case 266:return function(e){e.name&&ke(e,2097152,2097152);}(n);case 271:return function(t){l.symbol&&l.symbol.exports?t.exportClause?e.isNamespaceExport(t.exportClause)&&(e.setParent(t.exportClause,t),U(l.symbol.exports,l.symbol,t.exportClause,2097152,2097152)):U(l.symbol.exports,l.symbol,t,8388608,0):Ae(t,8388608,J(t));}(n);case 270:return function(t){if(l.symbol&&l.symbol.exports){var r=e.exportAssignmentIsAlias(t)?2097152:4,n=U(l.symbol.exports,l.symbol,t,r,67108863);t.isExportEquals&&e.setValueDeclaration(n,t);}else Ae(t,111551,J(t));}(n);case 303:return Be(n.statements),function(){if(Ne(t),e.isExternalModule(t))Je();else if(e.isJsonSourceFile(t)){Je();var r=t.symbol;U(t.symbol.exports,t.symbol,t,4,67108863),t.symbol=r;}}();case 234:if(!e.isFunctionLikeOrClassStaticBlockDeclaration(n.parent))return;case 261:return Be(n.statements);case 338:if(321===n.parent.kind)return rt(n);if(320!==n.parent.kind)break;case 345:var p=n;return ke(p,p.isBracketed||p.typeExpression&&314===p.typeExpression.type.kind?16777220:4,0);case 343:case 336:case 337:return (m||(m=[])).push(n)}}function Je(){Ae(t,512,'"'.concat(e.removeFileExtension(t.fileName),'"'));}function ze(e){return !t.externalModuleIndicator&&(t.commonJsModuleIndicator||(t.commonJsModuleIndicator=e,Je()),!0)}function Ue(t){if(ze(t)){var r=et(t.left.expression,void 0,(function(e,t){return t&&j(t,e,67110400),t}));if(r){var n=e.isAliasableExpression(t.right)&&(e.isExportsIdentifier(t.left.expression)||e.isModuleExportsAccessExpression(t.left.expression))?2097152:1048580;e.setParent(t.left,t),U(r.exports,r,t.left,n,0);}}}function Ke(e){U(t.symbol.exports,t.symbol,e,69206016,0);}function Ve(t){if(e.Debug.assert(e.isInJSFile(t)),!(e.isBinaryExpression(t)&&e.isPropertyAccessExpression(t.left)&&e.isPrivateIdentifier(t.left.name)||e.isPropertyAccessExpression(t)&&e.isPrivateIdentifier(t.name))){var r=e.getThisContainer(t,!1);switch(r.kind){case 255:case 212:var n=r.symbol;if(e.isBinaryExpression(r.parent)&&63===r.parent.operatorToken.kind){var i=r.parent.left;e.isBindableStaticAccessExpression(i)&&e.isPrototypeAccess(i.expression)&&(n=$e(i.expression.expression,p));}n&&n.valueDeclaration&&(n.members=n.members||e.createSymbolTable(),e.hasDynamicName(t)?qe(t,n,n.members):U(n.members,n,t,67108868,0),j(n,n.valueDeclaration,32));break;case 170:case 166:case 168:case 171:case 172:case 169:var a=r.parent,o=e.isStatic(r)?a.symbol.exports:a.symbol.members;e.hasDynamicName(t)?qe(t,a.symbol,o):U(o,a.symbol,t,67108868,0,!0);break;case 303:if(e.hasDynamicName(t))break;r.commonJsModuleIndicator?U(r.symbol.exports,r.symbol,t,1048580,0):ke(t,1,111550);break;default:e.Debug.failBadSyntaxKind(r);}}}function qe(e,t,r){U(r,t,e,4,0,!0,!0),We(e,t);}function We(t,r){r&&(r.assignmentDeclarationMembers||(r.assignmentDeclarationMembers=new e.Map)).set(e.getNodeId(t),t);}function He(t,r){var n=t.expression,i=n.expression;e.setParent(i,n),e.setParent(n,t),e.setParent(t,r),Ze(i,t,!0,!0);}function Ge(t){e.Debug.assert(!e.isIdentifier(t)),e.setParent(t.expression,t),Ze(t.expression,t,!1,!1);}function Qe(r,n,i,a,o){if(2097152&(null==r?void 0:r.flags))return r;if(i&&!a){var s=67110400;r=et(n,r,(function(r,n,i){return n?(j(n,r,s),n):U(i?i.exports:t.jsGlobalAugmentations||(t.jsGlobalAugmentations=e.createSymbolTable()),i,r,s,110735)}));}return o&&r&&r.valueDeclaration&&j(r,r.valueDeclaration,32),r}function Xe(t,r,n){if(r&&function(t){if(1072&t.flags)return !0;var r=t.valueDeclaration;if(r&&e.isCallExpression(r))return !!e.getAssignedExpandoInitializer(r);var n=r?e.isVariableDeclaration(r)?r.initializer:e.isBinaryExpression(r)?r.right:e.isPropertyAccessExpression(r)&&e.isBinaryExpression(r.parent)?r.parent.right:void 0:void 0;if(n=n&&e.getRightMostAssignedExpression(n)){var i=e.isPrototypeAccess(e.isVariableDeclaration(r)?r.name:e.isBinaryExpression(r)?r.left:r);return !!e.getExpandoInitializer(!e.isBinaryExpression(n)||56!==n.operatorToken.kind&&60!==n.operatorToken.kind?n:n.right,i)}return !1}(r)){var i=n?r.members||(r.members=e.createSymbolTable()):r.exports||(r.exports=e.createSymbolTable()),a=0,o=0;e.isFunctionLikeDeclaration(e.getAssignedExpandoInitializer(t))?(a=8192,o=103359):e.isCallExpression(t)&&e.isBindableObjectDefinePropertyCall(t)&&(e.some(t.arguments[2].properties,(function(t){var r=e.getNameOfDeclaration(t);return !!r&&e.isIdentifier(r)&&"set"===e.idText(r)}))&&(a|=65540,o|=78783),e.some(t.arguments[2].properties,(function(t){var r=e.getNameOfDeclaration(t);return !!r&&e.isIdentifier(r)&&"get"===e.idText(r)}))&&(a|=32772,o|=46015)),0===a&&(a=4,o=0),U(i,r,t,67108864|a,-67108865&o);}}function Ye(t){return e.isBinaryExpression(t.parent)?303===function(t){for(;e.isBinaryExpression(t.parent);)t=t.parent;return t.parent}(t.parent).parent.kind:303===t.parent.parent.kind}function Ze(e,t,r,n){var i=$e(e,l)||$e(e,f),a=Ye(t);Xe(t,i=Qe(i,t.expression,a,r,n),r);}function $e(t,r){if(void 0===r&&(r=l),e.isIdentifier(t))return d(r,t.escapedText);var n=$e(t.expression);return n&&n.exports&&n.exports.get(e.getElementOrPropertyAccessName(t))}function et(r,n,i){if(_(t,r))return t.symbol;if(e.isIdentifier(r))return i(r,$e(r),n);var a=et(r.expression,n,i),o=e.getNameOrArgument(r);return e.isPrivateIdentifier(o)&&e.Debug.fail("unexpected PrivateIdentifier"),i(o,a&&a.exports&&a.exports.get(e.getElementOrPropertyAccessName(r)),a)}function tt(t){F&&we(t,t.name),e.isBindingPattern(t.name)||(e.isInJSFile(t)&&e.isRequireVariableDeclaration(t)&&!e.getJSDocTypeTag(t)?ke(t,2097152,2097152):e.isBlockOrCatchScoped(t)?Pe(t,2,111551):e.isParameterDeclaration(t)?ke(t,1,111551):ke(t,1,111550));}function rt(t){if((338!==t.kind||321===l.kind)&&(!F||8388608&t.flags||we(t,t.name),e.isBindingPattern(t.name)?Ae(t,1,"__"+t.parent.parameters.indexOf(t)):ke(t,1,111551),e.isParameterPropertyDeclaration(t,t.parent))){var r=t.parent.parent;U(r.symbol.members,r.symbol,t,4|(t.questionToken?16777216:0),0);}}function nt(r,n,i){return t.isDeclarationFile||8388608&r.flags||!e.isAsyncFunction(r)||(N|=2048),v&&e.isObjectLiteralOrClassExpressionMethodOrAccessor(r)&&(r.flowNode=v),e.hasDynamicName(r)?Ae(r,n,"__computed"):ke(r,n,i)}}();function u(t){return !(e.isFunctionDeclaration(t)||function(t){switch(t.kind){case 257:case 258:return !0;case 260:return 1!==a(t);case 259:return e.hasSyntacticModifier(t,2048);default:return !1}}(t)||e.isEnumDeclaration(t)||e.isVariableStatement(t)&&!(3&e.getCombinedNodeFlags(t))&&t.declarationList.declarations.some((function(e){return !e.initializer})))}function _(t,r){for(var n=0,i=[r];i.length&&n<100;){if(n++,r=i.shift(),e.isExportsIdentifier(r)||e.isModuleExportsAccessExpression(r))return !0;if(e.isIdentifier(r)){var a=d(t,r.escapedText);if(a&&a.valueDeclaration&&e.isVariableDeclaration(a.valueDeclaration)&&a.valueDeclaration.initializer){var o=a.valueDeclaration.initializer;i.push(o),e.isAssignmentExpression(o,!0)&&(i.push(o.left),i.push(o.right));}}}return !1}function d(t,r){var n=t.locals&&t.locals.get(r);return n?n.exportSymbol||n:e.isSourceFile(t)&&t.jsGlobalAugmentations&&t.jsGlobalAugmentations.has(r)?t.jsGlobalAugmentations.get(r):t.symbol&&t.symbol.exports&&t.symbol.exports.get(r)}e.bindSourceFile=function(t,r){null===e.tracing||void 0===e.tracing||e.tracing.push("bind","bindSourceFile",{path:t.path},!0),e.performance.mark("beforeBind"),e.perfLogger.logStartBindFile(""+t.fileName),l(t,r),e.perfLogger.logStopBindFile(),e.performance.mark("afterBind"),e.performance.measure("Bind","beforeBind","afterBind"),null===e.tracing||void 0===e.tracing||e.tracing.pop();},e.isExportsOrModuleExportsOrAlias=_;}(t),function(e){e.createGetSymbolWalker=function(t,r,n,i,a,o,s,c,l,u){return function(_){void 0===_&&(_=function(){return !0});var d=[],p=[];return {walkType:function(t){try{return f(t),{visitedTypes:e.getOwnValues(d),visitedSymbols:e.getOwnValues(p)}}finally{e.clear(d),e.clear(p);}},walkSymbol:function(t){try{return y(t),{visitedTypes:e.getOwnValues(d),visitedSymbols:e.getOwnValues(p)}}finally{e.clear(d),e.clear(p);}}};function f(t){if(t&&!d[t.id]&&(d[t.id]=t,!y(t.symbol))){if(524288&t.flags){var r=t,n=r.objectFlags;4&n&&function(t){f(t.target),e.forEach(u(t),f);}(t),32&n&&function(e){f(e.typeParameter),f(e.constraintType),f(e.templateType),f(e.modifiersType);}(t),3&n&&(m(a=t),e.forEach(a.typeParameters,f),e.forEach(i(a),f),f(a.thisType)),24&n&&m(r);}var a;262144&t.flags&&function(e){f(c(e));}(t),3145728&t.flags&&function(t){e.forEach(t.types,f);}(t),4194304&t.flags&&function(e){f(e.type);}(t),8388608&t.flags&&function(e){f(e.objectType),f(e.indexType),f(e.constraint);}(t);}}function g(i){var a=r(i);a&&f(a.type),e.forEach(i.typeParameters,f);for(var o=0,s=i.parameters;o<s.length;o++)y(s[o]);f(t(i)),f(n(i));}function m(e){for(var t=a(e),r=0,n=t.indexInfos;r<n.length;r++){var i=n[r];f(i.keyType),f(i.type);}for(var o=0,s=t.callSignatures;o<s.length;o++)g(s[o]);for(var c=0,l=t.constructSignatures;c<l.length;c++)g(l[c]);for(var u=0,_=t.properties;u<_.length;u++)y(_[u]);}function y(t){if(!t)return !1;var r=e.getSymbolId(t);return !p[r]&&(p[r]=t,!_(t)||(f(o(t)),t.exports&&t.exports.forEach(y),e.forEach(t.declarations,(function(e){if(e.type&&180===e.type.kind){var t=e.type;y(s(l(t.exprName)));}})),!1))}}};}(t),function(e){var t,r,a,s,c=/^".+"$/,l="(anonymous)",u=1,_=1,d=1,p=1;!function(e){e[e.AllowsSyncIterablesFlag=1]="AllowsSyncIterablesFlag",e[e.AllowsAsyncIterablesFlag=2]="AllowsAsyncIterablesFlag",e[e.AllowsStringInputFlag=4]="AllowsStringInputFlag",e[e.ForOfFlag=8]="ForOfFlag",e[e.YieldStarFlag=16]="YieldStarFlag",e[e.SpreadFlag=32]="SpreadFlag",e[e.DestructuringFlag=64]="DestructuringFlag",e[e.PossiblyOutOfBounds=128]="PossiblyOutOfBounds",e[e.Element=1]="Element",e[e.Spread=33]="Spread",e[e.Destructuring=65]="Destructuring",e[e.ForOf=13]="ForOf",e[e.ForAwaitOf=15]="ForAwaitOf",e[e.YieldStar=17]="YieldStar",e[e.AsyncYieldStar=19]="AsyncYieldStar",e[e.GeneratorReturnType=1]="GeneratorReturnType",e[e.AsyncGeneratorReturnType=2]="AsyncGeneratorReturnType";}(t||(t={})),function(e){e[e.Yield=0]="Yield",e[e.Return=1]="Return",e[e.Next=2]="Next";}(r||(r={})),function(e){e[e.Normal=0]="Normal",e[e.FunctionReturn=1]="FunctionReturn",e[e.GeneratorNext=2]="GeneratorNext",e[e.GeneratorYield=3]="GeneratorYield";}(a||(a={})),function(e){e[e.None=0]="None",e[e.TypeofEQString=1]="TypeofEQString",e[e.TypeofEQNumber=2]="TypeofEQNumber",e[e.TypeofEQBigInt=4]="TypeofEQBigInt",e[e.TypeofEQBoolean=8]="TypeofEQBoolean",e[e.TypeofEQSymbol=16]="TypeofEQSymbol",e[e.TypeofEQObject=32]="TypeofEQObject",e[e.TypeofEQFunction=64]="TypeofEQFunction",e[e.TypeofEQHostObject=128]="TypeofEQHostObject",e[e.TypeofNEString=256]="TypeofNEString",e[e.TypeofNENumber=512]="TypeofNENumber",e[e.TypeofNEBigInt=1024]="TypeofNEBigInt",e[e.TypeofNEBoolean=2048]="TypeofNEBoolean",e[e.TypeofNESymbol=4096]="TypeofNESymbol",e[e.TypeofNEObject=8192]="TypeofNEObject",e[e.TypeofNEFunction=16384]="TypeofNEFunction",e[e.TypeofNEHostObject=32768]="TypeofNEHostObject",e[e.EQUndefined=65536]="EQUndefined",e[e.EQNull=131072]="EQNull",e[e.EQUndefinedOrNull=262144]="EQUndefinedOrNull",e[e.NEUndefined=524288]="NEUndefined",e[e.NENull=1048576]="NENull",e[e.NEUndefinedOrNull=2097152]="NEUndefinedOrNull",e[e.Truthy=4194304]="Truthy",e[e.Falsy=8388608]="Falsy",e[e.All=16777215]="All",e[e.BaseStringStrictFacts=3735041]="BaseStringStrictFacts",e[e.BaseStringFacts=12582401]="BaseStringFacts",e[e.StringStrictFacts=16317953]="StringStrictFacts",e[e.StringFacts=16776705]="StringFacts",e[e.EmptyStringStrictFacts=12123649]="EmptyStringStrictFacts",e[e.EmptyStringFacts=12582401]="EmptyStringFacts",e[e.NonEmptyStringStrictFacts=7929345]="NonEmptyStringStrictFacts",e[e.NonEmptyStringFacts=16776705]="NonEmptyStringFacts",e[e.BaseNumberStrictFacts=3734786]="BaseNumberStrictFacts",e[e.BaseNumberFacts=12582146]="BaseNumberFacts",e[e.NumberStrictFacts=16317698]="NumberStrictFacts",e[e.NumberFacts=16776450]="NumberFacts",e[e.ZeroNumberStrictFacts=12123394]="ZeroNumberStrictFacts",e[e.ZeroNumberFacts=12582146]="ZeroNumberFacts",e[e.NonZeroNumberStrictFacts=7929090]="NonZeroNumberStrictFacts",e[e.NonZeroNumberFacts=16776450]="NonZeroNumberFacts",e[e.BaseBigIntStrictFacts=3734276]="BaseBigIntStrictFacts",e[e.BaseBigIntFacts=12581636]="BaseBigIntFacts",e[e.BigIntStrictFacts=16317188]="BigIntStrictFacts",e[e.BigIntFacts=16775940]="BigIntFacts",e[e.ZeroBigIntStrictFacts=12122884]="ZeroBigIntStrictFacts",e[e.ZeroBigIntFacts=12581636]="ZeroBigIntFacts",e[e.NonZeroBigIntStrictFacts=7928580]="NonZeroBigIntStrictFacts",e[e.NonZeroBigIntFacts=16775940]="NonZeroBigIntFacts",e[e.BaseBooleanStrictFacts=3733256]="BaseBooleanStrictFacts",e[e.BaseBooleanFacts=12580616]="BaseBooleanFacts",e[e.BooleanStrictFacts=16316168]="BooleanStrictFacts",e[e.BooleanFacts=16774920]="BooleanFacts",e[e.FalseStrictFacts=12121864]="FalseStrictFacts",e[e.FalseFacts=12580616]="FalseFacts",e[e.TrueStrictFacts=7927560]="TrueStrictFacts",e[e.TrueFacts=16774920]="TrueFacts",e[e.SymbolStrictFacts=7925520]="SymbolStrictFacts",e[e.SymbolFacts=16772880]="SymbolFacts",e[e.ObjectStrictFacts=7888800]="ObjectStrictFacts",e[e.ObjectFacts=16736160]="ObjectFacts",e[e.FunctionStrictFacts=7880640]="FunctionStrictFacts",e[e.FunctionFacts=16728e3]="FunctionFacts",e[e.UndefinedFacts=9830144]="UndefinedFacts",e[e.NullFacts=9363232]="NullFacts",e[e.EmptyObjectStrictFacts=16318463]="EmptyObjectStrictFacts",e[e.AllTypeofNE=556800]="AllTypeofNE",e[e.EmptyObjectFacts=16777215]="EmptyObjectFacts";}(s||(s={}));var f,g,m,y,v,h,b,x,D,S=new e.Map(e.getEntries({string:1,number:2,bigint:4,boolean:8,symbol:16,undefined:65536,object:32,function:64})),T=new e.Map(e.getEntries({string:256,number:512,bigint:1024,boolean:2048,symbol:4096,undefined:524288,object:8192,function:16384}));!function(e){e[e.Type=0]="Type",e[e.ResolvedBaseConstructorType=1]="ResolvedBaseConstructorType",e[e.DeclaredType=2]="DeclaredType",e[e.ResolvedReturnType=3]="ResolvedReturnType",e[e.ImmediateBaseConstraint=4]="ImmediateBaseConstraint",e[e.EnumTagType=5]="EnumTagType",e[e.ResolvedTypeArguments=6]="ResolvedTypeArguments",e[e.ResolvedBaseTypes=7]="ResolvedBaseTypes";}(f||(f={})),function(e){e[e.Normal=0]="Normal",e[e.Contextual=1]="Contextual",e[e.Inferential=2]="Inferential",e[e.SkipContextSensitive=4]="SkipContextSensitive",e[e.SkipGenericFunctions=8]="SkipGenericFunctions",e[e.IsForSignatureHelp=16]="IsForSignatureHelp";}(g||(g={})),function(e){e[e.BivariantCallback=1]="BivariantCallback",e[e.StrictCallback=2]="StrictCallback",e[e.IgnoreReturnTypes=4]="IgnoreReturnTypes",e[e.StrictArity=8]="StrictArity",e[e.Callback=3]="Callback";}(m||(m={})),function(e){e[e.None=0]="None",e[e.Source=1]="Source",e[e.Target=2]="Target",e[e.PropertyCheck=4]="PropertyCheck",e[e.UnionIntersectionCheck=8]="UnionIntersectionCheck",e[e.InPropertyCheck=16]="InPropertyCheck";}(y||(y={})),function(e){e[e.None=0]="None",e[e.Source=1]="Source",e[e.Target=2]="Target",e[e.Both=3]="Both";}(v||(v={})),function(e){e[e.IncludeReadonly=1]="IncludeReadonly",e[e.ExcludeReadonly=2]="ExcludeReadonly",e[e.IncludeOptional=4]="IncludeOptional",e[e.ExcludeOptional=8]="ExcludeOptional";}(h||(h={})),function(e){e[e.None=0]="None",e[e.Source=1]="Source",e[e.Target=2]="Target",e[e.Both=3]="Both";}(b||(b={})),function(e){e.resolvedExports="resolvedExports",e.resolvedMembers="resolvedMembers";}(x||(x={})),function(e){e[e.Local=0]="Local",e[e.Parameter=1]="Parameter";}(D||(D={}));var C,E,k,N,F=e.and(R,(function(t){return !e.isAccessor(t)}));!function(e){e[e.GetAccessor=1]="GetAccessor",e[e.SetAccessor=2]="SetAccessor",e[e.PropertyAssignment=4]="PropertyAssignment",e[e.Method=8]="Method",e[e.PrivateStatic=16]="PrivateStatic",e[e.GetOrSetAccessor=3]="GetOrSetAccessor",e[e.PropertyAssignmentOrMethod=12]="PropertyAssignmentOrMethod";}(C||(C={})),function(e){e[e.None=0]="None",e[e.ExportValue=1]="ExportValue",e[e.ExportType=2]="ExportType",e[e.ExportNamespace=4]="ExportNamespace";}(E||(E={})),function(e){e[e.None=0]="None",e[e.StrongArityForUntypedJS=1]="StrongArityForUntypedJS",e[e.VoidIsNonOptional=2]="VoidIsNonOptional";}(k||(k={})),function(e){e[e.Uppercase=0]="Uppercase",e[e.Lowercase=1]="Lowercase",e[e.Capitalize=2]="Capitalize",e[e.Uncapitalize=3]="Uncapitalize";}(N||(N={}));var A,P=new e.Map(e.getEntries({Uppercase:0,Lowercase:1,Capitalize:2,Uncapitalize:3}));function w(){}function I(){this.flags=0;}function O(e){return e.id||(e.id=_,_++),e.id}function M(e){return e.id||(e.id=u,u++),e.id}function L(t,r){var n=e.getModuleInstanceState(t);return 1===n||r&&2===n}function R(e){return 255!==e.kind&&168!==e.kind||!!e.body}function B(t){switch(t.parent.kind){case 269:case 274:return e.isIdentifier(t);default:return e.isDeclarationName(t)}}function j(e){switch(e){case 0:return "yieldType";case 1:return "returnType";case 2:return "nextType"}}function J(e){return !!(1&e.flags)}function z(e){return !!(2&e.flags)}e.getNodeId=O,e.getSymbolId=M,e.isInstantiatedModule=L,e.createTypeChecker=function(t,r){var a,s,u,_,f=e.memoize((function(){var r=new e.Map;return t.getSourceFiles().forEach((function(e){e.resolvedModules&&e.resolvedModules.forEach((function(e){e&&e.packageId&&r.set(e.packageId.name,".d.ts"===e.extension||!!r.get(e.packageId.name));}));})),r})),g=e.objectAllocator.getSymbolConstructor(),m=e.objectAllocator.getTypeConstructor(),y=e.objectAllocator.getSignatureConstructor(),v=0,h=0,b=0,x=0,D=0,C=0,E=0,k=e.createSymbolTable(),N=[1],U=t.getCompilerOptions(),K=e.getEmitScriptTarget(U),V=e.getEmitModuleKind(U),q=e.getUseDefineForClassFields(U),W=e.getAllowSyntheticDefaultImports(U),H=e.getStrictOptionValue(U,"strictNullChecks"),G=e.getStrictOptionValue(U,"strictFunctionTypes"),Q=e.getStrictOptionValue(U,"strictBindCallApply"),X=e.getStrictOptionValue(U,"strictPropertyInitialization"),Y=e.getStrictOptionValue(U,"noImplicitAny"),Z=e.getStrictOptionValue(U,"noImplicitThis"),$=e.getStrictOptionValue(U,"useUnknownInCatchVariables"),ee=!!U.keyofStringsOnly,te=U.suppressExcessPropertyErrors?0:16384,re=U.exactOptionalPropertyTypes,ne=function(){var t=e.createBinaryExpressionTrampoline((function(t,r,i){return r?(r.stackIndex++,r.skip=!1,n(r,void 0),a(r,void 0)):r={checkMode:i,skip:!1,stackIndex:0,typeStack:[void 0,void 0]},e.isInJSFile(t)&&e.getAssignedExpandoInitializer(t)?(r.skip=!0,a(r,ax(t.right,i)),r):(function(t){var r=t.left,n=t.operatorToken,i=t.right;60===n.kind&&(!e.isBinaryExpression(r)||56!==r.operatorToken.kind&&55!==r.operatorToken.kind||YT(r,e.Diagnostics._0_and_1_operations_cannot_be_mixed_without_parentheses,e.tokenToString(r.operatorToken.kind),e.tokenToString(n.kind)),!e.isBinaryExpression(i)||56!==i.operatorToken.kind&&55!==i.operatorToken.kind||YT(i,e.Diagnostics._0_and_1_operations_cannot_be_mixed_without_parentheses,e.tokenToString(i.operatorToken.kind),e.tokenToString(n.kind)));}(t),63!==t.operatorToken.kind||204!==t.left.kind&&203!==t.left.kind||(r.skip=!0,a(r,Ib(t.left,ax(t.right,i),i,108===t.right.kind))),r)}),(function(e,t,n){if(!t.skip)return r(t,e)}),(function(t,r,o){if(!r.skip){var s=i(r);e.Debug.assertIsDefined(s),n(r,s),a(r,void 0);var c=t.kind;if(55===c||56===c||60===c){if(55===c){var l=e.walkUpParenthesizedExpressions(o.parent);fD(o.left,s,e.isIfStatement(l)?l.thenStatement:void 0);}gD(s,o.left);}}}),(function(e,t,n){if(!t.skip)return r(t,e)}),(function(t,r){var o;if(r.skip)o=i(r);else {var s=function(e){return e.typeStack[e.stackIndex]}(r);e.Debug.assertIsDefined(s);var c=i(r);e.Debug.assertIsDefined(c),o=Lb(t.left,t.operatorToken,t.right,s,c,t);}return r.skip=!1,n(r,void 0),a(r,void 0),r.stackIndex--,o}),(function(e,t,r){return a(e,t),e}));return function(r,n){var i=t(r,n);return e.Debug.assertIsDefined(i),i};function r(t,r){if(e.isBinaryExpression(r))return r;a(t,ax(r,t.checkMode));}function n(e,t){e.typeStack[e.stackIndex]=t;}function i(e){return e.typeStack[e.stackIndex+1]}function a(e,t){e.typeStack[e.stackIndex+1]=t;}}(),ie=function(){var r,n=t.getResolvedTypeReferenceDirectives();return n&&(r=new e.Map,n.forEach((function(e,r){if(e&&e.resolvedFileName){var n=t.getSourceFile(e.resolvedFileName);n&&a(n,r);}}))),{getReferencedExportContainer:qS,getReferencedImportDeclaration:WS,getReferencedDeclarationWithCollidingName:GS,isDeclarationWithCollidingName:QS,isValueAliasDeclaration:function(t){var r=e.getParseTreeNode(t);return !r||XS(r)},hasGlobalName:gT,isReferencedAliasDeclaration:function(t,r){var n=e.getParseTreeNode(t);return !n||eT(n,r)},getNodeCheckFlags:function(t){var r=e.getParseTreeNode(t);return r?oT(r):0},isTopLevelValueImportEqualsWithEntityName:YS,isDeclarationVisible:Ha,isImplementationOfOverload:tT,isRequiredInitializedParameter:rT,isOptionalUninitializedParameterProperty:nT,isExpandoFunctionDeclaration:iT,getPropertiesOfContainerFunction:aT,createTypeOfDeclaration:dT,createReturnTypeOfSignatureDeclaration:pT,createTypeOfExpression:fT,createLiteralConstValue:hT,isSymbolAccessible:Ea,isEntityNameVisible:wa,getConstantValue:function(t){var r=e.getParseTreeNode(t,cT);return r?lT(r):void 0},collectLinkedAliases:Ga,getReferencedValueDeclaration:yT,getTypeReferenceSerializationKind:_T,isOptionalParameter:nl,moduleExportsSomeValue:VS,isArgumentsLocalBinding:KS,getExternalModuleFileFromDeclaration:function(t){var r=e.getParseTreeNode(t,e.hasPossibleExternalModuleReference);return r&&DT(r)},getTypeReferenceDirectivesForEntityName:function(e){if(r){var t=790504;(79===e.kind&&Tg(e)||205===e.kind&&!function(e){return e.parent&&227===e.parent.kind&&e.parent.parent&&290===e.parent.parent.kind}(e))&&(t=1160127);var n=Mi(e,t,!0);return n&&n!==Ne?i(n,t):void 0}},getTypeReferenceDirectivesForSymbol:i,isLiteralConstDeclaration:vT,isLateBound:function(t){var r=e.getParseTreeNode(t,e.isDeclaration),n=r&&$i(r);return !!(n&&4096&e.getCheckFlags(n))},getJsxFactoryEntity:bT,getJsxFragmentFactoryEntity:xT,getAllAccessorDeclarations:function(t){var r=172===(t=e.getParseTreeNode(t,e.isGetOrSetAccessorDeclaration)).kind?171:172,n=e.getDeclarationOfKind($i(t),r);return {firstAccessor:n&&n.pos<t.pos?n:t,secondAccessor:n&&n.pos<t.pos?t:n,setAccessor:172===t.kind?t:n,getAccessor:171===t.kind?t:n}},getSymbolOfExternalModuleSpecifier:function(e){return Bi(e,e,void 0)},isBindingCapturedByNode:function(t,r){var n=e.getParseTreeNode(t),i=e.getParseTreeNode(r);return !!n&&!!i&&(e.isVariableDeclaration(i)||e.isBindingElement(i))&&function(t,r){var n=Qn(t);return !!n&&e.contains(n.capturedBlockScopeBindings,$i(r))}(n,i)},getDeclarationStatementsForSourceFile:function(t,r,n,i){var a=e.getParseTreeNode(t);e.Debug.assert(a&&303===a.kind,"Non-sourcefile node passed into getDeclarationsForSourceFile");var o=$i(t);return o?o.exports?ae.symbolTableToDeclarationStatements(o.exports,t,r,n,i):[]:t.locals?ae.symbolTableToDeclarationStatements(t.locals,t,r,n,i):[]},isImportRequiredByAugmentation:function(t){var r=e.getSourceFileOfNode(t);if(!r.symbol)return !1;var n=DT(t);if(!n)return !1;if(n===r)return !1;for(var i=Qi(r.symbol),a=0,o=e.arrayFrom(i.values());a<o.length;a++){var s=o[a];if(s.mergeId){var c=Zi(s);if(c.declarations)for(var l=0,u=c.declarations;l<u.length;l++){var _=u[l];if(e.getSourceFileOfNode(_)===n)return !0}}}return !1}};function i(t,n){if(r&&function(t){if(!t.declarations)return !1;for(var n=t;;){var i=ea(n);if(!i)break;n=i;}if(n.valueDeclaration&&303===n.valueDeclaration.kind&&512&n.flags)return !1;for(var a=0,o=t.declarations;a<o.length;a++){var s=o[a],c=e.getSourceFileOfNode(s);if(r.has(c.path))return !0}return !1}(t)){for(var i,a=0,o=t.declarations;a<o.length;a++){var s=o[a];if(s.symbol&&s.symbol.flags&n){var c=e.getSourceFileOfNode(s),l=r.get(c.path);if(!l)return;(i||(i=[])).push(l);}}return i}}function a(n,i){if(!r.has(n.path)){r.set(n.path,i);for(var o=0,s=n.referencedFiles;o<s.length;o++){var c=s[o].fileName,l=e.resolveTripleslashReference(c,n.fileName),u=t.getSourceFile(l);u&&a(u,i);}}}}(),ae=function(){return {typeToTypeNode:function(e,t,n,i){return r(t,n,i,(function(t){return l(e,t)}))},indexInfoToIndexSignatureDeclaration:function(e,t,n,i){return r(t,n,i,(function(t){return f(e,t,void 0)}))},signatureToSignatureDeclaration:function(e,t,n,i,a){return r(n,i,a,(function(r){return g(e,t,r)}))},symbolToEntityName:function(e,t,n,i,a){return r(n,i,a,(function(r){return A(e,r,t,!1)}))},symbolToExpression:function(e,t,n,i,a){return r(n,i,a,(function(r){return P(e,r,t)}))},symbolToTypeParameterDeclarations:function(e,t,n,i){return r(t,n,i,(function(t){return D(e,t)}))},symbolToParameterDeclaration:function(e,t,n,i){return r(t,n,i,(function(t){return v(e,t)}))},typeParameterToDeclaration:function(e,t,n,i){return r(t,n,i,(function(t){return y(e,t)}))},symbolTableToDeclarationStatements:function(t,a,s,c,u){return r(a,s,c,(function(r){return function(t,r,a){var s=X(e.factory.createPropertyDeclaration,168,!0),c=X((function(t,r,n,i,a){return e.factory.createPropertySignature(r,n,i,a)}),167,!1),u=r.enclosingDeclaration,_=[],d=new e.Set,p=[],m=r;(r=i$1(i$1({},m),{usedSymbolNames:new e.Set(m.usedSymbolNames),remappedSymbolNames:new e.Map,tracker:i$1(i$1({},m.tracker),{trackSymbol:function(e,t,n){if(0===Ea(e,t,n,!1).accessibility){var i=x(e,r,n);4&e.flags||F(i[0]);}else if(m.tracker&&m.tracker.trackSymbol)return m.tracker.trackSymbol(e,t,n);return !1}})})).tracker=o(r,r.tracker),e.forEachEntry(t,(function(t,r){ne(t,e.unescapeLeadingUnderscores(r));}));var v,h=!a,b=t.get("export=");return b&&t.size>1&&2097152&b.flags&&(t=e.createSymbolTable()).set("export=",b),k(t),v=function(t){var r=e.findIndex(t,(function(t){return e.isExportDeclaration(t)&&!t.moduleSpecifier&&!t.assertClause&&!!t.exportClause&&e.isNamedExports(t.exportClause)}));if(r>=0){var n=t[r],i=e.mapDefined(n.exportClause.elements,(function(r){if(!r.propertyName){var n=e.indicesOf(t),i=e.filter(n,(function(n){return e.nodeHasName(t[n],r.name)}));if(e.length(i)&&e.every(i,(function(e){return S(t[e])}))){for(var a=0,o=i;a<o.length;a++){var s=o[a];t[s]=T(t[s]);}return}}return r}));e.length(i)?t[r]=e.factory.updateExportDeclaration(n,n.decorators,n.modifiers,n.isTypeOnly,e.factory.updateNamedExports(n.exportClause,i),n.moduleSpecifier,n.assertClause):e.orderedRemoveItemAt(t,r);}return t}(v=function(t){var r=e.filter(t,(function(t){return e.isExportDeclaration(t)&&!t.moduleSpecifier&&!!t.exportClause&&e.isNamedExports(t.exportClause)}));if(e.length(r)>1){var i=e.filter(t,(function(t){return !e.isExportDeclaration(t)||!!t.moduleSpecifier||!t.exportClause}));t=n$3(n$3([],i,!0),[e.factory.createExportDeclaration(void 0,void 0,!1,e.factory.createNamedExports(e.flatMap(r,(function(t){return e.cast(t.exportClause,e.isNamedExports).elements}))),void 0)],!1);}var a=e.filter(t,(function(t){return e.isExportDeclaration(t)&&!!t.moduleSpecifier&&!!t.exportClause&&e.isNamedExports(t.exportClause)}));if(e.length(a)>1){var o=e.group(a,(function(t){return e.isStringLiteral(t.moduleSpecifier)?">"+t.moduleSpecifier.text:">"}));if(o.length!==a.length)for(var s=function(r){r.length>1&&(t=n$3(n$3([],e.filter(t,(function(e){return -1===r.indexOf(e)})),!0),[e.factory.createExportDeclaration(void 0,void 0,!1,e.factory.createNamedExports(e.flatMap(r,(function(t){return e.cast(t.exportClause,e.isNamedExports).elements}))),r[0].moduleSpecifier)],!1));},c=0,l=o;c<l.length;c++)s(l[c]);}return t}(v=function(t){var r=e.find(t,e.isExportAssignment),i=e.findIndex(t,e.isModuleDeclaration),a=-1!==i?t[i]:void 0;if(a&&r&&r.isExportEquals&&e.isIdentifier(r.expression)&&e.isIdentifier(a.name)&&e.idText(a.name)===e.idText(r.expression)&&a.body&&e.isModuleBlock(a.body)){var o=e.filter(t,(function(t){return !!(1&e.getEffectiveModifierFlags(t))})),s=a.name,c=a.body;if(e.length(o)&&(a=e.factory.updateModuleDeclaration(a,a.decorators,a.modifiers,a.name,c=e.factory.updateModuleBlock(c,e.factory.createNodeArray(n$3(n$3([],a.body.statements,!0),[e.factory.createExportDeclaration(void 0,void 0,!1,e.factory.createNamedExports(e.map(e.flatMap(o,(function(t){return r=t,e.isVariableStatement(r)?e.filter(e.map(r.declarationList.declarations,e.getNameOfDeclaration),D):e.filter([e.getNameOfDeclaration(r)],D);var r;})),(function(t){return e.factory.createExportSpecifier(!1,void 0,t)}))),void 0)],!1)))),t=n$3(n$3(n$3([],t.slice(0,i),!0),[a],!1),t.slice(i+1),!0)),!e.find(t,(function(t){return t!==a&&e.nodeHasName(t,s)}))){_=[];var l=!e.some(c.statements,(function(t){return e.hasSyntacticModifier(t,1)||e.isExportAssignment(t)||e.isExportDeclaration(t)}));e.forEach(c.statements,(function(e){w(e,l?1:0);})),t=n$3(n$3([],e.filter(t,(function(e){return e!==a&&e!==r})),!0),_,!0);}}return t}(v=_))),u&&(e.isSourceFile(u)&&e.isExternalOrCommonJsModule(u)||e.isModuleDeclaration(u))&&(!e.some(v,e.isExternalModuleIndicator)||!e.hasScopeMarker(v)&&e.some(v,e.needsScopeMarker))&&v.push(e.createEmptyExports(e.factory)),v;function D(e){return !!e&&79===e.kind}function S(t){return e.isEnumDeclaration(t)||e.isVariableStatement(t)||e.isFunctionDeclaration(t)||e.isClassDeclaration(t)||e.isModuleDeclaration(t)&&!e.isExternalModuleAugmentation(t)&&!e.isGlobalScopeAugmentation(t)||e.isInterfaceDeclaration(t)||NS(t)}function T(t){var r=-3&(1|e.getEffectiveModifierFlags(t));return e.factory.updateModifiers(t,r)}function E(t){var r=-2&e.getEffectiveModifierFlags(t);return e.factory.updateModifiers(t,r)}function k(t,r,n){r||p.push(new e.Map),t.forEach((function(e){N(e,!1,!!n);})),r||(p[p.length-1].forEach((function(e){N(e,!0,!!n);})),p.pop());}function N(t,_,p){var f=Zi(t);if(!d.has(M(f))&&(d.add(M(f)),!_||e.length(t.declarations)&&e.some(t.declarations,(function(t){return !!e.findAncestor(t,(function(e){return e===u}))})))){var g=r;r=function(t){var r=i$1({},t);return r.typeParameterNames&&(r.typeParameterNames=new e.Map(r.typeParameterNames)),r.typeParameterNamesByText&&(r.typeParameterNamesByText=new e.Set(r.typeParameterNamesByText)),r.typeParameterSymbolList&&(r.typeParameterSymbolList=new e.Set(r.typeParameterSymbolList)),r.tracker=o(r,r.tracker),r}(r);var v=function(t,i,o){var _,d,p=e.unescapeLeadingUnderscores(t.escapedName),f="default"===t.escapedName;if(!i||131072&r.flags||!e.isStringANonContextualKeyword(p)||f){var g=f&&!!(-113&t.flags||16&t.flags&&e.length(yc(Uo(t))))&&!(2097152&t.flags),m=!g&&!i&&e.isStringANonContextualKeyword(p)&&!f;(g||m)&&(i=!0);var v=(i?0:1)|(f&&!g?512:0),h=1536&t.flags&&7&t.flags&&"export="!==t.escapedName,b=h&&Q(Uo(t),t);if((8208&t.flags||b)&&O(Uo(t),t,ne(t,p),v),524288&t.flags&&function(t,n,i){var o,s=cs(t),c=Gn(t).typeParameters,u=e.map(c,(function(e){return y(e,r)})),_=null===(o=t.declarations)||void 0===o?void 0:o.find(e.isJSDocTypeAlias),d=e.getTextOfJSDocComment(_?_.comment||_.parent.comment:void 0),p=r.flags;r.flags|=8388608;var f=r.enclosingDeclaration;r.enclosingDeclaration=_;var g=_&&_.typeExpression&&e.isJSDocTypeExpression(_.typeExpression)&&V(r,_.typeExpression.type,F,a)||l(s,r);w(e.setSyntheticLeadingComments(e.factory.createTypeAliasDeclaration(void 0,void 0,ne(t,n),u,g),d?[{kind:3,text:"*\n * "+d.replace(/\n/g,"\n * ")+"\n ",pos:-1,end:-1,hasTrailingNewLine:!0}]:[]),i),r.flags=p,r.enclosingDeclaration=f;}(t,p,v),7&t.flags&&"export="!==t.escapedName&&!(4194304&t.flags)&&!(32&t.flags)&&!b)if(o)G(t)&&(m=!1,g=!1);else {var x=Uo(t),D=ne(t,p);if(16&t.flags||!Q(x,t)){var S=2&t.flags?Mm(t)?2:1:void 0,T=!g&&4&t.flags?te(D,t):D,E=t.declarations&&e.find(t.declarations,(function(t){return e.isVariableDeclaration(t)}));E&&e.isVariableDeclarationList(E.parent)&&1===E.parent.declarations.length&&(E=E.parent.parent);var k=null===(_=t.declarations)||void 0===_?void 0:_.find(e.isPropertyAccessExpression);if(k&&e.isBinaryExpression(k.parent)&&e.isIdentifier(k.parent.right)&&(null===(d=x.symbol)||void 0===d?void 0:d.valueDeclaration)&&e.isSourceFile(x.symbol.valueDeclaration)){var N=D===k.parent.right.escapedText?void 0:k.parent.right;w(e.factory.createExportDeclaration(void 0,void 0,!1,e.factory.createNamedExports([e.factory.createExportSpecifier(!1,N,D)])),0),r.tracker.trackSymbol(x.symbol,r.enclosingDeclaration,111551);}else w(e.setTextRange(e.factory.createVariableStatement(void 0,e.factory.createVariableDeclarationList([e.factory.createVariableDeclaration(T,void 0,J(r,x,t,u,F,a))],S)),E),T!==D?-2&v:v),T===D||i||(w(e.factory.createExportDeclaration(void 0,void 0,!1,e.factory.createNamedExports([e.factory.createExportSpecifier(!1,T,D)])),0),m=!1,g=!1);}else O(x,t,D,v);}if(384&t.flags&&function(t,r,n){w(e.factory.createEnumDeclaration(void 0,e.factory.createModifiersFromModifierFlags(Ab(t)?2048:0),ne(t,r),e.map(e.filter(yc(Uo(t)),(function(e){return !!(8&e.flags)})),(function(t){var r=t.declarations&&t.declarations[0]&&e.isEnumMember(t.declarations[0])?lT(t.declarations[0]):void 0;return e.factory.createEnumMember(e.unescapeLeadingUnderscores(t.escapedName),void 0===r?void 0:"string"==typeof r?e.factory.createStringLiteral(r):e.factory.createNumericLiteral(r))}))),n);}(t,p,v),32&t.flags&&(4&t.flags&&t.valueDeclaration&&e.isBinaryExpression(t.valueDeclaration.parent)&&e.isClassExpression(t.valueDeclaration.parent.right)?W(t,ne(t,p),v):function(t,i,o){var c,u,_=null===(c=t.declarations)||void 0===c?void 0:c.find(e.isClassLike),d=r.enclosingDeclaration;r.enclosingDeclaration=_||d;var p=Xo(t),f=e.map(p,(function(e){return y(e,r)})),g=ss(t),m=is(g),v=_&&e.getEffectiveImplementsTypeNodes(_),h=v&&function(t){var n=e.mapDefined(t,(function(t){var n,i=r.enclosingDeclaration;r.enclosingDeclaration=t;var o=t.expression;if(e.isEntityNameExpression(o)){if(e.isIdentifier(o)&&""===e.idText(o))return c(void 0);var s=void 0;if(s=(n=z(o,r,F)).introducesError,o=n.node,s)return c(void 0)}return c(e.factory.createExpressionWithTypeArguments(o,e.map(t.typeArguments,(function(e){return V(r,e,F,a)||l(dd(e),r)}))));function c(e){return r.enclosingDeclaration=i,e}}));if(n.length===t.length)return n}(v)||e.mapDefined(function(t){var r=e.emptyArray;if(t.symbol.declarations)for(var n=0,i=t.symbol.declarations;n<i.length;n++){var a=i[n],o=e.getEffectiveImplementsTypeNodes(a);if(o)for(var s=0,c=o;s<c.length;s++){var l=dd(c[s]);ro(l)||(r===e.emptyArray?r=[l]:r.push(l));}}return r}(g),ee),b=Uo(t),x=!!(null===(u=b.symbol)||void 0===u?void 0:u.valueDeclaration)&&e.isClassLike(b.symbol.valueDeclaration),D=x?rs(b):we,S=n$3(n$3([],e.length(m)?[e.factory.createHeritageClause(94,e.map(m,(function(t){return function(t,n,i){var a=$(t,111551);if(a)return a;var o=te("".concat(i,"_base"));return w(e.factory.createVariableStatement(void 0,e.factory.createVariableDeclarationList([e.factory.createVariableDeclaration(o,void 0,l(n,r))],2)),0),e.factory.createExpressionWithTypeArguments(e.factory.createIdentifier(o),void 0)}(t,D,i)})))]:[],!0),e.length(h)?[e.factory.createHeritageClause(117,h)]:[],!0),T=function(t,r,n){if(!e.length(r))return n;var i=new e.Map;e.forEach(n,(function(e){i.set(e.escapedName,e);}));for(var a=0,o=r;a<o.length;a++)for(var s=0,c=yc(Ls(o[a],t.thisType));s<c.length;s++){var l=c[s],u=i.get(l.escapedName);u&&!zp(u,l)&&i.delete(l.escapedName);}return e.arrayFrom(i.values())}(g,m,yc(g)),C=e.filter(T,(function(t){var r=t.valueDeclaration;return !(!r||e.isNamedDeclaration(r)&&e.isPrivateIdentifier(r.name))})),E=e.some(T,(function(t){var r=t.valueDeclaration;return !!r&&e.isNamedDeclaration(r)&&e.isPrivateIdentifier(r.name)}))?[e.factory.createPropertyDeclaration(void 0,void 0,e.factory.createPrivateIdentifier("#private"),void 0,void 0,void 0)]:e.emptyArray,k=e.flatMap(C,(function(e){return s(e,!1,m[0])})),N=e.flatMap(e.filter(yc(b),(function(e){return !(4194304&e.flags||"prototype"===e.escapedName||q(e))})),(function(e){return s(e,!0,D)})),A=!x&&t.valueDeclaration&&e.isInJSFile(t.valueDeclaration)&&!e.some(Uc(b,1))?[e.factory.createConstructorDeclaration(void 0,e.factory.createModifiersFromModifierFlags(8),[],void 0)]:Y(1,b,D,170),P=Z(g,m[0]);r.enclosingDeclaration=d,w(e.setTextRange(e.factory.createClassDeclaration(void 0,void 0,i,f,S,n$3(n$3(n$3(n$3(n$3([],P,!0),N,!0),A,!0),k,!0),E,!0)),t.declarations&&e.filter(t.declarations,(function(t){return e.isClassDeclaration(t)||e.isClassExpression(t)}))[0]),o);}(t,ne(t,p),v)),(1536&t.flags&&(!h||function(t){return e.every(I(t),(function(e){return !(111551&Ei(e).flags)}))}(t))||b)&&function(t,n,i){var a=I(t),o=e.arrayToMultiMap(a,(function(e){return e.parent&&e.parent===t?"real":"merged"})),s=o.get("real")||e.emptyArray,c=o.get("merged")||e.emptyArray;if(e.length(s)&&j(s,u=ne(t,n),i,!!(67108880&t.flags)),e.length(c)){var l=e.getSourceFileOfNode(r.enclosingDeclaration),u=ne(t,n),_=e.factory.createModuleBlock([e.factory.createExportDeclaration(void 0,void 0,!1,e.factory.createNamedExports(e.mapDefined(e.filter(c,(function(e){return "export="!==e.escapedName})),(function(n){var i,a,o=e.unescapeLeadingUnderscores(n.escapedName),s=ne(n,o),c=n.declarations&&di(n);if(!l||(c?l===e.getSourceFileOfNode(c):e.some(n.declarations,(function(t){return e.getSourceFileOfNode(t)===l})))){var u=c&&Ti(c,!0);F(u||n);var _=u?ne(u,e.unescapeLeadingUnderscores(u.escapedName)):s;return e.factory.createExportSpecifier(!1,o===_?void 0:_,o)}null===(a=null===(i=r.tracker)||void 0===i?void 0:i.reportNonlocalAugmentation)||void 0===a||a.call(i,l,t,n);}))))]);w(e.factory.createModuleDeclaration(void 0,void 0,e.factory.createIdentifier(u),_,16),0);}}(t,p,v),64&t.flags&&!(32&t.flags)&&function(t,i,a){var o=ss(t),s=Xo(t),l=e.map(s,(function(e){return y(e,r)})),u=is(o),_=e.length(u)?$u(u):void 0,d=e.flatMap(yc(o),(function(e){return function(e,t){return c(e,!1,t)}(e,_)})),p=Y(0,o,_,173),f=Y(1,o,_,174),g=Z(o,_),m=e.length(u)?[e.factory.createHeritageClause(94,e.mapDefined(u,(function(e){return $(e,111551)})))]:void 0;w(e.factory.createInterfaceDeclaration(void 0,void 0,ne(t,i),l,m,n$3(n$3(n$3(n$3([],g,!0),f,!0),p,!0),d,!0)),a);}(t,p,v),2097152&t.flags&&W(t,ne(t,p),v),4&t.flags&&"export="===t.escapedName&&G(t),8388608&t.flags&&t.declarations)for(var A=0,P=t.declarations;A<P.length;A++){var M=P[A],L=Ri(M,M.moduleSpecifier);L&&w(e.factory.createExportDeclaration(void 0,void 0,!1,void 0,e.factory.createStringLiteral(C(L,r))),0);}g?w(e.factory.createExportAssignment(void 0,void 0,!1,e.factory.createIdentifier(ne(t,p))),0):m&&w(e.factory.createExportDeclaration(void 0,void 0,!1,e.factory.createNamedExports([e.factory.createExportSpecifier(!1,ne(t,p),p)])),0);}else r.encounteredError=!0;}(t,_,p);return r.reportedDiagnostic&&(m.reportedDiagnostic=r.reportedDiagnostic),r=g,v}}function F(t){if(!e.some(t.declarations,e.isParameterDeclaration)){e.Debug.assertIsDefined(p[p.length-1]),te(e.unescapeLeadingUnderscores(t.escapedName),t);var r=!!(2097152&t.flags)&&!e.some(t.declarations,(function(t){return !!e.findAncestor(t,e.isExportDeclaration)||e.isNamespaceExport(t)||e.isImportEqualsDeclaration(t)&&!e.isExternalModuleReference(t.moduleReference)}));p[r?0:p.length-1].set(M(t),t);}}function w(t,n){if(e.canHaveModifiers(t)){var i=0,a=r.enclosingDeclaration&&(e.isJSDocTypeAlias(r.enclosingDeclaration)?e.getSourceFileOfNode(r.enclosingDeclaration):r.enclosingDeclaration);1&n&&a&&(function(t){return e.isSourceFile(t)&&(e.isExternalOrCommonJsModule(t)||e.isJsonSourceFile(t))||e.isAmbientModule(t)&&!e.isGlobalScopeAugmentation(t)}(a)||e.isModuleDeclaration(a))&&S(t)&&(i|=1),!h||1&i||a&&8388608&a.flags||!(e.isEnumDeclaration(t)||e.isVariableStatement(t)||e.isFunctionDeclaration(t)||e.isClassDeclaration(t)||e.isModuleDeclaration(t))||(i|=2),512&n&&(e.isClassDeclaration(t)||e.isInterfaceDeclaration(t)||e.isFunctionDeclaration(t))&&(i|=512),i&&(t=e.factory.updateModifiers(t,i|e.getEffectiveModifierFlags(t)));}_.push(t);}function I(t){return t.exports?e.filter(e.arrayFrom(t.exports.values()),q):[]}function O(t,n,i,o){for(var s=0,c=Uc(t,0);s<c.length;s++){var l=c[s],u=g(l,255,r,{name:e.factory.createIdentifier(i),privateSymbolVisitor:F,bundledImports:a});w(e.setTextRange(u,R(l)),o);}1536&n.flags&&n.exports&&n.exports.size||j(e.filter(yc(t),q),i,o,!0);}function R(t){if(t.declaration&&t.declaration.parent){if(e.isBinaryExpression(t.declaration.parent)&&5===e.getAssignmentDeclarationKind(t.declaration.parent))return t.declaration.parent;if(e.isVariableDeclaration(t.declaration.parent)&&t.declaration.parent.parent)return t.declaration.parent.parent}return t.declaration}function j(t,n,a,o){if(e.length(t)){var s=e.arrayToMultiMap(t,(function(t){return !e.length(t.declarations)||e.some(t.declarations,(function(t){return e.getSourceFileOfNode(t)===e.getSourceFileOfNode(r.enclosingDeclaration)}))?"local":"remote"})).get("local")||e.emptyArray,c=e.parseNodeFactory.createModuleDeclaration(void 0,void 0,e.factory.createIdentifier(n),e.factory.createModuleBlock([]),16);e.setParent(c,u),c.locals=e.createSymbolTable(t),c.symbol=t[0].parent;var l=_;_=[];var d=h;h=!1;var p=i$1(i$1({},r),{enclosingDeclaration:c}),f=r;r=p,k(e.createSymbolTable(s),o,!0),r=f,h=d;var g=_;_=l;var m=e.map(g,(function(t){return e.isExportAssignment(t)&&!t.isExportEquals&&e.isIdentifier(t.expression)?e.factory.createExportDeclaration(void 0,void 0,!1,e.factory.createNamedExports([e.factory.createExportSpecifier(!1,t.expression,e.factory.createIdentifier("default"))])):t})),y=e.every(m,(function(t){return e.hasSyntacticModifier(t,1)}))?e.map(m,E):m;w(c=e.factory.updateModuleDeclaration(c,c.decorators,c.modifiers,c.name,e.factory.createModuleBlock(y)),a);}}function q(t){return !!(2887656&t.flags)||!(4194304&t.flags||"prototype"===t.escapedName||t.valueDeclaration&&e.isStatic(t.valueDeclaration)&&e.isClassLike(t.valueDeclaration.parent))}function W(t,n,i){var a,o,s,c,l,u=di(t);if(!u)return e.Debug.fail();var _,d=Zi(Ti(u,!0));if(d){var p=e.isShorthandAmbientModuleSymbol(d)&&(_=t.declarations,e.firstDefined(_,(function(t){if(e.isImportSpecifier(t)||e.isExportSpecifier(t))return e.idText(t.propertyName||t.name);if(e.isBinaryExpression(t)||e.isExportAssignment(t)){var r=e.isExportAssignment(t)?t.expression:t.right;if(e.isPropertyAccessExpression(r))return e.idText(r.name)}if(pi(t)){var n=e.getNameOfDeclaration(t);if(n&&e.isIdentifier(n))return e.idText(n)}})))||e.unescapeLeadingUnderscores(d.escapedName);"export="===p&&(e.getESModuleInterop(U)||U.allowSyntheticDefaultImports)&&(p="default");var f=ne(d,p);switch(F(d),u.kind){case 202:if(253===(null===(o=null===(a=u.parent)||void 0===a?void 0:a.parent)||void 0===o?void 0:o.kind)){var g=C(d.parent||d,r),m=u.propertyName;w(e.factory.createImportDeclaration(void 0,void 0,e.factory.createImportClause(!1,void 0,e.factory.createNamedImports([e.factory.createImportSpecifier(!1,m&&e.isIdentifier(m)?e.factory.createIdentifier(e.idText(m)):void 0,e.factory.createIdentifier(n))])),e.factory.createStringLiteral(g),void 0),0);break}e.Debug.failBadSyntaxKind((null===(s=u.parent)||void 0===s?void 0:s.parent)||u,"Unhandled binding element grandparent kind in declaration serialization");break;case 295:220===(null===(l=null===(c=u.parent)||void 0===c?void 0:c.parent)||void 0===l?void 0:l.kind)&&H(e.unescapeLeadingUnderscores(t.escapedName),f);break;case 253:if(e.isPropertyAccessExpression(u.initializer)){var y=u.initializer,v=e.factory.createUniqueName(n),h=C(d.parent||d,r);w(e.factory.createImportEqualsDeclaration(void 0,void 0,!1,v,e.factory.createExternalModuleReference(e.factory.createStringLiteral(h))),0),w(e.factory.createImportEqualsDeclaration(void 0,void 0,!1,e.factory.createIdentifier(n),e.factory.createQualifiedName(v,y.name)),i);break}case 264:if("export="===d.escapedName&&e.some(d.declarations,e.isJsonSourceFile)){G(t);break}var b=!(512&d.flags||e.isVariableDeclaration(u));w(e.factory.createImportEqualsDeclaration(void 0,void 0,!1,e.factory.createIdentifier(n),b?A(d,r,67108863,!1):e.factory.createExternalModuleReference(e.factory.createStringLiteral(C(d,r)))),b?i:0);break;case 263:w(e.factory.createNamespaceExportDeclaration(e.idText(u.name)),0);break;case 266:w(e.factory.createImportDeclaration(void 0,void 0,e.factory.createImportClause(!1,e.factory.createIdentifier(n),void 0),e.factory.createStringLiteral(C(d.parent||d,r)),void 0),0);break;case 267:w(e.factory.createImportDeclaration(void 0,void 0,e.factory.createImportClause(!1,void 0,e.factory.createNamespaceImport(e.factory.createIdentifier(n))),e.factory.createStringLiteral(C(d,r)),void 0),0);break;case 273:w(e.factory.createExportDeclaration(void 0,void 0,!1,e.factory.createNamespaceExport(e.factory.createIdentifier(n)),e.factory.createStringLiteral(C(d,r))),0);break;case 269:w(e.factory.createImportDeclaration(void 0,void 0,e.factory.createImportClause(!1,void 0,e.factory.createNamedImports([e.factory.createImportSpecifier(!1,n!==p?e.factory.createIdentifier(p):void 0,e.factory.createIdentifier(n))])),e.factory.createStringLiteral(C(d.parent||d,r)),void 0),0);break;case 274:var x=u.parent.parent.moduleSpecifier;H(e.unescapeLeadingUnderscores(t.escapedName),x?p:f,x&&e.isStringLiteralLike(x)?e.factory.createStringLiteral(x.text):void 0);break;case 270:G(t);break;case 220:case 205:case 206:"default"===t.escapedName||"export="===t.escapedName?G(t):H(n,f);break;default:return e.Debug.failBadSyntaxKind(u,"Unhandled alias declaration kind in symbol serializer!")}}}function H(t,r,n){w(e.factory.createExportDeclaration(void 0,void 0,!1,e.factory.createNamedExports([e.factory.createExportSpecifier(!1,t!==r?r:void 0,t)]),n),0);}function G(t){if(4194304&t.flags)return !1;var n=e.unescapeLeadingUnderscores(t.escapedName),i="export="===n,o=i||"default"===n,s=t.declarations&&di(t),c=s&&Ti(s,!0);if(c&&e.length(c.declarations)&&e.some(c.declarations,(function(t){return e.getSourceFileOfNode(t)===e.getSourceFileOfNode(u)}))){var l=s&&(e.isExportAssignment(s)||e.isBinaryExpression(s)?e.getExportAssignmentExpression(s):e.getPropertyAssignmentAliasLikeExpression(s)),d=l&&e.isEntityNameExpression(l)?function(t){switch(t.kind){case 79:return t;case 160:do{t=t.left;}while(79!==t.kind);return t;case 205:do{if(e.isModuleExportsAccessExpression(t.expression)&&!e.isPrivateIdentifier(t.name))return t.name;t=t.expression;}while(79!==t.kind);return t}}(l):void 0,p=d&&Mi(d,67108863,!0,!0,u);(p||c)&&F(p||c);var f=r.tracker.trackSymbol;if(r.tracker.trackSymbol=function(){return !1},o)_.push(e.factory.createExportAssignment(void 0,void 0,i,P(c,r,67108863)));else if(d===l&&d)H(n,e.idText(d));else if(l&&e.isClassExpression(l))H(n,ne(c,e.symbolName(c)));else {var g=te(n,t);w(e.factory.createImportEqualsDeclaration(void 0,void 0,!1,e.factory.createIdentifier(g),A(c,r,67108863,!1)),0),H(n,g);}return r.tracker.trackSymbol=f,!0}g=te(n,t);var m=jf(Uo(Zi(t)));return Q(m,t)?O(m,t,g,o?0:1):w(e.factory.createVariableStatement(void 0,e.factory.createVariableDeclarationList([e.factory.createVariableDeclaration(g,void 0,J(r,m,t,u,F,a))],2)),c&&4&c.flags&&"export="===c.escapedName?2:n===g?1:0),o?(_.push(e.factory.createExportAssignment(void 0,void 0,i,e.factory.createIdentifier(g))),!0):n!==g&&(H(n,g),!0)}function Q(t,n){var i=e.getSourceFileOfNode(r.enclosingDeclaration);return 48&e.getObjectFlags(t)&&!e.length(Hc(t))&&!Ja(t)&&!(!e.length(e.filter(yc(t),q))&&!e.length(Uc(t,0)))&&!e.length(Uc(t,1))&&!B(n,u)&&!(t.symbol&&e.some(t.symbol.declarations,(function(t){return e.getSourceFileOfNode(t)!==i})))&&!e.some(yc(t),(function(e){return Ns(e.escapedName)}))&&!e.some(yc(t),(function(t){return e.some(t.declarations,(function(t){return e.getSourceFileOfNode(t)!==i}))}))&&e.every(yc(t),(function(t){return e.isIdentifierText(e.symbolName(t),K)}))}function X(t,n,i){return function(o,s,c){var l,_,d,p,f,m=e.getDeclarationModifierFlagsFromSymbol(o),y=!!(8&m);if(s&&2887656&o.flags)return [];if(4194304&o.flags||c&&Jc(c,o.escapedName)&&Db(Jc(c,o.escapedName))===Db(o)&&(16777216&o.flags)==(16777216&Jc(c,o.escapedName).flags)&&Wd(Uo(o),eo(c,o.escapedName)))return [];var v=-257&m|(s?32:0),h=L(o,r),b=null===(l=o.declarations)||void 0===l?void 0:l.find(e.or(e.isPropertyDeclaration,e.isAccessor,e.isVariableDeclaration,e.isPropertySignature,e.isBinaryExpression,e.isPropertyAccessExpression));if(98304&o.flags&&i){var x=[];if(65536&o.flags&&x.push(e.setTextRange(e.factory.createSetAccessorDeclaration(void 0,e.factory.createModifiersFromModifierFlags(v),h,[e.factory.createParameterDeclaration(void 0,void 0,void 0,"arg",void 0,y?void 0:J(r,Uo(o),o,u,F,a))],void 0),(null===(_=o.declarations)||void 0===_?void 0:_.find(e.isSetAccessor))||b)),32768&o.flags){var D=8&m;x.push(e.setTextRange(e.factory.createGetAccessorDeclaration(void 0,e.factory.createModifiersFromModifierFlags(v),h,[],D?void 0:J(r,Uo(o),o,u,F,a),void 0),(null===(d=o.declarations)||void 0===d?void 0:d.find(e.isGetAccessor))||b));}return x}if(98311&o.flags)return e.setTextRange(t(void 0,e.factory.createModifiersFromModifierFlags((Db(o)?64:0)|v),h,16777216&o.flags?e.factory.createToken(57):void 0,y?void 0:J(r,Uo(o),o,u,F,a),void 0),(null===(p=o.declarations)||void 0===p?void 0:p.find(e.or(e.isPropertyDeclaration,e.isVariableDeclaration)))||b);if(8208&o.flags){var S=Uc(Uo(o),0);if(8&v)return e.setTextRange(t(void 0,e.factory.createModifiersFromModifierFlags((Db(o)?64:0)|v),h,16777216&o.flags?e.factory.createToken(57):void 0,void 0,void 0),(null===(f=o.declarations)||void 0===f?void 0:f.find(e.isFunctionLikeDeclaration))||S[0]&&S[0].declaration||o.declarations&&o.declarations[0]);for(var T=[],C=0,E=S;C<E.length;C++){var k=E[C],N=g(k,n,r,{name:h,questionToken:16777216&o.flags?e.factory.createToken(57):void 0,modifiers:v?e.factory.createModifiersFromModifierFlags(v):void 0}),A=k.declaration&&e.isPrototypePropertyAssignment(k.declaration.parent)?k.declaration.parent:k.declaration;T.push(e.setTextRange(N,A));}return T}return e.Debug.fail("Unhandled class member kind! ".concat(o.__debugFlags||o.flags))}}function Y(t,n,i,a){var o=Uc(n,t);if(1===t){if(!i&&e.every(o,(function(t){return 0===e.length(t.parameters)})))return [];if(i){var s=Uc(i,1);if(!e.length(s)&&e.every(o,(function(t){return 0===e.length(t.parameters)})))return [];if(s.length===o.length){for(var c=!1,l=0;l<s.length;l++)if(!Kp(o[l],s[l],!1,!1,!0,Hd)){c=!0;break}if(!c)return []}}for(var u=0,_=0,d=o;_<d.length;_++){var p=d[_];p.declaration&&(u|=e.getSelectedEffectiveModifierFlags(p.declaration,24));}if(u)return [e.setTextRange(e.factory.createConstructorDeclaration(void 0,e.factory.createModifiersFromModifierFlags(u),[],void 0),o[0].declaration)]}for(var f=[],m=0,y=o;m<y.length;m++){var v=y[m],h=g(v,a,r);f.push(e.setTextRange(h,v.declaration));}return f}function Z(e,t){for(var n=[],i=0,a=Hc(e);i<a.length;i++){var o=a[i];if(t){var s=Gc(t,o.keyType);if(s&&Wd(o.type,s.type))continue}n.push(f(o,r,void 0));}return n}function $(t,n){var i,a;if(t.target&&Ta(t.target.symbol,u,n)?(i=e.map(zl(t),(function(e){return l(e,r)})),a=P(t.target.symbol,r,788968)):t.symbol&&Ta(t.symbol,u,n)&&(a=P(t.symbol,r,788968)),a)return e.factory.createExpressionWithTypeArguments(a,i)}function ee(t){return $(t,788968)||(t.symbol?e.factory.createExpressionWithTypeArguments(P(t.symbol,r,788968),void 0):void 0)}function te(e,t){var n,i,a=t?M(t):void 0;if(a&&r.remappedSymbolNames.has(a))return r.remappedSymbolNames.get(a);t&&(e=re(t,e));for(var o=0,s=e;null===(n=r.usedSymbolNames)||void 0===n?void 0:n.has(e);)o++,e="".concat(s,"_").concat(o);return null===(i=r.usedSymbolNames)||void 0===i||i.add(e),a&&r.remappedSymbolNames.set(a,e),e}function re(t,n){if("default"===n||"__class"===n||"__function"===n){var i=r.flags;r.flags|=16777216;var a=Wa(t,r);r.flags=i,n=a.length>0&&e.isSingleOrDoubleQuote(a.charCodeAt(0))?e.stripQuotes(a):a;}return "default"===n?n="_default":"export="===n&&(n="_exports"),e.isIdentifierText(n,K)&&!e.isStringANonContextualKeyword(n)?n:"_"+n.replace(/[^a-zA-Z0-9]/g,"_")}function ne(e,t){var n=M(e);return r.remappedSymbolNames.has(n)?r.remappedSymbolNames.get(n):(t=re(e,t),r.remappedSymbolNames.set(n,t),t)}}(t,r,u)}))}};function r(r,n,i,a){var s,c;e.Debug.assert(void 0===r||0==(8&r.flags));var l={enclosingDeclaration:r,flags:n||0,tracker:i&&i.trackSymbol?i:{trackSymbol:function(){return !1},moduleResolverHost:134217728&n?{getCommonSourceDirectory:t.getCommonSourceDirectory?function(){return t.getCommonSourceDirectory()}:function(){return ""},getCurrentDirectory:function(){return t.getCurrentDirectory()},getSymlinkCache:e.maybeBind(t,t.getSymlinkCache),useCaseSensitiveFileNames:e.maybeBind(t,t.useCaseSensitiveFileNames),redirectTargetsMap:t.redirectTargetsMap,getProjectReferenceRedirect:function(e){return t.getProjectReferenceRedirect(e)},isSourceOfProjectReferenceRedirect:function(e){return t.isSourceOfProjectReferenceRedirect(e)},fileExists:function(e){return t.fileExists(e)},getFileIncludeReasons:function(){return t.getFileIncludeReasons()},readFile:t.readFile?function(e){return t.readFile(e)}:void 0}:void 0},encounteredError:!1,reportedDiagnostic:!1,visitedTypes:void 0,symbolDepth:void 0,inferTypeParameters:void 0,approximateLength:0};l.tracker=o(l,l.tracker);var u=a(l);return l.truncating&&1&l.flags&&(null===(c=null===(s=l.tracker)||void 0===s?void 0:s.reportTruncationError)||void 0===c||c.call(s)),l.encounteredError?void 0:u}function o(e,t){var r=t.trackSymbol;return i$1(i$1({},t),{reportCyclicStructureError:n(t.reportCyclicStructureError),reportInaccessibleThisError:n(t.reportInaccessibleThisError),reportInaccessibleUniqueSymbolError:n(t.reportInaccessibleUniqueSymbolError),reportLikelyUnsafeImportRequiredError:n(t.reportLikelyUnsafeImportRequiredError),reportNonlocalAugmentation:n(t.reportNonlocalAugmentation),reportPrivateInBaseOfClassExpression:n(t.reportPrivateInBaseOfClassExpression),reportNonSerializableProperty:n(t.reportNonSerializableProperty),trackSymbol:r&&function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var i=r.apply(void 0,t);return i&&(e.reportedDiagnostic=!0),i}});function n(t){return t?function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return e.reportedDiagnostic=!0,t.apply(void 0,r)}:t}}function s(t){return t.truncating?t.truncating:t.truncating=t.approximateLength>(1&t.flags?e.noTruncationMaximumTruncationLength:e.defaultMaximumTruncationLength)}function l(t,r){a&&a.throwIfCancellationRequested&&a.throwIfCancellationRequested();var n=8388608&r.flags;if(r.flags&=-8388609,!t)return 262144&r.flags?(r.approximateLength+=3,e.factory.createKeywordTypeNode(130)):void(r.encounteredError=!0);if(536870912&r.flags||(t=Mc(t)),1&t.flags)return t.aliasSymbol?e.factory.createTypeReferenceNode(E(t.aliasSymbol),p(t.aliasTypeArguments,r)):t===Le?e.addSyntheticLeadingComment(e.factory.createKeywordTypeNode(130),3,"unresolved"):(r.approximateLength+=3,e.factory.createKeywordTypeNode(t===Be?138:130));if(2&t.flags)return e.factory.createKeywordTypeNode(154);if(4&t.flags)return r.approximateLength+=6,e.factory.createKeywordTypeNode(149);if(8&t.flags)return r.approximateLength+=6,e.factory.createKeywordTypeNode(146);if(64&t.flags)return r.approximateLength+=6,e.factory.createKeywordTypeNode(157);if(16&t.flags&&!t.aliasSymbol)return r.approximateLength+=7,e.factory.createKeywordTypeNode(133);if(1024&t.flags&&!(1048576&t.flags)){var i=ea(t.symbol),o=k(i,r,788968);if(ms(i)===t)return o;var c=e.symbolName(t.symbol);return e.isIdentifierText(c,0)?J(o,e.factory.createTypeReferenceNode(c,void 0)):e.isImportTypeNode(o)?(o.isTypeOf=!0,e.factory.createIndexedAccessTypeNode(o,e.factory.createLiteralTypeNode(e.factory.createStringLiteral(c)))):e.isTypeReferenceNode(o)?e.factory.createIndexedAccessTypeNode(e.factory.createTypeQueryNode(o.typeName),e.factory.createLiteralTypeNode(e.factory.createStringLiteral(c))):e.Debug.fail("Unhandled type node kind returned from `symbolToTypeNode`.")}if(1056&t.flags)return k(t.symbol,r,788968);if(128&t.flags)return r.approximateLength+=t.value.length+2,e.factory.createLiteralTypeNode(e.setEmitFlags(e.factory.createStringLiteral(t.value,!!(268435456&r.flags)),16777216));if(256&t.flags){var _=t.value;return r.approximateLength+=(""+_).length,e.factory.createLiteralTypeNode(_<0?e.factory.createPrefixUnaryExpression(40,e.factory.createNumericLiteral(-_)):e.factory.createNumericLiteral(_))}if(2048&t.flags)return r.approximateLength+=e.pseudoBigIntToString(t.value).length+1,e.factory.createLiteralTypeNode(e.factory.createBigIntLiteral(t.value));if(512&t.flags)return r.approximateLength+=t.intrinsicName.length,e.factory.createLiteralTypeNode("true"===t.intrinsicName?e.factory.createTrue():e.factory.createFalse());if(8192&t.flags){if(!(1048576&r.flags)){if(Sa(t.symbol,r.enclosingDeclaration))return r.approximateLength+=6,k(t.symbol,r,111551);r.tracker.reportInaccessibleUniqueSymbolError&&r.tracker.reportInaccessibleUniqueSymbolError();}return r.approximateLength+=13,e.factory.createTypeOperatorNode(153,e.factory.createKeywordTypeNode(150))}if(16384&t.flags)return r.approximateLength+=4,e.factory.createKeywordTypeNode(114);if(32768&t.flags)return r.approximateLength+=9,e.factory.createKeywordTypeNode(152);if(65536&t.flags)return r.approximateLength+=4,e.factory.createLiteralTypeNode(e.factory.createNull());if(131072&t.flags)return r.approximateLength+=5,e.factory.createKeywordTypeNode(143);if(4096&t.flags)return r.approximateLength+=6,e.factory.createKeywordTypeNode(150);if(67108864&t.flags)return r.approximateLength+=6,e.factory.createKeywordTypeNode(147);if(T_(t))return 4194304&r.flags&&(r.encounteredError||32768&r.flags||(r.encounteredError=!0),r.tracker.reportInaccessibleThisError&&r.tracker.reportInaccessibleThisError()),r.approximateLength+=4,e.factory.createThisTypeNode();if(!n&&t.aliasSymbol&&(16384&r.flags||Da(t.aliasSymbol,r.enclosingDeclaration))){var y=p(t.aliasTypeArguments,r);return !pa(t.aliasSymbol.escapedName)||32&t.aliasSymbol.flags?k(t.aliasSymbol,r,788968,y):e.factory.createTypeReferenceNode(e.factory.createIdentifier(""),y)}var v=e.getObjectFlags(t);if(4&v)return e.Debug.assert(!!(524288&t.flags)),t.node?R(t,j):j(t);if(262144&t.flags||3&v){if(262144&t.flags&&e.contains(r.inferTypeParameters,t))return r.approximateLength+=e.symbolName(t.symbol).length+6,e.factory.createInferTypeNode(m(t,r,void 0));if(4&r.flags&&262144&t.flags&&!Da(t.symbol,r.enclosingDeclaration)){var h=F(t,r);return r.approximateLength+=e.idText(h).length,e.factory.createTypeReferenceNode(e.factory.createIdentifier(e.idText(h)),void 0)}return t.symbol?k(t.symbol,r,788968):e.factory.createTypeReferenceNode(e.factory.createIdentifier("?"),void 0)}if(1048576&t.flags&&t.origin&&(t=t.origin),3145728&t.flags){var b=1048576&t.flags?function(e){for(var t=[],r=0,n=0;n<e.length;n++){var i=e[n];if(r|=i.flags,!(98304&i.flags)){if(1536&i.flags){var a=512&i.flags?et:ds(i);if(1048576&a.flags){var o=a.types.length;if(n+o<=e.length&&rd(e[n+o-1])===rd(a.types[o-1])){t.push(a),n+=o-1;continue}}}t.push(i);}}return 65536&r&&t.push(qe),32768&r&&t.push(ze),t||e}(t.types):t.types;if(1===e.length(b))return l(b[0],r);var x=p(b,r,!0);return x&&x.length>0?1048576&t.flags?e.factory.createUnionTypeNode(x):e.factory.createIntersectionTypeNode(x):void(r.encounteredError||262144&r.flags||(r.encounteredError=!0))}if(48&v)return e.Debug.assert(!!(524288&t.flags)),L(t);if(4194304&t.flags){var D=t.type;r.approximateLength+=6;var S=l(D,r);return e.factory.createTypeOperatorNode(140,S)}if(134217728&t.flags){var T=t.texts,C=t.types,N=e.factory.createTemplateHead(T[0]),A=e.factory.createNodeArray(e.map(C,(function(t,n){return e.factory.createTemplateLiteralTypeSpan(l(t,r),(n<C.length-1?e.factory.createTemplateMiddle:e.factory.createTemplateTail)(T[n+1]))})));return r.approximateLength+=2,e.factory.createTemplateLiteralType(N,A)}if(268435456&t.flags){var P=l(t.type,r);return k(t.symbol,r,788968,[P])}if(8388608&t.flags){var w=l(t.objectType,r);return S=l(t.indexType,r),r.approximateLength+=2,e.factory.createIndexedAccessTypeNode(w,S)}return 16777216&t.flags?R(t,(function(t){return function(t){var n=l(t.checkType,r),i=r.inferTypeParameters;r.inferTypeParameters=t.root.inferTypeParameters;var a=l(t.extendsType,r);r.inferTypeParameters=i;var o=I(j_(t)),s=I(J_(t));return r.approximateLength+=15,e.factory.createConditionalTypeNode(n,a,o,s)}(t)})):33554432&t.flags?l(t.baseType,r):e.Debug.fail("Should be unreachable.");function I(e){var t,n,i;return 1048576&e.flags?(null===(t=r.visitedTypes)||void 0===t?void 0:t.has(Bu(e)))?(131072&r.flags||(r.encounteredError=!0,null===(i=null===(n=r.tracker)||void 0===n?void 0:n.reportCyclicStructureError)||void 0===i||i.call(n)),u(r)):R(e,(function(e){return l(e,r)})):l(e,r)}function L(t){var n,i=t.id,a=t.symbol;if(a){var o=Ja(t)?788968:111551;if(Fh(a.valueDeclaration))return k(a,r,o);if(32&a.flags&&!Bo(a)&&!(a.valueDeclaration&&225===a.valueDeclaration.kind&&2048&r.flags)||896&a.flags||function(){var t,n=!!(8192&a.flags)&&e.some(a.declarations,(function(t){return e.isStatic(t)})),o=!!(16&a.flags)&&(a.parent||e.forEach(a.declarations,(function(e){return 303===e.parent.kind||261===e.parent.kind})));if(n||o)return (!!(4096&r.flags)||(null===(t=r.visitedTypes)||void 0===t?void 0:t.has(i)))&&(!(8&r.flags)||Sa(a,r.enclosingDeclaration))}())return k(a,r,o);if(null===(n=r.visitedTypes)||void 0===n?void 0:n.has(i)){var s=function(t){if(t.symbol&&2048&t.symbol.flags&&t.symbol.declarations){var r=e.walkUpParenthesizedTypes(t.symbol.declarations[0].parent);if(258===r.kind)return $i(r)}}(t);return s?k(s,r,788968):u(r)}return R(t,B)}return B(t)}function R(t,n){var i,a,o=t.id,s=16&e.getObjectFlags(t)&&t.symbol&&32&t.symbol.flags,c=4&e.getObjectFlags(t)&&t.node?"N"+O(t.node):16777216&t.flags?"N"+O(t.root.node):t.symbol?(s?"+":"")+M(t.symbol):void 0;r.visitedTypes||(r.visitedTypes=new e.Set),c&&!r.symbolDepth&&(r.symbolDepth=new e.Map);var l=r.enclosingDeclaration&&Qn(r.enclosingDeclaration),_="".concat(Bu(t),"|").concat(r.flags);l&&(l.serializedTypes||(l.serializedTypes=new e.Map));var d,p=null===(i=null==l?void 0:l.serializedTypes)||void 0===i?void 0:i.get(_);if(p)return p.truncating&&(r.truncating=!0),r.approximateLength+=p.addedLength,function t(r){return e.nodeIsSynthesized(r)||e.getParseTreeNode(r)!==r?e.setTextRange(e.factory.cloneNode(e.visitEachChild(r,t,e.nullTransformationContext)),r):r}(p);if(c){if((d=r.symbolDepth.get(c)||0)>10)return u(r);r.symbolDepth.set(c,d+1);}r.visitedTypes.add(o);var f=r.approximateLength,g=n(t),m=r.approximateLength-f;return r.reportedDiagnostic||r.encounteredError||(r.truncating&&(g.truncating=!0),g.addedLength=m,null===(a=null==l?void 0:l.serializedTypes)||void 0===a||a.set(_,g)),r.visitedTypes.delete(o),c&&r.symbolDepth.set(c,d),g}function B(t){if(dc(t)||t.containsError)return function(t){e.Debug.assert(!!(524288&t.flags));var n,i=t.declaration.readonlyToken?e.factory.createToken(t.declaration.readonlyToken.kind):void 0,a=t.declaration.questionToken?e.factory.createToken(t.declaration.questionToken.kind):void 0;n=sc(t)?e.factory.createTypeOperatorNode(140,l(cc(t),r)):l(nc(t),r);var o=m(rc(t),r,n),s=t.declaration.nameType?l(ic(t),r):void 0,c=l(Nf(ac(t),!!(4&lc(t))),r),u=e.factory.createMappedTypeNode(i,o,s,a,c,void 0);return r.approximateLength+=10,e.setEmitFlags(u,1)}(t);var n=pc(t);if(!n.properties.length&&!n.indexInfos.length){if(!n.callSignatures.length&&!n.constructSignatures.length)return r.approximateLength+=2,e.setEmitFlags(e.factory.createTypeLiteralNode(void 0),1);if(1===n.callSignatures.length&&!n.constructSignatures.length)return g(n.callSignatures[0],178,r);if(1===n.constructSignatures.length&&!n.callSignatures.length)return g(n.constructSignatures[0],179,r)}var i=e.filter(n.constructSignatures,(function(e){return !!(4&e.flags)}));if(e.some(i)){var a=e.map(i,Cl);return n.callSignatures.length+(n.constructSignatures.length-i.length)+n.indexInfos.length+(2048&r.flags?e.countWhere(n.properties,(function(e){return !(4194304&e.flags)})):e.length(n.properties))&&a.push(function(t){if(0===t.constructSignatures.length)return t;if(t.objectTypeWithoutAbstractConstructSignatures)return t.objectTypeWithoutAbstractConstructSignatures;var r=e.filter(t.constructSignatures,(function(e){return !(4&e.flags)}));if(t.constructSignatures===r)return t;var n=ya(t.symbol,t.members,t.callSignatures,e.some(r)?r:e.emptyArray,t.indexInfos);return t.objectTypeWithoutAbstractConstructSignatures=n,n.objectTypeWithoutAbstractConstructSignatures=n,n}(n)),l($u(a),r)}var o=r.flags;r.flags|=4194304;var c=function(t){if(s(r))return [e.factory.createPropertySignature(void 0,"...",void 0,void 0)];for(var n=[],i=0,a=t.callSignatures;i<a.length;i++){var o=a[i];n.push(g(o,173,r));}for(var c=0,l=t.constructSignatures;c<l.length;c++)4&(o=l[c]).flags||n.push(g(o,174,r));for(var _=0,p=t.indexInfos;_<p.length;_++){var m=p[_];n.push(f(m,r,1024&t.objectFlags?u(r):void 0));}var y=t.properties;if(!y)return n;for(var v=0,h=0,b=y;h<b.length;h++){var x=b[h];if(v++,2048&r.flags){if(4194304&x.flags)continue;24&e.getDeclarationModifierFlagsFromSymbol(x)&&r.tracker.reportPrivateInBaseOfClassExpression&&r.tracker.reportPrivateInBaseOfClassExpression(e.unescapeLeadingUnderscores(x.escapedName));}if(s(r)&&v+2<y.length-1){n.push(e.factory.createPropertySignature(void 0,"... ".concat(y.length-v," more ..."),void 0,void 0)),d(y[y.length-1],r,n);break}d(x,r,n);}return n.length?n:void 0}(n);r.flags=o;var _=e.factory.createTypeLiteralNode(c);return r.approximateLength+=2,e.setEmitFlags(_,1024&r.flags?0:1),_}function j(t){var n=zl(t);if(t.target===Mt||t.target===Lt){if(2&r.flags){var i=l(n[0],r);return e.factory.createTypeReferenceNode(t.target===Mt?"Array":"ReadonlyArray",[i])}var a=l(n[0],r),o=e.factory.createArrayTypeNode(a);return t.target===Mt?o:e.factory.createTypeOperatorNode(144,o)}if(!(8&t.target.objectFlags)){if(2048&r.flags&&t.symbol.valueDeclaration&&e.isClassLike(t.symbol.valueDeclaration)&&!Sa(t.symbol,r.enclosingDeclaration))return L(t);var s=t.target.outerTypeParameters,c=void(D=0);if(s)for(var u=s.length;D<u;){var _=D,d=Ol(s[D]);do{D++;}while(D<u&&Ol(s[D])===d);if(!e.rangeEquals(s,n,_,D)){var f=p(n.slice(_,D),r),g=r.flags;r.flags|=16;var m=k(d,r,788968,f);r.flags=g,c=c?J(c,m):m;}}var y=void 0;if(n.length>0){var v=(t.target.typeParameters||e.emptyArray).length;y=p(n.slice(D,v),r);}S=r.flags,r.flags|=16;var h=k(t.symbol,r,788968,y);return r.flags=S,c?J(c,h):h}if((n=e.sameMap(n,(function(e,r){return Nf(e,!!(2&t.target.elementFlags[r]))}))).length>0){var b=Ul(t),x=p(n.slice(0,b),r);if(x){if(t.target.labeledElementDeclarations)for(var D=0;D<x.length;D++){var S=t.target.elementFlags[D];x[D]=e.factory.createNamedTupleMember(12&S?e.factory.createToken(25):void 0,e.factory.createIdentifier(e.unescapeLeadingUnderscores(Vh(t.target.labeledElementDeclarations[D]))),2&S?e.factory.createToken(57):void 0,4&S?e.factory.createArrayTypeNode(x[D]):x[D]);}else for(D=0;D<Math.min(b,x.length);D++){S=t.target.elementFlags[D];x[D]=12&S?e.factory.createRestTypeNode(4&S?e.factory.createArrayTypeNode(x[D]):x[D]):2&S?e.factory.createOptionalTypeNode(x[D]):x[D];}var T=e.setEmitFlags(e.factory.createTupleTypeNode(x),1);return t.target.readonly?e.factory.createTypeOperatorNode(144,T):T}}if(r.encounteredError||524288&r.flags)return T=e.setEmitFlags(e.factory.createTupleTypeNode([]),1),t.target.readonly?e.factory.createTypeOperatorNode(144,T):T;r.encounteredError=!0;}function J(t,r){if(e.isImportTypeNode(t)){var n=t.typeArguments,i=t.qualifier;i&&(i=e.isIdentifier(i)?e.factory.updateIdentifier(i,n):e.factory.updateQualifiedName(i,i.left,e.factory.updateIdentifier(i.right,n))),n=r.typeArguments;for(var a=0,o=z(r);a<o.length;a++){var s=o[a];i=i?e.factory.createQualifiedName(i,s):s;}return e.factory.updateImportTypeNode(t,t.argument,i,n,t.isTypeOf)}n=t.typeArguments;var c=t.typeName;c=e.isIdentifier(c)?e.factory.updateIdentifier(c,n):e.factory.updateQualifiedName(c,c.left,e.factory.updateIdentifier(c.right,n)),n=r.typeArguments;for(var l=0,u=z(r);l<u.length;l++)s=u[l],c=e.factory.createQualifiedName(c,s);return e.factory.updateTypeReferenceNode(t,c,n)}function z(t){for(var r=t.typeName,n=[];!e.isIdentifier(r);)n.unshift(r.right),r=r.left;return n.unshift(r),n}}function u(t){return t.approximateLength+=3,1&t.flags?e.factory.createKeywordTypeNode(130):e.factory.createTypeReferenceNode(e.factory.createIdentifier("..."),void 0)}function _(t,r){var n;return !!(8192&e.getCheckFlags(t))&&(e.contains(r.reverseMappedStack,t)||(null===(n=r.reverseMappedStack)||void 0===n?void 0:n[0])&&!(16&e.getObjectFlags(e.last(r.reverseMappedStack).propertyType)))}function d(t,r,n){var i,a,o=!!(8192&e.getCheckFlags(t)),s=_(t,r)?we:Ko(t),c=r.enclosingDeclaration;if(r.enclosingDeclaration=void 0,r.tracker.trackSymbol&&4096&e.getCheckFlags(t)&&Ns(t.escapedName))if(t.declarations){var l=e.first(t.declarations);if(Fs(l))if(e.isBinaryExpression(l)){var d=e.getNameOfDeclaration(l);d&&e.isElementAccessExpression(d)&&e.isPropertyAccessEntityNameExpression(d.argumentExpression)&&h(d.argumentExpression,c,r);}else h(l.name.expression,c,r);}else (null===(i=r.tracker)||void 0===i?void 0:i.reportNonSerializableProperty)&&r.tracker.reportNonSerializableProperty(Ia(t));r.enclosingDeclaration=t.valueDeclaration||(null===(a=t.declarations)||void 0===a?void 0:a[0])||c;var p=L(t,r);r.enclosingDeclaration=c,r.approximateLength+=e.symbolName(t).length+1;var f=16777216&t.flags?e.factory.createToken(57):void 0;if(8208&t.flags&&!fc(s).length&&!Db(t))for(var m=0,y=Uc(om(s,(function(e){return !(32768&e.flags)})),0);m<y.length;m++){var v=g(y[m],167,r,{name:p,questionToken:f});n.push(S(v));}else {var b=void 0;_(t,r)?b=u(r):(o&&(r.reverseMappedStack||(r.reverseMappedStack=[]),r.reverseMappedStack.push(t)),b=s?J(r,s,t,c):e.factory.createKeywordTypeNode(130),o&&r.reverseMappedStack.pop());var x=Db(t)?[e.factory.createToken(144)]:void 0;x&&(r.approximateLength+=9);var D=e.factory.createPropertySignature(x,p,f,b);n.push(S(D));}function S(r){var n;if(e.some(t.declarations,(function(e){return 345===e.kind}))){var i=null===(n=t.declarations)||void 0===n?void 0:n.find((function(e){return 345===e.kind})),a=e.getTextOfJSDocComment(i.comment);a&&e.setSyntheticLeadingComments(r,[{kind:3,text:"*\n * "+a.replace(/\n/g,"\n * ")+"\n ",pos:-1,end:-1,hasTrailingNewLine:!0}]);}else t.valueDeclaration&&e.setCommentRange(r,t.valueDeclaration);return r}}function p(t,r,n){if(e.some(t)){if(s(r)){if(!n)return [e.factory.createTypeReferenceNode("...",void 0)];if(t.length>2)return [l(t[0],r),e.factory.createTypeReferenceNode("... ".concat(t.length-2," more ..."),void 0),l(t[t.length-1],r)]}for(var i=64&r.flags?void 0:e.createUnderscoreEscapedMultiMap(),a=[],o=0,c=0,u=t;c<u.length;c++){var _=u[c];if(o++,s(r)&&o+2<t.length-1){a.push(e.factory.createTypeReferenceNode("... ".concat(t.length-o," more ..."),void 0));var d=l(t[t.length-1],r);d&&a.push(d);break}r.approximateLength+=2;var p=l(_,r);p&&(a.push(p),i&&e.isIdentifierTypeReference(p)&&i.add(p.typeName.escapedText,[_,a.length-1]));}if(i){var f=r.flags;r.flags|=64,i.forEach((function(t){if(!e.arrayIsHomogeneous(t,(function(e,t){return r=e[0],n=t[0],r===n||!!r.symbol&&r.symbol===n.symbol||!!r.aliasSymbol&&r.aliasSymbol===n.aliasSymbol;var r,n;})))for(var n=0,i=t;n<i.length;n++){var o=i[n],s=o[0],c=o[1];a[c]=l(s,r);}})),r.flags=f;}return a}}function f(t,r,n){var i=e.getNameFromIndexInfo(t)||"x",a=l(t.keyType,r),o=e.factory.createParameterDeclaration(void 0,void 0,void 0,i,void 0,a,void 0);return n||(n=l(t.type||we,r)),t.type||2097152&r.flags||(r.encounteredError=!0),r.approximateLength+=i.length+4,e.factory.createIndexSignature(void 0,t.isReadonly?[e.factory.createToken(144)]:void 0,[o],n)}function g(t,r,n,i){var a,o,s,c,u,_,d=256&n.flags;d&&(n.flags&=-257),n.approximateLength+=3,32&n.flags&&t.target&&t.mapper&&t.target.typeParameters?_=t.target.typeParameters.map((function(e){return l(Rd(e,t.mapper),n)})):u=t.typeParameters&&t.typeParameters.map((function(e){return y(e,n)}));var p,f=Us(t,!0)[0],g=(e.some(f,(function(t){return t!==f[f.length-1]&&!!(32768&e.getCheckFlags(t))}))?t.parameters:f).map((function(e){return v(e,n,170===r,null==i?void 0:i.privateSymbolVisitor,null==i?void 0:i.bundledImports)}));if(t.thisParameter){var m=v(t.thisParameter,n);g.unshift(m);}var h=fl(t);if(h){var b=2===h.kind||3===h.kind?e.factory.createToken(128):void 0,x=1===h.kind||3===h.kind?e.setEmitFlags(e.factory.createIdentifier(h.parameterName),16777216):e.factory.createThisTypeNode(),D=h.type&&l(h.type,n);p=e.factory.createTypePredicateNode(b,x,D);}else {var S=ml(t);!S||d&&to(S)?d||(p=e.factory.createKeywordTypeNode(130)):p=function(t,r,n,i,a){if(!ro(r)&&t.enclosingDeclaration){var o=n.declaration&&e.getEffectiveReturnTypeNode(n.declaration);if(e.findAncestor(o,(function(e){return e===t.enclosingDeclaration}))&&o){var s=dd(o);if((262144&s.flags&&s.isThisType?Rd(s,n.mapper):s)===r&&j(o,r)){var c=V(t,o,i,a);if(c)return c}}}return l(r,t)}(n,S,t,null==i?void 0:i.privateSymbolVisitor,null==i?void 0:i.bundledImports);}var T=null==i?void 0:i.modifiers;if(179===r&&4&t.flags){var C=e.modifiersToFlags(T);T=e.factory.createModifiersFromModifierFlags(128|C);}var E=173===r?e.factory.createCallSignature(u,g,p):174===r?e.factory.createConstructSignature(u,g,p):167===r?e.factory.createMethodSignature(T,null!==(a=null==i?void 0:i.name)&&void 0!==a?a:e.factory.createIdentifier(""),null==i?void 0:i.questionToken,u,g,p):168===r?e.factory.createMethodDeclaration(void 0,T,void 0,null!==(o=null==i?void 0:i.name)&&void 0!==o?o:e.factory.createIdentifier(""),void 0,u,g,p,void 0):170===r?e.factory.createConstructorDeclaration(void 0,T,g,void 0):171===r?e.factory.createGetAccessorDeclaration(void 0,T,null!==(s=null==i?void 0:i.name)&&void 0!==s?s:e.factory.createIdentifier(""),g,p,void 0):172===r?e.factory.createSetAccessorDeclaration(void 0,T,null!==(c=null==i?void 0:i.name)&&void 0!==c?c:e.factory.createIdentifier(""),g,void 0):175===r?e.factory.createIndexSignature(void 0,T,g,p):315===r?e.factory.createJSDocFunctionType(g,p):178===r?e.factory.createFunctionTypeNode(u,g,null!=p?p:e.factory.createTypeReferenceNode(e.factory.createIdentifier(""))):179===r?e.factory.createConstructorTypeNode(T,u,g,null!=p?p:e.factory.createTypeReferenceNode(e.factory.createIdentifier(""))):255===r?e.factory.createFunctionDeclaration(void 0,T,void 0,(null==i?void 0:i.name)?e.cast(i.name,e.isIdentifier):e.factory.createIdentifier(""),u,g,p,void 0):212===r?e.factory.createFunctionExpression(T,void 0,(null==i?void 0:i.name)?e.cast(i.name,e.isIdentifier):e.factory.createIdentifier(""),u,g,p,e.factory.createBlock([])):213===r?e.factory.createArrowFunction(T,u,g,p,void 0,e.factory.createBlock([])):e.Debug.assertNever(r);return _&&(E.typeArguments=e.factory.createNodeArray(_)),E}function m(t,r,n){var i=r.flags;r.flags&=-513;var a=F(t,r),o=Fc(t),s=o&&l(o,r);return r.flags=i,e.factory.createTypeParameterDeclaration(a,n,s)}function y(e,t,r){return void 0===r&&(r=hc(e)),m(e,t,r&&l(r,t))}function v(t,r,n,i,a){var o=e.getDeclarationOfKind(t,163);o||e.isTransientSymbol(t)||(o=e.getDeclarationOfKind(t,338));var s,c=Uo(t);o&&rT(o)&&(c=Df(c)),1073741824&r.flags&&o&&!e.isJSDocParameterTag(o)&&(s=o,H&&nl(s)&&!s.initializer)&&(c=Jg(c,524288));var l=J(r,c,t,r.enclosingDeclaration,i,a),u=!(8192&r.flags)&&n&&o&&o.modifiers?o.modifiers.map(e.factory.cloneNode):void 0,_=o&&e.isRestParameter(o)||32768&e.getCheckFlags(t)?e.factory.createToken(25):void 0,d=o&&o.name?79===o.name.kind?e.setEmitFlags(e.factory.cloneNode(o.name),16777216):160===o.name.kind?e.setEmitFlags(e.factory.cloneNode(o.name.right),16777216):function t(n){r.tracker.trackSymbol&&e.isComputedPropertyName(n)&&ks(n)&&h(n.expression,r.enclosingDeclaration,r);var i=e.visitEachChild(n,t,e.nullTransformationContext,void 0,t);return e.isBindingElement(i)&&(i=e.factory.updateBindingElement(i,i.dotDotDotToken,i.propertyName,i.name,void 0)),e.nodeIsSynthesized(i)||(i=e.factory.cloneNode(i)),e.setEmitFlags(i,16777217)}(o.name):e.symbolName(t),p=o&&nl(o)||16384&e.getCheckFlags(t)?e.factory.createToken(57):void 0,f=e.factory.createParameterDeclaration(void 0,u,_,d,p,l,void 0);return r.approximateLength+=e.symbolName(t).length+3,f}function h(t,r,n){if(n.tracker.trackSymbol){var i=e.getFirstIdentifier(t),a=ei(i,i.escapedText,1160127,void 0,void 0,!0);a&&n.tracker.trackSymbol(a,r,111551);}}function b(e,t,r,n){return t.tracker.trackSymbol(e,t.enclosingDeclaration,r),x(e,t,r,n)}function x(t,r,n,i){var a;return 262144&t.flags||!(r.enclosingDeclaration||64&r.flags)||134217728&r.flags?a=[t]:(a=e.Debug.checkDefined(function t(n,a,o){var s,c=ba(n,r.enclosingDeclaration,a,!!(128&r.flags));if(!c||xa(c[0],r.enclosingDeclaration,1===c.length?a:ha(a))){var l=ta(c?c[0]:n,r.enclosingDeclaration,a);if(e.length(l)){s=l.map((function(t){return e.some(t.declarations,Aa)?C(t,r):void 0}));var u=l.map((function(e,t){return t}));u.sort((function(t,r){var n=s[t],i=s[r];if(n&&i){var a=e.pathIsRelative(i);return e.pathIsRelative(n)===a?e.moduleSpecifiers.countPathComponents(n)-e.moduleSpecifiers.countPathComponents(i):a?-1:1}return 0}));for(var _=0,d=u.map((function(e){return l[e]}));_<d.length;_++){var p=d[_],f=t(p,ha(a),!1);if(f){if(p.exports&&p.exports.get("export=")&&ia(p.exports.get("export="),n)){c=f;break}c=f.concat(c||[na(p,n)||n]);break}}}}if(c)return c;if(o||!(6144&n.flags)){if(!o&&!i&&e.forEach(n.declarations,Aa))return;return [n]}}(t,n,!0)),e.Debug.assert(a&&a.length>0)),a}function D(t,r){var n;return 524384&tS(t).flags&&(n=e.factory.createNodeArray(e.map(Xo(t),(function(e){return y(e,r)})))),n}function S(t,r,n){var i;e.Debug.assert(t&&0<=r&&r<t.length);var a=t[r],o=M(a);if(!(null===(i=n.typeParameterSymbolList)||void 0===i?void 0:i.has(o))){var s;if((n.typeParameterSymbolList||(n.typeParameterSymbolList=new e.Set)).add(o),512&n.flags&&r<t.length-1){var c=a,l=t[r+1];if(1&e.getCheckFlags(l)){var u=function(t){return e.concatenate(Qo(t),Xo(t))}(2097152&c.flags?ki(c):c);s=p(e.map(u,(function(e){return hd(e,l.mapper)})),n);}else s=D(a,n);}return s}}function T(t){return e.isIndexedAccessTypeNode(t.objectType)?T(t.objectType):t}function C(t,r){var n,a=e.getDeclarationOfKind(t,303);if(!a){var o=e.firstDefined(t.declarations,(function(e){return ra(e,t)}));o&&(a=e.getDeclarationOfKind(o,303));}if(a&&void 0!==a.moduleName)return a.moduleName;if(!a){if(r.tracker.trackReferencedAmbientModule){var s=e.filter(t.declarations,e.isAmbientModule);if(e.length(s))for(var l=0,u=s;l<u.length;l++){var _=u[l];r.tracker.trackReferencedAmbientModule(_,t);}}if(c.test(t.escapedName))return t.escapedName.substring(1,t.escapedName.length-1)}if(!r.enclosingDeclaration||!r.tracker.moduleResolverHost)return c.test(t.escapedName)?t.escapedName.substring(1,t.escapedName.length-1):e.getSourceFileOfNode(e.getNonAugmentationDeclaration(t)).fileName;var d=e.getSourceFileOfNode(e.getOriginalNode(r.enclosingDeclaration)),p=Gn(t),f=p.specifierCache&&p.specifierCache.get(d.path);if(!f){var g=!!e.outFile(U),m=r.tracker.moduleResolverHost,y=g?i$1(i$1({},U),{baseUrl:m.getCommonSourceDirectory()}):U;f=e.first(e.moduleSpecifiers.getModuleSpecifiers(t,de,y,d,m,{importModuleSpecifierPreference:g?"non-relative":"project-relative",importModuleSpecifierEnding:g?"minimal":void 0})),null!==(n=p.specifierCache)&&void 0!==n||(p.specifierCache=new e.Map),p.specifierCache.set(d.path,f);}return f}function E(t){var r=e.factory.createIdentifier(e.unescapeLeadingUnderscores(t.escapedName));return t.parent?e.factory.createQualifiedName(E(t.parent),r):r}function k(t,r,n,i){var a=b(t,r,n,!(16384&r.flags)),o=111551===n;if(e.some(a[0].declarations,Aa)){var s=a.length>1?m(a,a.length-1,1):void 0,c=i||S(a,0,r),l=C(a[0],r);!(67108864&r.flags)&&e.getEmitModuleResolutionKind(U)!==e.ModuleResolutionKind.Classic&&l.indexOf("/node_modules/")>=0&&(r.encounteredError=!0,r.tracker.reportLikelyUnsafeImportRequiredError&&r.tracker.reportLikelyUnsafeImportRequiredError(l));var u=e.factory.createLiteralTypeNode(e.factory.createStringLiteral(l));if(r.tracker.trackExternalModuleSymbolOfImportTypeNode&&r.tracker.trackExternalModuleSymbolOfImportTypeNode(a[0]),r.approximateLength+=l.length+10,!s||e.isEntityName(s))return s&&((f=e.isIdentifier(s)?s:s.right).typeArguments=void 0),e.factory.createImportTypeNode(u,s,c,o);var _=T(s),d=_.objectType.typeName;return e.factory.createIndexedAccessTypeNode(e.factory.createImportTypeNode(u,d,c,o),_.indexType)}var p=m(a,a.length-1,0);if(e.isIndexedAccessTypeNode(p))return p;if(o)return e.factory.createTypeQueryNode(p);var f,g=(f=e.isIdentifier(p)?p:p.right).typeArguments;return f.typeArguments=void 0,e.factory.createTypeReferenceNode(p,g);function m(t,n,a){var o,s=n===t.length-1?i:S(t,n,r),c=t[n],l=t[n-1];if(0===n)r.flags|=16777216,o=Wa(c,r),r.approximateLength+=(o?o.length:0)+1,r.flags^=16777216;else if(l&&Gi(l)){var u=Gi(l);e.forEachEntry(u,(function(t,r){if(ia(t,c)&&!Ns(r)&&"export="!==r)return o=e.unescapeLeadingUnderscores(r),!0}));}if(o||(o=Wa(c,r)),r.approximateLength+=o.length+1,!(16&r.flags)&&l&&Os(l)&&Os(l).get(c.escapedName)&&ia(Os(l).get(c.escapedName),c)){var _=m(t,n-1,a);return e.isIndexedAccessTypeNode(_)?e.factory.createIndexedAccessTypeNode(_,e.factory.createLiteralTypeNode(e.factory.createStringLiteral(o))):e.factory.createIndexedAccessTypeNode(e.factory.createTypeReferenceNode(_,s),e.factory.createLiteralTypeNode(e.factory.createStringLiteral(o)))}var d=e.setEmitFlags(e.factory.createIdentifier(o,s),16777216);return d.symbol=c,n>a?(_=m(t,n-1,a),e.isEntityName(_)?e.factory.createQualifiedName(_,d):e.Debug.fail("Impossible construct - an export of an indexed access cannot be reachable")):d}}function N(e,t,r){var n=ei(t.enclosingDeclaration,e,788968,void 0,e,!1);return !(!n||262144&n.flags&&n===r.symbol)}function F(t,r){var n,i;if(4&r.flags&&r.typeParameterNames){var a=r.typeParameterNames.get(Bu(t));if(a)return a}var o=A(t.symbol,r,788968,!0);if(!(79&o.kind))return e.factory.createIdentifier("(Missing type parameter)");if(4&r.flags){for(var s=o.escapedText,c=(null===(n=r.typeParameterNamesByTextNextNameCount)||void 0===n?void 0:n.get(s))||0,l=s;(null===(i=r.typeParameterNamesByText)||void 0===i?void 0:i.has(l))||N(l,r,t);)c++,l="".concat(s,"_").concat(c);l!==s&&(o=e.factory.createIdentifier(l,o.typeArguments)),(r.typeParameterNamesByTextNextNameCount||(r.typeParameterNamesByTextNextNameCount=new e.Map)).set(s,c),(r.typeParameterNames||(r.typeParameterNames=new e.Map)).set(Bu(t),o),(r.typeParameterNamesByText||(r.typeParameterNamesByText=new e.Set)).add(s);}return o}function A(t,r,n,i){var a=b(t,r,n);return !i||1===a.length||r.encounteredError||65536&r.flags||(r.encounteredError=!0),function t(n,i){var a=S(n,i,r),o=n[i];0===i&&(r.flags|=16777216);var s=Wa(o,r);0===i&&(r.flags^=16777216);var c=e.setEmitFlags(e.factory.createIdentifier(s,a),16777216);return c.symbol=o,i>0?e.factory.createQualifiedName(t(n,i-1),c):c}(a,a.length-1)}function P(t,r,n){var i=b(t,r,n);return function t(n,i){var a=S(n,i,r),o=n[i];0===i&&(r.flags|=16777216);var s=Wa(o,r);0===i&&(r.flags^=16777216);var c=s.charCodeAt(0);if(e.isSingleOrDoubleQuote(c)&&e.some(o.declarations,Aa))return e.factory.createStringLiteral(C(o,r));var l=35===c?s.length>1&&e.isIdentifierStart(s.charCodeAt(1),K):e.isIdentifierStart(c,K);if(0===i||l){var u=e.setEmitFlags(e.factory.createIdentifier(s,a),16777216);return u.symbol=o,i>0?e.factory.createPropertyAccessExpression(t(n,i-1),u):u}91===c&&(c=(s=s.substring(1,s.length-1)).charCodeAt(0));var _=void 0;return e.isSingleOrDoubleQuote(c)?_=e.factory.createStringLiteral(s.substring(1,s.length-1).replace(/\\./g,(function(e){return e.substring(1)})),39===c):""+ +s===s&&(_=e.factory.createNumericLiteral(+s)),_||((_=e.setEmitFlags(e.factory.createIdentifier(s,a),16777216)).symbol=o),e.factory.createElementAccessExpression(t(n,i-1),_)}(i,i.length-1)}function w(t){var r=e.getNameOfDeclaration(t);return !!r&&e.isStringLiteral(r)}function I(t){var r=e.getNameOfDeclaration(t);return !!(r&&e.isStringLiteral(r)&&(r.singleQuote||!e.nodeIsSynthesized(r)&&e.startsWith(e.getTextOfNode(r,!1),"'")))}function L(t,r){var n=!!e.length(t.declarations)&&e.every(t.declarations,I);return function(t,r,n){var i=Gn(t).nameType;if(i){if(384&i.flags){var a=""+i.value;return e.isIdentifierText(a,e.getEmitScriptTarget(U))||ky(a)?ky(a)&&e.startsWith(a,"-")?e.factory.createComputedPropertyName(e.factory.createNumericLiteral(+a)):R(a):e.factory.createStringLiteral(a,!!n)}if(8192&i.flags)return e.factory.createComputedPropertyName(P(i.symbol,r,111551))}}(t,r,n)||R(e.unescapeLeadingUnderscores(t.escapedName),!!e.length(t.declarations)&&e.every(t.declarations,w),n)}function R(t,r,n){return e.isIdentifierText(t,e.getEmitScriptTarget(U))?e.factory.createIdentifier(t):!r&&ky(t)&&+t>=0?e.factory.createNumericLiteral(+t):e.factory.createStringLiteral(t,!!n)}function B(t,r){return t.declarations&&e.find(t.declarations,(function(t){return !(!e.getEffectiveTypeAnnotationNode(t)||r&&!e.findAncestor(t,(function(e){return e===r})))}))}function j(t,r){return !(4&e.getObjectFlags(r))||!e.isTypeReferenceNode(t)||e.length(t.typeArguments)>=ol(r.target.typeParameters)}function J(t,r,n,i,a,o){if(!ro(r)&&i){var s=B(n,i);if(s&&!e.isFunctionLikeDeclaration(s)&&!e.isGetAccessorDeclaration(s)){var c=e.getEffectiveTypeAnnotationNode(s);if(dd(c)===r&&j(c,r)){var u=V(t,c,a,o);if(u)return u}}}var _=t.flags;8192&r.flags&&r.symbol===n&&(!t.enclosingDeclaration||e.some(n.declarations,(function(r){return e.getSourceFileOfNode(r)===e.getSourceFileOfNode(t.enclosingDeclaration)})))&&(t.flags|=1048576);var d=l(r,t);return t.flags=_,d}function z(t,r,n){var i,a,o=!1,s=e.getFirstIdentifier(t);if(e.isInJSFile(t)&&(e.isExportsIdentifier(s)||e.isModuleExportsAccessExpression(s.parent)||e.isQualifiedName(s.parent)&&e.isModuleIdentifier(s.parent.left)&&e.isExportsIdentifier(s.parent.right)))return {introducesError:o=!0,node:t};var c=Mi(s,67108863,!0,!0);if(c&&(0!==Ea(c,r.enclosingDeclaration,67108863,!1).accessibility?o=!0:(null===(a=null===(i=r.tracker)||void 0===i?void 0:i.trackSymbol)||void 0===a||a.call(i,c,r.enclosingDeclaration,67108863),null==n||n(c)),e.isIdentifier(t))){var l=262144&c.flags?F(ms(c),r):e.factory.cloneNode(t);return l.symbol=c,{introducesError:o,node:e.setEmitFlags(e.setOriginalNode(l,t),16777216)}}return {introducesError:o,node:t}}function V(r,n,i,o){a&&a.throwIfCancellationRequested&&a.throwIfCancellationRequested();var s=!1,c=e.getSourceFileOfNode(n),u=e.visitNode(n,(function n(a){if(e.isJSDocAllType(a)||317===a.kind)return e.factory.createKeywordTypeNode(130);if(e.isJSDocUnknownType(a))return e.factory.createKeywordTypeNode(154);if(e.isJSDocNullableType(a))return e.factory.createUnionTypeNode([e.visitNode(a.type,n),e.factory.createLiteralTypeNode(e.factory.createNull())]);if(e.isJSDocOptionalType(a))return e.factory.createUnionTypeNode([e.visitNode(a.type,n),e.factory.createKeywordTypeNode(152)]);if(e.isJSDocNonNullableType(a))return e.visitNode(a.type,n);if(e.isJSDocVariadicType(a))return e.factory.createArrayTypeNode(e.visitNode(a.type,n));if(e.isJSDocTypeLiteral(a))return e.factory.createTypeLiteralNode(e.map(a.jsDocPropertyTags,(function(t){var i=e.isIdentifier(t.name)?t.name:t.name.right,o=eo(dd(a),i.escapedText),s=o&&t.typeExpression&&dd(t.typeExpression.type)!==o?l(o,r):void 0;return e.factory.createPropertySignature(void 0,i,t.isBracketed||t.typeExpression&&e.isJSDocOptionalType(t.typeExpression.type)?e.factory.createToken(57):void 0,s||t.typeExpression&&e.visitNode(t.typeExpression.type,n)||e.factory.createKeywordTypeNode(130))})));if(e.isTypeReferenceNode(a)&&e.isIdentifier(a.typeName)&&""===a.typeName.escapedText)return e.setOriginalNode(e.factory.createKeywordTypeNode(130),a);if((e.isExpressionWithTypeArguments(a)||e.isTypeReferenceNode(a))&&e.isJSDocIndexSignature(a))return e.factory.createTypeLiteralNode([e.factory.createIndexSignature(void 0,void 0,[e.factory.createParameterDeclaration(void 0,void 0,void 0,"x",void 0,e.visitNode(a.typeArguments[0],n))],e.visitNode(a.typeArguments[1],n))]);var u;if(e.isJSDocFunctionType(a))return e.isJSDocConstructSignature(a)?e.factory.createConstructorTypeNode(a.modifiers,e.visitNodes(a.typeParameters,n),e.mapDefined(a.parameters,(function(t,r){return t.name&&e.isIdentifier(t.name)&&"new"===t.name.escapedText?void(u=t.type):e.factory.createParameterDeclaration(void 0,void 0,g(t),m(t,r),t.questionToken,e.visitNode(t.type,n),void 0)})),e.visitNode(u||a.type,n)||e.factory.createKeywordTypeNode(130)):e.factory.createFunctionTypeNode(e.visitNodes(a.typeParameters,n),e.map(a.parameters,(function(t,r){return e.factory.createParameterDeclaration(void 0,void 0,g(t),m(t,r),t.questionToken,e.visitNode(t.type,n),void 0)})),e.visitNode(a.type,n)||e.factory.createKeywordTypeNode(130));if(e.isTypeReferenceNode(a)&&e.isInJSDoc(a)&&(!j(a,dd(a))||ru(a)||Ne===Gl(a,788968,!0)))return e.setOriginalNode(l(dd(a),r),a);if(e.isLiteralImportTypeNode(a)){var _=Qn(a).resolvedSymbol;return !e.isInJSDoc(a)||!_||(a.isTypeOf||788968&_.flags)&&e.length(a.typeArguments)>=ol(Xo(_))?e.factory.updateImportTypeNode(a,e.factory.updateLiteralTypeNode(a.argument,function(n,i){if(o){if(r.tracker&&r.tracker.moduleResolverHost){var a=DT(n);if(a){var s={getCanonicalFileName:e.createGetCanonicalFileName(!!t.useCaseSensitiveFileNames),getCurrentDirectory:function(){return r.tracker.moduleResolverHost.getCurrentDirectory()},getCommonSourceDirectory:function(){return r.tracker.moduleResolverHost.getCommonSourceDirectory()}},c=e.getResolvedExternalModuleName(s,a);return e.factory.createStringLiteral(c)}}}else if(r.tracker&&r.tracker.trackExternalModuleSymbolOfImportTypeNode){var l=Bi(i,i,void 0);l&&r.tracker.trackExternalModuleSymbolOfImportTypeNode(l);}return i}(a,a.argument.literal)),a.qualifier,e.visitNodes(a.typeArguments,n,e.isTypeNode),a.isTypeOf):e.setOriginalNode(l(dd(a),r),a)}if(e.isEntityName(a)||e.isEntityNameExpression(a)){var d=z(a,r,i),p=d.introducesError,f=d.node;if(s=s||p,f!==a)return f}return c&&e.isTupleTypeNode(a)&&e.getLineAndCharacterOfPosition(c,a.pos).line===e.getLineAndCharacterOfPosition(c,a.end).line&&e.setEmitFlags(a,1),e.visitEachChild(a,n,e.nullTransformationContext);function g(t){return t.dotDotDotToken||(t.type&&e.isJSDocVariadicType(t.type)?e.factory.createToken(25):void 0)}function m(t,r){return t.name&&e.isIdentifier(t.name)&&"this"===t.name.escapedText?"this":g(t)?"args":"arg".concat(r)}}));if(!s)return u===n?e.setTextRange(e.factory.cloneNode(n),n):u}}(),oe=e.createSymbolTable(),se=jn(4,"undefined");se.declarations=[];var ce=jn(1536,"globalThis",8);ce.exports=oe,ce.declarations=[],oe.set(ce.escapedName,ce);var le,ue=jn(4,"arguments"),_e=jn(4,"require"),de={getNodeCount:function(){return e.sum(t.getSourceFiles(),"nodeCount")},getIdentifierCount:function(){return e.sum(t.getSourceFiles(),"identifierCount")},getSymbolCount:function(){return e.sum(t.getSourceFiles(),"symbolCount")+h},getTypeCount:function(){return v},getInstantiationCount:function(){return x},getRelationCacheSizes:function(){return {assignable:Dn.size,identity:Tn.size,subtype:bn.size,strictSubtype:xn.size}},isUndefinedSymbol:function(e){return e===se},isArgumentsSymbol:function(e){return e===ue},isUnknownSymbol:function(e){return e===Ne},getMergedSymbol:Zi,getDiagnostics:ES,getGlobalDiagnostics:function(){return kS(),mn.getGlobalDiagnostics()},getRecursionIdentity:Jp,getUnmatchedProperties:ag,getTypeOfSymbolAtLocation:function(t,r){var n=e.getParseTreeNode(r);return n?function(t,r){if(t=t.exportSymbol||t,(79===r.kind||80===r.kind)&&(e.isRightSideOfQualifiedNameOrPropertyAccess(r)&&(r=r.parent),e.isExpressionNode(r)&&(!e.isAssignmentTarget(r)||e.isWriteAccess(r)))){var n=rx(r);if(aa(Qn(r).resolvedSymbol)===t)return n}return e.isDeclarationName(r)&&e.isSetAccessor(r.parent)&&Io(r.parent)?Ro(r.parent.symbol,!0):Ko(t)}(t,n):Me},getSymbolsOfParameterPropertyDeclaration:function(t,r){var n=e.getParseTreeNode(t,e.isParameter);return void 0===n?e.Debug.fail("Cannot get symbols of a synthetic parameter that cannot be resolved to a parse-tree node."):function(t,r){var n=t.parent,i=t.parent.parent,a=Yn(n.locals,r,111551),o=Yn(Os(i.symbol),r,111551);return a&&o?[a,o]:e.Debug.fail("There should exist two symbols, one as property declaration and one as parameter declaration")}(n,e.escapeLeadingUnderscores(r))},getDeclaredTypeOfSymbol:ms,getPropertiesOfType:yc,getPropertyOfType:function(t,r){return Jc(t,e.escapeLeadingUnderscores(r))},getPrivateIdentifierPropertyOfType:function(t,r,n){var i=e.getParseTreeNode(n);if(i){var a=gv(e.escapeLeadingUnderscores(r),i);return a?yv(t,a):void 0}},getTypeOfPropertyOfType:function(t,r){return eo(t,e.escapeLeadingUnderscores(r))},getIndexInfoOfType:function(e,t){return Gc(e,0===t?He:Ge)},getIndexInfosOfType:Hc,getSignaturesOfType:Uc,getIndexTypeOfType:function(e,t){return Qc(e,0===t?He:Ge)},getBaseTypes:is,getBaseTypeOfLiteralType:of,getWidenedType:jf,getTypeFromTypeNode:function(t){var r=e.getParseTreeNode(t,e.isTypeNode);return r?dd(r):Me},getParameterType:Qh,getParameterIdentifierNameAtPosition:function(e,t){var r=e.parameters.length-(J(e)?1:0);if(t<r){var n=e.parameters[t];return Wh(n)?[n.escapedName,!1]:void 0}var i=e.parameters[r]||Ne;if(Wh(i)){var a=Uo(i);if(_f(a)){var o=a.target.labeledElementDeclarations,s=null==o?void 0:o[t-r],c=!!(null==s?void 0:s.dotDotDotToken);return s?[Vh(s),c]:void 0}return t===r?[i.escapedName,!0]:void 0}},getPromisedTypeOfPromise:Cx,getAwaitedType:function(e){return Ax(e)},getReturnTypeOfSignature:ml,isNullableType:av,getNullableType:xf,getNonNullableType:Sf,getNonOptionalType:Cf,getTypeArguments:zl,typeToTypeNode:ae.typeToTypeNode,indexInfoToIndexSignatureDeclaration:ae.indexInfoToIndexSignatureDeclaration,signatureToSignatureDeclaration:ae.signatureToSignatureDeclaration,symbolToEntityName:ae.symbolToEntityName,symbolToExpression:ae.symbolToExpression,symbolToTypeParameterDeclarations:ae.symbolToTypeParameterDeclarations,symbolToParameterDeclaration:ae.symbolToParameterDeclaration,typeParameterToDeclaration:ae.typeParameterToDeclaration,getSymbolsInScope:function(t,r){var n=e.getParseTreeNode(t);return n?function(t,r){if(16777216&t.flags)return [];var n=e.createSymbolTable(),i=!1;return function(){for(;t;){switch(t.locals&&!Xn(t)&&o(t.locals,r),t.kind){case 303:if(!e.isExternalModule(t))break;case 260:s($i(t).exports,2623475&r);break;case 259:o($i(t).exports,8&r);break;case 225:t.name&&a(t.symbol,r);case 256:case 257:i||o(Os($i(t)),788968&r);break;case 212:t.name&&a(t.symbol,r);}e.introducesArgumentsExoticObject(t)&&a(ue,r),i=e.isStatic(t),t=t.parent;}o(oe,r);}(),n.delete("this"),el(n);function a(t,r){if(e.getCombinedLocalAndExportSymbolFlags(t)&r){var i=t.escapedName;n.has(i)||n.set(i,t);}}function o(e,t){t&&e.forEach((function(e){a(e,t);}));}function s(t,r){r&&t.forEach((function(t){e.getDeclarationOfKind(t,274)||e.getDeclarationOfKind(t,273)||a(t,r);}));}}(n,r):[]},getSymbolAtLocation:function(t){var r=e.getParseTreeNode(t);return r?MS(r,!0):void 0},getIndexInfosAtLocation:function(t){var r=e.getParseTreeNode(t);return r?function(t){if(e.isIdentifier(t)&&e.isPropertyAccessExpression(t.parent)&&t.parent.name===t){var r=i_(t),n=rx(t.parent.expression),i=1048576&n.flags?n.types:[n];return e.flatMap(i,(function(t){return e.filter(Hc(t),(function(e){return qc(r,e.keyType)}))}))}}(r):void 0},getShorthandAssignmentValueSymbol:function(t){var r=e.getParseTreeNode(t);return r?function(e){if(e&&295===e.kind)return Mi(e.name,2208703)}(r):void 0},getExportSpecifierLocalTargetSymbol:function(t){var r=e.getParseTreeNode(t,e.isExportSpecifier);return r?function(t){return e.isExportSpecifier(t)?t.parent.parent.moduleSpecifier?bi(t.parent.parent,t):Mi(t.propertyName||t.name,2998271):Mi(t,2998271)}(r):void 0},getExportSymbolOfSymbol:function(e){return Zi(e.exportSymbol||e)},getTypeAtLocation:function(t){var r=e.getParseTreeNode(t);return r?LS(r):Me},getTypeOfAssignmentPattern:function(t){var r=e.getParseTreeNode(t,e.isAssignmentPattern);return r&&RS(r)||Me},getPropertySymbolOfDestructuringAssignment:function(t){var r=e.getParseTreeNode(t,e.isIdentifier);return r?function(t){var r=RS(e.cast(t.parent.parent,e.isAssignmentPattern));return r&&Jc(r,t.escapedText)}(r):void 0},signatureToString:function(t,r,n,i){return Oa(t,e.getParseTreeNode(r),n,i)},typeToString:function(t,r,n){return Ma(t,e.getParseTreeNode(r),n)},symbolToString:function(t,r,n,i){return Ia(t,e.getParseTreeNode(r),n,i)},typePredicateToString:function(t,r,n){return za(t,e.getParseTreeNode(r),n)},writeSignature:function(t,r,n,i,a){return Oa(t,e.getParseTreeNode(r),n,i,a)},writeType:function(t,r,n,i){return Ma(t,e.getParseTreeNode(r),n,i)},writeSymbol:function(t,r,n,i,a){return Ia(t,e.getParseTreeNode(r),n,i,a)},writeTypePredicate:function(t,r,n,i){return za(t,e.getParseTreeNode(r),n,i)},getAugmentedPropertiesOfType:zS,getRootSymbols:function t(r){var n=function(t){if(6&e.getCheckFlags(t))return e.mapDefined(Gn(t).containingType.types,(function(e){return Jc(e,t.escapedName)}));if(33554432&t.flags){var r=t,n=r.leftSpread,i=r.rightSpread,a=r.syntheticOrigin;return n?[n,i]:a?[a]:e.singleElementArray(function(e){for(var t,r=e;r=Gn(r).target;)t=r;return t}(t))}}(r);return n?e.flatMap(n,t):[r]},getSymbolOfExpando:Ph,getContextualType:function(t,r){var n=e.getParseTreeNode(t,e.isExpression);if(n){var i=e.findAncestor(n,e.isCallLikeExpression),a=i&&Qn(i).resolvedSignature;if(4&r&&i){var o=n;do{Qn(o).skipDirectInference=!0,o=o.parent;}while(o&&o!==i);Qn(i).resolvedSignature=void 0;}var s=my(n,r);if(4&r&&i){o=n;do{Qn(o).skipDirectInference=void 0,o=o.parent;}while(o&&o!==i);Qn(i).resolvedSignature=a;}return s}},getContextualTypeForObjectLiteralElement:function(t){var r=e.getParseTreeNode(t,e.isObjectLiteralElementLike);return r?ly(r):void 0},getContextualTypeForArgumentAtIndex:function(t,r){var n=e.getParseTreeNode(t,e.isCallLikeExpression);return n&&ay(n,r)},getContextualTypeForJsxAttribute:function(t){var r=e.getParseTreeNode(t,e.isJsxAttributeLike);return r&&_y(r)},isContextSensitive:Ud,getTypeOfPropertyOfContextualType:cy,getFullyQualifiedName:Oi,getResolvedSignature:function(e,t,r){return pe(e,t,r,0)},getResolvedSignatureForSignatureHelp:function(e,t,r){return pe(e,t,r,16)},getExpandedParameters:Us,hasEffectiveRestParameter:eb,containsArgumentsReference:ul,getConstantValue:function(t){var r=e.getParseTreeNode(t,cT);return r?lT(r):void 0},isValidPropertyAccess:function(t,r){var n=e.getParseTreeNode(t,e.isPropertyAccessOrQualifiedNameOrImportTypeNode);return !!n&&function(e,t){switch(e.kind){case 205:return Lv(e,106===e.expression.kind,t,jf(ax(e.expression)));case 160:return Lv(e,!1,t,jf(ax(e.left)));case 199:return Lv(e,!1,t,dd(e))}}(n,e.escapeLeadingUnderscores(r))},isValidPropertyAccessForCompletions:function(t,r,n){var i=e.getParseTreeNode(t,e.isPropertyAccessExpression);return !!i&&Mv(i,r,n)},getSignatureFromDeclaration:function(t){var r=e.getParseTreeNode(t,e.isFunctionLike);return r?cl(r):void 0},isImplementationOfOverload:function(t){var r=e.getParseTreeNode(t,e.isFunctionLike);return r?tT(r):void 0},getImmediateAliasedSymbol:Py,getAliasedSymbol:ki,getEmitResolver:function(e,t){return ES(e,t),ie},getExportsOfModule:qi,getExportsAndPropertiesOfModule:function(t){var r=qi(t),n=zi(t);if(n!==t){var i=Uo(n);Hi(i)&&e.addRange(r,yc(i));}return r},forEachExportAndPropertyOfModule:function(e,t){Qi(e).forEach((function(e,r){pa(r)||t(e,r);}));var r=zi(e);if(r!==e){var n=Uo(r);Hi(n)&&function(e,r){3670016&(e=Pc(e)).flags&&pc(e).members.forEach((function(e,r){ga(e,r)&&function(e,r){t(e,r);}(e,r);}));}(n);}},getSymbolWalker:e.createGetSymbolWalker((function(e){return hl(e)||we}),fl,ml,is,pc,Uo,Sg,hc,e.getFirstIdentifier,zl),getAmbientModules:function(){return Nt||(Nt=[],oe.forEach((function(e,t){c.test(t)&&Nt.push(e);}))),Nt},getJsxIntrinsicTagNamesAt:function(t){var r=By(A.IntrinsicElements,t);return r?yc(r):e.emptyArray},isOptionalParameter:function(t){var r=e.getParseTreeNode(t,e.isParameter);return !!r&&nl(r)},tryGetMemberInModuleExports:function(t,r){return Wi(e.escapeLeadingUnderscores(t),r)},tryGetMemberInModuleExportsAndProperties:function(t,r){return function(e,t){var r=Wi(e,t);if(r)return r;var n=zi(t);if(n!==t){var i=Uo(n);return Hi(i)?Jc(i,e):void 0}}(e.escapeLeadingUnderscores(t),r)},tryFindAmbientModule:function(e){return rl(e,!0)},tryFindAmbientModuleWithoutAugmentations:function(e){return rl(e,!1)},getApparentType:Ac,getUnionType:qu,isTypeAssignableTo:Yd,createAnonymousType:ya,createSignature:Bs,createSymbol:jn,createIndexInfo:Nl,getAnyType:function(){return we},getStringType:function(){return He},getNumberType:function(){return Ge},createPromiseType:cb,createArrayType:Tu,getElementTypeOfArrayType:Gp,getBooleanType:function(){return et},getFalseType:function(e){return e?Xe:Ye},getTrueType:function(e){return e?Ze:$e},getVoidType:function(){return rt},getUndefinedType:function(){return ze},getNullType:function(){return qe},getESSymbolType:function(){return tt},getNeverType:function(){return nt},getOptionalType:function(){return Ke},getPromiseType:function(){return mu(!1)},getPromiseLikeType:function(){return yu(!1)},isSymbolAccessible:Ea,isArrayType:qp,isTupleType:_f,isArrayLikeType:Qp,isTypeInvalidDueToUnionDiscriminant:function(e,t){return t.properties.some((function(t){var r=t.name&&i_(t.name),n=r&&Es(r)?Ps(r):void 0,i=void 0===n?void 0:eo(e,n);return !!i&&af(i)&&!Yd(LS(t),i)}))},getExactOptionalProperties:function(e){return yc(e).filter((function(e){return Ff(Uo(e))}))},getAllPossiblePropertiesOfTypes:function(t){var r=qu(t);if(!(1048576&r.flags))return zS(r);for(var n=e.createSymbolTable(),i=0,a=t;i<a.length;i++)for(var o=0,s=zS(a[i]);o<s.length;o++){var c=s[o].escapedName;if(!n.has(c)){var l=wc(r,c);l&&n.set(c,l);}}return e.arrayFrom(n.values())},getSuggestedSymbolForNonexistentProperty:kv,getSuggestionForNonexistentProperty:Fv,getSuggestedSymbolForNonexistentJSXAttribute:Nv,getSuggestedSymbolForNonexistentSymbol:function(t,r,n){return Av(t,e.escapeLeadingUnderscores(r),n)},getSuggestionForNonexistentSymbol:function(t,r,n){return function(t,r,n){var i=Av(t,r,n);return i&&e.symbolName(i)}(t,e.escapeLeadingUnderscores(r),n)},getSuggestedSymbolForNonexistentModule:Pv,getSuggestionForNonexistentExport:function(t,r){var n=Pv(t,r);return n&&e.symbolName(n)},getSuggestedSymbolForNonexistentClassMember:Ev,getBaseConstraintOfType:Tc,getDefaultFromTypeParameter:function(e){return e&&262144&e.flags?Fc(e):void 0},resolveName:function(t,r,n,i){return ei(r,e.escapeLeadingUnderscores(t),n,void 0,void 0,!1,i)},getJsxNamespace:function(t){return e.unescapeLeadingUnderscores(Nn(t))},getJsxFragmentFactory:function(t){var r=xT(t);return r&&e.unescapeLeadingUnderscores(e.getFirstIdentifier(r).escapedText)},getAccessibleSymbolChain:ba,getTypePredicateOfSignature:fl,resolveExternalModuleName:function(t){var r=e.getParseTreeNode(t,e.isExpression);return r&&Ri(r,r,!0)},resolveExternalModuleSymbol:zi,tryGetThisTypeAt:function(t,r){var n=e.getParseTreeNode(t);return n&&Hm(n,r)},getTypeArgumentConstraint:function(t){var r=e.getParseTreeNode(t,e.isTypeNode);return r&&function(t){var r=e.tryCast(t.parent,e.isTypeReferenceType);if(r){var n=yx(r);if(n){var i=hc(n[r.typeArguments.indexOf(t)]);return i&&Rd(i,vd(n,gx(r,n)))}}}(r)},getSuggestionDiagnostics:function(r,n){var o,s=e.getParseTreeNode(r,e.isSourceFile)||e.Debug.fail("Could not determine parsed source file.");if(e.skipTypeChecking(s,U,t))return e.emptyArray;try{return a=n,SS(s),e.Debug.assert(!!(1&Qn(s).flags)),o=e.addRange(o,yn.getDiagnostics(s.fileName)),Ux(CS(s),(function(t,r,n){e.containsParseError(t)||TS(r,!!(8388608&t.flags))||(o||(o=[])).push(i$1(i$1({},n),{category:e.DiagnosticCategory.Suggestion}));})),o||e.emptyArray}finally{a=void 0;}},runWithCancellationToken:function(e,t){try{return a=e,t(de)}finally{a=void 0;}},getLocalTypeParametersOfClassOrInterfaceOrTypeAlias:Xo,isDeclarationVisible:Ha,isPropertyAccessible:Rv,getTypeOnlyAliasDeclaration:Ai,getMemberOverrideModifierStatus:function(t,r){if(!r.name)return 0;var n=$i(t),i=ms(n),a=Ls(i),o=Uo(n),s=e.getEffectiveBaseTypeNode(t)&&is(i),c=(null==s?void 0:s.length)?Ls(e.first(s),i.thisType):void 0,l=rs(i),u=r.parent?e.hasOverrideModifier(r):e.hasSyntacticModifier(r,16384),_=e.unescapeLeadingUnderscores(e.getTextOfPropertyName(r.name));return $D(t,o,l,c,i,a,u,e.hasAbstractModifier(r),e.isStatic(r),!1,_)}};function pe(t,r,n,i){var a=e.getParseTreeNode(t,e.isCallLikeExpression);le=n;var o=a?Nh(a,r,i):void 0;return le=void 0,o}var fe=new e.Map,ge=new e.Map,me=new e.Map,ye=new e.Map,ve=new e.Map,he=new e.Map,be=new e.Map,xe=new e.Map,De=new e.Map,Se=new e.Map,Te=new e.Map,Ce=new e.Map,Ee=[],ke=new e.Map,Ne=jn(4,"unknown"),Fe=jn(0,"__resolving__"),Ae=new e.Map,Pe=new e.Map,we=ua(1,"any"),Ie=ua(1,"any"),Oe=ua(1,"any"),Me=ua(1,"error"),Le=ua(1,"unresolved"),Re=ua(1,"any",131072),Be=ua(1,"intrinsic"),je=ua(2,"unknown"),Je=ua(2,"unknown"),ze=ua(32768,"undefined"),Ue=H?ze:ua(32768,"undefined",131072),Ke=ua(32768,"undefined"),Ve=re?ua(32768,"undefined"):ze,qe=ua(65536,"null"),We=H?qe:ua(65536,"null",131072),He=ua(4,"string"),Ge=ua(8,"number"),Qe=ua(64,"bigint"),Xe=ua(512,"false"),Ye=ua(512,"false"),Ze=ua(512,"true"),$e=ua(512,"true");Ze.regularType=$e,Ze.freshType=Ze,$e.regularType=$e,$e.freshType=Ze,Xe.regularType=Ye,Xe.freshType=Xe,Ye.regularType=Ye,Ye.freshType=Xe;var et=qu([Ye,$e]),tt=ua(4096,"symbol"),rt=ua(16384,"void"),nt=ua(131072,"never"),it=ua(131072,"never"),at=ua(131072,"never",524288),ot=ua(131072,"never"),st=ua(131072,"never"),ct=ua(67108864,"object"),lt=qu([He,Ge]),ut=qu([He,Ge,tt]),_t=ee?He:ut,dt=qu([Ge,Qe]),pt=qu([He,Ge,et,Qe,qe,ze]),ft=xd((function(e){return 262144&e.flags?(t=e).constraint===je?t:t.restrictiveInstantiation||(t.restrictiveInstantiation=da(t.symbol),t.restrictiveInstantiation.constraint=je,t.restrictiveInstantiation):e;var t;})),gt=xd((function(e){return 262144&e.flags?Oe:e})),mt=ya(void 0,k,e.emptyArray,e.emptyArray,e.emptyArray),yt=ya(void 0,k,e.emptyArray,e.emptyArray,e.emptyArray);yt.objectFlags|=2048;var vt=jn(2048,"__type");vt.members=e.createSymbolTable();var ht=ya(vt,k,e.emptyArray,e.emptyArray,e.emptyArray),bt=ya(void 0,k,e.emptyArray,e.emptyArray,e.emptyArray);bt.instantiations=new e.Map;var xt=ya(void 0,k,e.emptyArray,e.emptyArray,e.emptyArray);xt.objectFlags|=524288;var Dt=ya(void 0,k,e.emptyArray,e.emptyArray,e.emptyArray),St=ya(void 0,k,e.emptyArray,e.emptyArray,e.emptyArray),Tt=ya(void 0,k,e.emptyArray,e.emptyArray,e.emptyArray),Ct=da(),Et=da();Et.constraint=Ct;var kt,Nt,Ft,At,Pt,wt,It,Ot,Mt,Lt,Rt,Bt,jt,Jt,zt,Ut,Kt,Vt,qt,Wt,Ht,Gt,Qt,Xt,Yt,Zt,$t,er,tr,rr,nr,ir,ar,or,sr,cr,lr,ur,_r,dr,pr,fr,gr,mr,yr,vr,hr,br,xr,Dr,Sr,Tr=da(),Cr=al(1,"<<unresolved>>",0,we),Er=Bs(void 0,void 0,void 0,e.emptyArray,we,void 0,0,0),kr=Bs(void 0,void 0,void 0,e.emptyArray,Me,void 0,0,0),Nr=Bs(void 0,void 0,void 0,e.emptyArray,we,void 0,0,0),Fr=Bs(void 0,void 0,void 0,e.emptyArray,it,void 0,0,0),Ar=Nl(Ge,He,!0),Pr=new e.Map,wr={get yieldType(){return e.Debug.fail("Not supported")},get returnType(){return e.Debug.fail("Not supported")},get nextType(){return e.Debug.fail("Not supported")}},Ir=DD(we,we,we),Or=DD(we,we,je),Mr=DD(nt,we,ze),Lr={iterableCacheKey:"iterationTypesOfAsyncIterable",iteratorCacheKey:"iterationTypesOfAsyncIterator",iteratorSymbolName:"asyncIterator",getGlobalIteratorType:function(e){return sr||(sr=_u("AsyncIterator",3,e))||bt},getGlobalIterableType:function(e){return or||(or=_u("AsyncIterable",1,e))||bt},getGlobalIterableIteratorType:function(e){return cr||(cr=_u("AsyncIterableIterator",1,e))||bt},getGlobalGeneratorType:function(e){return lr||(lr=_u("AsyncGenerator",3,e))||bt},resolveIterationType:Ax,mustHaveANextMethodDiagnostic:e.Diagnostics.An_async_iterator_must_have_a_next_method,mustBeAMethodDiagnostic:e.Diagnostics.The_0_property_of_an_async_iterator_must_be_a_method,mustHaveAValueDiagnostic:e.Diagnostics.The_type_returned_by_the_0_method_of_an_async_iterator_must_be_a_promise_for_a_type_with_a_value_property},Rr={iterableCacheKey:"iterationTypesOfIterable",iteratorCacheKey:"iterationTypesOfIterator",iteratorSymbolName:"iterator",getGlobalIteratorType:function(e){return tr||(tr=_u("Iterator",3,e))||bt},getGlobalIterableType:hu,getGlobalIterableIteratorType:function(e){return rr||(rr=_u("IterableIterator",1,e))||bt},getGlobalGeneratorType:function(e){return nr||(nr=_u("Generator",3,e))||bt},resolveIterationType:function(e,t){return e},mustHaveANextMethodDiagnostic:e.Diagnostics.An_iterator_must_have_a_next_method,mustBeAMethodDiagnostic:e.Diagnostics.The_0_property_of_an_iterator_must_be_a_method,mustHaveAValueDiagnostic:e.Diagnostics.The_type_returned_by_the_0_method_of_an_iterator_must_have_a_value_property},Br=new e.Map,jr=!1,Jr=new e.Map,zr=0,Ur=0,Kr=0,Vr=!1,qr=0,Wr=id(""),Hr=ad(0),Gr=od({negative:!1,base10Value:"0"}),Qr=[],Xr=[],Yr=[],Zr=0,$r=[],en=[],tn=[],rn=[],nn=[],an=[],on=[],sn=[],cn=[],ln=[],un=[],_n=[],dn=[],pn=[],fn=[],gn=[],mn=e.createDiagnosticCollection(),yn=e.createDiagnosticCollection(),vn=new e.Map(e.getEntries({string:He,number:Ge,bigint:Qe,boolean:et,symbol:tt,undefined:ze})),hn=qu(e.arrayFrom(S.keys(),id)),bn=new e.Map,xn=new e.Map,Dn=new e.Map,Sn=new e.Map,Tn=new e.Map,Cn=new e.Map,En=e.createSymbolTable();En.set(se.escapedName,se);var kn=[[".mts",".mjs"],[".ts",".js"],[".cts",".cjs"],[".mjs",".mjs"],[".js",".js"],[".cjs",".cjs"],[".tsx",1===U.jsx?".jsx":".js"],[".jsx",".jsx"],[".json",".json"]];return function(){for(var r=0,n=t.getSourceFiles();r<n.length;r++){var i=n[r];e.bindSourceFile(i,U);}var a,o,s,c;kt=new e.Map;for(var l=0,u=t.getSourceFiles();l<u.length;l++)if(!(i=u[l]).redirectInfo){if(!e.isExternalOrCommonJsModule(i)){var _=i.locals.get("globalThis");if(null==_?void 0:_.declarations)for(var d=0,p=_.declarations;d<p.length;d++){var f=p[d];mn.add(e.createDiagnosticForNode(f,e.Diagnostics.Declaration_name_conflicts_with_built_in_global_identifier_0,"globalThis"));}Wn(oe,i.locals);}i.jsGlobalAugmentations&&Wn(oe,i.jsGlobalAugmentations),i.patternAmbientModules&&i.patternAmbientModules.length&&(Ft=e.concatenate(Ft,i.patternAmbientModules)),i.moduleAugmentations.length&&(a||(a=[])).push(i.moduleAugmentations),i.symbol&&i.symbol.globalExports&&i.symbol.globalExports.forEach((function(e,t){oe.has(t)||oe.set(t,e);}));}if(a)for(var g=0,m=a;g<m.length;g++)for(var y=m[g],v=0,h=y;v<h.length;v++){var b=h[v];e.isGlobalScopeAugmentation(b.parent)&&Hn(b);}if(o=oe,s=En,c=e.Diagnostics.Declaration_name_conflicts_with_built_in_global_identifier_0,s.forEach((function(t,r){var n=o.get(r);n?e.forEach(n.declarations,function(t,r){return function(n){return mn.add(e.createDiagnosticForNode(n,r,t))}}(e.unescapeLeadingUnderscores(r),c)):o.set(r,t);})),Gn(se).type=Ue,Gn(ue).type=_u("IArguments",0,!0),Gn(Ne).type=Me,Gn(ce).type=_a(16,ce),Mt=_u("Array",1,!0),Pt=_u("Object",0,!0),wt=_u("Function",0,!0),It=Q&&_u("CallableFunction",0,!0)||wt,Ot=Q&&_u("NewableFunction",0,!0)||wt,Rt=_u("String",0,!0),Bt=_u("Number",0,!0),jt=_u("Boolean",0,!0),Jt=_u("RegExp",0,!0),Ut=Tu(we),(Kt=Tu(Ie))===mt&&(Kt=ya(void 0,k,e.emptyArray,e.emptyArray,e.emptyArray)),Lt=bu("ReadonlyArray",1)||Mt,Vt=Lt?Du(Lt,[we]):Ut,zt=bu("ThisType",1),a)for(var x=0,D=a;x<D.length;x++)for(var S=0,T=y=D[x];S<T.length;S++)b=T[S],e.isGlobalScopeAugmentation(b.parent)||Hn(b);kt.forEach((function(t){var r=t.firstFile,n=t.secondFile,i=t.conflictingSymbols;if(i.size<8)i.forEach((function(t,r){for(var n=t.isBlockScoped,i=t.firstFileLocations,a=t.secondFileLocations,o=n?e.Diagnostics.Cannot_redeclare_block_scoped_variable_0:e.Diagnostics.Duplicate_identifier_0,s=0,c=i;s<c.length;s++)qn(c[s],o,r,a);for(var l=0,u=a;l<u.length;l++)qn(u[l],o,r,i);}));else {var a=e.arrayFrom(i.keys()).join(", ");mn.add(e.addRelatedInfo(e.createDiagnosticForNode(r,e.Diagnostics.Definitions_of_the_following_identifiers_conflict_with_those_in_another_file_Colon_0,a),e.createDiagnosticForNode(n,e.Diagnostics.Conflicts_are_in_this_file))),mn.add(e.addRelatedInfo(e.createDiagnosticForNode(n,e.Diagnostics.Definitions_of_the_following_identifiers_conflict_with_those_in_another_file_Colon_0,a),e.createDiagnosticForNode(r,e.Diagnostics.Conflicts_are_in_this_file)));}})),kt=void 0;}(),de;function Nn(t){if(t){var r=e.getSourceFileOfNode(t);if(r)if(e.isJsxOpeningFragment(t)){if(r.localJsxFragmentNamespace)return r.localJsxFragmentNamespace;var n=r.pragmas.get("jsxfrag");if(n){var i=e.isArray(n)?n[0]:n;if(r.localJsxFragmentFactory=e.parseIsolatedEntityName(i.arguments.factory,K),e.visitNode(r.localJsxFragmentFactory,An),r.localJsxFragmentFactory)return r.localJsxFragmentNamespace=e.getFirstIdentifier(r.localJsxFragmentFactory).escapedText}var a=xT(t);if(a)return r.localJsxFragmentFactory=a,r.localJsxFragmentNamespace=e.getFirstIdentifier(a).escapedText}else {var o=Fn(r);if(o)return r.localJsxNamespace=o}}return xr||(xr="React",U.jsxFactory?(Dr=e.parseIsolatedEntityName(U.jsxFactory,K),e.visitNode(Dr,An),Dr&&(xr=e.getFirstIdentifier(Dr).escapedText)):U.reactNamespace&&(xr=e.escapeLeadingUnderscores(U.reactNamespace))),Dr||(Dr=e.factory.createQualifiedName(e.factory.createIdentifier(e.unescapeLeadingUnderscores(xr)),"createElement")),xr}function Fn(t){if(t.localJsxNamespace)return t.localJsxNamespace;var r=t.pragmas.get("jsx");if(r){var n=e.isArray(r)?r[0]:r;if(t.localJsxFactory=e.parseIsolatedEntityName(n.arguments.factory,K),e.visitNode(t.localJsxFactory,An),t.localJsxFactory)return t.localJsxNamespace=e.getFirstIdentifier(t.localJsxFactory).escapedText}}function An(t){return e.setTextRangePosEnd(t,-1,-1),e.visitEachChild(t,An,e.nullTransformationContext)}function Pn(e,t,r,n,i,a,o){var s=In(t,r,n,i,a,o);return s.skippedOn=e,s}function wn(t,r,n,i,a,o){return t?e.createDiagnosticForNode(t,r,n,i,a,o):e.createCompilerDiagnostic(r,n,i,a,o)}function In(e,t,r,n,i,a){var o=wn(e,t,r,n,i,a);return mn.add(o),o}function On(t,r){t?mn.add(r):yn.add(i$1(i$1({},r),{category:e.DiagnosticCategory.Suggestion}));}function Mn(t,r,n,i,a,o,s){if(r.pos<0||r.end<0){if(!t)return;var c=e.getSourceFileOfNode(r);On(t,"message"in n?e.createFileDiagnostic(c,0,0,n,i,a,o,s):e.createDiagnosticForFileFromMessageChain(c,n));}else On(t,"message"in n?e.createDiagnosticForNode(r,n,i,a,o,s):e.createDiagnosticForNodeFromMessageChain(r,n));}function Ln(t,r,n,i,a,o,s){var c=In(t,n,i,a,o,s);if(r){var l=e.createDiagnosticForNode(t,e.Diagnostics.Did_you_forget_to_use_await);e.addRelatedInfo(c,l);}return c}function Rn(t,r){var n=Array.isArray(t)?e.forEach(t,e.getJSDocDeprecatedTag):e.getJSDocDeprecatedTag(t);return n&&e.addRelatedInfo(r,e.createDiagnosticForNode(n,e.Diagnostics.The_declaration_was_marked_as_deprecated_here)),yn.add(r),r}function Bn(t,r,n){return Rn(r,e.createDiagnosticForNode(t,e.Diagnostics._0_is_deprecated,n))}function jn(e,t,r){h++;var n=new g(33554432|e,t);return n.checkFlags=r||0,n}function Jn(e){var t=0;return 2&e&&(t|=111551),1&e&&(t|=111550),4&e&&(t|=0),8&e&&(t|=900095),16&e&&(t|=110991),32&e&&(t|=899503),64&e&&(t|=788872),256&e&&(t|=899327),128&e&&(t|=899967),512&e&&(t|=110735),8192&e&&(t|=103359),32768&e&&(t|=46015),65536&e&&(t|=78783),262144&e&&(t|=526824),524288&e&&(t|=788968),2097152&e&&(t|=2097152),t}function zn(e,t){t.mergeId||(t.mergeId=d,d++),$r[t.mergeId]=e;}function Un(t){var r=jn(t.flags,t.escapedName);return r.declarations=t.declarations?t.declarations.slice():[],r.parent=t.parent,t.valueDeclaration&&(r.valueDeclaration=t.valueDeclaration),t.constEnumOnlyModule&&(r.constEnumOnlyModule=!0),t.members&&(r.members=new e.Map(t.members)),t.exports&&(r.exports=new e.Map(t.exports)),zn(r,t),r}function Kn(t,r,n){if(void 0===n&&(n=!1),!(t.flags&Jn(r.flags))||67108864&(r.flags|t.flags)){if(r===t)return t;if(!(33554432&t.flags)){var i=Ei(t);if(i===Ne)return r;t=Un(i);}512&r.flags&&512&t.flags&&t.constEnumOnlyModule&&!r.constEnumOnlyModule&&(t.constEnumOnlyModule=!1),t.flags|=r.flags,r.valueDeclaration&&e.setValueDeclaration(t,r.valueDeclaration),e.addRange(t.declarations,r.declarations),r.members&&(t.members||(t.members=e.createSymbolTable()),Wn(t.members,r.members,n)),r.exports&&(t.exports||(t.exports=e.createSymbolTable()),Wn(t.exports,r.exports,n)),n||zn(t,r);}else if(1024&t.flags)t!==ce&&In(r.declarations&&e.getNameOfDeclaration(r.declarations[0]),e.Diagnostics.Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity,Ia(t));else {var a=!!(384&t.flags||384&r.flags),o=!!(2&t.flags||2&r.flags),s=a?e.Diagnostics.Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations:o?e.Diagnostics.Cannot_redeclare_block_scoped_variable_0:e.Diagnostics.Duplicate_identifier_0,c=r.declarations&&e.getSourceFileOfNode(r.declarations[0]),l=t.declarations&&e.getSourceFileOfNode(t.declarations[0]),u=Ia(r);if(c&&l&&kt&&!a&&c!==l){var _=-1===e.comparePaths(c.path,l.path)?c:l,d=_===c?l:c,p=e.getOrUpdate(kt,"".concat(_.path,"|").concat(d.path),(function(){return {firstFile:_,secondFile:d,conflictingSymbols:new e.Map}})),f=e.getOrUpdate(p.conflictingSymbols,u,(function(){return {isBlockScoped:o,firstFileLocations:[],secondFileLocations:[]}}));g(f.firstFileLocations,r),g(f.secondFileLocations,t);}else Vn(r,s,u,t),Vn(t,s,u,r);}return t;function g(t,r){if(r.declarations)for(var n=0,i=r.declarations;n<i.length;n++){var a=i[n];e.pushIfUnique(t,a);}}}function Vn(t,r,n,i){e.forEach(t.declarations,(function(e){qn(e,r,n,i.declarations);}));}function qn(t,r,n,i){for(var a=(e.getExpandoInitializer(t,!1)?e.getNameOfExpando(t):e.getNameOfDeclaration(t))||t,o=function(t,r,n,i,a,o){var s=t?e.createDiagnosticForNode(t,r,n,i,a,o):e.createCompilerDiagnostic(r,n,i,a,o);return mn.lookup(s)||(mn.add(s),s)}(a,r,n),s=function(t){var r=(e.getExpandoInitializer(t,!1)?e.getNameOfExpando(t):e.getNameOfDeclaration(t))||t;if(r===a)return "continue";o.relatedInformation=o.relatedInformation||[];var i=e.createDiagnosticForNode(r,e.Diagnostics._0_was_also_declared_here,n),s=e.createDiagnosticForNode(r,e.Diagnostics.and_here);if(e.length(o.relatedInformation)>=5||e.some(o.relatedInformation,(function(t){return 0===e.compareDiagnostics(t,s)||0===e.compareDiagnostics(t,i)})))return "continue";e.addRelatedInfo(o,e.length(o.relatedInformation)?s:i);},c=0,l=i||e.emptyArray;c<l.length;c++)s(l[c]);}function Wn(e,t,r){void 0===r&&(r=!1),t.forEach((function(t,n){var i=e.get(n);e.set(n,i?Kn(i,t,r):t);}));}function Hn(t){var r,n,i,a=t.parent;if((null===(r=a.symbol.declarations)||void 0===r?void 0:r[0])===a)if(e.isGlobalScopeAugmentation(a))Wn(oe,a.symbol.exports);else {var o=Bi(t,t,8388608&t.parent.parent.flags?void 0:e.Diagnostics.Invalid_module_name_in_augmentation_module_0_cannot_be_found,!0);if(!o)return;if(1920&(o=zi(o)).flags)if(e.some(Ft,(function(e){return o===e.symbol}))){var s=Kn(a.symbol,o,!0);At||(At=new e.Map),At.set(t.text,s);}else {if((null===(n=o.exports)||void 0===n?void 0:n.get("__export"))&&(null===(i=a.symbol.exports)||void 0===i?void 0:i.size))for(var c=Is(o,"resolvedExports"),l=0,u=e.arrayFrom(a.symbol.exports.entries());l<u.length;l++){var _=u[l],d=_[0],p=_[1];c.has(d)&&!o.exports.has(d)&&Kn(c.get(d),p);}Kn(o,a.symbol);}else In(t,e.Diagnostics.Cannot_augment_module_0_because_it_resolves_to_a_non_module_entity,t.text);}else e.Debug.assert(a.symbol.declarations.length>1);}function Gn(e){if(33554432&e.flags)return e;var t=M(e);return en[t]||(en[t]=new w)}function Qn(e){var t=O(e);return tn[t]||(tn[t]=new I)}function Xn(t){return 303===t.kind&&!e.isExternalOrCommonJsModule(t)}function Yn(t,r,n){if(n){var i=Zi(t.get(r));if(i){if(e.Debug.assert(0==(1&e.getCheckFlags(i)),"Should never get an instantiated symbol here."),i.flags&n)return i;if(2097152&i.flags){var a=ki(i);if(a===Ne||a.flags&n)return i}}}}function Zn(r,n){var i=e.getSourceFileOfNode(r),a=e.getSourceFileOfNode(n),o=e.getEnclosingBlockScopeContainer(r);if(i!==a){if(V&&(i.externalModuleIndicator||a.externalModuleIndicator)||!e.outFile(U)||Tg(n)||8388608&r.flags)return !0;if(l(n,r))return !0;var s=t.getSourceFiles();return s.indexOf(i)<=s.indexOf(a)}if(r.pos<=n.pos&&(!e.isPropertyDeclaration(r)||!e.isThisProperty(n.parent)||r.initializer||r.exclamationToken)){if(202===r.kind){var c=e.getAncestor(n,202);return c?e.findAncestor(c,e.isBindingElement)!==e.findAncestor(r,e.isBindingElement)||r.pos<c.pos:Zn(e.getAncestor(r,253),n)}return 253===r.kind?!function(t,r){switch(t.parent.parent.kind){case 236:case 241:case 243:if(ui(r,t,o))return !0}var n=t.parent.parent;return e.isForInOrOfStatement(n)&&ui(r,n.expression,o)}(r,n):e.isClassDeclaration(r)?!e.findAncestor(n,(function(t){return e.isComputedPropertyName(t)&&t.parent.parent===r})):e.isPropertyDeclaration(r)?!u(r,n,!1):!e.isParameterPropertyDeclaration(r,r.parent)||!(99===e.getEmitScriptTarget(U)&&q&&e.getContainingClass(r)===e.getContainingClass(n)&&l(n,r))}return !(!(274===n.parent.kind||270===n.parent.kind&&n.parent.isExportEquals)&&(270!==n.kind||!n.isExportEquals)&&!(4194304&n.flags||Tg(n)||e.findAncestor(n,(function(t){return e.isInterfaceDeclaration(t)||e.isTypeAliasDeclaration(t)})))&&(!l(n,r)||99===e.getEmitScriptTarget(U)&&q&&e.getContainingClass(r)&&(e.isPropertyDeclaration(r)||e.isParameterPropertyDeclaration(r,r.parent))&&u(r,n,!0)));function l(t,r){return !!e.findAncestor(t,(function(n){if(n===o)return "quit";if(e.isFunctionLike(n))return !0;if(e.isClassStaticBlockDeclaration(n))return r.pos<t.pos;var i=e.tryCast(n.parent,e.isPropertyDeclaration);if(i&&i.initializer===n)if(e.isStatic(n.parent)){if(168===r.kind)return !0;if(e.isPropertyDeclaration(r)&&e.getContainingClass(t)===e.getContainingClass(r)){var a=r.name;if((e.isIdentifier(a)||e.isPrivateIdentifier(a))&&function(t,r,n,i,a){for(var o=0,s=n;o<s.length;o++){var c=s[o];if(c.pos>=i&&c.pos<=a){var l=e.factory.createPropertyAccessExpression(e.factory.createThis(),t);if(e.setParent(l.expression,l),e.setParent(l,c),l.flowNode=c.returnFlowNode,!(32768&vf(Pm(l,r,Df(r)))))return !0}}return !1}(a,Uo($i(r)),e.filter(r.parent.members,e.isClassStaticBlockDeclaration),r.parent.pos,n.pos))return !0}}else if(166!==r.kind||e.isStatic(r)||e.getContainingClass(t)!==e.getContainingClass(r))return !0;return !1}))}function u(t,r,n){return !(r.end>t.end)&&void 0===e.findAncestor(r,(function(r){if(r===t)return "quit";switch(r.kind){case 213:return !0;case 166:return !n||!(e.isPropertyDeclaration(t)&&r.parent===t.parent||e.isParameterPropertyDeclaration(t,t.parent)&&r.parent===t.parent.parent)||"quit";case 234:switch(r.parent.kind){case 171:case 168:case 172:return !0;default:return !1}default:return !1}}))}}function $n(t,r,n){var i=e.getEmitScriptTarget(U),a=r;if(e.isParameter(n)&&a.body&&t.valueDeclaration&&t.valueDeclaration.pos>=a.body.pos&&t.valueDeclaration.end<=a.body.end&&i>=2){var o=Qn(a);return void 0===o.declarationRequiresScopeChange&&(o.declarationRequiresScopeChange=e.forEach(a.parameters,(function(e){return s(e.name)||!!e.initializer&&s(e.initializer)}))||!1),!o.declarationRequiresScopeChange}return !1;function s(t){switch(t.kind){case 213:case 212:case 255:case 170:return !1;case 168:case 171:case 172:case 294:return s(t.name);case 166:return e.hasStaticModifier(t)?i<99||!q:s(t.name);default:return e.isNullishCoalesce(t)||e.isOptionalChain(t)?i<7:e.isBindingElement(t)&&t.dotDotDotToken&&e.isObjectBindingPattern(t.parent)?i<4:!e.isTypeNode(t)&&(e.forEachChild(t,s)||!1)}}}function ei(e,t,r,n,i,a,o,s){return void 0===o&&(o=!1),void 0===s&&(s=!0),ti(e,t,r,n,i,a,o,s,Yn)}function ti(t,n,i,a,o,s,c,l,u){var _,d,p,f,g,m,y,v,h,b=t,x=!1,D=t,S=!1;e:for(;t;){if(t.locals&&!Xn(t)&&(f=u(t.locals,n,i))){var T=!0;if(e.isFunctionLike(t)&&g&&g!==t.body?(i&f.flags&788968&&318!==g.kind&&(T=!!(262144&f.flags)&&(g===t.type||163===g.kind||162===g.kind)),i&f.flags&3&&($n(f,t,g)?T=!1:1&f.flags&&(T=163===g.kind||g===t.type&&!!e.findAncestor(f.valueDeclaration,e.isParameter)))):188===t.kind&&(T=g===t.trueType),T)break e;f=void 0;}switch(x=x||ni(t,g),t.kind){case 303:if(!e.isExternalOrCommonJsModule(t))break;S=!0;case 260:var C=(null===(_=$i(t))||void 0===_?void 0:_.exports)||k;if(303===t.kind||e.isModuleDeclaration(t)&&8388608&t.flags&&!e.isGlobalScopeAugmentation(t)){if(f=C.get("default")){var E=e.getLocalSymbolForExportDefault(f);if(E&&f.flags&i&&E.escapedName===n)break e;f=void 0;}var N=C.get(n);if(N&&2097152===N.flags&&(e.getDeclarationOfKind(N,274)||e.getDeclarationOfKind(N,273)))break}if("default"!==n&&(f=u(C,n,2623475&i))){if(!e.isSourceFile(t)||!t.commonJsModuleIndicator||(null===(d=f.declarations)||void 0===d?void 0:d.some(e.isJSDocTypeAlias)))break e;f=void 0;}break;case 259:if(f=u((null===(p=$i(t))||void 0===p?void 0:p.exports)||k,n,8&i))break e;break;case 166:if(!e.isStatic(t)){var F=sa(t.parent);F&&F.locals&&u(F.locals,n,111551&i)&&(y=t);}break;case 256:case 225:case 257:if(f=u($i(t).members||k,n,788968&i)){if(!oi(f,t)){f=void 0;break}if(g&&e.isStatic(g))return void In(D,e.Diagnostics.Static_members_cannot_reference_class_type_parameters);break e}if(225===t.kind&&32&i){var A=t.name;if(A&&n===A.escapedText){f=t.symbol;break e}}break;case 227:if(g===t.expression&&94===t.parent.token){var P=t.parent.parent;if(e.isClassLike(P)&&(f=u($i(P).members,n,788968&i)))return void(a&&In(D,e.Diagnostics.Base_class_expressions_cannot_reference_class_type_parameters))}break;case 161:if(h=t.parent.parent,(e.isClassLike(h)||257===h.kind)&&(f=u($i(h).members,n,788968&i)))return void In(D,e.Diagnostics.A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type);break;case 213:if(e.getEmitScriptTarget(U)>=2)break;case 168:case 170:case 171:case 172:case 255:if(3&i&&"arguments"===n){f=ue;break e}break;case 212:if(3&i&&"arguments"===n){f=ue;break e}if(16&i){var w=t.name;if(w&&n===w.escapedText){f=t.symbol;break e}}break;case 164:t.parent&&163===t.parent.kind&&(t=t.parent),t.parent&&(e.isClassElement(t.parent)||256===t.parent.kind)&&(t=t.parent);break;case 343:case 336:case 337:(B=e.getJSDocRoot(t))&&(t=B.parent);break;case 163:g&&(g===t.initializer||g===t.name&&e.isBindingPattern(g))&&(v||(v=t));break;case 202:g&&(g===t.initializer||g===t.name&&e.isBindingPattern(g))&&e.isParameterDeclaration(t)&&!v&&(v=t);break;case 189:if(262144&i){var I=t.typeParameter.name;if(I&&n===I.escapedText){f=t.typeParameter.symbol;break e}}}ii(t)&&(m=t),g=t,t=e.isJSDocTemplateTag(t)&&e.getEffectiveContainerForJSDocTemplateTag(t)||t.parent;}if(!s||!f||m&&f===m.symbol||(f.isReferenced|=i),!f){if(g&&(e.Debug.assert(303===g.kind),g.commonJsModuleIndicator&&"exports"===n&&i&g.symbol.flags))return g.symbol;c||(f=u(oe,n,i));}if(!f&&b&&e.isInJSFile(b)&&b.parent&&e.isRequireCall(b.parent,!1))return _e;if(f){if(a&&r){if(y&&(99!==e.getEmitScriptTarget(U)||!q)){var O=y.name;return void In(D,e.Diagnostics.Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor,e.declarationNameToString(O),ai(o))}if(D&&(2&i||(32&i||384&i)&&111551==(111551&i))){var M=aa(f);(2&M.flags||32&M.flags||384&M.flags)&&function(t,r){var n;if(e.Debug.assert(!!(2&t.flags||32&t.flags||384&t.flags)),!(67108881&t.flags&&32&t.flags)){var i=null===(n=t.declarations)||void 0===n?void 0:n.find((function(t){return e.isBlockOrCatchScoped(t)||e.isClassLike(t)||259===t.kind}));if(void 0===i)return e.Debug.fail("checkResolvedBlockScopedVariable could not find block-scoped declaration");if(!(8388608&i.flags||Zn(i,r))){var a=void 0,o=e.declarationNameToString(e.getNameOfDeclaration(i));2&t.flags?a=In(r,e.Diagnostics.Block_scoped_variable_0_used_before_its_declaration,o):32&t.flags?a=In(r,e.Diagnostics.Class_0_used_before_its_declaration,o):256&t.flags?a=In(r,e.Diagnostics.Enum_0_used_before_its_declaration,o):(e.Debug.assert(!!(128&t.flags)),e.shouldPreserveConstEnums(U)&&(a=In(r,e.Diagnostics.Enum_0_used_before_its_declaration,o))),a&&e.addRelatedInfo(a,e.createDiagnosticForNode(i,e.Diagnostics._0_is_declared_here,o));}}}(M,D);}if(f&&S&&111551==(111551&i)&&!(4194304&b.flags)){var L=Zi(f);e.length(L.declarations)&&e.every(L.declarations,(function(t){return e.isNamespaceExportDeclaration(t)||e.isSourceFile(t)&&!!t.symbol.globalExports}))&&Mn(!U.allowUmdGlobalAccess,D,e.Diagnostics._0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead,e.unescapeLeadingUnderscores(n));}if(f&&v&&!x&&111551==(111551&i)){var R=Zi(Ms(f)),B=e.getRootDeclaration(v);R===$i(v)?In(D,e.Diagnostics.Parameter_0_cannot_reference_itself,e.declarationNameToString(v.name)):R.valueDeclaration&&R.valueDeclaration.pos>v.pos&&B.parent.locals&&u(B.parent.locals,R.escapedName,i)===R&&In(D,e.Diagnostics.Parameter_0_cannot_reference_identifier_1_declared_after_it,e.declarationNameToString(v.name),e.declarationNameToString(D));}f&&D&&111551&i&&2097152&f.flags&&function(t,r,n){if(!e.isValidTypeOnlyAliasUseSite(n)){var i=Ai(t);if(i){var a=274===i.kind?e.Diagnostics._0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type:e.Diagnostics._0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type,o=e.unescapeLeadingUnderscores(r);ri(In(n,a,o),i,o);}}}(f,n,D);}return f}if(a&&r&&(!D||!(function(t,r,n){if(!e.isIdentifier(t)||t.escapedText!==r||FS(t)||Tg(t))return !1;for(var i=e.getThisContainer(t,!1),a=i;a;){if(e.isClassLike(a.parent)){var o=$i(a.parent);if(!o)break;if(Jc(Uo(o),r))return In(t,e.Diagnostics.Cannot_find_name_0_Did_you_mean_the_static_member_1_0,ai(n),Ia(o)),!0;if(a===i&&!e.isStatic(a)&&Jc(ms(o).thisType,r))return In(t,e.Diagnostics.Cannot_find_name_0_Did_you_mean_the_instance_member_this_0,ai(n)),!0}a=a.parent;}return !1}(D,n,o)||si(D)||function(t,r,n){var i=1920|(e.isInJSFile(t)?111551:0);if(n===i){var a=Ei(ei(t,r,788968&~i,void 0,void 0,!1)),o=t.parent;if(a){if(e.isQualifiedName(o)){e.Debug.assert(o.left===t,"Should only be resolving left side of qualified name as a namespace");var s=o.right.escapedText;if(Jc(ms(a),s))return In(o,e.Diagnostics.Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_property_1_in_0_with_0_1,e.unescapeLeadingUnderscores(r),e.unescapeLeadingUnderscores(s)),!0}return In(t,e.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_namespace_here,e.unescapeLeadingUnderscores(r)),!0}}return !1}(D,n,i)||function(t,r){return !(!li(r)||274!==t.parent.kind)&&(In(t,e.Diagnostics.Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module,r),!0)}(D,n)||function(t,r,n){if(111551&n){if(li(r))return In(t,e.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here,e.unescapeLeadingUnderscores(r)),!0;var i=Ei(ei(t,r,788544,void 0,void 0,!1));if(i&&!(1024&i.flags)){var a=e.unescapeLeadingUnderscores(r);return function(e){switch(e){case"Promise":case"Symbol":case"Map":case"WeakMap":case"Set":case"WeakSet":return !0}return !1}(r)?In(t,e.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_es2015_or_later,a):function(t,r){var n=e.findAncestor(t.parent,(function(t){return !e.isComputedPropertyName(t)&&!e.isPropertySignature(t)&&(e.isTypeLiteralNode(t)||"quit")}));if(n&&1===n.members.length){var i=ms(r);return !!(1048576&i.flags)&&Nb(i,384,!0)}return !1}(t,i)?In(t,e.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0,a,"K"===a?"P":"K"):In(t,e.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here,a),!0}}return !1}(D,n,i)||function(t,r,n){if(111127&n){if(Ei(ei(t,r,1024,void 0,void 0,!1)))return In(t,e.Diagnostics.Cannot_use_namespace_0_as_a_value,e.unescapeLeadingUnderscores(r)),!0}else if(788544&n&&Ei(ei(t,r,1536,void 0,void 0,!1)))return In(t,e.Diagnostics.Cannot_use_namespace_0_as_a_type,e.unescapeLeadingUnderscores(r)),!0;return !1}(D,n,i)||function(t,r,n){if(788584&n){var i=Ei(ei(t,r,111127,void 0,void 0,!1));if(i&&!(1920&i.flags))return In(t,e.Diagnostics._0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0,e.unescapeLeadingUnderscores(r)),!0}return !1}(D,n,i)))){var j=void 0;if(l&&Zr<10&&((null==(j=Av(b,n,i))?void 0:j.valueDeclaration)&&e.isAmbientModule(j.valueDeclaration)&&e.isGlobalScopeAugmentation(j.valueDeclaration)&&(j=void 0),j)){var J=Ia(j),z=bv(b,j,!1),K=wn(D,1920===i||o&&"string"!=typeof o&&e.nodeIsSynthesized(o)?e.Diagnostics.Cannot_find_namespace_0_Did_you_mean_1:z?e.Diagnostics.Could_not_find_name_0_Did_you_mean_1:e.Diagnostics.Cannot_find_name_0_Did_you_mean_1,ai(o),J);On(!z,K),j.valueDeclaration&&e.addRelatedInfo(K,e.createDiagnosticForNode(j.valueDeclaration,e.Diagnostics._0_is_declared_here,J));}if(!j&&o){var V=function(t){for(var r=ai(t),n=e.getScriptTargetFeatures(),i=0,a=e.getOwnKeys(n);i<a.length;i++){var o=a[i],s=e.getOwnKeys(n[o]);if(void 0!==s&&e.contains(s,r))return o}}(o);V?In(D,a,ai(o),V):In(D,a,ai(o));}Zr++;}}function ri(t,r,n){return r?e.addRelatedInfo(t,e.createDiagnosticForNode(r,274===r.kind?e.Diagnostics._0_was_exported_here:e.Diagnostics._0_was_imported_here,n)):t}function ni(t,r){return 213!==t.kind&&212!==t.kind?e.isTypeQueryNode(t)||(e.isFunctionLikeDeclaration(t)||166===t.kind&&!e.isStatic(t))&&(!r||r!==t.name):!(r&&r===t.name||!t.asteriskToken&&!e.hasSyntacticModifier(t,256)&&e.getImmediatelyInvokedFunctionExpression(t))}function ii(e){switch(e.kind){case 255:case 256:case 257:case 259:case 258:case 260:return !0;default:return !1}}function ai(t){return e.isString(t)?e.unescapeLeadingUnderscores(t):e.declarationNameToString(t)}function oi(t,r){if(t.declarations)for(var n=0,i=t.declarations;n<i.length;n++){var a=i[n];if(162===a.kind&&(e.isJSDocTemplateTag(a.parent)?e.getJSDocHost(a.parent):a.parent)===r)return !(e.isJSDocTemplateTag(a.parent)&&e.find(a.parent.parent.tags,e.isJSDocTypeAlias))}return !1}function si(t){var r=ci(t);return !(!r||!Mi(r,64,!0)||(In(t,e.Diagnostics.Cannot_extend_an_interface_0_Did_you_mean_implements,e.getTextOfNode(r)),0))}function ci(t){switch(t.kind){case 79:case 205:return t.parent?ci(t.parent):void 0;case 227:if(e.isEntityNameExpression(t.expression))return t.expression;default:return}}function li(e){return "any"===e||"string"===e||"number"===e||"boolean"===e||"never"===e||"unknown"===e}function ui(t,r,n){return !!r&&!!e.findAncestor(t,(function(t){return t===n||e.isFunctionLike(t)?"quit":t===r}))}function _i(e){switch(e.kind){case 264:return e;case 266:return e.parent;case 267:return e.parent.parent;case 269:return e.parent.parent.parent;default:return}}function di(t){return t.declarations&&e.findLast(t.declarations,pi)}function pi(t){return 264===t.kind||263===t.kind||266===t.kind&&!!t.name||267===t.kind||273===t.kind||269===t.kind||274===t.kind||270===t.kind&&e.exportAssignmentIsAlias(t)||e.isBinaryExpression(t)&&2===e.getAssignmentDeclarationKind(t)&&e.exportAssignmentIsAlias(t)||e.isAccessExpression(t)&&e.isBinaryExpression(t.parent)&&t.parent.left===t&&63===t.parent.operatorToken.kind&&fi(t.parent.right)||295===t.kind||294===t.kind&&fi(t.initializer)||e.isRequireVariableDeclaration(t)}function fi(t){return e.isAliasableExpression(t)||e.isFunctionExpression(t)&&Fh(t)}function gi(e,t,r,n){var i=e.exports.get("export="),a=i?Jc(Uo(i),t):e.exports.get(t),o=Ei(a,n);return Ni(r,a,o,!1),o}function mi(t){return e.isExportAssignment(t)&&!t.isExportEquals||e.hasSyntacticModifier(t,512)||e.isExportSpecifier(t)}function yi(t){return e.isStringLiteralLike(t)?e.getModeForUsageLocation(e.getSourceFileOfNode(t),t):void 0}function vi(t){return yi(t)===e.ModuleKind.ESNext&&e.endsWith(t.text,".json")}function hi(t,r,n,i){var a=t&&yi(i);if(t&&void 0!==a){var o=function(t,r){return t===e.ModuleKind.ESNext&&r===e.ModuleKind.CommonJS}(a,t.impliedNodeFormat);if(a===e.ModuleKind.ESNext||o)return o}if(!W)return !1;if(!t||t.isDeclarationFile){var s=gi(r,"default",void 0,!0);return !(s&&e.some(s.declarations,mi)||gi(r,e.escapeLeadingUnderscores("__esModule"),void 0,n))}return e.isSourceFileJS(t)?!t.externalModuleIndicator&&!gi(r,e.escapeLeadingUnderscores("__esModule"),void 0,n):Vi(r)}function bi(t,r,i){var a,o;void 0===i&&(i=!1);var s=e.getExternalModuleRequireArgument(t)||t.moduleSpecifier,c=Ri(t,s),l=!e.isPropertyAccessExpression(r)&&r.propertyName||r.name;if(e.isIdentifier(l)){var u=Ui(c,s,!1,"default"===l.escapedText&&!(!U.allowSyntheticDefaultImports&&!e.getESModuleInterop(U)));if(u&&l.escapedText){if(e.isShorthandAmbientModuleSymbol(c))return c;var _=void 0;_=c&&c.exports&&c.exports.get("export=")?Jc(Uo(u),l.escapedText,!0):function(e,t){if(3&e.flags){var r=e.valueDeclaration.type;if(r)return Ei(Jc(dd(r),t))}}(u,l.escapedText),_=Ei(_,i);var d=function(e,t,r,n){if(1536&e.flags){var i=Gi(e).get(t.escapedText),a=Ei(i,n);return Ni(r,i,a,!1),a}}(u,l,r,i);if(void 0===d&&"default"===l.escapedText){var p=null===(a=c.declarations)||void 0===a?void 0:a.find(e.isSourceFile);(vi(s)||hi(p,c,i,s))&&(d=zi(c,i)||Ei(c,i));}var f=d&&_&&d!==_?function(t,r){if(t===Ne&&r===Ne)return Ne;if(790504&t.flags)return t;var n=jn(t.flags|r.flags,t.escapedName);return n.declarations=e.deduplicate(e.concatenate(t.declarations,r.declarations),e.equateValues),n.parent=t.parent||r.parent,t.valueDeclaration&&(n.valueDeclaration=t.valueDeclaration),r.members&&(n.members=new e.Map(r.members)),t.exports&&(n.exports=new e.Map(t.exports)),n}(_,d):d||_;if(!f){var g=Oi(c,t),m=e.declarationNameToString(l),y=Pv(l,u);if(void 0!==y){var v=Ia(y),h=In(l,e.Diagnostics._0_has_no_exported_member_named_1_Did_you_mean_2,g,m,v);y.valueDeclaration&&e.addRelatedInfo(h,e.createDiagnosticForNode(y.valueDeclaration,e.Diagnostics._0_is_declared_here,v));}else (null===(o=c.exports)||void 0===o?void 0:o.has("default"))?In(l,e.Diagnostics.Module_0_has_no_exported_member_1_Did_you_mean_to_use_import_1_from_0_instead,g,m):function(t,r,i,a,o){var s,c,l=null===(c=null===(s=a.valueDeclaration)||void 0===s?void 0:s.locals)||void 0===c?void 0:c.get(r.escapedText),u=a.exports;if(l){var _=null==u?void 0:u.get("export=");if(_)ia(_,l)?function(t,r,n,i){V>=e.ModuleKind.ES2015?In(r,e.getESModuleInterop(U)?e.Diagnostics._0_can_only_be_imported_by_using_a_default_import:e.Diagnostics._0_can_only_be_imported_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import,n):e.isInJSFile(t)?In(r,e.getESModuleInterop(U)?e.Diagnostics._0_can_only_be_imported_by_using_a_require_call_or_by_using_a_default_import:e.Diagnostics._0_can_only_be_imported_by_using_a_require_call_or_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import,n):In(r,e.getESModuleInterop(U)?e.Diagnostics._0_can_only_be_imported_by_using_import_1_require_2_or_a_default_import:e.Diagnostics._0_can_only_be_imported_by_using_import_1_require_2_or_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import,n,n,i);}(t,r,i,o):In(r,e.Diagnostics.Module_0_has_no_exported_member_1,o,i);else {var d=u?e.find(el(u),(function(e){return !!ia(e,l)})):void 0,p=d?In(r,e.Diagnostics.Module_0_declares_1_locally_but_it_is_exported_as_2,o,i,Ia(d)):In(r,e.Diagnostics.Module_0_declares_1_locally_but_it_is_not_exported,o,i);l.declarations&&e.addRelatedInfo.apply(void 0,n$3([p],e.map(l.declarations,(function(t,r){return e.createDiagnosticForNode(t,0===r?e.Diagnostics._0_is_declared_here:e.Diagnostics.and_here,i)})),!1));}}else In(r,e.Diagnostics.Module_0_has_no_exported_member_1,o,i);}(t,l,m,c,g);}return f}}}function xi(t){if(e.isVariableDeclaration(t)&&t.initializer&&e.isPropertyAccessExpression(t.initializer))return t.initializer}function Di(e,t,r){var n=e.parent.parent.moduleSpecifier?bi(e.parent.parent,e,r):Mi(e.propertyName||e.name,t,!1,r);return Ni(e,void 0,n,!1),n}function Si(t,r){return e.isClassExpression(t)?zb(t).symbol:e.isEntityName(t)||e.isEntityNameExpression(t)?Mi(t,901119,!0,r)||(zb(t),Qn(t).resolvedSymbol):void 0}function Ti(t,r){switch(void 0===r&&(r=!1),t.kind){case 264:case 253:return function(t,r){var n=xi(t);if(n){var i=e.getLeftmostAccessExpression(n.expression).arguments[0];return e.isIdentifier(n.name)?Ei(Jc(dl(i),n.name.escapedText)):void 0}if(e.isVariableDeclaration(t)||276===t.moduleReference.kind){var a=Ri(t,e.getExternalModuleRequireArgument(t)||e.getExternalModuleImportEqualsDeclarationExpression(t)),o=zi(a);return Ni(t,a,o,!1),o}var s=Ii(t.moduleReference,r);return function(t,r){if(Ni(t,void 0,r,!1)&&!t.isTypeOnly){var n=Ai($i(t)),i=274===n.kind,a=i?e.Diagnostics.An_import_alias_cannot_reference_a_declaration_that_was_exported_using_export_type:e.Diagnostics.An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type,o=i?e.Diagnostics._0_was_exported_here:e.Diagnostics._0_was_imported_here,s=e.unescapeLeadingUnderscores(n.name.escapedText);e.addRelatedInfo(In(t.moduleReference,a),e.createDiagnosticForNode(n,o,s));}}(t,s),s}(t,r);case 266:return function(t,r){var n,i=Ri(t,t.parent.moduleSpecifier);if(i){var a;a=e.isShorthandAmbientModuleSymbol(i)?i:gi(i,"default",t,r);var o=null===(n=i.declarations)||void 0===n?void 0:n.find(e.isSourceFile),s=vi(t.parent.moduleSpecifier),c=hi(o,i,r,t.parent.moduleSpecifier);if(a||c||s){if(c||s){var l=zi(i,r)||Ei(i,r);return Ni(t,i,l,!1),l}}else if(Vi(i)){var u=V>=e.ModuleKind.ES2015?"allowSyntheticDefaultImports":"esModuleInterop",_=i.exports.get("export=").valueDeclaration,d=In(t.name,e.Diagnostics.Module_0_can_only_be_default_imported_using_the_1_flag,Ia(i),u);_&&e.addRelatedInfo(d,e.createDiagnosticForNode(_,e.Diagnostics.This_module_is_declared_with_using_export_and_can_only_be_used_with_a_default_import_when_using_the_0_flag,u));}else !function(t,r){var n,i,a;if(null===(n=t.exports)||void 0===n?void 0:n.has(r.symbol.escapedName))In(r.name,e.Diagnostics.Module_0_has_no_default_export_Did_you_mean_to_use_import_1_from_0_instead,Ia(t),Ia(r.symbol));else {var o=In(r.name,e.Diagnostics.Module_0_has_no_default_export,Ia(t)),s=null===(i=t.exports)||void 0===i?void 0:i.get("__export");if(s){var c=null===(a=s.declarations)||void 0===a?void 0:a.find((function(t){var r,n;return !!(e.isExportDeclaration(t)&&t.moduleSpecifier&&(null===(n=null===(r=Ri(t,t.moduleSpecifier))||void 0===r?void 0:r.exports)||void 0===n?void 0:n.has("default")))}));c&&e.addRelatedInfo(o,e.createDiagnosticForNode(c,e.Diagnostics.export_Asterisk_does_not_re_export_a_default));}}}(i,t);return Ni(t,a,void 0,!1),a}}(t,r);case 267:return function(e,t){var r=e.parent.parent.moduleSpecifier,n=Ri(e,r),i=Ui(n,r,t,!1);return Ni(e,n,i,!1),i}(t,r);case 273:return function(e,t){var r=e.parent.moduleSpecifier,n=r&&Ri(e,r),i=r&&Ui(n,r,t,!1);return Ni(e,n,i,!1),i}(t,r);case 269:case 202:return function(t,r){var n=e.isBindingElement(t)?e.getRootDeclaration(t):t.parent.parent.parent,i=xi(n),a=bi(n,i||t,r),o=t.propertyName||t.name;return i&&a&&e.isIdentifier(o)?Ei(Jc(Uo(a),o.escapedText),r):(Ni(t,void 0,a,!1),a)}(t,r);case 274:return Di(t,901119,r);case 270:case 220:return function(t,r){var n=Si(e.isExportAssignment(t)?t.expression:t.right,r);return Ni(t,void 0,n,!1),n}(t,r);case 263:return function(e,t){var r=zi(e.parent.symbol,t);return Ni(e,void 0,r,!1),r}(t,r);case 295:return Mi(t.name,901119,!0,r);case 294:return function(e,t){return Si(e.initializer,t)}(t,r);case 206:case 205:return function(t,r){if(e.isBinaryExpression(t.parent)&&t.parent.left===t&&63===t.parent.operatorToken.kind)return Si(t.parent.right,r)}(t,r);default:return e.Debug.fail()}}function Ci(e,t){return void 0===t&&(t=901119),!(!e||2097152!=(e.flags&(2097152|t))&&!(2097152&e.flags&&67108864&e.flags))}function Ei(e,t){return !t&&Ci(e)?ki(e):e}function ki(t){e.Debug.assert(0!=(2097152&t.flags),"Should only get Alias here.");var r=Gn(t);if(r.target)r.target===Fe&&(r.target=Ne);else {r.target=Fe;var n=di(t);if(!n)return e.Debug.fail();var i=Ti(n);r.target===Fe?r.target=i||Ne:In(n,e.Diagnostics.Circular_definition_of_import_alias_0,Ia(t));}return r.target}function Ni(t,r,n,i){if(!t||e.isPropertyAccessExpression(t))return !1;var a=$i(t);if(e.isTypeOnlyImportOrExportDeclaration(t))return Gn(a).typeOnlyDeclaration=t,!0;var o=Gn(a);return Fi(o,r,i)||Fi(o,n,i)}function Fi(t,r,n){var i,a,o;if(r&&(void 0===t.typeOnlyDeclaration||n&&!1===t.typeOnlyDeclaration)){var s=null!==(a=null===(i=r.exports)||void 0===i?void 0:i.get("export="))&&void 0!==a?a:r,c=s.declarations&&e.find(s.declarations,e.isTypeOnlyImportOrExportDeclaration);t.typeOnlyDeclaration=null!==(o=null!=c?c:Gn(s).typeOnlyDeclaration)&&void 0!==o&&o;}return !!t.typeOnlyDeclaration}function Ai(e){if(2097152&e.flags)return Gn(e).typeOnlyDeclaration||void 0}function Pi(e){var t=$i(e),r=ki(t);r&&(r===Ne||111551&r.flags&&!$S(r)&&!Ai(t))&&wi(t);}function wi(t){var r=Gn(t);if(!r.referenced){r.referenced=!0;var n=di(t);if(!n)return e.Debug.fail();if(e.isInternalModuleImportEqualsDeclaration(n)){var i=Ei(t);(i===Ne||111551&i.flags)&&zb(n.moduleReference);}}}function Ii(t,r){return 79===t.kind&&e.isRightSideOfQualifiedNameOrPropertyAccess(t)&&(t=t.parent),79===t.kind||160===t.parent.kind?Mi(t,1920,!1,r):(e.Debug.assert(264===t.parent.kind),Mi(t,901119,!1,r))}function Oi(e,t){return e.parent?Oi(e.parent,t)+"."+Ia(e):Ia(e,t,void 0,20)}function Mi(t,r,n,i,a){if(!e.nodeIsMissing(t)){var o,s=1920|(e.isInJSFile(t)?111551&r:0);if(79===t.kind){var c=r===s||e.nodeIsSynthesized(t)?e.Diagnostics.Cannot_find_namespace_0:Dg(e.getFirstIdentifier(t)),l=e.isInJSFile(t)&&!e.nodeIsSynthesized(t)?function(t,r){if(eu(t.parent)){var n=function(t){if(!e.findAncestor(t,(function(t){return e.isJSDocNode(t)||4194304&t.flags?e.isJSDocTypeAlias(t):"quit"}))){var r=e.getJSDocHost(t);if(r&&e.isExpressionStatement(r)&&e.isBinaryExpression(r.expression)&&3===e.getAssignmentDeclarationKind(r.expression)&&(n=$i(r.expression.left)))return Li(n);if(r&&(e.isObjectLiteralMethod(r)||e.isPropertyAssignment(r))&&e.isBinaryExpression(r.parent.parent)&&6===e.getAssignmentDeclarationKind(r.parent.parent)&&(n=$i(r.parent.parent.left)))return Li(n);var n,i=e.getEffectiveJSDocHost(t);if(i&&e.isFunctionLike(i))return (n=$i(i))&&n.valueDeclaration}}(t.parent);if(n)return ei(n,t.escapedText,r,void 0,t,!0)}}(t,r):void 0;if(!(o=Zi(ei(a||t,t.escapedText,r,n||l?void 0:c,t,!0,!1))))return Zi(l)}else {if(160!==t.kind&&205!==t.kind)throw e.Debug.assertNever(t,"Unknown entity name kind.");var u=160===t.kind?t.left:t.expression,_=160===t.kind?t.right:t.name,d=Mi(u,s,n,!1,a);if(!d||e.nodeIsMissing(_))return;if(d===Ne)return d;if(d.valueDeclaration&&e.isInJSFile(d.valueDeclaration)&&e.isVariableDeclaration(d.valueDeclaration)&&d.valueDeclaration.initializer&&Bh(d.valueDeclaration.initializer)){var p=d.valueDeclaration.initializer.arguments[0],f=Ri(p,p);if(f){var g=zi(f);g&&(d=g);}}if(!(o=Zi(Yn(Gi(d),_.escapedText,r)))){if(!n){var m=Oi(d),y=e.declarationNameToString(_),v=Pv(_,d);if(v)return void In(_,e.Diagnostics._0_has_no_exported_member_named_1_Did_you_mean_2,m,y,Ia(v));var h=e.isQualifiedName(t)&&function(t){for(;e.isQualifiedName(t.parent);)t=t.parent;return t}(t);if(Pt&&788968&r&&h&&!e.isTypeOfExpression(h.parent)&&function(t){var r=e.getFirstIdentifier(t),n=ei(r,r.escapedText,111551,void 0,r,!0);if(n){for(;e.isQualifiedName(r.parent);){if(!(n=Jc(Uo(n),r.parent.right.escapedText)))return;r=r.parent;}return n}}(h))return void In(h,e.Diagnostics._0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0,e.entityNameToString(h));if(1920&r&&e.isQualifiedName(t.parent)){var b=Zi(Yn(Gi(d),_.escapedText,788968));if(b)return void In(t.parent.right,e.Diagnostics.Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_property_1_in_0_with_0_1,Ia(b),e.unescapeLeadingUnderscores(t.parent.right.escapedText))}In(_,e.Diagnostics.Namespace_0_has_no_exported_member_1,m,y);}return}}return e.Debug.assert(0==(1&e.getCheckFlags(o)),"Should never get an instantiated symbol here."),!e.nodeIsSynthesized(t)&&e.isEntityName(t)&&(2097152&o.flags||270===t.parent.kind)&&Ni(e.getAliasDeclarationFromName(t),o,void 0,!0),o.flags&r||i?o:ki(o)}}function Li(t){var r=t.parent.valueDeclaration;if(r)return (e.isAssignmentDeclaration(r)?e.getAssignedExpandoInitializer(r):e.hasOnlyExpressionInitializer(r)?e.getDeclaredExpandoInitializer(r):void 0)||r}function Ri(t,r,n){var i=e.getEmitModuleResolutionKind(U)===e.ModuleResolutionKind.Classic?e.Diagnostics.Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_node_or_to_add_aliases_to_the_paths_option:e.Diagnostics.Cannot_find_module_0_or_its_corresponding_type_declarations;return Bi(t,r,n?void 0:i)}function Bi(t,r,n,i){return void 0===i&&(i=!1),e.isStringLiteralLike(r)?ji(t,r.text,n,r,i):void 0}function ji(r,n,i,a,o){var s,c,l,u,_,d,p;void 0===o&&(o=!1),e.startsWith(n,"@types/")&&In(a,N=e.Diagnostics.Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1,e.removePrefix(n,"@types/"),n);var f=rl(n,!0);if(f)return f;var g=e.getSourceFileOfNode(r),m=e.isStringLiteralLike(r)?r:(null===(s=e.findAncestor(r,e.isImportCall))||void 0===s?void 0:s.arguments[0])||(null===(c=e.findAncestor(r,e.isImportDeclaration))||void 0===c?void 0:c.moduleSpecifier)||(null===(l=e.findAncestor(r,e.isExternalModuleImportEqualsDeclaration))||void 0===l?void 0:l.moduleReference.expression)||(null===(u=e.findAncestor(r,e.isExportDeclaration))||void 0===u?void 0:u.moduleSpecifier)||(null===(_=e.isModuleDeclaration(r)?r:r.parent&&e.isModuleDeclaration(r.parent)&&r.parent.name===r?r.parent:void 0)||void 0===_?void 0:_.name)||(null===(d=e.isLiteralImportTypeNode(r)?r:void 0)||void 0===d?void 0:d.argument.literal),y=m&&e.isStringLiteralLike(m)?e.getModeForUsageLocation(g,m):g.impliedNodeFormat,v=e.getResolvedModule(g,n,y),h=v&&e.getResolutionDiagnostic(U,v),b=v&&!h&&t.getSourceFile(v.resolvedFileName);if(b){if(b.symbol)return v.isExternalLibraryImport&&!e.resolutionExtensionIsTSOrJson(v.extension)&&Ji(!1,a,v,n),(e.getEmitModuleResolutionKind(U)===e.ModuleResolutionKind.Node12||e.getEmitModuleResolutionKind(U)===e.ModuleResolutionKind.NodeNext)&&((g.impliedNodeFormat===e.ModuleKind.CommonJS&&!e.findAncestor(r,e.isImportCall)||!!e.findAncestor(r,e.isImportEqualsDeclaration))&&b.impliedNodeFormat===e.ModuleKind.ESNext&&In(a,e.Diagnostics.Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_cannot_be_imported_synchronously_Use_dynamic_import_instead,n),y===e.ModuleKind.ESNext&&U.resolveJsonModule&&".json"===v.extension&&In(a,e.Diagnostics.JSON_imports_are_experimental_in_ES_module_mode_imports)),Zi(b.symbol);i&&In(a,e.Diagnostics.File_0_is_not_a_module,b.fileName);}else {if(Ft){var x=e.findBestPatternMatch(Ft,(function(e){return e.pattern}),n);if(x){var D=At&&At.get(n);return Zi(D||x.symbol)}}if(v&&!e.resolutionExtensionIsTSOrJson(v.extension)&&void 0===h||h===e.Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type)o?In(a,N=e.Diagnostics.Invalid_module_name_in_augmentation_Module_0_resolves_to_an_untyped_module_at_1_which_cannot_be_augmented,n,v.resolvedFileName):Ji(Y&&!!i,a,v,n);else if(i){if(v){var S=t.getProjectReferenceRedirect(v.resolvedFileName);if(S)return void In(a,e.Diagnostics.Output_file_0_has_not_been_built_from_source_file_1,S,v.resolvedFileName)}if(h)In(a,h,n,v.resolvedFileName);else {var T=e.tryExtractTSExtension(n),C=e.pathIsRelative(n)&&!e.hasExtension(n),E=e.getEmitModuleResolutionKind(U),k=E===e.ModuleResolutionKind.Node12||E===e.ModuleResolutionKind.NodeNext;if(T){var N=e.Diagnostics.An_import_path_cannot_end_with_a_0_extension_Consider_importing_1_instead,F=e.removeExtension(n,T);V>=e.ModuleKind.ES2015&&(F+=".mts"===T?".mjs":".cts"===T?".cjs":".js"),In(a,N,T,F);}else if(!U.resolveJsonModule&&e.fileExtensionIs(n,".json")&&e.getEmitModuleResolutionKind(U)!==e.ModuleResolutionKind.Classic&&e.hasJsonModuleEmitEnabled(U))In(a,e.Diagnostics.Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension,n);else if(y===e.ModuleKind.ESNext&&k&&C){var A=e.getNormalizedAbsolutePath(n,e.getDirectoryPath(g.path)),P=null===(p=kn.find((function(e){var r=e[0];return t.fileExists(A+r)})))||void 0===p?void 0:p[1];P?In(a,e.Diagnostics.Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_node12_or_nodenext_Did_you_mean_0,n+P):In(a,e.Diagnostics.Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_node12_or_nodenext_Consider_adding_an_extension_to_the_import_path);}else In(a,i,n);}}}}function Ji(t,r,n,i){var a,o=n.packageId,s=n.resolvedFileName,c=!e.isExternalModuleNameRelative(i)&&o?(a=o.name,f().has(e.getTypesPackageName(a))?e.chainDiagnosticMessages(void 0,e.Diagnostics.If_the_0_package_actually_exposes_this_module_consider_sending_a_pull_request_to_amend_https_Colon_Slash_Slashgithub_com_SlashDefinitelyTyped_SlashDefinitelyTyped_Slashtree_Slashmaster_Slashtypes_Slash_1,o.name,e.mangleScopedPackageName(o.name)):function(e){return !!f().get(e)}(o.name)?e.chainDiagnosticMessages(void 0,e.Diagnostics.If_the_0_package_actually_exposes_this_module_try_adding_a_new_declaration_d_ts_file_containing_declare_module_1,o.name,i):e.chainDiagnosticMessages(void 0,e.Diagnostics.Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_module_0,i,e.mangleScopedPackageName(o.name))):void 0;Mn(t,r,e.chainDiagnosticMessages(c,e.Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type,i,s));}function zi(t,r){if(null==t?void 0:t.exports){var n=function(t,r){if(!t||t===Ne||t===r||1===r.exports.size||2097152&t.flags)return t;var n=Gn(t);if(n.cjsExportMerged)return n.cjsExportMerged;var i=33554432&t.flags?t:Un(t);return i.flags=512|i.flags,void 0===i.exports&&(i.exports=e.createSymbolTable()),r.exports.forEach((function(e,t){"export="!==t&&i.exports.set(t,i.exports.has(t)?Kn(i.exports.get(t),e):e);})),Gn(i).cjsExportMerged=i,n.cjsExportMerged=i}(Zi(Ei(t.exports.get("export="),r)),Zi(t));return Zi(n)||t}}function Ui(t,r,n,i){var a=zi(t,n);if(!n&&a){if(!(i||1539&a.flags||e.getDeclarationOfKind(a,303))){var o=V>=e.ModuleKind.ES2015?"allowSyntheticDefaultImports":"esModuleInterop";return In(r,e.Diagnostics.This_module_can_only_be_referenced_with_ECMAScript_imports_Slashexports_by_turning_on_the_0_flag_and_referencing_its_default_export,o),a}var s=r.parent;if(e.isImportDeclaration(s)&&e.getNamespaceDeclarationNode(s)||e.isImportCall(s)){var c=e.isImportCall(s)?s.arguments[0]:s.moduleSpecifier,l=Uo(a),u=Lh(l,a,t,c);if(u)return Ki(a,u,s);if(e.getESModuleInterop(U)){var _=zc(l,0);if(_&&_.length||(_=zc(l,1)),_&&_.length||Jc(l,"default"))return Ki(a,Rh(l,a,t,c),s)}}}return a}function Ki(t,r,n){var i=jn(t.flags,t.escapedName);i.declarations=t.declarations?t.declarations.slice():[],i.parent=t.parent,i.target=t,i.originatingImport=n,t.valueDeclaration&&(i.valueDeclaration=t.valueDeclaration),t.constEnumOnlyModule&&(i.constEnumOnlyModule=!0),t.members&&(i.members=new e.Map(t.members)),t.exports&&(i.exports=new e.Map(t.exports));var a=pc(r);return i.type=ya(i,a.members,e.emptyArray,e.emptyArray,a.indexInfos),i}function Vi(e){return void 0!==e.exports.get("export=")}function qi(e){return el(Qi(e))}function Wi(e,t){var r=Qi(t);if(r)return r.get(e)}function Hi(t){return !(131068&t.flags||1&e.getObjectFlags(t)||qp(t)||_f(t))}function Gi(e){return 6256&e.flags?Is(e,"resolvedExports"):1536&e.flags?Qi(e):e.exports||k}function Qi(e){var t=Gn(e);return t.resolvedExports||(t.resolvedExports=Yi(e))}function Xi(t,r,n,i){r&&r.forEach((function(r,a){if("default"!==a){var o=t.get(a);if(o){if(n&&i&&o&&Ei(o)!==Ei(r)){var s=n.get(a);s.exportsWithDuplicate?s.exportsWithDuplicate.push(i):s.exportsWithDuplicate=[i];}}else t.set(a,r),n&&i&&n.set(a,{specifierText:e.getTextOfNode(i.moduleSpecifier)});}}));}function Yi(t){var r=[];return function t(n){if(n&&n.exports&&e.pushIfUnique(r,n)){var i=new e.Map(n.exports),a=n.exports.get("__export");if(a){var o=e.createSymbolTable(),s=new e.Map;if(a.declarations)for(var c=0,l=a.declarations;c<l.length;c++){var u=l[c];Xi(o,t(Ri(u,u.moduleSpecifier)),s,u);}s.forEach((function(t,r){var n=t.exportsWithDuplicate;if("export="!==r&&n&&n.length&&!i.has(r))for(var a=0,o=n;a<o.length;a++){var c=o[a];mn.add(e.createDiagnosticForNode(c,e.Diagnostics.Module_0_has_already_exported_a_member_named_1_Consider_explicitly_re_exporting_to_resolve_the_ambiguity,s.get(r).specifierText,e.unescapeLeadingUnderscores(r)));}})),Xi(i,o);}return i}}(t=zi(t))||k}function Zi(e){var t;return e&&e.mergeId&&(t=$r[e.mergeId])?t:e}function $i(e){return Zi(e.symbol&&Ms(e.symbol))}function ea(e){return Zi(e.parent&&Ms(e.parent))}function ta(r,i,a){var o=ea(r);if(o&&!(262144&r.flags)){var s=e.mapDefined(o.declarations,(function(e){return o&&ra(e,o)})),c=i&&function(r,n){var i,a=e.getSourceFileOfNode(n),o=O(a),s=Gn(r);if(s.extendedContainersByFile&&(i=s.extendedContainersByFile.get(o)))return i;if(a&&a.imports){for(var c=0,l=a.imports;c<l.length;c++){var u=l[c];if(!e.nodeIsSynthesized(u)){var _=Ri(n,u,!0);_&&na(_,r)&&(i=e.append(i,_));}}if(e.length(i))return (s.extendedContainersByFile||(s.extendedContainersByFile=new e.Map)).set(o,i),i}if(s.extendedContainers)return s.extendedContainers;for(var d=0,p=t.getSourceFiles();d<p.length;d++){var f=p[d];if(e.isExternalModule(f)){var g=$i(f);na(g,r)&&(i=e.append(i,g));}}return s.extendedContainers=i||e.emptyArray}(r,i),l=function(t,r){var n=!!e.length(t.declarations)&&e.first(t.declarations);if(111551&r&&n&&n.parent&&e.isVariableDeclaration(n.parent)&&(e.isObjectLiteralExpression(n)&&n===n.parent.initializer||e.isTypeLiteralNode(n)&&n===n.parent.type))return $i(n.parent)}(o,a);if(i&&o.flags&ha(a)&&ba(o,i,1920,!1))return e.append(e.concatenate(e.concatenate([o],s),c),l);var u=!(o.flags&ha(a))&&788968&o.flags&&524288&ms(o).flags&&111551===a?va(i,(function(t){return e.forEachEntry(t,(function(e){if(e.flags&ha(a)&&Uo(e)===ms(o))return e}))})):void 0,_=n$3(n$3(u?[u]:[],s,!0),[o],!1);return _=e.append(_,l),e.addRange(_,c)}var d=e.mapDefined(r.declarations,(function(t){return !e.isAmbientModule(t)&&t.parent&&Aa(t.parent)?$i(t.parent):e.isClassExpression(t)&&e.isBinaryExpression(t.parent)&&63===t.parent.operatorToken.kind&&e.isAccessExpression(t.parent.left)&&e.isEntityNameExpression(t.parent.left.expression)?e.isModuleExportsAccessExpression(t.parent.left)||e.isExportsIdentifier(t.parent.left.expression)?$i(e.getSourceFileOfNode(t)):(zb(t.parent.left.expression),Qn(t.parent.left.expression).resolvedSymbol):void 0}));if(e.length(d))return e.mapDefined(d,(function(e){return na(e,r)?e:void 0}))}function ra(e,t){var r=Na(e),n=r&&r.exports&&r.exports.get("export=");return n&&ia(n,t)?r:void 0}function na(t,r){if(t===ea(r))return r;var n=t.exports&&t.exports.get("export=");if(n&&ia(n,r))return t;var i=Gi(t),a=i.get(r.escapedName);return a&&ia(a,r)?a:e.forEachEntry(i,(function(e){if(ia(e,r))return e}))}function ia(e,t){if(Zi(Ei(Zi(e)))===Zi(Ei(Zi(t))))return e}function aa(e){return Zi(e&&0!=(1048576&e.flags)?e.exportSymbol:e)}function oa(e){return !!(111551&e.flags||2097152&e.flags&&111551&ki(e).flags&&!Ai(e))}function sa(t){for(var r=0,n=t.members;r<n.length;r++){var i=n[r];if(170===i.kind&&e.nodeIsPresent(i.body))return i}}function ca(t){var n=new m(de,t);return v++,n.id=v,r&&(null===e.tracing||void 0===e.tracing||e.tracing.recordType(n)),n}function la(e){return new m(de,e)}function ua(e,t,r){void 0===r&&(r=0);var n=ca(e);return n.intrinsicName=t,n.objectFlags=r,n}function _a(e,t){var r=ca(524288);return r.objectFlags=e,r.symbol=t,r.members=void 0,r.properties=void 0,r.callSignatures=void 0,r.constructSignatures=void 0,r.indexInfos=void 0,r}function da(e){var t=ca(262144);return e&&(t.symbol=e),t}function pa(e){return 95===e.charCodeAt(0)&&95===e.charCodeAt(1)&&95!==e.charCodeAt(2)&&64!==e.charCodeAt(2)&&35!==e.charCodeAt(2)}function fa(t){var r;return t.forEach((function(e,t){ga(e,t)&&(r||(r=[])).push(e);})),r||e.emptyArray}function ga(e,t){return !pa(t)&&oa(e)}function ma(t,r,n,i,a){var o=t;return o.members=r,o.properties=e.emptyArray,o.callSignatures=n,o.constructSignatures=i,o.indexInfos=a,r!==k&&(o.properties=fa(r)),o}function ya(e,t,r,n,i){return ma(_a(16,e),t,r,n,i)}function va(t,r){for(var n,i=function(t){if(t.locals&&!Xn(t)&&(n=r(t.locals,void 0,!0,t)))return {value:n};switch(t.kind){case 303:if(!e.isExternalOrCommonJsModule(t))break;case 260:var i=$i(t);if(n=r((null==i?void 0:i.exports)||k,void 0,!0,t))return {value:n};break;case 256:case 225:case 257:var a;if(($i(t).members||k).forEach((function(t,r){788968&t.flags&&(a||(a=e.createSymbolTable())).set(r,t);})),a&&(n=r(a,void 0,!1,t)))return {value:n}}},a=t;a;a=a.parent){var o=i(a);if("object"==typeof o)return o.value}return r(oe,void 0,!0)}function ha(e){return 111551===e?111551:1920}function ba(t,r,n,i,a){if(void 0===a&&(a=new e.Map),t&&!function(e){if(e.declarations&&e.declarations.length){for(var t=0,r=e.declarations;t<r.length;t++)switch(r[t].kind){case 166:case 168:case 171:case 172:continue;default:return !1}return !0}return !1}(t)){var o=Gn(t),s=o.accessibleChainCache||(o.accessibleChainCache=new e.Map),c=va(r,(function(e,t,r,n){return n})),l="".concat(i?0:1,"|").concat(c&&O(c),"|").concat(n);if(s.has(l))return s.get(l);var u=M(t),_=a.get(u);_||a.set(u,_=[]);var d=va(r,p);return s.set(l,d),d}function p(n,a,o){if(e.pushIfUnique(_,n)){var s=function(n,a,o){return g(n.get(t.escapedName),void 0,a)?[t]:e.forEachEntry(n,(function(n){if(2097152&n.flags&&"export="!==n.escapedName&&"default"!==n.escapedName&&!(e.isUMDExportSymbol(n)&&r&&e.isExternalModule(e.getSourceFileOfNode(r)))&&(!i||e.some(n.declarations,e.isExternalModuleImportEqualsDeclaration))&&(!o||!e.some(n.declarations,e.isNamespaceReexportDeclaration))&&(a||!e.getDeclarationOfKind(n,274))){var s=m(n,ki(n),a);if(s)return s}if(n.escapedName===t.escapedName&&n.exportSymbol&&g(Zi(n.exportSymbol),void 0,a))return [t]}))||(n===oe?m(ce,ce,a):void 0)}(n,a,o);return _.pop(),s}}function f(e,t){return !xa(e,r,t)||!!ba(e.parent,r,ha(t),i,a)}function g(r,i,a){return (t===(i||r)||Zi(t)===Zi(i||r))&&!e.some(r.declarations,Aa)&&(a||f(Zi(r),n))}function m(e,t,r){if(g(e,t,r))return [e];var i=Gi(t),a=i&&p(i,!0);return a&&f(e,ha(n))?[e].concat(a):void 0}}function xa(t,r,n){var i=!1;return va(r,(function(r){var a=Zi(r.get(t.escapedName));return !!a&&(a===t||!!((a=2097152&a.flags&&!e.getDeclarationOfKind(a,274)?ki(a):a).flags&n)&&(i=!0,!0))})),i}function Da(e,t){return 0===ka(e,t,788968,!1,!0).accessibility}function Sa(e,t){return 0===ka(e,t,111551,!1,!0).accessibility}function Ta(e,t,r){return 0===ka(e,t,r,!1,!1).accessibility}function Ca(t,r,n,i,a,o){if(e.length(t)){for(var s,c=!1,l=0,u=t;l<u.length;l++){var _=u[l],d=ba(_,r,i,!1);if(d){s=_;var p=Pa(d[0],a);if(p)return p}if(o&&e.some(_.declarations,Aa)){if(a){c=!0;continue}return {accessibility:0}}var f=Ca(ta(_,r,i),r,n,n===_?ha(i):i,a,o);if(f)return f}return c?{accessibility:0}:s?{accessibility:1,errorSymbolName:Ia(n,r,i),errorModuleName:s!==n?Ia(s,r,1920):void 0}:void 0}}function Ea(e,t,r,n){return ka(e,t,r,n,!0)}function ka(t,r,n,i,a){if(t&&r){var o=Ca([t],r,t,n,i,a);if(o)return o;var s=e.forEach(t.declarations,Na);return s&&s!==Na(r)?{accessibility:2,errorSymbolName:Ia(t,r,n),errorModuleName:Ia(s),errorNode:e.isInJSFile(r)?r:void 0}:{accessibility:1,errorSymbolName:Ia(t,r,n)}}return {accessibility:0}}function Na(t){var r=e.findAncestor(t,Fa);return r&&$i(r)}function Fa(t){return e.isAmbientModule(t)||303===t.kind&&e.isExternalOrCommonJsModule(t)}function Aa(t){return e.isModuleWithStringLiteralName(t)||303===t.kind&&e.isExternalOrCommonJsModule(t)}function Pa(t,r){var n;if(e.every(e.filter(t.declarations,(function(e){return 79!==e.kind})),(function(r){var n,a;if(!Ha(r)){var o=_i(r);return o&&!e.hasSyntacticModifier(o,1)&&Ha(o.parent)?i(r,o):e.isVariableDeclaration(r)&&e.isVariableStatement(r.parent.parent)&&!e.hasSyntacticModifier(r.parent.parent,1)&&Ha(r.parent.parent.parent)?i(r,r.parent.parent):e.isLateVisibilityPaintedStatement(r)&&!e.hasSyntacticModifier(r,1)&&Ha(r.parent)?i(r,r):!!(2097152&t.flags&&e.isBindingElement(r)&&e.isInJSFile(r)&&(null===(n=r.parent)||void 0===n?void 0:n.parent)&&e.isVariableDeclaration(r.parent.parent)&&(null===(a=r.parent.parent.parent)||void 0===a?void 0:a.parent)&&e.isVariableStatement(r.parent.parent.parent.parent)&&!e.hasSyntacticModifier(r.parent.parent.parent.parent,1)&&r.parent.parent.parent.parent.parent&&Ha(r.parent.parent.parent.parent.parent))&&i(r,r.parent.parent.parent.parent)}return !0})))return {accessibility:0,aliasesToMakeVisible:n};function i(t,i){return r&&(Qn(t).isVisible=!0,n=e.appendIfUnique(n,i)),!0}}function wa(t,r){var n;n=180===t.parent.kind||e.isExpressionWithTypeArgumentsInClassExtendsClause(t.parent)||161===t.parent.kind?1160127:160===t.kind||205===t.kind||264===t.parent.kind?1920:788968;var i=e.getFirstIdentifier(t),a=ei(r,i.escapedText,n,void 0,void 0,!1);return a&&262144&a.flags&&788968&n?{accessibility:0}:a&&Pa(a,!0)||{accessibility:1,errorSymbolName:e.getTextOfNode(i),errorNode:i}}function Ia(t,r,n,i,a){void 0===i&&(i=4);var o=70221824;2&i&&(o|=128),1&i&&(o|=512),8&i&&(o|=16384),16&i&&(o|=134217728);var s=4&i?ae.symbolToExpression:ae.symbolToEntityName;return a?c(a).getText():e.usingSingleLineStringWriter(c);function c(i){var a=s(t,n,r,o),c=303===(null==r?void 0:r.kind)?e.createPrinter({removeComments:!0,neverAsciiEscape:!0}):e.createPrinter({removeComments:!0}),l=r&&e.getSourceFileOfNode(r);return c.writeNode(4,a,l,i),i}}function Oa(t,r,n,i,a){return void 0===n&&(n=0),a?o(a).getText():e.usingSingleLineStringWriter(o);function o(a){var o;o=262144&n?1===i?179:178:1===i?174:173;var s=ae.signatureToSignatureDeclaration(t,o,r,70222336|ja(n)),c=e.createPrinter({removeComments:!0,omitTrailingSemicolon:!0}),l=r&&e.getSourceFileOfNode(r);return c.writeNode(4,s,l,e.getTrailingSemicolonDeferringWriter(a)),a}}function Ma(t,r,n,i){void 0===n&&(n=1064960),void 0===i&&(i=e.createTextWriter(""));var a=U.noErrorTruncation||1&n,o=ae.typeToTypeNode(t,r,70221824|ja(n)|(a?1:0),i);if(void 0===o)return e.Debug.fail("should always get typenode");var s={removeComments:t!==Le},c=e.createPrinter(s),l=r&&e.getSourceFileOfNode(r);c.writeNode(4,o,l,i);var u=i.getText(),_=a?2*e.noTruncationMaximumTruncationLength:2*e.defaultMaximumTruncationLength;return _&&u&&u.length>=_?u.substr(0,_-"...".length)+"...":u}function La(e,t){var r=Ba(e.symbol)?Ma(e,e.symbol.valueDeclaration):Ma(e),n=Ba(t.symbol)?Ma(t,t.symbol.valueDeclaration):Ma(t);return r===n&&(r=Ra(e),n=Ra(t)),[r,n]}function Ra(e){return Ma(e,void 0,64)}function Ba(t){return t&&!!t.valueDeclaration&&e.isExpression(t.valueDeclaration)&&!Ud(t.valueDeclaration)}function ja(e){return void 0===e&&(e=0),814775659&e}function Ja(t){return !!(t.symbol&&32&t.symbol.flags&&(t===ss(t.symbol)||524288&t.flags&&16777216&e.getObjectFlags(t)))}function za(t,r,n,i){return void 0===n&&(n=16384),i?a(i).getText():e.usingSingleLineStringWriter(a);function a(i){var a=e.factory.createTypePredicateNode(2===t.kind||3===t.kind?e.factory.createToken(128):void 0,1===t.kind||3===t.kind?e.factory.createIdentifier(t.parameterName):e.factory.createThisTypeNode(),t.type&&ae.typeToTypeNode(t.type,r,70222336|ja(n))),o=e.createPrinter({removeComments:!0}),s=r&&e.getSourceFileOfNode(r);return o.writeNode(4,a,s,i),i}}function Ua(e){return 8===e?"private":16===e?"protected":"public"}function Ka(t){return t&&t.parent&&261===t.parent.kind&&e.isExternalModuleAugmentation(t.parent.parent)}function Va(t){return 303===t.kind||e.isAmbientModule(t)}function qa(t,r){var n=Gn(t).nameType;if(n){if(384&n.flags){var i=""+n.value;return e.isIdentifierText(i,e.getEmitScriptTarget(U))||ky(i)?ky(i)&&e.startsWith(i,"-")?"[".concat(i,"]"):i:'"'.concat(e.escapeString(i,34),'"')}if(8192&n.flags)return "[".concat(Wa(n.symbol,r),"]")}}function Wa(t,r){if(r&&"default"===t.escapedName&&!(16384&r.flags)&&(!(16777216&r.flags)||!t.declarations||r.enclosingDeclaration&&e.findAncestor(t.declarations[0],Va)!==e.findAncestor(r.enclosingDeclaration,Va)))return "default";if(t.declarations&&t.declarations.length){var n=e.firstDefined(t.declarations,(function(t){return e.getNameOfDeclaration(t)?t:void 0})),i=n&&e.getNameOfDeclaration(n);if(n&&i){if(e.isCallExpression(n)&&e.isBindableObjectDefinePropertyCall(n))return e.symbolName(t);if(e.isComputedPropertyName(i)&&!(4096&e.getCheckFlags(t))){var a=Gn(t).nameType;if(a&&384&a.flags){var o=qa(t,r);if(void 0!==o)return o}}return e.declarationNameToString(i)}if(n||(n=t.declarations[0]),n.parent&&253===n.parent.kind)return e.declarationNameToString(n.parent.name);switch(n.kind){case 225:case 212:case 213:return !r||r.encounteredError||131072&r.flags||(r.encounteredError=!0),225===n.kind?"(Anonymous class)":"(Anonymous function)"}}var s=qa(t,r);return void 0!==s?s:e.symbolName(t)}function Ha(t){if(t){var r=Qn(t);return void 0===r.isVisible&&(r.isVisible=!!function(){switch(t.kind){case 336:case 343:case 337:return !!(t.parent&&t.parent.parent&&t.parent.parent.parent&&e.isSourceFile(t.parent.parent.parent));case 202:return Ha(t.parent.parent);case 253:if(e.isBindingPattern(t.name)&&!t.name.elements.length)return !1;case 260:case 256:case 257:case 258:case 255:case 259:case 264:if(e.isExternalModuleAugmentation(t))return !0;var r=$a(t);return 1&e.getCombinedModifierFlags(t)||264!==t.kind&&303!==r.kind&&8388608&r.flags?Ha(r):Xn(r);case 166:case 165:case 171:case 172:case 168:case 167:if(e.hasEffectiveModifier(t,24))return !1;case 170:case 174:case 173:case 175:case 163:case 261:case 178:case 179:case 181:case 177:case 182:case 183:case 186:case 187:case 190:case 196:return Ha(t.parent);case 266:case 267:case 269:return !1;case 162:case 303:case 263:return !0;case 270:default:return !1}}()),r.isVisible}return !1}function Ga(t,r){var n,i,a;return t.parent&&270===t.parent.kind?n=ei(t,t.escapedText,2998271,void 0,t,!1):274===t.parent.kind&&(n=Di(t.parent,2998271)),n&&((a=new e.Set).add(M(n)),function t(n){e.forEach(n,(function(n){var o=_i(n)||n;if(r?Qn(n).isVisible=!0:(i=i||[],e.pushIfUnique(i,o)),e.isInternalModuleImportEqualsDeclaration(n)){var s=n.moduleReference,c=ei(n,e.getFirstIdentifier(s).escapedText,901119,void 0,void 0,!1);c&&a&&e.tryAddToSet(a,M(c))&&t(c.declarations);}}));}(n.declarations)),i}function Qa(e,t){var r=Xa(e,t);if(r>=0){for(var n=Qr.length,i=r;i<n;i++)Xr[i]=!1;return !1}return Qr.push(e),Xr.push(!0),Yr.push(t),!0}function Xa(e,t){for(var r=Qr.length-1;r>=0;r--){if(Ya(Qr[r],Yr[r]))return -1;if(Qr[r]===e&&Yr[r]===t)return r}return -1}function Ya(t,r){switch(r){case 0:return !!Gn(t).type;case 5:return !!Qn(t).resolvedEnumType;case 2:return !!Gn(t).declaredType;case 1:return !!t.resolvedBaseConstructorType;case 3:return !!t.resolvedReturnType;case 4:return !!t.immediateBaseConstraint;case 6:return !!t.resolvedTypeArguments;case 7:return !!t.baseTypesResolved}return e.Debug.assertNever(r)}function Za(){return Qr.pop(),Yr.pop(),Xr.pop()}function $a(t){return e.findAncestor(e.getRootDeclaration(t),(function(e){switch(e.kind){case 253:case 254:case 269:case 268:case 267:case 266:return !1;default:return !0}})).parent}function eo(e,t){var r=Jc(e,t);return r?Uo(r):void 0}function to(e){return e&&0!=(1&e.flags)}function ro(e){return e===Me||!!(1&e.flags&&e.aliasSymbol)}function no(e){var t=$i(e);return t&&Gn(t).type||mo(e,!1)}function io(t,r,n){if(131072&(t=om(t,(function(e){return !(98304&e.flags)}))).flags)return mt;if(1048576&t.flags)return lm(t,(function(e){return io(e,r,n)}));var i=qu(e.map(r,i_));if(x_(t)||D_(i)){if(131072&i.flags)return t;var a=(gr||(gr=lu("Omit",2,!0)||Ne),gr===Ne?void 0:gr);return a?Vl(a,[t,i]):Me}for(var o=e.createSymbolTable(),s=0,c=yc(t);s<c.length;s++){var l=c[s];Yd(a_(l,8576),i)||24&e.getDeclarationModifierFlagsFromSymbol(l)||!Z_(l)||o.set(l.escapedName,$_(l,!1));}var u=ya(n,o,e.emptyArray,e.emptyArray,Hc(t));return u.objectFlags|=8388608,u}function ao(e){return !!(465829888&e.flags)&&Eb(Tc(e)||je,32768)}function oo(e){return Jg(im(e,ao)?lm(e,(function(e){return 465829888&e.flags?Cc(e):e})):e,524288)}function so(e,t){var r=co(e);return r?Pm(r,t):t}function co(t){var r=function(e){var t=e.parent.parent;switch(t.kind){case 202:case 294:return co(t);case 203:return co(e.parent);case 253:return t.initializer;case 220:return t.right}}(t);if(r&&r.flowNode){var n=lo(t);if(n){var i=e.setTextRange(e.parseNodeFactory.createStringLiteral(n),t),a=e.isLeftHandSideExpression(r)?r:e.parseNodeFactory.createParenthesizedExpression(r),o=e.setTextRange(e.parseNodeFactory.createElementAccessExpression(a,i),t);return e.setParent(i,o),e.setParent(o,t),a!==r&&e.setParent(a,o),o.flowNode=r.flowNode,o}}}function lo(e){var t=e.parent;return 202===e.kind&&200===t.kind?uo(e.propertyName||e.name):294===e.kind||295===e.kind?uo(e.name):""+t.elements.indexOf(e)}function uo(e){var t=i_(e);return 384&t.flags?""+t.value:void 0}function _o(t){var r,n=t.parent,i=no(n.parent);if(!i||to(i))return i;if(H&&8388608&t.flags&&e.isParameterDeclaration(t)?i=Sf(i):!H||!n.parent.initializer||65536&jg(Qg(n.parent.initializer))||(i=Jg(i,524288)),200===n.kind)if(t.dotDotDotToken){if(2&(i=Mc(i)).flags||!wy(i))return In(t,e.Diagnostics.Rest_types_may_only_be_created_from_object_types),Me;for(var a=[],o=0,s=n.elements;o<s.length;o++){var c=s[o];c.dotDotDotToken||a.push(c.propertyName||c.name);}r=io(i,a,t.symbol);}else {var l=t.propertyName||t.name;r=so(t,F_(i,i_(l),32,l));}else {var u=hD(65|(t.dotDotDotToken?0:128),i,ze,n),_=n.elements.indexOf(t);r=t.dotDotDotToken?am(i,_f)?lm(i,(function(e){return Ou(e,_)})):Tu(u):Qp(i)?so(t,P_(i,ad(_),32|(Sy(t)?16:0),t.name)||Me):u;}return t.initializer?e.getEffectiveTypeAnnotationNode(e.walkUpBindingElementsAndPatterns(t))?!H||32768&vf(Kb(t))?r:oo(r):Vb(t,qu([oo(r),Kb(t)],2)):r}function po(t){var r=e.getJSDocType(t);if(r)return dd(r)}function fo(t){var r=e.skipParentheses(t,!0);return 203===r.kind&&0===r.elements.length}function go(e,t,r){return void 0===t&&(t=!1),void 0===r&&(r=!0),H&&r?Df(e,t):e}function mo(t,r){if(e.isVariableDeclaration(t)&&242===t.parent.parent.kind){var n=c_(ov(ax(t.parent.parent.expression)));return 4456448&n.flags?l_(n):He}if(e.isVariableDeclaration(t)&&243===t.parent.parent.kind)return vD(t.parent.parent)||we;if(e.isBindingPattern(t.parent))return _o(t);var i,a,o=e.isPropertyDeclaration(t)||e.isPropertySignature(t),s=r&&(o&&!!t.questionToken||e.isParameter(t)&&(!!t.questionToken||tl(t))||il(t)),c=wo(t);if(c)return go(c,o,s);if((Y||e.isInJSFile(t))&&e.isVariableDeclaration(t)&&!e.isBindingPattern(t.name)&&!(1&e.getCombinedModifierFlags(t))&&!(8388608&t.flags)){if(!(2&e.getCombinedNodeFlags(t)||t.initializer&&(i=t.initializer,a=e.skipParentheses(i,!0),104!==a.kind&&(79!==a.kind||Sg(a)!==se))))return Ie;if(t.initializer&&fo(t.initializer))return Kt}if(e.isParameter(t)){var l=t.parent;if(172===l.kind&&As(l)){var u=e.getDeclarationOfKind($i(t.parent),171);if(u){var _=cl(u),d=jT(l);return d&&t===d?(e.Debug.assert(!d.type),Uo(_.thisParameter)):ml(_)}}if(e.isInJSFile(t)){var p=e.getJSDocType(l);if(p&&e.isFunctionTypeNode(p)){var f=cl(p),g=l.parameters.indexOf(t);return t.dotDotDotToken?Yh(f,g):Qh(f,g)}}if(v="this"===t.symbol.escapedName?Zm(l):$m(t))return go(v,!1,s)}if(e.hasOnlyExpressionInitializer(t)&&t.initializer){if(e.isInJSFile(t)&&!e.isParameter(t)){var m=So(t,$i(t),e.getDeclaredExpandoInitializer(t));if(m)return m}return go(v=Vb(t,Kb(t)),o,s)}if(e.isPropertyDeclaration(t)&&(Y||e.isInJSFile(t))){if(e.hasStaticModifier(t)){var y=e.filter(t.parent.members,e.isClassStaticBlockDeclaration);return (v=y.length?function(t,r){for(var n=e.startsWith(t.escapedName,"__#")?e.factory.createPrivateIdentifier(t.escapedName.split("@")[1]):e.unescapeLeadingUnderscores(t.escapedName),i=0,a=r;i<a.length;i++){var o=a[i],s=e.factory.createPropertyAccessExpression(e.factory.createThis(),n);e.setParent(s.expression,s),e.setParent(s,o),s.flowNode=o.returnFlowNode;var c=xo(s,t);if(!Y||c!==Ie&&c!==Kt||In(t.valueDeclaration,e.Diagnostics.Member_0_implicitly_has_an_1_type,Ia(t),Ma(c)),!am(c,av))return cD(c)}}(t.symbol,y):2&e.getEffectiveModifierFlags(t)?Bp(t.symbol):void 0)&&go(v,!0,s)}var v,h=sa(t.parent);return (v=h?bo(t.symbol,h):2&e.getEffectiveModifierFlags(t)?Bp(t.symbol):void 0)&&go(v,!0,s)}return e.isJsxAttribute(t)?Ze:e.isBindingPattern(t.name)?No(t.name,!1,!0):void 0}function yo(t){if(t.valueDeclaration&&e.isBinaryExpression(t.valueDeclaration)){var r=Gn(t);return void 0===r.isConstructorDeclaredProperty&&(r.isConstructorDeclaredProperty=!1,r.isConstructorDeclaredProperty=!!ho(t)&&e.every(t.declarations,(function(r){return e.isBinaryExpression(r)&&oy(r)&&(206!==r.left.kind||e.isStringOrNumericLiteralLike(r.left.argumentExpression))&&!To(void 0,r,t,r)}))),r.isConstructorDeclaredProperty}return !1}function vo(t){var r=t.valueDeclaration;return r&&e.isPropertyDeclaration(r)&&!e.getEffectiveTypeAnnotationNode(r)&&!r.initializer&&(Y||e.isInJSFile(r))}function ho(t){if(t.declarations)for(var r=0,n=t.declarations;r<n.length;r++){var i=n[r],a=e.getThisContainer(i,!1);if(a&&(170===a.kind||Fh(a)))return a}}function bo(t,r){var n=e.startsWith(t.escapedName,"__#")?e.factory.createPrivateIdentifier(t.escapedName.split("@")[1]):e.unescapeLeadingUnderscores(t.escapedName),i=e.factory.createPropertyAccessExpression(e.factory.createThis(),n);e.setParent(i.expression,i),e.setParent(i,r),i.flowNode=r.returnFlowNode;var a=xo(i,t);return !Y||a!==Ie&&a!==Kt||In(t.valueDeclaration,e.Diagnostics.Member_0_implicitly_has_an_1_type,Ia(t),Ma(a)),am(a,av)?void 0:cD(a)}function xo(t,r){var n=(null==r?void 0:r.valueDeclaration)&&(!vo(r)||2&e.getEffectiveModifierFlags(r.valueDeclaration))&&Bp(r)||ze;return Pm(t,Ie,n)}function Do(t,r){var n,i=e.getAssignedExpandoInitializer(t.valueDeclaration);if(i){var a=e.getJSDocTypeTag(i);return a&&a.typeExpression?dd(a.typeExpression):t.valueDeclaration&&So(t.valueDeclaration,t,i)||sf(zb(i))}var o=!1,s=!1;if(yo(t)&&(n=bo(t,ho(t))),!n){var c=void 0;if(t.declarations){for(var l=void 0,u=0,_=t.declarations;u<_.length;u++){var d=_[u],p=e.isBinaryExpression(d)||e.isCallExpression(d)?d:e.isAccessExpression(d)?e.isBinaryExpression(d.parent)?d.parent:d:void 0;if(p){var f=e.isAccessExpression(p)?e.getAssignmentDeclarationPropertyAccessKind(p):e.getAssignmentDeclarationKind(p);(4===f||e.isBinaryExpression(p)&&oy(p,f))&&(Eo(p)?o=!0:s=!0),e.isCallExpression(p)||(l=To(l,p,t,d)),l||(c||(c=[])).push(e.isBinaryExpression(p)||e.isCallExpression(p)?Co(t,r,p,f):nt);}}n=l;}if(!n){if(!e.length(c))return Me;var g=o&&t.declarations?function(t,r){return e.Debug.assert(t.length===r.length),t.filter((function(t,n){var i=r[n],a=e.isBinaryExpression(i)?i:e.isBinaryExpression(i.parent)?i.parent:void 0;return a&&Eo(a)}))}(c,t.declarations):void 0;if(s){var m=Bp(t);m&&((g||(g=[])).push(m),o=!0);}n=qu(e.some(g,(function(e){return !!(-98305&e.flags)}))?g:c,2);}}var y=jf(go(n,!1,s&&!o));return t.valueDeclaration&&om(y,(function(e){return !!(-98305&e.flags)}))===nt?(Uf(t.valueDeclaration,we),we):y}function So(t,r,n){var i,a;if(e.isInJSFile(t)&&n&&e.isObjectLiteralExpression(n)&&!n.properties.length){for(var o=e.createSymbolTable();e.isBinaryExpression(t)||e.isPropertyAccessExpression(t);){var s=$i(t);(null===(i=null==s?void 0:s.exports)||void 0===i?void 0:i.size)&&Wn(o,s.exports),t=e.isBinaryExpression(t)?t.parent:t.parent.parent;}var c=$i(t);(null===(a=null==c?void 0:c.exports)||void 0===a?void 0:a.size)&&Wn(o,c.exports);var l=ya(r,o,e.emptyArray,e.emptyArray,e.emptyArray);return l.objectFlags|=8192,l}}function To(t,r,n,i){var a,o=e.getEffectiveTypeAnnotationNode(r.parent);if(o){var s=jf(dd(o));if(!t)return s;ro(t)||ro(s)||Wd(t,s)||uD(void 0,t,i,s);}if(null===(a=n.parent)||void 0===a?void 0:a.valueDeclaration){var c=e.getEffectiveTypeAnnotationNode(n.parent.valueDeclaration);if(c){var l=Jc(dd(c),n.escapedName);if(l)return Ko(l)}}return t}function Co(t,r,n,i){if(e.isCallExpression(n)){if(r)return Uo(r);var a=zb(n.arguments[2]),o=eo(a,"value");if(o)return o;var s=eo(a,"get");if(s){var c=Qv(s);if(c)return ml(c)}var l=eo(a,"set");if(l){var u=Qv(l);if(u)return nb(u)}return we}if(function(t,r){return e.isPropertyAccessExpression(t)&&108===t.expression.kind&&e.forEachChildRecursively(r,(function(e){return Eg(t,e)}))}(n.left,n.right))return we;var _=r?Uo(r):sf(zb(n.right));if(524288&_.flags&&2===i&&"export="===t.escapedName){var d=pc(_),p=e.createSymbolTable();e.copyEntries(d.members,p);var f=p.size;r&&!r.exports&&(r.exports=e.createSymbolTable()),(r||t).exports.forEach((function(t,r){var n,i=p.get(r);if(i&&i!==t)if(111551&t.flags&&111551&i.flags){if(t.valueDeclaration&&i.valueDeclaration&&e.getSourceFileOfNode(t.valueDeclaration)!==e.getSourceFileOfNode(i.valueDeclaration)){var a=e.unescapeLeadingUnderscores(t.escapedName),o=(null===(n=e.tryCast(i.valueDeclaration,e.isNamedDeclaration))||void 0===n?void 0:n.name)||i.valueDeclaration;e.addRelatedInfo(In(t.valueDeclaration,e.Diagnostics.Duplicate_identifier_0,a),e.createDiagnosticForNode(o,e.Diagnostics._0_was_also_declared_here,a)),e.addRelatedInfo(In(o,e.Diagnostics.Duplicate_identifier_0,a),e.createDiagnosticForNode(t.valueDeclaration,e.Diagnostics._0_was_also_declared_here,a));}var s=jn(t.flags|i.flags,r);s.type=qu([Uo(t),Uo(i)]),s.valueDeclaration=i.valueDeclaration,s.declarations=e.concatenate(i.declarations,t.declarations),p.set(r,s);}else p.set(r,Kn(t,i));else p.set(r,t);}));var g=ya(f!==p.size?void 0:d.symbol,p,d.callSignatures,d.constructSignatures,d.indexInfos);return g.objectFlags|=8192&e.getObjectFlags(_),g.symbol&&32&g.symbol.flags&&_===ss(g.symbol)&&(g.objectFlags|=16777216),g}return Zp(_)?(Uf(n,Ut),Ut):_}function Eo(t){var r=e.getThisContainer(t,!1);return 170===r.kind||255===r.kind||212===r.kind&&!e.isPrototypePropertyAssignment(r.parent)}function ko(t,r,n){return t.initializer?go(Vb(t,Kb(t,e.isBindingPattern(t.name)?No(t.name,!0,!1):je))):e.isBindingPattern(t.name)?No(t.name,r,n):(n&&!Po(t)&&Uf(t,we),r?Re:we)}function No(t,r,n){return void 0===r&&(r=!1),void 0===n&&(n=!1),200===t.kind?function(t,r,n){var i,a=e.createSymbolTable(),o=262272;e.forEach(t.elements,(function(e){var t=e.propertyName||e.name;if(e.dotDotDotToken)i=Nl(He,we,!1);else {var s=i_(t);if(Es(s)){var c=Ps(s),l=jn(4|(e.initializer?16777216:0),c);l.type=ko(e,r,n),l.bindingElement=e,a.set(l.escapedName,l);}else o|=512;}}));var s=ya(void 0,a,e.emptyArray,e.emptyArray,i?[i]:e.emptyArray);return s.objectFlags|=o,r&&(s.pattern=t,s.objectFlags|=262144),s}(t,r,n):function(t,r,n){var i,a=t.elements,o=e.lastOrUndefined(a),s=o&&202===o.kind&&o.dotDotDotToken?o:void 0;if(0===a.length||1===a.length&&s)return K>=2?(i=we,Du(hu(!0),[i])):Ut;var c=e.map(a,(function(t){return e.isOmittedExpression(t)?we:ko(t,r,n)})),l=e.findLastIndex(a,(function(t){return !(t===s||e.isOmittedExpression(t)||Sy(t))}),a.length-1)+1,u=Au(c,e.map(a,(function(e,t){return e===s?4:t>=l?2:1})));return r&&((u=jl(u)).pattern=t,u.objectFlags|=262144),u}(t,r,n)}function Fo(e,t){return Ao(mo(e,!0),e,t)}function Ao(t,r,n){return t?(4096&t.flags&&(i=r.parent,a=$i(i),(o=Ht||(Ht=cu("SymbolConstructor",!1)))&&a&&a===o)&&(t=cd(r)),n&&Kf(r,t),8192&t.flags&&(e.isBindingElement(r)||!r.type)&&t.symbol!==$i(r)&&(t=tt),jf(t)):(t=e.isParameter(r)&&r.dotDotDotToken?Ut:we,n&&(Po(r)||Uf(r,t)),t);var i,a,o;}function Po(t){var r=e.getRootDeclaration(t);return bx(163===r.kind?r.parent:r)}function wo(t){var r=e.getEffectiveTypeAnnotationNode(t);if(r)return dd(r)}function Io(t){if(t)return 171===t.kind?e.getEffectiveReturnTypeNode(t):e.getEffectiveSetAccessorTypeAnnotationNode(t)}function Oo(e){var t=Io(e);return t&&dd(t)}function Mo(t){var r=Gn(t);return r.type||(r.type=Lo(t)||e.Debug.fail("Read type of accessor must always produce a type"))}function Lo(t,r){if(void 0===r&&(r=!1),!Qa(t,0))return Me;var n=Ro(t,r);return Za()||(n=we,Y&&In(e.getDeclarationOfKind(t,171),e.Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions,Ia(t))),n}function Ro(t,r){void 0===r&&(r=!1);var n=e.getDeclarationOfKind(t,171),i=e.getDeclarationOfKind(t,172),a=Oo(i);if(r&&a)return c(a,t);if(n&&e.isInJSFile(n)){var o=po(n);if(o)return c(o,t)}var s=Oo(n);return s?c(s,t):a||(n&&n.body?c(_b(n),t):i?(bx(i)||Mn(Y,i,e.Diagnostics.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation,Ia(t)),we):n?(e.Debug.assert(!!n,"there must exist a getter as we are current checking either setter or getter in this function"),bx(n)||Mn(Y,n,e.Diagnostics.Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation,Ia(t)),we):void 0);function c(t,r){return 1&e.getCheckFlags(r)?Rd(t,Gn(r).mapper):t}}function Bo(t){var r=rs(ss(t));return 8650752&r.flags?r:2097152&r.flags?e.find(r.types,(function(e){return !!(8650752&e.flags)})):void 0}function jo(t){var r=Gn(t),n=r;if(!r.type){var i=t.valueDeclaration&&Ph(t.valueDeclaration,!1);if(i){var a=Ah(t,i);a&&(t=r=a);}n.type=r.type=function(t){var r=t.valueDeclaration;if(1536&t.flags&&e.isShorthandAmbientModuleSymbol(t))return we;if(r&&(220===r.kind||e.isAccessExpression(r)&&220===r.parent.kind))return Do(t);if(512&t.flags&&r&&e.isSourceFile(r)&&r.commonJsModuleIndicator){var n=zi(t);if(n!==t){if(!Qa(t,0))return Me;var i=Zi(t.exports.get("export=")),a=Do(i,i===n?void 0:n);return Za()?a:zo(t)}}var o=_a(16,t);if(32&t.flags){var s=Bo(t);return s?$u([o,s]):o}return H&&16777216&t.flags?Df(o):o}(t);}return r.type}function Jo(e){var t=Gn(e);return t.type||(t.type=fs(e))}function zo(t){var r=t.valueDeclaration;return e.getEffectiveTypeAnnotationNode(r)?(In(t.valueDeclaration,e.Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_type_annotation,Ia(t)),Me):(Y&&(163!==r.kind||r.initializer)&&In(t.valueDeclaration,e.Diagnostics._0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer,Ia(t)),we)}function Uo(t){var r=e.getCheckFlags(t);return 65536&r?function(t){var r=Gn(t);return r.type||(e.Debug.assertIsDefined(r.deferralParent),e.Debug.assertIsDefined(r.deferralConstituents),r.type=1048576&r.deferralParent.flags?qu(r.deferralConstituents):$u(r.deferralConstituents)),r.type}(t):1&r?function(e){var t=Gn(e);if(!t.type){if(!Qa(e,0))return t.type=Me;var r=Rd(Uo(t.target),t.mapper);Za()||(r=zo(e)),t.type=r;}return t.type}(t):262144&r?function(t){if(!t.type){var r=t.mappedType;if(!Qa(t,0))return r.containsError=!0,Me;var n=Rd(ac(r.target||r),Ed(r.mapper,rc(r),t.keyType)),i=H&&16777216&t.flags&&!Eb(n,49152)?Df(n,!0):524288&t.checkFlags?Af(n):n;Za()||(In(_,e.Diagnostics.Type_of_property_0_circularly_references_itself_in_mapped_type_1,Ia(t),Ma(r)),i=Me),t.type=i;}return t.type}(t):8192&r?function(e){var t=Gn(e);return t.type||(t.type=ig(e.propertyType,e.mappedType,e.constraintType)),t.type}(t):7&t.flags?function(t){var r=Gn(t);if(!r.type){var n=function(t){if(4194304&t.flags)return (r=ms(ea(t))).typeParameters?Bl(r,e.map(r.typeParameters,(function(e){return we}))):r;var r;if(t===_e)return we;if(134217728&t.flags&&t.valueDeclaration){var n=$i(e.getSourceFileOfNode(t.valueDeclaration)),i=jn(n.flags,"exports");i.declarations=n.declarations?n.declarations.slice():[],i.parent=t,i.target=n,n.valueDeclaration&&(i.valueDeclaration=n.valueDeclaration),n.members&&(i.members=new e.Map(n.members)),n.exports&&(i.exports=new e.Map(n.exports));var a=e.createSymbolTable();return a.set("exports",i),ya(t,a,e.emptyArray,e.emptyArray,e.emptyArray)}e.Debug.assertIsDefined(t.valueDeclaration);var o,s=t.valueDeclaration;if(e.isCatchClauseVariableDeclarationOrBindingElement(s)){var c=e.getEffectiveTypeAnnotationNode(s);if(void 0===c)return $?je:we;var l=LS(c);return to(l)||l===je?l:Me}if(e.isSourceFile(s)&&e.isJsonSourceFile(s))return s.statements.length?jf(sf(ax(s.statements[0].expression))):mt;if(!Qa(t,0))return 512&t.flags&&!(67108864&t.flags)?jo(t):zo(t);if(270===s.kind)o=Ao(wo(s)||zb(s.expression),s);else if(e.isBinaryExpression(s)||e.isInJSFile(s)&&(e.isCallExpression(s)||(e.isPropertyAccessExpression(s)||e.isBindableStaticElementAccessExpression(s))&&e.isBinaryExpression(s.parent)))o=Do(t);else if(e.isPropertyAccessExpression(s)||e.isElementAccessExpression(s)||e.isIdentifier(s)||e.isStringLiteralLike(s)||e.isNumericLiteral(s)||e.isClassDeclaration(s)||e.isFunctionDeclaration(s)||e.isMethodDeclaration(s)&&!e.isObjectLiteralMethod(s)||e.isMethodSignature(s)||e.isSourceFile(s)){if(9136&t.flags)return jo(t);o=e.isBinaryExpression(s.parent)?Do(t):wo(s)||we;}else if(e.isPropertyAssignment(s))o=wo(s)||Gb(s);else if(e.isJsxAttribute(s))o=wo(s)||My(s);else if(e.isShorthandPropertyAssignment(s))o=wo(s)||Hb(s.name,0);else if(e.isObjectLiteralMethod(s))o=wo(s)||Qb(s,0);else if(e.isParameter(s)||e.isPropertyDeclaration(s)||e.isPropertySignature(s)||e.isVariableDeclaration(s)||e.isBindingElement(s)||e.isJSDocPropertyLikeTag(s))o=Fo(s,!0);else if(e.isEnumDeclaration(s))o=jo(t);else if(e.isEnumMember(s))o=Jo(t);else {if(!e.isAccessor(s))return e.Debug.fail("Unhandled declaration kind! "+e.Debug.formatSyntaxKind(s.kind)+" for "+e.Debug.formatSymbol(t));o=Ro(t)||e.Debug.fail("Non-write accessor resolution must always produce a type");}return Za()?o:512&t.flags&&!(67108864&t.flags)?jo(t):zo(t)}(t);r.type||(r.type=n);}return r.type}(t):9136&t.flags?jo(t):8&t.flags?Jo(t):98304&t.flags?Mo(t):2097152&t.flags?function(t){var r=Gn(t);if(!r.type){var n=ki(t),i=t.declarations&&Ti(di(t),!0),a=e.firstDefined(null==i?void 0:i.declarations,(function(t){return e.isExportAssignment(t)?wo(t):void 0}));r.type=(null==i?void 0:i.declarations)&&vS(i.declarations)&&t.declarations.length?function(t){var r=e.getSourceFileOfNode(t.declarations[0]),n=e.unescapeLeadingUnderscores(t.escapedName),i=t.declarations.every((function(t){return e.isInJSFile(t)&&e.isAccessExpression(t)&&e.isModuleExportsAccessExpression(t.expression)})),a=i?e.factory.createPropertyAccessExpression(e.factory.createPropertyAccessExpression(e.factory.createIdentifier("module"),e.factory.createIdentifier("exports")),n):e.factory.createPropertyAccessExpression(e.factory.createIdentifier("exports"),n);return i&&e.setParent(a.expression.expression,a.expression),e.setParent(a.expression,a),e.setParent(a,r),a.flowNode=r.endFlowNode,Pm(a,Ie,ze)}(i):vS(t.declarations)?Ie:a||(111551&n.flags?Uo(n):Me);}return r.type}(t):Me}function Ko(e){return Nf(Uo(e),!!(16777216&e.flags))}function Vo(t,r){return void 0!==t&&void 0!==r&&0!=(4&e.getObjectFlags(t))&&t.target===r}function qo(t){return 4&e.getObjectFlags(t)?t.target:t}function Wo(t,r){return function t(n){if(7&e.getObjectFlags(n)){var i=qo(n);return i===r||e.some(is(i),t)}return !!(2097152&n.flags)&&e.some(n.types,t)}(t)}function Ho(t,r){for(var n=0,i=r;n<i.length;n++){var a=i[n];t=e.appendIfUnique(t,gs($i(a)));}return t}function Go(t,r){for(;;){if((t=t.parent)&&e.isBinaryExpression(t)){var n=e.getAssignmentDeclarationKind(t);if(6===n||3===n){var i=$i(t.left);i&&i.parent&&!e.findAncestor(i.parent.valueDeclaration,(function(e){return t===e}))&&(t=i.parent.valueDeclaration);}}if(!t)return;switch(t.kind){case 256:case 225:case 257:case 173:case 174:case 167:case 178:case 179:case 315:case 255:case 168:case 212:case 213:case 258:case 342:case 343:case 337:case 336:case 194:case 188:var a=Go(t,r);if(194===t.kind)return e.append(a,gs($i(t.typeParameter)));if(188===t.kind)return e.concatenate(a,z_(t));var o=Ho(a,e.getEffectiveTypeParameterDeclarations(t)),s=r&&(256===t.kind||225===t.kind||257===t.kind||Fh(t))&&ss($i(t)).thisType;return s?e.append(o,s):o;case 338:var c=e.getParameterSymbolFromJSDoc(t);c&&(t=c.valueDeclaration);break;case 318:return a=Go(t,r),t.tags?Ho(a,e.flatMap(t.tags,(function(t){return e.isJSDocTemplateTag(t)?t.typeParameters:void 0}))):a}}}function Qo(t){var r=32&t.flags?t.valueDeclaration:e.getDeclarationOfKind(t,257);return e.Debug.assert(!!r,"Class was missing valueDeclaration -OR- non-class had no interface declarations"),Go(r)}function Xo(t){if(t.declarations){for(var r,n=0,i=t.declarations;n<i.length;n++){var a=i[n];if(257===a.kind||256===a.kind||225===a.kind||Fh(a)||e.isTypeAlias(a)){var o=a;r=Ho(r,e.getEffectiveTypeParameterDeclarations(o));}}return r}}function Yo(e){var t=Uc(e,1);if(1===t.length){var r=t[0];if(!r.typeParameters&&1===r.parameters.length&&J(r)){var n=Kh(r.parameters[0]);return to(n)||Gp(n)===we}}return !1}function Zo(e){if(Uc(e,1).length>0)return !0;if(8650752&e.flags){var t=Tc(e);return !!t&&Yo(t)}return !1}function $o(t){return e.getEffectiveBaseTypeNode(t.symbol.valueDeclaration)}function es(t,r,n){var i=e.length(r),a=e.isInJSFile(n);return e.filter(Uc(t,1),(function(t){return (a||i>=ol(t.typeParameters))&&i<=e.length(t.typeParameters)}))}function ts(t,r,n){var i=es(t,r,n),a=e.map(r,dd);return e.sameMap(i,(function(t){return e.some(t.typeParameters)?bl(t,a,e.isInJSFile(n)):t}))}function rs(t){if(!t.resolvedBaseConstructorType){var r=t.symbol.valueDeclaration,n=e.getEffectiveBaseTypeNode(r),i=$o(t);if(!i)return t.resolvedBaseConstructorType=ze;if(!Qa(t,1))return Me;var a=ax(i.expression);if(n&&i!==n&&(e.Debug.assert(!n.typeArguments),ax(n.expression)),2621440&a.flags&&pc(a),!Za())return In(t.symbol.valueDeclaration,e.Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_base_expression,Ia(t.symbol)),t.resolvedBaseConstructorType=Me;if(!(1&a.flags||a===We||Zo(a))){var o=In(i.expression,e.Diagnostics.Type_0_is_not_a_constructor_function_type,Ma(a));if(262144&a.flags){var s=Il(a),c=je;if(s){var l=Uc(s,1);l[0]&&(c=ml(l[0]));}a.symbol.declarations&&e.addRelatedInfo(o,e.createDiagnosticForNode(a.symbol.declarations[0],e.Diagnostics.Did_you_mean_for_0_to_be_constrained_to_type_new_args_Colon_any_1,Ia(a.symbol),Ma(c)));}return t.resolvedBaseConstructorType=Me}t.resolvedBaseConstructorType=a;}return t.resolvedBaseConstructorType}function ns(t,r){In(t,e.Diagnostics.Type_0_recursively_references_itself_as_a_base_type,Ma(r,void 0,2));}function is(t){if(!t.baseTypesResolved){if(Qa(t,7)&&(8&t.objectFlags?t.resolvedBaseTypes=[as(t)]:96&t.symbol.flags?(32&t.symbol.flags&&function(t){t.resolvedBaseTypes=e.resolvingEmptyArray;var r=Ac(rs(t));if(!(2621441&r.flags))return t.resolvedBaseTypes=e.emptyArray;var n,i=$o(t),a=r.symbol?ms(r.symbol):void 0;if(r.symbol&&32&r.symbol.flags&&function(e){var t=e.outerTypeParameters;if(t){var r=t.length-1,n=zl(e);return t[r].symbol!==n[r].symbol}return !0}(a))n=Kl(i,r.symbol);else if(1&r.flags)n=r;else {var o=ts(r,i.typeArguments,i);if(!o.length)return In(i.expression,e.Diagnostics.No_base_constructor_has_the_specified_number_of_type_arguments),t.resolvedBaseTypes=e.emptyArray;n=ml(o[0]);}if(ro(n))return t.resolvedBaseTypes=e.emptyArray;var s=Mc(n);if(!os(s)){var c=jc(void 0,n),l=e.chainDiagnosticMessages(c,e.Diagnostics.Base_constructor_return_type_0_is_not_an_object_type_or_intersection_of_object_types_with_statically_known_members,Ma(s));return mn.add(e.createDiagnosticForNodeFromMessageChain(i.expression,l)),t.resolvedBaseTypes=e.emptyArray}if(t===s||Wo(s,t))return In(t.symbol.valueDeclaration,e.Diagnostics.Type_0_recursively_references_itself_as_a_base_type,Ma(t,void 0,2)),t.resolvedBaseTypes=e.emptyArray;t.resolvedBaseTypes===e.resolvingEmptyArray&&(t.members=void 0),t.resolvedBaseTypes=[s];}(t),64&t.symbol.flags&&function(t){if(t.resolvedBaseTypes=t.resolvedBaseTypes||e.emptyArray,t.symbol.declarations)for(var r=0,n=t.symbol.declarations;r<n.length;r++){var i=n[r];if(257===i.kind&&e.getInterfaceBaseTypeNodes(i))for(var a=0,o=e.getInterfaceBaseTypeNodes(i);a<o.length;a++){var s=o[a],c=Mc(dd(s));ro(c)||(os(c)?t===c||Wo(c,t)?ns(i,t):t.resolvedBaseTypes===e.emptyArray?t.resolvedBaseTypes=[c]:t.resolvedBaseTypes.push(c):In(s,e.Diagnostics.An_interface_can_only_extend_an_object_type_or_intersection_of_object_types_with_statically_known_members));}}}(t)):e.Debug.fail("type must be class or interface"),!Za()&&t.symbol.declarations))for(var r=0,n=t.symbol.declarations;r<n.length;r++){var i=n[r];256!==i.kind&&257!==i.kind||ns(i,t);}t.baseTypesResolved=!0;}return t.resolvedBaseTypes}function as(t){return Tu(qu(e.sameMap(t.typeParameters,(function(e,r){return 8&t.elementFlags[r]?F_(e,Ge):e}))||e.emptyArray),t.readonly)}function os(t){if(262144&t.flags){var r=Tc(t);if(r)return os(r)}return !!(67633153&t.flags&&!dc(t)||2097152&t.flags&&e.every(t.types,os))}function ss(t){var r,n,i,a,o,s=Gn(t),c=s;if(!s.declaredType){var l=32&t.flags?1:2,u=Ah(t,t.valueDeclaration&&((o=(null==(a=null===(n=null==(i=(r=t.valueDeclaration)&&Ph(r,!0))?void 0:i.exports)||void 0===n?void 0:n.get("prototype"))?void 0:a.valueDeclaration)&&function(t){if(!t.parent)return !1;for(var r=t.parent;r&&205===r.kind;)r=r.parent;if(r&&e.isBinaryExpression(r)&&e.isPrototypeAccess(r.left)&&63===r.operatorToken.kind){var n=e.getInitializerOfBinaryExpression(r);return e.isObjectLiteralExpression(n)&&n}}(a.valueDeclaration))?$i(o):void 0));u&&(t=s=u);var _=c.declaredType=s.declaredType=_a(l,t),d=Qo(t),p=Xo(t);(d||p||1===l||!function(t){if(!t.declarations)return !0;for(var r=0,n=t.declarations;r<n.length;r++){var i=n[r];if(257===i.kind){if(128&i.flags)return !1;var a=e.getInterfaceBaseTypeNodes(i);if(a)for(var o=0,s=a;o<s.length;o++){var c=s[o];if(e.isEntityNameExpression(c.expression)){var l=Mi(c.expression,788968,!0);if(!l||!(64&l.flags)||ss(l).thisType)return !1}}}}return !0}(t))&&(_.objectFlags|=4,_.typeParameters=e.concatenate(d,p),_.outerTypeParameters=d,_.localTypeParameters=p,_.instantiations=new e.Map,_.instantiations.set(Ml(_.typeParameters),_),_.target=_,_.resolvedTypeArguments=_.typeParameters,_.thisType=da(t),_.thisType.isThisType=!0,_.thisType.constraint=_);}return s.declaredType}function cs(t){var r,n=Gn(t);if(!n.declaredType){if(!Qa(t,2))return Me;var i=e.Debug.checkDefined(null===(r=t.declarations)||void 0===r?void 0:r.find(e.isTypeAlias),"Type alias symbol with no valid declaration found"),a=e.isJSDocTypeAlias(i)?i.typeExpression:i.type,o=a?dd(a):Me;if(Za()){var s=Xo(t);s&&(n.typeParameters=s,n.instantiations=new e.Map,n.instantiations.set(Ml(s),o));}else o=Me,337===i.kind?In(i.typeExpression.type,e.Diagnostics.Type_alias_0_circularly_references_itself,Ia(t)):In(e.isNamedDeclaration(i)?i.name:i||i,e.Diagnostics.Type_alias_0_circularly_references_itself,Ia(t));n.declaredType=o;}return n.declaredType}function ls(t){return !!e.isStringLiteralLike(t)||220===t.kind&&ls(t.left)&&ls(t.right)}function us(t){var r=t.initializer;if(!r)return !(8388608&t.flags);switch(r.kind){case 10:case 8:case 14:return !0;case 218:return 40===r.operator&&8===r.operand.kind;case 79:return e.nodeIsMissing(r)||!!$i(t.parent).exports.get(r.escapedText);case 220:return ls(r);default:return !1}}function _s(t){var r=Gn(t);if(void 0!==r.enumKind)return r.enumKind;var n=!1;if(t.declarations)for(var i=0,a=t.declarations;i<a.length;i++){var o=a[i];if(259===o.kind)for(var s=0,c=o.members;s<c.length;s++){var l=c[s];if(l.initializer&&e.isStringLiteralLike(l.initializer))return r.enumKind=1;us(l)||(n=!0);}}return r.enumKind=n?0:1}function ds(e){return 1024&e.flags&&!(1048576&e.flags)?ms(ea(e.symbol)):e}function ps(e){var t=Gn(e);if(t.declaredType)return t.declaredType;if(1===_s(e)){b++;var r=[];if(e.declarations)for(var n=0,i=e.declarations;n<i.length;n++){var a=i[n];if(259===a.kind)for(var o=0,s=a.members;o<s.length;o++){var c=s[o],l=sT(c),u=td(sd(void 0!==l?l:0,b,$i(c)));Gn($i(c)).declaredType=u,r.push(rd(u));}}if(r.length){var _=qu(r,1,e,void 0);return 1048576&_.flags&&(_.flags|=1024,_.symbol=e),t.declaredType=_}}var d=ca(32);return d.symbol=e,t.declaredType=d}function fs(e){var t=Gn(e);if(!t.declaredType){var r=ps(ea(e));t.declaredType||(t.declaredType=r);}return t.declaredType}function gs(e){var t=Gn(e);return t.declaredType||(t.declaredType=da(e))}function ms(e){return ys(e)||Me}function ys(e){return 96&e.flags?ss(e):524288&e.flags?cs(e):262144&e.flags?gs(e):384&e.flags?ps(e):8&e.flags?fs(e):2097152&e.flags?function(e){var t=Gn(e);return t.declaredType||(t.declaredType=ms(ki(e)))}(e):void 0}function vs(e){switch(e.kind){case 130:case 154:case 149:case 146:case 157:case 133:case 150:case 147:case 114:case 152:case 143:case 195:return !0;case 182:return vs(e.elementType);case 177:return !e.typeArguments||e.typeArguments.every(vs)}return !1}function hs(t){var r=e.getEffectiveConstraintOfTypeParameter(t);return !r||vs(r)}function bs(t){var r=e.getEffectiveTypeAnnotationNode(t);return r?vs(r):!e.hasInitializer(t)}function xs(t){if(t.declarations&&1===t.declarations.length){var r=t.declarations[0];if(r)switch(r.kind){case 166:case 165:return bs(r);case 168:case 167:case 170:case 171:case 172:return n=r,i=e.getEffectiveReturnTypeNode(n),a=e.getEffectiveTypeParameterDeclarations(n),(170===n.kind||!!i&&vs(i))&&n.parameters.every(bs)&&a.every(hs)}}var n,i,a;return !1}function Ds(t,r,n){for(var i=e.createSymbolTable(),a=0,o=t;a<o.length;a++){var s=o[a];i.set(s.escapedName,n&&xs(s)?s:Fd(s,r));}return i}function Ss(e,t){for(var r=0,n=t;r<n.length;r++){var i=n[r];e.has(i.escapedName)||Ts(i)||e.set(i.escapedName,i);}}function Ts(t){return !!t.valueDeclaration&&e.isPrivateIdentifierClassElementDeclaration(t.valueDeclaration)&&e.isStatic(t.valueDeclaration)}function Cs(t){if(!t.declaredProperties){var r=t.symbol,n=Os(r);t.declaredProperties=fa(n),t.declaredCallSignatures=e.emptyArray,t.declaredConstructSignatures=e.emptyArray,t.declaredIndexInfos=e.emptyArray,t.declaredCallSignatures=_l(n.get("__call")),t.declaredConstructSignatures=_l(n.get("__new")),t.declaredIndexInfos=Fl(r);}return t}function Es(e){return !!(8576&e.flags)}function ks(t){if(!e.isComputedPropertyName(t)&&!e.isElementAccessExpression(t))return !1;var r=e.isComputedPropertyName(t)?t.expression:t.argumentExpression;return e.isEntityNameExpression(r)&&Es(e.isComputedPropertyName(t)?Ny(t):zb(r))}function Ns(e){return 95===e.charCodeAt(0)&&95===e.charCodeAt(1)&&64===e.charCodeAt(2)}function Fs(t){var r=e.getNameOfDeclaration(t);return !!r&&ks(r)}function As(t){return !e.hasDynamicName(t)||Fs(t)}function Ps(t){return 8192&t.flags?t.escapedName:384&t.flags?e.escapeLeadingUnderscores(""+t.value):e.Debug.fail()}function ws(t,r,n,i){e.Debug.assert(!!i.symbol,"The member is expected to have a symbol.");var a=Qn(i);if(!a.resolvedSymbol){a.resolvedSymbol=i.symbol;var o=e.isBinaryExpression(i)?i.left:i.name,s=e.isElementAccessExpression(o)?zb(o.argumentExpression):Ny(o);if(Es(s)){var c=Ps(s),l=i.symbol.flags,u=n.get(c);u||n.set(c,u=jn(0,c,4096));var _=r&&r.get(c);if(u.flags&Jn(l)||_){var d=_?e.concatenate(_.declarations,u.declarations):u.declarations,p=!(8192&s.flags)&&e.unescapeLeadingUnderscores(c)||e.declarationNameToString(o);e.forEach(d,(function(t){return In(e.getNameOfDeclaration(t)||t,e.Diagnostics.Property_0_was_also_declared_here,p)})),In(o||i,e.Diagnostics.Duplicate_property_0,p),u=jn(0,c,4096);}return u.nameType=s,function(t,r,n){e.Debug.assert(!!(4096&e.getCheckFlags(t)),"Expected a late-bound symbol."),t.flags|=n,Gn(r.symbol).lateSymbol=t,t.declarations?r.symbol.isReplaceableByMethod||t.declarations.push(r):t.declarations=[r],111551&n&&(t.valueDeclaration&&t.valueDeclaration.kind===r.kind||(t.valueDeclaration=r));}(u,i,l),u.parent?e.Debug.assert(u.parent===t,"Existing symbol parent should match new one"):u.parent=t,a.resolvedSymbol=u}}return a.resolvedSymbol}function Is(t,r){var n=Gn(t);if(!n[r]){var i="resolvedExports"===r,a=i?1536&t.flags?Yi(t):t.exports:t.members;n[r]=a||k;for(var o=e.createSymbolTable(),s=0,c=t.declarations||e.emptyArray;s<c.length;s++){var l=c[s],u=e.getMembersOfDeclaration(l);if(u)for(var _=0,d=u;_<d.length;_++){var p=d[_];i===e.hasStaticModifier(p)&&Fs(p)&&ws(t,a,o,p);}}var f=t.assignmentDeclarationMembers;if(f)for(var g=0,m=e.arrayFrom(f.values());g<m.length;g++){p=m[g];var y=e.getAssignmentDeclarationKind(p);i===!(3===y||e.isBinaryExpression(p)&&oy(p,y)||9===y||6===y)&&Fs(p)&&ws(t,a,o,p);}n[r]=function(t,r){if(!(null==t?void 0:t.size))return r;if(!(null==r?void 0:r.size))return t;var n=e.createSymbolTable();return Wn(n,t),Wn(n,r),n}(a,o)||k;}return n[r]}function Os(e){return 6256&e.flags?Is(e,"resolvedMembers"):e.members||k}function Ms(t){if(106500&t.flags&&"__computed"===t.escapedName){var r=Gn(t);if(!r.lateSymbol&&e.some(t.declarations,Fs)){var n=Zi(t.parent);e.some(t.declarations,e.hasStaticModifier)?Gi(n):Os(n);}return r.lateSymbol||(r.lateSymbol=t)}return t}function Ls(t,r,n){if(4&e.getObjectFlags(t)){var i=t.target,a=zl(t);if(e.length(i.typeParameters)===e.length(a)){var o=Bl(i,e.concatenate(a,[r||i.thisType]));return n?Ac(o):o}}else if(2097152&t.flags){var s=e.sameMap(t.types,(function(e){return Ls(e,r,n)}));return s!==t.types?$u(s):t}return n?Ac(t):t}function Rs(t,r,n,i){var a,o,s,c,l;e.rangeEquals(n,i,0,n.length)?(o=r.symbol?Os(r.symbol):e.createSymbolTable(r.declaredProperties),s=r.declaredCallSignatures,c=r.declaredConstructSignatures,l=r.declaredIndexInfos):(a=vd(n,i),o=Ds(r.declaredProperties,a,1===n.length),s=md(r.declaredCallSignatures,a),c=md(r.declaredConstructSignatures,a),l=yd(r.declaredIndexInfos,a));var u=is(r);if(u.length){r.symbol&&o===Os(r.symbol)&&(o=e.createSymbolTable(r.declaredProperties)),ma(t,o,s,c,l);for(var _=e.lastOrUndefined(i),d=0,p=u;d<p.length;d++){var f=p[d],g=_?Ls(Rd(f,a),_):f;Ss(o,yc(g)),s=e.concatenate(s,Uc(g,0)),c=e.concatenate(c,Uc(g,1));var m=g!==we?Hc(g):[Nl(He,we,!1)];l=e.concatenate(l,e.filter(m,(function(e){return !Kc(l,e.keyType)})));}}ma(t,o,s,c,l);}function Bs(e,t,r,n,i,a,o,s){var c=new y(de,s);return c.declaration=e,c.typeParameters=t,c.parameters=n,c.thisParameter=r,c.resolvedReturnType=i,c.resolvedTypePredicate=a,c.minArgumentCount=o,c.resolvedMinArgumentCount=void 0,c.target=void 0,c.mapper=void 0,c.compositeSignatures=void 0,c.compositeKind=void 0,c}function js(e){var t=Bs(e.declaration,e.typeParameters,e.thisParameter,e.parameters,void 0,void 0,e.minArgumentCount,39&e.flags);return t.target=e.target,t.mapper=e.mapper,t.compositeSignatures=e.compositeSignatures,t.compositeKind=e.compositeKind,t}function Js(e,t){var r=js(e);return r.compositeSignatures=t,r.compositeKind=1048576,r.target=void 0,r.mapper=void 0,r}function zs(t,r){if((24&t.flags)===r)return t;t.optionalCallSignatureCache||(t.optionalCallSignatureCache={});var n=8===r?"inner":"outer";return t.optionalCallSignatureCache[n]||(t.optionalCallSignatureCache[n]=function(t,r){e.Debug.assert(8===r||16===r,"An optional call signature can either be for an inner call chain or an outer call chain, but not both.");var n=js(t);return n.flags|=r,n}(t,r))}function Us(t,r){if(J(t)){var n=t.parameters.length-1,i=Uo(t.parameters[n]);if(_f(i))return [a(i,n)];if(!r&&1048576&i.flags&&e.every(i.types,_f))return e.map(i.types,(function(e){return a(e,n)}))}return [t.parameters];function a(r,n){var i=zl(r),a=r.target.labeledElementDeclarations,o=e.map(i,(function(e,i){var o=!!a&&Vh(a[i])||qh(t,n+i,r),s=r.target.elementFlags[i],c=jn(1,o,12&s?32768:2&s?16384:0);return c.type=4&s?Tu(e):e,c}));return e.concatenate(t.parameters.slice(0,n),o)}}function Ks(e,t,r,n,i){for(var a=0,o=e;a<o.length;a++){var s=o[a];if(Kp(s,t,r,n,i,r?Qd:Hd))return s}}function Vs(t,r,n){if(r.typeParameters){if(n>0)return;for(var i=1;i<t.length;i++)if(!Ks(t[i],r,!1,!1,!1))return;return [r]}var a;for(i=0;i<t.length;i++){var o=i===n?r:Ks(t[i],r,!0,!1,!0);if(!o)return;a=e.appendIfUnique(a,o);}return a}function qs(t){for(var r,n,i=0;i<t.length;i++){if(0===t[i].length)return e.emptyArray;t[i].length>1&&(n=void 0===n?i:-1);for(var a=0,o=t[i];a<o.length;a++){var s=o[a];if(!r||!Ks(r,s,!1,!1,!0)){var c=Vs(t,s,i);if(c){var l=s;if(c.length>1){var u=s.thisParameter,_=e.forEach(c,(function(e){return e.thisParameter}));_&&(u=wf(_,$u(e.mapDefined(c,(function(e){return e.thisParameter&&Uo(e.thisParameter)}))))),(l=Js(s,c)).thisParameter=u;}(r||(r=[])).push(l);}}}}if(!e.length(r)&&-1!==n){for(var d=t[void 0!==n?n:0],p=d.slice(),f=function(t){if(t!==d){var r=t[0];if(e.Debug.assert(!!r,"getUnionSignatures bails early on empty signature lists and should not have empty lists on second pass"),!(p=r.typeParameters&&e.some(p,(function(e){return !!e.typeParameters&&!Ws(r.typeParameters,e.typeParameters)}))?void 0:e.map(p,(function(t){return function(t,r){var n,i=t.typeParameters||r.typeParameters;t.typeParameters&&r.typeParameters&&(n=vd(r.typeParameters,t.typeParameters));var a=t.declaration,o=function(e,t,r){for(var n=Zh(e),i=Zh(t),a=n>=i?e:t,o=a===e?t:e,s=a===e?n:i,c=eb(e)||eb(t),l=c&&!eb(a),u=new Array(s+(l?1:0)),_=0;_<s;_++){var d=Xh(a,_);a===t&&(d=Rd(d,r));var p=Xh(o,_)||je;o===t&&(p=Rd(p,r));var f=$u([d,p]),g=c&&!l&&_===s-1,m=_>=$h(a)&&_>=$h(o),y=_>=n?void 0:qh(e,_),v=_>=i?void 0:qh(t,_),h=jn(1|(m&&!g?16777216:0),(y===v?y:y?v?void 0:y:v)||"arg".concat(_));h.type=g?Tu(f):f,u[_]=h;}if(l){var b=jn(1,"args");b.type=Tu(Qh(o,s)),o===t&&(b.type=Rd(b.type,r)),u[s]=b;}return u}(t,r,n),s=Bs(a,i,function(e,t,r){return e&&t?wf(e,$u([Uo(e),Rd(Uo(t),r)])):e||t}(t.thisParameter,r.thisParameter,n),o,void 0,void 0,Math.max(t.minArgumentCount,r.minArgumentCount),39&(t.flags|r.flags));return s.compositeKind=1048576,s.compositeSignatures=e.concatenate(2097152!==t.compositeKind&&t.compositeSignatures||[t],[r]),n&&(s.mapper=2097152!==t.compositeKind&&t.mapper&&t.compositeSignatures?Td(t.mapper,n):n),s}(t,r)}))))return "break"}},g=0,m=t;g<m.length&&"break"!==f(m[g]);g++);r=p;}return r||e.emptyArray}function Ws(t,r){if(e.length(t)!==e.length(r))return !1;if(!t||!r)return !0;for(var n=vd(r,t),i=0;i<t.length;i++){var a=t[i],o=r[i];if(a!==o&&!Wd(Il(a)||je,Rd(Il(o)||je,n)))return !1}return !0}function Hs(t){var r=Hc(t[0]);if(r){for(var n=[],i=function(r){var i=r.keyType;e.every(t,(function(e){return !!Gc(e,i)}))&&n.push(Nl(i,qu(e.map(t,(function(e){return Qc(e,i)}))),e.some(t,(function(e){return Gc(e,i).isReadonly}))));},a=0,o=r;a<o.length;a++)i(o[a]);return n}return e.emptyArray}function Gs(e,t){return e?t?$u([e,t]):e:t}function Qs(t){var r=e.countWhere(t,(function(e){return Uc(e,1).length>0})),n=e.map(t,Yo);if(r>0&&r===e.countWhere(n,(function(e){return e}))){var i=n.indexOf(!0);n[i]=!1;}return n}function Xs(t,r){for(var n=function(r){t&&!e.every(t,(function(e){return !Kp(e,r,!1,!1,!1,Hd)}))||(t=e.append(t,r));},i=0,a=r;i<a.length;i++)n(a[i]);return t}function Ys(t,r,n){if(t)for(var i=0;i<t.length;i++){var a=t[i];if(a.keyType===r.keyType)return t[i]=Nl(a.keyType,n?qu([a.type,r.type]):$u([a.type,r.type]),n?a.isReadonly||r.isReadonly:a.isReadonly&&r.isReadonly),t}return e.append(t,r)}function Zs(e,t,r){return Rd(e,vd([t.indexType,t.objectType],[ad(0),Au([r])]))}function $s(t){if(4194304&t.flags){var r=Ac(t.type);return df(r)?Mu(r):c_(r)}if(16777216&t.flags){if(t.root.isDistributive){var n=t.checkType,i=$s(n);if(i!==n)return Ld(t,Cd(t.root.checkType,i,t.mapper))}return t}return 1048576&t.flags?lm(t,$s):2097152&t.flags?$u(e.sameMap(t.types,$s)):t}function ec(t){return 4096&e.getCheckFlags(t)}function tc(e,t,r,n){for(var i=0,a=yc(e);i<a.length;i++)n(a_(a[i],t));if(1&e.flags)n(He);else for(var o=0,s=Hc(e);o<s.length;o++){var c=s[o];(!r||134217732&c.keyType.flags)&&n(c.keyType);}}function rc(e){return e.typeParameter||(e.typeParameter=gs($i(e.declaration.typeParameter)))}function nc(e){return e.constraintType||(e.constraintType=hc(rc(e))||Me)}function ic(e){return e.declaration.nameType?e.nameType||(e.nameType=Rd(dd(e.declaration.nameType),e.mapper)):void 0}function ac(e){return e.templateType||(e.templateType=e.declaration.type?Rd(go(dd(e.declaration.type),!0,!!(4&lc(e))),e.mapper):Me)}function oc(t){return e.getEffectiveConstraintOfTypeParameter(t.declaration.typeParameter)}function sc(e){var t=oc(e);return 192===t.kind&&140===t.operator}function cc(e){if(!e.modifiersType)if(sc(e))e.modifiersType=Rd(dd(oc(e).type),e.mapper);else {var t=nc(I_(e.declaration)),r=t&&262144&t.flags?hc(t):t;e.modifiersType=r&&4194304&r.flags?Rd(r.type,e.mapper):je;}return e.modifiersType}function lc(e){var t=e.declaration;return (t.readonlyToken?40===t.readonlyToken.kind?2:1:0)|(t.questionToken?40===t.questionToken.kind?8:4:0)}function uc(e){var t=lc(e);return 8&t?-1:4&t?1:0}function _c(e){var t=uc(e),r=cc(e);return t||(dc(r)?uc(r):0)}function dc(t){return !!(32&e.getObjectFlags(t))&&D_(nc(t))}function pc(t){return t.members||(524288&t.flags?4&t.objectFlags?function(t){var r=Cs(t.target),n=e.concatenate(r.typeParameters,[r.thisType]),i=zl(t);Rs(t,r,n,i.length===n.length?i:e.concatenate(i,[t]));}(t):3&t.objectFlags?function(t){Rs(t,Cs(t),e.emptyArray,e.emptyArray);}(t):1024&t.objectFlags?function(t){for(var r=Gc(t.source,He),n=lc(t.mappedType),i=!(1&n),a=4&n?0:16777216,o=r?[Nl(He,ig(r.type,t.mappedType,t.constraintType),i&&r.isReadonly)]:e.emptyArray,s=e.createSymbolTable(),c=0,l=yc(t.source);c<l.length;c++){var u=l[c],_=8192|(i&&Db(u)?8:0),d=jn(4|u.flags&a,u.escapedName,_);if(d.declarations=u.declarations,d.nameType=Gn(u).nameType,d.propertyType=Uo(u),8388608&t.constraintType.type.flags&&262144&t.constraintType.type.objectType.flags&&262144&t.constraintType.type.indexType.flags){var p=t.constraintType.type.objectType,f=Zs(t.mappedType,t.constraintType.type,p);d.mappedType=f,d.constraintType=c_(p);}else d.mappedType=t.mappedType,d.constraintType=t.constraintType;s.set(u.escapedName,d);}ma(t,s,e.emptyArray,e.emptyArray,o);}(t):16&t.objectFlags?function(t){var r=Zi(t.symbol);if(t.target)ma(t,k,e.emptyArray,e.emptyArray,e.emptyArray),ma(t,a=Ds(fc(t.target),t.mapper,!1),n=md(Uc(t.target,0),t.mapper),i=md(Uc(t.target,1),t.mapper),o=yd(Hc(t.target),t.mapper));else if(2048&r.flags){ma(t,k,e.emptyArray,e.emptyArray,e.emptyArray);var n=_l((a=Os(r)).get("__call")),i=_l(a.get("__new"));ma(t,a,n,i,o=Fl(r));}else {var a=k,o=void 0;if(r.exports&&(a=Gi(r),r===ce)){var s=new e.Map;a.forEach((function(e){418&e.flags||s.set(e.escapedName,e);})),a=s;}var c=void 0;if(ma(t,a,e.emptyArray,e.emptyArray,e.emptyArray),32&r.flags){var l=rs(ss(r));11272192&l.flags?Ss(a=e.createSymbolTable(function(t){var r=fa(t),n=kl(t);return n?e.concatenate(r,[n]):r}(a)),yc(l)):l===we&&(c=Nl(He,we,!1));}var u=kl(a);if(u?o=Al(u):(c&&(o=e.append(o,c)),384&r.flags&&(32&ms(r).flags||e.some(t.properties,(function(e){return !!(296&Uo(e).flags)})))&&(o=e.append(o,Ar))),ma(t,a,e.emptyArray,e.emptyArray,o||e.emptyArray),8208&r.flags&&(t.callSignatures=_l(r)),32&r.flags){var _=ss(r);i=r.members?_l(r.members.get("__constructor")):e.emptyArray,16&r.flags&&(i=e.addRange(i.slice(),e.mapDefined(t.callSignatures,(function(e){return Fh(e.declaration)?Bs(e.declaration,e.typeParameters,e.thisParameter,e.parameters,_,void 0,e.minArgumentCount,39&e.flags):void 0})))),i.length||(i=function(t){var r=Uc(rs(t),1),n=e.getClassLikeDeclarationOfSymbol(t.symbol),i=!!n&&e.hasSyntacticModifier(n,128);if(0===r.length)return [Bs(void 0,t.localTypeParameters,void 0,e.emptyArray,t,void 0,0,i?4:0)];for(var a=$o(t),o=e.isInJSFile(a),s=iu(a),c=e.length(s),l=[],u=0,_=r;u<_.length;u++){var d=_[u],p=ol(d.typeParameters),f=e.length(d.typeParameters);if(o||c>=p&&c<=f){var g=f?Dl(d,sl(s,d.typeParameters,p,o)):js(d);g.typeParameters=t.localTypeParameters,g.resolvedReturnType=t,g.flags=i?4|g.flags:-5&g.flags,l.push(g);}}return l}(_)),t.constructSignatures=i;}}}(t):32&t.objectFlags&&function(t){var r,n=e.createSymbolTable();ma(t,k,e.emptyArray,e.emptyArray,e.emptyArray);var i=rc(t),a=nc(t),o=ic(t.target||t),s=ac(t.target||t),c=Ac(cc(t)),l=lc(t),u=ee?128:8576;function _(e){nm(o?Rd(o,Ed(t.mapper,i,e)):e,(function(a){return function(e,a){if(Es(a)){var u=Ps(a),_=n.get(u);if(_)_.nameType=qu([_.nameType,a]),_.keyType=qu([_.keyType,e]);else {var d=Es(e)?Jc(c,Ps(e)):void 0,p=!!(4&l||!(8&l)&&d&&16777216&d.flags),f=!!(1&l||!(2&l)&&d&&Db(d)),g=H&&!p&&d&&16777216&d.flags,m=jn(4|(p?16777216:0),u,262144|(d?ec(d):0)|(f?8:0)|(g?524288:0));m.mappedType=t,m.nameType=a,m.keyType=e,d&&(m.syntheticOrigin=d,m.declarations=o?void 0:d.declarations),n.set(u,m);}}else if(Pl(a)||33&a.flags){var y=Nl(5&a.flags?He:40&a.flags?Ge:a,Rd(s,Ed(t.mapper,i,e)),!!(1&l));r=Ys(r,y,!0);}}(e,a)}));}sc(t)?tc(c,u,ee,_):nm($s(a),_),ma(t,n,e.emptyArray,e.emptyArray,r||e.emptyArray);}(t):1048576&t.flags?function(t){var r=qs(e.map(t.types,(function(e){return e===wt?[kr]:Uc(e,0)}))),n=qs(e.map(t.types,(function(e){return Uc(e,1)}))),i=Hs(t.types);ma(t,k,r,n,i);}(t):2097152&t.flags&&function(t){for(var r,n,i,a=t.types,o=Qs(a),s=e.countWhere(o,(function(e){return e})),c=function(c){var l=t.types[c];if(!o[c]){var u=Uc(l,1);u.length&&s>0&&(u=e.map(u,(function(e){var t=js(e);return t.resolvedReturnType=function(e,t,r,n){for(var i=[],a=0;a<t.length;a++)a===n?i.push(e):r[a]&&i.push(ml(Uc(t[a],1)[0]));return $u(i)}(ml(e),a,o,c),t}))),n=Xs(n,u);}r=Xs(r,Uc(l,0)),i=e.reduceLeft(Hc(l),(function(e,t){return Ys(e,t,!1)}),i);},l=0;l<a.length;l++)c(l);ma(t,k,r||e.emptyArray,n||e.emptyArray,i||e.emptyArray);}(t)),t}function fc(t){return 524288&t.flags?pc(t).properties:e.emptyArray}function gc(e,t){if(524288&e.flags){var r=pc(e).members.get(t);if(r&&oa(r))return r}}function mc(t){if(!t.resolvedProperties){for(var r=e.createSymbolTable(),n=0,i=t.types;n<i.length;n++){for(var a=i[n],o=0,s=yc(a);o<s.length;o++){var c=s[o];if(!r.has(c.escapedName)){var l=Oc(t,c.escapedName);l&&r.set(c.escapedName,l);}}if(1048576&t.flags&&0===Hc(a).length)break}t.resolvedProperties=fa(r);}return t.resolvedProperties}function yc(e){return 3145728&(e=Pc(e)).flags?mc(e):fc(e)}function vc(e){return 262144&e.flags?hc(e):8388608&e.flags?function(e){return Ec(e)?function(e){var t=bc(e.indexType);if(t&&t!==e.indexType){var r=P_(e.objectType,t,e.accessFlags);if(r)return r}var n=bc(e.objectType);if(n&&n!==e.objectType)return P_(n,e.indexType,e.accessFlags)}(e):void 0}(e):16777216&e.flags?function(e){return Ec(e)?Sc(e):void 0}(e):Tc(e)}function hc(e){return Ec(e)?Il(e):void 0}function bc(e){var t=C_(e,!1);return t!==e?t:vc(e)}function xc(e){if(!e.resolvedDefaultConstraint){var t=function(e){return e.resolvedInferredTrueType||(e.resolvedInferredTrueType=e.combinedMapper?Rd(dd(e.root.node.trueType),e.combinedMapper):j_(e))}(e),r=J_(e);e.resolvedDefaultConstraint=to(t)?r:to(r)?t:qu([t,r]);}return e.resolvedDefaultConstraint}function Dc(e){if(e.root.isDistributive&&e.restrictiveInstantiation!==e){var t=C_(e.checkType,!1),r=t===e.checkType?vc(t):t;if(r&&r!==e.checkType){var n=Ld(e,Cd(e.root.checkType,r,e.mapper));if(!(131072&n.flags))return n}}}function Sc(e){return Dc(e)||xc(e)}function Tc(e){if(464781312&e.flags){var t=kc(e);return t!==Dt&&t!==St?t:void 0}return 4194304&e.flags?_t:void 0}function Cc(e){return Tc(e)||e}function Ec(e){return kc(e)!==St}function kc(t){if(t.resolvedBaseConstraint)return t.resolvedBaseConstraint;var r=[];return t.resolvedBaseConstraint=Ls(n(t),t);function n(t){if(!t.immediateBaseConstraint){if(!Qa(t,4))return St;var n=void 0;if((r.length<10||r.length<50&&!jp(t,r,r.length))&&(r.push(t),n=function(t){if(262144&t.flags){var r=Il(t);return t.isThisType||!r?r:i(r)}if(3145728&t.flags){for(var n=[],a=!1,o=0,s=u=t.types;o<s.length;o++){var c=s[o],l=i(c);l?(l!==c&&(a=!0),n.push(l)):a=!0;}return a?1048576&t.flags&&n.length===u.length?qu(n):2097152&t.flags&&n.length?$u(n):void 0:t}if(4194304&t.flags)return _t;if(134217728&t.flags){var u=t.types,_=e.mapDefined(u,i);return _.length===u.length?u_(t.texts,_):He}if(268435456&t.flags)return (r=i(t.type))?d_(t.symbol,r):He;if(8388608&t.flags){var d=i(t.objectType),p=i(t.indexType),f=d&&p&&P_(d,p,t.accessFlags);return f&&i(f)}return 16777216&t.flags?(r=Sc(t))&&i(r):33554432&t.flags?i(t.substitute):t}(C_(t,!1)),r.pop()),!Za()){if(262144&t.flags){var a=wl(t);if(a){var o=In(a,e.Diagnostics.Type_parameter_0_has_a_circular_constraint,Ma(t));!_||e.isNodeDescendantOf(a,_)||e.isNodeDescendantOf(_,a)||e.addRelatedInfo(o,e.createDiagnosticForNode(_,e.Diagnostics.Circularity_originates_in_type_at_this_location));}}n=St;}t.immediateBaseConstraint=n||Dt;}return t.immediateBaseConstraint}function i(e){var t=n(e);return t!==Dt&&t!==St?t:void 0}}function Nc(t){if(t.default)t.default===Tt&&(t.default=St);else if(t.target){var r=Nc(t.target);t.default=r?Rd(r,t.mapper):Dt;}else {t.default=Tt;var n=t.symbol&&e.forEach(t.symbol.declarations,(function(t){return e.isTypeParameterDeclaration(t)&&t.default})),i=n?dd(n):Dt;t.default===Tt&&(t.default=i);}return t.default}function Fc(e){var t=Nc(e);return t!==Dt&&t!==St?t:void 0}function Ac(t){var r=465829888&t.flags?Tc(t)||je:t;return 32&e.getObjectFlags(r)?function(e){return e.resolvedApparentType||(e.resolvedApparentType=function(e){var t=Pd(e);if(t&&!e.declaration.nameType){var r=hc(t);if(r&&(qp(r)||_f(r)))return Rd(e,Cd(t,r,e.mapper))}return e}(e))}(r):2097152&r.flags?function(e){return e.resolvedApparentType||(e.resolvedApparentType=Ls(e,e,!0))}(r):402653316&r.flags?Rt:296&r.flags?Bt:2112&r.flags?yr||(yr=_u("BigInt",0,K>=7))||mt:528&r.flags?jt:12288&r.flags?gu(K>=2):67108864&r.flags?mt:4194304&r.flags?_t:2&r.flags&&!H?mt:r}function Pc(e){return Mc(Ac(Mc(e)))}function wc(t,r,n){for(var i,a,o,s,c,l=1048576&t.flags,u=l?0:16777216,_=4,d=l?0:8,p=!1,f=0,g=t.types;f<g.length;f++)if(!(ro(F=Ac(g[f]))||131072&F.flags)){var m=(N=Jc(F,r,n))?e.getDeclarationModifierFlagsFromSymbol(N):0;if(N){if(l?u|=16777216&N.flags:u&=N.flags,o){if(N!==o)if((tS(N)||N)===(tS(o)||o)&&-1===Up(o,N,(function(e,t){return e===t?-1:0})))p=!!o.parent&&!!e.length(Xo(o.parent));else {s||(s=new e.Map).set(M(o),o);var y=M(N);s.has(y)||s.set(y,N);}}else o=N;l&&Db(N)?d|=8:l||Db(N)||(d&=-9),d|=(24&m?0:256)|(16&m?512:0)|(8&m?1024:0)|(32&m?2048:0),ev(N)||(_=2);}else if(l){var v=!Ns(r)&&Zc(F,r);v?(d|=32|(v.isReadonly?8:0),c=e.append(c,_f(F)?ff(F)||ze:v.type)):!yg(F)||4194304&e.getObjectFlags(F)?d|=16:(d|=32,c=e.append(c,ze));}}if(o&&!(l&&(s||48&d)&&1536&d)){if(!(s||16&d||c)){if(p){var h=wf(o,o.type);return h.parent=null===(a=null===(i=o.valueDeclaration)||void 0===i?void 0:i.symbol)||void 0===a?void 0:a.parent,h.containingType=t,h.mapper=o.mapper,h}return o}for(var b,x,D,S,T=[],C=!1,E=0,k=s?e.arrayFrom(s.values()):[o];E<k.length;E++){var N=k[E];S?N.valueDeclaration&&N.valueDeclaration!==S&&(C=!0):S=N.valueDeclaration,b=e.addRange(b,N.declarations);var F=Uo(N);x?F!==x&&(d|=64):(x=F,D=Gn(N).nameType),(af(F)||h_(F))&&(d|=128),131072&F.flags&&(d|=131072),T.push(F);}e.addRange(T,c);var A=jn(4|u,r,_|d);return A.containingType=t,!C&&S&&(A.valueDeclaration=S,S.symbol.parent&&(A.parent=S.symbol.parent)),A.declarations=b,A.nameType=D,T.length>2?(A.checkFlags|=65536,A.deferralParent=t,A.deferralConstituents=T):A.type=l?qu(T):$u(T),A}}function Ic(t,r,n){var i,a,o=(null===(i=t.propertyCacheWithoutObjectFunctionPropertyAugment)||void 0===i?void 0:i.get(r))||!n?null===(a=t.propertyCache)||void 0===a?void 0:a.get(r):void 0;return o||(o=wc(t,r,n))&&(n?t.propertyCacheWithoutObjectFunctionPropertyAugment||(t.propertyCacheWithoutObjectFunctionPropertyAugment=e.createSymbolTable()):t.propertyCache||(t.propertyCache=e.createSymbolTable())).set(r,o),o}function Oc(t,r,n){var i=Ic(t,r,n);return !i||16&e.getCheckFlags(i)?void 0:i}function Mc(t){return 1048576&t.flags&&33554432&t.objectFlags?t.resolvedReducedType||(t.resolvedReducedType=function(t){var r=e.sameMap(t.types,Mc);if(r===t.types)return t;var n=qu(r);return 1048576&n.flags&&(n.resolvedReducedType=n),n}(t)):2097152&t.flags?(33554432&t.objectFlags||(t.objectFlags|=33554432|(e.some(mc(t),Lc)?67108864:0)),67108864&t.objectFlags?nt:t):t}function Lc(e){return Rc(e)||Bc(e)}function Rc(t){return !(16777216&t.flags||192!=(131264&e.getCheckFlags(t))||!(131072&Uo(t).flags))}function Bc(t){return !t.valueDeclaration&&!!(1024&e.getCheckFlags(t))}function jc(t,r){if(2097152&r.flags&&67108864&e.getObjectFlags(r)){var n=e.find(mc(r),Rc);if(n)return e.chainDiagnosticMessages(t,e.Diagnostics.The_intersection_0_was_reduced_to_never_because_property_1_has_conflicting_types_in_some_constituents,Ma(r,void 0,536870912),Ia(n));var i=e.find(mc(r),Bc);if(i)return e.chainDiagnosticMessages(t,e.Diagnostics.The_intersection_0_was_reduced_to_never_because_property_1_exists_in_multiple_constituents_and_is_private_in_some,Ma(r,void 0,536870912),Ia(i))}return t}function Jc(e,t,r){if(524288&(e=Pc(e)).flags){var n=pc(e),i=n.members.get(t);if(i&&oa(i))return i;if(r)return;var a=n===xt?wt:n.callSignatures.length?It:n.constructSignatures.length?Ot:void 0;if(a){var o=gc(a,t);if(o)return o}return gc(Pt,t)}if(3145728&e.flags)return Oc(e,t,r)}function zc(t,r){if(3670016&t.flags){var n=pc(t);return 0===r?n.callSignatures:n.constructSignatures}return e.emptyArray}function Uc(e,t){return zc(Pc(e),t)}function Kc(t,r){return e.find(t,(function(e){return e.keyType===r}))}function Vc(t,r){for(var n,i,a,o=0,s=t;o<s.length;o++){var c=s[o];c.keyType===He?n=c:qc(r,c.keyType)&&(i?(a||(a=[i])).push(c):i=c);}return a?Nl(je,$u(e.map(a,(function(e){return e.type}))),e.reduceLeft(a,(function(e,t){return e&&t.isReadonly}),!0)):i||(n&&qc(r,He)?n:void 0)}function qc(e,t){return Yd(e,t)||t===He&&Yd(e,Ge)||t===Ge&&!!(128&e.flags)&&ky(e.value)}function Wc(t){return 3670016&t.flags?pc(t).indexInfos:e.emptyArray}function Hc(e){return Wc(Pc(e))}function Gc(e,t){return Kc(Hc(e),t)}function Qc(e,t){var r;return null===(r=Gc(e,t))||void 0===r?void 0:r.type}function Xc(e,t){return Hc(e).filter((function(e){return qc(t,e.keyType)}))}function Yc(e,t){return Vc(Hc(e),t)}function Zc(t,r){return Yc(t,Ns(r)?tt:id(e.unescapeLeadingUnderscores(r)))}function $c(t){for(var r,n=0,i=e.getEffectiveTypeParameterDeclarations(t);n<i.length;n++){var a=i[n];r=e.appendIfUnique(r,gs(a.symbol));}return r}function el(e){var t=[];return e.forEach((function(e,r){pa(r)||t.push(e);})),t}function tl(t){return e.isInJSFile(t)&&(t.type&&314===t.type.kind||e.getJSDocParameterTags(t).some((function(e){var t=e.isBracketed,r=e.typeExpression;return t||!!r&&314===r.type.kind})))}function rl(t,r){if(!e.isExternalModuleNameRelative(t)){var n=Yn(oe,'"'+t+'"',512);return n&&r?Zi(n):n}}function nl(t){if(e.hasQuestionToken(t)||il(t)||tl(t))return !0;if(t.initializer){var r=cl(t.parent),n=t.parent.parameters.indexOf(t);return e.Debug.assert(n>=0),n>=$h(r,3)}var i=e.getImmediatelyInvokedFunctionExpression(t.parent);return !!i&&!t.type&&!t.dotDotDotToken&&t.parent.parameters.indexOf(t)>=i.arguments.length}function il(t){if(!e.isJSDocPropertyLikeTag(t))return !1;var r=t.isBracketed,n=t.typeExpression;return r||!!n&&314===n.type.kind}function al(e,t,r,n){return {kind:e,parameterName:t,parameterIndex:r,type:n}}function ol(t){var r,n=0;if(t)for(var i=0;i<t.length;i++)(r=t[i]).symbol&&e.forEach(r.symbol.declarations,(function(t){return e.isTypeParameterDeclaration(t)&&t.default}))||(n=i+1);return n}function sl(t,r,n,i){var a=e.length(r);if(!a)return [];var o=e.length(t);if(i||o>=n&&o<=a){for(var s=t?t.slice():[],c=o;c<a;c++)s[c]=Me;var l=bg(i);for(c=o;c<a;c++){var u=Fc(r[c]);i&&u&&(Wd(u,je)||Wd(u,mt))&&(u=we),s[c]=u?Rd(u,vd(r,s)):l;}return s.length=r.length,s}return t&&t.slice()}function cl(t){var r,n=Qn(t);if(!n.resolvedSignature){var i=[],a=0,o=0,s=void 0,c=!1,l=e.getImmediatelyInvokedFunctionExpression(t),u=e.isJSDocConstructSignature(t);!l&&e.isInJSFile(t)&&e.isValueSignatureDeclaration(t)&&!e.hasJSDocParameterTags(t)&&!e.getJSDocType(t)&&(a|=32);for(var _=u?1:0;_<t.parameters.length;_++){var d=t.parameters[_],p=d.symbol,f=e.isJSDocParameterTag(d)?d.typeExpression&&d.typeExpression.type:d.type;p&&4&p.flags&&!e.isBindingPattern(d.name)&&(p=ei(d,p.escapedName,111551,void 0,void 0,!1)),0===_&&"this"===p.escapedName?(c=!0,s=d.symbol):i.push(p),f&&195===f.kind&&(a|=2),il(d)||d.initializer||d.questionToken||e.isRestParameter(d)||l&&i.length>l.arguments.length&&!f||tl(d)||(o=i.length);}if((171===t.kind||172===t.kind)&&As(t)&&(!c||!s)){var g=171===t.kind?172:171,m=e.getDeclarationOfKind($i(t),g);m&&(s=(r=jT(m))&&r.symbol);}var y=170===t.kind?ss(Zi(t.parent.symbol)):void 0,v=y?y.localTypeParameters:$c(t);(e.hasRestParameter(t)||e.isInJSFile(t)&&function(t,r){if(e.isJSDocSignature(t)||!ul(t))return !1;var n=e.lastOrUndefined(t.parameters),i=n?e.getJSDocParameterTags(n):e.getJSDocTags(t).filter(e.isJSDocParameterTag),a=e.firstDefined(i,(function(t){return t.typeExpression&&e.isJSDocVariadicType(t.typeExpression.type)?t.typeExpression.type:void 0})),o=jn(3,"args",32768);return o.type=a?Tu(dd(a.type)):Ut,a&&r.pop(),r.push(o),!0}(t,i))&&(a|=1),(e.isConstructorTypeNode(t)&&e.hasSyntacticModifier(t,128)||e.isConstructorDeclaration(t)&&e.hasSyntacticModifier(t.parent,128))&&(a|=4),n.resolvedSignature=Bs(t,v,s,i,void 0,void 0,o,a);}return n.resolvedSignature}function ll(t){if(e.isInJSFile(t)&&e.isFunctionLikeDeclaration(t)){var r=e.getJSDocTypeTag(t);return (null==r?void 0:r.typeExpression)&&Qv(dd(r.typeExpression))}}function ul(t){var r=Qn(t);return void 0===r.containsArgumentsReference&&(8192&r.flags?r.containsArgumentsReference=!0:r.containsArgumentsReference=function t(r){if(!r)return !1;switch(r.kind){case 79:return r.escapedText===ue.escapedName&&mT(r)===ue;case 166:case 168:case 171:case 172:return 161===r.name.kind&&t(r.name);case 205:case 206:return t(r.expression);default:return !e.nodeStartsNewLexicalEnvironment(r)&&!e.isPartOfTypeNode(r)&&!!e.forEachChild(r,t)}}(t.body)),r.containsArgumentsReference}function _l(t){if(!t||!t.declarations)return e.emptyArray;for(var r=[],n=0;n<t.declarations.length;n++){var i=t.declarations[n];if(e.isFunctionLike(i)){if(n>0&&i.body){var a=t.declarations[n-1];if(i.parent===a.parent&&i.kind===a.kind&&i.pos===a.end)continue}r.push(cl(i));}}return r}function dl(e){var t=Ri(e,e);if(t){var r=zi(t);if(r)return Uo(r)}return we}function pl(e){if(e.thisParameter)return Uo(e.thisParameter)}function fl(t){if(!t.resolvedTypePredicate){if(t.target){var r=fl(t.target);t.resolvedTypePredicate=r?(o=r,s=t.mapper,al(o.kind,o.parameterName,o.parameterIndex,Rd(o.type,s))):Cr;}else if(t.compositeSignatures)t.resolvedTypePredicate=function(e,t){for(var r,n=[],i=0,a=e;i<a.length;i++){var o=fl(a[i]);if(!o||2===o.kind||3===o.kind){if(2097152!==t)continue;return}if(r){if(!Wu(r,o))return}else r=o;n.push(o.type);}if(r){var s=gl(n,t);return al(r.kind,r.parameterName,r.parameterIndex,s)}}(t.compositeSignatures,t.compositeKind)||Cr;else {var n=t.declaration&&e.getEffectiveReturnTypeNode(t.declaration),i=void 0;if(!n&&e.isInJSFile(t.declaration)){var a=ll(t.declaration);a&&t!==a&&(i=fl(a));}t.resolvedTypePredicate=n&&e.isTypePredicateNode(n)?function(t,r){var n=t.parameterName,i=t.type&&dd(t.type);return 191===n.kind?al(t.assertsModifier?2:0,void 0,void 0,i):al(t.assertsModifier?3:1,n.escapedText,e.findIndex(r.parameters,(function(e){return e.escapedName===n.escapedText})),i)}(n,t):i||Cr;}e.Debug.assert(!!t.resolvedTypePredicate);}var o,s;return t.resolvedTypePredicate===Cr?void 0:t.resolvedTypePredicate}function gl(e,t,r){return 2097152!==t?qu(e,r):$u(e)}function ml(t){if(!t.resolvedReturnType){if(!Qa(t,3))return Me;var r=t.target?Rd(ml(t.target),t.mapper):t.compositeSignatures?Rd(gl(e.map(t.compositeSignatures,ml),t.compositeKind,2),t.mapper):yl(t.declaration)||(e.nodeIsMissing(t.declaration.body)?we:_b(t.declaration));if(8&t.flags?r=Tf(r):16&t.flags&&(r=Df(r)),!Za()){if(t.declaration){var n=e.getEffectiveReturnTypeNode(t.declaration);if(n)In(n,e.Diagnostics.Return_type_annotation_circularly_references_itself);else if(Y){var i=t.declaration,a=e.getNameOfDeclaration(i);a?In(a,e.Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions,e.declarationNameToString(a)):In(i,e.Diagnostics.Function_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions);}}r=we;}t.resolvedReturnType=r;}return t.resolvedReturnType}function yl(t){if(170===t.kind)return ss(Zi(t.parent.symbol));if(e.isJSDocConstructSignature(t))return dd(t.parameters[0].type);var r,n=e.getEffectiveReturnTypeNode(t);if(n)return dd(n);if(171===t.kind&&As(t)){var i=e.isInJSFile(t)&&po(t);if(i)return i;var a=Oo(e.getDeclarationOfKind($i(t),172));if(a)return a}return (r=ll(t))&&ml(r)}function vl(e){return !e.resolvedReturnType&&Xa(e,3)>=0}function hl(e){if(J(e)){var t=Uo(e.parameters[e.parameters.length-1]),r=_f(t)?ff(t):t;return r&&Qc(r,Ge)}}function bl(e,t,r,n){var i=xl(e,sl(t,e.typeParameters,ol(e.typeParameters),r));if(n){var a=Xv(ml(i));if(a){var o=js(a);o.typeParameters=n;var s=js(i);return s.resolvedReturnType=Cl(o),s}}return i}function xl(t,r){var n=t.instantiations||(t.instantiations=new e.Map),i=Ml(r),a=n.get(i);return a||n.set(i,a=Dl(t,r)),a}function Dl(e,t){return Nd(e,function(e,t){return vd(e.typeParameters,t)}(e,t),!0)}function Sl(e){return e.typeParameters?e.erasedSignatureCache||(e.erasedSignatureCache=function(e){return Nd(e,Sd(e.typeParameters),!0)}(e)):e}function Tl(t){var r=t.typeParameters;if(r){if(t.baseSignatureCache)return t.baseSignatureCache;for(var n=Sd(r),i=vd(r,e.map(r,(function(e){return hc(e)||je}))),a=e.map(r,(function(e){return Rd(e,i)||je})),o=0;o<r.length-1;o++)a=gd(a,i);return a=gd(a,n),t.baseSignatureCache=Nd(t,vd(r,a),!0)}return t}function Cl(t){if(!t.isolatedSignatureType){var r=t.declaration?t.declaration.kind:0,n=170===r||174===r||179===r,i=_a(16);i.members=k,i.properties=e.emptyArray,i.callSignatures=n?e.emptyArray:[t],i.constructSignatures=n?[t]:e.emptyArray,i.indexInfos=e.emptyArray,t.isolatedSignatureType=i;}return t.isolatedSignatureType}function El(e){return e.members?kl(e.members):void 0}function kl(e){return e.get("__index")}function Nl(e,t,r,n){return {keyType:e,type:t,isReadonly:r,declaration:n}}function Fl(t){var r=El(t);return r?Al(r):e.emptyArray}function Al(t){if(t.declarations){for(var r=[],n=function(t){if(1===t.parameters.length){var n=t.parameters[0];n.type&&nm(dd(n.type),(function(n){Pl(n)&&!Kc(r,n)&&r.push(Nl(n,t.type?dd(t.type):we,e.hasEffectiveModifier(t,64),t));}));}},i=0,a=t.declarations;i<a.length;i++)n(a[i]);return r}return e.emptyArray}function Pl(t){return !!(4108&t.flags)||h_(t)||!!(2097152&t.flags)&&!b_(t)&&e.some(t.types,Pl)}function wl(t){return e.mapDefined(e.filter(t.symbol&&t.symbol.declarations,e.isTypeParameterDeclaration),e.getEffectiveConstraintOfTypeParameter)[0]}function Il(t){if(!t.constraint)if(t.target){var r=hc(t.target);t.constraint=r?Rd(r,t.mapper):Dt;}else {var n=wl(t);if(n){var i=dd(n);1&i.flags&&!ro(i)&&(i=194===n.parent.parent.kind?_t:je),t.constraint=i;}else t.constraint=function(t){var r,n;if(null===(r=t.symbol)||void 0===r?void 0:r.declarations)for(var i=0,a=t.symbol.declarations;i<a.length;i++){var o=a[i];if(189===o.parent.kind){var s=e.walkUpParenthesizedTypesAndGetParentAndChild(o.parent.parent),c=s[0],l=void 0===c?o.parent:c,u=s[1];if(177===u.kind){var _=u,d=yx(_);if(d){var p=_.typeArguments.indexOf(l);if(p<d.length){var f=hc(d[p]);if(f){var g=Rd(f,vd(d,gx(_,d)));g!==t&&(n=e.append(n,g));}}}}else if(163===u.kind&&u.dotDotDotToken||185===u.kind||196===u.kind&&u.dotDotDotToken)n=e.append(n,Tu(je));else if(198===u.kind)n=e.append(n,He);else if(162===u.kind&&194===u.parent.kind)n=e.append(n,_t);else if(194===u.kind&&u.type&&e.skipParentheses(u.type)===o.parent&&188===u.parent.kind&&u.parent.extendsType===u&&194===u.parent.checkType.kind&&u.parent.checkType.type){var m=u.parent.checkType,y=dd(m.type);n=e.append(n,Rd(y,bd(gs($i(m.typeParameter)),m.typeParameter.constraint?dd(m.typeParameter.constraint):_t)));}}}return n&&$u(n)}(t)||Dt;}return t.constraint===Dt?void 0:t.constraint}function Ol(t){var r=e.getDeclarationOfKind(t.symbol,162),n=e.isJSDocTemplateTag(r.parent)?e.getEffectiveContainerForJSDocTemplateTag(r.parent):r.parent;return n&&$i(n)}function Ml(e){var t="";if(e)for(var r=e.length,n=0;n<r;){for(var i=e[n].id,a=1;n+a<r&&e[n+a].id===i+a;)a++;t.length&&(t+=","),t+=i,a>1&&(t+=":"+a),n+=a;}return t}function Ll(e,t){return e?"@".concat(M(e))+(t?":".concat(Ml(t)):""):""}function Rl(t,r){for(var n=0,i=0,a=t;i<a.length;i++){var o=a[i];o.flags&r||(n|=e.getObjectFlags(o));}return 917504&n}function Bl(e,t){var r=Ml(t),n=e.instantiations.get(r);return n||(n=_a(4,e.symbol),e.instantiations.set(r,n),n.objectFlags|=t?Rl(t,0):0,n.target=e,n.resolvedTypeArguments=t),n}function jl(e){var t=ca(e.flags);return t.symbol=e.symbol,t.objectFlags=e.objectFlags,t.target=e.target,t.resolvedTypeArguments=e.resolvedTypeArguments,t}function Jl(e,t,r,n,i){if(!n){var a=H_(n=W_(t));i=r?gd(a,r):a;}var o=_a(4,e.symbol);return o.target=e,o.node=t,o.mapper=r,o.aliasSymbol=n,o.aliasTypeArguments=i,o}function zl(t){var r,n;if(!t.resolvedTypeArguments){if(!Qa(t,6))return (null===(r=t.target.localTypeParameters)||void 0===r?void 0:r.map((function(){return Me})))||e.emptyArray;var i=t.node,a=i?177===i.kind?e.concatenate(t.target.outerTypeParameters,gx(i,t.target.localTypeParameters)):182===i.kind?[dd(i.elementType)]:e.map(i.elements,dd):e.emptyArray;Za()?t.resolvedTypeArguments=t.mapper?gd(a,t.mapper):a:(t.resolvedTypeArguments=(null===(n=t.target.localTypeParameters)||void 0===n?void 0:n.map((function(){return Me})))||e.emptyArray,In(t.node||_,t.target.symbol?e.Diagnostics.Type_arguments_for_0_circularly_reference_themselves:e.Diagnostics.Tuple_type_arguments_circularly_reference_themselves,t.target.symbol&&Ia(t.target.symbol)));}return t.resolvedTypeArguments}function Ul(t){return e.length(t.target.typeParameters)}function Kl(t,r){var n=ms(Zi(r)),i=n.localTypeParameters;if(i){var a=e.length(t.typeArguments),o=ol(i),s=e.isInJSFile(t);if((Y||!s)&&(a<o||a>i.length)){var c=s&&e.isExpressionWithTypeArguments(t)&&!e.isJSDocAugmentsTag(t.parent);if(In(t,o===i.length?c?e.Diagnostics.Expected_0_type_arguments_provide_these_with_an_extends_tag:e.Diagnostics.Generic_type_0_requires_1_type_argument_s:c?e.Diagnostics.Expected_0_1_type_arguments_provide_these_with_an_extends_tag:e.Diagnostics.Generic_type_0_requires_between_1_and_2_type_arguments,Ma(n,void 0,2),o,i.length),!s)return Me}return 177===t.kind&&ku(t,e.length(t.typeArguments)!==i.length)?Jl(n,t,void 0):Bl(n,e.concatenate(n.outerTypeParameters,sl(iu(t),i,o,s)))}return tu(t,r)?n:Me}function Vl(t,r,n,i){var a=ms(t);if(a===Be&&P.has(t.escapedName)&&r&&1===r.length)return d_(t,r[0]);var o=Gn(t),s=o.typeParameters,c=Ml(r)+Ll(n,i),l=o.instantiations.get(c);return l||o.instantiations.set(c,l=Bd(a,vd(s,sl(r,s,ol(s),e.isInJSFile(t.valueDeclaration))),n,i)),l}function ql(t){var r,n=null===(r=t.declarations)||void 0===r?void 0:r.find(e.isTypeAlias);return !(!n||!e.getContainingFunction(n))}function Wl(e){return e.parent?"".concat(Wl(e.parent),".").concat(e.escapedName):e.escapedName}function Hl(e){var t=(160===e.kind?e.right:205===e.kind?e.name:e).escapedText;if(t){var r=160===e.kind?Hl(e.left):205===e.kind?Hl(e.expression):void 0,n=r?"".concat(Wl(r),".").concat(t):t,i=Ae.get(n);return i||(Ae.set(n,i=jn(524288,t,1048576)),i.parent=r,i.declaredType=Le),i}return Ne}function Gl(t,r,n){var i=function(t){switch(t.kind){case 177:return t.typeName;case 227:var r=t.expression;if(e.isEntityNameExpression(r))return r}}(t);if(!i)return Ne;var a=Mi(i,r,n);return a&&a!==Ne?a:n?Ne:Hl(i)}function Ql(t,r){if(r===Ne)return Me;if(96&(r=function(t){var r=t.valueDeclaration;if(r&&e.isInJSFile(r)&&!(524288&t.flags)&&!e.getExpandoInitializer(r,!1)){var n=e.isVariableDeclaration(r)?e.getDeclaredExpandoInitializer(r):e.getAssignedExpandoInitializer(r);if(n){var i=$i(n);if(i)return Ah(i,t)}}}(r)||r).flags)return Kl(t,r);if(524288&r.flags)return function(t,r){if(1048576&e.getCheckFlags(r)){var n=iu(t),i=Ll(r,n),a=Pe.get(i);return a||((a=ua(1,"error")).aliasSymbol=r,a.aliasTypeArguments=n,Pe.set(i,a)),a}var o=ms(r),s=Gn(r).typeParameters;if(s){var c=e.length(t.typeArguments),l=ol(s);if(c<l||c>s.length)return In(t,l===s.length?e.Diagnostics.Generic_type_0_requires_1_type_argument_s:e.Diagnostics.Generic_type_0_requires_between_1_and_2_type_arguments,Ia(r),l,s.length),Me;var u=W_(t),_=!u||!ql(r)&&ql(u)?void 0:u;return Vl(r,iu(t),_,H_(_))}return tu(t,r)?o:Me}(t,r);var n=ys(r);return n?tu(t,r)?rd(n):Me:111551&r.flags&&eu(t)?function(e,t){var r=Qn(e);if(!r.resolvedJSDocType){var n=Uo(t),i=n;if(t.valueDeclaration){var a=199===e.kind&&e.qualifier;n.symbol&&n.symbol!==t&&a&&(i=Ql(e,n.symbol));}r.resolvedJSDocType=i;}return r.resolvedJSDocType}(t,r)||(Gl(t,788968),Uo(r)):Me}function Xl(e,t){if(3&t.flags||t===e)return e;var r="".concat(Bu(e),">").concat(Bu(t)),n=Te.get(r);if(n)return n;var i=ca(33554432);return i.baseType=e,i.substitute=t,Te.set(r,i),i}function Yl(e){return 183===e.kind&&1===e.elements.length}function Zl(e,t,r){return Yl(t)&&Yl(r)?Zl(e,t.elements[0],r.elements[0]):O_(dd(t))===e?dd(r):void 0}function $l(t,r){for(var n,i=!0;r&&!e.isStatement(r)&&318!==r.kind;){var a=r.parent;if(163===a.kind&&(i=!i),(i||8650752&t.flags)&&188===a.kind&&r===a.trueType){var o=Zl(t,a.checkType,a.extendsType);o&&(n=e.append(n,o));}r=a;}return n?Xl(t,$u(e.append(n,t))):t}function eu(e){return !!(4194304&e.flags)&&(177===e.kind||199===e.kind)}function tu(t,r){return !t.typeArguments||(In(t,e.Diagnostics.Type_0_is_not_generic,r?Ia(r):t.typeName?e.declarationNameToString(t.typeName):l),!1)}function ru(t){if(e.isIdentifier(t.typeName)){var r=t.typeArguments;switch(t.typeName.escapedText){case"String":return tu(t),He;case"Number":return tu(t),Ge;case"Boolean":return tu(t),et;case"Void":return tu(t),rt;case"Undefined":return tu(t),ze;case"Null":return tu(t),qe;case"Function":case"function":return tu(t),wt;case"array":return r&&r.length||Y?void 0:Ut;case"promise":return r&&r.length||Y?void 0:cb(we);case"Object":if(r&&2===r.length){if(e.isJSDocIndexSignature(t)){var n=dd(r[0]),i=dd(r[1]),a=n===He||n===Ge?[Nl(n,i,!1)]:e.emptyArray;return ya(void 0,k,e.emptyArray,e.emptyArray,a)}return we}return tu(t),Y?void 0:we}}}function nu(t){var r=Qn(t);if(!r.resolvedType){if(e.isConstTypeReference(t)&&e.isAssertionExpression(t.parent))return r.resolvedSymbol=Ne,r.resolvedType=zb(t.parent.expression);var n=void 0,i=void 0,a=788968;eu(t)&&((i=ru(t))||((n=Gl(t,a,!0))===Ne?n=Gl(t,900095):Gl(t,a),i=Ql(t,n))),i||(i=Ql(t,n=Gl(t,a))),r.resolvedSymbol=n,r.resolvedType=i;}return r.resolvedType}function iu(t){return e.map(t.typeArguments,dd)}function au(t){var r=Qn(t);if(!r.resolvedType){var n=e.isThisIdentifier(t.exprName)?Wm(t.exprName):ax(t.exprName);r.resolvedType=rd(jf(n));}return r.resolvedType}function ou(t,r){function n(e){var t=e.declarations;if(t)for(var r=0,n=t;r<n.length;r++){var i=n[r];switch(i.kind){case 256:case 257:case 259:return i}}}if(!t)return r?bt:mt;var i=ms(t);return 524288&i.flags?e.length(i.typeParameters)!==r?(In(n(t),e.Diagnostics.Global_type_0_must_have_1_type_parameter_s,e.symbolName(t),r),r?bt:mt):i:(In(n(t),e.Diagnostics.Global_type_0_must_be_a_class_or_interface_type,e.symbolName(t)),r?bt:mt)}function su(t,r){return uu(t,111551,r?e.Diagnostics.Cannot_find_global_value_0:void 0)}function cu(t,r){return uu(t,788968,r?e.Diagnostics.Cannot_find_global_type_0:void 0)}function lu(t,r,n){var i=uu(t,788968,n?e.Diagnostics.Cannot_find_global_type_0:void 0);if(!i||(ms(i),e.length(Gn(i).typeParameters)===r))return i;In(i.declarations&&e.find(i.declarations,e.isTypeAliasDeclaration),e.Diagnostics.Global_type_0_must_have_1_type_parameter_s,e.symbolName(i),r);}function uu(e,t,r){return ei(void 0,e,t,r,e,!1,!1,!1)}function _u(e,t,r){var n=cu(e,r);return n||r?ou(n,t):void 0}function du(){return _r||(_r=_u("ImportMeta",0,!0)||mt)}function pu(e){return pr||(pr=_u("ImportCallOptions",0,e))||mt}function fu(e){return Wt||(Wt=su("Symbol",e))}function gu(e){return Gt||(Gt=_u("Symbol",0,e))||mt}function mu(e){return Xt||(Xt=_u("Promise",1,e))||bt}function yu(e){return Yt||(Yt=_u("PromiseLike",1,e))||bt}function vu(e){return Zt||(Zt=su("Promise",e))}function hu(e){return er||(er=_u("Iterable",1,e))||bt}function bu(e,t){void 0===t&&(t=0);var r=uu(e,788968,void 0);return r&&ou(r,t)}function xu(e){return mr||(mr=lu("Awaited",1,e)||(e?Ne:void 0)),mr===Ne?void 0:mr}function Du(e,t){return e!==bt?Bl(e,t):mt}function Su(e){return Du(Qt||(Qt=_u("TypedPropertyDescriptor",1,!0)||bt),[e])}function Tu(e,t){return Du(t?Lt:Mt,[e])}function Cu(e){switch(e.kind){case 184:return 2;case 185:return Eu(e);case 196:return e.questionToken?2:e.dotDotDotToken?Eu(e):1;default:return 1}}function Eu(e){return _d(e.type)?4:8}function ku(t,r){return !!W_(t)||Nu(t)&&(182===t.kind?Fu(t.elementType):183===t.kind?e.some(t.elements,Fu):r||e.some(t.typeArguments,Fu))}function Nu(e){var t=e.parent;switch(t.kind){case 190:case 196:case 177:case 186:case 187:case 193:case 188:case 192:case 182:case 183:return Nu(t);case 258:return !0}return !1}function Fu(t){switch(t.kind){case 177:return eu(t)||!!(524288&Gl(t,788968).flags);case 180:return !0;case 192:return 153!==t.operator&&Fu(t.type);case 190:case 184:case 196:case 314:case 312:case 313:case 307:return Fu(t.type);case 185:return 182!==t.type.kind||Fu(t.type.elementType);case 186:case 187:return e.some(t.types,Fu);case 193:return Fu(t.objectType)||Fu(t.indexType);case 188:return Fu(t.checkType)||Fu(t.extendsType)||Fu(t.trueType)||Fu(t.falseType)}return !1}function Au(t,r,n,i){void 0===n&&(n=!1);var a=Pu(r||e.map(t,(function(e){return 1})),n,i);return a===bt?mt:t.length?wu(a,t):a}function Pu(t,r,n){if(1===t.length&&4&t[0])return r?Lt:Mt;var i=e.map(t,(function(e){return 1&e?"#":2&e?"?":4&e?".":"*"})).join()+(r?"R":"")+(n&&n.length?","+e.map(n,O).join(","):""),a=fe.get(i);return a||fe.set(i,a=function(t,r,n){var i,a=t.length,o=e.countWhere(t,(function(e){return !!(9&e)})),s=[],c=0;if(a){i=new Array(a);for(var l=0;l<a;l++){var u=i[l]=da(),_=t[l];if(!(12&(c|=_))){var d=jn(4|(2&_?16777216:0),""+l,r?8:0);d.tupleLabelDeclaration=null==n?void 0:n[l],d.type=u,s.push(d);}}}var p=s.length,f=jn(4,"length");if(12&c)f.type=Ge;else {var g=[];for(l=o;l<=a;l++)g.push(ad(l));f.type=qu(g);}s.push(f);var m=_a(12);return m.typeParameters=i,m.outerTypeParameters=void 0,m.localTypeParameters=i,m.instantiations=new e.Map,m.instantiations.set(Ml(m.typeParameters),m),m.target=m,m.resolvedTypeArguments=m.typeParameters,m.thisType=da(),m.thisType.isThisType=!0,m.thisType.constraint=m,m.declaredProperties=s,m.declaredCallSignatures=e.emptyArray,m.declaredConstructSignatures=e.emptyArray,m.declaredIndexInfos=e.emptyArray,m.elementFlags=t,m.minLength=o,m.fixedLength=p,m.hasRestElement=!!(12&c),m.combinedFlags=c,m.readonly=r,m.labeledElementDeclarations=n,m}(t,r,n)),a}function wu(e,t){return 8&e.objectFlags?Iu(e,t):Bl(e,t)}function Iu(t,r){var n,i,a;if(!(14&t.combinedFlags))return Bl(t,r);if(8&t.combinedFlags){var o=e.findIndex(r,(function(e,r){return !!(8&t.elementFlags[r]&&1179648&e.flags)}));if(o>=0)return t_(e.map(r,(function(e,r){return 8&t.elementFlags[r]?e:je})))?lm(r[o],(function(n){return Iu(t,e.replaceElement(r,o,n))})):Me}for(var s=[],c=[],l=[],u=-1,d=-1,p=-1,f=function(o){var c=r[o],l=t.elementFlags[o];if(8&l)if(58982400&c.flags||dc(c))v(c,8,null===(n=t.labeledElementDeclarations)||void 0===n?void 0:n[o]);else if(_f(c)){var u=zl(c);if(u.length+s.length>=1e4)return In(_,e.isPartOfTypeNode(_)?e.Diagnostics.Type_produces_a_tuple_type_that_is_too_large_to_represent:e.Diagnostics.Expression_produces_a_tuple_type_that_is_too_large_to_represent),{value:Me};e.forEach(u,(function(e,t){var r;return v(e,c.target.elementFlags[t],null===(r=c.target.labeledElementDeclarations)||void 0===r?void 0:r[t])}));}else v(Qp(c)&&Qc(c,Ge)||Me,4,null===(i=t.labeledElementDeclarations)||void 0===i?void 0:i[o]);else v(c,l,null===(a=t.labeledElementDeclarations)||void 0===a?void 0:a[o]);},g=0;g<r.length;g++){var m=f(g);if("object"==typeof m)return m.value}for(g=0;g<u;g++)2&c[g]&&(c[g]=1);d>=0&&d<p&&(s[d]=qu(e.sameMap(s.slice(d,p+1),(function(e,t){return 8&c[d+t]?F_(e,Ge):e}))),s.splice(d+1,p-d),c.splice(d+1,p-d),null==l||l.splice(d+1,p-d));var y=Pu(c,t.readonly,l);return y===bt?mt:c.length?Bl(y,s):y;function v(e,t,r){1&t&&(u=c.length),4&t&&d<0&&(d=c.length),6&t&&(p=c.length),s.push(e),c.push(t),l&&r?l.push(r):l=void 0;}}function Ou(t,r,n){void 0===n&&(n=0);var i=t.target,a=Ul(t)-n;return r>i.fixedLength?function(e){var t=ff(e);return t&&Tu(t)}(t)||Au(e.emptyArray):Au(zl(t).slice(r,a),i.elementFlags.slice(r,a),!1,i.labeledElementDeclarations&&i.labeledElementDeclarations.slice(r,a))}function Mu(t){return qu(e.append(e.arrayOf(t.target.fixedLength,(function(e){return id(""+e)})),c_(t.target.readonly?Lt:Mt)))}function Lu(t,r){var n=e.findIndex(t.elementFlags,(function(e){return !(e&r)}));return n>=0?n:t.elementFlags.length}function Ru(t,r){return t.elementFlags.length-e.findLastIndex(t.elementFlags,(function(e){return !(e&r)}))-1}function Bu(e){return e.id}function ju(t,r){return e.binarySearch(t,r,Bu,e.compareValues)>=0}function Ju(t,r){var n=e.binarySearch(t,r,Bu,e.compareValues);return n<0&&(t.splice(~n,0,r),!0)}function zu(t,r,n){var i=n.flags;if(1048576&i)return Uu(t,r|(function(e){return !!(1048576&e.flags&&(e.aliasSymbol||e.origin))}(n)?1048576:0),n.types);if(!(131072&i))if(r|=205258751&i,465829888&i&&(r|=33554432),n===Oe&&(r|=8388608),!H&&98304&i)131072&e.getObjectFlags(n)||(r|=4194304);else {var a=t.length,o=a&&n.id>t[a-1].id?~a:e.binarySearch(t,n,Bu,e.compareValues);o<0&&t.splice(~o,0,n);}return r}function Uu(e,t,r){for(var n=0,i=r;n<i.length;n++)t=zu(e,t,i[n]);return t}function Ku(t,r){for(var n=0,i=r;n<i.length;n++){var a=i[n];if(1048576&a.flags){var o=a.origin;a.aliasSymbol||o&&!(1048576&o.flags)?e.pushIfUnique(t,a):o&&1048576&o.flags&&Ku(t,o.types);}}}function Vu(e,t){var r=la(e);return r.types=t,r}function qu(t,r,n,i,a){if(void 0===r&&(r=1),0===t.length)return nt;if(1===t.length)return t[0];var o=[],s=Uu(o,0,t);if(0!==r){if(3&s)return 1&s?8388608&s?Oe:we:65536&s||ju(o,je)?je:Je;if(re&&32768&s){var c=e.binarySearch(o,Ve,Bu,e.compareValues);c>=0&&ju(o,ze)&&e.orderedRemoveItemAt(o,c);}if((402664320&s||16384&s&&32768&s)&&function(t,r,n){for(var i=t.length;i>0;){var a=t[--i],o=a.flags;(402653312&o&&4&r||256&o&&8&r||2048&o&&64&r||8192&o&&4096&r||n&&32768&o&&16384&r||nd(a)&&ju(t,a.regularType))&&e.orderedRemoveItemAt(t,i);}}(o,s,!!(2&r)),128&s&&134217728&s&&function(t){var r=e.filter(t,h_);if(r.length)for(var n=t.length,i=function(){n--;var i=t[n];128&i.flags&&e.some(r,(function(e){return _g(i,e)}))&&e.orderedRemoveItemAt(t,n);};n>0;)i();}(o),2===r&&!(o=function(t,r){var n=Ml(t),i=Ce.get(n);if(i)return i;for(var a=r&&e.some(t,(function(e){return !!(524288&e.flags)&&!dc(e)&&pp(pc(e))})),o=t.length,s=o,c=0;s>0;){var l=t[--s];if(a||469499904&l.flags)for(var u=61603840&l.flags?e.find(yc(l),(function(e){return rf(Uo(e))})):void 0,d=u&&rd(Uo(u)),p=0,f=t;p<f.length;p++){var g=f[p];if(l!==g){if(1e5===c&&c/(o-s)*o>1e6)return null===e.tracing||void 0===e.tracing||e.tracing.instant("checkTypes","removeSubtypes_DepthLimit",{typeIds:t.map((function(e){return e.id}))}),void In(_,e.Diagnostics.Expression_produces_a_union_type_that_is_too_complex_to_represent);if(c++,u&&61603840&g.flags){var m=eo(g,u.escapedName);if(m&&rf(m)&&rd(m)!==d)continue}if(hp(l,g,xn)&&(!(1&e.getObjectFlags(qo(l)))||!(1&e.getObjectFlags(qo(g)))||Zd(l,g))){e.orderedRemoveItemAt(t,s);break}}}}return Ce.set(n,t),t}(o,!!(524288&s))))return Me;if(0===o.length)return 65536&s?4194304&s?qe:We:32768&s?4194304&s?ze:Ue:nt}if(!a&&1048576&s){var l=[];Ku(l,t);for(var u=[],d=function(t){e.some(l,(function(e){return ju(e.types,t)}))||u.push(t);},p=0,f=o;p<f.length;p++)d(f[p]);if(!n&&1===l.length&&0===u.length)return l[0];if(e.reduceLeft(l,(function(e,t){return e+t.types.length}),0)+u.length===o.length){for(var g=0,m=l;g<m.length;g++)Ju(u,m[g]);a=Vu(1048576,u);}}return Hu(o,(36323363&s?0:65536)|(2097152&s?33554432:0),n,i,a)}function Wu(e,t){return e.kind===t.kind&&e.parameterIndex===t.parameterIndex}function Hu(e,t,r,n,i){if(0===e.length)return nt;if(1===e.length)return e[0];var a=(i?1048576&i.flags?"|".concat(Ml(i.types)):2097152&i.flags?"&".concat(Ml(i.types)):"#".concat(i.type.id,"|").concat(Ml(e)):Ml(e))+Ll(r,n),o=ge.get(a);return o||((o=ca(1048576)).objectFlags=t|Rl(e,98304),o.types=e,o.origin=i,o.aliasSymbol=r,o.aliasTypeArguments=n,2===e.length&&512&e[0].flags&&512&e[1].flags&&(o.flags|=16,o.intrinsicName="boolean"),ge.set(a,o)),o}function Gu(e,t,r){var n=r.flags;return 2097152&n?Qu(e,t,r.types):(gp(r)?16777216&t||(t|=16777216,e.set(r.id.toString(),r)):(3&n?r===Oe&&(t|=8388608):!H&&98304&n||(re&&r===Ve&&(t|=262144,r=ze),e.has(r.id.toString())||(109440&r.flags&&109440&t&&(t|=67108864),e.set(r.id.toString(),r))),t|=205258751&n),t)}function Qu(e,t,r){for(var n=0,i=r;n<i.length;n++)t=Gu(e,t,rd(i[n]));return t}function Xu(e,t){for(var r=0,n=e;r<n.length;r++){var i=n[r];if(!ju(i.types,t)){var a=128&t.flags?He:256&t.flags?Ge:2048&t.flags?Qe:8192&t.flags?tt:void 0;if(!a||!ju(i.types,a))return !1}}return !0}function Yu(t,r){return e.every(t,(function(t){return !!(1048576&t.flags)&&e.some(t.types,(function(e){return !!(e.flags&r)}))}))}function Zu(e,t){for(var r=0;r<e.length;r++)e[r]=om(e[r],(function(e){return !(e.flags&t)}));}function $u(t,r,n){var i=new e.Map,a=Qu(i,0,t),o=e.arrayFrom(i.values());if(131072&a)return e.contains(o,it)?it:nt;if(H&&98304&a&&84410368&a||67108864&a&&402783228&a||402653316&a&&67238776&a||296&a&&469891796&a||2112&a&&469889980&a||12288&a&&469879804&a||49152&a&&469842940&a)return nt;if(134217728&a&&128&a&&function(t){for(var r=t.length,n=e.filter(t,(function(e){return !!(128&e.flags)}));r>0;){var i=t[--r];if(134217728&i.flags)for(var a=0,o=n;a<o.length;a++){if(Xd(o[a],i)){e.orderedRemoveItemAt(t,r);break}if(h_(i))return !0}}return !1}(o))return nt;if(1&a)return 8388608&a?Oe:we;if(!H&&98304&a)return 32768&a?ze:qe;if((4&a&&128&a||8&a&&256&a||64&a&&2048&a||4096&a&&8192&a)&&function(t,r){for(var n=t.length;n>0;){var i=t[--n];(4&i.flags&&128&r||8&i.flags&&256&r||64&i.flags&&2048&r||4096&i.flags&&8192&r)&&e.orderedRemoveItemAt(t,n);}}(o,a),16777216&a&&524288&a&&e.orderedRemoveItemAt(o,e.findIndex(o,gp)),262144&a&&(o[o.indexOf(ze)]=Ve),0===o.length)return je;if(1===o.length)return o[0];var s=Ml(o)+Ll(r,n),c=me.get(s);if(!c){if(1048576&a)if(function(t){var r,n=e.findIndex(t,(function(t){return !!(65536&e.getObjectFlags(t))}));if(n<0)return !1;for(var i=n+1;i<t.length;){var a=t[i];65536&e.getObjectFlags(a)?((r||(r=[t[n]])).push(a),e.orderedRemoveItemAt(t,i)):i++;}if(!r)return !1;for(var o=[],s=[],c=0,l=r;c<l.length;c++)for(var u=0,_=l[c].types;u<_.length;u++)Ju(o,a=_[u])&&Xu(r,a)&&Ju(s,a);return t[n]=Hu(s,65536),!0}(o))c=$u(o,r,n);else if(Yu(o,32768)){var l=re&&e.some(o,(function(e){return ju(e.types,Ve)}))?Ve:ze;Zu(o,32768),c=qu([$u(o),l],1,r,n);}else if(Yu(o,65536))Zu(o,65536),c=qu([$u(o),qe],1,r,n);else {if(!t_(o))return Me;var u=function(e){for(var t=e_(e),r=[],n=0;n<t;n++){for(var i=e.slice(),a=n,o=e.length-1;o>=0;o--)if(1048576&e[o].flags){var s=e[o].types,c=s.length;i[o]=s[a%c],a=Math.floor(a/c);}var l=$u(i);131072&l.flags||r.push(l);}return r}(o);c=qu(u,1,r,n,e.some(u,(function(e){return !!(2097152&e.flags)}))?Vu(2097152,o):void 0);}else c=function(e,t,r){var n=ca(2097152);return n.objectFlags=Rl(e,98304),n.types=e,n.aliasSymbol=t,n.aliasTypeArguments=r,n}(o,r,n);me.set(s,c);}return c}function e_(t){return e.reduceLeft(t,(function(e,t){return 1048576&t.flags?e*t.types.length:131072&t.flags?0:e}),1)}function t_(t){var r=e_(t);return !(r>=1e5&&(null===e.tracing||void 0===e.tracing||e.tracing.instant("checkTypes","checkCrossProductUnion_DepthLimit",{typeIds:t.map((function(e){return e.id})),size:r}),In(_,e.Diagnostics.Expression_produces_a_union_type_that_is_too_complex_to_represent),1))}function r_(e,t){var r=ca(4194304);return r.type=e,r.stringsOnly=t,r}function n_(e,t){return t?e.resolvedStringIndexType||(e.resolvedStringIndexType=r_(e,!0)):e.resolvedIndexType||(e.resolvedIndexType=r_(e,!1))}function i_(t){return e.isPrivateIdentifier(t)?nt:e.isIdentifier(t)?id(e.unescapeLeadingUnderscores(t.escapedText)):rd(e.isComputedPropertyName(t)?Ny(t):ax(t))}function a_(t,r,n){if(n||!(24&e.getDeclarationModifierFlagsFromSymbol(t))){var i=Gn(Ms(t)).nameType;if(!i){var a=e.getNameOfDeclaration(t.valueDeclaration);i="default"===t.escapedName?id("default"):a&&i_(a)||(e.isKnownSymbol(t)?void 0:id(e.symbolName(t)));}if(i&&i.flags&r)return i}return nt}function o_(t,r){return !!(t.flags&r||2097152&t.flags&&e.some(t.types,(function(e){return o_(e,r)})))}function s_(t,r,n){var i=n&&(7&e.getObjectFlags(t)||t.aliasSymbol)?function(e){var t=la(4194304);return t.type=e,t}(t):void 0,a=e.map(yc(t),(function(e){return a_(e,r)})),o=e.map(Hc(t),(function(e){return e!==Ar&&o_(e.keyType,r)?e.keyType===He&&8&r?lt:e.keyType:nt}));return qu(e.concatenate(a,o),1,void 0,void 0,i)}function c_(t,r,n){return void 0===r&&(r=ee),1048576&(t=Mc(t)).flags?$u(e.map(t.types,(function(e){return c_(e,r,n)}))):2097152&t.flags?qu(e.map(t.types,(function(e){return c_(e,r,n)}))):58982400&t.flags||df(t)||dc(t)&&(a=rc(i=t),!function t(r){return !!(68157439&r.flags)||(16777216&r.flags?r.root.isDistributive&&r.checkType===a:137363456&r.flags?e.every(r.types,t):8388608&r.flags?t(r.objectType)&&t(r.indexType):33554432&r.flags?t(r.substitute):!!(268435456&r.flags)&&t(r.type))}(ic(i)||a))?n_(t,r):32&e.getObjectFlags(t)?function(e,t,r){var n=rc(e),i=nc(e),a=ic(e.target||e);if(!a&&!r)return i;var o=[];if(sc(e)){if(D_(i))return n_(e,t);tc(Ac(cc(e)),8576,t,c);}else nm($s(i),c);D_(i)&&nm(i,c);var s=r?om(qu(o),(function(e){return !(5&e.flags)})):qu(o);return 1048576&s.flags&&1048576&i.flags&&Ml(s.types)===Ml(i.types)?i:s;function c(t){var r=a?Rd(a,Ed(e.mapper,n,t)):t;o.push(r===He?lt:r);}}(t,r,n):t===Oe?Oe:2&t.flags?nt:131073&t.flags?_t:s_(t,(n?128:402653316)|(r?0:12584),r===ee&&!n);var i,a;}function l_(e){if(ee)return e;var t=(fr||(fr=lu("Extract",2,!0)||Ne),fr===Ne?void 0:fr);return t?Vl(t,[e,He]):He}function u_(t,r){var n=e.findIndex(r,(function(e){return !!(1179648&e.flags)}));if(n>=0)return t_(r)?lm(r[n],(function(i){return u_(t,e.replaceElement(r,n,i))})):Me;if(e.contains(r,Oe))return Oe;var i=[],a=[],o=t[0];if(!function e(t,r){for(var n=0;n<r.length;n++){var s=r[n];if(101248&s.flags)o+=__(s)||"",o+=t[n+1];else if(134217728&s.flags){if(o+=s.texts[0],!e(s.texts,s.types))return !1;o+=t[n+1];}else {if(!D_(s)&&!v_(s))return !1;i.push(s),a.push(o),o=t[n+1];}}return !0}(t,r))return He;if(0===i.length)return id(o);if(a.push(o),e.every(a,(function(e){return ""===e}))&&e.every(i,(function(e){return !!(4&e.flags)})))return He;var s="".concat(Ml(i),"|").concat(e.map(a,(function(e){return e.length})).join(","),"|").concat(a.join("")),c=De.get(s);return c||De.set(s,c=function(e,t){var r=ca(134217728);return r.texts=e,r.types=t,r}(a,i)),c}function __(t){return 128&t.flags?t.value:256&t.flags?""+t.value:2048&t.flags?e.pseudoBigIntToString(t.value):98816&t.flags?t.intrinsicName:void 0}function d_(e,t){return 1179648&t.flags?lm(t,(function(t){return d_(e,t)})):D_(t)?function(e,t){var r="".concat(M(e),",").concat(Bu(t)),n=Se.get(r);return n||Se.set(r,n=function(e,t){var r=ca(268435456);return r.symbol=e,r.type=t,r}(e,t)),n}(e,t):128&t.flags?id(function(e,t){switch(P.get(e.escapedName)){case 0:return t.toUpperCase();case 1:return t.toLowerCase();case 2:return t.charAt(0).toUpperCase()+t.slice(1);case 3:return t.charAt(0).toLowerCase()+t.slice(1)}return t}(e,t.value)):t}function p_(t){if(Y)return !1;if(8192&e.getObjectFlags(t))return !0;if(1048576&t.flags)return e.every(t.types,p_);if(2097152&t.flags)return e.some(t.types,p_);if(465829888&t.flags){var r=kc(t);return r!==t&&p_(r)}return !1}function f_(t,r){return Es(t)?Ps(t):r&&e.isPropertyName(r)?e.getPropertyNameForPropertyNameNode(r):void 0}function g_(t,r){if(8208&r.flags){var n=e.findAncestor(t.parent,(function(t){return !e.isAccessExpression(t)}))||t.parent;return e.isCallLikeExpression(n)?e.isCallOrNewExpression(n)&&e.isIdentifier(t)&&Lg(n,t):e.every(r.declarations,(function(t){return !e.isFunctionLike(t)||!!(134217728&e.getCombinedNodeFlags(t))}))}return !0}function m_(t,r,n,i,a,o){var s,c=a&&206===a.kind?a:void 0,l=a&&e.isPrivateIdentifier(a)?void 0:f_(n,a);if(void 0!==l){if(256&o)return cy(r,l)||we;var u=Jc(r,l);if(u){if(64&o&&a&&u.declarations&&134217728&$y(u)&&g_(a,u)&&Bn(null!==(s=null==c?void 0:c.argumentExpression)&&void 0!==s?s:e.isIndexedAccessTypeNode(a)?a.indexType:a,u.declarations,l),c){if(Iv(u,c,Ov(c.expression,r.symbol)),Sb(c,u,e.getAssignmentTargetKind(c)))return void In(c.argumentExpression,e.Diagnostics.Cannot_assign_to_0_because_it_is_a_read_only_property,Ia(u));if(8&o&&(Qn(a).resolvedSymbol=u),vv(c,u))return Ie}var _=Uo(u);return c&&1!==e.getAssignmentTargetKind(c)?Pm(c,_):_}if(am(r,_f)&&ky(l)&&+l>=0){if(a&&am(r,(function(e){return !e.target.hasRestElement}))&&!(16&o)){var d=y_(a);_f(r)?In(d,e.Diagnostics.Tuple_type_0_of_length_1_has_no_element_at_index_2,Ma(r),Ul(r),e.unescapeLeadingUnderscores(l)):In(d,e.Diagnostics.Property_0_does_not_exist_on_type_1,e.unescapeLeadingUnderscores(l),Ma(r));}return b(Gc(r,Ge)),lm(r,(function(e){var t=ff(e)||ze;return 1&o?qu([t,ze]):t}))}}if(!(98304&n.flags)&&kb(n,402665900)){if(131073&r.flags)return r;var p=Yc(r,n)||Gc(r,He);if(p)return 2&o&&p.keyType!==Ge?void(c&&In(c,e.Diagnostics.Type_0_cannot_be_used_to_index_type_1,Ma(n),Ma(t))):a&&p.keyType===He&&!kb(n,12)?(In(d=y_(a),e.Diagnostics.Type_0_cannot_be_used_as_an_index_type,Ma(n)),1&o?qu([p.type,ze]):p.type):(b(p),1&o?qu([p.type,ze]):p.type);if(131072&n.flags)return nt;if(p_(r))return we;if(c&&!Fb(r)){if(yg(r)){if(Y&&384&n.flags)return mn.add(e.createDiagnosticForNode(c,e.Diagnostics.Property_0_does_not_exist_on_type_1,n.value,Ma(r))),ze;if(12&n.flags){var f=e.map(r.properties,(function(e){return Uo(e)}));return qu(e.append(f,ze))}}if(r.symbol===ce&&void 0!==l&&ce.exports.has(l)&&418&ce.exports.get(l).flags)In(c,e.Diagnostics.Property_0_does_not_exist_on_type_1,e.unescapeLeadingUnderscores(l),Ma(r));else if(Y&&!U.suppressImplicitAnyIndexErrors&&!(128&o))if(void 0!==l&&Cv(l,r)){var g=Ma(r);In(c,e.Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_to_access_the_static_member_2_instead,l,g,g+"["+e.getTextOfNode(c.argumentExpression)+"]");}else if(Qc(r,Ge))In(c.argumentExpression,e.Diagnostics.Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number);else {var m=void 0;if(void 0!==l&&(m=Fv(l,r)))void 0!==m&&In(c.argumentExpression,e.Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2,l,Ma(r),m);else {var y=function(t,r,n){var i=e.isAssignmentTarget(r)?"set":"get";if(function(e){var r=gc(t,e);if(r){var i=Qv(Uo(r));return !!i&&$h(i)>=1&&Yd(n,Qh(i,0))}return !1}(i)){var a=e.tryGetPropertyAccessOrIdentifierToString(r.expression);return void 0===a?a=i:a+="."+i,a}}(r,c,n);if(void 0!==y)In(c,e.Diagnostics.Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature_Did_you_mean_to_call_1,Ma(r),y);else {var v=void 0;if(1024&n.flags)v=e.chainDiagnosticMessages(void 0,e.Diagnostics.Property_0_does_not_exist_on_type_1,"["+Ma(n)+"]",Ma(r));else if(8192&n.flags){var h=Oi(n.symbol,c);v=e.chainDiagnosticMessages(void 0,e.Diagnostics.Property_0_does_not_exist_on_type_1,"["+h+"]",Ma(r));}else 128&n.flags||256&n.flags?v=e.chainDiagnosticMessages(void 0,e.Diagnostics.Property_0_does_not_exist_on_type_1,n.value,Ma(r)):12&n.flags&&(v=e.chainDiagnosticMessages(void 0,e.Diagnostics.No_index_signature_with_a_parameter_of_type_0_was_found_on_type_1,Ma(n),Ma(r)));v=e.chainDiagnosticMessages(v,e.Diagnostics.Element_implicitly_has_an_any_type_because_expression_of_type_0_can_t_be_used_to_index_type_1,Ma(i),Ma(r)),mn.add(e.createDiagnosticForNodeFromMessageChain(c,v));}}}return}}return p_(r)?we:(a&&(d=y_(a),384&n.flags?In(d,e.Diagnostics.Property_0_does_not_exist_on_type_1,""+n.value,Ma(r)):12&n.flags?In(d,e.Diagnostics.Type_0_has_no_matching_index_signature_for_type_1,Ma(r),Ma(n)):In(d,e.Diagnostics.Type_0_cannot_be_used_as_an_index_type,Ma(n))),to(n)?n:void 0);function b(t){t&&t.isReadonly&&c&&(e.isAssignmentTarget(c)||e.isDeleteTarget(c))&&In(c,e.Diagnostics.Index_signature_in_type_0_only_permits_reading,Ma(r));}}function y_(e){return 206===e.kind?e.argumentExpression:193===e.kind?e.indexType:161===e.kind?e.expression:e}function v_(e){return !!(77&e.flags)}function h_(t){return !!(134217728&t.flags)&&e.every(t.types,v_)}function b_(e){return !!S_(e)}function x_(e){return !!(8388608&S_(e))}function D_(e){return !!(16777216&S_(e))}function S_(t){return 3145728&t.flags?(4194304&t.objectFlags||(t.objectFlags|=4194304|e.reduceLeft(t.types,(function(e,t){return e|S_(t)}),0)),25165824&t.objectFlags):33554432&t.flags?(4194304&t.objectFlags||(t.objectFlags|=4194304|S_(t.substitute)|S_(t.baseType)),25165824&t.objectFlags):(58982400&t.flags||dc(t)||df(t)?8388608:0)|(465829888&t.flags&&!h_(t)?16777216:0)}function T_(e){return !!(262144&e.flags&&e.isThisType)}function C_(t,r){return 8388608&t.flags?function(t,r){var n=r?"simplifiedForWriting":"simplifiedForReading";if(t[n])return t[n]===St?t:t[n];t[n]=St;var i=C_(t.objectType,r),a=C_(t.indexType,r),o=function(t,r,n){if(1048576&r.flags){var i=e.map(r.types,(function(e){return C_(F_(t,e),n)}));return n?$u(i):qu(i)}}(i,a,r);if(o)return t[n]=o;if(!(465829888&a.flags)){var s=E_(i,a,r);if(s)return t[n]=s}if(df(i)&&296&a.flags){var c=gf(i,8&a.flags?0:i.target.fixedLength,0,r);if(c)return t[n]=c}return dc(i)?t[n]=lm(N_(i,t.indexType),(function(e){return C_(e,r)})):t[n]=t}(t,r):16777216&t.flags?function(e,t){var r=e.checkType,n=e.extendsType,i=j_(e),a=J_(e);if(131072&a.flags&&O_(i)===O_(r)){if(1&r.flags||Yd(Jd(r),Jd(n)))return C_(i,t);if(k_(r,n))return nt}else if(131072&i.flags&&O_(a)===O_(r)){if(!(1&r.flags)&&Yd(Jd(r),Jd(n)))return nt;if(1&r.flags||k_(r,n))return C_(a,t)}return e}(t,r):t}function E_(t,r,n){if(3145728&t.flags){var i=e.map(t.types,(function(e){return C_(F_(e,r),n)}));return 2097152&t.flags||n?$u(i):qu(i)}}function k_(e,t){return !!(131072&qu([Gs(e,t),nt]).flags)}function N_(e,t){var r=vd([rc(e)],[t]),n=Td(e.mapper,r);return Rd(ac(e),n)}function F_(e,t,r,n,i,a){return void 0===r&&(r=0),P_(e,t,r,n,i,a)||(n?Me:je)}function A_(e,t){return am(e,(function(e){if(384&e.flags){var r=Ps(e);if(ky(r)){var n=+r;return n>=0&&n<t}}return !1}))}function P_(e,t,r,n,i,a){if(void 0===r&&(r=0),e===Oe||t===Oe)return Oe;if(!mp(e)||98304&t.flags||!kb(t,12)||(t=He),U.noUncheckedIndexedAccess&&32&r&&(r|=1),D_(t)||(n&&193!==n.kind?df(e)&&!A_(t,e.target.fixedLength):x_(e)&&(!_f(e)||!A_(t,e.target.fixedLength)))){if(3&e.flags)return e;var o=1&r,s=e.id+","+t.id+","+o+Ll(i,a),c=xe.get(s);return c||xe.set(s,c=function(e,t,r,n,i){var a=ca(8388608);return a.objectType=e,a.indexType=t,a.accessFlags=r,a.aliasSymbol=n,a.aliasTypeArguments=i,a}(e,t,o,i,a)),c}var l=Pc(e);if(1048576&t.flags&&!(16&t.flags)){for(var u=[],_=!1,d=0,p=t.types;d<p.length;d++){var f=m_(e,l,p[d],t,n,r|(_?128:0));if(f)u.push(f);else {if(!n)return;_=!0;}}if(_)return;return 4&r?$u(u,i,a):qu(u,1,i,a)}return m_(e,l,t,t,n,72|r)}function w_(e){var t=Qn(e);if(!t.resolvedType){var r=dd(e.objectType),n=dd(e.indexType),i=W_(e),a=F_(r,n,0,e,i,H_(i));t.resolvedType=8388608&a.flags&&a.objectType===r&&a.indexType===n?$l(a,e):a;}return t.resolvedType}function I_(e){var t=Qn(e);if(!t.resolvedType){var r=_a(32,e.symbol);r.declaration=e,r.aliasSymbol=W_(e),r.aliasTypeArguments=H_(r.aliasSymbol),t.resolvedType=r,nc(r);}return t.resolvedType}function O_(e){return 33554432&e.flags?e.baseType:8388608&e.flags&&(33554432&e.objectType.flags||33554432&e.indexType.flags)?F_(O_(e.objectType),O_(e.indexType)):e}function M_(e){return !e.isDistributive&&L_(e.node.checkType)&&L_(e.node.extendsType)}function L_(t){return e.isTupleTypeNode(t)&&1===e.length(t.elements)&&!e.isOptionalTypeNode(t.elements[0])&&!e.isRestTypeNode(t.elements[0])}function R_(e,t){return M_(e)&&_f(t)?zl(t)[0]:t}function B_(t,r,n,i){for(var a,o,s=0;;){if(1e3===s){In(_,e.Diagnostics.Type_instantiation_is_excessively_deep_and_possibly_infinite),a=Me;break}var c=M_(t),l=Rd(R_(t,O_(t.checkType)),r),u=b_(l),d=Rd(R_(t,t.extendsType),r);if(l===Oe||d===Oe)return Oe;var p=void 0;if(t.inferTypeParameters){var f=Wf(t.inferTypeParameters,void 0,0);u||fg(f.inferences,l,d,1536),p=r?Td(f.mapper,r):f.mapper;}var g=p?Rd(R_(t,t.extendsType),p):d;if(!u&&!b_(g)){if(!(3&g.flags)&&(1&l.flags&&!c||!Yd(jd(l),jd(g)))){1&l.flags&&!c&&(o||(o=[])).push(Rd(dd(t.node.trueType),p||r));var m=dd(t.node.falseType);if(16777216&m.flags){var y=m.root;if(y.node.parent===t.node&&(!y.isDistributive||y.checkType===t.checkType)){t=y;continue}if(b(m,r))continue}a=Rd(m,r);break}if(3&g.flags||Yd(Jd(l),Jd(g))){var v=dd(t.node.trueType),h=p||r;if(b(v,h))continue;a=Rd(v,h);break}}(a=ca(16777216)).root=t,a.checkType=Rd(t.checkType,r),a.extendsType=Rd(t.extendsType,r),a.mapper=r,a.combinedMapper=p,a.aliasSymbol=n||t.aliasSymbol,a.aliasTypeArguments=n?i:gd(t.aliasTypeArguments,r);break}return o?qu(e.append(o,a)):a;function b(a,o){if(16777216&a.flags&&o){var c=a.root;if(c.outerTypeParameters){var l=Td(a.mapper,o),u=e.map(c.outerTypeParameters,(function(e){return hd(e,l)})),_=vd(c.outerTypeParameters,u),d=c.isDistributive?hd(c.checkType,_):void 0;if(!(d&&d!==c.checkType&&1179648&d.flags))return t=c,r=_,n=void 0,i=void 0,c.aliasSymbol&&s++,!0}}return !1}}function j_(e){return e.resolvedTrueType||(e.resolvedTrueType=Rd(dd(e.root.node.trueType),e.mapper))}function J_(e){return e.resolvedFalseType||(e.resolvedFalseType=Rd(dd(e.root.node.falseType),e.mapper))}function z_(t){var r;return t.locals&&t.locals.forEach((function(t){262144&t.flags&&(r=e.append(r,ms(t)));})),r}function U_(t){return e.isIdentifier(t)?[t]:e.append(U_(t.left),t.right)}function K_(t){var r=Qn(t);if(!r.resolvedType){if(t.isTypeOf&&t.typeArguments)return In(t,e.Diagnostics.Type_arguments_cannot_be_used_here),r.resolvedSymbol=Ne,r.resolvedType=Me;if(!e.isLiteralImportTypeNode(t))return In(t.argument,e.Diagnostics.String_literal_expected),r.resolvedSymbol=Ne,r.resolvedType=Me;var n=t.isTypeOf?111551:4194304&t.flags?900095:788968,i=Ri(t,t.argument.literal);if(!i)return r.resolvedSymbol=Ne,r.resolvedType=Me;var a=zi(i,!1);if(e.nodeIsMissing(t.qualifier))a.flags&n?r.resolvedType=V_(t,r,a,n):(In(t,111551===n?e.Diagnostics.Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here:e.Diagnostics.Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0,t.argument.literal.text),r.resolvedSymbol=Ne,r.resolvedType=Me);else {for(var o=U_(t.qualifier),s=a,c=void 0;c=o.shift();){var l=o.length?1920:n,u=Zi(Ei(s)),_=t.isTypeOf?Jc(Uo(u),c.escapedText):Yn(Gi(u),c.escapedText,l);if(!_)return In(c,e.Diagnostics.Namespace_0_has_no_exported_member_1,Oi(s),e.declarationNameToString(c)),r.resolvedType=Me;Qn(c).resolvedSymbol=_,Qn(c.parent).resolvedSymbol=_,s=_;}r.resolvedType=V_(t,r,s,n);}}return r.resolvedType}function V_(e,t,r,n){var i=Ei(r);return t.resolvedSymbol=i,111551===n?Uo(r):Ql(e,i)}function q_(t){var r=Qn(t);if(!r.resolvedType){var n=W_(t);if(0!==Os(t.symbol).size||n){var i=_a(16,t.symbol);i.aliasSymbol=n,i.aliasTypeArguments=H_(n),e.isJSDocTypeLiteral(t)&&t.isArrayType&&(i=Tu(i)),r.resolvedType=i;}else r.resolvedType=ht;}return r.resolvedType}function W_(t){for(var r=t.parent;e.isParenthesizedTypeNode(r)||e.isJSDocTypeExpression(r)||e.isTypeOperatorNode(r)&&144===r.operator;)r=r.parent;return e.isTypeAlias(r)?$i(r):void 0}function H_(e){return e?Xo(e):void 0}function G_(e){return !!(524288&e.flags)&&!dc(e)}function Q_(e){return fp(e)||!!(474058748&e.flags)}function X_(t,r){if(!(1048576&t.flags))return t;if(e.every(t.types,Q_))return e.find(t.types,fp)||mt;var n=e.find(t.types,(function(e){return !Q_(e)}));return n?e.find(t.types,(function(e){return e!==n&&!Q_(e)}))?t:function(t){for(var n=e.createSymbolTable(),i=0,a=yc(t);i<a.length;i++){var o=a[i];if(24&e.getDeclarationModifierFlagsFromSymbol(o));else if(Z_(o)){var s=65536&o.flags&&!(32768&o.flags),c=jn(16777220,o.escapedName,ec(o)|(r?8:0));c.type=s?ze:go(Uo(o),!0),c.declarations=o.declarations,c.nameType=Gn(o).nameType,c.syntheticOrigin=o,n.set(o.escapedName,c);}}var l=ya(t.symbol,n,e.emptyArray,e.emptyArray,Hc(t));return l.objectFlags|=262272,l}(n):t}function Y_(t,r,n,i,a){if(1&t.flags||1&r.flags)return we;if(2&t.flags||2&r.flags)return je;if(131072&t.flags)return r;if(131072&r.flags)return t;if(1048576&(t=X_(t,a)).flags)return t_([t,r])?lm(t,(function(e){return Y_(e,r,n,i,a)})):Me;if(1048576&(r=X_(r,a)).flags)return t_([t,r])?lm(r,(function(e){return Y_(t,e,n,i,a)})):Me;if(473960444&r.flags)return t;if(x_(t)||x_(r)){if(fp(t))return r;if(2097152&t.flags){var o=t.types,s=o[o.length-1];if(G_(s)&&G_(r))return $u(e.concatenate(o.slice(0,o.length-1),[Y_(s,r,n,i,a)]))}return $u([t,r])}for(var c=e.createSymbolTable(),l=new e.Set,u=t===mt?Hc(r):Hs([t,r]),_=0,d=yc(r);_<d.length;_++){var p=d[_];24&e.getDeclarationModifierFlagsFromSymbol(p)?l.add(p.escapedName):Z_(p)&&c.set(p.escapedName,$_(p,a));}for(var f=0,g=yc(t);f<g.length;f++){var m=g[f];if(!l.has(m.escapedName)&&Z_(m))if(c.has(m.escapedName)){var y=Uo(p=c.get(m.escapedName));if(16777216&p.flags){var v=e.concatenate(m.declarations,p.declarations),h=jn(4|16777216&m.flags,m.escapedName);h.type=qu([Uo(m),Af(y)]),h.leftSpread=m,h.rightSpread=p,h.declarations=v,h.nameType=Gn(m).nameType,c.set(m.escapedName,h);}}else c.set(m.escapedName,$_(m,a));}var b=ya(n,c,e.emptyArray,e.emptyArray,e.sameMap(u,(function(e){return function(e,t){return e.isReadonly!==t?Nl(e.keyType,e.type,t,e.declaration):e}(e,a)})));return b.objectFlags|=4456576|i,b}function Z_(t){var r;return !(e.some(t.declarations,e.isPrivateIdentifierClassElementDeclaration)||106496&t.flags&&(null===(r=t.declarations)||void 0===r?void 0:r.some((function(t){return e.isClassLike(t.parent)}))))}function $_(e,t){var r=65536&e.flags&&!(32768&e.flags);if(!r&&t===Db(e))return e;var n=jn(4|16777216&e.flags,e.escapedName,ec(e)|(t?8:0));return n.type=r?ze:Uo(e),n.declarations=e.declarations,n.nameType=Gn(e).nameType,n.syntheticOrigin=e,n}function ed(e,t,r,n){var i=ca(e);return i.symbol=r,i.value=t,i.regularType=n||i,i}function td(e){if(2944&e.flags){if(!e.freshType){var t=ed(e.flags,e.value,e.symbol,e);t.freshType=t,e.freshType=t;}return e.freshType}return e}function rd(e){return 2944&e.flags?e.regularType:1048576&e.flags?e.regularType||(e.regularType=lm(e,rd)):e}function nd(e){return !!(2944&e.flags)&&e.freshType===e}function id(e){var t;return ye.get(e)||(ye.set(e,t=ed(128,e)),t)}function ad(e){var t;return ve.get(e)||(ve.set(e,t=ed(256,e)),t)}function od(t){var r,n=e.pseudoBigIntToString(t);return he.get(n)||(he.set(n,r=ed(2048,t)),r)}function sd(e,t,r){var n,i=t+("string"==typeof e?"@":"#")+e,a=1024|("string"==typeof e?128:256);return be.get(i)||(be.set(i,n=ed(a,e,r)),n)}function cd(t){if(e.isValidESSymbolDeclaration(t)){var r=$i(t),n=Gn(r);return n.uniqueESSymbolType||(n.uniqueESSymbolType=function(e){var t=ca(8192);return t.symbol=e,t.escapedName="__@".concat(t.symbol.escapedName,"@").concat(M(t.symbol)),t}(r))}return tt}function ld(t){var r=Qn(t);return r.resolvedType||(r.resolvedType=function(t){var r=e.getThisContainer(t,!1),n=r&&r.parent;if(n&&(e.isClassLike(n)||257===n.kind)&&!e.isStatic(r)&&(!e.isConstructorDeclaration(r)||e.isNodeDescendantOf(t,r.body)))return ss($i(n)).thisType;if(n&&e.isObjectLiteralExpression(n)&&e.isBinaryExpression(n.parent)&&6===e.getAssignmentDeclarationKind(n.parent))return ss($i(n.parent.left).parent).thisType;var i=4194304&t.flags?e.getHostSignatureFromJSDoc(t):void 0;return i&&e.isFunctionExpression(i)&&e.isBinaryExpression(i.parent)&&3===e.getAssignmentDeclarationKind(i.parent)?ss($i(i.parent.left).parent).thisType:Fh(r)&&e.isNodeDescendantOf(t,r.body)?ss($i(r)).thisType:(In(t,e.Diagnostics.A_this_type_is_available_only_in_a_non_static_member_of_a_class_or_interface),Me)}(t)),r.resolvedType}function ud(e){return dd(_d(e.type)||e.type)}function _d(e){switch(e.kind){case 190:return _d(e.type);case 183:if(1===e.elements.length&&(185===(e=e.elements[0]).kind||196===e.kind&&e.dotDotDotToken))return _d(e.type);break;case 182:return e.elementType}}function dd(e){return $l(pd(e),e)}function pd(t){switch(t.kind){case 130:case 310:case 311:return we;case 154:return je;case 149:return He;case 146:return Ge;case 157:return Qe;case 133:return et;case 150:return tt;case 114:return rt;case 152:return ze;case 104:return qe;case 143:return nt;case 147:return 131072&t.flags&&!Y?we:ct;case 138:return Be;case 191:case 108:return ld(t);case 195:return function(e){if(104===e.literal.kind)return qe;var t=Qn(e);return t.resolvedType||(t.resolvedType=rd(ax(e.literal))),t.resolvedType}(t);case 177:return nu(t);case 176:return t.assertsModifier?rt:et;case 227:return nu(t);case 180:return au(t);case 182:case 183:return function(t){var r=Qn(t);if(!r.resolvedType){var n=function(t){var r=function(t){return e.isTypeOperatorNode(t)&&144===t.operator}(t.parent);return _d(t)?r?Lt:Mt:Pu(e.map(t.elements,Cu),r,e.some(t.elements,(function(e){return 196!==e.kind}))?void 0:t.elements)}(t);if(n===bt)r.resolvedType=mt;else if(183===t.kind&&e.some(t.elements,(function(e){return !!(8&Cu(e))}))||!ku(t)){var i=182===t.kind?[dd(t.elementType)]:e.map(t.elements,dd);r.resolvedType=wu(n,i);}else r.resolvedType=183===t.kind&&0===t.elements.length?n:Jl(n,t,void 0);}return r.resolvedType}(t);case 184:return function(e){return go(dd(e.type),!0)}(t);case 186:return function(t){var r=Qn(t);if(!r.resolvedType){var n=W_(t);r.resolvedType=qu(e.map(t.types,dd),1,n,H_(n));}return r.resolvedType}(t);case 187:return function(t){var r=Qn(t);if(!r.resolvedType){var n=W_(t);r.resolvedType=$u(e.map(t.types,dd),n,H_(n));}return r.resolvedType}(t);case 312:return function(e){var t=dd(e.type);return H?xf(t,65536):t}(t);case 314:return go(dd(t.type));case 196:return function(e){var t=Qn(e);return t.resolvedType||(t.resolvedType=e.dotDotDotToken?ud(e):go(dd(e.type),!0,!!e.questionToken))}(t);case 190:case 313:case 307:return dd(t.type);case 185:return ud(t);case 316:return function(t){var r=dd(t.type),n=t.parent,i=t.parent.parent;if(e.isJSDocTypeExpression(t.parent)&&e.isJSDocParameterTag(i)){var a=e.getHostSignatureFromJSDoc(i),o=e.isJSDocCallbackTag(i.parent.parent);if(a||o){var s=o?e.lastOrUndefined(i.parent.parent.typeExpression.parameters):e.lastOrUndefined(a.parameters),c=e.getParameterSymbolFromJSDoc(i);if(!s||c&&s.symbol===c&&e.isRestParameter(s))return Tu(r)}}return e.isParameter(n)&&e.isJSDocFunctionType(n.parent)?Tu(r):go(r)}(t);case 178:case 179:case 181:case 320:case 315:case 321:return q_(t);case 192:return function(t){var r=Qn(t);if(!r.resolvedType)switch(t.operator){case 140:r.resolvedType=c_(dd(t.type));break;case 153:r.resolvedType=150===t.type.kind?cd(e.walkUpParenthesizedTypes(t.parent)):Me;break;case 144:r.resolvedType=dd(t.type);break;default:throw e.Debug.assertNever(t.operator)}return r.resolvedType}(t);case 193:return w_(t);case 194:return I_(t);case 188:return function(t){var r=Qn(t);if(!r.resolvedType){var n=dd(t.checkType),i=W_(t),a=H_(i),o=Go(t,!0),s=a?o:e.filter(o,(function(e){return Ad(e,t)})),c={node:t,checkType:n,extendsType:dd(t.extendsType),isDistributive:!!(262144&n.flags),inferTypeParameters:z_(t),outerTypeParameters:s,instantiations:void 0,aliasSymbol:i,aliasTypeArguments:a};r.resolvedType=B_(c,void 0),s&&(c.instantiations=new e.Map,c.instantiations.set(Ml(s),r.resolvedType));}return r.resolvedType}(t);case 189:return function(e){var t=Qn(e);return t.resolvedType||(t.resolvedType=gs($i(e.typeParameter))),t.resolvedType}(t);case 197:return function(t){var r=Qn(t);return r.resolvedType||(r.resolvedType=u_(n$3([t.head.text],e.map(t.templateSpans,(function(e){return e.literal.text})),!0),e.map(t.templateSpans,(function(e){return dd(e.type)})))),r.resolvedType}(t);case 199:return K_(t);case 79:case 160:case 205:var r=MS(t);return r?ms(r):Me;default:return Me}}function fd(e,t,r){if(e&&e.length)for(var n=0;n<e.length;n++){var i=e[n],a=r(i,t);if(i!==a){var o=0===n?[]:e.slice(0,n);for(o.push(a),n++;n<e.length;n++)o.push(r(e[n],t));return o}}return e}function gd(e,t){return fd(e,t,Rd)}function md(e,t){return fd(e,t,Nd)}function yd(e,t){return fd(e,t,zd)}function vd(e,t){return 1===e.length?bd(e[0],t?t[0]:we):function(e,t){return {kind:1,sources:e,targets:t}}(e,t)}function hd(e,t){switch(t.kind){case 0:return e===t.source?t.target:e;case 1:for(var r=t.sources,n=t.targets,i=0;i<r.length;i++)if(e===r[i])return n?n[i]:we;return e;case 2:return t.func(e);case 3:case 4:var a=hd(e,t.mapper1);return a!==e&&3===t.kind?Rd(a,t.mapper2):hd(a,t.mapper2)}}function bd(e,t){return {kind:0,source:e,target:t}}function xd(e){return {kind:2,func:e}}function Dd(e,t,r){return {kind:e,mapper1:t,mapper2:r}}function Sd(e){return vd(e,void 0)}function Td(e,t){return e?Dd(3,e,t):t}function Cd(e,t,r){return r?Dd(4,bd(e,t),r):bd(e,t)}function Ed(e,t,r){return e?Dd(4,e,bd(t,r)):bd(t,r)}function kd(e){var t=da(e.symbol);return t.target=e,t}function Nd(t,r,n){var i;if(t.typeParameters&&!n){i=e.map(t.typeParameters,kd),r=Td(vd(t.typeParameters,i),r);for(var a=0,o=i;a<o.length;a++)o[a].mapper=r;}var s=Bs(t.declaration,i,t.thisParameter&&Fd(t.thisParameter,r),fd(t.parameters,r,Fd),void 0,void 0,t.minArgumentCount,39&t.flags);return s.target=t,s.mapper=r,s}function Fd(t,r){var n=Gn(t);if(n.type&&!$f(n.type))return t;1&e.getCheckFlags(t)&&(t=n.target,r=Td(n.mapper,r));var i=jn(t.flags,t.escapedName,1|53256&e.getCheckFlags(t));return i.declarations=t.declarations,i.parent=t.parent,i.target=t,i.mapper=r,t.valueDeclaration&&(i.valueDeclaration=t.valueDeclaration),n.nameType&&(i.nameType=n.nameType),i}function Ad(t,r){if(t.symbol&&t.symbol.declarations&&1===t.symbol.declarations.length){for(var n=t.symbol.declarations[0].parent,i=r;i!==n;i=i.parent)if(!i||234===i.kind||188===i.kind&&e.forEachChild(i.extendsType,a))return !0;return a(r)}return !0;function a(r){switch(r.kind){case 191:return !!t.isThisType;case 79:return !t.isThisType&&e.isPartOfTypeNode(r)&&function(e){return !(177===e.parent.kind&&e.parent.typeArguments&&e===e.parent.typeName||199===e.parent.kind&&e.parent.typeArguments&&e===e.parent.qualifier)}(r)&&pd(r)===t;case 180:return !0;case 168:case 167:return !r.type&&!!r.body||e.some(r.typeParameters,a)||e.some(r.parameters,a)||!!r.type&&a(r.type)}return !!e.forEachChild(r,a)}}function Pd(e){var t=nc(e);if(4194304&t.flags){var r=O_(t.type);if(262144&r.flags)return r}}function wd(t,r,n,i){var a=Pd(t);if(a){var o=Rd(a,r);if(a!==o)return um(Mc(o),(function(n){if(61603843&n.flags&&n!==Oe&&!ro(n)){if(!t.declaration.nameType){var i=void 0;if(qp(n)||1&n.flags&&Xa(a,4)<0&&(i=hc(a))&&am(i,e.or(qp,_f)))return function(e,t,r){var n=Od(t,Ge,!0,r);return ro(n)?Me:Tu(n,Id(Wp(e),lc(t)))}(n,t,Cd(a,n,r));if(df(n))return function(t,r,n,i){var a=t.target.elementFlags,o=e.map(zl(t),(function(e,t){var o=8&a[t]?e:4&a[t]?Tu(e):Au([e],[a[t]]);return wd(r,Cd(n,o,i))})),s=Id(t.target.readonly,lc(r));return Au(o,e.map(o,(function(e){return 8})),s)}(n,t,a,r);if(_f(n))return function(t,r,n){var i=t.target.elementFlags,a=e.map(zl(t),(function(e,t){return Od(r,id(""+t),!!(2&i[t]),n)})),o=lc(r),s=4&o?e.map(i,(function(e){return 1&e?2:e})):8&o?e.map(i,(function(e){return 2&e?1:e})):i,c=Id(t.target.readonly,o);return e.contains(a,Me)?Me:Au(a,s,c,t.target.labeledElementDeclarations)}(n,t,Cd(a,n,r))}return Md(t,Cd(a,n,r))}return n}),n,i)}return Rd(nc(t),r)===Oe?Oe:Md(t,r,n,i)}function Id(e,t){return !!(1&t)||!(2&t)&&e}function Od(e,t,r,n){var i=Ed(n,rc(e),t),a=Rd(ac(e.target||e),i),o=lc(e);return H&&4&o&&!Eb(a,49152)?Df(a,!0):H&&8&o&&r?Jg(a,524288):a}function Md(e,t,r,n){var i=_a(64|e.objectFlags,e.symbol);if(32&e.objectFlags){i.declaration=e.declaration;var a=rc(e),o=kd(a);i.typeParameter=o,t=Td(bd(a,o),t),o.mapper=t;}return i.target=e,i.mapper=t,i.aliasSymbol=r||e.aliasSymbol,i.aliasTypeArguments=r?n:gd(e.aliasTypeArguments,t),i}function Ld(t,r,n,i){var a=t.root;if(a.outerTypeParameters){var o=e.map(a.outerTypeParameters,(function(e){return hd(e,r)})),s=Ml(o)+Ll(n,i),c=a.instantiations.get(s);if(!c){var l=vd(a.outerTypeParameters,o),u=a.checkType,_=a.isDistributive?hd(u,l):void 0;c=_&&u!==_&&1179648&_.flags?um(_,(function(e){return B_(a,Cd(u,e,l))}),n,i):B_(a,l,n,i),a.instantiations.set(s,c);}return c}return t}function Rd(e,t){return e&&t?Bd(e,t,void 0,void 0):e}function Bd(t,r,n,i){if(!$f(t))return t;if(100===C||D>=5e6)return null===e.tracing||void 0===e.tracing||e.tracing.instant("checkTypes","instantiateType_DepthLimit",{typeId:t.id,instantiationDepth:C,instantiationCount:D}),In(_,e.Diagnostics.Type_instantiation_is_excessively_deep_and_possibly_infinite),Me;x++,D++,C++;var a=function(t,r,n,i){var a=t.flags;if(262144&a)return hd(t,r);if(524288&a){var o=t.objectFlags;if(52&o){if(4&o&&!t.node){var s=t.resolvedTypeArguments,c=gd(s,r);return c!==s?wu(t.target,c):t}return 1024&o?function(t,r){var n=Rd(t.mappedType,r);if(!(32&e.getObjectFlags(n)))return t;var i=Rd(t.constraintType,r);if(!(4194304&i.flags))return t;var a=rg(Rd(t.source,r),n,i);return a||t}(t,r):function(t,r,n,i){var a=4&t.objectFlags?t.node:t.symbol.declarations[0],o=Qn(a),s=4&t.objectFlags?o.resolvedType:64&t.objectFlags?t.target:t,c=o.outerTypeParameters;if(!c){var l=Go(a,!0);if(Fh(a)){var u=$c(a);l=e.addRange(l,u);}c=l||e.emptyArray;var _=4&t.objectFlags?[a]:t.symbol.declarations;c=(4&s.objectFlags||8192&s.symbol.flags||2048&s.symbol.flags)&&!s.aliasTypeArguments?e.filter(c,(function(t){return e.some(_,(function(e){return Ad(t,e)}))})):c,o.outerTypeParameters=c;}if(c.length){var d=Td(t.mapper,r),p=e.map(c,(function(e){return hd(e,d)})),f=n||t.aliasSymbol,g=n?i:gd(t.aliasTypeArguments,r),m=Ml(p)+Ll(f,g);s.instantiations||(s.instantiations=new e.Map,s.instantiations.set(Ml(c)+Ll(s.aliasSymbol,s.aliasTypeArguments),s));var y=s.instantiations.get(m);if(!y){var v=vd(c,p);y=4&s.objectFlags?Jl(t.target,t.node,v,f,g):32&s.objectFlags?wd(s,v,f,g):Md(s,v,f,g),s.instantiations.set(m,y);}return y}return t}(t,r,n,i)}return t}if(3145728&a){var l=1048576&t.flags?t.origin:void 0,u=l&&3145728&l.flags?l.types:t.types,_=gd(u,r);if(_===u&&n===t.aliasSymbol)return t;var d=n||t.aliasSymbol,p=n?i:gd(t.aliasTypeArguments,r);return 2097152&a||l&&2097152&l.flags?$u(_,d,p):qu(_,1,d,p)}if(4194304&a)return c_(Rd(t.type,r));if(134217728&a)return u_(t.texts,gd(t.types,r));if(268435456&a)return d_(t.symbol,Rd(t.type,r));if(8388608&a)return d=n||t.aliasSymbol,p=n?i:gd(t.aliasTypeArguments,r),F_(Rd(t.objectType,r),Rd(t.indexType,r),t.accessFlags,void 0,d,p);if(16777216&a)return Ld(t,Td(t.mapper,r),n,i);if(33554432&a){var f=Rd(t.baseType,r);if(8650752&f.flags)return Xl(f,Rd(t.substitute,r));var g=Rd(t.substitute,r);return 3&g.flags||Yd(Jd(f),Jd(g))?f:g}return t}(t,r,n,i);return C--,a}function jd(e){return 262143&e.flags?e:e.permissiveInstantiation||(e.permissiveInstantiation=Rd(e,gt))}function Jd(e){return 262143&e.flags?e:(e.restrictiveInstantiation||(e.restrictiveInstantiation=Rd(e,ft),e.restrictiveInstantiation.restrictiveInstantiation=e.restrictiveInstantiation),e.restrictiveInstantiation)}function zd(e,t){return Nl(e.keyType,Rd(e.type,t),e.isReadonly,e.declaration)}function Ud(t){switch(e.Debug.assert(168!==t.kind||e.isObjectLiteralMethod(t)),t.kind){case 212:case 213:case 168:case 255:return Kd(t);case 204:return e.some(t.properties,Ud);case 203:return e.some(t.elements,Ud);case 221:return Ud(t.whenTrue)||Ud(t.whenFalse);case 220:return (56===t.operatorToken.kind||60===t.operatorToken.kind)&&(Ud(t.left)||Ud(t.right));case 294:return Ud(t.initializer);case 211:return Ud(t.expression);case 285:return e.some(t.properties,Ud)||e.isJsxOpeningElement(t.parent)&&e.some(t.parent.parent.children,Ud);case 284:var r=t.initializer;return !!r&&Ud(r);case 287:var n=t.expression;return !!n&&Ud(n)}return !1}function Kd(t){return (!e.isFunctionDeclaration(t)||e.isInJSFile(t)&&!!po(t))&&(e.hasContextSensitiveParameters(t)||function(t){return !t.typeParameters&&!e.getEffectiveReturnTypeNode(t)&&!!t.body&&234!==t.body.kind&&Ud(t.body)}(t))}function Vd(t){return (e.isInJSFile(t)&&e.isFunctionDeclaration(t)||e.isFunctionExpressionOrArrowFunction(t)||e.isObjectLiteralMethod(t))&&Kd(t)}function qd(t){if(524288&t.flags){var r=pc(t);if(r.constructSignatures.length||r.callSignatures.length){var n=_a(16,t.symbol);return n.members=r.members,n.properties=r.properties,n.callSignatures=e.emptyArray,n.constructSignatures=e.emptyArray,n.indexInfos=e.emptyArray,n}}else if(2097152&t.flags)return $u(e.map(t.types,qd));return t}function Wd(e,t){return hp(e,t,Tn)}function Hd(e,t){return hp(e,t,Tn)?-1:0}function Gd(e,t){return hp(e,t,Dn)?-1:0}function Qd(e,t){return hp(e,t,bn)?-1:0}function Xd(e,t){return hp(e,t,bn)}function Yd(e,t){return hp(e,t,Dn)}function Zd(t,r){return 1048576&t.flags?e.every(t.types,(function(e){return Zd(e,r)})):1048576&r.flags?e.some(r.types,(function(e){return Zd(t,e)})):58982400&t.flags?Zd(Tc(t)||je,r):r===Pt?!!(67633152&t.flags):r===wt?!!(524288&t.flags)&&Bg(t):Wo(t,qo(r))||qp(r)&&!Wp(r)&&Zd(t,Lt)}function $d(e,t){return hp(e,t,Sn)}function ep(e,t){return $d(e,t)||$d(t,e)}function tp(e,t,r,n,i,a){return Dp(e,t,Dn,r,n,i,a)}function rp(e,t,r,n,i,a){return np(e,t,Dn,r,n,i,a,void 0)}function np(e,t,r,n,i,a,o,s){return !!hp(e,t,r)||(!n||!ap(i,e,t,r,a,o,s))&&Dp(e,t,r,n,a,o,s)}function ip(t){return !!(16777216&t.flags||2097152&t.flags&&e.some(t.types,ip))}function ap(t,r,n,a,s,c,l){if(!t||ip(n))return !1;if(!Dp(r,n,a,void 0)&&function(t,r,n,i,a,o,s){for(var c=Uc(r,0),l=Uc(r,1),u=0,_=[l,c];u<_.length;u++){var d=_[u];if(e.some(d,(function(e){var t=ml(e);return !(131073&t.flags)&&Dp(t,n,i,void 0)}))){var p=s||{};tp(r,n,t,a,o,p);var f=p.errors[p.errors.length-1];return e.addRelatedInfo(f,e.createDiagnosticForNode(t,d===l?e.Diagnostics.Did_you_mean_to_use_new_with_this_expression:e.Diagnostics.Did_you_mean_to_call_this_expression)),!0}}return !1}(t,r,n,a,s,c,l))return !0;switch(t.kind){case 287:case 211:return ap(t.expression,r,n,a,s,c,l);case 220:switch(t.operatorToken.kind){case 63:case 27:return ap(t.right,r,n,a,s,c,l)}break;case 204:return function(t,r,n,i,a,s){return !(131068&n.flags)&&cp(function(t){var r,n,i,a;return o(this,(function(o){switch(o.label){case 0:if(!e.length(t.properties))return [2];r=0,n=t.properties,o.label=1;case 1:if(!(r<n.length))return [3,8];if(i=n[r],e.isSpreadAssignment(i))return [3,7];if(!(a=a_($i(i),8576))||131072&a.flags)return [3,7];switch(i.kind){case 172:case 171:case 168:case 295:return [3,2];case 294:return [3,4]}return [3,6];case 2:return [4,{errorNode:i.name,innerExpression:void 0,nameType:a}];case 3:return o.sent(),[3,7];case 4:return [4,{errorNode:i.name,innerExpression:i.initializer,nameType:a,errorMessage:e.isComputedNonLiteralName(i.name)?e.Diagnostics.Type_of_computed_property_s_value_is_0_which_is_not_assignable_to_type_1:void 0}];case 5:return o.sent(),[3,7];case 6:e.Debug.assertNever(i),o.label=7;case 7:return r++,[3,1];case 8:return [2]}}))}(t),r,n,i,a,s)}(t,r,n,a,c,l);case 203:return function(e,t,r,n,i,a){if(131068&r.flags)return !1;if($p(t))return cp(up(e,r),t,r,n,i,a);var o=e.contextualType;e.contextualType=r;try{var s=Ty(e,1,!0);return e.contextualType=o,!!$p(s)&&cp(up(e,r),s,r,n,i,a)}finally{e.contextualType=o;}}(t,r,n,a,c,l);case 285:return function(t,r,n,a,s,c){var l,u=cp(function(t){var r,n,i;return o(this,(function(a){switch(a.label){case 0:if(!e.length(t.properties))return [2];r=0,n=t.properties,a.label=1;case 1:return r<n.length?(i=n[r],e.isJsxSpreadAttribute(i)||Iy(e.idText(i.name))?[3,3]:[4,{errorNode:i.name,innerExpression:i.initializer,nameType:id(e.idText(i.name))}]):[3,4];case 2:a.sent(),a.label=3;case 3:return r++,[3,1];case 4:return [2]}}))}(t),r,n,a,s,c);if(e.isJsxOpeningElement(t.parent)&&e.isJsxElement(t.parent.parent)){var _=t.parent.parent,d=Ky(zy(t)),p=void 0===d?"children":e.unescapeLeadingUnderscores(d),f=id(p),g=F_(n,f),m=e.getSemanticJsxChildren(_.children);if(!e.length(m))return u;var y=e.length(m)>1,v=om(g,ef),h=om(g,(function(e){return !ef(e)}));if(y){if(v!==nt){var b=Au(Ly(_,0));u=cp(function(t,r){var n,i,a,s,c;return o(this,(function(o){switch(o.label){case 0:if(!e.length(t.children))return [2];n=0,i=0,o.label=1;case 1:return i<t.children.length?(a=t.children[i],s=ad(i-n),(c=lp(a,s,r))?[4,c]:[3,3]):[3,5];case 2:return o.sent(),[3,4];case 3:n++,o.label=4;case 4:return i++,[3,1];case 5:return [2]}}))}(_,S),b,v,a,s,c)||u;}else if(!hp(F_(r,f),g,a)){u=!0;var x=In(_.openingElement.tagName,e.Diagnostics.This_JSX_tag_s_0_prop_expects_a_single_child_of_type_1_but_multiple_children_were_provided,p,Ma(g));c&&c.skipLogging&&(c.errors||(c.errors=[])).push(x);}}else if(h!==nt){var D=lp(m[0],f,S);D&&(u=cp(function(){return o(this,(function(e){switch(e.label){case 0:return [4,D];case 1:return e.sent(),[2]}}))}(),r,n,a,s,c)||u);}else hp(F_(r,f),g,a)||(u=!0,x=In(_.openingElement.tagName,e.Diagnostics.This_JSX_tag_s_0_prop_expects_type_1_which_requires_multiple_children_but_only_a_single_child_was_provided,p,Ma(g)),c&&c.skipLogging&&(c.errors||(c.errors=[])).push(x));}return u;function S(){if(!l){var r=e.getTextOfNode(t.parent.tagName),a=Ky(zy(t)),o=void 0===a?"children":e.unescapeLeadingUnderscores(a),s=F_(n,id(o)),c=e.Diagnostics._0_components_don_t_accept_text_as_child_elements_Text_in_JSX_has_the_type_string_but_the_expected_type_of_1_is_2;l=i$1(i$1({},c),{key:"!!ALREADY FORMATTED!!",message:e.formatMessage(void 0,c,r,o,Ma(s))});}return l}}(t,r,n,a,c,l);case 213:return function(t,r,n,i,a,o){if(e.isBlock(t.body))return !1;if(e.some(t.parameters,e.hasType))return !1;var s=Qv(r);if(!s)return !1;var c=Uc(n,0);if(!e.length(c))return !1;var l=t.body,u=ml(s),_=qu(e.map(c,ml));if(!Dp(u,_,i,void 0)){var d=l&&ap(l,u,_,i,void 0,a,o);if(d)return d;var p=o||{};if(Dp(u,_,i,l,void 0,a,p),p.errors)return n.symbol&&e.length(n.symbol.declarations)&&e.addRelatedInfo(p.errors[p.errors.length-1],e.createDiagnosticForNode(n.symbol.declarations[0],e.Diagnostics.The_expected_type_comes_from_the_return_type_of_this_signature)),0==(2&e.getFunctionFlags(t))&&!eo(u,"then")&&Dp(cb(u),_,i,void 0)&&e.addRelatedInfo(p.errors[p.errors.length-1],e.createDiagnosticForNode(t,e.Diagnostics.Did_you_mean_to_mark_this_function_as_async)),!0}return !1}(t,r,n,a,c,l)}return !1}function op(e,t,r){var n=P_(t,r);if(n)return n;if(1048576&t.flags){var i=Ep(e,t);if(i)return P_(i,r)}}function sp(e,t){e.contextualType=t;try{return Hb(e,1,t)}finally{e.contextualType=void 0;}}function cp(t,r,n,i,a,o){for(var s=!1,c=t.next();!c.done;c=t.next()){var l=c.value,u=l.errorNode,_=l.innerExpression,d=l.nameType,p=l.errorMessage,f=op(r,n,d);if(f&&!(8388608&f.flags)){var g=P_(r,d);if(g){var m=f_(d,void 0);if(!Dp(g,f,i,void 0)&&(s=!0,!_||!ap(_,g,f,i,void 0,a,o))){var y=o||{},v=_?sp(_,g):g;if(re&&Cp(v,f)){var h=e.createDiagnosticForNode(u,e.Diagnostics.Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_type_of_the_target,Ma(v),Ma(f));mn.add(h),y.errors=[h];}else {var b=!!(m&&16777216&(Jc(n,m)||Ne).flags),x=!!(m&&16777216&(Jc(r,m)||Ne).flags);f=Nf(f,b),g=Nf(g,b&&x),Dp(v,f,i,u,p,a,y)&&v!==g&&Dp(g,f,i,u,p,a,y);}if(y.errors){var D=y.errors[y.errors.length-1],S=Es(d)?Ps(d):void 0,T=void 0!==S?Jc(n,S):void 0,C=!1;if(!T){var E=Yc(n,d);E&&E.declaration&&!e.getSourceFileOfNode(E.declaration).hasNoDefaultLib&&(C=!0,e.addRelatedInfo(D,e.createDiagnosticForNode(E.declaration,e.Diagnostics.The_expected_type_comes_from_this_index_signature)));}if(!C&&(T&&e.length(T.declarations)||n.symbol&&e.length(n.symbol.declarations))){var k=T&&e.length(T.declarations)?T.declarations[0]:n.symbol.declarations[0];e.getSourceFileOfNode(k).hasNoDefaultLib||e.addRelatedInfo(D,e.createDiagnosticForNode(k,e.Diagnostics.The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1,!S||8192&d.flags?Ma(d):e.unescapeLeadingUnderscores(S),Ma(n)));}}}}}}return s}function lp(t,r,n){switch(t.kind){case 287:return {errorNode:t,innerExpression:t.expression,nameType:r};case 11:if(t.containsOnlyTriviaWhiteSpaces)break;return {errorNode:t,innerExpression:void 0,nameType:r,errorMessage:n()};case 277:case 278:case 281:return {errorNode:t,innerExpression:t,nameType:r};default:return e.Debug.assertNever(t,"Found invalid jsx child")}}function up(t,r){var n,i,a,s;return o(this,(function(o){switch(o.label){case 0:if(!(n=e.length(t.elements)))return [2];i=0,o.label=1;case 1:return i<n?$p(r)&&!Jc(r,""+i)?[3,3]:(a=t.elements[i],e.isOmittedExpression(a)?[3,3]:(s=ad(i),[4,{errorNode:a,innerExpression:a,nameType:s}])):[3,4];case 2:o.sent(),o.label=3;case 3:return i++,[3,1];case 4:return [2]}}))}function _p(e,t,r,n,i){return Dp(e,t,Sn,r,n,i)}function dp(t,r,n,i,a,o,s,c){if(t===r)return -1;if(!(l=r).typeParameters&&(!l.thisParameter||to(Kh(l.thisParameter)))&&1===l.parameters.length&&J(l)&&(Kh(l.parameters[0])===Ut||to(Kh(l.parameters[0])))&&to(ml(l)))return -1;var l,u,_=Zh(r);if(!eb(r)&&(8&n?eb(t)||Zh(t)>_:$h(t)>_))return 0;t.typeParameters&&t.typeParameters!==r.typeParameters&&(t=Zv(t,r=(u=r).typeParameters?u.canonicalSignatureCache||(u.canonicalSignatureCache=function(t){return bl(t,e.map(t.typeParameters,(function(e){return e.target&&!hc(e.target)?e.target:e})),e.isInJSFile(t.declaration))}(u)):u,void 0,s));var d=Zh(t),p=rb(t),f=rb(r);if((p||f)&&Rd(p||f,c),p&&f&&d!==_)return 0;var g=r.declaration?r.declaration.kind:0,m=!(3&n)&&G&&168!==g&&167!==g&&170!==g,y=-1,v=pl(t);if(v&&v!==rt){var h=pl(r);if(h){if(!(C=!m&&s(v,h,!1)||s(h,v,i)))return i&&a(e.Diagnostics.The_this_types_of_each_signature_are_incompatible),0;y&=C;}}for(var b=p||f?Math.min(d,_):Math.max(d,_),x=p||f?b-1:-1,D=0;D<b;D++){var S=D===x?Yh(t,D):Xh(t,D),T=D===x?Yh(r,D):Xh(r,D);if(S&&T){var C,E=3&n?void 0:Qv(Sf(S)),k=3&n?void 0:Qv(Sf(T));if((C=E&&k&&!fl(E)&&!fl(k)&&(98304&vf(S))==(98304&vf(T))?dp(k,E,8&n|(m?2:1),i,a,o,s,c):!(3&n)&&!m&&s(S,T,!1)||s(T,S,i))&&8&n&&D>=$h(t)&&D<$h(r)&&s(S,T,!1)&&(C=0),!C)return i&&a(e.Diagnostics.Types_of_parameters_0_and_1_are_incompatible,e.unescapeLeadingUnderscores(qh(t,D)),e.unescapeLeadingUnderscores(qh(r,D))),0;y&=C;}}if(!(4&n)){var N=vl(r)?we:r.declaration&&Fh(r.declaration)?ss(Zi(r.declaration.symbol)):ml(r);if(N===rt)return y;var F=vl(t)?we:t.declaration&&Fh(t.declaration)?ss(Zi(t.declaration.symbol)):ml(t),A=fl(r);if(A){var P=fl(t);if(P)y&=function(t,r,n,i,a){if(t.kind!==r.kind)return n&&(i(e.Diagnostics.A_this_based_type_guard_is_not_compatible_with_a_parameter_based_type_guard),i(e.Diagnostics.Type_predicate_0_is_not_assignable_to_1,za(t),za(r))),0;if((1===t.kind||3===t.kind)&&t.parameterIndex!==r.parameterIndex)return n&&(i(e.Diagnostics.Parameter_0_is_not_in_the_same_position_as_parameter_1,t.parameterName,r.parameterName),i(e.Diagnostics.Type_predicate_0_is_not_assignable_to_1,za(t),za(r))),0;var o=t.type===r.type?-1:t.type&&r.type?a(t.type,r.type,n):0;return 0===o&&n&&i(e.Diagnostics.Type_predicate_0_is_not_assignable_to_1,za(t),za(r)),o}(P,A,i,a,s);else if(e.isIdentifierTypePredicate(A))return i&&a(e.Diagnostics.Signature_0_must_be_a_type_predicate,Oa(t)),0}else !(y&=1&n&&s(N,F,!1)||s(F,N,i))&&i&&o&&o(F,N);}return y}function pp(e){return e!==xt&&0===e.properties.length&&0===e.callSignatures.length&&0===e.constructSignatures.length&&0===e.indexInfos.length}function fp(t){return 524288&t.flags?!dc(t)&&pp(pc(t)):!!(67108864&t.flags)||(1048576&t.flags?e.some(t.types,fp):!!(2097152&t.flags)&&e.every(t.types,fp))}function gp(t){return !!(16&e.getObjectFlags(t)&&(t.members&&pp(t)||t.symbol&&2048&t.symbol.flags&&0===Os(t.symbol).size))}function mp(t){return 524288&t.flags&&!dc(t)&&0===yc(t).length&&1===Hc(t).length&&!!Gc(t,He)||3145728&t.flags&&e.every(t.types,mp)||!1}function yp(t,r,n){if(t===r)return !0;var i=M(t)+","+M(r),a=Cn.get(i);if(void 0!==a&&(4&a||!(2&a)||!n))return !!(1&a);if(!(t.escapedName===r.escapedName&&256&t.flags&&256&r.flags))return Cn.set(i,6),!1;for(var o=Uo(r),s=0,c=yc(Uo(t));s<c.length;s++){var l=c[s];if(8&l.flags){var u=Jc(o,l.escapedName);if(!(u&&8&u.flags))return n?(n(e.Diagnostics.Property_0_is_missing_in_type_1,e.symbolName(l),Ma(ms(r),void 0,64)),Cn.set(i,6)):Cn.set(i,2),!1}}return Cn.set(i,1),!0}function vp(e,t,r,n){var i=e.flags,a=t.flags;if(3&a||131072&i||e===Oe)return !0;if(131072&a)return !1;if(402653316&i&&4&a)return !0;if(128&i&&1024&i&&128&a&&!(1024&a)&&e.value===t.value)return !0;if(296&i&&8&a)return !0;if(256&i&&1024&i&&256&a&&!(1024&a)&&e.value===t.value)return !0;if(2112&i&&64&a)return !0;if(528&i&&16&a)return !0;if(12288&i&&4096&a)return !0;if(32&i&&32&a&&yp(e.symbol,t.symbol,n))return !0;if(1024&i&&1024&a){if(1048576&i&&1048576&a&&yp(e.symbol,t.symbol,n))return !0;if(2944&i&&2944&a&&e.value===t.value&&yp(ea(e.symbol),ea(t.symbol),n))return !0}if(32768&i&&(!H||49152&a))return !0;if(65536&i&&(!H||65536&a))return !0;if(524288&i&&67108864&a)return !0;if(r===Dn||r===Sn){if(1&i)return !0;if(264&i&&!(1024&i)&&(32&a||r===Dn&&256&a&&1024&a))return !0}return !1}function hp(e,t,r){if(nd(e)&&(e=e.regularType),nd(t)&&(t=t.regularType),e===t)return !0;if(r!==Tn){if(r===Sn&&!(131072&t.flags)&&vp(t,e,r)||vp(e,t,r))return !0}else {if(e.flags!==t.flags)return !1;if(67358815&e.flags)return !0}if(524288&e.flags&&524288&t.flags){var n=r.get(Mp(e,t,0,r,!1));if(void 0!==n)return !!(1&n)}return !!(469499904&e.flags||469499904&t.flags)&&Dp(e,t,r,void 0)}function bp(t,r){return 2048&e.getObjectFlags(t)&&Iy(r.escapedName)}function xp(t,r){for(;;){var n=nd(t)?t.regularType:4&e.getObjectFlags(t)&&t.node?Bl(t.target,zl(t)):3145728&t.flags?Mc(t):33554432&t.flags?r?t.baseType:t.substitute:25165824&t.flags?C_(t,r):t;if((n=Xp(n)||n)===t)break;t=n;}return t}function Dp(t,r,i,a,o,s,c){var u,d,p,f,g,m,y=0,v=0,h=0,b=0,x=!1,D=0,S=[],T=!1;e.Debug.assert(i!==Tn||!a,"no error reporting in identity checking");var C=J(t,r,3,!!a,o);if(S.length&&M(),x){null===e.tracing||void 0===e.tracing||e.tracing.instant("checkTypes","checkTypeRelatedTo_DepthLimit",{sourceId:t.id,targetId:r.id,depth:v,targetDepth:h});var E=In(a||_,e.Diagnostics.Excessive_stack_depth_comparing_types_0_and_1,Ma(t),Ma(r));c&&(c.errors||(c.errors=[])).push(E);}else if(u){if(s){var k=s();k&&(e.concatenateDiagnosticMessageChains(k,u),u=k);}var N=void 0;if(o&&a&&!C&&t.symbol){var F=Gn(t.symbol);if(F.originatingImport&&!e.isImportCall(F.originatingImport)&&Dp(Uo(F.target),r,i,void 0)){var P=e.createDiagnosticForNode(F.originatingImport,e.Diagnostics.Type_originates_at_this_import_A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime_Consider_using_a_default_import_or_import_require_here_instead);N=e.append(N,P);}}E=e.createDiagnosticForNodeFromMessageChain(a,u,N),d&&e.addRelatedInfo.apply(void 0,n$3([E],d,!1)),c&&(c.errors||(c.errors=[])).push(E),c&&c.skipLogging||mn.add(E);}return a&&c&&c.skipLogging&&0===C&&e.Debug.assert(!!c.errors,"missed opportunity to interact with error."),0!==C;function w(e){u=e.errorInfo,m=e.lastSkippedInfo,S=e.incompatibleStack,D=e.overrideNextErrorInfo,d=e.relatedInfo;}function I(){return {errorInfo:u,lastSkippedInfo:m,incompatibleStack:S.slice(),overrideNextErrorInfo:D,relatedInfo:d?d.slice():void 0}}function O(e,t,r,n,i){D++,m=void 0,S.push([e,t,r,n,i]);}function M(){var t=S;S=[];var r=m;if(m=void 0,1===t.length)return L.apply(void 0,t[0]),void(r&&R.apply(void 0,n$3([void 0],r,!1)));for(var i="",a=[];t.length;){var o=t.pop(),s=o[0],c=o.slice(1);switch(s.code){case e.Diagnostics.Types_of_property_0_are_incompatible.code:0===i.indexOf("new ")&&(i="(".concat(i,")"));var l=""+c[0];i=0===i.length?"".concat(l):e.isIdentifierText(l,e.getEmitScriptTarget(U))?"".concat(i,".").concat(l):"["===l[0]&&"]"===l[l.length-1]?"".concat(i).concat(l):"".concat(i,"[").concat(l,"]");break;case e.Diagnostics.Call_signature_return_types_0_and_1_are_incompatible.code:case e.Diagnostics.Construct_signature_return_types_0_and_1_are_incompatible.code:case e.Diagnostics.Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1.code:case e.Diagnostics.Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1.code:if(0===i.length){var u=s;s.code===e.Diagnostics.Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1.code?u=e.Diagnostics.Call_signature_return_types_0_and_1_are_incompatible:s.code===e.Diagnostics.Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1.code&&(u=e.Diagnostics.Construct_signature_return_types_0_and_1_are_incompatible),a.unshift([u,c[0],c[1]]);}else {var _=s.code===e.Diagnostics.Construct_signature_return_types_0_and_1_are_incompatible.code||s.code===e.Diagnostics.Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1.code?"new ":"",d=s.code===e.Diagnostics.Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1.code||s.code===e.Diagnostics.Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1.code?"":"...";i="".concat(_).concat(i,"(").concat(d,")");}break;case e.Diagnostics.Type_at_position_0_in_source_is_not_compatible_with_type_at_position_1_in_target.code:a.unshift([e.Diagnostics.Type_at_position_0_in_source_is_not_compatible_with_type_at_position_1_in_target,c[0],c[1]]);break;case e.Diagnostics.Type_at_positions_0_through_1_in_source_is_not_compatible_with_type_at_position_2_in_target.code:a.unshift([e.Diagnostics.Type_at_positions_0_through_1_in_source_is_not_compatible_with_type_at_position_2_in_target,c[0],c[1],c[2]]);break;default:return e.Debug.fail("Unhandled Diagnostic: ".concat(s.code))}}i?L(")"===i[i.length-1]?e.Diagnostics.The_types_returned_by_0_are_incompatible_between_these_types:e.Diagnostics.The_types_of_0_are_incompatible_between_these_types,i):a.shift();for(var p=0,f=a;p<f.length;p++){var g=f[p],y=(s=g[0],c=g.slice(1),s.elidedInCompatabilityPyramid);s.elidedInCompatabilityPyramid=!1,L.apply(void 0,n$3([s],c,!1)),s.elidedInCompatabilityPyramid=y;}r&&R.apply(void 0,n$3([void 0],r,!1));}function L(t,r,n,i,o){e.Debug.assert(!!a),S.length&&M(),t.elidedInCompatabilityPyramid||(u=e.chainDiagnosticMessages(u,t,r,n,i,o));}function R(t,r,n){S.length&&M();var a=La(r,n),o=a[0],s=a[1],c=r,l=o;if(af(r)&&!Sp(n)&&(c=of(r),e.Debug.assert(!Yd(c,n),"generalized source shouldn't be assignable"),l=Ra(c)),262144&n.flags){var _=Tc(n),d=void 0;_&&(Yd(c,_)||(d=Yd(r,_)))?L(e.Diagnostics._0_is_assignable_to_the_constraint_of_type_1_but_1_could_be_instantiated_with_a_different_subtype_of_constraint_2,d?o:l,s,Ma(_)):(u=void 0,L(e.Diagnostics._0_could_be_instantiated_with_an_arbitrary_type_which_could_be_unrelated_to_1,s,l));}if(t)t===e.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1&&re&&Tp(r,n).length&&(t=e.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties);else if(i===Sn)t=e.Diagnostics.Type_0_is_not_comparable_to_type_1;else if(o===s)t=e.Diagnostics.Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated;else if(re&&Tp(r,n).length)t=e.Diagnostics.Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties;else {if(128&r.flags&&1048576&n.flags){var p=function(t,r){var n=r.types.filter((function(e){return !!(128&e.flags)}));return e.getSpellingSuggestion(t.value,n,(function(e){return e.value}))}(r,n);if(p)return void L(e.Diagnostics.Type_0_is_not_assignable_to_type_1_Did_you_mean_2,l,s,Ma(p))}t=e.Diagnostics.Type_0_is_not_assignable_to_type_1;}L(t,l,s);}function B(t,r,n){return _f(t)?t.target.readonly&&Hp(r)?(n&&L(e.Diagnostics.The_type_0_is_readonly_and_cannot_be_assigned_to_the_mutable_type_1,Ma(t),Ma(r)),!1):_f(r)||qp(r):Wp(t)&&Hp(r)?(n&&L(e.Diagnostics.The_type_0_is_readonly_and_cannot_be_assigned_to_the_mutable_type_1,Ma(t),Ma(r)),!1):!_f(r)||qp(t)}function j(e,t,r){return J(e,t,3,r)}function J(t,r,n,o,s,c){if(void 0===n&&(n=3),void 0===o&&(o=!1),void 0===c&&(c=0),524288&t.flags&&131068&r.flags)return vp(t,r,i,o?L:void 0)?-1:(E(t,r,0,!!(2048&e.getObjectFlags(t))),0);var l=xp(t,!1),_=xp(r,!0);if(l===_)return -1;if(i===Tn)return function(e,t,r){if(e.flags!==t.flags)return 0;if(67358815&e.flags)return -1;if(z(e,t),3145728&e.flags){var n=K(e,t);return n&&(n&=K(t,e)),n}return W(e,t,!1,0,r)}(l,_,n);if(262144&l.flags&&vc(l)===_)return -1;if(1048576&_.flags&&524288&l.flags&&_.types.length<=3&&Eb(_,98304)){var d=dm(_,-98305);if(1179648&d.flags||(_=xp(d,!0)),l===d)return -1}if(i===Sn&&!(131072&_.flags)&&vp(_,l,i)||vp(l,_,i,o?L:void 0))return -1;var p=!!(2048&e.getObjectFlags(l)),f=!(2&c)&&yg(l)&&16384&e.getObjectFlags(l);if(f&&function(t,r,n){var o;if(!Zy(r)||!Y&&8192&e.getObjectFlags(r))return !1;var s=!!(2048&e.getObjectFlags(t));if((i===Dn||i===Sn)&&(rm(Pt,r)||!s&&fp(r)))return !1;var c,l=r;1048576&r.flags&&(l=rC(t,r,J)||function(e){if(Eb(e,67108864)){var t=om(e,(function(e){return !(131068&e.flags)}));if(!(131072&t.flags))return t}return e}(r),c=1048576&l.flags?l.types:[l]);for(var u=function(r){if(function(e,t){return e.valueDeclaration&&t.valueDeclaration&&e.valueDeclaration.parent===t.valueDeclaration}(r,t.symbol)&&!bp(t,r)){if(!Yy(l,r.escapedName,s)){if(n){var i=om(l,Zy);if(!a)return {value:e.Debug.fail()};if(e.isJsxAttributes(a)||e.isJsxOpeningLikeElement(a)||e.isJsxOpeningLikeElement(a.parent)){r.valueDeclaration&&e.isJsxAttribute(r.valueDeclaration)&&e.getSourceFileOfNode(a)===e.getSourceFileOfNode(r.valueDeclaration.name)&&(a=r.valueDeclaration.name);var u=Ia(r),_=Nv(u,i);(p=_?Ia(_):void 0)?L(e.Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2,u,Ma(i),p):L(e.Diagnostics.Property_0_does_not_exist_on_type_1,u,Ma(i));}else {var d=(null===(o=t.symbol)||void 0===o?void 0:o.declarations)&&e.firstOrUndefined(t.symbol.declarations),p=void 0;if(r.valueDeclaration&&e.findAncestor(r.valueDeclaration,(function(e){return e===d}))&&e.getSourceFileOfNode(d)===e.getSourceFileOfNode(a)){var f=r.valueDeclaration;e.Debug.assertNode(f,e.isObjectLiteralElementLike),a=f;var g=f.name;e.isIdentifier(g)&&(p=Fv(g,i));}void 0!==p?L(e.Diagnostics.Object_literal_may_only_specify_known_properties_but_0_does_not_exist_in_type_1_Did_you_mean_to_write_2,Ia(r),Ma(i),p):L(e.Diagnostics.Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1,Ia(r),Ma(i));}}return {value:!0}}if(c&&!J(Uo(r),function(t,r){return qu(e.reduceLeft(t,(function(t,n){var i,a=3145728&(n=Ac(n)).flags?Oc(n,r):gc(n,r),o=a&&Uo(a)||(null===(i=Zc(n,r))||void 0===i?void 0:i.type)||ze;return e.append(t,o)}),void 0)||e.emptyArray)}(c,r.escapedName),3,n))return n&&O(e.Diagnostics.Types_of_property_0_are_incompatible,Ia(r)),{value:!0}}},_=0,d=yc(t);_<d.length;_++){var p=u(d[_]);if("object"==typeof p)return p.value}return !1}(l,_,o))return o&&R(s,l,r.aliasSymbol?r:_),0;var g=i!==Sn&&!(2&c)&&2752508&l.flags&&l!==Pt&&2621440&_.flags&&Np(_)&&(yc(l).length>0||US(l));if(g&&!function(e,t,r){for(var n=0,i=yc(e);n<i.length;n++)if(Yy(t,i[n].escapedName,r))return !0;return !1}(l,_,p)){if(o){var y=Ma(t.aliasSymbol?t:l),v=Ma(r.aliasSymbol?r:_),h=Uc(l,0),b=Uc(l,1);h.length>0&&J(ml(h[0]),_,1,!1)||b.length>0&&J(ml(b[0]),_,1,!1)?L(e.Diagnostics.Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it,y,v):L(e.Diagnostics.Type_0_has_no_properties_in_common_with_type_1,y,v);}return 0}z(l,_);var x=0,S=I();if((1048576&l.flags||1048576&_.flags)&&_m(l)*_m(_)<4?x=G(l,_,o,8|c):(3145728&l.flags||3145728&_.flags)&&(x=W(l,_,o,8|c,n)),x||1048576&l.flags||!(469499904&l.flags||469499904&_.flags)||(x=W(l,_,o,c,n))&&w(S),!x&&2359296&l.flags){var C=function(t,r){for(var n,i=!1,a=0,o=t;a<o.length;a++)if(465829888&(u=o[a]).flags){for(var s=vc(u);s&&21233664&s.flags;)s=vc(s);s&&(n=e.append(n,s),r&&(n=e.append(n,u)));}else 469892092&u.flags&&(i=!0);if(n&&(r||i)){if(i)for(var c=0,l=t;c<l.length;c++){var u;469892092&(u=l[c]).flags&&(n=e.append(n,u));}return $u(n)}}(2097152&l.flags?l.types:[l],!!(1048576&_.flags));C&&(2097152&l.flags||1048576&_.flags)&&am(C,(function(e){return e!==l}))&&(x=J(C,_,1,!1,void 0,c))&&w(S);}return x&&!T&&(2097152&_.flags&&(f||g)||G_(_)&&!qp(_)&&!_f(_)&&2097152&l.flags&&3670016&Ac(l).flags&&!e.some(l.types,(function(t){return !!(524288&e.getObjectFlags(t))})))&&(T=!0,x&=W(l,_,o,4,n),T=!1),E(l,_,x,p),x;function E(n,i,c,l){if(!c&&o){var _=!!Xp(t),d=!!Xp(r);n=t.aliasSymbol||_?t:n,i=r.aliasSymbol||d?r:i;var p=D>0;if(p&&D--,524288&n.flags&&524288&i.flags){var f=u;B(n,i,o),u!==f&&(p=!!u);}if(524288&n.flags&&131068&i.flags)!function(t,r){var n=Ba(t.symbol)?Ma(t,t.symbol.valueDeclaration):Ma(t),i=Ba(r.symbol)?Ma(r,r.symbol.valueDeclaration):Ma(r);(Rt===t&&He===r||Bt===t&&Ge===r||jt===t&&et===r||gu(!1)===t&&tt===r)&&L(e.Diagnostics._0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible,i,n);}(n,i);else if(n.symbol&&524288&n.flags&&Pt===n)L(e.Diagnostics.The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead);else if(l&&2097152&i.flags){var g=i.types,y=By(A.IntrinsicAttributes,a),v=By(A.IntrinsicClassAttributes,a);if(!ro(y)&&!ro(v)&&(e.contains(g,y)||e.contains(g,v)))return c}else u=jc(u,r);if(!s&&p)return m=[n,i],c;R(s,n,i);}}}function z(t,r){if(e.tracing&&3145728&t.flags&&3145728&r.flags){var n=t,i=r;if(n.objectFlags&i.objectFlags&65536)return;var o=n.types.length,s=i.types.length;o*s>1e6&&e.tracing.instant("checkTypes","traceUnionsOrIntersectionsTooLarge_DepthLimit",{sourceId:t.id,sourceSize:o,targetId:r.id,targetSize:s,pos:null==a?void 0:a.pos,end:null==a?void 0:a.end});}}function K(e,t){for(var r=-1,n=0,i=e.types;n<i.length;n++){var a=V(i[n],t,!1);if(!a)return 0;r&=a;}return r}function V(e,t,r){var n=t.types;if(1048576&t.flags){if(ju(n,e))return -1;var i=Og(t,e);if(i&&(s=J(e,i,2,!1)))return s}for(var a=0,o=n;a<o.length;a++){var s;if(s=J(e,o[a],2,!1))return s}return r&&J(e,Ep(e,t,J)||n[n.length-1],2,!0),0}function q(e,t,r,n){var i=e.types;if(1048576&e.flags&&ju(i,t))return -1;for(var a=i.length,o=0;o<a;o++){var s=J(i[o],t,1,r&&o===a-1,void 0,n);if(s)return s}return 0}function W(t,r,n,a,o){if(x)return 0;var s=a|(T?16:0),c=Mp(t,r,s,i,!1),l=i.get(c);if(void 0!==l&&(!(n&&2&l)||4&l)){if(Sr){var u=24&l;8&u&&Rd(t,xd(Q)),16&u&&Rd(t,xd(X));}return 1&l?-1:0}if(p){for(var _=c.startsWith("*")?Mp(t,r,s,i,!0):void 0,d=0;d<y;d++)if(c===p[d]||_&&_===p[d])return 3;if(100===v||100===h)return x=!0,0}else p=[],f=[],g=[];var m=y;p[y]=c,y++;var D,S=b;1&o&&(f[v]=t,v++,1&b||!jp(t,f,v)||(b|=1)),2&o&&(g[h]=r,h++,2&b||!jp(r,g,h)||(b|=2));var C=0;Sr&&(D=Sr,Sr=function(e){return C|=e?16:8,D(e)}),3===b&&(null===e.tracing||void 0===e.tracing||e.tracing.instant("checkTypes","recursiveTypeRelatedTo_DepthLimit",{sourceId:t.id,sourceIdStack:f.map((function(e){return e.id})),targetId:r.id,targetIdStack:g.map((function(e){return e.id})),depth:v,targetDepth:h}));var E=3!==b?G(t,r,n,a):3;if(Sr&&(Sr=D),1&o&&v--,2&o&&h--,b=S,E){if(-1===E||0===v&&0===h){if(-1===E||3===E)for(d=m;d<y;d++)i.set(p[d],1|C);y=m;}}else i.set(c,2|(n?4:0)|C),y=m;return E}function G(t,r,a,o){null===e.tracing||void 0===e.tracing||e.tracing.push("checkTypes","structuredTypeRelatedTo",{sourceId:t.id,targetId:r.id});var s=function(t,r,a,o){if(4&o)return ee(t,r,a,void 0,0);if(8&o){if(1048576&t.flags)return i===Sn?q(t,r,a&&!(131068&t.flags),-9&o):function(e,t,r,n){for(var i=-1,a=e.types,o=function(e,t){return 1048576&e.flags&&1048576&t.flags&&!(32768&e.types[0].flags)&&32768&t.types[0].flags?dm(t,-32769):t}(e,t),s=0;s<a.length;s++){var c=a[s];if(1048576&o.flags&&a.length>=o.types.length&&a.length%o.types.length==0){var l=J(c,o.types[s%o.types.length],3,!1,void 0,n);if(l){i&=l;continue}}var u=J(c,t,1,r,void 0,n);if(!u)return 0;i&=u;}return i}(t,r,a&&!(131068&t.flags),-9&o);if(1048576&r.flags)return V(If(t),r,a&&!(131068&t.flags)&&!(131068&r.flags));if(2097152&r.flags)return function(e,t,r,n){for(var i=-1,a=0,o=t.types;a<o.length;a++){var s=J(e,o[a],2,r,void 0,2);if(!s)return 0;i&=s;}return i}(If(t),r,a);if(i===Sn&&131068&r.flags){var s=e.sameMap(t.types,Cc);if(s!==t.types&&!(2097152&(t=$u(s)).flags))return J(t,r,1,!1)}return q(t,r,!1,1)}var c,l,_=t.flags&r.flags;if(i===Tn&&!(524288&_)){if(4194304&_)return J(t.type,r.type,3,!1);var d=0;return 8388608&_&&(d=J(t.objectType,r.objectType,3,!1))&&(d&=J(t.indexType,r.indexType,3,!1))||16777216&_&&t.root.isDistributive===r.root.isDistributive&&(d=J(t.checkType,r.checkType,3,!1))&&(d&=J(t.extendsType,r.extendsType,3,!1))&&(d&=J(j_(t),j_(r),3,!1))&&(d&=J(J_(t),J_(r),3,!1))?d:33554432&_?J(t.substitute,r.substitute,3,!1):0}var p,m,y=!1,b=I();if(17301504&t.flags&&t.aliasSymbol&&t.aliasTypeArguments&&t.aliasSymbol===r.aliasSymbol&&!t.aliasTypeArgumentsContainsMarker&&!r.aliasTypeArgumentsContainsMarker){if((_e=Ap(t.aliasSymbol))===e.emptyArray)return 1;if(void 0!==(de=ye(t.aliasTypeArguments,r.aliasTypeArguments,_e,o)))return de}if(pf(t)&&!t.target.readonly&&(c=J(zl(t)[0],r,1))||pf(r)&&(r.target.readonly||Hp(Tc(t)||t))&&(c=J(t,zl(r)[0],2)))return c;if(262144&r.flags){if(32&e.getObjectFlags(t)&&!t.declaration.nameType&&J(c_(r),nc(t),3)&&!(4&lc(t))){var x=ac(t),D=F_(r,rc(t));if(c=J(x,D,3,a))return c}}else if(4194304&r.flags){var S=r.type;if(4194304&t.flags&&(c=J(S,t.type,3,!1)))return c;if(_f(S)){if(c=J(t,Mu(S),2,a))return c}else if(re=bc(S)){if(-1===J(t,c_(re,r.stringsOnly),2,a))return -1}else if(dc(S)){var T=ic(S),C=nc(S),E=void 0;if(T&&sc(S)){var k=Ac(cc(S)),N=[];tc(k,8576,!1,(function(e){N.push(Rd(T,Ed(S.mapper,rc(S),e)));})),E=qu(n$3(n$3([],N,!0),[T],!1));}else E=T||C;if(-1===J(t,E,2,a))return -1}}else if(8388608&r.flags){if(8388608&t.flags){if((c=J(t.objectType,r.objectType,3,a))&&(c&=J(t.indexType,r.indexType,3,a)),c)return w(b),c;a&&(l=u);}if(i===Dn||i===Sn){var F=r.objectType,A=r.indexType,P=Tc(F)||F,O=Tc(A)||A;if(!x_(P)&&!D_(O)&&(re=P_(P,O,4|(P!==F?2:0)))){if(a&&l&&w(b),c=J(t,re,2,a))return c;a&&l&&u&&(u=me([l])<=me([u])?l:u);}}a&&(l=void 0);}else if(dc(r)&&i!==Tn){var M=!!r.declaration.nameType,L=(x=ac(r),lc(r));if(!(8&L)){if(!M&&8388608&x.flags&&x.objectType===t&&x.indexType===rc(r))return -1;if(!dc(t)){E=M?ic(r):nc(r);var R=c_(t,void 0,!0),B=4&L,z=B?Gs(E,R):void 0;if(B?!(131072&z.flags):J(E,R,3)){var U=ac(r),K=rc(r),W=dm(U,-98305);if(!M&&8388608&W.flags&&W.indexType===K){if(c=J(t,W.objectType,2,a))return c}else if(D=F_(t,M?z||E:z?$u([z,K]):K),c=J(D,U,3,a))return c}l=u,w(b);}}}else if(16777216&r.flags){if(jp(r,g,h,10))return w(b),3;var G=r;if(!(G.root.inferTypeParameters||(p=G.root).isDistributive&&(Ad(p.checkType,p.node.trueType)||Ad(p.checkType,p.node.falseType)))){var Y=!Yd(jd(G.checkType),jd(G.extendsType)),Z=!Y&&Yd(Jd(G.checkType),Jd(G.extendsType));if((c=Y?-1:J(t,j_(G),2,!1))&&(c&=Z?-1:J(t,J_(G),2,!1)))return w(b),c}}else if(134217728&r.flags){if(134217728&t.flags){if(i===Sn)return function(e,t){var r=e.texts[0],n=t.texts[0],i=e.texts[e.texts.length-1],a=t.texts[t.texts.length-1],o=Math.min(r.length,n.length),s=Math.min(i.length,a.length);return r.slice(0,o)!==n.slice(0,o)||i.slice(i.length-s)!==a.slice(a.length-s)}(t,r)?0:-1;Rd(t,xd(X));}if(_g(t,r))return -1}if(8650752&t.flags){if(!(8388608&t.flags&&8388608&r.flags))if(!(re=vc(t))||262144&t.flags&&1&re.flags){if(c=J(mt,dm(r,-67108865),3))return w(b),c}else {if(c=J(re,r,1,!1,void 0,o))return w(b),c;if(c=J(Ls(re,t),r,1,a&&!(r.flags&t.flags&262144),void 0,o))return w(b),c}}else if(4194304&t.flags){if(c=J(_t,r,1,a))return w(b),c}else if(134217728&t.flags&&!(524288&r.flags)){if(!(134217728&r.flags)&&(re=Tc(t))&&re!==t&&(c=J(re,r,1,a)))return w(b),c}else if(268435456&t.flags){var re;if(268435456&r.flags&&t.symbol===r.symbol){if(c=J(t.type,r.type,3,a))return w(b),c}else if((re=Tc(t))&&(c=J(re,r,1,a)))return w(b),c}else if(16777216&t.flags){if(jp(t,f,v,10))return w(b),3;if(16777216&r.flags){var ne=t.root.inferTypeParameters,ie=t.extendsType,ae=void 0;if(ne){var oe=Wf(ne,void 0,0,j);fg(oe.inferences,r.extendsType,ie,1536),ie=Rd(ie,oe.mapper),ae=oe.mapper;}if(Wd(ie,r.extendsType)&&(J(t.checkType,r.checkType,3)||J(r.checkType,t.checkType,3))&&((c=J(Rd(j_(t),ae),j_(r),3,a))&&(c&=J(J_(t),J_(r),3,a)),c))return w(b),c}else {var ce=Dc(t);if(ce&&(c=J(ce,r,1,a)))return w(b),c}var le=xc(t);if(le&&(c=J(le,r,1,a)))return w(b),c}else {if(i!==bn&&i!==xn&&(m=r,32&e.getObjectFlags(m)&&4&lc(m))&&fp(t))return -1;if(dc(r))return dc(t)&&(c=function(e,t,r){var n;if((i===Sn||(i===Tn?lc(e)===lc(t):_c(e)<=_c(t)))&&(n=J(nc(t),Rd(nc(e),xd(_c(e)<0?Q:X)),3,r))){var a=vd([rc(e)],[rc(t)]);if(Rd(ic(e),a)===Rd(ic(t),a))return n&J(Rd(ac(e),a),ac(t),3,r)}return 0}(t,r,a))?(w(b),c):0;var ue=!!(131068&t.flags);if(i!==Tn)t=Ac(t);else if(dc(t))return 0;if(4&e.getObjectFlags(t)&&4&e.getObjectFlags(r)&&t.target===r.target&&!_f(t)&&!(4096&e.getObjectFlags(t)||4096&e.getObjectFlags(r))){var _e,de;if((_e=wp(t.target))===e.emptyArray)return 1;if(void 0!==(de=ye(zl(t),zl(r),_e,o)))return de}else {if(Wp(r)?qp(t)||_f(t):qp(r)&&_f(t)&&!t.target.readonly)return i!==Tn?J(Qc(t,Ge)||we,Qc(r,Ge)||we,3,a):0;if((i===bn||i===xn)&&fp(r)&&16384&e.getObjectFlags(r)&&!fp(t))return 0}if(2621440&t.flags&&524288&r.flags){var pe=a&&u===b.errorInfo&&!ue;if((c=ee(t,r,pe,void 0,o))&&(c&=te(t,r,0,pe))&&(c&=te(t,r,1,pe))&&(c&=se(t,r,ue,pe,o)),y&&c)u=l||u||b.errorInfo;else if(c)return c}if(2621440&t.flags&&1048576&r.flags){var fe=dm(r,36175872);if(1048576&fe.flags){var ge=function(t,r){var n=Pg(yc(t),r);if(!n)return 0;for(var a=1,o=0,s=n;o<s.length;o++)if((a*=cm(Ko(_=s[o])))>25)return null===e.tracing||void 0===e.tracing||e.tracing.instant("checkTypes","typeRelatedToDiscriminatedType_DepthLimit",{sourceId:t.id,targetId:r.id,numCombinations:a}),0;for(var c=new Array(n.length),l=new e.Set,u=0;u<n.length;u++){var _,d=Ko(_=n[u]);c[u]=1048576&d.flags?d.types:[d],l.add(_.escapedName);}for(var p=e.cartesianProduct(c),f=[],g=function(a){var o=!1;e:for(var s=0,c=r.types;s<c.length;s++){for(var l=c[s],u=function(e){var o=n[e],s=Jc(l,o.escapedName);return s?o===s?"continue":$(t,r,o,s,(function(t){return a[e]}),!1,0,H||i===Sn)?void 0:"continue-outer":"continue-outer"},_=0;_<n.length;_++)switch(u(_)){case"continue-outer":continue e}e.pushIfUnique(f,l,e.equateValues),o=!0;}if(!o)return {value:0}},m=0,y=p;m<y.length;m++){var v=g(y[m]);if("object"==typeof v)return v.value}for(var h=-1,b=0,x=f;b<x.length;b++){var D=x[b];if((h&=ee(t,D,!1,l,0))&&(h&=te(t,D,0,!1))&&(!(h&=te(t,D,1,!1))||_f(t)&&_f(D)||(h&=se(t,D,!1,!1,0))),!h)return h}return h}(t,fe);if(ge)return ge}}}return 0;function me(t){return t?e.reduceLeft(t,(function(e,t){return e+1+me(t.next)}),0):0}function ye(t,r,n,o){if(c=function(t,r,n,a,o){if(void 0===t&&(t=e.emptyArray),void 0===r&&(r=e.emptyArray),void 0===n&&(n=e.emptyArray),t.length!==r.length&&i===Tn)return 0;for(var s=t.length<=r.length?t.length:r.length,c=-1,l=0;l<s;l++){var u=l<n.length?n[l]:1,_=7&u;if(4!==_){var d=t[l],p=r[l],f=-1;if(8&u?f=i===Tn?J(d,p,3,!1):Hd(d,p):1===_?f=J(d,p,3,a,void 0,o):2===_?f=J(p,d,3,a,void 0,o):3===_?(f=J(p,d,3,!1))||(f=J(d,p,3,a,void 0,o)):(f=J(d,p,3,a,void 0,o))&&(f&=J(p,d,3,a,void 0,o)),!f)return 0;c&=f;}}return c}(t,r,n,a,o))return c;if(e.some(n,(function(e){return !!(24&e)})))return l=void 0,void w(b);var s=r&&function(e,t){for(var r=0;r<t.length;r++)if(1==(7&t[r])&&16384&e[r].flags)return !0;return !1}(r,n);if(y=!s,n!==e.emptyArray&&!s){if(y&&(!a||!e.some(n,(function(e){return 0==(7&e)}))))return 0;l=u,w(b);}}}(t,r,a,o);return null===e.tracing||void 0===e.tracing||e.tracing.pop(),s}function Q(e){return !Sr||e!==Ct&&e!==Et&&e!==Tr||Sr(!1),e}function X(e){return !Sr||e!==Ct&&e!==Et&&e!==Tr||Sr(!0),e}function Z(e,t){if(!t||0===e.length)return e;for(var r,n=0;n<e.length;n++)t.has(e[n].escapedName)?r||(r=e.slice(0,n)):r&&r.push(e[n]);return r||e}function $(t,r,n,i,a,o,s,c){var l=e.getDeclarationModifierFlagsFromSymbol(n),u=e.getDeclarationModifierFlagsFromSymbol(i);if(8&l||8&u){if(n.valueDeclaration!==i.valueDeclaration)return o&&(8&l&&8&u?L(e.Diagnostics.Types_have_separate_declarations_of_a_private_property_0,Ia(i)):L(e.Diagnostics.Property_0_is_private_in_type_1_but_not_in_type_2,Ia(i),Ma(8&l?t:r),Ma(8&l?r:t))),0}else if(16&u){if(!function(t,r){return !Lp(r,(function(r){return !!(16&e.getDeclarationModifierFlagsFromSymbol(r))&&(n=t,i=Rp(r),!Lp(n,(function(e){var t=Rp(e);return !!t&&Wo(t,i)})));var n,i;}))}(n,i))return o&&L(e.Diagnostics.Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2,Ia(i),Ma(Rp(n)||t),Ma(Rp(i)||r)),0}else if(16&l)return o&&L(e.Diagnostics.Property_0_is_protected_in_type_1_but_public_in_type_2,Ia(i),Ma(t),Ma(r)),0;var _=function(t,r,n,i,a){var o=H&&!!(48&e.getCheckFlags(r)),s=go(Ko(r),!1,o);return J(n(t),s,3,i,void 0,a)}(n,i,a,o,s);return _?c||!(16777216&n.flags)||16777216&i.flags?_:(o&&L(e.Diagnostics.Property_0_is_optional_in_type_1_but_required_in_type_2,Ia(i),Ma(t),Ma(r)),0):(o&&O(e.Diagnostics.Types_of_property_0_are_incompatible,Ia(i)),0)}function ee(t,r,a,s,c){if(i===Tn)return function(e,t,r){if(!(524288&e.flags&&524288&t.flags))return 0;var n=Z(fc(e),r),i=Z(fc(t),r);if(n.length!==i.length)return 0;for(var a=-1,o=0,s=n;o<s.length;o++){var c=s[o],l=gc(t,c.escapedName);if(!l)return 0;var u=Up(c,l,J);if(!u)return 0;a&=u;}return a}(t,r,s);var _=-1;if(_f(r)){if(qp(t)||_f(t)){if(!r.target.readonly&&(Wp(t)||_f(t)&&t.target.readonly))return 0;var p=Ul(t),f=Ul(r),g=_f(t)?4&t.target.combinedFlags:4,m=4&r.target.combinedFlags,y=_f(t)?t.target.minLength:0,v=r.target.minLength;if(!g&&p<v)return a&&L(e.Diagnostics.Source_has_0_element_s_but_target_requires_1,p,v),0;if(!m&&f<y)return a&&L(e.Diagnostics.Source_has_0_element_s_but_target_allows_only_1,y,f),0;if(!m&&(g||f<p))return a&&(y<v?L(e.Diagnostics.Target_requires_0_element_s_but_source_may_have_fewer,v):L(e.Diagnostics.Target_allows_only_0_element_s_but_source_may_have_more,f)),0;for(var h=zl(t),b=zl(r),x=Math.min(_f(t)?Lu(t.target,11):0,Lu(r.target,11)),S=Math.min(_f(t)?Ru(t.target,11):0,m?Ru(r.target,11):0),T=!!s,C=0;C<f;C++){var E=C<f-S?C:C+p-f,k=_f(t)&&(C<x||C>=f-S)?t.target.elementFlags[E]:4,N=r.target.elementFlags[C];if(8&N&&!(8&k))return a&&L(e.Diagnostics.Source_provides_no_match_for_variadic_element_at_position_0_in_target,C),0;if(8&k&&!(12&N))return a&&L(e.Diagnostics.Variadic_element_at_position_0_in_source_does_not_match_element_at_position_1_in_target,E,C),0;if(1&N&&!(1&k))return a&&L(e.Diagnostics.Source_provides_no_match_for_required_element_at_position_0_in_target,C),0;if(!(T&&((12&k||12&N)&&(T=!1),T&&(null==s?void 0:s.has(""+C))))){var F=_f(t)?C<x||C>=f-S?Nf(h[E],!!(k&N&2)):gf(t,x,S)||nt:h[0],A=b[C];if(!(W=J(F,8&k&&4&N?Tu(A):Nf(A,!!(2&N)),3,a,void 0,c)))return a&&(f>1||p>1)&&(C<x||C>=f-S||p-x-S==1?O(e.Diagnostics.Type_at_position_0_in_source_is_not_compatible_with_type_at_position_1_in_target,E,C):O(e.Diagnostics.Type_at_positions_0_through_1_in_source_is_not_compatible_with_type_at_position_2_in_target,x,p-S-1,C)),0;_&=W;}}return _}if(12&r.target.combinedFlags)return 0}var P=!(i!==bn&&i!==xn||yg(t)||Zp(t)||_f(t)),w=og(t,r,P,!1);if(w)return a&&function(t,r,i,a){var s=!1;if(i.valueDeclaration&&e.isNamedDeclaration(i.valueDeclaration)&&e.isPrivateIdentifier(i.valueDeclaration.name)&&t.symbol&&32&t.symbol.flags){var c=i.valueDeclaration.name.escapedText,_=e.getSymbolNameForPrivateIdentifier(t.symbol,c);if(_&&Jc(t,_)){var p=e.factory.getDeclarationName(t.symbol.valueDeclaration),f=e.factory.getDeclarationName(r.symbol.valueDeclaration);return void L(e.Diagnostics.Property_0_in_type_1_refers_to_a_different_member_that_cannot_be_accessed_from_within_type_2,ai(c),ai(""===p.escapedText?l:p),ai(""===f.escapedText?l:f))}}var g,m=e.arrayFrom(ag(t,r,a,!1));if((!o||o.code!==e.Diagnostics.Class_0_incorrectly_implements_interface_1.code&&o.code!==e.Diagnostics.Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclass.code)&&(s=!0),1===m.length){var y=Ia(i);L.apply(void 0,n$3([e.Diagnostics.Property_0_is_missing_in_type_1_but_required_in_type_2,y],La(t,r),!1)),e.length(i.declarations)&&(g=e.createDiagnosticForNode(i.declarations[0],e.Diagnostics._0_is_declared_here,y),e.Debug.assert(!!u),d?d.push(g):d=[g]),s&&u&&D++;}else B(t,r,!1)&&(m.length>5?L(e.Diagnostics.Type_0_is_missing_the_following_properties_from_type_1_Colon_2_and_3_more,Ma(t),Ma(r),e.map(m.slice(0,4),(function(e){return Ia(e)})).join(", "),m.length-4):L(e.Diagnostics.Type_0_is_missing_the_following_properties_from_type_1_Colon_2,Ma(t),Ma(r),e.map(m,(function(e){return Ia(e)})).join(", ")),s&&u&&D++);}(t,r,w,P),0;if(yg(r))for(var I=0,M=Z(yc(t),s);I<M.length;I++)if(!(gc(r,(K=M[I]).escapedName)||32768&(F=Uo(K)).flags))return a&&L(e.Diagnostics.Property_0_does_not_exist_on_type_1,Ia(K),Ma(r)),0;for(var R=yc(r),j=_f(t)&&_f(r),z=0,U=Z(R,s);z<U.length;z++){var K,V=U[z],q=V.escapedName;if(!(4194304&V.flags)&&(!j||ky(q)||"length"===q)&&(K=Jc(t,q))&&K!==V){var W;if(!(W=$(t,r,K,V,Ko,a,c,i===Sn)))return 0;_&=W;}}return _}function te(t,r,n,a){var o,s;if(i===Tn)return function(e,t,r){var n=Uc(e,r),i=Uc(t,r);if(n.length!==i.length)return 0;for(var a=-1,o=0;o<n.length;o++){var s=Kp(n[o],i[o],!1,!1,!1,J);if(!s)return 0;a&=s;}return a}(t,r,n);if(r===xt||t===xt)return -1;var c=t.symbol&&Fh(t.symbol.valueDeclaration),l=r.symbol&&Fh(r.symbol.valueDeclaration),u=Uc(t,c&&1===n?0:n),_=Uc(r,l&&1===n?0:n);if(1===n&&u.length&&_.length){var d=!!(4&u[0].flags),p=!!(4&_[0].flags);if(d&&!p)return a&&L(e.Diagnostics.Cannot_assign_an_abstract_constructor_type_to_a_non_abstract_constructor_type),0;if(!function(t,r,n){if(!t.declaration||!r.declaration)return !0;var i=e.getSelectedEffectiveModifierFlags(t.declaration,24),a=e.getSelectedEffectiveModifierFlags(r.declaration,24);return 8===a||(16===a&&8!==i||(16!==a&&!i||(n&&L(e.Diagnostics.Cannot_assign_a_0_constructor_type_to_a_1_constructor_type,Ua(i),Ua(a)),!1)))}(u[0],_[0],a))return 0}var f=-1,g=I(),m=1===n?ie:ne,y=e.getObjectFlags(t),v=e.getObjectFlags(r);if(64&y&&64&v&&t.symbol===r.symbol)for(var h=0;h<_.length;h++){if(!(A=ae(u[h],_[h],!0,a,m(u[h],_[h]))))return 0;f&=A;}else if(1===u.length&&1===_.length){var b=i===Sn||!!U.noStrictGenericChecks,x=e.first(u),D=e.first(_);if(!(f=ae(x,D,b,a,m(x,D)))&&a&&1===n&&y&v&&(170===(null===(o=D.declaration)||void 0===o?void 0:o.kind)||170===(null===(s=x.declaration)||void 0===s?void 0:s.kind))){var S=function(e){return Oa(e,void 0,262144,n)};return L(e.Diagnostics.Type_0_is_not_assignable_to_type_1,S(x),S(D)),L(e.Diagnostics.Types_of_construct_signatures_are_incompatible),f}}else e:for(var T=0,C=_;T<C.length;T++){for(var E=C[T],k=a,N=0,F=u;N<F.length;N++){var A,P=F[N];if(A=ae(P,E,!0,k,m(P,E))){f&=A,w(g);continue e}k=!1;}return k&&L(e.Diagnostics.Type_0_provides_no_match_for_the_signature_1,Ma(t),Oa(E,void 0,void 0,n)),0}return f}function ne(t,r){return 0===t.parameters.length&&0===r.parameters.length?function(t,r){return O(e.Diagnostics.Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1,Ma(t),Ma(r))}:function(t,r){return O(e.Diagnostics.Call_signature_return_types_0_and_1_are_incompatible,Ma(t),Ma(r))}}function ie(t,r){return 0===t.parameters.length&&0===r.parameters.length?function(t,r){return O(e.Diagnostics.Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1,Ma(t),Ma(r))}:function(t,r){return O(e.Diagnostics.Construct_signature_return_types_0_and_1_are_incompatible,Ma(t),Ma(r))}}function ae(e,t,r,n,a){return dp(r?Sl(e):e,r?Sl(t):t,i===xn?8:0,n,L,a,j,xd(X))}function oe(t,r,n){var i=J(t.type,r.type,3,n);return !i&&n&&(t.keyType===r.keyType?L(e.Diagnostics._0_index_signatures_are_incompatible,Ma(t.keyType)):L(e.Diagnostics._0_and_1_index_signatures_are_incompatible,Ma(t.keyType),Ma(r.keyType))),i}function se(t,r,n,a,o){if(i===Tn)return function(e,t){var r=Hc(e),n=Hc(t);if(r.length!==n.length)return 0;for(var i=0,a=n;i<a.length;i++){var o=a[i],s=Gc(e,o.keyType);if(!s||!J(s.type,o.type,3)||s.isReadonly!==o.isReadonly)return 0}return -1}(t,r);for(var s=Hc(r),c=e.some(s,(function(e){return e.keyType===He})),l=-1,u=0,_=s;u<_.length;u++){var d=_[u],p=!n&&c&&1&d.type.flags?-1:dc(t)&&c?J(ac(t),d.type,3,a):ce(t,d,a,o);if(!p)return 0;l&=p;}return l}function ce(t,r,n,i){var a=Yc(t,r.keyType);return a?oe(a,r,n):1&i||!Pf(t)?(n&&L(e.Diagnostics.Index_signature_for_type_0_is_missing_in_type_1,Ma(r.keyType),Ma(t)),0):function(t,r,n){for(var i=-1,a=r.keyType,o=0,s=2097152&t.flags?mc(t):fc(t);o<s.length;o++){var c=s[o];if(!bp(t,c)&&qc(a_(c,8576),a)){var l=Ko(c);if(!(p=J(re||32768&l.flags||a===Ge||!(16777216&c.flags)?l:Jg(l,524288),r.type,3,n)))return n&&L(e.Diagnostics.Property_0_is_incompatible_with_index_signature,Ia(c)),0;i&=p;}}for(var u=0,_=Hc(t);u<_.length;u++){var d=_[u];if(qc(d.keyType,a)){var p;if(!(p=oe(d,r,n)))return 0;i&=p;}}return i}(t,r,n)}}function Sp(t){if(16&t.flags)return !1;if(3145728&t.flags)return !!e.forEach(t.types,Sp);if(465829888&t.flags){var r=vc(t);if(r&&r!==t)return Sp(r)}return rf(t)||!!(134217728&t.flags)}function Tp(t,r){return _f(t)&&_f(r)?e.emptyArray:yc(r).filter((function(e){return Cp(eo(t,e.escapedName),Uo(e))}))}function Cp(e,t){return !!e&&!!t&&Eb(e,32768)&&!!Ff(t)}function Ep(t,r,n){return void 0===n&&(n=Gd),rC(t,r,n,!0)||function(t,r){var n=e.getObjectFlags(t);if(20&n&&1048576&r.flags)return e.find(r.types,(function(r){if(524288&r.flags){var i=n&e.getObjectFlags(r);if(4&i)return t.target===r.target;if(16&i)return !!t.aliasSymbol&&t.aliasSymbol===r.aliasSymbol}return !1}))}(t,r)||function(t,r){if(128&e.getObjectFlags(t)&&im(r,Qp))return e.find(r.types,(function(e){return !Qp(e)}))}(t,r)||function(t,r){var n=0;if(Uc(t,n).length>0||Uc(t,n=1).length>0)return e.find(r.types,(function(e){return Uc(e,n).length>0}))}(t,r)||function(t,r){for(var n,i=0,a=0,o=r.types;a<o.length;a++){var s=o[a],c=$u([c_(t),c_(s)]);if(4194304&c.flags)n=s,i=1/0;else if(1048576&c.flags){var l=e.length(e.filter(c.types,rf));l>=i&&(n=s,i=l);}else rf(c)&&1>=i&&(n=s,i=1);}return n}(t,r)}function kp(t,r,n,i,a){for(var o=t.types.map((function(e){})),s=0,c=r;s<c.length;s++){var l=c[s],u=l[0],_=l[1],d=Ic(t,_);if(!(a&&d&&16&e.getCheckFlags(d)))for(var p=0,f=0,g=t.types;f<g.length;f++){var m=eo(g[f],_);m&&n(u(),m)?o[p]=void 0===o[p]||o[p]:o[p]=!1,p++;}}var y=o.indexOf(!0);if(-1===y)return i;for(var v=o.indexOf(!0,y+1);-1!==v;){if(!Wd(t.types[y],t.types[v]))return i;v=o.indexOf(!0,v+1);}return t.types[y]}function Np(t){if(524288&t.flags){var r=pc(t);return 0===r.callSignatures.length&&0===r.constructSignatures.length&&0===r.indexInfos.length&&r.properties.length>0&&e.every(r.properties,(function(e){return !!(16777216&e.flags)}))}return !!(2097152&t.flags)&&e.every(t.types,Np)}function Fp(t,r,n){var i=Bl(t,e.map(t.typeParameters,(function(e){return e===r?n:e})));return i.objectFlags|=4096,i}function Ap(e){var t=Gn(e);return Pp(t.typeParameters,t,(function(r,n,i){var a=Vl(e,gd(t.typeParameters,bd(n,i)));return a.aliasTypeArgumentsContainsMarker=!0,a}))}function Pp(t,r,n){var i,a,o;void 0===t&&(t=e.emptyArray);var s=r.variances;if(!s){null===e.tracing||void 0===e.tracing||e.tracing.push("checkTypes","getVariancesWorker",{arity:t.length,id:null!==(o=null!==(i=r.id)&&void 0!==i?i:null===(a=r.declaredType)||void 0===a?void 0:a.id)&&void 0!==o?o:-1}),r.variances=e.emptyArray,s=[];for(var c=function(e){var t=!1,i=!1,a=Sr;Sr=function(e){return e?i=!0:t=!0};var o=n(r,e,Ct),c=n(r,e,Et),l=(Yd(c,o)?1:0)|(Yd(o,c)?2:0);3===l&&Yd(n(r,e,Tr),o)&&(l=4),Sr=a,(t||i)&&(t&&(l|=8),i&&(l|=16)),s.push(l);},l=0,u=t;l<u.length;l++)c(u[l]);r.variances=s,null===e.tracing||void 0===e.tracing||e.tracing.pop();}return s}function wp(e){return e===Mt||e===Lt||8&e.objectFlags?N:Pp(e.typeParameters,e,Fp)}function Ip(e){return 262144&e.flags&&!hc(e)}function Op(t){return function(t){return !!(4&e.getObjectFlags(t))&&!t.node}(t)&&e.some(zl(t),(function(e){return !!(262144&e.flags)||Op(e)}))}function Mp(e,t,r,n,i){if(n===Tn&&e.id>t.id){var a=e;e=t,t=a;}var o=r?":"+r:"";return Op(e)&&Op(t)?function(e,t,r,n){var i=[],a="",o=c(e,0),s=c(t,0);return "".concat(a).concat(o,",").concat(s).concat(r);function c(e,t){void 0===t&&(t=0);for(var r=""+e.target.id,o=0,s=zl(e);o<s.length;o++){var l=s[o];if(262144&l.flags){if(n||Ip(l)){var u=i.indexOf(l);u<0&&(u=i.length,i.push(l)),r+="="+u;continue}a="*";}else if(t<4&&Op(l)){r+="<"+c(l,t+1)+">";continue}r+="-"+l.id;}return r}}(e,t,o,i):"".concat(e.id,",").concat(t.id).concat(o)}function Lp(t,r){if(!(6&e.getCheckFlags(t)))return r(t);for(var n=0,i=t.containingType.types;n<i.length;n++){var a=Jc(i[n],t.escapedName),o=a&&Lp(a,r);if(o)return o}}function Rp(e){return e.parent&&32&e.parent.flags?ms(ea(e)):void 0}function Bp(e){var t=Rp(e),r=t&&is(t)[0];return r&&eo(r,e.escapedName)}function jp(e,t,r,n){if(void 0===n&&(n=3),r>=n)for(var i=Jp(e),a=0,o=0,s=0;s<r;s++){var c=t[s];if(Jp(c)===i){if(c.id>=o&&++a>=n)return !0;o=c.id;}}return !1}function Jp(t){if(524288&t.flags&&!vg(t)){if(e.getObjectFlags(t)&&t.node)return t.node;if(t.symbol&&!(16&e.getObjectFlags(t)&&32&t.symbol.flags))return t.symbol;if(_f(t))return t.target}if(262144&t.flags)return t.symbol;if(8388608&t.flags){do{t=t.objectType;}while(8388608&t.flags);return t}return 16777216&t.flags?t.root:t}function zp(e,t){return 0!==Up(e,t,Hd)}function Up(t,r,n){if(t===r)return -1;var i=24&e.getDeclarationModifierFlagsFromSymbol(t);if(i!==(24&e.getDeclarationModifierFlagsFromSymbol(r)))return 0;if(i){if(tS(t)!==tS(r))return 0}else if((16777216&t.flags)!=(16777216&r.flags))return 0;return Db(t)!==Db(r)?0:n(Uo(t),Uo(r))}function Kp(t,r,n,i,a,o){if(t===r)return -1;if(!function(e,t,r){var n=Zh(e),i=Zh(t),a=$h(e),o=$h(t),s=eb(e),c=eb(t);return n===i&&a===o&&s===c||!!(r&&a<=o)}(t,r,n))return 0;if(e.length(t.typeParameters)!==e.length(r.typeParameters))return 0;if(r.typeParameters){for(var s=vd(t.typeParameters,r.typeParameters),c=0;c<r.typeParameters.length;c++)if(!((g=t.typeParameters[c])===(p=r.typeParameters[c])||o(Rd(Il(g),s)||je,Il(p)||je)&&o(Rd(Fc(g),s)||je,Fc(p)||je)))return 0;t=Nd(t,s,!0);}var l=-1;if(!i){var u=pl(t);if(u){var _=pl(r);if(_){if(!(f=o(u,_)))return 0;l&=f;}}}var d=Zh(r);for(c=0;c<d;c++){var p,f,g=Qh(t,c);if(!(f=o(p=Qh(r,c),g)))return 0;l&=f;}if(!a){var m=fl(t),y=fl(r);l&=m||y?function(e,t,r){return e&&t&&Wu(e,t)?e.type===t.type?-1:e.type&&t.type?r(e.type,t.type):0:0}(m,y,o):o(ml(t),ml(r));}return l}function Vp(t){return 1===t.length?t[0]:function(e){for(var t,r=0,n=e;r<n.length;r++){var i=n[r],a=of(i);if(t||(t=a),a===i||a!==t)return !1}return !0}(t)?qu(t):e.reduceLeft(t,(function(e,t){return Xd(e,t)?t:e}))}function qp(t){return !!(4&e.getObjectFlags(t))&&(t.target===Mt||t.target===Lt)}function Wp(t){return !!(4&e.getObjectFlags(t))&&t.target===Lt}function Hp(e){return qp(e)&&!Wp(e)||_f(e)&&!e.target.readonly}function Gp(e){return qp(e)?zl(e)[0]:void 0}function Qp(e){return qp(e)||!(98304&e.flags)&&Yd(e,Vt)}function Xp(t){if(4&e.getObjectFlags(t)&&3&e.getObjectFlags(t.target)){if(33554432&e.getObjectFlags(t))return 67108864&e.getObjectFlags(t)?t.cachedEquivalentBaseType:void 0;t.objectFlags|=33554432;var r=t.target;if(1&e.getObjectFlags(r)){var n=$o(r);if(n&&79!==n.expression.kind&&205!==n.expression.kind)return}var i=is(r);if(1===i.length&&!Os(t.symbol).size){var a=e.length(r.typeParameters)?Rd(i[0],vd(r.typeParameters,zl(t).slice(0,r.typeParameters.length))):i[0];return e.length(zl(t))>e.length(r.typeParameters)&&(a=Ls(a,e.last(zl(t)))),t.objectFlags|=67108864,t.cachedEquivalentBaseType=a}}}function Yp(e){return H?e===ot:e===Ue}function Zp(e){var t=Gp(e);return !!t&&Yp(t)}function $p(e){return _f(e)||!!Jc(e,"0")}function ef(e){return Qp(e)||$p(e)}function tf(e){return !(240512&e.flags)}function rf(e){return !!(109440&e.flags)}function nf(t){return 2097152&t.flags?e.some(t.types,rf):!!(109440&t.flags)}function af(t){return !!(16&t.flags)||(1048576&t.flags?!!(1024&t.flags)||e.every(t.types,rf):rf(t))}function of(e){return 1024&e.flags?ds(e):128&e.flags?He:256&e.flags?Ge:2048&e.flags?Qe:512&e.flags?et:1048576&e.flags?lm(e,of):e}function sf(e){return 1024&e.flags&&nd(e)?ds(e):128&e.flags&&nd(e)?He:256&e.flags&&nd(e)?Ge:2048&e.flags&&nd(e)?Qe:512&e.flags&&nd(e)?et:1048576&e.flags?lm(e,sf):e}function cf(e){return 8192&e.flags?tt:1048576&e.flags?lm(e,cf):e}function lf(e,t){return qb(e,t)||(e=cf(sf(e))),e}function uf(e,t,r,n){return e&&rf(e)&&(e=lf(e,t?zD(r,t,n):void 0)),e}function _f(t){return !!(4&e.getObjectFlags(t)&&8&t.target.objectFlags)}function df(e){return _f(e)&&!!(8&e.target.combinedFlags)}function pf(e){return df(e)&&1===e.target.elementFlags.length}function ff(e){return gf(e,e.target.fixedLength)}function gf(e,t,r,n){void 0===r&&(r=0),void 0===n&&(n=!1);var i=Ul(e)-r;if(t<i){for(var a=zl(e),o=[],s=t;s<i;s++){var c=a[s];o.push(8&e.target.elementFlags[s]?F_(c,Ge):c);}return n?$u(o):qu(o)}}function mf(e){return "0"===e.value.base10Value}function yf(e){for(var t=0,r=0,n=e;r<n.length;r++)t|=vf(n[r]);return t}function vf(e){return 1048576&e.flags?yf(e.types):128&e.flags?""===e.value?128:0:256&e.flags?0===e.value?256:0:2048&e.flags?mf(e)?2048:0:512&e.flags?e===Xe||e===Ye?512:0:117724&e.flags}function hf(e){return 117632&vf(e)?om(e,(function(e){return !(117632&vf(e))})):e}function bf(e){return 4&e.flags?Wr:8&e.flags?Hr:64&e.flags?Gr:e===Ye||e===Xe||114691&e.flags||128&e.flags&&""===e.value||256&e.flags&&0===e.value||2048&e.flags&&mf(e)?e:nt}function xf(e,t){var r=t&~e.flags&98304;return 0===r?e:qu(32768===r?[e,ze]:65536===r?[e,qe]:[e,ze,qe])}function Df(t,r){return void 0===r&&(r=!1),e.Debug.assert(H),32768&t.flags?t:qu([t,r?Ve:ze])}function Sf(e){return H?function(e){var t=Jg(e,2097152);return qt||(qt=uu("NonNullable",524288,void 0)||Ne),qt!==Ne?Vl(qt,[t]):t}(e):e}function Tf(e){return H?qu([e,Ke]):e}function Cf(e){return H?sm(e,Ke):e}function Ef(t,r,n){return n?e.isOutermostOptionalChain(r)?Df(t):Tf(t):t}function kf(t,r){return e.isExpressionOfOptionalChainRoot(r)?Sf(t):e.isOptionalChain(r)?Cf(t):t}function Nf(e,t){return re&&t?sm(e,Ve):e}function Ff(e){return re&&(e===Ve||1048576&e.flags&&ju(e.types,Ve))}function Af(e){return re?sm(e,Ve):Jg(e,524288)}function Pf(t){return 2097152&t.flags?e.every(t.types,Pf):!(!t.symbol||0==(7040&t.symbol.flags)||US(t))||!!(1024&e.getObjectFlags(t)&&Pf(t.source))}function wf(t,r){var n=jn(t.flags,t.escapedName,8&e.getCheckFlags(t));n.declarations=t.declarations,n.parent=t.parent,n.type=r,n.target=t,t.valueDeclaration&&(n.valueDeclaration=t.valueDeclaration);var i=Gn(t).nameType;return i&&(n.nameType=i),n}function If(t){if(!(yg(t)&&16384&e.getObjectFlags(t)))return t;var r=t.regularType;if(r)return r;var n=t,i=function(t,r){for(var n=e.createSymbolTable(),i=0,a=fc(t);i<a.length;i++){var o=a[i],s=Uo(o),c=r(s);n.set(o.escapedName,c===s?o:wf(o,c));}return n}(t,If),a=ya(n.symbol,i,n.callSignatures,n.constructSignatures,n.indexInfos);return a.flags=n.flags,a.objectFlags|=-16385&n.objectFlags,t.regularType=a,a}function Of(e,t,r){return {parent:e,propertyName:t,siblings:r,resolvedProperties:void 0}}function Mf(e){if(!e.siblings){for(var t=[],r=0,n=Mf(e.parent);r<n.length;r++){var i=n[r];if(yg(i)){var a=gc(i,e.propertyName);a&&nm(Uo(a),(function(e){t.push(e);}));}}e.siblings=t;}return e.siblings}function Lf(t){if(!t.resolvedProperties){for(var r=new e.Map,n=0,i=Mf(t);n<i.length;n++){var a=i[n];if(yg(a)&&!(4194304&e.getObjectFlags(a)))for(var o=0,s=yc(a);o<s.length;o++){var c=s[o];r.set(c.escapedName,c);}}t.resolvedProperties=e.arrayFrom(r.values());}return t.resolvedProperties}function Rf(e,t){if(!(4&e.flags))return e;var r=Uo(e),n=Jf(r,t&&Of(t,e.escapedName,void 0));return n===r?e:wf(e,n)}function Bf(e){var t=ke.get(e.escapedName);if(t)return t;var r=wf(e,Ve);return r.flags|=16777216,ke.set(e.escapedName,r),r}function jf(e){return Jf(e,void 0)}function Jf(t,r){if(393216&e.getObjectFlags(t)){if(void 0===r&&t.widened)return t.widened;var n=void 0;if(98305&t.flags)n=we;else if(yg(t))n=function(t,r){for(var n=e.createSymbolTable(),i=0,a=fc(t);i<a.length;i++){var o=a[i];n.set(o.escapedName,Rf(o,r));}if(r)for(var s=0,c=Lf(r);s<c.length;s++)o=c[s],n.has(o.escapedName)||n.set(o.escapedName,Bf(o));var l=ya(t.symbol,n,e.emptyArray,e.emptyArray,e.sameMap(Hc(t),(function(e){return Nl(e.keyType,jf(e.type),e.isReadonly)})));return l.objectFlags|=532480&e.getObjectFlags(t),l}(t,r);else if(1048576&t.flags){var i=r||Of(void 0,void 0,t.types),a=e.sameMap(t.types,(function(e){return 98304&e.flags?e:Jf(e,i)}));n=qu(a,e.some(a,fp)?2:1);}else 2097152&t.flags?n=$u(e.sameMap(t.types,jf)):(qp(t)||_f(t))&&(n=Bl(t.target,e.sameMap(zl(t),jf)));return n&&void 0===r&&(t.widened=n),n||t}return t}function zf(t){var r=!1;if(131072&e.getObjectFlags(t)){if(1048576&t.flags)if(e.some(t.types,fp))r=!0;else for(var n=0,i=t.types;n<i.length;n++)zf(u=i[n])&&(r=!0);if(qp(t)||_f(t))for(var a=0,o=zl(t);a<o.length;a++)zf(u=o[a])&&(r=!0);if(yg(t))for(var s=0,c=fc(t);s<c.length;s++){var l=c[s],u=Uo(l);131072&e.getObjectFlags(u)&&(zf(u)||In(l.valueDeclaration,e.Diagnostics.Object_literal_s_property_0_implicitly_has_an_1_type,Ia(l),Ma(jf(u))),r=!0);}}return r}function Uf(t,r,n){var i=Ma(jf(r));if(!e.isInJSFile(t)||e.isCheckJsEnabledForFile(e.getSourceFileOfNode(t),U)){var a;switch(t.kind){case 220:case 166:case 165:a=Y?e.Diagnostics.Member_0_implicitly_has_an_1_type:e.Diagnostics.Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage;break;case 163:var o=t;if(e.isIdentifier(o.name)&&(e.isCallSignatureDeclaration(o.parent)||e.isMethodSignature(o.parent)||e.isFunctionTypeNode(o.parent))&&o.parent.parameters.indexOf(o)>-1&&(ei(o,o.name.escapedText,788968,void 0,o.name.escapedText,!0)||o.name.originalKeywordKind&&e.isTypeNodeKind(o.name.originalKeywordKind))){var s="arg"+o.parent.parameters.indexOf(o),c=e.declarationNameToString(o.name)+(o.dotDotDotToken?"[]":"");return void Mn(Y,t,e.Diagnostics.Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1,s,c)}a=t.dotDotDotToken?Y?e.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type:e.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage:Y?e.Diagnostics.Parameter_0_implicitly_has_an_1_type:e.Diagnostics.Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage;break;case 202:if(a=e.Diagnostics.Binding_element_0_implicitly_has_an_1_type,!Y)return;break;case 315:return void In(t,e.Diagnostics.Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type,i);case 255:case 168:case 167:case 171:case 172:case 212:case 213:if(Y&&!t.name)return void In(t,3===n?e.Diagnostics.Generator_implicitly_has_yield_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_return_type_annotation:e.Diagnostics.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type,i);a=Y?3===n?e.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_yield_type:e.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type:e.Diagnostics._0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage;break;case 194:return void(Y&&In(t,e.Diagnostics.Mapped_object_type_implicitly_has_an_any_template_type));default:a=Y?e.Diagnostics.Variable_0_implicitly_has_an_1_type:e.Diagnostics.Variable_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage;}Mn(Y,t,a,e.declarationNameToString(e.getNameOfDeclaration(t)),i);}}function Kf(t,n,i){!(r&&Y&&131072&e.getObjectFlags(n))||i&&xy(t)||zf(n)||Uf(t,n,i);}function Vf(e,t,r){var n=Zh(e),i=Zh(t),a=tb(e),o=tb(t),s=o?i-1:i,c=a?s:Math.min(n,s),l=pl(e);if(l){var u=pl(t);u&&r(l,u);}for(var _=0;_<c;_++)r(Qh(e,_),Qh(t,_));o&&r(Yh(e,c),o);}function qf(e,t,r){var n=fl(e),i=fl(t);n&&i&&Wu(n,i)&&n.type&&i.type?r(n.type,i.type):r(ml(e),ml(t));}function Wf(e,t,r,n){return Hf(e.map(Xf),t,r,n||Gd)}function Hf(e,t,r,n){var i={inferences:e,signature:t,flags:r,compareTypes:n,mapper:xd((function(e){return Gf(i,e,!0)})),nonFixingMapper:xd((function(e){return Gf(i,e,!1)}))};return i}function Gf(e,t,r){for(var n=e.inferences,i=0;i<n.length;i++){var a=n[i];if(t===a.typeParameter)return r&&!a.isFixed&&(Qf(n),a.isFixed=!0),hg(e,i)}return t}function Qf(e){for(var t=0,r=e;t<r.length;t++){var n=r[t];n.isFixed||(n.inferredType=void 0);}}function Xf(e){return {typeParameter:e,candidates:void 0,contraCandidates:void 0,inferredType:void 0,priority:void 0,topLevel:!0,isFixed:!1,impliedArity:void 0}}function Yf(e){return {typeParameter:e.typeParameter,candidates:e.candidates&&e.candidates.slice(),contraCandidates:e.contraCandidates&&e.contraCandidates.slice(),inferredType:e.inferredType,priority:e.priority,topLevel:e.topLevel,isFixed:e.isFixed,impliedArity:e.impliedArity}}function Zf(e){return e&&e.mapper}function $f(t){var r=e.getObjectFlags(t);if(1048576&r)return !!(2097152&r);var n=!!(465829888&t.flags||524288&t.flags&&!eg(t)&&(4&r&&(t.node||e.forEach(zl(t),$f))||16&r&&t.symbol&&14384&t.symbol.flags&&t.symbol.declarations||8389664&r)||3145728&t.flags&&!(1024&t.flags)&&!eg(t)&&e.some(t.types,$f));return 3899393&t.flags&&(t.objectFlags|=1048576|(n?2097152:0)),n}function eg(t){if(t.aliasSymbol&&!t.aliasTypeArguments){var r=e.getDeclarationOfKind(t.aliasSymbol,258);return !(!r||!e.findAncestor(r.parent,(function(e){return 303===e.kind||260!==e.kind&&"quit"})))}return !1}function tg(t,r){return !!(t===r||3145728&t.flags&&e.some(t.types,(function(e){return tg(e,r)}))||16777216&t.flags&&(j_(t)===r||J_(t)===r))}function rg(t,r,n){if(!jr){var i=t.id+","+r.id+","+n.id;if(Br.has(i))return Br.get(i);jr=!0;var a=function(t,r,n){if(Gc(t,He)||0!==yc(t).length&&ng(t)){if(qp(t))return Tu(ig(zl(t)[0],r,n),Wp(t));if(_f(t))return Au(e.map(zl(t),(function(e){return ig(e,r,n)})),4&lc(r)?e.sameMap(t.target.elementFlags,(function(e){return 2&e?1:e})):t.target.elementFlags,t.target.readonly,t.target.labeledElementDeclarations);var i=_a(1040,void 0);return i.source=t,i.mappedType=r,i.constraintType=n,i}}(t,r,n);return jr=!1,Br.set(i,a),a}}function ng(t){return !(524288&e.getObjectFlags(t))||yg(t)&&e.some(yc(t),(function(e){return ng(Uo(e))}))||_f(t)&&e.some(zl(t),ng)}function ig(e,t,r){var n=F_(r.type,rc(t)),i=ac(t),a=Xf(n);return fg([a],e,i),sg(a)||je}function ag(t,r,n,i){var a,s,c,l,u,_,d;return o(this,(function(o){switch(o.label){case 0:a=yc(r),s=0,c=a,o.label=1;case 1:return s<c.length?Ts(l=c[s])||!n&&(16777216&l.flags||48&e.getCheckFlags(l))?[3,5]:(u=Jc(t,l.escapedName))?[3,3]:[4,l]:[3,6];case 2:return o.sent(),[3,5];case 3:return i&&109440&(_=Uo(l)).flags?1&(d=Uo(u)).flags||rd(d)===rd(_)?[3,5]:[4,l]:[3,5];case 4:o.sent(),o.label=5;case 5:return s++,[3,1];case 6:return [2]}}))}function og(e,t,r,n){var i=ag(e,t,r,n).next();if(!i.done)return i.value}function sg(e){return e.candidates?qu(e.candidates,2):e.contraCandidates?$u(e.contraCandidates):void 0}function cg(e){return !!Qn(e).skipDirectInference}function lg(t){return !(!t.symbol||!e.some(t.symbol.declarations,cg))}function ug(t,r){return 128&t.flags?pg([t.value],e.emptyArray,r):134217728&t.flags?e.arraysEqual(t.texts,r.texts)?e.map(t.types,dg):pg(t.texts,t.types,r):void 0}function _g(t,r){var n=ug(t,r);return !!n&&e.every(n,(function(t,n){return function(t,r){if(t===r||5&r.flags)return !0;if(128&t.flags){var n=t.value;return !!(8&r.flags&&""!==n&&isFinite(+n)||64&r.flags&&""!==n&&function(t){var r=e.createScanner(99,!1),n=!0;r.setOnError((function(){return n=!1})),r.setText(t+"n");var i=r.scan();40===i&&(i=r.scan());var a=r.getTokenFlags();return n&&9===i&&r.getTextPos()===t.length+1&&!(512&a)}(n)||98816&r.flags&&n===r.intrinsicName)}if(134217728&t.flags){var i=t.texts;return 2===i.length&&""===i[0]&&""===i[1]&&Yd(t.types[0],r)}return Yd(t,r)}(t,r.types[n])}))}function dg(e){return 402653317&e.flags?e:u_(["",""],[e])}function pg(e,t,r){var i=e.length-1,a=e[0],o=e[i],s=r.texts,c=s.length-1,l=s[0],u=s[c];if(!(0===i&&a.length<l.length+u.length)&&a.startsWith(l)&&o.endsWith(u)){for(var _=o.slice(0,o.length-u.length),d=[],p=0,f=l.length,g=1;g<c;g++){var m=s[g];if(m.length>0){for(var y=p,v=f;!((v=h(y).indexOf(m,v))>=0);){if(++y===e.length)return;v=0;}b(y,v),f+=m.length;}else if(f<h(p).length)b(p,f+1);else {if(!(p<i))return;b(p+1,0);}}return b(i,h(i).length),d}function h(t){return t<i?e[t]:_}function b(r,i){var a=r===p?id(h(r).slice(f,i)):u_(n$3(n$3([e[p].slice(f)],e.slice(p+1,r),!0),[h(r).slice(0,i)],!1),t.slice(p,r));d.push(a),p=r,f=i;}}function fg(t,r,n,i,a){void 0===i&&(i=0),void 0===a&&(a=!1);var o,s,c,l,u=!1,_=2048,d=!0,p=0;function f(r,s){if($f(s)){if(r===Oe){var c=o;return o=r,f(s,s),void(o=c)}if(r.aliasSymbol&&r.aliasTypeArguments&&r.aliasSymbol===s.aliasSymbol)v(r.aliasTypeArguments,s.aliasTypeArguments,Ap(r.aliasSymbol));else if(r===s&&3145728&r.flags)for(var l=0,p=r.types;l<p.length;l++){var h=p[l];f(h,h);}else {if(1048576&s.flags){var D=y(1048576&r.flags?r.types:[r],s.types,gg),C=y(D[0],D[1],mg),E=C[0];if(0===(N=C[1]).length)return;if(s=qu(N),0===E.length)return void g(r,s,1);r=qu(E);}else if(2097152&s.flags&&e.some(s.types,(function(e){return !!b(e)||dc(e)&&!!b(Pd(e)||nt)}))){if(!(1048576&r.flags)){var k=y(2097152&r.flags?r.types:[r],s.types,Wd),N=(E=k[0],k[1]);if(0===E.length||0===N.length)return;r=$u(E),s=$u(N);}}else 41943040&s.flags&&(s=O_(s));if(8650752&s.flags){if(524288&e.getObjectFlags(r)||r===Re||r===it||128&i&&(r===Ie||r===Kt)||lg(r))return;var F=b(s);if(F){if(!F.isFixed){if((void 0===F.priority||i<F.priority)&&(F.candidates=void 0,F.contraCandidates=void 0,F.topLevel=!0,F.priority=i),i===F.priority){var A=o||r;a&&!u?e.contains(F.contraCandidates,A)||(F.contraCandidates=e.append(F.contraCandidates,A),Qf(t)):e.contains(F.candidates,A)||(F.candidates=e.append(F.candidates,A),Qf(t));}!(128&i)&&262144&s.flags&&F.topLevel&&!tg(n,s)&&(F.topLevel=!1,Qf(t));}return void(_=Math.min(_,i))}var P=C_(s,!1);if(P!==s)m(r,P,f);else if(8388608&s.flags){var w=C_(s.indexType,!1);if(465829888&w.flags){var I=E_(C_(s.objectType,!1),w,!1);I&&I!==s&&m(r,I,f);}}}if(!(4&e.getObjectFlags(r)&&4&e.getObjectFlags(s)&&(r.target===s.target||qp(r)&&qp(s)))||r.node&&s.node)if(4194304&r.flags&&4194304&s.flags)a=!a,f(r.type,s.type),a=!a;else if((af(r)||4&r.flags)&&4194304&s.flags){var O=function(t){var r=e.createSymbolTable();nm(t,(function(t){if(128&t.flags){var n=e.escapeLeadingUnderscores(t.value),i=jn(4,n);i.type=we,t.symbol&&(i.declarations=t.symbol.declarations,i.valueDeclaration=t.symbol.valueDeclaration),r.set(n,i);}}));var n=4&t.flags?[Nl(He,mt,!1)]:e.emptyArray;return ya(void 0,r,e.emptyArray,e.emptyArray,n)}(r);a=!a,g(O,s.type,256),a=!a;}else if(8388608&r.flags&&8388608&s.flags)f(r.objectType,s.objectType),f(r.indexType,s.indexType);else if(268435456&r.flags&&268435456&s.flags)r.symbol===s.symbol&&f(r.type,s.type);else if(33554432&r.flags){f(r.baseType,s);var M=i;i|=4,f(r.substitute,s),i=M;}else if(16777216&s.flags)m(r,s,S);else if(3145728&s.flags)x(r,s.types,s.flags);else if(1048576&r.flags)for(var L=0,R=r.types;L<R.length;L++)f(R[L],s);else if(134217728&s.flags)!function(t,r){var n=ug(t,r),i=r.types;if(n||e.every(r.texts,(function(e){return 0===e.length})))for(var a=0;a<i.length;a++)f(n?n[a]:nt,i[a]);}(r,s);else {if(r=Mc(r),!(512&i&&467927040&r.flags)){var B=Ac(r);if(B!==r&&d&&!(2621440&B.flags))return d=!1,f(B,s);r=B;}2621440&r.flags&&m(r,s,T);}else v(zl(r),zl(s),wp(r.target));}}}function g(e,t,r){var n=i;i|=r,f(e,t),i=n;}function m(t,r,n){var i=t.id+","+r.id,a=s&&s.get(i);if(void 0===a){(s||(s=new e.Map)).set(i,-1);var o=_;_=2048;var u=p,d=Jp(t),f=Jp(r);e.contains(c,d)&&(p|=1),e.contains(l,f)&&(p|=2),3!==p?((c||(c=[])).push(d),(l||(l=[])).push(f),n(t,r),l.pop(),c.pop()):_=-1,p=u,s.set(i,_),_=Math.min(_,o);}else _=Math.min(_,a);}function y(t,r,n){for(var i,a,o=0,s=r;o<s.length;o++)for(var c=s[o],l=0,u=t;l<u.length;l++){var _=u[l];n(_,c)&&(f(_,c),i=e.appendIfUnique(i,_),a=e.appendIfUnique(a,c));}return [i?e.filter(t,(function(t){return !e.contains(i,t)})):t,a?e.filter(r,(function(t){return !e.contains(a,t)})):r]}function v(e,t,r){for(var n=e.length<t.length?e.length:t.length,i=0;i<n;i++)i<r.length&&2==(7&r[i])?h(e[i],t[i]):f(e[i],t[i]);}function h(e,t){G||1024&i?(a=!a,f(e,t),a=!a):f(e,t);}function b(e){if(8650752&e.flags)for(var r=0,n=t;r<n.length;r++){var i=n[r];if(e===i.typeParameter)return i}}function x(t,r,n){var a=0;if(1048576&n){for(var o=void 0,s=1048576&t.flags?t.types:[t],c=new Array(s.length),l=!1,u=0,d=r;u<d.length;u++)if(b(T=d[u]))o=T,a++;else for(var p=0;p<s.length;p++){var m=_;_=2048,f(s[p],T),_===i&&(c[p]=!0),l=l||-1===_,_=Math.min(_,m);}if(0===a){var y=function(t){for(var r,n=0,i=t;n<i.length;n++){var a=i[n],o=2097152&a.flags&&e.find(a.types,(function(e){return !!b(e)}));if(!o||r&&o!==r)return;r=o;}return r}(r);return void(y&&g(t,y,1))}if(1===a&&!l){var v=e.flatMap(s,(function(e,t){return c[t]?void 0:e}));if(v.length)return void f(qu(v),o)}}else for(var h=0,x=r;h<x.length;h++)b(T=x[h])?a++:f(t,T);if(2097152&n?1===a:a>0)for(var D=0,S=r;D<S.length;D++){var T;b(T=S[D])&&g(t,T,1);}}function D(t,r,n){if(1048576&n.flags){for(var i=!1,a=0,o=n.types;a<o.length;a++)i=D(t,r,o[a])||i;return i}if(4194304&n.flags){var s=b(n.type);if(s&&!s.isFixed&&!lg(t)){var c=rg(t,r,n);c&&g(c,s.typeParameter,524288&e.getObjectFlags(t)?16:8);}return !0}if(262144&n.flags){g(c_(t),n,32);var l=vc(n);if(l&&D(t,r,l))return !0;var u=e.map(yc(t),Uo),_=e.map(Hc(t),(function(e){return e!==Ar?e.type:nt}));return f(qu(e.concatenate(u,_)),ac(r)),!0}return !1}function S(e,t){if(16777216&e.flags)f(e.checkType,t.checkType),f(e.extendsType,t.extendsType),f(j_(e),j_(t)),f(J_(e),J_(t));else {var r=i;i|=a?64:0,x(e,[j_(t),J_(t)],t.flags),i=r;}}function T(t,r){if(4&e.getObjectFlags(t)&&4&e.getObjectFlags(r)&&(t.target===r.target||qp(t)&&qp(r)))v(zl(t),zl(r),wp(t.target));else {if(dc(t)&&dc(r)){f(nc(t),nc(r)),f(ac(t),ac(r));var n=ic(t),i=ic(r);n&&i&&f(n,i);}var a,o;if(32&e.getObjectFlags(r)&&!r.declaration.nameType&&D(t,r,nc(r)))return;if(!function(e,t){return _f(e)&&_f(t)?function(e,t){return !(8&t.target.combinedFlags)&&t.target.minLength>e.target.minLength||!t.target.hasRestElement&&(e.target.hasRestElement||t.target.fixedLength<e.target.fixedLength)}(e,t):!!og(e,t,!1,!0)&&!!og(t,e,!1,!1)}(t,r)){if(qp(t)||_f(t)){if(_f(r)){var s=Ul(t),c=Ul(r),l=zl(r),u=r.target.elementFlags;if(_f(t)&&(o=r,Ul(a=t)===Ul(o)&&e.every(a.target.elementFlags,(function(e,t){return (12&e)==(12&o.target.elementFlags[t])})))){for(var _=0;_<c;_++)f(zl(t)[_],l[_]);return}var d=_f(t)?Math.min(t.target.fixedLength,r.target.fixedLength):0,p=Math.min(_f(t)?Ru(t.target,3):0,r.target.hasRestElement?Ru(r.target,3):0);for(_=0;_<d;_++)f(zl(t)[_],l[_]);if(!_f(t)||s-d-p==1&&4&t.target.elementFlags[d]){var m=zl(t)[d];for(_=d;_<c-p;_++)f(8&u[_]?Tu(m):m,l[_]);}else {var y=c-d-p;if(2===y&&u[d]&u[d+1]&8&&_f(t)){var h=b(l[d]);h&&void 0!==h.impliedArity&&(f(Ou(t,d,p+s-h.impliedArity),l[d]),f(Ou(t,d+h.impliedArity,p),l[d+1]));}else if(1===y&&8&u[d]){var x=2&r.target.elementFlags[c-1];g(_f(t)?Ou(t,d,p):Tu(zl(t)[0]),l[d],x?2:0);}else 1===y&&4&u[d]&&(m=_f(t)?gf(t,d,p):zl(t)[0])&&f(m,l[d]);}for(_=0;_<p;_++)f(zl(t)[s-_-1],l[c-_-1]);return}if(qp(r))return void k(t,r)}!function(e,t){for(var r=0,n=fc(t);r<n.length;r++){var i=n[r],a=Jc(e,i.escapedName);a&&f(Uo(a),Uo(i));}}(t,r),C(t,r,0),C(t,r,1),k(t,r);}}}function C(t,r,n){for(var i=Uc(t,n),a=Uc(r,n),o=i.length,s=a.length,c=o<s?o:s,l=!!(524288&e.getObjectFlags(t)),u=0;u<c;u++)E(Tl(i[o-c+u]),Sl(a[s-c+u]),l);}function E(e,t,r){if(!r){var n=u,i=t.declaration?t.declaration.kind:0;u=u||168===i||167===i||170===i,Vf(e,t,h),u=n;}qf(e,t,f);}function k(t,r){var n=e.getObjectFlags(t)&e.getObjectFlags(r)&32?8:0,i=Hc(r);if(Pf(t))for(var a=0,o=i;a<o.length;a++){for(var s=o[a],c=[],l=0,u=yc(t);l<u.length;l++){var _=u[l];if(qc(a_(_,8576),s.keyType)){var d=Uo(_);c.push(16777216&_.flags?Af(d):d);}}for(var p=0,f=Hc(t);p<f.length;p++){var m=f[p];qc(m.keyType,s.keyType)&&c.push(m.type);}c.length&&g(qu(c),s.type,n);}for(var y=0,v=i;y<v.length;y++){var h=Yc(t,(s=v[y]).keyType);h&&g(h.type,s.type,n);}}f(r,n);}function gg(e,t){return re&&t===Ve?e===t:Wd(e,t)||!!(4&t.flags&&128&e.flags||8&t.flags&&256&e.flags)}function mg(e,t){return !!(524288&e.flags&&524288&t.flags&&e.symbol&&e.symbol===t.symbol||e.aliasSymbol&&e.aliasTypeArguments&&e.aliasSymbol===t.aliasSymbol)}function yg(t){return !!(128&e.getObjectFlags(t))}function vg(t){return !!(32896&e.getObjectFlags(t))}function hg(t,r){var n,i,a=t.inferences[r];if(!a.inferredType){var o=void 0,s=t.signature;if(s){var c=a.candidates?function(t,r){var n,i=function(t){if(t.length>1){var r=e.filter(t,vg);if(r.length){var n=qu(r,2);return e.concatenate(e.filter(t,(function(e){return !vg(e)})),[n])}}return t}(t.candidates),a=!!(n=hc(t.typeParameter))&&Eb(16777216&n.flags?xc(n):n,406978556),o=!a&&t.topLevel&&(t.isFixed||!tg(ml(r),t.typeParameter)),s=a?e.sameMap(i,rd):o?e.sameMap(i,sf):i;return jf(416&t.priority?qu(s,2):function(t){if(!H)return Vp(t);var r=e.filter(t,(function(e){return !(98304&e.flags)}));return r.length?xf(Vp(r),98304&yf(t)):qu(t,2)}(s))}(a,s):void 0;if(a.contraCandidates)o=!c||131072&c.flags||!e.some(a.contraCandidates,(function(e){return Xd(c,e)}))?function(t){return 416&t.priority?$u(t.contraCandidates):(r=t.contraCandidates,e.reduceLeft(r,(function(e,t){return Xd(t,e)?t:e})));var r;}(a):c;else if(c)o=c;else if(1&t.flags)o=it;else {var l=Fc(a.typeParameter);l&&(o=Rd(l,(n=function(t,r){return xd((function(n){return e.findIndex(t.inferences,(function(e){return e.typeParameter===n}))>=r?je:n}))}(t,r),i=t.nonFixingMapper,n?Dd(4,n,i):i)));}}else o=sg(a);a.inferredType=o||bg(!!(2&t.flags));var u=hc(a.typeParameter);if(u){var _=Rd(u,t.nonFixingMapper);o&&t.compareTypes(o,Ls(_,o))||(a.inferredType=o=_);}}return a.inferredType}function bg(e){return e?we:je}function xg(e){for(var t=[],r=0;r<e.inferences.length;r++)t.push(hg(e,r));return t}function Dg(t){switch(t.escapedText){case"document":case"console":return e.Diagnostics.Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_include_dom;case"$":return U.types?e.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery_and_then_add_jquery_to_the_types_field_in_your_tsconfig:e.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery;case"describe":case"suite":case"it":case"test":return U.types?e.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_types_Slashjest_or_npm_i_save_dev_types_Slashmocha_and_then_add_jest_or_mocha_to_the_types_field_in_your_tsconfig:e.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_types_Slashjest_or_npm_i_save_dev_types_Slashmocha;case"process":case"require":case"Buffer":case"module":return U.types?e.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode_and_then_add_node_to_the_types_field_in_your_tsconfig:e.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode;case"Map":case"Set":case"Promise":case"Symbol":case"WeakMap":case"WeakSet":case"Iterator":case"AsyncIterator":case"SharedArrayBuffer":case"Atomics":case"AsyncIterable":case"AsyncIterableIterator":case"AsyncGenerator":case"AsyncGeneratorFunction":case"BigInt":case"Reflect":case"BigInt64Array":case"BigUint64Array":return e.Diagnostics.Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_1_or_later;default:return 295===t.parent.kind?e.Diagnostics.No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer:e.Diagnostics.Cannot_find_name_0}}function Sg(t){var r=Qn(t);return r.resolvedSymbol||(r.resolvedSymbol=!e.nodeIsMissing(t)&&ei(t,t.escapedText,1160127,Dg(t),t,!e.isWriteOnlyAccess(t),!1)||Ne),r.resolvedSymbol}function Tg(t){return !!e.findAncestor(t,(function(e){return 180===e.kind||79!==e.kind&&160!==e.kind&&"quit"}))}function Cg(t,r,n,i){switch(t.kind){case 79:if(!e.isThisInTypeQuery(t)){var a=Sg(t);return a!==Ne?"".concat(i?O(i):"-1","|").concat(Bu(r),"|").concat(Bu(n),"|").concat(M(a)):void 0}case 108:return "0|".concat(i?O(i):"-1","|").concat(Bu(r),"|").concat(Bu(n));case 229:case 211:return Cg(t.expression,r,n,i);case 160:var o=Cg(t.left,r,n,i);return o&&o+"."+t.right.escapedText;case 205:case 206:var s=kg(t);if(void 0!==s){var c=Cg(t.expression,r,n,i);return c&&c+"."+s}}}function Eg(t,r){switch(r.kind){case 211:case 229:return Eg(t,r.expression);case 220:return e.isAssignmentExpression(r)&&Eg(t,r.left)||e.isBinaryExpression(r)&&27===r.operatorToken.kind&&Eg(t,r.right)}switch(t.kind){case 230:return 230===r.kind&&t.keywordToken===r.keywordToken&&t.name.escapedText===r.name.escapedText;case 79:case 80:return e.isThisInTypeQuery(t)?108===r.kind:79===r.kind&&Sg(t)===Sg(r)||(253===r.kind||202===r.kind)&&aa(Sg(t))===$i(r);case 108:return 108===r.kind;case 106:return 106===r.kind;case 229:case 211:return Eg(t.expression,r);case 205:case 206:return e.isAccessExpression(r)&&kg(t)===kg(r)&&Eg(t.expression,r.expression);case 160:return e.isAccessExpression(r)&&t.right.escapedText===kg(r)&&Eg(t.left,r.expression);case 220:return e.isBinaryExpression(t)&&27===t.operatorToken.kind&&Eg(t.right,r)}return !1}function kg(t){var r;return 205===t.kind?t.name.escapedText:206===t.kind&&e.isStringOrNumericLiteralLike(t.argumentExpression)?e.escapeLeadingUnderscores(t.argumentExpression.text):202===t.kind&&(r=lo(t))?e.escapeLeadingUnderscores(r):void 0}function Ng(t,r){for(;e.isAccessExpression(t);)if(Eg(t=t.expression,r))return !0;return !1}function Fg(t,r){for(;e.isOptionalChain(t);)if(Eg(t=t.expression,r))return !0;return !1}function Ag(t,r){if(t&&1048576&t.flags){var n=Ic(t,r);if(n&&2&e.getCheckFlags(n))return void 0===n.isDiscriminantProperty&&(n.isDiscriminantProperty=192==(192&n.checkFlags)&&!b_(Uo(n))),!!n.isDiscriminantProperty}return !1}function Pg(e,t){for(var r,n=0,i=e;n<i.length;n++){var a=i[n];if(Ag(t,a.escapedName)){if(r){r.push(a);continue}r=[a];}}return r}function wg(t){var r=t.types;if(!(r.length<10||65536&e.getObjectFlags(t)||e.countWhere(r,(function(e){return !!(59506688&e.flags)}))<10)){if(void 0===t.keyPropertyName){var n=e.forEach(r,(function(t){return 59506688&t.flags?e.forEach(yc(t),(function(e){return rf(Uo(e))?e.escapedName:void 0})):void 0})),i=n&&function(t,r){for(var n=new e.Map,i=0,a=function(e){if(61603840&e.flags){var t=eo(e,r);if(t){if(!af(t))return {value:void 0};var a=!1;nm(t,(function(t){var r=Bu(rd(t)),i=n.get(r);i?i!==je&&(n.set(r,je),a=!0):n.set(r,e);})),a||i++;}}},o=0,s=t;o<s.length;o++){var c=a(s[o]);if("object"==typeof c)return c.value}return i>=10&&2*i>=t.length?n:void 0}(r,n);t.keyPropertyName=i?n:"",t.constituentMap=i;}return t.keyPropertyName.length?t.keyPropertyName:void 0}}function Ig(e,t){var r,n=null===(r=e.constituentMap)||void 0===r?void 0:r.get(Bu(rd(t)));return n!==je?n:void 0}function Og(e,t){var r=wg(e),n=r&&eo(t,r);return n&&Ig(e,n)}function Mg(e,t){return Eg(e,t)||Ng(e,t)}function Lg(e,t){if(e.arguments)for(var r=0,n=e.arguments;r<n.length;r++)if(Mg(t,n[r]))return !0;return !(205!==e.expression.kind||!Mg(t,e.expression.expression))}function Rg(e){return (!e.id||e.id<0)&&(e.id=p,p++),e.id}function Bg(e){var t=pc(e);return !!(t.callSignatures.length||t.constructSignatures.length||t.members.get("bind")&&Xd(e,wt))}function jg(t,r){void 0===r&&(r=!1);var n=t.flags;if(4&n)return H?16317953:16776705;if(128&n){var i=""===t.value;return H?i?12123649:7929345:i?12582401:16776705}if(40&n)return H?16317698:16776450;if(256&n){var a=0===t.value;return H?a?12123394:7929090:a?12582146:16776450}return 64&n?H?16317188:16775940:2048&n?(a=mf(t),H?a?12122884:7928580:a?12581636:16775940):16&n?H?16316168:16774920:528&n?H?t===Xe||t===Ye?12121864:7927560:t===Xe||t===Ye?12580616:16774920:524288&n&&!r?16&e.getObjectFlags(t)&&fp(t)?H?16318463:16777215:Bg(t)?H?7880640:16728e3:H?7888800:16736160:49152&n?9830144:65536&n?9363232:12288&n?H?7925520:16772880:67108864&n?H?7888800:16736160:131072&n?0:465829888&n?h_(t)?H?7929345:16776705:jg(Tc(t)||je,r):1048576&n?e.reduceLeft(t.types,(function(e,t){return e|jg(t,r)}),0):2097152&n?(r||(r=Eb(t,131068)),e.reduceLeft(t.types,(function(e,t){return e&jg(t,r)}),16777215)):16777215}function Jg(e,t){return om(e,(function(e){return 0!=(jg(e)&t)}))}function zg(e,t){return t?qu([oo(e),rx(t)]):e}function Ug(e,t){var r,n=i_(t);if(!Es(n))return Me;var i=Ps(n);return eo(e,i)||Vg(null===(r=Zc(e,i))||void 0===r?void 0:r.type)||Me}function Kg(e,t){return am(e,$p)&&function(e,t){return eo(e,""+t)||(am(e,_f)?lm(e,(function(e){return ff(e)||ze})):void 0)}(e,t)||Vg(hD(65,e,ze,void 0))||Me}function Vg(e){return e&&U.noUncheckedIndexedAccess?qu([e,ze]):e}function qg(e){return Tu(hD(65,e,ze,void 0)||Me)}function Wg(e){return 220===e.parent.kind&&e.parent.left===e||243===e.parent.kind&&e.parent.initializer===e}function Hg(e){return Ug(Gg(e.parent),e.name)}function Gg(e){var t=e.parent;switch(t.kind){case 242:return He;case 243:return vD(t)||Me;case 220:return function(e){return 203===e.parent.kind&&Wg(e.parent)||294===e.parent.kind&&Wg(e.parent.parent)?zg(Gg(e),e.right):rx(e.right)}(t);case 214:return ze;case 203:return function(e,t){return Kg(Gg(e),e.elements.indexOf(t))}(t,e);case 224:return function(e){return qg(Gg(e.parent))}(t);case 294:return Hg(t);case 295:return function(e){return zg(Hg(e),e.objectAssignmentInitializer)}(t)}return Me}function Qg(e){return Qn(e).resolvedType||rx(e)}function Xg(e){return 253===e.kind?function(e){return e.initializer?Qg(e.initializer):242===e.parent.parent.kind?He:243===e.parent.parent.kind&&vD(e.parent.parent)||Me}(e):function(e){var t=e.parent,r=Xg(t.parent);return zg(200===t.kind?Ug(r,e.propertyName||e.name):e.dotDotDotToken?qg(r):Kg(r,t.elements.indexOf(e)),e.initializer)}(e)}function Yg(e){switch(e.kind){case 211:return Yg(e.expression);case 220:switch(e.operatorToken.kind){case 63:case 75:case 76:case 77:return Yg(e.left);case 27:return Yg(e.right)}}return e}function Zg(e){var t=e.parent;return 211===t.kind||220===t.kind&&63===t.operatorToken.kind&&t.left===e||220===t.kind&&27===t.operatorToken.kind&&t.right===e?Zg(t):e}function $g(e){return 288===e.kind?rd(rx(e.expression)):nt}function em(e){var t=Qn(e);if(!t.switchTypes){t.switchTypes=[];for(var r=0,n=e.caseBlock.clauses;r<n.length;r++){var i=n[r];t.switchTypes.push($g(i));}}return t.switchTypes}function tm(t,r){for(var n=[],i=0,a=t.caseBlock.clauses;i<a.length;i++){var o=a[i];if(288===o.kind){if(e.isStringLiteralLike(o.expression)){n.push(o.expression.text);continue}return e.emptyArray}r&&n.push(void 0);}return n}function rm(e,t){return e===t||1048576&t.flags&&function(e,t){if(1048576&e.flags){for(var r=0,n=e.types;r<n.length;r++){var i=n[r];if(!ju(t.types,i))return !1}return !0}return !!(1024&e.flags&&ds(e)===t)||ju(t.types,e)}(e,t)}function nm(t,r){return 1048576&t.flags?e.forEach(t.types,r):r(t)}function im(t,r){return 1048576&t.flags?e.some(t.types,r):r(t)}function am(t,r){return 1048576&t.flags?e.every(t.types,r):r(t)}function om(t,r){if(1048576&t.flags){var n=t.types,i=e.filter(n,r);if(i===n)return t;var a=t.origin,o=void 0;if(a&&1048576&a.flags){var s=a.types,c=e.filter(s,(function(e){return !!(1048576&e.flags)||r(e)}));if(s.length-c.length==n.length-i.length){if(1===c.length)return c[0];o=Vu(1048576,c);}}return Hu(i,t.objectFlags,void 0,void 0,o)}return 131072&t.flags||r(t)?t:nt}function sm(e,t){return om(e,(function(e){return e!==t}))}function cm(e){return 1048576&e.flags?e.types.length:1}function lm(e,t,r){if(131072&e.flags)return e;if(!(1048576&e.flags))return t(e);for(var n,i=e.origin,a=!1,o=0,s=i&&1048576&i.flags?i.types:e.types;o<s.length;o++){var c=s[o],l=1048576&c.flags?lm(c,t,r):t(c);a||(a=c!==l),l&&(n?n.push(l):n=[l]);}return a?n&&qu(n,r?0:1):e}function um(t,r,n,i){return 1048576&t.flags&&n?qu(e.map(t.types,r),1,n,i):lm(t,r)}function _m(e){return 1048576&e.flags?e.types.length:1}function dm(e,t){return om(e,(function(e){return 0!=(e.flags&t)}))}function pm(e,t){return Eb(e,134217804)&&Eb(t,402655616)?lm(e,(function(e){return 4&e.flags?dm(t,402653316):h_(e)&&!Eb(t,402653188)?dm(t,128):8&e.flags?dm(t,264):64&e.flags?dm(t,2112):e})):e}function fm(e){return 0===e.flags}function gm(e){return 0===e.flags?e.type:e}function mm(e,t){return t?{flags:0,type:131072&e.flags?it:e}:e}function ym(e){return Ee[e.id]||(Ee[e.id]=function(e){var t=_a(256);return t.elementType=e,t}(e))}function vm(e,t){var r=If(of(ix(t)));return rm(r,e.elementType)?e:ym(qu([e.elementType,r]))}function hm(t){return 256&e.getObjectFlags(t)?(r=t).finalArrayType||(r.finalArrayType=131072&(n=r.elementType).flags?Kt:Tu(1048576&n.flags?qu(n.types,2):n)):t;var r,n;}function bm(t){return 256&e.getObjectFlags(t)?t.elementType:nt}function xm(t){var r=Zg(t),n=r.parent,i=e.isPropertyAccessExpression(n)&&("length"===n.name.escapedText||207===n.parent.kind&&e.isIdentifier(n.name)&&e.isPushOrUnshiftIdentifier(n.name)),a=206===n.kind&&n.expression===r&&220===n.parent.kind&&63===n.parent.operatorToken.kind&&n.parent.left===n&&!e.isAssignmentTarget(n.parent)&&kb(rx(n.argumentExpression),296);return i||a}function Dm(t,r){if(8752&t.flags)return Uo(t);if(7&t.flags){if(262144&e.getCheckFlags(t)){var n=t.syntheticOrigin;if(n&&Dm(n))return Uo(t)}var i=t.valueDeclaration;if(i){if(s=i,(e.isVariableDeclaration(s)||e.isPropertyDeclaration(s)||e.isPropertySignature(s)||e.isParameter(s))&&(e.getEffectiveTypeAnnotationNode(s)||e.isInJSFile(s)&&e.hasInitializer(s)&&s.initializer&&e.isFunctionExpressionOrArrowFunction(s.initializer)&&e.getEffectiveReturnTypeNode(s.initializer)))return Uo(t);if(e.isVariableDeclaration(i)&&243===i.parent.parent.kind){var a=i.parent.parent,o=Sm(a.expression,void 0);if(o)return hD(a.awaitModifier?15:13,o,ze,void 0)}r&&e.addRelatedInfo(r,e.createDiagnosticForNode(i,e.Diagnostics._0_needs_an_explicit_type_annotation,Ia(t)));}}var s;}function Sm(t,r){if(!(16777216&t.flags))switch(t.kind){case 79:var n=aa(Sg(t));return Dm(2097152&n.flags?ki(n):n,r);case 108:return function(t){var r=e.getThisContainer(t,!1);if(e.isFunctionLike(r)){var n=cl(r);if(n.thisParameter)return Dm(n.thisParameter)}if(e.isClassLike(r.parent)){var i=$i(r.parent);return e.isStatic(r)?Uo(i):ms(i).thisType}}(t);case 106:return Qm(t);case 205:var i=Sm(t.expression,r);if(i){var a=t.name,o=void 0;if(e.isPrivateIdentifier(a)){if(!i.symbol)return;o=Jc(i,e.getSymbolNameForPrivateIdentifier(i.symbol,a.escapedText));}else o=Jc(i,a.escapedText);return o&&Dm(o,r)}return;case 211:return Sm(t.expression,r)}}function Tm(t){var r=Qn(t),n=r.effectsSignature;if(void 0===n){var i=void 0;237===t.parent.kind?i=Sm(t.expression,void 0):106!==t.expression.kind&&(i=e.isOptionalChain(t)?uv(kf(ax(t.expression),t.expression),t.expression):iv(t.expression));var a=Uc(i&&Ac(i)||je,0),o=1!==a.length||a[0].typeParameters?e.some(a,Cm)?Nh(t):void 0:a[0];n=r.effectsSignature=o&&Cm(o)?o:kr;}return n===kr?void 0:n}function Cm(e){return !!(fl(e)||e.declaration&&131072&(yl(e.declaration)||je).flags)}function Em(e){var t=Nm(e,!1);return vr=e,hr=t,t}function km(t){var r=e.skipParentheses(t,!0);return 95===r.kind||220===r.kind&&(55===r.operatorToken.kind&&(km(r.left)||km(r.right))||56===r.operatorToken.kind&&km(r.left)&&km(r.right))}function Nm(t,r){for(;;){if(t===vr)return hr;var n=t.flags;if(4096&n){if(!r){var i=Rg(t),a=ln[i];return void 0!==a?a:ln[i]=Nm(t,!0)}r=!1;}if(368&n)t=t.antecedent;else if(512&n){var o=Tm(t.node);if(o){var s=fl(o);if(s&&3===s.kind&&!s.type){var c=t.node.arguments[s.parameterIndex];if(c&&km(c))return !1}if(131072&ml(o).flags)return !1}t=t.antecedent;}else {if(4&n)return e.some(t.antecedents,(function(e){return Nm(e,!1)}));if(8&n){var l=t.antecedents;if(void 0===l||0===l.length)return !1;t=l[0];}else {if(!(128&n)){if(1024&n){vr=void 0;var u=t.target,_=u.antecedents;u.antecedents=t.antecedents;var d=Nm(t.antecedent,!1);return u.antecedents=_,d}return !(1&n)}if(t.clauseStart===t.clauseEnd&&gb(t.switchStatement))return !1;t=t.antecedent;}}}}function Fm(t,r){for(;;){var n=t.flags;if(4096&n){if(!r){var i=Rg(t),a=un[i];return void 0!==a?a:un[i]=Fm(t,!0)}r=!1;}if(496&n)t=t.antecedent;else if(512&n){if(106===t.node.expression.kind)return !0;t=t.antecedent;}else {if(4&n)return e.every(t.antecedents,(function(e){return Fm(e,!1)}));if(!(8&n)){if(1024&n){var o=t.target,s=o.antecedents;o.antecedents=t.antecedents;var c=Fm(t.antecedent,!1);return o.antecedents=s,c}return !!(1&n)}t=t.antecedents[0];}}}function Am(t){switch(t.kind){case 79:var r=Sg(t);return Mm(r)||e.isParameterOrCatchClauseVariable(r)&&!Im(r);case 205:case 206:return Am(t.expression)&&Db(Qn(t).resolvedSymbol||Ne)}return !1}function Pm(t,r,n,i){var a;void 0===n&&(n=r);var o=!1,s=0;if(Vr)return Me;if(!t.flowNode)return r;qr++;var c=Kr,l=gm(d(t.flowNode));Kr=c;var u=256&e.getObjectFlags(l)&&xm(t)?Kt:hm(l);return u===st||t.parent&&229===t.parent.kind&&!(131072&u.flags)&&131072&Jg(u,2097152).flags?r:u===Je?je:u;function _(){return o?a:(o=!0,a=Cg(t,r,n,i))}function d(a){if(2e3===s)return null===e.tracing||void 0===e.tracing||e.tracing.instant("checkTypes","getTypeAtFlowNode_DepthLimit",{flowId:a.id}),Vr=!0,o=t,l=e.findAncestor(o,e.isFunctionOrModuleBlock),u=e.getSourceFileOfNode(o),_=e.getSpanOfTokenAtPosition(u,l.statements.pos),mn.add(e.createFileDiagnostic(u,_.start,_.length,e.Diagnostics.The_containing_function_or_module_body_is_too_large_for_control_flow_analysis)),Me;var o,l,u,_,p;for(s++;;){var g=a.flags;if(4096&g){for(var D=c;D<Kr;D++)if(sn[D]===a)return s--,cn[D];p=a;}var S=void 0;if(16&g){if(!(S=f(a))){a=a.antecedent;continue}}else if(512&g){if(!(S=m(a))){a=a.antecedent;continue}}else if(96&g)S=v(a);else if(128&g)S=h(a);else if(12&g){if(1===a.antecedents.length){a=a.antecedents[0];continue}S=4&g?b(a):x(a);}else if(256&g){if(!(S=y(a))){a=a.antecedent;continue}}else if(1024&g){var T=a.target,C=T.antecedents;T.antecedents=a.antecedents,S=d(a.antecedent),T.antecedents=C;}else if(2&g){var E=a.node;if(E&&E!==i&&205!==t.kind&&206!==t.kind&&108!==t.kind){a=E.flowNode;continue}S=n;}else S=cD(r);return p&&(sn[Kr]=p,cn[Kr]=S,Kr++),s--,S}}function p(e){var r=e.node;return Bm(253===r.kind||202===r.kind?Xg(r):Gg(r),t)}function f(n){var i=n.node;if(Eg(t,i)){if(!Em(n))return st;if(2===e.getAssignmentTargetKind(i)){var a=d(n.antecedent);return mm(of(gm(a)),fm(a))}if(r===Ie||r===Kt){if(function(e){return 253===e.kind&&e.initializer&&fo(e.initializer)||202!==e.kind&&220===e.parent.kind&&fo(e.parent.right)}(i))return ym(nt);var o=sf(p(n));return Yd(o,r)?o:Ut}return 1048576&r.flags?function(e,t){if(e!==t){if(131072&t.flags)return t;var r=om(e,(function(e){return function(e,t){if(!(1048576&e.flags))return Yd(e,t);for(var r=0,n=e.types;r<n.length;r++)if(Yd(n[r],t))return !0;return !1}(t,e)}));if(512&t.flags&&nd(t)&&(r=lm(r,td)),Yd(t,r))return r}return e}(r,p(n)):r}if(Ng(t,i)){if(!Em(n))return st;if(e.isVariableDeclaration(i)&&(e.isInJSFile(i)||e.isVarConst(i))){var s=e.getDeclaredExpandoInitializer(i);if(s&&(212===s.kind||213===s.kind))return d(n.antecedent)}return r}if(e.isVariableDeclaration(i)&&242===i.parent.parent.kind&&Eg(t,i.parent.parent.expression))return ov(gm(d(n.antecedent)))}function g(t,r){var n=e.skipParentheses(r,!0);if(95===n.kind)return st;if(220===n.kind){if(55===n.operatorToken.kind)return g(g(t,n.left),n.right);if(56===n.operatorToken.kind)return qu([g(t,n.left),g(t,n.right)])}return U(t,n,!0)}function m(e){var t=Tm(e.node);if(t){var r=fl(t);if(r&&(2===r.kind||3===r.kind)){var n=d(e.antecedent),i=hm(gm(n)),a=r.type?z(i,r,e.node,!0):3===r.kind&&r.parameterIndex>=0&&r.parameterIndex<e.node.arguments.length?g(i,e.node.arguments[r.parameterIndex]):i;return a===i?n:mm(a,fm(n))}if(131072&ml(t).flags)return st}}function y(n){if(r===Ie||r===Kt){var i=n.node,a=207===i.kind?i.expression.expression:i.left.expression;if(Eg(t,Yg(a))){var o=d(n.antecedent),s=gm(o);if(256&e.getObjectFlags(s)){var c=s;if(207===i.kind)for(var l=0,u=i.arguments;l<u.length;l++)c=vm(c,u[l]);else kb(ix(i.left.argumentExpression),296)&&(c=vm(c,i.right));return c===s?o:mm(c,fm(o))}return o}}}function v(e){var t=d(e.antecedent),r=gm(t);if(131072&r.flags)return t;var n=0!=(32&e.flags),i=hm(r),a=U(i,e.node,n);return a===i?t:mm(a,fm(t))}function h(r){var n=r.switchStatement.expression,i=d(r.antecedent),a=gm(i);if(Eg(t,n))a=M(a,r.switchStatement,r.clauseStart,r.clauseEnd);else if(215===n.kind&&Eg(t,n.expression))a=function(t,r,n,i){var a=tm(r,!0);if(!a.length)return t;var o,s,c=e.findIndex(a,(function(e){return void 0===e})),l=n===i||c>=n&&c<i;if(c>-1){var u=a.filter((function(e){return void 0!==e})),_=c<n?n-1:n,d=c<i?i-1:i;o=u.slice(_,d),s=fb(_,d,u,l);}else o=a.slice(n,i),s=fb(n,i,a,l);if(l)return om(t,(function(e){return (jg(e)&s)===s}));var p=Jg(qu(o.map((function(e){return L(t,e)||t}))),s);return Jg(lm(t,R(p)),s)}(a,r.switchStatement,r.clauseStart,r.clauseEnd);else {H&&(Fg(n,t)?a=O(a,r.switchStatement,r.clauseStart,r.clauseEnd,(function(e){return !(163840&e.flags)})):215===n.kind&&Fg(n.expression,t)&&(a=O(a,r.switchStatement,r.clauseStart,r.clauseEnd,(function(e){return !(131072&e.flags||128&e.flags&&"undefined"===e.value)}))));var o=C(n,a);o&&(a=function(t,r,n,i,a){if(i<a&&1048576&t.flags&&wg(t)===kg(r)){var o=em(n).slice(i,a),s=qu(e.map(o,(function(e){return Ig(t,e)||je})));if(s!==je)return s}return k(t,r,(function(e){return M(e,n,i,a)}))}(a,o,r.switchStatement,r.clauseStart,r.clauseEnd));}return mm(a,fm(i))}function b(t){for(var i,a=[],o=!1,s=!1,c=0,l=t.antecedents;c<l.length;c++){var u=l[c];if(!i&&128&u.flags&&u.clauseStart===u.clauseEnd)i=u;else {if((p=gm(_=d(u)))===r&&r===n)return p;e.pushIfUnique(a,p),rm(p,r)||(o=!0),fm(_)&&(s=!0);}}if(i){var _,p=gm(_=d(i));if(!e.contains(a,p)&&!gb(i.switchStatement)){if(p===r&&r===n)return p;a.push(p),rm(p,r)||(o=!0),fm(_)&&(s=!0);}}return mm(D(a,o?2:1),s)}function x(t){var n=Rg(t),i=rn[n]||(rn[n]=new e.Map),a=_();if(!a)return r;var o=i.get(a);if(o)return o;for(var s=zr;s<Ur;s++)if(nn[s]===t&&an[s]===a&&on[s].length)return mm(D(on[s],1),!0);for(var c,l=[],u=!1,p=0,f=t.antecedents;p<f.length;p++){var g=f[p],m=void 0;if(c){nn[Ur]=t,an[Ur]=a,on[Ur]=l,Ur++;var y=br;br=void 0,m=d(g),br=y,Ur--;var v=i.get(a);if(v)return v}else m=c=d(g);var h=gm(m);if(e.pushIfUnique(l,h),rm(h,r)||(u=!0),h===r)break}var b=D(l,u?2:1);return fm(c)?mm(b,!0):(i.set(a,b),b)}function D(t,n){if(function(t){for(var r=!1,n=0,i=t;n<i.length;n++){var a=i[n];if(!(131072&a.flags)){if(!(256&e.getObjectFlags(a)))return !1;r=!0;}}return r}(t))return ym(qu(e.map(t,bm)));var i=qu(e.sameMap(t,hm),n);return i!==r&&i.flags&r.flags&1048576&&e.arraysEqual(i.types,r.types)?r:i}function C(n,i){var a,o,s=1048576&r.flags?r:i;return 1048576&s.flags&&(a=function(t){if(e.isAccessExpression(t))return t;if(e.isIdentifier(t)){var r=Sg(t);if(Mm(r)){var n=r.valueDeclaration;if(e.isVariableDeclaration(n)&&!n.type&&n.initializer&&e.isAccessExpression(n.initializer))return n.initializer;if(e.isBindingElement(n)&&!n.initializer){var i=n.parent.parent;if(e.isVariableDeclaration(i)&&!i.type&&i.initializer&&(e.isIdentifier(i.initializer)||e.isAccessExpression(i.initializer)))return n}}}}(n))&&(o=kg(a))&&Eg(t,e.isAccessExpression(a)?a.expression:a.parent.parent.initializer)&&Ag(s,o)?a:void 0}function k(t,r,n){var i=kg(r);if(void 0===i)return t;var a=H&&e.isOptionalChain(r)&&Eb(t,98304),o=eo(a?Jg(t,2097152):t,i);if(!o)return t;var s=n(o=a?Df(o):o);return om(t,(function(e){var t=function(e,t){var r;return eo(e,t)||(null===(r=Zc(e,t))||void 0===r?void 0:r.type)||je}(e,i);return !(131072&s.flags)&&$d(s,t)}))}function N(e,t,r,n,i){if((36===r||37===r)&&1048576&e.flags){var a=wg(e);if(a&&a===kg(t)){var o=Ig(e,rx(n));if(o)return r===(i?36:37)?o:rf(eo(o,a)||je)?sm(e,o):e}}return k(e,t,(function(e){return w(e,r,n,i)}))}function F(e,r,n){if(Eg(t,r))return 2&e.flags&&n?Je:Jg(e,n?4194304:8388608);H&&n&&Fg(r,t)&&(e=Jg(e,2097152));var i=C(r,e);return i?k(e,i,(function(e){return Jg(e,n?4194304:8388608)})):e}function A(n,i,a){switch(i.operatorToken.kind){case 63:case 75:case 76:case 77:return F(U(n,i.right,a),i.left,a);case 34:case 35:case 36:case 37:var o=i.operatorToken.kind,s=Yg(i.left),c=Yg(i.right);if(215===s.kind&&e.isStringLiteralLike(c))return I(n,s,o,c,a);if(215===c.kind&&e.isStringLiteralLike(s))return I(n,c,o,s,a);if(Eg(t,s))return w(n,o,c,a);if(Eg(t,c))return w(n,o,s,a);H&&(Fg(s,t)?n=P(n,o,c,a):Fg(c,t)&&(n=P(n,o,s,a)));var l=C(s,n);if(l)return N(n,l,o,c,a);var u=C(c,n);if(u)return N(n,u,o,s,a);if(B(s))return j(n,o,c,a);if(B(c))return j(n,o,s,a);break;case 102:return function(r,n,i){var a=Yg(n.left);if(!Eg(t,a))return i&&H&&Fg(a,t)?Jg(r,2097152):r;var o,s=rx(n.right);if(!Zd(s,wt))return r;var c=Jc(s,"prototype");if(c){var l=Uo(c);to(l)||(o=l);}if(to(r)&&(o===Pt||o===wt))return r;if(!o){var u=Uc(s,1);o=u.length?qu(e.map(u,(function(e){return ml(Sl(e))}))):mt;}return !i&&1048576&s.flags&&!e.find(s.types,(function(e){return !Zo(e)}))?r:J(r,o,i,Zd)}(n,i,a);case 101:if(e.isPrivateIdentifier(i.left))return function(r,n,i){var a=Yg(n.right);if(!Eg(t,a))return r;e.Debug.assertNode(n.left,e.isPrivateIdentifier);var o=mv(n.left);if(void 0===o)return r;var s=o.parent;return J(r,e.hasStaticModifier(e.Debug.checkDefined(o.valueDeclaration,"should always have a declaration"))?Uo(s):ms(s),i,Zd)}(n,i,a);var _=Yg(i.right),d=LS(i.left);if(128&d.flags){var p=e.escapeLeadingUnderscores(d.value);if(Ff(n)&&e.isAccessExpression(t)&&Eg(t.expression,_)&&kg(t)===p)return Jg(n,a?524288:65536);if(Eg(t,_))return function(t,n,i){return 1048576&t.flags||524288&t.flags&&r!==t||T_(t)||2097152&t.flags&&e.every(t.types,(function(e){return e.symbol!==ce}))?om(t,(function(e){return function(e,t,r){var n=Jc(e,t);return n?!!(16777216&n.flags)||r:!!Zc(e,t)||!r}(e,n,i)})):t}(n,p,a)}break;case 27:return U(n,i.right,a);case 55:return a?U(U(n,i.left,!0),i.right,!0):qu([U(n,i.left,!1),U(n,i.right,!1)]);case 56:return a?qu([U(n,i.left,!0),U(n,i.right,!0)]):U(U(n,i.left,!1),i.right,!1)}return n}function P(e,t,r,n){var i=34===t||36===t,a=34===t||35===t?98304:32768,o=rx(r);return i!==n&&am(o,(function(e){return !!(e.flags&a)}))||i===n&&am(o,(function(e){return !(e.flags&(3|a))}))?Jg(e,2097152):e}function w(e,t,r,n){if(1&e.flags)return e;35!==t&&37!==t||(n=!n);var i=rx(r);if(n&&2&e.flags&&(34===t||35===t)&&65536&i.flags)return qu([qe,ze]);if(2&e.flags&&n&&(36===t||37===t))return 67239932&i.flags?i:524288&i.flags?ct:e;if(98304&i.flags){if(!H)return e;var a=34===t||35===t?n?262144:2097152:65536&i.flags?n?131072:1048576:n?65536:524288;return 2&e.flags&&3145728&a?Je:Jg(e,a)}return n?pm(om(e,34===t?function(e){return ep(e,i)||(t=i,0!=(524&e.flags)&&0!=(28&t.flags));var t;}:function(e){return ep(e,i)}),i):rf(i)?om(e,(function(e){return !(nf(e)&&ep(e,i))})):e}function I(e,r,n,i,a){35!==n&&37!==n||(a=!a);var o=Yg(r.expression);if(!Eg(t,o))return H&&Fg(o,t)&&a===("undefined"!==i.text)?Jg(e,2097152):e;if(1&e.flags&&"function"===i.text)return e;if(a&&2&e.flags&&"object"===i.text)return e===Je?ct:qu([ct,qe]);var s=a?S.get(i.text)||128:T.get(i.text)||32768,c=L(e,i.text);return Jg(a&&c?lm(e,R(c)):e,s)}function O(t,r,n,i,a){return n!==i&&e.every(em(r).slice(n,i),a)?Jg(t,2097152):t}function M(t,r,n,i){var a=em(r);if(!a.length)return t;var o=a.slice(n,i),s=n===i||e.contains(o,nt);if(2&t.flags&&!s){for(var c=void 0,l=0;l<o.length;l+=1){var u=o[l];if(67239932&u.flags)void 0!==c&&c.push(u);else {if(!(524288&u.flags))return t;void 0===c&&(c=o.slice(0,l)),c.push(ct);}}return qu(void 0===c?o:c)}var _=qu(o),d=131072&_.flags?nt:pm(om(t,(function(e){return ep(_,e)})),_);if(!s)return d;var p=om(t,(function(t){return !(nf(t)&&e.contains(a,rd(function(t){return 2097152&t.flags&&e.find(t.types,rf)||t}(t))))}));return 131072&d.flags?p:qu([d,p])}function L(e,t){switch(t){case"function":return 1&e.flags?e:wt;case"object":return 2&e.flags?qu([ct,qe]):e;default:return vn.get(t)}}function R(e){return function(t){if(Xd(t,e))return t;if(Xd(e,t))return e;if(465829888&t.flags){var r=Tc(t)||we;if(Xd(e,r))return $u([t,e])}return t}}function B(r){return (e.isPropertyAccessExpression(r)&&"constructor"===e.idText(r.name)||e.isElementAccessExpression(r)&&e.isStringLiteralLike(r.argumentExpression)&&"constructor"===r.argumentExpression.text)&&Eg(t,r.expression)}function j(t,r,n,i){if(i?34!==r&&36!==r:35!==r&&37!==r)return t;var a=rx(n);if(!uT(a)&&!Zo(a))return t;var o=Jc(a,"prototype");if(!o)return t;var s=Uo(o),c=to(s)?void 0:s;return c&&c!==Pt&&c!==wt?to(t)?c:om(t,(function(t){return n=c,524288&(r=t).flags&&1&e.getObjectFlags(r)||524288&n.flags&&1&e.getObjectFlags(n)?r.symbol===n.symbol:Xd(r,n);var r,n;})):t}function J(e,t,r,n){if(!r)return om(e,(function(e){return !n(e,t)}));if(1048576&e.flags){var i=om(e,(function(e){return n(e,t)}));if(!(131072&i.flags))return i}return Xd(t,e)?t:Yd(e,t)?e:Yd(t,e)?t:$u([e,t])}function z(r,n,i,a){if(n.type&&(!to(r)||n.type!==Pt&&n.type!==wt)){var o=function(t,r){if(1===t.kind||3===t.kind)return r.arguments[t.parameterIndex];var n=e.skipParentheses(r.expression);return e.isAccessExpression(n)?e.skipParentheses(n.expression):void 0}(n,i);if(o){if(Eg(t,o))return J(r,n.type,a,Xd);H&&a&&Fg(o,t)&&!(65536&jg(n.type))&&(r=Jg(r,2097152));var s=C(o,r);if(s)return k(r,s,(function(e){return J(e,n.type,a,Xd)}))}}return r}function U(r,n,i){if(e.isExpressionOfOptionalChainRoot(n)||e.isBinaryExpression(n.parent)&&60===n.parent.operatorToken.kind&&n.parent.left===n)return function(e,r,n){if(Eg(t,r))return Jg(e,n?2097152:262144);var i=C(r,e);return i?k(e,i,(function(e){return Jg(e,n?2097152:262144)})):e}(r,n,i);switch(n.kind){case 79:if(!Eg(t,n)&&E<5){var a=Sg(n);if(Mm(a)){var o=a.valueDeclaration;if(o&&e.isVariableDeclaration(o)&&!o.type&&o.initializer&&Am(t)){E++;var s=U(r,o.initializer,i);return E--,s}}}case 108:case 106:case 205:case 206:return F(r,n,i);case 207:return function(r,n,i){if(Lg(n,t)){var a=i||!e.isCallChain(n)?Tm(n):void 0,o=a&&fl(a);if(o&&(0===o.kind||1===o.kind))return z(r,o,n,i)}if(Ff(r)&&e.isAccessExpression(t)&&e.isPropertyAccessExpression(n.expression)){var s=n.expression;if(Eg(t.expression,Yg(s.expression))&&e.isIdentifier(s.name)&&"hasOwnProperty"===s.name.escapedText&&1===n.arguments.length){var c=n.arguments[0];if(e.isStringLiteralLike(c)&&kg(t)===e.escapeLeadingUnderscores(c.text))return Jg(r,i?524288:65536)}}return r}(r,n,i);case 211:case 229:return U(r,n.expression,i);case 220:return A(r,n,i);case 218:if(53===n.operator)return U(r,n.operand,!i)}return r}}function wm(t){return e.findAncestor(t.parent,(function(t){return e.isFunctionLike(t)&&!e.getImmediatelyInvokedFunctionExpression(t)||261===t.kind||303===t.kind||166===t.kind}))}function Im(t){if(!t.valueDeclaration)return !1;var r,n=e.getRootDeclaration(t.valueDeclaration).parent,i=Qn(n);return 8388608&i.flags||(i.flags|=8388608,r=n,e.findAncestor(r.parent,(function(t){return (e.isFunctionLike(t)||e.isCatchClause(t))&&!!(8388608&Qn(t).flags)}))||Om(n)),t.isAssigned||!1}function Om(t){if(79===t.kind){if(e.isAssignmentTarget(t)){var r=Sg(t);e.isParameterOrCatchClauseVariable(r)&&(r.isAssigned=!0);}}else e.forEachChild(t,Om);}function Mm(e){return 3&e.flags&&0!=(2&$y(e))}function Lm(e){return !!(465829888&e.flags&&1146880&Cc(e).flags)}function Rm(e){return !(!(465829888&e.flags)||Eb(Cc(e),98304))}function Bm(t,r,n){var i,a;return n&&2&n||!im(t,Lm)||!function(e,t){var r=t.parent;return 205===r.kind||207===r.kind&&r.expression===t||206===r.kind&&r.expression===t&&!(im(e,Rm)&&D_(rx(r.argumentExpression)))}(t,r)&&(i=r,!(a=(e.isIdentifier(i)||e.isPropertyAccessExpression(i)||e.isElementAccessExpression(i))&&!((e.isJsxOpeningElement(i.parent)||e.isJsxSelfClosingElement(i.parent))&&i.parent.tagName===i)&&my(i,8))||b_(a))?t:lm(t,(function(e){return 465829888&e.flags?Cc(e):e}))}function jm(t){return !!e.findAncestor(t,(function(t){var r=t.parent;return void 0===r?"quit":e.isExportAssignment(r)?r.expression===t&&e.isEntityNameExpression(t):!!e.isExportSpecifier(r)&&(r.name===t||r.propertyName===t)}))}function Jm(t,r){if(Ci(t,111551)&&!Tg(r)&&!Ai(t)){var n=ki(t);111551&n.flags&&(U.isolatedModules||e.shouldPreserveConstEnums(U)&&jm(r)||!$S(n)?wi(t):function(e){var t=Gn(e);t.constEnumReferenced||(t.constEnumReferenced=!0);}(t));}}function zm(t){return e.findAncestor(t,(function(t){return !t||e.nodeStartsNewLexicalEnvironment(t)?"quit":e.isIterationStatement(t,!1)}))}function Um(e,t){Qn(e).flags|=2,166===t.kind||170===t.kind?Qn(t.parent).flags|=4:Qn(t).flags|=4;}function Km(t){return e.isSuperCall(t)?t:e.isFunctionLike(t)?void 0:e.forEachChild(t,Km)}function Vm(e){return rs(ms($i(e)))===We}function qm(t,r,n){var i=r.parent;e.getClassExtendsHeritageElement(i)&&!Vm(i)&&t.flowNode&&!Fm(t.flowNode,!1)&&In(t,n);}function Wm(t){var r=Tg(t),n=e.getThisContainer(t,!0),i=!1;switch(170===n.kind&&qm(t,n,e.Diagnostics.super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class),213===n.kind&&(n=e.getThisContainer(n,!1),i=!0),function(t,r){e.isPropertyDeclaration(r)&&e.hasStaticModifier(r)&&r.initializer&&e.textRangeContainsPositionInclusive(r.initializer,t.pos)&&e.length(r.parent.decorators)&&In(t,e.Diagnostics.Cannot_use_this_in_a_static_property_initializer_of_a_decorated_class);}(t,n),n.kind){case 260:In(t,e.Diagnostics.this_cannot_be_referenced_in_a_module_or_namespace_body);break;case 259:In(t,e.Diagnostics.this_cannot_be_referenced_in_current_location);break;case 170:Gm(t,n)&&In(t,e.Diagnostics.this_cannot_be_referenced_in_constructor_arguments);break;case 161:In(t,e.Diagnostics.this_cannot_be_referenced_in_a_computed_property_name);}!r&&i&&K<2&&Um(t,n);var a=Hm(t,!0,n);if(Z){var o=Uo(ce);if(a===o&&i)In(t,e.Diagnostics.The_containing_arrow_function_captures_the_global_value_of_this);else if(!a){var s=In(t,e.Diagnostics.this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation);if(!e.isSourceFile(n)){var c=Hm(n);c&&c!==o&&e.addRelatedInfo(s,e.createDiagnosticForNode(n,e.Diagnostics.An_outer_value_of_this_is_shadowed_by_this_container));}}}return a||we}function Hm(t,r,n){void 0===r&&(r=!0),void 0===n&&(n=e.getThisContainer(t,!1));var i=e.isInJSFile(t);if(e.isFunctionLike(n)&&(!ty(t)||e.getThisParameter(n))){var a=pl(cl(n))||i&&function(t){var r=e.getJSDocType(t);if(r&&315===r.kind){var n=r;if(n.parameters.length>0&&n.parameters[0].name&&"this"===n.parameters[0].name.escapedText)return dd(n.parameters[0].type)}var i=e.getJSDocThisTag(t);if(i&&i.typeExpression)return dd(i.typeExpression)}(n);if(!a){var o=function(t){return 212===t.kind&&e.isBinaryExpression(t.parent)&&3===e.getAssignmentDeclarationKind(t.parent)?t.parent.left.expression.expression:168===t.kind&&204===t.parent.kind&&e.isBinaryExpression(t.parent.parent)&&6===e.getAssignmentDeclarationKind(t.parent.parent)?t.parent.parent.left.expression:212===t.kind&&294===t.parent.kind&&204===t.parent.parent.kind&&e.isBinaryExpression(t.parent.parent.parent)&&6===e.getAssignmentDeclarationKind(t.parent.parent.parent)?t.parent.parent.parent.left.expression:212===t.kind&&e.isPropertyAssignment(t.parent)&&e.isIdentifier(t.parent.name)&&("value"===t.parent.name.escapedText||"get"===t.parent.name.escapedText||"set"===t.parent.name.escapedText)&&e.isObjectLiteralExpression(t.parent.parent)&&e.isCallExpression(t.parent.parent.parent)&&t.parent.parent.parent.arguments[2]===t.parent.parent&&9===e.getAssignmentDeclarationKind(t.parent.parent.parent)?t.parent.parent.parent.arguments[0].expression:e.isMethodDeclaration(t)&&e.isIdentifier(t.name)&&("value"===t.name.escapedText||"get"===t.name.escapedText||"set"===t.name.escapedText)&&e.isObjectLiteralExpression(t.parent)&&e.isCallExpression(t.parent.parent)&&t.parent.parent.arguments[2]===t.parent&&9===e.getAssignmentDeclarationKind(t.parent.parent)?t.parent.parent.arguments[0].expression:void 0}(n);if(i&&o){var s=ax(o).symbol;s&&s.members&&16&s.flags&&(a=ms(s).thisType);}else Fh(n)&&(a=ms(Zi(n.symbol)).thisType);a||(a=Zm(n));}if(a)return Pm(t,a)}if(e.isClassLike(n.parent)){var c=$i(n.parent);return Pm(t,e.isStatic(n)?Uo(c):ms(c).thisType)}if(e.isSourceFile(n)){if(n.commonJsModuleIndicator){var l=$i(n);return l&&Uo(l)}if(n.externalModuleIndicator)return ze;if(r)return Uo(ce)}}function Gm(t,r){return !!e.findAncestor(t,(function(t){return e.isFunctionLikeDeclaration(t)?"quit":163===t.kind&&t.parent===r}))}function Qm(t){var r=207===t.parent.kind&&t.parent.expression===t,n=e.getSuperContainer(t,!0),i=n,a=!1;if(!r)for(;i&&213===i.kind;)i=e.getSuperContainer(i,!0),a=K<2;var o=0;if(!function(t){return !!t&&(r?170===t.kind:!(!e.isClassLike(t.parent)&&204!==t.parent.kind)&&(e.isStatic(t)?168===t.kind||167===t.kind||171===t.kind||172===t.kind||166===t.kind||169===t.kind:168===t.kind||167===t.kind||171===t.kind||172===t.kind||166===t.kind||165===t.kind||170===t.kind))}(i)){var s=e.findAncestor(t,(function(e){return e===i?"quit":161===e.kind}));return s&&161===s.kind?In(t,e.Diagnostics.super_cannot_be_referenced_in_a_computed_property_name):r?In(t,e.Diagnostics.Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors):i&&i.parent&&(e.isClassLike(i.parent)||204===i.parent.kind)?In(t,e.Diagnostics.super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_derived_class):In(t,e.Diagnostics.super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions),Me}if(r||170!==n.kind||qm(t,i,e.Diagnostics.super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class),e.isStatic(i)||r?(o=512,!r&&K>=2&&K<=8&&(e.isPropertyDeclaration(i)||e.isClassStaticBlockDeclaration(i))&&e.forEachEnclosingBlockScopeContainer(t.parent,(function(t){e.isSourceFile(t)&&!e.isExternalOrCommonJsModule(t)||(Qn(t).flags|=134217728);}))):o=256,Qn(t).flags|=o,168===i.kind&&e.hasSyntacticModifier(i,256)&&(e.isSuperProperty(t.parent)&&e.isAssignmentTarget(t.parent)?Qn(i).flags|=4096:Qn(i).flags|=2048),a&&Um(t.parent,i),204===i.parent.kind)return K<2?(In(t,e.Diagnostics.super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher),Me):we;var c=i.parent;if(!e.getClassExtendsHeritageElement(c))return In(t,e.Diagnostics.super_can_only_be_referenced_in_a_derived_class),Me;var l=ms($i(c)),u=l&&is(l)[0];return u?170===i.kind&&Gm(t,i)?(In(t,e.Diagnostics.super_cannot_be_referenced_in_constructor_arguments),Me):512===o?rs(l):Ls(u,l.thisType):Me}function Xm(t){return 4&e.getObjectFlags(t)&&t.target===zt?zl(t)[0]:void 0}function Ym(t){return lm(t,(function(t){return 2097152&t.flags?e.forEach(t.types,Xm):Xm(t)}))}function Zm(t){if(213!==t.kind){if(Vd(t)){var r=Dy(t);if(r){var n=r.thisParameter;if(n)return Uo(n)}}var i=e.isInJSFile(t);if(Z||i){var a=function(e){return 168!==e.kind&&171!==e.kind&&172!==e.kind||204!==e.parent.kind?212===e.kind&&294===e.parent.kind?e.parent.parent:void 0:e.parent}(t);if(a){for(var o=py(a),s=a,c=o;c;){var l=Ym(c);if(l)return Rd(l,Zf(yy(a)));if(294!==s.parent.kind)break;c=py(s=s.parent.parent);}return jf(o?Sf(o):zb(a))}var u=e.walkUpParenthesizedExpressions(t.parent);if(220===u.kind&&63===u.operatorToken.kind){var _=u.left;if(e.isAccessExpression(_)){var d=_.expression;if(i&&e.isIdentifier(d)){var p=e.getSourceFileOfNode(u);if(p.commonJsModuleIndicator&&Sg(d)===p.symbol)return}return jf(zb(d))}}}}}function $m(t){var r=t.parent;if(Vd(r)){var n=e.getImmediatelyInvokedFunctionExpression(r);if(n&&n.arguments){var i=ch(n),a=r.parameters.indexOf(t);if(t.dotDotDotToken)return rh(i,a,i.length,we,void 0,0);var o=Qn(n),s=o.resolvedSignature;o.resolvedSignature=Er;var c=a<i.length?sf(ax(i[a])):t.initializer?void 0:Ue;return o.resolvedSignature=s,c}var l=Dy(r);if(l){var u=r.parameters.indexOf(t)-(e.getThisParameter(r)?1:0);return t.dotDotDotToken&&e.lastOrUndefined(r.parameters)===t?Yh(l,u):Xh(l,u)}}}function ey(t){var r=e.getEffectiveTypeAnnotationNode(t);if(r)return dd(r);switch(t.kind){case 163:return $m(t);case 202:return function(t){var r=t.parent.parent,n=t.propertyName||t.name,i=ey(r)||202!==r.kind&&r.initializer&&Kb(r);if(i&&!e.isBindingPattern(n)&&!e.isComputedNonLiteralName(n)){if(201===r.name.kind){var a=e.indexOfNode(t.parent.elements,t);if(a<0)return;return uy(i,a)}var o=i_(n);return Es(o)?eo(i,Ps(o)):void 0}}(t);case 166:if(e.isStatic(t))return function(t){var r=e.isExpression(t.parent)&&my(t.parent);return r?cy(r,$i(t).escapedName):void 0}(t)}}function ty(t){for(var r=!1;t.parent&&!e.isFunctionLike(t.parent);){if(e.isParameter(t.parent)&&(r||t.parent.initializer===t))return !0;e.isBindingElement(t.parent)&&t.parent.initializer===t&&(r=!0),t=t.parent;}return !1}function ry(t,r){var n=!!(2&e.getFunctionFlags(r)),i=ny(r);if(i)return zD(t,i,n)||void 0}function ny(t){var r=yl(t);if(r)return r;var n=xy(t);if(n&&!vl(n))return ml(n);var i=e.getImmediatelyInvokedFunctionExpression(t);return i?my(i):void 0}function iy(e,t){var r=ch(e).indexOf(t);return -1===r?void 0:ay(e,r)}function ay(t,r){if(e.isImportCall(t))return 0===r?He:1===r?pu(!1):we;var n=Qn(t).resolvedSignature===Nr?Nr:Nh(t);if(e.isJsxOpeningLikeElement(t)&&0===r)return vy(n,t);var i=n.parameters.length-1;return J(n)&&r>=i?F_(Uo(n.parameters[i]),ad(r-i),256):Qh(n,r)}function oy(t,r){if(void 0===r&&(r=e.getAssignmentDeclarationKind(t)),4===r)return !0;if(!e.isInJSFile(t)||5!==r||!e.isIdentifier(t.left.expression))return !1;var n=t.left.expression.escapedText,i=ei(t.left,n,111551,void 0,void 0,!0,!0);return e.isThisInitializedDeclaration(null==i?void 0:i.valueDeclaration)}function sy(t){if(!t.symbol)return rx(t.left);if(t.symbol.valueDeclaration){var r=e.getEffectiveTypeAnnotationNode(t.symbol.valueDeclaration);if(r){var n=dd(r);if(n)return n}}var i=e.cast(t.left,e.isAccessExpression);if(e.isObjectLiteralMethod(e.getThisContainer(i.expression,!1))){var a=Wm(i.expression),o=e.getElementOrPropertyAccessName(i);return void 0!==o&&cy(a,o)||void 0}}function cy(t,r){return lm(t,(function(t){var n,i;if(dc(t)){var a=nc(t),o=Tc(a)||a,s=id(e.unescapeLeadingUnderscores(r));if(Yd(s,o))return N_(t,s)}else if(3670016&t.flags){var c=Jc(t,r);if(c)return i=c,262144&e.getCheckFlags(i)&&!i.type&&Xa(i,0)>=0?void 0:Uo(c);if(_f(t)){var l=ff(t);if(l&&ky(r)&&+r>=0)return l}return null===(n=Vc(Wc(t),id(e.unescapeLeadingUnderscores(r))))||void 0===n?void 0:n.type}}),!0)}function ly(t,r){var n=t.parent,i=e.isPropertyAssignment(t)&&ey(t);if(i)return i;var a=py(n,r);if(a){if(As(t))return cy(a,$i(t).escapedName);if(t.name){var o=i_(t.name);return lm(a,(function(e){var t;return null===(t=Vc(Wc(e),o))||void 0===t?void 0:t.type}),!0)}}}function uy(e,t){return e&&(cy(e,""+t)||lm(e,(function(e){return bD(1,e,ze,void 0,!1)}),!0))}function _y(t){if(e.isJsxAttribute(t)){var r=py(t.parent);if(!r||to(r))return;return cy(r,t.name.escapedText)}return my(t.parent)}function dy(e){switch(e.kind){case 10:case 8:case 9:case 14:case 110:case 95:case 104:case 79:case 152:return !0;case 205:case 211:return dy(e.expression);case 287:return !e.expression||dy(e.expression)}return !1}function py(t,r){var n=fy(e.isObjectLiteralMethod(t)?function(t,r){if(e.Debug.assert(e.isObjectLiteralMethod(t)),!(16777216&t.flags))return ly(t,r)}(t,r):my(t,r),t,r);if(n&&!(r&&2&r&&8650752&n.flags)){var i=lm(n,Ac,!0);return 1048576&i.flags&&e.isObjectLiteralExpression(t)?function(t,r){return function(t,r){var n=wg(t),i=n&&e.find(r.properties,(function(e){return e.symbol&&294===e.kind&&e.symbol.escapedName===n&&dy(e.initializer)})),a=i&&ix(i.initializer);return a&&Ig(t,a)}(r,t)||kp(r,e.concatenate(e.map(e.filter(t.properties,(function(e){return !!e.symbol&&294===e.kind&&dy(e.initializer)&&Ag(r,e.symbol.escapedName)})),(function(e){return [function(){return ix(e.initializer)},e.symbol.escapedName]})),e.map(e.filter(yc(r),(function(e){var n;return !!(16777216&e.flags)&&!!(null===(n=null==t?void 0:t.symbol)||void 0===n?void 0:n.members)&&!t.symbol.members.has(e.escapedName)&&Ag(r,e.escapedName)})),(function(e){return [function(){return ze},e.escapedName]}))),Yd,r)}(t,i):1048576&i.flags&&e.isJsxAttributes(t)?function(t,r){return kp(r,e.concatenate(e.map(e.filter(t.properties,(function(e){return !!e.symbol&&284===e.kind&&Ag(r,e.symbol.escapedName)&&(!e.initializer||dy(e.initializer))})),(function(e){return [e.initializer?function(){return ix(e.initializer)}:function(){return Ze},e.symbol.escapedName]})),e.map(e.filter(yc(r),(function(e){var n;return !!(16777216&e.flags)&&!!(null===(n=null==t?void 0:t.symbol)||void 0===n?void 0:n.members)&&!t.symbol.members.has(e.escapedName)&&Ag(r,e.escapedName)})),(function(e){return [function(){return ze},e.escapedName]}))),Yd,r)}(t,i):i}}function fy(t,r,n){if(t&&Eb(t,465829888)){var i=yy(r);if(i&&e.some(i.inferences,Zb)){if(n&&1&n)return gy(t,i.nonFixingMapper);if(i.returnMapper)return gy(t,i.returnMapper)}}return t}function gy(t,r){return 465829888&t.flags?Rd(t,r):1048576&t.flags?qu(e.map(t.types,(function(e){return gy(e,r)})),0):2097152&t.flags?$u(e.map(t.types,(function(e){return gy(e,r)}))):t}function my(t,r){if(16777216&t.flags);else {if(t.contextualType)return t.contextualType;var n=t.parent;switch(n.kind){case 253:case 163:case 166:case 165:case 202:return function(t,r){var n=t.parent;if(e.hasInitializer(n)&&t===n.initializer){var i=ey(n);if(i)return i;if(!(8&r)&&e.isBindingPattern(n.name))return No(n.name,!0,!1)}}(t,r);case 213:case 246:return function(t){var r=e.getContainingFunction(t);if(r){var n=ny(r);if(n){var i=e.getFunctionFlags(r);if(1&i){var a=ED(n,2&i?2:1,void 0);if(!a)return;n=a.returnType;}if(2&i){var o=lm(n,Px);return o&&qu([o,lb(o)])}return n}}}(t);case 223:return function(t){var r=e.getContainingFunction(t);if(r){var n=e.getFunctionFlags(r),i=ny(r);if(i)return t.asteriskToken?i:zD(0,i,0!=(2&n))}}(n);case 217:return function(e,t){var r=my(e,t);if(r){var n=Px(r);return n&&qu([n,lb(n)])}}(n,r);case 207:case 208:return iy(n,t);case 210:case 228:return e.isConstTypeReference(n.type)?o(n):dd(n.type);case 220:return function(t,r){var n=t.parent,i=n.left,a=n.operatorToken,o=n.right;switch(a.kind){case 63:case 76:case 75:case 77:return t===o?function(t){var r,n,i=e.getAssignmentDeclarationKind(t);switch(i){case 0:case 4:var a=function(t){if(t.symbol)return t.symbol;if(e.isIdentifier(t))return Sg(t);if(e.isPropertyAccessExpression(t)){var r=rx(t.expression);return e.isPrivateIdentifier(t.name)?function(e,t){var r=gv(t.escapedText,t);return r&&yv(e,r)}(r,t.name):Jc(r,t.name.escapedText)}}(t.left),o=a&&a.valueDeclaration;return o&&(e.isPropertyDeclaration(o)||e.isPropertySignature(o))?(c=e.getEffectiveTypeAnnotationNode(o))&&Rd(dd(c),Gn(a).mapper)||o.initializer&&rx(t.left):0===i?rx(t.left):sy(t);case 5:if(oy(t,i))return sy(t);if(t.left.symbol){var s=t.left.symbol.valueDeclaration;if(!s)return;var c,l=e.cast(t.left,e.isAccessExpression);if(c=e.getEffectiveTypeAnnotationNode(s))return dd(c);if(e.isIdentifier(l.expression)){var u=l.expression,_=ei(u,u.escapedText,111551,void 0,u.escapedText,!0);if(_){var d=_.valueDeclaration&&e.getEffectiveTypeAnnotationNode(_.valueDeclaration);if(d){var p=e.getElementOrPropertyAccessName(l);if(void 0!==p)return cy(dd(d),p)}return}}return e.isInJSFile(s)?void 0:rx(t.left)}return rx(t.left);case 1:case 6:case 3:var f=null===(r=t.left.symbol)||void 0===r?void 0:r.valueDeclaration;case 2:f||(f=null===(n=t.symbol)||void 0===n?void 0:n.valueDeclaration);var g=f&&e.getEffectiveTypeAnnotationNode(f);return g?dd(g):void 0;case 7:case 8:case 9:return e.Debug.fail("Does not apply");default:return e.Debug.assertNever(i)}}(n):void 0;case 56:case 60:var s=my(n,r);return t===o&&(s&&s.pattern||!s&&!e.isDefaultedExpandoInitializer(n))?rx(i):s;case 55:case 27:return t===o?my(n,r):void 0;default:return}}(t,r);case 294:case 295:return ly(n,r);case 296:return my(n.parent,r);case 203:var i=n;return uy(py(i,r),e.indexOfNode(i.elements,t));case 221:return function(e,t){var r=e.parent;return e===r.whenTrue||e===r.whenFalse?my(r,t):void 0}(t,r);case 232:return e.Debug.assert(222===n.parent.kind),function(e,t){if(209===e.parent.kind)return iy(e.parent,t)}(n.parent,t);case 211:var a=e.isInJSFile(n)?e.getJSDocTypeTag(n):void 0;return a?e.isJSDocTypeTag(a)&&e.isConstTypeReference(a.typeExpression.type)?o(n):dd(a.typeExpression.type):my(n,r);case 229:return my(n,r);case 287:return function(t){var r=t.parent;return e.isJsxAttributeLike(r)?my(t):e.isJsxElement(r)?function(t,r){var n=py(t.openingElement.tagName),i=Ky(zy(t));if(n&&!to(n)&&i&&""!==i){var a=e.getSemanticJsxChildren(t.children),o=a.indexOf(r),s=cy(n,i);return s&&(1===a.length?s:lm(s,(function(e){return Qp(e)?F_(e,ad(o)):e}),!0))}}(r,t):void 0}(n);case 284:case 286:return _y(n);case 279:case 278:return function(t,r){return e.isJsxOpeningElement(t)&&t.parent.contextualType&&4!==r?t.parent.contextualType:ay(t,0)}(n,r)}}function o(e){return my(e)}}function yy(t){var r=e.findAncestor(t,(function(e){return !!e.inferenceContext}));return r&&r.inferenceContext}function vy(t,r){return 0!==ih(r)?function(e,t){var r=ib(e,je);r=hy(t,zy(t),r);var n=By(A.IntrinsicAttributes,t);return ro(n)||(r=Gs(n,r)),r}(t,r):function(t,r){var n,i=zy(r),a=(n=i,Uy(A.ElementAttributesPropertyNameContainer,n)),o=void 0===a?ib(t,je):""===a?ml(t):function(e,t){if(e.compositeSignatures){for(var r=[],n=0,i=e.compositeSignatures;n<i.length;n++){var a=ml(i[n]);if(to(a))return a;var o=eo(a,t);if(!o)return;r.push(o);}return $u(r)}var s=ml(e);return to(s)?s:eo(s,t)}(t,a);if(!o)return a&&e.length(r.attributes.properties)&&In(r,e.Diagnostics.JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property,e.unescapeLeadingUnderscores(a)),je;if(to(o=hy(r,i,o)))return o;var s=o,c=By(A.IntrinsicClassAttributes,r);if(!ro(c)){var l=Xo(c.symbol),u=ml(t);s=Gs(l?Bl(c,sl([u],l,ol(l),e.isInJSFile(r))):c,s);}var _=By(A.IntrinsicAttributes,r);return ro(_)||(s=Gs(_,s)),s}(t,r)}function hy(t,r,n){var i,a=(i=r)&&Yn(i.exports,A.LibraryManagedAttributes,788968);if(a){var o=ms(a),s=function(e){if(Oy(e.tagName))return Cl(Ch(e,t=Wy(e)));var t,r=zb(e.tagName);return 128&r.flags?(t=qy(r,e))?Cl(Ch(e,t)):Me:r}(t);if(524288&a.flags){var c=Gn(a).typeParameters;if(e.length(c)>=2)return Vl(a,sl([s,n],c,2,e.isInJSFile(t)))}if(e.length(o.typeParameters)>=2)return Bl(o,sl([s,n],o.typeParameters,2,e.isInJSFile(t)))}return n}function by(t,r){var n=Uc(t,0),i=e.filter(n,(function(t){return !function(t,r){for(var n=0;n<r.parameters.length;n++){var i=r.parameters[n];if(i.initializer||i.questionToken||i.dotDotDotToken||tl(i))break}return r.parameters.length&&e.parameterIsThisKeyword(r.parameters[0])&&n--,!eb(t)&&Zh(t)<n}(t,r)}));return 1===i.length?i[0]:function(t){return e.getStrictOptionValue(U,"noImplicitAny")?e.reduceLeft(t,(function(t,r){return t!==r&&t?Ws(t.typeParameters,r.typeParameters)?function(t,r){var n,i=t.typeParameters||r.typeParameters;t.typeParameters&&r.typeParameters&&(n=vd(r.typeParameters,t.typeParameters));var a=t.declaration,o=function(e,t,r){for(var n=Zh(e),i=Zh(t),a=n>=i?e:t,o=a===e?t:e,s=a===e?n:i,c=eb(e)||eb(t),l=c&&!eb(a),u=new Array(s+(l?1:0)),_=0;_<s;_++){var d=Xh(a,_);a===t&&(d=Rd(d,r));var p=Xh(o,_)||je;o===t&&(p=Rd(p,r));var f=qu([d,p]),g=c&&!l&&_===s-1,m=_>=$h(a)&&_>=$h(o),y=_>=n?void 0:qh(e,_),v=_>=i?void 0:qh(t,_),h=jn(1|(m&&!g?16777216:0),(y===v?y:y?v?void 0:y:v)||"arg".concat(_));h.type=g?Tu(f):f,u[_]=h;}if(l){var b=jn(1,"args");b.type=Tu(Qh(o,s)),o===t&&(b.type=Rd(b.type,r)),u[s]=b;}return u}(t,r,n),s=Bs(a,i,function(e,t,r){return e&&t?wf(e,qu([Uo(e),Rd(Uo(t),r)])):e||t}(t.thisParameter,r.thisParameter,n),o,void 0,void 0,Math.max(t.minArgumentCount,r.minArgumentCount),39&(t.flags|r.flags));return s.compositeKind=2097152,s.compositeSignatures=e.concatenate(2097152===t.compositeKind&&t.compositeSignatures||[t],[r]),n&&(s.mapper=2097152===t.compositeKind&&t.mapper&&t.compositeSignatures?Td(t.mapper,n):n),s}(t,r):void 0:t})):void 0}(i)}function xy(t){return e.isFunctionExpressionOrArrowFunction(t)||e.isObjectLiteralMethod(t)?Dy(t):void 0}function Dy(t){e.Debug.assert(168!==t.kind||e.isObjectLiteralMethod(t));var r=ll(t);if(r)return r;var n=py(t,1);if(n){if(!(1048576&n.flags))return by(n,t);for(var i,a=0,o=n.types;a<o.length;a++){var s=by(o[a],t);if(s)if(i){if(!Kp(i[0],s,!1,!0,!0,Hd))return;i.push(s);}else i=[s];}return i?1===i.length?i[0]:Js(i[0],i):void 0}}function Sy(e){return 202===e.kind&&!!e.initializer||220===e.kind&&63===e.operatorToken.kind}function Ty(t,r,n){for(var i=t.elements,a=i.length,o=[],s=[],c=py(t),l=e.isAssignmentTarget(t),u=Wb(t),_=!1,d=0;d<a;d++){var p=i[d];if(224===p.kind){K<2&&ST(p,U.downlevelIteration?1536:1024);var f=ax(p.expression,r,n);if(Qp(f))o.push(f),s.push(8);else if(l){var g=Qc(f,Ge)||bD(65,f,ze,void 0,!1)||je;o.push(g),s.push(4);}else o.push(hD(33,f,ze,p.expression)),s.push(4);}else if(re&&226===p.kind)_=!0,o.push(Ve),s.push(2);else {var m=Hb(p,r,uy(c,o.length),n);o.push(go(m,!0,_)),s.push(_?2:1);}}return l?Au(o,s):n||u||c&&im(c,$p)?Cy(Au(o,s,u)):Cy(Tu(o.length?qu(e.sameMap(o,(function(e,t){return 8&s[t]?P_(e,Ge)||we:e})),2):H?ot:Ue,u))}function Cy(t){if(!(4&e.getObjectFlags(t)))return t;var r=t.literalType;return r||((r=t.literalType=jl(t)).objectFlags|=294912),r}function Ey(e){switch(e.kind){case 161:return function(e){return kb(Ny(e),296)}(e);case 79:return ky(e.escapedText);case 8:case 10:return ky(e.text);default:return !1}}function ky(e){return (+e).toString()===e}function Ny(t){var r=Qn(t.expression);if(!r.resolvedType){if((e.isTypeLiteralNode(t.parent.parent)||e.isClassLike(t.parent.parent)||e.isInterfaceDeclaration(t.parent.parent))&&e.isBinaryExpression(t.expression)&&101===t.expression.operatorToken.kind)return r.resolvedType=Me;if(r.resolvedType=ax(t.expression),e.isPropertyDeclaration(t.parent)&&!e.hasStaticModifier(t.parent)&&e.isClassExpression(t.parent.parent)){var n=zm(e.getEnclosingBlockScopeContainer(t.parent.parent));n&&(Qn(n).flags|=65536,Qn(t).flags|=524288,Qn(t.parent.parent).flags|=524288);}(98304&r.resolvedType.flags||!kb(r.resolvedType,402665900)&&!Yd(r.resolvedType,ut))&&In(t,e.Diagnostics.A_computed_property_name_must_be_of_type_string_number_symbol_or_any);}return r.resolvedType}function Fy(t){var r,n=null===(r=t.declarations)||void 0===r?void 0:r[0];return e.isKnownSymbol(t)||n&&e.isNamedDeclaration(n)&&e.isComputedPropertyName(n.name)&&kb(Ny(n.name),4096)}function Ay(t,r,n,i){for(var a,o,s,c=[],l=r;l<n.length;l++){var u=n[l];(i===He&&!Fy(u)||i===Ge&&(s=null===(o=(a=u).declarations)||void 0===o?void 0:o[0],ky(a.escapedName)||s&&e.isNamedDeclaration(s)&&Ey(s.name))||i===tt&&Fy(u))&&c.push(Uo(n[l]));}return Nl(i,c.length?qu(c,2):ze,Wb(t))}function Py(t){e.Debug.assert(0!=(2097152&t.flags),"Should only get Alias here.");var r=Gn(t);if(!r.immediateTarget){var n=di(t);if(!n)return e.Debug.fail();r.immediateTarget=Ti(n,!0);}return r.immediateTarget}function wy(t){if(465829888&t.flags){var r=Tc(t);if(void 0!==r)return wy(r)}return !!(126615553&t.flags||117632&vf(t)&&wy(hf(t))||3145728&t.flags&&e.every(t.types,wy))}function Iy(t){return e.stringContains(t,"-")}function Oy(t){return 79===t.kind&&e.isIntrinsicJsxName(t.escapedText)}function My(e,t){return e.initializer?Hb(e.initializer,t):Ze}function Ly(e,t){for(var r=[],n=0,i=e.children;n<i.length;n++){var a=i[n];if(11===a.kind)a.containsOnlyTriviaWhiteSpaces||r.push(He);else {if(287===a.kind&&!a.expression)continue;r.push(Hb(a,t));}}return r}function Ry(t,r,n){for(var i=0,a=yc(t);i<a.length;i++){var o=a[i];if(!(16777216&o.flags)){var s=r.get(o.escapedName);if(s){var c=In(s.valueDeclaration,e.Diagnostics._0_is_specified_more_than_once_so_this_usage_will_be_overwritten,e.unescapeLeadingUnderscores(s.escapedName));e.addRelatedInfo(c,e.createDiagnosticForNode(n,e.Diagnostics.This_spread_always_overwrites_this_property));}}}}function By(e,t){var r=zy(t),n=r&&Gi(r),i=n&&Yn(n,e,788968);return i?ms(i):Me}function jy(t){var r=Qn(t);if(!r.resolvedSymbol){var n=By(A.IntrinsicElements,t);if(ro(n))return Y&&In(t,e.Diagnostics.JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists,e.unescapeLeadingUnderscores(A.IntrinsicElements)),r.resolvedSymbol=Ne;if(!e.isIdentifier(t.tagName))return e.Debug.fail();var i=Jc(n,t.tagName.escapedText);return i?(r.jsxFlags|=1,r.resolvedSymbol=i):Qc(n,He)?(r.jsxFlags|=2,r.resolvedSymbol=n.symbol):(In(t,e.Diagnostics.Property_0_does_not_exist_on_type_1,e.idText(t.tagName),"JSX."+A.IntrinsicElements),r.resolvedSymbol=Ne)}return r.resolvedSymbol}function Jy(t){var r=t&&e.getSourceFileOfNode(t),n=r&&Qn(r);if(!n||!1!==n.jsxImplicitImportContainer){if(n&&n.jsxImplicitImportContainer)return n.jsxImplicitImportContainer;var i=e.getJSXRuntimeImport(e.getJSXImplicitImportBase(U,r),U);if(i){var a=ji(t,i,e.getEmitModuleResolutionKind(U)===e.ModuleResolutionKind.Classic?e.Diagnostics.Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_node_or_to_add_aliases_to_the_paths_option:e.Diagnostics.Cannot_find_module_0_or_its_corresponding_type_declarations,t),o=a&&a!==Ne?Zi(Ei(a)):void 0;return n&&(n.jsxImplicitImportContainer=o||!1),o}}}function zy(e){var t=e&&Qn(e);if(t&&t.jsxNamespace)return t.jsxNamespace;if(!t||!1!==t.jsxNamespace){var r=Jy(e);if(!r||r===Ne){var n=Nn(e);r=ei(e,n,1920,void 0,n,!1);}if(r){var i=Ei(Yn(Gi(Ei(r)),A.JSX,1920));if(i&&i!==Ne)return t&&(t.jsxNamespace=i),i}t&&(t.jsxNamespace=!1);}var a=Ei(uu(A.JSX,1920,void 0));return a!==Ne?a:void 0}function Uy(t,r){var n=r&&Yn(r.exports,t,788968),i=n&&ms(n),a=i&&yc(i);if(a){if(0===a.length)return "";if(1===a.length)return a[0].escapedName;a.length>1&&n.declarations&&In(n.declarations[0],e.Diagnostics.The_global_type_JSX_0_may_not_have_more_than_one_property,e.unescapeLeadingUnderscores(t));}}function Ky(e){return Uy(A.ElementChildrenAttributeNameContainer,e)}function Vy(t,r){if(4&t.flags)return [Er];if(128&t.flags){var n=qy(t,r);return n?[Ch(r,n)]:(In(r,e.Diagnostics.Property_0_does_not_exist_on_type_1,t.value,"JSX."+A.IntrinsicElements),e.emptyArray)}var i=Ac(t),a=Uc(i,1);return 0===a.length&&(a=Uc(i,0)),0===a.length&&1048576&i.flags&&(a=qs(e.map(i.types,(function(e){return Vy(e,r)})))),a}function qy(t,r){var n=By(A.IntrinsicElements,r);if(!ro(n)){var i=t.value,a=Jc(n,e.escapeLeadingUnderscores(i));return a?Uo(a):Qc(n,He)||void 0}return we}function Wy(t){e.Debug.assert(Oy(t.tagName));var r=Qn(t);if(!r.resolvedJsxElementAttributesType){var n=jy(t);return 1&r.jsxFlags?r.resolvedJsxElementAttributesType=Uo(n)||Me:2&r.jsxFlags?r.resolvedJsxElementAttributesType=Qc(By(A.IntrinsicElements,t),He)||Me:r.resolvedJsxElementAttributesType=Me}return r.resolvedJsxElementAttributesType}function Hy(e){var t=By(A.ElementClass,e);if(!ro(t))return t}function Gy(e){return By(A.Element,e)}function Qy(e){var t=Gy(e);if(t)return qu([t,qe])}function Xy(t){var r,n=e.isJsxOpeningLikeElement(t);if(n&&function(t){(function(t){if(e.isPropertyAccessExpression(t)){var r=t;do{var n=a(r.name);if(n)return n;r=r.expression;}while(e.isPropertyAccessExpression(r));var i=a(r);if(i)return i}function a(t){if(e.isIdentifier(t)&&-1!==e.idText(t).indexOf(":"))return YT(t,e.Diagnostics.JSX_property_access_expressions_cannot_include_JSX_namespace_names)}})(t.tagName),AT(t,t.typeArguments);for(var r=new e.Map,n=0,i=t.attributes.properties;n<i.length;n++){var a=i[n];if(286!==a.kind){var o=a.name,s=a.initializer;if(r.get(o.escapedText))return YT(o,e.Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name);if(r.set(o.escapedText,!0),s&&287===s.kind&&!s.expression)return YT(s,e.Diagnostics.JSX_attributes_must_only_be_assigned_a_non_empty_expression)}}}(t),r=t,0===(U.jsx||0)&&In(r,e.Diagnostics.Cannot_use_JSX_unless_the_jsx_flag_is_provided),void 0===Gy(r)&&Y&&In(r,e.Diagnostics.JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist),!Jy(t)){var i=mn&&2===U.jsx?e.Diagnostics.Cannot_find_name_0:void 0,a=Nn(t),o=n?t.tagName:t,s=void 0;if(e.isJsxOpeningFragment(t)&&"null"===a||(s=ei(o,a,111551,i,a,!0)),s&&(s.isReferenced=67108863,2097152&s.flags&&!Ai(s)&&wi(s)),e.isJsxOpeningFragment(t)){var c=Fn(e.getSourceFileOfNode(t));c&&ei(o,c,111551,i,c,!0);}}if(n){var l=t,u=Nh(l);wh(u,t),function(t,r,n){if(1===t)(i=Qy(n))&&Dp(r,i,Dn,n.tagName,e.Diagnostics.Its_return_type_0_is_not_a_valid_JSX_element,o);else if(0===t)(a=Hy(n))&&Dp(r,a,Dn,n.tagName,e.Diagnostics.Its_instance_type_0_is_not_a_valid_JSX_element,o);else {var i=Qy(n),a=Hy(n);if(!i||!a)return;Dp(r,qu([i,a]),Dn,n.tagName,e.Diagnostics.Its_element_type_0_is_not_a_valid_JSX_element,o);}function o(){var t=e.getTextOfNode(n.tagName);return e.chainDiagnosticMessages(void 0,e.Diagnostics._0_cannot_be_used_as_a_JSX_component,t)}}(ih(l),ml(u),l);}}function Yy(e,t,r){if(524288&e.flags){if(gc(e,t)||Zc(e,t)||Ns(t)&&Gc(e,He)||r&&Iy(t))return !0}else if(3145728&e.flags&&Zy(e))for(var n=0,i=e.types;n<i.length;n++)if(Yy(i[n],t,r))return !0;return !1}function Zy(t){return !!(524288&t.flags&&!(512&e.getObjectFlags(t))||67108864&t.flags||1048576&t.flags&&e.some(t.types,Zy)||2097152&t.flags&&e.every(t.types,Zy))}function $y(t){return t.valueDeclaration?e.getCombinedNodeFlags(t.valueDeclaration):0}function ev(t){if(8192&t.flags||4&e.getCheckFlags(t))return !0;if(e.isInJSFile(t.valueDeclaration)){var r=t.valueDeclaration.parent;return r&&e.isBinaryExpression(r)&&3===e.getAssignmentDeclarationKind(r)}}function tv(e,t,r,n,i,a){return void 0===a&&(a=!0),rv(e,t,r,n,i,a?160===e.kind?e.right:199===e.kind?e:202===e.kind&&e.propertyName?e.propertyName:e.name:void 0)}function rv(t,r,n,i,a,o){var s,c,l=e.getDeclarationModifierFlagsFromSymbol(a,n);if(r){if(K<2&&nv(a))return o&&In(o,e.Diagnostics.Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword),!1;if(128&l)return o&&In(o,e.Diagnostics.Abstract_method_0_in_class_1_cannot_be_accessed_via_super_expression,Ia(a),Ma(Rp(a))),!1}if(128&l&&nv(a)&&(e.isThisProperty(t)||e.isThisInitializedObjectBindingExpression(t)||e.isObjectBindingPattern(t.parent)&&e.isThisInitializedDeclaration(t.parent.parent))&&(c=e.getClassLikeDeclarationOfSymbol(ea(a)))&&(s=t,e.findAncestor(s,(function(t){return !!(e.isConstructorDeclaration(t)&&e.nodeIsPresent(t.body)||e.isPropertyDeclaration(t))||!(!e.isClassLike(t)&&!e.isFunctionLikeDeclaration(t))&&"quit"}))))return o&&In(o,e.Diagnostics.Abstract_property_0_in_class_1_cannot_be_accessed_in_the_constructor,Ia(a),e.getTextOfIdentifierOrLiteral(c.name)),!1;if(!(24&l))return !0;if(8&l)return !!PS(t,c=e.getClassLikeDeclarationOfSymbol(ea(a)))||(o&&In(o,e.Diagnostics.Property_0_is_private_and_only_accessible_within_class_1,Ia(a),Ma(Rp(a))),!1);if(r)return !0;var u=AS(t,(function(t){var r=ms($i(t));return function(t,r,n){return Lp(r,(function(r){return !!(16&e.getDeclarationModifierFlagsFromSymbol(r,n))&&!Wo(t,Rp(r))}))?void 0:t}(r,a,n)?r:void 0}));if(!u){var _=void 0;if(32&l||!(_=function(t){var r=e.getThisContainer(t,!1);return r&&e.isFunctionLike(r)?e.getThisParameter(r):void 0}(t))||!_.type)return o&&In(o,e.Diagnostics.Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses,Ia(a),Ma(Rp(a)||i)),!1;var d=dd(_.type);u=(262144&d.flags?hc(d):d).target;}return !!(32&l)||(262144&i.flags&&(i=i.isThisType?hc(i):Tc(i)),!(!i||!Wo(i,u))||(o&&In(o,e.Diagnostics.Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1_This_is_an_instance_of_class_2,Ia(a),Ma(u),Ma(i)),!1))}function nv(e){return !!Lp(e,(function(e){return !(8192&e.flags)}))}function iv(e){return uv(ax(e),e)}function av(e){return !!(98304&(H?vf(e):e.flags))}function ov(e){return av(e)?Sf(e):e}function sv(t,r){In(t,32768&r?65536&r?e.Diagnostics.Object_is_possibly_null_or_undefined:e.Diagnostics.Object_is_possibly_undefined:e.Diagnostics.Object_is_possibly_null);}function cv(t,r){In(t,32768&r?65536&r?e.Diagnostics.Cannot_invoke_an_object_which_is_possibly_null_or_undefined:e.Diagnostics.Cannot_invoke_an_object_which_is_possibly_undefined:e.Diagnostics.Cannot_invoke_an_object_which_is_possibly_null);}function lv(t,r,n){if(H&&2&t.flags)return In(r,e.Diagnostics.Object_is_of_type_unknown),Me;var i=98304&(H?vf(t):t.flags);if(i){n(r,i);var a=Sf(t);return 229376&a.flags?Me:a}return t}function uv(e,t){return lv(e,t,sv)}function _v(t,r){var n=uv(t,r);return 16384&n.flags&&In(r,e.Diagnostics.Object_is_possibly_undefined),n}function dv(e,t){return 32&e.flags?function(e,t){var r=ax(e.expression),n=kf(r,e.expression);return Ef(hv(e,e.expression,uv(n,e.expression),e.name,t),e,n!==r)}(e,t):hv(e,e.expression,iv(e.expression),e.name,t)}function pv(t,r){var n=e.isPartOfTypeQuery(t)&&e.isThisIdentifier(t.left)?uv(Wm(t.left),t.left):iv(t.left);return hv(t,t.left,n,t.right,r)}function fv(t){for(;211===t.parent.kind;)t=t.parent;return e.isCallOrNewExpression(t.parent)&&t.parent.expression===t}function gv(t,r){for(var n=e.getContainingClass(r);n;n=e.getContainingClass(n)){var i=n.symbol,a=e.getSymbolNameForPrivateIdentifier(i,t),o=i.members&&i.members.get(a)||i.exports&&i.exports.get(a);if(o)return o}}function mv(t){if(e.isExpressionNode(t)){var r=Qn(t);return void 0===r.resolvedSymbol&&(r.resolvedSymbol=gv(t.escapedText,t)),r.resolvedSymbol}}function yv(e,t){return Jc(e,t.escapedName)}function vv(t,r){return (yo(r)||e.isThisProperty(t)&&vo(r))&&e.getThisContainer(t,!0)===ho(r)}function hv(t,r,n,i,a){var o,s,c=Qn(r).resolvedSymbol,u=e.getAssignmentTargetKind(t),_=Ac(0!==u||fv(t)?jf(n):n),d=to(_)||_===it;if(e.isPrivateIdentifier(i)){K<99&&(0!==u&&ST(t,1048576),1!==u&&ST(t,524288));var p=gv(i.escapedText,i);if(u&&p&&p.valueDeclaration&&e.isMethodDeclaration(p.valueDeclaration)&&YT(i,e.Diagnostics.Cannot_assign_to_private_method_0_Private_methods_are_not_writable,e.idText(i)),(null==p?void 0:p.valueDeclaration)&&99===e.getEmitScriptTarget(U)&&!q){var f=e.getContainingClass(p.valueDeclaration),g=e.findAncestor(t,(function(t){return t===f?"quit":!(!e.isPropertyDeclaration(t.parent)||!e.hasStaticModifier(t.parent)||t.parent.initializer!==t||t.parent.parent!==f)}));if(g){var m=$i(g.parent);e.Debug.assert(m,"Initializer without declaration symbol");var y=In(t,e.Diagnostics.Property_0_may_not_be_used_in_a_static_property_s_initializer_in_the_same_class_when_target_is_esnext_and_useDefineForClassFields_is_false,e.symbolName(p));e.addRelatedInfo(y,e.createDiagnosticForNode(g.parent,e.Diagnostics.Initializer_for_property_0,e.symbolName(m)));}}if(d){if(p)return ro(_)?Me:_;if(!e.getContainingClass(i))return YT(i,e.Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies),we}if(!(o=p?yv(n,p):void 0)&&function(t,r,n){var i,a=yc(t);a&&e.forEach(a,(function(t){var n=t.valueDeclaration;if(n&&e.isNamedDeclaration(n)&&e.isPrivateIdentifier(n.name)&&n.name.escapedText===r.escapedText)return i=t,!0}));var o=ai(r);if(i){var s=e.Debug.checkDefined(i.valueDeclaration),c=e.Debug.checkDefined(e.getContainingClass(s));if(null==n?void 0:n.valueDeclaration){var u=n.valueDeclaration,_=e.getContainingClass(u);if(e.Debug.assert(!!_),e.findAncestor(_,(function(e){return c===e}))){var d=In(r,e.Diagnostics.The_property_0_cannot_be_accessed_on_type_1_within_this_class_because_it_is_shadowed_by_another_private_identifier_with_the_same_spelling,o,Ma(t));return e.addRelatedInfo(d,e.createDiagnosticForNode(u,e.Diagnostics.The_shadowing_declaration_of_0_is_defined_here,o),e.createDiagnosticForNode(s,e.Diagnostics.The_declaration_of_0_that_you_probably_intended_to_use_is_defined_here,o)),!0}}return In(r,e.Diagnostics.Property_0_is_not_accessible_outside_class_1_because_it_has_a_private_identifier,o,ai(c.name||l)),!0}return !1}(n,i,p))return Me;o&&65536&o.flags&&!(32768&o.flags)&&1!==u&&In(t,e.Diagnostics.Private_accessor_was_defined_without_a_getter);}else {if(d)return e.isIdentifier(r)&&c&&Jm(c,t),ro(_)?Me:_;o=Jc(_,i.escapedText);}if(e.isIdentifier(r)&&c&&(U.isolatedModules||!o||!$S(o)||e.shouldPreserveConstEnums(U)&&jm(t))&&Jm(c,t),o){o.declarations&&134217728&$y(o)&&g_(t,o)&&Bn(i,o.declarations,i.escapedText),function(t,r,n){var i,a=t.valueDeclaration;if(a&&!e.getSourceFileOfNode(r).isDeclarationFile){var o=e.idText(n);!Dv(r)||function(t){return e.isPropertyDeclaration(t)&&t.questionToken}(a)||e.isAccessExpression(r)&&e.isAccessExpression(r.expression)||Zn(a,n)||!U.useDefineForClassFields&&function(e){if(!(32&e.parent.flags))return !1;for(var t=Uo(e.parent);;){if(!(t=t.symbol&&Sv(t)))return !1;var r=Jc(t,e.escapedName);if(r&&r.valueDeclaration)return !0}}(t)?256!==a.kind||177===r.parent.kind||8388608&a.flags||Zn(a,n)||(i=In(n,e.Diagnostics.Class_0_used_before_its_declaration,o)):i=In(n,e.Diagnostics.Property_0_is_used_before_its_initialization,o),i&&e.addRelatedInfo(i,e.createDiagnosticForNode(a,e.Diagnostics._0_is_declared_here,o));}}(o,t,i),Iv(o,t,Ov(r,c)),Qn(t).resolvedSymbol=o;var v=e.isWriteAccess(t);if(tv(t,106===r.kind,v,_,o),Sb(t,o,u))return In(i,e.Diagnostics.Cannot_assign_to_0_because_it_is_a_read_only_property,e.idText(i)),Me;s=vv(t,o)?Ie:v?function(e){if(98304&e.flags){var t=function(e){var t=Gn(e);return t.writeType||(t.writeType=Lo(e,!0))}(e);if(t)return t}return Uo(e)}(o):Uo(o);}else {var h=e.isPrivateIdentifier(i)||0!==u&&x_(n)&&!T_(n)?void 0:Zc(_,i.escapedText);if(!h||!h.type){var b=bv(t,n.symbol,!0);return !b&&p_(n)?we:n.symbol===ce?(ce.exports.has(i.escapedText)&&418&ce.exports.get(i.escapedText).flags?In(i,e.Diagnostics.Property_0_does_not_exist_on_type_1,e.unescapeLeadingUnderscores(i.escapedText),Ma(n)):Y&&In(i,e.Diagnostics.Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature,Ma(n)),we):(i.escapedText&&!si(t)&&Tv(i,T_(n)?_:n,b),Me)}h.isReadonly&&(e.isAssignmentTarget(t)||e.isDeleteTarget(t))&&In(t,e.Diagnostics.Index_signature_in_type_0_only_permits_reading,Ma(_)),s=U.noUncheckedIndexedAccess&&!e.isAssignmentTarget(t)?qu([h.type,ze]):h.type,U.noPropertyAccessFromIndexSignature&&e.isPropertyAccessExpression(t)&&In(i,e.Diagnostics.Property_0_comes_from_an_index_signature_so_it_must_be_accessed_with_0,e.unescapeLeadingUnderscores(i.escapedText));}return xv(t,o,s,i,a)}function bv(t,r,n){var i=e.getSourceFileOfNode(t);if(i&&void 0===U.checkJs&&void 0===i.checkJsDirective&&(1===i.scriptKind||2===i.scriptKind)){var a=e.forEach(null==r?void 0:r.declarations,e.getSourceFileOfNode);return !(i!==a&&a&&Xn(a)||n&&r&&32&r.flags||t&&n&&e.isPropertyAccessExpression(t)&&108===t.expression.kind)}return !1}function xv(t,r,n,i,a){var o=e.getAssignmentTargetKind(t);if(1===o)return Nf(n,!!(r&&16777216&r.flags));if(r&&!(98311&r.flags)&&!(8192&r.flags&&1048576&n.flags)&&!vS(r.declarations))return n;if(n===Ie)return xo(t,r);n=Bm(n,t,a);var s=!1;if(H&&X&&e.isAccessExpression(t)&&108===t.expression.kind){var c=r&&r.valueDeclaration;if(c&&rS(c)&&!e.isStatic(c)){var l=wm(t);170!==l.kind||l.parent!==c.parent||8388608&c.flags||(s=!0);}}else H&&r&&r.valueDeclaration&&e.isPropertyAccessExpression(r.valueDeclaration)&&e.getAssignmentDeclarationPropertyAccessKind(r.valueDeclaration)&&wm(t)===wm(r.valueDeclaration)&&(s=!0);var u=Pm(t,n,s?Df(n):n);return s&&!(32768&vf(n))&&32768&vf(u)?(In(i,e.Diagnostics.Property_0_is_used_before_being_assigned,Ia(r)),n):o?of(u):u}function Dv(t){return !!e.findAncestor(t,(function(t){switch(t.kind){case 166:return !0;case 294:case 168:case 171:case 172:case 296:case 161:case 232:case 287:case 284:case 285:case 286:case 279:case 227:case 290:return !1;case 213:case 237:return !(!e.isBlock(t.parent)||!e.isClassStaticBlockDeclaration(t.parent.parent))||"quit";default:return !e.isExpressionNode(t)&&"quit"}}))}function Sv(e){var t=is(e);if(0!==t.length)return $u(t)}function Tv(t,r,n){var i,a;if(!e.isPrivateIdentifier(t)&&1048576&r.flags&&!(131068&r.flags))for(var o=0,s=r.types;o<s.length;o++){var c=s[o];if(!Jc(c,t.escapedText)&&!Zc(c,t.escapedText)){i=e.chainDiagnosticMessages(i,e.Diagnostics.Property_0_does_not_exist_on_type_1,e.declarationNameToString(t),Ma(c));break}}if(Cv(t.escapedText,r)){var l=e.declarationNameToString(t),u=Ma(r);i=e.chainDiagnosticMessages(i,e.Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_to_access_the_static_member_2_instead,l,u,u+"."+l);}else {var _=Cx(r);if(_&&Jc(_,t.escapedText))i=e.chainDiagnosticMessages(i,e.Diagnostics.Property_0_does_not_exist_on_type_1,e.declarationNameToString(t),Ma(r)),a=e.createDiagnosticForNode(t,e.Diagnostics.Did_you_forget_to_use_await);else {var d=e.declarationNameToString(t),p=Ma(r),f=function(t,r){var n=Ac(r).symbol;if(n)for(var i=e.getScriptTargetFeatures(),a=0,o=e.getOwnKeys(i);a<o.length;a++){var s=o[a],c=i[s][e.symbolName(n)];if(void 0!==c&&e.contains(c,t))return s}}(d,r);if(void 0!==f)i=e.chainDiagnosticMessages(i,e.Diagnostics.Property_0_does_not_exist_on_type_1_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2_or_later,d,p,f);else {var g=kv(t,r);if(void 0!==g){var m=e.symbolName(g),y=n?e.Diagnostics.Property_0_may_not_exist_on_type_1_Did_you_mean_2:e.Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2;i=e.chainDiagnosticMessages(i,y,d,p,m),a=g.valueDeclaration&&e.createDiagnosticForNode(g.valueDeclaration,e.Diagnostics._0_is_declared_here,m);}else {var v=function(t){return U.lib&&!U.lib.includes("dom")&&(n=function(t){return t.symbol&&/^(EventTarget|Node|((HTML[a-zA-Z]*)?Element))$/.test(e.unescapeLeadingUnderscores(t.symbol.escapedName))},3145728&(r=t).flags?e.every(r.types,n):n(r))&&fp(t);var r,n;}(r)?e.Diagnostics.Property_0_does_not_exist_on_type_1_Try_changing_the_lib_compiler_option_to_include_dom:e.Diagnostics.Property_0_does_not_exist_on_type_1;i=e.chainDiagnosticMessages(jc(i,r),v,d,p);}}}}var h=e.createDiagnosticForNodeFromMessageChain(t,i);a&&e.addRelatedInfo(h,a),On(!n||i.code!==e.Diagnostics.Property_0_may_not_exist_on_type_1_Did_you_mean_2.code,h);}function Cv(t,r){var n=r.symbol&&Jc(Uo(r.symbol),t);return void 0!==n&&!!n.valueDeclaration&&e.isStatic(n.valueDeclaration)}function Ev(e,t){return wv(e,yc(t),106500)}function kv(t,r){var n=yc(r);if("string"!=typeof t){var i=t.parent;e.isPropertyAccessExpression(i)&&(n=e.filter(n,(function(e){return Mv(i,r,e)}))),t=e.idText(t);}return wv(t,n,111551)}function Nv(t,r){var n=e.isString(t)?t:e.idText(t),i=yc(r),a="for"===n?e.find(i,(function(t){return "htmlFor"===e.symbolName(t)})):"class"===n?e.find(i,(function(t){return "className"===e.symbolName(t)})):void 0;return null!=a?a:wv(n,i,111551)}function Fv(t,r){var n=kv(t,r);return n&&e.symbolName(n)}function Av(t,r,n){return e.Debug.assert(void 0!==r,"outername should always be defined"),ti(t,r,n,void 0,r,!1,!1,!0,(function(t,n,i){e.Debug.assertEqual(r,n,"name should equal outerName");var a,o=Yn(t,n,i);return o||(a=t===oe?e.mapDefined(["string","number","boolean","object","bigint","symbol"],(function(e){return t.has(e.charAt(0).toUpperCase()+e.slice(1))?jn(524288,e):void 0})).concat(e.arrayFrom(t.values())):e.arrayFrom(t.values()),wv(e.unescapeLeadingUnderscores(n),a,i))}))}function Pv(t,r){return r.exports&&wv(e.idText(t),qi(r),2623475)}function wv(t,r,n){return e.getSpellingSuggestion(t,r,(function(t){var r=e.symbolName(t);if(!e.startsWith(r,'"')){if(t.flags&n)return r;if(2097152&t.flags){var i=function(e){if(Gn(e).target!==Fe)return ki(e)}(t);if(i&&i.flags&n)return r}}}))}function Iv(t,r,n){var i=t&&106500&t.flags&&t.valueDeclaration;if(i){var a=e.hasEffectiveModifier(i,8),o=t.valueDeclaration&&e.isNamedDeclaration(t.valueDeclaration)&&e.isPrivateIdentifier(t.valueDeclaration.name);if((a||o)&&(!r||!e.isWriteOnlyAccess(r)||65536&t.flags)){if(n){var s=e.findAncestor(r,e.isFunctionLikeDeclaration);if(s&&s.symbol===t)return}(1&e.getCheckFlags(t)?Gn(t).target:t).isReferenced=67108863;}}}function Ov(t,r){return 108===t.kind||!!r&&e.isEntityNameExpression(t)&&r===Sg(e.getFirstIdentifier(t))}function Mv(e,t,r){return Rv(e,205===e.kind&&106===e.expression.kind,!1,t,r)}function Lv(e,t,r,n){if(to(n))return !0;var i=Jc(n,r);return !!i&&Rv(e,t,!1,n,i)}function Rv(t,r,n,i,a){if(to(i))return !0;if(a.valueDeclaration&&e.isPrivateIdentifierClassElementDeclaration(a.valueDeclaration)){var o=e.getContainingClass(a.valueDeclaration);return !e.isOptionalChain(t)&&!!e.findAncestor(t,(function(e){return e===o}))}return rv(t,r,n,i,a)}function Bv(t){var r=t.initializer;if(254===r.kind){var n=r.declarations[0];if(n&&!e.isBindingPattern(n.name))return $i(n)}else if(79===r.kind)return Sg(r)}function jv(t,r,n){var i=0!==e.getAssignmentTargetKind(t)||fv(t)?jf(r):r,a=t.argumentExpression,o=ax(a);if(ro(i)||i===it)return i;if(Fb(i)&&!e.isStringLiteralLike(a))return In(a,e.Diagnostics.A_const_enum_member_can_only_be_accessed_using_a_string_literal),Me;var s=P_(i,function(t){var r,n=e.skipParentheses(t);if(79===n.kind){var i=Sg(n);if(3&i.flags)for(var a=t,o=t.parent;o;){if(242===o.kind&&a===o.statement&&Bv(o)===i&&1===Hc(r=rx(o.expression)).length&&Gc(r,Ge))return !0;a=o,o=o.parent;}}return !1}(a)?Ge:o,e.isAssignmentTarget(t)?4|(x_(i)&&!T_(i)?2:0):32,t)||Me;return hx(xv(t,Qn(t).resolvedSymbol,s,a,n),t)}function Jv(t){return e.isCallOrNewExpression(t)||e.isTaggedTemplateExpression(t)||e.isJsxOpeningLikeElement(t)}function zv(t){return Jv(t)&&e.forEach(t.typeArguments,hS),209===t.kind?ax(t.template):e.isJsxOpeningLikeElement(t)?ax(t.attributes):164!==t.kind&&e.forEach(t.arguments,(function(e){ax(e);})),Er}function Uv(e){return zv(e),kr}function Kv(e){return !!e&&(224===e.kind||231===e.kind&&e.isSpread)}function Vv(t){return e.findIndex(t,Kv)}function qv(e){return !!(16384&e.flags)}function Wv(e){return !!(49155&e.flags)}function Hv(t,r,n,i){var a;void 0===i&&(i=!1);var o=!1,s=Zh(n),c=$h(n);if(209===t.kind)if(a=r.length,222===t.template.kind){var l=e.last(t.template.templateSpans);o=e.nodeIsMissing(l.literal)||!!l.literal.isUnterminated;}else {var u=t.template;e.Debug.assert(14===u.kind),o=!!u.isUnterminated;}else if(164===t.kind)a=lh(t,n);else if(e.isJsxOpeningLikeElement(t)){if(o=t.attributes.end===t.end)return !0;a=0===c?r.length:1,s=0===r.length?s:1,c=Math.min(c,1);}else {if(!t.arguments)return e.Debug.assert(208===t.kind),0===$h(n);a=i?r.length+1:r.length,o=t.arguments.end===t.end;var _=Vv(r);if(_>=0)return _>=$h(n)&&(eb(n)||_<Zh(n))}if(!eb(n)&&a>s)return !1;if(o||a>=c)return !0;for(var d=a;d<c;d++)if(131072&om(Qh(n,d),e.isInJSFile(t)&&!H?Wv:qv).flags)return !1;return !0}function Gv(t,r){var n=e.length(t.typeParameters),i=ol(t.typeParameters);return !e.some(r)||r.length>=i&&r.length<=n}function Qv(e){return Yv(e,0,!1)}function Xv(e){return Yv(e,0,!1)||Yv(e,1,!1)}function Yv(e,t,r){if(524288&e.flags){var n=pc(e);if(r||0===n.properties.length&&0===n.indexInfos.length){if(0===t&&1===n.callSignatures.length&&0===n.constructSignatures.length)return n.callSignatures[0];if(1===t&&1===n.constructSignatures.length&&0===n.callSignatures.length)return n.constructSignatures[0]}}}function Zv(t,r,n,i){var a=Wf(t.typeParameters,t,0,i),o=tb(r),s=n&&(o&&262144&o.flags?n.nonFixingMapper:n.mapper);return Vf(s?Nd(r,s):r,t,(function(e,t){fg(a.inferences,e,t);})),n||qf(r,t,(function(e,t){fg(a.inferences,e,t,128);})),bl(t,xg(a),e.isInJSFile(r.declaration))}function $v(t){if(!t)return rt;var r=ax(t);return e.isOptionalChainRoot(t.parent)?Sf(r):e.isOptionalChain(t.parent)?Cf(r):r}function eh(t,r,n,i,a){if(e.isJsxOpeningLikeElement(t))return function(e,t,r,n){var i=vy(t,e),a=Jb(e.attributes,i,n,r);return fg(n.inferences,a,i),xg(n)}(t,r,i,a);if(164!==t.kind){var o=my(t,e.every(r.typeParameters,(function(e){return !!Fc(e)}))?8:0);if(o){var s=yy(t),c=Rd(o,Zf(function(t,r){return void 0===r&&(r=0),t&&Hf(e.map(t.inferences,Yf),t.signature,t.flags|r,t.compareTypes)}(s,1))),l=Qv(c),u=l&&l.typeParameters?Cl(xl(l,l.typeParameters)):c,_=ml(r);fg(a.inferences,u,_,128);var d=Wf(r.typeParameters,r,a.flags),p=Rd(o,s&&s.returnMapper);fg(d.inferences,p,_),a.returnMapper=e.some(d.inferences,Zb)?Zf(function(t){var r=e.filter(t.inferences,Zb);return r.length?Hf(e.map(r,Yf),t.signature,t.flags,t.compareTypes):void 0}(d)):void 0;}}var f=rb(r),g=f?Math.min(Zh(r)-1,n.length):n.length;if(f&&262144&f.flags){var m=e.find(a.inferences,(function(e){return e.typeParameter===f}));m&&(m.impliedArity=e.findIndex(n,Kv,g)<0?n.length-g:void 0);}var y=pl(r);if(y){var v=oh(t);fg(a.inferences,$v(v),y);}for(var h=0;h<g;h++){var b=n[h];if(226!==b.kind){var x=Qh(r,h),D=Jb(b,x,a,i);fg(a.inferences,D,x);}}if(f){var S=rh(n,g,n.length,f,a,i);fg(a.inferences,S,f);}return xg(a)}function th(e){return 1048576&e.flags?lm(e,th):1&e.flags||Hp(Tc(e)||e)?e:_f(e)?Au(zl(e),e.target.elementFlags,!1,e.target.labeledElementDeclarations):Au([e],[8])}function rh(t,r,n,i,a,o){if(r>=n-1&&Kv(_=t[n-1]))return th(231===_.kind?_.type:Jb(_.expression,i,a,o));for(var s=[],c=[],l=[],u=r;u<n;u++){var _;if(Kv(_=t[u])){var d=231===_.kind?_.type:ax(_.expression);Qp(d)?(s.push(d),c.push(8)):(s.push(hD(33,d,ze,224===_.kind?_.expression:_)),c.push(4));}else {var p=F_(i,ad(u-r),256),f=Jb(_,p,a,o),g=Eb(p,406978556);s.push(g?rd(f):sf(f)),c.push(1);}231===_.kind&&_.tupleNameSource&&l.push(_.tupleNameSource);}return Au(s,c,!1,e.length(l)===e.length(s)?l:void 0)}function nh(t,r,n,i){for(var a,o=e.isInJSFile(t.declaration),s=t.typeParameters,c=sl(e.map(r,dd),s,ol(s),o),l=0;l<r.length;l++){e.Debug.assert(void 0!==s[l],"Should not call checkTypeArguments with too many type arguments");var u=hc(s[l]);if(u){var _=n&&i?function(){return e.chainDiagnosticMessages(void 0,e.Diagnostics.Type_0_does_not_satisfy_the_constraint_1)}:void 0,d=i||e.Diagnostics.Type_0_does_not_satisfy_the_constraint_1;a||(a=vd(s,c));var p=c[l];if(!tp(p,Ls(Rd(u,a),p),n?r[l]:void 0,d,_))return}}return c}function ih(t){if(Oy(t.tagName))return 2;var r=Ac(ax(t.tagName));return e.length(Uc(r,1))?0:e.length(Uc(r,0))?1:2}function ah(t,r,n,i,a,o,s){var c={errors:void 0,skipLogging:!0};if(e.isJsxOpeningLikeElement(t))return function(t,r,n,i,a,o,s){var c=vy(r,t),l=Jb(t.attributes,c,void 0,i);return function(){var r;if(Jy(t))return !0;var n=e.isJsxOpeningElement(t)||e.isJsxSelfClosingElement(t)&&!Oy(t.tagName)?ax(t.tagName):void 0;if(!n)return !0;var i=Uc(n,0);if(!e.length(i))return !0;var o=bT(t);if(!o)return !0;var c=Mi(o,111551,!0,!1,t);if(!c)return !0;var l=Uc(Uo(c),0);if(!e.length(l))return !0;for(var u=!1,_=0,d=0,p=l;d<p.length;d++){var f=Uc(Qh(p[d],0),0);if(e.length(f))for(var g=0,m=f;g<m.length;g++){var y=m[g];if(u=!0,eb(y))return !0;var v=Zh(y);v>_&&(_=v);}}if(!u)return !0;for(var h=1/0,b=0,x=i;b<x.length;b++){var D=$h(x[b]);D<h&&(h=D);}if(h<=_)return !0;if(a){var S=e.createDiagnosticForNode(t.tagName,e.Diagnostics.Tag_0_expects_at_least_1_arguments_but_the_JSX_factory_2_provides_at_most_3,e.entityNameToString(t.tagName),h,e.entityNameToString(o),_),T=null===(r=MS(t.tagName))||void 0===r?void 0:r.valueDeclaration;T&&e.addRelatedInfo(S,e.createDiagnosticForNode(T,e.Diagnostics._0_is_declared_here,e.entityNameToString(t.tagName))),s&&s.skipLogging&&(s.errors||(s.errors=[])).push(S),s.skipLogging||mn.add(S);}return !1}()&&np(l,c,n,a?t.tagName:void 0,t.attributes,void 0,o,s)}(t,n,i,a,o,s,c)?void 0:(e.Debug.assert(!o||!!c.errors,"jsx should have errors when reporting errors"),c.errors||e.emptyArray);var l=pl(n);if(l&&l!==rt&&208!==t.kind){var u=oh(t),_=$v(u),d=o?u||t:void 0,p=e.Diagnostics.The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1;if(!Dp(_,l,i,d,p,s,c))return e.Debug.assert(!o||!!c.errors,"this parameter should have errors when reporting errors"),c.errors||e.emptyArray}for(var f=e.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1,g=rb(n),m=g?Math.min(Zh(n)-1,r.length):r.length,y=0;y<m;y++){var v=r[y];if(226!==v.kind){var h=Qh(n,y),b=Jb(v,h,void 0,a),x=4&a?If(b):b;if(!np(x,h,i,o?v:void 0,v,f,s,c))return e.Debug.assert(!o||!!c.errors,"parameter should have errors when reporting errors"),T(v,x,h),c.errors||e.emptyArray}}if(g){var D=rh(r,m,r.length,g,void 0,a),S=r.length-m;if(d=o?0===S?t:1===S?r[m]:e.setTextRangePosEnd(sh(t,D),r[m].pos,r[r.length-1].end):void 0,!Dp(D,g,i,d,f,void 0,c))return e.Debug.assert(!o||!!c.errors,"rest parameter should have errors when reporting errors"),T(d,D,g),c.errors||e.emptyArray}return;function T(t,r,n){if(t&&o&&c.errors&&c.errors.length){if(Tx(n))return;var a=Tx(r);a&&hp(a,n,i)&&e.addRelatedInfo(c.errors[0],e.createDiagnosticForNode(t,e.Diagnostics.Did_you_forget_to_use_await));}}}function oh(t){var r=207===t.kind?t.expression:209===t.kind?t.tag:void 0;if(r){var n=e.skipOuterExpressions(r);if(e.isAccessExpression(n))return n.expression}}function sh(t,r,n,i){var a=e.parseNodeFactory.createSyntheticExpression(r,n,i);return e.setTextRange(a,t),e.setParent(a,t),a}function ch(t){if(209===t.kind){var r=t.template,n=[sh(r,ur||(ur=_u("TemplateStringsArray",0,!0)||mt))];return 222===r.kind&&e.forEach(r.templateSpans,(function(e){n.push(e.expression);})),n}if(164===t.kind)return function(t){var r=t.parent,n=t.expression;switch(r.kind){case 256:case 225:return [sh(n,Uo($i(r)))];case 163:var i=r.parent;return [sh(n,170===r.parent.kind?Uo($i(i)):Me),sh(n,we),sh(n,Ge)];case 166:case 168:case 171:case 172:var a=166!==r.kind&&0!==K;return [sh(n,jS(r)),sh(n,JS(r)),sh(n,a?Su(LS(r)):we)]}return e.Debug.fail()}(t);if(e.isJsxOpeningLikeElement(t))return t.attributes.properties.length>0||e.isJsxOpeningElement(t)&&t.parent.children.length>0?[t.attributes]:e.emptyArray;var i=t.arguments||e.emptyArray,a=Vv(i);if(a>=0){for(var o=i.slice(0,a),s=function(t){var r=i[t],n=224===r.kind&&(Ur?ax(r.expression):zb(r.expression));n&&_f(n)?e.forEach(zl(n),(function(e,t){var i,a=n.target.elementFlags[t],s=sh(r,4&a?Tu(e):e,!!(12&a),null===(i=n.target.labeledElementDeclarations)||void 0===i?void 0:i[t]);o.push(s);})):o.push(r);},c=a;c<i.length;c++)s(c);return o}return i}function lh(t,r){switch(t.parent.kind){case 256:case 225:return 1;case 166:return 2;case 168:case 171:case 172:return 0===K||r.parameters.length<=2?2:3;case 163:return 3;default:return e.Debug.fail()}}function uh(t,r){var n,i,a=e.getSourceFileOfNode(t);if(e.isPropertyAccessExpression(t.expression)){var o=e.getErrorSpanForNode(a,t.expression.name);n=o.start,i=r?o.length:t.end-n;}else {var s=e.getErrorSpanForNode(a,t.expression);n=s.start,i=r?s.length:t.end-n;}return {start:n,length:i,sourceFile:a}}function _h(t,r,n,i,a,o){if(e.isCallExpression(t)){var s=uh(t),c=s.sourceFile,l=s.start,u=s.length;return e.createFileDiagnostic(c,l,u,r,n,i,a,o)}return e.createDiagnosticForNode(t,r,n,i,a,o)}function dh(t,r,n){var i,a=Vv(n);if(a>-1)return e.createDiagnosticForNode(n[a],e.Diagnostics.A_spread_argument_must_either_have_a_tuple_type_or_be_passed_to_a_rest_parameter);for(var o,s=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,l=Number.NEGATIVE_INFINITY,u=Number.POSITIVE_INFINITY,_=0,d=r;_<d.length;_++){var p=d[_],f=$h(p),g=Zh(p);f<s&&(s=f,o=p),c=Math.max(c,g),f<n.length&&f>l&&(l=f),n.length<g&&g<u&&(u=g);}var m=e.some(r,eb),y=m?s:s<c?s+"-"+c:s,v=m?e.Diagnostics.Expected_at_least_0_arguments_but_got_1:1===y&&0===n.length&&function(t){if(!e.isCallExpression(t)||!e.isIdentifier(t.expression))return !1;var r=ei(t.expression,t.expression.escapedText,111551,void 0,void 0,!1),n=null==r?void 0:r.valueDeclaration;if(!(n&&e.isParameter(n)&&e.isFunctionExpressionOrArrowFunction(n.parent)&&e.isNewExpression(n.parent.parent)&&e.isIdentifier(n.parent.parent.expression)))return !1;var i=vu(!1);return !!i&&MS(n.parent.parent.expression,!0)===i}(t)?e.Diagnostics.Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise:e.Diagnostics.Expected_0_arguments_but_got_1;if(s<n.length&&n.length<c)return _h(t,e.Diagnostics.No_overload_expects_0_arguments_but_overloads_do_exist_that_expect_either_1_or_2_arguments,n.length,l,u);if(n.length<s){var h=_h(t,v,y,n.length),b=null===(i=null==o?void 0:o.declaration)||void 0===i?void 0:i.parameters[o.thisParameter?n.length+1:n.length];if(b){var x=e.createDiagnosticForNode(b,e.isBindingPattern(b.name)?e.Diagnostics.An_argument_matching_this_binding_pattern_was_not_provided:e.isRestParameter(b)?e.Diagnostics.Arguments_for_the_rest_parameter_0_were_not_provided:e.Diagnostics.An_argument_for_0_was_not_provided,b.name?e.isBindingPattern(b.name)?void 0:e.idText(e.getFirstIdentifier(b.name)):n.length);return e.addRelatedInfo(h,x)}return h}var D=e.factory.createNodeArray(n.slice(c)),S=e.first(D).pos,T=e.last(D).end;return T===S&&T++,e.setTextRangePosEnd(D,S,T),e.createDiagnosticForNodeArray(e.getSourceFileOfNode(t),D,v,y,n.length)}function ph(t,i,a,o,s,c){var l,u=209===t.kind,_=164===t.kind,d=e.isJsxOpeningLikeElement(t),p=!a&&r;_||(l=t.typeArguments,(u||d||106!==t.expression.kind)&&e.forEach(l,hS));var f=a||[];if(function(t,r,n){var i,a,o,s,c=0,l=-1;e.Debug.assert(!r.length);for(var u=0,_=t;u<_.length;u++){var d=_[u],p=d.declaration&&$i(d.declaration),f=d.declaration&&d.declaration.parent;a&&p!==a?(o=c=r.length,i=f):i&&f===i?o+=1:(i=f,o=c),a=p,z(d)?(s=++l,c++):s=o,r.splice(s,0,n?zs(d,n):d);}}(i,f,s),!f.length)return p&&mn.add(_h(t,e.Diagnostics.Call_target_does_not_contain_any_signatures)),Uv(t);var g,m,y,v,h=ch(t),b=1===f.length&&!f[0].typeParameters,x=_||b||!e.some(h,Ud)?0:4,D=!!(16&o)&&207===t.kind&&t.arguments.hasTrailingComma;if(f.length>1&&(v=W(f,bn,b,D)),v||(v=W(f,Dn,b,D)),v)return v;if(p)if(g)if(1===g.length||g.length>3){var S,T=g[g.length-1];g.length>3&&(S=e.chainDiagnosticMessages(S,e.Diagnostics.The_last_overload_gave_the_following_error),S=e.chainDiagnosticMessages(S,e.Diagnostics.No_overload_matches_this_call));var C=ah(t,h,T,Dn,0,!0,(function(){return S}));if(C)for(var E=0,k=C;E<k.length;E++){var N=k[E];T.declaration&&g.length>3&&e.addRelatedInfo(N,e.createDiagnosticForNode(T.declaration,e.Diagnostics.The_last_overload_is_declared_here)),q(T,N),mn.add(N);}else e.Debug.fail("No error for last overload signature");}else {for(var F=[],A=0,P=Number.MAX_VALUE,w=0,I=0,O=function(r){var n=ah(t,h,r,Dn,0,!0,(function(){return e.chainDiagnosticMessages(void 0,e.Diagnostics.Overload_0_of_1_2_gave_the_following_error,I+1,f.length,Oa(r))}));n?(n.length<=P&&(P=n.length,w=I),A=Math.max(A,n.length),F.push(n)):e.Debug.fail("No error for 3 or fewer overload signatures"),I++;},M=0,L=g;M<L.length;M++)O(L[M]);var R=A>1?F[w]:e.flatten(F);e.Debug.assert(R.length>0,"No errors reported for 3 or fewer overload signatures");var B=e.chainDiagnosticMessages(e.map(R,(function(e){return "string"==typeof e.messageText?e:e.messageText})),e.Diagnostics.No_overload_matches_this_call),j=n$3([],e.flatMap(R,(function(e){return e.relatedInformation})),!0),U=void 0;if(e.every(R,(function(e){return e.start===R[0].start&&e.length===R[0].length&&e.file===R[0].file}))){var K=R[0];U={file:K.file,start:K.start,length:K.length,code:B.code,category:B.category,messageText:B,relatedInformation:j};}else U=e.createDiagnosticForNodeFromMessageChain(t,B,j);q(g[0],U),mn.add(U);}else if(m)mn.add(dh(t,[m],h));else if(y)nh(y,t.typeArguments,!0,c);else {var V=e.filter(i,(function(e){return Gv(e,l)}));0===V.length?mn.add(function(t,r,n){var i=n.length;if(1===r.length){var a=ol((_=r[0]).typeParameters),o=e.length(_.typeParameters);return e.createDiagnosticForNodeArray(e.getSourceFileOfNode(t),n,e.Diagnostics.Expected_0_type_arguments_but_got_1,a<o?a+"-"+o:a,i)}for(var s=-1/0,c=1/0,l=0,u=r;l<u.length;l++){var _,d=ol((_=u[l]).typeParameters);o=e.length(_.typeParameters),d>i?c=Math.min(c,d):o<i&&(s=Math.max(s,o));}return s!==-1/0&&c!==1/0?e.createDiagnosticForNodeArray(e.getSourceFileOfNode(t),n,e.Diagnostics.No_overload_expects_0_type_arguments_but_overloads_do_exist_that_expect_either_1_or_2_type_arguments,i,s,c):e.createDiagnosticForNodeArray(e.getSourceFileOfNode(t),n,e.Diagnostics.Expected_0_type_arguments_but_got_1,s===-1/0?c:s,i)}(t,i,l)):_?c&&mn.add(_h(t,c)):mn.add(dh(t,V,h));}return function(t,r,n,i){return e.Debug.assert(r.length>0),xS(t),i||1===r.length||r.some((function(e){return !!e.typeParameters}))?function(t,r,n){var i=function(e,t){for(var r=-1,n=-1,i=0;i<e.length;i++){var a=e[i],o=Zh(a);if(eb(a)||o>=t)return i;o>n&&(n=o,r=i);}return r}(r,void 0===le?n.length:le),a=r[i],o=a.typeParameters;if(!o)return a;var s=Jv(t)?t.typeArguments:void 0,c=s?Dl(a,function(e,t,r){for(var n=e.map(LS);n.length>t.length;)n.pop();for(;n.length<t.length;)n.push(hc(t[n.length])||bg(r));return n}(s,o,e.isInJSFile(t))):function(t,r,n,i){return Dl(n,eh(t,n,i,12,Wf(r,n,e.isInJSFile(t)?2:0)))}(t,o,a,n);return r[i]=c,c}(t,r,n):function(t){var r,n=e.mapDefined(t,(function(e){return e.thisParameter}));n.length&&(r=gh(n,n.map(Kh)));for(var i=e.minAndMax(t,fh),a=i.min,o=i.max,s=[],c=function(r){var n=e.mapDefined(t,(function(t){return J(t)?r<t.parameters.length-1?t.parameters[r]:e.last(t.parameters):r<t.parameters.length?t.parameters[r]:void 0}));e.Debug.assert(0!==n.length),s.push(gh(n,e.mapDefined(t,(function(e){return Xh(e,r)}))));},l=0;l<o;l++)c(l);var u=e.mapDefined(t,(function(t){return J(t)?e.last(t.parameters):void 0})),_=0;if(0!==u.length){var d=Tu(qu(e.mapDefined(t,hl),2));s.push(mh(u,d)),_|=1;}return t.some(z)&&(_|=2),Bs(t[0].declaration,void 0,r,s,$u(t.map(ml)),void 0,a,_)}(r)}(t,f,h,!!a);function q(t,r){var n,i,a=g,o=m,s=y,c=(null===(i=null===(n=t.declaration)||void 0===n?void 0:n.symbol)||void 0===i?void 0:i.declarations)||e.emptyArray,l=c.length>1?e.find(c,(function(t){return e.isFunctionLikeDeclaration(t)&&e.nodeIsPresent(t.body)})):void 0;if(l){var u=cl(l),_=!u.typeParameters;W([u],Dn,_)&&e.addRelatedInfo(r,e.createDiagnosticForNode(l,e.Diagnostics.The_call_would_have_succeeded_against_this_implementation_but_implementation_signatures_of_overloads_are_not_externally_visible));}g=a,m=o,y=s;}function W(r,n,i,a){if(void 0===a&&(a=!1),g=void 0,m=void 0,y=void 0,i){var o=r[0];if(e.some(l)||!Hv(t,h,o,a))return;return ah(t,h,o,n,0,!1,void 0)?void(g=[o]):o}for(var s=0;s<r.length;s++)if(Gv(o=r[s],l)&&Hv(t,h,o,a)){var c=void 0,u=void 0;if(o.typeParameters){var _=void 0;if(e.some(l)){if(!(_=nh(o,l,!1))){y=o;continue}}else u=Wf(o.typeParameters,o,e.isInJSFile(t)?2:0),_=eh(t,o,h,8|x,u),x|=4&u.flags?8:0;if(c=bl(o,_,e.isInJSFile(o.declaration),u&&u.inferredTypeParameters),rb(o)&&!Hv(t,h,c,a)){m=c;continue}}else c=o;if(!ah(t,h,c,n,x,!1,void 0)){if(x){if(x=0,u&&(c=bl(o,_=eh(t,o,h,x,u),e.isInJSFile(o.declaration),u&&u.inferredTypeParameters),rb(o)&&!Hv(t,h,c,a))){m=c;continue}if(ah(t,h,c,n,x,!1,void 0)){(g||(g=[])).push(c);continue}}return r[s]=c,c}(g||(g=[])).push(c);}}}function fh(e){var t=e.parameters.length;return J(e)?t-1:t}function gh(e,t){return mh(e,qu(t,2))}function mh(t,r){return wf(e.first(t),r)}function yh(e){return !(!e.typeParameters||!uT(ml(e)))}function vh(e,t,r,n){return to(e)||to(t)&&!!(262144&e.flags)||!r&&!n&&!(1048576&t.flags)&&!(131072&Mc(t).flags)&&Yd(e,wt)}function hh(t,r,n){if(t.arguments&&K<1){var i=Vv(t.arguments);i>=0&&In(t.arguments[i],e.Diagnostics.Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_5_and_higher);}var a=iv(t.expression);if(a===it)return Fr;if(ro(a=Ac(a)))return Uv(t);if(to(a))return t.typeArguments&&In(t,e.Diagnostics.Untyped_function_calls_may_not_accept_type_arguments),zv(t);var o=Uc(a,1);if(o.length){if(!function(t,r){if(!r||!r.declaration)return !0;var n=r.declaration,i=e.getSelectedEffectiveModifierFlags(n,24);if(!i||170!==n.kind)return !0;var a=e.getClassLikeDeclarationOfSymbol(n.parent.symbol),o=ms(n.parent.symbol);if(!PS(t,a)){var s=e.getContainingClass(t);if(s&&16&i){var c=LS(s);if(bh(n.parent.symbol,c))return !0}return 8&i&&In(t,e.Diagnostics.Constructor_of_class_0_is_private_and_only_accessible_within_the_class_declaration,Ma(o)),16&i&&In(t,e.Diagnostics.Constructor_of_class_0_is_protected_and_only_accessible_within_the_class_declaration,Ma(o)),!1}return !0}(t,o[0]))return Uv(t);if(o.some((function(e){return 4&e.flags})))return In(t,e.Diagnostics.Cannot_create_an_instance_of_an_abstract_class),Uv(t);var s=a.symbol&&e.getClassLikeDeclarationOfSymbol(a.symbol);return s&&e.hasSyntacticModifier(s,128)?(In(t,e.Diagnostics.Cannot_create_an_instance_of_an_abstract_class),Uv(t)):ph(t,o,r,n,0)}var c=Uc(a,0);if(c.length){var l=ph(t,c,r,n,0);return Y||(l.declaration&&!Fh(l.declaration)&&ml(l)!==rt&&In(t,e.Diagnostics.Only_a_void_function_can_be_called_with_the_new_keyword),pl(l)===rt&&In(t,e.Diagnostics.A_function_that_is_called_with_the_new_keyword_cannot_have_a_this_type_that_is_void)),l}return Dh(t.expression,a,1),Uv(t)}function bh(t,r){var n=is(r);if(!e.length(n))return !1;var i=n[0];if(2097152&i.flags){for(var a=Qs(i.types),o=0,s=0,c=i.types;s<c.length;s++){var l=c[s];if(!a[o]&&3&e.getObjectFlags(l)){if(l.symbol===t)return !0;if(bh(t,l))return !0}o++;}return !1}return i.symbol===t||bh(t,i)}function xh(t,r,n){var i,a=0===n,o=Ax(r),s=o&&Uc(o,n).length>0;if(1048576&r.flags){for(var c=!1,l=0,u=r.types;l<u.length;l++){var _=u[l];if(0!==Uc(_,n).length){if(c=!0,i)break}else if(i||(i=e.chainDiagnosticMessages(i,a?e.Diagnostics.Type_0_has_no_call_signatures:e.Diagnostics.Type_0_has_no_construct_signatures,Ma(_)),i=e.chainDiagnosticMessages(i,a?e.Diagnostics.Not_all_constituents_of_type_0_are_callable:e.Diagnostics.Not_all_constituents_of_type_0_are_constructable,Ma(r))),c)break}c||(i=e.chainDiagnosticMessages(void 0,a?e.Diagnostics.No_constituent_of_type_0_is_callable:e.Diagnostics.No_constituent_of_type_0_is_constructable,Ma(r))),i||(i=e.chainDiagnosticMessages(i,a?e.Diagnostics.Each_member_of_the_union_type_0_has_signatures_but_none_of_those_signatures_are_compatible_with_each_other:e.Diagnostics.Each_member_of_the_union_type_0_has_construct_signatures_but_none_of_those_signatures_are_compatible_with_each_other,Ma(r)));}else i=e.chainDiagnosticMessages(i,a?e.Diagnostics.Type_0_has_no_call_signatures:e.Diagnostics.Type_0_has_no_construct_signatures,Ma(r));var d=a?e.Diagnostics.This_expression_is_not_callable:e.Diagnostics.This_expression_is_not_constructable;if(e.isCallExpression(t.parent)&&0===t.parent.arguments.length){var p=Qn(t).resolvedSymbol;p&&32768&p.flags&&(d=e.Diagnostics.This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without);}return {messageChain:e.chainDiagnosticMessages(i,d),relatedMessage:s?e.Diagnostics.Did_you_forget_to_use_await:void 0}}function Dh(t,r,n,i){var a=xh(t,r,n),o=a.messageChain,s=a.relatedMessage,c=e.createDiagnosticForNodeFromMessageChain(t,o);if(s&&e.addRelatedInfo(c,e.createDiagnosticForNode(t,s)),e.isCallExpression(t.parent)){var l=uh(t.parent,!0),u=l.start,_=l.length;c.start=u,c.length=_;}mn.add(c),Sh(r,n,i?e.addRelatedInfo(c,i):c);}function Sh(t,r,n){if(t.symbol){var i=Gn(t.symbol).originatingImport;if(i&&!e.isImportCall(i)){var a=Uc(Uo(Gn(t.symbol).target),r);if(!a||!a.length)return;e.addRelatedInfo(n,e.createDiagnosticForNode(i,e.Diagnostics.Type_originates_at_this_import_A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime_Consider_using_a_default_import_or_import_require_here_instead));}}}function Th(t){switch(t.parent.kind){case 256:case 225:return e.Diagnostics.Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression;case 163:return e.Diagnostics.Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression;case 166:return e.Diagnostics.Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression;case 168:case 171:case 172:return e.Diagnostics.Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression;default:return e.Debug.fail()}}function Ch(t,r){var n=zy(t),i=n&&Gi(n),a=i&&Yn(i,A.Element,788968),o=a&&ae.symbolToEntityName(a,788968,t),s=e.factory.createFunctionTypeNode(void 0,[e.factory.createParameterDeclaration(void 0,void 0,void 0,"props",void 0,ae.typeToTypeNode(r,t))],o?e.factory.createTypeReferenceNode(o,void 0):e.factory.createKeywordTypeNode(130)),c=jn(1,"props");return c.type=r,Bs(s,void 0,void 0,[c],a?ms(a):Me,void 0,1,0)}function Eh(t,r,n){if(Oy(t.tagName)){var i=Wy(t),a=Ch(t,i);return rp(Jb(t.attributes,vy(a,t),void 0,0),i,t.tagName,t.attributes),e.length(t.typeArguments)&&(e.forEach(t.typeArguments,hS),mn.add(e.createDiagnosticForNodeArray(e.getSourceFileOfNode(t),t.typeArguments,e.Diagnostics.Expected_0_type_arguments_but_got_1,0,e.length(t.typeArguments)))),a}var o=ax(t.tagName),s=Ac(o);if(ro(s))return Uv(t);var c=Vy(o,t);return vh(o,s,c.length,0)?zv(t):0===c.length?(In(t.tagName,e.Diagnostics.JSX_element_type_0_does_not_have_any_construct_or_call_signatures,e.getTextOfNode(t.tagName)),Uv(t)):ph(t,c,r,n,0)}function kh(t,r,n){switch(t.kind){case 207:return function(t,r,n){if(106===t.expression.kind){var i=Qm(t.expression);if(to(i)){for(var a=0,o=t.arguments;a<o.length;a++)ax(o[a]);return Er}if(!ro(i)){var s=e.getEffectiveBaseTypeNode(e.getContainingClass(t));if(s)return ph(t,ts(i,s.typeArguments,s),r,n,0)}return zv(t)}var c,l=ax(t.expression);if(e.isCallChain(t)){var u=kf(l,t.expression);c=u===l?0:e.isOutermostOptionalChain(t)?16:8,l=u;}else c=0;if((l=lv(l,t.expression,cv))===it)return Fr;var _=Ac(l);if(ro(_))return Uv(t);var d=Uc(_,0),p=Uc(_,1).length;if(vh(l,_,d.length,p))return !ro(l)&&t.typeArguments&&In(t,e.Diagnostics.Untyped_function_calls_may_not_accept_type_arguments),zv(t);if(!d.length){if(p)In(t,e.Diagnostics.Value_of_type_0_is_not_callable_Did_you_mean_to_include_new,Ma(l));else {var f=void 0;if(1===t.arguments.length){var g=e.getSourceFileOfNode(t).text;e.isLineBreak(g.charCodeAt(e.skipTrivia(g,t.expression.end,!0)-1))&&(f=e.createDiagnosticForNode(t.expression,e.Diagnostics.Are_you_missing_a_semicolon));}Dh(t.expression,_,0,f);}return Uv(t)}return 8&n&&!t.typeArguments&&d.some(yh)?(Yb(t,n),Nr):d.some((function(t){return e.isInJSFile(t.declaration)&&!!e.getJSDocClassTag(t.declaration)}))?(In(t,e.Diagnostics.Value_of_type_0_is_not_callable_Did_you_mean_to_include_new,Ma(l)),Uv(t)):ph(t,d,r,n,c)}(t,r,n);case 208:return hh(t,r,n);case 209:return function(t,r,n){var i=ax(t.tag),a=Ac(i);if(ro(a))return Uv(t);var o=Uc(a,0),s=Uc(a,1).length;if(vh(i,a,o.length,s))return zv(t);if(!o.length){if(e.isArrayLiteralExpression(t.parent)){var c=e.createDiagnosticForNode(t.tag,e.Diagnostics.It_is_likely_that_you_are_missing_a_comma_to_separate_these_two_template_expressions_They_form_a_tagged_template_expression_which_cannot_be_invoked);return mn.add(c),Uv(t)}return Dh(t.tag,a,0),Uv(t)}return ph(t,o,r,n,0)}(t,r,n);case 164:return function(t,r,n){var i=ax(t.expression),a=Ac(i);if(ro(a))return Uv(t);var o,s,c=Uc(a,0),l=Uc(a,1).length;if(vh(i,a,c.length,l))return zv(t);if(o=t,(s=c).length&&e.every(s,(function(e){return 0===e.minArgumentCount&&!J(e)&&e.parameters.length<lh(o,e)}))){var u=e.getTextOfNode(t.expression,!1);return In(t,e.Diagnostics._0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write_0,u),Uv(t)}var _=Th(t);if(!c.length){var d=xh(t.expression,a,0),p=e.chainDiagnosticMessages(d.messageChain,_),f=e.createDiagnosticForNodeFromMessageChain(t.expression,p);return d.relatedMessage&&e.addRelatedInfo(f,e.createDiagnosticForNode(t.expression,d.relatedMessage)),mn.add(f),Sh(a,0,f),Uv(t)}return ph(t,c,r,n,0,_)}(t,r,n);case 279:case 278:return Eh(t,r,n)}throw e.Debug.assertNever(t,"Branch in 'resolveSignature' should be unreachable.")}function Nh(e,t,r){var n=Qn(e),i=n.resolvedSignature;if(i&&i!==Nr&&!t)return i;n.resolvedSignature=Nr;var a=kh(e,t,r||0);return a!==Nr&&(n.resolvedSignature=zr===Ur?a:i),a}function Fh(t){var r;if(!t||!e.isInJSFile(t))return !1;var n=e.isFunctionDeclaration(t)||e.isFunctionExpression(t)?t:e.isVariableDeclaration(t)&&t.initializer&&e.isFunctionExpression(t.initializer)?t.initializer:void 0;if(n){if(e.getJSDocClassTag(t))return !0;var i=$i(n);return !!(null===(r=null==i?void 0:i.members)||void 0===r?void 0:r.size)}return !1}function Ah(t,r){var n,i;if(r){var a=Gn(r);if(!a.inferredClassSymbol||!a.inferredClassSymbol.has(M(t))){var o=e.isTransientSymbol(t)?t:Un(t);return o.exports=o.exports||e.createSymbolTable(),o.members=o.members||e.createSymbolTable(),o.flags|=32&r.flags,(null===(n=r.exports)||void 0===n?void 0:n.size)&&Wn(o.exports,r.exports),(null===(i=r.members)||void 0===i?void 0:i.size)&&Wn(o.members,r.members),(a.inferredClassSymbol||(a.inferredClassSymbol=new e.Map)).set(M(o),o),o}return a.inferredClassSymbol.get(M(t))}}function Ph(t,r){if(t.parent){var n,i;if(e.isVariableDeclaration(t.parent)&&t.parent.initializer===t){if(!(e.isInJSFile(t)||e.isVarConst(t.parent)&&e.isFunctionLikeDeclaration(t)))return;n=t.parent.name,i=t.parent;}else if(e.isBinaryExpression(t.parent)){var a=t.parent,o=t.parent.operatorToken.kind;if(63!==o||!r&&a.right!==t){if(!(56!==o&&60!==o||(e.isVariableDeclaration(a.parent)&&a.parent.initializer===a?(n=a.parent.name,i=a.parent):e.isBinaryExpression(a.parent)&&63===a.parent.operatorToken.kind&&(r||a.parent.right===a)&&(i=n=a.parent.left),n&&e.isBindableStaticNameExpression(n)&&e.isSameEntityName(n,a.left))))return}else i=n=a.left;}else r&&e.isFunctionDeclaration(t)&&(n=t.name,i=t);if(i&&n&&(r||e.getExpandoInitializer(t,e.isPrototypeAccess(n))))return $i(i)}}function wh(t,r){if(t.declaration&&134217728&t.declaration.flags){var n=Ih(r),i=e.tryGetPropertyAccessOrIdentifierToString(e.getInvokedExpression(r));a=n,o=t.declaration,s=i,c=Oa(t),Rn(o,s?e.createDiagnosticForNode(a,e.Diagnostics.The_signature_0_of_1_is_deprecated,c,s):e.createDiagnosticForNode(a,e.Diagnostics._0_is_deprecated,c));}var a,o,s,c;}function Ih(t){switch((t=e.skipParentheses(t)).kind){case 207:case 164:case 208:return Ih(t.expression);case 209:return Ih(t.tag);case 279:case 278:return Ih(t.tagName);case 206:return t.argumentExpression;case 205:return t.name;case 177:var r=t;return e.isQualifiedName(r.typeName)?r.typeName.right:r;default:return t}}function Oh(t){if(!e.isCallExpression(t))return !1;var r=t.expression;if(e.isPropertyAccessExpression(r)&&"for"===r.name.escapedText&&(r=r.expression),!e.isIdentifier(r)||"Symbol"!==r.escapedText)return !1;var n=fu(!1);return !!n&&n===ei(r,"Symbol",111551,void 0,void 0,!1)}function Mh(t,r,n){var i=e.createSymbolTable(),a=jn(2097152,"default");return a.parent=r,a.nameType=id("default"),a.target=Ei(t),i.set("default",a),ya(n,i,e.emptyArray,e.emptyArray,e.emptyArray)}function Lh(e,t,r,n){if(vi(n)&&e&&!ro(e)){var i=e;if(!i.defaultOnlyType){var a=Mh(t,r);i.defaultOnlyType=a;}return i.defaultOnlyType}}function Rh(t,r,n,i){var a;if(W&&t&&!ro(t)){var o=t;if(!o.syntheticType)if(hi(null===(a=n.declarations)||void 0===a?void 0:a.find(e.isSourceFile),n,!1,i)){var s=jn(2048,"__type"),c=Mh(r,n,s);s.type=c,o.syntheticType=wy(t)?Y_(t,c,s,0,!1):c;}else o.syntheticType=t;return o.syntheticType}return t}function Bh(t){if(!e.isRequireCall(t,!0))return !1;if(!e.isIdentifier(t.expression))return e.Debug.fail();var r=ei(t.expression,t.expression.escapedText,111551,void 0,void 0,!0);if(r===_e)return !0;if(2097152&r.flags)return !1;var n=16&r.flags?255:3&r.flags?253:0;if(0!==n){var i=e.getDeclarationOfKind(r,n);return !!i&&!!(8388608&i.flags)}return !1}function jh(e){switch(e.kind){case 10:case 14:case 8:case 9:case 110:case 95:case 203:case 204:case 222:return !0;case 211:return jh(e.expression);case 218:var t=e.operator,r=e.operand;return 40===t&&(8===r.kind||9===r.kind)||39===t&&8===r.kind;case 205:case 206:var n=LS(e.expression).symbol;return n&&2097152&n.flags&&(n=ki(n)),!!(n&&384&n.flags&&1===_s(n))}return !1}function Jh(t,n,i,a){var o=ax(i,a);if(e.isConstTypeReference(n))return jh(i)||In(i,e.Diagnostics.A_const_assertions_can_only_be_applied_to_references_to_enum_members_or_string_number_boolean_array_or_object_literals),rd(o);hS(n),o=If(of(o));var s=dd(n);return r&&!ro(s)&&($d(s,jf(o))||_p(o,s,t,e.Diagnostics.Conversion_of_type_0_to_type_1_may_be_a_mistake_because_neither_type_sufficiently_overlaps_with_the_other_If_this_was_intentional_convert_the_expression_to_unknown_first)),s}function zh(t){switch(t.keywordToken){case 100:return function(){if(!dr){var t=jn(0,"ImportMetaExpression"),r=du(),n=jn(4,"meta",8);n.parent=t,n.type=r;var i=e.createSymbolTable([n]);t.members=i,dr=ya(t,i,e.emptyArray,e.emptyArray,e.emptyArray);}return dr}();case 103:var r=Uh(t);return ro(r)?Me:function(t){var r=jn(0,"NewTargetExpression"),n=jn(4,"target",8);n.parent=r,n.type=t;var i=e.createSymbolTable([n]);return r.members=i,ya(r,i,e.emptyArray,e.emptyArray,e.emptyArray)}(r);default:e.Debug.assertNever(t.keywordToken);}}function Uh(t){var r=e.getNewTargetContainer(t);return r?170===r.kind?Uo($i(r.parent)):Uo($i(r)):(In(t,e.Diagnostics.Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constructor,"new.target"),Me)}function Kh(t){var r=Uo(t);if(H){var n=t.valueDeclaration;if(n&&e.hasInitializer(n))return Df(r)}return r}function Vh(t){return e.Debug.assert(e.isIdentifier(t.name)),t.name.escapedText}function qh(e,t,r){var n=e.parameters.length-(J(e)?1:0);if(t<n)return e.parameters[t].escapedName;var i=e.parameters[n]||Ne,a=r||Uo(i);if(_f(a)){var o=a.target.labeledElementDeclarations,s=t-n;return o&&Vh(o[s])||i.escapedName+"_"+s}return i.escapedName}function Wh(t){return t.valueDeclaration&&e.isParameter(t.valueDeclaration)&&e.isIdentifier(t.valueDeclaration.name)}function Hh(t){return 196===t.kind||e.isParameter(t)&&t.name&&e.isIdentifier(t.name)}function Gh(e,t){var r=e.parameters.length-(J(e)?1:0);if(t<r){var n=e.parameters[t].valueDeclaration;return n&&Hh(n)?n:void 0}var i=e.parameters[r]||Ne,a=Uo(i);if(_f(a)){var o=a.target.labeledElementDeclarations;return o&&o[t-r]}return i.valueDeclaration&&Hh(i.valueDeclaration)?i.valueDeclaration:void 0}function Qh(e,t){return Xh(e,t)||we}function Xh(e,t){var r=e.parameters.length-(J(e)?1:0);if(t<r)return Kh(e.parameters[t]);if(J(e)){var n=Uo(e.parameters[r]),i=t-r;if(!_f(n)||n.target.hasRestElement||i<n.target.fixedLength)return F_(n,ad(i))}}function Yh(t,r){var n=Zh(t),i=$h(t),a=tb(t);if(a&&r>=n-1)return r===n-1?a:Tu(F_(a,Ge));for(var o=[],s=[],c=[],l=r;l<n;l++){!a||l<n-1?(o.push(Qh(t,l)),s.push(l<i?1:2)):(o.push(a),s.push(8));var u=Gh(t,l);u&&c.push(u);}return Au(o,s,!1,e.length(c)===e.length(o)?c:void 0)}function Zh(e){var t=e.parameters.length;if(J(e)){var r=Uo(e.parameters[t-1]);if(_f(r))return t+r.target.fixedLength-(r.target.hasRestElement?0:1)}return t}function $h(t,r){var n=1&r,i=2&r;if(i||void 0===t.resolvedMinArgumentCount){var a=void 0;if(J(t)){var o=Uo(t.parameters[t.parameters.length-1]);if(_f(o)){var s=e.findIndex(o.target.elementFlags,(function(e){return !(1&e)})),c=s<0?o.target.fixedLength:s;c>0&&(a=t.parameters.length-1+c);}}if(void 0===a){if(!n&&32&t.flags)return 0;a=t.minArgumentCount;}if(i)return a;for(var l=a-1;l>=0&&!(131072&om(Qh(t,l),qv).flags);l--)a=l;t.resolvedMinArgumentCount=a;}return t.resolvedMinArgumentCount}function eb(e){if(J(e)){var t=Uo(e.parameters[e.parameters.length-1]);return !_f(t)||t.target.hasRestElement}return !1}function tb(e){if(J(e)){var t=Uo(e.parameters[e.parameters.length-1]);if(!_f(t))return t;if(t.target.hasRestElement)return Ou(t,t.target.fixedLength)}}function rb(e){var t=tb(e);return !t||qp(t)||to(t)||0!=(131072&Mc(t).flags)?void 0:t}function nb(e){return ib(e,nt)}function ib(e,t){return e.parameters.length>0?Qh(e,0):t}function ab(t,r){if(r.typeParameters){if(t.typeParameters)return;t.typeParameters=r.typeParameters;}r.thisParameter&&(!(a=t.thisParameter)||a.valueDeclaration&&!a.valueDeclaration.type)&&(a||(t.thisParameter=wf(r.thisParameter,void 0)),ob(t.thisParameter,Uo(r.thisParameter)));for(var n=t.parameters.length-(J(t)?1:0),i=0;i<n;i++){var a=t.parameters[i];e.getEffectiveTypeAnnotationNode(a.valueDeclaration)||ob(a,Xh(r,i));}J(t)&&(a=e.last(t.parameters),!e.isTransientSymbol(a)&&e.getEffectiveTypeAnnotationNode(a.valueDeclaration)||ob(a,Yh(r,n)));}function ob(e,t){var r=Gn(e);if(!r.type){var n=e.valueDeclaration;r.type=t||Fo(n,!0),79!==n.name.kind&&(r.type===je&&(r.type=No(n.name)),sb(n.name));}}function sb(t){for(var r=0,n=t.elements;r<n.length;r++){var i=n[r];e.isOmittedExpression(i)||(79===i.name.kind?Gn($i(i)).type=_o(i):sb(i.name));}}function cb(e){var t=mu(!0);return t!==bt?Bl(t,[e=Px(Fx(e))||je]):je}function lb(e){var t=yu(!0);return t!==bt?Bl(t,[e=Px(Fx(e))||je]):je}function ub(t,r){var n=cb(r);return n===je?(In(t,e.isImportCall(t)?e.Diagnostics.A_dynamic_import_call_returns_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES2015_in_your_lib_option:e.Diagnostics.An_async_function_or_method_must_return_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES2015_in_your_lib_option),Me):(vu(!0)||In(t,e.isImportCall(t)?e.Diagnostics.A_dynamic_import_call_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option:e.Diagnostics.An_async_function_or_method_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option),n)}function _b(t,r){if(!t.body)return Me;var n,i,a,o=e.getFunctionFlags(t),s=0!=(2&o),c=0!=(1&o),l=rt;if(234!==t.body.kind)n=zb(t.body,r&&-9&r),s&&(n=Fx(Ex(n,!1,t,e.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member)));else if(c){var u=yb(t,r);u?u.length>0&&(n=qu(u,2)):l=nt;var _=function(t,r){var n=[],i=[],a=0!=(2&e.getFunctionFlags(t));return e.forEachYieldExpression(t.body,(function(t){var o,s=t.expression?ax(t.expression,r):Ue;if(e.pushIfUnique(n,pb(t,s,we,a)),t.asteriskToken){var c=ED(s,a?19:17,t.expression);o=c&&c.nextType;}else o=my(t);o&&e.pushIfUnique(i,o);})),{yieldTypes:n,nextTypes:i}}(t,r),d=_.yieldTypes,p=_.nextTypes;i=e.some(d)?qu(d,2):void 0,a=e.some(p)?$u(p):void 0;}else {var f=yb(t,r);if(!f)return 2&o?ub(t,nt):nt;if(0===f.length)return 2&o?ub(t,rt):rt;n=qu(f,2);}if(n||i||a){if(i&&Kf(t,i,3),n&&Kf(t,n,1),a&&Kf(t,a,2),n&&rf(n)||i&&rf(i)||a&&rf(a)){var g=xy(t),m=g?g===cl(t)?c?void 0:n:fy(ml(g),t):void 0;c?(i=uf(i,m,0,s),n=uf(n,m,1,s),a=uf(a,m,2,s)):n=function(e,t,r){return e&&rf(e)&&(e=lf(e,t?r?Cx(t):t:void 0)),e}(n,m,s);}i&&(i=jf(i)),n&&(n=jf(n)),a&&(a=jf(a));}return c?db(i||nt,n||l,a||ry(2,t)||je,s):s?cb(n||l):n||l}function db(e,t,r,n){var i=n?Lr:Rr,a=i.getGlobalGeneratorType(!1);if(e=i.resolveIterationType(e,void 0)||je,t=i.resolveIterationType(t,void 0)||je,r=i.resolveIterationType(r,void 0)||je,a===bt){var o=i.getGlobalIterableIteratorType(!1),s=o!==bt?AD(o,i):void 0,c=s?s.returnType:we,l=s?s.nextType:ze;return Yd(t,c)&&Yd(l,r)?o!==bt?Du(o,[e]):(i.getGlobalIterableIteratorType(!0),mt):(i.getGlobalGeneratorType(!0),mt)}return Du(a,[e,t,r])}function pb(t,r,n,i){var a=t.expression||t,o=t.asteriskToken?hD(i?19:17,r,n,a):r;return i?Ax(o,a,t.asteriskToken?e.Diagnostics.Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member:e.Diagnostics.Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member):o}function fb(e,t,r,n){var i=0;if(n){for(var a=t;a<r.length;a++)i|=T.get(r[a])||32768;for(a=e;a<t;a++)i&=~(T.get(r[a])||0);for(a=0;a<e;a++)i|=T.get(r[a])||32768;}else {for(a=e;a<t;a++)i|=S.get(r[a])||128;for(a=0;a<e;a++)i&=~(S.get(r[a])||0);}return i}function gb(t){var r=Qn(t);return void 0!==r.isExhaustive?r.isExhaustive:r.isExhaustive=function(t){if(215===t.expression.kind){var r=rx(t.expression.expression),n=fb(0,0,tm(t,!1),!0),i=Tc(r)||r;return 3&i.flags?556800==(556800&n):!!(131072&om(i,(function(e){return (jg(e)&n)===n})).flags)}var a=rx(t.expression);if(!af(a))return !1;var o,s,c=em(t);return !(!c.length||e.some(c,tf))&&(o=lm(a,rd),s=c,1048576&o.flags?!e.forEach(o.types,(function(t){return !e.contains(s,t)})):e.contains(s,o))}(t)}function mb(e){return e.endFlowNode&&Em(e.endFlowNode)}function yb(t,r){var n=e.getFunctionFlags(t),i=[],a=mb(t),o=!1;if(e.forEachReturnStatement(t.body,(function(s){var c=s.expression;if(c){var l=zb(c,r&&-9&r);2&n&&(l=Fx(Ex(l,!1,t,e.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member))),131072&l.flags&&(o=!0),e.pushIfUnique(i,l);}else a=!0;})),0!==i.length||a||!o&&!function(e){switch(e.kind){case 212:case 213:return !0;case 168:return 204===e.parent.kind;default:return !1}}(t))return !(H&&i.length&&a)||Fh(t)&&i.some((function(e){return e.symbol===t.symbol}))||e.pushIfUnique(i,ze),i}function vb(t,n){if(r){var i=e.getFunctionFlags(t),a=n&&KD(n,i);if((!a||!Eb(a,16385))&&167!==t.kind&&!e.nodeIsMissing(t.body)&&234===t.body.kind&&mb(t)){var o=512&t.flags,s=e.getEffectiveReturnTypeNode(t)||t;if(a&&131072&a.flags)In(s,e.Diagnostics.A_function_returning_never_cannot_have_a_reachable_end_point);else if(a&&!o)In(s,e.Diagnostics.A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value);else if(a&&H&&!Yd(ze,a))In(s,e.Diagnostics.Function_lacks_ending_return_statement_and_return_type_does_not_include_undefined);else if(U.noImplicitReturns){if(!a){if(!o)return;if(VD(t,ml(cl(t))))return}In(s,e.Diagnostics.Not_all_code_paths_return_a_value);}}}}function hb(t,r){if(e.Debug.assert(168!==t.kind||e.isObjectLiteralMethod(t)),xS(t),e.isFunctionExpression(t)&&sD(t,t.name),r&&4&r&&Ud(t)){if(!e.getEffectiveReturnTypeNode(t)&&!e.hasContextSensitiveParameters(t)){var n=Dy(t);if(n&&$f(ml(n))){var i=Qn(t);if(i.contextFreeType)return i.contextFreeType;var a=_b(t,r),o=Bs(void 0,void 0,void 0,e.emptyArray,a,void 0,0,0),s=ya(t.symbol,k,[o],e.emptyArray,e.emptyArray);return s.objectFlags|=524288,i.contextFreeType=s}}return xt}return FT(t)||212!==t.kind||MT(t),function(t,r){var n=Qn(t);if(!(1024&n.flags)){var i=Dy(t);if(!(1024&n.flags)){n.flags|=1024;var a=e.firstOrUndefined(Uc(Uo($i(t)),0));if(!a)return;if(Ud(t))if(i){var o=yy(t);r&&2&r&&function(t,r,n){for(var i=t.parameters.length-(J(t)?1:0),a=0;a<i;a++){var o=t.parameters[a].valueDeclaration;if(o.type){var s=e.getEffectiveTypeAnnotationNode(o);s&&fg(n.inferences,dd(s),Qh(r,a));}}var c=tb(r);if(c&&262144&c.flags){ab(t,Nd(r,n.nonFixingMapper));var l=Zh(r)-1;fg(n.inferences,Yh(t,l),c);}}(a,i,o),ab(a,o?Nd(i,o.mapper):i);}else !function(e){e.thisParameter&&ob(e.thisParameter);for(var t=0,r=e.parameters;t<r.length;t++)ob(r[t]);}(a);if(i&&!yl(t)&&!a.resolvedReturnType){var s=_b(t,r);a.resolvedReturnType||(a.resolvedReturnType=s);}lx(t);}}}(t,r),Uo($i(t))}function bb(e,t,r,n){if(void 0===n&&(n=!1),!Yd(t,dt)){var i=n&&Tx(t);return Ln(e,!!i&&Yd(i,dt),r),!1}return !0}function xb(t){if(!e.isCallExpression(t))return !1;if(!e.isBindableObjectDefinePropertyCall(t))return !1;var r=zb(t.arguments[2]);if(eo(r,"value")){var n=Jc(r,"writable"),i=n&&Uo(n);if(!i||i===Xe||i===Ye)return !0;if(n&&n.valueDeclaration&&e.isPropertyAssignment(n.valueDeclaration)){var a=ax(n.valueDeclaration.initializer);if(a===Xe||a===Ye)return !0}return !1}return !Jc(r,"set")}function Db(t){return !!(8&e.getCheckFlags(t)||4&t.flags&&64&e.getDeclarationModifierFlagsFromSymbol(t)||3&t.flags&&2&$y(t)||98304&t.flags&&!(65536&t.flags)||8&t.flags||e.some(t.declarations,xb))}function Sb(t,r,n){var i,a;if(0===n)return !1;if(Db(r)){if(4&r.flags&&e.isAccessExpression(t)&&108===t.expression.kind){var o=e.getContainingFunction(t);if(!o||170!==o.kind&&!Fh(o))return !0;if(r.valueDeclaration){var s=e.isBinaryExpression(r.valueDeclaration),c=o.parent===r.valueDeclaration.parent,l=o===r.valueDeclaration.parent,u=s&&(null===(i=r.parent)||void 0===i?void 0:i.valueDeclaration)===o.parent,_=s&&(null===(a=r.parent)||void 0===a?void 0:a.valueDeclaration)===o;return !(c||l||u||_)}}return !0}if(e.isAccessExpression(t)){var d=e.skipParentheses(t.expression);if(79===d.kind){var p=Qn(d).resolvedSymbol;if(2097152&p.flags){var f=di(p);return !!f&&267===f.kind}}}return !1}function Tb(t,r,n){var i=e.skipOuterExpressions(t,7);return 79===i.kind||e.isAccessExpression(i)?!(32&i.flags&&(In(t,n),1)):(In(t,r),!1)}function Cb(e){return Eb(e,2112)?kb(e,3)||Eb(e,296)?dt:Qe:Ge}function Eb(e,t){if(e.flags&t)return !0;if(3145728&e.flags)for(var r=0,n=e.types;r<n.length;r++)if(Eb(n[r],t))return !0;return !1}function kb(e,t,r){return !!(e.flags&t)||!(r&&114691&e.flags)&&(!!(296&t)&&Yd(e,Ge)||!!(2112&t)&&Yd(e,Qe)||!!(402653316&t)&&Yd(e,He)||!!(528&t)&&Yd(e,et)||!!(16384&t)&&Yd(e,rt)||!!(131072&t)&&Yd(e,nt)||!!(65536&t)&&Yd(e,qe)||!!(32768&t)&&Yd(e,ze)||!!(4096&t)&&Yd(e,tt)||!!(67108864&t)&&Yd(e,ct))}function Nb(t,r,n){return 1048576&t.flags?e.every(t.types,(function(e){return Nb(e,r,n)})):kb(t,r,n)}function Fb(t){return !!(16&e.getObjectFlags(t))&&!!t.symbol&&Ab(t.symbol)}function Ab(e){return 0!=(128&e.flags)}function Pb(t,r,n,i,a){void 0===a&&(a=!1);var o=t.properties,s=o[n];if(294===s.kind||295===s.kind){var c=s.name,l=i_(c);if(Es(l)){var u=Jc(r,Ps(l));u&&(Iv(u,s,a),tv(s,!1,!0,r,u));}var _=so(s,F_(r,l,32,c));return Ib(295===s.kind?s:s.initializer,_)}if(296===s.kind){if(!(n<o.length-1)){K<99&&ST(s,4);var d=[];if(i)for(var p=0,f=i;p<f.length;p++){var g=f[p];e.isSpreadAssignment(g)||d.push(g.name);}return _=io(r,d,r.symbol),kT(i,e.Diagnostics.A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma),Ib(s.expression,_)}In(s,e.Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern);}else In(s,e.Diagnostics.Property_assignment_expected);}function wb(t,r,n,i,a){var o=t.elements,s=o[n];if(226!==s.kind){if(224!==s.kind){var c=ad(n);if(Qp(r)){var l=P_(r,c,32|(Sy(s)?16:0),sh(s,c))||Me;return Ib(s,so(s,Sy(s)?Jg(l,524288):l),a)}return Ib(s,i,a)}if(n<o.length-1)In(s,e.Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern);else {var u=s.expression;if(220!==u.kind||63!==u.operatorToken.kind)return kT(t.elements,e.Diagnostics.A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma),Ib(u,am(r,_f)?lm(r,(function(e){return Ou(e,n)})):Tu(i),a);In(u.operatorToken,e.Diagnostics.A_rest_element_cannot_have_an_initializer);}}}function Ib(t,r,n,i){var a;if(295===t.kind){var o=t;o.objectAssignmentInitializer&&(!H||32768&vf(ax(o.objectAssignmentInitializer))||(r=Jg(r,524288)),function(e,t,r,n,i){var a=t.kind;if(63===a&&(204===e.kind||203===e.kind))return Ib(e,ax(r,n),n,108===r.kind);Lb(e,t,r,55===a||56===a||60===a?mD(e,n):ax(e,n),ax(r,n),void 0);}(o.name,o.equalsToken,o.objectAssignmentInitializer,n)),a=t.name;}else a=t;return 220===a.kind&&63===a.operatorToken.kind&&(ne(a,n),a=a.left),204===a.kind?function(e,t,r){var n=e.properties;if(H&&0===n.length)return uv(t,e);for(var i=0;i<n.length;i++)Pb(e,t,i,n,r);return t}(a,r,i):203===a.kind?function(e,t,r){var n=e.elements;K<2&&U.downlevelIteration&&ST(e,512);for(var i=hD(193,t,ze,e)||Me,a=U.noUncheckedIndexedAccess?void 0:i,o=0;o<n.length;o++){var s=i;224===e.elements[o].kind&&(s=a=null!=a?a:hD(65,t,ze,e)||Me),wb(e,t,o,s,r);}return t}(a,r,n):function(t,r,n){var i=ax(t,n);return Tb(t,296===t.parent.kind?e.Diagnostics.The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access:e.Diagnostics.The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access,296===t.parent.kind?e.Diagnostics.The_target_of_an_object_rest_assignment_may_not_be_an_optional_property_access:e.Diagnostics.The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access)&&rp(r,i,t,t),e.isPrivateIdentifierPropertyAccessExpression(t)&&ST(t.parent,1048576),r}(a,r,n)}function Ob(t){switch((t=e.skipParentheses(t)).kind){case 79:case 10:case 13:case 209:case 222:case 14:case 8:case 9:case 110:case 95:case 104:case 152:case 212:case 225:case 213:case 203:case 204:case 215:case 229:case 278:case 277:return !0;case 221:return Ob(t.whenTrue)&&Ob(t.whenFalse);case 220:return !e.isAssignmentOperator(t.operatorToken.kind)&&Ob(t.left)&&Ob(t.right);case 218:case 219:switch(t.operator){case 53:case 39:case 40:case 54:return !0}return !1;case 216:case 210:case 228:default:return !1}}function Mb(e,t){return 0!=(98304&t.flags)||$d(e,t)}function Lb(t,n,i,a,o,s){var c,l,u=n.kind;switch(u){case 41:case 42:case 66:case 67:case 43:case 68:case 44:case 69:case 40:case 65:case 47:case 70:case 48:case 71:case 49:case 72:case 51:case 74:case 52:case 78:case 50:case 73:if(a===it||o===it)return it;a=uv(a,t),o=uv(o,i);var _=void 0;if(528&a.flags&&528&o.flags&&void 0!==(_=function(e){switch(e){case 51:case 74:return 56;case 52:case 78:return 37;case 50:case 73:return 55;default:return}}(n.kind)))return In(s||n,e.Diagnostics.The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead,e.tokenToString(n.kind),e.tokenToString(_)),Ge;var d,p=bb(t,a,e.Diagnostics.The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type,!0),f=bb(i,o,e.Diagnostics.The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type,!0);if(kb(a,3)&&kb(o,3)||!Eb(a,2112)&&!Eb(o,2112))d=Ge;else if(T(a,o)){switch(u){case 49:case 72:N();break;case 42:case 67:K<3&&In(s,e.Diagnostics.Exponentiation_cannot_be_performed_on_bigint_values_unless_the_target_option_is_set_to_es2016_or_later);}d=Qe;}else N(T),d=Me;return p&&f&&E(d),d;case 39:case 64:if(a===it||o===it)return it;kb(a,402653316)||kb(o,402653316)||(a=uv(a,t),o=uv(o,i));var g=void 0;if(kb(a,296,!0)&&kb(o,296,!0)?g=Ge:kb(a,2112,!0)&&kb(o,2112,!0)?g=Qe:kb(a,402653316,!0)||kb(o,402653316,!0)?g=He:(to(a)||to(o))&&(g=ro(a)||ro(o)?Me:we),g&&!C(u))return g;if(!g){var m=402655727;return N((function(e,t){return kb(e,m)&&kb(t,m)})),we}return 64===u&&E(g),g;case 29:case 31:case 32:case 33:return C(u)&&(a=of(uv(a,t)),o=of(uv(o,i)),k((function(e,t){return $d(e,t)||$d(t,e)||Yd(e,dt)&&Yd(t,dt)}))),et;case 34:case 35:case 36:case 37:return k((function(e,t){return Mb(e,t)||Mb(t,e)})),et;case 102:return function(t,r,n,i){return n===it||i===it?it:(!to(n)&&Nb(n,131068)&&In(t,e.Diagnostics.The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter),to(i)||US(i)||Xd(i,wt)||In(r,e.Diagnostics.The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type),et)}(t,i,a,o);case 101:return function(t,r,n,i){if(n===it||i===it)return it;e.isPrivateIdentifier(t)?(K<99&&ST(t,2097152),!Qn(t).resolvedSymbol&&e.getContainingClass(t)&&Tv(t,i,bv(t,i.symbol,!0))):Nb(n=uv(n,t),402665900)||kb(n,407109632)||In(t,e.Diagnostics.The_left_hand_side_of_an_in_expression_must_be_a_private_identifier_or_of_type_any_string_number_or_symbol);var a=vc(i=uv(i,r));return (!Nb(i,126091264)||a&&(kb(i,3145728)&&!Nb(a,126091264)||!Eb(a,126615552)))&&In(r,e.Diagnostics.The_right_hand_side_of_an_in_expression_must_not_be_a_primitive),et}(t,i,a,o);case 55:case 76:var y=4194304&jg(a)?qu([(l=H?a:of(o),lm(l,bf)),o]):a;return 76===u&&E(o),y;case 56:case 75:var v=8388608&jg(a)?qu([hf(a),o],2):a;return 75===u&&E(o),v;case 60:case 77:var h=262144&jg(a)?qu([Sf(a),o],2):a;return 77===u&&E(o),h;case 63:var b=e.isBinaryExpression(t.parent)?e.getAssignmentDeclarationKind(t.parent):0;return function(t,r){if(2===t)for(var n=0,i=fc(r);n<i.length;n++){var a=i[n],o=Uo(a);if(o.symbol&&32&o.symbol.flags){var s=a.escapedName,c=ei(a.valueDeclaration,s,788968,void 0,s,!1);(null==c?void 0:c.declarations)&&c.declarations.some(e.isJSDocTypedefTag)&&(Vn(c,e.Diagnostics.Duplicate_identifier_0,e.unescapeLeadingUnderscores(s),a),Vn(a,e.Diagnostics.Duplicate_identifier_0,e.unescapeLeadingUnderscores(s),c));}}}(b,o),function(r){var n;switch(r){case 2:return !0;case 1:case 5:case 6:case 3:case 4:var a=$i(t),o=e.getAssignedExpandoInitializer(i);return !!o&&e.isObjectLiteralExpression(o)&&!!(null===(n=null==a?void 0:a.exports)||void 0===n?void 0:n.size);default:return !1}}(b)?(524288&o.flags&&(2===b||6===b||fp(o)||Bg(o)||1&e.getObjectFlags(o))||E(o),a):(E(o),If(o));case 27:if(!U.allowUnreachableCode&&Ob(t)&&(79!==(c=i).kind||"eval"!==c.escapedText)){var x=e.getSourceFileOfNode(t),D=x.text,S=e.skipTrivia(D,t.pos);x.parseDiagnostics.some((function(t){return t.code===e.Diagnostics.JSX_expressions_must_have_one_parent_element.code&&e.textSpanContainsPosition(t,S)}))||In(t,e.Diagnostics.Left_side_of_comma_operator_is_unused_and_has_no_side_effects);}return o;default:return e.Debug.fail()}function T(e,t){return kb(e,2112)&&kb(t,2112)}function C(r){var n=Eb(a,12288)?t:Eb(o,12288)?i:void 0;return !n||(In(n,e.Diagnostics.The_0_operator_cannot_be_applied_to_type_symbol,e.tokenToString(r)),!1)}function E(n){if(r&&e.isAssignmentOperator(u)&&Tb(t,e.Diagnostics.The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access,e.Diagnostics.The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access)&&(!e.isIdentifier(t)||"exports"!==e.unescapeLeadingUnderscores(t.escapedText))){var o=void 0;re&&e.isPropertyAccessExpression(t)&&Eb(n,32768)&&Cp(n,eo(rx(t.expression),t.name.escapedText))&&(o=e.Diagnostics.Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_type_of_the_target),rp(n,a,t,i,o);}}function k(e){return !e(a,o)&&(N(e),!0)}function N(t){var r,i=!1,c=s||n;if(t){var l=Px(a),u=Px(o);i=!(l===a&&u===o)&&!(!l||!u)&&t(l,u);}var _=a,d=o;!i&&t&&(r=function(e,t,r){var n=e,i=t,a=of(e),o=of(t);return r(a,o)||(n=a,i=o),[n,i]}(a,o,t),_=r[0],d=r[1]);var p=La(_,d),f=p[0],g=p[1];(function(t,r,i,a){var o;switch(n.kind){case 36:case 34:o="false";break;case 37:case 35:o="true";}if(o)return Ln(t,r,e.Diagnostics.This_condition_will_always_return_0_since_the_types_1_and_2_have_no_overlap,o,i,a)})(c,i,f,g)||Ln(c,i,e.Diagnostics.Operator_0_cannot_be_applied_to_types_1_and_2,e.tokenToString(n.kind),f,g);}}function Rb(t){var r=t.parent;return e.isParenthesizedExpression(r)&&Rb(r)||e.isElementAccessExpression(r)&&r.argumentExpression===t}function Bb(t){for(var r=[t.head.text],n=[],i=0,a=t.templateSpans;i<a.length;i++){var o=a[i],s=ax(o.expression);Eb(s,12288)&&In(o.expression,e.Diagnostics.Implicit_conversion_of_a_symbol_to_a_string_will_fail_at_runtime_Consider_wrapping_this_expression_in_String),r.push(o.literal.text),n.push(Yd(s,pt)?s:He);}return Wb(t)||Rb(t)||im(my(t)||je,jb)?u_(r,n):He}function jb(e){return !!(134217856&e.flags||58982400&e.flags&&Eb(Tc(e)||je,402653316))}function Jb(t,r,n,i){var a=function(t){return 285!==t.kind||e.isJsxSelfClosingElement(t.parent)?t:t.parent.parent}(t),o=a.contextualType,s=a.inferenceContext;try{a.contextualType=r,a.inferenceContext=n;var c=ax(t,1|i|(n?2:0));return Eb(c,2944)&&qb(c,fy(r,t))?rd(c):c}finally{a.contextualType=o,a.inferenceContext=s;}}function zb(e,t){var r=Qn(e);if(!r.resolvedType){if(t&&0!==t)return ax(e,t);var n=zr,i=br;zr=Ur,br=void 0,r.resolvedType=ax(e,t),br=i,zr=n;}return r.resolvedType}function Ub(t){return 210===(t=e.skipParentheses(t,!0)).kind||228===t.kind||e.isJSDocTypeAssertion(t)}function Kb(t,r){var n=e.getEffectiveInitializer(t),i=nx(n)||(r?Jb(n,r,void 0,0):zb(n));return e.isParameter(t)&&201===t.name.kind&&_f(i)&&!i.target.hasRestElement&&Ul(i)<t.name.elements.length?function(t,r){for(var n=r.elements,i=zl(t).slice(),a=t.target.elementFlags.slice(),o=Ul(t);o<n.length;o++){var s=n[o];(o<n.length-1||202!==s.kind||!s.dotDotDotToken)&&(i.push(!e.isOmittedExpression(s)&&Sy(s)?ko(s,!1,!1):we),a.push(2),e.isOmittedExpression(s)||Sy(s)||Uf(s,we));}return Au(i,a,t.target.readonly)}(i,t.name):i}function Vb(t,r){var n=2&e.getCombinedNodeFlags(t)||e.isDeclarationReadonly(t)?r:sf(r);if(e.isInJSFile(t)){if(Yp(n))return Uf(t,we),we;if(Zp(n))return Uf(t,Ut),Ut}return n}function qb(t,r){if(r){if(3145728&r.flags){var n=r.types;return e.some(n,(function(e){return qb(t,e)}))}if(58982400&r.flags){var i=Tc(r)||je;return Eb(i,4)&&Eb(t,128)||Eb(i,8)&&Eb(t,256)||Eb(i,64)&&Eb(t,2048)||Eb(i,4096)&&Eb(t,8192)||qb(t,i)}return !!(406847616&r.flags&&Eb(t,128)||256&r.flags&&Eb(t,256)||2048&r.flags&&Eb(t,2048)||512&r.flags&&Eb(t,512)||8192&r.flags&&Eb(t,8192))}return !1}function Wb(t){var r=t.parent;return e.isAssertionExpression(r)&&e.isConstTypeReference(r.type)||e.isJSDocTypeAssertion(r)&&e.isConstTypeReference(e.getJSDocTypeAssertionType(r))||(e.isParenthesizedExpression(r)||e.isArrayLiteralExpression(r)||e.isSpreadElement(r))&&Wb(r)||(e.isPropertyAssignment(r)||e.isShorthandPropertyAssignment(r)||e.isTemplateSpan(r))&&Wb(r.parent)}function Hb(e,t,r,n){var i=ax(e,t,n);return Wb(e)?rd(i):Ub(e)?i:lf(i,fy(2===arguments.length?my(e):r,e))}function Gb(e,t){return 161===e.name.kind&&Ny(e.name),Hb(e.initializer,t)}function Qb(e,t){return zT(e),161===e.name.kind&&Ny(e.name),Xb(e,hb(e,t),t)}function Xb(t,r,n){if(n&&10&n){var i=Yv(r,0,!0),a=Yv(r,1,!0),o=i||a;if(o&&o.typeParameters){var s=py(t,2);if(s){var c=Yv(Sf(s),i?0:1,!1);if(c&&!c.typeParameters){if(8&n)return Yb(t,n),xt;var l=yy(t),u=l.signature&&ml(l.signature),_=u&&Xv(u);if(_&&!_.typeParameters&&!e.every(l.inferences,Zb)){var d=function(t,r){for(var n,i,a=[],o=0,s=r;o<s.length;o++){var c=(p=s[o]).symbol.escapedName;if($b(t.inferredTypeParameters,c)||$b(a,c)){var l=da(jn(262144,ex(e.concatenate(t.inferredTypeParameters,a),c)));l.target=p,n=e.append(n,p),i=e.append(i,l),a.push(l);}else a.push(p);}if(i)for(var u=vd(n,i),_=0,d=i;_<d.length;_++){var p;(p=d[_]).mapper=u;}return a}(l,o.typeParameters),p=xl(o,d),f=e.map(l.inferences,(function(e){return Xf(e.typeParameter)}));if(Vf(p,c,(function(e,t){fg(f,e,t,0,!0);})),e.some(f,Zb)&&(qf(p,c,(function(e,t){fg(f,e,t);})),!function(e,t){for(var r=0;r<e.length;r++)if(Zb(e[r])&&Zb(t[r]))return !0;return !1}(l.inferences,f)))return function(e,t){for(var r=0;r<e.length;r++)!Zb(e[r])&&Zb(t[r])&&(e[r]=t[r]);}(l.inferences,f),l.inferredTypeParameters=e.concatenate(l.inferredTypeParameters,d),Cl(p)}return Cl(Zv(o,c,l))}}}}return r}function Yb(e,t){2&t&&(yy(e).flags|=4);}function Zb(e){return !(!e.candidates&&!e.contraCandidates)}function $b(t,r){return e.some(t,(function(e){return e.symbol.escapedName===r}))}function ex(e,t){for(var r=t.length;r>1&&t.charCodeAt(r-1)>=48&&t.charCodeAt(r-1)<=57;)r--;for(var n=t.slice(0,r),i=1;;i++){var a=n+i;if(!$b(e,a))return a}}function tx(e){var t=Qv(e);if(t&&!t.typeParameters)return ml(t)}function rx(t){var r=nx(t);if(r)return r;if(67108864&t.flags&&br){var n=br[O(t)];if(n)return n}var i=qr,a=ax(t);return qr!==i&&((br||(br=[]))[O(t)]=a,e.setNodeFlags(t,67108864|t.flags)),a}function nx(t){var r=e.skipParentheses(t,!0);if(e.isJSDocTypeAssertion(r)){var n=e.getJSDocTypeAssertionType(r);if(!e.isConstTypeReference(n))return dd(n)}if(r=e.skipParentheses(t),!e.isCallExpression(r)||106===r.expression.kind||e.isRequireCall(r,!0)||Oh(r)){if(e.isAssertionExpression(r)&&!e.isConstTypeReference(r.type))return dd(r.type);if(8===t.kind||10===t.kind||110===t.kind||95===t.kind)return ax(t)}else if(n=e.isCallChain(r)?function(e){var t=ax(e.expression),r=kf(t,e.expression),n=tx(t);return n&&Ef(n,e,r!==t)}(r):tx(iv(r.expression)))return n}function ix(e){var t=Qn(e);if(t.contextFreeType)return t.contextFreeType;var r=e.contextualType;e.contextualType=we;try{return t.contextFreeType=ax(e,4)}finally{e.contextualType=r;}}function ax(t,n,i){null===e.tracing||void 0===e.tracing||e.tracing.push("check","checkExpression",{kind:t.kind,pos:t.pos,end:t.end});var o=_;_=t,D=0;var s=Xb(t,function(t,n,i){var o=t.kind;if(a)switch(o){case 225:case 212:case 213:a.throwIfCancellationRequested();}switch(o){case 79:return function(t,r){var n=Sg(t);if(n===Ne)return Me;if(n===ue){if(Dv(t))return In(t,e.Diagnostics.arguments_cannot_be_referenced_in_property_initializers),Me;var i=e.getContainingFunction(t);return K<2&&(213===i.kind?In(t,e.Diagnostics.The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_standard_function_expression):e.hasSyntacticModifier(i,256)&&In(t,e.Diagnostics.The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES3_and_ES5_Consider_using_a_standard_function_or_method)),Qn(i).flags|=8192,Uo(n)}t.parent&&e.isPropertyAccessExpression(t.parent)&&t.parent.expression===t||Jm(n,t);var a=aa(n),o=2097152&a.flags?ki(a):a;o.declarations&&134217728&$y(o)&&g_(t,o)&&Bn(t,o.declarations,t.escapedText);var s=a.valueDeclaration;if(s&&32&a.flags)if(256===s.kind&&e.nodeIsDecorated(s))for(i=e.getContainingClass(t);void 0!==i;){if(i===s&&i.name!==t){Qn(s).flags|=16777216,Qn(t).flags|=33554432;break}i=e.getContainingClass(i);}else if(225===s.kind)for(i=e.getThisContainer(t,!1);303!==i.kind;){if(i.parent===s){(e.isPropertyDeclaration(i)&&e.isStatic(i)||e.isClassStaticBlockDeclaration(i))&&(Qn(s).flags|=16777216,Qn(t).flags|=33554432);break}i=e.getThisContainer(i,!1);}!function(t,r){if(!(K>=2||0==(34&r.flags)||!r.valueDeclaration||e.isSourceFile(r.valueDeclaration)||291===r.valueDeclaration.parent.kind)){var n=e.getEnclosingBlockScopeContainer(r.valueDeclaration),i=function(t,r){return !!e.findAncestor(t,(function(t){return t===r?"quit":e.isFunctionLike(t)||t.parent&&e.isPropertyDeclaration(t.parent)&&!e.hasStaticModifier(t.parent)&&t.parent.initializer===t}))}(t,n),a=zm(n);if(a){if(i){var o=!0;if(e.isForStatement(n)&&(u=e.getAncestor(r.valueDeclaration,254))&&u.parent===n){var s=function(t,r){return e.findAncestor(t,(function(e){return e===r?"quit":e===r.initializer||e===r.condition||e===r.incrementor||e===r.statement}))}(t.parent,n);if(s){var c=Qn(s);c.flags|=131072;var l=c.capturedBlockScopeBindings||(c.capturedBlockScopeBindings=[]);e.pushIfUnique(l,r),s===n.initializer&&(o=!1);}}o&&(Qn(a).flags|=65536);}var u;e.isForStatement(n)&&(u=e.getAncestor(r.valueDeclaration,254))&&u.parent===n&&function(t,r){for(var n=t;211===n.parent.kind;)n=n.parent;var i=!1;if(e.isAssignmentTarget(n))i=!0;else if(218===n.parent.kind||219===n.parent.kind){var a=n.parent;i=45===a.operator||46===a.operator;}return !!i&&!!e.findAncestor(n,(function(e){return e===r?"quit":e===r.statement}))}(t,n)&&(Qn(r.valueDeclaration).flags|=4194304),Qn(r.valueDeclaration).flags|=524288;}i&&(Qn(r.valueDeclaration).flags|=262144);}}(t,n);var c=Uo(a),l=e.getAssignmentTargetKind(t);if(l){if(!(3&a.flags||e.isInJSFile(t)&&512&a.flags))return In(t,384&a.flags?e.Diagnostics.Cannot_assign_to_0_because_it_is_an_enum:32&a.flags?e.Diagnostics.Cannot_assign_to_0_because_it_is_a_class:1536&a.flags?e.Diagnostics.Cannot_assign_to_0_because_it_is_a_namespace:16&a.flags?e.Diagnostics.Cannot_assign_to_0_because_it_is_a_function:2097152&a.flags?e.Diagnostics.Cannot_assign_to_0_because_it_is_an_import:e.Diagnostics.Cannot_assign_to_0_because_it_is_not_a_variable,Ia(n)),Me;if(Db(a))return 3&a.flags?In(t,e.Diagnostics.Cannot_assign_to_0_because_it_is_a_constant,Ia(n)):In(t,e.Diagnostics.Cannot_assign_to_0_because_it_is_a_read_only_property,Ia(n)),Me}var u=2097152&a.flags;if(3&a.flags){if(1===l)return c}else {if(!u)return c;s=di(n);}if(!s)return c;c=Bm(c,t,r);for(var _=163===e.getRootDeclaration(s).kind,d=wm(s),p=wm(t),f=p!==d,g=t.parent&&t.parent.parent&&e.isSpreadAssignment(t.parent)&&Wg(t.parent.parent),m=134217728&n.flags;p!==d&&(212===p.kind||213===p.kind||e.isObjectLiteralOrClassExpressionMethodOrAccessor(p))&&(Mm(a)&&c!==Kt||_&&!Im(a));)p=wm(p);var y=_||u||f||g||m||e.isBindingElement(s)||c!==Ie&&c!==Kt&&(!H||0!=(16387&c.flags)||Tg(t)||274===t.parent.kind)||229===t.parent.kind||253===s.kind&&s.exclamationToken||8388608&s.flags,v=Pm(t,c,y?_?function(e,t){if(Qa(t.symbol,2)){var r=H&&163===t.kind&&t.initializer&&32768&vf(e)&&!(32768&vf(ax(t.initializer)));return Za(),r?Jg(e,524288):e}return zo(t.symbol),e}(c,s):c:c===Ie||c===Kt?ze:Df(c),p);if(xm(t)||c!==Ie&&c!==Kt){if(!y&&!(32768&vf(c))&&32768&vf(v))return In(t,e.Diagnostics.Variable_0_is_used_before_being_assigned,Ia(n)),c}else if(v===Ie||v===Kt)return Y&&(In(e.getNameOfDeclaration(s),e.Diagnostics.Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined,Ia(n),Ma(v)),In(t,e.Diagnostics.Variable_0_implicitly_has_an_1_type,Ia(n),Ma(v))),cD(v);return l?of(v):v}(t,n);case 80:return function(t){!function(t){e.getContainingClass(t)?e.isExpressionNode(t)?!mv(t)&&YT(t,e.Diagnostics.Cannot_find_name_0,e.idText(t)):YT(t,e.Diagnostics.Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member_declaration_property_access_or_on_the_left_hand_side_of_an_in_expression):YT(t,e.Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies);}(t);var r=mv(t);return r&&Iv(r,void 0,!1),we}(t);case 108:return Wm(t);case 106:return Qm(t);case 104:return We;case 14:case 10:return td(id(t.text));case 8:return eC(t),td(ad(+t.text));case 9:return function(t){if(!(e.isLiteralTypeNode(t.parent)||e.isPrefixUnaryExpression(t.parent)&&e.isLiteralTypeNode(t.parent.parent))&&K<7&&YT(t,e.Diagnostics.BigInt_literals_are_not_available_when_targeting_lower_than_ES2020));}(t),td(od({negative:!1,base10Value:e.parsePseudoBigInt(t.text)}));case 110:return Ze;case 95:return Xe;case 222:return Bb(t);case 13:return Jt;case 203:return Ty(t,n,i);case 204:return function(t,r){var n=e.isAssignmentTarget(t);!function(t,r){for(var n=new e.Map,i=0,a=t.properties;i<a.length;i++){var o=a[i];if(296!==o.kind){var s=o.name;if(161===s.kind&&OT(s),295===o.kind&&!r&&o.objectAssignmentInitializer)return YT(o.equalsToken,e.Diagnostics.Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_part_of_a_destructuring_pattern);if(80===s.kind&&YT(s,e.Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies),o.modifiers)for(var c=0,l=o.modifiers;c<l.length;c++){var u=l[c];131===u.kind&&168===o.kind||YT(u,e.Diagnostics._0_modifier_cannot_be_used_here,e.getTextOfNode(u));}var _=void 0;switch(o.kind){case 295:RT(o.exclamationToken,e.Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context);case 294:LT(o.questionToken,e.Diagnostics.An_object_member_cannot_be_declared_optional),8===s.kind&&eC(s),_=4;break;case 168:_=8;break;case 171:_=1;break;case 172:_=2;break;default:throw e.Debug.assertNever(o,"Unexpected syntax kind:"+o.kind)}if(!r){var d=e.getPropertyNameForPropertyNameNode(s);if(void 0===d)continue;var p=n.get(d);if(p)if(12&_&&12&p)YT(s,e.Diagnostics.Duplicate_identifier_0,e.getTextOfNode(s));else {if(!(3&_&&3&p))return YT(s,e.Diagnostics.An_object_literal_cannot_have_property_and_accessor_with_the_same_name);if(3===p||_===p)return YT(s,e.Diagnostics.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name);n.set(d,_|p);}else n.set(d,_);}}else if(r){var f=e.skipParentheses(o.expression);if(e.isArrayLiteralExpression(f)||e.isObjectLiteralExpression(f))return YT(o.expression,e.Diagnostics.A_rest_element_cannot_contain_a_binding_pattern)}}}(t,n);for(var i=H?e.createSymbolTable():void 0,a=e.createSymbolTable(),o=[],s=mt,c=py(t),l=c&&c.pattern&&(200===c.pattern.kind||204===c.pattern.kind),u=Wb(t),_=u?8:0,d=e.isInJSFile(t)&&!e.isInJsonFile(t),p=e.getJSDocEnumTag(t),f=!c&&d&&!p,g=te,m=!1,y=!1,v=!1,h=!1,b=0,x=t.properties;b<x.length;b++){var D=x[b];D.name&&e.isComputedPropertyName(D.name)&&Ny(D.name);}for(var S=0,T=0,C=t.properties;T<C.length;T++){var E=C[T],k=$i(E),N=E.name&&161===E.name.kind?Ny(E.name):void 0;if(294===E.kind||295===E.kind||e.isObjectLiteralMethod(E)){var F=294===E.kind?Gb(E,r):295===E.kind?Hb(!n&&E.objectAssignmentInitializer?E.objectAssignmentInitializer:E.name,r):Qb(E,r);if(d){var A=po(E);A?(tp(F,A,E),F=A):p&&p.typeExpression&&tp(F,dd(p.typeExpression),E);}g|=917504&e.getObjectFlags(F);var P=N&&Es(N)?N:void 0,w=P?jn(4|k.flags,Ps(P),4096|_):jn(4|k.flags,k.escapedName,_);if(P&&(w.nameType=P),n)(294===E.kind&&Sy(E.initializer)||295===E.kind&&E.objectAssignmentInitializer)&&(w.flags|=16777216);else if(l&&!(512&e.getObjectFlags(c))){var I=Jc(c,k.escapedName);I?w.flags|=16777216&I.flags:U.suppressExcessPropertyErrors||Gc(c,He)||In(E.name,e.Diagnostics.Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1,Ia(k),Ma(c));}w.declarations=k.declarations,w.parent=k.parent,k.valueDeclaration&&(w.valueDeclaration=k.valueDeclaration),w.type=F,w.target=k,k=w,null==i||i.set(w.escapedName,w);}else {if(296===E.kind){if(K<2&&ST(E,2),o.length>0&&(s=Y_(s,R(),t.symbol,g,u),o=[],a=e.createSymbolTable(),y=!1,v=!1,h=!1),wy(F=Mc(ax(E.expression)))){var O=X_(F,u);if(i&&Ry(O,i,E),S=o.length,ro(s))continue;s=Y_(s,O,t.symbol,g,u);}else In(E,e.Diagnostics.Spread_types_may_only_be_created_from_object_types),s=Me;continue}e.Debug.assert(171===E.kind||172===E.kind),xS(E);}!N||8576&N.flags?a.set(k.escapedName,k):Yd(N,ut)&&(Yd(N,Ge)?v=!0:Yd(N,tt)?h=!0:y=!0,n&&(m=!0)),o.push(k);}if(l&&296!==t.parent.kind)for(var M=0,L=yc(c);M<L.length;M++)w=L[M],a.get(w.escapedName)||Jc(s,w.escapedName)||(16777216&w.flags||In(w.valueDeclaration||w.bindingElement,e.Diagnostics.Initializer_provides_no_value_for_this_binding_element_and_the_binding_element_has_no_default_value),a.set(w.escapedName,w),o.push(w));return ro(s)?Me:s!==mt?(o.length>0&&(s=Y_(s,R(),t.symbol,g,u),o=[],a=e.createSymbolTable(),y=!1,v=!1),lm(s,(function(e){return e===mt?R():e}))):R();function R(){var r=[];y&&r.push(Ay(t,S,o,He)),v&&r.push(Ay(t,S,o,Ge)),h&&r.push(Ay(t,S,o,tt));var i=ya(t.symbol,a,e.emptyArray,e.emptyArray,r);return i.objectFlags|=262272|g,f&&(i.objectFlags|=8192),m&&(i.objectFlags|=512),n&&(i.pattern=t),i}}(t,n);case 205:return dv(t,n);case 160:return pv(t,n);case 206:return function(e,t){return 32&e.flags?function(e,t){var r=ax(e.expression),n=kf(r,e.expression);return Ef(jv(e,uv(n,e.expression),t),e,n!==r)}(e,t):jv(e,iv(e.expression),t)}(t,n);case 207:if(100===t.expression.kind)return function(t){if(PT(t.arguments)||function(t){if(V===e.ModuleKind.ES2015)return YT(t,e.Diagnostics.Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd_system_umd_node12_or_nodenext);if(t.typeArguments)return YT(t,e.Diagnostics.Dynamic_import_cannot_have_type_arguments);var r=t.arguments;if(V!==e.ModuleKind.ESNext&&(kT(r),r.length>1))return YT(r[1],e.Diagnostics.Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext);if(0===r.length||r.length>2)return YT(t,e.Diagnostics.Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_assertion_as_arguments);var n=e.find(r,e.isSpreadElement);n&&YT(n,e.Diagnostics.Argument_of_dynamic_import_cannot_be_spread_element);}(t),0===t.arguments.length)return ub(t,we);for(var r=t.arguments[0],n=zb(r),i=t.arguments.length>1?zb(t.arguments[1]):void 0,a=2;a<t.arguments.length;++a)zb(t.arguments[a]);if((32768&n.flags||65536&n.flags||!Yd(n,He))&&In(r,e.Diagnostics.Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0,Ma(n)),i){var o=pu(!0);o!==mt&&tp(i,xf(o,32768),t.arguments[1]);}var s=Ri(t,r);if(s){var c=Ui(s,r,!0,!1);if(c)return ub(t,Lh(Uo(c),c,s,r)||Rh(Uo(c),c,s,r))}return ub(t,we)}(t);case 208:return function(t,r){var n;AT(t,t.typeArguments)||PT(t.arguments);var i=Nh(t,void 0,r);if(i===Nr)return at;if(wh(i,t),106===t.expression.kind)return rt;if(208===t.kind){var a=i.declaration;if(a&&170!==a.kind&&174!==a.kind&&179!==a.kind&&!e.isJSDocConstructSignature(a)&&!Fh(a))return Y&&In(t,e.Diagnostics.new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type),we}if(e.isInJSFile(t)&&Bh(t))return dl(t.arguments[0]);var o=ml(i);if(12288&o.flags&&Oh(t))return cd(e.walkUpParenthesizedExpressions(t.parent));if(207===t.kind&&!t.questionDotToken&&237===t.parent.kind&&16384&o.flags&&fl(i))if(e.isDottedName(t.expression)){if(!Tm(t)){var s=In(t.expression,e.Diagnostics.Assertions_require_every_name_in_the_call_target_to_be_declared_with_an_explicit_type_annotation);Sm(t.expression,s);}}else In(t.expression,e.Diagnostics.Assertions_require_the_call_target_to_be_an_identifier_or_qualified_name);if(e.isInJSFile(t)){var c=Ph(t,!1);if(null===(n=null==c?void 0:c.exports)||void 0===n?void 0:n.size){var l=ya(c,c.exports,e.emptyArray,e.emptyArray,e.emptyArray);return l.objectFlags|=8192,$u([o,l])}}return o}(t,n);case 209:return function(t){(function(t){return !!(t.questionDotToken||32&t.flags)&&YT(t.template,e.Diagnostics.Tagged_template_expressions_are_not_permitted_in_an_optional_chain)})(t)||AT(t,t.typeArguments),K<2&&ST(t,262144);var r=Nh(t);return wh(r,t),ml(r)}(t);case 211:return function(t,r){if(e.hasJSDocNodes(t)&&e.isJSDocTypeAssertion(t)){var n=e.getJSDocTypeAssertionType(t);return Jh(n,n,t.expression,r)}return ax(t.expression,r)}(t,n);case 225:return function(e){return YD(e),xS(e),Uo($i(e))}(t);case 212:case 213:return hb(t,n);case 215:return function(e){return ax(e.expression),hn}(t);case 210:case 228:return function(t){if(210===t.kind){var r=e.getSourceFileOfNode(t);r&&e.fileExtensionIsOneOf(r.fileName,[".cts",".mts"])&&YT(t,e.Diagnostics.This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Use_an_as_expression_instead);}return Jh(t,t.type,t.expression)}(t);case 229:return function(e){return 32&e.flags?function(e){var t=ax(e.expression),r=kf(t,e.expression);return Ef(Sf(r),e,r!==t)}(e):Sf(ax(e.expression))}(t);case 230:return function(t){return function(t){var r=t.name.escapedText;switch(t.keywordToken){case 103:if("target"!==r)return YT(t.name,e.Diagnostics._0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2,t.name.escapedText,e.tokenToString(t.keywordToken),"target");break;case 100:"meta"!==r&&YT(t.name,e.Diagnostics._0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2,t.name.escapedText,e.tokenToString(t.keywordToken),"meta");}}(t),103===t.keywordToken?Uh(t):100===t.keywordToken?function(t){V===e.ModuleKind.Node12||V===e.ModuleKind.NodeNext?e.getSourceFileOfNode(t).impliedNodeFormat!==e.ModuleKind.ESNext&&In(t,e.Diagnostics.The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output):V<e.ModuleKind.ES2020&&V!==e.ModuleKind.System&&In(t,e.Diagnostics.The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system_node12_or_nodenext);var r=e.getSourceFileOfNode(t);return e.Debug.assert(!!(2097152&r.flags),"Containing file is missing import meta node flag."),"meta"===t.name.escapedText?du():Me}(t):e.Debug.assertNever(t.keywordToken)}(t);case 214:return function(t){ax(t.expression);var r=e.skipParentheses(t.expression);if(!e.isAccessExpression(r))return In(r,e.Diagnostics.The_operand_of_a_delete_operator_must_be_a_property_reference),et;e.isPropertyAccessExpression(r)&&e.isPrivateIdentifier(r.name)&&In(r,e.Diagnostics.The_operand_of_a_delete_operator_cannot_be_a_private_identifier);var n=aa(Qn(r).resolvedSymbol);return n&&(Db(n)&&In(r,e.Diagnostics.The_operand_of_a_delete_operator_cannot_be_a_read_only_property),function(t,r){var n=Uo(r);!H||131075&n.flags||(re?16777216&r.flags:32768&vf(n))||In(t,e.Diagnostics.The_operand_of_a_delete_operator_must_be_optional);}(r,n)),et}(t);case 216:return function(e){return ax(e.expression),Ue}(t);case 217:return function(t){if(r){var n=e.getContainingFunctionOrClassStaticBlock(t);if(n&&e.isClassStaticBlockDeclaration(n))In(t,e.Diagnostics.Await_expression_cannot_be_used_inside_a_class_static_block);else if(!(32768&t.flags)){var i;if(e.isInTopLevelContext(t)){if(!GT(i=e.getSourceFileOfNode(t))){var a=void 0;if(!e.isEffectiveExternalModule(i,U)){a||(a=e.getSpanOfTokenAtPosition(i,t.pos));var o=e.createFileDiagnostic(i,a.start,a.length,e.Diagnostics.await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module);mn.add(o);}(V!==e.ModuleKind.ES2022&&V!==e.ModuleKind.ESNext&&V!==e.ModuleKind.System&&(V!==e.ModuleKind.NodeNext||e.getSourceFileOfNode(t).impliedNodeFormat!==e.ModuleKind.ESNext)||K<4)&&(a=e.getSpanOfTokenAtPosition(i,t.pos),o=e.createFileDiagnostic(i,a.start,a.length,e.Diagnostics.Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher),mn.add(o));}}else if(!GT(i=e.getSourceFileOfNode(t))){if(a=e.getSpanOfTokenAtPosition(i,t.pos),o=e.createFileDiagnostic(i,a.start,a.length,e.Diagnostics.await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules),n&&170!==n.kind&&0==(2&e.getFunctionFlags(n))){var s=e.createDiagnosticForNode(n,e.Diagnostics.Did_you_mean_to_mark_this_function_as_async);e.addRelatedInfo(o,s);}mn.add(o);}}ty(t)&&In(t,e.Diagnostics.await_expressions_cannot_be_used_in_a_parameter_initializer);}var c=ax(t.expression),l=Ex(c,!0,t,e.Diagnostics.Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member);return l!==c||ro(l)||3&c.flags||On(!1,e.createDiagnosticForNode(t,e.Diagnostics.await_has_no_effect_on_the_type_of_this_expression)),l}(t);case 218:return function(t){var r=ax(t.operand);if(r===it)return it;switch(t.operand.kind){case 8:switch(t.operator){case 40:return td(ad(-t.operand.text));case 39:return td(ad(+t.operand.text))}break;case 9:if(40===t.operator)return td(od({negative:!0,base10Value:e.parsePseudoBigInt(t.operand.text)}))}switch(t.operator){case 39:case 40:case 54:return uv(r,t.operand),Eb(r,12288)&&In(t.operand,e.Diagnostics.The_0_operator_cannot_be_applied_to_type_symbol,e.tokenToString(t.operator)),39===t.operator?(Eb(r,2112)&&In(t.operand,e.Diagnostics.Operator_0_cannot_be_applied_to_type_1,e.tokenToString(t.operator),Ma(of(r))),Ge):Cb(r);case 53:mD(t.operand);var n=12582912&jg(r);return 4194304===n?Xe:8388608===n?Ze:et;case 45:case 46:return bb(t.operand,uv(r,t.operand),e.Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type)&&Tb(t.operand,e.Diagnostics.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access,e.Diagnostics.The_operand_of_an_increment_or_decrement_operator_may_not_be_an_optional_property_access),Cb(r)}return Me}(t);case 219:return function(t){var r=ax(t.operand);return r===it?it:(bb(t.operand,uv(r,t.operand),e.Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type)&&Tb(t.operand,e.Diagnostics.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access,e.Diagnostics.The_operand_of_an_increment_or_decrement_operator_may_not_be_an_optional_property_access),Cb(r))}(t);case 220:return ne(t,n);case 221:return function(e,t){var r=mD(e.condition);return fD(e.condition,r,e.whenTrue),qu([ax(e.whenTrue,t),ax(e.whenFalse,t)],2)}(t,n);case 224:return function(e,t){return K<2&&ST(e,U.downlevelIteration?1536:1024),hD(33,ax(e.expression,t),ze,e.expression)}(t,n);case 226:return Ue;case 223:return function(t){r&&(8192&t.flags||QT(t,e.Diagnostics.A_yield_expression_is_only_allowed_in_a_generator_body),ty(t)&&In(t,e.Diagnostics.yield_expressions_cannot_be_used_in_a_parameter_initializer));var n=e.getContainingFunction(t);if(!n)return we;var i=e.getFunctionFlags(n);if(!(1&i))return we;var a=0!=(2&i);t.asteriskToken&&(a&&K<99&&ST(t,26624),!a&&K<2&&U.downlevelIteration&&ST(t,256));var o=yl(n),s=o&&UD(o,a),c=s&&s.yieldType||we,l=s&&s.nextType||we,u=a?Ax(l)||we:l,_=t.expression?ax(t.expression):Ue,d=pb(t,_,u,a);if(o&&d&&rp(d,c,t.expression||t,t.expression),t.asteriskToken)return xD(a?19:17,1,_,t.expression)||we;if(o)return zD(2,o,a)||we;var p=ry(2,n);if(!p&&(p=we,r&&Y&&!e.expressionResultIsUnused(t))){var f=my(t);f&&!to(f)||In(t,e.Diagnostics.yield_expression_implicitly_results_in_an_any_type_because_its_containing_generator_lacks_a_return_type_annotation);}return p}(t);case 231:return function(e){return e.isSpread?F_(e.type,Ge):e.type}(t);case 287:return function(t,r){if(function(t){t.expression&&e.isCommaSequence(t.expression)&&YT(t.expression,e.Diagnostics.JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array);}(t),t.expression){var n=ax(t.expression,r);return t.dotDotDotToken&&n!==we&&!qp(n)&&In(t,e.Diagnostics.JSX_spread_child_must_be_an_array_type),n}return Me}(t,n);case 277:case 278:return function(e,t){return xS(e),Gy(e)||we}(t);case 281:return function(t){Xy(t.openingFragment);var r=e.getSourceFileOfNode(t);return !e.getJSXTransformEnabled(U)||!U.jsxFactory&&!r.pragmas.has("jsx")||U.jsxFragmentFactory||r.pragmas.has("jsxfrag")||In(t,U.jsxFactory?e.Diagnostics.The_jsxFragmentFactory_compiler_option_must_be_provided_to_use_JSX_fragments_with_the_jsxFactory_compiler_option:e.Diagnostics.An_jsxFrag_pragma_is_required_when_using_an_jsx_pragma_with_JSX_fragments),Ly(t),Gy(t)||we}(t);case 285:return function(t,r){return function(t,r){for(var n,i=t.attributes,a=H?e.createSymbolTable():void 0,o=e.createSymbolTable(),s=yt,c=!1,l=!1,u=2048,_=Ky(zy(t)),d=0,p=i.properties;d<p.length;d++){var f=p[d],g=f.symbol;if(e.isJsxAttribute(f)){var m=My(f,r);u|=917504&e.getObjectFlags(m);var y=jn(4|g.flags,g.escapedName);y.declarations=g.declarations,y.parent=g.parent,g.valueDeclaration&&(y.valueDeclaration=g.valueDeclaration),y.type=m,y.target=g,o.set(y.escapedName,y),null==a||a.set(y.escapedName,y),f.name.escapedText===_&&(l=!0);}else e.Debug.assert(286===f.kind),o.size>0&&(s=Y_(s,T(),i.symbol,u,!1),o=e.createSymbolTable()),to(m=Mc(zb(f.expression,r)))&&(c=!0),wy(m)?(s=Y_(s,m,i.symbol,u,!1),a&&Ry(m,a,f)):n=n?$u([n,m]):m;}c||o.size>0&&(s=Y_(s,T(),i.symbol,u,!1));var v=277===t.parent.kind?t.parent:void 0;if(v&&v.openingElement===t&&v.children.length>0){var h=Ly(v,r);if(!c&&_&&""!==_){l&&In(i,e.Diagnostics._0_are_specified_twice_The_attribute_named_0_will_be_overwritten,e.unescapeLeadingUnderscores(_));var b=py(t.attributes),x=b&&cy(b,_),D=jn(4,_);D.type=1===h.length?h[0]:x&&im(x,$p)?Au(h):Tu(qu(h)),D.valueDeclaration=e.factory.createPropertySignature(void 0,e.unescapeLeadingUnderscores(_),void 0,void 0),e.setParent(D.valueDeclaration,i),D.valueDeclaration.symbol=D;var S=e.createSymbolTable();S.set(_,D),s=Y_(s,ya(i.symbol,S,e.emptyArray,e.emptyArray,e.emptyArray),i.symbol,u,!1);}}return c?we:n&&s!==yt?$u([n,s]):n||(s===yt?T():s);function T(){u|=te;var t=ya(i.symbol,o,e.emptyArray,e.emptyArray,e.emptyArray);return t.objectFlags|=262272|u,t}}(t.parent,r)}(t,n);case 279:e.Debug.fail("Shouldn't ever directly check a JsxOpeningElement");}return Me}(t,n,i),n);return Fb(s)&&function(t,r){205===t.parent.kind&&t.parent.expression===t||206===t.parent.kind&&t.parent.expression===t||(79===t.kind||160===t.kind)&&wS(t)||180===t.parent.kind&&t.parent.exprName===t||274===t.parent.kind||In(t,e.Diagnostics.const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment_or_type_query),U.isolatedModules&&(e.Debug.assert(!!(128&r.symbol.flags)),8388608&r.symbol.valueDeclaration.flags&&In(t,e.Diagnostics.Cannot_access_ambient_const_enums_when_the_isolatedModules_flag_is_provided));}(t,s),_=o,null===e.tracing||void 0===e.tracing||e.tracing.pop(),s}function ox(t){t.expression&&QT(t.expression,e.Diagnostics.Type_expected),hS(t.constraint),hS(t.default);var n=gs($i(t));Tc(n),function(e){return Nc(e)!==St}(n)||In(t.default,e.Diagnostics.Type_parameter_0_has_a_circular_default,Ma(n));var i=hc(n),a=Fc(n);i&&a&&tp(a,Ls(Rd(i,bd(n,a)),a),t.default,e.Diagnostics.Type_0_does_not_satisfy_the_constraint_1),r&&GD(t.name,e.Diagnostics.Type_parameter_name_cannot_be_0);}function sx(t){CT(t),lD(t);var r=e.getContainingFunction(t);e.hasSyntacticModifier(t,16476)&&(170===r.kind&&e.nodeIsPresent(r.body)||In(t,e.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation),170===r.kind&&e.isIdentifier(t.name)&&"constructor"===t.name.escapedText&&In(t.name,e.Diagnostics.constructor_cannot_be_used_as_a_parameter_property_name)),t.questionToken&&e.isBindingPattern(t.name)&&r.body&&In(t,e.Diagnostics.A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature),t.name&&e.isIdentifier(t.name)&&("this"===t.name.escapedText||"new"===t.name.escapedText)&&(0!==r.parameters.indexOf(t)&&In(t,e.Diagnostics.A_0_parameter_must_be_the_first_parameter,t.name.escapedText),170!==r.kind&&174!==r.kind&&179!==r.kind||In(t,e.Diagnostics.A_constructor_cannot_have_a_this_parameter),213===r.kind&&In(t,e.Diagnostics.An_arrow_function_cannot_have_a_this_parameter),171!==r.kind&&172!==r.kind||In(t,e.Diagnostics.get_and_set_accessors_cannot_declare_this_parameters)),!t.dotDotDotToken||e.isBindingPattern(t.name)||Yd(Mc(Uo(t.symbol)),Vt)||In(t,e.Diagnostics.A_rest_parameter_must_be_of_an_array_type);}function cx(t,r,n){for(var i=0,a=t.elements;i<a.length;i++){var o=a[i];if(!e.isOmittedExpression(o)){var s=o.name;if(79===s.kind&&s.escapedText===n)return In(r,e.Diagnostics.A_type_predicate_cannot_reference_element_0_in_a_binding_pattern,n),!0;if((201===s.kind||200===s.kind)&&cx(s,r,n))return !0}}}function lx(t){175===t.kind?function(t){CT(t)||function(t){var r=t.parameters[0];if(1!==t.parameters.length)return YT(r?r.name:t,e.Diagnostics.An_index_signature_must_have_exactly_one_parameter);if(kT(t.parameters,e.Diagnostics.An_index_signature_cannot_have_a_trailing_comma),r.dotDotDotToken)return YT(r.dotDotDotToken,e.Diagnostics.An_index_signature_cannot_have_a_rest_parameter);if(e.hasEffectiveModifiers(r))return YT(r.name,e.Diagnostics.An_index_signature_parameter_cannot_have_an_accessibility_modifier);if(r.questionToken)return YT(r.questionToken,e.Diagnostics.An_index_signature_parameter_cannot_have_a_question_mark);if(r.initializer)return YT(r.name,e.Diagnostics.An_index_signature_parameter_cannot_have_an_initializer);if(!r.type)return YT(r.name,e.Diagnostics.An_index_signature_parameter_must_have_a_type_annotation);var n=dd(r.type);im(n,(function(e){return !!(8576&e.flags)}))||b_(n)?YT(r.name,e.Diagnostics.An_index_signature_parameter_type_cannot_be_a_literal_type_or_generic_type_Consider_using_a_mapped_object_type_instead):am(n,Pl)?t.type||YT(t,e.Diagnostics.An_index_signature_must_have_a_type_annotation):YT(r.name,e.Diagnostics.An_index_signature_parameter_type_must_be_string_number_symbol_or_a_template_literal_type);}(t);}(t):178!==t.kind&&255!==t.kind&&179!==t.kind&&173!==t.kind&&170!==t.kind&&174!==t.kind||FT(t);var n=e.getFunctionFlags(t);if(4&n||(3==(3&n)&&K<99&&ST(t,6144),2==(3&n)&&K<4&&ST(t,64),0!=(3&n)&&K<2&&ST(t,128)),QD(e.getEffectiveTypeParameterDeclarations(t)),e.forEach(t.parameters,sx),t.type&&hS(t.type),r){!function(t){K>=2||!e.hasRestParameter(t)||8388608&t.flags||e.nodeIsMissing(t.body)||e.forEach(t.parameters,(function(t){t.name&&!e.isBindingPattern(t.name)&&t.name.escapedText===ue.escapedName&&Pn("noEmit",t,e.Diagnostics.Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters);}));}(t);var i=e.getEffectiveReturnTypeNode(t);if(Y&&!i)switch(t.kind){case 174:In(t,e.Diagnostics.Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type);break;case 173:In(t,e.Diagnostics.Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type);}if(i){var a=e.getFunctionFlags(t);if(1==(5&a)){var o=dd(i);if(o===rt)In(i,e.Diagnostics.A_generator_cannot_have_a_void_type_annotation);else {var s=zD(0,o,0!=(2&a))||we;tp(db(s,zD(1,o,0!=(2&a))||s,zD(2,o,0!=(2&a))||je,!!(2&a)),o,i);}}else 2==(3&a)&&function(t,r){var n=dd(r);if(K>=2){if(ro(n))return;var i=mu(!0);if(i!==bt&&!Vo(n,i))return void In(r,e.Diagnostics.The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type_Did_you_mean_to_write_Promise_0,Ma(Px(n)||rt))}else {if(function(t){Ix(t&&e.getEntityNameFromTypeNode(t));}(r),ro(n))return;var a=e.getEntityNameFromTypeNode(r);if(void 0===a)return void In(r,e.Diagnostics.Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Promise_compatible_constructor_value,Ma(n));var o=Mi(a,111551,!0),s=o?Uo(o):Me;if(ro(s))return void(79===a.kind&&"Promise"===a.escapedText&&qo(n)===mu(!1)?In(r,e.Diagnostics.An_async_function_or_method_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option):In(r,e.Diagnostics.Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Promise_compatible_constructor_value,e.entityNameToString(a)));var c=($t||($t=_u("PromiseConstructorLike",0,true))||mt);if(c===mt)return void In(r,e.Diagnostics.Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Promise_compatible_constructor_value,e.entityNameToString(a));if(!tp(s,c,r,e.Diagnostics.Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Promise_compatible_constructor_value))return;var l=a&&e.getFirstIdentifier(a),u=Yn(t.locals,l.escapedText,111551);if(u)return void In(u.valueDeclaration,e.Diagnostics.Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions,e.idText(l),e.entityNameToString(a))}Ex(n,!1,t,e.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member);}(t,i);}175!==t.kind&&315!==t.kind&&zx(t);}}function ux(t){for(var r=new e.Map,n=0,i=t.members;n<i.length;n++){var a=i[n];if(165===a.kind){var o=void 0,s=a.name;switch(s.kind){case 10:case 8:o=s.text;break;case 79:o=e.idText(s);break;default:continue}r.get(o)?(In(e.getNameOfDeclaration(a.symbol.valueDeclaration),e.Diagnostics.Duplicate_identifier_0,o),In(a.name,e.Diagnostics.Duplicate_identifier_0,o)):r.set(o,!0);}}}function _x(t){if(257===t.kind){var r=$i(t);if(r.declarations&&r.declarations.length>0&&r.declarations[0]!==t)return}var n=El($i(t));if(null==n?void 0:n.declarations){for(var i=new e.Map,a=function(e){1===e.parameters.length&&e.parameters[0].type&&nm(dd(e.parameters[0].type),(function(t){var r=i.get(Bu(t));r?r.declarations.push(e):i.set(Bu(t),{type:t,declarations:[e]});}));},o=0,s=n.declarations;o<s.length;o++)a(s[o]);i.forEach((function(t){if(t.declarations.length>1)for(var r=0,n=t.declarations;r<n.length;r++)In(n[r],e.Diagnostics.Duplicate_index_signature_for_type_0,Ma(t.type));}));}}function dx(t){CT(t)||function(t){if(e.isComputedPropertyName(t.name)&&e.isBinaryExpression(t.name.expression)&&101===t.name.expression.operatorToken.kind)return YT(t.parent.members[0],e.Diagnostics.A_mapped_type_may_not_declare_properties_or_methods);if(e.isClassLike(t.parent)){if(e.isStringLiteral(t.name)&&"constructor"===t.name.text)return YT(t.name,e.Diagnostics.Classes_may_not_have_a_field_named_constructor);if(JT(t.name,e.Diagnostics.A_computed_property_name_in_a_class_property_declaration_must_have_a_simple_literal_type_or_a_unique_symbol_type))return !0;if(K<2&&e.isPrivateIdentifier(t.name))return YT(t.name,e.Diagnostics.Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher)}else if(257===t.parent.kind){if(JT(t.name,e.Diagnostics.A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type))return !0;if(t.initializer)return YT(t.initializer,e.Diagnostics.An_interface_property_cannot_have_an_initializer)}else if(e.isTypeLiteralNode(t.parent)){if(JT(t.name,e.Diagnostics.A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type))return !0;if(t.initializer)return YT(t.initializer,e.Diagnostics.A_type_literal_property_cannot_have_an_initializer)}if(8388608&t.flags&&KT(t),e.isPropertyDeclaration(t)&&t.exclamationToken&&(!e.isClassLike(t.parent)||!t.type||t.initializer||8388608&t.flags||e.isStatic(t)||e.hasAbstractModifier(t))){var r=t.initializer?e.Diagnostics.Declarations_with_initializers_cannot_also_have_definite_assignment_assertions:t.type?e.Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context:e.Diagnostics.Declarations_with_definite_assignment_assertions_must_also_have_type_annotations;return YT(t.exclamationToken,r)}}(t)||OT(t.name),lD(t),px(t),e.isPrivateIdentifier(t.name)&&e.hasStaticModifier(t)&&t.initializer&&99===K&&!U.useDefineForClassFields&&In(t.initializer,e.Diagnostics.Static_fields_with_private_names_can_t_have_initializers_when_the_useDefineForClassFields_flag_is_not_specified_with_a_target_of_esnext_Consider_adding_the_useDefineForClassFields_flag),e.hasSyntacticModifier(t,128)&&166===t.kind&&t.initializer&&In(t,e.Diagnostics.Property_0_cannot_have_an_initializer_because_it_is_marked_abstract,e.declarationNameToString(t.name));}function px(t){if(e.isPrivateIdentifier(t.name)&&K<99){for(var r=e.getEnclosingBlockScopeContainer(t);r;r=e.getEnclosingBlockScopeContainer(r))Qn(r).flags|=67108864;if(e.isClassExpression(t.parent)){var n=zm(t.parent);n&&(Qn(t.name).flags|=524288,Qn(n).flags|=65536);}}}function fx(t){if(r){if(FT(t)||function(t){if(!(8388608&t.flags)&&181!==t.parent.kind&&257!==t.parent.kind){if(K<1)return YT(t.name,e.Diagnostics.Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher);if(K<2&&e.isPrivateIdentifier(t.name))return YT(t.name,e.Diagnostics.Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher);if(void 0===t.body&&!e.hasSyntacticModifier(t,128))return XT(t,t.end-1,";".length,e.Diagnostics._0_expected,"{")}if(t.body){if(e.hasSyntacticModifier(t,128))return YT(t,e.Diagnostics.An_abstract_accessor_cannot_have_an_implementation);if(181===t.parent.kind||257===t.parent.kind)return YT(t.body,e.Diagnostics.An_implementation_cannot_be_declared_in_ambient_contexts)}if(t.typeParameters)return YT(t.name,e.Diagnostics.An_accessor_cannot_have_type_parameters);if(!function(e){return jT(e)||e.parameters.length===(171===e.kind?0:1)}(t))return YT(t.name,171===t.kind?e.Diagnostics.A_get_accessor_cannot_have_parameters:e.Diagnostics.A_set_accessor_must_have_exactly_one_parameter);if(172===t.kind){if(t.type)return YT(t.name,e.Diagnostics.A_set_accessor_cannot_have_a_return_type_annotation);var r=e.Debug.checkDefined(e.getSetAccessorValueParameter(t),"Return value does not match parameter count assertion.");if(r.dotDotDotToken)return YT(r.dotDotDotToken,e.Diagnostics.A_set_accessor_cannot_have_rest_parameter);if(r.questionToken)return YT(r.questionToken,e.Diagnostics.A_set_accessor_cannot_have_an_optional_parameter);if(r.initializer)return YT(t.name,e.Diagnostics.A_set_accessor_parameter_cannot_have_an_initializer)}return !1}(t)||OT(t.name),Bx(t),lx(t),171===t.kind&&!(8388608&t.flags)&&e.nodeIsPresent(t.body)&&256&t.flags&&(512&t.flags||In(t.name,e.Diagnostics.A_get_accessor_must_return_a_value)),161===t.name.kind&&Ny(t.name),As(t)){var n=$i(t),i=e.getDeclarationOfKind(n,171),a=e.getDeclarationOfKind(n,172);if(i&&a&&!(1&oT(i))){Qn(i).flags|=1;var o=e.getEffectiveModifierFlags(i),s=e.getEffectiveModifierFlags(a);(128&o)!=(128&s)&&(In(i.name,e.Diagnostics.Accessors_must_both_be_abstract_or_non_abstract),In(a.name,e.Diagnostics.Accessors_must_both_be_abstract_or_non_abstract)),(16&o&&!(24&s)||8&o&&!(8&s))&&(In(i.name,e.Diagnostics.A_get_accessor_must_be_at_least_as_accessible_as_the_setter),In(a.name,e.Diagnostics.A_get_accessor_must_be_at_least_as_accessible_as_the_setter));var c=Oo(i),l=Oo(a);c&&l&&tp(c,l,i,e.Diagnostics.The_return_type_of_a_get_accessor_must_be_assignable_to_its_set_accessor_type);}}var u=Mo($i(t));171===t.kind&&vb(t,u);}hS(t.body),px(t);}function gx(t,r){return sl(e.map(t.typeArguments,dd),r,ol(r),e.isInJSFile(t))}function mx(t,r){for(var n,i,a=!0,o=0;o<r.length;o++){var s=hc(r[o]);s&&(n||(i=vd(r,n=gx(t,r))),a=a&&tp(n[o],Rd(s,i),t.typeArguments[o],e.Diagnostics.Type_0_does_not_satisfy_the_constraint_1));}return a}function yx(t){var r=nu(t);if(!ro(r)){var n=Qn(t).resolvedSymbol;if(n)return 524288&n.flags&&Gn(n).typeParameters||(4&e.getObjectFlags(r)?r.target.localTypeParameters:void 0)}}function vx(t){AT(t,t.typeArguments),177!==t.kind||void 0===t.typeName.jsdocDotPos||e.isInJSFile(t)||e.isInJSDoc(t)||XT(t,t.typeName.jsdocDotPos,1,e.Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments),e.forEach(t.typeArguments,hS);var n=nu(t);if(!ro(n)){if(t.typeArguments&&r){var i=yx(t);i&&mx(t,i);}var a=Qn(t).resolvedSymbol;a&&(e.some(a.declarations,(function(e){return NS(e)&&!!(134217728&e.flags)}))&&Bn(Ih(t),a.declarations,a.escapedName),32&n.flags&&8&a.flags&&In(t,e.Diagnostics.Enum_type_0_has_members_with_initializers_that_are_not_literals,Ma(n)));}}function hx(t,r){if(!(8388608&t.flags))return t;var n=t.objectType,i=t.indexType;if(Yd(i,c_(n,!1)))return 206===r.kind&&e.isAssignmentTarget(r)&&32&e.getObjectFlags(n)&&1&lc(n)&&In(r,e.Diagnostics.Index_signature_in_type_0_only_permits_reading,Ma(n)),t;var a=Ac(n);if(Gc(a,Ge)&&kb(i,296))return t;if(x_(n)){var o=f_(i,r);if(o){var s=nm(a,(function(e){return Jc(e,o)}));if(s&&24&e.getDeclarationModifierFlagsFromSymbol(s))return In(r,e.Diagnostics.Private_or_protected_member_0_cannot_be_accessed_on_a_type_parameter,e.unescapeLeadingUnderscores(o)),Me}}return In(r,e.Diagnostics.Type_0_cannot_be_used_to_index_type_1,Ma(i),Ma(n)),Me}function bx(t){return (e.hasEffectiveModifier(t,8)||e.isPrivateIdentifierClassElementDeclaration(t))&&!!(8388608&t.flags)}function xx(t,r){var n=e.getCombinedModifierFlags(t);return 257!==t.parent.kind&&256!==t.parent.kind&&225!==t.parent.kind&&8388608&t.flags&&(2&n||e.isModuleBlock(t.parent)&&e.isModuleDeclaration(t.parent.parent)&&e.isGlobalScopeAugmentation(t.parent.parent)||(n|=1),n|=2),n&r}function Dx(t){if(r){var i,a,o,s=0,c=155,l=!1,u=!0,_=!1,d=t.declarations,p=0!=(16384&t.flags),f=!1,g=!1,m=!1,y=[];if(d)for(var v=0,h=d;v<h.length;v++){var b=h[v],x=8388608&b.flags,D=b.parent&&(257===b.parent.kind||181===b.parent.kind)||x;if(D&&(o=void 0),256!==b.kind&&225!==b.kind||x||(m=!0),255===b.kind||168===b.kind||167===b.kind||170===b.kind){y.push(b);var S=xx(b,155);s|=S,c&=S,l=l||e.hasQuestionToken(b),u=u&&e.hasQuestionToken(b);var T=e.nodeIsPresent(b.body);T&&i?p?g=!0:f=!0:(null==o?void 0:o.parent)===b.parent&&o.end!==b.pos&&R(o),T?i||(i=b):_=!0,o=b,D||(a=b);}}if(g&&e.forEach(y,(function(t){In(t,e.Diagnostics.Multiple_constructor_implementations_are_not_allowed);})),f&&e.forEach(y,(function(t){In(e.getNameOfDeclaration(t)||t,e.Diagnostics.Duplicate_function_implementation);})),m&&!p&&16&t.flags&&d){var C=e.filter(d,(function(e){return 256===e.kind})).map((function(t){return e.createDiagnosticForNode(t,e.Diagnostics.Consider_adding_a_declare_modifier_to_this_class)}));e.forEach(d,(function(r){var i=256===r.kind?e.Diagnostics.Class_declaration_cannot_implement_overload_list_for_0:255===r.kind?e.Diagnostics.Function_with_bodies_can_only_merge_with_classes_that_are_ambient:void 0;i&&e.addRelatedInfo.apply(void 0,n$3([In(e.getNameOfDeclaration(r)||r,i,e.symbolName(t))],C,!1));}));}if(!a||a.body||e.hasSyntacticModifier(a,128)||a.questionToken||R(a),_&&(d&&(function(t,r,n,i,a){if(0!=(i^a)){var o=xx(L(t,r),155);e.forEach(t,(function(t){var r=xx(t,155)^o;1&r?In(e.getNameOfDeclaration(t),e.Diagnostics.Overload_signatures_must_all_be_exported_or_non_exported):2&r?In(e.getNameOfDeclaration(t),e.Diagnostics.Overload_signatures_must_all_be_ambient_or_non_ambient):24&r?In(e.getNameOfDeclaration(t)||t,e.Diagnostics.Overload_signatures_must_all_be_public_private_or_protected):128&r&&In(e.getNameOfDeclaration(t),e.Diagnostics.Overload_signatures_must_all_be_abstract_or_non_abstract);}));}}(d,i,0,s,c),function(t,r,n,i){if(n!==i){var a=e.hasQuestionToken(L(t,r));e.forEach(t,(function(t){e.hasQuestionToken(t)!==a&&In(e.getNameOfDeclaration(t),e.Diagnostics.Overload_signatures_must_all_be_optional_or_required);}));}}(d,i,l,u)),i))for(var E=_l(t),k=cl(i),N=0,F=E;N<F.length;N++){var A=F[N];if(P=A,w=void 0,I=void 0,O=void 0,M=void 0,w=Sl(k),I=Sl(P),O=ml(w),(M=ml(I))!==rt&&!hp(M,O,Dn)&&!hp(O,M,Dn)||0===dp(w,I,4,!1,void 0,void 0,Gd,void 0)){e.addRelatedInfo(In(A.declaration,e.Diagnostics.This_overload_signature_is_not_compatible_with_its_implementation_signature),e.createDiagnosticForNode(i,e.Diagnostics.The_implementation_signature_is_declared_here));break}}}var P,w,I,O,M;function L(e,t){return void 0!==t&&t.parent===e[0].parent?t:e[0]}function R(t){if(!t.name||!e.nodeIsMissing(t.name)){var r=!1,n=e.forEachChild(t.parent,(function(e){if(r)return e;r=e===t;}));if(n&&n.pos===t.end&&n.kind===t.kind){var i=n.name||n,a=n.name;if(t.name&&a&&(e.isPrivateIdentifier(t.name)&&e.isPrivateIdentifier(a)&&t.name.escapedText===a.escapedText||e.isComputedPropertyName(t.name)&&e.isComputedPropertyName(a)||e.isPropertyNameLiteral(t.name)&&e.isPropertyNameLiteral(a)&&e.getEscapedTextOfIdentifierOrLiteral(t.name)===e.getEscapedTextOfIdentifierOrLiteral(a)))return void(168!==t.kind&&167!==t.kind||e.isStatic(t)===e.isStatic(n)||In(i,e.isStatic(t)?e.Diagnostics.Function_overload_must_be_static:e.Diagnostics.Function_overload_must_not_be_static));if(e.nodeIsPresent(n.body))return void In(i,e.Diagnostics.Function_implementation_name_must_be_0,e.declarationNameToString(t.name))}var o=t.name||t;p?In(o,e.Diagnostics.Constructor_implementation_is_missing):e.hasSyntacticModifier(t,128)?In(o,e.Diagnostics.All_declarations_of_an_abstract_method_must_be_consecutive):In(o,e.Diagnostics.Function_implementation_is_missing_or_not_immediately_following_the_declaration);}}}function Sx(t){if(r){var n=t.localSymbol;if((n||(n=$i(t)).exportSymbol)&&e.getDeclarationOfKind(n,t.kind)===t){for(var i=0,a=0,o=0,s=0,c=n.declarations;s<c.length;s++){var l=y(g=c[s]),u=xx(g,513);1&u?512&u?o|=l:i|=l:a|=l;}var _=i&a,d=o&(i|a);if(_||d)for(var p=0,f=n.declarations;p<f.length;p++){l=y(g=f[p]);var g,m=e.getNameOfDeclaration(g);l&d?In(m,e.Diagnostics.Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_default_0_declaration_instead,e.declarationNameToString(m)):l&_&&In(m,e.Diagnostics.Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local,e.declarationNameToString(m));}}}function y(t){var r=t;switch(r.kind){case 257:case 258:case 343:case 336:case 337:return 2;case 260:return e.isAmbientModule(r)||0!==e.getModuleInstanceState(r)?5:4;case 256:case 259:case 297:return 3;case 303:return 7;case 270:case 220:var n=r,i=e.isExportAssignment(n)?n.expression:n.right;if(!e.isEntityNameExpression(i))return 1;r=i;case 264:case 267:case 266:var a=0,o=ki($i(r));return e.forEach(o.declarations,(function(e){a|=y(e);})),a;case 253:case 202:case 255:case 269:case 79:return 1;default:return e.Debug.failBadSyntaxKind(r)}}}function Tx(e,t,r,n){var i=Cx(e,t);return i&&Ax(i,t,r,n)}function Cx(t,r){if(!to(t)){var n=t;if(n.promisedTypeOfPromise)return n.promisedTypeOfPromise;if(Vo(t,mu(!1)))return n.promisedTypeOfPromise=zl(t)[0];if(!Nb(t,262140)){var i=eo(t,"then");if(!to(i)){var a=i?Uc(i,0):e.emptyArray;if(0!==a.length){var o=Jg(qu(e.map(a,nb)),2097152);if(!to(o)){var s=Uc(o,0);if(0!==s.length)return n.promisedTypeOfPromise=qu(e.map(s,nb),2);r&&In(r,e.Diagnostics.The_first_parameter_of_the_then_method_of_a_promise_must_be_a_callback);}}else r&&In(r,e.Diagnostics.A_promise_must_have_a_then_method);}}}}function Ex(e,t,r,n,i){return (t?Ax(e,r,n,i):Px(e,r,n,i))||Me}function kx(e){if(Nb(e,262140))return !1;var t=eo(e,"then");return !!t&&Uc(Jg(t,2097152),0).length>0}function Nx(e){var t;if(16777216&e.flags){var r=xu(!1);return !!r&&e.aliasSymbol===r&&1===(null===(t=e.aliasTypeArguments)||void 0===t?void 0:t.length)}return !1}function Fx(e){return 1048576&e.flags?lm(e,Fx):Nx(e)?e.aliasTypeArguments[0]:e}function Ax(t,r,n,i){var a=Px(t,r,n,i);return a&&function(t){if(to(t))return t;if(Nx(t))return t;if(x_(t)){var r=Tc(t);if(!r||3&r.flags||fp(r)||kx(r)){var n=xu(!0);if(n)return Vl(n,[Fx(t)])}}return e.Debug.assert(void 0===Cx(t),"type provided should not be a non-generic 'promise'-like."),t}(a)}function Px(t,r,n,i){if(to(t))return t;if(Nx(t))return t;var a=t;if(a.awaitedTypeOfType)return a.awaitedTypeOfType;if(1048576&t.flags){var o=r?function(e){return Px(e,r,n,i)}:Px;return a.awaitedTypeOfType=lm(t,o)}var s=Cx(t);if(s){if(t.id===s.id||gn.lastIndexOf(s.id)>=0)return void(r&&In(r,e.Diagnostics.Type_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method));gn.push(t.id);var c=Px(s,r,n,i);if(gn.pop(),!c)return;return a.awaitedTypeOfType=c}if(!kx(t))return a.awaitedTypeOfType=t;r&&(e.Debug.assertIsDefined(n),In(r,n,i));}function wx(t){var r=Nh(t);wh(r,t);var n=ml(r);if(!(1&n.flags)){var i,a,o=Th(t);switch(t.parent.kind){case 256:i=qu([Uo($i(t.parent)),rt]);break;case 163:i=rt,a=e.chainDiagnosticMessages(void 0,e.Diagnostics.The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any);break;case 166:i=rt,a=e.chainDiagnosticMessages(void 0,e.Diagnostics.The_return_type_of_a_property_decorator_function_must_be_either_void_or_any);break;case 168:case 171:case 172:i=qu([Su(LS(t.parent)),rt]);break;default:return e.Debug.fail()}tp(n,i,t,o,(function(){return a}));}}function Ix(t){if(t){var r=e.getFirstIdentifier(t),n=2097152|(79===t.kind?788968:1920),i=ei(r,r.escapedText,n,void 0,void 0,!0);i&&2097152&i.flags&&oa(i)&&!$S(ki(i))&&!Ai(i)&&wi(i);}}function Ox(t){var r=Mx(t);r&&e.isEntityName(r)&&Ix(r);}function Mx(e){if(e)switch(e.kind){case 187:case 186:return Lx(e.types);case 188:return Lx([e.trueType,e.falseType]);case 190:case 196:return Mx(e.type);case 177:return e.typeName}}function Lx(t){for(var r,n=0,i=t;n<i.length;n++){for(var a=i[n];190===a.kind||196===a.kind;)a=a.type;if(143!==a.kind&&(H||(195!==a.kind||104!==a.literal.kind)&&152!==a.kind)){var o=Mx(a);if(!o)return;if(r){if(!e.isIdentifier(r)||!e.isIdentifier(o)||r.escapedText!==o.escapedText)return}else r=o;}}return r}function Rx(t){var r=e.getEffectiveTypeAnnotationNode(t);return e.isRestParameter(t)?e.getRestParameterElementType(r):r}function Bx(t){if(t.decorators&&e.nodeCanBeDecorated(t,t.parent,t.parent.parent)){U.experimentalDecorators||In(t,e.Diagnostics.Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_in_your_tsconfig_or_jsconfig_to_remove_this_warning);var r=t.decorators[0];if(ST(r,8),163===t.kind&&ST(r,32),U.emitDecoratorMetadata)switch(ST(r,16),t.kind){case 256:var n=e.getFirstConstructorWithBody(t);if(n)for(var i=0,a=n.parameters;i<a.length;i++)Ox(Rx(a[i]));break;case 171:case 172:var o=171===t.kind?172:171,s=e.getDeclarationOfKind($i(t),o);Ox(Io(t)||s&&Io(s));break;case 168:for(var c=0,l=t.parameters;c<l.length;c++)Ox(Rx(l[c]));Ox(e.getEffectiveReturnTypeNode(t));break;case 166:Ox(e.getEffectiveTypeAnnotationNode(t));break;case 163:Ox(Rx(t));for(var u=0,_=t.parent.parameters;u<_.length;u++)Ox(Rx(_[u]));}e.forEach(t.decorators,wx);}}function jx(e){switch(e.kind){case 79:return e;case 205:return e.name;default:return}}function Jx(t){var n;Bx(t),lx(t);var i=e.getFunctionFlags(t);if(t.name&&161===t.name.kind&&Ny(t.name),As(t)){var a=$i(t),o=t.localSymbol||a,s=null===(n=o.declarations)||void 0===n?void 0:n.find((function(e){return e.kind===t.kind&&!(131072&e.flags)}));t===s&&Dx(o),a.parent&&Dx(a);}var c=167===t.kind?void 0:t.body;if(hS(c),vb(t,yl(t)),r&&!e.getEffectiveReturnTypeNode(t)&&(e.nodeIsMissing(c)&&!bx(t)&&Uf(t,we),1&i&&e.nodeIsPresent(c)&&ml(cl(t))),e.isInJSFile(t)){var l=e.getJSDocTypeTag(t);l&&l.typeExpression&&!by(dd(l.typeExpression),t)&&In(l.typeExpression.type,e.Diagnostics.The_type_of_a_function_declaration_must_match_the_function_s_signature);}}function zx(t){if(r){var n=e.getSourceFileOfNode(t),i=Jr.get(n.path);i||(i=[],Jr.set(n.path,i)),i.push(t);}}function Ux(t,r){for(var n=0,i=t;n<i.length;n++){var a=i[n];switch(a.kind){case 256:case 225:qx(a,r),Hx(a,r);break;case 303:case 260:case 234:case 262:case 241:case 242:case 243:Zx(a,r);break;case 170:case 212:case 255:case 213:case 168:case 171:case 172:a.body&&Zx(a,r),Hx(a,r);break;case 167:case 173:case 174:case 178:case 179:case 258:case 257:Hx(a,r);break;case 189:Wx(a,r);break;default:e.Debug.assertNever(a,"Node should not have been registered for unused identifiers check");}}}function Kx(t,r,n){var i=e.getNameOfDeclaration(t)||t,a=NS(t)?e.Diagnostics._0_is_declared_but_never_used:e.Diagnostics._0_is_declared_but_its_value_is_never_read;n(t,0,e.createDiagnosticForNode(i,a,r));}function Vx(t){return e.isIdentifier(t)&&95===e.idText(t).charCodeAt(0)}function qx(t,r){for(var n=0,i=t.members;n<i.length;n++){var a=i[n];switch(a.kind){case 168:case 166:case 171:case 172:if(172===a.kind&&32768&a.symbol.flags)break;var o=$i(a);o.isReferenced||!(e.hasEffectiveModifier(a,8)||e.isNamedDeclaration(a)&&e.isPrivateIdentifier(a.name))||8388608&a.flags||r(a,0,e.createDiagnosticForNode(a.name,e.Diagnostics._0_is_declared_but_its_value_is_never_read,Ia(o)));break;case 170:for(var s=0,c=a.parameters;s<c.length;s++){var l=c[s];!l.symbol.isReferenced&&e.hasSyntacticModifier(l,8)&&r(l,0,e.createDiagnosticForNode(l.name,e.Diagnostics.Property_0_is_declared_but_its_value_is_never_read,e.symbolName(l.symbol)));}break;case 175:case 233:case 169:break;default:e.Debug.fail("Unexpected class member");}}}function Wx(t,r){var n=t.typeParameter;Gx(n)&&r(t,1,e.createDiagnosticForNode(t,e.Diagnostics._0_is_declared_but_its_value_is_never_read,e.idText(n.name)));}function Hx(t,r){var n=$i(t).declarations;if(n&&e.last(n)===t)for(var i=e.getEffectiveTypeParameterDeclarations(t),a=new e.Set,o=0,s=i;o<s.length;o++){var c=s[o];if(Gx(c)){var l=e.idText(c.name),u=c.parent;if(189!==u.kind&&u.typeParameters.every(Gx)){if(e.tryAddToSet(a,u)){var _=e.getSourceFileOfNode(u),d=e.isJSDocTemplateTag(u)?e.rangeOfNode(u):e.rangeOfTypeParameters(_,u.typeParameters),p=1===u.typeParameters.length,f=p?e.Diagnostics._0_is_declared_but_its_value_is_never_read:e.Diagnostics.All_type_parameters_are_unused,g=p?l:void 0;r(c,1,e.createFileDiagnostic(_,d.pos,d.end-d.pos,f,g));}}else r(c,1,e.createDiagnosticForNode(c,e.Diagnostics._0_is_declared_but_its_value_is_never_read,l));}}}function Gx(e){return !(262144&Zi(e.symbol).isReferenced||Vx(e.name))}function Qx(e,t,r,n){var i=String(n(t)),a=e.get(i);a?a[1].push(r):e.set(i,[t,[r]]);}function Xx(t){return e.tryCast(e.getRootDeclaration(t),e.isParameter)}function Yx(t){return e.isBindingElement(t)?e.isObjectBindingPattern(t.parent)?!(!t.propertyName||!Vx(t.name)):Vx(t.name):e.isAmbientModule(t)||(e.isVariableDeclaration(t)&&e.isForInOrOfStatement(t.parent.parent)||eD(t))&&Vx(t.name)}function Zx(t,r){var n=new e.Map,i=new e.Map,a=new e.Map;t.locals.forEach((function(t){var o;if(!(262144&t.flags?!(3&t.flags)||3&t.isReferenced:t.isReferenced||t.exportSymbol)&&t.declarations)for(var s=0,c=t.declarations;s<c.length;s++){var l=c[s];if(!Yx(l))if(eD(l))Qx(n,266===(o=l).kind?o:267===o.kind?o.parent:o.parent.parent,l,O);else if(e.isBindingElement(l)&&e.isObjectBindingPattern(l.parent))l!==e.last(l.parent.elements)&&e.last(l.parent.elements).dotDotDotToken||Qx(i,l.parent,l,O);else if(e.isVariableDeclaration(l))Qx(a,l.parent,l,O);else {var u=t.valueDeclaration&&Xx(t.valueDeclaration),_=t.valueDeclaration&&e.getNameOfDeclaration(t.valueDeclaration);u&&_?e.isParameterPropertyDeclaration(u,u.parent)||e.parameterIsThisKeyword(u)||Vx(_)||(e.isBindingElement(l)&&e.isArrayBindingPattern(l.parent)?Qx(i,l.parent,l,O):r(u,1,e.createDiagnosticForNode(_,e.Diagnostics._0_is_declared_but_its_value_is_never_read,e.symbolName(t)))):Kx(l,e.symbolName(t),r);}}})),n.forEach((function(t){var n=t[0],i=t[1],a=n.parent;if((n.name?1:0)+(n.namedBindings?267===n.namedBindings.kind?1:n.namedBindings.elements.length:0)===i.length)r(a,0,1===i.length?e.createDiagnosticForNode(a,e.Diagnostics._0_is_declared_but_its_value_is_never_read,e.idText(e.first(i).name)):e.createDiagnosticForNode(a,e.Diagnostics.All_imports_in_import_declaration_are_unused));else for(var o=0,s=i;o<s.length;o++){var c=s[o];Kx(c,e.idText(c.name),r);}})),i.forEach((function(t){var n=t[0],i=t[1],o=Xx(n.parent)?1:0;if(n.elements.length===i.length)1===i.length&&253===n.parent.kind&&254===n.parent.parent.kind?Qx(a,n.parent.parent,n.parent,O):r(n,o,1===i.length?e.createDiagnosticForNode(n,e.Diagnostics._0_is_declared_but_its_value_is_never_read,$x(e.first(i).name)):e.createDiagnosticForNode(n,e.Diagnostics.All_destructured_elements_are_unused));else for(var s=0,c=i;s<c.length;s++){var l=c[s];r(l,o,e.createDiagnosticForNode(l,e.Diagnostics._0_is_declared_but_its_value_is_never_read,$x(l.name)));}})),a.forEach((function(t){var n=t[0],i=t[1];if(n.declarations.length===i.length)r(n,0,1===i.length?e.createDiagnosticForNode(e.first(i).name,e.Diagnostics._0_is_declared_but_its_value_is_never_read,$x(e.first(i).name)):e.createDiagnosticForNode(236===n.parent.kind?n.parent:n,e.Diagnostics.All_variables_are_unused));else for(var a=0,o=i;a<o.length;a++){var s=o[a];r(s,0,e.createDiagnosticForNode(s,e.Diagnostics._0_is_declared_but_its_value_is_never_read,$x(s.name)));}}));}function $x(t){switch(t.kind){case 79:return e.idText(t);case 201:case 200:return $x(e.cast(e.first(t.elements),e.isBindingElement).name);default:return e.Debug.assertNever(t)}}function eD(e){return 266===e.kind||269===e.kind||267===e.kind}function tD(t){if(234===t.kind&&$T(t),e.isFunctionOrModuleBlock(t)){var r=Vr;e.forEach(t.statements,hS),Vr=r;}else e.forEach(t.statements,hS);t.locals&&zx(t);}function rD(t,r,n){if((null==r?void 0:r.escapedText)!==n)return !1;if(166===t.kind||165===t.kind||168===t.kind||167===t.kind||171===t.kind||172===t.kind||294===t.kind)return !1;if(8388608&t.flags)return !1;if((e.isImportClause(t)||e.isImportEqualsDeclaration(t)||e.isImportSpecifier(t))&&e.isTypeOnlyImportOrExportDeclaration(t))return !1;var i=e.getRootDeclaration(t);return !e.isParameter(i)||!e.nodeIsMissing(i.parent.body)}function nD(t){e.findAncestor(t,(function(r){return !!(4&oT(r))&&(79!==t.kind?In(e.getNameOfDeclaration(t),e.Diagnostics.Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference):In(t,e.Diagnostics.Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference),!0)}));}function iD(t){e.findAncestor(t,(function(r){return !!(8&oT(r))&&(79!==t.kind?In(e.getNameOfDeclaration(t),e.Diagnostics.Duplicate_identifier_newTarget_Compiler_uses_variable_declaration_newTarget_to_capture_new_target_meta_property_reference):In(t,e.Diagnostics.Expression_resolves_to_variable_declaration_newTarget_that_compiler_uses_to_capture_new_target_meta_property_reference),!0)}));}function aD(t){67108864&oT(e.getEnclosingBlockScopeContainer(t))&&(e.Debug.assert(e.isNamedDeclaration(t)&&e.isIdentifier(t.name)&&"string"==typeof t.name.escapedText,"The target of a WeakMap/WeakSet collision check should be an identifier"),Pn("noEmit",t,e.Diagnostics.Compiler_reserves_name_0_when_emitting_private_identifier_downlevel,t.name.escapedText));}function oD(t){var r=!1;if(e.isClassExpression(t)){for(var n=0,i=t.members;n<i.length;n++)if(134217728&oT(i[n])){r=!0;break}}else if(e.isFunctionExpression(t))134217728&oT(t)&&(r=!0);else {var a=e.getEnclosingBlockScopeContainer(t);a&&134217728&oT(a)&&(r=!0);}r&&(e.Debug.assert(e.isNamedDeclaration(t)&&e.isIdentifier(t.name),"The target of a Reflect collision check should be an identifier"),Pn("noEmit",t,e.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_when_emitting_super_references_in_static_initializers,e.declarationNameToString(t.name),"Reflect"));}function sD(t,r){r&&(function(t,r){if((!(V>=e.ModuleKind.ES2015)||V>=e.ModuleKind.Node12&&e.getSourceFileOfNode(t).impliedNodeFormat===e.ModuleKind.CommonJS)&&r&&(rD(t,r,"require")||rD(t,r,"exports"))&&(!e.isModuleDeclaration(t)||1===e.getModuleInstanceState(t))){var n=$a(t);303===n.kind&&e.isExternalOrCommonJsModule(n)&&Pn("noEmit",r,e.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module,e.declarationNameToString(r),e.declarationNameToString(r));}}(t,r),function(t,r){if(r&&!(K>=4)&&rD(t,r,"Promise")&&(!e.isModuleDeclaration(t)||1===e.getModuleInstanceState(t))){var n=$a(t);303===n.kind&&e.isExternalOrCommonJsModule(n)&&2048&n.flags&&Pn("noEmit",r,e.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_containing_async_functions,e.declarationNameToString(r),e.declarationNameToString(r));}}(t,r),function(e,t){K<=8&&(rD(e,t,"WeakMap")||rD(e,t,"WeakSet"))&&pn.push(e);}(t,r),function(e,t){t&&K>=2&&K<=8&&rD(e,t,"Reflect")&&fn.push(e);}(t,r),e.isClassLike(t)?(GD(r,e.Diagnostics.Class_name_cannot_be_0),8388608&t.flags||function(t){K>=1&&"Object"===t.escapedText&&(V<e.ModuleKind.ES2015||e.getSourceFileOfNode(t).impliedNodeFormat===e.ModuleKind.CommonJS)&&In(t,e.Diagnostics.Class_name_cannot_be_Object_when_targeting_ES5_with_module_0,e.ModuleKind[V]);}(r)):e.isEnumDeclaration(t)&&GD(r,e.Diagnostics.Enum_name_cannot_be_0));}function cD(e){return e===Ie?we:e===Kt?Ut:e}function lD(t){var r;if(Bx(t),e.isBindingElement(t)||hS(t.type),t.name){if(161===t.name.kind&&(Ny(t.name),t.initializer&&zb(t.initializer)),e.isBindingElement(t)){e.isObjectBindingPattern(t.parent)&&t.dotDotDotToken&&K<5&&ST(t,4),t.propertyName&&161===t.propertyName.kind&&Ny(t.propertyName);var n=t.parent.parent,i=no(n),a=t.propertyName||t.name;if(i&&!e.isBindingPattern(a)){var o=i_(a);if(Es(o)){var s=Jc(i,Ps(o));s&&(Iv(s,void 0,!1),tv(t,!!n.initializer&&106===n.initializer.kind,!1,i,s));}}}if(e.isBindingPattern(t.name)&&(201===t.name.kind&&K<2&&U.downlevelIteration&&ST(t,512),e.forEach(t.name.elements,hS)),t.initializer&&e.isParameterDeclaration(t)&&e.nodeIsMissing(e.getContainingFunction(t).body))In(t,e.Diagnostics.A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation);else if(e.isBindingPattern(t.name)){var c=t.initializer&&242!==t.parent.parent.kind,l=0===t.name.elements.length;if(c||l){var u=Fo(t);if(c){var _=zb(t.initializer);H&&l?_v(_,t):rp(_,Fo(t),t,t.initializer);}l&&(e.isArrayBindingPattern(t.name)?hD(65,u,ze,t):H&&_v(u,t));}}else {var d=$i(t);if(2097152&d.flags&&e.isRequireVariableDeclaration(t))uS(t);else {var p=cD(Uo(d));if(t===d.valueDeclaration){var f=e.getEffectiveInitializer(t);f&&(e.isInJSFile(t)&&e.isObjectLiteralExpression(f)&&(0===f.properties.length||e.isPrototypeAccess(t.name))&&(null===(r=d.exports)||void 0===r?void 0:r.size)||242===t.parent.parent.kind||rp(zb(f),p,t,f,void 0)),d.declarations&&d.declarations.length>1&&e.some(d.declarations,(function(r){return r!==t&&e.isVariableLike(r)&&!_D(r,t)}))&&In(t.name,e.Diagnostics.All_declarations_of_0_must_have_identical_modifiers,e.declarationNameToString(t.name));}else {var g=cD(Fo(t));ro(p)||ro(g)||Wd(p,g)||67108864&d.flags||uD(d.valueDeclaration,p,t,g),t.initializer&&rp(zb(t.initializer),g,t,t.initializer,void 0),d.valueDeclaration&&!_D(t,d.valueDeclaration)&&In(t.name,e.Diagnostics.All_declarations_of_0_must_have_identical_modifiers,e.declarationNameToString(t.name));}166!==t.kind&&165!==t.kind&&(Sx(t),253!==t.kind&&202!==t.kind||function(t){if(0==(3&e.getCombinedNodeFlags(t))&&!e.isParameterDeclaration(t)&&(253!==t.kind||t.initializer)){var r=$i(t);if(1&r.flags){if(!e.isIdentifier(t.name))return e.Debug.fail();var n=ei(t,t.name.escapedText,3,void 0,void 0,!1);if(n&&n!==r&&2&n.flags&&3&$y(n)){var i=e.getAncestor(n.valueDeclaration,254),a=236===i.parent.kind&&i.parent.parent?i.parent.parent:void 0;if(!a||!(234===a.kind&&e.isFunctionLike(a.parent)||261===a.kind||260===a.kind||303===a.kind)){var o=Ia(n);In(t,e.Diagnostics.Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1,o,o);}}}}}(t),sD(t,t.name));}}}}function uD(t,r,n,i){var a=e.getNameOfDeclaration(n),o=166===n.kind||165===n.kind?e.Diagnostics.Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_type_2:e.Diagnostics.Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2,s=e.declarationNameToString(a),c=In(a,o,s,Ma(r),Ma(i));t&&e.addRelatedInfo(c,e.createDiagnosticForNode(t,e.Diagnostics._0_was_also_declared_here,s));}function _D(t,r){return 163===t.kind&&253===r.kind||253===t.kind&&163===r.kind||e.hasQuestionToken(t)===e.hasQuestionToken(r)&&e.getSelectedEffectiveModifierFlags(t,504)===e.getSelectedEffectiveModifierFlags(r,504)}function dD(t){null===e.tracing||void 0===e.tracing||e.tracing.push("check","checkVariableDeclaration",{kind:t.kind,pos:t.pos,end:t.end}),function(t){if(242!==t.parent.parent.kind&&243!==t.parent.parent.kind)if(8388608&t.flags)KT(t);else if(!t.initializer){if(e.isBindingPattern(t.name)&&!e.isBindingPattern(t.parent))return YT(t,e.Diagnostics.A_destructuring_declaration_must_have_an_initializer);if(e.isVarConst(t))return YT(t,e.Diagnostics.const_declarations_must_be_initialized)}if(t.exclamationToken&&(236!==t.parent.parent.kind||!t.type||t.initializer||8388608&t.flags)){var r=t.initializer?e.Diagnostics.Declarations_with_initializers_cannot_also_have_definite_assignment_assertions:t.type?e.Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context:e.Diagnostics.Declarations_with_definite_assignment_assertions_must_also_have_type_annotations;return YT(t.exclamationToken,r)}!(V<e.ModuleKind.ES2015||e.getSourceFileOfNode(t).impliedNodeFormat===e.ModuleKind.CommonJS)||V===e.ModuleKind.System||8388608&t.parent.parent.flags||!e.hasSyntacticModifier(t.parent.parent,1)||VT(t.name),(e.isLet(t)||e.isVarConst(t))&&qT(t.name);}(t),lD(t),null===e.tracing||void 0===e.tracing||e.tracing.pop();}function pD(t){CT(t)||WT(t.declarationList)||function(t){if(!HT(t.parent)){if(e.isLet(t.declarationList))return YT(t,e.Diagnostics.let_declarations_can_only_be_declared_inside_a_block);e.isVarConst(t.declarationList)&&YT(t,e.Diagnostics.const_declarations_can_only_be_declared_inside_a_block);}}(t),e.forEach(t.declarationList.declarations,hS);}function fD(t,r,n){if(H&&!vf(r)){var i=e.isBinaryExpression(t)?t.right:t;if(!e.isPropertyAccessExpression(i)||!Ub(i.expression)){var a=e.isIdentifier(i)?i:e.isPropertyAccessExpression(i)?i.name:e.isBinaryExpression(i)&&e.isIdentifier(i.right)?i.right:void 0,o=Uc(r,0),s=!!Tx(r);if(0!==o.length||s){var c=a&&MS(a);(c||s)&&(c&&e.isBinaryExpression(t.parent)&&function(t,r){for(;e.isBinaryExpression(t)&&55===t.operatorToken.kind;){if(e.forEachChild(t.right,(function t(n){if(e.isIdentifier(n)){var i=MS(n);if(i&&i===r)return !0}return e.forEachChild(n,t)})))return !0;t=t.parent;}return !1}(t.parent,c)||c&&n&&function(t,r,n,i){return !!e.forEachChild(r,(function r(a){if(e.isIdentifier(a)){var o=MS(a);if(o&&o===i){if(e.isIdentifier(t))return !0;for(var s=n.parent,c=a.parent;s&&c;){if(e.isIdentifier(s)&&e.isIdentifier(c)||108===s.kind&&108===c.kind)return MS(s)===MS(c);if(e.isPropertyAccessExpression(s)&&e.isPropertyAccessExpression(c)){if(MS(s.name)!==MS(c.name))return !1;c=c.expression,s=s.expression;}else {if(!e.isCallExpression(s)||!e.isCallExpression(c))return !1;c=c.expression,s=s.expression;}}}}return e.forEachChild(a,r)}))}(t,n,a,c)||(s?Ln(i,!0,e.Diagnostics.This_condition_will_always_return_true_since_this_0_is_always_defined,Ra(r)):In(i,e.Diagnostics.This_condition_will_always_return_true_since_this_function_is_always_defined_Did_you_mean_to_call_it_instead)));}}}}function gD(t,r){return 16384&t.flags&&In(r,e.Diagnostics.An_expression_of_type_void_cannot_be_tested_for_truthiness),t}function mD(e,t){return gD(ax(e,t),e)}function yD(e){var t=e.initializer;t.declarations.length>=1&&dD(t.declarations[0]);}function vD(e){return hD(e.awaitModifier?15:13,iv(e.expression),ze,e.expression)}function hD(e,t,r,n){return to(t)?t:bD(e,t,r,n,!0)||we}function bD(t,r,n,i,a){var o=0!=(2&t);if(r!==nt){var s=K>=2,c=!s&&U.downlevelIteration,l=U.noUncheckedIndexedAccess&&!!(128&t);if(s||c||o){var u=ED(r,t,s?i:void 0);if(a&&u){var _=8&t?e.Diagnostics.Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_for_of_will_always_send_0:32&t?e.Diagnostics.Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_array_spread_will_always_send_0:64&t?e.Diagnostics.Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_array_destructuring_will_always_send_0:16&t?e.Diagnostics.Cannot_delegate_iteration_to_value_because_the_next_method_of_its_iterator_expects_type_1_but_the_containing_generator_will_always_send_0:void 0;_&&tp(n,u.nextType,i,_);}if(u||s)return l?Vg(u&&u.yieldType):u&&u.yieldType}var d=r,p=!1,f=!1;if(4&t){if(1048576&d.flags){var g=r.types,m=e.filter(g,(function(e){return !(402653316&e.flags)}));m!==g&&(d=qu(m,2));}else 402653316&d.flags&&(d=nt);if((f=d!==r)&&(K<1&&i&&(In(i,e.Diagnostics.Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher),p=!0),131072&d.flags))return l?Vg(He):He}if(!Qp(d)){if(i&&!p){var y=function(n,i){var a;return i?n?[e.Diagnostics.Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator,!0]:[e.Diagnostics.Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator,!0]:xD(t,0,r,void 0)?[e.Diagnostics.Type_0_is_not_an_array_type_or_a_string_type_Use_compiler_option_downlevelIteration_to_allow_iterating_of_iterators,!1]:function(e){switch(e){case"Float32Array":case"Float64Array":case"Int16Array":case"Int32Array":case"Int8Array":case"NodeList":case"Uint16Array":case"Uint32Array":case"Uint8Array":case"Uint8ClampedArray":return !0}return !1}(null===(a=r.symbol)||void 0===a?void 0:a.escapedName)?[e.Diagnostics.Type_0_can_only_be_iterated_through_when_using_the_downlevelIteration_flag_or_with_a_target_of_es2015_or_higher,!0]:n?[e.Diagnostics.Type_0_is_not_an_array_type_or_a_string_type,!0]:[e.Diagnostics.Type_0_is_not_an_array_type,!0]}(!!(4&t)&&!f,c),v=y[0];Ln(i,y[1]&&!!Tx(d),v,Ma(d));}return f?l?Vg(He):He:void 0}var h=Qc(d,Ge);return f&&h?402653316&h.flags&&!U.noUncheckedIndexedAccess?He:qu(l?[h,He,ze]:[h,He],2):128&t?Vg(h):h}ID(i,r,o);}function xD(e,t,r,n){if(!to(r)){var i=ED(r,e,n);return i&&i[j(t)]}}function DD(e,t,r){if(void 0===e&&(e=nt),void 0===t&&(t=nt),void 0===r&&(r=je),67359327&e.flags&&180227&t.flags&&180227&r.flags){var n=Ml([e,t,r]),i=Pr.get(n);return i||(i={yieldType:e,returnType:t,nextType:r},Pr.set(n,i)),i}return {yieldType:e,returnType:t,nextType:r}}function SD(t){for(var r,n,i,a=0,o=t;a<o.length;a++){var s=o[a];if(void 0!==s&&s!==wr){if(s===Ir)return Ir;r=e.append(r,s.yieldType),n=e.append(n,s.returnType),i=e.append(i,s.nextType);}}return r||n||i?DD(r&&qu(r),n&&qu(n),i&&$u(i)):wr}function TD(e,t){return e[t]}function CD(e,t,r){return e[t]=r}function ED(t,r,n){if(to(t))return Ir;if(!(1048576&t.flags)){var i=ND(t,r,n);return i===wr?void(n&&ID(n,t,!!(2&r))):i}var a,o=2&r?"iterationTypesOfAsyncIterable":"iterationTypesOfIterable",s=TD(t,o);if(s)return s===wr?void 0:s;for(var c=0,l=t.types;c<l.length;c++){var u=ND(l[c],r,n);if(u===wr)return n&&ID(n,t,!!(2&r)),void CD(t,o,wr);a=e.append(a,u);}var _=a?SD(a):wr;return CD(t,o,_),_===wr?void 0:_}function kD(e,t){if(e===wr)return wr;if(e===Ir)return Ir;var r=e.yieldType,n=e.returnType,i=e.nextType;return t&&xu(!0),DD(Ax(r,t)||we,Ax(n,t)||we,i)}function ND(e,t,r){if(to(e))return Ir;var n;if(2&t&&(n=FD(e,Lr)||PD(e,Lr)))return 8&t?kD(n,r):n;if(1&t&&(n=FD(e,Rr)||PD(e,Rr))){if(!(2&t))return n;if(n!==wr)return CD(e,"iterationTypesOfAsyncIterable",kD(n,r))}return 2&t&&(n=wD(e,Lr,r))!==wr?n:1&t&&(n=wD(e,Rr,r))!==wr?2&t?CD(e,"iterationTypesOfAsyncIterable",n?kD(n,r):wr):n:wr}function FD(e,t){return TD(e,t.iterableCacheKey)}function AD(e,t){var r=FD(e,t)||wD(e,t,void 0);return r===wr?Mr:r}function PD(e,t){var r;if(Vo(e,r=t.getGlobalIterableType(!1))||Vo(e,r=t.getGlobalIterableIteratorType(!1))){var n=zl(e)[0],i=AD(r,t),a=i.returnType,o=i.nextType;return CD(e,t.iterableCacheKey,DD(t.resolveIterationType(n,void 0)||n,t.resolveIterationType(a,void 0)||a,o))}if(Vo(e,t.getGlobalGeneratorType(!1))){var s=zl(e);return n=s[0],a=s[1],o=s[2],CD(e,t.iterableCacheKey,DD(t.resolveIterationType(n,void 0)||n,t.resolveIterationType(a,void 0)||a,o))}}function wD(t,r,n){var i,a,o,s,c=Jc(t,(a=r.iteratorSymbolName,(s=(o=fu(!1))&&eo(Uo(o),e.escapeLeadingUnderscores(a)))&&Es(s)?Ps(s):"__@".concat(a))),l=!c||16777216&c.flags?void 0:Uo(c);if(to(l))return CD(t,r.iterableCacheKey,Ir);var u=l?Uc(l,0):void 0;if(!e.some(u))return CD(t,r.iterableCacheKey,wr);var _=null!==(i=OD($u(e.map(u,ml)),r,n))&&void 0!==i?i:wr;return CD(t,r.iterableCacheKey,_)}function ID(t,r,n){var i=n?e.Diagnostics.Type_0_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator:e.Diagnostics.Type_0_must_have_a_Symbol_iterator_method_that_returns_an_iterator;Ln(t,!!Tx(r),i,Ma(r));}function OD(e,t,r){if(to(e))return Ir;var n=MD(e,t)||function(e,t){var r=t.getGlobalIterableIteratorType(!1);if(Vo(e,r)){var n=zl(e)[0],i=MD(r,t)||JD(r,t,void 0),a=i===wr?Mr:i,o=a.returnType,s=a.nextType;return CD(e,t.iteratorCacheKey,DD(n,o,s))}if(Vo(e,t.getGlobalIteratorType(!1))||Vo(e,t.getGlobalGeneratorType(!1))){var c=zl(e);return n=c[0],o=c[1],s=c[2],CD(e,t.iteratorCacheKey,DD(n,o,s))}}(e,t)||JD(e,t,r);return n===wr?void 0:n}function MD(e,t){return TD(e,t.iteratorCacheKey)}function LD(e,t){var r=eo(e,"done")||Xe;return Yd(0===t?Xe:Ze,r)}function RD(e){return LD(e,0)}function BD(e){return LD(e,1)}function jD(t,r,n,i){var a,o,s,c,l=Jc(t,n);if(l||"next"===n){var u=!l||"next"===n&&16777216&l.flags?void 0:"next"===n?Uo(l):Jg(Uo(l),2097152);if(to(u))return "next"===n?Ir:Or;var _,d,p,f,g,m=u?Uc(u,0):e.emptyArray;if(0===m.length)return i&&In(i,"next"===n?r.mustHaveANextMethodDiagnostic:r.mustBeAMethodDiagnostic,n),"next"===n?Ir:void 0;if((null==u?void 0:u.symbol)&&1===m.length){var y=r.getGlobalGeneratorType(!1),v=r.getGlobalIteratorType(!1),h=(null===(o=null===(a=y.symbol)||void 0===a?void 0:a.members)||void 0===o?void 0:o.get(n))===u.symbol,b=!h&&(null===(c=null===(s=v.symbol)||void 0===s?void 0:s.members)||void 0===c?void 0:c.get(n))===u.symbol;if(h||b){var x=h?y:v,D=u.mapper;return DD(hd(x.typeParameters[0],D),hd(x.typeParameters[1],D),"next"===n?hd(x.typeParameters[2],D):void 0)}}for(var S=0,T=m;S<T.length;S++){var C=T[S];"throw"!==n&&e.some(C.parameters)&&(_=e.append(_,Qh(C,0))),d=e.append(d,ml(C));}if("throw"!==n){var E=_?qu(_):je;if("next"===n)f=E;else if("return"===n){var k=r.resolveIterationType(E,i)||we;p=e.append(p,k);}}var N=d?$u(d):nt,F=function(e){if(to(e))return Ir;var t=TD(e,"iterationTypesOfIteratorResult");if(t)return t;if(Vo(e,ir||(ir=_u("IteratorYieldResult",1,!1))||bt))return CD(e,"iterationTypesOfIteratorResult",DD(zl(e)[0],void 0,void 0));if(Vo(e,ar||(ar=_u("IteratorReturnResult",1,!1))||bt))return CD(e,"iterationTypesOfIteratorResult",DD(void 0,zl(e)[0],void 0));var r=om(e,RD),n=r!==nt?eo(r,"value"):void 0,i=om(e,BD),a=i!==nt?eo(i,"value"):void 0;return CD(e,"iterationTypesOfIteratorResult",n||a?DD(n,a||rt,void 0):wr)}(r.resolveIterationType(N,i)||we);return F===wr?(i&&In(i,r.mustHaveAValueDiagnostic,n),g=we,p=e.append(p,we)):(g=F.yieldType,p=e.append(p,F.returnType)),DD(g,qu(p),f)}}function JD(e,t,r){var n=SD([jD(e,t,"next",r),jD(e,t,"return",r),jD(e,t,"throw",r)]);return CD(e,t.iteratorCacheKey,n)}function zD(e,t,r){if(!to(t)){var n=UD(t,r);return n&&n[j(e)]}}function UD(e,t){if(to(e))return Ir;var r=t?Lr:Rr;return ED(e,t?2:1,void 0)||OD(e,r,void 0)}function KD(e,t){var r=!!(2&t);return 1&t?zD(1,e,r)||Me:r?Px(e)||Me:e}function VD(t,r){var n=KD(r,e.getFunctionFlags(t));return !!n&&Eb(n,16387)}function qD(t,r,n){var i=Hc(t);if(0!==i.length){for(var a=0,o=fc(t);a<o.length;a++){var s=o[a];n&&4194304&s.flags||WD(t,s,a_(s,8576,!0),Ko(s));}var c=r.valueDeclaration;if(c&&e.isClassLike(c))for(var l=0,u=c.members;l<u.length;l++){var _=u[l];if(!e.isStatic(_)&&!As(_)){var d=$i(_);WD(t,d,rx(_.name.expression),Ko(d));}}if(i.length>1)for(var p=0,f=i;p<f.length;p++)HD(t,f[p]);}}function WD(t,r,n,i){var a=r.valueDeclaration,o=e.getNameOfDeclaration(a);if(!o||!e.isPrivateIdentifier(o))for(var s=Xc(t,n),c=2&e.getObjectFlags(t)?e.getDeclarationOfKind(t.symbol,257):void 0,l=a&&220===a.kind||o&&161===o.kind||ea(r)===t.symbol?a:void 0,u=function(n){var a=n.declaration&&ea($i(n.declaration))===t.symbol?n.declaration:void 0,o=l||a||(c&&!e.some(is(t),(function(e){return !!gc(e,r.escapedName)&&!!Qc(e,n.keyType)}))?c:void 0);o&&!Yd(i,n.type)&&In(o,e.Diagnostics.Property_0_of_type_1_is_not_assignable_to_2_index_type_3,Ia(r),Ma(i),Ma(n.keyType),Ma(n.type));},_=0,d=s;_<d.length;_++)u(d[_]);}function HD(t,r){for(var n=r.declaration,i=Xc(t,r.keyType),a=2&e.getObjectFlags(t)?e.getDeclarationOfKind(t.symbol,257):void 0,o=n&&ea($i(n))===t.symbol?n:void 0,s=function(n){if(n===r)return "continue";var i=n.declaration&&ea($i(n.declaration))===t.symbol?n.declaration:void 0,s=o||i||(a&&!e.some(is(t),(function(e){return !!Gc(e,r.keyType)&&!!Qc(e,n.keyType)}))?a:void 0);s&&!Yd(r.type,n.type)&&In(s,e.Diagnostics._0_index_type_1_is_not_assignable_to_2_index_type_3,Ma(r.keyType),Ma(r.type),Ma(n.keyType),Ma(n.type));},c=0,l=i;c<l.length;c++)s(l[c]);}function GD(e,t){switch(e.escapedText){case"any":case"unknown":case"never":case"number":case"bigint":case"boolean":case"string":case"symbol":case"void":case"object":In(e,t,e.escapedText);}}function QD(t){if(t)for(var n=!1,i=0;i<t.length;i++){var a=t[i];if(ox(a),r){a.default?(n=!0,s=a.default,c=t,l=i,function t(r){if(177===r.kind){var n=nu(r);if(262144&n.flags)for(var i=l;i<c.length;i++)n.symbol===$i(c[i])&&In(r,e.Diagnostics.Type_parameter_defaults_can_only_reference_previously_declared_type_parameters);}e.forEachChild(r,t);}(s)):n&&In(a,e.Diagnostics.Required_type_parameters_may_not_follow_optional_type_parameters);for(var o=0;o<i;o++)t[o].symbol===a.symbol&&In(a.name,e.Diagnostics.Duplicate_identifier_0,e.declarationNameToString(a.name));}}var s,c,l;}function XD(t){if(!t.declarations||1!==t.declarations.length){var r=Gn(t);if(!r.typeParametersChecked){r.typeParametersChecked=!0;var n=function(t){return e.filter(t.declarations,(function(e){return 256===e.kind||257===e.kind}))}(t);if(!n||n.length<=1)return;if(!function(t,r){for(var n=e.length(r),i=ol(r),a=0,o=t;a<o.length;a++){var s=o[a],c=e.getEffectiveTypeParameterDeclarations(s),l=c.length;if(l<i||l>n)return !1;for(var u=0;u<l;u++){var _=c[u],d=r[u];if(_.name.escapedText!==d.symbol.escapedName)return !1;var p=e.getEffectiveConstraintOfTypeParameter(_),f=p&&dd(p),g=hc(d);if(f&&g&&!Wd(f,g))return !1;var m=_.default&&dd(_.default),y=Fc(d);if(m&&y&&!Wd(m,y))return !1}}return !0}(n,ms(t).localTypeParameters))for(var i=Ia(t),a=0,o=n;a<o.length;a++)In(o[a].name,e.Diagnostics.All_declarations_of_0_must_have_identical_type_parameters,i);}}}function YD(t){!function(t){var r=e.getSourceFileOfNode(t);(function(t){var r=!1,n=!1;if(!CT(t)&&t.heritageClauses)for(var i=0,a=t.heritageClauses;i<a.length;i++){var o=a[i];if(94===o.token){if(r)return QT(o,e.Diagnostics.extends_clause_already_seen);if(n)return QT(o,e.Diagnostics.extends_clause_must_precede_implements_clause);if(o.types.length>1)return QT(o.types[1],e.Diagnostics.Classes_can_only_extend_a_single_class);r=!0;}else {if(e.Debug.assert(117===o.token),n)return QT(o,e.Diagnostics.implements_clause_already_seen);n=!0;}wT(o);}})(t)||NT(t.typeParameters,r);}(t),Bx(t),sD(t,t.name),QD(e.getEffectiveTypeParameterDeclarations(t)),Sx(t);var n=$i(t),i=ms(n),a=Ls(i),o=Uo(n);XD(n),Dx(n),function(t){for(var r=new e.Map,n=new e.Map,i=new e.Map,a=0,o=t.members;a<o.length;a++){var s=o[a];if(170===s.kind)for(var c=0,l=s.parameters;c<l.length;c++){var u=l[c];e.isParameterPropertyDeclaration(u,s)&&!e.isBindingPattern(u.name)&&y(r,u.name,u.name.escapedText,3);}else {var _=e.isStatic(s),d=s.name;if(!d)continue;var p=e.isPrivateIdentifier(d),f=p&&_?16:0,g=p?i:_?n:r,m=d&&e.getPropertyNameForPropertyNameNode(d);if(m)switch(s.kind){case 171:y(g,d,m,1|f);break;case 172:y(g,d,m,2|f);break;case 166:y(g,d,m,3|f);break;case 168:y(g,d,m,8|f);}}}function y(t,r,n,i){var a=t.get(n);if(a)if((16&a)!=(16&i))In(r,e.Diagnostics.Duplicate_identifier_0_Static_and_instance_elements_cannot_share_the_same_private_name,e.getTextOfNode(r));else {var o=!!(8&a),s=!!(8&i);o||s?o!==s&&In(r,e.Diagnostics.Duplicate_identifier_0,e.getTextOfNode(r)):a&i&-17?In(r,e.Diagnostics.Duplicate_identifier_0,e.getTextOfNode(r)):t.set(n,a|i);}else t.set(n,i);}}(t),8388608&t.flags||function(t){for(var r=0,n=t.members;r<n.length;r++){var i=n[r],a=i.name;if(e.isStatic(i)&&a){var o=e.getPropertyNameForPropertyNameNode(a);switch(o){case"name":case"length":case"caller":case"arguments":case"prototype":In(a,e.Diagnostics.Static_property_0_conflicts_with_built_in_property_Function_0_of_constructor_function_1,o,Wa($i(t)));}}}}(t);var s=e.getEffectiveBaseTypeNode(t);if(s){e.forEach(s.typeArguments,hS),K<2&&ST(s.parent,1);var c=e.getClassExtendsHeritageElement(t);c&&c!==s&&ax(c.expression);var l=is(i);if(l.length&&r){var u=l[0],_=rs(i),d=Ac(_);if(function(t,r){var n=Uc(t,1);if(n.length){var i=n[0].declaration;i&&e.hasEffectiveModifier(i,8)&&(PS(r,e.getClassLikeDeclarationOfSymbol(t.symbol))||In(r,e.Diagnostics.Cannot_extend_a_class_0_Class_constructor_is_marked_as_private,Oi(t.symbol)));}}(d,s),hS(s.expression),e.some(s.typeArguments)){e.forEach(s.typeArguments,hS);for(var p=0,f=es(d,s.typeArguments,s);p<f.length&&mx(s,f[p].typeParameters);p++);}if(tp(a,x=Ls(u,i.thisType),void 0)?tp(o,qd(d),t.name||t,e.Diagnostics.Class_static_side_0_incorrectly_extends_base_class_static_side_1):eS(t,a,x,e.Diagnostics.Class_0_incorrectly_extends_base_class_1),8650752&_.flags&&(Yo(o)?Uc(_,1).some((function(e){return 4&e.flags}))&&!e.hasSyntacticModifier(t,128)&&In(t.name||t,e.Diagnostics.A_mixin_class_that_extends_from_a_type_variable_containing_an_abstract_construct_signature_must_also_be_declared_abstract):In(t.name||t,e.Diagnostics.A_mixin_class_must_have_a_constructor_with_a_single_rest_parameter_of_type_any)),!(d.symbol&&32&d.symbol.flags||8650752&_.flags)){var g=ts(d,s.typeArguments,s);e.forEach(g,(function(e){return !Fh(e.declaration)&&!Wd(ml(e),u)}))&&In(s.expression,e.Diagnostics.Base_constructors_must_all_have_the_same_return_type);}!function(t,r){var n,i;e:for(var a=0,o=yc(r);a<o.length;a++){var s=o[a],c=tS(s);if(!(4194304&c.flags)){var l=gc(t,c.escapedName);if(l){var u=tS(l),_=e.getDeclarationModifierFlagsFromSymbol(c);if(e.Debug.assert(!!u,"derived should point to something, even if it is the base class' declaration."),u===c){var d=e.getClassLikeDeclarationOfSymbol(t.symbol);if(128&_&&(!d||!e.hasSyntacticModifier(d,128))){for(var p=0,f=is(t);p<f.length;p++){var g=f[p];if(g!==r){var m=gc(g,c.escapedName),y=m&&tS(m);if(y&&y!==c)continue e}}225===d.kind?In(d,e.Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1,Ia(s),Ma(r)):In(d,e.Diagnostics.Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2,Ma(t),Ia(s),Ma(r));}}else {var v=e.getDeclarationModifierFlagsFromSymbol(u);if(8&_||8&v)continue;var h=void 0,b=98308&c.flags,x=98308&u.flags;if(b&&x){if(128&_&&!(c.valueDeclaration&&e.isPropertyDeclaration(c.valueDeclaration)&&c.valueDeclaration.initializer)||c.valueDeclaration&&257===c.valueDeclaration.parent.kind||u.valueDeclaration&&e.isBinaryExpression(u.valueDeclaration))continue;var D=4!==b&&4===x;if(D||4===b&&4!==x){var S=D?e.Diagnostics._0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property:e.Diagnostics._0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor;In(e.getNameOfDeclaration(u.valueDeclaration)||u.valueDeclaration,S,Ia(c),Ma(r),Ma(t));}else if(q){var T=null===(n=u.declarations)||void 0===n?void 0:n.find((function(e){return 166===e.kind&&!e.initializer}));if(T&&!(33554432&u.flags)&&!(128&_)&&!(128&v)&&!(null===(i=u.declarations)||void 0===i?void 0:i.some((function(e){return !!(8388608&e.flags)})))){var C=sa(e.getClassLikeDeclarationOfSymbol(t.symbol)),E=T.name;if(T.exclamationToken||!C||!e.isIdentifier(E)||!H||!nS(E,t,C)){var k=e.Diagnostics.Property_0_will_overwrite_the_base_property_in_1_If_this_is_intentional_add_an_initializer_Otherwise_add_a_declare_modifier_or_remove_the_redundant_declaration;In(e.getNameOfDeclaration(u.valueDeclaration)||u.valueDeclaration,k,Ia(c),Ma(r));}}}continue}if(ev(c)){if(ev(u)||4&u.flags)continue;e.Debug.assert(!!(98304&u.flags)),h=e.Diagnostics.Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor;}else h=98304&c.flags?e.Diagnostics.Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function:e.Diagnostics.Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function;In(e.getNameOfDeclaration(u.valueDeclaration)||u.valueDeclaration,h,Ma(r),Ia(c),Ma(t));}}}}}(i,u);}}!function(t,r,n,i){for(var a=e.getEffectiveBaseTypeNode(t)&&is(r),o=(null==a?void 0:a.length)?Ls(e.first(a),r.thisType):void 0,s=rs(r),c=function(a){if(e.hasAmbientModifier(a))return "continue";e.isConstructorDeclaration(a)&&e.forEach(a.parameters,(function(c){e.isParameterPropertyDeclaration(c,a)&&ZD(t,i,s,o,r,n,c,!0);})),ZD(t,i,s,o,r,n,a,!1);},l=0,u=t.members;l<u.length;l++)c(u[l]);}(t,i,a,o);var m=e.getEffectiveImplementsTypeNodes(t);if(m)for(var y=0,v=m;y<v.length;y++){var h=v[y];if(e.isEntityNameExpression(h.expression)&&!e.isOptionalChain(h.expression)||In(h.expression,e.Diagnostics.A_class_can_only_implement_an_identifier_Slashqualified_name_with_optional_type_arguments),vx(h),r){var b=Mc(dd(h));if(!ro(b))if(os(b)){var x,D=b.symbol&&32&b.symbol.flags?e.Diagnostics.Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclass:e.Diagnostics.Class_0_incorrectly_implements_interface_1;tp(a,x=Ls(b,i.thisType),void 0)||eS(t,a,x,D);}else In(h,e.Diagnostics.A_class_can_only_implement_an_object_type_or_intersection_of_object_types_with_statically_known_members);}}r&&(qD(i,n),qD(o,n,!0),_x(t),function(t){if(H&&X&&!(8388608&t.flags))for(var r=sa(t),n=0,i=t.members;n<i.length;n++){var a=i[n];if(!(2&e.getEffectiveModifierFlags(a))&&!e.isStatic(a)&&rS(a)){var o=a.name;if(e.isIdentifier(o)||e.isPrivateIdentifier(o)){var s=Uo($i(a));3&s.flags||32768&vf(s)||r&&nS(o,s,r)||In(a.name,e.Diagnostics.Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor,e.declarationNameToString(o));}}}}(t));}function ZD(t,r,n,i,a,o,s,c,l){void 0===l&&(l=!0);var u=s.name&&MS(s.name)||MS(s);return u?$D(t,r,n,i,a,o,e.hasOverrideModifier(s),e.hasAbstractModifier(s),e.isStatic(s),c,e.symbolName(u),l?s:void 0):0}function $D(t,r,n,i,a,o,s,c,l,u,_,d){var p=e.isInJSFile(t),f=!!(8388608&t.flags);if(i&&(s||U.noImplicitOverride)){var g=e.escapeLeadingUnderscores(_),m=l?n:i,y=Jc(l?r:o,g),v=Jc(m,g),h=Ma(i);if(y&&!v&&s){if(d){var b=Ev(_,m);b?In(d,p?e.Diagnostics.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1:e.Diagnostics.This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1,h,Ia(b)):In(d,p?e.Diagnostics.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0:e.Diagnostics.This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0,h);}return 2}if(y&&(null==v?void 0:v.declarations)&&U.noImplicitOverride&&!f){var x=e.some(v.declarations,e.hasAbstractModifier);if(s)return 0;if(!x)return d&&In(d,u?p?e.Diagnostics.This_parameter_property_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0:e.Diagnostics.This_parameter_property_must_have_an_override_modifier_because_it_overrides_a_member_in_base_class_0:p?e.Diagnostics.This_member_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0:e.Diagnostics.This_member_must_have_an_override_modifier_because_it_overrides_a_member_in_the_base_class_0,h),1;if(c&&x)return d&&In(d,e.Diagnostics.This_member_must_have_an_override_modifier_because_it_overrides_an_abstract_method_that_is_declared_in_the_base_class_0,h),1}}else if(s){if(d){var D=Ma(a);In(d,p?e.Diagnostics.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_containing_class_0_does_not_extend_another_class:e.Diagnostics.This_member_cannot_have_an_override_modifier_because_its_containing_class_0_does_not_extend_another_class,D);}return 2}return 0}function eS(t,r,n,i){for(var a=!1,o=function(t){if(e.isStatic(t))return "continue";var i=t.name&&MS(t.name)||MS(t);if(i){var o=Jc(r,i.escapedName),s=Jc(n,i.escapedName);o&&s&&(tp(Uo(o),Uo(s),t.name||t,void 0,(function(){return e.chainDiagnosticMessages(void 0,e.Diagnostics.Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2,Ia(i),Ma(r),Ma(n))}))||(a=!0));}},s=0,c=t.members;s<c.length;s++)o(c[s]);a||tp(r,n,t.name||t,i);}function tS(t){return 1&e.getCheckFlags(t)?t.target:t}function rS(t){return 166===t.kind&&!e.hasAbstractModifier(t)&&!t.exclamationToken&&!t.initializer}function nS(t,r,n){var i=e.factory.createPropertyAccessExpression(e.factory.createThis(),t);return e.setParent(i.expression,i),e.setParent(i,n),i.flowNode=n.returnFlowNode,!(32768&vf(Pm(i,r,Df(r))))}function iS(e){var t=Qn(e);if(!(16384&t.flags)){t.flags|=16384;for(var r=0,n=0,i=e.members;n<i.length;n++){var a=i[n],o=aS(a,r);Qn(a).enumMemberValue=o,r="number"==typeof o?o+1:void 0;}}}function aS(t,r){if(e.isComputedNonLiteralName(t.name))In(t.name,e.Diagnostics.Computed_property_names_are_not_allowed_in_enums);else {var n=e.getTextOfPropertyName(t.name);ky(n)&&!e.isInfinityOrNaNString(n)&&In(t.name,e.Diagnostics.An_enum_member_cannot_have_a_numeric_name);}return t.initializer?function(t){var r=_s($i(t.parent)),n=e.isEnumConst(t.parent),i=t.initializer,a=1!==r||us(t)?function r(n){switch(n.kind){case 218:var i=r(n.operand);if("number"==typeof i)switch(n.operator){case 39:return i;case 40:return -i;case 54:return ~i}break;case 220:var a=r(n.left),o=r(n.right);if("number"==typeof a&&"number"==typeof o)switch(n.operatorToken.kind){case 51:return a|o;case 50:return a&o;case 48:return a>>o;case 49:return a>>>o;case 47:return a<<o;case 52:return a^o;case 41:return a*o;case 43:return a/o;case 39:return a+o;case 40:return a-o;case 44:return a%o;case 42:return Math.pow(a,o)}else if("string"==typeof a&&"string"==typeof o&&39===n.operatorToken.kind)return a+o;break;case 10:case 14:return n.text;case 8:return eC(n),+n.text;case 211:return r(n.expression);case 79:var c=n;return e.isInfinityOrNaNString(c.escapedText)?+c.escapedText:e.nodeIsMissing(n)?0:s(n,$i(t.parent),c.escapedText);case 206:case 205:var l=n;if(oS(l)){var u=rx(l.expression);if(u.symbol&&384&u.symbol.flags){var _;return _=205===l.kind?l.name.escapedText:e.escapeLeadingUnderscores(e.cast(l.argumentExpression,e.isLiteralExpression).text),s(n,u.symbol,_)}}}}(i):void 0;if(void 0!==a)n&&"number"==typeof a&&!isFinite(a)&&In(i,isNaN(a)?e.Diagnostics.const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN:e.Diagnostics.const_enum_member_initializer_was_evaluated_to_a_non_finite_value);else {if(1===r)return In(i,e.Diagnostics.Computed_values_are_not_permitted_in_an_enum_with_string_valued_members),0;if(n)In(i,e.Diagnostics.const_enum_member_initializers_can_only_contain_literal_values_and_other_computed_enum_values);else if(8388608&t.parent.flags)In(i,e.Diagnostics.In_ambient_enum_declarations_member_initializer_must_be_constant_expression);else {var o=ax(i);kb(o,296)?tp(o,ms($i(t.parent)),i,void 0):In(i,e.Diagnostics.Only_numeric_enums_can_have_computed_members_but_this_expression_has_type_0_If_you_do_not_need_exhaustiveness_checks_consider_using_an_object_literal_instead,Ma(o));}}return a;function s(r,n,i){var a=n.exports.get(i);if(a){var o=a.valueDeclaration;if(o!==t)return o&&Zn(o,t)?sT(o):(In(r,e.Diagnostics.A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_members_defined_in_other_enums),0);In(r,e.Diagnostics.Property_0_is_used_before_being_assigned,Ia(a));}}}(t):8388608&t.parent.flags&&!e.isEnumConst(t.parent)&&0===_s($i(t.parent))?void 0:void 0!==r?r:void In(t.name,e.Diagnostics.Enum_member_must_have_initializer)}function oS(t){return 79===t.kind||205===t.kind&&oS(t.expression)||206===t.kind&&oS(t.expression)&&e.isStringLiteralLike(t.argumentExpression)}function sS(t){e.isPrivateIdentifier(t.name)&&In(t,e.Diagnostics.An_enum_member_cannot_be_named_with_a_private_identifier);}function cS(t,r){var n;switch(t.kind){case 236:for(var i=0,a=t.declarationList.declarations;i<a.length;i++)cS(a[i],r);break;case 270:case 271:QT(t,e.Diagnostics.Exports_and_export_assignments_are_not_permitted_in_module_augmentations);break;case 264:case 265:QT(t,e.Diagnostics.Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_module);break;case 202:case 253:var o=t.name;if(e.isBindingPattern(o)){for(var s=0,c=o.elements;s<c.length;s++)cS(c[s],r);break}case 256:case 259:case 255:case 257:case 260:case 258:if(r)return;var l=$i(t);if(l){var u=!(33554432&l.flags);u||(u=!!(null===(n=l.parent)||void 0===n?void 0:n.declarations)&&e.isExternalModuleAugmentation(l.parent.declarations[0]));}}}function lS(t){var r=e.getExternalModuleName(t);if(!r||e.nodeIsMissing(r))return !1;if(!e.isStringLiteral(r))return In(r,e.Diagnostics.String_literal_expected),!1;var n=261===t.parent.kind&&e.isAmbientModule(t.parent.parent);return 303===t.parent.kind||n?!(n&&e.isExternalModuleNameRelative(r.text)&&!Ka(t)&&(In(t,e.Diagnostics.Import_or_export_declaration_in_an_ambient_module_declaration_cannot_reference_module_through_relative_module_name),1)):(In(r,271===t.kind?e.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace:e.Diagnostics.Import_declarations_in_a_namespace_cannot_reference_a_module),!1)}function uS(t){var r,n=$i(t),i=ki(n);if(i!==Ne){var a=(1160127&(n=Zi(n.exportSymbol||n)).flags?111551:0)|(788968&n.flags?788968:0)|(1920&n.flags?1920:0);if(i.flags&a&&In(t,274===t.kind?e.Diagnostics.Export_declaration_conflicts_with_exported_declaration_of_0:e.Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0,Ia(n)),U.isolatedModules&&!e.isTypeOnlyImportOrExportDeclaration(t)&&!(8388608&t.flags)){var o=Ai(n),s=!(111551&i.flags);if(s||o)switch(t.kind){case 266:case 269:case 264:U.preserveValueImports&&(e.Debug.assertIsDefined(t.name,"An ImportClause with a symbol should have a name"),ri(In(t,s?e.Diagnostics._0_is_a_type_and_must_be_imported_using_a_type_only_import_when_preserveValueImports_and_isolatedModules_are_both_enabled:e.Diagnostics._0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_preserveValueImports_and_isolatedModules_are_both_enabled,c=e.idText(269===t.kind&&t.propertyName||t.name)),s?void 0:o,c));break;case 274:var c;if(e.getSourceFileOfNode(o)!==e.getSourceFileOfNode(t))return void ri(In(t,s?e.Diagnostics.Re_exporting_a_type_when_the_isolatedModules_flag_is_provided_requires_using_export_type:e.Diagnostics._0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_isolatedModules_is_enabled,c=e.idText(t.propertyName||t.name)),s?void 0:o,c)}}e.isImportSpecifier(t)&&(null===(r=i.declarations)||void 0===r?void 0:r.every((function(t){return !!(134217728&e.getCombinedNodeFlags(t))})))&&Bn(t.name,i.declarations,n.escapedName);}}function _S(t){sD(t,t.name),uS(t),269===t.kind&&"default"===e.idText(t.propertyName||t.name)&&e.getESModuleInterop(U)&&V!==e.ModuleKind.System&&(V<e.ModuleKind.ES2015||e.getSourceFileOfNode(t).impliedNodeFormat===e.ModuleKind.CommonJS)&&ST(t,131072);}function dS(t){var r;if(t.assertClause){if(V!==e.ModuleKind.ESNext)return YT(t.assertClause,e.Diagnostics.Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext);if(e.isImportDeclaration(t)?null===(r=t.importClause)||void 0===r?void 0:r.isTypeOnly:t.isTypeOnly)return YT(t.assertClause,e.Diagnostics.Import_assertions_cannot_be_used_with_type_only_imports_or_exports)}}function pS(e,t){var r=303===e.parent.kind||261===e.parent.kind||260===e.parent.kind;return r||QT(e,t),!r}function fS(t){return e.isImportDeclaration(t)&&t.importClause&&!t.importClause.isTypeOnly&&(r=t.importClause,e.forEachImportClauseDeclaration(r,(function(e){return !!$i(e).isReferenced})))&&!eT(t.importClause,!0)&&!function(t){return e.forEachImportClauseDeclaration(t,(function(e){return !!Gn($i(e)).constEnumReferenced}))}(t.importClause);var r;}function gS(t){return e.isImportEqualsDeclaration(t)&&e.isExternalModuleReference(t.moduleReference)&&!t.isTypeOnly&&$i(t).isReferenced&&!eT(t,!1)&&!Gn($i(t)).constEnumReferenced}function mS(t){if(uS(t),e.getEmitDeclarations(U)&&Ga(t.propertyName||t.name,!0),t.parent.parent.moduleSpecifier)e.getESModuleInterop(U)&&V!==e.ModuleKind.System&&(V<e.ModuleKind.ES2015||e.getSourceFileOfNode(t).impliedNodeFormat===e.ModuleKind.CommonJS)&&"default"===e.idText(t.propertyName||t.name)&&ST(t,131072);else {var r=t.propertyName||t.name,n=ei(r,r.escapedText,2998271,void 0,void 0,!0);if(n&&(n===se||n===ce||n.declarations&&Xn($a(n.declarations[0]))))In(r,e.Diagnostics.Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module,e.idText(r));else {Pi(t);var i=n&&(2097152&n.flags?ki(n):n);(!i||i===Ne||111551&i.flags)&&zb(t.propertyName||t.name);}}}function yS(t){var r=$i(t),n=Gn(r);if(!n.exportsChecked){var i=r.exports.get("export=");if(i&&function(t){return e.forEachEntry(t.exports,(function(e,t){return "export="!==t}))}(r)){var a=di(i)||i.valueDeclaration;!a||Ka(a)||e.isInJSFile(a)||In(a,e.Diagnostics.An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements);}var o=Qi(r);o&&o.forEach((function(t,r){var n=t.declarations,i=t.flags;if("__export"!==r&&!(1984&i)){var a=e.countWhere(n,F);if(!(524288&i&&a<=2)&&a>1&&!vS(n))for(var o=0,s=n;o<s.length;o++){var c=s[o];R(c)&&mn.add(e.createDiagnosticForNode(c,e.Diagnostics.Cannot_redeclare_exported_variable_0,e.unescapeLeadingUnderscores(r)));}}})),n.exportsChecked=!0;}}function vS(t){return t&&t.length>1&&t.every((function(t){return e.isInJSFile(t)&&e.isAccessExpression(t)&&(e.isExportsIdentifier(t.expression)||e.isModuleExportsAccessExpression(t.expression))}))}function hS(t){if(t){var n=_;_=t,D=0,function(t){e.isInJSFile(t)&&e.forEach(t.jsDoc,(function(t){var r=t.tags;return e.forEach(r,hS)}));var n=t.kind;if(a)switch(n){case 260:case 256:case 257:case 255:a.throwIfCancellationRequested();}switch(n>=236&&n<=252&&t.flowNode&&!Em(t.flowNode)&&Mn(!1===U.allowUnreachableCode,t,e.Diagnostics.Unreachable_code_detected),n){case 162:return ox(t);case 163:return sx(t);case 166:return dx(t);case 165:return function(t){return e.isPrivateIdentifier(t.name)&&In(t,e.Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies),dx(t)}(t);case 179:case 178:case 173:case 174:case 175:return lx(t);case 168:case 167:return function(t){zT(t)||OT(t.name),Jx(t),e.hasSyntacticModifier(t,128)&&168===t.kind&&t.body&&In(t,e.Diagnostics.Method_0_cannot_have_an_implementation_because_it_is_marked_abstract,e.declarationNameToString(t.name)),e.isPrivateIdentifier(t.name)&&!e.getContainingClass(t)&&In(t,e.Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies),px(t);}(t);case 169:return function(t){CT(t),e.forEachChild(t,hS);}(t);case 170:return function(t){lx(t),function(t){var r=e.isInJSFile(t)?e.getJSDocTypeParameterDeclarations(t):void 0,n=t.typeParameters||r&&e.firstOrUndefined(r);if(n){var i=n.pos===n.end?n.pos:e.skipTrivia(e.getSourceFileOfNode(t).text,n.pos);return XT(t,i,n.end-i,e.Diagnostics.Type_parameters_cannot_appear_on_a_constructor_declaration)}}(t)||function(t){var r=e.getEffectiveReturnTypeNode(t);r&&YT(r,e.Diagnostics.Type_annotation_cannot_appear_on_a_constructor_declaration);}(t),hS(t.body);var n=$i(t);if(t===e.getDeclarationOfKind(n,t.kind)&&Dx(n),!e.nodeIsMissing(t.body)&&r){var i=t.parent;if(e.getClassExtendsHeritageElement(i)){Um(t.parent,i);var a=Vm(i),o=Km(t.body);if(o){if(a&&In(o,e.Diagnostics.A_constructor_cannot_contain_a_super_call_when_its_class_extends_null),(99!==e.getEmitScriptTarget(U)||!q)&&(e.some(t.parent.members,(function(t){return !!e.isPrivateIdentifierClassElementDeclaration(t)||166===t.kind&&!e.isStatic(t)&&!!t.initializer}))||e.some(t.parameters,(function(t){return e.hasSyntacticModifier(t,16476)})))){for(var s=void 0,c=0,l=t.body.statements;c<l.length;c++){var u=l[c];if(237===u.kind&&e.isSuperCall(u.expression)){s=u;break}if(!e.isPrologueDirective(u))break}s||In(t,e.Diagnostics.A_super_call_must_be_the_first_statement_in_the_constructor_when_a_class_contains_initialized_properties_parameter_properties_or_private_identifiers);}}else a||In(t,e.Diagnostics.Constructors_for_derived_classes_must_contain_a_super_call);}}}(t);case 171:case 172:return fx(t);case 177:return vx(t);case 176:return function(t){var r=function(e){switch(e.parent.kind){case 213:case 173:case 255:case 212:case 178:case 168:case 167:var t=e.parent;if(e===t.type)return t}}(t);if(r){var n=cl(r),i=fl(n);if(i){hS(t.type);var a=t.parameterName;if(0===i.kind||2===i.kind)ld(a);else if(i.parameterIndex>=0)J(n)&&i.parameterIndex===n.parameters.length-1?In(a,e.Diagnostics.A_type_predicate_cannot_reference_a_rest_parameter):i.type&&tp(i.type,Uo(n.parameters[i.parameterIndex]),t.type,void 0,(function(){return e.chainDiagnosticMessages(void 0,e.Diagnostics.A_type_predicate_s_type_must_be_assignable_to_its_parameter_s_type)}));else if(a){for(var o=!1,s=0,c=r.parameters;s<c.length;s++){var l=c[s].name;if(e.isBindingPattern(l)&&cx(l,a,i.parameterName)){o=!0;break}}o||In(t.parameterName,e.Diagnostics.Cannot_find_parameter_0,i.parameterName);}}}else In(t,e.Diagnostics.A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods);}(t);case 180:return function(e){au(e);}(t);case 181:return function(t){if(e.forEach(t.members,hS),r){var n=q_(t);qD(n,n.symbol),_x(t),ux(t);}}(t);case 182:return function(e){hS(e.elementType);}(t);case 183:return function(t){for(var r=t.elements,n=!1,i=!1,a=e.some(r,e.isNamedTupleMember),o=0,s=r;o<s.length;o++){var c=s[o];if(196!==c.kind&&a){YT(c,e.Diagnostics.Tuple_members_must_all_have_names_or_all_not_have_names);break}var l=Cu(c);if(8&l){var u=dd(c.type);if(!Qp(u)){In(c,e.Diagnostics.A_rest_element_type_must_be_an_array_type);break}(qp(u)||_f(u)&&4&u.target.combinedFlags)&&(i=!0);}else if(4&l){if(i){YT(c,e.Diagnostics.A_rest_element_cannot_follow_another_rest_element);break}i=!0;}else if(2&l){if(i){YT(c,e.Diagnostics.An_optional_element_cannot_follow_a_rest_element);break}n=!0;}else if(n){YT(c,e.Diagnostics.A_required_element_cannot_follow_an_optional_element);break}}e.forEach(t.elements,hS),dd(t);}(t);case 186:case 187:return function(t){e.forEach(t.types,hS),dd(t);}(t);case 190:case 184:case 185:return hS(t.type);case 191:return function(e){ld(e);}(t);case 192:return function(t){!function(t){if(153===t.operator){if(150!==t.type.kind)return YT(t.type,e.Diagnostics._0_expected,e.tokenToString(150));var r=e.walkUpParenthesizedTypes(t.parent);switch(e.isInJSFile(r)&&e.isJSDocTypeExpression(r)&&(r=r.parent,e.isJSDocTypeTag(r)&&(r=r.parent.parent)),r.kind){case 253:var n=r;if(79!==n.name.kind)return YT(t,e.Diagnostics.unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name);if(!e.isVariableDeclarationInVariableStatement(n))return YT(t,e.Diagnostics.unique_symbol_types_are_only_allowed_on_variables_in_a_variable_statement);if(!(2&n.parent.flags))return YT(r.name,e.Diagnostics.A_variable_whose_type_is_a_unique_symbol_type_must_be_const);break;case 166:if(!e.isStatic(r)||!e.hasEffectiveReadonlyModifier(r))return YT(r.name,e.Diagnostics.A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly);break;case 165:if(!e.hasSyntacticModifier(r,64))return YT(r.name,e.Diagnostics.A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly);break;default:YT(t,e.Diagnostics.unique_symbol_types_are_not_allowed_here);}}else 144===t.operator&&182!==t.type.kind&&183!==t.type.kind&&QT(t,e.Diagnostics.readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types,e.tokenToString(150));}(t),hS(t.type);}(t);case 188:return function(t){e.forEachChild(t,hS);}(t);case 189:return function(t){e.findAncestor(t,(function(e){return e.parent&&188===e.parent.kind&&e.parent.extendsType===e}))||YT(t,e.Diagnostics.infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type),hS(t.typeParameter),zx(t);}(t);case 197:return function(e){for(var t=0,r=e.templateSpans;t<r.length;t++){var n=r[t];hS(n.type),tp(dd(n.type),pt,n.type);}dd(e);}(t);case 199:return function(e){hS(e.argument),dd(e);}(t);case 196:return function(t){t.dotDotDotToken&&t.questionToken&&YT(t,e.Diagnostics.A_tuple_member_cannot_be_both_optional_and_rest),184===t.type.kind&&YT(t.type,e.Diagnostics.A_labeled_tuple_element_is_declared_as_optional_with_a_question_mark_after_the_name_and_before_the_colon_rather_than_after_the_type),185===t.type.kind&&YT(t.type,e.Diagnostics.A_labeled_tuple_element_is_declared_as_rest_with_a_before_the_name_rather_than_before_the_type),hS(t.type),dd(t);}(t);case 326:return function(t){var r=e.getEffectiveJSDocHost(t);if(r&&(e.isClassDeclaration(r)||e.isClassExpression(r))){var n=e.getJSDocTags(r).filter(e.isJSDocAugmentsTag);e.Debug.assert(n.length>0),n.length>1&&In(n[1],e.Diagnostics.Class_declarations_cannot_have_more_than_one_augments_or_extends_tag);var i=jx(t.class.expression),a=e.getClassExtendsHeritageElement(r);if(a){var o=jx(a.expression);o&&i.escapedText!==o.escapedText&&In(i,e.Diagnostics.JSDoc_0_1_does_not_match_the_extends_2_clause,e.idText(t.tagName),e.idText(i),e.idText(o));}}else In(r,e.Diagnostics.JSDoc_0_is_not_attached_to_a_class,e.idText(t.tagName));}(t);case 327:return function(t){var r=e.getEffectiveJSDocHost(t);r&&(e.isClassDeclaration(r)||e.isClassExpression(r))||In(r,e.Diagnostics.JSDoc_0_is_not_attached_to_a_class,e.idText(t.tagName));}(t);case 343:case 336:case 337:return function(t){t.typeExpression||In(t.name,e.Diagnostics.JSDoc_typedef_tag_should_either_have_a_type_annotation_or_be_followed_by_property_or_member_tags),t.name&&GD(t.name,e.Diagnostics.Type_alias_name_cannot_be_0),hS(t.typeExpression),QD(e.getEffectiveTypeParameterDeclarations(t));}(t);case 342:return function(e){hS(e.constraint);for(var t=0,r=e.typeParameters;t<r.length;t++)hS(r[t]);}(t);case 341:return function(e){hS(e.typeExpression);}(t);case 338:return function(t){if(hS(t.typeExpression),!e.getParameterSymbolFromJSDoc(t)){var r=e.getHostSignatureFromJSDoc(t);if(r){var n=e.getJSDocTags(r).filter(e.isJSDocParameterTag).indexOf(t);if(n>-1&&n<r.parameters.length&&e.isBindingPattern(r.parameters[n].name))return;ul(r)?e.findLast(e.getJSDocTags(r),e.isJSDocParameterTag)===t&&t.typeExpression&&t.typeExpression.type&&!qp(dd(t.typeExpression.type))&&In(t.name,e.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_had_an_array_type,e.idText(160===t.name.kind?t.name.right:t.name)):e.isQualifiedName(t.name)?In(t.name,e.Diagnostics.Qualified_name_0_is_not_allowed_without_a_leading_param_object_1,e.entityNameToString(t.name),e.entityNameToString(t.name.left)):In(t.name,e.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name,e.idText(t.name));}}}(t);case 345:return function(e){hS(e.typeExpression);}(t);case 315:!function(t){!r||t.type||e.isJSDocConstructSignature(t)||Uf(t,we),lx(t);}(t);case 313:case 312:case 310:case 311:case 320:return bS(t),void e.forEachChild(t,hS);case 316:return void function(t){bS(t),hS(t.type);var r=t.parent;if(e.isParameter(r)&&e.isJSDocFunctionType(r.parent))e.last(r.parent.parameters)!==r&&In(t,e.Diagnostics.A_rest_parameter_must_be_last_in_a_parameter_list);else {e.isJSDocTypeExpression(r)||In(t,e.Diagnostics.JSDoc_may_only_appear_in_the_last_parameter_of_a_signature);var n=t.parent.parent;if(e.isJSDocParameterTag(n)){var i=e.getParameterSymbolFromJSDoc(n);if(i){var a=e.getHostSignatureFromJSDoc(n);a&&e.last(a.parameters).symbol===i||In(t,e.Diagnostics.A_rest_parameter_must_be_last_in_a_parameter_list);}}else In(t,e.Diagnostics.JSDoc_may_only_appear_in_the_last_parameter_of_a_signature);}}(t);case 307:return hS(t.type);case 331:case 333:case 332:return function(t){var r=e.getJSDocHost(t);r&&e.isPrivateIdentifierClassElementDeclaration(r)&&In(t,e.Diagnostics.An_accessibility_modifier_cannot_be_used_with_a_private_identifier);}(t);case 193:return function(e){hS(e.objectType),hS(e.indexType),hx(w_(e),e);}(t);case 194:return function(t){!function(t){var r;(null===(r=t.members)||void 0===r?void 0:r.length)&&YT(t.members[0],e.Diagnostics.A_mapped_type_may_not_declare_properties_or_methods);}(t),hS(t.typeParameter),hS(t.nameType),hS(t.type),t.type||Uf(t,we);var r=I_(t),n=ic(r);n?tp(n,_t,t.nameType):tp(nc(r),_t,e.getEffectiveConstraintOfTypeParameter(t.typeParameter));}(t);case 255:return function(e){r&&(Jx(e),MT(e),sD(e,e.name));}(t);case 234:case 261:return tD(t);case 236:return pD(t);case 237:return function(e){$T(e),ax(e.expression);}(t);case 238:return function(t){$T(t);var r=mD(t.expression);fD(t.expression,r,t.thenStatement),hS(t.thenStatement),235===t.thenStatement.kind&&In(t.thenStatement,e.Diagnostics.The_body_of_an_if_statement_cannot_be_the_empty_statement),hS(t.elseStatement);}(t);case 239:return function(e){$T(e),hS(e.statement),mD(e.expression);}(t);case 240:return function(e){$T(e),mD(e.expression),hS(e.statement);}(t);case 241:return function(t){$T(t)||t.initializer&&254===t.initializer.kind&&WT(t.initializer),t.initializer&&(254===t.initializer.kind?e.forEach(t.initializer.declarations,dD):ax(t.initializer)),t.condition&&mD(t.condition),t.incrementor&&ax(t.incrementor),hS(t.statement),t.locals&&zx(t);}(t);case 242:return function(t){BT(t);var r,n=ov(ax(t.expression));if(254===t.initializer.kind){var i=t.initializer.declarations[0];i&&e.isBindingPattern(i.name)&&In(i.name,e.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern),yD(t);}else {var a=t.initializer,o=ax(a);203===a.kind||204===a.kind?In(a,e.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern):Yd(131072&(r=l_(c_(n))).flags?He:r,o)?Tb(a,e.Diagnostics.The_left_hand_side_of_a_for_in_statement_must_be_a_variable_or_a_property_access,e.Diagnostics.The_left_hand_side_of_a_for_in_statement_may_not_be_an_optional_property_access):In(a,e.Diagnostics.The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any);}n!==nt&&kb(n,126091264)||In(t.expression,e.Diagnostics.The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter_but_here_has_type_0,Ma(n)),hS(t.statement),t.locals&&zx(t);}(t);case 243:return function(t){BT(t);var r=e.getContainingFunctionOrClassStaticBlock(t);if(t.awaitModifier?r&&e.isClassStaticBlockDeclaration(r)?YT(t.awaitModifier,e.Diagnostics.For_await_loops_cannot_be_used_inside_a_class_static_block):2==(6&e.getFunctionFlags(r))&&K<99&&ST(t,16384):U.downlevelIteration&&K<2&&ST(t,256),254===t.initializer.kind)yD(t);else {var n=t.initializer,i=vD(t);if(203===n.kind||204===n.kind)Ib(n,i||Me);else {var a=ax(n);Tb(n,e.Diagnostics.The_left_hand_side_of_a_for_of_statement_must_be_a_variable_or_a_property_access,e.Diagnostics.The_left_hand_side_of_a_for_of_statement_may_not_be_an_optional_property_access),i&&rp(i,a,n,t.expression);}}hS(t.statement),t.locals&&zx(t);}(t);case 244:case 245:return function(t){$T(t)||function(t){for(var r=t;r;){if(e.isFunctionLikeOrClassStaticBlockDeclaration(r))return YT(t,e.Diagnostics.Jump_target_cannot_cross_function_boundary);switch(r.kind){case 249:if(t.label&&r.label.escapedText===t.label.escapedText)return !(244!==t.kind||e.isIterationStatement(r.statement,!0))&&YT(t,e.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement);break;case 248:if(245===t.kind&&!t.label)return !1;break;default:if(e.isIterationStatement(r,!1)&&!t.label)return !1}r=r.parent;}t.label?YT(t,245===t.kind?e.Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement:e.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement):YT(t,245===t.kind?e.Diagnostics.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement:e.Diagnostics.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement);}(t);}(t);case 246:return function(t){var r;if(!$T(t)){var n=e.getContainingFunctionOrClassStaticBlock(t);if(n&&e.isClassStaticBlockDeclaration(n))QT(t,e.Diagnostics.A_return_statement_cannot_be_used_inside_a_class_static_block);else if(n){var i=ml(cl(n)),a=e.getFunctionFlags(n);if(H||t.expression||131072&i.flags){var o=t.expression?zb(t.expression):ze;if(172===n.kind)t.expression&&In(t,e.Diagnostics.Setters_cannot_return_a_value);else if(170===n.kind)t.expression&&!rp(o,i,t,t.expression)&&In(t,e.Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class);else if(yl(n)){var s=null!==(r=KD(i,a))&&void 0!==r?r:i,c=2&a?Ex(o,!1,t,e.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member):o;s&&rp(c,s,t,t.expression);}}else 170!==n.kind&&U.noImplicitReturns&&!VD(n,i)&&In(t,e.Diagnostics.Not_all_code_paths_return_a_value);}else QT(t,e.Diagnostics.A_return_statement_can_only_be_used_within_a_function_body);}}(t);case 247:return function(t){$T(t)||32768&t.flags&&QT(t,e.Diagnostics.with_statements_are_not_allowed_in_an_async_function_block),ax(t.expression);var r=e.getSourceFileOfNode(t);if(!GT(r)){var n=e.getSpanOfTokenAtPosition(r,t.pos).start;XT(r,n,t.statement.pos-n,e.Diagnostics.The_with_statement_is_not_supported_All_symbols_in_a_with_block_will_have_type_any);}}(t);case 248:return function(t){var n;$T(t);var i=!1,a=ax(t.expression),o=af(a);e.forEach(t.caseBlock.clauses,(function(t){if(289!==t.kind||i||(void 0===n?n=t:(YT(t,e.Diagnostics.A_default_clause_cannot_appear_more_than_once_in_a_switch_statement),i=!0)),r&&288===t.kind){var s=ax(t.expression),c=af(s),l=a;c&&o||(s=c?of(s):s,l=of(a)),Mb(l,s)||_p(s,l,t.expression,void 0);}e.forEach(t.statements,hS),U.noFallthroughCasesInSwitch&&t.fallthroughFlowNode&&Em(t.fallthroughFlowNode)&&In(t,e.Diagnostics.Fallthrough_case_in_switch);})),t.caseBlock.locals&&zx(t.caseBlock);}(t);case 249:return function(t){$T(t)||e.findAncestor(t.parent,(function(r){return e.isFunctionLike(r)?"quit":249===r.kind&&r.label.escapedText===t.label.escapedText&&(YT(t.label,e.Diagnostics.Duplicate_label_0,e.getTextOfNode(t.label)),!0)})),hS(t.statement);}(t);case 250:return function(t){$T(t)||e.isIdentifier(t.expression)&&!t.expression.escapedText&&function(t,r,n,i,a){var o=e.getSourceFileOfNode(t);if(!GT(o)){var s=e.getSpanOfTokenAtPosition(o,t.pos);mn.add(e.createFileDiagnostic(o,e.textSpanEnd(s),0,r,void 0,void 0,void 0));}}(t,e.Diagnostics.Line_break_not_permitted_here),t.expression&&ax(t.expression);}(t);case 251:return function(t){$T(t),tD(t.tryBlock);var r=t.catchClause;if(r){if(r.variableDeclaration){var n=r.variableDeclaration,i=e.getEffectiveTypeAnnotationNode(e.getRootDeclaration(n));if(i){var a=mo(n,!1);!a||3&a.flags||QT(i,e.Diagnostics.Catch_clause_variable_type_annotation_must_be_any_or_unknown_if_specified);}else if(n.initializer)QT(n.initializer,e.Diagnostics.Catch_clause_variable_cannot_have_an_initializer);else {var o=r.block.locals;o&&e.forEachKey(r.locals,(function(t){var r=o.get(t);(null==r?void 0:r.valueDeclaration)&&0!=(2&r.flags)&&YT(r.valueDeclaration,e.Diagnostics.Cannot_redeclare_identifier_0_in_catch_clause,t);}));}}tD(r.block);}t.finallyBlock&&tD(t.finallyBlock);}(t);case 253:return dD(t);case 202:return function(t){return function(t){if(t.dotDotDotToken){var r=t.parent.elements;if(t!==e.last(r))return YT(t,e.Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern);if(kT(r,e.Diagnostics.A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma),t.propertyName)return YT(t.name,e.Diagnostics.A_rest_element_cannot_have_a_property_name)}t.dotDotDotToken&&t.initializer&&XT(t,t.initializer.pos-1,1,e.Diagnostics.A_rest_element_cannot_have_an_initializer);}(t),lD(t)}(t);case 256:return function(t){e.some(t.decorators)&&e.some(t.members,(function(t){return e.hasStaticModifier(t)&&e.isPrivateIdentifierClassElementDeclaration(t)}))&&YT(t.decorators[0],e.Diagnostics.Class_decorators_can_t_be_used_with_static_private_identifier_Consider_removing_the_experimental_decorator),t.name||e.hasSyntacticModifier(t,512)||QT(t,e.Diagnostics.A_class_declaration_without_the_default_modifier_must_have_a_name),YD(t),e.forEach(t.members,hS),zx(t);}(t);case 257:return function(t){if(CT(t)||function(t){var r=!1;if(t.heritageClauses)for(var n=0,i=t.heritageClauses;n<i.length;n++){var a=i[n];if(94!==a.token)return e.Debug.assert(117===a.token),QT(a,e.Diagnostics.Interface_declaration_cannot_have_implements_clause);if(r)return QT(a,e.Diagnostics.extends_clause_already_seen);r=!0,wT(a);}}(t),QD(t.typeParameters),r){GD(t.name,e.Diagnostics.Interface_name_cannot_be_0),Sx(t);var n=$i(t);if(XD(n),t===e.getDeclarationOfKind(n,257)){var i=ms(n),a=Ls(i);if(function(t,r){var n=is(t);if(n.length<2)return !0;var i=new e.Map;e.forEach(Cs(t).declaredProperties,(function(e){i.set(e.escapedName,{prop:e,containingType:t});}));for(var a=!0,o=0,s=n;o<s.length;o++)for(var c=s[o],l=0,u=yc(Ls(c,t.thisType));l<u.length;l++){var _=u[l],d=i.get(_.escapedName);if(d){if(d.containingType!==t&&!zp(d.prop,_)){a=!1;var p=Ma(d.containingType),f=Ma(c),g=e.chainDiagnosticMessages(void 0,e.Diagnostics.Named_property_0_of_types_1_and_2_are_not_identical,Ia(_),p,f);g=e.chainDiagnosticMessages(g,e.Diagnostics.Interface_0_cannot_simultaneously_extend_types_1_and_2,Ma(t),p,f),mn.add(e.createDiagnosticForNodeFromMessageChain(r,g));}}else i.set(_.escapedName,{prop:_,containingType:c});}return a}(i,t.name)){for(var o=0,s=is(i);o<s.length;o++)tp(a,Ls(s[o],i.thisType),t.name,e.Diagnostics.Interface_0_incorrectly_extends_interface_1);qD(i,n);}}ux(t);}e.forEach(e.getInterfaceBaseTypeNodes(t),(function(t){e.isEntityNameExpression(t.expression)&&!e.isOptionalChain(t.expression)||In(t.expression,e.Diagnostics.An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments),vx(t);})),e.forEach(t.members,hS),r&&(_x(t),zx(t));}(t);case 258:return function(t){CT(t),GD(t.name,e.Diagnostics.Type_alias_name_cannot_be_0),Sx(t),QD(t.typeParameters),138===t.type.kind?P.has(t.name.escapedText)&&1===e.length(t.typeParameters)||In(t.type,e.Diagnostics.The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types):(hS(t.type),zx(t));}(t);case 259:return function(t){if(r){CT(t),sD(t,t.name),Sx(t),t.members.forEach(sS),iS(t);var n=$i(t);if(t===e.getDeclarationOfKind(n,t.kind)){if(n.declarations&&n.declarations.length>1){var i=e.isEnumConst(t);e.forEach(n.declarations,(function(t){e.isEnumDeclaration(t)&&e.isEnumConst(t)!==i&&In(e.getNameOfDeclaration(t),e.Diagnostics.Enum_declarations_must_all_be_const_or_non_const);}));}var a=!1;e.forEach(n.declarations,(function(t){if(259!==t.kind)return !1;var r=t;if(!r.members.length)return !1;var n=r.members[0];n.initializer||(a?In(n.name,e.Diagnostics.In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enum_element):a=!0);}));}}}(t);case 260:return function(t){if(r){var n=e.isGlobalScopeAugmentation(t),i=8388608&t.flags;n&&!i&&In(t.name,e.Diagnostics.Augmentations_for_the_global_scope_should_have_declare_modifier_unless_they_appear_in_already_ambient_context);var a=e.isAmbientModule(t);if(pS(t,a?e.Diagnostics.An_ambient_module_declaration_is_only_allowed_at_the_top_level_in_a_file:e.Diagnostics.A_namespace_declaration_is_only_allowed_in_a_namespace_or_module))return;CT(t)||i||10!==t.name.kind||YT(t.name,e.Diagnostics.Only_ambient_modules_can_use_quoted_names),e.isIdentifier(t.name)&&sD(t,t.name),Sx(t);var o=$i(t);if(512&o.flags&&!i&&o.declarations&&o.declarations.length>1&&L(t,e.shouldPreserveConstEnums(U))){var s=function(t){var r=t.declarations;if(r)for(var n=0,i=r;n<i.length;n++){var a=i[n];if((256===a.kind||255===a.kind&&e.nodeIsPresent(a.body))&&!(8388608&a.flags))return a}}(o);s&&(e.getSourceFileOfNode(t)!==e.getSourceFileOfNode(s)?In(t.name,e.Diagnostics.A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged):t.pos<s.pos&&In(t.name,e.Diagnostics.A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged));var c=e.getDeclarationOfKind(o,256);c&&(_=t,d=c,p=e.getEnclosingBlockScopeContainer(_),f=e.getEnclosingBlockScopeContainer(d),Xn(p)?Xn(f):!Xn(f)&&p===f)&&(Qn(t).flags|=32768);}if(a)if(e.isExternalModuleAugmentation(t)){if((n||33554432&$i(t).flags)&&t.body)for(var l=0,u=t.body.statements;l<u.length;l++)cS(u[l],n);}else Xn(t.parent)?n?In(t.name,e.Diagnostics.Augmentations_for_the_global_scope_can_only_be_directly_nested_in_external_modules_or_ambient_module_declarations):e.isExternalModuleNameRelative(e.getTextOfIdentifierOrLiteral(t.name))&&In(t.name,e.Diagnostics.Ambient_module_declaration_cannot_specify_relative_module_name):In(t.name,n?e.Diagnostics.Augmentations_for_the_global_scope_can_only_be_directly_nested_in_external_modules_or_ambient_module_declarations:e.Diagnostics.Ambient_modules_cannot_be_nested_in_other_modules_or_namespaces);}var _,d,p,f;t.body&&(hS(t.body),e.isGlobalScopeAugmentation(t)||zx(t));}(t);case 265:return function(t){if(!pS(t,e.Diagnostics.An_import_declaration_can_only_be_used_in_a_namespace_or_module)){if(!CT(t)&&e.hasEffectiveModifiers(t)&&QT(t,e.Diagnostics.An_import_declaration_cannot_have_modifiers),lS(t)){var r=t.importClause;r&&!function(t){var r;return t.isTypeOnly&&t.name&&t.namedBindings?YT(t,e.Diagnostics.A_type_only_import_can_specify_a_default_import_or_named_bindings_but_not_both):!(!t.isTypeOnly||268!==(null===(r=t.namedBindings)||void 0===r?void 0:r.kind))&&tC(t.namedBindings)}(r)&&(r.name&&_S(r),r.namedBindings&&(267===r.namedBindings.kind?(_S(r.namedBindings),V!==e.ModuleKind.System&&(V<e.ModuleKind.ES2015||e.getSourceFileOfNode(t).impliedNodeFormat===e.ModuleKind.CommonJS)&&e.getESModuleInterop(U)&&ST(t,65536)):Ri(t,t.moduleSpecifier)&&e.forEach(r.namedBindings.elements,_S)));}dS(t);}}(t);case 264:return function(t){if(!pS(t,e.Diagnostics.An_import_declaration_can_only_be_used_in_a_namespace_or_module)&&(CT(t),e.isInternalModuleImportEqualsDeclaration(t)||lS(t)))if(_S(t),e.hasSyntacticModifier(t,1)&&Pi(t),276!==t.moduleReference.kind){var r=ki($i(t));if(r!==Ne){if(111551&r.flags){var n=e.getFirstIdentifier(t.moduleReference);1920&Mi(n,112575).flags||In(n,e.Diagnostics.Module_0_is_hidden_by_a_local_declaration_with_the_same_name,e.declarationNameToString(n));}788968&r.flags&&GD(t.name,e.Diagnostics.Import_name_cannot_be_0);}t.isTypeOnly&&YT(t,e.Diagnostics.An_import_alias_cannot_use_import_type);}else !(V>=e.ModuleKind.ES2015&&void 0===e.getSourceFileOfNode(t).impliedNodeFormat)||t.isTypeOnly||8388608&t.flags||YT(t,e.Diagnostics.Import_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_import_Asterisk_as_ns_from_mod_import_a_from_mod_import_d_from_mod_or_another_module_format_instead);}(t);case 271:return function(t){if(!pS(t,e.Diagnostics.An_export_declaration_can_only_be_used_in_a_module)){if(!CT(t)&&e.hasEffectiveModifiers(t)&&QT(t,e.Diagnostics.An_export_declaration_cannot_have_modifiers),t.moduleSpecifier&&t.exportClause&&e.isNamedExports(t.exportClause)&&e.length(t.exportClause.elements)&&0===K&&ST(t,4194304),function(t){var r;t.isTypeOnly&&(272===(null===(r=t.exportClause)||void 0===r?void 0:r.kind)?tC(t.exportClause):YT(t,e.Diagnostics.Only_named_exports_may_use_export_type));}(t),!t.moduleSpecifier||lS(t))if(t.exportClause&&!e.isNamespaceExport(t.exportClause)){e.forEach(t.exportClause.elements,mS);var r=261===t.parent.kind&&e.isAmbientModule(t.parent.parent),n=!r&&261===t.parent.kind&&!t.moduleSpecifier&&8388608&t.flags;303===t.parent.kind||r||n||In(t,e.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace);}else {var i=Ri(t,t.moduleSpecifier);i&&Vi(i)?In(t.moduleSpecifier,e.Diagnostics.Module_0_uses_export_and_cannot_be_used_with_export_Asterisk,Ia(i)):t.exportClause&&uS(t.exportClause),V!==e.ModuleKind.System&&(V<e.ModuleKind.ES2015||e.getSourceFileOfNode(t).impliedNodeFormat===e.ModuleKind.CommonJS)&&(t.exportClause?e.getESModuleInterop(U)&&ST(t,65536):ST(t,32768));}dS(t);}}(t);case 270:return function(t){if(!pS(t,t.isExportEquals?e.Diagnostics.An_export_assignment_must_be_at_the_top_level_of_a_file_or_module_declaration:e.Diagnostics.A_default_export_must_be_at_the_top_level_of_a_file_or_module_declaration)){var r=303===t.parent.kind?t.parent:t.parent.parent;if(260!==r.kind||e.isAmbientModule(r)){!CT(t)&&e.hasEffectiveModifiers(t)&&QT(t,e.Diagnostics.An_export_assignment_cannot_have_modifiers);var n=e.getEffectiveTypeAnnotationNode(t);if(n&&tp(zb(t.expression),dd(n),t.expression),79===t.expression.kind){var i=t.expression,a=Mi(i,67108863,!0,!0,t);if(a){Jm(a,i);var o=2097152&a.flags?ki(a):a;(o===Ne||111551&o.flags)&&zb(t.expression);}else zb(t.expression);e.getEmitDeclarations(U)&&Ga(t.expression,!0);}else zb(t.expression);yS(r),8388608&t.flags&&!e.isEntityNameExpression(t.expression)&&YT(t.expression,e.Diagnostics.The_expression_of_an_export_assignment_must_be_an_identifier_or_qualified_name_in_an_ambient_context),!t.isExportEquals||8388608&t.flags||(V>=e.ModuleKind.ES2015&&e.getSourceFileOfNode(t).impliedNodeFormat!==e.ModuleKind.CommonJS?YT(t,e.Diagnostics.Export_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_export_default_or_another_module_format_instead):V===e.ModuleKind.System&&YT(t,e.Diagnostics.Export_assignment_is_not_supported_when_module_flag_is_system));}else t.isExportEquals?In(t,e.Diagnostics.An_export_assignment_cannot_be_used_in_a_namespace):In(t,e.Diagnostics.A_default_export_can_only_be_used_in_an_ECMAScript_style_module);}}(t);case 235:case 252:return void $T(t);case 275:!function(e){Bx(e);}(t);}}(t),_=n;}}function bS(t){e.isInJSFile(t)||YT(t,e.Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments);}function xS(t){var r=Qn(e.getSourceFileOfNode(t));if(!(1&r.flags)){r.deferredNodes=r.deferredNodes||new e.Map;var n=O(t);r.deferredNodes.set(n,t);}}function DS(t){null===e.tracing||void 0===e.tracing||e.tracing.push("check","checkDeferredNode",{kind:t.kind,pos:t.pos,end:t.end});var r=_;switch(_=t,D=0,t.kind){case 207:case 208:case 209:case 164:case 279:zv(t);break;case 212:case 213:case 168:case 167:!function(t){e.Debug.assert(168!==t.kind||e.isObjectLiteralMethod(t));var r=e.getFunctionFlags(t),n=yl(t);if(vb(t,n),t.body)if(e.getEffectiveReturnTypeNode(t)||ml(cl(t)),234===t.body.kind)hS(t.body);else {var i=ax(t.body),a=n&&KD(n,r);a&&rp(2==(3&r)?Ex(i,!1,t.body,e.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member):i,a,t.body,t.body);}}(t);break;case 171:case 172:fx(t);break;case 225:!function(t){e.forEach(t.members,hS),zx(t);}(t);break;case 278:!function(e){Xy(e);}(t);break;case 277:!function(e){Xy(e.openingElement),Oy(e.closingElement.tagName)?jy(e.closingElement):ax(e.closingElement.tagName),Ly(e);}(t);}_=r,null===e.tracing||void 0===e.tracing||e.tracing.pop();}function SS(r){null===e.tracing||void 0===e.tracing||e.tracing.push("check","checkSourceFile",{path:r.path},!0),e.performance.mark("beforeCheck"),function(r){var n=Qn(r);if(!(1&n.flags)){if(e.skipTypeChecking(r,U,t))return;!function(t){8388608&t.flags&&function(t){for(var r=0,n=t.statements;r<n.length;r++){var i=n[r];if((e.isDeclaration(i)||236===i.kind)&&ZT(i))return !0}}(t);}(r),e.clear(_n),e.clear(dn),e.clear(pn),e.clear(fn),e.forEach(r.statements,hS),hS(r.endOfFileToken),function(e){var t=Qn(e);t.deferredNodes&&t.deferredNodes.forEach(DS);}(r),e.isExternalOrCommonJsModule(r)&&zx(r),r.isDeclarationFile||!U.noUnusedLocals&&!U.noUnusedParameters||Ux(CS(r),(function(t,r,n){!e.containsParseError(t)&&TS(r,!!(8388608&t.flags))&&mn.add(n);})),2===U.importsNotUsedAsValues&&!r.isDeclarationFile&&e.isExternalModule(r)&&function(t){for(var r=0,n=t.statements;r<n.length;r++){var i=n[r];(fS(i)||gS(i))&&In(i,e.Diagnostics.This_import_is_never_used_as_a_value_and_must_use_import_type_because_importsNotUsedAsValues_is_set_to_error);}}(r),e.isExternalOrCommonJsModule(r)&&yS(r),_n.length&&(e.forEach(_n,nD),e.clear(_n)),dn.length&&(e.forEach(dn,iD),e.clear(dn)),pn.length&&(e.forEach(pn,aD),e.clear(pn)),fn.length&&(e.forEach(fn,oD),e.clear(fn)),n.flags|=1;}}(r),e.performance.mark("afterCheck"),e.performance.measure("Check","beforeCheck","afterCheck"),null===e.tracing||void 0===e.tracing||e.tracing.pop();}function TS(t,r){if(r)return !1;switch(t){case 0:return !!U.noUnusedLocals;case 1:return !!U.noUnusedParameters;default:return e.Debug.assertNever(t)}}function CS(t){return Jr.get(t.path)||e.emptyArray}function ES(r,n){try{return a=n,function(r){if(kS(),r){var n=mn.getGlobalDiagnostics(),i=n.length;SS(r);var a=mn.getDiagnostics(r.fileName),o=mn.getGlobalDiagnostics();if(o!==n){var s=e.relativeComplement(n,o,e.compareDiagnostics);return e.concatenate(s,a)}return 0===i&&o.length>0?e.concatenate(o,a):a}return e.forEach(t.getSourceFiles(),SS),mn.getDiagnostics()}(r)}finally{a=void 0;}}function kS(){if(!r)throw new Error("Trying to get diagnostics from a type checker that does not produce them.")}function NS(e){switch(e.kind){case 162:case 256:case 257:case 258:case 259:case 343:case 336:case 337:return !0;case 266:return e.isTypeOnly;case 269:case 274:return e.parent.parent.isTypeOnly;default:return !1}}function FS(e){for(;160===e.parent.kind;)e=e.parent;return 177===e.parent.kind}function AS(t,r){for(var n;(t=e.getContainingClass(t))&&!(n=r(t)););return n}function PS(e,t){return !!AS(e,(function(e){return e===t}))}function wS(e){return void 0!==function(e){for(;160===e.parent.kind;)e=e.parent;return 264===e.parent.kind?e.parent.moduleReference===e?e.parent:void 0:270===e.parent.kind&&e.parent.expression===e?e.parent:void 0}(e)}function IS(t){if(e.isDeclarationName(t))return $i(t.parent);if(e.isInJSFile(t)&&205===t.parent.kind&&t.parent===t.parent.parent.left&&!e.isPrivateIdentifier(t)&&!e.isJSDocMemberName(t)){var r=function(t){switch(e.getAssignmentDeclarationKind(t.parent.parent)){case 1:case 3:return $i(t.parent);case 4:case 2:case 5:return $i(t.parent.parent)}}(t);if(r)return r}if(270===t.parent.kind&&e.isEntityNameExpression(t)){var n=Mi(t,2998271,!0);if(n&&n!==Ne)return n}else if(e.isEntityName(t)&&wS(t)){var i=e.getAncestor(t,264);return e.Debug.assert(void 0!==i),Ii(t,!0)}if(e.isEntityName(t)){var a=function(t){for(var r=t.parent;e.isQualifiedName(r);)t=r,r=r.parent;if(r&&199===r.kind&&r.qualifier===t)return r}(t);if(a){dd(a);var o=Qn(t).resolvedSymbol;return o===Ne?void 0:o}}for(;e.isRightSideOfQualifiedNameOrPropertyAccessOrJSDocMemberName(t);)t=t.parent;if(function(e){for(;205===e.parent.kind;)e=e.parent;return 227===e.parent.kind}(t)){var s=0;227===t.parent.kind?(s=788968,e.isExpressionWithTypeArgumentsInClassExtendsClause(t.parent)&&(s|=111551)):s=1920,s|=2097152;var c=e.isEntityNameExpression(t)?Mi(t,s):void 0;if(c)return c}if(338===t.parent.kind)return e.getParameterSymbolFromJSDoc(t.parent);if(162===t.parent.kind&&342===t.parent.parent.kind){e.Debug.assert(!e.isInJSFile(t));var l=e.getTypeParameterFromJsDoc(t.parent);return l&&l.symbol}if(e.isExpressionNode(t)){if(e.nodeIsMissing(t))return;var u=e.findAncestor(t,e.or(e.isJSDocLinkLike,e.isJSDocNameReference,e.isJSDocMemberName));if(s=u?901119:111551,79===t.kind){if(e.isJSXTagName(t)&&Oy(t))return (f=jy(t.parent))===Ne?void 0:f;var _=Mi(t,s,!1,!u,e.getHostSignatureFromJSDoc(t));if(!_&&u){var d=e.findAncestor(t,e.or(e.isClassLike,e.isInterfaceDeclaration));if(d)return OS(t,$i(d))}return _}if(e.isPrivateIdentifier(t))return mv(t);if(205===t.kind||160===t.kind){var p=Qn(t);return p.resolvedSymbol?p.resolvedSymbol:(205===t.kind?dv(t,0):pv(t,0),!p.resolvedSymbol&&u&&e.isQualifiedName(t)?OS(t):p.resolvedSymbol)}if(e.isJSDocMemberName(t))return OS(t)}else if(FS(t)){var f;return (f=Mi(t,s=177===t.parent.kind?788968:1920,!1,!0))&&f!==Ne?f:Hl(t)}return 176===t.parent.kind?Mi(t,1):void 0}function OS(t,r){if(e.isEntityName(t)){var n=901119,i=Mi(t,n,!1,!0,e.getHostSignatureFromJSDoc(t));if(!i&&e.isIdentifier(t)&&r&&(i=Zi(Yn(Gi(r),t.escapedText,n))),i)return i}var a=e.isIdentifier(t)?r:OS(t.left),o=e.isIdentifier(t)?t.escapedText:t.right.escapedText;if(a){var s=111551&a.flags&&Jc(Uo(a),"prototype");return Jc(s?Uo(s):ms(a),o)}}function MS(t,r){if(303===t.kind)return e.isExternalModule(t)?Zi(t.symbol):void 0;var n=t.parent,i=n.parent;if(!(16777216&t.flags)){if(B(t)){var a=$i(n);return e.isImportOrExportSpecifier(t.parent)&&t.parent.propertyName===t?Py(a):a}if(e.isLiteralComputedPropertyDeclarationName(t))return $i(n.parent);if(79===t.kind){if(wS(t))return IS(t);if(202===n.kind&&200===i.kind&&t===n.propertyName){if(o=Jc(LS(i),t.escapedText))return o}else if(e.isMetaProperty(n)){var o;if(o=Jc(LS(n),t.escapedText))return o;if(103===n.keywordToken)return Uh(n).symbol}}switch(t.kind){case 79:case 80:case 205:case 160:return IS(t);case 108:var s=e.getThisContainer(t,!1);if(e.isFunctionLike(s)){var c=cl(s);if(c.thisParameter)return c.thisParameter}if(e.isInExpressionContext(t))return ax(t).symbol;case 191:return ld(t).symbol;case 106:return ax(t).symbol;case 134:var l=t.parent;return l&&170===l.kind?l.parent.symbol:void 0;case 10:case 14:if(e.isExternalModuleImportEqualsDeclaration(t.parent.parent)&&e.getExternalModuleImportEqualsDeclarationExpression(t.parent.parent)===t||(265===t.parent.kind||271===t.parent.kind)&&t.parent.moduleSpecifier===t||e.isInJSFile(t)&&e.isRequireCall(t.parent,!1)||e.isImportCall(t.parent)||e.isLiteralTypeNode(t.parent)&&e.isLiteralImportTypeNode(t.parent.parent)&&t.parent.parent.argument===t.parent)return Ri(t,t,r);if(e.isCallExpression(n)&&e.isBindableObjectDefinePropertyCall(n)&&n.arguments[1]===t)return $i(n);case 8:var u=e.isElementAccessExpression(n)?n.argumentExpression===t?rx(n.expression):void 0:e.isLiteralTypeNode(n)&&e.isIndexedAccessTypeNode(i)?dd(i.objectType):void 0;return u&&Jc(u,e.escapeLeadingUnderscores(t.text));case 88:case 98:case 38:case 84:return $i(t.parent);case 199:return e.isLiteralImportTypeNode(t)?MS(t.argument.literal,r):void 0;case 93:return e.isExportAssignment(t.parent)?e.Debug.checkDefined(t.parent.symbol):void 0;case 100:case 103:return e.isMetaProperty(t.parent)?zh(t.parent).symbol:void 0;case 230:return ax(t).symbol;default:return}}}function LS(t){if(e.isSourceFile(t)&&!e.isExternalModule(t))return Me;if(16777216&t.flags)return Me;var r,n,i=e.tryGetClassImplementingOrExtendingExpressionWithTypeArguments(t),a=i&&ss($i(i.class));if(e.isPartOfTypeNode(t)){var o=dd(t);return a?Ls(o,a.thisType):o}if(e.isExpressionNode(t))return BS(t);if(a&&!i.isImplements){var s=e.firstOrUndefined(is(a));return s?Ls(s,a.thisType):Me}if(NS(t))return ms(n=$i(t));if(79===(r=t).kind&&NS(r.parent)&&e.getNameOfDeclaration(r.parent)===r)return (n=MS(t))?ms(n):Me;if(e.isDeclaration(t))return Uo(n=$i(t));if(B(t))return (n=MS(t))?Uo(n):Me;if(e.isBindingPattern(t))return mo(t.parent,!0)||Me;if(wS(t)&&(n=MS(t))){var c=ms(n);return ro(c)?Uo(n):c}return e.isMetaProperty(t.parent)&&t.parent.keywordToken===t.kind?zh(t.parent):Me}function RS(t){if(e.Debug.assert(204===t.kind||203===t.kind),243===t.parent.kind)return Ib(t,vD(t.parent)||Me);if(220===t.parent.kind)return Ib(t,rx(t.parent.right)||Me);if(294===t.parent.kind){var r=e.cast(t.parent.parent,e.isObjectLiteralExpression);return Pb(r,RS(r)||Me,e.indexOfNode(r.properties,t.parent))}var n=e.cast(t.parent,e.isArrayLiteralExpression),i=RS(n)||Me,a=hD(65,i,ze,t.parent)||Me;return wb(n,i,n.elements.indexOf(t),a)}function BS(t){return e.isRightSideOfQualifiedNameOrPropertyAccess(t)&&(t=t.parent),rd(rx(t))}function jS(t){var r=$i(t.parent);return e.isStatic(t)?Uo(r):ms(r)}function JS(t){var r=t.name;switch(r.kind){case 79:return id(e.idText(r));case 8:case 10:return id(r.text);case 161:var n=Ny(r);return kb(n,12288)?n:He;default:return e.Debug.fail("Unsupported property name.")}}function zS(t){t=Ac(t);var r=e.createSymbolTable(yc(t)),n=Uc(t,0).length?It:Uc(t,1).length?Ot:void 0;return n&&e.forEach(yc(n),(function(e){r.has(e.escapedName)||r.set(e.escapedName,e);})),fa(r)}function US(t){return e.typeHasCallOrConstructSignatures(t,de)}function KS(t){if(e.isGeneratedIdentifier(t))return !1;var r=e.getParseTreeNode(t,e.isIdentifier);if(!r)return !1;var n=r.parent;return !(!n||(e.isPropertyAccessExpression(n)||e.isPropertyAssignment(n))&&n.name===r||mT(r)!==ue)}function VS(t){var r=Ri(t.parent,t);if(!r||e.isShorthandAmbientModuleSymbol(r))return !0;var n=Vi(r),i=Gn(r=zi(r));return void 0===i.exportsSomeValue&&(i.exportsSomeValue=n?!!(111551&r.flags):e.forEachEntry(Qi(r),(function(e){return (e=Ei(e))&&!!(111551&e.flags)}))),i.exportsSomeValue}function qS(t,r){var n,i=e.getParseTreeNode(t,e.isIdentifier);if(i){var a=mT(i,function(t){return e.isModuleOrEnumDeclaration(t.parent)&&t===t.parent.name}(i));if(a){if(1048576&a.flags){var o=Zi(a.exportSymbol);if(!r&&944&o.flags&&!(3&o.flags))return;a=o;}var s=ea(a);if(s){if(512&s.flags&&303===(null===(n=s.valueDeclaration)||void 0===n?void 0:n.kind)){var c=s.valueDeclaration;return c!==e.getSourceFileOfNode(i)?void 0:c}return e.findAncestor(i.parent,(function(t){return e.isModuleOrEnumDeclaration(t)&&$i(t)===s}))}}}}function WS(t){if(t.generatedImportReference)return t.generatedImportReference;var r=e.getParseTreeNode(t,e.isIdentifier);if(r){var n=mT(r);if(Ci(n,111551)&&!Ai(n))return di(n)}}function HS(t){if(418&t.flags&&t.valueDeclaration&&!e.isSourceFile(t.valueDeclaration)){var r=Gn(t);if(void 0===r.isDeclarationWithCollidingName){var n=e.getEnclosingBlockScopeContainer(t.valueDeclaration);if(e.isStatementWithLocals(n)||function(t){return t.valueDeclaration&&e.isBindingElement(t.valueDeclaration)&&291===e.walkUpBindingElementsAndPatterns(t.valueDeclaration).parent.kind}(t)){var i=Qn(t.valueDeclaration);if(ei(n.parent,t.escapedName,111551,void 0,void 0,!1))r.isDeclarationWithCollidingName=!0;else if(262144&i.flags){var a=524288&i.flags,o=e.isIterationStatement(n,!1),s=234===n.kind&&e.isIterationStatement(n.parent,!1);r.isDeclarationWithCollidingName=!(e.isBlockScopedContainerTopLevel(n)||a&&(o||s));}else r.isDeclarationWithCollidingName=!1;}}return r.isDeclarationWithCollidingName}return !1}function GS(t){if(!e.isGeneratedIdentifier(t)){var r=e.getParseTreeNode(t,e.isIdentifier);if(r){var n=mT(r);if(n&&HS(n))return n.valueDeclaration}}}function QS(t){var r=e.getParseTreeNode(t,e.isDeclaration);if(r){var n=$i(r);if(n)return HS(n)}return !1}function XS(t){switch(t.kind){case 264:return ZS($i(t));case 266:case 267:case 269:case 274:var r=$i(t);return !!r&&ZS(r)&&!Ai(r);case 271:var n=t.exportClause;return !!n&&(e.isNamespaceExport(n)||e.some(n.elements,XS));case 270:return !t.expression||79!==t.expression.kind||ZS($i(t))}return !1}function YS(t){var r=e.getParseTreeNode(t,e.isImportEqualsDeclaration);return !(void 0===r||303!==r.parent.kind||!e.isInternalModuleImportEqualsDeclaration(r))&&ZS($i(r))&&r.moduleReference&&!e.nodeIsMissing(r.moduleReference)}function ZS(t){if(!t)return !1;var r=ki(t);return r===Ne||!!(111551&r.flags)&&(e.shouldPreserveConstEnums(U)||!$S(r))}function $S(e){return Ab(e)||!!e.constEnumOnlyModule}function eT(t,r){if(pi(t)){var n=$i(t),i=n&&Gn(n);if(null==i?void 0:i.referenced)return !0;var a=Gn(n).target;if(a&&1&e.getEffectiveModifierFlags(t)&&111551&a.flags&&(e.shouldPreserveConstEnums(U)||!$S(a)))return !0}return !!r&&!!e.forEachChild(t,(function(e){return eT(e,r)}))}function tT(t){if(e.nodeIsPresent(t.body)){if(e.isGetAccessor(t)||e.isSetAccessor(t))return !1;var r=_l($i(t));return r.length>1||1===r.length&&r[0].declaration!==t}return !1}function rT(t){return !(!H||nl(t)||e.isJSDocParameterTag(t)||!t.initializer||e.hasSyntacticModifier(t,16476))}function nT(t){return H&&nl(t)&&!t.initializer&&e.hasSyntacticModifier(t,16476)}function iT(t){var r=e.getParseTreeNode(t,e.isFunctionDeclaration);if(!r)return !1;var n=$i(r);return !!(n&&16&n.flags)&&!!e.forEachEntry(Gi(n),(function(t){return 111551&t.flags&&t.valueDeclaration&&e.isPropertyAccessExpression(t.valueDeclaration)}))}function aT(t){var r=e.getParseTreeNode(t,e.isFunctionDeclaration);if(!r)return e.emptyArray;var n=$i(r);return n&&yc(Uo(n))||e.emptyArray}function oT(e){var t,r=e.id||0;return r<0||r>=tn.length?0:(null===(t=tn[r])||void 0===t?void 0:t.flags)||0}function sT(e){return iS(e.parent),Qn(e).enumMemberValue}function cT(e){switch(e.kind){case 297:case 205:case 206:return !0}return !1}function lT(t){if(297===t.kind)return sT(t);var r=Qn(t).resolvedSymbol;if(r&&8&r.flags){var n=r.valueDeclaration;if(e.isEnumConst(n.parent))return sT(n)}}function uT(e){return !!(524288&e.flags)&&Uc(e,0).length>0}function _T(t,r){var n,i,a=e.getParseTreeNode(t,e.isEntityName);if(!a)return e.TypeReferenceSerializationKind.Unknown;if(r&&!(r=e.getParseTreeNode(r)))return e.TypeReferenceSerializationKind.Unknown;var o=!1;if(e.isQualifiedName(a)){var s=Mi(e.getFirstIdentifier(a),111551,!0,!0,r);o=!!(null===(n=null==s?void 0:s.declarations)||void 0===n?void 0:n.every(e.isTypeOnlyImportOrExportDeclaration));}var c=Mi(a,111551,!0,!0,r),l=c&&2097152&c.flags?ki(c):c;o||(o=!!(null===(i=null==c?void 0:c.declarations)||void 0===i?void 0:i.every(e.isTypeOnlyImportOrExportDeclaration)));var u=Mi(a,788968,!0,!1,r);if(l&&l===u){var _=vu(!1);if(_&&l===_)return e.TypeReferenceSerializationKind.Promise;var d=Uo(l);if(d&&Zo(d))return o?e.TypeReferenceSerializationKind.TypeWithCallSignature:e.TypeReferenceSerializationKind.TypeWithConstructSignatureAndValue}if(!u)return o?e.TypeReferenceSerializationKind.ObjectType:e.TypeReferenceSerializationKind.Unknown;var p=ms(u);return ro(p)?o?e.TypeReferenceSerializationKind.ObjectType:e.TypeReferenceSerializationKind.Unknown:3&p.flags?e.TypeReferenceSerializationKind.ObjectType:kb(p,245760)?e.TypeReferenceSerializationKind.VoidNullableOrNeverType:kb(p,528)?e.TypeReferenceSerializationKind.BooleanType:kb(p,296)?e.TypeReferenceSerializationKind.NumberLikeType:kb(p,2112)?e.TypeReferenceSerializationKind.BigIntLikeType:kb(p,402653316)?e.TypeReferenceSerializationKind.StringLikeType:_f(p)?e.TypeReferenceSerializationKind.ArrayLikeType:kb(p,12288)?e.TypeReferenceSerializationKind.ESSymbolType:uT(p)?e.TypeReferenceSerializationKind.TypeWithCallSignature:qp(p)?e.TypeReferenceSerializationKind.ArrayLikeType:e.TypeReferenceSerializationKind.ObjectType}function dT(t,r,n,i,a){var o=e.getParseTreeNode(t,e.isVariableLikeOrAccessor);if(!o)return e.factory.createToken(130);var s=$i(o),c=!s||133120&s.flags?Me:sf(Uo(s));return 8192&c.flags&&c.symbol===s&&(n|=1048576),a&&(c=Df(c)),ae.typeToTypeNode(c,r,1024|n,i)}function pT(t,r,n,i){var a=e.getParseTreeNode(t,e.isFunctionLike);if(!a)return e.factory.createToken(130);var o=cl(a);return ae.typeToTypeNode(ml(o),r,1024|n,i)}function fT(t,r,n,i){var a=e.getParseTreeNode(t,e.isExpression);if(!a)return e.factory.createToken(130);var o=jf(BS(a));return ae.typeToTypeNode(o,r,1024|n,i)}function gT(t){return oe.has(e.escapeLeadingUnderscores(t))}function mT(t,r){var n=Qn(t).resolvedSymbol;if(n)return n;var i=t;if(r){var a=t.parent;e.isDeclaration(a)&&t===a.name&&(i=$a(a));}return ei(i,t.escapedText,3257279,void 0,void 0,!0)}function yT(t){if(!e.isGeneratedIdentifier(t)){var r=e.getParseTreeNode(t,e.isIdentifier);if(r){var n=mT(r);if(n)return aa(n).valueDeclaration}}}function vT(t){return !!(e.isDeclarationReadonly(t)||e.isVariableDeclaration(t)&&e.isVarConst(t))&&nd(Uo($i(t)))}function hT(t,r){return function(t,r,n){var i=1024&t.flags?ae.symbolToExpression(t.symbol,111551,r,void 0,n):t===Ze?e.factory.createTrue():t===Xe&&e.factory.createFalse();if(i)return i;var a=t.value;return "object"==typeof a?e.factory.createBigIntLiteral(a):"number"==typeof a?e.factory.createNumericLiteral(a):e.factory.createStringLiteral(a)}(Uo($i(t)),t,r)}function bT(t){return t?(Nn(t),e.getSourceFileOfNode(t).localJsxFactory||Dr):Dr}function xT(t){if(t){var r=e.getSourceFileOfNode(t);if(r){if(r.localJsxFragmentFactory)return r.localJsxFragmentFactory;var n=r.pragmas.get("jsxfrag"),i=e.isArray(n)?n[0]:n;if(i)return r.localJsxFragmentFactory=e.parseIsolatedEntityName(i.arguments.factory,K),r.localJsxFragmentFactory}}if(U.jsxFragmentFactory)return e.parseIsolatedEntityName(U.jsxFragmentFactory,K)}function DT(t){var r=260===t.kind?e.tryCast(t.name,e.isStringLiteral):e.getExternalModuleName(t),n=Bi(r,r,void 0);if(n)return e.getDeclarationOfKind(n,303)}function ST(t,r){if((s&r)!==r&&U.importHelpers){var n=e.getSourceFileOfNode(t);if(e.isEffectiveExternalModule(n,U)&&!(8388608&t.flags)){var i=(_=n,d=t,u||(u=ji(_,e.externalHelpersModuleNameText,e.Diagnostics.This_syntax_requires_an_imported_helper_but_module_0_cannot_be_found,d)||Ne),u);if(i!==Ne)for(var a=r&~s,o=1;o<=4194304;o<<=1)if(a&o){var c=TT(o),l=Yn(i.exports,e.escapeLeadingUnderscores(c),111551);l?524288&o?e.some(_l(l),(function(e){return Zh(e)>3}))||In(t,e.Diagnostics.This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_one_in_0_Consider_upgrading_your_version_of_0,e.externalHelpersModuleNameText,c,4):1048576&o?e.some(_l(l),(function(e){return Zh(e)>4}))||In(t,e.Diagnostics.This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_one_in_0_Consider_upgrading_your_version_of_0,e.externalHelpersModuleNameText,c,5):1024&o&&(e.some(_l(l),(function(e){return Zh(e)>2}))||In(t,e.Diagnostics.This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_one_in_0_Consider_upgrading_your_version_of_0,e.externalHelpersModuleNameText,c,3)):In(t,e.Diagnostics.This_syntax_requires_an_imported_helper_named_1_which_does_not_exist_in_0_Consider_upgrading_your_version_of_0,e.externalHelpersModuleNameText,c);}s|=r;}}var _,d;}function TT(t){switch(t){case 1:return "__extends";case 2:return "__assign";case 4:return "__rest";case 8:return "__decorate";case 16:return "__metadata";case 32:return "__param";case 64:return "__awaiter";case 128:return "__generator";case 256:return "__values";case 512:return "__read";case 1024:return "__spreadArray";case 2048:return "__await";case 4096:return "__asyncGenerator";case 8192:return "__asyncDelegator";case 16384:return "__asyncValues";case 32768:return "__exportStar";case 65536:return "__importStar";case 131072:return "__importDefault";case 262144:return "__makeTemplateObject";case 524288:return "__classPrivateFieldGet";case 1048576:return "__classPrivateFieldSet";case 2097152:return "__classPrivateFieldIn";case 4194304:return "__createBinding";default:return e.Debug.fail("Unrecognized helper")}}function CT(t){return function(t){if(!t.decorators)return !1;if(!e.nodeCanBeDecorated(t,t.parent,t.parent.parent))return 168!==t.kind||e.nodeIsPresent(t.body)?QT(t,e.Diagnostics.Decorators_are_not_valid_here):QT(t,e.Diagnostics.A_decorator_can_only_decorate_a_method_implementation_not_an_overload);if(171===t.kind||172===t.kind){var r=e.getAllAccessorDeclarations(t.parent.members,t);if(r.firstAccessor.decorators&&t===r.secondAccessor)return QT(t,e.Diagnostics.Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name)}return !1}(t)||function(t){var r,n,i,a,o,s=function(t){return !!t.modifiers&&(function(t){switch(t.kind){case 171:case 172:case 170:case 166:case 165:case 168:case 167:case 175:case 260:case 265:case 264:case 271:case 270:case 212:case 213:case 163:return !1;default:if(261===t.parent.kind||303===t.parent.kind)return !1;switch(t.kind){case 255:return ET(t,131);case 256:case 179:return ET(t,126);case 257:case 236:case 258:case 169:return !0;case 259:return ET(t,85);default:e.Debug.fail();}}}(t)?QT(t,e.Diagnostics.Modifiers_cannot_appear_here):void 0)}(t);if(void 0!==s)return s;for(var c=0,l=0,u=t.modifiers;l<u.length;l++){var _=u[l];if(144!==_.kind){if(165===t.kind||167===t.kind)return YT(_,e.Diagnostics._0_modifier_cannot_appear_on_a_type_member,e.tokenToString(_.kind));if(175===t.kind&&(124!==_.kind||!e.isClassLike(t.parent)))return YT(_,e.Diagnostics._0_modifier_cannot_appear_on_an_index_signature,e.tokenToString(_.kind))}switch(_.kind){case 85:if(259!==t.kind)return YT(t,e.Diagnostics.A_class_member_cannot_have_the_0_keyword,e.tokenToString(85));break;case 158:if(16384&c)return YT(_,e.Diagnostics._0_modifier_already_seen,"override");if(2&c)return YT(_,e.Diagnostics._0_modifier_cannot_be_used_with_1_modifier,"override","declare");if(64&c)return YT(_,e.Diagnostics._0_modifier_must_precede_1_modifier,"override","readonly");if(256&c)return YT(_,e.Diagnostics._0_modifier_must_precede_1_modifier,"override","async");c|=16384,o=_;break;case 123:case 122:case 121:var d=Ua(e.modifierToFlag(_.kind));if(28&c)return YT(_,e.Diagnostics.Accessibility_modifier_already_seen);if(16384&c)return YT(_,e.Diagnostics._0_modifier_must_precede_1_modifier,d,"override");if(32&c)return YT(_,e.Diagnostics._0_modifier_must_precede_1_modifier,d,"static");if(64&c)return YT(_,e.Diagnostics._0_modifier_must_precede_1_modifier,d,"readonly");if(256&c)return YT(_,e.Diagnostics._0_modifier_must_precede_1_modifier,d,"async");if(261===t.parent.kind||303===t.parent.kind)return YT(_,e.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element,d);if(128&c)return 121===_.kind?YT(_,e.Diagnostics._0_modifier_cannot_be_used_with_1_modifier,d,"abstract"):YT(_,e.Diagnostics._0_modifier_must_precede_1_modifier,d,"abstract");if(e.isPrivateIdentifierClassElementDeclaration(t))return YT(_,e.Diagnostics.An_accessibility_modifier_cannot_be_used_with_a_private_identifier);c|=e.modifierToFlag(_.kind);break;case 124:if(32&c)return YT(_,e.Diagnostics._0_modifier_already_seen,"static");if(64&c)return YT(_,e.Diagnostics._0_modifier_must_precede_1_modifier,"static","readonly");if(256&c)return YT(_,e.Diagnostics._0_modifier_must_precede_1_modifier,"static","async");if(261===t.parent.kind||303===t.parent.kind)return YT(_,e.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element,"static");if(163===t.kind)return YT(_,e.Diagnostics._0_modifier_cannot_appear_on_a_parameter,"static");if(128&c)return YT(_,e.Diagnostics._0_modifier_cannot_be_used_with_1_modifier,"static","abstract");if(16384&c)return YT(_,e.Diagnostics._0_modifier_must_precede_1_modifier,"static","override");c|=32,r=_;break;case 144:if(64&c)return YT(_,e.Diagnostics._0_modifier_already_seen,"readonly");if(166!==t.kind&&165!==t.kind&&175!==t.kind&&163!==t.kind)return YT(_,e.Diagnostics.readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature);c|=64,a=_;break;case 93:if(1&c)return YT(_,e.Diagnostics._0_modifier_already_seen,"export");if(2&c)return YT(_,e.Diagnostics._0_modifier_must_precede_1_modifier,"export","declare");if(128&c)return YT(_,e.Diagnostics._0_modifier_must_precede_1_modifier,"export","abstract");if(256&c)return YT(_,e.Diagnostics._0_modifier_must_precede_1_modifier,"export","async");if(e.isClassLike(t.parent))return YT(_,e.Diagnostics._0_modifier_cannot_appear_on_class_elements_of_this_kind,"export");if(163===t.kind)return YT(_,e.Diagnostics._0_modifier_cannot_appear_on_a_parameter,"export");c|=1;break;case 88:var p=303===t.parent.kind?t.parent:t.parent.parent;if(260===p.kind&&!e.isAmbientModule(p))return YT(_,e.Diagnostics.A_default_export_can_only_be_used_in_an_ECMAScript_style_module);if(!(1&c))return YT(_,e.Diagnostics._0_modifier_must_precede_1_modifier,"export","default");c|=512;break;case 135:if(2&c)return YT(_,e.Diagnostics._0_modifier_already_seen,"declare");if(256&c)return YT(_,e.Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context,"async");if(16384&c)return YT(_,e.Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context,"override");if(e.isClassLike(t.parent)&&!e.isPropertyDeclaration(t))return YT(_,e.Diagnostics._0_modifier_cannot_appear_on_class_elements_of_this_kind,"declare");if(163===t.kind)return YT(_,e.Diagnostics._0_modifier_cannot_appear_on_a_parameter,"declare");if(8388608&t.parent.flags&&261===t.parent.kind)return YT(_,e.Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context);if(e.isPrivateIdentifierClassElementDeclaration(t))return YT(_,e.Diagnostics._0_modifier_cannot_be_used_with_a_private_identifier,"declare");c|=2,n=_;break;case 126:if(128&c)return YT(_,e.Diagnostics._0_modifier_already_seen,"abstract");if(256!==t.kind&&179!==t.kind){if(168!==t.kind&&166!==t.kind&&171!==t.kind&&172!==t.kind)return YT(_,e.Diagnostics.abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration);if(256!==t.parent.kind||!e.hasSyntacticModifier(t.parent,128))return YT(_,e.Diagnostics.Abstract_methods_can_only_appear_within_an_abstract_class);if(32&c)return YT(_,e.Diagnostics._0_modifier_cannot_be_used_with_1_modifier,"static","abstract");if(8&c)return YT(_,e.Diagnostics._0_modifier_cannot_be_used_with_1_modifier,"private","abstract");if(256&c&&i)return YT(i,e.Diagnostics._0_modifier_cannot_be_used_with_1_modifier,"async","abstract");if(16384&c)return YT(_,e.Diagnostics._0_modifier_must_precede_1_modifier,"abstract","override")}if(e.isNamedDeclaration(t)&&80===t.name.kind)return YT(_,e.Diagnostics._0_modifier_cannot_be_used_with_a_private_identifier,"abstract");c|=128;break;case 131:if(256&c)return YT(_,e.Diagnostics._0_modifier_already_seen,"async");if(2&c||8388608&t.parent.flags)return YT(_,e.Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context,"async");if(163===t.kind)return YT(_,e.Diagnostics._0_modifier_cannot_appear_on_a_parameter,"async");if(128&c)return YT(_,e.Diagnostics._0_modifier_cannot_be_used_with_1_modifier,"async","abstract");c|=256,i=_;}}return 170===t.kind?32&c?YT(r,e.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration,"static"):128&c?YT(r,e.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration,"abstract"):16384&c?YT(o,e.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration,"override"):256&c?YT(i,e.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration,"async"):!!(64&c)&&YT(a,e.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration,"readonly"):(265===t.kind||264===t.kind)&&2&c?YT(n,e.Diagnostics.A_0_modifier_cannot_be_used_with_an_import_declaration,"declare"):163===t.kind&&16476&c&&e.isBindingPattern(t.name)?YT(t,e.Diagnostics.A_parameter_property_may_not_be_declared_using_a_binding_pattern):163===t.kind&&16476&c&&t.dotDotDotToken?YT(t,e.Diagnostics.A_parameter_property_cannot_be_declared_using_a_rest_parameter):!!(256&c)&&function(t,r){switch(t.kind){case 168:case 255:case 212:case 213:return !1}return YT(r,e.Diagnostics._0_modifier_cannot_be_used_here,"async")}(t,i)}(t)}function ET(e,t){return e.modifiers.length>1||e.modifiers[0].kind!==t}function kT(t,r){return void 0===r&&(r=e.Diagnostics.Trailing_comma_not_allowed),!(!t||!t.hasTrailingComma)&&XT(t[0],t.end-",".length,",".length,r)}function NT(t,r){if(t&&0===t.length){var n=t.pos-"<".length;return XT(r,n,e.skipTrivia(r.text,t.end)+">".length-n,e.Diagnostics.Type_parameter_list_cannot_be_empty)}return !1}function FT(t){var r=e.getSourceFileOfNode(t);return CT(t)||NT(t.typeParameters,r)||function(t){for(var r=!1,n=t.length,i=0;i<n;i++){var a=t[i];if(a.dotDotDotToken){if(i!==n-1)return YT(a.dotDotDotToken,e.Diagnostics.A_rest_parameter_must_be_last_in_a_parameter_list);if(8388608&a.flags||kT(t,e.Diagnostics.A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma),a.questionToken)return YT(a.questionToken,e.Diagnostics.A_rest_parameter_cannot_be_optional);if(a.initializer)return YT(a.name,e.Diagnostics.A_rest_parameter_cannot_have_an_initializer)}else if(nl(a)){if(r=!0,a.questionToken&&a.initializer)return YT(a.name,e.Diagnostics.Parameter_cannot_have_question_mark_and_initializer)}else if(r&&!a.initializer)return YT(a.name,e.Diagnostics.A_required_parameter_cannot_follow_an_optional_parameter)}}(t.parameters)||function(t,r){if(!e.isArrowFunction(t))return !1;t.typeParameters&&!(e.length(t.typeParameters)>1||t.typeParameters.hasTrailingComma||t.typeParameters[0].constraint)&&r&&e.fileExtensionIsOneOf(r.fileName,[".mts",".cts"])&&YT(t.typeParameters[0],e.Diagnostics.This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Add_a_trailing_comma_or_explicit_constraint);var n=t.equalsGreaterThanToken;return e.getLineAndCharacterOfPosition(r,n.pos).line!==e.getLineAndCharacterOfPosition(r,n.end).line&&YT(n,e.Diagnostics.Line_terminator_not_permitted_before_arrow)}(t,r)||e.isFunctionLikeDeclaration(t)&&function(t){if(K>=3){var r=t.body&&e.isBlock(t.body)&&e.findUseStrictPrologue(t.body.statements);if(r){var i=(o=t.parameters,e.filter(o,(function(t){return !!t.initializer||e.isBindingPattern(t.name)||e.isRestParameter(t)})));if(e.length(i)){e.forEach(i,(function(t){e.addRelatedInfo(In(t,e.Diagnostics.This_parameter_is_not_allowed_with_use_strict_directive),e.createDiagnosticForNode(r,e.Diagnostics.use_strict_directive_used_here));}));var a=i.map((function(t,r){return 0===r?e.createDiagnosticForNode(t,e.Diagnostics.Non_simple_parameter_declared_here):e.createDiagnosticForNode(t,e.Diagnostics.and_here)}));return e.addRelatedInfo.apply(void 0,n$3([In(r,e.Diagnostics.use_strict_directive_cannot_be_used_with_non_simple_parameter_list)],a,!1)),!0}}}var o;return !1}(t)}function AT(t,r){return kT(r)||function(t,r){if(r&&0===r.length){var n=e.getSourceFileOfNode(t),i=r.pos-"<".length;return XT(n,i,e.skipTrivia(n.text,r.end)+">".length-i,e.Diagnostics.Type_argument_list_cannot_be_empty)}return !1}(t,r)}function PT(t){return function(t){if(t)for(var r=0,n=t;r<n.length;r++){var i=n[r];if(226===i.kind)return XT(i,i.pos,0,e.Diagnostics.Argument_expression_expected)}return !1}(t)}function wT(t){var r=t.types;if(kT(r))return !0;if(r&&0===r.length){var n=e.tokenToString(t.token);return XT(t,r.pos,0,e.Diagnostics._0_list_cannot_be_empty,n)}return e.some(r,IT)}function IT(e){return AT(e,e.typeArguments)}function OT(t){if(161!==t.kind)return !1;var r=t;return 220===r.expression.kind&&27===r.expression.operatorToken.kind&&YT(r.expression,e.Diagnostics.A_comma_expression_is_not_allowed_in_a_computed_property_name)}function MT(t){if(t.asteriskToken){if(e.Debug.assert(255===t.kind||212===t.kind||168===t.kind),8388608&t.flags)return YT(t.asteriskToken,e.Diagnostics.Generators_are_not_allowed_in_an_ambient_context);if(!t.body)return YT(t.asteriskToken,e.Diagnostics.An_overload_signature_cannot_be_declared_as_a_generator)}}function LT(e,t){return !!e&&YT(e,t)}function RT(e,t){return !!e&&YT(e,t)}function BT(t){if($T(t))return !0;if(243===t.kind&&t.awaitModifier&&!(32768&t.flags)){var r=e.getSourceFileOfNode(t);if(e.isInTopLevelContext(t))GT(r)||(e.isEffectiveExternalModule(r,U)||mn.add(e.createDiagnosticForNode(t.awaitModifier,e.Diagnostics.for_await_loops_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module)),(V!==e.ModuleKind.ES2022&&V!==e.ModuleKind.ESNext&&V!==e.ModuleKind.System&&(V!==e.ModuleKind.NodeNext||e.getSourceFileOfNode(t).impliedNodeFormat!==e.ModuleKind.ESNext)||K<4)&&mn.add(e.createDiagnosticForNode(t.awaitModifier,e.Diagnostics.Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher)));else if(!GT(r)){var n=e.createDiagnosticForNode(t.awaitModifier,e.Diagnostics.for_await_loops_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules),i=e.getContainingFunction(t);if(i&&170!==i.kind){e.Debug.assert(0==(2&e.getFunctionFlags(i)),"Enclosing function should never be an async function.");var a=e.createDiagnosticForNode(i,e.Diagnostics.Did_you_mean_to_mark_this_function_as_async);e.addRelatedInfo(n,a);}return mn.add(n),!0}return !1}if(e.isForOfStatement(t)&&!(32768&t.flags)&&e.isIdentifier(t.initializer)&&"async"===t.initializer.escapedText)return YT(t.initializer,e.Diagnostics.The_left_hand_side_of_a_for_of_statement_may_not_be_async),!1;if(254===t.initializer.kind){var o=t.initializer;if(!WT(o)){var s=o.declarations;if(!s.length)return !1;if(s.length>1)return n=242===t.kind?e.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement:e.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement,QT(o.declarations[1],n);var c=s[0];if(c.initializer){n=242===t.kind?e.Diagnostics.The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer:e.Diagnostics.The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer;return YT(c.name,n)}if(c.type)return YT(c,n=242===t.kind?e.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation:e.Diagnostics.The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation)}}return !1}function jT(t){if(t.parameters.length===(171===t.kind?1:2))return e.getThisParameter(t)}function JT(t,r){if(function(t){return e.isDynamicName(t)&&!ks(t)}(t))return YT(t,r)}function zT(t){if(FT(t))return !0;if(168===t.kind){if(204===t.parent.kind){if(t.modifiers&&(1!==t.modifiers.length||131!==e.first(t.modifiers).kind))return QT(t,e.Diagnostics.Modifiers_cannot_appear_here);if(LT(t.questionToken,e.Diagnostics.An_object_member_cannot_be_declared_optional))return !0;if(RT(t.exclamationToken,e.Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context))return !0;if(void 0===t.body)return XT(t,t.end-1,";".length,e.Diagnostics._0_expected,"{")}if(MT(t))return !0}if(e.isClassLike(t.parent)){if(K<2&&e.isPrivateIdentifier(t.name))return YT(t.name,e.Diagnostics.Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher);if(8388608&t.flags)return JT(t.name,e.Diagnostics.A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type);if(168===t.kind&&!t.body)return JT(t.name,e.Diagnostics.A_computed_property_name_in_a_method_overload_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type)}else {if(257===t.parent.kind)return JT(t.name,e.Diagnostics.A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type);if(181===t.parent.kind)return JT(t.name,e.Diagnostics.A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type)}}function UT(t){return e.isStringOrNumericLiteralLike(t)||218===t.kind&&40===t.operator&&8===t.operand.kind}function KT(t){var r,n=t.initializer;if(n){var i=!(UT(n)||function(t){if((e.isPropertyAccessExpression(t)||e.isElementAccessExpression(t)&&UT(t.argumentExpression))&&e.isEntityNameExpression(t.expression))return !!(1024&zb(t).flags)}(n)||110===n.kind||95===n.kind||(r=n,9===r.kind||218===r.kind&&40===r.operator&&9===r.operand.kind)),a=e.isDeclarationReadonly(t)||e.isVariableDeclaration(t)&&e.isVarConst(t);if(!a||t.type)return YT(n,e.Diagnostics.Initializers_are_not_allowed_in_ambient_contexts);if(i)return YT(n,e.Diagnostics.A_const_initializer_in_an_ambient_context_must_be_a_string_or_numeric_literal_or_literal_enum_reference);if(!a||i)return YT(n,e.Diagnostics.Initializers_are_not_allowed_in_ambient_contexts)}}function VT(t){if(79===t.kind){if("__esModule"===e.idText(t))return a=t,o=e.Diagnostics.Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules,!GT(e.getSourceFileOfNode(a))&&(Pn("noEmit",a,o,void 0,void 0,void 0),!0)}else for(var r=0,n=t.elements;r<n.length;r++){var i=n[r];if(!e.isOmittedExpression(i))return VT(i.name)}var a,o;return !1}function qT(t){if(79===t.kind){if(119===t.originalKeywordKind)return YT(t,e.Diagnostics.let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations)}else for(var r=0,n=t.elements;r<n.length;r++){var i=n[r];e.isOmittedExpression(i)||qT(i.name);}return !1}function WT(t){var r=t.declarations;return !!kT(t.declarations)||!t.declarations.length&&XT(t,r.pos,r.end-r.pos,e.Diagnostics.Variable_declaration_list_cannot_be_empty)}function HT(e){switch(e.kind){case 238:case 239:case 240:case 247:case 241:case 242:case 243:return !1;case 249:return HT(e.parent)}return !0}function GT(e){return e.parseDiagnostics.length>0}function QT(t,r,n,i,a){var o=e.getSourceFileOfNode(t);if(!GT(o)){var s=e.getSpanOfTokenAtPosition(o,t.pos);return mn.add(e.createFileDiagnostic(o,s.start,s.length,r,n,i,a)),!0}return !1}function XT(t,r,n,i,a,o,s){var c=e.getSourceFileOfNode(t);return !GT(c)&&(mn.add(e.createFileDiagnostic(c,r,n,i,a,o,s)),!0)}function YT(t,r,n,i,a){return !GT(e.getSourceFileOfNode(t))&&(mn.add(e.createDiagnosticForNode(t,r,n,i,a)),!0)}function ZT(t){return 257!==t.kind&&258!==t.kind&&265!==t.kind&&264!==t.kind&&271!==t.kind&&270!==t.kind&&263!==t.kind&&!e.hasSyntacticModifier(t,515)&&QT(t,e.Diagnostics.Top_level_declarations_in_d_ts_files_must_start_with_either_a_declare_or_export_modifier)}function $T(t){if(8388608&t.flags){if(!Qn(t).hasReportedStatementInAmbientContext&&(e.isFunctionLike(t.parent)||e.isAccessor(t.parent)))return Qn(t).hasReportedStatementInAmbientContext=QT(t,e.Diagnostics.An_implementation_cannot_be_declared_in_ambient_contexts);if(234===t.parent.kind||261===t.parent.kind||303===t.parent.kind){var r=Qn(t.parent);if(!r.hasReportedStatementInAmbientContext)return r.hasReportedStatementInAmbientContext=QT(t,e.Diagnostics.Statements_are_not_allowed_in_ambient_contexts)}}return !1}function eC(t){if(32&t.numericLiteralFlags){var r=void 0;if(K>=1?r=e.Diagnostics.Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher_Use_the_syntax_0:e.isChildOfNodeWithKind(t,195)?r=e.Diagnostics.Octal_literal_types_must_use_ES2015_syntax_Use_the_syntax_0:e.isChildOfNodeWithKind(t,297)&&(r=e.Diagnostics.Octal_literals_are_not_allowed_in_enums_members_initializer_Use_the_syntax_0),r){var n=e.isPrefixUnaryExpression(t.parent)&&40===t.parent.operator,i=(n?"-":"")+"0o"+t.text;return YT(n?t.parent:t,r,i)}}return function(t){if(!(16&t.numericLiteralFlags||t.text.length<=15||-1!==t.text.indexOf("."))){var r=+e.getTextOfNode(t);r<=Math.pow(2,53)-1&&r+1>r||On(!1,e.createDiagnosticForNode(t,e.Diagnostics.Numeric_literals_with_absolute_values_equal_to_2_53_or_greater_are_too_large_to_be_represented_accurately_as_integers));}}(t),!1}function tC(t){return !!e.forEach(t.elements,(function(t){if(t.isTypeOnly)return QT(t,269===t.kind?e.Diagnostics.The_type_modifier_cannot_be_used_on_a_named_import_when_import_type_is_used_on_its_import_statement:e.Diagnostics.The_type_modifier_cannot_be_used_on_a_named_export_when_export_type_is_used_on_its_export_statement)}))}function rC(t,r,n,i){if(1048576&r.flags&&2621440&t.flags){var a=Og(r,t);if(a)return a;var o=yc(t);if(o){var s=Pg(o,r);if(s)return kp(r,e.map(s,(function(e){return [function(){return Uo(e)},e.escapedName]})),n,void 0,i)}}}},function(e){e.JSX="JSX",e.IntrinsicElements="IntrinsicElements",e.ElementClass="ElementClass",e.ElementAttributesPropertyNameContainer="ElementAttributesProperty",e.ElementChildrenAttributeNameContainer="ElementChildrenAttribute",e.Element="Element",e.IntrinsicAttributes="IntrinsicAttributes",e.IntrinsicClassAttributes="IntrinsicClassAttributes",e.LibraryManagedAttributes="LibraryManagedAttributes";}(A||(A={})),e.signatureHasRestParameter=J,e.signatureHasLiteralTypes=z;}(t),function(e){function t(t,r,n,i){if(void 0===t||void 0===r)return t;var a,o=r(t);return o===t?t:void 0!==o?(a=e.isArray(o)?(i||c)(o):o,e.Debug.assertNode(a,n),a):void 0}function r(t,r,n,i,a){if(void 0===t||void 0===r)return t;var o,s,c=t.length;(void 0===i||i<0)&&(i=0),(void 0===a||a>c-i)&&(a=c-i);var l=-1,u=-1;(i>0||a<c)&&(o=[],s=t.hasTrailingComma&&i+a===c);for(var _=0;_<a;_++){var d=t[_+i],p=void 0!==d?r(d):void 0;if((void 0!==o||void 0===p||p!==d)&&(void 0===o&&(o=t.slice(0,_),s=t.hasTrailingComma,l=t.pos,u=t.end),p))if(e.isArray(p))for(var f=0,g=p;f<g.length;f++){var m=g[f];e.Debug.assertNode(m,n),o.push(m);}else e.Debug.assertNode(p,n),o.push(p);}if(o){var y=e.factory.createNodeArray(o,s);return e.setTextRangePosEnd(y,l,u),y}return t}function n(t,n,i,a,o,s){return void 0===s&&(s=r),i.startLexicalEnvironment(),t=s(t,n,e.isStatement,a),o&&(t=i.factory.ensureUseStrict(t)),e.factory.mergeLexicalEnvironment(t,i.endLexicalEnvironment())}function i(t,n,i,o){var s;return void 0===o&&(o=r),i.startLexicalEnvironment(),t&&(i.setLexicalEnvironmentFlags(1,!0),s=o(t,n,e.isParameterDeclaration),2&i.getLexicalEnvironmentFlags()&&e.getEmitScriptTarget(i.getCompilerOptions())>=2&&(s=function(t,r){for(var n,i=0;i<t.length;i++){var o=t[i],s=a(o,r);(n||s!==o)&&(n||(n=t.slice(0,i)),n[i]=s);}return n?e.setTextRange(r.factory.createNodeArray(n,t.hasTrailingComma),t):t}(s,i)),i.setLexicalEnvironmentFlags(1,!1)),i.suspendLexicalEnvironment(),s}function a(t,r){return t.dotDotDotToken?t:e.isBindingPattern(t.name)?function(e,t){var r=t.factory;return t.addInitializationStatement(r.createVariableStatement(void 0,r.createVariableDeclarationList([r.createVariableDeclaration(e.name,void 0,e.type,e.initializer?r.createConditionalExpression(r.createStrictEquality(r.getGeneratedNameForNode(e),r.createVoidZero()),void 0,e.initializer,void 0,r.getGeneratedNameForNode(e)):r.getGeneratedNameForNode(e))]))),r.updateParameterDeclaration(e,e.decorators,e.modifiers,e.dotDotDotToken,r.getGeneratedNameForNode(e),e.questionToken,e.type,void 0)}(t,r):t.initializer?function(t,r,n,i){var a=i.factory;return i.addInitializationStatement(a.createIfStatement(a.createTypeCheck(a.cloneNode(r),"undefined"),e.setEmitFlags(e.setTextRange(a.createBlock([a.createExpressionStatement(e.setEmitFlags(e.setTextRange(a.createAssignment(e.setEmitFlags(a.cloneNode(r),48),e.setEmitFlags(n,1584|e.getEmitFlags(n))),t),1536))]),t),1953))),a.updateParameterDeclaration(t,t.decorators,t.modifiers,t.dotDotDotToken,t.name,t.questionToken,t.type,void 0)}(t,t.name,t.initializer,r):t}function o(r,n,i,a){void 0===a&&(a=t),i.resumeLexicalEnvironment();var o=a(r,n,e.isConciseBody),s=i.endLexicalEnvironment();if(e.some(s)){if(!o)return i.factory.createBlock(s);var c=i.factory.converters.convertToFunctionBlock(o),l=e.factory.mergeLexicalEnvironment(c.statements,s);return i.factory.updateBlock(c,l)}return o}function s(r,n,i){i.startBlockScope();var a=t(r,n,e.isStatement,i.factory.liftToBlock),o=i.endBlockScope();return e.some(o)?e.isBlock(a)?(o.push.apply(o,a.statements),i.factory.updateBlock(a,o)):(o.push(a),i.factory.createBlock(o)):a}function c(t){return e.Debug.assert(t.length<=1,"Too many nodes written to output."),e.singleOrUndefined(t)}e.visitNode=t,e.visitNodes=r,e.visitLexicalEnvironment=n,e.visitParameterList=i,e.visitFunctionBody=o,e.visitIterationBody=s,e.visitEachChild=function(a,c,l,u,_,d){if(void 0===u&&(u=r),void 0===d&&(d=t),void 0!==a){var p=a.kind;if(p>0&&p<=159||191===p)return a;var f=l.factory;switch(p){case 79:return e.Debug.type(a),f.updateIdentifier(a,u(a.typeArguments,c,e.isTypeNodeOrTypeParameterDeclaration));case 160:return e.Debug.type(a),f.updateQualifiedName(a,d(a.left,c,e.isEntityName),d(a.right,c,e.isIdentifier));case 161:return e.Debug.type(a),f.updateComputedPropertyName(a,d(a.expression,c,e.isExpression));case 162:return e.Debug.type(a),f.updateTypeParameterDeclaration(a,d(a.name,c,e.isIdentifier),d(a.constraint,c,e.isTypeNode),d(a.default,c,e.isTypeNode));case 163:return e.Debug.type(a),f.updateParameterDeclaration(a,u(a.decorators,c,e.isDecorator),u(a.modifiers,c,e.isModifier),d(a.dotDotDotToken,_,e.isDotDotDotToken),d(a.name,c,e.isBindingName),d(a.questionToken,_,e.isQuestionToken),d(a.type,c,e.isTypeNode),d(a.initializer,c,e.isExpression));case 164:return e.Debug.type(a),f.updateDecorator(a,d(a.expression,c,e.isExpression));case 165:return e.Debug.type(a),f.updatePropertySignature(a,u(a.modifiers,c,e.isModifier),d(a.name,c,e.isPropertyName),d(a.questionToken,_,e.isToken),d(a.type,c,e.isTypeNode));case 166:return e.Debug.type(a),f.updatePropertyDeclaration(a,u(a.decorators,c,e.isDecorator),u(a.modifiers,c,e.isModifier),d(a.name,c,e.isPropertyName),d(a.questionToken||a.exclamationToken,_,e.isQuestionOrExclamationToken),d(a.type,c,e.isTypeNode),d(a.initializer,c,e.isExpression));case 167:return e.Debug.type(a),f.updateMethodSignature(a,u(a.modifiers,c,e.isModifier),d(a.name,c,e.isPropertyName),d(a.questionToken,_,e.isQuestionToken),u(a.typeParameters,c,e.isTypeParameterDeclaration),u(a.parameters,c,e.isParameterDeclaration),d(a.type,c,e.isTypeNode));case 168:return e.Debug.type(a),f.updateMethodDeclaration(a,u(a.decorators,c,e.isDecorator),u(a.modifiers,c,e.isModifier),d(a.asteriskToken,_,e.isAsteriskToken),d(a.name,c,e.isPropertyName),d(a.questionToken,_,e.isQuestionToken),u(a.typeParameters,c,e.isTypeParameterDeclaration),i(a.parameters,c,l,u),d(a.type,c,e.isTypeNode),o(a.body,c,l,d));case 170:return e.Debug.type(a),f.updateConstructorDeclaration(a,u(a.decorators,c,e.isDecorator),u(a.modifiers,c,e.isModifier),i(a.parameters,c,l,u),o(a.body,c,l,d));case 171:return e.Debug.type(a),f.updateGetAccessorDeclaration(a,u(a.decorators,c,e.isDecorator),u(a.modifiers,c,e.isModifier),d(a.name,c,e.isPropertyName),i(a.parameters,c,l,u),d(a.type,c,e.isTypeNode),o(a.body,c,l,d));case 172:return e.Debug.type(a),f.updateSetAccessorDeclaration(a,u(a.decorators,c,e.isDecorator),u(a.modifiers,c,e.isModifier),d(a.name,c,e.isPropertyName),i(a.parameters,c,l,u),o(a.body,c,l,d));case 169:return e.Debug.type(a),l.startLexicalEnvironment(),l.suspendLexicalEnvironment(),f.updateClassStaticBlockDeclaration(a,u(a.decorators,c,e.isDecorator),u(a.modifiers,c,e.isModifier),o(a.body,c,l,d));case 173:return e.Debug.type(a),f.updateCallSignature(a,u(a.typeParameters,c,e.isTypeParameterDeclaration),u(a.parameters,c,e.isParameterDeclaration),d(a.type,c,e.isTypeNode));case 174:return e.Debug.type(a),f.updateConstructSignature(a,u(a.typeParameters,c,e.isTypeParameterDeclaration),u(a.parameters,c,e.isParameterDeclaration),d(a.type,c,e.isTypeNode));case 175:return e.Debug.type(a),f.updateIndexSignature(a,u(a.decorators,c,e.isDecorator),u(a.modifiers,c,e.isModifier),u(a.parameters,c,e.isParameterDeclaration),d(a.type,c,e.isTypeNode));case 176:return e.Debug.type(a),f.updateTypePredicateNode(a,d(a.assertsModifier,c,e.isAssertsKeyword),d(a.parameterName,c,e.isIdentifierOrThisTypeNode),d(a.type,c,e.isTypeNode));case 177:return e.Debug.type(a),f.updateTypeReferenceNode(a,d(a.typeName,c,e.isEntityName),u(a.typeArguments,c,e.isTypeNode));case 178:return e.Debug.type(a),f.updateFunctionTypeNode(a,u(a.typeParameters,c,e.isTypeParameterDeclaration),u(a.parameters,c,e.isParameterDeclaration),d(a.type,c,e.isTypeNode));case 179:return e.Debug.type(a),f.updateConstructorTypeNode(a,u(a.modifiers,c,e.isModifier),u(a.typeParameters,c,e.isTypeParameterDeclaration),u(a.parameters,c,e.isParameterDeclaration),d(a.type,c,e.isTypeNode));case 180:return e.Debug.type(a),f.updateTypeQueryNode(a,d(a.exprName,c,e.isEntityName));case 181:return e.Debug.type(a),f.updateTypeLiteralNode(a,u(a.members,c,e.isTypeElement));case 182:return e.Debug.type(a),f.updateArrayTypeNode(a,d(a.elementType,c,e.isTypeNode));case 183:return e.Debug.type(a),f.updateTupleTypeNode(a,u(a.elements,c,e.isTypeNode));case 184:return e.Debug.type(a),f.updateOptionalTypeNode(a,d(a.type,c,e.isTypeNode));case 185:return e.Debug.type(a),f.updateRestTypeNode(a,d(a.type,c,e.isTypeNode));case 186:return e.Debug.type(a),f.updateUnionTypeNode(a,u(a.types,c,e.isTypeNode));case 187:return e.Debug.type(a),f.updateIntersectionTypeNode(a,u(a.types,c,e.isTypeNode));case 188:return e.Debug.type(a),f.updateConditionalTypeNode(a,d(a.checkType,c,e.isTypeNode),d(a.extendsType,c,e.isTypeNode),d(a.trueType,c,e.isTypeNode),d(a.falseType,c,e.isTypeNode));case 189:return e.Debug.type(a),f.updateInferTypeNode(a,d(a.typeParameter,c,e.isTypeParameterDeclaration));case 199:return e.Debug.type(a),f.updateImportTypeNode(a,d(a.argument,c,e.isTypeNode),d(a.qualifier,c,e.isEntityName),r(a.typeArguments,c,e.isTypeNode),a.isTypeOf);case 196:return e.Debug.type(a),f.updateNamedTupleMember(a,t(a.dotDotDotToken,c,e.isDotDotDotToken),t(a.name,c,e.isIdentifier),t(a.questionToken,c,e.isQuestionToken),t(a.type,c,e.isTypeNode));case 190:return e.Debug.type(a),f.updateParenthesizedType(a,d(a.type,c,e.isTypeNode));case 192:return e.Debug.type(a),f.updateTypeOperatorNode(a,d(a.type,c,e.isTypeNode));case 193:return e.Debug.type(a),f.updateIndexedAccessTypeNode(a,d(a.objectType,c,e.isTypeNode),d(a.indexType,c,e.isTypeNode));case 194:return e.Debug.type(a),f.updateMappedTypeNode(a,d(a.readonlyToken,_,e.isReadonlyKeywordOrPlusOrMinusToken),d(a.typeParameter,c,e.isTypeParameterDeclaration),d(a.nameType,c,e.isTypeNode),d(a.questionToken,_,e.isQuestionOrPlusOrMinusToken),d(a.type,c,e.isTypeNode),u(a.members,c,e.isTypeElement));case 195:return e.Debug.type(a),f.updateLiteralTypeNode(a,d(a.literal,c,e.isExpression));case 197:return e.Debug.type(a),f.updateTemplateLiteralType(a,d(a.head,c,e.isTemplateHead),u(a.templateSpans,c,e.isTemplateLiteralTypeSpan));case 198:return e.Debug.type(a),f.updateTemplateLiteralTypeSpan(a,d(a.type,c,e.isTypeNode),d(a.literal,c,e.isTemplateMiddleOrTemplateTail));case 200:return e.Debug.type(a),f.updateObjectBindingPattern(a,u(a.elements,c,e.isBindingElement));case 201:return e.Debug.type(a),f.updateArrayBindingPattern(a,u(a.elements,c,e.isArrayBindingElement));case 202:return e.Debug.type(a),f.updateBindingElement(a,d(a.dotDotDotToken,_,e.isDotDotDotToken),d(a.propertyName,c,e.isPropertyName),d(a.name,c,e.isBindingName),d(a.initializer,c,e.isExpression));case 203:return e.Debug.type(a),f.updateArrayLiteralExpression(a,u(a.elements,c,e.isExpression));case 204:return e.Debug.type(a),f.updateObjectLiteralExpression(a,u(a.properties,c,e.isObjectLiteralElementLike));case 205:return 32&a.flags?(e.Debug.type(a),f.updatePropertyAccessChain(a,d(a.expression,c,e.isExpression),d(a.questionDotToken,_,e.isQuestionDotToken),d(a.name,c,e.isMemberName))):(e.Debug.type(a),f.updatePropertyAccessExpression(a,d(a.expression,c,e.isExpression),d(a.name,c,e.isMemberName)));case 206:return 32&a.flags?(e.Debug.type(a),f.updateElementAccessChain(a,d(a.expression,c,e.isExpression),d(a.questionDotToken,_,e.isQuestionDotToken),d(a.argumentExpression,c,e.isExpression))):(e.Debug.type(a),f.updateElementAccessExpression(a,d(a.expression,c,e.isExpression),d(a.argumentExpression,c,e.isExpression)));case 207:return 32&a.flags?(e.Debug.type(a),f.updateCallChain(a,d(a.expression,c,e.isExpression),d(a.questionDotToken,_,e.isQuestionDotToken),u(a.typeArguments,c,e.isTypeNode),u(a.arguments,c,e.isExpression))):(e.Debug.type(a),f.updateCallExpression(a,d(a.expression,c,e.isExpression),u(a.typeArguments,c,e.isTypeNode),u(a.arguments,c,e.isExpression)));case 208:return e.Debug.type(a),f.updateNewExpression(a,d(a.expression,c,e.isExpression),u(a.typeArguments,c,e.isTypeNode),u(a.arguments,c,e.isExpression));case 209:return e.Debug.type(a),f.updateTaggedTemplateExpression(a,d(a.tag,c,e.isExpression),r(a.typeArguments,c,e.isTypeNode),d(a.template,c,e.isTemplateLiteral));case 210:return e.Debug.type(a),f.updateTypeAssertion(a,d(a.type,c,e.isTypeNode),d(a.expression,c,e.isExpression));case 211:return e.Debug.type(a),f.updateParenthesizedExpression(a,d(a.expression,c,e.isExpression));case 212:return e.Debug.type(a),f.updateFunctionExpression(a,u(a.modifiers,c,e.isModifier),d(a.asteriskToken,_,e.isAsteriskToken),d(a.name,c,e.isIdentifier),u(a.typeParameters,c,e.isTypeParameterDeclaration),i(a.parameters,c,l,u),d(a.type,c,e.isTypeNode),o(a.body,c,l,d));case 213:return e.Debug.type(a),f.updateArrowFunction(a,u(a.modifiers,c,e.isModifier),u(a.typeParameters,c,e.isTypeParameterDeclaration),i(a.parameters,c,l,u),d(a.type,c,e.isTypeNode),d(a.equalsGreaterThanToken,_,e.isEqualsGreaterThanToken),o(a.body,c,l,d));case 214:return e.Debug.type(a),f.updateDeleteExpression(a,d(a.expression,c,e.isExpression));case 215:return e.Debug.type(a),f.updateTypeOfExpression(a,d(a.expression,c,e.isExpression));case 216:return e.Debug.type(a),f.updateVoidExpression(a,d(a.expression,c,e.isExpression));case 217:return e.Debug.type(a),f.updateAwaitExpression(a,d(a.expression,c,e.isExpression));case 218:return e.Debug.type(a),f.updatePrefixUnaryExpression(a,d(a.operand,c,e.isExpression));case 219:return e.Debug.type(a),f.updatePostfixUnaryExpression(a,d(a.operand,c,e.isExpression));case 220:return e.Debug.type(a),f.updateBinaryExpression(a,d(a.left,c,e.isExpression),d(a.operatorToken,_,e.isBinaryOperatorToken),d(a.right,c,e.isExpression));case 221:return e.Debug.type(a),f.updateConditionalExpression(a,d(a.condition,c,e.isExpression),d(a.questionToken,_,e.isQuestionToken),d(a.whenTrue,c,e.isExpression),d(a.colonToken,_,e.isColonToken),d(a.whenFalse,c,e.isExpression));case 222:return e.Debug.type(a),f.updateTemplateExpression(a,d(a.head,c,e.isTemplateHead),u(a.templateSpans,c,e.isTemplateSpan));case 223:return e.Debug.type(a),f.updateYieldExpression(a,d(a.asteriskToken,_,e.isAsteriskToken),d(a.expression,c,e.isExpression));case 224:return e.Debug.type(a),f.updateSpreadElement(a,d(a.expression,c,e.isExpression));case 225:return e.Debug.type(a),f.updateClassExpression(a,u(a.decorators,c,e.isDecorator),u(a.modifiers,c,e.isModifier),d(a.name,c,e.isIdentifier),u(a.typeParameters,c,e.isTypeParameterDeclaration),u(a.heritageClauses,c,e.isHeritageClause),u(a.members,c,e.isClassElement));case 227:return e.Debug.type(a),f.updateExpressionWithTypeArguments(a,d(a.expression,c,e.isExpression),u(a.typeArguments,c,e.isTypeNode));case 228:return e.Debug.type(a),f.updateAsExpression(a,d(a.expression,c,e.isExpression),d(a.type,c,e.isTypeNode));case 229:return 32&a.flags?(e.Debug.type(a),f.updateNonNullChain(a,d(a.expression,c,e.isExpression))):(e.Debug.type(a),f.updateNonNullExpression(a,d(a.expression,c,e.isExpression)));case 230:return e.Debug.type(a),f.updateMetaProperty(a,d(a.name,c,e.isIdentifier));case 232:return e.Debug.type(a),f.updateTemplateSpan(a,d(a.expression,c,e.isExpression),d(a.literal,c,e.isTemplateMiddleOrTemplateTail));case 234:return e.Debug.type(a),f.updateBlock(a,u(a.statements,c,e.isStatement));case 236:return e.Debug.type(a),f.updateVariableStatement(a,u(a.modifiers,c,e.isModifier),d(a.declarationList,c,e.isVariableDeclarationList));case 237:return e.Debug.type(a),f.updateExpressionStatement(a,d(a.expression,c,e.isExpression));case 238:return e.Debug.type(a),f.updateIfStatement(a,d(a.expression,c,e.isExpression),d(a.thenStatement,c,e.isStatement,f.liftToBlock),d(a.elseStatement,c,e.isStatement,f.liftToBlock));case 239:return e.Debug.type(a),f.updateDoStatement(a,s(a.statement,c,l),d(a.expression,c,e.isExpression));case 240:return e.Debug.type(a),f.updateWhileStatement(a,d(a.expression,c,e.isExpression),s(a.statement,c,l));case 241:return e.Debug.type(a),f.updateForStatement(a,d(a.initializer,c,e.isForInitializer),d(a.condition,c,e.isExpression),d(a.incrementor,c,e.isExpression),s(a.statement,c,l));case 242:return e.Debug.type(a),f.updateForInStatement(a,d(a.initializer,c,e.isForInitializer),d(a.expression,c,e.isExpression),s(a.statement,c,l));case 243:return e.Debug.type(a),f.updateForOfStatement(a,d(a.awaitModifier,_,e.isAwaitKeyword),d(a.initializer,c,e.isForInitializer),d(a.expression,c,e.isExpression),s(a.statement,c,l));case 244:return e.Debug.type(a),f.updateContinueStatement(a,d(a.label,c,e.isIdentifier));case 245:return e.Debug.type(a),f.updateBreakStatement(a,d(a.label,c,e.isIdentifier));case 246:return e.Debug.type(a),f.updateReturnStatement(a,d(a.expression,c,e.isExpression));case 247:return e.Debug.type(a),f.updateWithStatement(a,d(a.expression,c,e.isExpression),d(a.statement,c,e.isStatement,f.liftToBlock));case 248:return e.Debug.type(a),f.updateSwitchStatement(a,d(a.expression,c,e.isExpression),d(a.caseBlock,c,e.isCaseBlock));case 249:return e.Debug.type(a),f.updateLabeledStatement(a,d(a.label,c,e.isIdentifier),d(a.statement,c,e.isStatement,f.liftToBlock));case 250:return e.Debug.type(a),f.updateThrowStatement(a,d(a.expression,c,e.isExpression));case 251:return e.Debug.type(a),f.updateTryStatement(a,d(a.tryBlock,c,e.isBlock),d(a.catchClause,c,e.isCatchClause),d(a.finallyBlock,c,e.isBlock));case 253:return e.Debug.type(a),f.updateVariableDeclaration(a,d(a.name,c,e.isBindingName),d(a.exclamationToken,_,e.isExclamationToken),d(a.type,c,e.isTypeNode),d(a.initializer,c,e.isExpression));case 254:return e.Debug.type(a),f.updateVariableDeclarationList(a,u(a.declarations,c,e.isVariableDeclaration));case 255:return e.Debug.type(a),f.updateFunctionDeclaration(a,u(a.decorators,c,e.isDecorator),u(a.modifiers,c,e.isModifier),d(a.asteriskToken,_,e.isAsteriskToken),d(a.name,c,e.isIdentifier),u(a.typeParameters,c,e.isTypeParameterDeclaration),i(a.parameters,c,l,u),d(a.type,c,e.isTypeNode),o(a.body,c,l,d));case 256:return e.Debug.type(a),f.updateClassDeclaration(a,u(a.decorators,c,e.isDecorator),u(a.modifiers,c,e.isModifier),d(a.name,c,e.isIdentifier),u(a.typeParameters,c,e.isTypeParameterDeclaration),u(a.heritageClauses,c,e.isHeritageClause),u(a.members,c,e.isClassElement));case 257:return e.Debug.type(a),f.updateInterfaceDeclaration(a,u(a.decorators,c,e.isDecorator),u(a.modifiers,c,e.isModifier),d(a.name,c,e.isIdentifier),u(a.typeParameters,c,e.isTypeParameterDeclaration),u(a.heritageClauses,c,e.isHeritageClause),u(a.members,c,e.isTypeElement));case 258:return e.Debug.type(a),f.updateTypeAliasDeclaration(a,u(a.decorators,c,e.isDecorator),u(a.modifiers,c,e.isModifier),d(a.name,c,e.isIdentifier),u(a.typeParameters,c,e.isTypeParameterDeclaration),d(a.type,c,e.isTypeNode));case 259:return e.Debug.type(a),f.updateEnumDeclaration(a,u(a.decorators,c,e.isDecorator),u(a.modifiers,c,e.isModifier),d(a.name,c,e.isIdentifier),u(a.members,c,e.isEnumMember));case 260:return e.Debug.type(a),f.updateModuleDeclaration(a,u(a.decorators,c,e.isDecorator),u(a.modifiers,c,e.isModifier),d(a.name,c,e.isModuleName),d(a.body,c,e.isModuleBody));case 261:return e.Debug.type(a),f.updateModuleBlock(a,u(a.statements,c,e.isStatement));case 262:return e.Debug.type(a),f.updateCaseBlock(a,u(a.clauses,c,e.isCaseOrDefaultClause));case 263:return e.Debug.type(a),f.updateNamespaceExportDeclaration(a,d(a.name,c,e.isIdentifier));case 264:return e.Debug.type(a),f.updateImportEqualsDeclaration(a,u(a.decorators,c,e.isDecorator),u(a.modifiers,c,e.isModifier),a.isTypeOnly,d(a.name,c,e.isIdentifier),d(a.moduleReference,c,e.isModuleReference));case 265:return e.Debug.type(a),f.updateImportDeclaration(a,u(a.decorators,c,e.isDecorator),u(a.modifiers,c,e.isModifier),d(a.importClause,c,e.isImportClause),d(a.moduleSpecifier,c,e.isExpression),d(a.assertClause,c,e.isAssertClause));case 292:return e.Debug.type(a),f.updateAssertClause(a,u(a.elements,c,e.isAssertEntry),a.multiLine);case 293:return e.Debug.type(a),f.updateAssertEntry(a,d(a.name,c,e.isAssertionKey),d(a.value,c,e.isStringLiteral));case 266:return e.Debug.type(a),f.updateImportClause(a,a.isTypeOnly,d(a.name,c,e.isIdentifier),d(a.namedBindings,c,e.isNamedImportBindings));case 267:return e.Debug.type(a),f.updateNamespaceImport(a,d(a.name,c,e.isIdentifier));case 273:return e.Debug.type(a),f.updateNamespaceExport(a,d(a.name,c,e.isIdentifier));case 268:return e.Debug.type(a),f.updateNamedImports(a,u(a.elements,c,e.isImportSpecifier));case 269:return e.Debug.type(a),f.updateImportSpecifier(a,a.isTypeOnly,d(a.propertyName,c,e.isIdentifier),d(a.name,c,e.isIdentifier));case 270:return e.Debug.type(a),f.updateExportAssignment(a,u(a.decorators,c,e.isDecorator),u(a.modifiers,c,e.isModifier),d(a.expression,c,e.isExpression));case 271:return e.Debug.type(a),f.updateExportDeclaration(a,u(a.decorators,c,e.isDecorator),u(a.modifiers,c,e.isModifier),a.isTypeOnly,d(a.exportClause,c,e.isNamedExportBindings),d(a.moduleSpecifier,c,e.isExpression),d(a.assertClause,c,e.isAssertClause));case 272:return e.Debug.type(a),f.updateNamedExports(a,u(a.elements,c,e.isExportSpecifier));case 274:return e.Debug.type(a),f.updateExportSpecifier(a,a.isTypeOnly,d(a.propertyName,c,e.isIdentifier),d(a.name,c,e.isIdentifier));case 276:return e.Debug.type(a),f.updateExternalModuleReference(a,d(a.expression,c,e.isExpression));case 277:return e.Debug.type(a),f.updateJsxElement(a,d(a.openingElement,c,e.isJsxOpeningElement),u(a.children,c,e.isJsxChild),d(a.closingElement,c,e.isJsxClosingElement));case 278:return e.Debug.type(a),f.updateJsxSelfClosingElement(a,d(a.tagName,c,e.isJsxTagNameExpression),u(a.typeArguments,c,e.isTypeNode),d(a.attributes,c,e.isJsxAttributes));case 279:return e.Debug.type(a),f.updateJsxOpeningElement(a,d(a.tagName,c,e.isJsxTagNameExpression),u(a.typeArguments,c,e.isTypeNode),d(a.attributes,c,e.isJsxAttributes));case 280:return e.Debug.type(a),f.updateJsxClosingElement(a,d(a.tagName,c,e.isJsxTagNameExpression));case 281:return e.Debug.type(a),f.updateJsxFragment(a,d(a.openingFragment,c,e.isJsxOpeningFragment),u(a.children,c,e.isJsxChild),d(a.closingFragment,c,e.isJsxClosingFragment));case 284:return e.Debug.type(a),f.updateJsxAttribute(a,d(a.name,c,e.isIdentifier),d(a.initializer,c,e.isStringLiteralOrJsxExpression));case 285:return e.Debug.type(a),f.updateJsxAttributes(a,u(a.properties,c,e.isJsxAttributeLike));case 286:return e.Debug.type(a),f.updateJsxSpreadAttribute(a,d(a.expression,c,e.isExpression));case 287:return e.Debug.type(a),f.updateJsxExpression(a,d(a.expression,c,e.isExpression));case 288:return e.Debug.type(a),f.updateCaseClause(a,d(a.expression,c,e.isExpression),u(a.statements,c,e.isStatement));case 289:return e.Debug.type(a),f.updateDefaultClause(a,u(a.statements,c,e.isStatement));case 290:return e.Debug.type(a),f.updateHeritageClause(a,u(a.types,c,e.isExpressionWithTypeArguments));case 291:return e.Debug.type(a),f.updateCatchClause(a,d(a.variableDeclaration,c,e.isVariableDeclaration),d(a.block,c,e.isBlock));case 294:return e.Debug.type(a),f.updatePropertyAssignment(a,d(a.name,c,e.isPropertyName),d(a.initializer,c,e.isExpression));case 295:return e.Debug.type(a),f.updateShorthandPropertyAssignment(a,d(a.name,c,e.isIdentifier),d(a.objectAssignmentInitializer,c,e.isExpression));case 296:return e.Debug.type(a),f.updateSpreadAssignment(a,d(a.expression,c,e.isExpression));case 297:return e.Debug.type(a),f.updateEnumMember(a,d(a.name,c,e.isPropertyName),d(a.initializer,c,e.isExpression));case 303:return e.Debug.type(a),f.updateSourceFile(a,n(a.statements,c,l));case 348:return e.Debug.type(a),f.updatePartiallyEmittedExpression(a,d(a.expression,c,e.isExpression));case 349:return e.Debug.type(a),f.updateCommaListExpression(a,u(a.elements,c,e.isExpression));default:return a}}};}(t),function(e){e.createSourceMapGenerator=function(t,r,n,i,o){var s,c,l=o.extendedDiagnostics?e.performance.createTimer("Source Map","beforeSourcemap","afterSourcemap"):e.performance.nullTimer,u=l.enter,_=l.exit,d=[],p=[],f=new e.Map,g=[],m=[],y="",v=0,h=0,b=0,x=0,D=0,S=0,T=!1,C=0,E=0,k=0,N=0,F=0,A=0,P=!1,w=!1,I=!1;return {getSources:function(){return d},addSource:O,setSourceContent:M,addName:L,addMapping:R,appendSourceMap:function(t,r,n,i,o,s){e.Debug.assert(t>=C,"generatedLine cannot backtrack"),e.Debug.assert(r>=0,"generatedCharacter cannot be negative"),u();for(var c,l=[],d=a(n.mappings),p=d.next();!p.done;p=d.next()){var f=p.value;if(s&&(f.generatedLine>s.line||f.generatedLine===s.line&&f.generatedCharacter>s.character))break;if(!o||!(f.generatedLine<o.line||o.line===f.generatedLine&&f.generatedCharacter<o.character)){var g=void 0,m=void 0,y=void 0,v=void 0;if(void 0!==f.sourceIndex){if(void 0===(g=l[f.sourceIndex])){var h=n.sources[f.sourceIndex],b=n.sourceRoot?e.combinePaths(n.sourceRoot,h):h,x=e.combinePaths(e.getDirectoryPath(i),b);l[f.sourceIndex]=g=O(x),n.sourcesContent&&"string"==typeof n.sourcesContent[f.sourceIndex]&&M(g,n.sourcesContent[f.sourceIndex]);}m=f.sourceLine,y=f.sourceCharacter,n.names&&void 0!==f.nameIndex&&(c||(c=[]),void 0===(v=c[f.nameIndex])&&(c[f.nameIndex]=v=L(n.names[f.nameIndex])));}var D=f.generatedLine-(o?o.line:0),S=D+t,T=o&&o.line===f.generatedLine?f.generatedCharacter-o.character:f.generatedCharacter;R(S,0===D?T+r:T,g,m,y,v);}}_();},toJSON:z,toString:function(){return JSON.stringify(z())}};function O(r){u();var n=e.getRelativePathToDirectoryOrUrl(i,r,t.getCurrentDirectory(),t.getCanonicalFileName,!0),a=f.get(n);return void 0===a&&(a=p.length,p.push(n),d.push(r),f.set(n,a)),_(),a}function M(e,t){if(u(),null!==t){for(s||(s=[]);s.length<e;)s.push(null);s[e]=t;}_();}function L(t){u(),c||(c=new e.Map);var r=c.get(t);return void 0===r&&(r=g.length,g.push(t),c.set(t,r)),_(),r}function R(t,r,n,i,a,o){e.Debug.assert(t>=C,"generatedLine cannot backtrack"),e.Debug.assert(r>=0,"generatedCharacter cannot be negative"),e.Debug.assert(void 0===n||n>=0,"sourceIndex cannot be negative"),e.Debug.assert(void 0===i||i>=0,"sourceLine cannot be negative"),e.Debug.assert(void 0===a||a>=0,"sourceCharacter cannot be negative"),u(),(function(e,t){return !P||C!==e||E!==t}(t,r)||function(e,t,r){return void 0!==e&&void 0!==t&&void 0!==r&&k===e&&(N>t||N===t&&F>r)}(n,i,a))&&(j(),C=t,E=r,w=!1,I=!1,P=!0),void 0!==n&&void 0!==i&&void 0!==a&&(k=n,N=i,F=a,w=!0,void 0!==o&&(A=o,I=!0)),_();}function B(e){m.push(e),m.length>=1024&&J();}function j(){if(P&&(!T||v!==C||h!==E||b!==k||x!==N||D!==F||S!==A)){if(u(),v<C){do{B(59),v++;}while(v<C);h=0;}else e.Debug.assertEqual(v,C,"generatedLine cannot backtrack"),T&&B(44);U(E-h),h=E,w&&(U(k-b),b=k,U(N-x),x=N,U(F-D),D=F,I&&(U(A-S),S=A)),T=!0,_();}}function J(){m.length>0&&(y+=String.fromCharCode.apply(void 0,m),m.length=0);}function z(){return j(),J(),{version:3,file:r,sourceRoot:n,sources:p,names:g,mappings:y,sourcesContent:s}}function U(t){t<0?t=1+(-t<<1):t<<=1;do{var r=31&t;(t>>=5)>0&&(r|=32),B((n=r)>=0&&n<26?65+n:n>=26&&n<52?97+n-26:n>=52&&n<62?48+n-52:62===n?43:63===n?47:e.Debug.fail("".concat(n,": not a base64 value")));}while(t>0);var n;}};var t=/^\/\/[@#] source[M]appingURL=(.+)\r?\n?$/,r=/^\s*(\/\/[@#] .*)?$/;function n(e){return "string"==typeof e||null===e}function i(t){return null!==t&&"object"==typeof t&&3===t.version&&"string"==typeof t.file&&"string"==typeof t.mappings&&e.isArray(t.sources)&&e.every(t.sources,e.isString)&&(void 0===t.sourceRoot||null===t.sourceRoot||"string"==typeof t.sourceRoot)&&(void 0===t.sourcesContent||null===t.sourcesContent||e.isArray(t.sourcesContent)&&e.every(t.sourcesContent,n))&&(void 0===t.names||null===t.names||e.isArray(t.names)&&e.every(t.names,e.isString))}function a(e){var t,r=!1,n=0,i=0,a=0,o=0,s=0,c=0,l=0;return {get pos(){return n},get error(){return t},get state(){return u(!0,!0)},next:function(){for(;!r&&n<e.length;){var t=e.charCodeAt(n);if(59!==t){if(44!==t){var d=!1,y=!1;if(a+=m(),f())return _();if(a<0)return p("Invalid generatedCharacter found");if(!g()){if(d=!0,o+=m(),f())return _();if(o<0)return p("Invalid sourceIndex found");if(g())return p("Unsupported Format: No entries after sourceIndex");if(s+=m(),f())return _();if(s<0)return p("Invalid sourceLine found");if(g())return p("Unsupported Format: No entries after sourceLine");if(c+=m(),f())return _();if(c<0)return p("Invalid sourceCharacter found");if(!g()){if(y=!0,l+=m(),f())return _();if(l<0)return p("Invalid nameIndex found");if(!g())return p("Unsupported Error Format: Entries after nameIndex")}}return {value:u(d,y),done:r}}n++;}else i++,a=0,n++;}return _()}};function u(e,t){return {generatedLine:i,generatedCharacter:a,sourceIndex:e?o:void 0,sourceLine:e?s:void 0,sourceCharacter:e?c:void 0,nameIndex:t?l:void 0}}function _(){return r=!0,{value:void 0,done:!0}}function d(e){void 0===t&&(t=e);}function p(e){return d(e),_()}function f(){return void 0!==t}function g(){return n===e.length||44===e.charCodeAt(n)||59===e.charCodeAt(n)}function m(){for(var t,r=!0,i=0,a=0;r;n++){if(n>=e.length)return d("Error in decoding base64VLQFormatDecode, past the mapping string"),-1;var o=(t=e.charCodeAt(n))>=65&&t<=90?t-65:t>=97&&t<=122?t-97+26:t>=48&&t<=57?t-48+52:43===t?62:47===t?63:-1;if(-1===o)return d("Invalid character in VLQ"),-1;r=0!=(32&o),a|=(31&o)<<i,i+=5;}return 0==(1&a)?a>>=1:a=-(a>>=1),a}}function o(e){return void 0!==e.sourceIndex&&void 0!==e.sourceLine&&void 0!==e.sourceCharacter}function s(e){return void 0!==e.sourceIndex&&void 0!==e.sourcePosition}function c(e,t){return e.generatedPosition===t.generatedPosition&&e.sourceIndex===t.sourceIndex&&e.sourcePosition===t.sourcePosition}function l(t,r){return e.Debug.assert(t.sourceIndex===r.sourceIndex),e.compareValues(t.sourcePosition,r.sourcePosition)}function u(t,r){return e.compareValues(t.generatedPosition,r.generatedPosition)}function _(e){return e.sourcePosition}function d(e){return e.generatedPosition}e.getLineInfo=function(e,t){return {getLineCount:function(){return t.length},getLineText:function(r){return e.substring(t[r],t[r+1])}}},e.tryGetSourceMappingURL=function(n){for(var i=n.getLineCount()-1;i>=0;i--){var a=n.getLineText(i),o=t.exec(a);if(o)return e.trimStringEnd(o[1]);if(!a.match(r))break}},e.isRawSourceMap=i,e.tryParseRawSourceMap=function(e){try{var t=JSON.parse(e);if(i(t))return t}catch(e){}},e.decodeMappings=a,e.sameMapping=function(e,t){return e===t||e.generatedLine===t.generatedLine&&e.generatedCharacter===t.generatedCharacter&&e.sourceIndex===t.sourceIndex&&e.sourceLine===t.sourceLine&&e.sourceCharacter===t.sourceCharacter&&e.nameIndex===t.nameIndex},e.isSourceMapping=o,e.createDocumentPositionMapper=function(t,r,n){var i,p,f,g=e.getDirectoryPath(n),m=r.sourceRoot?e.getNormalizedAbsolutePath(r.sourceRoot,g):g,y=e.getNormalizedAbsolutePath(r.file,g),v=t.getSourceFileLike(y),h=r.sources.map((function(t){return e.getNormalizedAbsolutePath(t,m)})),b=new e.Map(h.map((function(e,r){return [t.getCanonicalFileName(e),r]})));return {getSourcePosition:function(t){var r=T();if(!e.some(r))return t;var n=e.binarySearchKey(r,t.pos,d,e.compareValues);n<0&&(n=~n);var i=r[n];return void 0!==i&&s(i)?{fileName:h[i.sourceIndex],pos:i.sourcePosition}:t},getGeneratedPosition:function(r){var n=b.get(t.getCanonicalFileName(r.fileName));if(void 0===n)return r;var i=S(n);if(!e.some(i))return r;var a=e.binarySearchKey(i,r.pos,_,e.compareValues);a<0&&(a=~a);var o=i[a];return void 0===o||o.sourceIndex!==n?r:{fileName:y,pos:o.generatedPosition}}};function x(n){var i,a,s=void 0!==v?e.getPositionOfLineAndCharacter(v,n.generatedLine,n.generatedCharacter,!0):-1;if(o(n)){var c=t.getSourceFileLike(h[n.sourceIndex]);i=r.sources[n.sourceIndex],a=void 0!==c?e.getPositionOfLineAndCharacter(c,n.sourceLine,n.sourceCharacter,!0):-1;}return {generatedPosition:s,source:i,sourceIndex:n.sourceIndex,sourcePosition:a,nameIndex:n.nameIndex}}function D(){if(void 0===i){var n=a(r.mappings),o=e.arrayFrom(n,x);void 0!==n.error?(t.log&&t.log("Encountered error while decoding sourcemap: ".concat(n.error)),i=e.emptyArray):i=o;}return i}function S(t){if(void 0===f){for(var r=[],n=0,i=D();n<i.length;n++){var a=i[n];if(s(a)){var o=r[a.sourceIndex];o||(r[a.sourceIndex]=o=[]),o.push(a);}}f=r.map((function(t){return e.sortAndDeduplicate(t,l,c)}));}return f[t]}function T(){if(void 0===p){for(var t=[],r=0,n=D();r<n.length;r++){var i=n[r];t.push(i);}p=e.sortAndDeduplicate(t,u,c);}return p}},e.identitySourceMapConsumer={getSourcePosition:e.identity,getGeneratedPosition:e.identity};}(t),function(e){function t(t){return (t=e.getOriginalNode(t))?e.getNodeId(t):0}function r(e){return void 0!==e.propertyName&&"default"===e.propertyName.escapedText}function n(t){if(e.getNamespaceDeclarationNode(t))return !0;var n=t.importClause&&t.importClause.namedBindings;if(!n)return !1;if(!e.isNamedImports(n))return !1;for(var i=0,a=0,o=n.elements;a<o.length;a++)r(o[a])&&i++;return i>0&&i!==n.elements.length||!!(n.elements.length-i)&&e.isDefaultImport(t)}function i(t){return !n(t)&&(e.isDefaultImport(t)||!!t.importClause&&e.isNamedImports(t.importClause.namedBindings)&&function(t){return !!t&&!!e.isNamedImports(t)&&e.some(t.elements,r)}(t.importClause.namedBindings))}function a(t,r,n){if(e.isBindingPattern(t.name))for(var i=0,o=t.name.elements;i<o.length;i++){var s=o[i];e.isOmittedExpression(s)||(n=a(s,r,n));}else if(!e.isGeneratedIdentifier(t.name)){var c=e.idText(t.name);r.get(c)||(r.set(c,!0),n=e.append(n,t.name));}return n}function o(e,t,r){var n=e[t];return n?n.push(r):e[t]=n=[r],n}function s(t){return e.isStringLiteralLike(t)||8===t.kind||e.isKeyword(t.kind)||e.isIdentifier(t)}function c(t){return r=t,e.isPropertyDeclaration(r)&&e.hasStaticModifier(r)||e.isClassStaticBlockDeclaration(t);var r;}e.getOriginalNodeId=t,e.chainBundle=function(t,r){return function(n){return 303===n.kind?r(n):function(n){return t.factory.createBundle(e.map(n.sourceFiles,r),n.prepends)}(n)}},e.getExportNeedsImportStarHelper=function(t){return !!e.getNamespaceDeclarationNode(t)},e.getImportNeedsImportStarHelper=n,e.getImportNeedsImportDefaultHelper=i,e.collectExternalModuleInfo=function(r,s,c,l){for(var u,_,d=[],p=e.createMultiMap(),f=[],g=new e.Map,m=!1,y=!1,v=!1,h=!1,b=0,x=s.statements;b<x.length;b++){var D=x[b];switch(D.kind){case 265:d.push(D),!v&&n(D)&&(v=!0),!h&&i(D)&&(h=!0);break;case 264:276===D.moduleReference.kind&&d.push(D);break;case 271:if(D.moduleSpecifier)if(D.exportClause)if(d.push(D),e.isNamedExports(D.exportClause))N(D);else {var S=D.exportClause.name;g.get(e.idText(S))||(o(f,t(D),S),g.set(e.idText(S),!0),u=e.append(u,S)),v=!0;}else d.push(D),y=!0;else N(D);break;case 270:D.isExportEquals&&!_&&(_=D);break;case 236:if(e.hasSyntacticModifier(D,1))for(var T=0,C=D.declarationList.declarations;T<C.length;T++){var E=C[T];u=a(E,g,u);}break;case 255:e.hasSyntacticModifier(D,1)&&(e.hasSyntacticModifier(D,512)?m||(o(f,t(D),r.factory.getDeclarationName(D)),m=!0):(S=D.name,g.get(e.idText(S))||(o(f,t(D),S),g.set(e.idText(S),!0),u=e.append(u,S))));break;case 256:e.hasSyntacticModifier(D,1)&&(e.hasSyntacticModifier(D,512)?m||(o(f,t(D),r.factory.getDeclarationName(D)),m=!0):(S=D.name)&&!g.get(e.idText(S))&&(o(f,t(D),S),g.set(e.idText(S),!0),u=e.append(u,S)));}}var k=e.createExternalHelpersImportDeclarationIfNeeded(r.factory,r.getEmitHelperFactory(),s,l,y,v,h);return k&&d.unshift(k),{externalImports:d,exportSpecifiers:p,exportEquals:_,hasExportStarsToExportValues:y,exportedBindings:f,exportedNames:u,externalHelpersImportDeclaration:k};function N(r){for(var n=0,i=e.cast(r.exportClause,e.isNamedExports).elements;n<i.length;n++){var a=i[n];if(!g.get(e.idText(a.name))){var s=a.propertyName||a.name;r.moduleSpecifier||p.add(e.idText(s),a);var l=c.getReferencedImportDeclaration(s)||c.getReferencedValueDeclaration(s);l&&o(f,t(l),a.name),g.set(e.idText(a.name),!0),u=e.append(u,a.name);}}}},e.isSimpleCopiableExpression=s,e.isSimpleInlineableExpression=function(t){return !e.isIdentifier(t)&&s(t)},e.isCompoundAssignment=function(e){return e>=64&&e<=78},e.getNonAssignmentOperatorForCompoundAssignment=function(e){switch(e){case 64:return 39;case 65:return 40;case 66:return 41;case 67:return 42;case 68:return 43;case 69:return 44;case 70:return 47;case 71:return 48;case 72:return 49;case 73:return 50;case 74:return 51;case 78:return 52;case 75:return 56;case 76:return 55;case 77:return 60}},e.addPrologueDirectivesAndInitialSuperCall=function(t,r,n,i){if(r.body){var a=r.body.statements,o=t.copyPrologue(a,n,!1,i);if(o===a.length)return o;var s=e.findIndex(a,(function(t){return e.isExpressionStatement(t)&&e.isSuperCall(t.expression)}),o);if(s>-1){for(var c=o;c<=s;c++)n.push(e.visitNode(a[c],i,e.isStatement));return s+1}return o}return 0},e.getProperties=function(t,r,n){return e.filter(t.members,(function(t){return function(t,r,n){return e.isPropertyDeclaration(t)&&(!!t.initializer||!r)&&e.hasStaticModifier(t)===n}(t,r,n)}))},e.getStaticPropertiesAndClassStaticBlock=function(t){return e.filter(t.members,c)},e.isInitializedProperty=function(e){return 166===e.kind&&void 0!==e.initializer},e.isNonStaticMethodOrAccessorWithPrivateName=function(t){return !e.isStatic(t)&&e.isMethodOrAccessor(t)&&e.isPrivateIdentifier(t.name)};}(t),function(e){function t(r,n){var i=e.getTargetOfBindingOrAssignmentElement(r);return e.isBindingOrAssignmentPattern(i)?function(r,n){for(var i=0,a=e.getElementsOfBindingOrAssignmentPattern(r);i<a.length;i++)if(t(a[i],n))return !0;return !1}(i,n):!!e.isIdentifier(i)&&i.escapedText===n}function r(t){var n=e.tryGetPropertyNameOfBindingOrAssignmentElement(t);if(n&&e.isComputedPropertyName(n)&&!e.isLiteralExpression(n.expression))return !0;var i,a=e.getTargetOfBindingOrAssignmentElement(t);return !!a&&e.isBindingOrAssignmentPattern(a)&&(i=a,!!e.forEach(e.getElementsOfBindingOrAssignmentPattern(i),r))}function n(t,r,s,c,l){var u=e.getTargetOfBindingOrAssignmentElement(r);if(!l){var _=e.visitNode(e.getInitializerOfBindingOrAssignmentElement(r),t.visitor,e.isExpression);_?s?(s=function(e,t,r,n){return t=o(e,t,!0,n),e.context.factory.createConditionalExpression(e.context.factory.createTypeCheck(t,"undefined"),void 0,r,void 0,t)}(t,s,_,c),!e.isSimpleInlineableExpression(_)&&e.isBindingOrAssignmentPattern(u)&&(s=o(t,s,!0,c))):s=_:s||(s=t.context.factory.createVoidZero());}e.isObjectBindingOrAssignmentPattern(u)?function(t,r,i,s,c){var l,u,_=e.getElementsOfBindingOrAssignmentPattern(i),d=_.length;1!==d&&(s=o(t,s,!e.isDeclarationBindingElement(r)||0!==d,c));for(var p=0;p<d;p++){var f=_[p];if(e.getRestIndicatorOfBindingOrAssignmentElement(f))p===d-1&&(l&&(t.emitBindingOrAssignment(t.createObjectBindingOrAssignmentPattern(l),s,c,i),l=void 0),m=t.context.getEmitHelperFactory().createRestHelper(s,_,u,i),n(t,f,m,f));else {var g=e.getPropertyNameOfBindingOrAssignmentElement(f);if(!(t.level>=1)||49152&f.transformFlags||49152&e.getTargetOfBindingOrAssignmentElement(f).transformFlags||e.isComputedPropertyName(g)){l&&(t.emitBindingOrAssignment(t.createObjectBindingOrAssignmentPattern(l),s,c,i),l=void 0);var m=a(t,s,g);e.isComputedPropertyName(g)&&(u=e.append(u,m.argumentExpression)),n(t,f,m,f);}else l=e.append(l,e.visitNode(f,t.visitor));}}l&&t.emitBindingOrAssignment(t.createObjectBindingOrAssignmentPattern(l),s,c,i);}(t,r,u,s,c):e.isArrayBindingOrAssignmentPattern(u)?function(t,r,a,s,c){var l,u,_=e.getElementsOfBindingOrAssignmentPattern(a),d=_.length;t.level<1&&t.downlevelIteration?s=o(t,e.setTextRange(t.context.getEmitHelperFactory().createReadHelper(s,d>0&&e.getRestIndicatorOfBindingOrAssignmentElement(_[d-1])?void 0:d),c),!1,c):(1!==d&&(t.level<1||0===d)||e.every(_,e.isOmittedExpression))&&(s=o(t,s,!e.isDeclarationBindingElement(r)||0!==d,c));for(var p=0;p<d;p++){var f=_[p];if(t.level>=1)if(32768&f.transformFlags||t.hasTransformedPriorElement&&!i(f)){t.hasTransformedPriorElement=!0;var g=t.context.factory.createTempVariable(void 0);t.hoistTempVariables&&t.context.hoistVariableDeclaration(g),u=e.append(u,[g,f]),l=e.append(l,t.createArrayBindingOrAssignmentElement(g));}else l=e.append(l,f);else {if(e.isOmittedExpression(f))continue;if(e.getRestIndicatorOfBindingOrAssignmentElement(f))p===d-1&&(m=t.context.factory.createArraySliceCall(s,p),n(t,f,m,f));else {var m=t.context.factory.createElementAccessExpression(s,p);n(t,f,m,f);}}}if(l&&t.emitBindingOrAssignment(t.createArrayBindingOrAssignmentPattern(l),s,c,a),u)for(var y=0,v=u;y<v.length;y++){var h=v[y],b=h[0];n(t,f=h[1],b,f);}}(t,r,u,s,c):t.emitBindingOrAssignment(u,s,c,r);}function i(t){var r=e.getTargetOfBindingOrAssignmentElement(t);if(!r||e.isOmittedExpression(r))return !0;var n=e.tryGetPropertyNameOfBindingOrAssignmentElement(t);if(n&&!e.isPropertyNameLiteral(n))return !1;var a=e.getInitializerOfBindingOrAssignmentElement(t);return !(a&&!e.isSimpleInlineableExpression(a))&&(e.isBindingOrAssignmentPattern(r)?e.every(e.getElementsOfBindingOrAssignmentPattern(r),i):e.isIdentifier(r))}function a(t,r,n){if(e.isComputedPropertyName(n)){var i=o(t,e.visitNode(n.expression,t.visitor),!1,n);return t.context.factory.createElementAccessExpression(r,i)}if(e.isStringOrNumericLiteralLike(n))return i=e.factory.cloneNode(n),t.context.factory.createElementAccessExpression(r,i);var a=t.context.factory.createIdentifier(e.idText(n));return t.context.factory.createPropertyAccessExpression(r,a)}function o(t,r,n,i){if(e.isIdentifier(r)&&n)return r;var a=t.context.factory.createTempVariable(void 0);return t.hoistTempVariables?(t.context.hoistVariableDeclaration(a),t.emitExpression(e.setTextRange(t.context.factory.createAssignment(a,r),i))):t.emitBindingOrAssignment(a,r,i,void 0),a}function s(e){return e}var c;(c=e.FlattenLevel||(e.FlattenLevel={}))[c.All=0]="All",c[c.ObjectRest=1]="ObjectRest",e.flattenDestructuringAssignment=function(i,a,c,l,u,_){var d,p,f=i;if(e.isDestructuringAssignment(i))for(d=i.right;e.isEmptyArrayLiteral(i.left)||e.isEmptyObjectLiteral(i.left);){if(!e.isDestructuringAssignment(d))return e.visitNode(d,a,e.isExpression);f=i=d,d=i.right;}var g={context:c,level:l,downlevelIteration:!!c.getCompilerOptions().downlevelIteration,hoistTempVariables:!0,emitExpression:m,emitBindingOrAssignment:function(t,r,n,i){e.Debug.assertNode(t,_?e.isIdentifier:e.isExpression);var o=_?_(t,r,n):e.setTextRange(c.factory.createAssignment(e.visitNode(t,a,e.isExpression),r),n);o.original=i,m(o);},createArrayBindingOrAssignmentPattern:function(t){return function(t,r){return t.createArrayLiteralExpression(e.map(r,t.converters.convertToArrayAssignmentElement))}(c.factory,t)},createObjectBindingOrAssignmentPattern:function(t){return function(t,r){return t.createObjectLiteralExpression(e.map(r,t.converters.convertToObjectAssignmentElement))}(c.factory,t)},createArrayBindingOrAssignmentElement:s,visitor:a};if(d&&(d=e.visitNode(d,a,e.isExpression),e.isIdentifier(d)&&t(i,d.escapedText)||r(i)?d=o(g,d,!1,f):u?d=o(g,d,!0,f):e.nodeIsSynthesized(i)&&(f=d)),n(g,i,d,f,e.isDestructuringAssignment(i)),d&&u){if(!e.some(p))return d;p.push(d);}return c.factory.inlineExpressions(p)||c.factory.createOmittedExpression();function m(t){p=e.append(p,t);}},e.flattenDestructuringBinding=function(i,a,s,c,l,u,_){var d;void 0===u&&(u=!1);var p=[],f=[],g={context:s,level:c,downlevelIteration:!!s.getCompilerOptions().downlevelIteration,hoistTempVariables:u,emitExpression:function(t){d=e.append(d,t);},emitBindingOrAssignment:N,createArrayBindingOrAssignmentPattern:function(t){return function(t,r){return e.Debug.assertEachNode(r,e.isArrayBindingElement),t.createArrayBindingPattern(r)}(s.factory,t)},createObjectBindingOrAssignmentPattern:function(t){return function(t,r){return e.Debug.assertEachNode(r,e.isBindingElement),t.createObjectBindingPattern(r)}(s.factory,t)},createArrayBindingOrAssignmentElement:function(e){return function(e,t){return e.createBindingElement(void 0,void 0,t)}(s.factory,e)},visitor:a};if(e.isVariableDeclaration(i)){var m=e.getInitializerOfBindingOrAssignmentElement(i);m&&(e.isIdentifier(m)&&t(i,m.escapedText)||r(i))&&(m=o(g,e.visitNode(m,g.visitor),!1,m),i=s.factory.updateVariableDeclaration(i,i.name,void 0,void 0,m));}if(n(g,i,l,i,_),d){var y=s.factory.createTempVariable(void 0);if(u){var v=s.factory.inlineExpressions(d);d=void 0,N(y,v,void 0,void 0);}else {s.hoistVariableDeclaration(y);var h=e.last(p);h.pendingExpressions=e.append(h.pendingExpressions,s.factory.createAssignment(y,h.value)),e.addRange(h.pendingExpressions,d),h.value=y;}}for(var b=0,x=p;b<x.length;b++){var D=x[b],S=D.pendingExpressions,T=D.name,C=(v=D.value,D.location),E=D.original,k=s.factory.createVariableDeclaration(T,void 0,void 0,S?s.factory.inlineExpressions(e.append(S,v)):v);k.original=E,e.setTextRange(k,C),f.push(k);}return f;function N(t,r,n,i){e.Debug.assertNode(t,e.isBindingName),d&&(r=s.factory.inlineExpressions(e.append(d,r)),d=void 0),p.push({pendingExpressions:d,name:t,value:r,location:n,original:i});}};}(t),function(e){var t;function r(t){return t.templateFlags?e.factory.createVoidZero():e.factory.createStringLiteral(t.text)}function n(t,r){var n=t.rawText;if(void 0===n){e.Debug.assertIsDefined(r,"Template literal node is missing 'rawText' and does not have a source file. Possibly bad transform."),n=e.getSourceTextOfNodeFromSourceFile(r,t);var i=14===t.kind||17===t.kind;n=n.substring(1,n.length-(i?1:2));}return n=n.replace(/\r\n?/g,"\n"),e.setTextRange(e.factory.createStringLiteral(n),t)}!function(e){e[e.LiftRestriction=0]="LiftRestriction",e[e.All=1]="All";}(t=e.ProcessLevel||(e.ProcessLevel={})),e.processTaggedTemplateExpression=function(i,a,o,s,c,l){var u=e.visitNode(a.tag,o,e.isExpression),_=[void 0],d=[],p=[],f=a.template;if(l===t.LiftRestriction&&!e.hasInvalidEscape(f))return e.visitEachChild(a,o,i);if(e.isNoSubstitutionTemplateLiteral(f))d.push(r(f)),p.push(n(f,s));else {d.push(r(f.head)),p.push(n(f.head,s));for(var g=0,m=f.templateSpans;g<m.length;g++){var y=m[g];d.push(r(y.literal)),p.push(n(y.literal,s)),_.push(e.visitNode(y.expression,o,e.isExpression));}}var v=i.getEmitHelperFactory().createTemplateObjectHelper(e.factory.createArrayLiteralExpression(d),e.factory.createArrayLiteralExpression(p));if(e.isExternalModule(s)){var h=e.factory.createUniqueName("templateObject");c(h),_[0]=e.factory.createLogicalOr(h,e.factory.createAssignment(h,v));}else _[0]=v;return e.factory.createCallExpression(u,void 0,_)};}(t),function(e){var t,r;!function(e){e[e.ClassAliases=1]="ClassAliases",e[e.NamespaceExports=2]="NamespaceExports",e[e.NonQualifiedEnumMembers=8]="NonQualifiedEnumMembers";}(t||(t={})),function(e){e[e.None=0]="None",e[e.HasStaticInitializedProperties=1]="HasStaticInitializedProperties",e[e.HasConstructorDecorators=2]="HasConstructorDecorators",e[e.HasMemberDecorators=4]="HasMemberDecorators",e[e.IsExportOfNamespace=8]="IsExportOfNamespace",e[e.IsNamedExternalExport=16]="IsNamedExternalExport",e[e.IsDefaultExternalExport=32]="IsDefaultExternalExport",e[e.IsDerivedClass=64]="IsDerivedClass",e[e.UseImmediatelyInvokedFunctionExpression=128]="UseImmediatelyInvokedFunctionExpression",e[e.HasAnyDecorators=6]="HasAnyDecorators",e[e.NeedsName=5]="NeedsName",e[e.MayNeedImmediatelyInvokedFunctionExpression=7]="MayNeedImmediatelyInvokedFunctionExpression",e[e.IsExported=56]="IsExported";}(r||(r={})),e.transformTypeScript=function(t){var r,n,i,a,o,s,c,l,u,_,d=t.factory,p=t.getEmitHelperFactory,f=t.startLexicalEnvironment,g=t.resumeLexicalEnvironment,m=t.endLexicalEnvironment,y=t.hoistVariableDeclaration,v=t.getEmitResolver(),h=t.getCompilerOptions(),b=e.getStrictOptionValue(h,"strictNullChecks"),x=e.getEmitScriptTarget(h),D=e.getEmitModuleKind(h),S=t.onEmitNode,T=t.onSubstituteNode;return t.onEmitNode=function(t,n,i){var a=_,o=r;e.isSourceFile(n)&&(r=n),2&l&&function(t){return 260===e.getOriginalNode(t).kind}(n)&&(_|=2),8&l&&function(t){return 259===e.getOriginalNode(t).kind}(n)&&(_|=8),S(t,n,i),_=a,r=o;},t.onSubstituteNode=function(t,r){return r=T(t,r),1===t?function(t){switch(t.kind){case 79:return function(t){return function(t){if(1&l&&33554432&v.getNodeCheckFlags(t)){var r=v.getReferencedValueDeclaration(t);if(r){var n=u[r.id];if(n){var i=d.cloneNode(n);return e.setSourceMapRange(i,t),e.setCommentRange(i,t),i}}}}(t)||Pe(t)||t}(t);case 205:case 206:return function(t){return function(t){var r=function(t){if(!h.isolatedModules)return e.isPropertyAccessExpression(t)||e.isElementAccessExpression(t)?v.getConstantValue(t):void 0}(t);if(void 0!==r){e.setConstantValue(t,r);var n="string"==typeof r?d.createStringLiteral(r):d.createNumericLiteral(r);if(!h.removeComments){var i=e.getOriginalNode(t,e.isAccessExpression),a=e.isPropertyAccessExpression(i)?e.declarationNameToString(i.name):e.getTextOfNode(i.argumentExpression);e.addSyntheticTrailingComment(n,3," ".concat(a," "));}return n}return t}(t)}(t)}return t}(r):e.isShorthandPropertyAssignment(r)?function(t){if(2&l){var r=t.name,n=Pe(r);if(n){if(t.objectAssignmentInitializer){var i=d.createAssignment(n,t.objectAssignmentInitializer);return e.setTextRange(d.createPropertyAssignment(r,i),t)}return e.setTextRange(d.createPropertyAssignment(r,n),t)}}return t}(r):r},t.enableSubstitution(205),t.enableSubstitution(206),function(t){return 304===t.kind?function(t){return d.createBundle(t.sourceFiles.map(C),e.mapDefined(t.prepends,(function(t){return 306===t.kind?e.createUnparsedSourceFile(t,"js"):t})))}(t):C(t)};function C(n){if(n.isDeclarationFile)return n;r=n;var i=E(n,R);return e.addEmitHelpers(i,t.readEmitHelpers()),r=void 0,i}function E(t,r){var n=a,i=o,l=s,u=c;!function(t){switch(t.kind){case 303:case 262:case 261:case 234:a=t,o=void 0,s=void 0;break;case 256:case 255:if(e.hasSyntacticModifier(t,2))break;t.name?de(t):e.Debug.assert(256===t.kind||e.hasSyntacticModifier(t,512)),e.isClassDeclaration(t)&&(o=t);}}(t);var _=r(t);return a!==n&&(s=l),a=n,o=i,c=u,_}function k(e){return E(e,N)}function N(e){return 1&e.transformFlags?L(e):e}function F(e){return E(e,A)}function A(r){switch(r.kind){case 265:case 264:case 270:case 271:return function(r){if(e.getParseTreeNode(r)!==r)return 1&r.transformFlags?e.visitEachChild(r,k,t):r;switch(r.kind){case 265:return function(t){if(!t.importClause)return t;if(!t.importClause.isTypeOnly){var r=e.visitNode(t.importClause,ye,e.isImportClause);return r||1===h.importsNotUsedAsValues||2===h.importsNotUsedAsValues?d.updateImportDeclaration(t,void 0,void 0,r,t.moduleSpecifier,t.assertClause):void 0}}(r);case 264:return xe(r);case 270:return function(r){return v.isValueAliasDeclaration(r)?e.visitEachChild(r,k,t):void 0}(r);case 271:return function(t){if(!t.isTypeOnly){if(!t.exportClause||e.isNamespaceExport(t.exportClause))return t;var r=!!t.moduleSpecifier&&(1===h.importsNotUsedAsValues||2===h.importsNotUsedAsValues),n=e.visitNode(t.exportClause,(function(t){return function(t,r){return e.isNamespaceExport(t)?function(t){return d.updateNamespaceExport(t,e.visitNode(t.name,k,e.isIdentifier))}(t):function(t,r){var n=e.visitNodes(t.elements,be,e.isExportSpecifier);return r||e.some(n)?d.updateNamedExports(t,n):void 0}(t,r)}(t,r)}),e.isNamedExportBindings);return n?d.updateExportDeclaration(t,void 0,void 0,t.isTypeOnly,n,t.moduleSpecifier,t.assertClause):void 0}}(r);default:e.Debug.fail("Unhandled ellided statement");}}(r);default:return N(r)}}function P(e){return E(e,w)}function w(t){if(271!==t.kind&&265!==t.kind&&266!==t.kind&&(264!==t.kind||276!==t.moduleReference.kind))return 1&t.transformFlags||e.hasSyntacticModifier(t,1)?L(t):t}function I(e){return E(e,O)}function O(t){switch(t.kind){case 170:return oe(t);case 166:return ae(t);case 175:case 171:case 172:case 168:case 169:return N(t);case 233:return t;default:return e.Debug.failBadSyntaxKind(t)}}function M(t){if(!(18654&e.modifierToFlag(t.kind)||n&&93===t.kind))return t}function L(o){if(e.isStatement(o)&&e.hasSyntacticModifier(o,2))return d.createNotEmittedStatement(o);switch(o.kind){case 93:case 88:return n?void 0:o;case 123:case 121:case 122:case 126:case 158:case 85:case 135:case 144:case 182:case 183:case 184:case 185:case 181:case 176:case 162:case 130:case 154:case 133:case 149:case 146:case 143:case 114:case 150:case 179:case 178:case 180:case 177:case 186:case 187:case 188:case 190:case 191:case 192:case 193:case 194:case 195:case 175:case 164:return;case 258:return d.createNotEmittedStatement(o);case 166:return ae(o);case 263:return;case 170:return oe(o);case 257:return d.createNotEmittedStatement(o);case 256:return function(i){if(!(j(i)||n&&e.hasSyntacticModifier(i,1)))return e.visitEachChild(i,k,t);var a=function(t,r){var n=0;e.some(r)&&(n|=1);var i=e.getEffectiveBaseTypeNode(t);return i&&104!==e.skipOuterExpressions(i.expression).kind&&(n|=64),e.classOrConstructorParameterIsDecorated(t)&&(n|=2),e.childIsDecorated(t)&&(n|=4),De(t)?n|=8:function(t){return Se(t)&&e.hasSyntacticModifier(t,512)}(t)?n|=32:Te(t)&&(n|=16),x<=1&&7&n&&(n|=128),n}(i,e.getProperties(i,!0,!0));128&a&&t.startLexicalEnvironment();var o=i.name||(5&a?d.getGeneratedNameForNode(i):void 0),s=2&a?function(r,n){var i=e.moveRangePastDecorators(r),a=function(r){if(16777216&v.getNodeCheckFlags(r)){0==(1&l)&&(l|=1,t.enableSubstitution(79),u=[]);var n=d.createUniqueName(r.name&&!e.isGeneratedIdentifier(r.name)?e.idText(r.name):"default");return u[e.getOriginalNodeId(r)]=n,y(n),n}}(r),o=x<=2?d.getInternalName(r,!1,!0):d.getLocalName(r,!1,!0),s=e.visitNodes(r.heritageClauses,k,e.isHeritageClause),c=J(r),_=d.createClassExpression(void 0,void 0,n,void 0,s,c);e.setOriginalNode(_,r),e.setTextRange(_,i);var p=d.createVariableStatement(void 0,d.createVariableDeclarationList([d.createVariableDeclaration(o,void 0,void 0,a?d.createAssignment(a,_):_)],1));return e.setOriginalNode(p,r),e.setTextRange(p,i),e.setCommentRange(p,r),p}(i,o):function(t,r,n){var i=128&n?void 0:e.visitNodes(t.modifiers,M,e.isModifier),a=d.createClassDeclaration(void 0,i,r,void 0,e.visitNodes(t.heritageClauses,k,e.isHeritageClause),J(t)),o=e.getEmitFlags(t);return 1&n&&(o|=32),e.setTextRange(a,t),e.setOriginalNode(a,t),e.setEmitFlags(a,o),a}(i,o,a),c=[s];if(V(c,i,!1),V(c,i,!0),function(t,r){var n=function(t){var r=K(t,t,function(t){var r=t.decorators,n=U(e.getFirstConstructorWithBody(t));if(r||n)return {decorators:r,parameters:n}}(t));if(r){var n=u&&u[e.getOriginalNodeId(t)],i=x<=2?d.getInternalName(t,!1,!0):d.getLocalName(t,!1,!0),a=p().createDecorateHelper(r,i),o=d.createAssignment(i,n?d.createAssignment(n,a):a);return e.setEmitFlags(o,1536),e.setSourceMapRange(o,e.moveRangePastDecorators(t)),o}}(r);n&&t.push(e.setOriginalNode(d.createExpressionStatement(n),r));}(c,i),128&a){var _=e.createTokenRange(e.skipTrivia(r.text,i.members.end),19),f=d.getInternalName(i),g=d.createPartiallyEmittedExpression(f);e.setTextRangeEnd(g,_.end),e.setEmitFlags(g,1536);var m=d.createReturnStatement(g);e.setTextRangePos(m,_.pos),e.setEmitFlags(m,1920),c.push(m),e.insertStatementsAfterStandardPrologue(c,t.endLexicalEnvironment());var h=d.createImmediatelyInvokedArrowFunction(c);e.setEmitFlags(h,33554432);var b=d.createVariableStatement(void 0,d.createVariableDeclarationList([d.createVariableDeclaration(d.getLocalName(i,!1,!1),void 0,void 0,h)]));e.setOriginalNode(b,i),e.setCommentRange(b,i),e.setSourceMapRange(b,e.moveRangePastDecorators(i)),e.startOnNewLine(b),c=[b];}return 8&a?Ee(c,i):(128&a||2&a)&&(32&a?c.push(d.createExportDefault(d.getLocalName(i,!1,!0))):16&a&&c.push(d.createExternalModuleExport(d.getLocalName(i,!1,!0)))),c.length>1&&(c.push(d.createEndOfDeclarationMarker(i)),e.setEmitFlags(s,4194304|e.getEmitFlags(s))),e.singleOrMany(c)}(o);case 225:return function(r){if(!j(r))return e.visitEachChild(r,k,t);var n=d.createClassExpression(void 0,void 0,r.name,void 0,e.visitNodes(r.heritageClauses,k,e.isHeritageClause),J(r));return e.setOriginalNode(n,r),e.setTextRange(n,r),n}(o);case 290:return function(r){if(117!==r.token)return e.visitEachChild(r,k,t)}(o);case 227:return function(t){return d.updateExpressionWithTypeArguments(t,e.visitNode(t.expression,k,e.isLeftHandSideExpression),void 0)}(o);case 168:return function(r){if(ie(r)){var n=d.updateMethodDeclaration(r,void 0,e.visitNodes(r.modifiers,M,e.isModifier),r.asteriskToken,ne(r),void 0,void 0,e.visitParameterList(r.parameters,k,t),void 0,e.visitFunctionBody(r.body,k,t));return n!==r&&(e.setCommentRange(n,r),e.setSourceMapRange(n,e.moveRangePastDecorators(r))),n}}(o);case 171:return function(r){if(ce(r)){var n=d.updateGetAccessorDeclaration(r,void 0,e.visitNodes(r.modifiers,M,e.isModifier),ne(r),e.visitParameterList(r.parameters,k,t),void 0,e.visitFunctionBody(r.body,k,t)||d.createBlock([]));return n!==r&&(e.setCommentRange(n,r),e.setSourceMapRange(n,e.moveRangePastDecorators(r))),n}}(o);case 172:return function(r){if(ce(r)){var n=d.updateSetAccessorDeclaration(r,void 0,e.visitNodes(r.modifiers,M,e.isModifier),ne(r),e.visitParameterList(r.parameters,k,t),e.visitFunctionBody(r.body,k,t)||d.createBlock([]));return n!==r&&(e.setCommentRange(n,r),e.setSourceMapRange(n,e.moveRangePastDecorators(r))),n}}(o);case 255:return function(r){if(!ie(r))return d.createNotEmittedStatement(r);var n=d.updateFunctionDeclaration(r,void 0,e.visitNodes(r.modifiers,M,e.isModifier),r.asteriskToken,r.name,void 0,e.visitParameterList(r.parameters,k,t),void 0,e.visitFunctionBody(r.body,k,t)||d.createBlock([]));if(De(r)){var i=[n];return Ee(i,r),i}return n}(o);case 212:return function(r){return ie(r)?d.updateFunctionExpression(r,e.visitNodes(r.modifiers,M,e.isModifier),r.asteriskToken,r.name,void 0,e.visitParameterList(r.parameters,k,t),void 0,e.visitFunctionBody(r.body,k,t)||d.createBlock([])):d.createOmittedExpression()}(o);case 213:return function(r){return d.updateArrowFunction(r,e.visitNodes(r.modifiers,M,e.isModifier),void 0,e.visitParameterList(r.parameters,k,t),void 0,r.equalsGreaterThanToken,e.visitFunctionBody(r.body,k,t))}(o);case 163:return function(t){if(!e.parameterIsThisKeyword(t)){var r=d.updateParameterDeclaration(t,void 0,void 0,t.dotDotDotToken,e.visitNode(t.name,k,e.isBindingName),void 0,void 0,e.visitNode(t.initializer,k,e.isExpression));return r!==t&&(e.setCommentRange(r,t),e.setTextRange(r,e.moveRangePastModifiers(t)),e.setSourceMapRange(r,e.moveRangePastModifiers(t)),e.setEmitFlags(r.name,32)),r}}(o);case 211:return function(n){var i=e.skipOuterExpressions(n.expression,-7);if(e.isAssertionExpression(i)){var a=e.visitNode(n.expression,k,e.isExpression);return e.length(e.getLeadingCommentRangesOfNode(a,r))?d.updateParenthesizedExpression(n,a):d.createPartiallyEmittedExpression(a,n)}return e.visitEachChild(n,k,t)}(o);case 210:case 228:return function(t){var r=e.visitNode(t.expression,k,e.isExpression);return d.createPartiallyEmittedExpression(r,t)}(o);case 207:return function(t){return d.updateCallExpression(t,e.visitNode(t.expression,k,e.isExpression),void 0,e.visitNodes(t.arguments,k,e.isExpression))}(o);case 208:return function(t){return d.updateNewExpression(t,e.visitNode(t.expression,k,e.isExpression),void 0,e.visitNodes(t.arguments,k,e.isExpression))}(o);case 209:return function(t){return d.updateTaggedTemplateExpression(t,e.visitNode(t.tag,k,e.isExpression),void 0,e.visitNode(t.template,k,e.isExpression))}(o);case 229:return function(t){var r=e.visitNode(t.expression,k,e.isLeftHandSideExpression);return d.createPartiallyEmittedExpression(r,t)}(o);case 259:return function(t){if(!function(t){return !e.isEnumConst(t)||e.shouldPreserveConstEnums(h)}(t))return d.createNotEmittedStatement(t);var n=[],o=2,s=fe(n,t);s&&(D===e.ModuleKind.System&&a===r||(o|=512));var c=Fe(t),l=Ae(t),u=e.hasSyntacticModifier(t,1)?d.getExternalModuleOrNamespaceExportName(i,t,!1,!0):d.getLocalName(t,!1,!0),_=d.createLogicalOr(u,d.createAssignment(u,d.createObjectLiteralExpression()));if(_e(t)){var p=d.getLocalName(t,!1,!0);_=d.createAssignment(p,_);}var g=d.createExpressionStatement(d.createCallExpression(d.createFunctionExpression(void 0,void 0,void 0,void 0,[d.createParameterDeclaration(void 0,void 0,void 0,c)],void 0,function(t,r){var n=i;i=r;var a=[];f();var o=e.map(t.members,ue);return e.insertStatementsAfterStandardPrologue(a,m()),e.addRange(a,o),i=n,d.createBlock(e.setTextRange(d.createNodeArray(a),t.members),!0)}(t,l)),void 0,[_]));return e.setOriginalNode(g,t),s&&(e.setSyntheticLeadingComments(g,void 0),e.setSyntheticTrailingComments(g,void 0)),e.setTextRange(g,t),e.addEmitFlags(g,o),n.push(g),n.push(d.createEndOfDeclarationMarker(t)),n}(o);case 236:return function(r){if(De(r)){var n=e.getInitializedVariables(r.declarationList);if(0===n.length)return;return e.setTextRange(d.createExpressionStatement(d.inlineExpressions(e.map(n,le))),r)}return e.visitEachChild(r,k,t)}(o);case 253:return function(t){return d.updateVariableDeclaration(t,e.visitNode(t.name,k,e.isBindingName),void 0,void 0,e.visitNode(t.initializer,k,e.isExpression))}(o);case 260:return ge(o);case 264:return xe(o);case 278:return function(t){return d.updateJsxSelfClosingElement(t,e.visitNode(t.tagName,k,e.isJsxTagNameExpression),void 0,e.visitNode(t.attributes,k,e.isJsxAttributes))}(o);case 279:return function(t){return d.updateJsxOpeningElement(t,e.visitNode(t.tagName,k,e.isJsxTagNameExpression),void 0,e.visitNode(t.attributes,k,e.isJsxAttributes))}(o);default:return e.visitEachChild(o,k,t)}}function R(r){var n=e.getStrictOptionValue(h,"alwaysStrict")&&!(e.isExternalModule(r)&&D>=e.ModuleKind.ES2015)&&!e.isJsonSourceFile(r);return d.updateSourceFile(r,e.visitLexicalEnvironment(r.statements,F,t,0,n))}function B(e){return !!(4096&e.transformFlags)}function j(t){return e.some(t.decorators)||e.some(t.typeParameters)||e.some(t.heritageClauses,B)||e.some(t.members,B)}function J(t){var r=[],n=e.getFirstConstructorWithBody(t),i=n&&e.filter(n.parameters,(function(t){return e.isParameterPropertyDeclaration(t,n)}));if(i)for(var a=0,o=i;a<o.length;a++){var s=o[a];e.isIdentifier(s.name)&&r.push(e.setOriginalNode(d.createPropertyDeclaration(void 0,void 0,s.name,void 0,void 0,void 0),s));}return e.addRange(r,e.visitNodes(t.members,I,e.isClassElement)),e.setTextRange(d.createNodeArray(r),t.members)}function z(t,r,n){return e.nodeOrChildIsDecorated(t,n)&&r===e.isStatic(t)}function U(t){var r;if(t)for(var n=t.parameters,i=n.length>0&&e.parameterIsThisKeyword(n[0]),a=i?1:0,o=i?n.length-1:n.length,s=0;s<o;s++){var c=n[s+a];(r||c.decorators)&&(r||(r=new Array(o)),r[s]=c.decorators);}return r}function K(t,r,n){if(n){var i=[];return e.addRange(i,e.map(n.decorators,W)),e.addRange(i,e.flatMap(n.parameters,H)),function(t,r,n){!function(t,r,n){h.emitDecoratorMetadata&&(function(e){var t=e.kind;return 168===t||171===t||172===t||166===t}(t)&&n.push(p().createMetadataHelper("design:type",G(t))),function(t){switch(t.kind){case 256:case 225:return void 0!==e.getFirstConstructorWithBody(t);case 168:case 171:case 172:return !0}return !1}(t)&&n.push(p().createMetadataHelper("design:paramtypes",function(t,r){var n=e.isClassLike(t)?e.getFirstConstructorWithBody(t):e.isFunctionLike(t)&&e.nodeIsPresent(t.body)?t:void 0,i=[];if(n)for(var a=function(t,r){if(r&&171===t.kind){var n=e.getAllAccessorDeclarations(r.members,t).setAccessor;if(n)return n.parameters}return t.parameters}(n,r),o=a.length,s=0;s<o;s++){var c=a[s];0===s&&e.isIdentifier(c.name)&&"this"===c.name.escapedText||(c.dotDotDotToken?i.push(Q(e.getRestParameterElementType(c.type))):i.push(G(c)));}return d.createArrayLiteralExpression(i)}(t,r))),function(e){return 168===e.kind}(t)&&n.push(p().createMetadataHelper("design:returntype",function(t){return e.isFunctionLike(t)&&t.type?Q(t.type):e.isAsyncFunction(t)?d.createIdentifier("Promise"):d.createVoidZero()}(t))));}(t,r,n);}(t,r,i),i}}function V(t,r,n){e.addRange(t,e.map(function(t,r){for(var n,i=0,a=function(t,r){return e.filter(t.members,r?function(e){return z(e,!0,t)}:function(e){return z(e,!1,t)})}(t,r);i<a.length;i++){var o=q(t,a[i]);o&&(n?n.push(o):n=[o]);}return n}(r,n),Ce));}function q(t,r){var n=K(r,t,function(t,r){switch(r.kind){case 171:case 172:return function(t,r){if(r.body){var n=e.getAllAccessorDeclarations(t.members,r),i=n.firstAccessor,a=n.secondAccessor,o=n.setAccessor,s=i.decorators?i:a&&a.decorators?a:void 0;if(s&&r===s){var c=s.decorators,l=U(o);if(c||l)return {decorators:c,parameters:l}}}}(t,r);case 168:return function(e){if(e.body){var t=e.decorators,r=U(e);if(t||r)return {decorators:t,parameters:r}}}(r);case 166:return function(e){var t=e.decorators;if(t)return {decorators:t}}(r);default:return}}(t,r));if(n){var i=function(t,r){return e.isStatic(r)?d.getDeclarationName(t):function(e){return d.createPropertyAccessExpression(d.getDeclarationName(e),"prototype")}(t)}(t,r),a=re(r,!0),o=x>0?166===r.kind?d.createVoidZero():d.createNull():void 0,s=p().createDecorateHelper(n,i,a,o);return e.setTextRange(s,e.moveRangePastDecorators(r)),e.setEmitFlags(s,1536),s}}function W(t){return e.visitNode(t.expression,k,e.isExpression)}function H(t,r){var n;if(t){n=[];for(var i=0,a=t;i<a.length;i++){var o=a[i],s=p().createParamHelper(W(o),r);e.setTextRange(s,o.expression),e.setEmitFlags(s,1536),n.push(s);}}return n}function G(t){switch(t.kind){case 166:case 163:return Q(t.type);case 172:case 171:return Q(function(t){var r=v.getAllAccessorDeclarations(t);return r.setAccessor&&e.getSetAccessorTypeAnnotationNode(r.setAccessor)||r.getAccessor&&e.getEffectiveReturnTypeNode(r.getAccessor)}(t));case 256:case 225:case 168:return d.createIdentifier("Function");default:return d.createVoidZero()}}function Q(t){if(void 0===t)return d.createIdentifier("Object");switch(t.kind){case 114:case 152:case 143:return d.createVoidZero();case 190:return Q(t.type);case 178:case 179:return d.createIdentifier("Function");case 182:case 183:return d.createIdentifier("Array");case 176:case 133:return d.createIdentifier("Boolean");case 149:return d.createIdentifier("String");case 147:return d.createIdentifier("Object");case 195:switch(t.literal.kind){case 10:case 14:return d.createIdentifier("String");case 218:case 8:return d.createIdentifier("Number");case 9:return te();case 110:case 95:return d.createIdentifier("Boolean");case 104:return d.createVoidZero();default:return e.Debug.failBadSyntaxKind(t.literal)}case 146:return d.createIdentifier("Number");case 157:return te();case 150:return x<2?ee():d.createIdentifier("Symbol");case 177:return function(t){var r=v.getTypeReferenceSerializationKind(t.typeName,o||a);switch(r){case e.TypeReferenceSerializationKind.Unknown:if(e.findAncestor(t,(function(t){return t.parent&&e.isConditionalTypeNode(t.parent)&&(t.parent.trueType===t||t.parent.falseType===t)})))return d.createIdentifier("Object");var n=Z(t.typeName),i=d.createTempVariable(y);return d.createConditionalExpression(d.createTypeCheck(d.createAssignment(i,n),"function"),void 0,i,void 0,d.createIdentifier("Object"));case e.TypeReferenceSerializationKind.TypeWithConstructSignatureAndValue:return $(t.typeName);case e.TypeReferenceSerializationKind.VoidNullableOrNeverType:return d.createVoidZero();case e.TypeReferenceSerializationKind.BigIntLikeType:return te();case e.TypeReferenceSerializationKind.BooleanType:return d.createIdentifier("Boolean");case e.TypeReferenceSerializationKind.NumberLikeType:return d.createIdentifier("Number");case e.TypeReferenceSerializationKind.StringLikeType:return d.createIdentifier("String");case e.TypeReferenceSerializationKind.ArrayLikeType:return d.createIdentifier("Array");case e.TypeReferenceSerializationKind.ESSymbolType:return x<2?ee():d.createIdentifier("Symbol");case e.TypeReferenceSerializationKind.TypeWithCallSignature:return d.createIdentifier("Function");case e.TypeReferenceSerializationKind.Promise:return d.createIdentifier("Promise");case e.TypeReferenceSerializationKind.ObjectType:return d.createIdentifier("Object");default:return e.Debug.assertNever(r)}}(t);case 187:case 186:return X(t.types);case 188:return X([t.trueType,t.falseType]);case 192:if(144===t.operator)return Q(t.type);break;case 180:case 193:case 194:case 181:case 130:case 154:case 191:case 199:break;case 310:case 311:case 315:case 316:case 317:break;case 312:case 313:case 314:return Q(t.type);default:return e.Debug.failBadSyntaxKind(t)}return d.createIdentifier("Object")}function X(t){for(var r,n=0,i=t;n<i.length;n++){for(var a=i[n];190===a.kind;)a=a.type;if(143!==a.kind&&(b||(195!==a.kind||104!==a.literal.kind)&&152!==a.kind)){var o=Q(a);if(e.isIdentifier(o)&&"Object"===o.escapedText)return o;if(r){if(!e.isIdentifier(r)||!e.isIdentifier(o)||r.escapedText!==o.escapedText)return d.createIdentifier("Object")}else r=o;}}return r||d.createVoidZero()}function Y(e,t){return d.createLogicalAnd(d.createStrictInequality(d.createTypeOfExpression(e),d.createStringLiteral("undefined")),t)}function Z(e){if(79===e.kind){var t=$(e);return Y(t,t)}if(79===e.left.kind)return Y($(e.left),$(e));var r=Z(e.left),n=d.createTempVariable(y);return d.createLogicalAnd(d.createLogicalAnd(r.left,d.createStrictInequality(d.createAssignment(n,r.right),d.createVoidZero())),d.createPropertyAccessExpression(n,e.right))}function $(t){switch(t.kind){case 79:var r=e.setParent(e.setTextRange(e.parseNodeFactory.cloneNode(t),t),t.parent);return r.original=void 0,e.setParent(r,e.getParseTreeNode(a)),r;case 160:return function(e){return d.createPropertyAccessExpression($(e.left),e.right)}(t)}}function ee(){return d.createConditionalExpression(d.createTypeCheck(d.createIdentifier("Symbol"),"function"),void 0,d.createIdentifier("Symbol"),void 0,d.createIdentifier("Object"))}function te(){return x<99?d.createConditionalExpression(d.createTypeCheck(d.createIdentifier("BigInt"),"function"),void 0,d.createIdentifier("BigInt"),void 0,d.createIdentifier("Object")):d.createIdentifier("BigInt")}function re(t,r){var n=t.name;return e.isPrivateIdentifier(n)?d.createIdentifier(""):e.isComputedPropertyName(n)?r&&!e.isSimpleInlineableExpression(n.expression)?d.getGeneratedNameForNode(n):n.expression:e.isIdentifier(n)?d.createStringLiteral(e.idText(n)):d.cloneNode(n)}function ne(t){var r=t.name;if(e.isComputedPropertyName(r)&&(!e.hasStaticModifier(t)&&c||e.some(t.decorators))){var n=e.visitNode(r.expression,k,e.isExpression),i=e.skipPartiallyEmittedExpressions(n);if(!e.isSimpleInlineableExpression(i)){var a=d.getGeneratedNameForNode(r);return y(a),d.updateComputedPropertyName(r,d.createAssignment(a,n))}}return e.visitNode(r,k,e.isPropertyName)}function ie(t){return !e.nodeIsMissing(t.body)}function ae(t){if(!(8388608&t.flags||e.hasSyntacticModifier(t,128))){var r=d.updatePropertyDeclaration(t,void 0,e.visitNodes(t.modifiers,k,e.isModifier),ne(t),void 0,void 0,e.visitNode(t.initializer,k));return r!==t&&(e.setCommentRange(r,t),e.setSourceMapRange(r,e.moveRangePastDecorators(t))),r}}function oe(r){if(ie(r))return d.updateConstructorDeclaration(r,void 0,void 0,e.visitParameterList(r.parameters,k,t),function(r,n){var i=n&&e.filter(n.parameters,(function(t){return e.isParameterPropertyDeclaration(t,n)}));if(!e.some(i))return e.visitFunctionBody(r,k,t);var a,o=[];g(),a=e.addPrologueDirectivesAndInitialSuperCall(d,n,o,k),e.addRange(o,e.map(i,se)),e.addRange(o,e.visitNodes(r.statements,k,e.isStatement,a)),o=d.mergeLexicalEnvironment(o,m());var s=d.createBlock(e.setTextRange(d.createNodeArray(o),r.statements),!0);return e.setTextRange(s,r),e.setOriginalNode(s,r),s}(r.body,r))}function se(t){var r=t.name;if(e.isIdentifier(r)){var n=e.setParent(e.setTextRange(d.cloneNode(r),r),r.parent);e.setEmitFlags(n,1584);var i=e.setParent(e.setTextRange(d.cloneNode(r),r),r.parent);return e.setEmitFlags(i,1536),e.startOnNewLine(e.removeAllComments(e.setTextRange(e.setOriginalNode(d.createExpressionStatement(d.createAssignment(e.setTextRange(d.createPropertyAccessExpression(d.createThis(),n),t.name),i)),t),e.moveRangePos(t,-1))))}}function ce(t){return !(e.nodeIsMissing(t.body)&&e.hasSyntacticModifier(t,128))}function le(r){var n=r.name;return e.isBindingPattern(n)?e.flattenDestructuringAssignment(r,k,t,0,!1,ke):e.setTextRange(d.createAssignment(Ne(n),e.visitNode(r.initializer,k,e.isExpression)),r)}function ue(r){var n=re(r,!1),a=function(r){var n=v.getConstantValue(r);return void 0!==n?"string"==typeof n?d.createStringLiteral(n):d.createNumericLiteral(n):(0==(8&l)&&(l|=8,t.enableSubstitution(79)),r.initializer?e.visitNode(r.initializer,k,e.isExpression):d.createVoidZero())}(r),o=d.createAssignment(d.createElementAccessExpression(i,n),a),s=10===a.kind?o:d.createAssignment(d.createElementAccessExpression(i,o),n);return e.setTextRange(d.createExpressionStatement(e.setTextRange(s,r)),r)}function _e(t){return De(t)||Se(t)&&D!==e.ModuleKind.ES2015&&D!==e.ModuleKind.ES2020&&D!==e.ModuleKind.ES2022&&D!==e.ModuleKind.ESNext&&D!==e.ModuleKind.System}function de(t){s||(s=new e.Map);var r=pe(t);s.has(r)||s.set(r,t);}function pe(t){return e.Debug.assertNode(t.name,e.isIdentifier),t.name.escapedText}function fe(t,r){var n=d.createVariableStatement(e.visitNodes(r.modifiers,M,e.isModifier),d.createVariableDeclarationList([d.createVariableDeclaration(d.getLocalName(r,!1,!0))],303===a.kind?0:1));if(e.setOriginalNode(n,r),de(r),function(e){if(s){var t=pe(e);return s.get(t)===e}return !0}(r))return 259===r.kind?e.setSourceMapRange(n.declarationList,r):e.setSourceMapRange(n,r),e.setCommentRange(n,r),e.addEmitFlags(n,4195328),t.push(n),!0;var i=d.createMergeDeclarationMarker(n);return e.setEmitFlags(i,4195840),t.push(i),!1}function ge(o){if(!function(t){var r=e.getParseTreeNode(t,e.isModuleDeclaration);return !r||e.isInstantiatedModule(r,e.shouldPreserveConstEnums(h))}(o))return d.createNotEmittedStatement(o);e.Debug.assertNode(o.name,e.isIdentifier,"A TypeScript namespace should have an Identifier name."),0==(2&l)&&(l|=2,t.enableSubstitution(79),t.enableSubstitution(295),t.enableEmitNotification(260));var c=[],u=2,_=fe(c,o);_&&(D===e.ModuleKind.System&&a===r||(u|=512));var p=Fe(o),g=Ae(o),y=e.hasSyntacticModifier(o,1)?d.getExternalModuleOrNamespaceExportName(i,o,!1,!0):d.getLocalName(o,!1,!0),v=d.createLogicalOr(y,d.createAssignment(y,d.createObjectLiteralExpression()));if(_e(o)){var b=d.getLocalName(o,!1,!0);v=d.createAssignment(b,v);}var x=d.createExpressionStatement(d.createCallExpression(d.createFunctionExpression(void 0,void 0,void 0,void 0,[d.createParameterDeclaration(void 0,void 0,void 0,p)],void 0,function(t,r){var a=i,o=n,c=s;i=r,n=t,s=void 0;var l,u,_=[];if(f(),t.body)if(261===t.body.kind)E(t.body,(function(t){return e.addRange(_,e.visitNodes(t.statements,P,e.isStatement))})),l=t.body.statements,u=t.body;else {var p=ge(t.body);p&&(e.isArray(p)?e.addRange(_,p):_.push(p));var g=me(t).body;l=e.moveRangePos(g.statements,-1);}e.insertStatementsAfterStandardPrologue(_,m()),i=a,n=o,s=c;var y=d.createBlock(e.setTextRange(d.createNodeArray(_),l),!0);return e.setTextRange(y,u),t.body&&261===t.body.kind||e.setEmitFlags(y,1536|e.getEmitFlags(y)),y}(o,g)),void 0,[v]));return e.setOriginalNode(x,o),_&&(e.setSyntheticLeadingComments(x,void 0),e.setSyntheticTrailingComments(x,void 0)),e.setTextRange(x,o),e.addEmitFlags(x,u),c.push(x),c.push(d.createEndOfDeclarationMarker(o)),c}function me(e){if(260===e.body.kind)return me(e.body)||e.body}function ye(t){e.Debug.assert(!t.isTypeOnly);var r=we(t)?t.name:void 0,n=e.visitNode(t.namedBindings,ve,e.isNamedImportBindings);return r||n?d.updateImportClause(t,!1,r,n):void 0}function ve(t){if(267===t.kind)return we(t)?t:void 0;var r=h.preserveValueImports&&(1===h.importsNotUsedAsValues||2===h.importsNotUsedAsValues),n=e.visitNodes(t.elements,he,e.isImportSpecifier);return r||e.some(n)?d.updateNamedImports(t,n):void 0}function he(e){return !e.isTypeOnly&&we(e)?e:void 0}function be(e){return !e.isTypeOnly&&v.isValueAliasDeclaration(e)?e:void 0}function xe(n){if(!n.isTypeOnly){if(e.isExternalModuleImportEqualsDeclaration(n)){var a=we(n);return a||1!==h.importsNotUsedAsValues?a?e.visitEachChild(n,k,t):void 0:e.setOriginalNode(e.setTextRange(d.createImportDeclaration(void 0,void 0,void 0,n.moduleReference.expression,void 0),n),n)}if(function(t){return we(t)||!e.isExternalModule(r)&&v.isTopLevelValueImportEqualsWithEntityName(t)}(n)){var o,s,c,l=e.createExpressionFromEntityName(d,n.moduleReference);return e.setEmitFlags(l,3584),Te(n)||!De(n)?e.setOriginalNode(e.setTextRange(d.createVariableStatement(e.visitNodes(n.modifiers,M,e.isModifier),d.createVariableDeclarationList([e.setOriginalNode(d.createVariableDeclaration(n.name,void 0,void 0,l),n)])),n),n):e.setOriginalNode((o=n.name,s=l,c=n,e.setTextRange(d.createExpressionStatement(d.createAssignment(d.getNamespaceMemberName(i,o,!1,!0),s)),c)),n)}}}function De(t){return void 0!==n&&e.hasSyntacticModifier(t,1)}function Se(t){return void 0===n&&e.hasSyntacticModifier(t,1)}function Te(t){return Se(t)&&!e.hasSyntacticModifier(t,512)}function Ce(e){return d.createExpressionStatement(e)}function Ee(t,r){var n=d.createAssignment(d.getExternalModuleOrNamespaceExportName(i,r,!1,!0),d.getLocalName(r));e.setSourceMapRange(n,e.createRange(r.name?r.name.pos:r.pos,r.end));var a=d.createExpressionStatement(n);e.setSourceMapRange(a,e.createRange(-1,r.end)),t.push(a);}function ke(t,r,n){return e.setTextRange(d.createAssignment(Ne(t),r),n)}function Ne(e){return d.getNamespaceMemberName(i,e,!1,!0)}function Fe(t){var r=d.getGeneratedNameForNode(t);return e.setSourceMapRange(r,t.name),r}function Ae(e){return d.getGeneratedNameForNode(e)}function Pe(t){if(l&_&&!e.isGeneratedIdentifier(t)&&!e.isLocalName(t)){var r=v.getReferencedExportContainer(t,!1);if(r&&303!==r.kind&&(2&_&&260===r.kind||8&_&&259===r.kind))return e.setTextRange(d.createPropertyAccessExpression(d.getGeneratedNameForNode(r),t),t)}}function we(e){return h.preserveValueImports?v.isValueAliasDeclaration(e):v.isReferencedAliasDeclaration(e)}};}(t),function(e){var t,r,i;!function(e){e[e.ClassAliases=1]="ClassAliases",e[e.ClassStaticThisOrSuperReference=2]="ClassStaticThisOrSuperReference";}(t||(t={})),(i=e.PrivateIdentifierKind||(e.PrivateIdentifierKind={})).Field="f",i.Method="m",i.Accessor="a",function(e){e[e.None=0]="None",e[e.ClassWasDecorated=1]="ClassWasDecorated",e[e.NeedsClassConstructorReference=2]="NeedsClassConstructorReference",e[e.NeedsClassSuperReference=4]="NeedsClassSuperReference",e[e.NeedsSubstitutionForThisInClassStaticField=8]="NeedsSubstitutionForThisInClassStaticField";}(r||(r={})),e.transformClassFields=function(t){var r=t.factory,i=t.hoistVariableDeclaration,a=t.endLexicalEnvironment,o=t.startLexicalEnvironment,s=t.resumeLexicalEnvironment,c=t.addBlockScopedVariable,l=t.getEmitResolver(),u=t.getCompilerOptions(),_=e.getEmitScriptTarget(u),d=e.getUseDefineForClassFields(u),p=_<99,f=(_<=8||!d)&&_>=2,g=_<=8||!d,m=t.onSubstituteNode;t.onSubstituteNode=function(t,n){return n=m(t,n),1===t?function(t){switch(t.kind){case 79:return function(t){return function(t){if(1&y&&33554432&l.getNodeCheckFlags(t)){var n=l.getReferencedValueDeclaration(t);if(n){var i=v[n.id];if(i){var a=r.cloneNode(i);return e.setSourceMapRange(a,t),e.setCommentRange(a,t),a}}}}(t)||t}(t);case 108:return function(t){if(2&y&&D){var n=D.facts,i=D.classConstructor;if(1&n)return r.createParenthesizedExpression(r.createVoidZero());if(i)return e.setTextRange(e.setOriginalNode(r.cloneNode(i),t),t)}return t}(t)}return t}(n):n};var y,v,h,b,x=t.onEmitNode;t.onEmitNode=function(t,r,n){var i=e.getOriginalNode(r);if(i.id){var a=E.get(i.id);if(a){var o=D,s=S;return D=a,S=a,x(t,r,n),D=o,void(S=s)}}switch(r.kind){case 212:if(e.isArrowFunction(i)||262144&e.getEmitFlags(r))break;case 255:case 170:return o=D,s=S,D=void 0,S=void 0,x(t,r,n),D=o,void(S=s);case 171:case 172:case 168:case 166:return o=D,s=S,S=D,D=void 0,x(t,r,n),D=o,void(S=s);case 161:return o=D,s=S,D=S,S=void 0,x(t,r,n),D=o,void(S=s)}x(t,r,n);};var D,S,T,C=[],E=new e.Map;return e.chainBundle(t,(function(r){var n=t.getCompilerOptions();if(r.isDeclarationFile||d&&99===e.getEmitScriptTarget(n))return r;var i=e.visitEachChild(r,F,t);return e.addEmitHelpers(i,t.readEmitHelpers()),i}));function k(a,o){if(8388608&a.transformFlags)switch(a.kind){case 225:case 256:return function(n){if(!e.forEach(n.members,j))return e.visitEachChild(n,F,t);var a=h;if(h=void 0,C.push(D),D=void 0,p){var o=e.getNameOfDeclaration(n);o&&e.isIdentifier(o)&&(Q().className=e.idText(o));var s=J(n);e.some(s)&&(Q().weakSetName=Z("instances",s[0].name));}var u=e.isClassDeclaration(n)?function(t){var n=z(t);n&&(G().facts=n),8&n&&W();var a,o=e.getStaticPropertiesAndClassStaticBlock(t);if(2&n){var s=r.createTempVariable(i,!0);G().classConstructor=r.cloneNode(s),a=r.createAssignment(s,r.getInternalName(t));}var c=e.getEffectiveBaseTypeNode(t),l=!(!c||104===e.skipOuterExpressions(c.expression).kind),u=[r.updateClassDeclaration(t,void 0,t.modifiers,t.name,void 0,e.visitNodes(t.heritageClauses,A,e.isHeritageClause),U(t,l))];return a&&X().unshift(a),e.some(h)&&u.push(r.createExpressionStatement(r.inlineExpressions(h))),e.some(o)&&V(u,o,r.getInternalName(t)),u}(n):function(n){var a=z(n);a&&(G().facts=a),8&a&&W();var o,s=!!(1&a),u=e.getStaticPropertiesAndClassStaticBlock(n),_=e.getEffectiveBaseTypeNode(n),d=!(!_||104===e.skipOuterExpressions(_.expression).kind),f=16777216&l.getNodeCheckFlags(n);function g(){var e=l.getNodeCheckFlags(n),t=16777216&e,a=524288&e;return r.createTempVariable(a?c:i,!!t)}2&a&&(o=g(),G().classConstructor=r.cloneNode(o));var m=r.updateClassExpression(n,e.visitNodes(n.decorators,F,e.isDecorator),n.modifiers,n.name,void 0,e.visitNodes(n.heritageClauses,A,e.isHeritageClause),U(n,d));if(e.some(u,(function(t){return e.isClassStaticBlockDeclaration(t)||!!t.initializer||p&&e.isPrivateIdentifier(t.name)}))||e.some(h)){if(s)return e.Debug.assertIsDefined(b,"Decorated classes transformed by TypeScript are expected to be within a variable declaration."),b&&h&&e.some(h)&&b.push(r.createExpressionStatement(r.inlineExpressions(h))),b&&e.some(u)&&V(b,u,r.getInternalName(n)),o?r.inlineExpressions([r.createAssignment(o,m),o]):m;var x=[];if(o||(o=g()),f){0==(1&y)&&(y|=1,t.enableSubstitution(79),v=[]);var D=r.cloneNode(o);D.autoGenerateFlags&=-9,v[e.getOriginalNodeId(n)]=D;}return e.setEmitFlags(m,65536|e.getEmitFlags(m)),x.push(e.startOnNewLine(r.createAssignment(o,m))),e.addRange(x,e.map(h,e.startOnNewLine)),e.addRange(x,function(t,r){for(var n=[],i=0,a=t;i<a.length;i++){var o=a[i],s=e.isClassStaticBlockDeclaration(o)?R(o):q(o,r);s&&(e.startOnNewLine(s),e.setSourceMapRange(s,e.moveRangePastModifiers(o)),e.setCommentRange(s,o),e.setOriginalNode(s,o),n.push(s));}return n}(u,o)),x.push(e.startOnNewLine(o)),r.inlineExpressions(x)}return m}(n);return D=C.pop(),h=a,u}(a);case 166:return I(a);case 236:return function(r){var i=b;b=[];var a=e.visitEachChild(r,F,t),o=e.some(b)?n$3([a],b,!0):a;return b=i,o}(a);case 80:return function(t){return p?e.isStatement(t.parent)?t:e.setOriginalNode(r.createIdentifier(""),t):t}(a);case 169:return function(r){if(!p)return e.visitEachChild(r,w,t)}(a)}if(8388608&a.transformFlags||33554432&a.transformFlags&&f&&T&&D)switch(a.kind){case 218:case 219:return function(n,a){if(45===n.operator||46===n.operator)if(p&&e.isPrivateIdentifierPropertyAccessExpression(n.operand)){var o;if(o=ee(n.operand.name)){var s=L(e.visitNode(n.operand.expression,F,e.isExpression)),c=s.readExpression,l=s.initializeExpression,u=O(o,c),_=e.isPrefixUnaryExpression(n)||a?void 0:r.createTempVariable(i);return u=B(o,l||c,u=e.expandPreOrPostfixIncrementOrDecrementExpression(r,n,u,i,_),63),e.setOriginalNode(u,n),e.setTextRange(u,n),_&&(u=r.createComma(u,_),e.setTextRange(u,n)),u}}else if(f&&e.isSuperProperty(n.operand)&&T&&D){var d=D.classConstructor,g=D.superClassReference;if(1&D.facts){var m=H(n.operand);return e.isPrefixUnaryExpression(n)?r.updatePrefixUnaryExpression(n,m):r.updatePostfixUnaryExpression(n,m)}if(d&&g){var y=void 0,v=void 0;if(e.isPropertyAccessExpression(n.operand)?e.isIdentifier(n.operand.name)&&(v=y=r.createStringLiteralFromNode(n.operand.name)):e.isSimpleInlineableExpression(n.operand.argumentExpression)?v=y=n.operand.argumentExpression:(v=r.createTempVariable(i),y=r.createAssignment(v,e.visitNode(n.operand.argumentExpression,F,e.isExpression))),y&&v)return u=r.createReflectGetCall(g,v,d),e.setTextRange(u,n.operand),_=a?void 0:r.createTempVariable(i),u=e.expandPreOrPostfixIncrementOrDecrementExpression(r,n,u,i,_),u=r.createReflectSetCall(g,y,u,d),e.setOriginalNode(u,n),e.setTextRange(u,n),_&&(u=r.createComma(u,_),e.setTextRange(u,n)),u}}return e.visitEachChild(n,F,t)}(a,o);case 220:return function(a,o){if(e.isDestructuringAssignment(a)){var s=h;h=void 0,a=r.updateBinaryExpression(a,e.visitNode(a.left,P),a.operatorToken,e.visitNode(a.right,F));var c=e.some(h)?r.inlineExpressions(e.compact(n$3(n$3([],h,!0),[a],!1))):a;return h=s,c}if(e.isAssignmentExpression(a))if(p&&e.isPrivateIdentifierPropertyAccessExpression(a.left)){var l=ee(a.left.name);if(l)return e.setTextRange(e.setOriginalNode(B(l,a.left.expression,a.right,a.operatorToken.kind),a),a)}else if(f&&e.isSuperProperty(a.left)&&T&&D){var u=D.classConstructor,_=D.superClassReference;if(1&D.facts)return r.updateBinaryExpression(a,H(a.left),a.operatorToken,e.visitNode(a.right,F,e.isExpression));if(u&&_){var d=e.isElementAccessExpression(a.left)?e.visitNode(a.left.argumentExpression,F,e.isExpression):e.isIdentifier(a.left.name)?r.createStringLiteralFromNode(a.left.name):void 0;if(d){var g=e.visitNode(a.right,F,e.isExpression);if(e.isCompoundAssignment(a.operatorToken.kind)){var m=d;e.isSimpleInlineableExpression(d)||(m=r.createTempVariable(i),d=r.createAssignment(m,d));var y=r.createReflectGetCall(_,m,u);e.setOriginalNode(y,a.left),e.setTextRange(y,a.left),g=r.createBinaryExpression(y,e.getNonAssignmentOperatorForCompoundAssignment(a.operatorToken.kind),g),e.setTextRange(g,a);}var v=o?void 0:r.createTempVariable(i);return v&&(g=r.createAssignment(v,g),e.setTextRange(v,a)),g=r.createReflectSetCall(_,d,g,u),e.setOriginalNode(g,a),e.setTextRange(g,a),v&&(g=r.createComma(g,v),e.setTextRange(g,a)),g}}}return 101===a.operatorToken.kind&&e.isPrivateIdentifier(a.left)?function(r){if(!p)return r;var n=r.left;e.Debug.assertNode(n,e.isPrivateIdentifier),e.Debug.assert(101===r.operatorToken.kind);var i=ee(n);if(i){var a=e.visitNode(r.right,F,e.isExpression);return e.setOriginalNode(t.getEmitHelperFactory().createClassPrivateFieldInHelper(i.brandCheckIdentifier,a),r)}return e.visitEachChild(r,F,t)}(a):e.visitEachChild(a,F,t)}(a,o);case 207:return function(a){if(p&&e.isPrivateIdentifierPropertyAccessExpression(a.expression)){var o=r.createCallBinding(a.expression,i,_),s=o.thisArg,c=o.target;return e.isCallChain(a)?r.updateCallChain(a,r.createPropertyAccessChain(e.visitNode(c,F),a.questionDotToken,"call"),void 0,void 0,n$3([e.visitNode(s,F,e.isExpression)],e.visitNodes(a.arguments,F,e.isExpression),!0)):r.updateCallExpression(a,r.createPropertyAccessExpression(e.visitNode(c,F),"call"),void 0,n$3([e.visitNode(s,F,e.isExpression)],e.visitNodes(a.arguments,F,e.isExpression),!0))}if(f&&e.isSuperProperty(a.expression)&&T&&(null==D?void 0:D.classConstructor)){var l=r.createFunctionCallCall(e.visitNode(a.expression,F,e.isExpression),D.classConstructor,e.visitNodes(a.arguments,F,e.isExpression));return e.setOriginalNode(l,a),e.setTextRange(l,a),l}return e.visitEachChild(a,F,t)}(a);case 209:return function(n){if(p&&e.isPrivateIdentifierPropertyAccessExpression(n.tag)){var a=r.createCallBinding(n.tag,i,_),o=a.thisArg,s=a.target;return r.updateTaggedTemplateExpression(n,r.createCallExpression(r.createPropertyAccessExpression(e.visitNode(s,F),"bind"),void 0,[e.visitNode(o,F,e.isExpression)]),void 0,e.visitNode(n.template,F,e.isTemplateLiteral))}if(f&&e.isSuperProperty(n.tag)&&T&&(null==D?void 0:D.classConstructor)){var c=r.createFunctionBindCall(e.visitNode(n.tag,F,e.isExpression),D.classConstructor,[]);return e.setOriginalNode(c,n),e.setTextRange(c,n),r.updateTaggedTemplateExpression(n,c,void 0,e.visitNode(n.template,F,e.isTemplateLiteral))}return e.visitEachChild(n,F,t)}(a);case 205:return function(n){if(p&&e.isPrivateIdentifier(n.name)){var i=ee(n.name);if(i)return e.setTextRange(e.setOriginalNode(O(i,n.expression),n),n)}if(f&&e.isSuperProperty(n)&&e.isIdentifier(n.name)&&T&&D){var a=D.classConstructor,o=D.superClassReference;if(1&D.facts)return H(n);if(a&&o){var s=r.createReflectGetCall(o,r.createStringLiteralFromNode(n.name),a);return e.setOriginalNode(s,n.expression),e.setTextRange(s,n.expression),s}}return e.visitEachChild(n,F,t)}(a);case 206:return function(n){if(f&&e.isSuperProperty(n)&&T&&D){var i=D.classConstructor,a=D.superClassReference;if(1&D.facts)return H(n);if(i&&a){var o=r.createReflectGetCall(a,e.visitNode(n.argumentExpression,F,e.isExpression),i);return e.setOriginalNode(o,n.expression),e.setTextRange(o,n.expression),o}}return e.visitEachChild(n,F,t)}(a);case 237:return function(t){return r.updateExpressionStatement(t,e.visitNode(t.expression,N,e.isExpression))}(a);case 241:return function(n){return r.updateForStatement(n,e.visitNode(n.initializer,N,e.isForInitializer),e.visitNode(n.condition,F,e.isExpression),e.visitNode(n.incrementor,N,e.isExpression),e.visitIterationBody(n.statement,F,t))}(a);case 255:case 212:case 170:case 168:case 171:case 172:var s=T;T=void 0;var u=e.visitEachChild(a,F,t);return T=s,u}return e.visitEachChild(a,F,t)}function N(e){return k(e,!0)}function F(e){return k(e,!1)}function A(n){switch(n.kind){case 290:return e.visitEachChild(n,A,t);case 227:return function(n){if(4&((null==D?void 0:D.facts)||0)){var a=r.createTempVariable(i,!0);return G().superClassReference=a,r.updateExpressionWithTypeArguments(n,r.createAssignment(a,e.visitNode(n.expression,F,e.isExpression)),void 0)}return e.visitEachChild(n,F,t)}(n)}return F(n)}function P(t){switch(t.kind){case 204:case 203:return function(t){return e.isArrayLiteralExpression(t)?r.updateArrayLiteralExpression(t,e.visitNodes(t.elements,re,e.isExpression)):r.updateObjectLiteralExpression(t,e.visitNodes(t.properties,ne,e.isObjectLiteralElementLike))}(t);default:return F(t)}}function w(n){switch(n.kind){case 170:return;case 171:case 172:case 168:return function(n){if(e.Debug.assert(!e.some(n.decorators)),!p||!e.isPrivateIdentifier(n.name))return e.visitEachChild(n,w,t);var i=ee(n.name);if(e.Debug.assert(i,"Undeclared private name for property declaration."),!i.isValid)return n;var a=function(t){e.Debug.assert(e.isPrivateIdentifier(t.name));var r=ee(t.name);if(e.Debug.assert(r,"Undeclared private name for property declaration."),"m"===r.kind)return r.methodName;if("a"===r.kind){if(e.isGetAccessor(t))return r.getterName;if(e.isSetAccessor(t))return r.setterName}}(n);a&&X().push(r.createAssignment(a,r.createFunctionExpression(e.filter(n.modifiers,(function(t){return !e.isStaticModifier(t)})),n.asteriskToken,a,void 0,e.visitParameterList(n.parameters,w,t),void 0,e.visitFunctionBody(n.body,w,t))));}(n);case 166:return I(n);case 161:return function(n){var i=e.visitEachChild(n,F,t);if(e.some(h)){var a=h;a.push(i.expression),h=[],i=r.updateComputedPropertyName(i,r.inlineExpressions(a));}return i}(n);case 233:return n;default:return F(n)}}function I(t){if(e.Debug.assert(!e.some(t.decorators)),e.isPrivateIdentifier(t.name)){if(!p)return r.updatePropertyDeclaration(t,void 0,e.visitNodes(t.modifiers,F,e.isModifier),t.name,void 0,void 0,void 0);var n=ee(t.name);if(e.Debug.assert(n,"Undeclared private name for property declaration."),!n.isValid)return t}var a=function(t,n){if(e.isComputedPropertyName(t)){var a=e.visitNode(t.expression,F,e.isExpression),o=e.skipPartiallyEmittedExpressions(a),s=e.isSimpleInlineableExpression(o);if((!e.isAssignmentExpression(o)||!e.isGeneratedIdentifier(o.left))&&!s&&n){var u=r.getGeneratedNameForNode(t);return 524288&l.getNodeCheckFlags(t)?c(u):i(u),r.createAssignment(u,a)}return s||e.isIdentifier(o)?void 0:a}}(t.name,!!t.initializer||d);a&&!e.isSimpleInlineableExpression(a)&&X().push(a);}function O(t,r){return M(t,e.visitNode(r,F,e.isExpression))}function M(r,n){switch(e.setCommentRange(n,e.moveRangePos(n,-1)),r.kind){case"a":return t.getEmitHelperFactory().createClassPrivateFieldGetHelper(n,r.brandCheckIdentifier,r.kind,r.getterName);case"m":return t.getEmitHelperFactory().createClassPrivateFieldGetHelper(n,r.brandCheckIdentifier,r.kind,r.methodName);case"f":return t.getEmitHelperFactory().createClassPrivateFieldGetHelper(n,r.brandCheckIdentifier,r.kind,r.variableName);default:e.Debug.assertNever(r,"Unknown private element type");}}function L(t){var n=e.nodeIsSynthesized(t)?t:r.cloneNode(t);if(e.isSimpleInlineableExpression(t))return {readExpression:n,initializeExpression:void 0};var a=r.createTempVariable(i);return {readExpression:a,initializeExpression:r.createAssignment(a,n)}}function R(t){if(p){D&&E.set(e.getOriginalNodeId(t),D),o();var n=T;T=t;var i=e.visitNodes(t.body.statements,F,e.isStatement);i=r.mergeLexicalEnvironment(i,a()),T=n;var s=r.createImmediatelyInvokedArrowFunction(i);return e.setOriginalNode(s,t),e.setTextRange(s,t),e.addEmitFlags(s,2),s}}function B(n,i,a,o){if(i=e.visitNode(i,F,e.isExpression),a=e.visitNode(a,F,e.isExpression),e.isCompoundAssignment(o)){var s=L(i),c=s.readExpression;i=s.initializeExpression||c,a=r.createBinaryExpression(M(n,c),e.getNonAssignmentOperatorForCompoundAssignment(o),a);}switch(e.setCommentRange(i,e.moveRangePos(i,-1)),n.kind){case"a":return t.getEmitHelperFactory().createClassPrivateFieldSetHelper(i,n.brandCheckIdentifier,a,n.kind,n.setterName);case"m":return t.getEmitHelperFactory().createClassPrivateFieldSetHelper(i,n.brandCheckIdentifier,a,n.kind,void 0);case"f":return t.getEmitHelperFactory().createClassPrivateFieldSetHelper(i,n.brandCheckIdentifier,a,n.kind,n.variableName);default:e.Debug.assertNever(n,"Unknown private element type");}}function j(t){return e.isPropertyDeclaration(t)||e.isClassStaticBlockDeclaration(t)||p&&t.name&&e.isPrivateIdentifier(t.name)}function J(t){return e.filter(t.members,e.isNonStaticMethodOrAccessorWithPrivateName)}function z(t){var r=0,n=e.getOriginalNode(t);e.isClassDeclaration(n)&&e.classOrConstructorParameterIsDecorated(n)&&(r|=1);for(var i=0,a=t.members;i<a.length;i++){var o=a[i];e.isStatic(o)&&(o.name&&e.isPrivateIdentifier(o.name)&&p&&(r|=2),(e.isPropertyDeclaration(o)||e.isClassStaticBlockDeclaration(o))&&(g&&8192&o.transformFlags&&(1&(r|=8)||(r|=2)),f&&33554432&o.transformFlags&&(1&r||(r|=6))));}return r}function U(n,i){if(p){for(var o=0,c=n.members;o<c.length;o++){var l=c[o];e.isPrivateIdentifierClassElementDeclaration(l)&&Y(l);}e.some(J(n))&&(u=Q().weakSetName,e.Debug.assert(u,"weakSetName should be set in private identifier environment"),X().push(r.createAssignment(u,r.createNewExpression(r.createIdentifier("WeakSet"),void 0,[]))));}var u,_=[],f=function(n,i){var o=e.visitNode(e.getFirstConstructorWithBody(n),F,e.isConstructorDeclaration),c=n.members.filter(K);if(!e.some(c))return o;var l=e.visitParameterList(o?o.parameters:void 0,F,t),u=function(n,i,o){var c=e.getProperties(n,!1,!1);d||(c=e.filter(c,(function(t){return !!t.initializer||e.isPrivateIdentifier(t.name)})));var l=J(n),u=e.some(c)||e.some(l);if(!i&&!u)return e.visitFunctionBody(void 0,F,t);s();var _=0,f=[];if(!i&&o&&f.push(r.createExpressionStatement(r.createCallExpression(r.createSuper(),void 0,[r.createSpreadElement(r.createIdentifier("arguments"))]))),i&&(_=e.addPrologueDirectivesAndInitialSuperCall(r,i,f,F)),null==i?void 0:i.body){var g=e.findIndex(i.body.statements,(function(t){return !e.isParameterPropertyDeclaration(e.getOriginalNode(t),i)}),_);-1===g&&(g=i.body.statements.length),g>_&&(d||e.addRange(f,e.visitNodes(i.body.statements,F,e.isStatement,_,g-_)),_=g);}var m=r.createThis();return function(t,n,i){if(p&&e.some(n)){var a=Q().weakSetName;e.Debug.assert(a,"weakSetName should be set in private identifier environment"),t.push(r.createExpressionStatement(function(t,r){return e.factory.createCallExpression(e.factory.createPropertyAccessExpression(r,"add"),void 0,[t])}(i,a)));}}(f,l,m),V(f,c,m),i&&e.addRange(f,e.visitNodes(i.body.statements,F,e.isStatement,_)),f=r.mergeLexicalEnvironment(f,a()),e.setTextRange(r.createBlock(e.setTextRange(r.createNodeArray(f),i?i.body.statements:n.members),!0),i?i.body:void 0)}(n,o,i);return u?e.startOnNewLine(e.setOriginalNode(e.setTextRange(r.createConstructorDeclaration(void 0,void 0,null!=l?l:[],u),o||n),o)):void 0}(n,i);return f&&_.push(f),e.addRange(_,e.visitNodes(n.members,w,e.isClassElement)),e.setTextRange(r.createNodeArray(_),n.members)}function K(t){return !e.isStatic(t)&&!e.hasSyntacticModifier(e.getOriginalNode(t),128)&&(d?_<99:e.isInitializedProperty(t)||p&&e.isPrivateIdentifierClassElementDeclaration(t))}function V(t,n,i){for(var a=0,o=n;a<o.length;a++){var s=o[a],c=e.isClassStaticBlockDeclaration(s)?R(s):q(s,i);if(c){var l=r.createExpressionStatement(c);e.setSourceMapRange(l,e.moveRangePastModifiers(s)),e.setCommentRange(l,s),e.setOriginalNode(l,s),t.push(l);}}}function q(t,n){var i=T,a=function(t,n){var i,a=!d,o=e.isComputedPropertyName(t.name)&&!e.isSimpleInlineableExpression(t.name.expression)?r.updateComputedPropertyName(t.name,r.getGeneratedNameForNode(t.name)):t.name;if(e.hasStaticModifier(t)&&(T=t),p&&e.isPrivateIdentifier(o)){var s=ee(o);if(s)return "f"===s.kind?s.isStatic?function(t,r){return e.factory.createAssignment(t,e.factory.createObjectLiteralExpression([e.factory.createPropertyAssignment("value",r||e.factory.createVoidZero())]))}(s.variableName,e.visitNode(t.initializer,F,e.isExpression)):function(t,r,n){return e.factory.createCallExpression(e.factory.createPropertyAccessExpression(n,"set"),void 0,[t,r||e.factory.createVoidZero()])}(n,e.visitNode(t.initializer,F,e.isExpression),s.brandCheckIdentifier):void 0;e.Debug.fail("Undeclared private name for property declaration.");}if(!e.isPrivateIdentifier(o)&&!e.hasStaticModifier(t)||t.initializer){var c=e.getOriginalNode(t);if(!e.hasSyntacticModifier(c,128)){var l=t.initializer||a?null!==(i=e.visitNode(t.initializer,F,e.isExpression))&&void 0!==i?i:r.createVoidZero():e.isParameterPropertyDeclaration(c,c.parent)&&e.isIdentifier(o)?o:r.createVoidZero();if(a||e.isPrivateIdentifier(o)){var u=e.createMemberAccessForPropertyName(r,n,o,o);return r.createAssignment(u,l)}var _=e.isComputedPropertyName(o)?o.expression:e.isIdentifier(o)?r.createStringLiteral(e.unescapeLeadingUnderscores(o.escapedText)):o,f=r.createPropertyDescriptor({value:l,configurable:!0,writable:!0,enumerable:!0});return r.createObjectDefinePropertyCall(n,_,f)}}}(t,n);return a&&e.hasStaticModifier(t)&&(null==D?void 0:D.facts)&&(e.setOriginalNode(a,t),e.addEmitFlags(a,2),E.set(e.getOriginalNodeId(a),D)),T=i,a}function W(){0==(2&y)&&(y|=2,t.enableSubstitution(108),t.enableEmitNotification(255),t.enableEmitNotification(212),t.enableEmitNotification(170),t.enableEmitNotification(171),t.enableEmitNotification(172),t.enableEmitNotification(168),t.enableEmitNotification(166),t.enableEmitNotification(161));}function H(t){return e.isPropertyAccessExpression(t)?r.updatePropertyAccessExpression(t,r.createVoidZero(),t.name):r.updateElementAccessExpression(t,r.createVoidZero(),e.visitNode(t.argumentExpression,F,e.isExpression))}function G(){return D||(D={facts:0,classConstructor:void 0,superClassReference:void 0,privateIdentifierEnvironment:void 0})}function Q(){var t=G();return t.privateIdentifierEnvironment||(t.privateIdentifierEnvironment={className:"",identifiers:new e.Map}),t.privateIdentifierEnvironment}function X(){return h||(h=[])}function Y(t){var n,i=e.getTextOfPropertyName(t.name),a=G().classConstructor,o=Q(),s=o.weakSetName,c=[],l=t.name.escapedText,u=o.identifiers.get(l),_=!function(e){return "#constructor"===e.escapedText}(t.name)&&void 0===u;if(e.hasStaticModifier(t))if(e.Debug.assert(a,"weakSetName should be set in private identifier environment"),e.isPropertyDeclaration(t)){var d=$(i,t);o.identifiers.set(l,{kind:"f",variableName:d,brandCheckIdentifier:a,isStatic:!0,isValid:_});}else if(e.isMethodDeclaration(t)){var p=$(i,t);o.identifiers.set(l,{kind:"m",methodName:p,brandCheckIdentifier:a,isStatic:!0,isValid:_});}else if(e.isGetAccessorDeclaration(t)){var f=$(i+"_get",t);"a"===(null==u?void 0:u.kind)&&u.isStatic&&!u.getterName?u.getterName=f:o.identifiers.set(l,{kind:"a",getterName:f,setterName:void 0,brandCheckIdentifier:a,isStatic:!0,isValid:_});}else if(e.isSetAccessorDeclaration(t)){var g=$(i+"_set",t);"a"===(null==u?void 0:u.kind)&&u.isStatic&&!u.setterName?u.setterName=g:o.identifiers.set(l,{kind:"a",getterName:void 0,setterName:g,brandCheckIdentifier:a,isStatic:!0,isValid:_});}else e.Debug.assertNever(t,"Unknown class element type.");else if(e.isPropertyDeclaration(t)){var m=$(i,t);o.identifiers.set(l,{kind:"f",brandCheckIdentifier:m,isStatic:!1,variableName:void 0,isValid:_}),c.push(r.createAssignment(m,r.createNewExpression(r.createIdentifier("WeakMap"),void 0,[])));}else e.isMethodDeclaration(t)?(e.Debug.assert(s,"weakSetName should be set in private identifier environment"),o.identifiers.set(l,{kind:"m",methodName:$(i,t),brandCheckIdentifier:s,isStatic:!1,isValid:_})):e.isAccessor(t)?(e.Debug.assert(s,"weakSetName should be set in private identifier environment"),e.isGetAccessor(t)?(f=$(i+"_get",t),"a"!==(null==u?void 0:u.kind)||u.isStatic||u.getterName?o.identifiers.set(l,{kind:"a",getterName:f,setterName:void 0,brandCheckIdentifier:s,isStatic:!1,isValid:_}):u.getterName=f):(g=$(i+"_set",t),"a"!==(null==u?void 0:u.kind)||u.isStatic||u.setterName?o.identifiers.set(l,{kind:"a",getterName:void 0,setterName:g,brandCheckIdentifier:s,isStatic:!1,isValid:_}):u.setterName=g)):e.Debug.assertNever(t,"Unknown class element type.");(n=X()).push.apply(n,c);}function Z(e,t){var n=Q().className,a=n?"_".concat(n):"",o=r.createUniqueName("".concat(a,"_").concat(e),16);return 524288&l.getNodeCheckFlags(t)?c(o):i(o),o}function $(e,t){return Z(e.substring(1),t.name)}function ee(e){var t;if((null==D?void 0:D.privateIdentifierEnvironment)&&(n=D.privateIdentifierEnvironment.identifiers.get(e.escapedText)))return n;for(var r=C.length-1;r>=0;--r){var n,i=C[r];if(i&&(n=null===(t=i.privateIdentifierEnvironment)||void 0===t?void 0:t.identifiers.get(e.escapedText)))return n}}function te(n){var a=r.getGeneratedNameForNode(n),o=ee(n.name);if(!o)return e.visitEachChild(n,F,t);var s=n.expression;return (e.isThisProperty(n)||e.isSuperProperty(n)||!e.isSimpleCopiableExpression(n.expression))&&(s=r.createTempVariable(i,!0),X().push(r.createBinaryExpression(s,63,e.visitNode(n.expression,F,e.isExpression)))),r.createAssignmentTargetWrapper(a,B(o,s,a,63))}function re(t){var n=e.getTargetOfBindingOrAssignmentElement(t);if(n){var i=void 0;if(e.isPrivateIdentifierPropertyAccessExpression(n))i=te(n);else if(f&&e.isSuperProperty(n)&&T&&D){var a=D.classConstructor,o=D.superClassReference;if(1&D.facts)i=H(n);else if(a&&o){var s=e.isElementAccessExpression(n)?e.visitNode(n.argumentExpression,F,e.isExpression):e.isIdentifier(n.name)?r.createStringLiteralFromNode(n.name):void 0;if(s){var c=r.createTempVariable(void 0);i=r.createAssignmentTargetWrapper(c,r.createReflectSetCall(o,s,c,a));}}}if(i)return e.isAssignmentExpression(t)?r.updateBinaryExpression(t,i,t.operatorToken,e.visitNode(t.right,F,e.isExpression)):e.isSpreadElement(t)?r.updateSpreadElement(t,i):i}return e.visitNode(t,P)}function ne(t){if(e.isObjectBindingOrAssignmentElement(t)&&!e.isShorthandPropertyAssignment(t)){var n=e.getTargetOfBindingOrAssignmentElement(t),i=void 0;if(n)if(e.isPrivateIdentifierPropertyAccessExpression(n))i=te(n);else if(f&&e.isSuperProperty(n)&&T&&D){var a=D.classConstructor,o=D.superClassReference;if(1&D.facts)i=H(n);else if(a&&o){var s=e.isElementAccessExpression(n)?e.visitNode(n.argumentExpression,F,e.isExpression):e.isIdentifier(n.name)?r.createStringLiteralFromNode(n.name):void 0;if(s){var c=r.createTempVariable(void 0);i=r.createAssignmentTargetWrapper(c,r.createReflectSetCall(o,s,c,a));}}}if(e.isPropertyAssignment(t)){var l=e.getInitializerOfBindingOrAssignmentElement(t);return r.updatePropertyAssignment(t,e.visitNode(t.name,F,e.isPropertyName),i?l?r.createAssignment(i,e.visitNode(l,F)):i:e.visitNode(t.initializer,P,e.isExpression))}if(e.isSpreadAssignment(t))return r.updateSpreadAssignment(t,i||e.visitNode(t.expression,P,e.isExpression));e.Debug.assert(void 0===i,"Should not have generated a wrapped target");}return e.visitNode(t,F)}};}(t),function(e){var t,r;function i(t,r,n,i){var a=0!=(4096&r.getNodeCheckFlags(n)),o=[];return i.forEach((function(r,n){var i=e.unescapeLeadingUnderscores(n),s=[];s.push(t.createPropertyAssignment("get",t.createArrowFunction(void 0,void 0,[],void 0,void 0,e.setEmitFlags(t.createPropertyAccessExpression(e.setEmitFlags(t.createSuper(),4),i),4)))),a&&s.push(t.createPropertyAssignment("set",t.createArrowFunction(void 0,void 0,[t.createParameterDeclaration(void 0,void 0,void 0,"v",void 0,void 0,void 0)],void 0,void 0,t.createAssignment(e.setEmitFlags(t.createPropertyAccessExpression(e.setEmitFlags(t.createSuper(),4),i),4),t.createIdentifier("v"))))),o.push(t.createPropertyAssignment(i,t.createObjectLiteralExpression(s)));})),t.createVariableStatement(void 0,t.createVariableDeclarationList([t.createVariableDeclaration(t.createUniqueName("_super",48),void 0,void 0,t.createCallExpression(t.createPropertyAccessExpression(t.createIdentifier("Object"),"create"),void 0,[t.createNull(),t.createObjectLiteralExpression(o,!0)]))],2))}!function(e){e[e.AsyncMethodsWithSuper=1]="AsyncMethodsWithSuper";}(t||(t={})),function(e){e[e.NonTopLevel=1]="NonTopLevel",e[e.HasLexicalThis=2]="HasLexicalThis";}(r||(r={})),e.transformES2017=function(t){var r,a,o,s,c=t.factory,l=t.getEmitHelperFactory,u=t.resumeLexicalEnvironment,_=t.endLexicalEnvironment,d=t.hoistVariableDeclaration,p=t.getEmitResolver(),f=t.getCompilerOptions(),g=e.getEmitScriptTarget(f),m=0,y=[],v=0,h=t.onEmitNode,b=t.onSubstituteNode;return t.onEmitNode=function(t,n,i){if(1&r&&function(e){var t=e.kind;return 256===t||170===t||168===t||171===t||172===t}(n)){var a=6144&p.getNodeCheckFlags(n);if(a!==m){var o=m;return m=a,h(t,n,i),void(m=o)}}else if(r&&y[e.getNodeId(n)])return o=m,m=0,h(t,n,i),void(m=o);h(t,n,i);},t.onSubstituteNode=function(t,r){return r=b(t,r),1===t&&m?function(t){switch(t.kind){case 205:return J(t);case 206:return z(t);case 207:return function(t){var r=t.expression;if(e.isSuperProperty(r)){var i=e.isPropertyAccessExpression(r)?J(r):z(r);return c.createCallExpression(c.createPropertyAccessExpression(i,"call"),void 0,n$3([c.createThis()],t.arguments,!0))}return t}(t)}return t}(r):r},e.chainBundle(t,(function(r){if(r.isDeclarationFile)return r;x(1,!1),x(2,!e.isEffectiveStrictModeSourceFile(r,f));var n=e.visitEachChild(r,E,t);return e.addEmitHelpers(n,t.readEmitHelpers()),n}));function x(e,t){v=t?v|e:v&~e;}function D(e){return 0!=(v&e)}function S(){return D(2)}function T(e,t,r){var n=e&~v;if(n){x(n,!0);var i=t(r);return x(n,!1),i}return t(r)}function C(r){return e.visitEachChild(r,E,t)}function E(r){if(0==(128&r.transformFlags))return r;switch(r.kind){case 131:return;case 217:return function(r){return D(1)?e.setOriginalNode(e.setTextRange(c.createYieldExpression(void 0,e.visitNode(r.expression,E,e.isExpression)),r),r):e.visitEachChild(r,E,t)}(r);case 168:return T(3,N,r);case 255:return T(3,F,r);case 212:return T(3,A,r);case 213:return T(1,P,r);case 205:return o&&e.isPropertyAccessExpression(r)&&106===r.expression.kind&&o.add(r.name.escapedText),e.visitEachChild(r,E,t);case 206:return o&&106===r.expression.kind&&(s=!0),e.visitEachChild(r,E,t);case 171:case 172:case 170:case 256:case 225:return T(3,C,r);default:return e.visitEachChild(r,E,t)}}function k(r){if(e.isNodeWithPossibleHoistedDeclaration(r))switch(r.kind){case 236:return function(r){if(I(r.declarationList)){var n=O(r.declarationList,!1);return n?c.createExpressionStatement(n):void 0}return e.visitEachChild(r,E,t)}(r);case 241:return function(r){var n=r.initializer;return c.updateForStatement(r,I(n)?O(n,!1):e.visitNode(r.initializer,E,e.isForInitializer),e.visitNode(r.condition,E,e.isExpression),e.visitNode(r.incrementor,E,e.isExpression),e.visitIterationBody(r.statement,k,t))}(r);case 242:return function(r){return c.updateForInStatement(r,I(r.initializer)?O(r.initializer,!0):e.visitNode(r.initializer,E,e.isForInitializer),e.visitNode(r.expression,E,e.isExpression),e.visitIterationBody(r.statement,k,t))}(r);case 243:return function(r){return c.updateForOfStatement(r,e.visitNode(r.awaitModifier,E,e.isToken),I(r.initializer)?O(r.initializer,!0):e.visitNode(r.initializer,E,e.isForInitializer),e.visitNode(r.expression,E,e.isExpression),e.visitIterationBody(r.statement,k,t))}(r);case 291:return function(r){var n,i=new e.Set;if(w(r.variableDeclaration,i),i.forEach((function(t,r){a.has(r)&&(n||(n=new e.Set(a)),n.delete(r));})),n){var o=a;a=n;var s=e.visitEachChild(r,k,t);return a=o,s}return e.visitEachChild(r,k,t)}(r);case 234:case 248:case 262:case 288:case 289:case 251:case 239:case 240:case 238:case 247:case 249:return e.visitEachChild(r,k,t);default:return e.Debug.assertNever(r,"Unhandled node.")}return E(r)}function N(r){return c.updateMethodDeclaration(r,void 0,e.visitNodes(r.modifiers,E,e.isModifier),r.asteriskToken,r.name,void 0,void 0,e.visitParameterList(r.parameters,E,t),void 0,2&e.getFunctionFlags(r)?B(r):e.visitFunctionBody(r.body,E,t))}function F(r){return c.updateFunctionDeclaration(r,void 0,e.visitNodes(r.modifiers,E,e.isModifier),r.asteriskToken,r.name,void 0,e.visitParameterList(r.parameters,E,t),void 0,2&e.getFunctionFlags(r)?B(r):e.visitFunctionBody(r.body,E,t))}function A(r){return c.updateFunctionExpression(r,e.visitNodes(r.modifiers,E,e.isModifier),r.asteriskToken,r.name,void 0,e.visitParameterList(r.parameters,E,t),void 0,2&e.getFunctionFlags(r)?B(r):e.visitFunctionBody(r.body,E,t))}function P(r){return c.updateArrowFunction(r,e.visitNodes(r.modifiers,E,e.isModifier),void 0,e.visitParameterList(r.parameters,E,t),void 0,r.equalsGreaterThanToken,2&e.getFunctionFlags(r)?B(r):e.visitFunctionBody(r.body,E,t))}function w(t,r){var n=t.name;if(e.isIdentifier(n))r.add(n.escapedText);else for(var i=0,a=n.elements;i<a.length;i++){var o=a[i];e.isOmittedExpression(o)||w(o,r);}}function I(t){return !!t&&e.isVariableDeclarationList(t)&&!(3&t.flags)&&t.declarations.some(R)}function O(t,r){!function(t){e.forEach(t.declarations,M);}(t);var n=e.getInitializedVariables(t);return 0===n.length?r?e.visitNode(c.converters.convertToAssignmentElementTarget(t.declarations[0].name),E,e.isExpression):void 0:c.inlineExpressions(e.map(n,L))}function M(t){var r=t.name;if(e.isIdentifier(r))d(r);else for(var n=0,i=r.elements;n<i.length;n++){var a=i[n];e.isOmittedExpression(a)||M(a);}}function L(t){var r=e.setSourceMapRange(c.createAssignment(c.converters.convertToAssignmentElementTarget(t.name),t.initializer),t);return e.visitNode(r,E,e.isExpression)}function R(t){var r=t.name;if(e.isIdentifier(r))return a.has(r.escapedText);for(var n=0,i=r.elements;n<i.length;n++){var o=i[n];if(!e.isOmittedExpression(o)&&R(o))return !0}return !1}function B(n){u();var d=e.getOriginalNode(n,e.isFunctionLike).type,f=g<2?function(t){var r=t&&e.getEntityNameFromTypeNode(t);if(r&&e.isEntityName(r)){var n=p.getTypeReferenceSerializationKind(r);if(n===e.TypeReferenceSerializationKind.TypeWithConstructSignatureAndValue||n===e.TypeReferenceSerializationKind.Unknown)return r}}(d):void 0,m=213===n.kind,v=0!=(8192&p.getNodeCheckFlags(n)),h=a;a=new e.Set;for(var b=0,x=n.parameters;b<x.length;b++)w(x[b],a);var D,T=o,C=s;if(m||(o=new e.Set,s=!1),m){var k=l().createAwaiterHelper(S(),v,f,j(n.body)),N=_();e.some(N)?(O=c.converters.convertToFunctionBlock(k),D=c.updateBlock(O,e.setTextRange(c.createNodeArray(e.concatenate(N,O.statements)),O.statements))):D=k;}else {var F=[],A=c.copyPrologue(n.body.statements,F,!1,E);F.push(c.createReturnStatement(l().createAwaiterHelper(S(),v,f,j(n.body,A)))),e.insertStatementsAfterStandardPrologue(F,_());var P=g>=2&&6144&p.getNodeCheckFlags(n);if(P&&(0==(1&r)&&(r|=1,t.enableSubstitution(207),t.enableSubstitution(205),t.enableSubstitution(206),t.enableEmitNotification(256),t.enableEmitNotification(168),t.enableEmitNotification(171),t.enableEmitNotification(172),t.enableEmitNotification(170),t.enableEmitNotification(236)),o.size)){var I=i(c,p,n,o);y[e.getNodeId(I)]=!0,e.insertStatementsAfterStandardPrologue(F,[I]);}var O=c.createBlock(F,!0);e.setTextRange(O,n.body),P&&s&&(4096&p.getNodeCheckFlags(n)?e.addEmitHelper(O,e.advancedAsyncSuperHelper):2048&p.getNodeCheckFlags(n)&&e.addEmitHelper(O,e.asyncSuperHelper)),D=O;}return a=h,m||(o=T,s=C),D}function j(t,r){return e.isBlock(t)?c.updateBlock(t,e.visitNodes(t.statements,k,e.isStatement,r)):c.converters.convertToFunctionBlock(e.visitNode(t,k,e.isConciseBody))}function J(t){return 106===t.expression.kind?e.setTextRange(c.createPropertyAccessExpression(c.createUniqueName("_super",48),t.name),t):t}function z(t){return 106===t.expression.kind?(r=t.argumentExpression,n=t,4096&m?e.setTextRange(c.createPropertyAccessExpression(c.createCallExpression(c.createUniqueName("_superIndex",48),void 0,[r]),"value"),n):e.setTextRange(c.createCallExpression(c.createUniqueName("_superIndex",48),void 0,[r]),n)):t;var r,n;}},e.createSuperAccessVariableStatement=i;}(t),function(e){var t,r;!function(e){e[e.AsyncMethodsWithSuper=1]="AsyncMethodsWithSuper";}(t||(t={})),function(e){e[e.None=0]="None",e[e.HasLexicalThis=1]="HasLexicalThis",e[e.IterationContainer=2]="IterationContainer",e[e.AncestorFactsMask=3]="AncestorFactsMask",e[e.SourceFileIncludes=1]="SourceFileIncludes",e[e.SourceFileExcludes=2]="SourceFileExcludes",e[e.StrictModeSourceFileIncludes=0]="StrictModeSourceFileIncludes",e[e.ClassOrFunctionIncludes=1]="ClassOrFunctionIncludes",e[e.ClassOrFunctionExcludes=2]="ClassOrFunctionExcludes",e[e.ArrowFunctionIncludes=0]="ArrowFunctionIncludes",e[e.ArrowFunctionExcludes=2]="ArrowFunctionExcludes",e[e.IterationStatementIncludes=2]="IterationStatementIncludes",e[e.IterationStatementExcludes=0]="IterationStatementExcludes";}(r||(r={})),e.transformES2018=function(t){var r=t.factory,i=t.getEmitHelperFactory,a=t.resumeLexicalEnvironment,o=t.endLexicalEnvironment,s=t.hoistVariableDeclaration,c=t.getEmitResolver(),l=t.getCompilerOptions(),u=e.getEmitScriptTarget(l),_=t.onEmitNode;t.onEmitNode=function(t,r,n){if(1&p&&function(e){var t=e.kind;return 256===t||170===t||168===t||171===t||172===t}(r)){var i=6144&c.getNodeCheckFlags(r);if(i!==b){var a=b;return b=i,_(t,r,n),void(b=a)}}else if(p&&D[e.getNodeId(r)])return a=b,b=0,_(t,r,n),void(b=a);_(t,r,n);};var d=t.onSubstituteNode;t.onSubstituteNode=function(t,i){return i=d(t,i),1===t&&b?function(t){switch(t.kind){case 205:return W(t);case 206:return H(t);case 207:return function(t){var i=t.expression;if(e.isSuperProperty(i)){var a=e.isPropertyAccessExpression(i)?W(i):H(i);return r.createCallExpression(r.createPropertyAccessExpression(a,"call"),void 0,n$3([r.createThis()],t.arguments,!0))}return t}(t)}return t}(i):i};var p,f,g,m,y,v,h=!1,b=0,x=0,D=[];return e.chainBundle(t,(function(n){if(n.isDeclarationFile)return n;g=n;var i=function(n){var i=S(2,e.isEffectiveStrictModeSourceFile(n,l)?0:1);h=!1;var a=e.visitEachChild(n,E,t),o=e.concatenate(a.statements,m&&[r.createVariableStatement(void 0,r.createVariableDeclarationList(m))]),s=r.updateSourceFile(a,e.setTextRange(r.createNodeArray(o),n.statements));return T(i),s}(n);return e.addEmitHelpers(i,t.readEmitHelpers()),g=void 0,m=void 0,i}));function S(e,t){var r=x;return x=3&(x&~e|t),r}function T(e){x=e;}function C(t){m=e.append(m,r.createVariableDeclaration(t));}function E(e){return P(e,!1)}function k(e){return P(e,!0)}function N(e){if(131!==e.kind)return e}function F(e,t,r,n){if(function(e,t){return x!==(x&~e|t)}(r,n)){var i=S(r,n),a=e(t);return T(i),a}return e(t)}function A(r){return e.visitEachChild(r,E,t)}function P(a,o){if(0==(64&a.transformFlags))return a;switch(a.kind){case 217:return function(n){return 2&f&&1&f?e.setOriginalNode(e.setTextRange(r.createYieldExpression(void 0,i().createAwaitHelper(e.visitNode(n.expression,E,e.isExpression))),n),n):e.visitEachChild(n,E,t)}(a);case 223:return function(n){if(2&f&&1&f){if(n.asteriskToken){var a=e.visitNode(e.Debug.assertDefined(n.expression),E,e.isExpression);return e.setOriginalNode(e.setTextRange(r.createYieldExpression(void 0,i().createAwaitHelper(r.updateYieldExpression(n,n.asteriskToken,e.setTextRange(i().createAsyncDelegatorHelper(e.setTextRange(i().createAsyncValuesHelper(a),a)),a)))),n),n)}return e.setOriginalNode(e.setTextRange(r.createYieldExpression(void 0,M(n.expression?e.visitNode(n.expression,E,e.isExpression):r.createVoidZero())),n),n)}return e.visitEachChild(n,E,t)}(a);case 246:return function(n){return 2&f&&1&f?r.updateReturnStatement(n,M(n.expression?e.visitNode(n.expression,E,e.isExpression):r.createVoidZero())):e.visitEachChild(n,E,t)}(a);case 249:return function(n){if(2&f){var i=e.unwrapInnermostStatementOfLabel(n);return 243===i.kind&&i.awaitModifier?O(i,n):r.restoreEnclosingLabel(e.visitNode(i,E,e.isStatement,r.liftToBlock),n)}return e.visitEachChild(n,E,t)}(a);case 204:return function(n){if(32768&n.transformFlags){var a=function(t){for(var n,i=[],a=0,o=t;a<o.length;a++){var s=o[a];if(296===s.kind){n&&(i.push(r.createObjectLiteralExpression(n)),n=void 0);var c=s.expression;i.push(e.visitNode(c,E,e.isExpression));}else n=e.append(n,294===s.kind?r.createPropertyAssignment(s.name,e.visitNode(s.initializer,E,e.isExpression)):e.visitNode(s,E,e.isObjectLiteralElementLike));}return n&&i.push(r.createObjectLiteralExpression(n)),i}(n.properties);a.length&&204!==a[0].kind&&a.unshift(r.createObjectLiteralExpression());var o=a[0];if(a.length>1){for(var s=1;s<a.length;s++)o=i().createAssignHelper([o,a[s]]);return o}return i().createAssignHelper(a)}return e.visitEachChild(n,E,t)}(a);case 220:return function(n,i){return e.isDestructuringAssignment(n)&&32768&n.left.transformFlags?e.flattenDestructuringAssignment(n,E,t,1,!i):27===n.operatorToken.kind?r.updateBinaryExpression(n,e.visitNode(n.left,k,e.isExpression),n.operatorToken,e.visitNode(n.right,i?k:E,e.isExpression)):e.visitEachChild(n,E,t)}(a,o);case 349:return function(n,i){if(i)return e.visitEachChild(n,k,t);for(var a,o=0;o<n.elements.length;o++){var s=n.elements[o],c=e.visitNode(s,o<n.elements.length-1?k:E,e.isExpression);(a||c!==s)&&(a||(a=n.elements.slice(0,o)),a.push(c));}var l=a?e.setTextRange(r.createNodeArray(a),n.elements):n.elements;return r.updateCommaListExpression(n,l)}(a,o);case 291:return function(i){if(i.variableDeclaration&&e.isBindingPattern(i.variableDeclaration.name)&&32768&i.variableDeclaration.name.transformFlags){var a=r.getGeneratedNameForNode(i.variableDeclaration.name),o=r.updateVariableDeclaration(i.variableDeclaration,i.variableDeclaration.name,void 0,void 0,a),s=e.flattenDestructuringBinding(o,E,t,1),c=e.visitNode(i.block,E,e.isBlock);return e.some(s)&&(c=r.updateBlock(c,n$3([r.createVariableStatement(void 0,s)],c.statements,!0))),r.updateCatchClause(i,r.updateVariableDeclaration(i.variableDeclaration,a,void 0,void 0,void 0),c)}return e.visitEachChild(i,E,t)}(a);case 236:return function(r){if(e.hasSyntacticModifier(r,1)){var n=h;h=!0;var i=e.visitEachChild(r,E,t);return h=n,i}return e.visitEachChild(r,E,t)}(a);case 253:return function(e){if(h){var t=h;h=!1;var r=w(e,!0);return h=t,r}return w(e,!1)}(a);case 239:case 240:case 242:return F(A,a,0,2);case 243:return O(a,void 0);case 241:return F(I,a,0,2);case 216:return function(r){return e.visitEachChild(r,k,t)}(a);case 170:return F(L,a,2,1);case 168:return F(j,a,2,1);case 171:return F(R,a,2,1);case 172:return F(B,a,2,1);case 255:return F(J,a,2,1);case 212:return F(U,a,2,1);case 213:return F(z,a,2,0);case 163:return function(n){return 32768&n.transformFlags?r.updateParameterDeclaration(n,void 0,void 0,n.dotDotDotToken,r.getGeneratedNameForNode(n),void 0,void 0,e.visitNode(n.initializer,E,e.isExpression)):e.visitEachChild(n,E,t)}(a);case 237:return function(r){return e.visitEachChild(r,k,t)}(a);case 211:return function(r,n){return e.visitEachChild(r,n?k:E,t)}(a,o);case 209:return function(r){return e.processTaggedTemplateExpression(t,r,E,g,C,e.ProcessLevel.LiftRestriction)}(a);case 205:return y&&e.isPropertyAccessExpression(a)&&106===a.expression.kind&&y.add(a.name.escapedText),e.visitEachChild(a,E,t);case 206:return y&&106===a.expression.kind&&(v=!0),e.visitEachChild(a,E,t);case 256:case 225:return F(A,a,2,1);default:return e.visitEachChild(a,E,t)}}function w(r,n){return e.isBindingPattern(r.name)&&32768&r.name.transformFlags?e.flattenDestructuringBinding(r,E,t,1,void 0,n):e.visitEachChild(r,E,t)}function I(n){return r.updateForStatement(n,e.visitNode(n.initializer,k,e.isForInitializer),e.visitNode(n.condition,E,e.isExpression),e.visitNode(n.incrementor,k,e.isExpression),e.visitIterationBody(n.statement,E,t))}function O(n,a){var o=S(0,2);32768&n.initializer.transformFlags&&(n=function(t){var n=e.skipParentheses(t.initializer);if(e.isVariableDeclarationList(n)||e.isAssignmentPattern(n)){var i=void 0,a=void 0,o=r.createTempVariable(void 0),s=[e.createForOfBindingStatement(r,n,o)];return e.isBlock(t.statement)?(e.addRange(s,t.statement.statements),i=t.statement,a=t.statement.statements):t.statement&&(e.append(s,t.statement),i=t.statement,a=t.statement),r.updateForOfStatement(t,t.awaitModifier,e.setTextRange(r.createVariableDeclarationList([e.setTextRange(r.createVariableDeclaration(o),t.initializer)],1),t.initializer),t.expression,e.setTextRange(r.createBlock(e.setTextRange(r.createNodeArray(s),a),!0),i))}return t}(n));var c=n.awaitModifier?function(n,a,o){var c=e.visitNode(n.expression,E,e.isExpression),l=e.isIdentifier(c)?r.getGeneratedNameForNode(c):r.createTempVariable(void 0),u=e.isIdentifier(c)?r.getGeneratedNameForNode(l):r.createTempVariable(void 0),_=r.createUniqueName("e"),d=r.getGeneratedNameForNode(_),p=r.createTempVariable(void 0),f=e.setTextRange(i().createAsyncValuesHelper(c),n.expression),g=r.createCallExpression(r.createPropertyAccessExpression(l,"next"),void 0,[]),m=r.createPropertyAccessExpression(u,"done"),y=r.createPropertyAccessExpression(u,"value"),v=r.createFunctionCallCall(p,l,[]);s(_),s(p);var h=2&o?r.inlineExpressions([r.createAssignment(_,r.createVoidZero()),f]):f,b=e.setEmitFlags(e.setTextRange(r.createForStatement(e.setEmitFlags(e.setTextRange(r.createVariableDeclarationList([e.setTextRange(r.createVariableDeclaration(l,void 0,void 0,h),n.expression),r.createVariableDeclaration(u)]),n.expression),2097152),r.createComma(r.createAssignment(u,M(g)),r.createLogicalNot(m)),void 0,function(n,i){var a,o,s=e.createForOfBindingStatement(r,n.initializer,i),c=[e.visitNode(s,E,e.isStatement)],l=e.visitIterationBody(n.statement,E,t);return e.isBlock(l)?(e.addRange(c,l.statements),a=l,o=l.statements):c.push(l),e.setEmitFlags(e.setTextRange(r.createBlock(e.setTextRange(r.createNodeArray(c),o),!0),a),432)}(n,y)),n),256);return r.createTryStatement(r.createBlock([r.restoreEnclosingLabel(b,a)]),r.createCatchClause(r.createVariableDeclaration(d),e.setEmitFlags(r.createBlock([r.createExpressionStatement(r.createAssignment(_,r.createObjectLiteralExpression([r.createPropertyAssignment("error",d)])))]),1)),r.createBlock([r.createTryStatement(r.createBlock([e.setEmitFlags(r.createIfStatement(r.createLogicalAnd(r.createLogicalAnd(u,r.createLogicalNot(m)),r.createAssignment(p,r.createPropertyAccessExpression(l,"return"))),r.createExpressionStatement(M(v))),1)]),void 0,e.setEmitFlags(r.createBlock([e.setEmitFlags(r.createIfStatement(_,r.createThrowStatement(r.createPropertyAccessExpression(_,"error"))),1)]),1))]))}(n,a,o):r.restoreEnclosingLabel(e.visitEachChild(n,E,t),a);return T(o),c}function M(e){return 1&f?r.createYieldExpression(void 0,i().createAwaitHelper(e)):r.createAwaitExpression(e)}function L(n){var i=f;f=0;var a=r.updateConstructorDeclaration(n,void 0,n.modifiers,e.visitParameterList(n.parameters,E,t),V(n));return f=i,a}function R(n){var i=f;f=0;var a=r.updateGetAccessorDeclaration(n,void 0,n.modifiers,e.visitNode(n.name,E,e.isPropertyName),e.visitParameterList(n.parameters,E,t),void 0,V(n));return f=i,a}function B(n){var i=f;f=0;var a=r.updateSetAccessorDeclaration(n,void 0,n.modifiers,e.visitNode(n.name,E,e.isPropertyName),e.visitParameterList(n.parameters,E,t),V(n));return f=i,a}function j(n){var i=f;f=e.getFunctionFlags(n);var a=r.updateMethodDeclaration(n,void 0,1&f?e.visitNodes(n.modifiers,N,e.isModifier):n.modifiers,2&f?void 0:n.asteriskToken,e.visitNode(n.name,E,e.isPropertyName),e.visitNode(void 0,E,e.isToken),void 0,e.visitParameterList(n.parameters,E,t),void 0,2&f&&1&f?K(n):V(n));return f=i,a}function J(n){var i=f;f=e.getFunctionFlags(n);var a=r.updateFunctionDeclaration(n,void 0,1&f?e.visitNodes(n.modifiers,N,e.isModifier):n.modifiers,2&f?void 0:n.asteriskToken,n.name,void 0,e.visitParameterList(n.parameters,E,t),void 0,2&f&&1&f?K(n):V(n));return f=i,a}function z(n){var i=f;f=e.getFunctionFlags(n);var a=r.updateArrowFunction(n,n.modifiers,void 0,e.visitParameterList(n.parameters,E,t),void 0,n.equalsGreaterThanToken,V(n));return f=i,a}function U(n){var i=f;f=e.getFunctionFlags(n);var a=r.updateFunctionExpression(n,1&f?e.visitNodes(n.modifiers,N,e.isModifier):n.modifiers,2&f?void 0:n.asteriskToken,n.name,void 0,e.visitParameterList(n.parameters,E,t),void 0,2&f&&1&f?K(n):V(n));return f=i,a}function K(n){a();var s=[],l=r.copyPrologue(n.body.statements,s,!1,E);q(s,n);var _=y,d=v;y=new e.Set,v=!1;var f=r.createReturnStatement(i().createAsyncGeneratorHelper(r.createFunctionExpression(void 0,r.createToken(41),n.name&&r.getGeneratedNameForNode(n.name),void 0,[],void 0,r.updateBlock(n.body,e.visitLexicalEnvironment(n.body.statements,E,t,l))),!!(1&x))),g=u>=2&&6144&c.getNodeCheckFlags(n);if(g){0==(1&p)&&(p|=1,t.enableSubstitution(207),t.enableSubstitution(205),t.enableSubstitution(206),t.enableEmitNotification(256),t.enableEmitNotification(168),t.enableEmitNotification(171),t.enableEmitNotification(172),t.enableEmitNotification(170),t.enableEmitNotification(236));var m=e.createSuperAccessVariableStatement(r,c,n,y);D[e.getNodeId(m)]=!0,e.insertStatementsAfterStandardPrologue(s,[m]);}s.push(f),e.insertStatementsAfterStandardPrologue(s,o());var h=r.updateBlock(n.body,s);return g&&v&&(4096&c.getNodeCheckFlags(n)?e.addEmitHelper(h,e.advancedAsyncSuperHelper):2048&c.getNodeCheckFlags(n)&&e.addEmitHelper(h,e.asyncSuperHelper)),y=_,v=d,h}function V(t){var n;a();var i=0,s=[],c=null!==(n=e.visitNode(t.body,E,e.isConciseBody))&&void 0!==n?n:r.createBlock([]);e.isBlock(c)&&(i=r.copyPrologue(c.statements,s,!1,E)),e.addRange(s,q(void 0,t));var l=o();if(i>0||e.some(s)||e.some(l)){var u=r.converters.convertToFunctionBlock(c,!0);return e.insertStatementsAfterStandardPrologue(s,l),e.addRange(s,u.statements.slice(i)),r.updateBlock(u,e.setTextRange(r.createNodeArray(s),u.statements))}return c}function q(n,i){for(var a=0,o=i.parameters;a<o.length;a++){var s=o[a];if(32768&s.transformFlags){var c=r.getGeneratedNameForNode(s),l=e.flattenDestructuringBinding(s,E,t,1,c,!1,!0);if(e.some(l)){var u=r.createVariableStatement(void 0,r.createVariableDeclarationList(l));e.setEmitFlags(u,1048576),n=e.append(n,u);}}}return n}function W(t){return 106===t.expression.kind?e.setTextRange(r.createPropertyAccessExpression(r.createUniqueName("_super",48),t.name),t):t}function H(t){return 106===t.expression.kind?(n=t.argumentExpression,i=t,4096&b?e.setTextRange(r.createPropertyAccessExpression(r.createCallExpression(r.createIdentifier("_superIndex"),void 0,[n]),"value"),i):e.setTextRange(r.createCallExpression(r.createIdentifier("_superIndex"),void 0,[n]),i)):t;var n,i;}};}(t),function(e){e.transformES2019=function(t){var r=t.factory;return e.chainBundle(t,(function(r){return r.isDeclarationFile?r:e.visitEachChild(r,n,t)}));function n(i){if(0==(32&i.transformFlags))return i;switch(i.kind){case 291:return function(i){return i.variableDeclaration?e.visitEachChild(i,n,t):r.updateCatchClause(i,r.createVariableDeclaration(r.createTempVariable(void 0)),e.visitNode(i.block,n,e.isBlock))}(i);default:return e.visitEachChild(i,n,t)}}};}(t),function(e){e.transformES2020=function(t){var r=t.factory,n=t.hoistVariableDeclaration;return e.chainBundle(t,(function(r){return r.isDeclarationFile?r:e.visitEachChild(r,i,t)}));function i(a){if(0==(16&a.transformFlags))return a;switch(a.kind){case 207:var u=o(a,!1);return e.Debug.assertNotNode(u,e.isSyntheticReference),u;case 205:case 206:return e.isOptionalChain(a)?(u=c(a,!1,!1),e.Debug.assertNotNode(u,e.isSyntheticReference),u):e.visitEachChild(a,i,t);case 220:return 60===a.operatorToken.kind?function(t){var a=e.visitNode(t.left,i,e.isExpression),o=a;return e.isSimpleCopiableExpression(a)||(o=r.createTempVariable(n),a=r.createAssignment(o,a)),e.setTextRange(r.createConditionalExpression(l(a,o),void 0,o,void 0,e.visitNode(t.right,i,e.isExpression)),t)}(a):e.visitEachChild(a,i,t);case 214:return function(t){return e.isOptionalChain(e.skipParentheses(t.expression))?e.setOriginalNode(s(t.expression,!1,!0),t):r.updateDeleteExpression(t,e.visitNode(t.expression,i,e.isExpression))}(a);default:return e.visitEachChild(a,i,t)}}function a(t,n,i){var a=s(t.expression,n,i);return e.isSyntheticReference(a)?r.createSyntheticReferenceExpression(r.updateParenthesizedExpression(t,a.expression),a.thisArg):r.updateParenthesizedExpression(t,a)}function o(n,o){if(e.isOptionalChain(n))return c(n,o,!1);if(e.isParenthesizedExpression(n.expression)&&e.isOptionalChain(e.skipParentheses(n.expression))){var s=a(n.expression,!0,!1),l=e.visitNodes(n.arguments,i,e.isExpression);return e.isSyntheticReference(s)?e.setTextRange(r.createFunctionCallCall(s.expression,s.thisArg,l),n):r.updateCallExpression(n,s,void 0,l)}return e.visitEachChild(n,i,t)}function s(t,s,l){switch(t.kind){case 211:return a(t,s,l);case 205:case 206:return function(t,a,o){if(e.isOptionalChain(t))return c(t,a,o);var s,l=e.visitNode(t.expression,i,e.isExpression);return e.Debug.assertNotNode(l,e.isSyntheticReference),a&&(e.isSimpleCopiableExpression(l)?s=l:(s=r.createTempVariable(n),l=r.createAssignment(s,l))),l=205===t.kind?r.updatePropertyAccessExpression(t,l,e.visitNode(t.name,i,e.isIdentifier)):r.updateElementAccessExpression(t,l,e.visitNode(t.argumentExpression,i,e.isExpression)),s?r.createSyntheticReferenceExpression(l,s):l}(t,s,l);case 207:return o(t,s);default:return e.visitNode(t,i,e.isExpression)}}function c(t,a,o){var c=function(t){e.Debug.assertNotNode(t,e.isNonNullChain);for(var r=[t];!t.questionDotToken&&!e.isTaggedTemplateExpression(t);)t=e.cast(e.skipPartiallyEmittedExpressions(t.expression),e.isOptionalChain),e.Debug.assertNotNode(t,e.isNonNullChain),r.unshift(t);return {expression:t.expression,chain:r}}(t),u=c.expression,_=c.chain,d=s(u,e.isCallChain(_[0]),!1),p=e.isSyntheticReference(d)?d.thisArg:void 0,f=e.isSyntheticReference(d)?d.expression:d,g=f;e.isSimpleCopiableExpression(f)||(g=r.createTempVariable(n),f=r.createAssignment(g,f));for(var m,y=g,v=0;v<_.length;v++){var h=_[v];switch(h.kind){case 205:case 206:v===_.length-1&&a&&(e.isSimpleCopiableExpression(y)?m=y:(m=r.createTempVariable(n),y=r.createAssignment(m,y))),y=205===h.kind?r.createPropertyAccessExpression(y,e.visitNode(h.name,i,e.isIdentifier)):r.createElementAccessExpression(y,e.visitNode(h.argumentExpression,i,e.isExpression));break;case 207:y=0===v&&p?r.createFunctionCallCall(y,106===p.kind?r.createThis():p,e.visitNodes(h.arguments,i,e.isExpression)):r.createCallExpression(y,void 0,e.visitNodes(h.arguments,i,e.isExpression));}e.setOriginalNode(y,h);}var b=o?r.createConditionalExpression(l(f,g,!0),void 0,r.createTrue(),void 0,r.createDeleteExpression(y)):r.createConditionalExpression(l(f,g,!0),void 0,r.createVoidZero(),void 0,y);return e.setTextRange(b,t),m?r.createSyntheticReferenceExpression(b,m):b}function l(e,t,n){return r.createBinaryExpression(r.createBinaryExpression(e,r.createToken(n?36:37),r.createNull()),r.createToken(n?56:55),r.createBinaryExpression(t,r.createToken(n?36:37),r.createVoidZero()))}};}(t),function(e){e.transformES2021=function(t){var r=t.hoistVariableDeclaration,n=t.factory;return e.chainBundle(t,(function(r){return r.isDeclarationFile?r:e.visitEachChild(r,i,t)}));function i(a){if(0==(8&a.transformFlags))return a;switch(a.kind){case 220:var o=a;if(e.isLogicalOrCoalescingAssignmentExpression(o))return function(t){var a=t.operatorToken,o=e.getNonAssignmentOperatorForCompoundAssignment(a.kind),s=e.skipParentheses(e.visitNode(t.left,i,e.isLeftHandSideExpression)),c=s,l=e.skipParentheses(e.visitNode(t.right,i,e.isExpression));if(e.isAccessExpression(s)){var u=e.isSimpleCopiableExpression(s.expression),_=u?s.expression:n.createTempVariable(r),d=u?s.expression:n.createAssignment(_,s.expression);if(e.isPropertyAccessExpression(s))c=n.createPropertyAccessExpression(_,s.name),s=n.createPropertyAccessExpression(d,s.name);else {var p=e.isSimpleCopiableExpression(s.argumentExpression),f=p?s.argumentExpression:n.createTempVariable(r);c=n.createElementAccessExpression(_,f),s=n.createElementAccessExpression(d,p?s.argumentExpression:n.createAssignment(f,s.argumentExpression));}}return n.createBinaryExpression(s,o,n.createParenthesizedExpression(n.createAssignment(c,l)))}(o);default:return e.visitEachChild(a,i,t)}}};}(t),function(e){e.transformESNext=function(t){return e.chainBundle(t,(function(n){return n.isDeclarationFile?n:e.visitEachChild(n,r,t)}));function r(n){return 0==(4&n.transformFlags)?n:(e.visitEachChild(n,r,t))}};}(t),function(e){e.transformJsx=function(r){var n,i,a=r.factory,o=r.getEmitHelperFactory,s=r.getCompilerOptions();return e.chainBundle(r,(function(t){if(t.isDeclarationFile)return t;n=t,(i={}).importSpecifier=e.getJSXImplicitImportBase(s,t);var o=e.visitEachChild(t,u,r);e.addEmitHelpers(o,r.readEmitHelpers());var c=o.statements;if(i.filenameDeclaration&&(c=e.insertStatementAfterCustomPrologue(c.slice(),a.createVariableStatement(void 0,a.createVariableDeclarationList([i.filenameDeclaration],2)))),i.utilizedImplicitRuntimeImports)for(var l=0,_=e.arrayFrom(i.utilizedImplicitRuntimeImports.entries());l<_.length;l++){var d=_[l],p=d[0],f=d[1];if(e.isExternalModule(t)){var g=a.createImportDeclaration(void 0,void 0,a.createImportClause(!1,void 0,a.createNamedImports(e.arrayFrom(f.values()))),a.createStringLiteral(p),void 0);e.setParentRecursive(g,!1),c=e.insertStatementAfterCustomPrologue(c.slice(),g);}else if(e.isExternalOrCommonJsModule(t)){var m=a.createVariableStatement(void 0,a.createVariableDeclarationList([a.createVariableDeclaration(a.createObjectBindingPattern(e.map(e.arrayFrom(f.values()),(function(e){return a.createBindingElement(void 0,e.propertyName,e.name)}))),void 0,void 0,a.createCallExpression(a.createIdentifier("require"),void 0,[a.createStringLiteral(p)]))],2));e.setParentRecursive(m,!1),c=e.insertStatementAfterCustomPrologue(c.slice(),m);}}return c!==o.statements&&(o=a.updateSourceFile(o,c)),i=void 0,o}));function c(){if(i.filenameDeclaration)return i.filenameDeclaration.name;var e=a.createVariableDeclaration(a.createUniqueName("_jsxFileName",48),void 0,void 0,a.createStringLiteral(n.fileName));return i.filenameDeclaration=e,i.filenameDeclaration.name}function l(t){var r,n,o="createElement"===t?i.importSpecifier:e.getJSXRuntimeImport(i.importSpecifier,s),c=null===(n=null===(r=i.utilizedImplicitRuntimeImports)||void 0===r?void 0:r.get(o))||void 0===n?void 0:n.get(t);if(c)return c.name;i.utilizedImplicitRuntimeImports||(i.utilizedImplicitRuntimeImports=e.createMap());var l=i.utilizedImplicitRuntimeImports.get(o);l||(l=e.createMap(),i.utilizedImplicitRuntimeImports.set(o,l));var u=a.createUniqueName("_".concat(t),112),_=a.createImportSpecifier(!1,a.createIdentifier(t),u);return u.generatedImportReference=_,l.set(t,_),u}function u(t){return 2&t.transformFlags?function(t){switch(t.kind){case 277:return p(t,!1);case 278:return f(t,!1);case 281:return g(t,!1);case 287:return F(t);default:return e.visitEachChild(t,u,r)}}(t):t}function _(t){switch(t.kind){case 11:return function(t){var r=function(t){for(var r,n=0,i=-1,a=0;a<t.length;a++){var o=t.charCodeAt(a);e.isLineBreak(o)?(-1!==n&&-1!==i&&(r=E(r,t.substr(n,i-n+1))),n=-1):e.isWhiteSpaceSingleLine(o)||(i=a,-1===n&&(n=a));}return -1!==n?E(r,t.substr(n)):r}(t.text);return void 0===r?void 0:a.createStringLiteral(r)}(t);case 287:return F(t);case 277:return p(t,!0);case 278:return f(t,!0);case 281:return g(t,!0);default:return e.Debug.failBadSyntaxKind(t)}}function d(t){return void 0===i.importSpecifier||function(t){for(var r=!1,n=0,i=t.attributes.properties;n<i.length;n++){var a=i[n];if(e.isJsxSpreadAttribute(a))r=!0;else if(r&&e.isJsxAttribute(a)&&"key"===a.name.escapedText)return !0}return !1}(t)}function p(e,t){return (d(e.openingElement)?h:y)(e.openingElement,e.children,t,e)}function f(e,t){return (d(e)?h:y)(e,void 0,t,e)}function g(e,t){return (void 0===i.importSpecifier?x:b)(e.openingFragment,e.children,t,e)}function m(t){var r=e.getSemanticJsxChildren(t);if(1===e.length(r)&&!r[0].dotDotDotToken){var n=_(r[0]);return n&&a.createPropertyAssignment("children",n)}var i=e.mapDefined(t,_);return e.length(i)?a.createPropertyAssignment("children",a.createArrayLiteralExpression(i)):void 0}function y(t,r,n,i){var o=N(t),s=r&&r.length?m(r):void 0,c=e.find(t.attributes.properties,(function(t){return !!t.name&&e.isIdentifier(t.name)&&"key"===t.name.escapedText})),l=c?e.filter(t.attributes.properties,(function(e){return e!==c})):t.attributes.properties;return v(o,e.length(l)?D(l,s):a.createObjectLiteralExpression(s?[s]:e.emptyArray),c,r||e.emptyArray,n,i)}function v(t,r,i,o,u,_){var d,p=e.getSemanticJsxChildren(o),f=e.length(p)>1||!!(null===(d=p[0])||void 0===d?void 0:d.dotDotDotToken),g=[t,r,i?C(i.initializer):a.createVoidZero()];if(5===s.jsx){var m=e.getOriginalNode(n);if(m&&e.isSourceFile(m)){g.push(f?a.createTrue():a.createFalse());var y=e.getLineAndCharacterOfPosition(m,_.pos);g.push(a.createObjectLiteralExpression([a.createPropertyAssignment("fileName",c()),a.createPropertyAssignment("lineNumber",a.createNumericLiteral(y.line+1)),a.createPropertyAssignment("columnNumber",a.createNumericLiteral(y.character+1))])),g.push(a.createThis());}}var v=e.setTextRange(a.createCallExpression(function(e){return l(function(e){return 5===s.jsx?"jsxDEV":e?"jsxs":"jsx"}(e))}(f),void 0,g),_);return u&&e.startOnNewLine(v),v}function h(t,o,c,u){var d=N(t),p=t.attributes.properties,f=e.length(p)?D(p):a.createNull(),g=void 0===i.importSpecifier?e.createJsxFactoryExpression(a,r.getEmitResolver().getJsxFactoryEntity(n),s.reactNamespace,t):l("createElement"),m=e.createExpressionForJsxElement(a,g,d,f,e.mapDefined(o,_),u);return c&&e.startOnNewLine(m),m}function b(e,t,r,n){var i;if(t&&t.length){var o=function(e){var t=m(e);return t&&a.createObjectLiteralExpression([t])}(t);o&&(i=o);}return v(l("Fragment"),i||a.createObjectLiteralExpression([]),void 0,t,r,n)}function x(t,i,o,c){var l=e.createExpressionForJsxFragment(a,r.getEmitResolver().getJsxFactoryEntity(n),r.getEmitResolver().getJsxFragmentFactoryEntity(n),s.reactNamespace,e.mapDefined(i,_),t,c);return o&&e.startOnNewLine(l),l}function D(t,r){var n=e.getEmitScriptTarget(s);return n&&n>=5?a.createObjectLiteralExpression(function(t,r){var n=e.flatten(e.spanMap(t,e.isJsxSpreadAttribute,(function(t,r){return e.map(t,(function(t){return r?(n=t,a.createSpreadAssignment(e.visitNode(n.expression,u,e.isExpression))):T(t);var n;}))})));return r&&n.push(r),n}(t,r)):function(t,r){var n=e.flatten(e.spanMap(t,e.isJsxSpreadAttribute,(function(t,r){return r?e.map(t,S):a.createObjectLiteralExpression(e.map(t,T))})));return e.isJsxSpreadAttribute(t[0])&&n.unshift(a.createObjectLiteralExpression()),r&&n.push(a.createObjectLiteralExpression([r])),e.singleOrUndefined(n)||o().createAssignHelper(n)}(t,r)}function S(t){return e.visitNode(t.expression,u,e.isExpression)}function T(t){var r=function(t){var r=t.name,n=e.idText(r);return /^[A-Za-z_]\w*$/.test(n)?r:a.createStringLiteral(n)}(t),n=C(t.initializer);return a.createPropertyAssignment(r,n)}function C(t){if(void 0===t)return a.createTrue();if(10===t.kind){var r=void 0!==t.singleQuote?t.singleQuote:!e.isStringDoubleQuoted(t,n),i=a.createStringLiteral(((s=k(o=t.text))===o?void 0:s)||t.text,r);return e.setTextRange(i,t)}return 287===t.kind?void 0===t.expression?a.createTrue():e.visitNode(t.expression,u,e.isExpression):e.Debug.failBadSyntaxKind(t);var o,s;}function E(e,t){var r=k(t);return void 0===e?r:e+" "+r}function k(r){return r.replace(/&((#((\d+)|x([\da-fA-F]+)))|(\w+));/g,(function(r,n,i,a,o,s,c){if(o)return e.utf16EncodeAsString(parseInt(o,10));if(s)return e.utf16EncodeAsString(parseInt(s,16));var l=t.get(c);return l?e.utf16EncodeAsString(l):r}))}function N(t){if(277===t.kind)return N(t.openingElement);var r=t.tagName;return e.isIdentifier(r)&&e.isIntrinsicJsxName(r.escapedText)?a.createStringLiteral(e.idText(r)):e.createExpressionFromEntityName(a,r)}function F(t){var r=e.visitNode(t.expression,u,e.isExpression);return t.dotDotDotToken?a.createSpreadElement(r):r}};var t=new e.Map(e.getEntries({quot:34,amp:38,apos:39,lt:60,gt:62,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,copy:169,ordf:170,laquo:171,not:172,shy:173,reg:174,macr:175,deg:176,plusmn:177,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,sup1:185,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,Agrave:192,Aacute:193,Acirc:194,Atilde:195,Auml:196,Aring:197,AElig:198,Ccedil:199,Egrave:200,Eacute:201,Ecirc:202,Euml:203,Igrave:204,Iacute:205,Icirc:206,Iuml:207,ETH:208,Ntilde:209,Ograve:210,Oacute:211,Ocirc:212,Otilde:213,Ouml:214,times:215,Oslash:216,Ugrave:217,Uacute:218,Ucirc:219,Uuml:220,Yacute:221,THORN:222,szlig:223,agrave:224,aacute:225,acirc:226,atilde:227,auml:228,aring:229,aelig:230,ccedil:231,egrave:232,eacute:233,ecirc:234,euml:235,igrave:236,iacute:237,icirc:238,iuml:239,eth:240,ntilde:241,ograve:242,oacute:243,ocirc:244,otilde:245,ouml:246,divide:247,oslash:248,ugrave:249,uacute:250,ucirc:251,uuml:252,yacute:253,thorn:254,yuml:255,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830}));}(t),function(e){e.transformES2016=function(t){var r=t.factory,n=t.hoistVariableDeclaration;return e.chainBundle(t,(function(r){return r.isDeclarationFile?r:e.visitEachChild(r,i,t)}));function i(a){if(0==(256&a.transformFlags))return a;switch(a.kind){case 220:return function(a){switch(a.operatorToken.kind){case 67:return function(t){var a,o,s=e.visitNode(t.left,i,e.isExpression),c=e.visitNode(t.right,i,e.isExpression);if(e.isElementAccessExpression(s)){var l=r.createTempVariable(n),u=r.createTempVariable(n);a=e.setTextRange(r.createElementAccessExpression(e.setTextRange(r.createAssignment(l,s.expression),s.expression),e.setTextRange(r.createAssignment(u,s.argumentExpression),s.argumentExpression)),s),o=e.setTextRange(r.createElementAccessExpression(l,u),s);}else e.isPropertyAccessExpression(s)?(l=r.createTempVariable(n),a=e.setTextRange(r.createPropertyAccessExpression(e.setTextRange(r.createAssignment(l,s.expression),s.expression),s.name),s),o=e.setTextRange(r.createPropertyAccessExpression(l,s.name),s)):(a=s,o=s);return e.setTextRange(r.createAssignment(a,e.setTextRange(r.createGlobalMethodCall("Math","pow",[o,c]),t)),t)}(a);case 42:return function(t){var n=e.visitNode(t.left,i,e.isExpression),a=e.visitNode(t.right,i,e.isExpression);return e.setTextRange(r.createGlobalMethodCall("Math","pow",[n,a]),t)}(a);default:return e.visitEachChild(a,i,t)}}(a);default:return e.visitEachChild(a,i,t)}}};}(t),function(e){var t,r,i,a,o,s;function c(e,t){return {kind:e,expression:t}}!function(e){e[e.CapturedThis=1]="CapturedThis",e[e.BlockScopedBindings=2]="BlockScopedBindings";}(t||(t={})),function(e){e[e.Body=1]="Body",e[e.Initializer=2]="Initializer";}(r||(r={})),function(e){e[e.ToOriginal=0]="ToOriginal",e[e.ToOutParameter=1]="ToOutParameter";}(i||(i={})),function(e){e[e.Break=2]="Break",e[e.Continue=4]="Continue",e[e.Return=8]="Return";}(a||(a={})),function(e){e[e.None=0]="None",e[e.Function=1]="Function",e[e.ArrowFunction=2]="ArrowFunction",e[e.AsyncFunctionBody=4]="AsyncFunctionBody",e[e.NonStaticClassElement=8]="NonStaticClassElement",e[e.CapturesThis=16]="CapturesThis",e[e.ExportedVariableStatement=32]="ExportedVariableStatement",e[e.TopLevel=64]="TopLevel",e[e.Block=128]="Block",e[e.IterationStatement=256]="IterationStatement",e[e.IterationStatementBlock=512]="IterationStatementBlock",e[e.IterationContainer=1024]="IterationContainer",e[e.ForStatement=2048]="ForStatement",e[e.ForInOrForOfStatement=4096]="ForInOrForOfStatement",e[e.ConstructorWithCapturedSuper=8192]="ConstructorWithCapturedSuper",e[e.StaticInitializer=16384]="StaticInitializer",e[e.AncestorFactsMask=32767]="AncestorFactsMask",e[e.BlockScopeIncludes=0]="BlockScopeIncludes",e[e.BlockScopeExcludes=7104]="BlockScopeExcludes",e[e.SourceFileIncludes=64]="SourceFileIncludes",e[e.SourceFileExcludes=8064]="SourceFileExcludes",e[e.FunctionIncludes=65]="FunctionIncludes",e[e.FunctionExcludes=32670]="FunctionExcludes",e[e.AsyncFunctionBodyIncludes=69]="AsyncFunctionBodyIncludes",e[e.AsyncFunctionBodyExcludes=32662]="AsyncFunctionBodyExcludes",e[e.ArrowFunctionIncludes=66]="ArrowFunctionIncludes",e[e.ArrowFunctionExcludes=15232]="ArrowFunctionExcludes",e[e.ConstructorIncludes=73]="ConstructorIncludes",e[e.ConstructorExcludes=32662]="ConstructorExcludes",e[e.DoOrWhileStatementIncludes=1280]="DoOrWhileStatementIncludes",e[e.DoOrWhileStatementExcludes=0]="DoOrWhileStatementExcludes",e[e.ForStatementIncludes=3328]="ForStatementIncludes",e[e.ForStatementExcludes=5056]="ForStatementExcludes",e[e.ForInOrForOfStatementIncludes=5376]="ForInOrForOfStatementIncludes",e[e.ForInOrForOfStatementExcludes=3008]="ForInOrForOfStatementExcludes",e[e.BlockIncludes=128]="BlockIncludes",e[e.BlockExcludes=6976]="BlockExcludes",e[e.IterationStatementBlockIncludes=512]="IterationStatementBlockIncludes",e[e.IterationStatementBlockExcludes=7104]="IterationStatementBlockExcludes",e[e.StaticInitializerIncludes=16449]="StaticInitializerIncludes",e[e.StaticInitializerExcludes=32670]="StaticInitializerExcludes",e[e.NewTarget=32768]="NewTarget",e[e.CapturedLexicalThis=65536]="CapturedLexicalThis",e[e.SubtreeFactsMask=-32768]="SubtreeFactsMask",e[e.ArrowFunctionSubtreeExcludes=0]="ArrowFunctionSubtreeExcludes",e[e.FunctionSubtreeExcludes=98304]="FunctionSubtreeExcludes";}(o||(o={})),function(e){e[e.None=0]="None",e[e.UnpackedSpread=1]="UnpackedSpread",e[e.PackedSpread=2]="PackedSpread";}(s||(s={})),e.transformES2015=function(t){var r,i,a,o,s,l,u=t.factory,_=t.getEmitHelperFactory,d=t.startLexicalEnvironment,p=t.resumeLexicalEnvironment,f=t.endLexicalEnvironment,g=t.hoistVariableDeclaration,m=t.getCompilerOptions(),y=t.getEmitResolver(),v=t.onSubstituteNode,h=t.onEmitNode;function b(t){o=e.append(o,u.createVariableDeclaration(t));}return t.onEmitNode=function(t,r,n){if(1&l&&e.isFunctionLike(r)){var i=x(32670,8&e.getEmitFlags(r)?81:65);return h(t,r,n),void D(i,0,0)}h(t,r,n);},t.onSubstituteNode=function(t,r){return r=v(t,r),1===t?function(t){switch(t.kind){case 79:return function(t){if(2&l&&!e.isInternalName(t)){var r=y.getReferencedDeclarationWithCollidingName(t);if(r&&(!e.isClassLike(r)||!function(t,r){var n=e.getParseTreeNode(r);if(!n||n===t||n.end<=t.pos||n.pos>=t.end)return !1;for(var i=e.getEnclosingBlockScopeContainer(t);n;){if(n===i||n===t)return !1;if(e.isClassElement(n)&&n.parent===t)return !0;n=n.parent;}return !1}(r,t)))return e.setTextRange(u.getGeneratedNameForNode(e.getNameOfDeclaration(r)),t)}return t}(t);case 108:return function(t){return 1&l&&16&a?e.setTextRange(u.createUniqueName("_this",48),t):t}(t)}return t}(r):e.isIdentifier(r)?function(t){if(2&l&&!e.isInternalName(t)){var r=e.getParseTreeNode(t,e.isIdentifier);if(r&&function(e){switch(e.parent.kind){case 202:case 256:case 259:case 253:return e.parent.name===e&&y.isDeclarationWithCollidingName(e.parent)}return !1}(r))return e.setTextRange(u.getGeneratedNameForNode(r),t)}return t}(r):r},e.chainBundle(t,(function(n){if(n.isDeclarationFile)return n;r=n,i=n.text;var s=function(t){var r=x(8064,64),n=[],i=[];d();var a=u.copyPrologue(t.statements,n,!1,C);return e.addRange(i,e.visitNodes(t.statements,C,e.isStatement,a)),o&&i.push(u.createVariableStatement(void 0,u.createVariableDeclarationList(o))),u.mergeLexicalEnvironment(n,f()),z(n,t),D(r,0,0),u.updateSourceFile(t,e.setTextRange(u.createNodeArray(e.concatenate(n,i)),t.statements))}(n);return e.addEmitHelpers(s,t.readEmitHelpers()),r=void 0,i=void 0,o=void 0,a=0,s}));function x(e,t){var r=a;return a=32767&(a&~e|t),r}function D(e,t,r){a=-32768&(a&~t|r)|e;}function S(e){return 0!=(8192&a)&&246===e.kind&&!e.expression}function T(t){return 0!=(512&t.transformFlags)||void 0!==s||8192&a&&function(t){return 2097152&t.transformFlags&&(e.isReturnStatement(t)||e.isIfStatement(t)||e.isWithStatement(t)||e.isSwitchStatement(t)||e.isCaseBlock(t)||e.isCaseClause(t)||e.isDefaultClause(t)||e.isTryStatement(t)||e.isCatchClause(t)||e.isLabeledStatement(t)||e.isIterationStatement(t,!1)||e.isBlock(t))}(t)||e.isIterationStatement(t,!1)&&pe(t)||0!=(33554432&e.getEmitFlags(t))}function C(e){return T(e)?F(e,!1):e}function E(e){return T(e)?F(e,!0):e}function k(t){if(T(t)){var r=e.getOriginalNode(t);if(e.isPropertyDeclaration(r)&&e.hasStaticModifier(r)){var n=x(32670,16449),i=F(t,!1);return D(n,98304,0),i}return F(t,!1)}return t}function N(e){return 106===e.kind?we(!0):C(e)}function F(i,o){switch(i.kind){case 124:return;case 256:return function(t){var r=u.createVariableDeclaration(u.getLocalName(t,!0),void 0,void 0,w(t));e.setOriginalNode(r,t);var n=[],i=u.createVariableStatement(void 0,u.createVariableDeclarationList([r]));if(e.setOriginalNode(i,t),e.setTextRange(i,t),e.startOnNewLine(i),n.push(i),e.hasSyntacticModifier(t,1)){var a=e.hasSyntacticModifier(t,512)?u.createExportDefault(u.getLocalName(t)):u.createExternalModuleExport(u.getLocalName(t));e.setOriginalNode(a,i),n.push(a);}var o=e.getEmitFlags(t);return 0==(4194304&o)&&(n.push(u.createEndOfDeclarationMarker(t)),e.setEmitFlags(i,4194304|o)),e.singleOrMany(n)}(i);case 225:return function(e){return w(e)}(i);case 163:return function(t){return t.dotDotDotToken?void 0:e.isBindingPattern(t.name)?e.setOriginalNode(e.setTextRange(u.createParameterDeclaration(void 0,void 0,void 0,u.getGeneratedNameForNode(t),void 0,void 0,void 0),t),t):t.initializer?e.setOriginalNode(e.setTextRange(u.createParameterDeclaration(void 0,void 0,void 0,t.name,void 0,void 0,void 0),t),t):t}(i);case 255:return function(r){var n=s;s=void 0;var i=x(32670,65),o=e.visitParameterList(r.parameters,C,t),c=Q(r),l=32768&a?u.getLocalName(r):r.name;return D(i,98304,0),s=n,u.updateFunctionDeclaration(r,void 0,e.visitNodes(r.modifiers,C,e.isModifier),r.asteriskToken,l,void 0,o,void 0,c)}(i);case 213:return function(r){8192&r.transformFlags&&!(16384&a)&&(a|=65536);var n=s;s=void 0;var i=x(15232,66),o=u.createFunctionExpression(void 0,void 0,void 0,void 0,e.visitParameterList(r.parameters,C,t),void 0,Q(r));return e.setTextRange(o,r),e.setOriginalNode(o,r),e.setEmitFlags(o,8),D(i,0,0),s=n,o}(i);case 212:return function(r){var n=262144&e.getEmitFlags(r)?x(32662,69):x(32670,65),i=s;s=void 0;var o=e.visitParameterList(r.parameters,C,t),c=Q(r),l=32768&a?u.getLocalName(r):r.name;return D(n,98304,0),s=i,u.updateFunctionExpression(r,void 0,r.asteriskToken,l,void 0,o,void 0,c)}(i);case 253:return Z(i);case 79:return P(i);case 254:return function(r){if(3&r.flags||262144&r.transformFlags){3&r.flags&&Ie();var n=e.flatMap(r.declarations,1&r.flags?Y:Z),i=u.createVariableDeclarationList(n);return e.setOriginalNode(i,r),e.setTextRange(i,r),e.setCommentRange(i,r),262144&r.transformFlags&&(e.isBindingPattern(r.declarations[0].name)||e.isBindingPattern(e.last(r.declarations).name))&&e.setSourceMapRange(i,function(t){for(var r=-1,n=-1,i=0,a=t;i<a.length;i++){var o=a[i];r=-1===r?o.pos:-1===o.pos?r:Math.min(r,o.pos),n=Math.max(n,o.end);}return e.createRange(r,n)}(n)),i}return e.visitEachChild(r,C,t)}(i);case 248:return function(r){if(void 0!==s){var n=s.allowedNonLabeledJumps;s.allowedNonLabeledJumps|=2;var i=e.visitEachChild(r,C,t);return s.allowedNonLabeledJumps=n,i}return e.visitEachChild(r,C,t)}(i);case 262:return function(r){var n=x(7104,0),i=e.visitEachChild(r,C,t);return D(n,0,0),i}(i);case 234:return function(r,n){var i=256&a?x(7104,512):x(6976,128),o=e.visitEachChild(r,C,t);return D(i,0,0),o}(i);case 245:case 244:return function(r){if(s){var n=245===r.kind?2:4;if(!(r.label&&s.labels&&s.labels.get(e.idText(r.label))||!r.label&&s.allowedNonLabeledJumps&n)){var i=void 0,a=r.label;a?245===r.kind?(i="break-".concat(a.escapedText),be(s,!0,e.idText(a),i)):(i="continue-".concat(a.escapedText),be(s,!1,e.idText(a),i)):245===r.kind?(s.nonLocalJumps|=2,i="break"):(s.nonLocalJumps|=4,i="continue");var o=u.createStringLiteral(i);if(s.loopOutParameters.length){for(var c=s.loopOutParameters,l=void 0,_=0;_<c.length;_++){var d=ve(c[_],1);l=0===_?d:u.createBinaryExpression(l,27,d);}o=u.createBinaryExpression(l,27,o);}return u.createReturnStatement(o)}}return e.visitEachChild(r,C,t)}(i);case 249:return function(t){s&&!s.labels&&(s.labels=new e.Map);var r=e.unwrapInnermostStatementOfLabel(t,s&&$);return e.isIterationStatement(r,!1)?function(e,t){switch(e.kind){case 239:case 240:return re(e,t);case 241:return ne(e,t);case 242:return ie(e,t);case 243:return ae(e,t)}}(r,t):u.restoreEnclosingLabel(e.visitNode(r,C,e.isStatement,u.liftToBlock),t,s&&ee)}(i);case 239:case 240:return re(i,void 0);case 241:return ne(i,void 0);case 242:return ie(i,void 0);case 243:return ae(i,void 0);case 237:return function(r){return e.visitEachChild(r,E,t)}(i);case 204:return function(r){for(var n=r.properties,i=-1,o=!1,s=0;s<n.length;s++){var c=n[s];if(524288&c.transformFlags&&4&a||(o=161===e.Debug.checkDefined(c.name).kind)){i=s;break}}if(i<0)return e.visitEachChild(r,C,t);var l=u.createTempVariable(g),_=[],d=u.createAssignment(l,e.setEmitFlags(u.createObjectLiteralExpression(e.visitNodes(n,C,e.isObjectLiteralElementLike,0,i),r.multiLine),o?65536:0));return r.multiLine&&e.startOnNewLine(d),_.push(d),function(t,r,n,i){for(var a=r.properties,o=a.length,s=i;s<o;s++){var c=a[s];switch(c.kind){case 171:case 172:var l=e.getAllAccessorDeclarations(r.properties,c);c===l.firstAccessor&&t.push(H(n,l,r,!!r.multiLine));break;case 168:t.push(Ce(c,n,r,r.multiLine));break;case 294:t.push(Se(c,n,r.multiLine));break;case 295:t.push(Te(c,n,r.multiLine));break;default:e.Debug.failBadSyntaxKind(r);}}}(_,r,l,i),_.push(r.multiLine?e.startOnNewLine(e.setParent(e.setTextRange(u.cloneNode(l),l),l.parent)):l),u.inlineExpressions(_)}(i);case 291:return function(r){var i,a,o,s,c=x(7104,0);if(e.Debug.assert(!!r.variableDeclaration,"Catch clause variable should always be present when downleveling ES2015."),e.isBindingPattern(r.variableDeclaration.name)){var l=u.createTempVariable(void 0),_=u.createVariableDeclaration(l);e.setTextRange(_,r.variableDeclaration);var d=e.flattenDestructuringBinding(r.variableDeclaration,C,t,0,l),p=u.createVariableDeclarationList(d);e.setTextRange(p,r.variableDeclaration);var f=u.createVariableStatement(void 0,p);i=u.updateCatchClause(r,_,(a=r.block,o=f,s=e.visitNodes(a.statements,C,e.isStatement),u.updateBlock(a,n$3([o],s,!0))));}else i=e.visitEachChild(r,C,t);return D(c,0,0),i}(i);case 295:return function(t){return e.setTextRange(u.createPropertyAssignment(t.name,P(u.cloneNode(t.name))),t)}(i);case 161:return function(r){return e.visitEachChild(r,C,t)}(i);case 203:return function(r){return e.some(r.elements,e.isSpreadElement)?ke(r.elements,!1,!!r.multiLine,!!r.elements.hasTrailingComma):e.visitEachChild(r,C,t)}(i);case 207:return function(t){if(33554432&e.getEmitFlags(t))return function(t){var r=e.cast(e.cast(e.skipOuterExpressions(t.expression),e.isArrowFunction).body,e.isBlock),n=function(t){return e.isVariableStatement(t)&&!!e.first(t.declarationList.declarations).initializer},i=s;s=void 0;var a=e.visitNodes(r.statements,k,e.isStatement);s=i;var o=e.filter(a,n),c=e.filter(a,(function(e){return !n(e)})),l=e.cast(e.first(o),e.isVariableStatement).declarationList.declarations[0],_=e.skipOuterExpressions(l.initializer),d=e.tryCast(_,e.isAssignmentExpression);!d&&e.isBinaryExpression(_)&&27===_.operatorToken.kind&&(d=e.tryCast(_.left,e.isAssignmentExpression));var p=e.cast(d?e.skipOuterExpressions(d.right):_,e.isCallExpression),f=e.cast(e.skipOuterExpressions(p.expression),e.isFunctionExpression),g=f.body.statements,m=0,y=-1,v=[];if(d){var h=e.tryCast(g[m],e.isExpressionStatement);h&&(v.push(h),m++),v.push(g[m]),m++,v.push(u.createExpressionStatement(u.createAssignment(d.left,e.cast(l.name,e.isIdentifier))));}for(;!e.isReturnStatement(e.elementAt(g,y));)y--;return e.addRange(v,g,m,y),y<-1&&e.addRange(v,g,y+1),e.addRange(v,c),e.addRange(v,o,1),u.restoreOuterExpressions(t.expression,u.restoreOuterExpressions(l.initializer,u.restoreOuterExpressions(d&&d.right,u.updateCallExpression(p,u.restoreOuterExpressions(p.expression,u.updateFunctionExpression(f,void 0,void 0,void 0,void 0,f.parameters,void 0,u.updateBlock(f.body,v))),void 0,p.arguments))))}(t);var r=e.skipOuterExpressions(t.expression);return 106===r.kind||e.isSuperProperty(r)||e.some(t.arguments,e.isSpreadElement)?Ee(t,!0):u.updateCallExpression(t,e.visitNode(t.expression,N,e.isExpression),void 0,e.visitNodes(t.arguments,C,e.isExpression))}(i);case 208:return function(r){if(e.some(r.arguments,e.isSpreadElement)){var i=u.createCallBinding(u.createPropertyAccessExpression(r.expression,"bind"),g),a=i.target,o=i.thisArg;return u.createNewExpression(u.createFunctionApplyCall(e.visitNode(a,C,e.isExpression),o,ke(u.createNodeArray(n$3([u.createVoidZero()],r.arguments,!0)),!0,!1,!1)),void 0,[])}return e.visitEachChild(r,C,t)}(i);case 211:return function(r,n){return e.visitEachChild(r,n?E:C,t)}(i,o);case 220:return X(i,o);case 349:return function(r,n){if(n)return e.visitEachChild(r,E,t);for(var i,a=0;a<r.elements.length;a++){var o=r.elements[a],s=e.visitNode(o,a<r.elements.length-1?E:C,e.isExpression);(i||s!==o)&&(i||(i=r.elements.slice(0,a)),i.push(s));}var c=i?e.setTextRange(u.createNodeArray(i),r.elements):r.elements;return u.updateCommaListExpression(r,c)}(i,o);case 14:case 15:case 16:case 17:return function(t){return e.setTextRange(u.createStringLiteral(t.text),t)}(i);case 10:return function(t){return t.hasExtendedUnicodeEscape?e.setTextRange(u.createStringLiteral(t.text),t):t}(i);case 8:return function(t){return 384&t.numericLiteralFlags?e.setTextRange(u.createNumericLiteral(t.text),t):t}(i);case 209:return function(n){return e.processTaggedTemplateExpression(t,n,C,r,b,e.ProcessLevel.All)}(i);case 222:return function(t){for(var r=u.createStringLiteral(t.head.text),n=0,i=t.templateSpans;n<i.length;n++){var a=i[n],o=[e.visitNode(a.expression,C,e.isExpression)];a.literal.text.length>0&&o.push(u.createStringLiteral(a.literal.text)),r=u.createCallExpression(u.createPropertyAccessExpression(r,"concat"),void 0,o);}return e.setTextRange(r,t)}(i);case 223:return function(r){return e.visitEachChild(r,C,t)}(i);case 224:return function(t){return e.visitNode(t.expression,C,e.isExpression)}(i);case 106:return we(!1);case 108:return function(e){return 2&a&&!(16384&a)&&(a|=65536),s?2&a?(s.containsLexicalThis=!0,e):s.thisName||(s.thisName=u.createUniqueName("this")):e}(i);case 230:return function(e){return 103===e.keywordToken&&"target"===e.name.escapedText?(a|=32768,u.createUniqueName("_newTarget",48)):e}(i);case 168:return function(t){e.Debug.assert(!e.isComputedPropertyName(t.name));var r=G(t,e.moveRangePos(t,-1),void 0,void 0);return e.setEmitFlags(r,512|e.getEmitFlags(r)),e.setTextRange(u.createPropertyAssignment(t.name,r),t)}(i);case 171:case 172:return function(r){e.Debug.assert(!e.isComputedPropertyName(r.name));var n=s;s=void 0;var i,a=x(32670,65),o=e.visitParameterList(r.parameters,C,t),c=Q(r);return i=171===r.kind?u.updateGetAccessorDeclaration(r,r.decorators,r.modifiers,r.name,o,r.type,c):u.updateSetAccessorDeclaration(r,r.decorators,r.modifiers,r.name,o,c),D(a,98304,0),s=n,i}(i);case 236:return function(r){var n,i=x(0,e.hasSyntacticModifier(r,1)?32:0);if(s&&0==(3&r.declarationList.flags)&&!function(t){return 1===t.declarationList.declarations.length&&!!t.declarationList.declarations[0].initializer&&!!(33554432&e.getEmitFlags(t.declarationList.declarations[0].initializer))}(r)){for(var a=void 0,o=0,c=r.declarationList.declarations;o<c.length;o++){var l=c[o];if(ge(s,l),l.initializer){var _=void 0;e.isBindingPattern(l.name)?_=e.flattenDestructuringAssignment(l,C,t,0):(_=u.createBinaryExpression(l.name,63,e.visitNode(l.initializer,C,e.isExpression)),e.setTextRange(_,l)),a=e.append(a,_);}}n=a?e.setTextRange(u.createExpressionStatement(u.inlineExpressions(a)),r):void 0;}else n=e.visitEachChild(r,C,t);return D(i,0,0),n}(i);case 246:return function(r){return s?(s.nonLocalJumps|=8,S(r)&&(r=A(r)),u.createReturnStatement(u.createObjectLiteralExpression([u.createPropertyAssignment(u.createIdentifier("value"),r.expression?e.visitNode(r.expression,C,e.isExpression):u.createVoidZero())]))):S(r)?A(r):e.visitEachChild(r,C,t)}(i);case 216:return function(r){return e.visitEachChild(r,E,t)}(i);default:return e.visitEachChild(i,C,t)}}function A(t){return e.setOriginalNode(u.createReturnStatement(u.createUniqueName("_this",48)),t)}function P(e){return s&&y.isArgumentsLocalBinding(e)?s.argumentsName||(s.argumentsName=u.createUniqueName("arguments")):e}function w(n){n.name&&Ie();var o=e.getClassExtendsHeritageElement(n),c=u.createFunctionExpression(void 0,void 0,void 0,void 0,o?[u.createParameterDeclaration(void 0,void 0,void 0,u.createUniqueName("_super",48))]:[],void 0,function(n,o){var c=[],l=u.getInternalName(n),g=e.isIdentifierANonContextualKeyword(l)?u.getGeneratedNameForNode(l):l;d(),function(t,r,n){n&&t.push(e.setTextRange(u.createExpressionStatement(_().createExtendsHelper(u.getInternalName(r))),n));}(c,n,o),function(r,n,i,o){var c=s;s=void 0;var l=x(32662,73),_=e.getFirstConstructorWithBody(n),d=function(t,r){if(!t||!r)return !1;if(e.some(t.parameters))return !1;var n=e.firstOrUndefined(t.body.statements);if(!n||!e.nodeIsSynthesized(n)||237!==n.kind)return !1;var i=n.expression;if(!e.nodeIsSynthesized(i)||207!==i.kind)return !1;var a=i.expression;if(!e.nodeIsSynthesized(a)||106!==a.kind)return !1;var o=e.singleOrUndefined(i.arguments);if(!o||!e.nodeIsSynthesized(o)||224!==o.kind)return !1;var s=o.expression;return e.isIdentifier(s)&&"arguments"===s.escapedText}(_,void 0!==o),g=u.createFunctionDeclaration(void 0,void 0,void 0,i,void 0,function(r,n){return e.visitParameterList(r&&!n?r.parameters:void 0,C,t)||[]}(_,d),void 0,function(t,r,n,i){var o=!!n&&104!==e.skipOuterExpressions(n.expression).kind;if(!t)return function(t,r){var n=[];p(),u.mergeLexicalEnvironment(n,f()),r&&n.push(u.createReturnStatement(M()));var i=u.createNodeArray(n);e.setTextRange(i,t.members);var a=u.createBlock(i,!0);return e.setTextRange(a,t),e.setEmitFlags(a,1536),a}(r,o);var s=[],c=[];p();var l,_=0;if(i||(_=u.copyStandardPrologue(t.body.statements,s,!1)),R(c,t),J(c,t,i),i||(_=u.copyCustomPrologue(t.body.statements,c,_,C)),i)l=M();else if(o&&_<t.body.statements.length){var d=t.body.statements[_];e.isExpressionStatement(d)&&e.isSuperCall(d.expression)&&(l=function(e){return Ee(e,!1)}(d.expression));}if(l&&(a|=8192,_++),e.addRange(c,e.visitNodes(t.body.statements,C,e.isStatement,_)),u.mergeLexicalEnvironment(s,f()),K(s,t,!1),o)if(!l||_!==t.body.statements.length||8192&t.body.transformFlags)U(c,t,l||O()),I(t.body)||c.push(u.createReturnStatement(u.createUniqueName("_this",48)));else {var g=e.cast(e.cast(l,e.isBinaryExpression).left,e.isCallExpression),m=u.createReturnStatement(l);e.setCommentRange(m,e.getCommentRange(g)),e.setEmitFlags(g,1536),c.push(m);}else z(s,t);var y=u.createBlock(e.setTextRange(u.createNodeArray(e.concatenate(s,c)),t.body.statements),!0);return e.setTextRange(y,t.body),y}(_,n,o,d));e.setTextRange(g,_||n),o&&e.setEmitFlags(g,8),r.push(g),D(l,98304,0),s=c;}(c,n,g,o),function(t,n){for(var i=0,a=n.members;i<a.length;i++){var o=a[i];switch(o.kind){case 233:t.push(V(o));break;case 168:t.push(q(Oe(n,o),o,n));break;case 171:case 172:var s=e.getAllAccessorDeclarations(n.members,o);o===s.firstAccessor&&t.push(W(Oe(n,o),s,n));break;case 170:case 169:break;default:e.Debug.failBadSyntaxKind(o,r&&r.fileName);}}}(c,n);var m=e.createTokenRange(e.skipTrivia(i,n.members.end),19),y=u.createPartiallyEmittedExpression(g);e.setTextRangeEnd(y,m.end),e.setEmitFlags(y,1536);var v=u.createReturnStatement(y);e.setTextRangePos(v,m.pos),e.setEmitFlags(v,1920),c.push(v),e.insertStatementsAfterStandardPrologue(c,f());var h=u.createBlock(e.setTextRange(u.createNodeArray(c),n.members),!0);return e.setEmitFlags(h,1536),h}(n,o));e.setEmitFlags(c,65536&e.getEmitFlags(n)|524288);var l=u.createPartiallyEmittedExpression(c);e.setTextRangeEnd(l,n.end),e.setEmitFlags(l,1536);var g=u.createPartiallyEmittedExpression(l);e.setTextRangeEnd(g,e.skipTrivia(i,n.pos)),e.setEmitFlags(g,1536);var m=u.createParenthesizedExpression(u.createCallExpression(g,void 0,o?[e.visitNode(o.expression,C,e.isExpression)]:[]));return e.addSyntheticLeadingComment(m,3,"* @class "),m}function I(t){if(246===t.kind)return !0;if(238===t.kind){var r=t;if(r.elseStatement)return I(r.thenStatement)&&I(r.elseStatement)}else if(234===t.kind){var n=e.lastOrUndefined(t.statements);if(n&&I(n))return !0}return !1}function O(){return e.setEmitFlags(u.createThis(),4)}function M(){return u.createLogicalOr(u.createLogicalAnd(u.createStrictInequality(u.createUniqueName("_super",48),u.createNull()),u.createFunctionApplyCall(u.createUniqueName("_super",48),O(),u.createIdentifier("arguments"))),O())}function L(t){return void 0!==t.initializer||e.isBindingPattern(t.name)}function R(t,r){if(!e.some(r.parameters,L))return !1;for(var n=!1,i=0,a=r.parameters;i<a.length;i++){var o=a[i],s=o.name,c=o.initializer;o.dotDotDotToken||(e.isBindingPattern(s)?n=B(t,o,s,c)||n:c&&(j(t,o,s,c),n=!0));}return n}function B(r,n,i,a){return i.elements.length>0?(e.insertStatementAfterCustomPrologue(r,e.setEmitFlags(u.createVariableStatement(void 0,u.createVariableDeclarationList(e.flattenDestructuringBinding(n,C,t,0,u.getGeneratedNameForNode(n)))),1048576)),!0):!!a&&(e.insertStatementAfterCustomPrologue(r,e.setEmitFlags(u.createExpressionStatement(u.createAssignment(u.getGeneratedNameForNode(n),e.visitNode(a,C,e.isExpression))),1048576)),!0)}function j(t,r,n,i){i=e.visitNode(i,C,e.isExpression);var a=u.createIfStatement(u.createTypeCheck(u.cloneNode(n),"undefined"),e.setEmitFlags(e.setTextRange(u.createBlock([u.createExpressionStatement(e.setEmitFlags(e.setTextRange(u.createAssignment(e.setEmitFlags(e.setParent(e.setTextRange(u.cloneNode(n),n),n.parent),48),e.setEmitFlags(i,1584|e.getEmitFlags(i))),r),1536))]),r),1953));e.startOnNewLine(a),e.setTextRange(a,r),e.setEmitFlags(a,1050528),e.insertStatementAfterCustomPrologue(t,a);}function J(r,n,i){var a=[],o=e.lastOrUndefined(n.parameters);if(!function(e,t){return !(!e||!e.dotDotDotToken||t)}(o,i))return !1;var s=79===o.name.kind?e.setParent(e.setTextRange(u.cloneNode(o.name),o.name),o.name.parent):u.createTempVariable(void 0);e.setEmitFlags(s,48);var c=79===o.name.kind?u.cloneNode(o.name):s,l=n.parameters.length-1,_=u.createLoopVariable();a.push(e.setEmitFlags(e.setTextRange(u.createVariableStatement(void 0,u.createVariableDeclarationList([u.createVariableDeclaration(s,void 0,void 0,u.createArrayLiteralExpression([]))])),o),1048576));var d=u.createForStatement(e.setTextRange(u.createVariableDeclarationList([u.createVariableDeclaration(_,void 0,void 0,u.createNumericLiteral(l))]),o),e.setTextRange(u.createLessThan(_,u.createPropertyAccessExpression(u.createIdentifier("arguments"),"length")),o),e.setTextRange(u.createPostfixIncrement(_),o),u.createBlock([e.startOnNewLine(e.setTextRange(u.createExpressionStatement(u.createAssignment(u.createElementAccessExpression(c,0===l?_:u.createSubtract(_,u.createNumericLiteral(l))),u.createElementAccessExpression(u.createIdentifier("arguments"),_))),o))]));return e.setEmitFlags(d,1048576),e.startOnNewLine(d),a.push(d),79!==o.name.kind&&a.push(e.setEmitFlags(e.setTextRange(u.createVariableStatement(void 0,u.createVariableDeclarationList(e.flattenDestructuringBinding(o,C,t,0,c))),o),1048576)),e.insertStatementsAfterCustomPrologue(r,a),!0}function z(e,t){return !!(65536&a&&213!==t.kind)&&(U(e,t,u.createThis()),!0)}function U(r,n,i){0==(1&l)&&(l|=1,t.enableSubstitution(108),t.enableEmitNotification(170),t.enableEmitNotification(168),t.enableEmitNotification(171),t.enableEmitNotification(172),t.enableEmitNotification(213),t.enableEmitNotification(212),t.enableEmitNotification(255));var a=u.createVariableStatement(void 0,u.createVariableDeclarationList([u.createVariableDeclaration(u.createUniqueName("_this",48),void 0,void 0,i)]));e.setEmitFlags(a,1050112),e.setSourceMapRange(a,n),e.insertStatementAfterCustomPrologue(r,a);}function K(t,r,n){if(32768&a){var i=void 0;switch(r.kind){case 213:return t;case 168:case 171:case 172:i=u.createVoidZero();break;case 170:i=u.createPropertyAccessExpression(e.setEmitFlags(u.createThis(),4),"constructor");break;case 255:case 212:i=u.createConditionalExpression(u.createLogicalAnd(e.setEmitFlags(u.createThis(),4),u.createBinaryExpression(e.setEmitFlags(u.createThis(),4),102,u.getLocalName(r))),void 0,u.createPropertyAccessExpression(e.setEmitFlags(u.createThis(),4),"constructor"),void 0,u.createVoidZero());break;default:return e.Debug.failBadSyntaxKind(r)}var o=u.createVariableStatement(void 0,u.createVariableDeclarationList([u.createVariableDeclaration(u.createUniqueName("_newTarget",48),void 0,void 0,i)]));e.setEmitFlags(o,1050112),n&&(t=t.slice()),e.insertStatementAfterCustomPrologue(t,o);}return t}function V(t){return e.setTextRange(u.createEmptyStatement(),t)}function q(r,n,i){var a,o=e.getCommentRange(n),s=e.getSourceMapRange(n),c=G(n,n,void 0,i),l=e.visitNode(n.name,C,e.isPropertyName);if(!e.isPrivateIdentifier(l)&&e.getUseDefineForClassFields(t.getCompilerOptions())){var _=e.isComputedPropertyName(l)?l.expression:e.isIdentifier(l)?u.createStringLiteral(e.unescapeLeadingUnderscores(l.escapedText)):l;a=u.createObjectDefinePropertyCall(r,_,u.createPropertyDescriptor({value:c,enumerable:!1,writable:!0,configurable:!0}));}else {var d=e.createMemberAccessForPropertyName(u,r,l,n.name);a=u.createAssignment(d,c);}e.setEmitFlags(c,1536),e.setSourceMapRange(c,s);var p=e.setTextRange(u.createExpressionStatement(a),n);return e.setOriginalNode(p,n),e.setCommentRange(p,o),e.setEmitFlags(p,48),p}function W(t,r,n){var i=u.createExpressionStatement(H(t,r,n,!1));return e.setEmitFlags(i,1536),e.setSourceMapRange(i,e.getSourceMapRange(r.firstAccessor)),i}function H(t,r,n,i){var a=r.firstAccessor,o=r.getAccessor,s=r.setAccessor,c=e.setParent(e.setTextRange(u.cloneNode(t),t),t.parent);e.setEmitFlags(c,1568),e.setSourceMapRange(c,a.name);var l=e.visitNode(a.name,C,e.isPropertyName);if(e.isPrivateIdentifier(l))return e.Debug.failBadSyntaxKind(l,"Encountered unhandled private identifier while transforming ES2015.");var _=e.createExpressionForPropertyName(u,l);e.setEmitFlags(_,1552),e.setSourceMapRange(_,a.name);var d=[];if(o){var p=G(o,void 0,void 0,n);e.setSourceMapRange(p,e.getSourceMapRange(o)),e.setEmitFlags(p,512);var f=u.createPropertyAssignment("get",p);e.setCommentRange(f,e.getCommentRange(o)),d.push(f);}if(s){var g=G(s,void 0,void 0,n);e.setSourceMapRange(g,e.getSourceMapRange(s)),e.setEmitFlags(g,512);var m=u.createPropertyAssignment("set",g);e.setCommentRange(m,e.getCommentRange(s)),d.push(m);}d.push(u.createPropertyAssignment("enumerable",o||s?u.createFalse():u.createTrue()),u.createPropertyAssignment("configurable",u.createTrue()));var y=u.createCallExpression(u.createPropertyAccessExpression(u.createIdentifier("Object"),"defineProperty"),void 0,[c,_,u.createObjectLiteralExpression(d,!0)]);return i&&e.startOnNewLine(y),y}function G(r,n,i,o){var c=s;s=void 0;var l=o&&e.isClassLike(o)&&!e.isStatic(r)?x(32670,73):x(32670,65),_=e.visitParameterList(r.parameters,C,t),d=Q(r);return 32768&a&&!i&&(255===r.kind||212===r.kind)&&(i=u.getGeneratedNameForNode(r)),D(l,98304,0),s=c,e.setOriginalNode(e.setTextRange(u.createFunctionExpression(void 0,r.asteriskToken,i,void 0,_,void 0,d),n),r)}function Q(t){var n,i,a,o=!1,s=!1,c=[],l=[],_=t.body;if(p(),e.isBlock(_)&&(a=u.copyStandardPrologue(_.statements,c,!1),a=u.copyCustomPrologue(_.statements,l,a,C,e.isHoistedFunction),a=u.copyCustomPrologue(_.statements,l,a,C,e.isHoistedVariableStatement)),o=R(l,t)||o,o=J(l,t,!1)||o,e.isBlock(_))a=u.copyCustomPrologue(_.statements,l,a,C),n=_.statements,e.addRange(l,e.visitNodes(_.statements,C,e.isStatement,a)),!o&&_.multiLine&&(o=!0);else {e.Debug.assert(213===t.kind),n=e.moveRangeEnd(_,-1);var d=t.equalsGreaterThanToken;e.nodeIsSynthesized(d)||e.nodeIsSynthesized(_)||(e.rangeEndIsOnSameLineAsRangeStart(d,_,r)?s=!0:o=!0);var g=e.visitNode(_,C,e.isExpression),m=u.createReturnStatement(g);e.setTextRange(m,_),e.moveSyntheticComments(m,_),e.setEmitFlags(m,1440),l.push(m),i=_;}if(u.mergeLexicalEnvironment(c,f()),K(c,t,!1),z(c,t),e.some(c)&&(o=!0),l.unshift.apply(l,c),e.isBlock(_)&&e.arrayIsEqualTo(l,_.statements))return _;var y=u.createBlock(e.setTextRange(u.createNodeArray(l),n),o);return e.setTextRange(y,t.body),!o&&s&&e.setEmitFlags(y,1),i&&e.setTokenSourceMapRange(y,19,i),e.setOriginalNode(y,t.body),y}function X(r,n){return e.isDestructuringAssignment(r)?e.flattenDestructuringAssignment(r,C,t,0,!n):27===r.operatorToken.kind?u.updateBinaryExpression(r,e.visitNode(r.left,E,e.isExpression),r.operatorToken,e.visitNode(r.right,n?E:C,e.isExpression)):e.visitEachChild(r,C,t)}function Y(r){var n=r.name;return e.isBindingPattern(n)?Z(r):!r.initializer&&function(e){var t=y.getNodeCheckFlags(e),r=262144&t,n=524288&t;return !(0!=(64&a)||r&&n&&0!=(512&a))&&0==(4096&a)&&(!y.isDeclarationWithCollidingName(e)||n&&!r&&0==(6144&a))}(r)?u.updateVariableDeclaration(r,r.name,void 0,void 0,u.createVoidZero()):e.visitEachChild(r,C,t)}function Z(r){var n,i=x(32,0);return n=e.isBindingPattern(r.name)?e.flattenDestructuringBinding(r,C,t,0,void 0,0!=(32&i)):e.visitEachChild(r,C,t),D(i,0,0),n}function $(t){s.labels.set(e.idText(t.label),!0);}function ee(t){s.labels.set(e.idText(t.label),!1);}function te(r,n,i,o,c){var l=x(r,n),_=function(r,n,i,o){if(!pe(r)){var c=void 0;s&&(c=s.allowedNonLabeledJumps,s.allowedNonLabeledJumps=6);var l=o?o(r,n,void 0,i):u.restoreEnclosingLabel(e.isForStatement(r)?function(t){return u.updateForStatement(t,e.visitNode(t.initializer,E,e.isForInitializer),e.visitNode(t.condition,C,e.isExpression),e.visitNode(t.incrementor,E,e.isExpression),e.visitNode(t.statement,C,e.isStatement,u.liftToBlock))}(r):e.visitEachChild(r,C,t),n,s&&ee);return s&&(s.allowedNonLabeledJumps=c),l}var _=function(t){var r;switch(t.kind){case 241:case 242:case 243:var n=t.initializer;n&&254===n.kind&&(r=n);}var i=[],a=[];if(r&&3&e.getCombinedNodeFlags(r))for(var o=_e(t),c=0,l=r.declarations;c<l.length;c++)De(t,l[c],i,a,o);var u={loopParameters:i,loopOutParameters:a};return s&&(s.argumentsName&&(u.argumentsName=s.argumentsName),s.thisName&&(u.thisName=s.thisName),s.hoistedLocalVariables&&(u.hoistedLocalVariables=s.hoistedLocalVariables)),u}(r),p=[],g=s;s=_;var m,y,v,h,b,x=_e(r)?function(t,r){var n=u.createUniqueName("_loop_init"),i=0!=(524288&t.initializer.transformFlags),o=0;r.containsLexicalThis&&(o|=8),i&&4&a&&(o|=262144);var s=[];return s.push(u.createVariableStatement(void 0,t.initializer)),he(r.loopOutParameters,2,1,s),{functionName:n,containsYield:i,functionDeclaration:u.createVariableStatement(void 0,e.setEmitFlags(u.createVariableDeclarationList([u.createVariableDeclaration(n,void 0,void 0,e.setEmitFlags(u.createFunctionExpression(void 0,i?u.createToken(41):void 0,void 0,void 0,void 0,void 0,e.visitNode(u.createBlock(s,!0),C,e.isBlock)),o))]),2097152)),part:u.createVariableDeclarationList(e.map(r.loopOutParameters,ye))}}(r,_):void 0,D=fe(r)?function(t,r,n){var i=u.createUniqueName("_loop");d();var o=e.visitNode(t.statement,C,e.isStatement,u.liftToBlock),s=f(),c=[];(de(t)||function(t){return e.isForStatement(t)&&!!t.incrementor&&ue(t.incrementor)}(t))&&(r.conditionVariable=u.createUniqueName("inc"),t.incrementor?c.push(u.createIfStatement(r.conditionVariable,u.createExpressionStatement(e.visitNode(t.incrementor,C,e.isExpression)),u.createExpressionStatement(u.createAssignment(r.conditionVariable,u.createTrue())))):c.push(u.createIfStatement(u.createLogicalNot(r.conditionVariable),u.createExpressionStatement(u.createAssignment(r.conditionVariable,u.createTrue())))),de(t)&&c.push(u.createIfStatement(u.createPrefixUnaryExpression(53,e.visitNode(t.condition,C,e.isExpression)),e.visitNode(u.createBreakStatement(),C,e.isStatement)))),e.isBlock(o)?e.addRange(c,o.statements):c.push(o),he(r.loopOutParameters,1,1,c),e.insertStatementsAfterStandardPrologue(c,s);var l=u.createBlock(c,!0);e.isBlock(o)&&e.setOriginalNode(l,o);var _=0!=(524288&t.statement.transformFlags),p=524288;return r.containsLexicalThis&&(p|=8),_&&0!=(4&a)&&(p|=262144),{functionName:i,containsYield:_,functionDeclaration:u.createVariableStatement(void 0,e.setEmitFlags(u.createVariableDeclarationList([u.createVariableDeclaration(i,void 0,void 0,e.setEmitFlags(u.createFunctionExpression(void 0,_?u.createToken(41):void 0,void 0,void 0,r.loopParameters,void 0,l),p))]),2097152)),part:function(t,r,n,i){var a=[],o=!(-5&r.nonLocalJumps||r.labeledNonLocalBreaks||r.labeledNonLocalContinues),s=u.createCallExpression(t,void 0,e.map(r.loopParameters,(function(e){return e.name}))),c=i?u.createYieldExpression(u.createToken(41),e.setEmitFlags(s,8388608)):s;if(o)a.push(u.createExpressionStatement(c)),he(r.loopOutParameters,1,0,a);else {var l=u.createUniqueName("state"),_=u.createVariableStatement(void 0,u.createVariableDeclarationList([u.createVariableDeclaration(l,void 0,void 0,c)]));if(a.push(_),he(r.loopOutParameters,1,0,a),8&r.nonLocalJumps){var d=void 0;n?(n.nonLocalJumps|=8,d=u.createReturnStatement(l)):d=u.createReturnStatement(u.createPropertyAccessExpression(l,"value")),a.push(u.createIfStatement(u.createTypeCheck(l,"object"),d));}if(2&r.nonLocalJumps&&a.push(u.createIfStatement(u.createStrictEquality(l,u.createStringLiteral("break")),u.createBreakStatement())),r.labeledNonLocalBreaks||r.labeledNonLocalContinues){var p=[];xe(r.labeledNonLocalBreaks,!0,l,n,p),xe(r.labeledNonLocalContinues,!1,l,n,p),a.push(u.createSwitchStatement(l,u.createCaseBlock(p)));}}return a}(i,r,n,_)}}(r,_,g):void 0;if(s=g,x&&p.push(x.functionDeclaration),D&&p.push(D.functionDeclaration),function(e,t,r){var n;if(t.argumentsName&&(r?r.argumentsName=t.argumentsName:(n||(n=[])).push(u.createVariableDeclaration(t.argumentsName,void 0,void 0,u.createIdentifier("arguments")))),t.thisName&&(r?r.thisName=t.thisName:(n||(n=[])).push(u.createVariableDeclaration(t.thisName,void 0,void 0,u.createIdentifier("this")))),t.hoistedLocalVariables)if(r)r.hoistedLocalVariables=t.hoistedLocalVariables;else {n||(n=[]);for(var i=0,a=t.hoistedLocalVariables;i<a.length;i++){var o=a[i];n.push(u.createVariableDeclaration(o));}}if(t.loopOutParameters.length){n||(n=[]);for(var s=0,c=t.loopOutParameters;s<c.length;s++){var l=c[s];n.push(u.createVariableDeclaration(l.outParamName));}}t.conditionVariable&&(n||(n=[]),n.push(u.createVariableDeclaration(t.conditionVariable,void 0,void 0,u.createFalse()))),n&&e.push(u.createVariableStatement(void 0,u.createVariableDeclarationList(n)));}(p,_,g),x&&p.push((y=x.functionName,v=x.containsYield,h=u.createCallExpression(y,void 0,[]),b=v?u.createYieldExpression(u.createToken(41),e.setEmitFlags(h,8388608)):h,u.createExpressionStatement(b))),D)if(o)m=o(r,n,D.part,i);else {var S=me(r,x,u.createBlock(D.part,!0));m=u.restoreEnclosingLabel(S,n,s&&ee);}else {var T=me(r,x,e.visitNode(r.statement,C,e.isStatement,u.liftToBlock));m=u.restoreEnclosingLabel(T,n,s&&ee);}return p.push(m),p}(i,o,l,c);return D(l,0,0),_}function re(e,t){return te(0,1280,e,t)}function ne(e,t){return te(5056,3328,e,t)}function ie(e,t){return te(3008,5376,e,t)}function ae(e,t){return te(3008,5376,e,t,m.downlevelIteration?le:ce)}function oe(r,n,i){var a=[],o=r.initializer;if(e.isVariableDeclarationList(o)){3&r.initializer.flags&&Ie();var s=e.firstOrUndefined(o.declarations);if(s&&e.isBindingPattern(s.name)){var c=e.flattenDestructuringBinding(s,C,t,0,n),l=e.setTextRange(u.createVariableDeclarationList(c),r.initializer);e.setOriginalNode(l,r.initializer),e.setSourceMapRange(l,e.createRange(c[0].pos,e.last(c).end)),a.push(u.createVariableStatement(void 0,l));}else a.push(e.setTextRange(u.createVariableStatement(void 0,e.setOriginalNode(e.setTextRange(u.createVariableDeclarationList([u.createVariableDeclaration(s?s.name:u.createTempVariable(void 0),void 0,void 0,n)]),e.moveRangePos(o,-1)),o)),e.moveRangeEnd(o,-1)));}else {var _=u.createAssignment(o,n);e.isDestructuringAssignment(_)?a.push(u.createExpressionStatement(X(_,!0))):(e.setTextRangeEnd(_,o.end),a.push(e.setTextRange(u.createExpressionStatement(e.visitNode(_,C,e.isExpression)),e.moveRangeEnd(o,-1))));}if(i)return se(e.addRange(a,i));var d=e.visitNode(r.statement,C,e.isStatement,u.liftToBlock);return e.isBlock(d)?u.updateBlock(d,e.setTextRange(u.createNodeArray(e.concatenate(a,d.statements)),d.statements)):(a.push(d),se(a))}function se(t){return e.setEmitFlags(u.createBlock(u.createNodeArray(t),!0),432)}function ce(t,r,n){var i=e.visitNode(t.expression,C,e.isExpression),a=u.createLoopVariable(),o=e.isIdentifier(i)?u.getGeneratedNameForNode(i):u.createTempVariable(void 0);e.setEmitFlags(i,48|e.getEmitFlags(i));var c=e.setTextRange(u.createForStatement(e.setEmitFlags(e.setTextRange(u.createVariableDeclarationList([e.setTextRange(u.createVariableDeclaration(a,void 0,void 0,u.createNumericLiteral(0)),e.moveRangePos(t.expression,-1)),e.setTextRange(u.createVariableDeclaration(o,void 0,void 0,i),t.expression)]),t.expression),2097152),e.setTextRange(u.createLessThan(a,u.createPropertyAccessExpression(o,"length")),t.expression),e.setTextRange(u.createPostfixIncrement(a),t.expression),oe(t,u.createElementAccessExpression(o,a),n)),t);return e.setEmitFlags(c,256),e.setTextRange(c,t),u.restoreEnclosingLabel(c,r,s&&ee)}function le(t,r,n,i){var a=e.visitNode(t.expression,C,e.isExpression),o=e.isIdentifier(a)?u.getGeneratedNameForNode(a):u.createTempVariable(void 0),c=e.isIdentifier(a)?u.getGeneratedNameForNode(o):u.createTempVariable(void 0),l=u.createUniqueName("e"),d=u.getGeneratedNameForNode(l),p=u.createTempVariable(void 0),f=e.setTextRange(_().createValuesHelper(a),t.expression),m=u.createCallExpression(u.createPropertyAccessExpression(o,"next"),void 0,[]);g(l),g(p);var y=1024&i?u.inlineExpressions([u.createAssignment(l,u.createVoidZero()),f]):f,v=e.setEmitFlags(e.setTextRange(u.createForStatement(e.setEmitFlags(e.setTextRange(u.createVariableDeclarationList([e.setTextRange(u.createVariableDeclaration(o,void 0,void 0,y),t.expression),u.createVariableDeclaration(c,void 0,void 0,m)]),t.expression),2097152),u.createLogicalNot(u.createPropertyAccessExpression(c,"done")),u.createAssignment(c,m),oe(t,u.createPropertyAccessExpression(c,"value"),n)),t),256);return u.createTryStatement(u.createBlock([u.restoreEnclosingLabel(v,r,s&&ee)]),u.createCatchClause(u.createVariableDeclaration(d),e.setEmitFlags(u.createBlock([u.createExpressionStatement(u.createAssignment(l,u.createObjectLiteralExpression([u.createPropertyAssignment("error",d)])))]),1)),u.createBlock([u.createTryStatement(u.createBlock([e.setEmitFlags(u.createIfStatement(u.createLogicalAnd(u.createLogicalAnd(c,u.createLogicalNot(u.createPropertyAccessExpression(c,"done"))),u.createAssignment(p,u.createPropertyAccessExpression(o,"return"))),u.createExpressionStatement(u.createFunctionCallCall(p,o,[]))),1)]),void 0,e.setEmitFlags(u.createBlock([e.setEmitFlags(u.createIfStatement(l,u.createThrowStatement(u.createPropertyAccessExpression(l,"error"))),1)]),1))]))}function ue(e){return 0!=(131072&y.getNodeCheckFlags(e))}function _e(t){return e.isForStatement(t)&&!!t.initializer&&ue(t.initializer)}function de(t){return e.isForStatement(t)&&!!t.condition&&ue(t.condition)}function pe(e){return fe(e)||_e(e)}function fe(e){return 0!=(65536&y.getNodeCheckFlags(e))}function ge(t,r){t.hoistedLocalVariables||(t.hoistedLocalVariables=[]),function r(n){if(79===n.kind)t.hoistedLocalVariables.push(n);else for(var i=0,a=n.elements;i<a.length;i++){var o=a[i];e.isOmittedExpression(o)||r(o.name);}}(r.name);}function me(t,r,n){switch(t.kind){case 241:return function(t,r,n){var i=t.condition&&ue(t.condition),a=i||t.incrementor&&ue(t.incrementor);return u.updateForStatement(t,e.visitNode(r?r.part:t.initializer,E,e.isForInitializer),e.visitNode(i?void 0:t.condition,C,e.isExpression),e.visitNode(a?void 0:t.incrementor,E,e.isExpression),n)}(t,r,n);case 242:return function(t,r){return u.updateForInStatement(t,e.visitNode(t.initializer,C,e.isForInitializer),e.visitNode(t.expression,C,e.isExpression),r)}(t,n);case 243:return function(t,r){return u.updateForOfStatement(t,void 0,e.visitNode(t.initializer,C,e.isForInitializer),e.visitNode(t.expression,C,e.isExpression),r)}(t,n);case 239:return function(t,r){return u.updateDoStatement(t,r,e.visitNode(t.expression,C,e.isExpression))}(t,n);case 240:return function(t,r){return u.updateWhileStatement(t,e.visitNode(t.expression,C,e.isExpression),r)}(t,n);default:return e.Debug.failBadSyntaxKind(t,"IterationStatement expected")}}function ye(e){return u.createVariableDeclaration(e.originalName,void 0,void 0,e.outParamName)}function ve(e,t){var r=0===t?e.outParamName:e.originalName,n=0===t?e.originalName:e.outParamName;return u.createBinaryExpression(n,63,r)}function he(e,t,r,n){for(var i=0,a=e;i<a.length;i++){var o=a[i];o.flags&t&&n.push(u.createExpressionStatement(ve(o,r)));}}function be(t,r,n,i){r?(t.labeledNonLocalBreaks||(t.labeledNonLocalBreaks=new e.Map),t.labeledNonLocalBreaks.set(n,i)):(t.labeledNonLocalContinues||(t.labeledNonLocalContinues=new e.Map),t.labeledNonLocalContinues.set(n,i));}function xe(e,t,r,n,i){e&&e.forEach((function(e,a){var o=[];if(!n||n.labels&&n.labels.get(a)){var s=u.createIdentifier(a);o.push(t?u.createBreakStatement(s):u.createContinueStatement(s));}else be(n,t,a,e),o.push(u.createReturnStatement(r));i.push(u.createCaseClause(u.createStringLiteral(e),o));}));}function De(t,r,n,i,a){var o=r.name;if(e.isBindingPattern(o))for(var s=0,c=o.elements;s<c.length;s++){var l=c[s];e.isOmittedExpression(l)||De(t,l,n,i,a);}else {n.push(u.createParameterDeclaration(void 0,void 0,void 0,o));var _=y.getNodeCheckFlags(r);if(4194304&_||a){var d=u.createUniqueName("out_"+e.idText(o)),p=0;4194304&_&&(p|=1),e.isForStatement(t)&&t.initializer&&y.isBindingCapturedByNode(t.initializer,r)&&(p|=2),i.push({flags:p,originalName:o,outParamName:d});}}}function Se(t,r,n){var i=u.createAssignment(e.createMemberAccessForPropertyName(u,r,e.visitNode(t.name,C,e.isPropertyName)),e.visitNode(t.initializer,C,e.isExpression));return e.setTextRange(i,t),n&&e.startOnNewLine(i),i}function Te(t,r,n){var i=u.createAssignment(e.createMemberAccessForPropertyName(u,r,e.visitNode(t.name,C,e.isPropertyName)),u.cloneNode(t.name));return e.setTextRange(i,t),n&&e.startOnNewLine(i),i}function Ce(t,r,n,i){var a=u.createAssignment(e.createMemberAccessForPropertyName(u,r,e.visitNode(t.name,C,e.isPropertyName)),G(t,t,void 0,n));return e.setTextRange(a,t),i&&e.startOnNewLine(a),a}function Ee(r,n){if(16384&r.transformFlags||106===r.expression.kind||e.isSuperProperty(e.skipOuterExpressions(r.expression))){var i=u.createCallBinding(r.expression,g),a=i.target,o=i.thisArg;106===r.expression.kind&&e.setEmitFlags(o,4);var s=void 0;if(s=16384&r.transformFlags?u.createFunctionApplyCall(e.visitNode(a,N,e.isExpression),106===r.expression.kind?o:e.visitNode(o,C,e.isExpression),ke(r.arguments,!0,!1,!1)):e.setTextRange(u.createFunctionCallCall(e.visitNode(a,N,e.isExpression),106===r.expression.kind?o:e.visitNode(o,C,e.isExpression),e.visitNodes(r.arguments,C,e.isExpression)),r),106===r.expression.kind){var c=u.createLogicalOr(s,O());s=n?u.createAssignment(u.createUniqueName("_this",48),c):c;}return e.setOriginalNode(s,r)}return e.visitEachChild(r,C,t)}function ke(t,r,n,i){var a=t.length,o=e.flatten(e.spanMap(t,Ne,(function(e,t,r,o){return t(e,n,i&&o===a)})));if(1===o.length){var s=o[0];if(r&&!m.downlevelIteration||e.isPackedArrayLiteral(s.expression)||e.isCallToHelper(s.expression,"___spreadArray"))return s.expression}for(var c=_(),l=0!==o[0].kind,d=l?u.createArrayLiteralExpression():o[0].expression,p=l?0:1;p<o.length;p++){var f=o[p];d=c.createSpreadArrayHelper(d,f.expression,1===f.kind&&!r);}return d}function Ne(t){return e.isSpreadElement(t)?Fe:Pe}function Fe(t){return e.map(t,Ae)}function Ae(t){var r=e.visitNode(t.expression,C,e.isExpression),n=e.isCallToHelper(r,"___read"),i=n||e.isPackedArrayLiteral(r)?2:1;return !m.downlevelIteration||1!==i||e.isArrayLiteralExpression(r)||n||(r=_().createReadHelper(r,void 0),i=2),c(i,r)}function Pe(t,r,n){return c(0,u.createArrayLiteralExpression(e.visitNodes(u.createNodeArray(t,n),C,e.isExpression),r))}function we(e){return 8&a&&!e?u.createPropertyAccessExpression(u.createUniqueName("_super",48),"prototype"):u.createUniqueName("_super",48)}function Ie(){0==(2&l)&&(l|=2,t.enableSubstitution(79));}function Oe(t,r){return e.isStatic(r)?u.getInternalName(t):u.createPropertyAccessExpression(u.getInternalName(t),"prototype")}};}(t),function(e){e.transformES5=function(t){var r,n,i=t.factory,a=t.getCompilerOptions();1!==a.jsx&&3!==a.jsx||(r=t.onEmitNode,t.onEmitNode=function(t,i,a){switch(i.kind){case 279:case 280:case 278:var o=i.tagName;n[e.getOriginalNodeId(o)]=!0;}r(t,i,a);},t.enableEmitNotification(279),t.enableEmitNotification(280),t.enableEmitNotification(278),n=[]);var o=t.onSubstituteNode;return t.onSubstituteNode=function(t,r){return r.id&&n&&n[r.id]?o(t,r):(r=o(t,r),e.isPropertyAccessExpression(r)?function(t){if(e.isPrivateIdentifier(t.name))return t;var r=s(t.name);return r?e.setTextRange(i.createElementAccessExpression(t.expression,r),t):t}(r):e.isPropertyAssignment(r)?function(t){var r=e.isIdentifier(t.name)&&s(t.name);return r?i.updatePropertyAssignment(t,r,t.initializer):t}(r):r)},t.enableSubstitution(205),t.enableSubstitution(294),e.chainBundle(t,(function(e){return e}));function s(t){var r=t.originalKeywordKind||(e.nodeIsSynthesized(t)?e.stringToToken(e.idText(t)):void 0);if(void 0!==r&&r>=81&&r<=116)return e.setTextRange(i.createStringLiteralFromNode(t),t)}};}(t),function(e){var t,r,i,a,o;!function(e){e[e.Nop=0]="Nop",e[e.Statement=1]="Statement",e[e.Assign=2]="Assign",e[e.Break=3]="Break",e[e.BreakWhenTrue=4]="BreakWhenTrue",e[e.BreakWhenFalse=5]="BreakWhenFalse",e[e.Yield=6]="Yield",e[e.YieldStar=7]="YieldStar",e[e.Return=8]="Return",e[e.Throw=9]="Throw",e[e.Endfinally=10]="Endfinally";}(t||(t={})),function(e){e[e.Open=0]="Open",e[e.Close=1]="Close";}(r||(r={})),function(e){e[e.Exception=0]="Exception",e[e.With=1]="With",e[e.Switch=2]="Switch",e[e.Loop=3]="Loop",e[e.Labeled=4]="Labeled";}(i||(i={})),function(e){e[e.Try=0]="Try",e[e.Catch=1]="Catch",e[e.Finally=2]="Finally",e[e.Done=3]="Done";}(a||(a={})),function(e){e[e.Next=0]="Next",e[e.Throw=1]="Throw",e[e.Return=2]="Return",e[e.Break=3]="Break",e[e.Yield=4]="Yield",e[e.YieldStar=5]="YieldStar",e[e.Catch=6]="Catch",e[e.Endfinally=7]="Endfinally";}(o||(o={})),e.transformGenerators=function(t){var r,i,a,o,s,c,l,u,_,d,p=t.factory,f=t.getEmitHelperFactory,g=t.resumeLexicalEnvironment,m=t.endLexicalEnvironment,y=t.hoistFunctionDeclaration,v=t.hoistVariableDeclaration,h=t.getCompilerOptions(),b=e.getEmitScriptTarget(h),x=t.getEmitResolver(),D=t.onSubstituteNode;t.onSubstituteNode=function(t,n){return n=D(t,n),1===t?function(t){return e.isIdentifier(t)?function(t){if(!e.isGeneratedIdentifier(t)&&r&&r.has(e.idText(t))){var n=e.getOriginalNode(t);if(e.isIdentifier(n)&&n.parent){var a=x.getReferencedValueDeclaration(n);if(a){var o=i[e.getOriginalNodeId(a)];if(o){var s=e.setParent(e.setTextRange(p.cloneNode(o),o),o.parent);return e.setSourceMapRange(s,t),e.setCommentRange(s,t),s}}}}return t}(t):t}(n):n};var S,T,C,E,k,N,F,A,P,w,I,O,M=1,L=0,R=0;return e.chainBundle(t,(function(r){if(r.isDeclarationFile||0==(1024&r.transformFlags))return r;var n=e.visitEachChild(r,B,t);return e.addEmitHelpers(n,t.readEmitHelpers()),n}));function B(r){var n=r.transformFlags;return o?function(r){switch(r.kind){case 239:case 240:return function(r){return o?(oe(),r=e.visitEachChild(r,B,t),ce(),r):e.visitEachChild(r,B,t)}(r);case 248:return function(r){return o&&re({kind:2,isScript:!0,breakLabel:-1}),r=e.visitEachChild(r,B,t),o&&le(),r}(r);case 249:return function(r){return o&&re({kind:4,isScript:!0,labelText:e.idText(r.label),breakLabel:-1}),r=e.visitEachChild(r,B,t),o&&ue(),r}(r);default:return j(r)}}(r):a?j(r):e.isFunctionLikeDeclaration(r)&&r.asteriskToken?function(t){switch(t.kind){case 255:return J(t);case 212:return z(t);default:return e.Debug.failBadSyntaxKind(t)}}(r):1024&n?e.visitEachChild(r,B,t):r}function j(r){switch(r.kind){case 255:return J(r);case 212:return z(r);case 171:case 172:return function(r){var n=a,i=o;return a=!1,o=!1,r=e.visitEachChild(r,B,t),a=n,o=i,r}(r);case 236:return function(t){if(524288&t.transformFlags)G(t.declarationList);else {if(1048576&e.getEmitFlags(t))return t;for(var r=0,n=t.declarationList.declarations;r<n.length;r++){var i=n[r];v(i.name);}var a=e.getInitializedVariables(t.declarationList);if(0!==a.length)return e.setSourceMapRange(p.createExpressionStatement(p.inlineExpressions(e.map(a,Q))),t)}}(r);case 241:return function(r){o&&oe();var n=r.initializer;if(n&&e.isVariableDeclarationList(n)){for(var i=0,a=n.declarations;i<a.length;i++){var s=a[i];v(s.name);}var c=e.getInitializedVariables(n);r=p.updateForStatement(r,c.length>0?p.inlineExpressions(e.map(c,Q)):void 0,e.visitNode(r.condition,B,e.isExpression),e.visitNode(r.incrementor,B,e.isExpression),e.visitIterationBody(r.statement,B,t));}else r=e.visitEachChild(r,B,t);return o&&ce(),r}(r);case 242:return function(r){o&&oe();var n=r.initializer;if(e.isVariableDeclarationList(n)){for(var i=0,a=n.declarations;i<a.length;i++){var s=a[i];v(s.name);}r=p.updateForInStatement(r,n.declarations[0].name,e.visitNode(r.expression,B,e.isExpression),e.visitNode(r.statement,B,e.isStatement,p.liftToBlock));}else r=e.visitEachChild(r,B,t);return o&&ce(),r}(r);case 245:return function(r){if(o){var n=ge(r.label&&e.idText(r.label));if(n>0)return he(n,r)}return e.visitEachChild(r,B,t)}(r);case 244:return function(r){if(o){var n=me(r.label&&e.idText(r.label));if(n>0)return he(n,r)}return e.visitEachChild(r,B,t)}(r);case 246:return function(t){return r=e.visitNode(t.expression,B,e.isExpression),n=t,e.setTextRange(p.createReturnStatement(p.createArrayLiteralExpression(r?[ve(2),r]:[ve(2)])),n);var r,n;}(r);default:return 524288&r.transformFlags?function(r){switch(r.kind){case 220:return function(r){var n=e.getExpressionAssociativity(r);switch(n){case 0:return function(r){return X(r.right)?e.isLogicalOperator(r.operatorToken.kind)?function(t){var r=ee(),n=$();return De(n,e.visitNode(t.left,B,e.isExpression),t.left),55===t.operatorToken.kind?Ce(r,n,t.left):Te(r,n,t.left),De(n,e.visitNode(t.right,B,e.isExpression),t.right),te(r),n}(r):27===r.operatorToken.kind?K(r):p.updateBinaryExpression(r,Z(e.visitNode(r.left,B,e.isExpression)),r.operatorToken,e.visitNode(r.right,B,e.isExpression)):e.visitEachChild(r,B,t)}(r);case 1:return function(r){var n=r.left,i=r.right;if(X(i)){var a=void 0;switch(n.kind){case 205:a=p.updatePropertyAccessExpression(n,Z(e.visitNode(n.expression,B,e.isLeftHandSideExpression)),n.name);break;case 206:a=p.updateElementAccessExpression(n,Z(e.visitNode(n.expression,B,e.isLeftHandSideExpression)),Z(e.visitNode(n.argumentExpression,B,e.isExpression)));break;default:a=e.visitNode(n,B,e.isExpression);}var o=r.operatorToken.kind;return e.isCompoundAssignment(o)?e.setTextRange(p.createAssignment(a,e.setTextRange(p.createBinaryExpression(Z(a),e.getNonAssignmentOperatorForCompoundAssignment(o),e.visitNode(i,B,e.isExpression)),r)),r):p.updateBinaryExpression(r,a,r.operatorToken,e.visitNode(i,B,e.isExpression))}return e.visitEachChild(r,B,t)}(r);default:return e.Debug.assertNever(n)}}(r);case 349:return function(t){for(var r=[],n=0,i=t.elements;n<i.length;n++){var a=i[n];e.isBinaryExpression(a)&&27===a.operatorToken.kind?r.push(K(a)):(X(a)&&r.length>0&&(Ee(1,[p.createExpressionStatement(p.inlineExpressions(r))]),r=[]),r.push(e.visitNode(a,B,e.isExpression)));}return p.inlineExpressions(r)}(r);case 221:return function(r){if(X(r.whenTrue)||X(r.whenFalse)){var n=ee(),i=ee(),a=$();return Ce(n,e.visitNode(r.condition,B,e.isExpression),r.condition),De(a,e.visitNode(r.whenTrue,B,e.isExpression),r.whenTrue),Se(i),te(n),De(a,e.visitNode(r.whenFalse,B,e.isExpression),r.whenFalse),te(i),a}return e.visitEachChild(r,B,t)}(r);case 223:return function(t){var r,n=ee(),i=e.visitNode(t.expression,B,e.isExpression);return t.asteriskToken?function(e,t){Ee(7,[e],t);}(0==(8388608&e.getEmitFlags(t.expression))?e.setTextRange(f().createValuesHelper(i),t):i,t):function(e,t){Ee(6,[e],t);}(i,t),te(n),r=t,e.setTextRange(p.createCallExpression(p.createPropertyAccessExpression(E,"sent"),void 0,[]),r)}(r);case 203:return function(e){return V(e.elements,void 0,void 0,e.multiLine)}(r);case 204:return function(t){var r=t.properties,n=t.multiLine,i=Y(r),a=$();De(a,p.createObjectLiteralExpression(e.visitNodes(r,B,e.isObjectLiteralElementLike,0,i),n));var o=e.reduceLeft(r,(function(r,i){X(i)&&r.length>0&&(xe(p.createExpressionStatement(p.inlineExpressions(r))),r=[]);var o=e.createExpressionForObjectLiteralElementLike(p,t,i,a),s=e.visitNode(o,B,e.isExpression);return s&&(n&&e.startOnNewLine(s),r.push(s)),r}),[],i);return o.push(n?e.startOnNewLine(e.setParent(e.setTextRange(p.cloneNode(a),a),a.parent)):a),p.inlineExpressions(o)}(r);case 206:return function(r){return X(r.argumentExpression)?p.updateElementAccessExpression(r,Z(e.visitNode(r.expression,B,e.isLeftHandSideExpression)),e.visitNode(r.argumentExpression,B,e.isExpression)):e.visitEachChild(r,B,t)}(r);case 207:return function(r){if(!e.isImportCall(r)&&e.forEach(r.arguments,X)){var n=p.createCallBinding(r.expression,v,b,!0),i=n.target,a=n.thisArg;return e.setOriginalNode(e.setTextRange(p.createFunctionApplyCall(Z(e.visitNode(i,B,e.isLeftHandSideExpression)),a,V(r.arguments)),r),r)}return e.visitEachChild(r,B,t)}(r);case 208:return function(r){if(e.forEach(r.arguments,X)){var n=p.createCallBinding(p.createPropertyAccessExpression(r.expression,"bind"),v),i=n.target,a=n.thisArg;return e.setOriginalNode(e.setTextRange(p.createNewExpression(p.createFunctionApplyCall(Z(e.visitNode(i,B,e.isExpression)),a,V(r.arguments,p.createVoidZero())),void 0,[]),r),r)}return e.visitEachChild(r,B,t)}(r);default:return e.visitEachChild(r,B,t)}}(r):2098176&r.transformFlags?e.visitEachChild(r,B,t):r}}function J(r){if(r.asteriskToken)r=e.setOriginalNode(e.setTextRange(p.createFunctionDeclaration(void 0,r.modifiers,void 0,r.name,void 0,e.visitParameterList(r.parameters,B,t),void 0,U(r.body)),r),r);else {var n=a,i=o;a=!1,o=!1,r=e.visitEachChild(r,B,t),a=n,o=i;}return a?void y(r):r}function z(r){if(r.asteriskToken)r=e.setOriginalNode(e.setTextRange(p.createFunctionExpression(void 0,void 0,r.name,void 0,e.visitParameterList(r.parameters,B,t),void 0,U(r.body)),r),r);else {var n=a,i=o;a=!1,o=!1,r=e.visitEachChild(r,B,t),a=n,o=i;}return r}function U(t){var r=[],n=a,i=o,f=s,y=c,v=l,h=u,b=_,x=d,D=M,k=S,N=T,F=C,A=E;a=!0,o=!1,s=void 0,c=void 0,l=void 0,u=void 0,_=void 0,d=void 0,M=1,S=void 0,T=void 0,C=void 0,E=p.createTempVariable(void 0),g();var P=p.copyPrologue(t.statements,r,!1,B);q(t.statements,P);var w=ke();return e.insertStatementsAfterStandardPrologue(r,m()),r.push(p.createReturnStatement(w)),a=n,o=i,s=f,c=y,l=v,u=h,_=b,d=x,M=D,S=k,T=N,C=F,E=A,e.setTextRange(p.createBlock(r,t.multiLine),t)}function K(t){var r=[];return n(t.left),n(t.right),p.inlineExpressions(r);function n(t){e.isBinaryExpression(t)&&27===t.operatorToken.kind?(n(t.left),n(t.right)):(X(t)&&r.length>0&&(Ee(1,[p.createExpressionStatement(p.inlineExpressions(r))]),r=[]),r.push(e.visitNode(t,B,e.isExpression)));}}function V(t,r,i,a){var o,s=Y(t);if(s>0){o=$();var c=e.visitNodes(t,B,e.isExpression,0,s);De(o,p.createArrayLiteralExpression(r?n$3([r],c,!0):c)),r=void 0;}var l=e.reduceLeft(t,(function(t,i){if(X(i)&&t.length>0){var s=void 0!==o;o||(o=$()),De(o,s?p.createArrayConcatCall(o,[p.createArrayLiteralExpression(t,a)]):p.createArrayLiteralExpression(r?n$3([r],t,!0):t,a)),r=void 0,t=[];}return t.push(e.visitNode(i,B,e.isExpression)),t}),[],s);return o?p.createArrayConcatCall(o,[p.createArrayLiteralExpression(l,a)]):e.setTextRange(p.createArrayLiteralExpression(r?n$3([r],l,!0):l,a),i)}function q(e,t){void 0===t&&(t=0);for(var r=e.length,n=t;n<r;n++)H(e[n]);}function W(t){e.isBlock(t)?q(t.statements):H(t);}function H(n){var a=o;o||(o=X(n)),function(n){switch(n.kind){case 234:return function(t){X(t)?q(t.statements):xe(e.visitNode(t,B,e.isStatement));}(n);case 237:return function(t){xe(e.visitNode(t,B,e.isStatement));}(n);case 238:return function(t){if(X(t))if(X(t.thenStatement)||X(t.elseStatement)){var r=ee(),n=t.elseStatement?ee():void 0;Ce(t.elseStatement?n:r,e.visitNode(t.expression,B,e.isExpression),t.expression),W(t.thenStatement),t.elseStatement&&(Se(r),te(n),W(t.elseStatement)),te(r);}else xe(e.visitNode(t,B,e.isStatement));else xe(e.visitNode(t,B,e.isStatement));}(n);case 239:return function(t){if(X(t)){var r=ee(),n=ee();se(r),te(n),W(t.statement),te(r),Te(n,e.visitNode(t.expression,B,e.isExpression)),ce();}else xe(e.visitNode(t,B,e.isStatement));}(n);case 240:return function(t){if(X(t)){var r=ee(),n=se(r);te(r),Ce(n,e.visitNode(t.expression,B,e.isExpression)),W(t.statement),Se(r),ce();}else xe(e.visitNode(t,B,e.isStatement));}(n);case 241:return function(t){if(X(t)){var r=ee(),n=ee(),i=se(n);if(t.initializer){var a=t.initializer;e.isVariableDeclarationList(a)?G(a):xe(e.setTextRange(p.createExpressionStatement(e.visitNode(a,B,e.isExpression)),a));}te(r),t.condition&&Ce(i,e.visitNode(t.condition,B,e.isExpression)),W(t.statement),te(n),t.incrementor&&xe(e.setTextRange(p.createExpressionStatement(e.visitNode(t.incrementor,B,e.isExpression)),t.incrementor)),Se(r),ce();}else xe(e.visitNode(t,B,e.isStatement));}(n);case 242:return function(t){if(X(t)){var r=$(),n=$(),i=p.createLoopVariable(),a=t.initializer;v(i),De(r,p.createArrayLiteralExpression()),xe(p.createForInStatement(n,e.visitNode(t.expression,B,e.isExpression),p.createExpressionStatement(p.createCallExpression(p.createPropertyAccessExpression(r,"push"),void 0,[n])))),De(i,p.createNumericLiteral(0));var o=ee(),s=ee(),c=se(s);te(o),Ce(c,p.createLessThan(i,p.createPropertyAccessExpression(r,"length")));var l=void 0;if(e.isVariableDeclarationList(a)){for(var u=0,_=a.declarations;u<_.length;u++){var d=_[u];v(d.name);}l=p.cloneNode(a.declarations[0].name);}else l=e.visitNode(a,B,e.isExpression),e.Debug.assert(e.isLeftHandSideExpression(l));De(l,p.createElementAccessExpression(r,i)),W(t.statement),te(s),xe(p.createExpressionStatement(p.createPostfixIncrement(i))),Se(o),ce();}else xe(e.visitNode(t,B,e.isStatement));}(n);case 244:return function(t){var r=me(t.label?e.idText(t.label):void 0);r>0?Se(r,t):xe(t);}(n);case 245:return function(t){var r=ge(t.label?e.idText(t.label):void 0);r>0?Se(r,t):xe(t);}(n);case 246:return function(t){Ee(8,[e.visitNode(t.expression,B,e.isExpression)],t);}(n);case 247:return function(t){var r,n,i;X(t)?(r=Z(e.visitNode(t.expression,B,e.isExpression)),n=ee(),i=ee(),te(n),re({kind:1,expression:r,startLabel:n,endLabel:i}),W(t.statement),e.Debug.assert(1===ae()),te(ne().endLabel)):xe(e.visitNode(t,B,e.isStatement));}(n);case 248:return function(t){if(X(t.caseBlock)){for(var r=t.caseBlock,n=r.clauses.length,i=(re({kind:2,isScript:!1,breakLabel:f=ee()}),f),a=Z(e.visitNode(t.expression,B,e.isExpression)),o=[],s=-1,c=0;c<n;c++){var l=r.clauses[c];o.push(ee()),289===l.kind&&-1===s&&(s=c);}for(var u=0,_=[];u<n;){var d=0;for(c=u;c<n;c++)if(288===(l=r.clauses[c]).kind){if(X(l.expression)&&_.length>0)break;_.push(p.createCaseClause(e.visitNode(l.expression,B,e.isExpression),[he(o[c],l.expression)]));}else d++;_.length&&(xe(p.createSwitchStatement(a,p.createCaseBlock(_))),u+=_.length,_=[]),d>0&&(u+=d,d=0);}for(Se(s>=0?o[s]:i),c=0;c<n;c++)te(o[c]),q(r.clauses[c].statements);le();}else xe(e.visitNode(t,B,e.isStatement));var f;}(n);case 249:return function(t){X(t)?(re({kind:4,isScript:!1,labelText:e.idText(t.label),breakLabel:ee()}),W(t.statement),ue()):xe(e.visitNode(t,B,e.isStatement));}(n);case 250:return function(t){var r;Ee(9,[e.visitNode(null!==(r=t.expression)&&void 0!==r?r:p.createVoidZero(),B,e.isExpression)],t);}(n);case 251:return function(n){var a,o;X(n)?(a=ee(),o=ee(),te(a),re({kind:0,state:0,startLabel:a,endLabel:o}),be(),W(n.tryBlock),n.catchClause&&(function(n){var a;if(e.Debug.assert(0===ae()),e.isGeneratedIdentifier(n.name))a=n.name,v(n.name);else {var o=e.idText(n.name);a=$(o),r||(r=new e.Map,i=[],t.enableSubstitution(79)),r.set(o,!0),i[e.getOriginalNodeId(n)]=a;}var s=ie();e.Debug.assert(s.state<1),Se(s.endLabel);var c=ee();te(c),s.state=1,s.catchVariable=a,s.catchLabel=c,De(a,p.createCallExpression(p.createPropertyAccessExpression(E,"sent"),void 0,[])),be();}(n.catchClause.variableDeclaration),W(n.catchClause.block)),n.finallyBlock&&(function(){e.Debug.assert(0===ae());var t=ie();e.Debug.assert(t.state<2),Se(t.endLabel);var r=ee();te(r),t.state=2,t.finallyLabel=r;}(),W(n.finallyBlock)),function(){e.Debug.assert(0===ae());var t=ne();t.state<2?Se(t.endLabel):Ee(10),te(t.endLabel),be(),t.state=3;}()):xe(e.visitEachChild(n,B,t));}(n);default:xe(e.visitNode(n,B,e.isStatement));}}(n),o=a;}function G(t){for(var r=0,n=t.declarations;r<n.length;r++){var i=n[r],a=p.cloneNode(i.name);e.setCommentRange(a,i.name),v(a);}for(var o=e.getInitializedVariables(t),s=o.length,c=0,l=[];c<s;){for(var u=c;u<s&&!(X((i=o[u]).initializer)&&l.length>0);u++)l.push(Q(i));l.length&&(xe(p.createExpressionStatement(p.inlineExpressions(l))),c+=l.length,l=[]);}}function Q(t){return e.setSourceMapRange(p.createAssignment(e.setSourceMapRange(p.cloneNode(t.name),t.name),e.visitNode(t.initializer,B,e.isExpression)),t)}function X(e){return !!e&&0!=(524288&e.transformFlags)}function Y(e){for(var t=e.length,r=0;r<t;r++)if(X(e[r]))return r;return -1}function Z(t){if(e.isGeneratedIdentifier(t)||4096&e.getEmitFlags(t))return t;var r=p.createTempVariable(v);return De(r,t,t),r}function $(e){var t=e?p.createUniqueName(e):p.createTempVariable(void 0);return v(t),t}function ee(){_||(_=[]);var e=M;return M++,_[e]=-1,e}function te(t){e.Debug.assert(void 0!==_,"No labels were defined."),_[t]=S?S.length:0;}function re(e){s||(s=[],l=[],c=[],u=[]);var t=l.length;return l[t]=0,c[t]=S?S.length:0,s[t]=e,u.push(e),t}function ne(){var t=ie();if(void 0===t)return e.Debug.fail("beginBlock was never called.");var r=l.length;return l[r]=1,c[r]=S?S.length:0,s[r]=t,u.pop(),t}function ie(){return e.lastOrUndefined(u)}function ae(){var e=ie();return e&&e.kind}function oe(){re({kind:3,isScript:!0,breakLabel:-1,continueLabel:-1});}function se(e){var t=ee();return re({kind:3,isScript:!1,breakLabel:t,continueLabel:e}),t}function ce(){e.Debug.assert(3===ae());var t=ne(),r=t.breakLabel;t.isScript||te(r);}function le(){e.Debug.assert(2===ae());var t=ne(),r=t.breakLabel;t.isScript||te(r);}function ue(){e.Debug.assert(4===ae());var t=ne();t.isScript||te(t.breakLabel);}function _e(e){return 2===e.kind||3===e.kind}function de(e){return 4===e.kind}function pe(e){return 3===e.kind}function fe(e,t){for(var r=t;r>=0;r--){var n=u[r];if(!de(n))break;if(n.labelText===e)return !0}return !1}function ge(e){if(u)if(e)for(var t=u.length-1;t>=0;t--){if(de(r=u[t])&&r.labelText===e)return r.breakLabel;if(_e(r)&&fe(e,t-1))return r.breakLabel}else for(t=u.length-1;t>=0;t--){var r;if(_e(r=u[t]))return r.breakLabel}return 0}function me(e){if(u)if(e){for(var t=u.length-1;t>=0;t--)if(pe(r=u[t])&&fe(e,t-1))return r.continueLabel}else for(t=u.length-1;t>=0;t--){var r;if(pe(r=u[t]))return r.continueLabel}return 0}function ye(e){if(void 0!==e&&e>0){void 0===d&&(d=[]);var t=p.createNumericLiteral(-1);return void 0===d[e]?d[e]=[t]:d[e].push(t),t}return p.createOmittedExpression()}function ve(t){var r=p.createNumericLiteral(t);return e.addSyntheticTrailingComment(r,3,function(e){switch(e){case 2:return "return";case 3:return "break";case 4:return "yield";case 5:return "yield*";case 7:return "endfinally";default:return}}(t)),r}function he(t,r){return e.Debug.assertLessThan(0,t,"Invalid label"),e.setTextRange(p.createReturnStatement(p.createArrayLiteralExpression([ve(3),ye(t)])),r)}function be(){Ee(0);}function xe(e){e?Ee(1,[e]):be();}function De(e,t,r){Ee(2,[e,t],r);}function Se(e,t){Ee(3,[e],t);}function Te(e,t,r){Ee(4,[e,t],r);}function Ce(e,t,r){Ee(5,[e,t],r);}function Ee(e,t,r){void 0===S&&(S=[],T=[],C=[]),void 0===_&&te(ee());var n=S.length;S[n]=e,T[n]=t,C[n]=r;}function ke(){L=0,R=0,k=void 0,N=!1,F=!1,A=void 0,P=void 0,w=void 0,I=void 0,O=void 0;var t=function(){if(S){for(var t=0;t<S.length;t++)Pe(t);Ne(S.length);}else Ne(0);if(A){var r=p.createPropertyAccessExpression(E,"label"),n=p.createSwitchStatement(r,p.createCaseBlock(A));return [e.startOnNewLine(n)]}return P||[]}();return f().createGeneratorHelper(e.setEmitFlags(p.createFunctionExpression(void 0,void 0,void 0,void 0,[p.createParameterDeclaration(void 0,void 0,void 0,E)],void 0,p.createBlock(t,t.length>0)),524288))}function Ne(e){(function(e){if(!F)return !0;if(!_||!d)return !1;for(var t=0;t<_.length;t++)if(_[t]===e&&d[t])return !0;return !1})(e)&&(Ae(e),O=void 0,Ie(void 0,void 0)),P&&A&&Fe(!1),function(){if(void 0!==d&&void 0!==k)for(var e=0;e<k.length;e++){var t=k[e];if(void 0!==t)for(var r=0,n=t;r<n.length;r++){var i=n[r],a=d[i];if(void 0!==a)for(var o=0,s=a;o<s.length;o++)s[o].text=String(e);}}}();}function Fe(e){if(A||(A=[]),P){if(O)for(var t=O.length-1;t>=0;t--){var r=O[t];P=[p.createWithStatement(r.expression,p.createBlock(P))];}if(I){var n=I.startLabel,i=I.catchLabel,a=I.finallyLabel,o=I.endLabel;P.unshift(p.createExpressionStatement(p.createCallExpression(p.createPropertyAccessExpression(p.createPropertyAccessExpression(E,"trys"),"push"),void 0,[p.createArrayLiteralExpression([ye(n),ye(i),ye(a),ye(o)])]))),I=void 0;}e&&P.push(p.createExpressionStatement(p.createAssignment(p.createPropertyAccessExpression(E,"label"),p.createNumericLiteral(R+1))));}A.push(p.createCaseClause(p.createNumericLiteral(R),P||[])),P=void 0;}function Ae(e){if(_)for(var t=0;t<_.length;t++)_[t]===e&&(P&&(Fe(!N),N=!1,F=!1,R++),void 0===k&&(k=[]),void 0===k[R]?k[R]=[t]:k[R].push(t));}function Pe(t){if(Ae(t),function(e){if(s)for(;L<l.length&&c[L]<=e;L++){var t=s[L],r=l[L];switch(t.kind){case 0:0===r?(w||(w=[]),P||(P=[]),w.push(I),I=t):1===r&&(I=w.pop());break;case 1:0===r?(O||(O=[]),O.push(t)):1===r&&O.pop();}}}(t),!N){N=!1,F=!1;var r=S[t];if(0!==r){if(10===r)return N=!0,void we(p.createReturnStatement(p.createArrayLiteralExpression([ve(7)])));var n=T[t];if(1===r)return we(n[0]);var i,a,o,u=C[t];switch(r){case 2:return i=n[0],a=n[1],o=u,void we(e.setTextRange(p.createExpressionStatement(p.createAssignment(i,a)),o));case 3:return function(t,r){N=!0,we(e.setEmitFlags(e.setTextRange(p.createReturnStatement(p.createArrayLiteralExpression([ve(3),ye(t)])),r),384));}(n[0],u);case 4:return function(t,r,n){we(e.setEmitFlags(p.createIfStatement(r,e.setEmitFlags(e.setTextRange(p.createReturnStatement(p.createArrayLiteralExpression([ve(3),ye(t)])),n),384)),1));}(n[0],n[1],u);case 5:return function(t,r,n){we(e.setEmitFlags(p.createIfStatement(p.createLogicalNot(r),e.setEmitFlags(e.setTextRange(p.createReturnStatement(p.createArrayLiteralExpression([ve(3),ye(t)])),n),384)),1));}(n[0],n[1],u);case 6:return function(t,r){N=!0,we(e.setEmitFlags(e.setTextRange(p.createReturnStatement(p.createArrayLiteralExpression(t?[ve(4),t]:[ve(4)])),r),384));}(n[0],u);case 7:return function(t,r){N=!0,we(e.setEmitFlags(e.setTextRange(p.createReturnStatement(p.createArrayLiteralExpression([ve(5),t])),r),384));}(n[0],u);case 8:return Ie(n[0],u);case 9:return function(t,r){N=!0,F=!0,we(e.setTextRange(p.createThrowStatement(t),r));}(n[0],u)}}}}function we(e){e&&(P?P.push(e):P=[e]);}function Ie(t,r){N=!0,F=!0,we(e.setEmitFlags(e.setTextRange(p.createReturnStatement(p.createArrayLiteralExpression(t?[ve(2),t]:[ve(2)])),r),384));}};}(t),function(e){e.transformModule=function(r){var i=r.factory,a=r.getEmitHelperFactory,o=r.startLexicalEnvironment,s=r.endLexicalEnvironment,c=r.hoistVariableDeclaration,l=r.getCompilerOptions(),u=r.getEmitResolver(),_=r.getEmitHost(),d=e.getEmitScriptTarget(l),p=e.getEmitModuleKind(l),f=r.onSubstituteNode,g=r.onEmitNode;r.onSubstituteNode=function(t,r){return (r=f(t,r)).id&&x[r.id]?r:1===t?function(t){switch(t.kind){case 79:return Z(t);case 207:return function(t){if(e.isIdentifier(t.expression)){var r=Z(t.expression);if(x[e.getNodeId(r)]=!0,!e.isIdentifier(r))return e.addEmitFlags(i.updateCallExpression(t,r,void 0,t.arguments),536870912)}return t}(t);case 209:return function(t){if(e.isIdentifier(t.tag)){var r=Z(t.tag);if(x[e.getNodeId(r)]=!0,!e.isIdentifier(r))return e.addEmitFlags(i.updateTaggedTemplateExpression(t,r,void 0,t.template),536870912)}return t}(t);case 220:return function(t){if(e.isAssignmentOperator(t.operatorToken.kind)&&e.isIdentifier(t.left)&&!e.isGeneratedIdentifier(t.left)&&!e.isLocalName(t.left)&&!e.isDeclarationNameOfEnumOrNamespace(t.left)){var r=$(t.left);if(r){for(var n=t,i=0,a=r;i<a.length;i++){var o=a[i];x[e.getNodeId(n)]=!0,n=X(o,n,t);}return n}}return t}(t)}return t}(r):e.isShorthandPropertyAssignment(r)?function(t){var r=t.name,n=Z(r);if(n!==r){if(t.objectAssignmentInitializer){var a=i.createAssignment(n,t.objectAssignmentInitializer);return e.setTextRange(i.createPropertyAssignment(r,a),t)}return e.setTextRange(i.createPropertyAssignment(r,n),t)}return t}(r):r},r.onEmitNode=function(t,r,n){303===r.kind?(m=r,y=h[e.getOriginalNodeId(m)],g(t,r,n),m=void 0,y=void 0):g(t,r,n);},r.enableSubstitution(207),r.enableSubstitution(209),r.enableSubstitution(79),r.enableSubstitution(220),r.enableSubstitution(295),r.enableEmitNotification(303);var m,y,v,h=[],b=[],x=[];return e.chainBundle(r,(function(t){if(t.isDeclarationFile||!(e.isEffectiveExternalModule(t,l)||4194304&t.transformFlags||e.isJsonSourceFile(t)&&e.hasJsonModuleEmitEnabled(l)&&e.outFile(l)))return t;m=t,y=e.collectExternalModuleInfo(r,t,u,l),h[e.getOriginalNodeId(t)]=y;var n=function(t){switch(t){case e.ModuleKind.AMD:return T;case e.ModuleKind.UMD:return C;default:return S}}(p)(t);return m=void 0,y=void 0,v=!1,n}));function D(){return !(y.exportEquals||!e.isExternalModule(m))}function S(t){o();var n=[],a=e.getStrictOptionValue(l,"alwaysStrict")||!l.noImplicitUseStrict&&e.isExternalModule(m),c=i.copyPrologue(t.statements,n,a&&!e.isJsonSourceFile(t),A);if(D()&&e.append(n,Q()),e.length(y.exportedNames))for(var u=0;u<y.exportedNames.length;u+=50)e.append(n,i.createExpressionStatement(e.reduceLeft(y.exportedNames.slice(u,u+50),(function(t,r){return i.createAssignment(i.createPropertyAccessExpression(i.createIdentifier("exports"),i.createIdentifier(e.idText(r))),t)}),i.createVoidZero())));e.append(n,e.visitNode(y.externalHelpersImportDeclaration,A,e.isStatement)),e.addRange(n,e.visitNodes(t.statements,A,e.isStatement,c)),F(n,!1),e.insertStatementsAfterStandardPrologue(n,s());var _=i.updateSourceFile(t,e.setTextRange(i.createNodeArray(n),t.statements));return e.addEmitHelpers(_,r.readEmitHelpers()),_}function T(t){var a=i.createIdentifier("define"),o=e.tryGetModuleNameFromFile(i,t,_,l),s=e.isJsonSourceFile(t)&&t,c=E(t,!0),u=c.aliasedModuleNames,d=c.unaliasedModuleNames,p=c.importAliasNames,f=i.updateSourceFile(t,e.setTextRange(i.createNodeArray([i.createExpressionStatement(i.createCallExpression(a,void 0,n$3(n$3([],o?[o]:[],!0),[i.createArrayLiteralExpression(s?e.emptyArray:n$3(n$3([i.createStringLiteral("require"),i.createStringLiteral("exports")],u,!0),d,!0)),s?s.statements.length?s.statements[0].expression:i.createObjectLiteralExpression():i.createFunctionExpression(void 0,void 0,void 0,void 0,n$3([i.createParameterDeclaration(void 0,void 0,void 0,"require"),i.createParameterDeclaration(void 0,void 0,void 0,"exports")],p,!0),void 0,N(t))],!1)))]),t.statements));return e.addEmitHelpers(f,r.readEmitHelpers()),f}function C(t){var a=E(t,!1),o=a.aliasedModuleNames,s=a.unaliasedModuleNames,c=a.importAliasNames,u=e.tryGetModuleNameFromFile(i,t,_,l),d=i.createFunctionExpression(void 0,void 0,void 0,void 0,[i.createParameterDeclaration(void 0,void 0,void 0,"factory")],void 0,e.setTextRange(i.createBlock([i.createIfStatement(i.createLogicalAnd(i.createTypeCheck(i.createIdentifier("module"),"object"),i.createTypeCheck(i.createPropertyAccessExpression(i.createIdentifier("module"),"exports"),"object")),i.createBlock([i.createVariableStatement(void 0,[i.createVariableDeclaration("v",void 0,void 0,i.createCallExpression(i.createIdentifier("factory"),void 0,[i.createIdentifier("require"),i.createIdentifier("exports")]))]),e.setEmitFlags(i.createIfStatement(i.createStrictInequality(i.createIdentifier("v"),i.createIdentifier("undefined")),i.createExpressionStatement(i.createAssignment(i.createPropertyAccessExpression(i.createIdentifier("module"),"exports"),i.createIdentifier("v")))),1)]),i.createIfStatement(i.createLogicalAnd(i.createTypeCheck(i.createIdentifier("define"),"function"),i.createPropertyAccessExpression(i.createIdentifier("define"),"amd")),i.createBlock([i.createExpressionStatement(i.createCallExpression(i.createIdentifier("define"),void 0,n$3(n$3([],u?[u]:[],!0),[i.createArrayLiteralExpression(n$3(n$3([i.createStringLiteral("require"),i.createStringLiteral("exports")],o,!0),s,!0)),i.createIdentifier("factory")],!1)))])))],!0),void 0)),p=i.updateSourceFile(t,e.setTextRange(i.createNodeArray([i.createExpressionStatement(i.createCallExpression(d,void 0,[i.createFunctionExpression(void 0,void 0,void 0,void 0,n$3([i.createParameterDeclaration(void 0,void 0,void 0,"require"),i.createParameterDeclaration(void 0,void 0,void 0,"exports")],c,!0),void 0,N(t))]))]),t.statements));return e.addEmitHelpers(p,r.readEmitHelpers()),p}function E(t,r){for(var n=[],a=[],o=[],s=0,c=t.amdDependencies;s<c.length;s++){var d=c[s];d.name?(n.push(i.createStringLiteral(d.path)),o.push(i.createParameterDeclaration(void 0,void 0,void 0,d.name))):a.push(i.createStringLiteral(d.path));}for(var p=0,f=y.externalImports;p<f.length;p++){var g=f[p],v=e.getExternalModuleNameLiteral(i,g,m,_,u,l),h=e.getLocalNameForExternalImport(i,g,m);v&&(r&&h?(e.setEmitFlags(h,4),n.push(v),o.push(i.createParameterDeclaration(void 0,void 0,void 0,h))):a.push(v));}return {aliasedModuleNames:n,unaliasedModuleNames:a,importAliasNames:o}}function k(t){if(!e.isImportEqualsDeclaration(t)&&!e.isExportDeclaration(t)&&e.getExternalModuleNameLiteral(i,t,m,_,u,l)){var r=e.getLocalNameForExternalImport(i,t,m),n=R(t,r);if(n!==r)return i.createExpressionStatement(i.createAssignment(r,n))}}function N(r){o();var n=[],a=i.copyPrologue(r.statements,n,!l.noImplicitUseStrict,A);D()&&e.append(n,Q()),e.length(y.exportedNames)&&e.append(n,i.createExpressionStatement(e.reduceLeft(y.exportedNames,(function(t,r){return i.createAssignment(i.createPropertyAccessExpression(i.createIdentifier("exports"),i.createIdentifier(e.idText(r))),t)}),i.createVoidZero()))),e.append(n,e.visitNode(y.externalHelpersImportDeclaration,A,e.isStatement)),p===e.ModuleKind.AMD&&e.addRange(n,e.mapDefined(y.externalImports,k)),e.addRange(n,e.visitNodes(r.statements,A,e.isStatement,a)),F(n,!0),e.insertStatementsAfterStandardPrologue(n,s());var c=i.createBlock(n,!0);return v&&e.addEmitHelper(c,t),c}function F(t,r){if(y.exportEquals){var n=e.visitNode(y.exportEquals.expression,w);if(n)if(r){var a=i.createReturnStatement(n);e.setTextRange(a,y.exportEquals),e.setEmitFlags(a,1920),t.push(a);}else a=i.createExpressionStatement(i.createAssignment(i.createPropertyAccessExpression(i.createIdentifier("module"),"exports"),n)),e.setTextRange(a,y.exportEquals),e.setEmitFlags(a,1536),t.push(a);}}function A(t){switch(t.kind){case 265:return function(t){var r,n=e.getNamespaceDeclarationNode(t);if(p!==e.ModuleKind.AMD){if(!t.importClause)return e.setOriginalNode(e.setTextRange(i.createExpressionStatement(B(t)),t),t);var a=[];n&&!e.isDefaultImport(t)?a.push(i.createVariableDeclaration(i.cloneNode(n.name),void 0,void 0,R(t,B(t)))):(a.push(i.createVariableDeclaration(i.getGeneratedNameForNode(t),void 0,void 0,R(t,B(t)))),n&&e.isDefaultImport(t)&&a.push(i.createVariableDeclaration(i.cloneNode(n.name),void 0,void 0,i.getGeneratedNameForNode(t)))),r=e.append(r,e.setOriginalNode(e.setTextRange(i.createVariableStatement(void 0,i.createVariableDeclarationList(a,d>=2?2:0)),t),t));}else n&&e.isDefaultImport(t)&&(r=e.append(r,i.createVariableStatement(void 0,i.createVariableDeclarationList([e.setOriginalNode(e.setTextRange(i.createVariableDeclaration(i.cloneNode(n.name),void 0,void 0,i.getGeneratedNameForNode(t)),t),t)],d>=2?2:0))));if(z(t)){var o=e.getOriginalNodeId(t);b[o]=U(b[o],t);}else r=U(r,t);return e.singleOrMany(r)}(t);case 264:return function(t){var r;if(e.Debug.assert(e.isExternalModuleImportEqualsDeclaration(t),"import= for internal module references should be handled in an earlier transformer."),p!==e.ModuleKind.AMD?r=e.hasSyntacticModifier(t,1)?e.append(r,e.setOriginalNode(e.setTextRange(i.createExpressionStatement(X(t.name,B(t))),t),t)):e.append(r,e.setOriginalNode(e.setTextRange(i.createVariableStatement(void 0,i.createVariableDeclarationList([i.createVariableDeclaration(i.cloneNode(t.name),void 0,void 0,B(t))],d>=2?2:0)),t),t)):e.hasSyntacticModifier(t,1)&&(r=e.append(r,e.setOriginalNode(e.setTextRange(i.createExpressionStatement(X(i.getExportName(t),i.getLocalName(t))),t),t))),z(t)){var n=e.getOriginalNodeId(t);b[n]=K(b[n],t);}else r=K(r,t);return e.singleOrMany(r)}(t);case 271:return function(t){if(t.moduleSpecifier){var r=i.getGeneratedNameForNode(t);if(t.exportClause&&e.isNamedExports(t.exportClause)){var n=[];p!==e.ModuleKind.AMD&&n.push(e.setOriginalNode(e.setTextRange(i.createVariableStatement(void 0,i.createVariableDeclarationList([i.createVariableDeclaration(r,void 0,void 0,B(t))])),t),t));for(var o=0,s=t.exportClause.elements;o<s.length;o++){var c=s[o];if(0===d)n.push(e.setOriginalNode(e.setTextRange(i.createExpressionStatement(a().createCreateBindingHelper(r,i.createStringLiteralFromNode(c.propertyName||c.name),c.propertyName?i.createStringLiteralFromNode(c.name):void 0)),c),c));else {var u=!(!e.getESModuleInterop(l)||67108864&e.getEmitFlags(t)||"default"!==e.idText(c.propertyName||c.name)),_=i.createPropertyAccessExpression(u?a().createImportDefaultHelper(r):r,c.propertyName||c.name);n.push(e.setOriginalNode(e.setTextRange(i.createExpressionStatement(X(i.getExportName(c),_,void 0,!0)),c),c));}}return e.singleOrMany(n)}return t.exportClause?((n=[]).push(e.setOriginalNode(e.setTextRange(i.createExpressionStatement(X(i.cloneNode(t.exportClause.name),function(t,r){return !e.getESModuleInterop(l)||67108864&e.getEmitFlags(t)?r:e.getExportNeedsImportStarHelper(t)?a().createImportStarHelper(r):r}(t,p!==e.ModuleKind.AMD?B(t):e.isExportNamespaceAsDefaultDeclaration(t)?r:i.createIdentifier(e.idText(t.exportClause.name))))),t),t)),e.singleOrMany(n)):e.setOriginalNode(e.setTextRange(i.createExpressionStatement(a().createExportStarHelper(p!==e.ModuleKind.AMD?B(t):r)),t),t)}}(t);case 270:return function(t){if(!t.isExportEquals){var r,n=t.original;if(n&&z(n)){var a=e.getOriginalNodeId(t);b[a]=G(b[a],i.createIdentifier("default"),e.visitNode(t.expression,w),t,!0);}else r=G(r,i.createIdentifier("default"),e.visitNode(t.expression,w),t,!0);return e.singleOrMany(r)}}(t);case 236:return function(t){var n,a,o;if(e.hasSyntacticModifier(t,1)){for(var s=void 0,c=!1,l=0,u=t.declarationList.declarations;l<u.length;l++){var _=u[l];if(e.isIdentifier(_.name)&&e.isLocalName(_.name))s||(s=e.visitNodes(t.modifiers,Y,e.isModifier)),a=e.append(a,_);else if(_.initializer)if(!e.isBindingPattern(_.name)&&(e.isArrowFunction(_.initializer)||e.isFunctionExpression(_.initializer)||e.isClassExpression(_.initializer))){var d=i.createAssignment(e.setTextRange(i.createPropertyAccessExpression(i.createIdentifier("exports"),_.name),_.name),i.createIdentifier(e.getTextOfIdentifierOrLiteral(_.name))),p=i.createVariableDeclaration(_.name,_.exclamationToken,_.type,e.visitNode(_.initializer,w));a=e.append(a,p),o=e.append(o,d),c=!0;}else o=e.append(o,J(_));}if(a&&(n=e.append(n,i.updateVariableStatement(t,s,i.updateVariableDeclarationList(t.declarationList,a)))),o){var f=e.setOriginalNode(e.setTextRange(i.createExpressionStatement(i.inlineExpressions(o)),t),t);c&&e.removeAllComments(f),n=e.append(n,f);}}else n=e.append(n,e.visitEachChild(t,w,r));if(z(t)){var g=e.getOriginalNodeId(t);b[g]=V(b[g],t);}else n=V(n,t);return e.singleOrMany(n)}(t);case 255:return function(t){var n;if(n=e.hasSyntacticModifier(t,1)?e.append(n,e.setOriginalNode(e.setTextRange(i.createFunctionDeclaration(void 0,e.visitNodes(t.modifiers,Y,e.isModifier),t.asteriskToken,i.getDeclarationName(t,!0,!0),void 0,e.visitNodes(t.parameters,w),void 0,e.visitEachChild(t.body,w,r)),t),t)):e.append(n,e.visitEachChild(t,w,r)),z(t)){var a=e.getOriginalNodeId(t);b[a]=W(b[a],t);}else n=W(n,t);return e.singleOrMany(n)}(t);case 256:return function(t){var n;if(n=e.hasSyntacticModifier(t,1)?e.append(n,e.setOriginalNode(e.setTextRange(i.createClassDeclaration(void 0,e.visitNodes(t.modifiers,Y,e.isModifier),i.getDeclarationName(t,!0,!0),void 0,e.visitNodes(t.heritageClauses,w),e.visitNodes(t.members,w)),t),t)):e.append(n,e.visitEachChild(t,w,r)),z(t)){var a=e.getOriginalNodeId(t);b[a]=W(b[a],t);}else n=W(n,t);return e.singleOrMany(n)}(t);case 350:return function(t){if(z(t)&&236===t.original.kind){var r=e.getOriginalNodeId(t);b[r]=V(b[r],t.original);}return t}(t);case 351:return function(t){var r=e.getOriginalNodeId(t),n=b[r];return n?(delete b[r],e.append(n,t)):t}(t);default:return w(t)}}function P(t,n){if(!(71305216&t.transformFlags))return t;switch(t.kind){case 241:return function(t){return i.updateForStatement(t,e.visitNode(t.initializer,I,e.isForInitializer),e.visitNode(t.condition,w,e.isExpression),e.visitNode(t.incrementor,I,e.isExpression),e.visitIterationBody(t.statement,w,r))}(t);case 237:return function(t){return i.updateExpressionStatement(t,e.visitNode(t.expression,I,e.isExpression))}(t);case 211:return function(t,r){return i.updateParenthesizedExpression(t,e.visitNode(t.expression,r?I:w,e.isExpression))}(t,n);case 348:return function(t,r){return i.updatePartiallyEmittedExpression(t,e.visitNode(t.expression,r?I:w,e.isExpression))}(t,n);case 207:if(e.isImportCall(t)&&void 0===m.impliedNodeFormat)return function(t){var r=e.getExternalModuleNameLiteral(i,t,m,_,u,l),n=e.visitNode(e.firstOrUndefined(t.arguments),w),a=!r||n&&e.isStringLiteral(n)&&n.text===r.text?n:r,o=!!(8192&t.transformFlags);switch(l.module){case e.ModuleKind.AMD:return M(a,o);case e.ModuleKind.UMD:return function(t,r){if(v=!0,e.isSimpleCopiableExpression(t)){var n=e.isGeneratedIdentifier(t)?t:e.isStringLiteral(t)?i.createStringLiteralFromNode(t):e.setEmitFlags(e.setTextRange(i.cloneNode(t),t),1536);return i.createConditionalExpression(i.createIdentifier("__syncRequire"),void 0,L(t,r),void 0,M(n,r))}var a=i.createTempVariable(c);return i.createComma(i.createAssignment(a,t),i.createConditionalExpression(i.createIdentifier("__syncRequire"),void 0,L(a,r),void 0,M(a,r)))}(null!=a?a:i.createVoidZero(),o);case e.ModuleKind.CommonJS:default:return L(a,o)}}(t);break;case 220:if(e.isDestructuringAssignment(t))return function(t,n){return O(t.left)?e.flattenDestructuringAssignment(t,w,r,0,!n,j):e.visitEachChild(t,w,r)}(t,n);break;case 218:case 219:return function(t,n){if((45===t.operator||46===t.operator)&&e.isIdentifier(t.operand)&&!e.isGeneratedIdentifier(t.operand)&&!e.isLocalName(t.operand)&&!e.isDeclarationNameOfEnumOrNamespace(t.operand)){var a=$(t.operand);if(a){var o=void 0,s=e.visitNode(t.operand,w,e.isExpression);e.isPrefixUnaryExpression(t)?s=i.updatePrefixUnaryExpression(t,s):(s=i.updatePostfixUnaryExpression(t,s),n||(o=i.createTempVariable(c),s=i.createAssignment(o,s),e.setTextRange(s,t)),s=i.createComma(s,i.cloneNode(t.operand)),e.setTextRange(s,t));for(var l=0,u=a;l<u.length;l++){var _=u[l];x[e.getNodeId(s)]=!0,s=X(_,s),e.setTextRange(s,t);}return o&&(x[e.getNodeId(s)]=!0,s=i.createComma(s,o),e.setTextRange(s,t)),s}}return e.visitEachChild(t,w,r)}(t,n)}return e.visitEachChild(t,w,r)}function w(e){return P(e,!1)}function I(e){return P(e,!0)}function O(t){if(e.isObjectLiteralExpression(t))for(var r=0,n=t.properties;r<n.length;r++)switch((o=n[r]).kind){case 294:if(O(o.initializer))return !0;break;case 295:if(O(o.name))return !0;break;case 296:if(O(o.expression))return !0;break;case 168:case 171:case 172:return !1;default:e.Debug.assertNever(o,"Unhandled object member kind");}else if(e.isArrayLiteralExpression(t))for(var i=0,a=t.elements;i<a.length;i++){var o=a[i];if(e.isSpreadElement(o)){if(O(o.expression))return !0}else if(O(o))return !0}else if(e.isIdentifier(t))return e.length($(t))>(e.isExportName(t)?1:0);return !1}function M(t,r){var n,o=i.createUniqueName("resolve"),s=i.createUniqueName("reject"),c=[i.createParameterDeclaration(void 0,void 0,void 0,o),i.createParameterDeclaration(void 0,void 0,void 0,s)],u=i.createBlock([i.createExpressionStatement(i.createCallExpression(i.createIdentifier("require"),void 0,[i.createArrayLiteralExpression([t||i.createOmittedExpression()]),o,s]))]);d>=2?n=i.createArrowFunction(void 0,void 0,c,void 0,void 0,u):(n=i.createFunctionExpression(void 0,void 0,void 0,void 0,c,void 0,u),r&&e.setEmitFlags(n,8));var _=i.createNewExpression(i.createIdentifier("Promise"),void 0,[n]);return e.getESModuleInterop(l)?i.createCallExpression(i.createPropertyAccessExpression(_,i.createIdentifier("then")),void 0,[a().createImportStarCallbackHelper()]):_}function L(t,r){var n,o=i.createCallExpression(i.createPropertyAccessExpression(i.createIdentifier("Promise"),"resolve"),void 0,[]),s=i.createCallExpression(i.createIdentifier("require"),void 0,t?[t]:[]);return e.getESModuleInterop(l)&&(s=a().createImportStarHelper(s)),d>=2?n=i.createArrowFunction(void 0,void 0,[],void 0,void 0,s):(n=i.createFunctionExpression(void 0,void 0,void 0,void 0,[],void 0,i.createBlock([i.createReturnStatement(s)])),r&&e.setEmitFlags(n,8)),i.createCallExpression(i.createPropertyAccessExpression(o,"then"),void 0,[n])}function R(t,r){return !e.getESModuleInterop(l)||67108864&e.getEmitFlags(t)?r:e.getImportNeedsImportStarHelper(t)?a().createImportStarHelper(r):e.getImportNeedsImportDefaultHelper(t)?a().createImportDefaultHelper(r):r}function B(t){var r=e.getExternalModuleNameLiteral(i,t,m,_,u,l),n=[];return r&&n.push(r),i.createCallExpression(i.createIdentifier("require"),void 0,n)}function j(t,r,n){var a=$(t);if(a){for(var o=e.isExportName(t)?r:i.createAssignment(t,r),s=0,c=a;s<c.length;s++){var l=c[s];e.setEmitFlags(o,4),o=X(l,o,n);}return o}return i.createAssignment(t,r)}function J(t){return e.isBindingPattern(t.name)?e.flattenDestructuringAssignment(e.visitNode(t,w),void 0,r,0,!1,j):i.createAssignment(e.setTextRange(i.createPropertyAccessExpression(i.createIdentifier("exports"),t.name),t.name),t.initializer?e.visitNode(t.initializer,w):i.createVoidZero())}function z(t){return 0!=(4194304&e.getEmitFlags(t))}function U(e,t){if(y.exportEquals)return e;var r=t.importClause;if(!r)return e;r.name&&(e=H(e,r));var n=r.namedBindings;if(n)switch(n.kind){case 267:e=H(e,n);break;case 268:for(var i=0,a=n.elements;i<a.length;i++)e=H(e,a[i],!0);}return e}function K(e,t){return y.exportEquals?e:H(e,t)}function V(e,t){if(y.exportEquals)return e;for(var r=0,n=t.declarationList.declarations;r<n.length;r++)e=q(e,n[r]);return e}function q(t,r){if(y.exportEquals)return t;if(e.isBindingPattern(r.name))for(var n=0,i=r.name.elements;n<i.length;n++){var a=i[n];e.isOmittedExpression(a)||(t=q(t,a));}else e.isGeneratedIdentifier(r.name)||(t=H(t,r));return t}function W(t,r){return y.exportEquals||(e.hasSyntacticModifier(r,1)&&(t=G(t,e.hasSyntacticModifier(r,512)?i.createIdentifier("default"):i.getDeclarationName(r),i.getLocalName(r),r)),r.name&&(t=H(t,r))),t}function H(t,r,n){var a=i.getDeclarationName(r),o=y.exportSpecifiers.get(e.idText(a));if(o)for(var s=0,c=o;s<c.length;s++){var l=c[s];t=G(t,l.name,a,l.name,void 0,n);}return t}function G(t,r,n,a,o,s){return e.append(t,function(t,r,n,a,o){var s=e.setTextRange(i.createExpressionStatement(X(t,r,void 0,o)),n);return e.startOnNewLine(s),a||e.setEmitFlags(s,1536),s}(r,n,a,o,s))}function Q(){var t;return t=0===d?i.createExpressionStatement(X(i.createIdentifier("__esModule"),i.createTrue())):i.createExpressionStatement(i.createCallExpression(i.createPropertyAccessExpression(i.createIdentifier("Object"),"defineProperty"),void 0,[i.createIdentifier("exports"),i.createStringLiteral("__esModule"),i.createObjectLiteralExpression([i.createPropertyAssignment("value",i.createTrue())])])),e.setEmitFlags(t,1048576),t}function X(t,r,n,a){return e.setTextRange(a&&0!==d?i.createCallExpression(i.createPropertyAccessExpression(i.createIdentifier("Object"),"defineProperty"),void 0,[i.createIdentifier("exports"),i.createStringLiteralFromNode(t),i.createObjectLiteralExpression([i.createPropertyAssignment("enumerable",i.createTrue()),i.createPropertyAssignment("get",i.createFunctionExpression(void 0,void 0,void 0,void 0,[],void 0,i.createBlock([i.createReturnStatement(r)])))])]):i.createAssignment(i.createPropertyAccessExpression(i.createIdentifier("exports"),i.cloneNode(t)),r),n)}function Y(e){switch(e.kind){case 93:case 88:return}return e}function Z(t){var r,n;if(4096&e.getEmitFlags(t)){var a=e.getExternalHelpersModuleName(m);return a?i.createPropertyAccessExpression(a,t):t}if((!e.isGeneratedIdentifier(t)||64&t.autoGenerateFlags)&&!e.isLocalName(t)){var o=u.getReferencedExportContainer(t,e.isExportName(t));if(o&&303===o.kind)return e.setTextRange(i.createPropertyAccessExpression(i.createIdentifier("exports"),i.cloneNode(t)),t);var s=u.getReferencedImportDeclaration(t);if(s){if(e.isImportClause(s))return e.setTextRange(i.createPropertyAccessExpression(i.getGeneratedNameForNode(s.parent),i.createIdentifier("default")),t);if(e.isImportSpecifier(s)){var c=s.propertyName||s.name;return e.setTextRange(i.createPropertyAccessExpression(i.getGeneratedNameForNode((null===(n=null===(r=s.parent)||void 0===r?void 0:r.parent)||void 0===n?void 0:n.parent)||s),i.cloneNode(c)),t)}}}return t}function $(t){if(!e.isGeneratedIdentifier(t)){var r=u.getReferencedImportDeclaration(t)||u.getReferencedValueDeclaration(t);if(r)return y&&y.exportedBindings[e.getOriginalNodeId(r)]}}};var t={name:"typescript:dynamicimport-sync-require",scoped:!0,text:'\n var __syncRequire = typeof module === "object" && typeof module.exports === "object";'};}(t),function(e){e.transformSystemModule=function(t){var r=t.factory,n=t.startLexicalEnvironment,i=t.endLexicalEnvironment,a=t.hoistVariableDeclaration,o=t.getCompilerOptions(),s=t.getEmitResolver(),c=t.getEmitHost(),l=t.onSubstituteNode,u=t.onEmitNode;t.onSubstituteNode=function(t,n){return function(e){return y&&e.id&&y[e.id]}(n=l(t,n))?n:1===t?function(t){switch(t.kind){case 79:return function(t){var n,i;if(4096&e.getEmitFlags(t)){var a=e.getExternalHelpersModuleName(_);return a?r.createPropertyAccessExpression(a,t):t}if(!e.isGeneratedIdentifier(t)&&!e.isLocalName(t)){var o=s.getReferencedImportDeclaration(t);if(o){if(e.isImportClause(o))return e.setTextRange(r.createPropertyAccessExpression(r.getGeneratedNameForNode(o.parent),r.createIdentifier("default")),t);if(e.isImportSpecifier(o))return e.setTextRange(r.createPropertyAccessExpression(r.getGeneratedNameForNode((null===(i=null===(n=o.parent)||void 0===n?void 0:n.parent)||void 0===i?void 0:i.parent)||o),r.cloneNode(o.propertyName||o.name)),t)}}return t}(t);case 220:return function(t){if(e.isAssignmentOperator(t.operatorToken.kind)&&e.isIdentifier(t.left)&&!e.isGeneratedIdentifier(t.left)&&!e.isLocalName(t.left)&&!e.isDeclarationNameOfEnumOrNamespace(t.left)){var r=X(t.left);if(r){for(var n=t,i=0,a=r;i<a.length;i++)n=z(a[i],Y(n));return n}}return t}(t);case 230:return function(t){return e.isImportMeta(t)?r.createPropertyAccessExpression(f,r.createIdentifier("meta")):t}(t)}return t}(n):4===t?function(t){switch(t.kind){case 295:return function(t){var n,i,a=t.name;if(!e.isGeneratedIdentifier(a)&&!e.isLocalName(a)){var o=s.getReferencedImportDeclaration(a);if(o){if(e.isImportClause(o))return e.setTextRange(r.createPropertyAssignment(r.cloneNode(a),r.createPropertyAccessExpression(r.getGeneratedNameForNode(o.parent),r.createIdentifier("default"))),t);if(e.isImportSpecifier(o))return e.setTextRange(r.createPropertyAssignment(r.cloneNode(a),r.createPropertyAccessExpression(r.getGeneratedNameForNode((null===(i=null===(n=o.parent)||void 0===n?void 0:n.parent)||void 0===i?void 0:i.parent)||o),r.cloneNode(o.propertyName||o.name))),t)}}return t}(t)}return t}(n):n},t.onEmitNode=function(t,r,n){if(303===r.kind){var i=e.getOriginalNodeId(r);_=r,d=v[i],p=b[i],y=x[i],f=D[i],y&&delete x[i],u(t,r,n),_=void 0,d=void 0,p=void 0,f=void 0,y=void 0;}else u(t,r,n);},t.enableSubstitution(79),t.enableSubstitution(295),t.enableSubstitution(220),t.enableSubstitution(230),t.enableEmitNotification(303);var _,d,p,f,g,m,y,v=[],h=[],b=[],x=[],D=[];return e.chainBundle(t,(function(a){if(a.isDeclarationFile||!(e.isEffectiveExternalModule(a,o)||4194304&a.transformFlags))return a;var l=e.getOriginalNodeId(a);_=a,m=a,d=v[l]=e.collectExternalModuleInfo(t,a,s,o),p=r.createUniqueName("exports"),b[l]=p,f=D[l]=r.createUniqueName("context");var u=function(t){for(var n=new e.Map,i=[],a=0,l=t;a<l.length;a++){var u=l[a],d=e.getExternalModuleNameLiteral(r,u,_,c,s,o);if(d){var p=d.text,f=n.get(p);void 0!==f?i[f].externalImports.push(u):(n.set(p,i.length),i.push({name:d,externalImports:[u]}));}}return i}(d.externalImports),h=function(t,a){var s=[];n();var c=e.getStrictOptionValue(o,"alwaysStrict")||!o.noImplicitUseStrict&&e.isExternalModule(_),l=r.copyPrologue(t.statements,s,c,C);s.push(r.createVariableStatement(void 0,r.createVariableDeclarationList([r.createVariableDeclaration("__moduleName",void 0,void 0,r.createLogicalAnd(f,r.createPropertyAccessExpression(f,"id")))]))),e.visitNode(d.externalHelpersImportDeclaration,C,e.isStatement);var u=e.visitNodes(t.statements,C,e.isStatement,l);e.addRange(s,g),e.insertStatementsAfterStandardPrologue(s,i());var p=function(e){if(d.hasExportStarsToExportValues){if(!d.exportedNames&&0===d.exportSpecifiers.size){for(var t=!1,n=0,i=d.externalImports;n<i.length;n++){var a=i[n];if(271===a.kind&&a.exportClause){t=!0;break}}if(!t){var o=S(void 0);return e.push(o),o.name}}var s=[];if(d.exportedNames)for(var c=0,l=d.exportedNames;c<l.length;c++){var u=l[c];"default"!==u.escapedText&&s.push(r.createPropertyAssignment(r.createStringLiteralFromNode(u),r.createTrue()));}var _=r.createUniqueName("exportedNames");e.push(r.createVariableStatement(void 0,r.createVariableDeclarationList([r.createVariableDeclaration(_,void 0,void 0,r.createObjectLiteralExpression(s,!0))])));var p=S(_);return e.push(p),p.name}}(s),m=1048576&t.transformFlags?r.createModifiersFromModifierFlags(256):void 0,y=r.createObjectLiteralExpression([r.createPropertyAssignment("setters",T(p,a)),r.createPropertyAssignment("execute",r.createFunctionExpression(m,void 0,void 0,void 0,[],void 0,r.createBlock(u,!0)))],!0);return s.push(r.createReturnStatement(y)),r.createBlock(s,!0)}(a,u),E=r.createFunctionExpression(void 0,void 0,void 0,void 0,[r.createParameterDeclaration(void 0,void 0,void 0,p),r.createParameterDeclaration(void 0,void 0,void 0,f)],void 0,h),k=e.tryGetModuleNameFromFile(r,a,c,o),N=r.createArrayLiteralExpression(e.map(u,(function(e){return e.name}))),F=e.setEmitFlags(r.updateSourceFile(a,e.setTextRange(r.createNodeArray([r.createExpressionStatement(r.createCallExpression(r.createPropertyAccessExpression(r.createIdentifier("System"),"register"),void 0,k?[k,N,E]:[N,E]))]),a.statements)),1024);return e.outFile(o)||e.moveEmitHelpers(F,h,(function(e){return !e.scoped})),y&&(x[l]=y,y=void 0),_=void 0,d=void 0,p=void 0,f=void 0,g=void 0,m=void 0,F}));function S(t){var n=r.createUniqueName("exportStar"),i=r.createIdentifier("m"),a=r.createIdentifier("n"),o=r.createIdentifier("exports"),s=r.createStrictInequality(a,r.createStringLiteral("default"));return t&&(s=r.createLogicalAnd(s,r.createLogicalNot(r.createCallExpression(r.createPropertyAccessExpression(t,"hasOwnProperty"),void 0,[a])))),r.createFunctionDeclaration(void 0,void 0,void 0,n,void 0,[r.createParameterDeclaration(void 0,void 0,void 0,i)],void 0,r.createBlock([r.createVariableStatement(void 0,r.createVariableDeclarationList([r.createVariableDeclaration(o,void 0,void 0,r.createObjectLiteralExpression([]))])),r.createForInStatement(r.createVariableDeclarationList([r.createVariableDeclaration(a)]),i,r.createBlock([e.setEmitFlags(r.createIfStatement(s,r.createExpressionStatement(r.createAssignment(r.createElementAccessExpression(o,a),r.createElementAccessExpression(i,a)))),1)])),r.createExpressionStatement(r.createCallExpression(p,void 0,[o]))],!0))}function T(t,n){for(var i=[],a=0,o=n;a<o.length;a++){for(var s=o[a],c=e.forEach(s.externalImports,(function(t){return e.getLocalNameForExternalImport(r,t,_)})),l=c?r.getGeneratedNameForNode(c):r.createUniqueName(""),u=[],d=0,f=s.externalImports;d<f.length;d++){var g=f[d],m=e.getLocalNameForExternalImport(r,g,_);switch(g.kind){case 265:if(!g.importClause)break;case 264:e.Debug.assert(void 0!==m),u.push(r.createExpressionStatement(r.createAssignment(m,l)));break;case 271:if(e.Debug.assert(void 0!==m),g.exportClause)if(e.isNamedExports(g.exportClause)){for(var y=[],v=0,h=g.exportClause.elements;v<h.length;v++){var b=h[v];y.push(r.createPropertyAssignment(r.createStringLiteral(e.idText(b.name)),r.createElementAccessExpression(l,r.createStringLiteral(e.idText(b.propertyName||b.name)))));}u.push(r.createExpressionStatement(r.createCallExpression(p,void 0,[r.createObjectLiteralExpression(y,!0)])));}else u.push(r.createExpressionStatement(r.createCallExpression(p,void 0,[r.createStringLiteral(e.idText(g.exportClause.name)),l])));else u.push(r.createExpressionStatement(r.createCallExpression(t,void 0,[l])));}}i.push(r.createFunctionExpression(void 0,void 0,void 0,void 0,[r.createParameterDeclaration(void 0,void 0,void 0,l)],void 0,r.createBlock(u,!0)));}return r.createArrayLiteralExpression(i,!0)}function C(t){switch(t.kind){case 265:return function(t){var n;if(t.importClause&&a(e.getLocalNameForExternalImport(r,t,_)),w(t)){var i=e.getOriginalNodeId(t);h[i]=I(h[i],t);}else n=I(n,t);return e.singleOrMany(n)}(t);case 264:return function(t){var n;if(e.Debug.assert(e.isExternalModuleImportEqualsDeclaration(t),"import= for internal module references should be handled in an earlier transformer."),a(e.getLocalNameForExternalImport(r,t,_)),w(t)){var i=e.getOriginalNodeId(t);h[i]=O(h[i],t);}else n=O(n,t);return e.singleOrMany(n)}(t);case 271:return function(t){e.Debug.assertIsDefined(t);}(t);case 270:return function(t){if(!t.isExportEquals){var n=e.visitNode(t.expression,W,e.isExpression),i=t.original;if(!i||!w(i))return J(r.createIdentifier("default"),n,!0);var a=e.getOriginalNodeId(t);h[a]=j(h[a],r.createIdentifier("default"),n,!0);}}(t);default:return U(t)}}function E(t){if(e.isBindingPattern(t.name))for(var n=0,i=t.name.elements;n<i.length;n++){var o=i[n];e.isOmittedExpression(o)||E(o);}else a(r.cloneNode(t.name));}function k(t){return 0==(2097152&e.getEmitFlags(t))&&(303===m.kind||0==(3&e.getOriginalNode(t).flags))}function N(r,n){var i=n?F:A;return e.isBindingPattern(r.name)?e.flattenDestructuringAssignment(r,W,t,0,!1,i):r.initializer?i(r.name,e.visitNode(r.initializer,W,e.isExpression)):r.name}function F(e,t,r){return P(e,t,r,!0)}function A(e,t,r){return P(e,t,r,!1)}function P(t,n,i,o){return a(r.cloneNode(t)),o?z(t,Y(e.setTextRange(r.createAssignment(t,n),i))):Y(e.setTextRange(r.createAssignment(t,n),i))}function w(t){return 0!=(4194304&e.getEmitFlags(t))}function I(e,t){if(d.exportEquals)return e;var r=t.importClause;if(!r)return e;r.name&&(e=B(e,r));var n=r.namedBindings;if(n)switch(n.kind){case 267:e=B(e,n);break;case 268:for(var i=0,a=n.elements;i<a.length;i++)e=B(e,a[i]);}return e}function O(e,t){return d.exportEquals?e:B(e,t)}function M(e,t,r){if(d.exportEquals)return e;for(var n=0,i=t.declarationList.declarations;n<i.length;n++){var a=i[n];(a.initializer||r)&&(e=L(e,a,r));}return e}function L(t,n,i){if(d.exportEquals)return t;if(e.isBindingPattern(n.name))for(var a=0,o=n.name.elements;a<o.length;a++){var s=o[a];e.isOmittedExpression(s)||(t=L(t,s,i));}else if(!e.isGeneratedIdentifier(n.name)){var c=void 0;i&&(t=j(t,n.name,r.getLocalName(n)),c=e.idText(n.name)),t=B(t,n,c);}return t}function R(t,n){if(d.exportEquals)return t;var i;if(e.hasSyntacticModifier(n,1)){var a=e.hasSyntacticModifier(n,512)?r.createStringLiteral("default"):n.name;t=j(t,a,r.getLocalName(n)),i=e.getTextOfIdentifierOrLiteral(a);}return n.name&&(t=B(t,n,i)),t}function B(t,n,i){if(d.exportEquals)return t;var a=r.getDeclarationName(n),o=d.exportSpecifiers.get(e.idText(a));if(o)for(var s=0,c=o;s<c.length;s++){var l=c[s];l.name.escapedText!==i&&(t=j(t,l.name,a));}return t}function j(t,r,n,i){return e.append(t,J(r,n,i))}function J(t,n,i){var a=r.createExpressionStatement(z(t,n));return e.startOnNewLine(a),i||e.setEmitFlags(a,1536),a}function z(t,n){var i=e.isIdentifier(t)?r.createStringLiteralFromNode(t):t;return e.setEmitFlags(n,1536|e.getEmitFlags(n)),e.setCommentRange(r.createCallExpression(p,void 0,[i,n]),n)}function U(n){switch(n.kind){case 236:return function(t){if(!k(t.declarationList))return e.visitNode(t,W,e.isStatement);for(var n,i,a=e.hasSyntacticModifier(t,1),o=w(t),s=0,c=t.declarationList.declarations;s<c.length;s++){var l=c[s];l.initializer?n=e.append(n,N(l,a&&!o)):E(l);}if(n&&(i=e.append(i,e.setTextRange(r.createExpressionStatement(r.inlineExpressions(n)),t))),o){var u=e.getOriginalNodeId(t);h[u]=M(h[u],t,a);}else i=M(i,t,!1);return e.singleOrMany(i)}(n);case 255:return function(n){if(g=e.hasSyntacticModifier(n,1)?e.append(g,r.updateFunctionDeclaration(n,n.decorators,e.visitNodes(n.modifiers,Q,e.isModifier),n.asteriskToken,r.getDeclarationName(n,!0,!0),void 0,e.visitNodes(n.parameters,W,e.isParameterDeclaration),void 0,e.visitNode(n.body,W,e.isBlock))):e.append(g,e.visitEachChild(n,W,t)),w(n)){var i=e.getOriginalNodeId(n);h[i]=R(h[i],n);}else g=R(g,n);}(n);case 256:return function(t){var n,i=r.getLocalName(t);if(a(i),n=e.append(n,e.setTextRange(r.createExpressionStatement(r.createAssignment(i,e.setTextRange(r.createClassExpression(e.visitNodes(t.decorators,W,e.isDecorator),void 0,t.name,void 0,e.visitNodes(t.heritageClauses,W,e.isHeritageClause),e.visitNodes(t.members,W,e.isClassElement)),t))),t)),w(t)){var o=e.getOriginalNodeId(t);h[o]=R(h[o],t);}else n=R(n,t);return e.singleOrMany(n)}(n);case 241:return K(n,!0);case 242:return function(n){var i=m;return m=n,n=r.updateForInStatement(n,V(n.initializer),e.visitNode(n.expression,W,e.isExpression),e.visitIterationBody(n.statement,U,t)),m=i,n}(n);case 243:return function(n){var i=m;return m=n,n=r.updateForOfStatement(n,n.awaitModifier,V(n.initializer),e.visitNode(n.expression,W,e.isExpression),e.visitIterationBody(n.statement,U,t)),m=i,n}(n);case 239:return function(n){return r.updateDoStatement(n,e.visitIterationBody(n.statement,U,t),e.visitNode(n.expression,W,e.isExpression))}(n);case 240:return function(n){return r.updateWhileStatement(n,e.visitNode(n.expression,W,e.isExpression),e.visitIterationBody(n.statement,U,t))}(n);case 249:return function(t){return r.updateLabeledStatement(t,t.label,e.visitNode(t.statement,U,e.isStatement,r.liftToBlock))}(n);case 247:return function(t){return r.updateWithStatement(t,e.visitNode(t.expression,W,e.isExpression),e.visitNode(t.statement,U,e.isStatement,r.liftToBlock))}(n);case 248:return function(t){return r.updateSwitchStatement(t,e.visitNode(t.expression,W,e.isExpression),e.visitNode(t.caseBlock,U,e.isCaseBlock))}(n);case 262:return function(t){var n=m;return m=t,t=r.updateCaseBlock(t,e.visitNodes(t.clauses,U,e.isCaseOrDefaultClause)),m=n,t}(n);case 288:return function(t){return r.updateCaseClause(t,e.visitNode(t.expression,W,e.isExpression),e.visitNodes(t.statements,U,e.isStatement))}(n);case 289:case 251:return function(r){return e.visitEachChild(r,U,t)}(n);case 291:return function(t){var n=m;return m=t,t=r.updateCatchClause(t,t.variableDeclaration,e.visitNode(t.block,U,e.isBlock)),m=n,t}(n);case 234:return function(r){var n=m;return m=r,r=e.visitEachChild(r,U,t),m=n,r}(n);case 350:return function(t){if(w(t)&&236===t.original.kind){var r=e.getOriginalNodeId(t),n=e.hasSyntacticModifier(t.original,1);h[r]=M(h[r],t.original,n);}return t}(n);case 351:return function(t){var r=e.getOriginalNodeId(t),n=h[r];if(n)return delete h[r],e.append(n,t);var i=e.getOriginalNode(t);return e.isModuleOrEnumDeclaration(i)?e.append(B(n,i),t):t}(n);default:return W(n)}}function K(n,i){var a=m;return m=n,n=r.updateForStatement(n,e.visitNode(n.initializer,i?V:H,e.isForInitializer),e.visitNode(n.condition,W,e.isExpression),e.visitNode(n.incrementor,H,e.isExpression),e.visitIterationBody(n.statement,i?U:W,t)),m=a,n}function V(t){if(function(t){return e.isVariableDeclarationList(t)&&k(t)}(t)){for(var n=void 0,i=0,a=t.declarations;i<a.length;i++){var o=a[i];n=e.append(n,N(o,!1)),o.initializer||E(o);}return n?r.inlineExpressions(n):r.createOmittedExpression()}return e.visitNode(t,H,e.isExpression)}function q(n,i){if(!(71305216&n.transformFlags))return n;switch(n.kind){case 241:return K(n,!1);case 237:return function(t){return r.updateExpressionStatement(t,e.visitNode(t.expression,H,e.isExpression))}(n);case 211:return function(t,n){return r.updateParenthesizedExpression(t,e.visitNode(t.expression,n?H:W,e.isExpression))}(n,i);case 348:return function(t,n){return r.updatePartiallyEmittedExpression(t,e.visitNode(t.expression,n?H:W,e.isExpression))}(n,i);case 220:if(e.isDestructuringAssignment(n))return function(r,n){return G(r.left)?e.flattenDestructuringAssignment(r,W,t,0,!n):e.visitEachChild(r,W,t)}(n,i);break;case 207:if(e.isImportCall(n))return function(t){var n=e.getExternalModuleNameLiteral(r,t,_,c,s,o),i=e.visitNode(e.firstOrUndefined(t.arguments),W),a=!n||i&&e.isStringLiteral(i)&&i.text===n.text?i:n;return r.createCallExpression(r.createPropertyAccessExpression(f,r.createIdentifier("import")),void 0,a?[a]:[])}(n);break;case 218:case 219:return function(n,i){if((45===n.operator||46===n.operator)&&e.isIdentifier(n.operand)&&!e.isGeneratedIdentifier(n.operand)&&!e.isLocalName(n.operand)&&!e.isDeclarationNameOfEnumOrNamespace(n.operand)){var o=X(n.operand);if(o){var s=void 0,c=e.visitNode(n.operand,W,e.isExpression);e.isPrefixUnaryExpression(n)?c=r.updatePrefixUnaryExpression(n,c):(c=r.updatePostfixUnaryExpression(n,c),i||(s=r.createTempVariable(a),c=r.createAssignment(s,c),e.setTextRange(c,n)),c=r.createComma(c,r.cloneNode(n.operand)),e.setTextRange(c,n));for(var l=0,u=o;l<u.length;l++)c=z(u[l],Y(c));return s&&(c=r.createComma(c,s),e.setTextRange(c,n)),c}}return e.visitEachChild(n,W,t)}(n,i)}return e.visitEachChild(n,W,t)}function W(e){return q(e,!1)}function H(e){return q(e,!0)}function G(t){if(e.isAssignmentExpression(t,!0))return G(t.left);if(e.isSpreadElement(t))return G(t.expression);if(e.isObjectLiteralExpression(t))return e.some(t.properties,G);if(e.isArrayLiteralExpression(t))return e.some(t.elements,G);if(e.isShorthandPropertyAssignment(t))return G(t.name);if(e.isPropertyAssignment(t))return G(t.initializer);if(e.isIdentifier(t)){var r=s.getReferencedExportContainer(t);return void 0!==r&&303===r.kind}return !1}function Q(e){switch(e.kind){case 93:case 88:return}return e}function X(t){var n;if(!e.isGeneratedIdentifier(t)){var i=s.getReferencedImportDeclaration(t)||s.getReferencedValueDeclaration(t);if(i){var a=s.getReferencedExportContainer(t,!1);a&&303===a.kind&&(n=e.append(n,r.getDeclarationName(i))),n=e.addRange(n,d&&d.exportedBindings[e.getOriginalNodeId(i)]);}}return n}function Y(t){return void 0===y&&(y=[]),y[e.getNodeId(t)]=!0,t}};}(t),function(e){e.transformECMAScriptModule=function(t){var r,i,a,o=t.factory,s=t.getEmitHelperFactory,c=t.getEmitHost(),l=t.getEmitResolver(),u=t.getCompilerOptions(),_=e.getEmitScriptTarget(u),d=t.onEmitNode,p=t.onSubstituteNode;return t.onEmitNode=function(t,n,i){e.isSourceFile(n)?((e.isExternalModule(n)||u.isolatedModules)&&u.importHelpers&&(r=new e.Map),d(t,n,i),r=void 0):d(t,n,i);},t.onSubstituteNode=function(t,n){return n=p(t,n),r&&e.isIdentifier(n)&&4096&e.getEmitFlags(n)?function(t){var n=e.idText(t),i=r.get(n);return i||r.set(n,i=o.createUniqueName(n,48)),i}(n):n},t.enableEmitNotification(303),t.enableSubstitution(79),e.chainBundle(t,(function(r){if(r.isDeclarationFile)return r;if(e.isExternalModule(r)||u.isolatedModules){i=r,a=void 0;var c=function(r){var n=e.createExternalHelpersImportDeclarationIfNeeded(o,s(),r,u);if(n){var i=[],a=o.copyPrologue(r.statements,i);return e.append(i,n),e.addRange(i,e.visitNodes(r.statements,f,e.isStatement,a)),o.updateSourceFile(r,e.setTextRange(o.createNodeArray(i),r.statements))}return e.visitEachChild(r,f,t)}(r);return i=void 0,a&&(c=o.updateSourceFile(c,e.setTextRange(o.createNodeArray(e.insertStatementsAfterCustomPrologue(c.statements.slice(),a)),c.statements))),!e.isExternalModule(r)||e.some(c.statements,e.isExternalModuleIndicator)?c:o.updateSourceFile(c,e.setTextRange(o.createNodeArray(n$3(n$3([],c.statements,!0),[e.createEmptyExports(o)],!1)),c.statements))}return r}));function f(t){switch(t.kind){case 264:return e.getEmitScriptTarget(u)>=e.ModuleKind.ES2020?function(t){var r;return e.Debug.assert(e.isExternalModuleImportEqualsDeclaration(t),"import= for internal module references should be handled in an earlier transformer."),r=function(t,r){return e.hasSyntacticModifier(r,1)&&(t=e.append(t,o.createExportDeclaration(void 0,void 0,r.isTypeOnly,o.createNamedExports([o.createExportSpecifier(!1,void 0,e.idText(r.name))])))),t}(r=e.append(r,e.setOriginalNode(e.setTextRange(o.createVariableStatement(void 0,o.createVariableDeclarationList([o.createVariableDeclaration(o.cloneNode(t.name),void 0,void 0,g(t))],_>=2?2:0)),t),t)),t),e.singleOrMany(r)}(t):void 0;case 270:return function(e){return e.isExportEquals?void 0:e}(t);case 271:return function(t){if(void 0!==u.module&&u.module>e.ModuleKind.ES2015)return t;if(!t.exportClause||!e.isNamespaceExport(t.exportClause)||!t.moduleSpecifier)return t;var r=t.exportClause.name,n=o.getGeneratedNameForNode(r),i=o.createImportDeclaration(void 0,void 0,o.createImportClause(!1,void 0,o.createNamespaceImport(n)),t.moduleSpecifier,t.assertClause);e.setOriginalNode(i,t.exportClause);var a=e.isExportNamespaceAsDefaultDeclaration(t)?o.createExportDefault(n):o.createExportDeclaration(void 0,void 0,!1,o.createNamedExports([o.createExportSpecifier(!1,n,r)]));return e.setOriginalNode(a,t),[i,a]}(t)}return t}function g(t){var r=e.getExternalModuleNameLiteral(o,t,e.Debug.checkDefined(i),c,l,u),n=[];if(r&&n.push(r),!a){var s=o.createUniqueName("_createRequire",48),d=o.createImportDeclaration(void 0,void 0,o.createImportClause(!1,void 0,o.createNamedImports([o.createImportSpecifier(!1,o.createIdentifier("createRequire"),s)])),o.createStringLiteral("module")),p=o.createUniqueName("__require",48),f=o.createVariableStatement(void 0,o.createVariableDeclarationList([o.createVariableDeclaration(p,void 0,void 0,o.createCallExpression(o.cloneNode(s),void 0,[o.createPropertyAccessExpression(o.createMetaProperty(100,o.createIdentifier("meta")),o.createIdentifier("url"))]))],_>=2?2:0));a=[d,f];}var g=a[1].declarationList.declarations[0].name;return e.Debug.assertNode(g,e.isIdentifier),o.createCallExpression(o.cloneNode(g),void 0,n)}};}(t),function(e){e.transformNodeModule=function(t){var r=t.onSubstituteNode,n=t.onEmitNode,i=e.transformECMAScriptModule(t),a=t.onSubstituteNode,o=t.onEmitNode;t.onSubstituteNode=r,t.onEmitNode=n;var s,c=e.transformModule(t),l=t.onSubstituteNode,u=t.onEmitNode;return t.onSubstituteNode=function(t,n){return e.isSourceFile(n)?(s=n,r(t,n)):s?s.impliedNodeFormat===e.ModuleKind.ESNext?a(t,n):l(t,n):r(t,n)},t.onEmitNode=function(t,r,i){return e.isSourceFile(r)&&(s=r),s?s.impliedNodeFormat===e.ModuleKind.ESNext?o(t,r,i):u(t,r,i):n(t,r,i)},t.enableSubstitution(303),t.enableEmitNotification(303),function(r){return 303===r.kind?_(r):function(r){return t.factory.createBundle(e.map(r.sourceFiles,_),r.prepends)}(r)};function _(t){if(t.isDeclarationFile)return t;s=t;var r=(t.impliedNodeFormat===e.ModuleKind.ESNext?i:c)(t);return s=void 0,e.Debug.assert(e.isSourceFile(r)),r}};}(t),function(e){function t(t){return e.isVariableDeclaration(t)||e.isPropertyDeclaration(t)||e.isPropertySignature(t)||e.isPropertyAccessExpression(t)||e.isBindingElement(t)||e.isConstructorDeclaration(t)?r:e.isSetAccessor(t)||e.isGetAccessor(t)?function(r){return {diagnosticMessage:172===t.kind?e.isStatic(t)?r.errorModuleName?e.Diagnostics.Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_private_name_1:r.errorModuleName?e.Diagnostics.Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_private_name_1:e.isStatic(t)?r.errorModuleName?2===r.accessibility?e.Diagnostics.Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:e.Diagnostics.Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_private_name_1:r.errorModuleName?2===r.accessibility?e.Diagnostics.Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:e.Diagnostics.Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Return_type_of_public_getter_0_from_exported_class_has_or_is_using_private_name_1,errorNode:t.name,typeName:t.name}}:e.isConstructSignatureDeclaration(t)||e.isCallSignatureDeclaration(t)||e.isMethodDeclaration(t)||e.isMethodSignature(t)||e.isFunctionDeclaration(t)||e.isIndexSignatureDeclaration(t)?function(r){var n;switch(t.kind){case 174:n=r.errorModuleName?e.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1:e.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0;break;case 173:n=r.errorModuleName?e.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1:e.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0;break;case 175:n=r.errorModuleName?e.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1:e.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0;break;case 168:case 167:n=e.isStatic(t)?r.errorModuleName?2===r.accessibility?e.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named:e.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1:e.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0:256===t.parent.kind?r.errorModuleName?2===r.accessibility?e.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named:e.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1:e.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0:r.errorModuleName?e.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1:e.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0;break;case 255:n=r.errorModuleName?2===r.accessibility?e.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named:e.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1:e.Diagnostics.Return_type_of_exported_function_has_or_is_using_private_name_0;break;default:return e.Debug.fail("This is unknown kind for signature: "+t.kind)}return {diagnosticMessage:n,errorNode:t.name||t}}:e.isParameter(t)?e.isParameterPropertyDeclaration(t,t.parent)&&e.hasSyntacticModifier(t.parent,8)?r:function(r){var n=function(r){switch(t.parent.kind){case 170:return r.errorModuleName?2===r.accessibility?e.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:e.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1;case 174:case 179:return r.errorModuleName?e.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1;case 173:return r.errorModuleName?e.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1;case 175:return r.errorModuleName?e.Diagnostics.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1;case 168:case 167:return e.isStatic(t.parent)?r.errorModuleName?2===r.accessibility?e.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:e.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1:256===t.parent.parent.kind?r.errorModuleName?2===r.accessibility?e.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:e.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1:r.errorModuleName?e.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1;case 255:case 178:return r.errorModuleName?2===r.accessibility?e.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:e.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_private_name_1;case 172:case 171:return r.errorModuleName?2===r.accessibility?e.Diagnostics.Parameter_0_of_accessor_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:e.Diagnostics.Parameter_0_of_accessor_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Parameter_0_of_accessor_has_or_is_using_private_name_1;default:return e.Debug.fail("Unknown parent for parameter: ".concat(e.SyntaxKind[t.parent.kind]))}}(r);return void 0!==n?{diagnosticMessage:n,errorNode:t,typeName:t.name}:void 0}:e.isTypeParameterDeclaration(t)?function(){var r;switch(t.parent.kind){case 256:r=e.Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_private_name_1;break;case 257:r=e.Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1;break;case 194:r=e.Diagnostics.Type_parameter_0_of_exported_mapped_object_type_is_using_private_name_1;break;case 179:case 174:r=e.Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1;break;case 173:r=e.Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1;break;case 168:case 167:r=e.isStatic(t.parent)?e.Diagnostics.Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1:256===t.parent.parent.kind?e.Diagnostics.Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1:e.Diagnostics.Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1;break;case 178:case 255:r=e.Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1;break;case 258:r=e.Diagnostics.Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1;break;default:return e.Debug.fail("This is unknown parent for type parameter: "+t.parent.kind)}return {diagnosticMessage:r,errorNode:t,typeName:t.name}}:e.isExpressionWithTypeArguments(t)?function(){return {diagnosticMessage:e.isClassDeclaration(t.parent.parent)?e.isHeritageClause(t.parent)&&117===t.parent.token?e.Diagnostics.Implements_clause_of_exported_class_0_has_or_is_using_private_name_1:t.parent.parent.name?e.Diagnostics.extends_clause_of_exported_class_0_has_or_is_using_private_name_1:e.Diagnostics.extends_clause_of_exported_class_has_or_is_using_private_name_0:e.Diagnostics.extends_clause_of_exported_interface_0_has_or_is_using_private_name_1,errorNode:t,typeName:e.getNameOfDeclaration(t.parent.parent)}}:e.isImportEqualsDeclaration(t)?function(){return {diagnosticMessage:e.Diagnostics.Import_declaration_0_is_using_private_name_1,errorNode:t,typeName:t.name}}:e.isTypeAliasDeclaration(t)||e.isJSDocTypeAlias(t)?function(r){return {diagnosticMessage:r.errorModuleName?e.Diagnostics.Exported_type_alias_0_has_or_is_using_private_name_1_from_module_2:e.Diagnostics.Exported_type_alias_0_has_or_is_using_private_name_1,errorNode:e.isJSDocTypeAlias(t)?e.Debug.checkDefined(t.typeExpression):t.type,typeName:e.isJSDocTypeAlias(t)?e.getNameOfDeclaration(t):t.name}}:e.Debug.assertNever(t,"Attempted to set a declaration diagnostic context for unhandled node kind: ".concat(e.SyntaxKind[t.kind]));function r(r){var n=function(r){return 253===t.kind||202===t.kind?r.errorModuleName?2===r.accessibility?e.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:e.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Exported_variable_0_has_or_is_using_private_name_1:166===t.kind||205===t.kind||165===t.kind||163===t.kind&&e.hasSyntacticModifier(t.parent,8)?e.isStatic(t)?r.errorModuleName?2===r.accessibility?e.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:e.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1:256===t.parent.kind||163===t.kind?r.errorModuleName?2===r.accessibility?e.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:e.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_private_name_1:r.errorModuleName?e.Diagnostics.Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Property_0_of_exported_interface_has_or_is_using_private_name_1:void 0}(r);return void 0!==n?{diagnosticMessage:n,errorNode:t,typeName:t.name}:void 0}}e.canProduceDiagnostics=function(t){return e.isVariableDeclaration(t)||e.isPropertyDeclaration(t)||e.isPropertySignature(t)||e.isBindingElement(t)||e.isSetAccessor(t)||e.isGetAccessor(t)||e.isConstructSignatureDeclaration(t)||e.isCallSignatureDeclaration(t)||e.isMethodDeclaration(t)||e.isMethodSignature(t)||e.isFunctionDeclaration(t)||e.isParameter(t)||e.isTypeParameterDeclaration(t)||e.isExpressionWithTypeArguments(t)||e.isImportEqualsDeclaration(t)||e.isTypeAliasDeclaration(t)||e.isConstructorDeclaration(t)||e.isIndexSignatureDeclaration(t)||e.isPropertyAccessExpression(t)||e.isJSDocTypeAlias(t)},e.createGetSymbolAccessibilityDiagnosticForNodeName=function(r){return e.isSetAccessor(r)||e.isGetAccessor(r)?function(t){var n=function(t){return e.isStatic(r)?t.errorModuleName?2===t.accessibility?e.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:e.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1:256===r.parent.kind?t.errorModuleName?2===t.accessibility?e.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:e.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_private_name_1:t.errorModuleName?e.Diagnostics.Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Property_0_of_exported_interface_has_or_is_using_private_name_1}(t);return void 0!==n?{diagnosticMessage:n,errorNode:r,typeName:r.name}:void 0}:e.isMethodSignature(r)||e.isMethodDeclaration(r)?function(t){var n=function(t){return e.isStatic(r)?t.errorModuleName?2===t.accessibility?e.Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:e.Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_private_name_1:256===r.parent.kind?t.errorModuleName?2===t.accessibility?e.Diagnostics.Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:e.Diagnostics.Public_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Public_method_0_of_exported_class_has_or_is_using_private_name_1:t.errorModuleName?e.Diagnostics.Method_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Method_0_of_exported_interface_has_or_is_using_private_name_1}(t);return void 0!==n?{diagnosticMessage:n,errorNode:r,typeName:r.name}:void 0}:t(r)},e.createGetSymbolAccessibilityDiagnosticForNode=t;}(t),function(e){function t(t,r){var n=r.text.substring(t.pos,t.end);return e.stringContains(n,"@internal")}function r(r,n){var i=e.getParseTreeNode(r);if(i&&163===i.kind){var a=i.parent.parameters.indexOf(i),o=a>0?i.parent.parameters[a-1]:void 0,s=n.text,c=o?e.concatenate(e.getTrailingCommentRanges(s,e.skipTrivia(s,o.end+1,!1,!0)),e.getLeadingCommentRanges(s,r.pos)):e.getTrailingCommentRanges(s,e.skipTrivia(s,r.pos,!1,!0));return c&&c.length&&t(e.last(c),n)}var l=i&&e.getLeadingCommentRangesOfNode(i,n);return !!e.forEach(l,(function(e){return t(e,n)}))}e.getDeclarationDiagnostics=function(t,r,n){var i=t.getCompilerOptions();return e.transformNodes(r,t,e.factory,i,n?[n]:e.filter(t.getSourceFiles(),e.isSourceFileNotJson),[a],!1).diagnostics},e.isInternalDeclaration=r;var i=531469;function a(t){var a,c,l,u,_,d,p,f,g,m,y,v,h=function(){return e.Debug.fail("Diagnostic emitted without context")},b=h,x=!0,D=!1,S=!1,T=!1,C=!1,E=t.factory,k=t.getEmitHost(),N={trackSymbol:function(e,t,r){if(262144&e.flags)return !1;var n=O(F.isSymbolAccessible(e,t,r,!0));return I(F.getTypeReferenceDirectivesForSymbol(e,r)),n},reportInaccessibleThisError:function(){(p||f)&&t.addDiagnostic(e.createDiagnosticForNode(p||f,e.Diagnostics.The_inferred_type_of_0_references_an_inaccessible_1_type_A_type_annotation_is_necessary,M(),"this"));},reportInaccessibleUniqueSymbolError:function(){(p||f)&&t.addDiagnostic(e.createDiagnosticForNode(p||f,e.Diagnostics.The_inferred_type_of_0_references_an_inaccessible_1_type_A_type_annotation_is_necessary,M(),"unique symbol"));},reportCyclicStructureError:function(){(p||f)&&t.addDiagnostic(e.createDiagnosticForNode(p||f,e.Diagnostics.The_inferred_type_of_0_references_a_type_with_a_cyclic_structure_which_cannot_be_trivially_serialized_A_type_annotation_is_necessary,M()));},reportPrivateInBaseOfClassExpression:function(r){(p||f)&&t.addDiagnostic(e.createDiagnosticForNode(p||f,e.Diagnostics.Property_0_of_exported_class_expression_may_not_be_private_or_protected,r));},reportLikelyUnsafeImportRequiredError:function(r){(p||f)&&t.addDiagnostic(e.createDiagnosticForNode(p||f,e.Diagnostics.The_inferred_type_of_0_cannot_be_named_without_a_reference_to_1_This_is_likely_not_portable_A_type_annotation_is_necessary,M(),r));},reportTruncationError:function(){(p||f)&&t.addDiagnostic(e.createDiagnosticForNode(p||f,e.Diagnostics.The_inferred_type_of_this_node_exceeds_the_maximum_length_the_compiler_will_serialize_An_explicit_type_annotation_is_needed));},moduleResolverHost:k,trackReferencedAmbientModule:function(t,r){var n=F.getTypeReferenceDirectivesForSymbol(r,67108863);if(e.length(n))return I(n);var i=e.getSourceFileOfNode(t);m.set(e.getOriginalNodeId(i),i);},trackExternalModuleSymbolOfImportTypeNode:function(e){D||(d||(d=[])).push(e);},reportNonlocalAugmentation:function(r,n,i){var a,o=null===(a=n.declarations)||void 0===a?void 0:a.find((function(t){return e.getSourceFileOfNode(t)===r})),s=e.filter(i.declarations,(function(t){return e.getSourceFileOfNode(t)!==r}));if(s)for(var c=0,l=s;c<l.length;c++){var u=l[c];t.addDiagnostic(e.addRelatedInfo(e.createDiagnosticForNode(u,e.Diagnostics.Declaration_augments_declaration_in_another_file_This_cannot_be_serialized),e.createDiagnosticForNode(o,e.Diagnostics.This_is_the_declaration_being_augmented_Consider_moving_the_augmenting_declaration_into_the_same_file)));}},reportNonSerializableProperty:function(r){(p||f)&&t.addDiagnostic(e.createDiagnosticForNode(p||f,e.Diagnostics.The_type_of_this_node_cannot_be_serialized_because_its_property_0_cannot_be_serialized,r));}},F=t.getEmitResolver(),A=t.getCompilerOptions(),P=A.noResolve,w=A.stripInternal;return function(r){if(303===r.kind&&r.isDeclarationFile)return r;if(304===r.kind){D=!0,m=new e.Map,y=new e.Map;var i=!1,o=E.createBundle(e.map(r.sourceFiles,(function(r){if(!r.isDeclarationFile){if(i=i||r.hasNoDefaultLib,g=r,a=r,l=void 0,_=!1,u=new e.Map,b=h,T=!1,C=!1,R(r,m),B(r,y),e.isExternalOrCommonJsModule(r)||e.isJsonSourceFile(r)){S=!1,x=!1;var n=e.isSourceFileJS(r)?E.createNodeArray(L(r,!0)):e.visitNodes(r.statements,te);return E.updateSourceFile(r,[E.createModuleDeclaration([],[E.createModifier(135)],E.createStringLiteral(e.getResolvedExternalModuleName(t.getEmitHost(),r)),E.createModuleBlock(e.setTextRange(E.createNodeArray($(n)),r.statements)))],!0,[],[],!1,[])}x=!0;var o=e.isSourceFileJS(r)?E.createNodeArray(L(r)):e.visitNodes(r.statements,te);return E.updateSourceFile(r,$(o),!0,[],[],!1,[])}})),e.mapDefined(r.prepends,(function(t){if(306===t.kind){var r=e.createUnparsedSourceFile(t,"dts",w);return i=i||!!r.hasNoDefaultLib,R(r,m),I(r.typeReferenceDirectives),B(r,y),r}return t})));o.syntheticFileReferences=[],o.syntheticTypeReferences=j(),o.syntheticLibReferences=M(),o.hasNoDefaultLib=i;var s=e.getDirectoryPath(e.normalizeSlashes(e.getOutputPathsFor(r,k,!0).declarationFilePath)),p=z(o.syntheticFileReferences,s);return m.forEach(p),o}x=!0,T=!1,C=!1,a=r,g=r,b=h,D=!1,S=!1,_=!1,l=void 0,u=new e.Map,c=void 0,m=R(g,new e.Map),y=B(g,new e.Map);var f,N=[],F=z(N,e.getDirectoryPath(e.normalizeSlashes(e.getOutputPathsFor(r,k,!0).declarationFilePath)));if(e.isSourceFileJS(g))f=E.createNodeArray(L(r)),m.forEach(F),v=e.filter(f,e.isAnyImportSyntax);else {var P=e.visitNodes(r.statements,te);f=e.setTextRange(E.createNodeArray($(P)),r.statements),m.forEach(F),v=e.filter(f,e.isAnyImportSyntax),e.isExternalModule(r)&&(!S||T&&!C)&&(f=e.setTextRange(E.createNodeArray(n$3(n$3([],f,!0),[e.createEmptyExports(E)],!1)),f));}var O=E.updateSourceFile(r,f,!0,N,j(),r.hasNoDefaultLib,M());return O.exportedModulesFromDeclarationEmit=d,O;function M(){return e.map(e.arrayFrom(y.keys()),(function(e){return {fileName:e,pos:-1,end:-1}}))}function j(){return c?e.mapDefined(e.arrayFrom(c.keys()),J):[]}function J(t){if(v)for(var r=0,n=v;r<n.length;r++){var i=n[r];if(e.isImportEqualsDeclaration(i)&&e.isExternalModuleReference(i.moduleReference)){var a=i.moduleReference.expression;if(e.isStringLiteralLike(a)&&a.text===t)return}else if(e.isImportDeclaration(i)&&e.isStringLiteral(i.moduleSpecifier)&&i.moduleSpecifier.text===t)return}return {fileName:t,pos:-1,end:-1}}function z(t,n){return function(i){var a;if(i.isDeclarationFile)a=i.fileName;else {if(D&&e.contains(r.sourceFiles,i))return;var o=e.getOutputPathsFor(i,k,!0);a=o.declarationFilePath||o.jsFilePath||i.fileName;}if(a){var s=e.moduleSpecifiers.getModuleSpecifier(A,g,e.toPath(n,k.getCurrentDirectory(),k.getCanonicalFileName),e.toPath(a,k.getCurrentDirectory(),k.getCanonicalFileName),k);if(!e.pathIsRelative(s))return void I([s]);var c=e.getRelativePathToDirectoryOrUrl(n,a,k.getCurrentDirectory(),k.getCanonicalFileName,!1);if(e.startsWith(c,"./")&&e.hasExtension(c)&&(c=c.substring(2)),e.startsWith(c,"node_modules/")||e.pathContainsNodeModules(c))return;t.push({pos:-1,end:-1,fileName:c});}}}};function I(t){if(t){c=c||new e.Set;for(var r=0,n=t;r<n.length;r++){var i=n[r];c.add(i);}}}function O(r){if(0===r.accessibility){if(r&&r.aliasesToMakeVisible)if(l)for(var n=0,i=r.aliasesToMakeVisible;n<i.length;n++){var a=i[n];e.pushIfUnique(l,a);}else l=r.aliasesToMakeVisible;}else {var o=b(r);if(o)return o.typeName?t.addDiagnostic(e.createDiagnosticForNode(r.errorNode||o.errorNode,o.diagnosticMessage,e.getTextOfNode(o.typeName),r.errorSymbolName,r.errorModuleName)):t.addDiagnostic(e.createDiagnosticForNode(r.errorNode||o.errorNode,o.diagnosticMessage,r.errorSymbolName,r.errorModuleName)),!0}return !1}function M(){return p?e.declarationNameToString(p):f&&e.getNameOfDeclaration(f)?e.declarationNameToString(e.getNameOfDeclaration(f)):f&&e.isExportAssignment(f)?f.isExportEquals?"export=":"default":"(Missing)"}function L(t,r){var n=b;b=function(r){return r.errorNode&&e.canProduceDiagnostics(r.errorNode)?e.createGetSymbolAccessibilityDiagnosticForNode(r.errorNode)(r):{diagnosticMessage:r.errorModuleName?e.Diagnostics.Declaration_emit_for_this_file_requires_using_private_name_0_from_module_1_An_explicit_type_annotation_may_unblock_declaration_emit:e.Diagnostics.Declaration_emit_for_this_file_requires_using_private_name_0_An_explicit_type_annotation_may_unblock_declaration_emit,errorNode:r.errorNode||t}};var a=F.getDeclarationStatementsForSourceFile(t,i,N,r);return b=n,a}function R(t,r){return P||!e.isUnparsedSource(t)&&e.isSourceFileJS(t)||e.forEach(t.referencedFiles,(function(n){var i=k.getSourceFileFromReference(t,n);i&&r.set(e.getOriginalNodeId(i),i);})),r}function B(t,r){return e.forEach(t.libReferenceDirectives,(function(t){k.getLibFileFromReference(t)&&r.set(e.toFileNameLowerCase(t.fileName),!0);})),r}function j(t){return 79===t.kind?t:201===t.kind?E.updateArrayBindingPattern(t,e.visitNodes(t.elements,r)):E.updateObjectBindingPattern(t,e.visitNodes(t.elements,r));function r(e){return 226===e.kind?e:E.updateBindingElement(e,e.dotDotDotToken,e.propertyName,j(e.name),z(e)?e.initializer:void 0)}}function J(t,r,n){var i;_||(i=b,b=e.createGetSymbolAccessibilityDiagnosticForNode(t));var a=E.updateParameterDeclaration(t,void 0,function(t,r,n){return e.factory.createModifiersFromModifierFlags(o(t,r,void 0))}(t,r),t.dotDotDotToken,j(t.name),F.isOptionalParameter(t)?t.questionToken||E.createToken(57):void 0,K(t,n||t.type,!0),U(t));return _||(b=i),a}function z(t){return function(t){switch(t.kind){case 166:case 165:return !e.hasEffectiveModifier(t,8);case 163:case 253:return !0}return !1}(t)&&F.isLiteralConstDeclaration(e.getParseTreeNode(t))}function U(t){if(z(t))return F.createLiteralConstValue(e.getParseTreeNode(t),N)}function K(t,r,n){if((n||!e.hasEffectiveModifier(t,8))&&!z(t)){var o,s=163===t.kind&&(F.isRequiredInitializedParameter(t)||F.isOptionalUninitializedParameterProperty(t));return r&&!s?e.visitNode(r,ee):e.getParseTreeNode(t)?172===t.kind?E.createKeywordTypeNode(130):(p=t.name,_||(o=b,b=e.createGetSymbolAccessibilityDiagnosticForNode(t)),253===t.kind||202===t.kind?c(F.createTypeOfDeclaration(t,a,i,N)):163===t.kind||166===t.kind||165===t.kind?t.initializer?c(F.createTypeOfDeclaration(t,a,i,N,s)||F.createTypeOfExpression(t.initializer,a,i,N)):c(F.createTypeOfDeclaration(t,a,i,N,s)):c(F.createReturnTypeOfSignatureDeclaration(t,a,i,N))):r?e.visitNode(r,ee):E.createKeywordTypeNode(130)}function c(e){return p=void 0,_||(b=o),e||E.createKeywordTypeNode(130)}}function V(t){switch((t=e.getParseTreeNode(t)).kind){case 255:case 260:case 257:case 256:case 258:case 259:return !F.isDeclarationVisible(t);case 253:return !q(t);case 264:case 265:case 271:case 270:return !1;case 169:return !0}return !1}function q(t){return !e.isOmittedExpression(t)&&(e.isBindingPattern(t.name)?e.some(t.name.elements,q):F.isDeclarationVisible(t))}function W(t,r,n){if(!e.hasEffectiveModifier(t,8)){var i=e.map(r,(function(e){return J(e,n)}));if(i)return E.createNodeArray(i,r.hasTrailingComma)}}function H(t,r){var n;if(!r){var i=e.getThisParameter(t);i&&(n=[J(i)]);}if(e.isSetAccessorDeclaration(t)){var a=void 0;if(!r){var o=e.getSetAccessorValueParameter(t);o&&(a=J(o,void 0,ce(t,F.getAllAccessorDeclarations(t))));}a||(a=E.createParameterDeclaration(void 0,void 0,void 0,"value")),n=e.append(n,a);}return E.createNodeArray(n||e.emptyArray)}function G(t,r){return e.hasEffectiveModifier(t,8)?void 0:e.visitNodes(r,ee)}function Q(t){return e.isSourceFile(t)||e.isTypeAliasDeclaration(t)||e.isModuleDeclaration(t)||e.isClassDeclaration(t)||e.isInterfaceDeclaration(t)||e.isFunctionLike(t)||e.isIndexSignatureDeclaration(t)||e.isMappedTypeNode(t)}function X(e,t){O(F.isEntityNameVisible(e,t)),I(F.getTypeReferenceDirectivesForEntityName(e));}function Y(t,r){return e.hasJSDocNodes(t)&&e.hasJSDocNodes(r)&&(t.jsDoc=r.jsDoc),e.setCommentRange(t,e.getCommentRange(r))}function Z(r,n){if(n){if(S=S||260!==r.kind&&199!==r.kind,e.isStringLiteralLike(n))if(D){var i=e.getExternalModuleNameFromDeclaration(t.getEmitHost(),F,r);if(i)return E.createStringLiteral(i)}else {var a=F.getSymbolOfExternalModuleSpecifier(n);a&&(d||(d=[])).push(a);}return n}}function $(t){for(;e.length(l);){var r=l.shift();if(!e.isLateVisibilityPaintedStatement(r))return e.Debug.fail("Late replaced statement was found which is not handled by the declaration transformer!: ".concat(e.SyntaxKind?e.SyntaxKind[r.kind]:r.kind));var n=x;x=r.parent&&e.isSourceFile(r.parent)&&!(e.isExternalModule(r.parent)&&D);var i=ne(r);x=n,u.set(e.getOriginalNodeId(r),i);}return e.visitNodes(t,(function(t){if(e.isLateVisibilityPaintedStatement(t)){var r=e.getOriginalNodeId(t);if(u.has(r)){var n=u.get(r);return u.delete(r),n&&((e.isArray(n)?e.some(n,e.needsScopeMarker):e.needsScopeMarker(n))&&(T=!0),e.isSourceFile(t.parent)&&(e.isArray(n)?e.some(n,e.isExternalModuleIndicator):e.isExternalModuleIndicator(n))&&(S=!0)),n}}return t}))}function ee(r){if(!ae(r)){if(e.isDeclaration(r)){if(V(r))return;if(e.hasDynamicName(r)&&!F.isLateBound(e.getParseTreeNode(r)))return}if(!(e.isFunctionLike(r)&&F.isImplementationOfOverload(r)||e.isSemicolonClassElement(r))){var n;Q(r)&&(n=a,a=r);var i=b,o=e.canProduceDiagnostics(r),s=_,c=(181===r.kind||194===r.kind)&&258!==r.parent.kind;if((e.isMethodDeclaration(r)||e.isMethodSignature(r))&&e.hasEffectiveModifier(r,8)){if(r.symbol&&r.symbol.declarations&&r.symbol.declarations[0]!==r)return;return h(E.createPropertyDeclaration(void 0,se(r),r.name,void 0,void 0,void 0))}if(o&&!_&&(b=e.createGetSymbolAccessibilityDiagnosticForNode(r)),e.isTypeQueryNode(r)&&X(r.exprName,a),c&&(_=!0),function(e){switch(e.kind){case 174:case 170:case 168:case 171:case 172:case 166:case 165:case 167:case 173:case 175:case 253:case 162:case 227:case 177:case 188:case 178:case 179:case 199:return !0}return !1}(r))switch(r.kind){case 227:(e.isEntityName(r.expression)||e.isEntityNameExpression(r.expression))&&X(r.expression,a);var l=e.visitEachChild(r,ee,t);return h(E.updateExpressionWithTypeArguments(l,l.expression,l.typeArguments));case 177:return X(r.typeName,a),l=e.visitEachChild(r,ee,t),h(E.updateTypeReferenceNode(l,l.typeName,l.typeArguments));case 174:return h(E.updateConstructSignature(r,G(r,r.typeParameters),W(r,r.parameters),K(r,r.type)));case 170:return h(E.createConstructorDeclaration(void 0,se(r),W(r,r.parameters,0),void 0));case 168:return e.isPrivateIdentifier(r.name)?h(void 0):h(E.createMethodDeclaration(void 0,se(r),void 0,r.name,r.questionToken,G(r,r.typeParameters),W(r,r.parameters),K(r,r.type),void 0));case 171:if(e.isPrivateIdentifier(r.name))return h(void 0);var u=ce(r,F.getAllAccessorDeclarations(r));return h(E.updateGetAccessorDeclaration(r,void 0,se(r),r.name,H(r,e.hasEffectiveModifier(r,8)),K(r,u),void 0));case 172:return e.isPrivateIdentifier(r.name)?h(void 0):h(E.updateSetAccessorDeclaration(r,void 0,se(r),r.name,H(r,e.hasEffectiveModifier(r,8)),void 0));case 166:return e.isPrivateIdentifier(r.name)?h(void 0):h(E.updatePropertyDeclaration(r,void 0,se(r),r.name,r.questionToken,K(r,r.type),U(r)));case 165:return e.isPrivateIdentifier(r.name)?h(void 0):h(E.updatePropertySignature(r,se(r),r.name,r.questionToken,K(r,r.type)));case 167:return e.isPrivateIdentifier(r.name)?h(void 0):h(E.updateMethodSignature(r,se(r),r.name,r.questionToken,G(r,r.typeParameters),W(r,r.parameters),K(r,r.type)));case 173:return h(E.updateCallSignature(r,G(r,r.typeParameters),W(r,r.parameters),K(r,r.type)));case 175:return h(E.updateIndexSignature(r,void 0,se(r),W(r,r.parameters),e.visitNode(r.type,ee)||E.createKeywordTypeNode(130)));case 253:return e.isBindingPattern(r.name)?ie(r.name):(c=!0,_=!0,h(E.updateVariableDeclaration(r,r.name,void 0,K(r,r.type),U(r))));case 162:return function(t){return 168===t.parent.kind&&e.hasEffectiveModifier(t.parent,8)}(r)&&(r.default||r.constraint)?h(E.updateTypeParameterDeclaration(r,r.name,void 0,void 0)):h(e.visitEachChild(r,ee,t));case 188:var d=e.visitNode(r.checkType,ee),f=e.visitNode(r.extendsType,ee),m=a;a=r.trueType;var y=e.visitNode(r.trueType,ee);a=m;var v=e.visitNode(r.falseType,ee);return h(E.updateConditionalTypeNode(r,d,f,y,v));case 178:return h(E.updateFunctionTypeNode(r,e.visitNodes(r.typeParameters,ee),W(r,r.parameters),e.visitNode(r.type,ee)));case 179:return h(E.updateConstructorTypeNode(r,se(r),e.visitNodes(r.typeParameters,ee),W(r,r.parameters),e.visitNode(r.type,ee)));case 199:return e.isLiteralImportTypeNode(r)?h(E.updateImportTypeNode(r,E.updateLiteralTypeNode(r.argument,Z(r,r.argument.literal)),r.qualifier,e.visitNodes(r.typeArguments,ee,e.isTypeNode),r.isTypeOf)):h(r);default:e.Debug.assertNever(r,"Attempted to process unhandled node kind: ".concat(e.SyntaxKind[r.kind]));}return e.isTupleTypeNode(r)&&e.getLineAndCharacterOfPosition(g,r.pos).line===e.getLineAndCharacterOfPosition(g,r.end).line&&e.setEmitFlags(r,1),h(e.visitEachChild(r,ee,t))}}function h(t){return t&&o&&e.hasDynamicName(r)&&function(t){var r;_||(r=b,b=e.createGetSymbolAccessibilityDiagnosticForNodeName(t)),p=t.name,e.Debug.assert(F.isLateBound(e.getParseTreeNode(t))),X(t.name.expression,a),_||(b=r),p=void 0;}(r),Q(r)&&(a=n),o&&!_&&(b=i),c&&(_=s),t===r?t:t&&e.setOriginalNode(Y(t,r),r)}}function te(t){if(function(e){switch(e.kind){case 255:case 260:case 264:case 257:case 256:case 258:case 259:case 236:case 265:case 271:case 270:return !0}return !1}(t)&&!ae(t)){switch(t.kind){case 271:return e.isSourceFile(t.parent)&&(S=!0),C=!0,E.updateExportDeclaration(t,void 0,t.modifiers,t.isTypeOnly,t.exportClause,Z(t,t.moduleSpecifier),void 0);case 270:if(e.isSourceFile(t.parent)&&(S=!0),C=!0,79===t.expression.kind)return t;var r=E.createUniqueName("_default",16);b=function(){return {diagnosticMessage:e.Diagnostics.Default_export_of_the_module_has_or_is_using_private_name_0,errorNode:t}},f=t;var n=E.createVariableDeclaration(r,void 0,F.createTypeOfExpression(t.expression,t,i,N),void 0);return f=void 0,[E.createVariableStatement(x?[E.createModifier(135)]:[],E.createVariableDeclarationList([n],2)),E.updateExportAssignment(t,t.decorators,t.modifiers,r)]}var a=ne(t);return u.set(e.getOriginalNodeId(t),a),t}}function re(t){if(e.isImportEqualsDeclaration(t)||e.hasEffectiveModifier(t,512)||!e.canHaveModifiers(t))return t;var r=E.createModifiersFromModifierFlags(27646&e.getEffectiveModifierFlags(t));return E.updateModifiers(t,r)}function ne(t){if(!ae(t)){switch(t.kind){case 264:return function(t){if(F.isDeclarationVisible(t)){if(276===t.moduleReference.kind){var r=e.getExternalModuleImportEqualsDeclarationExpression(t);return E.updateImportEqualsDeclaration(t,void 0,t.modifiers,t.isTypeOnly,t.name,E.updateExternalModuleReference(t.moduleReference,Z(t,r)))}var n=b;return b=e.createGetSymbolAccessibilityDiagnosticForNode(t),X(t.moduleReference,a),b=n,t}}(t);case 265:return function(t){if(!t.importClause)return E.updateImportDeclaration(t,void 0,t.modifiers,t.importClause,Z(t,t.moduleSpecifier),void 0);var r=t.importClause&&t.importClause.name&&F.isDeclarationVisible(t.importClause)?t.importClause.name:void 0;if(!t.importClause.namedBindings)return r&&E.updateImportDeclaration(t,void 0,t.modifiers,E.updateImportClause(t.importClause,t.importClause.isTypeOnly,r,void 0),Z(t,t.moduleSpecifier),void 0);if(267===t.importClause.namedBindings.kind){var n=F.isDeclarationVisible(t.importClause.namedBindings)?t.importClause.namedBindings:void 0;return r||n?E.updateImportDeclaration(t,void 0,t.modifiers,E.updateImportClause(t.importClause,t.importClause.isTypeOnly,r,n),Z(t,t.moduleSpecifier),void 0):void 0}var i=e.mapDefined(t.importClause.namedBindings.elements,(function(e){return F.isDeclarationVisible(e)?e:void 0}));return i&&i.length||r?E.updateImportDeclaration(t,void 0,t.modifiers,E.updateImportClause(t.importClause,t.importClause.isTypeOnly,r,i&&i.length?E.updateNamedImports(t.importClause.namedBindings,i):void 0),Z(t,t.moduleSpecifier),void 0):F.isImportRequiredByAugmentation(t)?E.updateImportDeclaration(t,void 0,t.modifiers,void 0,Z(t,t.moduleSpecifier),void 0):void 0}(t)}if(!(e.isDeclaration(t)&&V(t)||e.isFunctionLike(t)&&F.isImplementationOfOverload(t))){var r;Q(t)&&(r=a,a=t);var o=e.canProduceDiagnostics(t),s=b;o&&(b=e.createGetSymbolAccessibilityDiagnosticForNode(t));var c=x;switch(t.kind){case 258:return ge(E.updateTypeAliasDeclaration(t,void 0,se(t),t.name,e.visitNodes(t.typeParameters,ee,e.isTypeParameterDeclaration),e.visitNode(t.type,ee,e.isTypeNode)));case 257:return ge(E.updateInterfaceDeclaration(t,void 0,se(t),t.name,G(t,t.typeParameters),le(t.heritageClauses),e.visitNodes(t.members,ee)));case 255:var l=ge(E.updateFunctionDeclaration(t,void 0,se(t),void 0,t.name,G(t,t.typeParameters),W(t,t.parameters),K(t,t.type),void 0));if(l&&F.isExpandoFunctionDeclaration(t)&&function(t){var r;if(t.body)return !0;var n=null===(r=t.symbol.declarations)||void 0===r?void 0:r.filter((function(t){return e.isFunctionDeclaration(t)&&!t.body}));return !n||n.indexOf(t)===n.length-1}(t)){var _=F.getPropertiesOfContainerFunction(t),d=e.parseNodeFactory.createModuleDeclaration(void 0,void 0,l.name||E.createIdentifier("_default"),E.createModuleBlock([]),16);e.setParent(d,a),d.locals=e.createSymbolTable(_),d.symbol=_[0].parent;var g=[],m=e.mapDefined(_,(function(t){if(t.valueDeclaration&&e.isPropertyAccessExpression(t.valueDeclaration)){b=e.createGetSymbolAccessibilityDiagnosticForNode(t.valueDeclaration);var r=F.createTypeOfDeclaration(t.valueDeclaration,d,i,N);b=s;var n=e.unescapeLeadingUnderscores(t.escapedName),a=e.isStringANonContextualKeyword(n),o=a?E.getGeneratedNameForNode(t.valueDeclaration):E.createIdentifier(n);a&&g.push([o,n]);var c=E.createVariableDeclaration(o,void 0,r,void 0);return E.createVariableStatement(a?void 0:[E.createToken(93)],E.createVariableDeclarationList([c]))}}));g.length?m.push(E.createExportDeclaration(void 0,void 0,!1,E.createNamedExports(e.map(g,(function(e){var t=e[0],r=e[1];return E.createExportSpecifier(!1,t,r)}))))):m=e.mapDefined(m,(function(e){return E.updateModifiers(e,0)}));var y=E.createModuleDeclaration(void 0,se(t),t.name,E.createModuleBlock(m),16);if(!e.hasEffectiveModifier(l,512))return [l,y];var v=E.createModifiersFromModifierFlags(-514&e.getEffectiveModifierFlags(l)|2),h=E.updateFunctionDeclaration(l,void 0,v,void 0,l.name,l.typeParameters,l.parameters,l.type,void 0),D=E.updateModuleDeclaration(y,void 0,v,y.name,y.body),k=E.createExportAssignment(void 0,void 0,!1,y.name);return e.isSourceFile(t.parent)&&(S=!0),C=!0,[h,D,k]}return l;case 260:x=!1;var A=t.body;if(A&&261===A.kind){var P=T,w=C;C=!1,T=!1;var I=$(e.visitNodes(A.statements,te));8388608&t.flags&&(T=!1),e.isGlobalScopeAugmentation(t)||(fe=I,e.some(fe,oe))||C||(I=T?E.createNodeArray(n$3(n$3([],I,!0),[e.createEmptyExports(E)],!1)):e.visitNodes(I,re));var O=E.updateModuleBlock(A,I);x=c,T=P,C=w;var M=se(t);return ge(E.updateModuleDeclaration(t,void 0,M,e.isExternalModuleAugmentation(t)?Z(t,t.name):t.name,O))}x=c,M=se(t),x=!1,e.visitNode(A,te);var L=e.getOriginalNodeId(A);return O=u.get(L),u.delete(L),ge(E.updateModuleDeclaration(t,void 0,M,t.name,O));case 256:p=t.name,f=t,v=E.createNodeArray(se(t));var R=G(t,t.typeParameters),B=e.getFirstConstructorWithBody(t),j=void 0;if(B){var J=b;j=e.compact(e.flatMap(B.parameters,(function(t){if(e.hasSyntacticModifier(t,16476)&&!ae(t))return b=e.createGetSymbolAccessibilityDiagnosticForNode(t),79===t.name.kind?Y(E.createPropertyDeclaration(void 0,se(t),t.name,t.questionToken,K(t,t.type),U(t)),t):function r(n){for(var i,a=0,o=n.elements;a<o.length;a++){var s=o[a];e.isOmittedExpression(s)||(e.isBindingPattern(s.name)&&(i=e.concatenate(i,r(s.name))),(i=i||[]).push(E.createPropertyDeclaration(void 0,se(t),s.name,void 0,K(s,void 0),void 0)));}return i}(t.name)}))),b=J;}var z=e.some(t.members,(function(t){return !!t.name&&e.isPrivateIdentifier(t.name)}))?[E.createPropertyDeclaration(void 0,void 0,E.createPrivateIdentifier("#private"),void 0,void 0,void 0)]:void 0,H=e.concatenate(e.concatenate(z,j),e.visitNodes(t.members,ee)),ne=E.createNodeArray(H),ie=e.getEffectiveBaseTypeNode(t);if(ie&&!e.isEntityNameExpression(ie.expression)&&104!==ie.expression.kind){var ce=t.name?e.unescapeLeadingUnderscores(t.name.escapedText):"default",ue=E.createUniqueName("".concat(ce,"_base"),16);b=function(){return {diagnosticMessage:e.Diagnostics.extends_clause_of_exported_class_0_has_or_is_using_private_name_1,errorNode:ie,typeName:t.name}};var _e=E.createVariableDeclaration(ue,void 0,F.createTypeOfExpression(ie.expression,t,i,N),void 0),de=E.createVariableStatement(x?[E.createModifier(135)]:[],E.createVariableDeclarationList([_e],2)),pe=E.createNodeArray(e.map(t.heritageClauses,(function(t){if(94===t.token){var r=b;b=e.createGetSymbolAccessibilityDiagnosticForNode(t.types[0]);var n=E.updateHeritageClause(t,e.map(t.types,(function(t){return E.updateExpressionWithTypeArguments(t,ue,e.visitNodes(t.typeArguments,ee))})));return b=r,n}return E.updateHeritageClause(t,e.visitNodes(E.createNodeArray(e.filter(t.types,(function(t){return e.isEntityNameExpression(t.expression)||104===t.expression.kind}))),ee))})));return [de,ge(E.updateClassDeclaration(t,void 0,v,t.name,R,pe,ne))]}return pe=le(t.heritageClauses),ge(E.updateClassDeclaration(t,void 0,v,t.name,R,pe,ne));case 236:return ge(function(t){if(e.forEach(t.declarationList.declarations,q)){var r=e.visitNodes(t.declarationList.declarations,ee);if(e.length(r))return E.updateVariableStatement(t,E.createNodeArray(se(t)),E.updateVariableDeclarationList(t.declarationList,r))}}(t));case 259:return ge(E.updateEnumDeclaration(t,void 0,E.createNodeArray(se(t)),t.name,E.createNodeArray(e.mapDefined(t.members,(function(e){if(!ae(e)){var t=F.getConstantValue(e);return Y(E.updateEnumMember(e,e.name,void 0!==t?"string"==typeof t?E.createStringLiteral(t):E.createNumericLiteral(t):void 0),e)}})))))}return e.Debug.assertNever(t,"Unhandled top-level node in declaration emit: ".concat(e.SyntaxKind[t.kind]))}}var fe;function ge(n){return Q(t)&&(a=r),o&&(b=s),260===t.kind&&(x=c),n===t?n:(f=void 0,p=void 0,n&&e.setOriginalNode(Y(n,t),t))}}function ie(t){return e.flatten(e.mapDefined(t.elements,(function(t){return function(t){if(226!==t.kind&&t.name){if(!q(t))return;return e.isBindingPattern(t.name)?ie(t.name):E.createVariableDeclaration(t.name,void 0,K(t,void 0),void 0)}}(t)})))}function ae(e){return !!w&&!!e&&r(e,g)}function oe(t){return e.isExportAssignment(t)||e.isExportDeclaration(t)}function se(t){var r=e.getEffectiveModifierFlags(t),n=function(t){var r=11003,n=x&&!function(e){return 257===e.kind}(t)?2:0,i=303===t.parent.kind;return (!i||D&&i&&e.isExternalModule(t.parent))&&(r^=2,n=0),o(t,r,n)}(t);return r===n?t.modifiers:E.createModifiersFromModifierFlags(n)}function ce(t,r){var n=s(t);return n||t===r.firstAccessor||(n=s(r.firstAccessor),b=e.createGetSymbolAccessibilityDiagnosticForNode(r.firstAccessor)),!n&&r.secondAccessor&&t!==r.secondAccessor&&(n=s(r.secondAccessor),b=e.createGetSymbolAccessibilityDiagnosticForNode(r.secondAccessor)),n}function le(t){return E.createNodeArray(e.filter(e.map(t,(function(t){return E.updateHeritageClause(t,e.visitNodes(E.createNodeArray(e.filter(t.types,(function(r){return e.isEntityNameExpression(r.expression)||94===t.token&&104===r.expression.kind}))),ee))})),(function(e){return e.types&&!!e.types.length})))}}function o(t,r,n){void 0===r&&(r=27643),void 0===n&&(n=0);var i=e.getEffectiveModifierFlags(t)&r|n;return 512&i&&!(1&i)&&(i^=1),512&i&&2&i&&(i^=2),i}function s(e){if(e)return 171===e.kind?e.type:e.parameters.length>0?e.parameters[0].type:void 0}e.transformDeclarations=a;}(t),function(e){var t,r;function i(t,r,n){if(n)return e.emptyArray;var i=e.getEmitScriptTarget(t),a=e.getEmitModuleKind(t),o=[];return e.addRange(o,r&&e.map(r.before,s)),o.push(e.transformTypeScript),o.push(e.transformClassFields),e.getJSXTransformEnabled(t)&&o.push(e.transformJsx),i<99&&o.push(e.transformESNext),i<8&&o.push(e.transformES2021),i<7&&o.push(e.transformES2020),i<6&&o.push(e.transformES2019),i<5&&o.push(e.transformES2018),i<4&&o.push(e.transformES2017),i<3&&o.push(e.transformES2016),i<2&&(o.push(e.transformES2015),o.push(e.transformGenerators)),o.push(function(t){switch(t){case e.ModuleKind.ESNext:case e.ModuleKind.ES2022:case e.ModuleKind.ES2020:case e.ModuleKind.ES2015:return e.transformECMAScriptModule;case e.ModuleKind.System:return e.transformSystemModule;case e.ModuleKind.Node12:case e.ModuleKind.NodeNext:return e.transformNodeModule;default:return e.transformModule}}(a)),i<1&&o.push(e.transformES5),e.addRange(o,r&&e.map(r.after,s)),o}function a(t){var r=[];return r.push(e.transformDeclarations),e.addRange(r,t&&e.map(t.afterDeclarations,c)),r}function o(t,r){return function(n){var i=t(n);return "function"==typeof i?r(n,i):function(t){return function(r){return e.isBundle(r)?t.transformBundle(r):t.transformSourceFile(r)}}(i)}}function s(t){return o(t,e.chainBundle)}function c(e){return o(e,(function(e,t){return t}))}function l(e,t){return t}function u(e,t,r){r(e,t);}!function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initialized=1]="Initialized",e[e.Completed=2]="Completed",e[e.Disposed=3]="Disposed";}(t||(t={})),function(e){e[e.Substitution=1]="Substitution",e[e.EmitNotifications=2]="EmitNotifications";}(r||(r={})),e.noTransformers={scriptTransformers:e.emptyArray,declarationTransformers:e.emptyArray},e.getTransformers=function(e,t,r){return {scriptTransformers:i(e,t,r),declarationTransformers:a(t)}},e.noEmitSubstitution=l,e.noEmitNotification=u,e.transformNodes=function(t,r,i,a,o,s,c){for(var _,d,p,f,g,m=new Array(353),y=0,v=[],h=[],b=[],x=[],D=0,S=!1,T=[],C=0,E=l,k=u,N=0,F=[],A={factory:i,getCompilerOptions:function(){return a},getEmitResolver:function(){return t},getEmitHost:function(){return r},getEmitHelperFactory:e.memoize((function(){return e.createEmitHelperFactory(A)})),startLexicalEnvironment:function(){e.Debug.assert(N>0,"Cannot modify the lexical environment during initialization."),e.Debug.assert(N<2,"Cannot modify the lexical environment after transformation has completed."),e.Debug.assert(!S,"Lexical environment is suspended."),v[D]=_,h[D]=d,b[D]=p,x[D]=y,D++,_=void 0,d=void 0,p=void 0,y=0;},suspendLexicalEnvironment:function(){e.Debug.assert(N>0,"Cannot modify the lexical environment during initialization."),e.Debug.assert(N<2,"Cannot modify the lexical environment after transformation has completed."),e.Debug.assert(!S,"Lexical environment is already suspended."),S=!0;},resumeLexicalEnvironment:function(){e.Debug.assert(N>0,"Cannot modify the lexical environment during initialization."),e.Debug.assert(N<2,"Cannot modify the lexical environment after transformation has completed."),e.Debug.assert(S,"Lexical environment is not suspended."),S=!1;},endLexicalEnvironment:function(){var t;if(e.Debug.assert(N>0,"Cannot modify the lexical environment during initialization."),e.Debug.assert(N<2,"Cannot modify the lexical environment after transformation has completed."),e.Debug.assert(!S,"Lexical environment is suspended."),_||d||p){if(d&&(t=n$3([],d,!0)),_){var r=i.createVariableStatement(void 0,i.createVariableDeclarationList(_));e.setEmitFlags(r,1048576),t?t.push(r):t=[r];}p&&(t=n$3(t?n$3([],t,!0):[],p,!0));}return D--,_=v[D],d=h[D],p=b[D],y=x[D],0===D&&(v=[],h=[],b=[],x=[]),t},setLexicalEnvironmentFlags:function(e,t){y=t?y|e:y&~e;},getLexicalEnvironmentFlags:function(){return y},hoistVariableDeclaration:function(t){e.Debug.assert(N>0,"Cannot modify the lexical environment during initialization."),e.Debug.assert(N<2,"Cannot modify the lexical environment after transformation has completed.");var r=e.setEmitFlags(i.createVariableDeclaration(t),64);_?_.push(r):_=[r],1&y&&(y|=2);},hoistFunctionDeclaration:function(t){e.Debug.assert(N>0,"Cannot modify the lexical environment during initialization."),e.Debug.assert(N<2,"Cannot modify the lexical environment after transformation has completed."),e.setEmitFlags(t,1048576),d?d.push(t):d=[t];},addInitializationStatement:function(t){e.Debug.assert(N>0,"Cannot modify the lexical environment during initialization."),e.Debug.assert(N<2,"Cannot modify the lexical environment after transformation has completed."),e.setEmitFlags(t,1048576),p?p.push(t):p=[t];},startBlockScope:function(){e.Debug.assert(N>0,"Cannot start a block scope during initialization."),e.Debug.assert(N<2,"Cannot start a block scope after transformation has completed."),T[C]=f,C++,f=void 0;},endBlockScope:function(){e.Debug.assert(N>0,"Cannot end a block scope during initialization."),e.Debug.assert(N<2,"Cannot end a block scope after transformation has completed.");var t=e.some(f)?[i.createVariableStatement(void 0,i.createVariableDeclarationList(f.map((function(e){return i.createVariableDeclaration(e)})),1))]:void 0;return C--,f=T[C],0===C&&(T=[]),t},addBlockScopedVariable:function(t){e.Debug.assert(C>0,"Cannot add a block scoped variable outside of an iteration body."),(f||(f=[])).push(t);},requestEmitHelper:function t(r){if(e.Debug.assert(N>0,"Cannot modify the transformation context during initialization."),e.Debug.assert(N<2,"Cannot modify the transformation context after transformation has completed."),e.Debug.assert(!r.scoped,"Cannot request a scoped emit helper."),r.dependencies)for(var n=0,i=r.dependencies;n<i.length;n++){t(i[n]);}g=e.append(g,r);},readEmitHelpers:function(){e.Debug.assert(N>0,"Cannot modify the transformation context during initialization."),e.Debug.assert(N<2,"Cannot modify the transformation context after transformation has completed.");var t=g;return g=void 0,t},enableSubstitution:function(t){e.Debug.assert(N<2,"Cannot modify the transformation context after transformation has completed."),m[t]|=1;},enableEmitNotification:function(t){e.Debug.assert(N<2,"Cannot modify the transformation context after transformation has completed."),m[t]|=2;},isSubstitutionEnabled:J,isEmitNotificationEnabled:z,get onSubstituteNode(){return E},set onSubstituteNode(t){e.Debug.assert(N<1,"Cannot modify transformation hooks after initialization has completed."),e.Debug.assert(void 0!==t,"Value must not be 'undefined'"),E=t;},get onEmitNode(){return k},set onEmitNode(t){e.Debug.assert(N<1,"Cannot modify transformation hooks after initialization has completed."),e.Debug.assert(void 0!==t,"Value must not be 'undefined'"),k=t;},addDiagnostic:function(e){F.push(e);}},P=0,w=o;P<w.length;P++){var I=w[P];e.disposeEmitNodes(e.getSourceFileOfNode(e.getParseTreeNode(I)));}e.performance.mark("beforeTransform");var O=s.map((function(e){return e(A)})),M=function(e){for(var t=0,r=O;t<r.length;t++)e=(0, r[t])(e);return e};N=1;for(var L=[],R=0,B=o;R<B.length;R++)I=B[R],null===e.tracing||void 0===e.tracing||e.tracing.push("emit","transformNodes",303===I.kind?{path:I.path}:{kind:I.kind,pos:I.pos,end:I.end}),L.push((c?M:j)(I)),null===e.tracing||void 0===e.tracing||e.tracing.pop();return N=2,e.performance.mark("afterTransform"),e.performance.measure("transformTime","beforeTransform","afterTransform"),{transformed:L,substituteNode:function(t,r){return e.Debug.assert(N<3,"Cannot substitute a node after the result is disposed."),r&&J(r)&&E(t,r)||r},emitNodeWithNotification:function(t,r,n){e.Debug.assert(N<3,"Cannot invoke TransformationResult callbacks after the result is disposed."),r&&(z(r)?k(t,r,n):n(t,r));},isEmitNotificationEnabled:z,dispose:function(){if(N<3){for(var t=0,r=o;t<r.length;t++){var n=r[t];e.disposeEmitNodes(e.getSourceFileOfNode(e.getParseTreeNode(n)));}_=void 0,v=void 0,d=void 0,h=void 0,E=void 0,k=void 0,g=void 0,N=3;}},diagnostics:F};function j(t){return !t||e.isSourceFile(t)&&t.isDeclarationFile?t:M(t)}function J(t){return 0!=(1&m[t.kind])&&0==(4&e.getEmitFlags(t))}function z(t){return 0!=(2&m[t.kind])||0!=(2&e.getEmitFlags(t))}},e.nullTransformationContext={factory:e.factory,getCompilerOptions:function(){return {}},getEmitResolver:e.notImplemented,getEmitHost:e.notImplemented,getEmitHelperFactory:e.notImplemented,startLexicalEnvironment:e.noop,resumeLexicalEnvironment:e.noop,suspendLexicalEnvironment:e.noop,endLexicalEnvironment:e.returnUndefined,setLexicalEnvironmentFlags:e.noop,getLexicalEnvironmentFlags:function(){return 0},hoistVariableDeclaration:e.noop,hoistFunctionDeclaration:e.noop,addInitializationStatement:e.noop,startBlockScope:e.noop,endBlockScope:e.returnUndefined,addBlockScopedVariable:e.noop,requestEmitHelper:e.noop,readEmitHelpers:e.notImplemented,enableSubstitution:e.noop,enableEmitNotification:e.noop,isSubstitutionEnabled:e.notImplemented,isEmitNotificationEnabled:e.notImplemented,onSubstituteNode:l,onEmitNode:u,addDiagnostic:e.noop};}(t),function(e){var t,r,i=function(){var e=[];return e[1024]=["{","}"],e[2048]=["(",")"],e[4096]=["<",">"],e[8192]=["[","]"],e}();function a(t,r,n,i,a,s){void 0===i&&(i=!1);var l=e.isArray(n)?n:e.getSourceFilesToEmit(t,n,i),u=t.getCompilerOptions();if(e.outFile(u)){var _=t.getPrependNodes();if(l.length||_.length){var d=e.factory.createBundle(l,_);if(g=r(c(d,t,i),d))return g}}else {if(!a)for(var p=0,f=l;p<f.length;p++){var g,m=f[p];if(g=r(c(m,t,i),m))return g}if(s){var y=o(u);if(y)return r({buildInfoPath:y},void 0)}}}function o(t){var r=t.configFilePath;if(e.isIncrementalCompilation(t)){if(t.tsBuildInfoFile)return t.tsBuildInfoFile;var n,i=e.outFile(t);if(i)n=e.removeFileExtension(i);else {if(!r)return;var a=e.removeFileExtension(r);n=t.outDir?t.rootDir?e.resolvePath(t.outDir,e.getRelativePathFromDirectory(t.rootDir,a,!0)):e.combinePaths(t.outDir,e.getBaseFileName(a)):a;}return n+".tsbuildinfo"}}function s(t,r){var n=e.outFile(t),i=t.emitDeclarationOnly?void 0:n,a=i&&l(i,t),s=r||e.getEmitDeclarations(t)?e.removeFileExtension(n)+".d.ts":void 0;return {jsFilePath:i,sourceMapFilePath:a,declarationFilePath:s,declarationMapPath:s&&e.getAreDeclarationMapsEnabled(t)?s+".map":void 0,buildInfoPath:o(t)}}function c(t,r,n){var i=r.getCompilerOptions();if(304===t.kind)return s(i,n);var a=e.getOwnEmitOutputFilePath(t.fileName,r,u(t.fileName,i)),o=e.isJsonSourceFile(t),c=o&&0===e.comparePaths(t.fileName,a,r.getCurrentDirectory(),!r.useCaseSensitiveFileNames()),_=i.emitDeclarationOnly||c?void 0:a,d=!_||e.isJsonSourceFile(t)?void 0:l(_,i),p=n||e.getEmitDeclarations(i)&&!o?e.getDeclarationEmitOutputFilePath(t.fileName,r):void 0;return {jsFilePath:_,sourceMapFilePath:d,declarationFilePath:p,declarationMapPath:p&&e.getAreDeclarationMapsEnabled(i)?p+".map":void 0,buildInfoPath:void 0}}function l(e,t){return t.sourceMap&&!t.inlineSourceMap?e+".map":void 0}function u(t,r){return e.fileExtensionIs(t,".json")?".json":1===r.jsx&&e.fileExtensionIsOneOf(t,[".jsx",".tsx"])?".jsx":e.fileExtensionIsOneOf(t,[".mts",".mjs"])?".mjs":e.fileExtensionIsOneOf(t,[".cts",".cjs"])?".cjs":".js"}function _(t,r,n,i,a){return i?e.resolvePath(i,e.getRelativePathFromDirectory(a?a():v(r,n),t,n)):t}function d(t,r,n,i){return e.changeExtension(_(t,r,n,r.options.declarationDir||r.options.outDir,i),e.getDeclarationEmitExtensionForPath(t))}function p(t,r,n,i){if(!r.options.emitDeclarationOnly){var a=e.fileExtensionIs(t,".json"),o=e.changeExtension(_(t,r,n,r.options.outDir,i),u(t,r.options));return a&&0===e.comparePaths(t,o,e.Debug.checkDefined(r.options.configFilePath),n)?void 0:o}}function f(){var t;return {addOutput:function(e){e&&(t||(t=[])).push(e);},getOutputs:function(){return t||e.emptyArray}}}function g(e,t){var r=s(e.options,!1),n=r.jsFilePath,i=r.sourceMapFilePath,a=r.declarationFilePath,o=r.declarationMapPath,c=r.buildInfoPath;t(n),t(i),t(a),t(o),t(c);}function m(t,r,n,i,a){if(!e.fileExtensionIs(r,".d.ts")){var o=p(r,t,n,a);if(i(o),!e.fileExtensionIs(r,".json")&&(o&&t.options.sourceMap&&i("".concat(o,".map")),e.getEmitDeclarations(t.options))){var s=d(r,t,n,a);i(s),t.options.declarationMap&&i("".concat(s,".map"));}}}function y(t,r,n,i,a){var o;return t.rootDir?(o=e.getNormalizedAbsolutePath(t.rootDir,n),null==a||a(t.rootDir)):t.composite&&t.configFilePath?(o=e.getDirectoryPath(e.normalizeSlashes(t.configFilePath)),null==a||a(o)):o=e.computeCommonSourceDirectoryOfFilenames(r(),n,i),o&&o[o.length-1]!==e.directorySeparator&&(o+=e.directorySeparator),o}function v(t,r){var n=t.options,i=t.fileNames;return y(n,(function(){return e.filter(i,(function(t){return !(n.noEmitForJsFiles&&e.fileExtensionIsOneOf(t,e.supportedJSExtensionsFlat)||e.fileExtensionIs(t,".d.ts"))}))}),e.getDirectoryPath(e.normalizeSlashes(e.Debug.checkDefined(n.configFilePath))),e.createGetCanonicalFileName(!r))}function h(t,r,n,i,o,s,c){var l,u,_=i.scriptTransformers,d=i.declarationTransformers,p=r.getCompilerOptions(),f=p.sourceMap||p.inlineSourceMap||e.getAreDeclarationMapsEnabled(p)?[]:void 0,g=p.listEmittedFiles?[]:void 0,m=e.createDiagnosticCollection(),y=e.getNewLineCharacter(p,(function(){return r.getNewLine()})),v=e.createTextWriter(y),h=e.performance.createTimer("printTime","beforePrint","afterPrint"),x=h.enter,S=h.exit,T=!1;return x(),a(r,(function(i,a){var s,f=i.jsFilePath,y=i.sourceMapFilePath,v=i.declarationFilePath,h=i.declarationMapPath,x=i.buildInfoPath;function S(t){return e.ensurePathIsNonModuleName(e.getRelativePathFromDirectory(s,t,r.getCanonicalFileName))}x&&a&&e.isBundle(a)&&(s=e.getDirectoryPath(e.getNormalizedAbsolutePath(x,r.getCurrentDirectory())),l={commonSourceDirectory:S(r.getCommonSourceDirectory()),sourceFiles:a.sourceFiles.map((function(t){return S(e.getNormalizedAbsolutePath(t.fileName,r.getCurrentDirectory()))}))}),null===e.tracing||void 0===e.tracing||e.tracing.push("emit","emitJsFileOrBundle",{jsFilePath:f}),function(n,i,a,s){if(n&&!o&&i)if(i&&r.isEmitBlocked(i)||p.noEmit)T=!0;else {var c=e.transformNodes(t,r,e.factory,p,[n],_,!1),u=D({removeComments:p.removeComments,newLine:p.newLine,noEmitHelpers:p.noEmitHelpers,module:p.module,target:p.target,sourceMap:p.sourceMap,inlineSourceMap:p.inlineSourceMap,inlineSources:p.inlineSources,extendedDiagnostics:p.extendedDiagnostics,writeBundleFileInfo:!!l,relativeToBuildInfo:s},{hasGlobalName:t.hasGlobalName,onEmitNode:c.emitNodeWithNotification,isEmitNotificationEnabled:c.isEmitNotificationEnabled,substituteNode:c.substituteNode});e.Debug.assert(1===c.transformed.length,"Should only see one output from the transform"),E(i,a,c.transformed[0],u,p),c.dispose(),l&&(l.js=u.bundleFileInfo);}}(a,f,y,S),null===e.tracing||void 0===e.tracing||e.tracing.pop(),null===e.tracing||void 0===e.tracing||e.tracing.push("emit","emitDeclarationFileOrBundle",{declarationFilePath:v}),function(n,i,a,s){if(n)if(i){var _=e.isSourceFile(n)?[n]:n.sourceFiles,f=c?_:e.filter(_,e.isSourceFileNotJson),g=e.outFile(p)?[e.factory.createBundle(f,e.isSourceFile(n)?void 0:n.prepends)]:f;o&&!e.getEmitDeclarations(p)&&f.forEach(C);var y=e.transformNodes(t,r,e.factory,p,g,d,!1);if(e.length(y.diagnostics))for(var v=0,h=y.diagnostics;v<h.length;v++){var b=h[v];m.add(b);}var x=D({removeComments:p.removeComments,newLine:p.newLine,noEmitHelpers:!0,module:p.module,target:p.target,sourceMap:p.sourceMap,inlineSourceMap:p.inlineSourceMap,extendedDiagnostics:p.extendedDiagnostics,onlyPrintJsDocStyle:!0,writeBundleFileInfo:!!l,recordInternalSection:!!l,relativeToBuildInfo:s},{hasGlobalName:t.hasGlobalName,onEmitNode:y.emitNodeWithNotification,isEmitNotificationEnabled:y.isEmitNotificationEnabled,substituteNode:y.substituteNode}),S=!!y.diagnostics&&!!y.diagnostics.length||!!r.isEmitBlocked(i)||!!p.noEmit;if(T=T||S,(!S||c)&&(e.Debug.assert(1===y.transformed.length,"Should only see one output from the decl transform"),E(i,a,y.transformed[0],x,{sourceMap:!c&&p.declarationMap,sourceRoot:p.sourceRoot,mapRoot:p.mapRoot,extendedDiagnostics:p.extendedDiagnostics}),c&&303===y.transformed[0].kind)){var k=y.transformed[0];u=k.exportedModulesFromDeclarationEmit;}y.dispose(),l&&(l.dts=x.bundleFileInfo);}else (o||p.emitDeclarationOnly)&&(T=!0);}(a,v,h,S),null===e.tracing||void 0===e.tracing||e.tracing.pop(),null===e.tracing||void 0===e.tracing||e.tracing.push("emit","emitBuildInfo",{buildInfoPath:x}),function(t,i){if(i&&!n&&!T){var a=r.getProgramBuildInfo();if(r.isEmitBlocked(i))T=!0;else {var o=e.version;e.writeFile(r,m,i,b({bundle:t,program:a,version:o}),!1);}}}(l,x),null===e.tracing||void 0===e.tracing||e.tracing.pop(),!T&&g&&(o||(f&&g.push(f),y&&g.push(y),x&&g.push(x)),v&&g.push(v),h&&g.push(h));}),e.getSourceFilesToEmit(r,n,c),c,s,!n),S(),{emitSkipped:T,diagnostics:m.getDiagnostics(),emittedFiles:g,sourceMaps:f,exportedModulesFromDeclarationEmit:u};function C(r){e.isExportAssignment(r)?79===r.expression.kind&&t.collectLinkedAliases(r.expression,!0):e.isExportSpecifier(r)?t.collectLinkedAliases(r.propertyName||r.name,!0):e.forEachChild(r,C);}function E(t,n,i,a,o){var s,c=304===i.kind?i:void 0,l=303===i.kind?i:void 0,u=c?c.sourceFiles:[l];if(function(t,r){return (t.sourceMap||t.inlineSourceMap)&&(303!==r.kind||!e.fileExtensionIs(r.fileName,".json"))}(o,i)&&(s=e.createSourceMapGenerator(r,e.getBaseFileName(e.normalizeSlashes(t)),function(t){var r=e.normalizeSlashes(t.sourceRoot||"");return r?e.ensureTrailingDirectorySeparator(r):r}(o),function(t,n,i){if(t.sourceRoot)return r.getCommonSourceDirectory();if(t.mapRoot){var a=e.normalizeSlashes(t.mapRoot);return i&&(a=e.getDirectoryPath(e.getSourceFilePathInNewDir(i.fileName,r,a))),0===e.getRootLength(a)&&(a=e.combinePaths(r.getCommonSourceDirectory(),a)),a}return e.getDirectoryPath(e.normalizePath(n))}(o,t,l),o)),c?a.writeBundle(c,v,s):a.writeFile(l,v,s),s){f&&f.push({inputSourceFileNames:s.getSources(),sourceMap:s.toJSON()});var _=function(t,n,i,a,o){if(t.inlineSourceMap){var s=n.toString(),c=e.base64encode(e.sys,s);return "data:application/json;base64,".concat(c)}var l=e.getBaseFileName(e.normalizeSlashes(e.Debug.checkDefined(a)));if(t.mapRoot){var u=e.normalizeSlashes(t.mapRoot);return o&&(u=e.getDirectoryPath(e.getSourceFilePathInNewDir(o.fileName,r,u))),0===e.getRootLength(u)?(u=e.combinePaths(r.getCommonSourceDirectory(),u),encodeURI(e.getRelativePathToDirectoryOrUrl(e.getDirectoryPath(e.normalizePath(i)),e.combinePaths(u,l),r.getCurrentDirectory(),r.getCanonicalFileName,!0))):encodeURI(e.combinePaths(u,l))}return encodeURI(l)}(o,s,t,n,l);if(_&&(v.isAtStartOfLine()||v.rawWrite(y),v.writeComment("//# ".concat("sourceMappingURL","=").concat(_))),n){var d=s.toString();e.writeFile(r,m,n,d,!1,u);}}else v.writeLine();e.writeFile(r,m,t,v.getText(),!!p.emitBOM,u),v.clear();}}function b(e){return JSON.stringify(e)}function x(e){return JSON.parse(e)}function D(t,r){void 0===t&&(t={}),void 0===r&&(r={});var n,a,o,s,c,l,u,_,d,p,f,g,m,y,v,h,b,x,D,S=r.hasGlobalName,T=r.onEmitNode,C=void 0===T?e.noEmitNotification:T,E=r.isEmitNotificationEnabled,k=r.substituteNode,N=void 0===k?e.noEmitSubstitution:k,F=r.onBeforeEmitNode,A=r.onAfterEmitNode,P=r.onBeforeEmitNodeArray,w=r.onAfterEmitNodeArray,I=r.onBeforeEmitToken,O=r.onAfterEmitToken,M=!!t.extendedDiagnostics,L=e.getNewLineCharacter(t),R=e.getEmitModuleKind(t),B=new e.Map,j=t.preserveSourceNewlines,J=function(e){p.write(e);},z=t.writeBundleFileInfo?{sections:[]}:void 0,U=z?e.Debug.checkDefined(t.relativeToBuildInfo):void 0,K=t.recordInternalSection,V=0,q="text",W=!0,H=-1,G=-1,Q=-1,X=-1,Y=-1,Z=!1,$=!!t.removeComments,ee=e.performance.createTimerIf(M,"commentTime","beforeComment","afterComment"),te=ee.enter,re=ee.exit,ne=e.factory.parenthesizer,ie=function(){return e.createBinaryExpressionTrampoline((function(e,t){if(t){t.stackIndex++,t.preserveSourceNewlinesStack[t.stackIndex]=j,t.containerPosStack[t.stackIndex]=Q,t.containerEndStack[t.stackIndex]=X,t.declarationListContainerEndStack[t.stackIndex]=Y;var r=t.shouldEmitCommentsStack[t.stackIndex]=Ae(e),n=t.shouldEmitSourceMapsStack[t.stackIndex]=Pe(e);null==F||F(e),r&&Nr(e),n&&Qr(e),ke(e);}else t={stackIndex:0,preserveSourceNewlinesStack:[void 0],containerPosStack:[-1],containerEndStack:[-1],declarationListContainerEndStack:[-1],shouldEmitCommentsStack:[!1],shouldEmitSourceMapsStack:[!1]};return t}),(function(e,r,n){return t(e,n,"left")}),(function(e,t,r){var n=27!==e.kind,i=lr(r,r.left,e),a=lr(r,e,r.right);er(i,n),jr(e.pos),Xt(e,101===e.kind?jt:Jt),zr(e.end,!0),er(a,!0);}),(function(e,r,n){return t(e,n,"right")}),(function(e,t){if(tr(lr(e,e.left,e.operatorToken),lr(e,e.operatorToken,e.right)),t.stackIndex>0){var r=t.preserveSourceNewlinesStack[t.stackIndex],n=t.containerPosStack[t.stackIndex],i=t.containerEndStack[t.stackIndex],a=t.declarationListContainerEndStack[t.stackIndex],o=t.shouldEmitCommentsStack[t.stackIndex],s=t.shouldEmitSourceMapsStack[t.stackIndex];Ne(r),s&&Xr(e),o&&Fr(e,n,i,a),null==A||A(e),t.stackIndex--;}}),void 0);function t(t,r,n){var i="left"===n?ne.getParenthesizeLeftSideOfBinaryForOperator(r.operatorToken.kind):ne.getParenthesizeRightSideOfBinaryForOperator(r.operatorToken.kind),a=we(0,1,t);if(a===Re&&(e.Debug.assertIsDefined(x),a=Ie(1,1,t=i(e.cast(x,e.isExpression))),x=void 0),(a===kr||a===Gr||a===Me)&&e.isBinaryExpression(t))return t;D=i,a(1,t);}}();return xe(),{printNode:function(t,r,n){switch(t){case 0:e.Debug.assert(e.isSourceFile(r),"Expected a SourceFile node.");break;case 2:e.Debug.assert(e.isIdentifier(r),"Expected an Identifier node.");break;case 1:e.Debug.assert(e.isExpression(r),"Expected an Expression node.");}switch(r.kind){case 303:return oe(r);case 304:return ae(r);case 305:return i=r,a=me(),o=p,be(a,void 0),ve(4,i,void 0),xe(),p=o,ye()}var i,a,o;return se(t,r,n,me()),ye()},printList:function(e,t,r){return ce(e,t,r,me()),ye()},printFile:oe,printBundle:ae,writeNode:se,writeList:ce,writeFile:ge,writeBundle:fe,bundleFileInfo:z};function ae(e){return fe(e,me(),void 0),ye()}function oe(e){return ge(e,me(),void 0),ye()}function se(e,t,r,n){var i=p;be(n,void 0),ve(e,t,r),xe(),p=i;}function ce(e,t,r,n){var i=p;be(n,void 0),r&&he(r),wt(void 0,t,e),xe(),p=i;}function le(){return p.getTextPosWithWriteLine?p.getTextPosWithWriteLine():p.getTextPos()}function ue(t,r,n){var i=e.lastOrUndefined(z.sections);i&&i.kind===n?i.end=r:z.sections.push({pos:t,end:r,kind:n});}function _e(t){if(K&&z&&n&&(e.isDeclaration(t)||e.isVariableStatement(t))&&e.isInternalDeclaration(t,n)&&"internal"!==q){var r=q;return pe(p.getTextPos()),V=le(),q="internal",r}}function de(e){e&&(pe(p.getTextPos()),V=le(),q=e);}function pe(e){return V<e&&(ue(V,e,q),!0)}function fe(r,n,i){var a;g=!1;var o=p;be(n,i),vt(r),yt(r),Be(r),function(t){pt(!!t.hasNoDefaultLib,t.syntheticFileReferences||[],t.syntheticTypeReferences||[],t.syntheticLibReferences||[]);for(var r=0,n=t.prepends;r<n.length;r++){var i=n[r];if(e.isUnparsedSource(i)&&i.syntheticReferences)for(var a=0,o=i.syntheticReferences;a<o.length;a++)Se(o[a]),Wt();}}(r);for(var s=0,c=r.prepends;s<c.length;s++){var l=c[s];Wt();var u=p.getTextPos(),_=z&&z.sections;if(_&&(z.sections=[]),ve(4,l,void 0),z){var d=z.sections;z.sections=_,l.oldFileOfCurrentEmit?(a=z.sections).push.apply(a,d):(d.forEach((function(t){return e.Debug.assert(e.isBundleFileTextLike(t))})),z.sections.push({pos:u,end:p.getTextPos(),kind:"prepend",data:U(l.fileName),texts:d}));}}V=le();for(var f=0,m=r.sourceFiles;f<m.length;f++){var y=m[f];ve(0,y,y);}if(z&&r.sourceFiles.length&&pe(p.getTextPos())){var v=function(t){for(var r,n=new e.Set,i=0;i<t.sourceFiles.length;i++){for(var a=t.sourceFiles[i],o=void 0,s=0,c=0,l=a.statements;c<l.length;c++){var u=l[c];if(!e.isPrologueDirective(u))break;n.has(u.expression.text)||(n.add(u.expression.text),(o||(o=[])).push({pos:u.pos,end:u.end,expression:{pos:u.expression.pos,end:u.expression.end,text:u.expression.text}}),s=s<u.end?u.end:s);}o&&(r||(r=[])).push({file:i,text:a.text.substring(0,s),directives:o});}return r}(r);v&&(z.sources||(z.sources={}),z.sources.prologues=v);var h=function(r){var n;if(R!==e.ModuleKind.None&&!t.noEmitHelpers){for(var i=new e.Map,a=0,o=r.sourceFiles;a<o.length;a++){var s=o[a],c=void 0!==e.getExternalHelpersModuleName(s),l=je(s);if(l)for(var u=0,_=l;u<_.length;u++){var d=_[u];d.scoped||c||i.get(d.name)||(i.set(d.name,!0),(n||(n=[])).push(d.name));}}return n}}(r);h&&(z.sources||(z.sources={}),z.sources.helpers=h);}xe(),p=o;}function ge(e,t,r){g=!0;var n=p;be(t,r),vt(e),yt(e),ve(0,e,e),xe(),p=n;}function me(){return f||(f=e.createTextWriter(L))}function ye(){var e=f.getText();return f.clear(),e}function ve(e,t,r){r&&he(r),Fe(e,t,void 0);}function he(e){n=e,h=void 0,b=void 0,e&&en(e);}function be(r,n){r&&t.omitTrailingSemicolon&&(r=e.getTrailingSemicolonDeferringWriter(r)),m=n,W=!(p=r)||!m;}function xe(){a=[],o=[],s=new e.Set,c=[],l=0,u=[],n=void 0,h=void 0,b=void 0,be(void 0,void 0);}function De(){return h||(h=e.getLineStarts(n))}function Se(e,t){if(void 0!==e){var r=_e(e);Fe(4,e,t),de(r);}}function Te(e){void 0!==e&&Fe(2,e,void 0);}function Ce(e,t){void 0!==e&&Fe(1,e,t);}function Ee(t){Fe(e.isStringLiteral(t)?6:4,t);}function ke(t){j&&134217728&e.getEmitFlags(t)&&(j=!1);}function Ne(e){j=e;}function Fe(e,t,r){D=r,we(0,e,t)(e,t),D=void 0;}function Ae(t){return !$&&!e.isSourceFile(t)}function Pe(t){return !(W||e.isSourceFile(t)||e.isInJsonFile(t)||e.isUnparsedSource(t)||e.isUnparsedPrepend(t))}function we(t,r,n){switch(t){case 0:if(C!==e.noEmitNotification&&(!E||E(n)))return Oe;case 1:if(N!==e.noEmitSubstitution&&(x=N(r,n)||n)!==n)return D&&(x=D(x)),Re;case 2:if(Ae(n))return kr;case 3:if(Pe(n))return Gr;case 4:return Me;default:return e.Debug.assertNever(t)}}function Ie(e,t,r){return we(e+1,t,r)}function Oe(e,t){var r=Ie(0,e,t);C(e,t,r);}function Me(e,t){if(null==F||F(t),j){var r=j;ke(t),Le(e,t),Ne(r);}else Le(e,t);null==A||A(t),D=void 0;}function Le(t,r,i){if(void 0===i&&(i=!0),i){var a=e.getSnippetElement(r);if(a)return function(e,t,r){switch(r.kind){case 1:!function(e,t,r){qt("${".concat(r.order,":")),Le(e,t,!1),qt("}");}(e,t,r);break;case 0:!function(e){qt("$".concat(e.order));}(r);}}(t,r,a)}if(0===t)return dt(e.cast(r,e.isSourceFile));if(2===t)return Ue(e.cast(r,e.isIdentifier));if(6===t)return Je(e.cast(r,e.isStringLiteral),!0);if(3===t)return function(e){Se(e.name),Kt(),jt("in"),Kt(),Se(e.constraint);}(e.cast(r,e.isTypeParameterDeclaration));if(5===t)return e.Debug.assertNode(r,e.isEmptyStatement),We(!0);if(4===t){switch(r.kind){case 15:case 16:case 17:return Je(r,!1);case 79:return Ue(r);case 80:return Ke(r);case 160:return function(e){(function(e){79===e.kind?Ce(e):Se(e);})(e.left),Rt("."),Se(e.right);}(r);case 161:return function(e){Rt("["),Ce(e.expression,ne.parenthesizeExpressionOfComputedPropertyName),Rt("]");}(r);case 162:return function(e){Se(e.name),e.constraint&&(Kt(),jt("extends"),Kt(),Se(e.constraint)),e.default&&(Kt(),Jt("="),Kt(),Se(e.default));}(r);case 163:return function(e){Et(e,e.decorators),bt(e,e.modifiers),Se(e.dotDotDotToken),ht(e.name,zt),Se(e.questionToken),e.parent&&315===e.parent.kind&&!e.name?Se(e.type):xt(e.type),Dt(e.initializer,e.type?e.type.end:e.questionToken?e.questionToken.end:e.name?e.name.end:e.modifiers?e.modifiers.end:e.decorators?e.decorators.end:e.pos,e,ne.parenthesizeExpressionForDisallowedComma);}(r);case 164:return _=r,Rt("@"),void Ce(_.expression,ne.parenthesizeLeftSideOfAccess);case 165:return function(e){Et(e,e.decorators),bt(e,e.modifiers),ht(e.name,Vt),Se(e.questionToken),xt(e.type),Bt();}(r);case 166:return function(e){Et(e,e.decorators),bt(e,e.modifiers),Se(e.name),Se(e.questionToken),Se(e.exclamationToken),xt(e.type),Dt(e.initializer,e.type?e.type.end:e.questionToken?e.questionToken.end:e.name.end,e),Bt();}(r);case 167:return function(e){fr(e),Et(e,e.decorators),bt(e,e.modifiers),Se(e.name),Se(e.questionToken),Nt(e,e.typeParameters),Ft(e,e.parameters),xt(e.type),Bt(),gr(e);}(r);case 168:return function(e){Et(e,e.decorators),bt(e,e.modifiers),Se(e.asteriskToken),Se(e.name),Se(e.questionToken),Ye(e,Ze);}(r);case 169:return function(e){Et(e,e.decorators),bt(e,e.modifiers),jt("static"),$e(e.body);}(r);case 170:return function(e){bt(e,e.modifiers),jt("constructor"),Ye(e,Ze);}(r);case 171:case 172:return function(e){Et(e,e.decorators),bt(e,e.modifiers),jt(171===e.kind?"get":"set"),Kt(),Se(e.name),Ye(e,Ze);}(r);case 173:return function(e){fr(e),Et(e,e.decorators),bt(e,e.modifiers),Nt(e,e.typeParameters),Ft(e,e.parameters),xt(e.type),Bt(),gr(e);}(r);case 174:return function(e){fr(e),Et(e,e.decorators),bt(e,e.modifiers),jt("new"),Kt(),Nt(e,e.typeParameters),Ft(e,e.parameters),xt(e.type),Bt(),gr(e);}(r);case 175:return function(e){Et(e,e.decorators),bt(e,e.modifiers),wt(e,e.parameters,8848),xt(e.type),Bt();}(r);case 176:return function(e){e.assertsModifier&&(Se(e.assertsModifier),Kt()),Se(e.parameterName),e.type&&(Kt(),jt("is"),Kt(),Se(e.type));}(r);case 177:return function(e){Se(e.typeName),kt(e,e.typeArguments);}(r);case 178:return function(e){fr(e),Nt(e,e.typeParameters),At(e,e.parameters),Kt(),Rt("=>"),Kt(),Se(e.type),gr(e);}(r);case 179:return function(e){fr(e),bt(e,e.modifiers),jt("new"),Kt(),Nt(e,e.typeParameters),Ft(e,e.parameters),Kt(),Rt("=>"),Kt(),Se(e.type),gr(e);}(r);case 180:return function(e){jt("typeof"),Kt(),Se(e.exprName);}(r);case 181:return function(t){Rt("{");var r=1&e.getEmitFlags(t)?768:32897;wt(t,t.members,524288|r),Rt("}");}(r);case 182:return function(e){Se(e.elementType,ne.parenthesizeElementTypeOfArrayType),Rt("["),Rt("]");}(r);case 183:return function(t){Qe(22,t.pos,Rt,t);var r=1&e.getEmitFlags(t)?528:657;wt(t,t.elements,524288|r),Qe(23,t.elements.end,Rt,t);}(r);case 184:return function(e){Se(e.type,ne.parenthesizeElementTypeOfArrayType),Rt("?");}(r);case 186:return function(e){wt(e,e.types,516,ne.parenthesizeMemberOfElementType);}(r);case 187:return function(e){wt(e,e.types,520,ne.parenthesizeMemberOfElementType);}(r);case 188:return function(e){Se(e.checkType,ne.parenthesizeMemberOfConditionalType),Kt(),jt("extends"),Kt(),Se(e.extendsType,ne.parenthesizeMemberOfConditionalType),Kt(),Rt("?"),Kt(),Se(e.trueType),Kt(),Rt(":"),Kt(),Se(e.falseType);}(r);case 189:return function(e){jt("infer"),Kt(),Se(e.typeParameter);}(r);case 190:return function(e){Rt("("),Se(e.type),Rt(")");}(r);case 227:return function(e){Ce(e.expression,ne.parenthesizeLeftSideOfAccess),kt(e,e.typeArguments);}(r);case 191:return void jt("this");case 192:return function(e){Yt(e.operator,jt),Kt(),Se(e.type,ne.parenthesizeMemberOfElementType);}(r);case 193:return function(e){Se(e.objectType,ne.parenthesizeMemberOfElementType),Rt("["),Se(e.indexType),Rt("]");}(r);case 194:return function(t){var r=e.getEmitFlags(t);Rt("{"),1&r?Kt():(Wt(),Ht()),t.readonlyToken&&(Se(t.readonlyToken),144!==t.readonlyToken.kind&&jt("readonly"),Kt()),Rt("["),Fe(3,t.typeParameter),t.nameType&&(Kt(),jt("as"),Kt(),Se(t.nameType)),Rt("]"),t.questionToken&&(Se(t.questionToken),57!==t.questionToken.kind&&Rt("?")),Rt(":"),Kt(),Se(t.type),Bt(),1&r?Kt():(Wt(),Gt()),Rt("}");}(r);case 195:return function(e){Ce(e.literal);}(r);case 196:return function(e){Se(e.dotDotDotToken),Se(e.name),Se(e.questionToken),Qe(58,e.name.end,Rt,e),Kt(),Se(e.type);}(r);case 197:return function(e){Se(e.head),wt(e,e.templateSpans,262144);}(r);case 198:return function(e){Se(e.type),Se(e.literal);}(r);case 199:return function(e){e.isTypeOf&&(jt("typeof"),Kt()),jt("import"),Rt("("),Se(e.argument),Rt(")"),e.qualifier&&(Rt("."),Se(e.qualifier)),kt(e,e.typeArguments);}(r);case 200:return function(e){Rt("{"),wt(e,e.elements,525136),Rt("}");}(r);case 201:return function(e){Rt("["),wt(e,e.elements,524880),Rt("]");}(r);case 202:return function(e){Se(e.dotDotDotToken),e.propertyName&&(Se(e.propertyName),Rt(":"),Kt()),Se(e.name),Dt(e.initializer,e.name.end,e,ne.parenthesizeExpressionForDisallowedComma);}(r);case 232:return function(e){Ce(e.expression),Se(e.literal);}(r);case 233:return void Bt();case 234:return function(e){qe(e,!e.multiLine&&ur(e));}(r);case 236:return function(e){bt(e,e.modifiers),Se(e.declarationList),Bt();}(r);case 235:return We(!1);case 237:return function(t){Ce(t.expression,ne.parenthesizeExpressionOfExpressionStatement),(!e.isJsonSourceFile(n)||e.nodeIsSynthesized(t.expression))&&Bt();}(r);case 238:return function(e){var t=Qe(99,e.pos,jt,e);Kt(),Qe(20,t,Rt,e),Ce(e.expression),Qe(21,e.expression.end,Rt,e),Ct(e,e.thenStatement),e.elseStatement&&(Zt(e,e.thenStatement,e.elseStatement),Qe(91,e.thenStatement.end,jt,e),238===e.elseStatement.kind?(Kt(),Se(e.elseStatement)):Ct(e,e.elseStatement));}(r);case 239:return function(t){Qe(90,t.pos,jt,t),Ct(t,t.statement),e.isBlock(t.statement)&&!j?Kt():Zt(t,t.statement,t.expression),He(t,t.statement.end),Bt();}(r);case 240:return function(e){He(e,e.pos),Ct(e,e.statement);}(r);case 241:return function(e){var t=Qe(97,e.pos,jt,e);Kt();var r=Qe(20,t,Rt,e);Ge(e.initializer),r=Qe(26,e.initializer?e.initializer.end:r,Rt,e),Tt(e.condition),r=Qe(26,e.condition?e.condition.end:r,Rt,e),Tt(e.incrementor),Qe(21,e.incrementor?e.incrementor.end:r,Rt,e),Ct(e,e.statement);}(r);case 242:return function(e){var t=Qe(97,e.pos,jt,e);Kt(),Qe(20,t,Rt,e),Ge(e.initializer),Kt(),Qe(101,e.initializer.end,jt,e),Kt(),Ce(e.expression),Qe(21,e.expression.end,Rt,e),Ct(e,e.statement);}(r);case 243:return function(e){var t=Qe(97,e.pos,jt,e);Kt(),function(e){e&&(Se(e),Kt());}(e.awaitModifier),Qe(20,t,Rt,e),Ge(e.initializer),Kt(),Qe(159,e.initializer.end,jt,e),Kt(),Ce(e.expression),Qe(21,e.expression.end,Rt,e),Ct(e,e.statement);}(r);case 244:return function(e){Qe(86,e.pos,jt,e),St(e.label),Bt();}(r);case 245:return function(e){Qe(81,e.pos,jt,e),St(e.label),Bt();}(r);case 246:return function(e){Qe(105,e.pos,jt,e),Tt(e.expression),Bt();}(r);case 247:return function(e){var t=Qe(116,e.pos,jt,e);Kt(),Qe(20,t,Rt,e),Ce(e.expression),Qe(21,e.expression.end,Rt,e),Ct(e,e.statement);}(r);case 248:return function(e){var t=Qe(107,e.pos,jt,e);Kt(),Qe(20,t,Rt,e),Ce(e.expression),Qe(21,e.expression.end,Rt,e),Kt(),Se(e.caseBlock);}(r);case 249:return function(e){Se(e.label),Qe(58,e.label.end,Rt,e),Kt(),Se(e.statement);}(r);case 250:return function(e){Qe(109,e.pos,jt,e),Tt(e.expression),Bt();}(r);case 251:return function(e){Qe(111,e.pos,jt,e),Kt(),Se(e.tryBlock),e.catchClause&&(Zt(e,e.tryBlock,e.catchClause),Se(e.catchClause)),e.finallyBlock&&(Zt(e,e.catchClause||e.tryBlock,e.finallyBlock),Qe(96,(e.catchClause||e.tryBlock).end,jt,e),Kt(),Se(e.finallyBlock));}(r);case 252:return function(e){Qt(87,e.pos,jt),Bt();}(r);case 253:return function(e){Se(e.name),Se(e.exclamationToken),xt(e.type),Dt(e.initializer,e.type?e.type.end:e.name.end,e,ne.parenthesizeExpressionForDisallowedComma);}(r);case 254:return function(t){jt(e.isLet(t)?"let":e.isVarConst(t)?"const":"var"),Kt(),wt(t,t.declarations,528);}(r);case 255:return function(e){Xe(e);}(r);case 256:return function(e){rt(e);}(r);case 257:return function(e){Et(e,e.decorators),bt(e,e.modifiers),jt("interface"),Kt(),Se(e.name),Nt(e,e.typeParameters),wt(e,e.heritageClauses,512),Kt(),Rt("{"),wt(e,e.members,129),Rt("}");}(r);case 258:return function(e){Et(e,e.decorators),bt(e,e.modifiers),jt("type"),Kt(),Se(e.name),Nt(e,e.typeParameters),Kt(),Rt("="),Kt(),Se(e.type),Bt();}(r);case 259:return function(e){bt(e,e.modifiers),jt("enum"),Kt(),Se(e.name),Kt(),Rt("{"),wt(e,e.members,145),Rt("}");}(r);case 260:return function(t){bt(t,t.modifiers),1024&~t.flags&&(jt(16&t.flags?"namespace":"module"),Kt()),Se(t.name);var r=t.body;if(!r)return Bt();for(;r&&e.isModuleDeclaration(r);)Rt("."),Se(r.name),r=r.body;Kt(),Se(r);}(r);case 261:return function(t){fr(t),e.forEach(t.statements,yr),qe(t,ur(t)),gr(t);}(r);case 262:return function(e){Qe(18,e.pos,Rt,e),wt(e,e.clauses,129),Qe(19,e.clauses.end,Rt,e,!0);}(r);case 263:return function(e){var t=Qe(93,e.pos,jt,e);Kt(),t=Qe(127,t,jt,e),Kt(),t=Qe(142,t,jt,e),Kt(),Se(e.name),Bt();}(r);case 264:return function(e){bt(e,e.modifiers),Qe(100,e.modifiers?e.modifiers.end:e.pos,jt,e),Kt(),e.isTypeOnly&&(Qe(151,e.pos,jt,e),Kt()),Se(e.name),Kt(),Qe(63,e.name.end,Rt,e),Kt(),function(e){79===e.kind?Ce(e):Se(e);}(e.moduleReference),Bt();}(r);case 265:return function(e){bt(e,e.modifiers),Qe(100,e.modifiers?e.modifiers.end:e.pos,jt,e),Kt(),e.importClause&&(Se(e.importClause),Kt(),Qe(155,e.importClause.end,jt,e),Kt()),Ce(e.moduleSpecifier),e.assertClause&&St(e.assertClause),Bt();}(r);case 266:return function(e){e.isTypeOnly&&(Qe(151,e.pos,jt,e),Kt()),Se(e.name),e.name&&e.namedBindings&&(Qe(27,e.name.end,Rt,e),Kt()),Se(e.namedBindings);}(r);case 267:return function(e){var t=Qe(41,e.pos,Rt,e);Kt(),Qe(127,t,jt,e),Kt(),Se(e.name);}(r);case 273:return function(e){var t=Qe(41,e.pos,Rt,e);Kt(),Qe(127,t,jt,e),Kt(),Se(e.name);}(r);case 268:return function(e){nt(e);}(r);case 269:return function(e){it(e);}(r);case 270:return function(e){var t=Qe(93,e.pos,jt,e);Kt(),e.isExportEquals?Qe(63,t,Jt,e):Qe(88,t,jt,e),Kt(),Ce(e.expression,e.isExportEquals?ne.getParenthesizeRightSideOfBinaryForOperator(63):ne.parenthesizeExpressionOfExportDefault),Bt();}(r);case 271:return function(e){var t=Qe(93,e.pos,jt,e);Kt(),e.isTypeOnly&&(t=Qe(151,t,jt,e),Kt()),e.exportClause?Se(e.exportClause):t=Qe(41,t,Rt,e),e.moduleSpecifier&&(Kt(),Qe(155,e.exportClause?e.exportClause.end:t,jt,e),Kt(),Ce(e.moduleSpecifier)),e.assertClause&&St(e.assertClause),Bt();}(r);case 272:return function(e){nt(e);}(r);case 274:return function(e){it(e);}(r);case 292:return function(e){Qe(129,e.pos,jt,e),Kt(),wt(e,e.elements,526226);}(r);case 293:return function(t){Se(t.name),Rt(":"),Kt();var r=t.value;0==(512&e.getEmitFlags(r))&&zr(e.getCommentRange(r).pos),Se(r);}(r);case 275:return;case 276:return function(e){jt("require"),Rt("("),Ce(e.expression),Rt(")");}(r);case 11:return function(e){p.writeLiteral(e.text);}(r);case 279:case 282:return function(t){if(Rt("<"),e.isJsxOpeningElement(t)){var r=or(t.tagName,t);at(t.tagName),kt(t,t.typeArguments),t.attributes.properties&&t.attributes.properties.length>0&&Kt(),Se(t.attributes),sr(t.attributes,t),tr(r);}Rt(">");}(r);case 280:case 283:return function(t){Rt("</"),e.isJsxClosingElement(t)&&at(t.tagName),Rt(">");}(r);case 284:return function(e){Se(e.name),function(e,t,r,n){r&&(t("="),n(r));}(0,Rt,e.initializer,Ee);}(r);case 285:return function(e){wt(e,e.properties,262656);}(r);case 286:return function(e){Rt("{..."),Ce(e.expression),Rt("}");}(r);case 287:return function(t){var r,i;if(t.expression||!$&&!e.nodeIsSynthesized(t)&&(function(t){var r=!1;return e.forEachTrailingCommentRange((null==n?void 0:n.text)||"",t+1,(function(){return r=!0})),r}(i=t.pos)||function(t){var r=!1;return e.forEachLeadingCommentRange((null==n?void 0:n.text)||"",t+1,(function(){return r=!0})),r}(i))){var a=n&&!e.nodeIsSynthesized(t)&&e.getLineAndCharacterOfPosition(n,t.pos).line!==e.getLineAndCharacterOfPosition(n,t.end).line;a&&p.increaseIndent();var o=Qe(18,t.pos,Rt,t);Se(t.dotDotDotToken),Ce(t.expression),Qe(19,(null===(r=t.expression)||void 0===r?void 0:r.end)||o,Rt,t),a&&p.decreaseIndent();}}(r);case 288:return function(e){Qe(82,e.pos,jt,e),Kt(),Ce(e.expression,ne.parenthesizeExpressionForDisallowedComma),ot(e,e.statements,e.expression.end);}(r);case 289:return function(e){var t=Qe(88,e.pos,jt,e);ot(e,e.statements,t);}(r);case 290:return function(e){Kt(),Yt(e.token,jt),Kt(),wt(e,e.types,528);}(r);case 291:return function(e){var t=Qe(83,e.pos,jt,e);Kt(),e.variableDeclaration&&(Qe(20,t,Rt,e),Se(e.variableDeclaration),Qe(21,e.variableDeclaration.end,Rt,e),Kt()),Se(e.block);}(r);case 294:return function(t){Se(t.name),Rt(":"),Kt();var r=t.initializer;0==(512&e.getEmitFlags(r))&&zr(e.getCommentRange(r).pos),Ce(r,ne.parenthesizeExpressionForDisallowedComma);}(r);case 295:return function(e){Se(e.name),e.objectAssignmentInitializer&&(Kt(),Rt("="),Kt(),Ce(e.objectAssignmentInitializer,ne.parenthesizeExpressionForDisallowedComma));}(r);case 296:return function(e){e.expression&&(Qe(25,e.pos,Rt,e),Ce(e.expression,ne.parenthesizeExpressionForDisallowedComma));}(r);case 297:return function(e){Se(e.name),Dt(e.initializer,e.name.end,e,ne.parenthesizeExpressionForDisallowedComma);}(r);case 298:return ze(r);case 305:case 299:return function(e){for(var t=0,r=e.texts;t<r.length;t++){var n=r[t];Wt(),Se(n);}}(r);case 300:case 301:return l=r,u=le(),ze(l),void(z&&ue(u,p.getTextPos(),300===l.kind?"text":"internal"));case 302:return function(t){var r=le();if(ze(t),z){var n=e.clone(t.section);n.pos=r,n.end=p.getTextPos(),z.sections.push(n);}}(r);case 303:return dt(r);case 304:return e.Debug.fail("Bundles should be printed using printBundle");case 306:return e.Debug.fail("InputFiles should not be printed");case 307:return _t(r);case 308:return function(e){Kt(),Rt("{"),Se(e.name),Rt("}");}(r);case 310:return Rt("*");case 311:return Rt("?");case 312:return function(e){Rt("?"),Se(e.type);}(r);case 313:return function(e){Rt("!"),Se(e.type);}(r);case 314:return function(e){Se(e.type),Rt("=");}(r);case 315:return function(e){jt("function"),Ft(e,e.parameters),Rt(":"),Se(e.type);}(r);case 185:case 316:return function(e){Rt("..."),Se(e.type);}(r);case 317:return;case 318:return function(t){if(J("/**"),t.comment){var r=e.getTextOfJSDocComment(t.comment);if(r)for(var n=0,i=r.split(/\r\n?|\n/g);n<i.length;n++){var a=i[n];Wt(),Kt(),Rt("*"),Kt(),J(a);}}t.tags&&(1!==t.tags.length||341!==t.tags[0].kind||t.comment?wt(t,t.tags,33):(Kt(),Se(t.tags[0]))),Kt(),J("*/");}(r);case 320:return st(r);case 321:return ct(r);case 325:case 330:return lt((c=r).tagName),void ut(c.comment);case 326:case 327:return function(e){lt(e.tagName),Kt(),Rt("{"),Se(e.class),Rt("}"),ut(e.comment);}(r);case 328:case 329:return;case 331:case 332:case 333:case 334:case 335:return;case 336:return function(e){lt(e.tagName),e.name&&(Kt(),Se(e.name)),ut(e.comment),ct(e.typeExpression);}(r);case 338:case 345:return lt((s=r).tagName),_t(s.typeExpression),Kt(),s.isBracketed&&Rt("["),Se(s.name),s.isBracketed&&Rt("]"),void ut(s.comment);case 337:case 339:case 340:case 341:return function(e){lt(e.tagName),_t(e.typeExpression),ut(e.comment);}(r);case 342:return function(e){lt(e.tagName),_t(e.constraint),Kt(),wt(e,e.typeParameters,528),ut(e.comment);}(r);case 343:return function(e){lt(e.tagName),e.typeExpression&&(307===e.typeExpression.kind?_t(e.typeExpression):(Kt(),Rt("{"),J("Object"),e.typeExpression.isArrayType&&(Rt("["),Rt("]")),Rt("}"))),e.fullName&&(Kt(),Se(e.fullName)),ut(e.comment),e.typeExpression&&320===e.typeExpression.kind&&st(e.typeExpression);}(r);case 344:return function(e){lt(e.tagName),Se(e.name),ut(e.comment);}(r);case 347:case 351:case 350:return}if(e.isExpression(r)&&(t=1,N!==e.noEmitSubstitution)){var o=N(t,r)||r;o!==r&&(r=o,D&&(r=D(r)));}}var s,c,l,u,_;if(1===t)switch(r.kind){case 8:case 9:return function(e){Je(e,!1);}(r);case 10:case 13:case 14:return Je(r,!1);case 79:return Ue(r);case 80:return Ke(r);case 203:return function(e){It(e,e.elements,8914|(e.multiLine?65536:0),ne.parenthesizeExpressionForDisallowedComma);}(r);case 204:return function(t){e.forEach(t.properties,vr);var r=65536&e.getEmitFlags(t);r&&Ht();var i=t.multiLine?65536:0,a=n.languageVersion>=1&&!e.isJsonSourceFile(n)?64:0;wt(t,t.properties,526226|a|i),r&&Gt();}(r);case 205:return function(t){Ce(t.expression,ne.parenthesizeLeftSideOfAccess);var r=t.questionDotToken||e.setTextRangePosEnd(e.factory.createToken(24),t.expression.end,t.name.pos),n=lr(t,t.expression,r),i=lr(t,r,t.name);er(n,!1),28===r.kind||!function(t){if(t=e.skipPartiallyEmittedExpressions(t),e.isNumericLiteral(t)){var r=pr(t,!0,!1);return !t.numericLiteralFlags&&!e.stringContains(r,e.tokenToString(24))}if(e.isAccessExpression(t)){var n=e.getConstantValue(t);return "number"==typeof n&&isFinite(n)&&Math.floor(n)===n}}(t.expression)||p.hasTrailingComment()||p.hasTrailingWhitespace()||Rt("."),t.questionDotToken?Se(r):Qe(r.kind,t.expression.end,Rt,t),er(i,!1),Se(t.name),tr(n,i);}(r);case 206:return function(e){Ce(e.expression,ne.parenthesizeLeftSideOfAccess),Se(e.questionDotToken),Qe(22,e.expression.end,Rt,e),Ce(e.argumentExpression),Qe(23,e.argumentExpression.end,Rt,e);}(r);case 207:return function(t){var r=536870912&e.getEmitFlags(t);r&&(Rt("("),Mt("0"),Rt(","),Kt()),Ce(t.expression,ne.parenthesizeLeftSideOfAccess),r&&Rt(")"),Se(t.questionDotToken),kt(t,t.typeArguments),It(t,t.arguments,2576,ne.parenthesizeExpressionForDisallowedComma);}(r);case 208:return function(e){Qe(103,e.pos,jt,e),Kt(),Ce(e.expression,ne.parenthesizeExpressionOfNew),kt(e,e.typeArguments),It(e,e.arguments,18960,ne.parenthesizeExpressionForDisallowedComma);}(r);case 209:return function(t){var r=536870912&e.getEmitFlags(t);r&&(Rt("("),Mt("0"),Rt(","),Kt()),Ce(t.tag,ne.parenthesizeLeftSideOfAccess),r&&Rt(")"),kt(t,t.typeArguments),Kt(),Ce(t.template);}(r);case 210:return function(e){Rt("<"),Se(e.type),Rt(">"),Ce(e.expression,ne.parenthesizeOperandOfPrefixUnary);}(r);case 211:return function(e){var t=Qe(20,e.pos,Rt,e),r=or(e.expression,e);Ce(e.expression,void 0),sr(e.expression,e),tr(r),Qe(21,e.expression?e.expression.end:t,Rt,e);}(r);case 212:return function(e){hr(e.name),Xe(e);}(r);case 213:return function(e){Et(e,e.decorators),bt(e,e.modifiers),Ye(e,Ve);}(r);case 214:return function(e){Qe(89,e.pos,jt,e),Kt(),Ce(e.expression,ne.parenthesizeOperandOfPrefixUnary);}(r);case 215:return function(e){Qe(112,e.pos,jt,e),Kt(),Ce(e.expression,ne.parenthesizeOperandOfPrefixUnary);}(r);case 216:return function(e){Qe(114,e.pos,jt,e),Kt(),Ce(e.expression,ne.parenthesizeOperandOfPrefixUnary);}(r);case 217:return function(e){Qe(132,e.pos,jt,e),Kt(),Ce(e.expression,ne.parenthesizeOperandOfPrefixUnary);}(r);case 218:return function(e){Yt(e.operator,Jt),function(e){var t=e.operand;return 218===t.kind&&(39===e.operator&&(39===t.operator||45===t.operator)||40===e.operator&&(40===t.operator||46===t.operator))}(e)&&Kt(),Ce(e.operand,ne.parenthesizeOperandOfPrefixUnary);}(r);case 219:return function(e){Ce(e.operand,ne.parenthesizeOperandOfPostfixUnary),Yt(e.operator,Jt);}(r);case 220:return ie(r);case 221:return function(e){var t=lr(e,e.condition,e.questionToken),r=lr(e,e.questionToken,e.whenTrue),n=lr(e,e.whenTrue,e.colonToken),i=lr(e,e.colonToken,e.whenFalse);Ce(e.condition,ne.parenthesizeConditionOfConditionalExpression),er(t,!0),Se(e.questionToken),er(r,!0),Ce(e.whenTrue,ne.parenthesizeBranchOfConditionalExpression),tr(t,r),er(n,!0),Se(e.colonToken),er(i,!0),Ce(e.whenFalse,ne.parenthesizeBranchOfConditionalExpression),tr(n,i);}(r);case 222:return function(e){Se(e.head),wt(e,e.templateSpans,262144);}(r);case 223:return function(e){Qe(125,e.pos,jt,e),Se(e.asteriskToken),Tt(e.expression,ne.parenthesizeExpressionForDisallowedComma);}(r);case 224:return function(e){Qe(25,e.pos,Rt,e),Ce(e.expression,ne.parenthesizeExpressionForDisallowedComma);}(r);case 225:return function(e){hr(e.name),rt(e);}(r);case 226:return;case 228:return function(e){Ce(e.expression,void 0),e.type&&(Kt(),jt("as"),Kt(),Se(e.type));}(r);case 229:return function(e){Ce(e.expression,ne.parenthesizeLeftSideOfAccess),Jt("!");}(r);case 230:return function(e){Qt(e.keywordToken,e.pos,Rt),Rt("."),Se(e.name);}(r);case 231:return e.Debug.fail("SyntheticExpression should never be printed.");case 277:return function(e){Se(e.openingElement),wt(e,e.children,262144),Se(e.closingElement);}(r);case 278:return function(e){Rt("<"),at(e.tagName),kt(e,e.typeArguments),Kt(),Se(e.attributes),Rt("/>");}(r);case 281:return function(e){Se(e.openingFragment),wt(e,e.children,262144),Se(e.closingFragment);}(r);case 346:return e.Debug.fail("SyntaxList should not be printed");case 347:return;case 348:return function(e){Ce(e.expression);}(r);case 349:return function(e){It(e,e.elements,528,void 0);}(r);case 350:case 351:return;case 352:return e.Debug.fail("SyntheticReferenceExpression should not be printed")}return e.isKeyword(r.kind)?Xt(r,jt):e.isTokenKind(r.kind)?Xt(r,Rt):void e.Debug.fail("Unhandled SyntaxKind: ".concat(e.Debug.formatSyntaxKind(r.kind),"."))}function Re(t,r){var n=Ie(1,t,r);e.Debug.assertIsDefined(x),r=x,x=void 0,n(t,r);}function Be(r){var i=!1,a=304===r.kind?r:void 0;if(!a||R!==e.ModuleKind.None){for(var o=a?a.prepends.length:0,s=a?a.sourceFiles.length+o:1,c=0;c<s;c++){var l=a?c<o?a.prepends[c]:a.sourceFiles[c-o]:r,u=e.isSourceFile(l)?l:e.isUnparsedSource(l)?void 0:n,_=t.noEmitHelpers||!!u&&e.hasRecordedExternalHelpers(u),d=(e.isSourceFile(l)||e.isUnparsedSource(l))&&!g,f=e.isUnparsedSource(l)?l.helpers:je(l);if(f)for(var m=0,y=f;m<y.length;m++){var v=y[m];if(v.scoped){if(a)continue}else {if(_)continue;if(d){if(B.get(v.name))continue;B.set(v.name,!0);}}var h=le();"string"==typeof v.text?$t(v.text):$t(v.text(Er)),z&&z.sections.push({pos:h,end:p.getTextPos(),kind:"emitHelpers",data:v.name}),i=!0;}}return i}}function je(t){var r=e.getEmitHelpers(t);return r&&e.stableSort(r,e.compareEmitHelpers)}function Je(r,n){var i,a=pr(r,t.neverAsciiEscape,n);!t.sourceMap&&!t.inlineSourceMap||10!==r.kind&&!e.isTemplateLiteralKind(r.kind)?(i=a,p.writeStringLiteral(i)):Mt(a);}function ze(e){p.rawWrite(e.parent.text.substring(e.pos,e.end));}function Ue(e){(e.symbol?Lt:J)(dr(e,!1),e.symbol),wt(e,e.typeArguments,53776);}function Ke(e){(e.symbol?Lt:J)(dr(e,!1),e.symbol);}function Ve(e){Nt(e,e.typeParameters),At(e,e.parameters),xt(e.type),Kt(),Se(e.equalsGreaterThanToken);}function qe(t,r){Qe(18,t.pos,Rt,t);var n=r||1&e.getEmitFlags(t)?768:129;wt(t,t.statements,n),Qe(19,t.statements.end,Rt,t,!!(1&n));}function We(e){e?Rt(";"):Bt();}function He(e,t){var r=Qe(115,t,jt,e);Kt(),Qe(20,r,Rt,e),Ce(e.expression),Qe(21,e.expression.end,Rt,e);}function Ge(e){void 0!==e&&(254===e.kind?Se(e):Ce(e));}function Qe(t,r,i,a,o){var s=e.getParseTreeNode(a),c=s&&s.kind===a.kind,l=r;if(c&&n&&(r=e.skipTrivia(n.text,r)),c&&a.pos!==l){var u=o&&n&&!e.positionsAreOnSameLine(l,r,n);u&&Ht(),jr(l),u&&Gt();}if(r=Yt(t,i,r),c&&a.end!==r){var _=287===a.kind;zr(r,!_,_);}return r}function Xe(e){Et(e,e.decorators),bt(e,e.modifiers),jt("function"),Se(e.asteriskToken),Kt(),Te(e.name),Ye(e,Ze);}function Ye(t,r){var n=t.body;if(n)if(e.isBlock(n)){var i=65536&e.getEmitFlags(t);i&&Ht(),fr(t),e.forEach(t.parameters,yr),yr(t.body),r(t),$e(n),gr(t),i&&Gt();}else r(t),Kt(),Ce(n,ne.parenthesizeConciseBodyOfArrowFunction);else r(t),Bt();}function Ze(e){Nt(e,e.typeParameters),Ft(e,e.parameters),xt(e.type);}function $e(t){null==F||F(t),Kt(),Rt("{"),Ht();var r=function(t){if(1&e.getEmitFlags(t))return !0;if(t.multiLine)return !1;if(!e.nodeIsSynthesized(t)&&!e.rangeIsOnSingleLine(t,n))return !1;if(rr(t,t.statements,2)||ir(t,t.statements,2))return !1;for(var r,i=0,a=t.statements;i<a.length;i++){var o=a[i];if(nr(r,o,2)>0)return !1;r=o;}return !0}(t)?et:tt;Ir?Ir(t,t.statements,r):r(t),Gt(),Qt(19,t.statements.end,Rt,t),null==A||A(t);}function et(e){tt(e,!0);}function tt(e,t){var r=gt(e.statements),n=p.getTextPos();Be(e),0===r&&n===p.getTextPos()&&t?(Gt(),wt(e,e.statements,768),Ht()):wt(e,e.statements,1,void 0,r);}function rt(t){e.forEach(t.members,vr),Et(t,t.decorators),bt(t,t.modifiers),jt("class"),t.name&&(Kt(),Te(t.name));var r=65536&e.getEmitFlags(t);r&&Ht(),Nt(t,t.typeParameters),wt(t,t.heritageClauses,0),Kt(),Rt("{"),wt(t,t.members,129),Rt("}"),r&&Gt();}function nt(e){Rt("{"),wt(e,e.elements,525136),Rt("}");}function it(e){e.isTypeOnly&&(jt("type"),Kt()),e.propertyName&&(Se(e.propertyName),Kt(),Qe(127,e.propertyName.end,jt,e),Kt()),Se(e.name);}function at(e){79===e.kind?Ce(e):Se(e);}function ot(t,r,i){var a=163969;1===r.length&&(e.nodeIsSynthesized(t)||e.nodeIsSynthesized(r[0])||e.rangeStartPositionsAreOnSameLine(t,r[0],n))?(Qt(58,i,Rt,t),Kt(),a&=-130):Qe(58,i,Rt,t),wt(t,r,a);}function st(t){wt(t,e.factory.createNodeArray(t.jsDocPropertyTags),33);}function ct(t){t.typeParameters&&wt(t,e.factory.createNodeArray(t.typeParameters),33),t.parameters&&wt(t,e.factory.createNodeArray(t.parameters),33),t.type&&(Wt(),Kt(),Rt("*"),Kt(),Se(t.type));}function lt(e){Rt("@"),Se(e);}function ut(t){var r=e.getTextOfJSDocComment(t);r&&(Kt(),J(r));}function _t(e){e&&(Kt(),Rt("{"),Se(e.type),Rt("}"));}function dt(t){Wt();var r=t.statements;!Ir||0!==r.length&&e.isPrologueDirective(r[0])&&!e.nodeIsSynthesized(r[0])?ft(t):Ir(t,r,ft);}function pt(e,t,r,i){if(e){var a=p.getTextPos();Ut('/// <reference no-default-lib="true"/>'),z&&z.sections.push({pos:a,end:p.getTextPos(),kind:"no-default-lib"}),Wt();}if(n&&n.moduleName&&(Ut('/// <amd-module name="'.concat(n.moduleName,'" />')),Wt()),n&&n.amdDependencies)for(var o=0,s=n.amdDependencies;o<s.length;o++){var c=s[o];c.name?Ut('/// <amd-dependency name="'.concat(c.name,'" path="').concat(c.path,'" />')):Ut('/// <amd-dependency path="'.concat(c.path,'" />')),Wt();}for(var l=0,u=t;l<u.length;l++){var _=u[l];a=p.getTextPos(),Ut('/// <reference path="'.concat(_.fileName,'" />')),z&&z.sections.push({pos:a,end:p.getTextPos(),kind:"reference",data:_.fileName}),Wt();}for(var d=0,f=r;d<f.length;d++)_=f[d],a=p.getTextPos(),Ut('/// <reference types="'.concat(_.fileName,'" />')),z&&z.sections.push({pos:a,end:p.getTextPos(),kind:"type",data:_.fileName}),Wt();for(var g=0,m=i;g<m.length;g++)_=m[g],a=p.getTextPos(),Ut('/// <reference lib="'.concat(_.fileName,'" />')),z&&z.sections.push({pos:a,end:p.getTextPos(),kind:"lib",data:_.fileName}),Wt();}function ft(t){var r=t.statements;fr(t),e.forEach(t.statements,yr),Be(t);var n=e.findIndex(r,(function(t){return !e.isPrologueDirective(t)}));!function(e){e.isDeclarationFile&&pt(e.hasNoDefaultLib,e.referencedFiles,e.typeReferenceDirectives,e.libReferenceDirectives);}(t),wt(t,r,1,void 0,-1===n?r.length:n),gr(t);}function gt(t,r,n,i){for(var a=!!r,o=0;o<t.length;o++){var s=t[o];if(!e.isPrologueDirective(s))return o;if(!n||!n.has(s.expression.text)){a&&(a=!1,he(r)),Wt();var c=p.getTextPos();Se(s),i&&z&&z.sections.push({pos:c,end:p.getTextPos(),kind:"prologue",data:s.expression.text}),n&&n.add(s.expression.text);}}return t.length}function mt(e,t){for(var r=0,n=e;r<n.length;r++){var i=n[r];if(!t.has(i.data)){Wt();var a=p.getTextPos();Se(i),z&&z.sections.push({pos:a,end:p.getTextPos(),kind:"prologue",data:i.data}),t&&t.add(i.data);}}}function yt(t){if(e.isSourceFile(t))gt(t.statements,t);else {for(var r=new e.Set,n=0,i=t.prepends;n<i.length;n++)mt(i[n].prologues,r);for(var a=0,o=t.sourceFiles;a<o.length;a++){var s=o[a];gt(s.statements,s,r,!0);}he(void 0);}}function vt(t){if(e.isSourceFile(t)||e.isUnparsedSource(t)){var r=e.getShebang(t.text);if(r)return Ut(r),Wt(),!0}else {for(var n=0,i=t.prepends;n<i.length;n++){var a=i[n];if(e.Debug.assertNode(a,e.isUnparsedSource),vt(a))return !0}for(var o=0,s=t.sourceFiles;o<s.length;o++)if(vt(s[o]))return !0}}function ht(e,t){if(e){var r=J;J=t,Se(e),J=r;}}function bt(e,t){t&&t.length&&(wt(e,t,262656),Kt());}function xt(e){e&&(Rt(":"),Kt(),Se(e));}function Dt(e,t,r,n){e&&(Kt(),Qe(63,t,Jt,r),Kt(),Ce(e,n));}function St(e){e&&(Kt(),Se(e));}function Tt(e,t){e&&(Kt(),Ce(e,t));}function Ct(t,r){e.isBlock(r)||1&e.getEmitFlags(t)?(Kt(),Se(r)):(Wt(),Ht(),e.isEmptyStatement(r)?Fe(5,r):Se(r),Gt());}function Et(e,t){wt(e,t,2146305);}function kt(e,t){wt(e,t,53776,ne.parenthesizeMemberOfElementType);}function Nt(t,r){if(e.isFunctionLike(t)&&t.typeArguments)return kt(t,t.typeArguments);wt(t,r,53776);}function Ft(e,t){wt(e,t,2576);}function At(t,r){!function(t,r){var n=e.singleOrUndefined(r);return n&&n.pos===t.pos&&e.isArrowFunction(t)&&!t.type&&!e.some(t.decorators)&&!e.some(t.modifiers)&&!e.some(t.typeParameters)&&!e.some(n.decorators)&&!e.some(n.modifiers)&&!n.dotDotDotToken&&!n.questionToken&&!n.type&&!n.initializer&&e.isIdentifier(n.name)}(t,r)?Ft(t,r):wt(t,r,528);}function Pt(e){switch(60&e){case 0:break;case 16:Rt(",");break;case 4:Kt(),Rt("|");break;case 32:Kt(),Rt("*"),Kt();break;case 8:Kt(),Rt("&");}}function wt(e,t,r,n,i,a){Ot(Se,e,t,r,n,i,a);}function It(e,t,r,n,i,a){Ot(Ce,e,t,r,n,i,a);}function Ot(t,r,a,o,s,c,l){if(void 0===c&&(c=0),void 0===l&&(l=a?a.length-c:0),!(void 0===a&&16384&o)){var u=void 0===a||c>=a.length||0===l;if(u&&32768&o)return P&&P(a),void(w&&w(a));if(15360&o&&(Rt(function(e){return i[15360&e][0]}(o)),u&&a&&zr(a.pos,!0)),P&&P(a),u)1&o&&(!j||r&&!e.rangeIsOnSingleLine(r,n))?Wt():256&o&&!(524288&o)&&Kt();else {e.Debug.type(a);var _=0==(262144&o),p=_,f=rr(r,a,o);f?(Wt(f),p=!1):256&o&&Kt(),128&o&&Ht();for(var g=void 0,m=void 0,y=!1,v=0;v<l;v++){var h=a[c+v];if(32&o)Wt(),Pt(o);else if(g){60&o&&g.end!==(r?r.end:-1)&&jr(g.end),Pt(o),de(m);var b=nr(g,h,o);b>0?(0==(131&o)&&(Ht(),y=!0),Wt(b),p=!1):g&&512&o&&Kt();}m=_e(h),p?zr&&zr(e.getCommentRange(h).pos):p=_,d=h.pos,1===t.length?t(h):t(h,s),y&&(Gt(),y=!1),g=h;}var x=g?e.getEmitFlags(g):0,D=$||!!(1024&x),S=(null==a?void 0:a.hasTrailingComma)&&64&o&&16&o;S&&(g&&!D?Qe(27,g.end,Rt,g):Rt(",")),g&&(r?r.end:-1)!==g.end&&60&o&&!D&&jr(S&&(null==a?void 0:a.end)?a.end:g.end),128&o&&Gt(),de(m);var T=ir(r,a,o);T?Wt(T):2097408&o&&Kt();}w&&w(a),15360&o&&(u&&a&&jr(a.end),Rt(function(e){return i[15360&e][1]}(o)));}}function Mt(e){p.writeLiteral(e);}function Lt(e,t){p.writeSymbol(e,t);}function Rt(e){p.writePunctuation(e);}function Bt(){p.writeTrailingSemicolon(";");}function jt(e){p.writeKeyword(e);}function Jt(e){p.writeOperator(e);}function zt(e){p.writeParameter(e);}function Ut(e){p.writeComment(e);}function Kt(){p.writeSpace(" ");}function Vt(e){p.writeProperty(e);}function qt(e){p.nonEscapingWrite?p.nonEscapingWrite(e):p.write(e);}function Wt(e){void 0===e&&(e=1);for(var t=0;t<e;t++)p.writeLine(t>0);}function Ht(){p.increaseIndent();}function Gt(){p.decreaseIndent();}function Qt(t,r,n,i){return W?Yt(t,n,r):function(t,r,n,i,a){if(W||t&&e.isInJsonFile(t))return a(r,n,i);var o=t&&t.emitNode,s=o&&o.flags||0,c=o&&o.tokenSourceMapRanges&&o.tokenSourceMapRanges[r],l=c&&c.source||y;return i=Yr(l,c?c.pos:i),0==(128&s)&&i>=0&&$r(l,i),i=a(r,n,i),c&&(i=c.end),0==(256&s)&&i>=0&&$r(l,i),i}(i,t,n,r,Yt)}function Xt(t,r){I&&I(t),r(e.tokenToString(t.kind)),O&&O(t);}function Yt(t,r,n){var i=e.tokenToString(t);return r(i),n<0?n:n+i.length}function Zt(t,r,n){if(1&e.getEmitFlags(t))Kt();else if(j){var i=lr(t,r,n);i?Wt(i):Kt();}else Wt();}function $t(t){for(var r=t.split(/\r\n?|\n/g),n=e.guessIndentation(r),i=0,a=r;i<a.length;i++){var o=a[i],s=n?o.slice(n):o;s.length&&(Wt(),J(s));}}function er(e,t){e?(Ht(),Wt(e)):t&&Kt();}function tr(e,t){e&&Gt(),t&&Gt();}function rr(t,r,i){if(2&i||j){if(65536&i)return 1;var a=r[0];if(void 0===a)return !t||e.rangeIsOnSingleLine(t,n)?0:1;if(a.pos===d)return 0;if(11===a.kind)return 0;if(t&&!e.positionIsSynthesized(t.pos)&&!e.nodeIsSynthesized(a)&&(!a.parent||e.getOriginalNode(a.parent)===e.getOriginalNode(t)))return j?ar((function(r){return e.getLinesBetweenPositionAndPrecedingNonWhitespaceCharacter(a.pos,t.pos,n,r)})):e.rangeStartPositionsAreOnSameLine(t,a,n)?0:1;if(cr(a,i))return 1}return 1&i?1:0}function nr(t,r,i){if(2&i||j){if(void 0===t||void 0===r)return 0;if(11===r.kind)return 0;if(!e.nodeIsSynthesized(t)&&!e.nodeIsSynthesized(r))return j&&function(t,r){if(r.pos<t.end)return !1;t=e.getOriginalNode(t),r=e.getOriginalNode(r);var n=t.parent;if(!n||n!==r.parent)return !1;var i=e.getContainingNodeArray(t),a=null==i?void 0:i.indexOf(t);return void 0!==a&&a>-1&&i.indexOf(r)===a+1}(t,r)?ar((function(i){return e.getLinesBetweenRangeEndAndRangeStart(t,r,n,i)})):!j&&(a=t,o=r,(a=e.getOriginalNode(a)).parent&&a.parent===e.getOriginalNode(o).parent)?e.rangeEndIsOnSameLineAsRangeStart(t,r,n)?0:1:65536&i?1:0;if(cr(t,i)||cr(r,i))return 1}else if(e.getStartsOnNewLine(r))return 1;var a,o;return 1&i?1:0}function ir(t,r,i){if(2&i||j){if(65536&i)return 1;var a=e.lastOrUndefined(r);if(void 0===a)return !t||e.rangeIsOnSingleLine(t,n)?0:1;if(t&&!e.positionIsSynthesized(t.pos)&&!e.nodeIsSynthesized(a)&&(!a.parent||a.parent===t)){if(j){var o=e.isNodeArray(r)&&!e.positionIsSynthesized(r.end)?r.end:a.end;return ar((function(r){return e.getLinesBetweenPositionAndNextNonWhitespaceCharacter(o,t.end,n,r)}))}return e.rangeEndPositionsAreOnSameLine(t,a,n)?0:1}if(cr(a,i))return 1}return 1&i&&!(131072&i)?1:0}function ar(t){e.Debug.assert(!!j);var r=t(!0);return 0===r?t(!1):r}function or(e,t){var r=j&&rr(t,[e],0);return r&&er(r,!1),!!r}function sr(e,t){var r=j&&ir(t,[e],0);r&&Wt(r);}function cr(t,r){if(e.nodeIsSynthesized(t)){var n=e.getStartsOnNewLine(t);return void 0===n?0!=(65536&r):n}return 0!=(65536&r)}function lr(t,r,i){return 131072&e.getEmitFlags(t)?0:(t=_r(t),r=_r(r),i=_r(i),e.getStartsOnNewLine(i)?1:e.nodeIsSynthesized(t)||e.nodeIsSynthesized(r)||e.nodeIsSynthesized(i)?0:j?ar((function(t){return e.getLinesBetweenRangeEndAndRangeStart(r,i,n,t)})):e.rangeEndIsOnSameLineAsRangeStart(r,i,n)?0:1)}function ur(t){return 0===t.statements.length&&e.rangeEndIsOnSameLineAsRangeStart(t,t,n)}function _r(t){for(;211===t.kind&&e.nodeIsSynthesized(t);)t=t.expression;return t}function dr(t,r){return e.isGeneratedIdentifier(t)?br(t):(e.isIdentifier(t)||e.isPrivateIdentifier(t))&&(e.nodeIsSynthesized(t)||!t.parent||!n||t.parent&&n&&e.getSourceFileOfNode(t)!==e.getOriginalNode(n))?e.idText(t):10===t.kind&&t.textSourceNode?dr(t.textSourceNode,r):!e.isLiteralExpression(t)||!e.nodeIsSynthesized(t)&&t.parent?e.getSourceTextOfNodeFromSourceFile(n,t,r):t.text}function pr(r,i,a){if(10===r.kind&&r.textSourceNode){var o=r.textSourceNode;if(e.isIdentifier(o)||e.isNumericLiteral(o)){var s=e.isNumericLiteral(o)?o.text:dr(o);return a?'"'.concat(e.escapeJsxAttributeString(s),'"'):i||16777216&e.getEmitFlags(r)?'"'.concat(e.escapeString(s),'"'):'"'.concat(e.escapeNonAsciiString(s),'"')}return pr(o,i,a)}var c=(i?1:0)|(a?2:0)|(t.terminateUnterminatedLiterals?4:0)|(t.target&&99===t.target?8:0);return e.getLiteralText(r,n,c)}function fr(t){t&&524288&e.getEmitFlags(t)||(c.push(l),l=0,u.push(_));}function gr(t){t&&524288&e.getEmitFlags(t)||(l=c.pop(),_=u.pop());}function mr(t){_&&_!==e.lastOrUndefined(u)||(_=new e.Set),_.add(t);}function yr(t){if(t)switch(t.kind){case 234:e.forEach(t.statements,yr);break;case 249:case 247:case 239:case 240:yr(t.statement);break;case 238:yr(t.thenStatement),yr(t.elseStatement);break;case 241:case 243:case 242:yr(t.initializer),yr(t.statement);break;case 248:yr(t.caseBlock);break;case 262:e.forEach(t.clauses,yr);break;case 288:case 289:e.forEach(t.statements,yr);break;case 251:yr(t.tryBlock),yr(t.catchClause),yr(t.finallyBlock);break;case 291:yr(t.variableDeclaration),yr(t.block);break;case 236:yr(t.declarationList);break;case 254:e.forEach(t.declarations,yr);break;case 253:case 163:case 202:case 256:hr(t.name);break;case 255:hr(t.name),524288&e.getEmitFlags(t)&&(e.forEach(t.parameters,yr),yr(t.body));break;case 200:case 201:e.forEach(t.elements,yr);break;case 265:yr(t.importClause);break;case 266:hr(t.name),yr(t.namedBindings);break;case 267:case 273:hr(t.name);break;case 268:e.forEach(t.elements,yr);break;case 269:hr(t.propertyName||t.name);}}function vr(e){if(e)switch(e.kind){case 294:case 295:case 166:case 168:case 171:case 172:hr(e.name);}}function hr(t){t&&(e.isGeneratedIdentifier(t)?br(t):e.isBindingPattern(t)&&yr(t));}function br(t){if(4==(7&t.autoGenerateFlags))return xr(function(t){for(var r=t.autoGenerateId,n=t,i=n.original;i&&(n=i,!(e.isIdentifier(n)&&4&n.autoGenerateFlags&&n.autoGenerateId!==r));)i=n.original;return n}(t),t.autoGenerateFlags);var r=t.autoGenerateId;return o[r]||(o[r]=function(t){switch(7&t.autoGenerateFlags){case 1:return Tr(0,!!(8&t.autoGenerateFlags));case 2:return Tr(268435456,!!(8&t.autoGenerateFlags));case 3:return Cr(e.idText(t),32&t.autoGenerateFlags?Sr:Dr,!!(16&t.autoGenerateFlags),!!(8&t.autoGenerateFlags))}return e.Debug.fail("Unsupported GeneratedIdentifierKind.")}(t))}function xr(t,r){var n=e.getNodeId(t);return a[n]||(a[n]=function(t,r){switch(t.kind){case 79:return Cr(dr(t),Dr,!!(16&r),!!(8&r));case 260:case 259:return function(t){var r=dr(t.name);return function(t,r){for(var n=r;e.isNodeDescendantOf(n,r);n=n.nextContainer)if(n.locals){var i=n.locals.get(e.escapeLeadingUnderscores(t));if(i&&3257279&i.flags)return !1}return !0}(r,t)?r:Cr(r)}(t);case 265:case 271:return function(t){var r=e.getExternalModuleName(t);return Cr(e.isStringLiteral(r)?e.makeIdentifierFromModuleName(r.text):"module")}(t);case 255:case 256:case 270:return Cr("default");case 225:return Cr("class");case 168:case 171:case 172:return function(t){return e.isIdentifier(t.name)?xr(t.name):Tr(0)}(t);case 161:return Tr(0,!0);default:return Tr(0)}}(t,r))}function Dr(e){return Sr(e)&&!s.has(e)&&!(_&&_.has(e))}function Sr(t){return !n||e.isFileLevelUniqueName(n,t,S)}function Tr(e,t){if(e&&!(l&e)&&Dr(r=268435456===e?"_i":"_n"))return l|=e,t&&mr(r),r;for(;;){var r,n=268435455&l;if(l++,8!==n&&13!==n&&Dr(r=n<26?"_"+String.fromCharCode(97+n):"_"+(n-26)))return t&&mr(r),r}}function Cr(e,t,r,n){if(void 0===t&&(t=Dr),r&&t(e))return n?mr(e):s.add(e),e;95!==e.charCodeAt(e.length-1)&&(e+="_");for(var i=1;;){var a=e+i;if(t(a))return n?mr(a):s.add(a),a;i++;}}function Er(e){return Cr(e,Sr,!0)}function kr(e,t){var r=Ie(2,e,t),n=Q,i=X,a=Y;Nr(t),r(e,t),Fr(t,n,i,a);}function Nr(t){var r=e.getEmitFlags(t),n=e.getCommentRange(t);!function(t,r,n,i){te(),Z=!1;var a=n<0||0!=(512&r)||11===t.kind,o=i<0||0!=(1024&r)||11===t.kind;(n>0||i>0)&&n!==i&&(a||Or(n,347!==t.kind),(!a||n>=0&&0!=(512&r))&&(Q=n),(!o||i>=0&&0!=(1024&r))&&(X=i,254===t.kind&&(Y=i))),e.forEach(e.getSyntheticLeadingComments(t),Ar),re();}(t,r,n.pos,n.end),2048&r&&($=!0);}function Fr(t,r,n,i){var a=e.getEmitFlags(t),o=e.getCommentRange(t);2048&a&&($=!1),function(t,r,n,i,a,o,s){te();var c=i<0||0!=(1024&r)||11===t.kind;e.forEach(e.getSyntheticTrailingComments(t),Pr),(n>0||i>0)&&n!==i&&(Q=a,X=o,Y=s,c||347===t.kind||function(e){qr(e,Jr);}(i)),re();}(t,a,o.pos,o.end,r,n,i);}function Ar(e){(e.hasLeadingNewline||2===e.kind)&&p.writeLine(),wr(e),e.hasTrailingNewLine||2===e.kind?p.writeLine():p.writeSpace(" ");}function Pr(e){p.isAtStartOfLine()||p.writeSpace(" "),wr(e),e.hasTrailingNewLine&&p.writeLine();}function wr(t){var r=function(e){return 3===e.kind?"/*".concat(e.text,"*/"):"//".concat(e.text)}(t),n=3===t.kind?e.computeLineStarts(r):void 0;e.writeCommentRange(r,n,p,0,r.length,L);}function Ir(t,r,i){te();var a,o,s=r.pos,c=r.end,l=e.getEmitFlags(t),u=$||c<0||0!=(1024&l);s<0||0!=(512&l)||(a=r,(o=e.emitDetachedComments(n.text,De(),p,Wr,a,L,$))&&(b?b.push(o):b=[o])),re(),2048&l&&!$?($=!0,i(t),$=!1):i(t),te(),u||(Or(r.end,!0),Z&&!p.isAtStartOfLine()&&p.writeLine()),re();}function Or(e,t){Z=!1,t?0===e&&(null==n?void 0:n.isDeclarationFile)?Vr(e,Lr):Vr(e,Br):0===e&&Vr(e,Mr);}function Mr(e,t,r,n,i){Hr(e,t)&&Br(e,t,r,n,i);}function Lr(e,t,r,n,i){Hr(e,t)||Br(e,t,r,n,i);}function Rr(r,n){return !t.onlyPrintJsDocStyle||e.isJSDocLikeText(r,n)||e.isPinnedComment(r,n)}function Br(t,r,i,a,o){Rr(n.text,t)&&(Z||(e.emitNewLineBeforeLeadingCommentOfPosition(De(),p,o,t),Z=!0),Zr(t),e.writeCommentRange(n.text,De(),p,t,r,L),Zr(r),a?p.writeLine():3===i&&p.writeSpace(" "));}function jr(e){$||-1===e||Or(e,!0);}function Jr(t,r,i,a){Rr(n.text,t)&&(p.isAtStartOfLine()||p.writeSpace(" "),Zr(t),e.writeCommentRange(n.text,De(),p,t,r,L),Zr(r),a&&p.writeLine());}function zr(e,t,r){$||(te(),qr(e,t?Jr:r?Ur:Kr),re());}function Ur(t,r,i){Zr(t),e.writeCommentRange(n.text,De(),p,t,r,L),Zr(r),2===i&&p.writeLine();}function Kr(t,r,i,a){Zr(t),e.writeCommentRange(n.text,De(),p,t,r,L),Zr(r),a?p.writeLine():p.writeSpace(" ");}function Vr(t,r){!n||-1!==Q&&t===Q||(function(t){return void 0!==b&&e.last(b).nodePos===t}(t)?function(t){var r=e.last(b).detachedCommentEndPos;b.length-1?b.pop():b=void 0,e.forEachLeadingCommentRange(n.text,r,t,r);}(r):e.forEachLeadingCommentRange(n.text,t,r,t));}function qr(t,r){n&&(-1===X||t!==X&&t!==Y)&&e.forEachTrailingCommentRange(n.text,t,r);}function Wr(t,r,i,a,o,s){Rr(n.text,a)&&(Zr(a),e.writeCommentRange(t,r,i,a,o,s),Zr(o));}function Hr(t,r){return e.isRecognizedTripleSlashComment(n.text,t,r)}function Gr(e,t){var r=Ie(3,e,t);Qr(t),r(e,t),Xr(t);}function Qr(t){var r=e.getEmitFlags(t),n=e.getSourceMapRange(t);if(e.isUnparsedNode(t)){e.Debug.assertIsDefined(t.parent,"UnparsedNodes must have parent pointers");var i=function(t){return void 0===t.parsedSourceMap&&void 0!==t.sourceMapText&&(t.parsedSourceMap=e.tryParseRawSourceMap(t.sourceMapText)||!1),t.parsedSourceMap||void 0}(t.parent);i&&m&&m.appendSourceMap(p.getLine(),p.getColumn(),i,t.parent.sourceMapPath,t.parent.getLineAndCharacterOfPosition(t.pos),t.parent.getLineAndCharacterOfPosition(t.end));}else {var a=n.source||y;347!==t.kind&&0==(16&r)&&n.pos>=0&&$r(n.source||y,Yr(a,n.pos)),64&r&&(W=!0);}}function Xr(t){var r=e.getEmitFlags(t),n=e.getSourceMapRange(t);e.isUnparsedNode(t)||(64&r&&(W=!1),347!==t.kind&&0==(32&r)&&n.end>=0&&$r(n.source||y,n.end));}function Yr(t,r){return t.skipTrivia?t.skipTrivia(r):e.skipTrivia(t.text,r)}function Zr(t){if(!(W||e.positionIsSynthesized(t)||tn(y))){var r=e.getLineAndCharacterOfPosition(y,t),n=r.line,i=r.character;m.addMapping(p.getLine(),p.getColumn(),H,n,i,void 0);}}function $r(e,t){if(e!==y){var r=y,n=H;en(e),Zr(t),function(e,t){y=e,H=t;}(r,n);}else Zr(t);}function en(e){W||(y=e,e!==v?tn(e)||(H=m.addSource(e.fileName),t.inlineSources&&m.setSourceContent(H,e.text),v=e,G=H):H=G);}function tn(t){return e.fileExtensionIs(t.fileName,".json")}}e.isBuildInfoFile=function(t){return e.fileExtensionIs(t,".tsbuildinfo")},e.forEachEmittedFile=a,e.getTsBuildInfoEmitOutputFilePath=o,e.getOutputPathsForBundle=s,e.getOutputPathsFor=c,e.getOutputExtension=u,e.getOutputDeclarationFileName=d,e.getCommonSourceDirectory=y,e.getCommonSourceDirectoryOfConfig=v,e.getAllProjectOutputs=function(t,r){var n=f(),i=n.addOutput,a=n.getOutputs;if(e.outFile(t.options))g(t,i);else {for(var s=e.memoize((function(){return v(t,r)})),c=0,l=t.fileNames;c<l.length;c++){var u=l[c];m(t,u,r,i,s);}i(o(t.options));}return a()},e.getOutputFileNames=function(t,r,n){r=e.normalizePath(r),e.Debug.assert(e.contains(t.fileNames,r),"Expected fileName to be present in command line");var i=f(),a=i.addOutput,o=i.getOutputs;return e.outFile(t.options)?g(t,a):m(t,r,n,a),o()},e.getFirstProjectOutput=function(t,r){if(e.outFile(t.options)){var n=s(t.options,!1).jsFilePath;return e.Debug.checkDefined(n,"project ".concat(t.options.configFilePath," expected to have at least one output"))}for(var i=e.memoize((function(){return v(t,r)})),a=0,c=t.fileNames;a<c.length;a++){var l=c[a];if(!e.fileExtensionIs(l,".d.ts")){if(n=p(l,t,r,i))return n;if(!e.fileExtensionIs(l,".json")&&e.getEmitDeclarations(t.options))return d(l,t,r,i)}}return o(t.options)||e.Debug.fail("project ".concat(t.options.configFilePath," expected to have at least one output"))},e.emitFiles=h,e.getBuildInfoText=b,e.getBuildInfo=x,e.notImplementedResolver={hasGlobalName:e.notImplemented,getReferencedExportContainer:e.notImplemented,getReferencedImportDeclaration:e.notImplemented,getReferencedDeclarationWithCollidingName:e.notImplemented,isDeclarationWithCollidingName:e.notImplemented,isValueAliasDeclaration:e.notImplemented,isReferencedAliasDeclaration:e.notImplemented,isTopLevelValueImportEqualsWithEntityName:e.notImplemented,getNodeCheckFlags:e.notImplemented,isDeclarationVisible:e.notImplemented,isLateBound:function(e){return !1},collectLinkedAliases:e.notImplemented,isImplementationOfOverload:e.notImplemented,isRequiredInitializedParameter:e.notImplemented,isOptionalUninitializedParameterProperty:e.notImplemented,isExpandoFunctionDeclaration:e.notImplemented,getPropertiesOfContainerFunction:e.notImplemented,createTypeOfDeclaration:e.notImplemented,createReturnTypeOfSignatureDeclaration:e.notImplemented,createTypeOfExpression:e.notImplemented,createLiteralConstValue:e.notImplemented,isSymbolAccessible:e.notImplemented,isEntityNameVisible:e.notImplemented,getConstantValue:e.notImplemented,getReferencedValueDeclaration:e.notImplemented,getTypeReferenceSerializationKind:e.notImplemented,isOptionalParameter:e.notImplemented,moduleExportsSomeValue:e.notImplemented,isArgumentsLocalBinding:e.notImplemented,getExternalModuleFileFromDeclaration:e.notImplemented,getTypeReferenceDirectivesForEntityName:e.notImplemented,getTypeReferenceDirectivesForSymbol:e.notImplemented,isLiteralConstDeclaration:e.notImplemented,getJsxFactoryEntity:e.notImplemented,getJsxFragmentFactoryEntity:e.notImplemented,getAllAccessorDeclarations:e.notImplemented,getSymbolOfExternalModuleSpecifier:e.notImplemented,isBindingCapturedByNode:e.notImplemented,getDeclarationStatementsForSourceFile:e.notImplemented,isImportRequiredByAugmentation:e.notImplemented},e.emitUsingBuildInfo=function(t,r,i,a){var o=s(t.options,!1),c=o.buildInfoPath,l=o.jsFilePath,u=o.sourceMapFilePath,_=o.declarationFilePath,d=o.declarationMapPath,p=r.readFile(e.Debug.checkDefined(c));if(!p)return c;var f=r.readFile(e.Debug.checkDefined(l));if(!f)return l;var g=u&&r.readFile(u);if(u&&!g||t.options.inlineSourceMap)return u||"inline sourcemap decoding";var m=_&&r.readFile(_);if(_&&!m)return _;var y=d&&r.readFile(d);if(d&&!y||t.options.inlineSourceMap)return d||"inline sourcemap decoding";var v=x(p);if(!v.bundle||!v.bundle.js||m&&!v.bundle.dts)return c;var D=e.getDirectoryPath(e.getNormalizedAbsolutePath(c,r.getCurrentDirectory())),S=e.createInputFiles(f,m,u,g,d,y,l,_,c,v,!0),T=[],C=e.createPrependNodes(t.projectReferences,i,(function(e){return r.readFile(e)})),E=function(t,r,n){var i,a=e.Debug.checkDefined(t.js),o=(null===(i=a.sources)||void 0===i?void 0:i.prologues)&&e.arrayToMap(a.sources.prologues,(function(e){return e.file}));return t.sourceFiles.map((function(t,i){var a,s,c=null==o?void 0:o.get(i),l=null==c?void 0:c.directives.map((function(t){var r=e.setTextRange(e.factory.createStringLiteral(t.expression.text),t.expression),n=e.setTextRange(e.factory.createExpressionStatement(r),t);return e.setParent(r,n),n})),u=e.factory.createToken(1),_=e.factory.createSourceFile(null!=l?l:[],u,0);return _.fileName=e.getRelativePathFromDirectory(n.getCurrentDirectory(),e.getNormalizedAbsolutePath(t,r),!n.useCaseSensitiveFileNames()),_.text=null!==(a=null==c?void 0:c.text)&&void 0!==a?a:"",e.setTextRangePosWidth(_,0,null!==(s=null==c?void 0:c.text.length)&&void 0!==s?s:0),e.setEachParent(_.statements,_),e.setTextRangePosWidth(u,_.end,0),e.setParent(u,_),_}))}(v.bundle,D,r),k={getPrependNodes:e.memoize((function(){return n$3(n$3([],C,!0),[S],!1)})),getCanonicalFileName:r.getCanonicalFileName,getCommonSourceDirectory:function(){return e.getNormalizedAbsolutePath(v.bundle.commonSourceDirectory,D)},getCompilerOptions:function(){return t.options},getCurrentDirectory:function(){return r.getCurrentDirectory()},getNewLine:function(){return r.getNewLine()},getSourceFile:e.returnUndefined,getSourceFileByPath:e.returnUndefined,getSourceFiles:function(){return E},getLibFileFromReference:e.notImplemented,isSourceFileFromExternalLibrary:e.returnFalse,getResolvedProjectReferenceToRedirect:e.returnUndefined,getProjectReferenceRedirect:e.returnUndefined,isSourceOfProjectReferenceRedirect:e.returnFalse,writeFile:function(t,r,n){switch(t){case l:if(f===r)return;break;case u:if(g===r)return;break;case c:var i=x(r);i.program=v.program;var a=v.bundle,o=a.js,s=a.dts,p=a.sourceFiles;return i.bundle.js.sources=o.sources,s&&(i.bundle.dts.sources=s.sources),i.bundle.sourceFiles=p,void T.push({name:t,text:b(i),writeByteOrderMark:n});case _:if(m===r)return;break;case d:if(y===r)return;break;default:e.Debug.fail("Unexpected path: ".concat(t));}T.push({name:t,text:r,writeByteOrderMark:n});},isEmitBlocked:e.returnFalse,readFile:function(e){return r.readFile(e)},fileExists:function(e){return r.fileExists(e)},useCaseSensitiveFileNames:function(){return r.useCaseSensitiveFileNames()},getProgramBuildInfo:e.returnUndefined,getSourceFileFromReference:e.returnUndefined,redirectTargetsMap:e.createMultiMap(),getFileIncludeReasons:e.notImplemented};return h(e.notImplementedResolver,k,void 0,e.getTransformers(t.options,a)),T},function(e){e[e.Notification=0]="Notification",e[e.Substitution=1]="Substitution",e[e.Comments=2]="Comments",e[e.SourceMaps=3]="SourceMaps",e[e.Emit=4]="Emit";}(t||(t={})),e.createPrinter=D,function(e){e[e.Auto=0]="Auto",e[e.CountMask=268435455]="CountMask",e[e._i=268435456]="_i";}(r||(r={}));}(t),function(e){var t,r;function i(e){e.watcher.close();}e.createCachedDirectoryStructureHost=function(t,r,n){if(t.getDirectories&&t.readDirectory){var i=new e.Map,a=e.createGetCanonicalFileName(n);return {useCaseSensitiveFileNames:n,fileExists:function(e){var r=c(o(e));return r&&d(r.files,l(e))||t.fileExists(e)},readFile:function(e,r){return t.readFile(e,r)},directoryExists:t.directoryExists&&function(r){var n=o(r);return i.has(e.ensureTrailingDirectorySeparator(n))||t.directoryExists(r)},getDirectories:function(e){var r=u(e,o(e));return r?r.directories.slice():t.getDirectories(e)},readDirectory:function(i,a,s,c,_){var d,p=o(i),g=u(i,p);return void 0!==g?e.matchFiles(i,a,s,c,n,r,_,(function(t){var r=o(t);if(r===p)return g||m(t,r);var n=u(t,r);return void 0!==n?n||m(t,r):e.emptyFileSystemEntries}),f):t.readDirectory(i,a,s,c,_);function m(r,n){if(d&&n===p)return d;var i={files:e.map(t.readDirectory(r,void 0,void 0,["*.*"]),l)||e.emptyArray,directories:t.getDirectories(r)||e.emptyArray};return n===p&&(d=i),i}},createDirectory:t.createDirectory&&function(e){var r=c(o(e)),n=l(e);r&&p(r.directories,n,!0),t.createDirectory(e);},writeFile:t.writeFile&&function(e,r,n){var i=c(o(e));return i&&g(i,l(e),!0),t.writeFile(e,r,n)},addOrDeleteFileOrDirectory:function(e,r){if(void 0===s(r)){var n=c(r);if(n){if(t.directoryExists){var i=l(e),a={fileExists:t.fileExists(r),directoryExists:t.directoryExists(r)};return a.directoryExists||d(n.directories,i)?m():g(n,i,a.fileExists),a}m();}}else m();},addOrDeleteFile:function(t,r,n){if(n!==e.FileWatcherEventKind.Changed){var i=c(r);i&&g(i,l(t),n===e.FileWatcherEventKind.Created);}},clearCache:m,realpath:t.realpath&&f}}function o(t){return e.toPath(t,r,a)}function s(t){return i.get(e.ensureTrailingDirectorySeparator(t))}function c(t){return s(e.getDirectoryPath(t))}function l(t){return e.getBaseFileName(e.normalizePath(t))}function u(r,n){var a=s(n=e.ensureTrailingDirectorySeparator(n));if(a)return a;try{return function(r,n){var a;if(!t.realpath||e.ensureTrailingDirectorySeparator(o(t.realpath(r)))===n){var s={files:e.map(t.readDirectory(r,void 0,void 0,["*.*"]),l)||[],directories:t.getDirectories(r)||[]};return i.set(e.ensureTrailingDirectorySeparator(n),s),s}if(null===(a=t.directoryExists)||void 0===a?void 0:a.call(t,r))return i.set(n,!1),!1}(r,n)}catch(t){return void e.Debug.assert(!i.has(e.ensureTrailingDirectorySeparator(n)))}}function _(e,t){return a(e)===a(t)}function d(t,r){return e.some(t,(function(e){return _(e,r)}))}function p(t,r,n){if(d(t,r)){if(!n)return e.filterMutate(t,(function(e){return !_(e,r)}))}else if(n)return t.push(r)}function f(e){return t.realpath?t.realpath(e):e}function g(e,t,r){p(e.files,t,r);}function m(){i.clear();}},(r=e.ConfigFileProgramReloadLevel||(e.ConfigFileProgramReloadLevel={}))[r.None=0]="None",r[r.Partial=1]="Partial",r[r.Full=2]="Full",e.updateSharedExtendedConfigFileWatcher=function(t,r,n,i,a){var o,s=e.arrayToMap((null===(o=null==r?void 0:r.configFile)||void 0===o?void 0:o.extendedSourceFiles)||e.emptyArray,a);n.forEach((function(e,r){s.has(r)||(e.projects.delete(t),e.close());})),s.forEach((function(r,a){var o=n.get(a);o?o.projects.add(t):n.set(a,{projects:new e.Set([t]),watcher:i(r,a),close:function(){var e=n.get(a);e&&0===e.projects.size&&(e.watcher.close(),n.delete(a));}});}));},e.clearSharedExtendedConfigFileWatcher=function(e,t){t.forEach((function(t){t.projects.delete(e)&&t.close();}));},e.cleanExtendedConfigCache=function e(t,r,n){t.delete(r)&&t.forEach((function(i,a){var o;(null===(o=i.extendedResult.extendedSourceFiles)||void 0===o?void 0:o.some((function(e){return n(e)===r})))&&e(t,a,n);}));},e.updatePackageJsonWatch=function(t,r,n){var i=new e.Map(t);e.mutateMap(r,i,{createNewValue:n,onDeleteValue:e.closeFileWatcher});},e.updateMissingFilePathsWatch=function(t,r,n){var i=t.getMissingFilePaths(),a=e.arrayToMap(i,e.identity,e.returnTrue);e.mutateMap(r,a,{createNewValue:n,onDeleteValue:e.closeFileWatcher});},e.updateWatchingWildcardDirectories=function(t,r,n){function a(e,t){return {watcher:n(e,t),flags:t}}e.mutateMap(t,r,{createNewValue:a,onDeleteValue:i,onExistingValue:function(e,r,n){e.flags!==r&&(e.watcher.close(),t.set(n,a(n,r)));}});},e.isIgnoredFileFromWildCardWatching=function(t){var r=t.watchedDirPath,n=t.fileOrDirectory,i=t.fileOrDirectoryPath,a=t.configFileName,o=t.options,s=t.program,c=t.extraFileExtensions,l=t.currentDirectory,u=t.useCaseSensitiveFileNames,_=t.writeLog,d=t.toPath,p=e.removeIgnoredPath(i);if(!p)return _("Project: ".concat(a," Detected ignored path: ").concat(n)),!0;if((i=p)===r)return !1;if(e.hasExtension(i)&&!e.isSupportedSourceFileName(n,o,c))return _("Project: ".concat(a," Detected file add/remove of non supported extension: ").concat(n)),!0;if(e.isExcludedFile(n,o.configFile.configFileSpecs,e.getNormalizedAbsolutePath(e.getDirectoryPath(a),l),u,l))return _("Project: ".concat(a," Detected excluded file: ").concat(n)),!0;if(!s)return !1;if(e.outFile(o)||o.outDir)return !1;if(e.fileExtensionIs(i,".d.ts")){if(o.declarationDir)return !1}else if(!e.fileExtensionIsOneOf(i,e.supportedJSExtensionsFlat))return !1;var f=e.removeFileExtension(i),g=e.isArray(s)?void 0:function(e){return !!e.getState}(s)?s.getProgramOrUndefined():s,m=g||e.isArray(s)?void 0:s;return !(!y(f+".ts")&&!y(f+".tsx")||(_("Project: ".concat(a," Detected output file: ").concat(n)),0));function y(t){return g?!!g.getSourceFileByPath(t):m?m.getState().fileInfos.has(t):!!e.find(s,(function(e){return d(e)===t}))}},e.isEmittedFileOfProgram=function(e,t){return !!e&&e.isEmittedFile(t)},function(e){e[e.None=0]="None",e[e.TriggerOnly=1]="TriggerOnly",e[e.Verbose=2]="Verbose";}(t=e.WatchLogLevel||(e.WatchLogLevel={})),e.getWatchFactory=function(r,i,a,o){e.setSysLog(i===t.Verbose?a:e.noop);var s={watchFile:function(e,t,n,i){return r.watchFile(e,t,n,i)},watchDirectory:function(e,t,n,i){return r.watchDirectory(e,t,0!=(1&n),i)}},c=i!==t.None?{watchFile:d("watchFile"),watchDirectory:d("watchDirectory")}:void 0,l=i===t.Verbose?{watchFile:function(e,t,r,n,i,s){a("FileWatcher:: Added:: ".concat(p(e,r,n,i,s,o)));var l=c.watchFile(e,t,r,n,i,s);return {close:function(){a("FileWatcher:: Close:: ".concat(p(e,r,n,i,s,o))),l.close();}}},watchDirectory:function(t,r,n,i,s,l){var u="DirectoryWatcher:: Added:: ".concat(p(t,n,i,s,l,o));a(u);var _=e.timestamp(),d=c.watchDirectory(t,r,n,i,s,l),f=e.timestamp()-_;return a("Elapsed:: ".concat(f,"ms ").concat(u)),{close:function(){var r="DirectoryWatcher:: Close:: ".concat(p(t,n,i,s,l,o));a(r);var c=e.timestamp();d.close();var u=e.timestamp()-c;a("Elapsed:: ".concat(u,"ms ").concat(r));}}}}:c||s,u=i===t.Verbose?function(e,t,r,n,i){return a("ExcludeWatcher:: Added:: ".concat(p(e,t,r,n,i,o))),{close:function(){return a("ExcludeWatcher:: Close:: ".concat(p(e,t,r,n,i,o)))}}}:e.returnNoopFileWatcher;return {watchFile:_("watchFile"),watchDirectory:_("watchDirectory")};function _(t){return function(n,i,a,o,s,c){var _;return e.matchesExclude(n,"watchFile"===t?null==o?void 0:o.excludeFiles:null==o?void 0:o.excludeDirectories,"boolean"==typeof r.useCaseSensitiveFileNames?r.useCaseSensitiveFileNames:r.useCaseSensitiveFileNames(),(null===(_=r.getCurrentDirectory)||void 0===_?void 0:_.call(r))||"")?u(n,a,o,s,c):l[t].call(void 0,n,i,a,o,s,c)}}function d(t){return function(r,i,c,l,u,_){return s[t].call(void 0,r,(function(){for(var s=[],d=0;d<arguments.length;d++)s[d]=arguments[d];var f="".concat("watchFile"===t?"FileWatcher":"DirectoryWatcher",":: Triggered with ").concat(s[0]," ").concat(void 0!==s[1]?s[1]:"",":: ").concat(p(r,c,l,u,_,o));a(f);var g=e.timestamp();i.call.apply(i,n$3([void 0],s,!1));var m=e.timestamp()-g;a("Elapsed:: ".concat(m,"ms ").concat(f));}),c,l,u,_)}}function p(e,t,r,n,i,a){return "WatchInfo: ".concat(e," ").concat(t," ").concat(JSON.stringify(r)," ").concat(a?a(n,i):void 0===i?n:"".concat(n," ").concat(i))}},e.getFallbackOptions=function(t){var r=null==t?void 0:t.fallbackPolling;return {watchFile:void 0!==r?r:e.WatchFileKind.PriorityPollingInterval}},e.closeFileWatcherOf=i;}(t),function(e){function t(t,r){var n=e.getDirectoryPath(r),i=e.isRootedDiskPath(t)?t:e.combinePaths(n,t);return e.normalizePath(i)}function r(e,t){return i(e,t)}function i(t,r,n){void 0===n&&(n=e.sys);var i,a=new e.Map,o=e.createGetCanonicalFileName(n.useCaseSensitiveFileNames),s=e.maybeBind(n,n.createHash)||e.generateDjb2Hash;function c(){return e.getDirectoryPath(e.normalizePath(n.getExecutingFilePath()))}var l=e.getNewLineCharacter(t,(function(){return n.newLine})),u=n.realpath&&function(e){return n.realpath(e)},_={getSourceFile:function(t,n,i){var a;try{e.performance.mark("beforeIORead"),a=_.readFile(t),e.performance.mark("afterIORead"),e.performance.measure("I/O Read","beforeIORead","afterIORead");}catch(e){i&&i(e.message),a="";}return void 0!==a?e.createSourceFile(t,a,n,r):void 0},getDefaultLibLocation:c,getDefaultLibFileName:function(t){return e.combinePaths(c(),e.getDefaultLibFileName(t))},writeFile:function(r,o,c,l){try{e.performance.mark("beforeIOWrite"),e.writeFileEnsuringDirectories(r,o,c,(function(r,a,o){return function(r,a,o){if(e.isWatchSet(t)&&n.getModifiedTime){i||(i=new e.Map);var c=s(a),l=n.getModifiedTime(r);if(l){var u=i.get(r);if(u&&u.byteOrderMark===o&&u.hash===c&&u.mtime.getTime()===l.getTime())return}n.writeFile(r,a,o);var _=n.getModifiedTime(r)||e.missingFileModifiedTime;i.set(r,{hash:c,byteOrderMark:o,mtime:_});}else n.writeFile(r,a,o);}(r,a,o)}),(function(e){return (_.createDirectory||n.createDirectory)(e)}),(function(e){return t=e,!!a.has(t)||!!(_.directoryExists||n.directoryExists)(t)&&(a.set(t,!0),!0);var t;})),e.performance.mark("afterIOWrite"),e.performance.measure("I/O Write","beforeIOWrite","afterIOWrite");}catch(e){l&&l(e.message);}},getCurrentDirectory:e.memoize((function(){return n.getCurrentDirectory()})),useCaseSensitiveFileNames:function(){return n.useCaseSensitiveFileNames},getCanonicalFileName:o,getNewLine:function(){return l},fileExists:function(e){return n.fileExists(e)},readFile:function(e){return n.readFile(e)},trace:function(e){return n.write(e+l)},directoryExists:function(e){return n.directoryExists(e)},getEnvironmentVariable:function(e){return n.getEnvironmentVariable?n.getEnvironmentVariable(e):""},getDirectories:function(e){return n.getDirectories(e)},realpath:u,readDirectory:function(e,t,r,i,a){return n.readDirectory(e,t,r,i,a)},createDirectory:function(e){return n.createDirectory(e)},createHash:e.maybeBind(n,n.createHash)};return _}function a(t,r){var n="".concat(e.diagnosticCategoryName(t)," TS").concat(t.code,": ").concat(f(t.messageText,r.getNewLine())).concat(r.getNewLine());if(t.file){var i=e.getLineAndCharacterOfPosition(t.file,t.start),a=i.line,o=i.character,s=t.file.fileName,c=e.convertToRelativePath(s,r.getCurrentDirectory(),(function(e){return r.getCanonicalFileName(e)}));return "".concat(c,"(").concat(a+1,",").concat(o+1,"): ")+n}return n}var o;e.findConfigFile=function(t,r,n){return void 0===n&&(n="tsconfig.json"),e.forEachAncestorDirectory(t,(function(t){var i=e.combinePaths(t,n);return r(i)?i:void 0}))},e.resolveTripleslashReference=t,e.computeCommonSourceDirectoryOfFilenames=function(t,r,n){var i;return e.forEach(t,(function(t){var a=e.getNormalizedPathComponents(t,r);if(a.pop(),i){for(var o=Math.min(i.length,a.length),s=0;s<o;s++)if(n(i[s])!==n(a[s])){if(0===s)return !0;i.length=s;break}a.length<i.length&&(i.length=a.length);}else i=a;}))?"":i?e.getPathFromPathComponents(i):r},e.createCompilerHost=r,e.createCompilerHostWorker=i,e.changeCompilerHostLikeToUseCache=function(t,r,n){var i=t.readFile,a=t.fileExists,o=t.directoryExists,s=t.createDirectory,c=t.writeFile,l=new e.Map,u=new e.Map,_=new e.Map,d=new e.Map,p=function(e,r){var n=i.call(t,r);return l.set(e,void 0!==n&&n),n};t.readFile=function(n){var a=r(n),o=l.get(a);return void 0!==o?!1!==o?o:void 0:e.fileExtensionIs(n,".json")||e.isBuildInfoFile(n)?p(a,n):i.call(t,n)};var f=n?function(t,i,a,o){var s=r(t),c=d.get(s);if(c)return c;var l=n(t,i,a,o);return l&&(e.isDeclarationFileName(t)||e.fileExtensionIs(t,".json"))&&d.set(s,l),l}:void 0;return t.fileExists=function(e){var n=r(e),i=u.get(n);if(void 0!==i)return i;var o=a.call(t,e);return u.set(n,!!o),o},c&&(t.writeFile=function(e,n,i,a,o){var s=r(e);u.delete(s);var _=l.get(s);if(void 0!==_&&_!==n)l.delete(s),d.delete(s);else if(f){var p=d.get(s);p&&p.text!==n&&d.delete(s);}c.call(t,e,n,i,a,o);}),o&&s&&(t.directoryExists=function(e){var n=r(e),i=_.get(n);if(void 0!==i)return i;var a=o.call(t,e);return _.set(n,!!a),a},t.createDirectory=function(e){var n=r(e);_.delete(n),s.call(t,e);}),{originalReadFile:i,originalFileExists:a,originalDirectoryExists:o,originalCreateDirectory:s,originalWriteFile:c,getSourceFileWithCache:f,readFileWithCache:function(e){var t=r(e),n=l.get(t);return void 0!==n?!1!==n?n:void 0:p(t,e)}}},e.getPreEmitDiagnostics=function(t,r,n){var i;return i=e.addRange(i,t.getConfigFileParsingDiagnostics()),i=e.addRange(i,t.getOptionsDiagnostics(n)),i=e.addRange(i,t.getSyntacticDiagnostics(r,n)),i=e.addRange(i,t.getGlobalDiagnostics(n)),i=e.addRange(i,t.getSemanticDiagnostics(r,n)),e.getEmitDeclarations(t.getCompilerOptions())&&(i=e.addRange(i,t.getDeclarationDiagnostics(r,n))),e.sortAndDeduplicateDiagnostics(i||e.emptyArray)},e.formatDiagnostics=function(e,t){for(var r="",n=0,i=e;n<i.length;n++)r+=a(i[n],t);return r},e.formatDiagnostic=a,function(e){e.Grey="",e.Red="",e.Yellow="",e.Blue="",e.Cyan="";}(o=e.ForegroundColorEscapeSequences||(e.ForegroundColorEscapeSequences={}));var s="",c="",l=" ";function u(t){switch(t){case e.DiagnosticCategory.Error:return o.Red;case e.DiagnosticCategory.Warning:return o.Yellow;case e.DiagnosticCategory.Suggestion:return e.Debug.fail("Should never get an Info diagnostic on the command line.");case e.DiagnosticCategory.Message:return o.Blue}}function _(e,t){return t+e+c}function d(t,r,n,i,a,o){var l=e.getLineAndCharacterOfPosition(t,r),u=l.line,d=l.character,p=e.getLineAndCharacterOfPosition(t,r+n),f=p.line,g=p.character,m=e.getLineAndCharacterOfPosition(t,t.text.length).line,y=f-u>=4,v=(f+1+"").length;y&&(v=Math.max("...".length,v));for(var h="",b=u;b<=f;b++){h+=o.getNewLine(),y&&u+1<b&&b<f-1&&(h+=i+_(e.padLeft("...",v),s)+" "+o.getNewLine(),b=f-1);var x=e.getPositionOfLineAndCharacter(t,b,0),D=b<m?e.getPositionOfLineAndCharacter(t,b+1,0):t.text.length,S=t.text.slice(x,D);if(S=(S=e.trimStringEnd(S)).replace(/\t/g," "),h+=i+_(e.padLeft(b+1+"",v),s)+" ",h+=S+o.getNewLine(),h+=i+_(e.padLeft("",v),s)+" ",h+=a,b===u){var T=b===f?g:void 0;h+=S.slice(0,d).replace(/\S/g," "),h+=S.slice(d,T).replace(/./g,"~");}else h+=b===f?S.slice(0,g).replace(/./g,"~"):S.replace(/./g,"~");h+=c;}return h}function p(t,r,n,i){void 0===i&&(i=_);var a=e.getLineAndCharacterOfPosition(t,r),s=a.line,c=a.character,l="";return l+=i(n?e.convertToRelativePath(t.fileName,n.getCurrentDirectory(),(function(e){return n.getCanonicalFileName(e)})):t.fileName,o.Cyan),l+=":",l+=i("".concat(s+1),o.Yellow),(l+=":")+i("".concat(c+1),o.Yellow)}function f(t,r,n){if(void 0===n&&(n=0),e.isString(t))return t;if(void 0===t)return "";var i="";if(n){i+=r;for(var a=0;a<n;a++)i+=" ";}if(i+=t.messageText,n++,t.next)for(var o=0,s=t.next;o<s.length;o++)i+=f(s[o],r,n);return i}function g(t,r,n,i){if(0===t.length)return [];for(var a=[],o=new e.Map,s=0,c=t;s<c.length;s++){var l=c[s],u=void 0;o.has(l)?u=o.get(l):o.set(l,u=i(l,r,n)),a.push(u);}return a}function m(e,t){if(void 0!==e.impliedNodeFormat)return y(e,P(e,t))}function y(t,r){var n;if(void 0!==t.impliedNodeFormat){if(t.impliedNodeFormat!==e.ModuleKind.ESNext)return e.isImportCall(e.walkUpParenthesizedExpressions(r.parent))?e.ModuleKind.ESNext:e.ModuleKind.CommonJS;var i=null===(n=e.walkUpParenthesizedExpressions(r.parent))||void 0===n?void 0:n.parent;return i&&e.isImportEqualsDeclaration(i)?e.ModuleKind.CommonJS:e.ModuleKind.ESNext}}function v(t,r,n,i,a){if(0===t.length)return [];for(var o=[],s=new e.Map,c=0,l=0,u=t;l<u.length;l++){var _=u[l],d=void 0,p=m(r,c);c++;var f=void 0!==p?"".concat(p,"|").concat(_):_;s.has(f)?d=s.get(f):s.set(f,d=a(_,p,n,i)),o.push(d);}return o}function h(t,r,n,i){var a;return function t(r,o,s){if(i){var c=i(r,s);if(c)return c}return e.forEach(o,(function(r,i){if(!r||!(null==a?void 0:a.has(r.sourceFile.path))){var o=n(r,s,i);return o||!r?o:((a||(a=new e.Set)).add(r.sourceFile.path),t(r.commandLine.projectReferences,r.references,r))}}))}(t,r,void 0)}function b(t){switch(null==t?void 0:t.kind){case e.FileIncludeKind.Import:case e.FileIncludeKind.ReferenceFile:case e.FileIncludeKind.TypeReferenceDirective:case e.FileIncludeKind.LibReferenceDirective:return !0;default:return !1}}function x(e){return void 0!==e.pos}function D(t,r){var n,i,a,o,s,c,l,u,_,d,p=e.Debug.checkDefined(t(r.file)),f=r.kind,g=r.index;switch(f){case e.FileIncludeKind.Import:var y=P(p,g);if(d=null===(s=null===(o=p.resolvedModules)||void 0===o?void 0:o.get(y.text,m(p,g)))||void 0===s?void 0:s.packageId,-1===y.pos)return {file:p,packageId:d,text:y.text};u=e.skipTrivia(p.text,y.pos),_=y.end;break;case e.FileIncludeKind.ReferenceFile:u=(n=p.referencedFiles[g]).pos,_=n.end;break;case e.FileIncludeKind.TypeReferenceDirective:u=(i=p.typeReferenceDirectives[g]).pos,_=i.end,d=null===(l=null===(c=p.resolvedTypeReferenceDirectiveNames)||void 0===c?void 0:c.get(e.toFileNameLowerCase(p.typeReferenceDirectives[g].fileName),p.impliedNodeFormat))||void 0===l?void 0:l.packageId;break;case e.FileIncludeKind.LibReferenceDirective:u=(a=p.libReferenceDirectives[g]).pos,_=a.end;break;default:return e.Debug.assertNever(f)}return {file:p,pos:u,end:_,packageId:d}}function S(t,r,n,i){switch(e.getEmitModuleResolutionKind(i)){case e.ModuleResolutionKind.Node12:case e.ModuleResolutionKind.NodeNext:return e.fileExtensionIsOneOf(t,[".d.mts",".mts",".mjs"])?e.ModuleKind.ESNext:e.fileExtensionIsOneOf(t,[".d.cts",".cts",".cjs"])?e.ModuleKind.CommonJS:e.fileExtensionIsOneOf(t,[".d.ts",".ts",".tsx",".js",".jsx"])?"module"===(null==(a=e.getPackageScopeForPath(t,r,n,i))?void 0:a.packageJsonContent.type)?e.ModuleKind.ESNext:e.ModuleKind.CommonJS:void 0;default:return}var a;}function T(t,r,i,a){var o=t.getCompilerOptions();if(o.noEmit)return t.getSemanticDiagnostics(r,a),r||e.outFile(o)?e.emitSkippedWithNoDiagnostics:t.emitBuildInfo(i,a);if(o.noEmitOnError){var s=n$3(n$3(n$3(n$3([],t.getOptionsDiagnostics(a),!0),t.getSyntacticDiagnostics(r,a),!0),t.getGlobalDiagnostics(a),!0),t.getSemanticDiagnostics(r,a),!0);if(0===s.length&&e.getEmitDeclarations(t.getCompilerOptions())&&(s=t.getDeclarationDiagnostics(void 0,a)),s.length){var c;if(!r&&!e.outFile(o)){var l=t.emitBuildInfo(i,a);l.diagnostics&&(s=n$3(n$3([],s,!0),l.diagnostics,!0)),c=l.emittedFiles;}return {diagnostics:s,sourceMaps:void 0,emittedFiles:c,emitSkipped:!0}}}}function C(t,r){return e.filter(t,(function(e){return !e.skippedOn||!r[e.skippedOn]}))}function E(t,r){return void 0===r&&(r=t),{fileExists:function(e){return r.fileExists(e)},readDirectory:function(t,n,i,a,o){return e.Debug.assertIsDefined(r.readDirectory,"'CompilerHost.readDirectory' must be implemented to correctly process 'projectReferences'"),r.readDirectory(t,n,i,a,o)},readFile:function(e){return r.readFile(e)},useCaseSensitiveFileNames:t.useCaseSensitiveFileNames(),getCurrentDirectory:function(){return t.getCurrentDirectory()},onUnRecoverableConfigFileDiagnostic:t.onUnRecoverableConfigFileDiagnostic||e.returnUndefined,trace:t.trace?function(e){return t.trace(e)}:void 0}}function k(t,r,n){if(!t)return e.emptyArray;for(var i,a=0;a<t.length;a++){var o=t[a],s=r(o,a);if(o.prepend&&s&&s.options){if(!e.outFile(s.options))continue;var c=e.getOutputPathsForBundle(s.options,!0),l=c.jsFilePath,u=c.sourceMapFilePath,_=c.declarationFilePath,d=c.declarationMapPath,p=c.buildInfoPath,f=e.createInputFiles(n,l,u,_,d,p);(i||(i=[])).push(f);}}return i||e.emptyArray}function N(t,r){var n=r||t;return e.resolveConfigFileProjectName(n.path)}function F(t,r){switch(r.extension){case".ts":case".d.ts":return;case".tsx":return n();case".jsx":return n()||i();case".js":return i();case".json":return t.resolveJsonModule?void 0:e.Diagnostics.Module_0_was_resolved_to_1_but_resolveJsonModule_is_not_used}function n(){return t.jsx?void 0:e.Diagnostics.Module_0_was_resolved_to_1_but_jsx_is_not_set}function i(){return e.getAllowJSCompilerOption(t)||!e.getStrictOptionValue(t,"noImplicitAny")?void 0:e.Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type}}function A(e){for(var t=e.imports,r=e.moduleAugmentations,n=t.map((function(e){return e.text})),i=0,a=r;i<a.length;i++){var o=a[i];10===o.kind&&n.push(o.text);}return n}function P(t,r){var n=t.imports,i=t.moduleAugmentations;if(r<n.length)return n[r];for(var a=n.length,o=0,s=i;o<s.length;o++){var c=s[o];if(10===c.kind){if(r===a)return c;a++;}}e.Debug.fail("should never ask for module name at index higher than possible module name");}e.formatColorAndReset=_,e.formatLocation=p,e.formatDiagnosticsWithColorAndContext=function(t,r){for(var n="",i=0,a=t;i<a.length;i++){var s=a[i];if(s.file&&(n+=p(y=s.file,v=s.start,r),n+=" - "),n+=_(e.diagnosticCategoryName(s),u(s.category)),n+=_(" TS".concat(s.code,": "),o.Grey),n+=f(s.messageText,r.getNewLine()),s.file&&(n+=r.getNewLine(),n+=d(s.file,s.start,s.length,"",u(s.category),r)),s.relatedInformation){n+=r.getNewLine();for(var c=0,g=s.relatedInformation;c<g.length;c++){var m=g[c],y=m.file,v=m.start,h=m.length,b=m.messageText;y&&(n+=r.getNewLine(),n+=" "+p(y,v,r),n+=d(y,v,h,l,o.Cyan,r)),n+=r.getNewLine(),n+=l+f(b,r.getNewLine());}}n+=r.getNewLine();}return n},e.flattenDiagnosticMessageText=f,e.loadWithLocalCache=g,e.getModeForResolutionAtIndex=m,e.getModeForUsageLocation=y,e.loadWithModeAwareCache=v,e.forEachResolvedProjectReference=function(e,t){return h(void 0,e,(function(e,r){return e&&t(e,r)}))},e.inferredTypesContainingFile="__inferred type names__.ts",e.isReferencedFile=b,e.isReferenceFileLocation=x,e.getReferencedFileLocation=D,e.isProgramUptoDate=function(t,r,n,i,a,o,s,c,l){if(!t||(null==s?void 0:s()))return !1;if(!e.arrayIsEqualTo(t.getRootFileNames(),r))return !1;var u;if(!e.arrayIsEqualTo(t.getProjectReferences(),l,(function(r,n,i){return e.projectReferenceIsEqualTo(r,n)&&d(t.getResolvedProjectReferences()[i],r)})))return !1;if(t.getSourceFiles().some((function(e){return !function(e){return e.version===i(e.resolvedPath,e.fileName)}(e)||o(e.path)})))return !1;if(t.getMissingFilePaths().some(a))return !1;var _=t.getCompilerOptions();return !(!e.compareDataObjects(_,n)||_.configFile&&n.configFile&&_.configFile.text!==n.configFile.text);function d(t,r){if(t){if(e.contains(u,t))return !0;var n=N(r),i=c(n);return !!i&&t.commandLine.options.configFile===i.options.configFile&&!!e.arrayIsEqualTo(t.commandLine.fileNames,i.fileNames)&&((u||(u=[])).push(t),!e.forEach(t.references,(function(e,r){return !d(e,t.commandLine.projectReferences[r])})))}var a=N(r);return !c(a)}},e.getConfigFileParsingDiagnostics=function(e){return e.options.configFile?n$3(n$3([],e.options.configFile.parseDiagnostics,!0),e.errors,!0):e.errors},e.getImpliedNodeFormatForFile=S,e.createProgram=function(i,a,o,s,c){var l,u,_,d,p,f,y,P,w,I,O,M,L,R=e.isArray(i)?function(e,t,r,n,i){return {rootNames:e,options:t,host:r,oldProgram:n,configFileParsingDiagnostics:i}}(i,a,o,s,c):i,B=R.rootNames,j=R.options,J=R.configFileParsingDiagnostics,z=R.projectReferences,U=R.oldProgram,K=new e.Map,V=e.createMultiMap(),q={},W={},H=new e.Map,G="number"==typeof j.maxNodeModuleJsDepth?j.maxNodeModuleJsDepth:0,Q=0,X=new e.Map,Y=new e.Map;null===e.tracing||void 0===e.tracing||e.tracing.push("program","createProgram",{configFilePath:j.configFilePath,rootDir:j.rootDir},!0),e.performance.mark("beforeProgram");var Z,$,ee,te,re,ne=R.host||r(j),ie=E(ne),ae=j.noLib,oe=e.memoize((function(){return ne.getDefaultLibFileName(j)})),se=ne.getDefaultLibLocation?ne.getDefaultLibLocation():e.getDirectoryPath(oe()),ce=e.createDiagnosticCollection(),le=ne.getCurrentDirectory(),ue=e.getSupportedExtensions(j),_e=e.getSupportedExtensionsWithJsonIfResolveJsonModule(j,ue),de=new e.Map,pe=ne.hasInvalidatedResolution||e.returnFalse;if(ne.resolveModuleNames)te=function(t,r,n,i,a){return ne.resolveModuleNames(e.Debug.checkEachDefined(t),n,i,a,j,r).map((function(t){if(!t||void 0!==t.extension)return t;var r=e.clone(t);return r.extension=e.extensionFromPath(t.resolvedFileName),r}))},$=null===(l=ne.getModuleResolutionCache)||void 0===l?void 0:l.call(ne);else {$=e.createModuleResolutionCache(le,qt,j);var fe=function(t,r,n,i){return e.resolveModuleName(t,n,j,ne,$,i,r).resolvedModule};te=function(t,r,n,i,a){return v(e.Debug.checkEachDefined(t),r,n,a,fe)};}if(ne.resolveTypeReferenceDirectives)re=function(t,r,n){return ne.resolveTypeReferenceDirectives(e.Debug.checkEachDefined(t),r,n,j)};else {ee=e.createTypeReferenceDirectiveResolutionCache(le,qt,void 0,null==$?void 0:$.getPackageJsonInfoCache());var ge=function(t,r,n){return e.resolveTypeReferenceDirective(t,r,j,ne,n,ee).resolvedTypeReferenceDirective};re=function(t,r,n){return g(e.Debug.checkEachDefined(t),r,n,ge)};}var me,ye,ve,he,be,xe=new e.Map,De=new e.Map,Se=e.createMultiMap(),Te=!1,Ce=new e.Map,Ee=ne.useCaseSensitiveFileNames()?new e.Map:void 0,ke=!!(null===(u=ne.useSourceOfProjectReferenceRedirect)||void 0===u?void 0:u.call(ne))&&!j.disableSourceOfProjectReferenceRedirect,Ne=function(t){var r,n,i=t.compilerHost.fileExists,a=t.compilerHost.directoryExists,o=t.compilerHost.getDirectories,s=t.compilerHost.realpath;return t.useSourceOfProjectReferenceRedirect?(t.compilerHost.fileExists=c,a&&(n=t.compilerHost.directoryExists=function(n){return a.call(t.compilerHost,n)?(function(r){var n;if(t.getResolvedProjectReferences()&&!e.containsIgnoredPath(r)&&s&&e.stringContains(r,e.nodeModulesPathPart)){var i=t.getSymlinkCache(),a=e.ensureTrailingDirectorySeparator(t.toPath(r));if(!(null===(n=i.getSymlinkedDirectories())||void 0===n?void 0:n.has(a))){var o,c=e.normalizePath(s.call(t.compilerHost,r));c!==r&&(o=e.ensureTrailingDirectorySeparator(t.toPath(c)))!==a?i.setSymlinkedDirectory(r,{real:e.ensureTrailingDirectorySeparator(c),realPath:o}):i.setSymlinkedDirectory(a,!1);}}}(n),!0):!!t.getResolvedProjectReferences()&&(r||(r=new e.Set,t.forEachResolvedProjectReference((function(n){var i=e.outFile(n.commandLine.options);if(i)r.add(e.getDirectoryPath(t.toPath(i)));else {var a=n.commandLine.options.declarationDir||n.commandLine.options.outDir;a&&r.add(t.toPath(a));}}))),l(n,!1))}),o&&(t.compilerHost.getDirectories=function(e){return !t.getResolvedProjectReferences()||a&&a.call(t.compilerHost,e)?o.call(t.compilerHost,e):[]}),s&&(t.compilerHost.realpath=function(e){var r;return (null===(r=t.getSymlinkCache().getSymlinkedFiles())||void 0===r?void 0:r.get(t.toPath(e)))||s.call(t.compilerHost,e)}),{onProgramCreateComplete:function(){t.compilerHost.fileExists=i,t.compilerHost.directoryExists=a,t.compilerHost.getDirectories=o;},fileExists:c,directoryExists:n}):{onProgramCreateComplete:e.noop,fileExists:c};function c(r){return !!i.call(t.compilerHost,r)||!!t.getResolvedProjectReferences()&&!!e.isDeclarationFileName(r)&&l(r,!0)}function l(n,a){var o,s=a?function(r){return function(r){var n=t.getSourceOfProjectReferenceRedirect(t.toPath(r));return void 0!==n?!e.isString(n)||i.call(t.compilerHost,n):void 0}(r)}:function(n){return function(n){var i=t.toPath(n),a="".concat(i).concat(e.directorySeparator);return e.forEachKey(r,(function(t){return i===t||e.startsWith(t,a)||e.startsWith(i,"".concat(t,"/"))}))}(n)},c=s(n);if(void 0!==c)return c;var l=t.getSymlinkCache(),u=l.getSymlinkedDirectories();if(!u)return !1;var _=t.toPath(n);return !!e.stringContains(_,e.nodeModulesPathPart)&&(!(!a||!(null===(o=l.getSymlinkedFiles())||void 0===o?void 0:o.has(_)))||e.firstDefinedIterator(u.entries(),(function(r){var i=r[0],o=r[1];if(o&&e.startsWith(_,i)){var c=s(_.replace(i,o.realPath));if(a&&c){var u=e.getNormalizedAbsolutePath(n,t.compilerHost.getCurrentDirectory());l.setSymlinkedFile(_,"".concat(o.real).concat(u.replace(new RegExp(i,"i"),"")));}return c}}))||!1)}}({compilerHost:ne,getSymlinkCache:ur,useSourceOfProjectReferenceRedirect:ke,toPath:Xe,getResolvedProjectReferences:et,getSourceOfProjectReferenceRedirect:Rt,forEachResolvedProjectReference:Lt}),Fe=Ne.onProgramCreateComplete,Ae=Ne.fileExists,Pe=Ne.directoryExists,we=ne.readFile.bind(ne);null===e.tracing||void 0===e.tracing||e.tracing.push("program","shouldProgramCreateNewSourceFiles",{hasOldProgram:!!U});var Ie,Oe=function(t,r){return !!t&&e.optionsHaveChanges(t.getCompilerOptions(),r,e.sourceFileAffectingCompilerOptions)}(U,j);if(null===e.tracing||void 0===e.tracing||e.tracing.pop(),null===e.tracing||void 0===e.tracing||e.tracing.push("program","tryReuseStructureFromOldProgram",{}),Ie=function(){var t;if(!U)return 0;var r=U.getCompilerOptions();if(e.changesAffectModuleResolution(r,j))return 0;var n=U.getRootFileNames();if(!e.arrayIsEqualTo(n,B))return 0;if(h(U.getProjectReferences(),U.getResolvedProjectReferences(),(function(t,r,n){var i=Ht((r?r.commandLine.projectReferences:z)[n]);return t?!i||i.sourceFile!==t.sourceFile||!e.arrayIsEqualTo(t.commandLine.fileNames,i.commandLine.fileNames):void 0!==i}),(function(t,r){var n=r?jt(r.sourceFile.path).commandLine.projectReferences:z;return !e.arrayIsEqualTo(t,n,e.projectReferenceIsEqualTo)})))return 0;z&&(ye=z.map(Ht));var i=[],a=[];if(Ie=2,U.getMissingFilePaths().some((function(e){return ne.fileExists(e)})))return 0;var o,s=U.getSourceFiles();!function(e){e[e.Exists=0]="Exists",e[e.Modified=1]="Modified";}(o||(o={}));for(var c=new e.Map,l=0,u=s;l<u.length;l++){var _=u[l];if(!(M=ne.getSourceFileByPath?ne.getSourceFileByPath(_.fileName,_.resolvedPath,e.getEmitScriptTarget(j),void 0,Oe):ne.getSourceFile(_.fileName,e.getEmitScriptTarget(j),void 0,Oe)))return 0;e.Debug.assert(!M.redirectInfo,"Host should not return a redirect source file from `getSourceFile`");var d=void 0;if(_.redirectInfo){if(M!==_.redirectInfo.unredirected)return 0;d=!1,M=_;}else if(U.redirectTargetsMap.has(_.path)){if(M!==_)return 0;d=!1;}else d=M!==_;M.path=_.path,M.originalFileName=_.originalFileName,M.resolvedPath=_.resolvedPath,M.fileName=_.fileName;var p=U.sourceFileToPackageName.get(_.path);if(void 0!==p){var f=c.get(p),g=d?1:0;if(void 0!==f&&1===g||1===f)return 0;c.set(p,g);}d?(e.arrayIsEqualTo(_.libReferenceDirectives,M.libReferenceDirectives,xt)||(Ie=1),_.hasNoDefaultLib!==M.hasNoDefaultLib&&(Ie=1),e.arrayIsEqualTo(_.referencedFiles,M.referencedFiles,xt)||(Ie=1),Tt(M),e.arrayIsEqualTo(_.imports,M.imports,Dt)||(Ie=1),e.arrayIsEqualTo(_.moduleAugmentations,M.moduleAugmentations,Dt)||(Ie=1),(3145728&_.flags)!=(3145728&M.flags)&&(Ie=1),e.arrayIsEqualTo(_.typeReferenceDirectives,M.typeReferenceDirectives,xt)||(Ie=1),a.push({oldFile:_,newFile:M})):pe(_.path)&&(Ie=1,a.push({oldFile:_,newFile:M})),i.push(M);}if(2!==Ie)return Ie;for(var m=a.map((function(e){return e.oldFile})),v=0,b=s;v<b.length;v++){var x=b[v];if(!e.contains(m,x))for(var D=0,S=x.ambientModuleNames;D<S.length;D++){var T=S[D];K.set(T,x.fileName);}}for(var C=0,E=a;C<E.length;C++){var k=E[C],N=(_=k.oldFile,A(M=k.newFile)),F=Ze(N,M);e.hasChangesInResolutions(N,F,_.resolvedModules,_,e.moduleResolutionIsEqualTo)?(Ie=1,M.resolvedModules=e.zipToModeAwareCache(M,N,F)):M.resolvedModules=_.resolvedModules;var P=e.map(M.typeReferenceDirectives,(function(t){return e.toFileNameLowerCase(t.fileName)})),w=We(P,M);e.hasChangesInResolutions(P,w,_.resolvedTypeReferenceDirectiveNames,_,e.typeDirectiveIsEqualTo)?(Ie=1,M.resolvedTypeReferenceDirectiveNames=e.zipToModeAwareCache(M,P,w)):M.resolvedTypeReferenceDirectiveNames=_.resolvedTypeReferenceDirectiveNames;}if(2!==Ie)return Ie;if(e.changesAffectingProgramStructure(r,j)||(null===(t=ne.hasChangedAutomaticTypeDirectiveNames)||void 0===t?void 0:t.call(ne)))return 1;me=U.getMissingFilePaths(),e.Debug.assert(i.length===U.getSourceFiles().length);for(var I=0,O=i;I<O.length;I++){var M=O[I];Ce.set(M.path,M);}return U.getFilesByNameMap().forEach((function(e,t){e?e.path!==t?Ce.set(t,Ce.get(e.path)):U.isSourceFileFromExternalLibrary(e)&&Y.set(e.path,!0):Ce.set(t,e);})),y=i,V=U.getFileIncludeReasons(),L=U.getFileProcessingDiagnostics(),H=U.getResolvedTypeReferenceDirectives(),De=U.sourceFileToPackageName,Se=U.redirectTargetsMap,Te=U.usesUriStyleNodeCoreModules,2}(),null===e.tracing||void 0===e.tracing||e.tracing.pop(),2!==Ie){p=[],f=[],z&&(ye||(ye=z.map(Ht)),B.length&&(null==ye||ye.forEach((function(t,r){if(t){var n=e.outFile(t.commandLine.options);if(ke){if(n||e.getEmitModuleKind(t.commandLine.options)===e.ModuleKind.None)for(var i=0,a=t.commandLine.fileNames;i<a.length;i++)kt(l=a[i],{kind:e.FileIncludeKind.SourceFromProjectReference,index:r});}else if(n)kt(e.changeExtension(n,".d.ts"),{kind:e.FileIncludeKind.OutputFromProjectReference,index:r});else if(e.getEmitModuleKind(t.commandLine.options)===e.ModuleKind.None)for(var o=e.memoize((function(){return e.getCommonSourceDirectoryOfConfig(t.commandLine,!ne.useCaseSensitiveFileNames())})),s=0,c=t.commandLine.fileNames;s<c.length;s++){var l=c[s];e.fileExtensionIs(l,".d.ts")||e.fileExtensionIs(l,".json")||kt(e.getOutputDeclarationFileName(l,t.commandLine,!ne.useCaseSensitiveFileNames(),o),{kind:e.FileIncludeKind.OutputFromProjectReference,index:r});}}})))),null===e.tracing||void 0===e.tracing||e.tracing.push("program","processRootFiles",{count:B.length}),e.forEach(B,(function(t,r){return bt(t,!1,!1,{kind:e.FileIncludeKind.RootFile,index:r})})),null===e.tracing||void 0===e.tracing||e.tracing.pop();var Me=B.length?e.getAutomaticTypeDirectiveNames(j,ne):e.emptyArray;if(Me.length){null===e.tracing||void 0===e.tracing||e.tracing.push("program","processTypeReferences",{count:Me.length});for(var Le=j.configFilePath?e.getDirectoryPath(j.configFilePath):ne.getCurrentDirectory(),Re=We(Me,e.combinePaths(Le,e.inferredTypesContainingFile)),Be=0;Be<Me.length;Be++)Ut(Me[Be],Re[Be],{kind:e.FileIncludeKind.AutomaticTypeDirectiveFile,typeReference:Me[Be],packageId:null===(_=Re[Be])||void 0===_?void 0:_.packageId});null===e.tracing||void 0===e.tracing||e.tracing.pop();}if(B.length&&!ae){var je=oe();!j.lib&&je?bt(je,!0,!1,{kind:e.FileIncludeKind.LibFile}):e.forEach(j.lib,(function(t,r){bt(Kt(t),!0,!1,{kind:e.FileIncludeKind.LibFile,index:r});}));}me=e.arrayFrom(e.mapDefinedIterator(Ce.entries(),(function(e){var t=e[0];return void 0===e[1]?t:void 0}))),y=e.stableSort(p,(function(t,r){return e.compareValues(Qe(t),Qe(r))})).concat(f),p=void 0,f=void 0;}if(e.Debug.assert(!!me),U&&ne.onReleaseOldSourceFile){for(var Je=0,ze=U.getSourceFiles();Je<ze.length;Je++){var Ue=ze[Je],Ke=st(Ue.resolvedPath);(Oe||!Ke||Ue.resolvedPath===Ue.path&&Ke.resolvedPath!==Ue.path)&&ne.onReleaseOldSourceFile(Ue,U.getCompilerOptions(),!!st(Ue.path));}ne.getParsedCommandLine||U.forEachResolvedProjectReference((function(e){jt(e.sourceFile.path)||ne.onReleaseOldSourceFile(e.sourceFile,U.getCompilerOptions(),!1);}));}U&&ne.onReleaseParsedCommandLine&&h(U.getProjectReferences(),U.getResolvedProjectReferences(),(function(e,t,r){var n=N((null==t?void 0:t.commandLine.projectReferences[r])||U.getProjectReferences()[r]);(null==ve?void 0:ve.has(Xe(n)))||ne.onReleaseParsedCommandLine(n,e,U.getCompilerOptions());})),ee=void 0,U=void 0;var Ve={getRootFileNames:function(){return B},getSourceFile:ot,getSourceFileByPath:st,getSourceFiles:function(){return y},getMissingFilePaths:function(){return me},getModuleResolutionCache:function(){return $},getFilesByNameMap:function(){return Ce},getCompilerOptions:function(){return j},getSyntacticDiagnostics:function(e,t){return ct(e,ut,t)},getOptionsDiagnostics:function(){return e.sortAndDeduplicateDiagnostics(e.concatenate(ce.getGlobalDiagnostics(),function(){if(!j.configFile)return e.emptyArray;var t=ce.getDiagnostics(j.configFile.fileName);return Lt((function(r){t=e.concatenate(t,ce.getDiagnostics(r.sourceFile.fileName));})),t}()))},getGlobalDiagnostics:function(){return B.length?e.sortAndDeduplicateDiagnostics(nt().getGlobalDiagnostics().slice()):e.emptyArray},getSemanticDiagnostics:function(e,t){return ct(e,dt,t)},getCachedSemanticDiagnostics:function(e){var t;return e?null===(t=q.perFile)||void 0===t?void 0:t.get(e.path):q.allDiagnostics},getSuggestionDiagnostics:function(e,t){return _t((function(){return nt().getSuggestionDiagnostics(e,t)}))},getDeclarationDiagnostics:function(t,r){var n=Ve.getCompilerOptions();return !t||e.outFile(n)?mt(t,r):ct(t,ht,r)},getBindAndCheckDiagnostics:function(e,t){return pt(e,t)},getProgramDiagnostics:lt,getTypeChecker:it,getClassifiableNames:function(){var t;if(!M){it(),M=new e.Set;for(var r=0,n=y;r<n.length;r++){null===(t=n[r].classifiableNames)||void 0===t||t.forEach((function(e){return M.add(e)}));}}return M},getDiagnosticsProducingTypeChecker:nt,getCommonSourceDirectory:Ye,emit:function(t,r,n,i,a,o){null===e.tracing||void 0===e.tracing||e.tracing.push("emit","emit",{path:null==t?void 0:t.path},!0);var s=_t((function(){return function(t,r,n,i,a,o,s){if(!s){var c=T(t,r,n,i);if(c)return c}var l=nt().getEmitResolver(e.outFile(j)?void 0:r,i);e.performance.mark("beforeEmit");var u=e.emitFiles(l,$e(n),r,e.getTransformers(j,o,a),a,!1,s);return e.performance.mark("afterEmit"),e.performance.measure("Emit","beforeEmit","afterEmit"),u}(Ve,t,r,n,i,a,o)}));return null===e.tracing||void 0===e.tracing||e.tracing.pop(),s},getCurrentDirectory:function(){return le},getNodeCount:function(){return nt().getNodeCount()},getIdentifierCount:function(){return nt().getIdentifierCount()},getSymbolCount:function(){return nt().getSymbolCount()},getTypeCount:function(){return nt().getTypeCount()},getInstantiationCount:function(){return nt().getInstantiationCount()},getRelationCacheSizes:function(){return nt().getRelationCacheSizes()},getFileProcessingDiagnostics:function(){return L},getResolvedTypeReferenceDirectives:function(){return H},isSourceFileFromExternalLibrary:rt,isSourceFileDefaultLibrary:function(t){if(t.hasNoDefaultLib)return !0;if(!j.noLib)return !1;var r=ne.useCaseSensitiveFileNames()?e.equateStringsCaseSensitive:e.equateStringsCaseInsensitive;return j.lib?e.some(j.lib,(function(e){return r(t.fileName,Kt(e))})):r(t.fileName,oe())},dropDiagnosticsProducingTypeChecker:function(){I=void 0;},getSourceFileFromReference:function(e,r){return Ct(t(r.fileName,e.fileName),ot)},getLibFileFromReference:function(t){var r=e.toFileNameLowerCase(t.fileName),n=e.libMap.get(r);if(n)return ot(Kt(n))},sourceFileToPackageName:De,redirectTargetsMap:Se,usesUriStyleNodeCoreModules:Te,isEmittedFile:function(t){if(j.noEmit)return !1;var r=Xe(t);if(st(r))return !1;var n=e.outFile(j);if(n)return lr(r,n)||lr(r,e.removeFileExtension(n)+".d.ts");if(j.declarationDir&&e.containsPath(j.declarationDir,r,le,!ne.useCaseSensitiveFileNames()))return !0;if(j.outDir)return e.containsPath(j.outDir,r,le,!ne.useCaseSensitiveFileNames());if(e.fileExtensionIsOneOf(r,e.supportedJSExtensionsFlat)||e.fileExtensionIs(r,".d.ts")){var i=e.removeFileExtension(r);return !!st(i+".ts")||!!st(i+".tsx")}return !1},getConfigFileParsingDiagnostics:function(){return J||e.emptyArray},getResolvedModuleWithFailedLookupLocationsFromCache:function(t,r,n){return $&&e.resolveModuleNameFromCache(t,r,$,n)},getProjectReferences:function(){return z},getResolvedProjectReferences:et,getProjectReferenceRedirect:wt,getResolvedProjectReferenceToRedirect:Mt,getResolvedProjectReferenceByPath:jt,forEachResolvedProjectReference:Lt,isSourceOfProjectReferenceRedirect:Bt,emitBuildInfo:function(t){e.Debug.assert(!e.outFile(j)),null===e.tracing||void 0===e.tracing||e.tracing.push("emit","emitBuildInfo",{},!0),e.performance.mark("beforeEmit");var r=e.emitFiles(e.notImplementedResolver,$e(t),void 0,e.noTransformers,!1,!0);return e.performance.mark("afterEmit"),e.performance.measure("Emit","beforeEmit","afterEmit"),null===e.tracing||void 0===e.tracing||e.tracing.pop(),r},fileExists:Ae,readFile:we,directoryExists:Pe,getSymlinkCache:ur,realpath:null===(d=ne.realpath)||void 0===d?void 0:d.bind(ne),useCaseSensitiveFileNames:function(){return ne.useCaseSensitiveFileNames()},getFileIncludeReasons:function(){return V},structureIsReused:Ie};return Fe(),null==L||L.forEach((function(t){switch(t.kind){case 1:return ce.add(Gt(t.file&&st(t.file),t.fileProcessingReason,t.diagnostic,t.args||e.emptyArray));case 0:var r=D(st,t.reason),i=r.file,a=r.pos,o=r.end;return ce.add(e.createFileDiagnostic.apply(void 0,n$3([i,e.Debug.checkDefined(a),e.Debug.checkDefined(o)-a,t.diagnostic],t.args||e.emptyArray,!1)));default:e.Debug.assertNever(t);}})),function(){e.stringContains(e.version,"-dev")||(e.getEmitModuleKind(j)===e.ModuleKind.Node12?nr("module",e.Diagnostics.Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next,"module","node12"):e.getEmitModuleKind(j)===e.ModuleKind.NodeNext?nr("module",e.Diagnostics.Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next,"module","nodenext"):e.getEmitModuleResolutionKind(j)===e.ModuleResolutionKind.Node12?nr("moduleResolution",e.Diagnostics.Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next,"moduleResolution","node12"):e.getEmitModuleResolutionKind(j)===e.ModuleResolutionKind.NodeNext&&nr("moduleResolution",e.Diagnostics.Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next,"moduleResolution","nodenext")),j.strictPropertyInitialization&&!e.getStrictOptionValue(j,"strictNullChecks")&&rr(e.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1,"strictPropertyInitialization","strictNullChecks"),j.exactOptionalPropertyTypes&&!e.getStrictOptionValue(j,"strictNullChecks")&&rr(e.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1,"exactOptionalPropertyTypes","strictNullChecks"),j.isolatedModules&&(j.out&&rr(e.Diagnostics.Option_0_cannot_be_specified_with_option_1,"out","isolatedModules"),j.outFile&&rr(e.Diagnostics.Option_0_cannot_be_specified_with_option_1,"outFile","isolatedModules")),j.inlineSourceMap&&(j.sourceMap&&rr(e.Diagnostics.Option_0_cannot_be_specified_with_option_1,"sourceMap","inlineSourceMap"),j.mapRoot&&rr(e.Diagnostics.Option_0_cannot_be_specified_with_option_1,"mapRoot","inlineSourceMap")),j.composite&&(!1===j.declaration&&rr(e.Diagnostics.Composite_projects_may_not_disable_declaration_emit,"declaration"),!1===j.incremental&&rr(e.Diagnostics.Composite_projects_may_not_disable_incremental_compilation,"declaration"));var t,r=e.outFile(j);if(j.tsBuildInfoFile?e.isIncrementalCompilation(j)||rr(e.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1_or_option_2,"tsBuildInfoFile","incremental","composite"):!j.incremental||r||j.configFilePath||ce.add(e.createCompilerDiagnostic(e.Diagnostics.Option_incremental_can_only_be_specified_using_tsconfig_emitting_to_single_file_or_when_option_tsBuildInfoFile_is_specified)),t=j.suppressOutputPathCheck?void 0:e.getTsBuildInfoEmitOutputFilePath(j),h(z,ye,(function(r,n,i){var a=(n?n.commandLine.projectReferences:z)[i],o=n&&n.sourceFile;if(r){var s=r.commandLine.options;if(s.composite&&!s.noEmit||(n?n.commandLine.fileNames:B).length&&(s.composite||ir(o,i,e.Diagnostics.Referenced_project_0_must_have_setting_composite_Colon_true,a.path),s.noEmit&&ir(o,i,e.Diagnostics.Referenced_project_0_may_not_disable_emit,a.path)),a.prepend){var c=e.outFile(s);c?ne.fileExists(c)||ir(o,i,e.Diagnostics.Output_file_0_from_project_1_does_not_exist,c,a.path):ir(o,i,e.Diagnostics.Cannot_prepend_project_0_because_it_does_not_have_outFile_set,a.path);}!n&&t&&t===e.getTsBuildInfoEmitOutputFilePath(s)&&(ir(o,i,e.Diagnostics.Cannot_write_file_0_because_it_will_overwrite_tsbuildinfo_file_generated_by_referenced_project_1,t,a.path),de.set(Xe(t),!0));}else ir(o,i,e.Diagnostics.File_0_not_found,a.path);})),j.composite)for(var n=new e.Set(B.map(Xe)),i=0,a=y;i<a.length;i++){var o=a[i];e.sourceFileMayBeEmitted(o,Ve)&&!n.has(o.path)&&Xt(o,e.Diagnostics.File_0_is_not_listed_within_the_file_list_of_project_1_Projects_must_list_all_files_or_use_an_include_pattern,[o.fileName,j.configFilePath||""]);}if(j.paths)for(var s in j.paths)if(e.hasProperty(j.paths,s))if(e.hasZeroOrOneAsteriskCharacter(s)||Zt(!0,s,e.Diagnostics.Pattern_0_can_have_at_most_one_Asterisk_character,s),e.isArray(j.paths[s])){var c=j.paths[s].length;0===c&&Zt(!1,s,e.Diagnostics.Substitutions_for_pattern_0_shouldn_t_be_an_empty_array,s);for(var l=0;l<c;l++){var u=j.paths[s][l],_=typeof u;"string"===_?(e.hasZeroOrOneAsteriskCharacter(u)||Yt(s,l,e.Diagnostics.Substitution_0_in_pattern_1_can_have_at_most_one_Asterisk_character,u,s),j.baseUrl||e.pathIsRelative(u)||e.pathIsAbsolute(u)||Yt(s,l,e.Diagnostics.Non_relative_paths_are_not_allowed_when_baseUrl_is_not_set_Did_you_forget_a_leading_Slash)):Yt(s,l,e.Diagnostics.Substitution_0_for_pattern_1_has_incorrect_type_expected_string_got_2,u,s,_);}}else Zt(!1,s,e.Diagnostics.Substitutions_for_pattern_0_should_be_an_array,s);j.sourceMap||j.inlineSourceMap||(j.inlineSources&&rr(e.Diagnostics.Option_0_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided,"inlineSources"),j.sourceRoot&&rr(e.Diagnostics.Option_0_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided,"sourceRoot")),j.out&&j.outFile&&rr(e.Diagnostics.Option_0_cannot_be_specified_with_option_1,"out","outFile"),!j.mapRoot||j.sourceMap||j.declarationMap||rr(e.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1_or_option_2,"mapRoot","sourceMap","declarationMap"),j.declarationDir&&(e.getEmitDeclarations(j)||rr(e.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1_or_option_2,"declarationDir","declaration","composite"),r&&rr(e.Diagnostics.Option_0_cannot_be_specified_with_option_1,"declarationDir",j.out?"out":"outFile")),j.declarationMap&&!e.getEmitDeclarations(j)&&rr(e.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1_or_option_2,"declarationMap","declaration","composite"),j.lib&&j.noLib&&rr(e.Diagnostics.Option_0_cannot_be_specified_with_option_1,"lib","noLib"),j.noImplicitUseStrict&&e.getStrictOptionValue(j,"alwaysStrict")&&rr(e.Diagnostics.Option_0_cannot_be_specified_with_option_1,"noImplicitUseStrict","alwaysStrict");var d=e.getEmitScriptTarget(j),p=e.find(y,(function(t){return e.isExternalModule(t)&&!t.isDeclarationFile}));if(j.isolatedModules){j.module===e.ModuleKind.None&&d<2&&rr(e.Diagnostics.Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES2015_or_higher,"isolatedModules","target"),!1===j.preserveConstEnums&&rr(e.Diagnostics.Option_preserveConstEnums_cannot_be_disabled_when_isolatedModules_is_enabled,"preserveConstEnums","isolatedModules");var f=e.find(y,(function(t){return !e.isExternalModule(t)&&!e.isSourceFileJS(t)&&!t.isDeclarationFile&&6!==t.scriptKind}));if(f){var g=e.getErrorSpanForNode(f,f);ce.add(e.createFileDiagnostic(f,g.start,g.length,e.Diagnostics._0_cannot_be_compiled_under_isolatedModules_because_it_is_considered_a_global_script_file_Add_an_import_export_or_an_empty_export_statement_to_make_it_a_module,e.getBaseFileName(f.fileName)));}}else p&&d<2&&j.module===e.ModuleKind.None&&(g=e.getErrorSpanForNode(p,p.externalModuleIndicator),ce.add(e.createFileDiagnostic(p,g.start,g.length,e.Diagnostics.Cannot_use_imports_exports_or_module_augmentations_when_module_is_none)));if(r&&!j.emitDeclarationOnly&&(j.module&&j.module!==e.ModuleKind.AMD&&j.module!==e.ModuleKind.System?rr(e.Diagnostics.Only_amd_and_system_modules_are_supported_alongside_0,j.out?"out":"outFile","module"):void 0===j.module&&p&&(g=e.getErrorSpanForNode(p,p.externalModuleIndicator),ce.add(e.createFileDiagnostic(p,g.start,g.length,e.Diagnostics.Cannot_compile_modules_using_option_0_unless_the_module_flag_is_amd_or_system,j.out?"out":"outFile")))),j.resolveJsonModule&&(e.getEmitModuleResolutionKind(j)!==e.ModuleResolutionKind.NodeJs&&e.getEmitModuleResolutionKind(j)!==e.ModuleResolutionKind.Node12&&e.getEmitModuleResolutionKind(j)!==e.ModuleResolutionKind.NodeNext?rr(e.Diagnostics.Option_resolveJsonModule_cannot_be_specified_without_node_module_resolution_strategy,"resolveJsonModule"):e.hasJsonModuleEmitEnabled(j)||rr(e.Diagnostics.Option_resolveJsonModule_can_only_be_specified_when_module_code_generation_is_commonjs_amd_es2015_or_esNext,"resolveJsonModule","module")),j.outDir||j.rootDir||j.sourceRoot||j.mapRoot){var m=Ye();j.outDir&&""===m&&y.some((function(t){return e.getRootLength(t.fileName)>1}))&&rr(e.Diagnostics.Cannot_find_the_common_subdirectory_path_for_the_input_files,"outDir");}if(j.useDefineForClassFields&&0===d&&rr(e.Diagnostics.Option_0_cannot_be_specified_when_option_target_is_ES3,"useDefineForClassFields"),j.checkJs&&!e.getAllowJSCompilerOption(j)&&ce.add(e.createCompilerDiagnostic(e.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1,"checkJs","allowJs")),j.emitDeclarationOnly&&(e.getEmitDeclarations(j)||rr(e.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1_or_option_2,"emitDeclarationOnly","declaration","composite"),j.noEmit&&rr(e.Diagnostics.Option_0_cannot_be_specified_with_option_1,"emitDeclarationOnly","noEmit")),j.emitDecoratorMetadata&&!j.experimentalDecorators&&rr(e.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1,"emitDecoratorMetadata","experimentalDecorators"),j.jsxFactory?(j.reactNamespace&&rr(e.Diagnostics.Option_0_cannot_be_specified_with_option_1,"reactNamespace","jsxFactory"),4!==j.jsx&&5!==j.jsx||rr(e.Diagnostics.Option_0_cannot_be_specified_when_option_jsx_is_1,"jsxFactory",e.inverseJsxOptionMap.get(""+j.jsx)),e.parseIsolatedEntityName(j.jsxFactory,d)||nr("jsxFactory",e.Diagnostics.Invalid_value_for_jsxFactory_0_is_not_a_valid_identifier_or_qualified_name,j.jsxFactory)):j.reactNamespace&&!e.isIdentifierText(j.reactNamespace,d)&&nr("reactNamespace",e.Diagnostics.Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier,j.reactNamespace),j.jsxFragmentFactory&&(j.jsxFactory||rr(e.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1,"jsxFragmentFactory","jsxFactory"),4!==j.jsx&&5!==j.jsx||rr(e.Diagnostics.Option_0_cannot_be_specified_when_option_jsx_is_1,"jsxFragmentFactory",e.inverseJsxOptionMap.get(""+j.jsx)),e.parseIsolatedEntityName(j.jsxFragmentFactory,d)||nr("jsxFragmentFactory",e.Diagnostics.Invalid_value_for_jsxFragmentFactory_0_is_not_a_valid_identifier_or_qualified_name,j.jsxFragmentFactory)),j.reactNamespace&&(4!==j.jsx&&5!==j.jsx||rr(e.Diagnostics.Option_0_cannot_be_specified_when_option_jsx_is_1,"reactNamespace",e.inverseJsxOptionMap.get(""+j.jsx))),j.jsxImportSource&&2===j.jsx&&rr(e.Diagnostics.Option_0_cannot_be_specified_when_option_jsx_is_1,"jsxImportSource",e.inverseJsxOptionMap.get(""+j.jsx)),j.preserveValueImports&&e.getEmitModuleKind(j)<e.ModuleKind.ES2015&&nr("importsNotUsedAsValues",e.Diagnostics.Option_preserveValueImports_can_only_be_used_when_module_is_set_to_es2015_or_later),!j.noEmit&&!j.suppressOutputPathCheck){var v=$e(),b=new e.Set;e.forEachEmittedFile(v,(function(e){j.emitDeclarationOnly||x(e.jsFilePath,b),x(e.declarationFilePath,b);}));}function x(t,r){if(t){var n=Xe(t);if(Ce.has(n)){var i=void 0;j.configFilePath||(i=e.chainDiagnosticMessages(void 0,e.Diagnostics.Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript_files_Learn_more_at_https_Colon_Slash_Slashaka_ms_Slashtsconfig)),i=e.chainDiagnosticMessages(i,e.Diagnostics.Cannot_write_file_0_because_it_would_overwrite_input_file,t),cr(t,e.createCompilerDiagnosticFromMessageChain(i));}var a=ne.useCaseSensitiveFileNames()?n:e.toFileNameLowerCase(n);r.has(a)?cr(t,e.createCompilerDiagnostic(e.Diagnostics.Cannot_write_file_0_because_it_would_be_overwritten_by_multiple_input_files,t)):r.add(a);}}}(),e.performance.mark("afterProgram"),e.performance.measure("Program","beforeProgram","afterProgram"),null===e.tracing||void 0===e.tracing||e.tracing.pop(),Ve;function qe(t,r,n){if(!t.length)return e.emptyArray;var i=e.getNormalizedAbsolutePath(r.originalFileName,le),a=He(r);null===e.tracing||void 0===e.tracing||e.tracing.push("program","resolveModuleNamesWorker",{containingFileName:i}),e.performance.mark("beforeResolveModule");var o=te(t,r,i,n,a);return e.performance.mark("afterResolveModule"),e.performance.measure("ResolveModule","beforeResolveModule","afterResolveModule"),null===e.tracing||void 0===e.tracing||e.tracing.pop(),o}function We(t,r){if(!t.length)return [];var n=e.isString(r)?r:e.getNormalizedAbsolutePath(r.originalFileName,le),i=e.isString(r)?void 0:He(r);null===e.tracing||void 0===e.tracing||e.tracing.push("program","resolveTypeReferenceDirectiveNamesWorker",{containingFileName:n}),e.performance.mark("beforeResolveTypeReference");var a=re(t,n,i);return e.performance.mark("afterResolveTypeReference"),e.performance.measure("ResolveTypeReference","beforeResolveTypeReference","afterResolveTypeReference"),null===e.tracing||void 0===e.tracing||e.tracing.pop(),a}function He(t){var r=Mt(t.originalFileName);if(r||!e.fileExtensionIsOneOf(t.originalFileName,[".d.ts",".d.cts",".d.mts"]))return r;var n=Ge(t.path);if(n)return n;if(ne.realpath&&j.preserveSymlinks&&e.stringContains(t.originalFileName,e.nodeModulesPathPart)){var i=Xe(ne.realpath(t.originalFileName));return i===t.path?void 0:Ge(i)}}function Ge(t){var r=Rt(t);return e.isString(r)?Mt(r):r?Lt((function(r){var n=e.outFile(r.commandLine.options);if(n)return Xe(n)===t?r:void 0})):void 0}function Qe(t){if(e.containsPath(se,t.fileName,!1)){var r=e.getBaseFileName(t.fileName);if("lib.d.ts"===r||"lib.es6.d.ts"===r)return 0;var n=e.removeSuffix(e.removePrefix(r,"lib."),".d.ts"),i=e.libs.indexOf(n);if(-1!==i)return i+1}return e.libs.length+2}function Xe(t){return e.toPath(t,le,qt)}function Ye(){if(void 0===w){var t=e.filter(y,(function(t){return e.sourceFileMayBeEmitted(t,Ve)}));w=e.getCommonSourceDirectory(j,(function(){return e.mapDefined(t,(function(e){return e.isDeclarationFile?void 0:e.fileName}))}),le,qt,(function(r){return function(t,r){for(var n=!0,i=ne.getCanonicalFileName(e.getNormalizedAbsolutePath(r,le)),a=0,o=t;a<o.length;a++){var s=o[a];s.isDeclarationFile||0!==ne.getCanonicalFileName(e.getNormalizedAbsolutePath(s.fileName,le)).indexOf(i)&&(Xt(s,e.Diagnostics.File_0_is_not_under_rootDir_1_rootDir_is_expected_to_contain_all_source_files,[s.fileName,r]),n=!1);}return n}(t,r)}));}return w}function Ze(t,r){if(0===Ie&&!r.ambientModuleNames.length)return qe(t,r,void 0);var n,i,a,o=U&&U.getSourceFile(r.fileName);if(o!==r&&r.resolvedModules){for(var s=[],c=0,l=0,u=t;l<u.length;l++){var _=u[l],d=r.resolvedModules.get(_,m(r,c));c++,s.push(d);}return s}var p={};for(c=0;c<t.length;c++){if(_=t[c],r===o&&!pe(o.path)){var f=e.getResolvedModule(o,_,m(o,c));if(f){e.isTraceEnabled(j,ne)&&e.trace(ne,f.packageId?e.Diagnostics.Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package_ID_3:e.Diagnostics.Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2,_,e.getNormalizedAbsolutePath(r.originalFileName,le),f.resolvedFileName,f.packageId&&e.packageIdToString(f.packageId)),(i||(i=new Array(t.length)))[c]=f,(a||(a=[])).push(_);continue}}var g=!1;e.contains(r.ambientModuleNames,_)?(g=!0,e.isTraceEnabled(j,ne)&&e.trace(ne,e.Diagnostics.Module_0_was_resolved_as_locally_declared_ambient_module_in_file_1,_,e.getNormalizedAbsolutePath(r.originalFileName,le))):g=h(_,c),g?(i||(i=new Array(t.length)))[c]=p:(n||(n=[])).push(_);}var y=n&&n.length?qe(n,r,a):e.emptyArray;if(!i)return e.Debug.assert(y.length===t.length),y;var v=0;for(c=0;c<i.length;c++)i[c]?i[c]===p&&(i[c]=void 0):(i[c]=y[v],v++);return e.Debug.assert(v===y.length),i;function h(t,r){if(r>=e.length(null==o?void 0:o.imports)+e.length(null==o?void 0:o.moduleAugmentations))return !1;var n=e.getResolvedModule(o,t,o&&m(o,r)),i=n&&U.getSourceFile(n.resolvedFileName);if(n&&i)return !1;var a=K.get(t);return !!a&&(e.isTraceEnabled(j,ne)&&e.trace(ne,e.Diagnostics.Module_0_was_resolved_as_ambient_module_declared_in_1_since_this_file_was_not_modified,t,a),!0)}}function $e(t){return {getPrependNodes:tt,getCanonicalFileName:qt,getCommonSourceDirectory:Ve.getCommonSourceDirectory,getCompilerOptions:Ve.getCompilerOptions,getCurrentDirectory:function(){return le},getNewLine:function(){return ne.getNewLine()},getSourceFile:Ve.getSourceFile,getSourceFileByPath:Ve.getSourceFileByPath,getSourceFiles:Ve.getSourceFiles,getLibFileFromReference:Ve.getLibFileFromReference,isSourceFileFromExternalLibrary:rt,getResolvedProjectReferenceToRedirect:Mt,getProjectReferenceRedirect:wt,isSourceOfProjectReferenceRedirect:Bt,getSymlinkCache:ur,writeFile:t||function(e,t,r,n,i){return ne.writeFile(e,t,r,n,i)},isEmitBlocked:at,readFile:function(e){return ne.readFile(e)},fileExists:function(t){var r=Xe(t);return !!st(r)||!e.contains(me,r)&&ne.fileExists(t)},useCaseSensitiveFileNames:function(){return ne.useCaseSensitiveFileNames()},getProgramBuildInfo:function(){return Ve.getProgramBuildInfo&&Ve.getProgramBuildInfo()},getSourceFileFromReference:function(e,t){return Ve.getSourceFileFromReference(e,t)},redirectTargetsMap:Se,getFileIncludeReasons:Ve.getFileIncludeReasons}}function et(){return ye}function tt(){return k(z,(function(e,t){var r;return null===(r=ye[t])||void 0===r?void 0:r.commandLine}),(function(e){var t=Xe(e),r=st(t);return r?r.text:Ce.has(t)?void 0:ne.readFile(t)}))}function rt(e){return !!Y.get(e.path)}function nt(){return I||(I=e.createTypeChecker(Ve,!0))}function it(){return O||(O=e.createTypeChecker(Ve,!1))}function at(e){return de.has(Xe(e))}function ot(e){return st(Xe(e))}function st(e){return Ce.get(e)||void 0}function ct(t,r,n){return t?r(t,n):e.sortAndDeduplicateDiagnostics(e.flatMap(Ve.getSourceFiles(),(function(e){return n&&n.throwIfCancellationRequested(),r(e,n)})))}function lt(t){var r;if(e.skipTypeChecking(t,j,Ve))return e.emptyArray;var n=ce.getDiagnostics(t.fileName);return (null===(r=t.commentDirectives)||void 0===r?void 0:r.length)?gt(t,t.commentDirectives,n).diagnostics:n}function ut(t){return e.isSourceFileJS(t)?(t.additionalSyntacticDiagnostics||(t.additionalSyntacticDiagnostics=function(t){return _t((function(){var r=[];return n(t,t),e.forEachChildRecursively(t,n,(function(t,n){switch(n.decorators!==t||j.experimentalDecorators||r.push(a(n,e.Diagnostics.Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_in_your_tsconfig_or_jsconfig_to_remove_this_warning)),n.kind){case 256:case 225:case 168:case 170:case 171:case 172:case 212:case 255:case 213:if(t===n.typeParameters)return r.push(i(t,e.Diagnostics.Type_parameter_declarations_can_only_be_used_in_TypeScript_files)),"skip";case 236:if(t===n.modifiers)return function(t,n){for(var i=0,o=t;i<o.length;i++){var s=o[i];switch(s.kind){case 85:if(n)continue;case 123:case 121:case 122:case 144:case 135:case 126:case 158:r.push(a(s,e.Diagnostics.The_0_modifier_can_only_be_used_in_TypeScript_files,e.tokenToString(s.kind)));}}}(n.modifiers,236===n.kind),"skip";break;case 166:if(t===n.modifiers){for(var o=0,s=t;o<s.length;o++){var c=s[o];124!==c.kind&&r.push(a(c,e.Diagnostics.The_0_modifier_can_only_be_used_in_TypeScript_files,e.tokenToString(c.kind)));}return "skip"}break;case 163:if(t===n.modifiers)return r.push(i(t,e.Diagnostics.Parameter_modifiers_can_only_be_used_in_TypeScript_files)),"skip";break;case 207:case 208:case 227:case 278:case 279:case 209:if(t===n.typeArguments)return r.push(i(t,e.Diagnostics.Type_arguments_can_only_be_used_in_TypeScript_files)),"skip"}})),r;function n(t,n){switch(n.kind){case 163:case 166:case 168:if(n.questionToken===t)return r.push(a(t,e.Diagnostics.The_0_modifier_can_only_be_used_in_TypeScript_files,"?")),"skip";case 167:case 170:case 171:case 172:case 212:case 255:case 213:case 253:if(n.type===t)return r.push(a(t,e.Diagnostics.Type_annotations_can_only_be_used_in_TypeScript_files)),"skip"}switch(t.kind){case 266:if(t.isTypeOnly)return r.push(a(n,e.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files,"import type")),"skip";break;case 271:if(t.isTypeOnly)return r.push(a(t,e.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files,"export type")),"skip";break;case 264:return r.push(a(t,e.Diagnostics.import_can_only_be_used_in_TypeScript_files)),"skip";case 270:if(t.isExportEquals)return r.push(a(t,e.Diagnostics.export_can_only_be_used_in_TypeScript_files)),"skip";break;case 290:if(117===t.token)return r.push(a(t,e.Diagnostics.implements_clauses_can_only_be_used_in_TypeScript_files)),"skip";break;case 257:var i=e.tokenToString(118);return e.Debug.assertIsDefined(i),r.push(a(t,e.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files,i)),"skip";case 260:var o=16&t.flags?e.tokenToString(142):e.tokenToString(141);return e.Debug.assertIsDefined(o),r.push(a(t,e.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files,o)),"skip";case 258:return r.push(a(t,e.Diagnostics.Type_aliases_can_only_be_used_in_TypeScript_files)),"skip";case 259:var s=e.Debug.checkDefined(e.tokenToString(92));return r.push(a(t,e.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files,s)),"skip";case 229:return r.push(a(t,e.Diagnostics.Non_null_assertions_can_only_be_used_in_TypeScript_files)),"skip";case 228:return r.push(a(t.type,e.Diagnostics.Type_assertion_expressions_can_only_be_used_in_TypeScript_files)),"skip";case 210:e.Debug.fail();}}function i(r,n,i,a,o){var s=r.pos;return e.createFileDiagnostic(t,s,r.end-s,n,i,a,o)}function a(r,n,i,a,o){return e.createDiagnosticForNodeInSourceFile(t,r,n,i,a,o)}}))}(t)),e.concatenate(t.additionalSyntacticDiagnostics,t.parseDiagnostics)):t.parseDiagnostics}function _t(t){try{return t()}catch(t){throw t instanceof e.OperationCanceledException&&(O=void 0,I=void 0),t}}function dt(t,r){return e.concatenate(C(pt(t,r),j),lt(t))}function pt(e,t){return vt(e,t,q,ft)}function ft(t,r){return _t((function(){if(e.skipTypeChecking(t,j,Ve))return e.emptyArray;var n=nt();e.Debug.assert(!!t.bindDiagnostics);var i=e.isCheckJsEnabledForFile(t,j),a=!(t.checkJsDirective&&!1===t.checkJsDirective.enabled)&&(3===t.scriptKind||4===t.scriptKind||5===t.scriptKind||i||7===t.scriptKind),o=a?t.bindDiagnostics:e.emptyArray,s=a?n.getDiagnostics(t,r):e.emptyArray;return function(t,r){for(var n,i=[],a=2;a<arguments.length;a++)i[a-2]=arguments[a];var o=e.flatten(i);if(!r||!(null===(n=t.commentDirectives)||void 0===n?void 0:n.length))return o;for(var s=gt(t,t.commentDirectives,o),c=s.diagnostics,l=s.directives,u=0,_=l.getUnusedExpectations();u<_.length;u++){var d=_[u];c.push(e.createDiagnosticForRange(t,d.range,e.Diagnostics.Unused_ts_expect_error_directive));}return c}(t,a,o,s,i?t.jsDocDiagnostics:void 0)}))}function gt(t,r,n){var i=e.createCommentDirectivesMap(t,r);return {diagnostics:n.filter((function(t){return -1===function(t,r){var n=t.file,i=t.start;if(!n)return -1;for(var a=e.getLineStarts(n),o=e.computeLineAndCharacterOfPosition(a,i).line-1;o>=0;){if(r.markUsed(o))return o;var s=n.text.slice(a[o],a[o+1]).trim();if(""!==s&&!/^(\s*)\/\/(.*)$/.test(s))return -1;o--;}return -1}(t,i)})),directives:i}}function mt(e,t){return vt(e,t,W,yt)}function yt(t,r){return _t((function(){var n=nt().getEmitResolver(t,r);return e.getDeclarationDiagnostics($e(e.noop),n,t)||e.emptyArray}))}function vt(t,r,n,i){var a,o=t?null===(a=n.perFile)||void 0===a?void 0:a.get(t.path):n.allDiagnostics;if(o)return o;var s=i(t,r);return t?(n.perFile||(n.perFile=new e.Map)).set(t.path,s):n.allDiagnostics=s,s}function ht(e,t){return e.isDeclarationFile?[]:mt(e,t)}function bt(t,r,n,i){Et(e.normalizePath(t),r,n,void 0,i);}function xt(e,t){return e.fileName===t.fileName}function Dt(e,t){return 79===e.kind?79===t.kind&&e.escapedText===t.escapedText:10===t.kind&&e.text===t.text}function St(t,r){var n=e.factory.createStringLiteral(t),i=e.factory.createImportDeclaration(void 0,void 0,void 0,n,void 0);return e.addEmitFlags(i,67108864),e.setParent(n,i),e.setParent(i,r),n.flags&=-9,i.flags&=-9,n}function Tt(t){if(!t.imports){var r,n,i,a=e.isSourceFileJS(t),o=e.isExternalModule(t);if((j.isolatedModules||o)&&!t.isDeclarationFile){j.importHelpers&&(r=[St(e.externalHelpersModuleNameText,t)]);var s=e.getJSXRuntimeImport(e.getJSXImplicitImportBase(j,t),j);s&&(r||(r=[])).push(St(s,t));}for(var c=0,l=t.statements;c<l.length;c++)u(l[c],!1);return (1048576&t.flags||a)&&function(t){for(var n=/import|require/g;null!==n.exec(t.text);){var i=_(t,n.lastIndex);a&&e.isRequireCall(i,!0)||e.isImportCall(i)&&i.arguments.length>=1&&e.isStringLiteralLike(i.arguments[0])?(e.setParentRecursive(i,!1),r=e.append(r,i.arguments[0])):e.isLiteralImportTypeNode(i)&&(e.setParentRecursive(i,!1),r=e.append(r,i.argument.literal));}}(t),t.imports=r||e.emptyArray,t.moduleAugmentations=n||e.emptyArray,void(t.ambientModuleNames=i||e.emptyArray)}function u(a,s){if(e.isAnyImportOrReExport(a)){var c=e.getExternalModuleName(a);!(c&&e.isStringLiteral(c)&&c.text)||s&&e.isExternalModuleNameRelative(c.text)||(e.setParentRecursive(a,!1),r=e.append(r,c),Te||0!==Q||t.isDeclarationFile||(Te=e.startsWith(c.text,"node:")));}else if(e.isModuleDeclaration(a)&&e.isAmbientModule(a)&&(s||e.hasSyntacticModifier(a,2)||t.isDeclarationFile)){a.name.parent=a;var l=e.getTextOfIdentifierOrLiteral(a.name);if(o||s&&!e.isExternalModuleNameRelative(l))(n||(n=[])).push(a.name);else if(!s){t.isDeclarationFile&&(i||(i=[])).push(l);var _=a.body;if(_)for(var d=0,p=_.statements;d<p.length;d++)u(p[d],!0);}}}function _(t,r){for(var n=t,i=function(e){if(e.pos<=r&&(r<e.end||r===e.end&&1===e.kind))return e};;){var o=a&&e.hasJSDocNodes(n)&&e.forEach(n.jsDoc,i)||e.forEachChild(n,i);if(!o)return n;n=o;}}}function Ct(t,r,n,i){if(e.hasExtension(t)){var a=ne.getCanonicalFileName(t);if(!j.allowNonTsExtensions&&!e.forEach(e.flatten(_e),(function(t){return e.fileExtensionIs(a,t)})))return void(n&&(e.hasJSFileExtension(a)?n(e.Diagnostics.File_0_is_a_JavaScript_file_Did_you_mean_to_enable_the_allowJs_option,t):n(e.Diagnostics.File_0_has_an_unsupported_extension_The_only_supported_extensions_are_1,t,"'"+e.flatten(ue).join("', '")+"'")));var o=r(t);if(n)if(o)b(i)&&a===ne.getCanonicalFileName(st(i.file).fileName)&&n(e.Diagnostics.A_file_cannot_have_a_reference_to_itself);else {var s=wt(t);s?n(e.Diagnostics.Output_file_0_has_not_been_built_from_source_file_1,s,t):n(e.Diagnostics.File_0_not_found,t);}return o}var c=j.allowNonTsExtensions&&r(t);if(c)return c;if(!n||!j.allowNonTsExtensions){var l=e.forEach(ue[0],(function(e){return r(t+e)}));return n&&!l&&n(e.Diagnostics.Could_not_resolve_the_path_0_with_the_extensions_Colon_1,t,"'"+e.flatten(ue).join("', '")+"'"),l}n(e.Diagnostics.File_0_not_found,t);}function Et(e,t,r,n,i){Ct(e,(function(e){return Ft(e,t,r,i,n)}),(function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return Qt(void 0,i,e,t)}),i);}function kt(e,t){return Et(e,!1,!1,void 0,t)}function Nt(t,r,n){!b(n)&&e.some(V.get(r.path),b)?Qt(r,n,e.Diagnostics.Already_included_file_name_0_differs_from_file_name_1_only_in_casing,[r.fileName,t]):Qt(r,n,e.Diagnostics.File_name_0_differs_from_already_included_file_name_1_only_in_casing,[t,r.fileName]);}function Ft(t,r,n,i,a){null===e.tracing||void 0===e.tracing||e.tracing.push("program","findSourceFile",{fileName:t,isDefaultLib:r||void 0,fileIncludeKind:e.FileIncludeKind[i.kind]});var o=function(t,r,n,i,a){var o=Xe(t);if(ke){var s=Rt(o);if(!s&&ne.realpath&&j.preserveSymlinks&&e.isDeclarationFileName(t)&&e.stringContains(t,e.nodeModulesPathPart)){var c=Xe(ne.realpath(t));c!==o&&(s=Rt(c));}if(s){var l=e.isString(s)?Ft(s,r,n,i,a):void 0;return l&&Pt(l,o,void 0),l}}var u,_=t;if(Ce.has(o)){var d=Ce.get(o);if(At(d||void 0,i),d&&j.forceConsistentCasingInFileNames){var g=d.fileName;Xe(g)!==Xe(t)&&(t=wt(t)||t),e.getNormalizedAbsolutePathWithoutRoot(g,le)!==e.getNormalizedAbsolutePathWithoutRoot(t,le)&&Nt(t,d,i);}return d&&Y.get(d.path)&&0===Q?(Y.set(d.path,!1),j.noResolve||(Jt(d,r),zt(d)),j.noLib||Vt(d),X.set(d.path,!1),Wt(d)):d&&X.get(d.path)&&Q<G&&(X.set(d.path,!1),Wt(d)),d||void 0}if(b(i)&&!ke){var m=It(t);if(m){if(e.outFile(m.commandLine.options))return;var y=Ot(m,t);t=y,u=Xe(y);}}var v=ne.getSourceFile(t,e.getEmitScriptTarget(j),(function(r){return Qt(void 0,i,e.Diagnostics.Cannot_read_file_0_Colon_1,[t,r])}),Oe);if(a){var h=e.packageIdToString(a),x=xe.get(h);if(x){var D=function(e,t,r,n,i,a){var o=Object.create(e);return o.fileName=r,o.path=n,o.resolvedPath=i,o.originalFileName=a,o.redirectInfo={redirectTarget:e,unredirected:t},Y.set(n,Q>0),Object.defineProperties(o,{id:{get:function(){return this.redirectInfo.redirectTarget.id},set:function(e){this.redirectInfo.redirectTarget.id=e;}},symbol:{get:function(){return this.redirectInfo.redirectTarget.symbol},set:function(e){this.redirectInfo.redirectTarget.symbol=e;}}}),o}(x,v,t,o,Xe(t),_);return Se.add(x.path,t),Pt(D,o,u),At(D,i),De.set(o,a.name),f.push(D),D}v&&(xe.set(h,v),De.set(o,a.name));}if(Pt(v,o,u),v){if(Y.set(o,Q>0),v.fileName=t,v.path=o,v.resolvedPath=Xe(t),v.originalFileName=_,v.impliedNodeFormat=S(v.resolvedPath,null==$?void 0:$.getPackageJsonInfoCache(),ne,j),At(v,i),ne.useCaseSensitiveFileNames()){var T=e.toFileNameLowerCase(o),C=Ee.get(T);C?Nt(t,C,i):Ee.set(T,v);}ae=ae||v.hasNoDefaultLib&&!n,j.noResolve||(Jt(v,r),zt(v)),j.noLib||Vt(v),Wt(v),r?p.push(v):f.push(v);}return v}(t,r,n,i,a);return null===e.tracing||void 0===e.tracing||e.tracing.pop(),o}function At(e,t){e&&V.add(e.path,t);}function Pt(e,t,r){r?(Ce.set(r,e),Ce.set(t,e||!1)):Ce.set(t,e);}function wt(e){var t=It(e);return t&&Ot(t,e)}function It(t){if(ye&&ye.length&&!e.fileExtensionIs(t,".d.ts")&&!e.fileExtensionIs(t,".json"))return Mt(t)}function Ot(t,r){var n=e.outFile(t.commandLine.options);return n?e.changeExtension(n,".d.ts"):e.getOutputDeclarationFileName(r,t.commandLine,!ne.useCaseSensitiveFileNames())}function Mt(t){void 0===he&&(he=new e.Map,Lt((function(e){Xe(j.configFilePath)!==e.sourceFile.path&&e.commandLine.fileNames.forEach((function(t){return he.set(Xe(t),e.sourceFile.path)}));})));var r=he.get(Xe(t));return r&&jt(r)}function Lt(t){return e.forEachResolvedProjectReference(ye,t)}function Rt(t){if(e.isDeclarationFileName(t))return void 0===be&&(be=new e.Map,Lt((function(t){var r=e.outFile(t.commandLine.options);if(r){var n=e.changeExtension(r,".d.ts");be.set(Xe(n),!0);}else {var i=e.memoize((function(){return e.getCommonSourceDirectoryOfConfig(t.commandLine,!ne.useCaseSensitiveFileNames())}));e.forEach(t.commandLine.fileNames,(function(r){if(!e.fileExtensionIs(r,".d.ts")&&!e.fileExtensionIs(r,".json")){var n=e.getOutputDeclarationFileName(r,t.commandLine,!ne.useCaseSensitiveFileNames(),i);be.set(Xe(n),r);}}));}}))),be.get(t)}function Bt(e){return ke&&!!Mt(e)}function jt(e){if(ve)return ve.get(e)||void 0}function Jt(r,n){e.forEach(r.referencedFiles,(function(i,a){Et(t(i.fileName,r.fileName),n,!1,void 0,{kind:e.FileIncludeKind.ReferenceFile,file:r.path,index:a});}));}function zt(t){var r=e.map(t.typeReferenceDirectives,(function(t){return e.toFileNameLowerCase(t.fileName)}));if(r)for(var n=We(r,t),i=0;i<r.length;i++){var a=t.typeReferenceDirectives[i],o=n[i],s=e.toFileNameLowerCase(a.fileName);e.setResolvedTypeReferenceDirective(t,s,o),Ut(s,o,{kind:e.FileIncludeKind.TypeReferenceDirective,file:t.path,index:i});}}function Ut(t,r,n){null===e.tracing||void 0===e.tracing||e.tracing.push("program","processTypeReferenceDirective",{directive:t,hasResolved:!!Ze,refKind:n.kind,refPath:b(n)?n.file:void 0}),function(t,r,n){var i=H.get(t);if(!i||!i.primary){var a=!0;if(r){if(r.isExternalLibraryImport&&Q++,r.primary)Et(r.resolvedFileName,!1,!1,r.packageId,n);else if(i){if(r.resolvedFileName!==i.resolvedFileName){var o=ne.readFile(r.resolvedFileName),s=ot(i.resolvedFileName);o!==s.text&&Qt(s,n,e.Diagnostics.Conflicting_definitions_for_0_found_at_1_and_2_Consider_installing_a_specific_version_of_this_library_to_resolve_the_conflict,[t,r.resolvedFileName,i.resolvedFileName]);}a=!1;}else Et(r.resolvedFileName,!1,!1,r.packageId,n);r.isExternalLibraryImport&&Q--;}else Qt(void 0,n,e.Diagnostics.Cannot_find_type_definition_file_for_0,[t]);a&&H.set(t,r);}}(t,r,n),null===e.tracing||void 0===e.tracing||e.tracing.pop();}function Kt(t){for(var r=t.split("."),n=r[1],i=2;r[i]&&"d"!==r[i];)n+=(2===i?"/":"-")+r[i],i++;var a=e.combinePaths(le,"__lib_node_modules_lookup_".concat(t,"__.ts")),o=e.resolveModuleName("@typescript/lib-"+n,a,{moduleResolution:e.ModuleResolutionKind.NodeJs},ne,$);return (null==o?void 0:o.resolvedModule)?o.resolvedModule.resolvedFileName:e.combinePaths(se,t)}function Vt(t){e.forEach(t.libReferenceDirectives,(function(r,n){var i=e.toFileNameLowerCase(r.fileName),a=e.libMap.get(i);if(a)bt(Kt(a),!0,!0,{kind:e.FileIncludeKind.LibReferenceDirective,file:t.path,index:n});else {var o=e.removeSuffix(e.removePrefix(i,"lib."),".d.ts"),s=e.getSpellingSuggestion(o,e.libs,e.identity),c=s?e.Diagnostics.Cannot_find_lib_definition_for_0_Did_you_mean_1:e.Diagnostics.Cannot_find_lib_definition_for_0;(L||(L=[])).push({kind:0,reason:{kind:e.FileIncludeKind.LibReferenceDirective,file:t.path,index:n},diagnostic:c,args:[i,s]});}}));}function qt(e){return ne.getCanonicalFileName(e)}function Wt(t){var r;if(Tt(t),t.imports.length||t.moduleAugmentations.length){var n=A(t),i=Ze(n,t);e.Debug.assert(i.length===n.length);for(var a=(ke?null===(r=He(t))||void 0===r?void 0:r.commandLine.options:void 0)||j,o=0;o<n.length;o++){var s=i[o];if(e.setResolvedModule(t,n[o],s,m(t,o)),s){var c=s.isExternalLibraryImport,l=!e.resolutionExtensionIsTSOrJson(s.extension),u=c&&l,_=s.resolvedFileName;c&&Q++;var d=u&&Q>G,p=_&&!F(a,s)&&!a.noResolve&&o<t.imports.length&&!d&&!(l&&!e.getAllowJSCompilerOption(a))&&(e.isInJSFile(t.imports[o])||!(4194304&t.imports[o].flags));d?X.set(t.path,!0):p&&Ft(_,!1,!1,{kind:e.FileIncludeKind.Import,file:t.path,index:o},s.packageId),c&&Q--;}}}else t.resolvedModules=void 0;}function Ht(t){ve||(ve=new e.Map);var r,n,i=N(t),a=Xe(i),o=ve.get(a);if(void 0!==o)return o||void 0;if(ne.getParsedCommandLine){if(!(r=ne.getParsedCommandLine(i)))return Pt(void 0,a,void 0),void ve.set(a,!1);n=e.Debug.checkDefined(r.options.configFile),e.Debug.assert(!n.path||n.path===a),Pt(n,a,void 0);}else {var s=e.getNormalizedAbsolutePath(e.getDirectoryPath(i),ne.getCurrentDirectory());if(Pt(n=ne.getSourceFile(i,100),a,void 0),void 0===n)return void ve.set(a,!1);r=e.parseJsonSourceFileConfigFileContent(n,ie,s,void 0,i);}n.fileName=i,n.path=a,n.resolvedPath=a,n.originalFileName=i;var c={commandLine:r,sourceFile:n};return ve.set(a,c),r.projectReferences&&(c.references=r.projectReferences.map(Ht)),c}function Gt(t,r,i,a){var o,s,c,l=b(r)?r:void 0;t&&(null===(o=V.get(t.path))||void 0===o||o.forEach(f)),r&&f(r),l&&1===(null==s?void 0:s.length)&&(s=void 0);var u=l&&D(st,l),_=s&&e.chainDiagnosticMessages(s,e.Diagnostics.The_file_is_in_the_program_because_Colon),d=t&&e.explainIfFileIsRedirect(t),p=e.chainDiagnosticMessages.apply(void 0,n$3([d?_?n$3([_],d,!0):d:_,i],a||e.emptyArray,!1));return u&&x(u)?e.createFileDiagnosticFromMessageChain(u.file,u.pos,u.end-u.pos,p,c):e.createCompilerDiagnosticFromMessageChain(p,c);function f(t){(s||(s=[])).push(e.fileIncludeReasonToDiagnostics(Ve,t)),!l&&b(t)?l=t:l!==t&&(c=e.append(c,function(t){if(b(t)){var r,n=D(st,t);switch(t.kind){case e.FileIncludeKind.Import:r=e.Diagnostics.File_is_included_via_import_here;break;case e.FileIncludeKind.ReferenceFile:r=e.Diagnostics.File_is_included_via_reference_here;break;case e.FileIncludeKind.TypeReferenceDirective:r=e.Diagnostics.File_is_included_via_type_library_reference_here;break;case e.FileIncludeKind.LibReferenceDirective:r=e.Diagnostics.File_is_included_via_library_reference_here;break;default:e.Debug.assertNever(t);}return x(n)?e.createFileDiagnostic(n.file,n.pos,n.end-n.pos,r):void 0}if(j.configFile){var i,a,o,s;switch(t.kind){case e.FileIncludeKind.RootFile:if(!j.configFile.configFileSpecs)return;var c=e.getNormalizedAbsolutePath(B[t.index],le),l=e.getMatchedFileSpec(Ve,c);if(l){i=e.getTsConfigPropArrayElementValue(j.configFile,"files",l),a=e.Diagnostics.File_is_matched_by_files_list_specified_here;break}var u=e.getMatchedIncludeSpec(Ve,c);if(!u)return;i=e.getTsConfigPropArrayElementValue(j.configFile,"include",u),a=e.Diagnostics.File_is_matched_by_include_pattern_specified_here;break;case e.FileIncludeKind.SourceFromProjectReference:case e.FileIncludeKind.OutputFromProjectReference:var _=e.Debug.checkDefined(null==ye?void 0:ye[t.index]),d=h(z,ye,(function(e,t,r){return e===_?{sourceFile:(null==t?void 0:t.sourceFile)||j.configFile,index:r}:void 0}));if(!d)return;var p=d.sourceFile,f=d.index,g=e.firstDefined(e.getTsConfigPropArray(p,"references"),(function(t){return e.isArrayLiteralExpression(t.initializer)?t.initializer:void 0}));return g&&g.elements.length>f?e.createDiagnosticForNodeInSourceFile(p,g.elements[f],t.kind===e.FileIncludeKind.OutputFromProjectReference?e.Diagnostics.File_is_output_from_referenced_project_specified_here:e.Diagnostics.File_is_source_from_referenced_project_specified_here):void 0;case e.FileIncludeKind.AutomaticTypeDirectiveFile:if(!j.types)return;i=tr("types",t.typeReference),a=e.Diagnostics.File_is_entry_point_of_type_library_specified_here;break;case e.FileIncludeKind.LibFile:if(void 0!==t.index){i=tr("lib",j.lib[t.index]),a=e.Diagnostics.File_is_library_specified_here;break}var m=e.forEachEntry(e.targetOptionDeclaration.type,(function(t,r){return t===e.getEmitScriptTarget(j)?r:void 0}));i=m?(o=m,(s=$t("target"))&&e.firstDefined(s,(function(t){return e.isStringLiteral(t.initializer)&&t.initializer.text===o?t.initializer:void 0}))):void 0,a=e.Diagnostics.File_is_default_library_for_target_specified_here;break;default:e.Debug.assertNever(t);}return i&&e.createDiagnosticForNodeInSourceFile(j.configFile,i,a)}}(t))),t===r&&(r=void 0);}}function Qt(e,t,r,n){(L||(L=[])).push({kind:1,file:e&&e.path,fileProcessingReason:t,diagnostic:r,args:n});}function Xt(e,t,r){ce.add(Gt(e,void 0,t,r));}function Yt(t,r,n,i,a,o){for(var s=!0,c=0,l=er();c<l.length;c++){var u=l[c];if(e.isObjectLiteralExpression(u.initializer))for(var _=0,d=e.getPropertyAssignment(u.initializer,t);_<d.length;_++){var p=d[_].initializer;e.isArrayLiteralExpression(p)&&p.elements.length>r&&(ce.add(e.createDiagnosticForNodeInSourceFile(j.configFile,p.elements[r],n,i,a,o)),s=!1);}}s&&ce.add(e.createCompilerDiagnostic(n,i,a,o));}function Zt(t,r,n,i){for(var a=!0,o=0,s=er();o<s.length;o++){var c=s[o];e.isObjectLiteralExpression(c.initializer)&&sr(c.initializer,t,r,void 0,n,i)&&(a=!1);}a&&ce.add(e.createCompilerDiagnostic(n,i));}function $t(t){var r=or();return r&&e.getPropertyAssignment(r,t)}function er(){return $t("paths")||e.emptyArray}function tr(t,r){var n=or();return n&&e.getPropertyArrayElementValue(n,t,r)}function rr(e,t,r,n){ar(!0,t,r,e,t,r,n);}function nr(e,t,r,n){ar(!1,e,void 0,t,r,n);}function ir(t,r,n,i,a){var o=e.firstDefined(e.getTsConfigPropArray(t||j.configFile,"references"),(function(t){return e.isArrayLiteralExpression(t.initializer)?t.initializer:void 0}));o&&o.elements.length>r?ce.add(e.createDiagnosticForNodeInSourceFile(t||j.configFile,o.elements[r],n,i,a)):ce.add(e.createCompilerDiagnostic(n,i,a));}function ar(t,r,n,i,a,o,s){var c=or();(!c||!sr(c,t,r,n,i,a,o,s))&&ce.add(e.createCompilerDiagnostic(i,a,o,s));}function or(){if(void 0===Z){Z=!1;var t=e.getTsConfigObjectLiteralExpression(j.configFile);if(t)for(var r=0,n=e.getPropertyAssignment(t,"compilerOptions");r<n.length;r++){var i=n[r];if(e.isObjectLiteralExpression(i.initializer)){Z=i.initializer;break}}}return Z||void 0}function sr(t,r,n,i,a,o,s,c){for(var l=e.getPropertyAssignment(t,n,i),u=0,_=l;u<_.length;u++){var d=_[u];ce.add(e.createDiagnosticForNodeInSourceFile(j.configFile,r?d.name:d.initializer,a,o,s,c));}return !!l.length}function cr(e,t){de.set(Xe(e),!0),ce.add(t);}function lr(t,r){return 0===e.comparePaths(t,r,le,!ne.useCaseSensitiveFileNames())}function ur(){return ne.getSymlinkCache?ne.getSymlinkCache():(P||(P=e.createSymlinkCache(le,qt)),y&&H&&!P.hasProcessedResolutions()&&P.setSymlinksFromResolutions(y,H),P)}},e.emitSkippedWithNoDiagnostics={diagnostics:e.emptyArray,sourceMaps:void 0,emittedFiles:void 0,emitSkipped:!0},e.handleNoEmitOptions=T,e.filterSemanticDiagnostics=C,e.parseConfigHostFromCompilerHostLike=E,e.createPrependNodes=k,e.resolveProjectReferencePath=N,e.getResolutionDiagnostic=F,e.getModuleNameStringLiteralAt=P;}(t),function(e){function t(e,t,r,n,i,a){var o=[],s=e.emit(t,(function(e,t,r){o.push({name:e,writeByteOrderMark:r,text:t});}),n,r,i,a),c=s.emitSkipped,l=s.diagnostics,u=s.exportedModulesFromDeclarationEmit;return {outputFiles:o,emitSkipped:c,diagnostics:l,exportedModulesFromDeclarationEmit:u}}e.getFileEmitOutput=t,function(r){var n=0;function i(){return function t(r,i,o){var s=0,c={id:n++,version:function(){return s},clone:function(){return t(new e.Map(r),new e.Map(i),o&&new e.Set(o))},forEach:function(e){return r.forEach(e)},getKeys:function(e){return i.get(e)},getValues:function(e){return r.get(e)},hasKey:function(e){return r.has(e)},keys:function(){return r.keys()},deletedKeys:function(){return o},deleteKey:function(t){(o||(o=new e.Set)).add(t);var n=r.get(t);return !!n&&(n.forEach((function(e){return a(i,e,t)})),r.delete(t),s++,!0)},set:function(t,n){var l=!!(null==o?void 0:o.delete(t)),u=r.get(t);return r.set(t,n),null==u||u.forEach((function(e){n.has(e)||(l=!0,a(i,e,t));})),n.forEach((function(r){(null==u?void 0:u.has(r))||(l=!0,function(t,r,n){var i=t.get(r);i||(i=new e.Set,t.set(r,i)),i.add(n);}(i,r,t));})),l&&s++,c}};return c}(new e.Map,new e.Map,void 0)}function a(e,t,r,n){void 0===n&&(n=!0);var i=e.get(t);return !!(null==i?void 0:i.delete(r))&&(n&&!i.size&&e.delete(t),!0)}function o(t){return e.mapDefined(t.declarations,(function(t){var r;return null===(r=e.getSourceFileOfNode(t))||void 0===r?void 0:r.resolvedPath}))}function s(e,t){var r=e.getSymbolAtLocation(t);return r&&o(r)}function c(t,r,n,i){return e.toPath(t.getProjectReferenceRedirect(r)||r,n,i)}function l(t,r,n){var i;if(r.imports&&r.imports.length>0)for(var a=t.getTypeChecker(),o=0,l=r.imports;o<l.length;o++){var u=s(a,l[o]);null==u||u.forEach(S);}var _=e.getDirectoryPath(r.resolvedPath);if(r.referencedFiles&&r.referencedFiles.length>0)for(var d=0,p=r.referencedFiles;d<p.length;d++){var f=p[d];S(c(t,f.fileName,_,n));}if(r.resolvedTypeReferenceDirectiveNames&&r.resolvedTypeReferenceDirectiveNames.forEach((function(e){if(e){var r=e.resolvedFileName;S(c(t,r,_,n));}})),r.moduleAugmentations.length){a=t.getTypeChecker();for(var g=0,m=r.moduleAugmentations;g<m.length;g++){var y=m[g];if(e.isStringLiteral(y)){var v=a.getSymbolAtLocation(y);v&&D(v);}}}for(var h=0,b=t.getTypeChecker().getAmbientModules();h<b.length;h++){var x=b[h];x.declarations&&x.declarations.length>1&&D(x);}return i;function D(t){if(t.declarations)for(var n=0,i=t.declarations;n<i.length;n++){var a=i[n],o=e.getSourceFileOfNode(a);o&&o!==r&&S(o.resolvedPath);}}function S(t){(i||(i=new e.Set)).add(t);}}function u(e,t){return t&&!t.referencedMap==!e}function _(e,t){t.forEach((function(t,r){return d(e,t,r)}));}function d(e,t,r){e.fileInfos.get(r).signature=t,e.hasCalledUpdateShapeSignature.add(r);}function p(r,n,i,a,s,c,l,u){if(void 0===u&&(u=r.useFileVersionAsSignature),e.Debug.assert(!!i),e.Debug.assert(!l||!!r.exportedModulesMap,"Compute visible to outside map only if visibleToOutsideReferencedMap present in the state"),r.hasCalledUpdateShapeSignature.has(i.resolvedPath)||a.has(i.resolvedPath))return !1;var _=r.fileInfos.get(i.resolvedPath);if(!_)return e.Debug.fail();var d,p=_.signature;if(!i.isDeclarationFile&&!u){var f=t(n,i,!0,s,void 0,!0),g=e.firstOrUndefined(f.outputFiles);g&&(e.Debug.assert(e.fileExtensionIsOneOf(g.name,[".d.ts",".d.mts",".d.cts"]),"File extension for signature expected to be dts",(function(){return "Found: ".concat(e.getAnyExtensionFromPath(g.name)," for ").concat(g.name,":: All output files: ").concat(JSON.stringify(f.outputFiles.map((function(e){return e.name}))))})),d=(c||e.generateDjb2Hash)(g.text),l&&d!==p&&function(t,r,n){var i;r?(r.forEach((function(t){var r;(null==(r=o(t))?void 0:r.length)&&(i||(i=new e.Set),r.forEach((function(e){return i.add(e)})));})),i?n.set(t.resolvedPath,i):n.deleteKey(t.resolvedPath)):n.deleteKey(t.resolvedPath);}(i,f.exportedModulesFromDeclarationEmit,l));}if(void 0===d&&(d=i.version,l&&d!==p)){var m=r.referencedMap?r.referencedMap.getValues(i.resolvedPath):void 0;m?l.set(i.resolvedPath,m):l.deleteKey(i.resolvedPath);}return a.set(i.resolvedPath,d),d!==p}function f(t,r){if(!t.allFileNames){var n=r.getSourceFiles();t.allFileNames=n===e.emptyArray?e.emptyArray:n.map((function(e){return e.fileName}));}return t.allFileNames}function g(t,r){var n=t.referencedMap.getKeys(r);return n?e.arrayFrom(n.keys()):[]}function m(t){return function(t){return e.some(t.moduleAugmentations,(function(t){return e.isGlobalScopeAugmentation(t.parent)}))}(t)||!e.isExternalOrCommonJsModule(t)&&!e.isJsonSourceFile(t)&&!function(t){for(var r=0,n=t.statements;r<n.length;r++){var i=n[r];if(!e.isModuleWithStringLiteralName(i))return !1}return !0}(t)}function y(t,r,n){if(t.allFilesExcludingDefaultLibraryFile)return t.allFilesExcludingDefaultLibraryFile;var i;n&&c(n);for(var a=0,o=r.getSourceFiles();a<o.length;a++){var s=o[a];s!==n&&c(s);}return t.allFilesExcludingDefaultLibraryFile=i||e.emptyArray,t.allFilesExcludingDefaultLibraryFile;function c(e){r.isSourceFileDefaultLibrary(e)||(i||(i=[])).push(e);}}function v(t,r,n){var i=r.getCompilerOptions();return i&&e.outFile(i)?[n]:y(t,r,n)}function h(t,r,n,i,a,o,s){if(m(n))return y(t,r,n);var c=r.getCompilerOptions();if(c&&(c.isolatedModules||e.outFile(c)))return [n];var l=new e.Map;l.set(n.resolvedPath,n);for(var u=g(t,n.resolvedPath);u.length>0;){var _=u.pop();if(!l.has(_)){var d=r.getSourceFileByPath(_);l.set(_,d),d&&p(t,r,d,i,a,o,s)&&u.push.apply(u,g(t,d.resolvedPath));}}return e.arrayFrom(e.mapDefinedIterator(l.values(),(function(e){return e})))}r.createManyToManyPathMap=i,r.canReuseOldState=u,r.create=function(t,r,n,a){var o=new e.Map,s=t.getCompilerOptions().module!==e.ModuleKind.None?i():void 0,c=s?i():void 0,_=new e.Set,d=u(s,n);t.getTypeChecker();for(var p=0,f=t.getSourceFiles();p<f.length;p++){var g=f[p],y=e.Debug.checkDefined(g.version,"Program intended to be used with Builder should have source files with versions set"),v=d?n.fileInfos.get(g.resolvedPath):void 0;if(s){var h=l(t,g,r);if(h&&s.set(g.resolvedPath,h),d){var b=n.exportedModulesMap.getValues(g.resolvedPath);b&&c.set(g.resolvedPath,b);}}o.set(g.resolvedPath,{version:y,signature:v&&v.signature,affectsGlobalScope:m(g)||void 0,impliedFormat:g.impliedNodeFormat});}return {fileInfos:o,referencedMap:s,exportedModulesMap:c,hasCalledUpdateShapeSignature:_,useFileVersionAsSignature:!a&&!d}},r.releaseCache=function(e){e.allFilesExcludingDefaultLibraryFile=void 0,e.allFileNames=void 0;},r.clone=function(t){var r,n;return {fileInfos:new e.Map(t.fileInfos),referencedMap:null===(r=t.referencedMap)||void 0===r?void 0:r.clone(),exportedModulesMap:null===(n=t.exportedModulesMap)||void 0===n?void 0:n.clone(),hasCalledUpdateShapeSignature:new e.Set(t.hasCalledUpdateShapeSignature),useFileVersionAsSignature:t.useFileVersionAsSignature}},r.getFilesAffectedBy=function(t,r,n,i,a,o,s){var c=o||new e.Map,l=r.getSourceFileByPath(n);if(!l)return e.emptyArray;if(!p(t,r,l,c,i,a,s))return [l];var u=(t.referencedMap?h:v)(t,r,l,c,i,a,s);return o||_(t,c),u},r.updateSignaturesFromCache=_,r.updateSignatureOfFile=d,r.updateShapeSignature=p,r.updateExportedFilesMapFromCache=function(t,r){var n;if(r){e.Debug.assert(!!t.exportedModulesMap);var i=r.id,a=r.version();if(t.previousCache){if(t.previousCache.id===i&&t.previousCache.version===a)return;t.previousCache.id=i,t.previousCache.version=a;}else t.previousCache={id:i,version:a};null===(n=r.deletedKeys())||void 0===n||n.forEach((function(e){return t.exportedModulesMap.deleteKey(e)})),r.forEach((function(e,r){return t.exportedModulesMap.set(r,e)}));}},r.getAllDependencies=function(t,r,n){var i=r.getCompilerOptions();if(e.outFile(i))return f(t,r);if(!t.referencedMap||m(n))return f(t,r);for(var a=new e.Set,o=[n.resolvedPath];o.length;){var s=o.pop();if(!a.has(s)){a.add(s);var c=t.referencedMap.getValues(s);if(c)for(var l=c.keys(),u=l.next();!u.done;u=l.next())o.push(u.value);}}return e.arrayFrom(e.mapDefinedIterator(a.keys(),(function(e){var t,n;return null!==(n=null===(t=r.getSourceFileByPath(e))||void 0===t?void 0:t.fileName)&&void 0!==n?n:e})))},r.getReferencedByPaths=g,r.getAllFilesExcludingDefaultLibraryFile=y;}(e.BuilderState||(e.BuilderState={}));}(t),function(e){var t,r;function n(e,t,r){var n=e.file;return i$1(i$1({},e),{file:n?t.getSourceFileByPath(r(n)):void 0})}function a(t,r){e.Debug.assert(!r||!t.affectedFiles||t.affectedFiles[t.affectedFilesIndex-1]!==r||!t.semanticDiagnosticsPerFile.has(r.resolvedPath));}function o(t,r,n){for(;;){var i=t.affectedFiles;if(i){for(var a=t.seenAffectedFiles,o=t.affectedFilesIndex;o<i.length;){var c=i[o];if(!a.has(c.resolvedPath))return t.affectedFilesIndex=o,s(t,c,r,n),c;o++;}t.changedFilesSet.delete(t.currentChangedFilePath),t.currentChangedFilePath=void 0,e.BuilderState.updateSignaturesFromCache(t,t.currentAffectedFilesSignatures),t.currentAffectedFilesSignatures.clear(),e.BuilderState.updateExportedFilesMapFromCache(t,t.currentAffectedFilesExportedModulesMap),t.affectedFiles=void 0;}var l=t.changedFilesSet.keys().next();if(l.done)return;var u=e.Debug.checkDefined(t.program),_=u.getCompilerOptions();if(e.outFile(_))return e.Debug.assert(!t.semanticDiagnosticsPerFile),u;t.currentAffectedFilesSignatures||(t.currentAffectedFilesSignatures=new e.Map),t.exportedModulesMap&&(t.currentAffectedFilesExportedModulesMap||(t.currentAffectedFilesExportedModulesMap=e.BuilderState.createManyToManyPathMap())),t.affectedFiles=e.BuilderState.getFilesAffectedBy(t,u,l.value,r,n,t.currentAffectedFilesSignatures,t.currentAffectedFilesExportedModulesMap),t.currentChangedFilePath=l.value,t.affectedFilesIndex=0,t.seenAffectedFiles||(t.seenAffectedFiles=new e.Set);}}function s(t,r,n,i){var a;if(c(t,r.resolvedPath),t.allFilesExcludingDefaultLibraryFile!==t.affectedFiles)e.Debug.assert(t.hasCalledUpdateShapeSignature.has(r.resolvedPath)||(null===(a=t.currentAffectedFilesSignatures)||void 0===a?void 0:a.has(r.resolvedPath)),"Signature not updated for affected file: ".concat(r.fileName)),t.compilerOptions.assumeChangesOnlyAffectDirectDependencies||function(t,r,n){var i,a;if(t.exportedModulesMap&&t.changedFilesSet.has(r.resolvedPath)&&l(t,r.resolvedPath)){if(t.compilerOptions.isolatedModules){var o=new e.Map;o.set(r.resolvedPath,!0);for(var s=e.BuilderState.getReferencedByPaths(t,r.resolvedPath);s.length>0;){var c=s.pop();if(!o.has(c)&&(o.set(c,!0),n(t,c),l(t,c))){var _=e.Debug.checkDefined(t.program).getSourceFileByPath(c);s.push.apply(s,e.BuilderState.getReferencedByPaths(t,_.resolvedPath));}}}e.Debug.assert(!!t.currentAffectedFilesExportedModulesMap);var d=new e.Set;null===(i=t.currentAffectedFilesExportedModulesMap.getKeys(r.resolvedPath))||void 0===i||i.forEach((function(e){return u(t,e,d,n)})),null===(a=t.exportedModulesMap.getKeys(r.resolvedPath))||void 0===a||a.forEach((function(e){var r;return !t.currentAffectedFilesExportedModulesMap.hasKey(e)&&!(null===(r=t.currentAffectedFilesExportedModulesMap.deletedKeys())||void 0===r?void 0:r.has(e))&&u(t,e,d,n)}));}}(t,r,(function(t,r){return function(t,r,n,i){if(c(t,r),!t.changedFilesSet.has(r)){var a=e.Debug.checkDefined(t.program),o=a.getSourceFileByPath(r);o&&(e.BuilderState.updateShapeSignature(t,a,o,e.Debug.checkDefined(t.currentAffectedFilesSignatures),n,i,t.currentAffectedFilesExportedModulesMap,!0),e.getEmitDeclarations(t.compilerOptions)&&b(t,r,0));}}(t,r,n,i)}));else {if(!t.cleanedDiagnosticsOfLibFiles){t.cleanedDiagnosticsOfLibFiles=!0;var o=e.Debug.checkDefined(t.program),s=o.getCompilerOptions();e.forEach(o.getSourceFiles(),(function(r){return o.isSourceFileDefaultLibrary(r)&&!e.skipTypeChecking(r,s,o)&&c(t,r.resolvedPath)}));}e.BuilderState.updateShapeSignature(t,e.Debug.checkDefined(t.program),r,e.Debug.checkDefined(t.currentAffectedFilesSignatures),n,i,t.currentAffectedFilesExportedModulesMap);}}function c(e,t){return !e.semanticDiagnosticsFromOldState||(e.semanticDiagnosticsFromOldState.delete(t),e.semanticDiagnosticsPerFile.delete(t),!e.semanticDiagnosticsFromOldState.size)}function l(t,r){return e.Debug.checkDefined(t.currentAffectedFilesSignatures).get(r)!==e.Debug.checkDefined(t.fileInfos.get(r)).signature}function u(e,t,r,n){var i;null===(i=e.referencedMap.getKeys(t))||void 0===i||i.forEach((function(t){return _(e,t,r,n)}));}function _(t,r,n,i){var a,o,s;e.tryAddToSet(n,r)&&(i(t,r),e.Debug.assert(!!t.currentAffectedFilesExportedModulesMap),null===(a=t.currentAffectedFilesExportedModulesMap.getKeys(r))||void 0===a||a.forEach((function(e){return _(t,e,n,i)})),null===(o=t.exportedModulesMap.getKeys(r))||void 0===o||o.forEach((function(e){var r;return !t.currentAffectedFilesExportedModulesMap.hasKey(e)&&!(null===(r=t.currentAffectedFilesExportedModulesMap.deletedKeys())||void 0===r?void 0:r.has(e))&&_(t,e,n,i)})),null===(s=t.referencedMap.getKeys(r))||void 0===s||s.forEach((function(e){return !n.has(e)&&i(t,e)})));}function d(t,r,n,i,a){a?t.buildInfoEmitPending=!1:r===t.program?(t.changedFilesSet.clear(),t.programEmitComplete=!0):(t.seenAffectedFiles.add(r.resolvedPath),void 0!==n&&(t.seenEmittedFiles||(t.seenEmittedFiles=new e.Map)).set(r.resolvedPath,n),i?(t.affectedFilesPendingEmitIndex++,t.buildInfoEmitPending=!0):t.affectedFilesIndex++);}function p(e,t,r){return d(e,r),{result:t,affected:r}}function f(e,t,r,n,i,a){return d(e,r,n,i,a),{result:t,affected:r}}function g(t,r,n){return e.concatenate(function(t,r,n){var i=r.resolvedPath;if(t.semanticDiagnosticsPerFile){var a=t.semanticDiagnosticsPerFile.get(i);if(a)return e.filterSemanticDiagnostics(a,t.compilerOptions)}var o=e.Debug.checkDefined(t.program).getBindAndCheckDiagnostics(r,n);return t.semanticDiagnosticsPerFile&&t.semanticDiagnosticsPerFile.set(i,o),e.filterSemanticDiagnostics(o,t.compilerOptions)}(t,r,n),e.Debug.checkDefined(t.program).getProgramDiagnostics(r))}function m(t,r){for(var n,i=e.getOptionsNameMap().optionsNameMap,a=0,o=e.getOwnKeys(t).sort(e.compareStringsCaseSensitive);a<o.length;a++){var s=o[a],c=s.toLowerCase(),l=i.get(c);((null==l?void 0:l.affectsEmit)||(null==l?void 0:l.affectsSemanticDiagnostics)||"strict"===c||"skiplibcheck"===c||"skipdefaultlibcheck"===c)&&((n||(n={}))[s]=y(l,t[s],r));}return n}function y(e,t,r){if(e)if("list"===e.type){var n=t;if(e.element.isFilePath&&n.length)return n.map(r)}else if(e.isFilePath)return r(t);return t}function v(t,r){return e.Debug.assert(!!t.length),t.map((function(e){var t=h(e,r);t.reportsUnnecessary=e.reportsUnnecessary,t.reportDeprecated=e.reportsDeprecated,t.source=e.source,t.skippedOn=e.skippedOn;var n=e.relatedInformation;return t.relatedInformation=n?n.length?n.map((function(e){return h(e,r)})):[]:void 0,t}))}function h(e,t){var r=e.file;return i$1(i$1({},e),{file:r?t(r.resolvedPath):void 0})}function b(t,r,n){t.affectedFilesPendingEmit||(t.affectedFilesPendingEmit=[]),t.affectedFilesPendingEmitKind||(t.affectedFilesPendingEmitKind=new e.Map);var i=t.affectedFilesPendingEmitKind.get(r);t.affectedFilesPendingEmit.push(r),t.affectedFilesPendingEmitKind.set(r,i||n),void 0===t.affectedFilesPendingEmitIndex&&(t.affectedFilesPendingEmitIndex=0);}function x(t){return e.isString(t)?{version:t,signature:t,affectsGlobalScope:void 0,impliedFormat:void 0}:e.isString(t.signature)?t:{version:t.version,signature:!1===t.signature?void 0:t.version,affectsGlobalScope:t.affectsGlobalScope,impliedFormat:t.impliedFormat}}function D(t,r){return {getState:e.notImplemented,backupState:e.noop,restoreState:e.noop,getProgram:n,getProgramOrUndefined:function(){return t().program},releaseProgram:function(){return t().program=void 0},getCompilerOptions:function(){return t().compilerOptions},getSourceFile:function(e){return n().getSourceFile(e)},getSourceFiles:function(){return n().getSourceFiles()},getOptionsDiagnostics:function(e){return n().getOptionsDiagnostics(e)},getGlobalDiagnostics:function(e){return n().getGlobalDiagnostics(e)},getConfigFileParsingDiagnostics:function(){return r},getSyntacticDiagnostics:function(e,t){return n().getSyntacticDiagnostics(e,t)},getDeclarationDiagnostics:function(e,t){return n().getDeclarationDiagnostics(e,t)},getSemanticDiagnostics:function(e,t){return n().getSemanticDiagnostics(e,t)},emit:function(e,t,r,i,a){return n().emit(e,t,r,i,a)},emitBuildInfo:function(e,t){return n().emitBuildInfo(e,t)},getAllDependencies:e.notImplemented,getCurrentDirectory:function(){return n().getCurrentDirectory()},close:e.noop};function n(){return e.Debug.checkDefined(t().program)}}(r=e.BuilderFileEmit||(e.BuilderFileEmit={}))[r.DtsOnly=0]="DtsOnly",r[r.Full=1]="Full",function(e){e[e.SemanticDiagnosticsBuilderProgram=0]="SemanticDiagnosticsBuilderProgram",e[e.EmitAndSemanticDiagnosticsBuilderProgram=1]="EmitAndSemanticDiagnosticsBuilderProgram";}(t=e.BuilderProgramKind||(e.BuilderProgramKind={})),e.getBuilderCreationParameters=function(t,r,n,i,a,o){var s,c,l;return void 0===t?(e.Debug.assert(void 0===r),s=n,l=i,e.Debug.assert(!!l),c=l.getProgram()):e.isArray(t)?(l=i,c=e.createProgram({rootNames:t,options:r,host:n,oldProgram:l&&l.getProgramOrUndefined(),configFileParsingDiagnostics:a,projectReferences:o}),s=n):(c=t,s=r,l=n,a=i),{host:s,newProgram:c,oldProgram:l,configFileParsingDiagnostics:a||e.emptyArray}},e.createBuilderProgram=function(r,i){var s=i.newProgram,c=i.host,l=i.oldProgram,u=i.configFileParsingDiagnostics,_=l&&l.getState();if(_&&s===_.program&&u===s.getConfigFileParsingDiagnostics())return s=void 0,_=void 0,l;var y,h=e.createGetCanonicalFileName(c.useCaseSensitiveFileNames()),x=e.maybeBind(c,c.createHash),S=function(t,r,i,a){var o=e.BuilderState.create(t,r,i,a);o.program=t;var s=t.getCompilerOptions();o.compilerOptions=s,e.outFile(s)||(o.semanticDiagnosticsPerFile=new e.Map),o.changedFilesSet=new e.Set;var c=e.BuilderState.canReuseOldState(o.referencedMap,i),l=c?i.compilerOptions:void 0,u=c&&i.semanticDiagnosticsPerFile&&!!o.semanticDiagnosticsPerFile&&!e.compilerOptionsAffectSemanticDiagnostics(s,l);if(c){if(!i.currentChangedFilePath){var _=i.currentAffectedFilesSignatures;e.Debug.assert(!(i.affectedFiles||_&&_.size),"Cannot reuse if only few affected files of currentChangedFile were iterated");}var d=i.changedFilesSet;u&&e.Debug.assert(!d||!e.forEachKey(d,(function(e){return i.semanticDiagnosticsPerFile.has(e)})),"Semantic diagnostics shouldnt be available for changed files"),null==d||d.forEach((function(e){return o.changedFilesSet.add(e)})),!e.outFile(s)&&i.affectedFilesPendingEmit&&(o.affectedFilesPendingEmit=i.affectedFilesPendingEmit.slice(),o.affectedFilesPendingEmitKind=i.affectedFilesPendingEmitKind&&new e.Map(i.affectedFilesPendingEmitKind),o.affectedFilesPendingEmitIndex=i.affectedFilesPendingEmitIndex,o.seenAffectedFiles=new e.Set);}var p=o.referencedMap,f=c?i.referencedMap:void 0,g=u&&!s.skipLibCheck==!l.skipLibCheck,m=g&&!s.skipDefaultLibCheck==!l.skipDefaultLibCheck;return o.fileInfos.forEach((function(a,s){var l,_,d,y;if(!c||!(l=i.fileInfos.get(s))||l.version!==a.version||(d=_=p&&p.getValues(s))!==(y=f&&f.getValues(s))&&(void 0===d||void 0===y||d.size!==y.size||e.forEachKey(d,(function(e){return !y.has(e)})))||_&&e.forEachKey(_,(function(e){return !o.fileInfos.has(e)&&i.fileInfos.has(e)})))o.changedFilesSet.add(s);else if(u){var v=t.getSourceFileByPath(s);if(v.isDeclarationFile&&!g)return;if(v.hasNoDefaultLib&&!m)return;var h=i.semanticDiagnosticsPerFile.get(s);h&&(o.semanticDiagnosticsPerFile.set(s,i.hasReusableDiagnostic?function(t,r,i){if(!t.length)return e.emptyArray;var a=e.getDirectoryPath(e.getNormalizedAbsolutePath(e.getTsBuildInfoEmitOutputFilePath(r.getCompilerOptions()),r.getCurrentDirectory()));return t.map((function(e){var t=n(e,r,o);t.reportsUnnecessary=e.reportsUnnecessary,t.reportsDeprecated=e.reportDeprecated,t.source=e.source,t.skippedOn=e.skippedOn;var i=e.relatedInformation;return t.relatedInformation=i?i.length?i.map((function(e){return n(e,r,o)})):[]:void 0,t}));function o(t){return e.toPath(t,a,i)}}(h,t,r):h),o.semanticDiagnosticsFromOldState||(o.semanticDiagnosticsFromOldState=new e.Set),o.semanticDiagnosticsFromOldState.add(s));}})),c&&e.forEachEntry(i.fileInfos,(function(e,t){return e.affectsGlobalScope&&!o.fileInfos.has(t)}))?e.BuilderState.getAllFilesExcludingDefaultLibraryFile(o,t,void 0).forEach((function(e){return o.changedFilesSet.add(e.resolvedPath)})):l&&!e.outFile(s)&&e.compilerOptionsAffectEmit(s,l)&&(t.getSourceFiles().forEach((function(e){return b(o,e.resolvedPath,1)})),e.Debug.assert(!o.seenAffectedFiles||!o.seenAffectedFiles.size),o.seenAffectedFiles=o.seenAffectedFiles||new e.Set),c&&e.forEachEntry(i.fileInfos,(function(e,t){o.fileInfos.has(t)&&o.fileInfos.get(t).impliedFormat!==e.impliedFormat&&o.changedFilesSet.add(t);})),o.buildInfoEmitPending=!!o.changedFilesSet.size,o}(s,h,_,c.disableUseFileVersionAsSignature);s.getProgramBuildInfo=function(){return function(t,r){if(!e.outFile(t.compilerOptions)){var n,i,a,o,s,c,l=e.Debug.checkDefined(t.program).getCurrentDirectory(),u=e.getDirectoryPath(e.getNormalizedAbsolutePath(e.getTsBuildInfoEmitOutputFilePath(t.compilerOptions),l)),_=[],d=new e.Map,p=e.arrayFrom(t.fileInfos.entries(),(function(r){var n=r[0],i=r[1],a=C(n);e.Debug.assert(_[a-1]===T(n));var o=t.currentAffectedFilesSignatures&&t.currentAffectedFilesSignatures.get(n),s=null!=o?o:i.signature;return i.version===s?i.affectsGlobalScope?{version:i.version,signature:void 0,affectsGlobalScope:!0,impliedFormat:i.impliedFormat}:i.version:void 0!==s?void 0===o?i:{version:i.version,signature:o,affectsGlobalScope:i.affectsGlobalScope,impliedFormat:i.impliedFormat}:{version:i.version,signature:!1,affectsGlobalScope:i.affectsGlobalScope,impliedFormat:i.impliedFormat}}));if(t.referencedMap&&(a=e.arrayFrom(t.referencedMap.keys()).sort(e.compareStringsCaseSensitive).map((function(e){return [C(e),E(t.referencedMap.getValues(e))]}))),t.exportedModulesMap&&(o=e.mapDefined(e.arrayFrom(t.exportedModulesMap.keys()).sort(e.compareStringsCaseSensitive),(function(e){var r;if(t.currentAffectedFilesExportedModulesMap){if(null===(r=t.currentAffectedFilesExportedModulesMap.deletedKeys())||void 0===r?void 0:r.has(e))return;var n=t.currentAffectedFilesExportedModulesMap.getValues(e);if(n)return [C(e),E(n)]}return [C(e),E(t.exportedModulesMap.getValues(e))]}))),t.semanticDiagnosticsPerFile)for(var f=0,g=e.arrayFrom(t.semanticDiagnosticsPerFile.keys()).sort(e.compareStringsCaseSensitive);f<g.length;f++){var y=g[f],h=t.semanticDiagnosticsPerFile.get(y);(s||(s=[])).push(h.length?[C(y),t.hasReusableDiagnostic?h:v(h,T)]:C(y));}if(t.affectedFilesPendingEmit)for(var b=new e.Set,x=0,D=t.affectedFilesPendingEmit.slice(t.affectedFilesPendingEmitIndex).sort(e.compareStringsCaseSensitive);x<D.length;x++){var S=D[x];e.tryAddToSet(b,S)&&(c||(c=[])).push([C(S),t.affectedFilesPendingEmitKind.get(S)]);}return {fileNames:_,fileInfos:p,options:m(t.compilerOptions,(function(t){return T(e.getNormalizedAbsolutePath(t,l))})),fileIdsList:n,referencedMap:a,exportedModulesMap:o,semanticDiagnosticsPerFile:s,affectedFilesPendingEmit:c}}function T(t){return e.ensurePathIsNonModuleName(e.getRelativePathFromDirectory(u,t,r))}function C(e){var t=d.get(e);return void 0===t&&(_.push(T(e)),d.set(e,t=_.length)),t}function E(t){var r=e.arrayFrom(t.keys(),C).sort(e.compareValues),a=r.join(),o=null==i?void 0:i.get(a);return void 0===o&&((n||(n=[])).push(r),(i||(i=new e.Map)).set(a,o=n.length)),o}}(S,h)},s=void 0,l=void 0,_=void 0;var T=function(){return S},C=D(T,u);return C.getState=T,C.backupState=function(){e.Debug.assert(void 0===y),y=function(t){var r,n=e.BuilderState.clone(t);return n.semanticDiagnosticsPerFile=t.semanticDiagnosticsPerFile&&new e.Map(t.semanticDiagnosticsPerFile),n.changedFilesSet=new e.Set(t.changedFilesSet),n.affectedFiles=t.affectedFiles,n.affectedFilesIndex=t.affectedFilesIndex,n.currentChangedFilePath=t.currentChangedFilePath,n.currentAffectedFilesSignatures=t.currentAffectedFilesSignatures&&new e.Map(t.currentAffectedFilesSignatures),n.currentAffectedFilesExportedModulesMap=null===(r=t.currentAffectedFilesExportedModulesMap)||void 0===r?void 0:r.clone(),n.seenAffectedFiles=t.seenAffectedFiles&&new e.Set(t.seenAffectedFiles),n.cleanedDiagnosticsOfLibFiles=t.cleanedDiagnosticsOfLibFiles,n.semanticDiagnosticsFromOldState=t.semanticDiagnosticsFromOldState&&new e.Set(t.semanticDiagnosticsFromOldState),n.program=t.program,n.compilerOptions=t.compilerOptions,n.affectedFilesPendingEmit=t.affectedFilesPendingEmit&&t.affectedFilesPendingEmit.slice(),n.affectedFilesPendingEmitKind=t.affectedFilesPendingEmitKind&&new e.Map(t.affectedFilesPendingEmitKind),n.affectedFilesPendingEmitIndex=t.affectedFilesPendingEmitIndex,n.seenEmittedFiles=t.seenEmittedFiles&&new e.Map(t.seenEmittedFiles),n.programEmitComplete=t.programEmitComplete,n}(S);},C.restoreState=function(){S=e.Debug.checkDefined(y),y=void 0;},C.getAllDependencies=function(t){return e.BuilderState.getAllDependencies(S,e.Debug.checkDefined(S.program),t)},C.getSemanticDiagnostics=function(t,r){a(S,t);var n,i=e.Debug.checkDefined(S.program).getCompilerOptions();if(e.outFile(i))return e.Debug.assert(!S.semanticDiagnosticsPerFile),e.Debug.checkDefined(S.program).getSemanticDiagnostics(t,r);if(t)return g(S,t,r);for(;k(r););for(var o=0,s=e.Debug.checkDefined(S.program).getSourceFiles();o<s.length;o++){var c=s[o];n=e.addRange(n,g(S,c,r));}return n||e.emptyArray},C.emit=function(n,i,o,s,l){var u,_,d,p=!1;r===t.EmitAndSemanticDiagnosticsBuilderProgram||n||e.outFile(S.compilerOptions)||S.compilerOptions.noEmit||!S.compilerOptions.noEmitOnError||(p=!0,u=S.affectedFilesPendingEmit&&S.affectedFilesPendingEmit.slice(),_=S.affectedFilesPendingEmitKind&&new e.Map(S.affectedFilesPendingEmitKind),d=S.affectedFilesPendingEmitIndex),r===t.EmitAndSemanticDiagnosticsBuilderProgram&&a(S,n);var f=e.handleNoEmitOptions(C,n,i,o);if(f)return f;if(p&&(S.affectedFilesPendingEmit=u,S.affectedFilesPendingEmitKind=_,S.affectedFilesPendingEmitIndex=d),!n&&r===t.EmitAndSemanticDiagnosticsBuilderProgram){for(var g=[],m=!1,y=void 0,v=[],h=void 0;h=E(i,o,s,l);)m=m||h.result.emitSkipped,y=e.addRange(y,h.result.diagnostics),v=e.addRange(v,h.result.emittedFiles),g=e.addRange(g,h.result.sourceMaps);return {emitSkipped:m,diagnostics:y||e.emptyArray,emittedFiles:v,sourceMaps:g}}return e.Debug.checkDefined(S.program).emit(n,i||e.maybeBind(c,c.writeFile),o,s,l)},C.releaseProgram=function(){!function(t){e.BuilderState.releaseCache(t),t.program=void 0;}(S),y=void 0;},r===t.SemanticDiagnosticsBuilderProgram?C.getSemanticDiagnosticsOfNextAffectedFile=k:r===t.EmitAndSemanticDiagnosticsBuilderProgram?(C.getSemanticDiagnosticsOfNextAffectedFile=k,C.emitNextAffectedFile=E,C.emitBuildInfo=function(t,r){if(S.buildInfoEmitPending){var n=e.Debug.checkDefined(S.program).emitBuildInfo(t||e.maybeBind(c,c.writeFile),r);return S.buildInfoEmitPending=!1,n}return e.emitSkippedWithNoDiagnostics}):e.notImplemented(),C;function E(t,r,n,i){var a=o(S,r,x),s=1,l=!1;if(!a)if(e.outFile(S.compilerOptions)){var u=e.Debug.checkDefined(S.program);if(S.programEmitComplete)return;a=u;}else {var _=function(t){var r=t.affectedFilesPendingEmit;if(r){for(var n=t.seenEmittedFiles||(t.seenEmittedFiles=new e.Map),i=t.affectedFilesPendingEmitIndex;i<r.length;i++){var a=e.Debug.checkDefined(t.program).getSourceFileByPath(r[i]);if(a){var o=n.get(a.resolvedPath),s=e.Debug.checkDefined(e.Debug.checkDefined(t.affectedFilesPendingEmitKind).get(a.resolvedPath));if(void 0===o||o<s)return t.affectedFilesPendingEmitIndex=i,{affectedFile:a,emitKind:s}}}t.affectedFilesPendingEmit=void 0,t.affectedFilesPendingEmitKind=void 0,t.affectedFilesPendingEmitIndex=void 0;}}(S);if(!_){if(!S.buildInfoEmitPending)return;var d=e.Debug.checkDefined(S.program);return f(S,d.emitBuildInfo(t||e.maybeBind(c,c.writeFile),r),d,1,!1,!0)}a=_.affectedFile,s=_.emitKind,l=!0;}return f(S,e.Debug.checkDefined(S.program).emit(a===S.program?void 0:a,t||e.maybeBind(c,c.writeFile),r,n||0===s,i),a,s,l)}function k(e,n){for(;;){var i=o(S,e,x);if(!i)return;if(i===S.program)return p(S,S.program.getSemanticDiagnostics(void 0,e),i);if((r===t.EmitAndSemanticDiagnosticsBuilderProgram||S.compilerOptions.noEmit||S.compilerOptions.noEmitOnError)&&b(S,i.resolvedPath,1),!n||!n(i))return p(S,g(S,i,e),i);d(S,i);}}},e.toBuilderStateFileInfo=x,e.createBuildProgramUsingProgramBuildInfo=function(t,r,n){var i,a=e.getDirectoryPath(e.getNormalizedAbsolutePath(r,n.getCurrentDirectory())),o=e.createGetCanonicalFileName(n.useCaseSensitiveFileNames()),s=t.fileNames.map((function(t){return e.toPath(t,a,o)})),c=null===(i=t.fileIdsList)||void 0===i?void 0:i.map((function(t){return new e.Set(t.map(_))})),l=new e.Map;t.fileInfos.forEach((function(e,t){return l.set(_(t+1),x(e))}));var u={fileInfos:l,compilerOptions:t.options?e.convertToOptionsWithAbsolutePaths(t.options,(function(t){return e.getNormalizedAbsolutePath(t,a)})):{},referencedMap:d(t.referencedMap),exportedModulesMap:d(t.exportedModulesMap),semanticDiagnosticsPerFile:t.semanticDiagnosticsPerFile&&e.arrayToMap(t.semanticDiagnosticsPerFile,(function(t){return _(e.isNumber(t)?t:t[0])}),(function(t){return e.isNumber(t)?e.emptyArray:t[1]})),hasReusableDiagnostic:!0,affectedFilesPendingEmit:e.map(t.affectedFilesPendingEmit,(function(e){return _(e[0])})),affectedFilesPendingEmitKind:t.affectedFilesPendingEmit&&e.arrayToMap(t.affectedFilesPendingEmit,(function(e){return _(e[0])}),(function(e){return e[1]})),affectedFilesPendingEmitIndex:t.affectedFilesPendingEmit&&0};return {getState:function(){return u},backupState:e.noop,restoreState:e.noop,getProgram:e.notImplemented,getProgramOrUndefined:e.returnUndefined,releaseProgram:e.noop,getCompilerOptions:function(){return u.compilerOptions},getSourceFile:e.notImplemented,getSourceFiles:e.notImplemented,getOptionsDiagnostics:e.notImplemented,getGlobalDiagnostics:e.notImplemented,getConfigFileParsingDiagnostics:e.notImplemented,getSyntacticDiagnostics:e.notImplemented,getDeclarationDiagnostics:e.notImplemented,getSemanticDiagnostics:e.notImplemented,emit:e.notImplemented,getAllDependencies:e.notImplemented,getCurrentDirectory:e.notImplemented,emitNextAffectedFile:e.notImplemented,getSemanticDiagnosticsOfNextAffectedFile:e.notImplemented,emitBuildInfo:e.notImplemented,close:e.noop};function _(e){return s[e-1]}function d(t){if(t){var r=e.BuilderState.createManyToManyPathMap();return t.forEach((function(e){var t=e[0],n=e[1];return r.set(_(t),c[n-1])})),r}}},e.createRedirectedBuilderProgram=D;}(t),function(e){e.createSemanticDiagnosticsBuilderProgram=function(t,r,n,i,a,o){return e.createBuilderProgram(e.BuilderProgramKind.SemanticDiagnosticsBuilderProgram,e.getBuilderCreationParameters(t,r,n,i,a,o))},e.createEmitAndSemanticDiagnosticsBuilderProgram=function(t,r,n,i,a,o){return e.createBuilderProgram(e.BuilderProgramKind.EmitAndSemanticDiagnosticsBuilderProgram,e.getBuilderCreationParameters(t,r,n,i,a,o))},e.createAbstractBuilder=function(t,r,n,i,a,o){var s=e.getBuilderCreationParameters(t,r,n,i,a,o),c=s.newProgram,l=s.configFileParsingDiagnostics;return e.createRedirectedBuilderProgram((function(){return {program:c,compilerOptions:c.getCompilerOptions()}}),l)};}(t),function(e){function t(t){return e.endsWith(t,"/node_modules/.staging")?e.removeSuffix(t,"/.staging"):e.some(e.ignoredPaths,(function(r){return e.stringContains(t,r)}))?void 0:t}function r(t){var r=e.getRootLength(t);if(t.length===r)return !1;var n=t.indexOf(e.directorySeparator,r);if(-1===n)return !1;var i=t.substring(r,n+1),a=r>1||47!==t.charCodeAt(0);if(a&&0!==t.search(/[a-zA-Z]:/)&&0===i.search(/[a-zA-z]\$\//)){if(-1===(n=t.indexOf(e.directorySeparator,n+1)))return !1;i=t.substring(r+i.length,n+1);}if(a&&0!==i.search(/users\//i))return !0;for(var o=n+1,s=2;s>0;s--)if(0===(o=t.indexOf(e.directorySeparator,o)+1))return !1;return !0}function n(e){var t,r;return !(!(null===(t=e.resolvedModule)||void 0===t?void 0:t.originalPath)&&!(null===(r=e.resolvedTypeReferenceDirective)||void 0===r?void 0:r.originalPath))}e.removeIgnoredPath=t,e.canWatchDirectory=r,e.createResolutionCache=function(i,a,o){var s,c,l,u,_,d,p=e.createMultiMap(),f=[],g=e.createMultiMap(),m=!1,y=e.memoize((function(){return i.getCurrentDirectory()})),v=i.getCachedDirectoryStructureHost(),h=new e.Map,b=e.createCacheWithRedirects(),x=e.createCacheWithRedirects(),D=e.createModuleResolutionCache(y(),i.getCanonicalFileName,void 0,b,x),S=new e.Map,T=e.createCacheWithRedirects(),C=e.createTypeReferenceDirectiveResolutionCache(y(),i.getCanonicalFileName,void 0,D.getPackageJsonInfoCache(),T),E=[".ts",".tsx",".js",".jsx",".json"],k=new e.Map,N=new e.Map,F=a&&e.removeTrailingDirectorySeparator(e.getNormalizedAbsolutePath(a,y())),A=F&&i.toPath(F),P=void 0!==A?A.split(e.directorySeparator).length:0,w=new e.Map;return {getModuleResolutionCache:function(){return D},startRecordingFilesWithChangedResolutions:function(){s=[];},finishRecordingFilesWithChangedResolutions:function(){var e=s;return s=void 0,e},startCachingPerDirectoryResolution:R,finishCachingPerDirectoryResolution:function(){l=void 0,R(),N.forEach((function(e,t){0===e.refCount&&(N.delete(t),e.watcher.close());})),m=!1;},resolveModuleNames:function(t,r,n,i,a){return J({names:t,containingFile:r,redirectedReference:i,cache:h,perDirectoryCacheWithRedirects:b,loader:B,getResolutionWithResolvedFileName:I,shouldRetryResolution:function(t){return !t.resolvedModule||!e.resolutionExtensionIsTSOrJson(t.resolvedModule.extension)},reusedNames:n,logChanges:o,containingSourceFile:a})},getResolvedModuleWithFailedLookupLocationsFromCache:function(e,t,r){var n=h.get(i.toPath(t));return n?n.get(e,r):void 0},resolveTypeReferenceDirectives:function(e,t,r){return J({names:e,containingFile:t,redirectedReference:r,cache:S,perDirectoryCacheWithRedirects:T,loader:j,getResolutionWithResolvedFileName:O,shouldRetryResolution:function(e){return void 0===e.resolvedTypeReferenceDirective}})},removeResolutionsFromProjectReferenceRedirects:function(t){if(e.fileExtensionIs(t,".json")){var r=i.getCurrentProgram();if(r){var n=r.getResolvedProjectReferenceByPath(t);n&&n.commandLine.fileNames.forEach((function(e){return $(i.toPath(e))}));}}},removeResolutionsOfFile:$,hasChangedAutomaticTypeDirectiveNames:function(){return m},invalidateResolutionOfFile:function(t){$(t);var r=m;ee(g.get(t),e.returnTrue)&&m&&!r&&i.onChangedAutomaticTypeDirectiveNames();},invalidateResolutionsOfFailedLookupLocations:re,setFilesWithInvalidatedNonRelativeUnresolvedImports:function(t){e.Debug.assert(l===t||void 0===l),l=t;},createHasInvalidatedResolution:function(t){if(re(),t)return c=void 0,e.returnTrue;var r=c;return c=void 0,function(e){return !!r&&r.has(e)||L(e)}},isFileWithInvalidatedNonRelativeUnresolvedImports:L,updateTypeRootsWatch:function(){var t=i.getCompilationSettings();if(t.types)ie();else {var r=e.getEffectiveTypeRoots(t,{directoryExists:oe,getCurrentDirectory:y});r?e.mutateMap(w,e.arrayToMap(r,(function(e){return i.toPath(e)})),{createNewValue:ae,onDeleteValue:e.closeFileWatcher}):ie();}},closeTypeRootsWatch:ie,clear:function(){e.clearMap(N,e.closeFileWatcherOf),k.clear(),p.clear(),ie(),h.clear(),S.clear(),g.clear(),f.length=0,u=void 0,_=void 0,d=void 0,R(),m=!1;}};function I(e){return e.resolvedModule}function O(e){return e.resolvedTypeReferenceDirective}function M(t,r){return !(void 0===t||r.length<=t.length)&&e.startsWith(r,t)&&r[t.length]===e.directorySeparator}function L(e){if(!l)return !1;var t=l.get(e);return !!t&&!!t.length}function R(){D.clear(),C.clear(),p.forEach(H),p.clear();}function B(t,r,n,a,o){var s,c=e.resolveModuleName(t,r,n,a,D,o);if(!i.getGlobalCache)return c;var l=i.getGlobalCache();if(!(void 0===l||e.isExternalModuleNameRelative(t)||c.resolvedModule&&e.extensionIsTS(c.resolvedModule.extension))){var u=e.loadModuleFromGlobalCache(e.Debug.checkDefined(i.globalCacheResolutionModuleName)(t),i.projectName,n,a,l,D),_=u.resolvedModule,d=u.failedLookupLocations;if(_)return c.resolvedModule=_,(s=c.failedLookupLocations).push.apply(s,d),c}return c}function j(t,r,n,i,a){return e.resolveTypeReferenceDirective(t,r,n,i,a,C)}function J(t){var r,a,o,c=t.names,l=t.containingFile,u=t.redirectedReference,_=t.cache,d=t.perDirectoryCacheWithRedirects,p=t.loader,f=t.getResolutionWithResolvedFileName,g=t.shouldRetryResolution,m=t.reusedNames,y=t.logChanges,v=t.containingSourceFile,h=i.toPath(l),b=_.get(h)||_.set(h,e.createModeAwareCache()).get(h),x=e.getDirectoryPath(h),D=d.getOrCreateMapOfCacheRedirects(u),S=D.get(x);S||(S=e.createModeAwareCache(),D.set(x,S));for(var T=[],C=i.getCompilationSettings(),E=y&&L(h),k=i.getCurrentProgram(),N=k&&k.getResolvedProjectReferenceToRedirect(l),F=N?!u||u.sourceFile.path!==N.sourceFile.path:!!u,A=e.createModeAwareCache(),P=0,w=0,I=c;w<I.length;w++){var O=I[w],M=v?e.getModeForResolutionAtIndex(v,P):void 0;P++;var R=b.get(O,M);if(!A.has(O,M)&&F||!R||R.isInvalidated||E&&!e.isExternalModuleNameRelative(O)&&g(R)){var j=R,J=S.get(O,M);if(J){R=J;var z=(null===(r=i.getCompilerHost)||void 0===r?void 0:r.call(i))||i;if(e.isTraceEnabled(C,z)){var U=f(R);e.trace(z,p===B?(null==U?void 0:U.resolvedFileName)?U.packagetId?e.Diagnostics.Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_3_with_Package_ID_4:e.Diagnostics.Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_3:e.Diagnostics.Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_not_resolved:(null==U?void 0:U.resolvedFileName)?U.packagetId?e.Diagnostics.Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_3_with_Package_ID_4:e.Diagnostics.Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_3:e.Diagnostics.Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_not_resolved,O,l,e.getDirectoryPath(l),null==U?void 0:U.resolvedFileName,(null==U?void 0:U.packagetId)&&e.packageIdToString(U.packagetId));}}else R=p(O,l,C,(null===(a=i.getCompilerHost)||void 0===a?void 0:a.call(i))||i,u,v),S.set(O,M,R),i.onDiscoveredSymlink&&n(R)&&i.onDiscoveredSymlink();b.set(O,M,R),q(O,R,h,f),j&&Q(j,h,f),y&&s&&!K(j,R)&&(s.push(h),y=!1);}else z=(null===(o=i.getCompilerHost)||void 0===o?void 0:o.call(i))||i,e.isTraceEnabled(C,z)&&!A.has(O,M)&&(U=f(R),e.trace(z,p===B?(null==U?void 0:U.resolvedFileName)?U.packagetId?e.Diagnostics.Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package_ID_3:e.Diagnostics.Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2:e.Diagnostics.Reusing_resolution_of_module_0_from_1_of_old_program_it_was_not_resolved:(null==U?void 0:U.resolvedFileName)?U.packagetId?e.Diagnostics.Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package_ID_3:e.Diagnostics.Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_successfully_resolved_to_2:e.Diagnostics.Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_not_resolved,O,l,null==U?void 0:U.resolvedFileName,(null==U?void 0:U.packagetId)&&e.packageIdToString(U.packagetId)));e.Debug.assert(void 0!==R&&!R.isInvalidated),A.set(O,M,!0),T.push(f(R));}return b.forEach((function(t,r,n){A.has(r,n)||e.contains(m,r)||(Q(t,h,f),b.delete(r,n));})),T;function K(e,t){if(e===t)return !0;if(!e||!t)return !1;var r=f(e),n=f(t);return r===n||!(!r||!n)&&r.resolvedFileName===n.resolvedFileName}}function z(t){return e.endsWith(t,"/node_modules/@types")}function U(t,r){if(M(A,r)){t=e.isRootedDiskPath(t)?e.normalizePath(t):e.getNormalizedAbsolutePath(t,y());var n=r.split(e.directorySeparator),i=t.split(e.directorySeparator);return e.Debug.assert(i.length===n.length,"FailedLookup: ".concat(t," failedLookupLocationPath: ").concat(r)),n.length>P+1?{dir:i.slice(0,P+1).join(e.directorySeparator),dirPath:n.slice(0,P+1).join(e.directorySeparator)}:{dir:F,dirPath:A,nonRecursive:!1}}return K(e.getDirectoryPath(e.getNormalizedAbsolutePath(t,y())),e.getDirectoryPath(r))}function K(t,n){for(;e.pathContainsNodeModules(n);)t=e.getDirectoryPath(t),n=e.getDirectoryPath(n);if(e.isNodeModulesDirectory(n))return r(e.getDirectoryPath(n))?{dir:t,dirPath:n}:void 0;var i,a,o=!0;if(void 0!==A)for(;!M(n,A);){var s=e.getDirectoryPath(n);if(s===n)break;o=!1,i=n,a=t,n=s,t=e.getDirectoryPath(t);}return r(n)?{dir:a||t,dirPath:i||n,nonRecursive:o}:void 0}function V(t){return e.fileExtensionIsOneOf(t,E)}function q(t,r,n,a){if(r.refCount)r.refCount++,e.Debug.assertDefined(r.files);else {r.refCount=1,e.Debug.assert(0===e.length(r.files)),e.isExternalModuleNameRelative(t)?W(r):p.add(t,r);var o=a(r);o&&o.resolvedFileName&&g.add(i.toPath(o.resolvedFileName),r);}(r.files||(r.files=[])).push(n);}function W(t){e.Debug.assert(!!t.refCount);var r=t.failedLookupLocations;if(r.length){f.push(t);for(var n=!1,a=0,o=r;a<o.length;a++){var s=o[a],c=i.toPath(s),l=U(s,c);if(l){var u=l.dir,_=l.dirPath,d=l.nonRecursive;if(!V(c)){var p=k.get(c)||0;k.set(c,p+1);}_===A?(e.Debug.assert(!d),n=!0):G(u,_,d);}}n&&G(F,A,!0);}}function H(e,t){var r=i.getCurrentProgram();r&&r.getTypeChecker().tryFindAmbientModuleWithoutAugmentations(t)||e.forEach(W);}function G(t,r,n){var i=N.get(r);i?(e.Debug.assert(!!n==!!i.nonRecursive),i.refCount++):N.set(r,{watcher:Y(t,r,n),refCount:1,nonRecursive:n});}function Q(t,r,n){if(e.unorderedRemoveItem(e.Debug.assertDefined(t.files),r),t.refCount--,!t.refCount){var a=n(t);if(a&&a.resolvedFileName&&g.remove(i.toPath(a.resolvedFileName),t),e.unorderedRemoveItem(f,t)){for(var o=!1,s=0,c=t.failedLookupLocations;s<c.length;s++){var l=c[s],u=i.toPath(l),_=U(l,u);if(_){var d=_.dirPath,p=k.get(u);p&&(1===p?k.delete(u):(e.Debug.assert(p>1),k.set(u,p-1))),d===A?o=!0:X(d);}}o&&X(A);}}}function X(e){N.get(e).refCount--;}function Y(e,t,r){return i.watchDirectoryOfFailedLookupLocation(e,(function(e){var r=i.toPath(e);v&&v.addOrDeleteFileOrDirectory(e,r),te(r,t===r);}),r?0:1)}function Z(e,t,r){var n=e.get(t);n&&(n.forEach((function(e){return Q(e,t,r)})),e.delete(t));}function $(e){Z(h,e,I),Z(S,e,O);}function ee(t,r){if(!t)return !1;for(var n=!1,i=0,a=t;i<a.length;i++){var o=a[i];if(!o.isInvalidated&&r(o)){o.isInvalidated=n=!0;for(var s=0,l=e.Debug.assertDefined(o.files);s<l.length;s++){var u=l[s];(c||(c=new e.Set)).add(u),m=m||e.endsWith(u,e.inferredTypesContainingFile);}}}return n}function te(r,n){if(n)(d||(d=[])).push(r);else {var a=t(r);if(!a)return !1;if(r=a,i.fileIsOpen(r))return !1;var o=e.getDirectoryPath(r);if(z(r)||e.isNodeModulesDirectory(r)||z(o)||e.isNodeModulesDirectory(o))(u||(u=[])).push(r),(_||(_=new e.Set)).add(r);else {if(!V(r)&&!k.has(r))return !1;if(e.isEmittedFileOfProgram(i.getCurrentProgram(),r))return !1;(u||(u=[])).push(r);var s=e.parseNodeModuleFromPath(r);s&&(_||(_=new e.Set)).add(s);}}i.scheduleInvalidateResolutionsOfFailedLookupLocations();}function re(){if(!u&&!_&&!d)return !1;var e=ee(f,ne);return u=void 0,_=void 0,d=void 0,e}function ne(t){return t.failedLookupLocations.some((function(t){var r=i.toPath(t);return e.contains(u,r)||e.firstDefinedIterator((null==_?void 0:_.keys())||e.emptyIterator,(function(t){return !!e.startsWith(r,t)||void 0}))||(null==d?void 0:d.some((function(e){return M(e,r)})))}))}function ie(){e.clearMap(w,e.closeFileWatcher);}function ae(e,t){return i.watchTypeRootsDirectory(t,(function(r){var n=i.toPath(r);v&&v.addOrDeleteFileOrDirectory(r,n),m=!0,i.onChangedAutomaticTypeDirectiveNames();var a=function(e,t){if(M(A,t))return A;var r=K(e,t);return r&&N.has(r.dirPath)?r.dirPath:void 0}(t,e);a&&te(n,a===n);}),1)}function oe(t){var n=e.getDirectoryPath(e.getDirectoryPath(t)),a=i.toPath(n);return a===A||r(a)}};}(t),function(e){!function(t){var r,a,o;function s(t,r,n,i){var a=r.importModuleSpecifierPreference,o=r.importModuleSpecifierEnding;return {relativePreference:"relative"===a?0:"non-relative"===a?1:"project-relative"===a?3:2,ending:function(){switch(o){case"minimal":return 0;case"index":return 1;case"js":return 2;default:return function(t){var r=t.imports;return e.firstDefined(r,(function(t){var r=t.text;return e.pathIsRelative(r)?e.hasJSFileExtension(r):void 0}))||!1}(i)||c(n,i.path,t)?2:e.getEmitModuleResolutionKind(n)!==e.ModuleResolutionKind.NodeJs?1:0}}()}}function c(t,r,n){return (e.getEmitModuleResolutionKind(t)===e.ModuleResolutionKind.Node12||e.getEmitModuleResolutionKind(t)===e.ModuleResolutionKind.NodeNext)&&e.getImpliedNodeFormatForFile(r,void 0,function(t){var r;return {fileExists:t.fileExists,readFile:e.Debug.checkDefined(t.readFile),directoryExists:t.directoryExists,getCurrentDirectory:t.getCurrentDirectory,realpath:t.realpath,useCaseSensitiveFileNames:null===(r=t.useCaseSensitiveFileNames)||void 0===r?void 0:r.call(t)}}(n),t)!==e.ModuleKind.CommonJS}function l(t,r,n,i,a,o){var s=d(r,i),c=v(r,n,i,o);return e.firstDefined(c,(function(e){return D(e,s,i,t)}))||p(n,s,t,i,a)}function u(t,r,n,i){var a,o=e.getSourceFileOfModule(t);if(!o)return e.emptyArray;var s=null===(a=n.getModuleSpecifierCache)||void 0===a?void 0:a.call(n),c=null==s?void 0:s.get(r.path,o.path,i);return [null==c?void 0:c.moduleSpecifiers,o,null==c?void 0:c.modulePaths,s]}function _(t,r,n,i,a,o){var c=!1,l=function(t,r){var n,i=null===(n=t.declarations)||void 0===n?void 0:n.find((function(t){return e.isNonGlobalAmbientModule(t)&&(!e.isExternalModuleAugmentation(t)||!e.isExternalModuleNameRelative(e.getTextOfIdentifierOrLiteral(t.name)))}));if(i)return i.name.text;var a=e.mapDefined(t.declarations,(function(t){var n,i,a,o;if(e.isModuleDeclaration(t)){var s=function(e){for(;4&e.flags;)e=e.parent;return e}(t);if((null===(n=null==s?void 0:s.parent)||void 0===n?void 0:n.parent)&&e.isModuleBlock(s.parent)&&e.isAmbientModule(s.parent.parent)&&e.isSourceFile(s.parent.parent.parent)){var c=null===(o=null===(a=null===(i=s.parent.parent.symbol.exports)||void 0===i?void 0:i.get("export="))||void 0===a?void 0:a.valueDeclaration)||void 0===o?void 0:o.expression;if(c){var l=r.getSymbolAtLocation(c);if(l&&(2097152&(null==l?void 0:l.flags)?r.getAliasedSymbol(l):l)===t.symbol)return s.parent.parent}}}}))[0];return a?a.name.text:void 0}(t,r);if(l)return {moduleSpecifiers:[l],computedWithoutCache:c};var _=u(t,i,a,o),f=_[0],g=_[1],m=_[2],y=_[3];if(f)return {moduleSpecifiers:f,computedWithoutCache:c};if(!g)return {moduleSpecifiers:e.emptyArray,computedWithoutCache:c};c=!0,m||(m=h(i.path,g.originalFileName,a));var v=function(t,r,n,i,a){var o=d(n.path,i),c=s(i,a,r,n),l=e.forEach(t,(function(t){return e.forEach(i.getFileIncludeReasons().get(e.toPath(t.path,i.getCurrentDirectory(),o.getCanonicalFileName)),(function(t){if(t.kind===e.FileIncludeKind.Import&&t.file===n.path){var r=e.getModuleNameStringLiteralAt(n,t.index).text;return 1===c.relativePreference&&e.pathIsRelative(r)?void 0:r}}))}));if(l)return [l];for(var u,_,f,g=e.some(t,(function(e){return e.isInNodeModules})),m=0,y=t;m<y.length;m++){var v=y[m],h=D(v,o,i,r);if(u=e.append(u,h),h&&v.isRedirect)return u;if(!h&&!v.isRedirect){var b=p(v.path,o,r,i,c);e.pathIsBareSpecifier(b)?_=e.append(_,b):g&&!v.isInNodeModules||(f=e.append(f,b));}}return (null==_?void 0:_.length)?_:(null==u?void 0:u.length)?u:e.Debug.checkDefined(f)}(m,n,i,a,o);return null==y||y.set(i.path,g.path,o,m,v),{moduleSpecifiers:v,computedWithoutCache:c}}function d(t,r){return {getCanonicalFileName:e.createGetCanonicalFileName(!r.useCaseSensitiveFileNames||r.useCaseSensitiveFileNames()),importingSourceFileName:t,sourceDirectory:e.getDirectoryPath(t)}}function p(t,r,n,i,a){var o=a.ending,s=a.relativePreference,c=n.baseUrl,l=n.paths,u=n.rootDirs,_=r.sourceDirectory,d=r.getCanonicalFileName,p=u&&function(t,r,n,i,a,o){var s=S(r,t,i);if(void 0!==s){var c=S(n,t,i),l=void 0!==c?e.ensurePathIsNonModuleName(e.getRelativePathFromDirectory(c,s,i)):s;return e.getEmitModuleResolutionKind(o)===e.ModuleResolutionKind.NodeJs?T(l,a,o):e.removeFileExtension(l)}}(u,t,_,d,o,n)||T(e.ensurePathIsNonModuleName(e.getRelativePathFromDirectory(_,t,d)),o,n);if(!c&&!l||0===s)return p;var g=k(t,e.getNormalizedAbsolutePath(e.getPathsBasePath(n,i)||c,i.getCurrentDirectory()),d);if(!g)return p;var y=T(g,o,n),v=l&&b(e.removeFileExtension(g),y,l),h=void 0===v&&void 0!==c?y:v;if(!h)return p;if(1===s)return h;if(3===s){var x=n.configFilePath?e.toPath(e.getDirectoryPath(n.configFilePath),i.getCurrentDirectory(),r.getCanonicalFileName):r.getCanonicalFileName(i.getCurrentDirectory()),D=e.toPath(t,x,d),C=e.startsWith(_,x),E=e.startsWith(D,x);if(C&&!E||!C&&E)return h;var F=m(i,e.getDirectoryPath(D));return m(i,_)!==F?h:p}return 2!==s&&e.Debug.assertNever(s),N(h)||f(p)<f(h)?p:h}function f(t){for(var r=0,n=e.startsWith(t,"./")?2:0;n<t.length;n++)47===t.charCodeAt(n)&&r++;return r}function g(t,r){return e.compareBooleans(r.isRedirect,t.isRedirect)||e.compareNumberOfDirectorySeparators(t.path,r.path)}function m(t,r){return t.getNearestAncestorDirectoryWithPackageJson?t.getNearestAncestorDirectoryWithPackageJson(r):!!e.forEachAncestorDirectory(r,(function(r){return !!t.fileExists(e.combinePaths(r,"package.json"))||void 0}))}function y(t,r,i,a,o){var s,c=e.hostGetCanonicalFileName(i),l=i.getCurrentDirectory(),u=i.isSourceOfProjectReferenceRedirect(r)?i.getProjectReferenceRedirect(r):void 0,_=e.toPath(r,l,c),d=i.redirectTargetsMap.get(_)||e.emptyArray,p=n$3(n$3(n$3([],u?[u]:e.emptyArray,!0),[r],!1),d,!0).map((function(t){return e.getNormalizedAbsolutePath(t,l)})),f=!e.every(p,e.containsIgnoredPath);if(!a){var g=e.forEach(p,(function(t){return !(f&&e.containsIgnoredPath(t))&&o(t,u===t)}));if(g)return g}var m=null===(s=i.getSymlinkCache)||void 0===s?void 0:s.call(i).getSymlinkedDirectoriesByRealpath(),y=e.getNormalizedAbsolutePath(r,l);return m&&e.forEachAncestorDirectory(e.getDirectoryPath(y),(function(r){var n=m.get(e.ensureTrailingDirectorySeparator(e.toPath(r,l,c)));if(n)return !e.startsWithDirectory(t,r,c)&&e.forEach(p,(function(t){if(e.startsWithDirectory(t,r,c))for(var i=e.getRelativePathFromDirectory(r,t,c),a=0,s=n;a<s.length;a++){var l=s[a],_=e.resolvePath(l,i),d=o(_,t===u);if(f=!0,d)return d}}))}))||(a?e.forEach(p,(function(t){return f&&e.containsIgnoredPath(t)?void 0:o(t,t===u)})):void 0)}function v(t,r,n,i,a){var o;void 0===a&&(a=e.toPath(r,n.getCurrentDirectory(),e.hostGetCanonicalFileName(n)));var s=null===(o=n.getModuleSpecifierCache)||void 0===o?void 0:o.call(n);if(s){var c=s.get(t,a,i);if(null==c?void 0:c.modulePaths)return c.modulePaths}var l=h(t,r,n);return s&&s.setModulePaths(t,a,i,l),l}function h(t,r,n){var i=e.hostGetCanonicalFileName(n),a=new e.Map,o=!1;y(t,r,n,!0,(function(t,r){var n=e.pathContainsNodeModules(t);a.set(t,{path:i(t),isRedirect:r,isInNodeModules:n}),o=o||n;}));for(var s,c=[],l=function(t){var r,n=e.ensureTrailingDirectorySeparator(t);a.forEach((function(t,i){var o=t.path,s=t.isRedirect,c=t.isInNodeModules;e.startsWith(o,n)&&((r||(r=[])).push({path:i,isRedirect:s,isInNodeModules:c}),a.delete(i));})),r&&(r.length>1&&r.sort(g),c.push.apply(c,r));var i=e.getDirectoryPath(t);if(i===t)return s=t,"break";s=t=i;},u=e.getDirectoryPath(t);0!==a.size;){var _=l(u);if(u=s,"break"===_)break}if(a.size){var d=e.arrayFrom(a.values());d.length>1&&d.sort(g),c.push.apply(c,d);}return c}function b(t,r,n){for(var i in n)for(var a=0,o=n[i];a<o.length;a++){var s=o[a],c=e.removeFileExtension(e.normalizePath(s)),l=c.indexOf("*");if(-1!==l){var u=c.substr(0,l),_=c.substr(l+1);if(r.length>=u.length+_.length&&e.startsWith(r,u)&&e.endsWith(r,_)||!_&&r===e.removeTrailingDirectorySeparator(u)){var d=r.substr(u.length,r.length-_.length-u.length);return i.replace("*",d)}}else if(c===r||c===t)return i}}function x(t,r,n,i,a,o,s){if(void 0===s&&(s=0),"string"==typeof a){var c=e.getNormalizedAbsolutePath(e.combinePaths(n,a),void 0),l=e.hasTSFileExtension(r)?e.removeFileExtension(r)+E(r,t):void 0;switch(s){case 0:if(0===e.comparePaths(r,c)||l&&0===e.comparePaths(l,c))return {moduleFileToTry:i};break;case 1:if(e.containsPath(c,r)){var u=e.getRelativePathFromDirectory(c,r,!1);return {moduleFileToTry:e.getNormalizedAbsolutePath(e.combinePaths(e.combinePaths(i,a),u),void 0)}}break;case 2:var _=c.indexOf("*"),d=c.slice(0,_),p=c.slice(_+1);if(e.startsWith(r,d)&&e.endsWith(r,p)){var f=r.slice(d.length,r.length-p.length);return {moduleFileToTry:i.replace("*",f)}}if(l&&e.startsWith(l,d)&&e.endsWith(l,p))return f=l.slice(d.length,l.length-p.length),{moduleFileToTry:i.replace("*",f)}}}else {if(Array.isArray(a))return e.forEach(a,(function(e){return x(t,r,n,i,e,o)}));if("object"==typeof a&&null!==a){if(e.allKeysStartWithDot(a))return e.forEach(e.getOwnKeys(a),(function(s){var c=e.getNormalizedAbsolutePath(e.combinePaths(i,s),void 0),l=e.endsWith(s,"/")?1:e.stringContains(s,"*")?2:0;return x(t,r,n,c,a[s],o,l)}));for(var g=0,m=e.getOwnKeys(a);g<m.length;g++){var y=m[g];if("default"===y||o.indexOf(y)>=0||e.isApplicableVersionedTypesKey(o,y)){var v=a[y],h=x(t,r,n,i,v,o);if(h)return h}}}}}function D(t,r,n,a,o){var s=t.path,c=t.isRedirect,l=r.getCanonicalFileName,u=r.sourceDirectory;if(n.fileExists&&n.readFile){var _=function(t){var r,n=0,i=0,a=0;!function(e){e[e.BeforeNodeModules=0]="BeforeNodeModules",e[e.NodeModules=1]="NodeModules",e[e.Scope=2]="Scope",e[e.PackageContent=3]="PackageContent";}(r||(r={}));for(var o=0,s=0,c=0;s>=0;)switch(o=s,s=t.indexOf("/",o+1),c){case 0:t.indexOf(e.nodeModulesPathPart,o)===o&&(n=o,i=s,c=1);break;case 1:case 2:1===c&&"@"===t.charAt(o+1)?c=2:(a=s,c=3);break;case 3:c=t.indexOf(e.nodeModulesPathPart,o)===o?1:3;}return c>1?{topLevelNodeModulesIndex:n,topLevelPackageNameIndex:i,packageRootIndex:a,fileNameIndex:o}:void 0}(s);if(_){var d=s,p=!1;if(!o)for(var f=_.packageRootIndex,g=void 0;;){var m=F(f),y=m.moduleFileToTry,v=m.packageRootPath,h=m.blockedByExports,D=m.verbatimFromExports;if(e.getEmitModuleResolutionKind(a)!==e.ModuleResolutionKind.Classic){if(h)return;if(D)return y}if(v){d=v,p=!0;break}if(g||(g=y),-1===(f=s.indexOf(e.directorySeparator,f+1))){d=A(g);break}}if(!c||p){var S=n.getGlobalTypingsCacheLocation&&n.getGlobalTypingsCacheLocation(),C=l(d.substring(0,_.topLevelNodeModulesIndex));if(e.startsWith(u,C)||S&&e.startsWith(l(S),C)){var k=d.substring(_.topLevelPackageNameIndex+1),N=e.getPackageNameFromTypesPackageName(k);return e.getEmitModuleResolutionKind(a)===e.ModuleResolutionKind.Classic&&N===k?void 0:N}}}}function F(t){var r=s.substring(0,t),o=e.combinePaths(r,"package.json"),c=s;if(n.fileExists(o)){var u=JSON.parse(n.readFile(o));if(e.getEmitModuleResolutionKind(a)===e.ModuleResolutionKind.Node12||e.getEmitModuleResolutionKind(a)===e.ModuleResolutionKind.NodeNext){var _=u.exports&&"string"==typeof u.name?x(a,s,r,u.name,u.exports,["node","types"]):void 0;if(_){var d=e.hasTSFileExtension(_.moduleFileToTry)?{moduleFileToTry:e.removeFileExtension(_.moduleFileToTry)+E(_.moduleFileToTry,a)}:_;return i$1(i$1({},d),{verbatimFromExports:!0})}if(u.exports)return {moduleFileToTry:s,blockedByExports:!0}}var p=u.typesVersions?e.getPackageJsonTypesVersionsPaths(u.typesVersions):void 0;if(p){var f=s.slice(r.length+1),g=b(e.removeFileExtension(f),T(f,0,a),p.paths);void 0!==g&&(c=e.combinePaths(r,g));}var m=u.typings||u.types||u.main;if(e.isString(m)){var y=e.toPath(m,r,l);if(e.removeFileExtension(y)===e.removeFileExtension(l(c)))return {packageRootPath:r,moduleFileToTry:c}}}return {moduleFileToTry:c}}function A(t){var r=e.removeFileExtension(t);return "/index"!==l(r.substring(_.fileNameIndex))||function(t,r){if(t.fileExists)for(var n=0,i=e.flatten(e.getSupportedExtensions({allowJs:!0},[{extension:"node",isMixedContent:!1},{extension:"json",isMixedContent:!1,scriptKind:6}]));n<i.length;n++){var a=r+i[n];if(t.fileExists(a))return a}}(n,r.substring(0,_.fileNameIndex))?r:r.substring(0,_.fileNameIndex)}}function S(t,r,n){return e.firstDefined(r,(function(e){var r=k(t,e,n);return N(r)?void 0:r}))}function T(t,r,n){if(e.fileExtensionIsOneOf(t,[".json",".mjs",".cjs"]))return t;var i=e.removeFileExtension(t);if(e.fileExtensionIsOneOf(t,[".d.mts",".mts",".d.cts",".cts"]))return i+C(t,n);switch(r){case 0:return e.removeSuffix(i,"/index");case 1:return i;case 2:return i+C(t,n);default:return e.Debug.assertNever(r)}}function C(t,r){var n;return null!==(n=E(t,r))&&void 0!==n?n:e.Debug.fail("Extension ".concat(e.extensionFromPath(t)," is unsupported:: FileName:: ").concat(t))}function E(t,r){var n=e.tryGetExtensionFromPath(t);switch(n){case".ts":case".d.ts":return ".js";case".tsx":return 1===r.jsx?".jsx":".js";case".js":case".jsx":case".json":return n;case".d.mts":case".mts":case".mjs":return ".mjs";case".d.cts":case".cts":case".cjs":return ".cjs";default:return}}function k(t,r,n){var i=e.getRelativePathToDirectoryOrUrl(r,t,r,n,!1);return e.isRootedDiskPath(i)?void 0:i}function N(t){return e.startsWith(t,"..")}!function(e){e[e.Relative=0]="Relative",e[e.NonRelative=1]="NonRelative",e[e.Shortest=2]="Shortest",e[e.ExternalNonRelative=3]="ExternalNonRelative";}(r||(r={})),function(e){e[e.Minimal=0]="Minimal",e[e.Index=1]="Index",e[e.JsExtension=2]="JsExtension";}(a||(a={})),t.updateModuleSpecifier=function(t,r,n,i,a){var o=l(t,r,n,i,function(t,r,n,i){return {relativePreference:e.isExternalModuleNameRelative(r)?0:1,ending:e.hasJSFileExtension(r)||c(t,n,i)?2:e.getEmitModuleResolutionKind(t)!==e.ModuleResolutionKind.NodeJs||e.endsWith(r,"index")?1:0}}(t,a,r,i),{});if(o!==a)return o},t.getModuleSpecifier=function(e,t,r,n,i){return l(e,r,n,i,s(i,{},e,t),{})},t.getNodeModulesPackageName=function(t,r,n,i,a){var o=d(r,i),s=v(r,n,i,a);return e.firstDefined(s,(function(e){return D(e,o,i,t,!0)}))},t.tryGetModuleSpecifiersFromCache=function(e,t,r,n){return u(e,t,r,n)[0]},t.getModuleSpecifiers=function(e,t,r,n,i,a){return _(e,t,r,n,i,a).moduleSpecifiers},t.getModuleSpecifiersWithCacheInfo=_,t.countPathComponents=f,t.forEachFileNameOfModule=y,function(e){e[e.Exact=0]="Exact",e[e.Directory=1]="Directory",e[e.Pattern=2]="Pattern";}(o||(o={})),t.tryGetJSExtensionForFile=E;}(e.moduleSpecifiers||(e.moduleSpecifiers={}));}(t),function(e){var t=e.sys?{getCurrentDirectory:function(){return e.sys.getCurrentDirectory()},getNewLine:function(){return e.sys.newLine},getCanonicalFileName:e.createGetCanonicalFileName(e.sys.useCaseSensitiveFileNames)}:void 0;function r(r,n){var i=r===e.sys&&t?t:{getCurrentDirectory:function(){return r.getCurrentDirectory()},getNewLine:function(){return r.newLine},getCanonicalFileName:e.createGetCanonicalFileName(r.useCaseSensitiveFileNames)};if(!n)return function(t){return r.write(e.formatDiagnostic(t,i))};var a=new Array(1);return function(t){a[0]=t,r.write(e.formatDiagnosticsWithColorAndContext(a,i)+i.getNewLine()),a[0]=void 0;}}function i(t,r,n){return !(!t.clearScreen||n.preserveWatchOutput||n.extendedDiagnostics||n.diagnostics||!e.contains(e.screenStartingMessageCodes,r.code)||(t.clearScreen(),0))}function a(e){return e.now?e.now().toLocaleTimeString("en-US",{timeZone:"UTC"}):(new Date).toLocaleTimeString()}function o(t,r){return r?function(r,n,o){i(t,r,o);var s="[".concat(e.formatColorAndReset(a(t),e.ForegroundColorEscapeSequences.Grey),"] ");s+="".concat(e.flattenDiagnosticMessageText(r.messageText,t.newLine)).concat(n+n),t.write(s);}:function(r,n,o){var s="";i(t,r,o)||(s+=n),s+="".concat(a(t)," - "),s+="".concat(e.flattenDiagnosticMessageText(r.messageText,t.newLine)).concat(function(t,r){return e.contains(e.screenStartingMessageCodes,t.code)?r+r:r}(r,n)),t.write(s);}}function s(t){return e.countWhere(t,(function(t){return t.category===e.DiagnosticCategory.Error}))}function c(t){return 1===t?e.Diagnostics.Found_1_error_Watching_for_file_changes:e.Diagnostics.Found_0_errors_Watching_for_file_changes}function l(t,r){if(0===t)return "";var n=e.createCompilerDiagnostic(1===t?e.Diagnostics.Found_1_error:e.Diagnostics.Found_0_errors,t);return "".concat(r).concat(e.flattenDiagnosticMessageText(n.messageText,r)).concat(r).concat(r)}function u(e){return !!e.getState}function _(t,r){var n=t.getCompilerOptions();n.explainFiles?d(u(t)?t.getProgram():t,r):(n.listFiles||n.listFilesOnly)&&e.forEach(t.getSourceFiles(),(function(e){r(e.fileName);}));}function d(t,r){for(var n,i,a=t.getFileIncludeReasons(),o=e.createGetCanonicalFileName(t.useCaseSensitiveFileNames()),s=function(r){return e.convertToRelativePath(r,t.getCurrentDirectory(),o)},c=0,l=t.getSourceFiles();c<l.length;c++){var u=l[c];r("".concat(y(u,s))),null===(n=a.get(u.path))||void 0===n||n.forEach((function(e){return r(" ".concat(m(t,e,s).messageText))})),null===(i=p(u,s))||void 0===i||i.forEach((function(e){return r(" ".concat(e.messageText))}));}}function p(t,r){var n;return t.path!==t.resolvedPath&&(n||(n=[])).push(e.chainDiagnosticMessages(void 0,e.Diagnostics.File_is_output_of_project_reference_source_0,y(t.originalFileName,r))),t.redirectInfo&&(n||(n=[])).push(e.chainDiagnosticMessages(void 0,e.Diagnostics.File_redirects_to_file_0,y(t.redirectInfo.redirectTarget,r))),n}function f(t,r){var n,i=t.getCompilerOptions().configFile;if(null===(n=null==i?void 0:i.configFileSpecs)||void 0===n?void 0:n.validatedFilesSpec){var a=e.createGetCanonicalFileName(t.useCaseSensitiveFileNames()),o=a(r),s=e.getDirectoryPath(e.getNormalizedAbsolutePath(i.fileName,t.getCurrentDirectory()));return e.find(i.configFileSpecs.validatedFilesSpec,(function(t){return a(e.getNormalizedAbsolutePath(t,s))===o}))}}function g(t,r){var n,i,a=t.getCompilerOptions().configFile;if(null===(n=null==a?void 0:a.configFileSpecs)||void 0===n?void 0:n.validatedIncludeSpecs){var o=e.fileExtensionIs(r,".json"),s=e.getDirectoryPath(e.getNormalizedAbsolutePath(a.fileName,t.getCurrentDirectory())),c=t.useCaseSensitiveFileNames();return e.find(null===(i=null==a?void 0:a.configFileSpecs)||void 0===i?void 0:i.validatedIncludeSpecs,(function(t){if(o&&!e.endsWith(t,".json"))return !1;var n=e.getPatternFromSpec(t,s,"files");return !!n&&e.getRegexFromPattern("(".concat(n,")$"),c).test(r)}))}}function m(t,r,n){var i,a,o=t.getCompilerOptions();if(e.isReferencedFile(r)){var s=e.getReferencedFileLocation((function(e){return t.getSourceFileByPath(e)}),r),c=e.isReferenceFileLocation(s)?s.file.text.substring(s.pos,s.end):'"'.concat(s.text,'"'),l=void 0;switch(e.Debug.assert(e.isReferenceFileLocation(s)||r.kind===e.FileIncludeKind.Import,"Only synthetic references are imports"),r.kind){case e.FileIncludeKind.Import:l=e.isReferenceFileLocation(s)?s.packageId?e.Diagnostics.Imported_via_0_from_file_1_with_packageId_2:e.Diagnostics.Imported_via_0_from_file_1:s.text===e.externalHelpersModuleNameText?s.packageId?e.Diagnostics.Imported_via_0_from_file_1_with_packageId_2_to_import_importHelpers_as_specified_in_compilerOptions:e.Diagnostics.Imported_via_0_from_file_1_to_import_importHelpers_as_specified_in_compilerOptions:s.packageId?e.Diagnostics.Imported_via_0_from_file_1_with_packageId_2_to_import_jsx_and_jsxs_factory_functions:e.Diagnostics.Imported_via_0_from_file_1_to_import_jsx_and_jsxs_factory_functions;break;case e.FileIncludeKind.ReferenceFile:e.Debug.assert(!s.packageId),l=e.Diagnostics.Referenced_via_0_from_file_1;break;case e.FileIncludeKind.TypeReferenceDirective:l=s.packageId?e.Diagnostics.Type_library_referenced_via_0_from_file_1_with_packageId_2:e.Diagnostics.Type_library_referenced_via_0_from_file_1;break;case e.FileIncludeKind.LibReferenceDirective:e.Debug.assert(!s.packageId),l=e.Diagnostics.Library_referenced_via_0_from_file_1;break;default:e.Debug.assertNever(r);}return e.chainDiagnosticMessages(void 0,l,c,y(s.file,n),s.packageId&&e.packageIdToString(s.packageId))}switch(r.kind){case e.FileIncludeKind.RootFile:if(!(null===(i=o.configFile)||void 0===i?void 0:i.configFileSpecs))return e.chainDiagnosticMessages(void 0,e.Diagnostics.Root_file_specified_for_compilation);var u=e.getNormalizedAbsolutePath(t.getRootFileNames()[r.index],t.getCurrentDirectory());if(f(t,u))return e.chainDiagnosticMessages(void 0,e.Diagnostics.Part_of_files_list_in_tsconfig_json);var _=g(t,u);return _?e.chainDiagnosticMessages(void 0,e.Diagnostics.Matched_by_include_pattern_0_in_1,_,y(o.configFile,n)):e.chainDiagnosticMessages(void 0,e.Diagnostics.Root_file_specified_for_compilation);case e.FileIncludeKind.SourceFromProjectReference:case e.FileIncludeKind.OutputFromProjectReference:var d=r.kind===e.FileIncludeKind.OutputFromProjectReference,p=e.Debug.checkDefined(null===(a=t.getResolvedProjectReferences())||void 0===a?void 0:a[r.index]);return e.chainDiagnosticMessages(void 0,e.outFile(o)?d?e.Diagnostics.Output_from_referenced_project_0_included_because_1_specified:e.Diagnostics.Source_from_referenced_project_0_included_because_1_specified:d?e.Diagnostics.Output_from_referenced_project_0_included_because_module_is_specified_as_none:e.Diagnostics.Source_from_referenced_project_0_included_because_module_is_specified_as_none,y(p.sourceFile.fileName,n),o.outFile?"--outFile":"--out");case e.FileIncludeKind.AutomaticTypeDirectiveFile:return e.chainDiagnosticMessages(void 0,o.types?r.packageId?e.Diagnostics.Entry_point_of_type_library_0_specified_in_compilerOptions_with_packageId_1:e.Diagnostics.Entry_point_of_type_library_0_specified_in_compilerOptions:r.packageId?e.Diagnostics.Entry_point_for_implicit_type_library_0_with_packageId_1:e.Diagnostics.Entry_point_for_implicit_type_library_0,r.typeReference,r.packageId&&e.packageIdToString(r.packageId));case e.FileIncludeKind.LibFile:if(void 0!==r.index)return e.chainDiagnosticMessages(void 0,e.Diagnostics.Library_0_specified_in_compilerOptions,o.lib[r.index]);var m=e.forEachEntry(e.targetOptionDeclaration.type,(function(t,r){return t===e.getEmitScriptTarget(o)?r:void 0}));return e.chainDiagnosticMessages(void 0,m?e.Diagnostics.Default_library_for_target_0:e.Diagnostics.Default_library,m);default:e.Debug.assertNever(r);}}function y(t,r){var n=e.isString(t)?t:t.fileName;return r?r(n):n}function v(t,r,n,i,a,o,c,l){var u=!!t.getCompilerOptions().listFilesOnly,d=t.getConfigFileParsingDiagnostics().slice(),p=d.length;e.addRange(d,t.getSyntacticDiagnostics(void 0,o)),d.length===p&&(e.addRange(d,t.getOptionsDiagnostics(o)),u||(e.addRange(d,t.getGlobalDiagnostics(o)),d.length===p&&e.addRange(d,t.getSemanticDiagnostics(void 0,o))));var f=u?{emitSkipped:!0,diagnostics:e.emptyArray}:t.emit(void 0,a,o,c,l),g=f.emittedFiles,m=f.diagnostics;e.addRange(d,m);var y=e.sortAndDeduplicateDiagnostics(d);if(y.forEach(r),n){var v=t.getCurrentDirectory();e.forEach(g,(function(t){var r=e.getNormalizedAbsolutePath(t,v);n("TSFILE: ".concat(r));})),_(t,n);}return i&&i(s(y)),{emitResult:f,diagnostics:y}}function h(t,r,n,i,a,o,s,c){var l=v(t,r,n,i,a,o,s,c),u=l.emitResult,_=l.diagnostics;return u.emitSkipped&&_.length>0?e.ExitStatus.DiagnosticsPresent_OutputsSkipped:_.length>0?e.ExitStatus.DiagnosticsPresent_OutputsGenerated:e.ExitStatus.Success}function b(t,r){return void 0===t&&(t=e.sys),{onWatchStatusChange:r||o(t),watchFile:e.maybeBind(t,t.watchFile)||e.returnNoopFileWatcher,watchDirectory:e.maybeBind(t,t.watchDirectory)||e.returnNoopFileWatcher,setTimeout:e.maybeBind(t,t.setTimeout)||e.noop,clearTimeout:e.maybeBind(t,t.clearTimeout)||e.noop}}function x(t,r){var n=e.memoize((function(){return e.getDirectoryPath(e.normalizePath(t.getExecutingFilePath()))}));return {useCaseSensitiveFileNames:function(){return t.useCaseSensitiveFileNames},getNewLine:function(){return t.newLine},getCurrentDirectory:e.memoize((function(){return t.getCurrentDirectory()})),getDefaultLibLocation:n,getDefaultLibFileName:function(t){return e.combinePaths(n(),e.getDefaultLibFileName(t))},fileExists:function(e){return t.fileExists(e)},readFile:function(e,r){return t.readFile(e,r)},directoryExists:function(e){return t.directoryExists(e)},getDirectories:function(e){return t.getDirectories(e)},readDirectory:function(e,r,n,i,a){return t.readDirectory(e,r,n,i,a)},realpath:e.maybeBind(t,t.realpath),getEnvironmentVariable:e.maybeBind(t,t.getEnvironmentVariable),trace:function(e){return t.write(e+t.newLine)},createDirectory:function(e){return t.createDirectory(e)},writeFile:function(e,r,n){return t.writeFile(e,r,n)},createHash:e.maybeBind(t,t.createHash),createProgram:r||e.createEmitAndSemanticDiagnosticsBuilderProgram,disableUseFileVersionAsSignature:t.disableUseFileVersionAsSignature}}function D(t,r,n,i){void 0===t&&(t=e.sys);var a=function(e){return t.write(e+t.newLine)},o=x(t,r);return e.copyProperties(o,b(t,i)),o.afterProgramCreate=function(r){var i=r.getCompilerOptions(),s=e.getNewLineCharacter(i,(function(){return t.newLine}));v(r,n,a,(function(t){return o.onWatchStatusChange(e.createCompilerDiagnostic(c(t),t),s,i,t)}));},o}function S(t,r,n){r(n),t.exit(e.ExitStatus.DiagnosticsPresent_OutputsSkipped);}e.createDiagnosticReporter=r,e.screenStartingMessageCodes=[e.Diagnostics.Starting_compilation_in_watch_mode.code,e.Diagnostics.File_change_detected_Starting_incremental_compilation.code],e.getLocaleTimeString=a,e.createWatchStatusReporter=o,e.parseConfigFileWithSystem=function(t,r,n,i,a,o){var s=a;s.onUnRecoverableConfigFileDiagnostic=function(e){return S(a,o,e)};var c=e.getParsedCommandLineOfConfigFile(t,r,s,n,i);return s.onUnRecoverableConfigFileDiagnostic=void 0,c},e.getErrorCountForSummary=s,e.getWatchErrorSummaryDiagnosticMessage=c,e.getErrorSummaryText=l,e.isBuilderProgram=u,e.listFiles=_,e.explainFiles=d,e.explainIfFileIsRedirect=p,e.getMatchedFileSpec=f,e.getMatchedIncludeSpec=g,e.fileIncludeReasonToDiagnostics=m,e.emitFilesAndReportErrors=v,e.emitFilesAndReportErrorsAndGetExitStatus=h,e.noopFileWatcher={close:e.noop},e.returnNoopFileWatcher=function(){return e.noopFileWatcher},e.createWatchHost=b,e.WatchType={ConfigFile:"Config file",ExtendedConfigFile:"Extended config file",SourceFile:"Source file",MissingFile:"Missing file",WildcardDirectory:"Wild card directory",FailedLookupLocations:"Failed Lookup Locations",TypeRoots:"Type roots",ConfigFileOfReferencedProject:"Config file of referened project",ExtendedConfigOfReferencedProject:"Extended config file of referenced project",WildcardDirectoryOfReferencedProject:"Wild card directory of referenced project",PackageJson:"package.json file"},e.createWatchFactory=function(t,r){var n=t.trace?r.extendedDiagnostics?e.WatchLogLevel.Verbose:r.diagnostics?e.WatchLogLevel.TriggerOnly:e.WatchLogLevel.None:e.WatchLogLevel.None,i=n!==e.WatchLogLevel.None?function(e){return t.trace(e)}:e.noop,a=e.getWatchFactory(t,n,i);return a.writeLog=i,a},e.createCompilerHostFromProgramHost=function(t,r,n){void 0===n&&(n=t);var i=t.useCaseSensitiveFileNames(),a=e.memoize((function(){return t.getNewLine()}));return {getSourceFile:function(n,i,a){var o;try{e.performance.mark("beforeIORead"),o=t.readFile(n,r().charset),e.performance.mark("afterIORead"),e.performance.measure("I/O Read","beforeIORead","afterIORead");}catch(e){a&&a(e.message),o="";}return void 0!==o?e.createSourceFile(n,o,i):void 0},getDefaultLibLocation:e.maybeBind(t,t.getDefaultLibLocation),getDefaultLibFileName:function(e){return t.getDefaultLibFileName(e)},writeFile:function(r,n,i,a){try{e.performance.mark("beforeIOWrite"),e.writeFileEnsuringDirectories(r,n,i,(function(e,r,n){return t.writeFile(e,r,n)}),(function(e){return t.createDirectory(e)}),(function(e){return t.directoryExists(e)})),e.performance.mark("afterIOWrite"),e.performance.measure("I/O Write","beforeIOWrite","afterIOWrite");}catch(e){a&&a(e.message);}},getCurrentDirectory:e.memoize((function(){return t.getCurrentDirectory()})),useCaseSensitiveFileNames:function(){return i},getCanonicalFileName:e.createGetCanonicalFileName(i),getNewLine:function(){return e.getNewLineCharacter(r(),a)},fileExists:function(e){return t.fileExists(e)},readFile:function(e){return t.readFile(e)},trace:e.maybeBind(t,t.trace),directoryExists:e.maybeBind(n,n.directoryExists),getDirectories:e.maybeBind(n,n.getDirectories),realpath:e.maybeBind(t,t.realpath),getEnvironmentVariable:e.maybeBind(t,t.getEnvironmentVariable)||function(){return ""},createHash:e.maybeBind(t,t.createHash),readDirectory:e.maybeBind(t,t.readDirectory),disableUseFileVersionAsSignature:t.disableUseFileVersionAsSignature}},e.setGetSourceFileAsHashVersioned=function(t,r){var i=t.getSourceFile,a=e.maybeBind(r,r.createHash)||e.generateDjb2Hash;t.getSourceFile=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var o=i.call.apply(i,n$3([t],e,!1));return o&&(o.version=a(o.text)),o};},e.createProgramHost=x,e.createWatchCompilerHostOfConfigFile=function(e){var t=e.configFileName,n=e.optionsToExtend,i=e.watchOptionsToExtend,a=e.extraFileExtensions,o=e.system,s=e.createProgram,c=e.reportDiagnostic,l=e.reportWatchStatus,u=c||r(o),_=D(o,s,u,l);return _.onUnRecoverableConfigFileDiagnostic=function(e){return S(o,u,e)},_.configFileName=t,_.optionsToExtend=n,_.watchOptionsToExtend=i,_.extraFileExtensions=a,_},e.createWatchCompilerHostOfFilesAndCompilerOptions=function(e){var t=e.rootFiles,n=e.options,i=e.watchOptions,a=e.projectReferences,o=e.system,s=e.createProgram,c=e.reportDiagnostic,l=e.reportWatchStatus,u=D(o,s,c||r(o),l);return u.rootFiles=t,u.options=n,u.watchOptions=i,u.projectReferences=a,u},e.performIncrementalCompilation=function(t){var n=t.system||e.sys,i=t.host||(t.host=e.createIncrementalCompilerHost(t.options,n)),a=e.createIncrementalProgram(t),o=h(a,t.reportDiagnostic||r(n),(function(e){return i.trace&&i.trace(e)}),t.reportErrorSummary||t.options.pretty?function(e){return n.write(l(e,n.newLine))}:void 0);return t.afterProgramEmitAndDiagnostics&&t.afterProgramEmitAndDiagnostics(a),o};}(t),function(e){function t(t,r){if(!e.outFile(t)){var n=e.getTsBuildInfoEmitOutputFilePath(t);if(n){var i=r.readFile(n);if(i){var a=e.getBuildInfo(i);if(a.version===e.version&&a.program)return e.createBuildProgramUsingProgramBuildInfo(a.program,n,r)}}}}function r(t,r){void 0===r&&(r=e.sys);var n=e.createCompilerHostWorker(t,void 0,r);return n.createHash=e.maybeBind(r,r.createHash),n.disableUseFileVersionAsSignature=r.disableUseFileVersionAsSignature,e.setGetSourceFileAsHashVersioned(n,r),e.changeCompilerHostLikeToUseCache(n,(function(t){return e.toPath(t,n.getCurrentDirectory(),n.getCanonicalFileName)})),n}e.readBuilderProgram=t,e.createIncrementalCompilerHost=r,e.createIncrementalProgram=function(n){var i=n.rootNames,a=n.options,o=n.configFileParsingDiagnostics,s=n.projectReferences,c=n.host,l=n.createProgram;return c=c||r(a),(l=l||e.createEmitAndSemanticDiagnosticsBuilderProgram)(i,a,c,t(a,c),o,s)},e.createWatchCompilerHost=function(t,r,n,i,a,o,s,c){return e.isArray(t)?e.createWatchCompilerHostOfFilesAndCompilerOptions({rootFiles:t,options:r,watchOptions:c,projectReferences:s,system:n,createProgram:i,reportDiagnostic:a,reportWatchStatus:o}):e.createWatchCompilerHostOfConfigFile({configFileName:t,optionsToExtend:r,watchOptionsToExtend:s,extraFileExtensions:c,system:n,createProgram:i,reportDiagnostic:a,reportWatchStatus:o})},e.createWatchProgram=function(r){var a,o,s,c,l,u,_,d,p,f,g,m,y=r.extendedConfigCache,v=!1,h=new e.Map,b=!1,x=r.useCaseSensitiveFileNames(),D=r.getCurrentDirectory(),S=r.configFileName,T=r.optionsToExtend,C=void 0===T?{}:T,E=r.watchOptionsToExtend,k=r.extraFileExtensions,N=r.createProgram,F=r.rootFiles,A=r.options,P=r.watchOptions,w=r.projectReferences,I=!1,O=!1,M=void 0===S?void 0:e.createCachedDirectoryStructureHost(r,D,x),L=M||r,R=e.parseConfigHostFromCompilerHostLike(r,L),B=$();S&&r.configFileParsingResult&&(fe(r.configFileParsingResult),B=$()),oe(e.Diagnostics.Starting_compilation_in_watch_mode),S&&!r.configFileParsingResult&&(B=e.getNewLineCharacter(C,(function(){return r.getNewLine()})),e.Debug.assert(!F),pe(),B=$());var j,J=e.createWatchFactory(r,A),z=J.watchFile,U=J.watchDirectory,K=J.writeLog,V=e.createGetCanonicalFileName(x);K("Current directory: ".concat(D," CaseSensitiveFileNames: ").concat(x)),S&&(j=z(S,(function(){e.Debug.assert(!!S),o=e.ConfigFileProgramReloadLevel.Full,ue();}),e.PollingInterval.High,P,e.WatchType.ConfigFile));var q=e.createCompilerHostFromProgramHost(r,(function(){return A}),L);e.setGetSourceFileAsHashVersioned(q,r);var W=q.getSourceFile;q.getSourceFile=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return ne.apply(void 0,n$3([e,ee(e)],t,!1))},q.getSourceFileByPath=ne,q.getNewLine=function(){return B},q.fileExists=re,q.onReleaseOldSourceFile=function(e,t,r){var n=h.get(e.resolvedPath);void 0!==n&&(te(n)?(f||(f=[])).push(e.path):n.sourceFile===e&&(n.fileWatcher&&n.fileWatcher.close(),h.delete(e.resolvedPath),r||H.removeResolutionsOfFile(e.path)));},q.onReleaseParsedCommandLine=function(t){var r,n=ee(t),i=null==d?void 0:d.get(n);i&&(d.delete(n),i.watchedDirectories&&e.clearMap(i.watchedDirectories,e.closeFileWatcherOf),null===(r=i.watcher)||void 0===r||r.close(),e.clearSharedExtendedConfigFileWatcher(n,p));},q.toPath=ee,q.getCompilationSettings=function(){return A},q.useSourceOfProjectReferenceRedirect=e.maybeBind(r,r.useSourceOfProjectReferenceRedirect),q.watchDirectoryOfFailedLookupLocation=function(t,r,n){return U(t,r,n,P,e.WatchType.FailedLookupLocations)},q.watchTypeRootsDirectory=function(t,r,n){return U(t,r,n,P,e.WatchType.TypeRoots)},q.getCachedDirectoryStructureHost=function(){return M},q.scheduleInvalidateResolutionsOfFailedLookupLocations=function(){if(!r.setTimeout||!r.clearTimeout)return H.invalidateResolutionsOfFailedLookupLocations();var e=ce();K("Scheduling invalidateFailedLookup".concat(e?", Cancelled earlier one":"")),_=r.setTimeout(le,250);},q.onInvalidatedResolution=ue,q.onChangedAutomaticTypeDirectiveNames=ue,q.fileIsOpen=e.returnFalse,q.getCurrentProgram=Y,q.writeLog=K,q.getParsedCommandLine=ge;var H=e.createResolutionCache(q,S?e.getDirectoryPath(e.getNormalizedAbsolutePath(S,D)):D,!1);q.resolveModuleNames=r.resolveModuleNames?function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return r.resolveModuleNames.apply(r,e)}:function(e,t,r,n,i,a){return H.resolveModuleNames(e,t,r,n,a)},q.resolveTypeReferenceDirectives=r.resolveTypeReferenceDirectives?function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return r.resolveTypeReferenceDirectives.apply(r,e)}:function(e,t,r){return H.resolveTypeReferenceDirectives(e,t,r)};var G=!!r.resolveModuleNames||!!r.resolveTypeReferenceDirectives;return a=t(A,q),Z(),Se(),S&&Ce(ee(S),A,P,e.WatchType.ExtendedConfigFile),S?{getCurrentProgram:X,getProgram:de,close:Q}:{getCurrentProgram:X,getProgram:de,updateRootFileNames:function(t){e.Debug.assert(!S,"Cannot update root file names with config file watch mode"),F=t,ue();},close:Q};function Q(){ce(),H.clear(),e.clearMap(h,(function(e){e&&e.fileWatcher&&(e.fileWatcher.close(),e.fileWatcher=void 0);})),j&&(j.close(),j=void 0),null==y||y.clear(),y=void 0,p&&(e.clearMap(p,e.closeFileWatcherOf),p=void 0),l&&(e.clearMap(l,e.closeFileWatcherOf),l=void 0),s&&(e.clearMap(s,e.closeFileWatcher),s=void 0),d&&(e.clearMap(d,(function(t){var r;null===(r=t.watcher)||void 0===r||r.close(),t.watcher=void 0,t.watchedDirectories&&e.clearMap(t.watchedDirectories,e.closeFileWatcherOf),t.watchedDirectories=void 0;})),d=void 0),c&&(e.clearMap(c,e.closeFileWatcher),c=void 0);}function X(){return a}function Y(){return a&&a.getProgramOrUndefined()}function Z(){K("Synchronizing program"),ce();var t=X();b&&(B=$(),t&&(v||e.changesAffectModuleResolution(t.getCompilerOptions(),A))&&H.clear());var n=H.createHasInvalidatedResolution(G||v);return e.isProgramUptoDate(Y(),F,A,ae,re,n,se,ge,w)?O&&(a=N(void 0,void 0,q,a,m,w),O=!1):function(t){K("CreatingProgramWith::"),K(" roots: ".concat(JSON.stringify(F))),K(" options: ".concat(JSON.stringify(A))),w&&K(" projectReferences: ".concat(JSON.stringify(w)));var r=b||!Y();b=!1,O=!1,H.startCachingPerDirectoryResolution(),q.hasInvalidatedResolution=t,q.hasChangedAutomaticTypeDirectiveNames=se,a=N(F,A,q,a,m,w);var n=e.map(H.getModuleResolutionCache().getPackageJsonInfoCache().entries(),(function(e){var t=e[0],r=e[1];return [q.realpath?ee(q.realpath(t)):t,r]}));if(H.finishCachingPerDirectoryResolution(),e.updateMissingFilePathsWatch(a.getProgram(),s||(s=new e.Map),he),e.updatePackageJsonWatch(n,c||(c=new e.Map),be),r&&H.updateTypeRootsWatch(),f){for(var i=0,o=f;i<o.length;i++){var l=o[i];s.has(l)||h.delete(l);}f=void 0;}}(n),v=!1,r.afterProgramCreate&&t!==a&&r.afterProgramCreate(a),a}function $(){return e.getNewLineCharacter(A||C,(function(){return r.getNewLine()}))}function ee(t){return e.toPath(t,D,V)}function te(e){return "boolean"==typeof e}function re(e){var t=ee(e);return !te(h.get(t))&&L.fileExists(e)}function ne(t,r,n,i,a){var o=h.get(r);if(!te(o)){if(void 0===o||a||function(e){return "boolean"==typeof e.version}(o)){var s=W(t,n,i);if(o)s?(o.sourceFile=s,o.version=s.version,o.fileWatcher||(o.fileWatcher=me(r,t,ye,e.PollingInterval.Low,P,e.WatchType.SourceFile))):(o.fileWatcher&&o.fileWatcher.close(),h.set(r,!1));else if(s){var c=me(r,t,ye,e.PollingInterval.Low,P,e.WatchType.SourceFile);h.set(r,{sourceFile:s,version:s.version,fileWatcher:c});}else h.set(r,!1);return s&&(s.impliedNodeFormat=e.getImpliedNodeFormatForFile(r,H.getModuleResolutionCache().getPackageJsonInfoCache(),q,q.getCompilationSettings())),s}return o.sourceFile}}function ie(e){var t=h.get(e);void 0!==t&&(te(t)?h.set(e,{version:!1}):t.version=!1);}function ae(e){var t=h.get(e);return t&&t.version?t.version:void 0}function oe(t){r.onWatchStatusChange&&r.onWatchStatusChange(e.createCompilerDiagnostic(t),B,A||C);}function se(){return H.hasChangedAutomaticTypeDirectiveNames()}function ce(){return !!_&&(r.clearTimeout(_),_=void 0,!0)}function le(){_=void 0,H.invalidateResolutionsOfFailedLookupLocations()&&ue();}function ue(){r.setTimeout&&r.clearTimeout&&(u&&r.clearTimeout(u),K("Scheduling update"),u=r.setTimeout(_e,250));}function _e(){u=void 0,oe(e.Diagnostics.File_change_detected_Starting_incremental_compilation),de();}function de(){switch(o){case e.ConfigFileProgramReloadLevel.Partial:e.perfLogger.logStartUpdateProgram("PartialConfigReload"),K("Reloading new file names and options"),F=e.getFileNamesFromConfigSpecs(A.configFile.configFileSpecs,e.getNormalizedAbsolutePath(e.getDirectoryPath(S),D),A,R,k),e.updateErrorForNoInputFiles(F,e.getNormalizedAbsolutePath(S,D),A.configFile.configFileSpecs,m,I)&&(O=!0),Z();break;case e.ConfigFileProgramReloadLevel.Full:e.perfLogger.logStartUpdateProgram("FullConfigReload"),K("Reloading config file: ".concat(S)),o=e.ConfigFileProgramReloadLevel.None,M&&M.clearCache(),pe(),b=!0,Z(),Se(),Ce(ee(S),A,P,e.WatchType.ExtendedConfigFile);break;default:e.perfLogger.logStartUpdateProgram("SynchronizeProgram"),Z();}return e.perfLogger.logStopUpdateProgram("Done"),X()}function pe(){fe(e.getParsedCommandLineOfConfigFile(S,C,R,y||(y=new e.Map),E,k));}function fe(t){F=t.fileNames,A=t.options,P=t.watchOptions,w=t.projectReferences,g=t.wildcardDirectories,m=e.getConfigFileParsingDiagnostics(t).slice(),I=e.canJsonReportNoInputFiles(t.raw),O=!0;}function ge(t){var n=ee(t),a=null==d?void 0:d.get(n);if(a){if(!a.reloadLevel)return a.parsedCommandLine;if(a.parsedCommandLine&&a.reloadLevel===e.ConfigFileProgramReloadLevel.Partial&&!r.getParsedCommandLine){K("Reloading new file names and options");var o=e.getFileNamesFromConfigSpecs(a.parsedCommandLine.options.configFile.configFileSpecs,e.getNormalizedAbsolutePath(e.getDirectoryPath(t),D),A,R);return a.parsedCommandLine=i$1(i$1({},a.parsedCommandLine),{fileNames:o}),a.reloadLevel=void 0,a.parsedCommandLine}}K("Loading config file: ".concat(t));var s=r.getParsedCommandLine?r.getParsedCommandLine(t):function(t){var r=R.onUnRecoverableConfigFileDiagnostic;R.onUnRecoverableConfigFileDiagnostic=e.noop;var n=e.getParsedCommandLineOfConfigFile(t,void 0,R,y||(y=new e.Map),E);return R.onUnRecoverableConfigFileDiagnostic=r,n}(t);return a?(a.parsedCommandLine=s,a.reloadLevel=void 0):(d||(d=new e.Map)).set(n,a={parsedCommandLine:s}),function(t,r,n){var i,a,o,s,c;n.watcher||(n.watcher=z(t,(function(n,i){ve(t,r,i);var a=null==d?void 0:d.get(r);a&&(a.reloadLevel=e.ConfigFileProgramReloadLevel.Full),H.removeResolutionsFromProjectReferenceRedirects(r),ue();}),e.PollingInterval.High,(null===(i=n.parsedCommandLine)||void 0===i?void 0:i.watchOptions)||P,e.WatchType.ConfigFileOfReferencedProject)),(null===(a=n.parsedCommandLine)||void 0===a?void 0:a.wildcardDirectories)?e.updateWatchingWildcardDirectories(n.watchedDirectories||(n.watchedDirectories=new e.Map),new e.Map(e.getEntries(null===(o=n.parsedCommandLine)||void 0===o?void 0:o.wildcardDirectories)),(function(i,a){var o;return U(i,(function(n){var a=ee(n);M&&M.addOrDeleteFileOrDirectory(n,a),ie(a);var o=null==d?void 0:d.get(r);(null==o?void 0:o.parsedCommandLine)&&(e.isIgnoredFileFromWildCardWatching({watchedDirPath:ee(i),fileOrDirectory:n,fileOrDirectoryPath:a,configFileName:t,options:o.parsedCommandLine.options,program:o.parsedCommandLine.fileNames,currentDirectory:D,useCaseSensitiveFileNames:x,writeLog:K,toPath:ee})||o.reloadLevel!==e.ConfigFileProgramReloadLevel.Full&&(o.reloadLevel=e.ConfigFileProgramReloadLevel.Partial,ue()));}),a,(null===(o=n.parsedCommandLine)||void 0===o?void 0:o.watchOptions)||P,e.WatchType.WildcardDirectoryOfReferencedProject)})):n.watchedDirectories&&(e.clearMap(n.watchedDirectories,e.closeFileWatcherOf),n.watchedDirectories=void 0),Ce(r,null===(s=n.parsedCommandLine)||void 0===s?void 0:s.options,(null===(c=n.parsedCommandLine)||void 0===c?void 0:c.watchOptions)||P,e.WatchType.ExtendedConfigOfReferencedProject);}(t,n,a),s}function me(e,t,r,n,i,a){return z(t,(function(t,n){return r(t,n,e)}),n,i,a)}function ye(t,r,n){ve(t,n,r),r===e.FileWatcherEventKind.Deleted&&h.has(n)&&H.invalidateResolutionOfFile(n),ie(n),ue();}function ve(e,t,r){M&&M.addOrDeleteFile(e,t,r);}function he(t){return (null==d?void 0:d.has(t))?e.noopFileWatcher:me(t,t,De,e.PollingInterval.Medium,P,e.WatchType.MissingFile)}function be(t){return h.has(t)?e.noopFileWatcher:me(t,t,xe,e.PollingInterval.High,P,e.WatchType.PackageJson)}function xe(t,r,n){ve(t,n,r),o=e.ConfigFileProgramReloadLevel.Full,v=!0,ue();}function De(t,r,n){ve(t,n,r),r===e.FileWatcherEventKind.Created&&s.has(n)&&(s.get(n).close(),s.delete(n),ie(n),ue());}function Se(){g?e.updateWatchingWildcardDirectories(l||(l=new e.Map),new e.Map(e.getEntries(g)),Te):l&&e.clearMap(l,e.closeFileWatcherOf);}function Te(t,r){return U(t,(function(r){e.Debug.assert(!!S);var n=ee(r);M&&M.addOrDeleteFileOrDirectory(r,n),ie(n),e.isIgnoredFileFromWildCardWatching({watchedDirPath:ee(t),fileOrDirectory:r,fileOrDirectoryPath:n,configFileName:S,extraFileExtensions:k,options:A,program:X()||F,currentDirectory:D,useCaseSensitiveFileNames:x,writeLog:K,toPath:ee})||o!==e.ConfigFileProgramReloadLevel.Full&&(o=e.ConfigFileProgramReloadLevel.Partial,ue());}),r,P,e.WatchType.WildcardDirectory)}function Ce(t,r,n,i){e.updateSharedExtendedConfigFileWatcher(t,r,p||(p=new e.Map),(function(t,r){return z(t,(function(n,i){var a;ve(t,r,i),y&&e.cleanExtendedConfigCache(y,r,ee);var s=null===(a=p.get(r))||void 0===a?void 0:a.projects;(null==s?void 0:s.size)&&s.forEach((function(t){if(ee(S)===t)o=e.ConfigFileProgramReloadLevel.Full;else {var r=null==d?void 0:d.get(t);r&&(r.reloadLevel=e.ConfigFileProgramReloadLevel.Full),H.removeResolutionsFromProjectReferenceRedirects(t);}ue();}));}),e.PollingInterval.High,n,i)}),ee);}};}(t),function(e){var t;(t=e.UpToDateStatusType||(e.UpToDateStatusType={}))[t.Unbuildable=0]="Unbuildable",t[t.UpToDate=1]="UpToDate",t[t.UpToDateWithUpstreamTypes=2]="UpToDateWithUpstreamTypes",t[t.OutOfDateWithPrepend=3]="OutOfDateWithPrepend",t[t.OutputMissing=4]="OutputMissing",t[t.OutOfDateWithSelf=5]="OutOfDateWithSelf",t[t.OutOfDateWithUpstream=6]="OutOfDateWithUpstream",t[t.UpstreamOutOfDate=7]="UpstreamOutOfDate",t[t.UpstreamBlocked=8]="UpstreamBlocked",t[t.ComputingUpstream=9]="ComputingUpstream",t[t.TsVersionOutputOfDate=10]="TsVersionOutputOfDate",t[t.ContainerOnly=11]="ContainerOnly",e.resolveConfigFileProjectName=function(t){return e.fileExtensionIs(t,".json")?t:e.combinePaths(t,"tsconfig.json")};}(t),function(e){var t,r,i,a=new Date(-864e13),o=new Date(864e13);function s(t,r){return function(t,r,n){var i,a=t.get(r);return a||(i=new e.Map,t.set(r,i)),a||i}(t,r)}function c(e,t){return t>e?t:e}function l(t){return e.fileExtensionIs(t,".d.ts")}function u(e){return !!e&&!!e.buildOrder}function _(e){return u(e)?e.buildOrder:e}function d(t,r){return function(n){var i=r?"[".concat(e.formatColorAndReset(e.getLocaleTimeString(t),e.ForegroundColorEscapeSequences.Grey),"] "):"".concat(e.getLocaleTimeString(t)," - ");i+="".concat(e.flattenDiagnosticMessageText(n.messageText,t.newLine)).concat(t.newLine+t.newLine),t.write(i);}}function p(t,r,n,i){var a=e.createProgramHost(t,r);return a.getModifiedTime=t.getModifiedTime?function(e){return t.getModifiedTime(e)}:e.returnUndefined,a.setModifiedTime=t.setModifiedTime?function(e,r){return t.setModifiedTime(e,r)}:e.noop,a.deleteFile=t.deleteFile?function(e){return t.deleteFile(e)}:e.noop,a.reportDiagnostic=n||e.createDiagnosticReporter(t),a.reportSolutionBuilderStatus=i||d(t),a.now=e.maybeBind(t,t.now),a}function f(t,r){return e.toPath(r,t.currentDirectory,t.getCanonicalFileName)}function g(e,t){var r=e.resolvedConfigFilePaths,n=r.get(t);if(void 0!==n)return n;var i=f(e,t);return r.set(t,i),i}function m(e){return !!e.options}function y(e,t){var r=e.configFileCache.get(t);return r&&m(r)?r:void 0}function v(t,r,n){var i,a=t.configFileCache,o=a.get(n);if(o)return m(o)?o:void 0;var s,c=t.parseConfigFileHost,l=t.baseCompilerOptions,u=t.baseWatchOptions,_=t.extendedConfigCache,d=t.host;return d.getParsedCommandLine?(s=d.getParsedCommandLine(r))||(i=e.createCompilerDiagnostic(e.Diagnostics.File_0_not_found,r)):(c.onUnRecoverableConfigFileDiagnostic=function(e){return i=e},s=e.getParsedCommandLineOfConfigFile(r,l,c,_,u),c.onUnRecoverableConfigFileDiagnostic=e.noop),a.set(n,s||i),s}function h(t,r){return e.resolveConfigFileProjectName(e.resolvePath(t.currentDirectory,r))}function b(t,r){for(var n,i,a=new e.Map,o=new e.Map,s=[],c=0,l=r;c<l.length;c++)u(l[c]);return i?{buildOrder:n||e.emptyArray,circularDiagnostics:i}:n||e.emptyArray;function u(r,c){var l=g(t,r);if(!o.has(l))if(a.has(l))c||(i||(i=[])).push(e.createCompilerDiagnostic(e.Diagnostics.Project_references_may_not_form_a_circular_graph_Cycle_detected_Colon_0,s.join("\r\n")));else {a.set(l,!0),s.push(r);var _=v(t,r,l);if(_&&_.projectReferences)for(var d=0,p=_.projectReferences;d<p.length;d++){var f=p[d];u(h(t,f.path),c||f.circular);}s.pop(),o.set(l,!0),(n||(n=[])).push(r);}}}function x(t){return t.buildOrder||function(t){var r=b(t,t.rootNames.map((function(e){return h(t,e)})));t.resolvedConfigFilePaths.clear();var n=new e.Map(_(r).map((function(e){return [g(t,e),!0]}))),i={onDeleteValue:e.noop};return e.mutateMapSkippingNewValues(t.configFileCache,n,i),e.mutateMapSkippingNewValues(t.projectStatus,n,i),e.mutateMapSkippingNewValues(t.buildInfoChecked,n,i),e.mutateMapSkippingNewValues(t.builderPrograms,n,i),e.mutateMapSkippingNewValues(t.diagnostics,n,i),e.mutateMapSkippingNewValues(t.projectPendingBuild,n,i),e.mutateMapSkippingNewValues(t.projectErrorsReported,n,i),t.watch&&(e.mutateMapSkippingNewValues(t.allWatchedConfigFiles,n,{onDeleteValue:e.closeFileWatcher}),t.allWatchedExtendedConfigFiles.forEach((function(e){e.projects.forEach((function(t){n.has(t)||e.projects.delete(t);})),e.close();})),e.mutateMapSkippingNewValues(t.allWatchedWildcardDirectories,n,{onDeleteValue:function(t){return t.forEach(e.closeFileWatcherOf)}}),e.mutateMapSkippingNewValues(t.allWatchedInputFiles,n,{onDeleteValue:function(t){return t.forEach(e.closeFileWatcher)}}),e.mutateMapSkippingNewValues(t.allWatchedPackageJsonFiles,n,{onDeleteValue:function(t){return t.forEach(e.closeFileWatcher)}})),t.buildOrder=r}(t)}function D(t,r,n){var i=r&&h(t,r),a=x(t);if(u(a))return a;if(i){var o=g(t,i);if(-1===e.findIndex(a,(function(e){return g(t,e)===o})))return}var s=i?b(t,[i]):a;return e.Debug.assert(!u(s)),e.Debug.assert(!n||void 0!==i),e.Debug.assert(!n||s[s.length-1]===i),n?s.slice(0,s.length-1):s}function S(t){t.cache&&T(t);var r=t.compilerHost,i=t.host,a=t.readFileWithCache,o=r.getSourceFile,s=e.changeCompilerHostLikeToUseCache(i,(function(e){return f(t,e)}),(function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return o.call.apply(o,n$3([r],e,!1))})),c=s.originalReadFile,l=s.originalFileExists,u=s.originalDirectoryExists,_=s.originalCreateDirectory,d=s.originalWriteFile,p=s.getSourceFileWithCache,g=s.readFileWithCache;t.readFileWithCache=g,r.getSourceFile=p,t.cache={originalReadFile:c,originalFileExists:l,originalDirectoryExists:u,originalCreateDirectory:_,originalWriteFile:d,originalReadFileWithCache:a,originalGetSourceFile:o};}function T(e){if(e.cache){var t=e.cache,r=e.host,n=e.compilerHost,i=e.extendedConfigCache,a=e.moduleResolutionCache,o=e.typeReferenceDirectiveResolutionCache;r.readFile=t.originalReadFile,r.fileExists=t.originalFileExists,r.directoryExists=t.originalDirectoryExists,r.createDirectory=t.originalCreateDirectory,r.writeFile=t.originalWriteFile,n.getSourceFile=t.originalGetSourceFile,e.readFileWithCache=t.originalReadFileWithCache,i.clear(),null==a||a.clear(),null==o||o.clear(),e.cache=void 0;}}function C(e,t){e.projectStatus.delete(t),e.diagnostics.delete(t);}function E(e,t,r){var n=e.projectPendingBuild,i=n.get(t);(void 0===i||i<r)&&n.set(t,r);}function k(t,r){t.allProjectBuildPending&&(t.allProjectBuildPending=!1,t.options.watch&&te(t,e.Diagnostics.Starting_compilation_in_watch_mode),S(t),_(x(t)).forEach((function(r){return t.projectPendingBuild.set(g(t,r),e.ConfigFileProgramReloadLevel.None)})),r&&r.throwIfCancellationRequested());}function N(t,r){return t.projectPendingBuild.delete(r),t.currentInvalidatedProject=void 0,t.diagnostics.has(r)?e.ExitStatus.DiagnosticsPresent_OutputsSkipped:e.ExitStatus.Success}function F(e,t,n,i,a){var o=!0;return {kind:r.UpdateOutputFileStamps,project:t,projectPath:n,buildOrder:a,getCompilerOptions:function(){return i.options},getCurrentDirectory:function(){return e.currentDirectory},updateOutputFileStatmps:function(){j(e,i,n),o=!1;},done:function(){return o&&j(e,i,n),N(e,n)}}}function A(s,u,_,d,p,m,y){var b,x,D,S=s===r.Build?i.CreateProgram:i.EmitBundle;return s===r.Build?{kind:s,project:_,projectPath:d,buildOrder:y,getCompilerOptions:function(){return m.options},getCurrentDirectory:function(){return u.currentDirectory},getBuilderProgram:function(){return C(e.identity)},getProgram:function(){return C((function(e){return e.getProgramOrUndefined()}))},getSourceFile:function(e){return C((function(t){return t.getSourceFile(e)}))},getSourceFiles:function(){return E((function(e){return e.getSourceFiles()}))},getOptionsDiagnostics:function(e){return E((function(t){return t.getOptionsDiagnostics(e)}))},getGlobalDiagnostics:function(e){return E((function(t){return t.getGlobalDiagnostics(e)}))},getConfigFileParsingDiagnostics:function(){return E((function(e){return e.getConfigFileParsingDiagnostics()}))},getSyntacticDiagnostics:function(e,t){return E((function(r){return r.getSyntacticDiagnostics(e,t)}))},getAllDependencies:function(e){return E((function(t){return t.getAllDependencies(e)}))},getSemanticDiagnostics:function(e,t){return E((function(r){return r.getSemanticDiagnostics(e,t)}))},getSemanticDiagnosticsOfNextAffectedFile:function(e,t){return C((function(r){return r.getSemanticDiagnosticsOfNextAffectedFile&&r.getSemanticDiagnosticsOfNextAffectedFile(e,t)}))},emit:function(e,t,r,n,a){return e||n?C((function(i){var o,s;return i.emit(e,t,r,n,a||(null===(s=(o=u.host).getCustomTransformers)||void 0===s?void 0:s.call(o,_)))})):(U(i.SemanticDiagnostics,r),S===i.EmitBuildInfo?R(t,r):S===i.Emit?L(t,r,a):void 0)},done:T}:{kind:s,project:_,projectPath:d,buildOrder:y,getCompilerOptions:function(){return m.options},getCurrentDirectory:function(){return u.currentDirectory},emit:function(e,t){return S!==i.EmitBundle?D:z(e,t)},done:T};function T(e,t,r){return U(i.Done,e,t,r),N(u,d)}function C(e){return U(i.CreateProgram),b&&e(b)}function E(t){return C(t)||e.emptyArray}function k(){var r,n;if(e.Debug.assert(void 0===b),u.options.dry)return ee(u,e.Diagnostics.A_non_dry_build_would_build_project_0,_),x=t.Success,void(S=i.QueueReferencingProjects);if(u.options.verbose&&ee(u,e.Diagnostics.Building_project_0,_),0===m.fileNames.length)return ne(u,d,e.getConfigFileParsingDiagnostics(m)),x=t.None,void(S=i.QueueReferencingProjects);var a=u.host,o=u.compilerHost;u.projectCompilerOptions=m.options,null===(r=u.moduleResolutionCache)||void 0===r||r.update(m.options),null===(n=u.typeReferenceDirectiveResolutionCache)||void 0===n||n.update(m.options),b=a.createProgram(m.fileNames,m.options,o,function(t,r,n){var i=t.options,a=t.builderPrograms,o=t.compilerHost;if(!i.force)return a.get(r)||e.readBuilderProgram(n.options,o)}(u,d,m),e.getConfigFileParsingDiagnostics(m),m.projectReferences),u.watch&&(u.lastCachedPackageJsonLookups.set(d,u.moduleResolutionCache&&e.map(u.moduleResolutionCache.getPackageJsonInfoCache().entries(),(function(e){var t=e[0],r=e[1];return [u.host.realpath&&r?f(u,u.host.realpath(t)):t,r]}))),u.builderPrograms.set(d,b)),S++;}function F(e,t,r){var n;e.length?(n=M(u,d,b,m,e,t,r),x=n.buildResult,S=n.step):S++;}function P(r){e.Debug.assertIsDefined(b),F(n$3(n$3(n$3(n$3([],b.getConfigFileParsingDiagnostics(),!0),b.getOptionsDiagnostics(r),!0),b.getGlobalDiagnostics(r),!0),b.getSyntacticDiagnostics(void 0,r),!0),t.SyntaxErrors,"Syntactic");}function w(r){F(e.Debug.checkDefined(b).getSemanticDiagnostics(void 0,r),t.TypeErrors,"Semantic");}function L(r,n,o){var s,p,g,y;e.Debug.assertIsDefined(b),e.Debug.assert(S===i.Emit),b.backupState();var v=[],h=e.emitFilesAndReportErrors(b,(function(e){return (y||(y=[])).push(e)}),void 0,void 0,(function(e,t,r){return v.push({name:e,text:t,writeByteOrderMark:r})}),n,!1,o||(null===(g=(p=u.host).getCustomTransformers)||void 0===g?void 0:g.call(p,_))).emitResult;if(y)return b.restoreState(),s=M(u,d,b,m,y,t.DeclarationEmitErrors,"Declaration file"),x=s.buildResult,S=s.step,{emitSkipped:!0,diagnostics:h.diagnostics};var D=u.host,T=u.compilerHost,C=t.DeclarationOutputUnchanged,E=a,k=!1,N=e.createDiagnosticCollection(),F=new e.Map;return v.forEach((function(n){var i,a=n.name,o=n.text,s=n.writeByteOrderMark;!k&&l(a)&&(D.fileExists(a)&&u.readFileWithCache(a)===o?i=D.getModifiedTime(a):(C&=~t.DeclarationOutputUnchanged,k=!0)),F.set(f(u,a),a),e.writeFile(r?{writeFile:r}:T,N,a,o,s),void 0!==i&&(E=c(i,E));})),j(N,F,E,k,v.length?v[0].name:e.getFirstProjectOutput(m,!D.useCaseSensitiveFileNames()),C),h}function R(r,a){e.Debug.assertIsDefined(b),e.Debug.assert(S===i.EmitBuildInfo);var o=b.emitBuildInfo(r,a);return o.diagnostics.length&&(re(u,o.diagnostics),u.diagnostics.set(d,n$3(n$3([],u.diagnostics.get(d),!0),o.diagnostics,!0)),x=t.EmitErrors&x),o.emittedFiles&&u.write&&o.emittedFiles.forEach((function(e){return I(u,m,e)})),O(u,b,m),S=i.QueueReferencingProjects,o}function j(r,n,a,s,c,l){var _,p=r.getDiagnostics();if(p.length)return _=M(u,d,b,m,p,t.EmitErrors,"Emit"),x=_.buildResult,S=_.step,p;u.write&&n.forEach((function(e){return I(u,m,e)}));var f=B(u,m,a,e.Diagnostics.Updating_unchanged_output_timestamps_of_project_0,n);return u.diagnostics.delete(d),u.projectStatus.set(d,{type:e.UpToDateStatusType.UpToDate,newestDeclarationFileContentChangedTime:s?o:f,oldestOutputFileName:c}),O(u,b,m),S=i.QueueReferencingProjects,x=l,p}function z(n,o){var c,l;if(e.Debug.assert(s===r.UpdateBundle),u.options.dry)return ee(u,e.Diagnostics.A_non_dry_build_would_update_output_of_project_0,_),x=t.Success,void(S=i.QueueReferencingProjects);u.options.verbose&&ee(u,e.Diagnostics.Updating_output_of_project_0,_);var b=u.compilerHost;u.projectCompilerOptions=m.options;var T=e.emitUsingBuildInfo(m,b,(function(e){var t=h(u,e.path);return v(u,t,g(u,t))}),o||(null===(l=(c=u.host).getCustomTransformers)||void 0===l?void 0:l.call(c,_)));if(e.isString(T))return ee(u,e.Diagnostics.Cannot_update_output_of_project_0_because_there_was_error_reading_file_1,_,$(u,T)),S=i.BuildInvalidatedProjectOfBundle,D=A(r.Build,u,_,d,p,m,y);e.Debug.assert(!!T.length);var C=e.createDiagnosticCollection(),E=new e.Map;return T.forEach((function(t){var r=t.name,i=t.text,a=t.writeByteOrderMark;E.set(f(u,r),r),e.writeFile(n?{writeFile:n}:b,C,r,i,a);})),{emitSkipped:!1,diagnostics:j(C,E,a,!1,T[0].name,t.DeclarationOutputUnchanged)}}function U(t,r,n,a){for(;S<=t&&S<i.Done;){var o=S;switch(S){case i.CreateProgram:k();break;case i.SyntaxDiagnostics:P(r);break;case i.SemanticDiagnostics:w(r);break;case i.Emit:L(n,r,a);break;case i.EmitBuildInfo:R(n,r);break;case i.EmitBundle:z(n,a);break;case i.BuildInvalidatedProjectOfBundle:e.Debug.checkDefined(D).done(r,n,a),S=i.Done;break;case i.QueueReferencingProjects:J(u,_,d,p,m,y,e.Debug.checkDefined(x)),S++;break;case i.Done:default:e.assertType(S);}e.Debug.assert(S>o);}}}function P(t,r,n){var i=t.options;return !(r.type===e.UpToDateStatusType.OutOfDateWithPrepend&&!i.force&&0!==n.fileNames.length&&!e.getConfigFileParsingDiagnostics(n).length&&e.isIncrementalCompilation(n.options))}function w(t,n,i){if(t.projectPendingBuild.size&&!u(n)){if(t.currentInvalidatedProject)return e.arrayIsEqualTo(t.currentInvalidatedProject.buildOrder,n)?t.currentInvalidatedProject:void 0;for(var a=t.options,o=t.projectPendingBuild,s=0;s<n.length;s++){var c=n[s],l=g(t,c),_=t.projectPendingBuild.get(l);if(void 0!==_){i&&(i=!1,oe(t,n));var d=v(t,c,l);if(d){_===e.ConfigFileProgramReloadLevel.Full?(H(t,c,l,d),G(t,l,d),Q(t,c,l,d),X(t,c,l,d),Y(t,c,l,d)):_===e.ConfigFileProgramReloadLevel.Partial&&(d.fileNames=e.getFileNamesFromConfigSpecs(d.options.configFile.configFileSpecs,e.getDirectoryPath(c),d.options,t.parseConfigFileHost),e.updateErrorForNoInputFiles(d.fileNames,c,d.options.configFile.configFileSpecs,d.errors,e.canJsonReportNoInputFiles(d.raw)),X(t,c,l,d),Y(t,c,l,d));var p=R(t,d,l);if(se(t,c,p),!a.force){if(p.type===e.UpToDateStatusType.UpToDate){ne(t,l,e.getConfigFileParsingDiagnostics(d)),o.delete(l),a.dry&&ee(t,e.Diagnostics.Project_0_is_up_to_date,c);continue}if(p.type===e.UpToDateStatusType.UpToDateWithUpstreamTypes)return ne(t,l,e.getConfigFileParsingDiagnostics(d)),F(t,c,l,d,n)}if(p.type!==e.UpToDateStatusType.UpstreamBlocked){if(p.type!==e.UpToDateStatusType.ContainerOnly)return A(P(t,p,d)?r.Build:r.UpdateBundle,t,c,l,s,d,n);ne(t,l,e.getConfigFileParsingDiagnostics(d)),o.delete(l);}else ne(t,l,e.getConfigFileParsingDiagnostics(d)),o.delete(l),a.verbose&&ee(t,p.upstreamProjectBlocked?e.Diagnostics.Skipping_build_of_project_0_because_its_dependency_1_was_not_built:e.Diagnostics.Skipping_build_of_project_0_because_its_dependency_1_has_errors,c,p.upstreamProjectName);}else ie(t,l),o.delete(l);}}}}function I(e,t,r){var n=e.write;n&&t.options.listEmittedFiles&&n("TSFILE: ".concat(r));}function O(t,r,n){r?(r&&t.write&&e.listFiles(r,t.write),t.host.afterProgramEmitAndDiagnostics&&t.host.afterProgramEmitAndDiagnostics(r),r.releaseProgram()):t.host.afterEmitBundle&&t.host.afterEmitBundle(n),t.projectCompilerOptions=t.baseCompilerOptions;}function M(r,n,a,o,s,c,l){var u=!(c&t.SyntaxErrors)&&a&&!e.outFile(a.getCompilerOptions());return ne(r,n,s),r.projectStatus.set(n,{type:e.UpToDateStatusType.Unbuildable,reason:"".concat(l," errors")}),u?{buildResult:c,step:i.EmitBuildInfo}:(O(r,a,o),{buildResult:c,step:i.QueueReferencingProjects})}function L(t,r,n,i){if(n<e.getModifiedTime(t.host,r))return {type:e.UpToDateStatusType.OutOfDateWithSelf,outOfDateOutputFileName:i,newerInputFileName:r}}function R(t,r,n){if(void 0===r)return {type:e.UpToDateStatusType.Unbuildable,reason:"File deleted mid-build"};var i=t.projectStatus.get(n);if(void 0!==i)return i;var s=function(t,r,n){for(var i=!!t.options.force,s=void 0,u=a,_=t.host,d=0,p=r.fileNames;d<p.length;d++){var f=p[d];if(!_.fileExists(f))return {type:e.UpToDateStatusType.Unbuildable,reason:"".concat(f," does not exist")};if(!i){var m=e.getModifiedTime(_,f);m>u&&(s=f,u=m);}}if(!r.fileNames.length&&!e.canJsonReportNoInputFiles(r.raw))return {type:e.UpToDateStatusType.ContainerOnly};var y,h=e.getAllProjectOutputs(r,!_.useCaseSensitiveFileNames()),b="(none)",x=o,D="(none)",S=a,T=a,C=!1;if(!i)for(var E=0,k=h;E<k.length;E++){var N=k[E];if(!_.fileExists(N)){y=N;break}var F=e.getModifiedTime(_,N);if(F<x&&(x=F,b=N),F<u){C=!0;break}F>S&&(S=F,D=N),l(N)&&(T=c(T,e.getModifiedTime(_,N)));}var A,P=!1,w=!1;if(r.projectReferences){t.projectStatus.set(n,{type:e.UpToDateStatusType.ComputingUpstream});for(var I=0,O=r.projectReferences;I<O.length;I++){var M=O[I];w=w||!!M.prepend;var B=e.resolveProjectReferencePath(M),j=g(t,B),J=R(t,v(t,B,j),j);if(J.type!==e.UpToDateStatusType.ComputingUpstream&&J.type!==e.UpToDateStatusType.ContainerOnly){if(J.type===e.UpToDateStatusType.Unbuildable||J.type===e.UpToDateStatusType.UpstreamBlocked)return {type:e.UpToDateStatusType.UpstreamBlocked,upstreamProjectName:M.path,upstreamProjectBlocked:J.type===e.UpToDateStatusType.UpstreamBlocked};if(J.type!==e.UpToDateStatusType.UpToDate)return {type:e.UpToDateStatusType.UpstreamOutOfDate,upstreamProjectName:M.path};if(!i&&!y){if(J.newestInputFileTime&&J.newestInputFileTime<=x)continue;if(J.newestDeclarationFileContentChangedTime&&J.newestDeclarationFileContentChangedTime<=x){P=!0,A=M.path;continue}return e.Debug.assert(void 0!==b,"Should have an oldest output filename here"),{type:e.UpToDateStatusType.OutOfDateWithUpstream,outOfDateOutputFileName:b,newerProjectName:M.path}}}}}if(void 0!==y)return {type:e.UpToDateStatusType.OutputMissing,missingOutputFileName:y};if(C)return {type:e.UpToDateStatusType.OutOfDateWithSelf,outOfDateOutputFileName:b,newerInputFileName:s};var z=L(t,r.options.configFilePath,x,b);if(z)return z;var U=e.forEach(r.options.configFile.extendedSourceFiles||e.emptyArray,(function(e){return L(t,e,x,b)}));if(U)return U;var K=e.forEach(t.lastCachedPackageJsonLookups.get(n)||e.emptyArray,(function(e){var r=e[0];return L(t,r,x,b)}));if(K)return K;if(!i&&!t.buildInfoChecked.has(n)){t.buildInfoChecked.set(n,!0);var V=e.getTsBuildInfoEmitOutputFilePath(r.options);if(V){var q=t.readFileWithCache(V),W=q&&e.getBuildInfo(q);if(W&&(W.bundle||W.program)&&W.version!==e.version)return {type:e.UpToDateStatusType.TsVersionOutputOfDate,version:W.version}}}return w&&P?{type:e.UpToDateStatusType.OutOfDateWithPrepend,outOfDateOutputFileName:b,newerProjectName:A}:{type:P?e.UpToDateStatusType.UpToDateWithUpstreamTypes:e.UpToDateStatusType.UpToDate,newestDeclarationFileContentChangedTime:T,newestInputFileTime:u,newestOutputFileTime:S,newestInputFileName:s,newestOutputFileName:D,oldestOutputFileName:b}}(t,r,n);return t.projectStatus.set(n,s),s}function B(t,r,n,i,a){if(r.options.noEmit)return n;var o=t.host,s=e.getAllProjectOutputs(r,!o.useCaseSensitiveFileNames());if(!a||s.length!==a.size)for(var u=!!t.options.verbose,_=o.now?o.now():new Date,d=0,p=s;d<p.length;d++){var g=p[d];a&&a.has(f(t,g))||(u&&(u=!1,ee(t,i,r.options.configFilePath)),l(g)&&(n=c(n,e.getModifiedTime(o,g))),o.setModifiedTime(g,_));}return n}function j(t,r,n){if(t.options.dry)return ee(t,e.Diagnostics.A_non_dry_build_would_update_timestamps_for_output_of_project_0,r.options.configFilePath);var i=B(t,r,a,e.Diagnostics.Updating_output_timestamps_of_project_0);t.projectStatus.set(n,{type:e.UpToDateStatusType.UpToDate,newestDeclarationFileContentChangedTime:i,oldestOutputFileName:e.getFirstProjectOutput(r,!t.host.useCaseSensitiveFileNames())});}function J(r,n,i,a,o,s,c){if(!(c&t.AnyErrors)&&o.options.composite)for(var l=a+1;l<s.length;l++){var u=s[l],_=g(r,u);if(!r.projectPendingBuild.has(_)){var d=v(r,u,_);if(d&&d.projectReferences)for(var p=0,f=d.projectReferences;p<f.length;p++){var m=f[p];if(g(r,h(r,m.path))===i){var y=r.projectStatus.get(_);if(y)switch(y.type){case e.UpToDateStatusType.UpToDate:if(c&t.DeclarationOutputUnchanged){m.prepend?r.projectStatus.set(_,{type:e.UpToDateStatusType.OutOfDateWithPrepend,outOfDateOutputFileName:y.oldestOutputFileName,newerProjectName:n}):y.type=e.UpToDateStatusType.UpToDateWithUpstreamTypes;break}case e.UpToDateStatusType.UpToDateWithUpstreamTypes:case e.UpToDateStatusType.OutOfDateWithPrepend:c&t.DeclarationOutputUnchanged||r.projectStatus.set(_,{type:e.UpToDateStatusType.OutOfDateWithUpstream,outOfDateOutputFileName:y.type===e.UpToDateStatusType.OutOfDateWithPrepend?y.outOfDateOutputFileName:y.oldestOutputFileName,newerProjectName:n});break;case e.UpToDateStatusType.UpstreamBlocked:g(r,h(r,y.upstreamProjectName))===i&&C(r,_);}E(r,_,e.ConfigFileProgramReloadLevel.None);break}}}}}function z(t,r,n,i,a,o){var s=D(t,r,o);if(!s)return e.ExitStatus.InvalidProject_OutputsSkipped;k(t,n);for(var c=!0,l=0;;){var d=w(t,s,c);if(!d)break;c=!1,d.done(n,i,null==a?void 0:a(d.project)),t.diagnostics.has(d.projectPath)||l++;}return T(t),ae(t,s),function(e,t){if(e.watchAllProjectsPending){e.watchAllProjectsPending=!1;for(var r=0,n=_(t);r<n.length;r++){var i=n[r],a=g(e,i),o=v(e,i,a);H(e,i,a,o),G(e,a,o),o&&(Q(e,i,a,o),X(e,i,a,o),Y(e,i,a,o));}}}(t,s),u(s)?e.ExitStatus.ProjectReferenceCycle_OutputsSkipped:s.some((function(e){return t.diagnostics.has(g(t,e))}))?l?e.ExitStatus.DiagnosticsPresent_OutputsGenerated:e.ExitStatus.DiagnosticsPresent_OutputsSkipped:e.ExitStatus.Success}function U(t,r,n){var i=D(t,r,n);if(!i)return e.ExitStatus.InvalidProject_OutputsSkipped;if(u(i))return re(t,i.circularDiagnostics),e.ExitStatus.ProjectReferenceCycle_OutputsSkipped;for(var a=t.options,o=t.host,s=a.dry?[]:void 0,c=0,l=i;c<l.length;c++){var _=l[c],d=g(t,_),p=v(t,_,d);if(void 0!==p){var m=e.getAllProjectOutputs(p,!o.useCaseSensitiveFileNames());if(m.length)for(var y=new e.Set(p.fileNames.map((function(e){return f(t,e)}))),h=0,b=m;h<b.length;h++){var x=b[h];y.has(f(t,x))||o.fileExists(x)&&(s?s.push(x):(o.deleteFile(x),K(t,d,e.ConfigFileProgramReloadLevel.None)));}}else ie(t,d);}return s&&ee(t,e.Diagnostics.A_non_dry_build_would_delete_the_following_files_Colon_0,s.map((function(e){return "\r\n * ".concat(e)})).join("")),e.ExitStatus.Success}function K(t,r,n){t.host.getParsedCommandLine&&n===e.ConfigFileProgramReloadLevel.Partial&&(n=e.ConfigFileProgramReloadLevel.Full),n===e.ConfigFileProgramReloadLevel.Full&&(t.configFileCache.delete(r),t.buildOrder=void 0),t.needsSummary=!0,C(t,r),E(t,r,n),S(t);}function V(e,t,r){e.reportFileChangeDetected=!0,K(e,t,r),q(e);}function q(e){var t=e.hostWithWatch;t.setTimeout&&t.clearTimeout&&(e.timerToBuildInvalidatedProject&&t.clearTimeout(e.timerToBuildInvalidatedProject),e.timerToBuildInvalidatedProject=t.setTimeout(W,250,e));}function W(t){t.timerToBuildInvalidatedProject=void 0,t.reportFileChangeDetected&&(t.reportFileChangeDetected=!1,t.projectErrorsReported.clear(),te(t,e.Diagnostics.File_change_detected_Starting_incremental_compilation));var r=x(t),n=w(t,r,!1);n&&(n.done(),t.projectPendingBuild.size)?t.watch&&!t.timerToBuildInvalidatedProject&&q(t):(T(t),ae(t,r));}function H(t,r,n,i){t.watch&&!t.allWatchedConfigFiles.has(n)&&t.allWatchedConfigFiles.set(n,t.watchFile(r,(function(){V(t,n,e.ConfigFileProgramReloadLevel.Full);}),e.PollingInterval.High,null==i?void 0:i.watchOptions,e.WatchType.ConfigFile,r));}function G(t,r,n){e.updateSharedExtendedConfigFileWatcher(r,null==n?void 0:n.options,t.allWatchedExtendedConfigFiles,(function(r,i){return t.watchFile(r,(function(){var r;return null===(r=t.allWatchedExtendedConfigFiles.get(i))||void 0===r?void 0:r.projects.forEach((function(r){return V(t,r,e.ConfigFileProgramReloadLevel.Full)}))}),e.PollingInterval.High,null==n?void 0:n.watchOptions,e.WatchType.ExtendedConfigFile)}),(function(e){return f(t,e)}));}function Q(t,r,n,i){t.watch&&e.updateWatchingWildcardDirectories(s(t.allWatchedWildcardDirectories,n),new e.Map(e.getEntries(i.wildcardDirectories)),(function(a,o){return t.watchDirectory(a,(function(o){var s;e.isIgnoredFileFromWildCardWatching({watchedDirPath:f(t,a),fileOrDirectory:o,fileOrDirectoryPath:f(t,o),configFileName:r,currentDirectory:t.currentDirectory,options:i.options,program:t.builderPrograms.get(n)||(null===(s=y(t,n))||void 0===s?void 0:s.fileNames),useCaseSensitiveFileNames:t.parseConfigFileHost.useCaseSensitiveFileNames,writeLog:function(e){return t.writeLog(e)},toPath:function(e){return f(t,e)}})||V(t,n,e.ConfigFileProgramReloadLevel.Partial);}),o,null==i?void 0:i.watchOptions,e.WatchType.WildcardDirectory,r)}));}function X(t,r,n,i){t.watch&&e.mutateMap(s(t.allWatchedInputFiles,n),e.arrayToMap(i.fileNames,(function(e){return f(t,e)})),{createNewValue:function(a,o){return t.watchFile(o,(function(){return V(t,n,e.ConfigFileProgramReloadLevel.None)}),e.PollingInterval.Low,null==i?void 0:i.watchOptions,e.WatchType.SourceFile,r)},onDeleteValue:e.closeFileWatcher});}function Y(t,r,n,i){t.watch&&t.lastCachedPackageJsonLookups&&e.mutateMap(s(t.allWatchedPackageJsonFiles,n),new e.Map(t.lastCachedPackageJsonLookups.get(n)),{createNewValue:function(a,o){return t.watchFile(a,(function(){return V(t,n,e.ConfigFileProgramReloadLevel.Full)}),e.PollingInterval.High,null==i?void 0:i.watchOptions,e.WatchType.PackageJson,r)},onDeleteValue:e.closeFileWatcher});}function Z(t,r,n,i,a){var o=function(t,r,n,i,a){var o,s,c=r,l=r,u=c.getCurrentDirectory(),_=e.createGetCanonicalFileName(c.useCaseSensitiveFileNames()),d=(o=i,s={},e.commonOptionsWithBuild.forEach((function(t){e.hasProperty(o,t.name)&&(s[t.name]=o[t.name]);})),s),p=e.createCompilerHostFromProgramHost(c,(function(){return T.projectCompilerOptions}));e.setGetSourceFileAsHashVersioned(p,c),p.getParsedCommandLine=function(e){return v(T,e,g(T,e))},p.resolveModuleNames=e.maybeBind(c,c.resolveModuleNames),p.resolveTypeReferenceDirectives=e.maybeBind(c,c.resolveTypeReferenceDirectives);var f=p.resolveModuleNames?void 0:e.createModuleResolutionCache(u,_),m=p.resolveTypeReferenceDirectives?void 0:e.createTypeReferenceDirectiveResolutionCache(u,_,void 0,null==f?void 0:f.getPackageJsonInfoCache());if(!p.resolveModuleNames){var y=function(t,r,n,i){return e.resolveModuleName(t,n,T.projectCompilerOptions,p,f,i,r).resolvedModule};p.resolveModuleNames=function(t,r,n,i,a,o){return e.loadWithModeAwareCache(e.Debug.checkEachDefined(t),e.Debug.checkDefined(o),r,i,y)},p.getModuleResolutionCache=function(){return f};}if(!p.resolveTypeReferenceDirectives){var h=function(t,r,n){return e.resolveTypeReferenceDirective(t,r,T.projectCompilerOptions,p,n,T.typeReferenceDirectiveResolutionCache).resolvedTypeReferenceDirective};p.resolveTypeReferenceDirectives=function(t,r,n){return e.loadWithLocalCache(e.Debug.checkEachDefined(t),r,n,h)};}var b=e.createWatchFactory(l,i),x=b.watchFile,D=b.watchDirectory,S=b.writeLog,T={host:c,hostWithWatch:l,currentDirectory:u,getCanonicalFileName:_,parseConfigFileHost:e.parseConfigHostFromCompilerHostLike(c),write:e.maybeBind(c,c.trace),options:i,baseCompilerOptions:d,rootNames:n,baseWatchOptions:a,resolvedConfigFilePaths:new e.Map,configFileCache:new e.Map,projectStatus:new e.Map,buildInfoChecked:new e.Map,extendedConfigCache:new e.Map,builderPrograms:new e.Map,diagnostics:new e.Map,projectPendingBuild:new e.Map,projectErrorsReported:new e.Map,compilerHost:p,moduleResolutionCache:f,typeReferenceDirectiveResolutionCache:m,buildOrder:void 0,readFileWithCache:function(e){return c.readFile(e)},projectCompilerOptions:d,cache:void 0,allProjectBuildPending:!0,needsSummary:!0,watchAllProjectsPending:t,currentInvalidatedProject:void 0,watch:t,allWatchedWildcardDirectories:new e.Map,allWatchedInputFiles:new e.Map,allWatchedConfigFiles:new e.Map,allWatchedExtendedConfigFiles:new e.Map,allWatchedPackageJsonFiles:new e.Map,lastCachedPackageJsonLookups:new e.Map,timerToBuildInvalidatedProject:void 0,reportFileChangeDetected:!1,watchFile:x,watchDirectory:D,writeLog:S};return T}(t,r,n,i,a);return {build:function(e,t,r,n){return z(o,e,t,r,n)},clean:function(e){return U(o,e)},buildReferences:function(e,t,r,n){return z(o,e,t,r,n,!0)},cleanReferences:function(e){return U(o,e,!0)},getNextInvalidatedProject:function(e){return k(o,e),w(o,x(o),!1)},getBuildOrder:function(){return x(o)},getUpToDateStatusOfProject:function(e){var t=h(o,e),r=g(o,t);return R(o,v(o,t,r),r)},invalidateProject:function(t,r){return K(o,t,r||e.ConfigFileProgramReloadLevel.None)},buildNextInvalidatedProject:function(){return W(o)},getAllParsedConfigs:function(){return e.arrayFrom(e.mapDefinedIterator(o.configFileCache.values(),(function(e){return m(e)?e:void 0})))},close:function(){return function(t){e.clearMap(t.allWatchedConfigFiles,e.closeFileWatcher),e.clearMap(t.allWatchedExtendedConfigFiles,e.closeFileWatcherOf),e.clearMap(t.allWatchedWildcardDirectories,(function(t){return e.clearMap(t,e.closeFileWatcherOf)})),e.clearMap(t.allWatchedInputFiles,(function(t){return e.clearMap(t,e.closeFileWatcher)})),e.clearMap(t.allWatchedPackageJsonFiles,(function(t){return e.clearMap(t,e.closeFileWatcher)}));}(o)}}}function $(t,r){return e.convertToRelativePath(r,t.currentDirectory,(function(e){return t.getCanonicalFileName(e)}))}function ee(t,r){for(var i=[],a=2;a<arguments.length;a++)i[a-2]=arguments[a];t.host.reportSolutionBuilderStatus(e.createCompilerDiagnostic.apply(void 0,n$3([r],i,!1)));}function te(t,r){for(var i,a,o=[],s=2;s<arguments.length;s++)o[s-2]=arguments[s];null===(a=(i=t.hostWithWatch).onWatchStatusChange)||void 0===a||a.call(i,e.createCompilerDiagnostic.apply(void 0,n$3([r],o,!1)),t.host.getNewLine(),t.baseCompilerOptions);}function re(e,t){var r=e.host;t.forEach((function(e){return r.reportDiagnostic(e)}));}function ne(e,t,r){re(e,r),e.projectErrorsReported.set(t,!0),r.length&&e.diagnostics.set(t,r);}function ie(e,t){ne(e,t,[e.configFileCache.get(t)]);}function ae(t,r){if(t.needsSummary){t.needsSummary=!1;var n=t.watch||!!t.host.reportErrorSummary,i=t.diagnostics,a=0;u(r)?(oe(t,r.buildOrder),re(t,r.circularDiagnostics),n&&(a+=e.getErrorCountForSummary(r.circularDiagnostics))):(r.forEach((function(r){var n=g(t,r);t.projectErrorsReported.has(n)||re(t,i.get(n)||e.emptyArray);})),n&&i.forEach((function(t){return a+=e.getErrorCountForSummary(t)}))),t.watch?te(t,e.getWatchErrorSummaryDiagnosticMessage(a),a):t.host.reportErrorSummary&&t.host.reportErrorSummary(a);}}function oe(t,r){t.options.verbose&&ee(t,e.Diagnostics.Projects_in_this_build_Colon_0,r.map((function(e){return "\r\n * "+$(t,e)})).join(""));}function se(t,r,n){t.options.verbose&&function(t,r,n){if(t.options.force&&(n.type===e.UpToDateStatusType.UpToDate||n.type===e.UpToDateStatusType.UpToDateWithUpstreamTypes))return ee(t,e.Diagnostics.Project_0_is_being_forcibly_rebuilt,$(t,r));switch(n.type){case e.UpToDateStatusType.OutOfDateWithSelf:return ee(t,e.Diagnostics.Project_0_is_out_of_date_because_oldest_output_1_is_older_than_newest_input_2,$(t,r),$(t,n.outOfDateOutputFileName),$(t,n.newerInputFileName));case e.UpToDateStatusType.OutOfDateWithUpstream:return ee(t,e.Diagnostics.Project_0_is_out_of_date_because_oldest_output_1_is_older_than_newest_input_2,$(t,r),$(t,n.outOfDateOutputFileName),$(t,n.newerProjectName));case e.UpToDateStatusType.OutputMissing:return ee(t,e.Diagnostics.Project_0_is_out_of_date_because_output_file_1_does_not_exist,$(t,r),$(t,n.missingOutputFileName));case e.UpToDateStatusType.UpToDate:if(void 0!==n.newestInputFileTime)return ee(t,e.Diagnostics.Project_0_is_up_to_date_because_newest_input_1_is_older_than_oldest_output_2,$(t,r),$(t,n.newestInputFileName||""),$(t,n.oldestOutputFileName||""));break;case e.UpToDateStatusType.OutOfDateWithPrepend:return ee(t,e.Diagnostics.Project_0_is_out_of_date_because_output_of_its_dependency_1_has_changed,$(t,r),$(t,n.newerProjectName));case e.UpToDateStatusType.UpToDateWithUpstreamTypes:return ee(t,e.Diagnostics.Project_0_is_up_to_date_with_d_ts_files_from_its_dependencies,$(t,r));case e.UpToDateStatusType.UpstreamOutOfDate:return ee(t,e.Diagnostics.Project_0_is_out_of_date_because_its_dependency_1_is_out_of_date,$(t,r),$(t,n.upstreamProjectName));case e.UpToDateStatusType.UpstreamBlocked:return ee(t,n.upstreamProjectBlocked?e.Diagnostics.Project_0_can_t_be_built_because_its_dependency_1_was_not_built:e.Diagnostics.Project_0_can_t_be_built_because_its_dependency_1_has_errors,$(t,r),$(t,n.upstreamProjectName));case e.UpToDateStatusType.Unbuildable:return ee(t,e.Diagnostics.Failed_to_parse_file_0_Colon_1,$(t,r),n.reason);case e.UpToDateStatusType.TsVersionOutputOfDate:return ee(t,e.Diagnostics.Project_0_is_out_of_date_because_output_for_it_was_generated_with_version_1_that_differs_with_current_version_2,$(t,r),n.version,e.version);case e.UpToDateStatusType.ContainerOnly:case e.UpToDateStatusType.ComputingUpstream:break;default:e.assertType(n);}}(t,r,n);}!function(e){e[e.None=0]="None",e[e.Success=1]="Success",e[e.DeclarationOutputUnchanged=2]="DeclarationOutputUnchanged",e[e.ConfigFileErrors=4]="ConfigFileErrors",e[e.SyntaxErrors=8]="SyntaxErrors",e[e.TypeErrors=16]="TypeErrors",e[e.DeclarationEmitErrors=32]="DeclarationEmitErrors",e[e.EmitErrors=64]="EmitErrors",e[e.AnyErrors=124]="AnyErrors";}(t||(t={})),e.isCircularBuildOrder=u,e.getBuildOrderFromAnyBuildOrder=_,e.createBuilderStatusReporter=d,e.createSolutionBuilderHost=function(t,r,n,i,a){void 0===t&&(t=e.sys);var o=p(t,r,n,i);return o.reportErrorSummary=a,o},e.createSolutionBuilderWithWatchHost=function(t,r,n,i,a){void 0===t&&(t=e.sys);var o=p(t,r,n,i),s=e.createWatchHost(t,a);return e.copyProperties(o,s),o},e.createSolutionBuilder=function(e,t,r){return Z(!1,e,t,r)},e.createSolutionBuilderWithWatch=function(e,t,r,n){return Z(!0,e,t,r,n)},function(e){e[e.Build=0]="Build",e[e.UpdateBundle=1]="UpdateBundle",e[e.UpdateOutputFileStamps=2]="UpdateOutputFileStamps";}(r=e.InvalidatedProjectKind||(e.InvalidatedProjectKind={})),function(e){e[e.CreateProgram=0]="CreateProgram",e[e.SyntaxDiagnostics=1]="SyntaxDiagnostics",e[e.SemanticDiagnostics=2]="SemanticDiagnostics",e[e.Emit=3]="Emit",e[e.EmitBundle=4]="EmitBundle",e[e.EmitBuildInfo=5]="EmitBuildInfo",e[e.BuildInvalidatedProjectOfBundle=6]="BuildInvalidatedProjectOfBundle",e[e.QueueReferencingProjects=7]="QueueReferencingProjects",e[e.Done=8]="Done";}(i||(i={}));}(t),function(e){var t,r;(t=e.server||(e.server={})).ActionSet="action::set",t.ActionInvalidate="action::invalidate",t.ActionPackageInstalled="action::packageInstalled",t.EventTypesRegistry="event::typesRegistry",t.EventBeginInstallTypes="event::beginInstallTypes",t.EventEndInstallTypes="event::endInstallTypes",t.EventInitializationFailed="event::initializationFailed",(r=t.Arguments||(t.Arguments={})).GlobalCacheLocation="--globalTypingsCacheLocation",r.LogFile="--logFile",r.EnableTelemetry="--enableTelemetry",r.TypingSafeListLocation="--typingSafeListLocation",r.TypesMapLocation="--typesMapLocation",r.NpmLocation="--npmLocation",r.ValidateDefaultNpmLocation="--validateDefaultNpmLocation",t.hasArgument=function(t){return e.sys.args.indexOf(t)>=0},t.findArgument=function(t){var r=e.sys.args.indexOf(t);return r>=0&&r<e.sys.args.length-1?e.sys.args[r+1]:void 0},t.nowString=function(){var t=new Date;return "".concat(e.padLeft(t.getHours().toString(),2,"0"),":").concat(e.padLeft(t.getMinutes().toString(),2,"0"),":").concat(e.padLeft(t.getSeconds().toString(),2,"0"),".").concat(e.padLeft(t.getMilliseconds().toString(),3,"0"))};}(t),function(e){!function(t){function r(t,r){return new e.Version(e.getProperty(r,"ts".concat(e.versionMajorMinor))||e.getProperty(r,"latest")).compareTo(t.version)<=0}t.isTypingUpToDate=r;var i,a=["assert","assert/strict","async_hooks","buffer","child_process","cluster","console","constants","crypto","dgram","diagnostics_channel","dns","dns/promises","domain","events","fs","fs/promises","http","https","http2","inspector","module","net","os","path","perf_hooks","process","punycode","querystring","readline","repl","stream","stream/promises","string_decoder","timers","timers/promises","tls","trace_events","tty","url","util","util/types","v8","vm","wasi","worker_threads","zlib"];function o(e){return t.nodeCoreModules.has(e)?"node":e}function s(e,t){if(!e)return 1;if(e.length>214)return 2;if(46===e.charCodeAt(0))return 3;if(95===e.charCodeAt(0))return 4;if(t){var r=/^@([^/]+)\/([^/]+)$/.exec(e);if(r){var n=s(r[1],!1);if(0!==n)return {name:r[1],isScopeName:!0,result:n};var i=s(r[2],!1);return 0!==i?{name:r[2],isScopeName:!1,result:i}:0}}return encodeURIComponent(e)!==e?5:0}function c(t,r,n,i){var a=i?"Scope":"Package";switch(r){case 1:return "'".concat(t,"':: ").concat(a," name '").concat(n,"' cannot be empty");case 2:return "'".concat(t,"':: ").concat(a," name '").concat(n,"' should be less than ").concat(214," characters");case 3:return "'".concat(t,"':: ").concat(a," name '").concat(n,"' cannot start with '.'");case 4:return "'".concat(t,"':: ").concat(a," name '").concat(n,"' cannot start with '_'");case 5:return "'".concat(t,"':: ").concat(a," name '").concat(n,"' contains non URI safe characters");case 0:return e.Debug.fail();default:throw e.Debug.assertNever(r)}}t.prefixedNodeCoreModuleList=a.map((function(e){return "node:".concat(e)})),t.nodeCoreModuleList=n$3(n$3([],a,!0),t.prefixedNodeCoreModuleList,!0),t.nodeCoreModules=new e.Set(t.nodeCoreModuleList),t.nonRelativeModuleNameForTypingCache=o,t.loadSafeList=function(t,r){var n=e.readConfigFile(r,(function(e){return t.readFile(e)}));return new e.Map(e.getEntries(n.config))},t.loadTypesMap=function(t,r){var n=e.readConfigFile(r,(function(e){return t.readFile(e)}));if(n.config)return new e.Map(e.getEntries(n.config.simpleMap))},t.discoverTypings=function(t,n,i,a,s,c,l,u,_){if(!l||!l.enable)return {cachedTypingPaths:[],newTypingNames:[],filesToWatch:[]};var d=new e.Map;i=e.mapDefined(i,(function(t){var r=e.normalizePath(t);if(e.hasJSFileExtension(r))return r}));var p=[];l.include&&S(l.include,"Explicitly included types");var f=l.exclude||[],g=new e.Set(i.map(e.getDirectoryPath));g.add(a),g.forEach((function(t){T(e.combinePaths(t,"package.json"),p),T(e.combinePaths(t,"bower.json"),p),C(e.combinePaths(t,"bower_components"),p),C(e.combinePaths(t,"node_modules"),p);})),l.disableFilenameBasedTypeAcquisition||function(t){var r=e.mapDefined(t,(function(t){if(e.hasJSFileExtension(t)){var r=e.removeFileExtension(e.getBaseFileName(t.toLowerCase())),n=e.removeMinAndVersionNumbers(r);return s.get(n)}}));r.length&&S(r,"Inferred typings from file names"),e.some(t,(function(t){return e.fileExtensionIs(t,".jsx")}))&&(n&&n("Inferred 'react' typings due to presence of '.jsx' extension"),D("react"));}(i),u&&S(e.deduplicate(u.map(o),e.equateStringsCaseSensitive,e.compareStringsCaseSensitive),"Inferred typings from unresolved imports"),c.forEach((function(e,t){var n=_.get(t);d.has(t)&&void 0===d.get(t)&&void 0!==n&&r(e,n)&&d.set(t,e.typingLocation);}));for(var m=0,y=f;m<y.length;m++){var v=y[m];d.delete(v)&&n&&n("Typing for ".concat(v," is in exclude list, will be ignored."));}var h=[],b=[];d.forEach((function(e,t){void 0!==e?b.push(e):h.push(t);}));var x={cachedTypingPaths:b,newTypingNames:h,filesToWatch:p};return n&&n("Result: ".concat(JSON.stringify(x))),x;function D(e){d.has(e)||d.set(e,void 0);}function S(t,r){n&&n("".concat(r,": ").concat(JSON.stringify(t))),e.forEach(t,D);}function T(r,n){if(t.fileExists(r)){n.push(r);var i=e.readConfigFile(r,(function(e){return t.readFile(e)})).config;S(e.flatMap([i.dependencies,i.devDependencies,i.optionalDependencies,i.peerDependencies],e.getOwnKeys),"Typing names in '".concat(r,"' dependencies"));}}function C(r,i){if(i.push(r),t.directoryExists(r)){var a=t.readDirectory(r,[".json"],void 0,void 0,2);n&&n("Searching for typing names in ".concat(r,"; all files: ").concat(JSON.stringify(a)));for(var o=[],s=0,c=a;s<c.length;s++){var l=c[s],u=e.normalizePath(l),_=e.getBaseFileName(u);if("package.json"===_||"bower.json"===_){var p=e.readConfigFile(u,(function(e){return t.readFile(e)})).config;if(("package.json"!==_||!p._requiredBy||0!==e.filter(p._requiredBy,(function(e){return "#"===e[0]||"/"===e})).length)&&p.name){var f=p.types||p.typings;if(f){var g=e.getNormalizedAbsolutePath(f,e.getDirectoryPath(u));n&&n(" Package '".concat(p.name,"' provides its own types.")),d.set(p.name,g);}else o.push(p.name);}}}S(o," Found package names");}}},(i=t.NameValidationResult||(t.NameValidationResult={}))[i.Ok=0]="Ok",i[i.EmptyName=1]="EmptyName",i[i.NameTooLong=2]="NameTooLong",i[i.NameStartsWithDot=3]="NameStartsWithDot",i[i.NameStartsWithUnderscore=4]="NameStartsWithUnderscore",i[i.NameContainsNonURISafeCharacters=5]="NameContainsNonURISafeCharacters",t.validatePackageName=function(e){return s(e,!0)},t.renderPackageNameValidationFailure=function(e,t){return "object"==typeof e?c(t,e.result,e.name,e.isScopeName):c(t,e,t,!1)};}(e.JsTyping||(e.JsTyping={}));}(t),function(e){var t,r,n,i,a,o,s,c,l,u,_,d,p,f,g,m,y,v,h,b;function x(e){return {indentSize:4,tabSize:4,newLineCharacter:e||"\n",convertTabsToSpaces:!0,indentStyle:t.Smart,insertSpaceAfterConstructor:!1,insertSpaceAfterCommaDelimiter:!0,insertSpaceAfterSemicolonInForStatements:!0,insertSpaceBeforeAndAfterBinaryOperators:!0,insertSpaceAfterKeywordsInControlFlowStatements:!0,insertSpaceAfterFunctionKeywordForAnonymousFunctions:!1,insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis:!1,insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets:!1,insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces:!0,insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces:!1,insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces:!1,insertSpaceBeforeFunctionParenthesis:!1,placeOpenBraceOnNewLineForFunctions:!1,placeOpenBraceOnNewLineForControlBlocks:!1,semicolons:r.Ignore,trimTrailingWhitespace:!0}}h=e.ScriptSnapshot||(e.ScriptSnapshot={}),b=function(){function e(e){this.text=e;}return e.prototype.getText=function(e,t){return 0===e&&t===this.text.length?this.text:this.text.substring(e,t)},e.prototype.getLength=function(){return this.text.length},e.prototype.getChangeRange=function(){},e}(),h.fromString=function(e){return new b(e)},(v=e.PackageJsonDependencyGroup||(e.PackageJsonDependencyGroup={}))[v.Dependencies=1]="Dependencies",v[v.DevDependencies=2]="DevDependencies",v[v.PeerDependencies=4]="PeerDependencies",v[v.OptionalDependencies=8]="OptionalDependencies",v[v.All=15]="All",(y=e.PackageJsonAutoImportPreference||(e.PackageJsonAutoImportPreference={}))[y.Off=0]="Off",y[y.On=1]="On",y[y.Auto=2]="Auto",(m=e.LanguageServiceMode||(e.LanguageServiceMode={}))[m.Semantic=0]="Semantic",m[m.PartialSemantic=1]="PartialSemantic",m[m.Syntactic=2]="Syntactic",e.emptyOptions={},(g=e.SemanticClassificationFormat||(e.SemanticClassificationFormat={})).Original="original",g.TwentyTwenty="2020",(f=e.CompletionTriggerKind||(e.CompletionTriggerKind={}))[f.Invoked=1]="Invoked",f[f.TriggerCharacter=2]="TriggerCharacter",f[f.TriggerForIncompleteCompletions=3]="TriggerForIncompleteCompletions",(p=e.InlayHintKind||(e.InlayHintKind={})).Type="Type",p.Parameter="Parameter",p.Enum="Enum",(d=e.HighlightSpanKind||(e.HighlightSpanKind={})).none="none",d.definition="definition",d.reference="reference",d.writtenReference="writtenReference",function(e){e[e.None=0]="None",e[e.Block=1]="Block",e[e.Smart=2]="Smart";}(t=e.IndentStyle||(e.IndentStyle={})),function(e){e.Ignore="ignore",e.Insert="insert",e.Remove="remove";}(r=e.SemicolonPreference||(e.SemicolonPreference={})),e.getDefaultFormatCodeSettings=x,e.testFormatSettings=x("\n"),(_=e.SymbolDisplayPartKind||(e.SymbolDisplayPartKind={}))[_.aliasName=0]="aliasName",_[_.className=1]="className",_[_.enumName=2]="enumName",_[_.fieldName=3]="fieldName",_[_.interfaceName=4]="interfaceName",_[_.keyword=5]="keyword",_[_.lineBreak=6]="lineBreak",_[_.numericLiteral=7]="numericLiteral",_[_.stringLiteral=8]="stringLiteral",_[_.localName=9]="localName",_[_.methodName=10]="methodName",_[_.moduleName=11]="moduleName",_[_.operator=12]="operator",_[_.parameterName=13]="parameterName",_[_.propertyName=14]="propertyName",_[_.punctuation=15]="punctuation",_[_.space=16]="space",_[_.text=17]="text",_[_.typeParameterName=18]="typeParameterName",_[_.enumMemberName=19]="enumMemberName",_[_.functionName=20]="functionName",_[_.regularExpressionLiteral=21]="regularExpressionLiteral",_[_.link=22]="link",_[_.linkName=23]="linkName",_[_.linkText=24]="linkText",(u=e.OutliningSpanKind||(e.OutliningSpanKind={})).Comment="comment",u.Region="region",u.Code="code",u.Imports="imports",(l=e.OutputFileType||(e.OutputFileType={}))[l.JavaScript=0]="JavaScript",l[l.SourceMap=1]="SourceMap",l[l.Declaration=2]="Declaration",(c=e.EndOfLineState||(e.EndOfLineState={}))[c.None=0]="None",c[c.InMultiLineCommentTrivia=1]="InMultiLineCommentTrivia",c[c.InSingleQuoteStringLiteral=2]="InSingleQuoteStringLiteral",c[c.InDoubleQuoteStringLiteral=3]="InDoubleQuoteStringLiteral",c[c.InTemplateHeadOrNoSubstitutionTemplate=4]="InTemplateHeadOrNoSubstitutionTemplate",c[c.InTemplateMiddleOrTail=5]="InTemplateMiddleOrTail",c[c.InTemplateSubstitutionPosition=6]="InTemplateSubstitutionPosition",(s=e.TokenClass||(e.TokenClass={}))[s.Punctuation=0]="Punctuation",s[s.Keyword=1]="Keyword",s[s.Operator=2]="Operator",s[s.Comment=3]="Comment",s[s.Whitespace=4]="Whitespace",s[s.Identifier=5]="Identifier",s[s.NumberLiteral=6]="NumberLiteral",s[s.BigIntLiteral=7]="BigIntLiteral",s[s.StringLiteral=8]="StringLiteral",s[s.RegExpLiteral=9]="RegExpLiteral",(o=e.ScriptElementKind||(e.ScriptElementKind={})).unknown="",o.warning="warning",o.keyword="keyword",o.scriptElement="script",o.moduleElement="module",o.classElement="class",o.localClassElement="local class",o.interfaceElement="interface",o.typeElement="type",o.enumElement="enum",o.enumMemberElement="enum member",o.variableElement="var",o.localVariableElement="local var",o.functionElement="function",o.localFunctionElement="local function",o.memberFunctionElement="method",o.memberGetAccessorElement="getter",o.memberSetAccessorElement="setter",o.memberVariableElement="property",o.constructorImplementationElement="constructor",o.callSignatureElement="call",o.indexSignatureElement="index",o.constructSignatureElement="construct",o.parameterElement="parameter",o.typeParameterElement="type parameter",o.primitiveType="primitive type",o.label="label",o.alias="alias",o.constElement="const",o.letElement="let",o.directory="directory",o.externalModuleName="external module name",o.jsxAttribute="JSX attribute",o.string="string",o.link="link",o.linkName="link name",o.linkText="link text",(a=e.ScriptElementKindModifier||(e.ScriptElementKindModifier={})).none="",a.publicMemberModifier="public",a.privateMemberModifier="private",a.protectedMemberModifier="protected",a.exportedModifier="export",a.ambientModifier="declare",a.staticModifier="static",a.abstractModifier="abstract",a.optionalModifier="optional",a.deprecatedModifier="deprecated",a.dtsModifier=".d.ts",a.tsModifier=".ts",a.tsxModifier=".tsx",a.jsModifier=".js",a.jsxModifier=".jsx",a.jsonModifier=".json",a.dmtsModifier=".d.mts",a.mtsModifier=".mts",a.mjsModifier=".mjs",a.dctsModifier=".d.cts",a.ctsModifier=".cts",a.cjsModifier=".cjs",(i=e.ClassificationTypeNames||(e.ClassificationTypeNames={})).comment="comment",i.identifier="identifier",i.keyword="keyword",i.numericLiteral="number",i.bigintLiteral="bigint",i.operator="operator",i.stringLiteral="string",i.whiteSpace="whitespace",i.text="text",i.punctuation="punctuation",i.className="class name",i.enumName="enum name",i.interfaceName="interface name",i.moduleName="module name",i.typeParameterName="type parameter name",i.typeAliasName="type alias name",i.parameterName="parameter name",i.docCommentTagName="doc comment tag name",i.jsxOpenTagName="jsx open tag name",i.jsxCloseTagName="jsx close tag name",i.jsxSelfClosingTagName="jsx self closing tag name",i.jsxAttribute="jsx attribute",i.jsxText="jsx text",i.jsxAttributeStringLiteralValue="jsx attribute string literal value",(n=e.ClassificationType||(e.ClassificationType={}))[n.comment=1]="comment",n[n.identifier=2]="identifier",n[n.keyword=3]="keyword",n[n.numericLiteral=4]="numericLiteral",n[n.operator=5]="operator",n[n.stringLiteral=6]="stringLiteral",n[n.regularExpressionLiteral=7]="regularExpressionLiteral",n[n.whiteSpace=8]="whiteSpace",n[n.text=9]="text",n[n.punctuation=10]="punctuation",n[n.className=11]="className",n[n.enumName=12]="enumName",n[n.interfaceName=13]="interfaceName",n[n.moduleName=14]="moduleName",n[n.typeParameterName=15]="typeParameterName",n[n.typeAliasName=16]="typeAliasName",n[n.parameterName=17]="parameterName",n[n.docCommentTagName=18]="docCommentTagName",n[n.jsxOpenTagName=19]="jsxOpenTagName",n[n.jsxCloseTagName=20]="jsxCloseTagName",n[n.jsxSelfClosingTagName=21]="jsxSelfClosingTagName",n[n.jsxAttribute=22]="jsxAttribute",n[n.jsxText=23]="jsxText",n[n.jsxAttributeStringLiteralValue=24]="jsxAttributeStringLiteralValue",n[n.bigintLiteral=25]="bigintLiteral";}(t),function(e){function t(t){switch(t.kind){case 253:return e.isInJSFile(t)&&e.getJSDocEnumTag(t)?7:1;case 163:case 202:case 166:case 165:case 294:case 295:case 168:case 167:case 170:case 171:case 172:case 255:case 212:case 213:case 291:case 284:return 1;case 162:case 257:case 258:case 181:return 2;case 343:return void 0===t.name?3:2;case 297:case 256:return 3;case 260:return e.isAmbientModule(t)||1===e.getModuleInstanceState(t)?5:4;case 259:case 268:case 269:case 264:case 265:case 270:case 271:return 7;case 303:return 5}return 7}function r(t){for(;160===t.parent.kind;)t=t.parent;return e.isInternalModuleImportEqualsDeclaration(t.parent)&&t.parent.moduleReference===t}function n(e){return e.expression}function a(e){return e.tag}function o(e){return e.tagName}function s(t,r,n,i,a){var o=i?l(t):c(t);return a&&(o=e.skipOuterExpressions(o)),!!o&&!!o.parent&&r(o.parent)&&n(o.parent)===o}function c(e){return d(e)?e.parent:e}function l(e){return d(e)||p(e)?e.parent:e}function u(t){var r;return e.isIdentifier(t)&&(null===(r=e.tryCast(t.parent,e.isBreakOrContinueStatement))||void 0===r?void 0:r.label)===t}function _(t){var r;return e.isIdentifier(t)&&(null===(r=e.tryCast(t.parent,e.isLabeledStatement))||void 0===r?void 0:r.label)===t}function d(t){var r;return (null===(r=e.tryCast(t.parent,e.isPropertyAccessExpression))||void 0===r?void 0:r.name)===t}function p(t){var r;return (null===(r=e.tryCast(t.parent,e.isElementAccessExpression))||void 0===r?void 0:r.argumentExpression)===t}var f;e.scanner=e.createScanner(99,!0),(f=e.SemanticMeaning||(e.SemanticMeaning={}))[f.None=0]="None",f[f.Value=1]="Value",f[f.Type=2]="Type",f[f.Namespace=4]="Namespace",f[f.All=7]="All",e.getMeaningFromDeclaration=t,e.getMeaningFromLocation=function(n){var i=(n=w(n)).parent;if(303===n.kind)return 1;if(e.isExportAssignment(i)||e.isExportSpecifier(i)||e.isExternalModuleReference(i)||e.isImportSpecifier(i)||e.isImportClause(i)||e.isImportEqualsDeclaration(i)&&n===i.name){for(var a=i;a;){if(e.isImportEqualsDeclaration(a)||e.isImportClause(a)||e.isExportDeclaration(a))return a.isTypeOnly?2:7;a=a.parent;}return 7}return r(n)?function(t){var r=160===t.kind?t:e.isQualifiedName(t.parent)&&t.parent.right===t?t.parent:void 0;return r&&264===r.parent.kind?7:4}(n):e.isDeclarationName(n)?t(i):e.isEntityName(n)&&e.findAncestor(n,e.or(e.isJSDocNameReference,e.isJSDocLinkLike,e.isJSDocMemberName))?7:function(t){switch(e.isRightSideOfQualifiedNameOrPropertyAccess(t)&&(t=t.parent),t.kind){case 108:return !e.isExpressionNode(t);case 191:return !0}switch(t.parent.kind){case 177:return !0;case 199:return !t.parent.isTypeOf;case 227:return !e.isExpressionWithTypeArgumentsInClassExtendsClause(t.parent)}return !1}(n)?2:function(e){return function(e){var t=e,r=!0;if(160===t.parent.kind){for(;t.parent&&160===t.parent.kind;)t=t.parent;r=t.right===e;}return 177===t.parent.kind&&!r}(e)||function(e){var t=e,r=!0;if(205===t.parent.kind){for(;t.parent&&205===t.parent.kind;)t=t.parent;r=t.name===e;}if(!r&&227===t.parent.kind&&290===t.parent.parent.kind){var n=t.parent.parent.parent;return 256===n.kind&&117===t.parent.parent.token||257===n.kind&&94===t.parent.parent.token}return !1}(e)}(n)?4:e.isTypeParameterDeclaration(i)?(e.Debug.assert(e.isJSDocTemplateTag(i.parent)),2):e.isLiteralTypeNode(i)?3:1},e.isInRightSideOfInternalImportEqualsDeclaration=r,e.isCallExpressionTarget=function(t,r,i){return void 0===r&&(r=!1),void 0===i&&(i=!1),s(t,e.isCallExpression,n,r,i)},e.isNewExpressionTarget=function(t,r,i){return void 0===r&&(r=!1),void 0===i&&(i=!1),s(t,e.isNewExpression,n,r,i)},e.isCallOrNewExpressionTarget=function(t,r,i){return void 0===r&&(r=!1),void 0===i&&(i=!1),s(t,e.isCallOrNewExpression,n,r,i)},e.isTaggedTemplateTag=function(t,r,n){return void 0===r&&(r=!1),void 0===n&&(n=!1),s(t,e.isTaggedTemplateExpression,a,r,n)},e.isDecoratorTarget=function(t,r,i){return void 0===r&&(r=!1),void 0===i&&(i=!1),s(t,e.isDecorator,n,r,i)},e.isJsxOpeningLikeElementTagName=function(t,r,n){return void 0===r&&(r=!1),void 0===n&&(n=!1),s(t,e.isJsxOpeningLikeElement,o,r,n)},e.climbPastPropertyAccess=c,e.climbPastPropertyOrElementAccess=l,e.getTargetLabel=function(e,t){for(;e;){if(249===e.kind&&e.label.escapedText===t)return e.label;e=e.parent;}},e.hasPropertyAccessExpressionWithName=function(t,r){return !!e.isPropertyAccessExpression(t.expression)&&t.expression.name.text===r},e.isJumpStatementTarget=u,e.isLabelOfLabeledStatement=_,e.isLabelName=function(e){return _(e)||u(e)},e.isTagName=function(t){var r;return (null===(r=e.tryCast(t.parent,e.isJSDocTag))||void 0===r?void 0:r.tagName)===t},e.isRightSideOfQualifiedName=function(t){var r;return (null===(r=e.tryCast(t.parent,e.isQualifiedName))||void 0===r?void 0:r.right)===t},e.isRightSideOfPropertyAccess=d,e.isArgumentExpressionOfElementAccess=p,e.isNameOfModuleDeclaration=function(t){var r;return (null===(r=e.tryCast(t.parent,e.isModuleDeclaration))||void 0===r?void 0:r.name)===t},e.isNameOfFunctionDeclaration=function(t){var r;return e.isIdentifier(t)&&(null===(r=e.tryCast(t.parent,e.isFunctionLike))||void 0===r?void 0:r.name)===t},e.isLiteralNameOfPropertyDeclarationOrIndexAccess=function(t){switch(t.parent.kind){case 166:case 165:case 294:case 297:case 168:case 167:case 171:case 172:case 260:return e.getNameOfDeclaration(t.parent)===t;case 206:return t.parent.argumentExpression===t;case 161:return !0;case 195:return 193===t.parent.parent.kind;default:return !1}},e.isExpressionOfExternalModuleImportEqualsDeclaration=function(t){return e.isExternalModuleImportEqualsDeclaration(t.parent.parent)&&e.getExternalModuleImportEqualsDeclarationExpression(t.parent.parent)===t},e.getContainerNode=function(t){for(e.isJSDocTypeAlias(t)&&(t=t.parent.parent);;){if(!(t=t.parent))return;switch(t.kind){case 303:case 168:case 167:case 255:case 212:case 171:case 172:case 256:case 257:case 259:case 260:return t}}},e.getNodeKind=function t(r){switch(r.kind){case 303:return e.isExternalModule(r)?"module":"script";case 260:return "module";case 256:case 225:return "class";case 257:return "interface";case 258:case 336:case 343:return "type";case 259:return "enum";case 253:return c(r);case 202:return c(e.getRootDeclaration(r));case 213:case 255:case 212:return "function";case 171:return "getter";case 172:return "setter";case 168:case 167:return "method";case 294:var n=r.initializer;return e.isFunctionLike(n)?"method":"property";case 166:case 165:case 295:case 296:return "property";case 175:return "index";case 174:return "construct";case 173:return "call";case 170:case 169:return "constructor";case 162:return "type parameter";case 297:return "enum member";case 163:return e.hasSyntacticModifier(r,16476)?"property":"parameter";case 264:case 269:case 274:case 267:case 273:return "alias";case 220:var i=e.getAssignmentDeclarationKind(r),a=r.right;switch(i){case 7:case 8:case 9:case 0:return "";case 1:case 2:var o=t(a);return ""===o?"const":o;case 3:return e.isFunctionExpression(a)?"method":"property";case 4:return "property";case 5:return e.isFunctionExpression(a)?"method":"property";case 6:return "local class";default:return e.assertType(i),""}case 79:return e.isImportClause(r.parent)?"alias":"";case 270:var s=t(r.expression);return ""===s?"const":s;default:return ""}function c(t){return e.isVarConst(t)?"const":e.isLet(t)?"let":"var"}},e.isThis=function(t){switch(t.kind){case 108:return !0;case 79:return e.identifierIsThisKeyword(t)&&163===t.parent.kind;default:return !1}};var g,m=/^\/\/\/\s*</;function y(e,t){return h(e.pos,e.end,t)}function v(e,t){return e.pos<t&&t<e.end}function h(e,t,r){return e<=r.pos&&t>=r.end}function b(e,t,r,n){return Math.max(e,r)<Math.min(t,n)}function x(t,r){if(void 0===t||e.nodeIsMissing(t))return !1;switch(t.kind){case 256:case 257:case 259:case 204:case 200:case 181:case 234:case 261:case 262:case 268:case 272:return D(t,19,r);case 291:return x(t.block,r);case 208:if(!t.arguments)return !0;case 207:case 211:case 190:return D(t,21,r);case 178:case 179:return x(t.type,r);case 170:case 171:case 172:case 255:case 212:case 168:case 167:case 174:case 173:case 213:return t.body?x(t.body,r):t.type?x(t.type,r):S(t,21,r);case 260:return !!t.body&&x(t.body,r);case 238:return t.elseStatement?x(t.elseStatement,r):x(t.thenStatement,r);case 237:return x(t.expression,r)||S(t,26,r);case 203:case 201:case 206:case 161:case 183:return D(t,23,r);case 175:return t.type?x(t.type,r):S(t,23,r);case 288:case 289:return !1;case 241:case 242:case 243:case 240:return x(t.statement,r);case 239:return S(t,115,r)?D(t,21,r):x(t.statement,r);case 180:return x(t.exprName,r);case 215:case 214:case 216:case 223:case 224:return x(t.expression,r);case 209:return x(t.template,r);case 222:return x(e.lastOrUndefined(t.templateSpans),r);case 232:return e.nodeIsPresent(t.literal);case 271:case 265:return e.nodeIsPresent(t.moduleSpecifier);case 218:return x(t.operand,r);case 220:return x(t.right,r);case 221:return x(t.whenFalse,r);default:return !0}}function D(t,r,n){var i=t.getChildren(n);if(i.length){var a=e.last(i);if(a.kind===r)return !0;if(26===a.kind&&1!==i.length)return i[i.length-2].kind===r}return !1}function S(e,t,r){return !!T(e,t,r)}function T(t,r,n){return e.find(t.getChildren(n),(function(e){return e.kind===r}))}function C(t){var r=e.find(t.parent.getChildren(),(function(r){return e.isSyntaxList(r)&&y(r,t)}));return e.Debug.assert(!r||e.contains(r.getChildren(),t)),r}function E(e){return 88===e.kind}function k(e){return 84===e.kind}function N(e){return 98===e.kind}function F(t,r){if(t.importClause){if(t.importClause.name&&t.importClause.namedBindings)return;if(t.importClause.name)return t.importClause.name;if(t.importClause.namedBindings){if(e.isNamedImports(t.importClause.namedBindings)){var n=e.singleOrUndefined(t.importClause.namedBindings.elements);if(!n)return;return n.name}if(e.isNamespaceImport(t.importClause.namedBindings))return t.importClause.namedBindings.name}}if(!r)return t.moduleSpecifier}function A(t,r){if(t.exportClause){if(e.isNamedExports(t.exportClause)){if(!e.singleOrUndefined(t.exportClause.elements))return;return t.exportClause.elements[0].name}if(e.isNamespaceExport(t.exportClause))return t.exportClause.name}if(!r)return t.moduleSpecifier}function P(t,r){var n=t.parent;if((e.isModifier(t)&&(r||88!==t.kind)?e.contains(n.modifiers,t):84===t.kind?e.isClassDeclaration(n)||e.isClassExpression(t):98===t.kind?e.isFunctionDeclaration(n)||e.isFunctionExpression(t):118===t.kind?e.isInterfaceDeclaration(n):92===t.kind?e.isEnumDeclaration(n):151===t.kind?e.isTypeAliasDeclaration(n):142===t.kind||141===t.kind?e.isModuleDeclaration(n):100===t.kind?e.isImportEqualsDeclaration(n):136===t.kind?e.isGetAccessorDeclaration(n):148===t.kind&&e.isSetAccessorDeclaration(n))&&(a=function(t,r){if(!r)switch(t.kind){case 256:case 225:return function(t){if(e.isNamedDeclaration(t))return t.name;if(e.isClassDeclaration(t)){var r=t.modifiers&&e.find(t.modifiers,E);if(r)return r}if(e.isClassExpression(t)){var n=e.find(t.getChildren(),k);if(n)return n}}(t);case 255:case 212:return function(t){if(e.isNamedDeclaration(t))return t.name;if(e.isFunctionDeclaration(t)){var r=e.find(t.modifiers,E);if(r)return r}if(e.isFunctionExpression(t)){var n=e.find(t.getChildren(),N);if(n)return n}}(t)}if(e.isNamedDeclaration(t))return t.name}(n,r)))return a;if((113===t.kind||85===t.kind||119===t.kind)&&e.isVariableDeclarationList(n)&&1===n.declarations.length){var i=n.declarations[0];if(e.isIdentifier(i.name))return i.name}if(151===t.kind){if(e.isImportClause(n)&&n.isTypeOnly&&(a=F(n.parent,r)))return a;if(e.isExportDeclaration(n)&&n.isTypeOnly&&(a=A(n,r)))return a}if(127===t.kind){if(e.isImportSpecifier(n)&&n.propertyName||e.isExportSpecifier(n)&&n.propertyName||e.isNamespaceImport(n)||e.isNamespaceExport(n))return n.name;if(e.isExportDeclaration(n)&&n.exportClause&&e.isNamespaceExport(n.exportClause))return n.exportClause.name}if(100===t.kind&&e.isImportDeclaration(n)&&(a=F(n,r)))return a;if(93===t.kind){var a;if(e.isExportDeclaration(n)&&(a=A(n,r)))return a;if(e.isExportAssignment(n))return e.skipOuterExpressions(n.expression)}if(145===t.kind&&e.isExternalModuleReference(n))return n.expression;if(155===t.kind&&(e.isImportDeclaration(n)||e.isExportDeclaration(n))&&n.moduleSpecifier)return n.moduleSpecifier;if((94===t.kind||117===t.kind)&&e.isHeritageClause(n)&&n.token===t.kind&&(a=function(e){if(1===e.types.length)return e.types[0].expression}(n)))return a;if(94===t.kind){if(e.isTypeParameterDeclaration(n)&&n.constraint&&e.isTypeReferenceNode(n.constraint))return n.constraint.typeName;if(e.isConditionalTypeNode(n)&&e.isTypeReferenceNode(n.extendsType))return n.extendsType.typeName}if(137===t.kind&&e.isInferTypeNode(n))return n.typeParameter.name;if(101===t.kind&&e.isTypeParameterDeclaration(n)&&e.isMappedTypeNode(n.parent))return n.name;if(140===t.kind&&e.isTypeOperatorNode(n)&&140===n.operator&&e.isTypeReferenceNode(n.type))return n.type.typeName;if(144===t.kind&&e.isTypeOperatorNode(n)&&144===n.operator&&e.isArrayTypeNode(n.type)&&e.isTypeReferenceNode(n.type.elementType))return n.type.elementType.typeName;if(!r){if((103===t.kind&&e.isNewExpression(n)||114===t.kind&&e.isVoidExpression(n)||112===t.kind&&e.isTypeOfExpression(n)||132===t.kind&&e.isAwaitExpression(n)||125===t.kind&&e.isYieldExpression(n)||89===t.kind&&e.isDeleteExpression(n))&&n.expression)return e.skipOuterExpressions(n.expression);if((101===t.kind||102===t.kind)&&e.isBinaryExpression(n)&&n.operatorToken===t)return e.skipOuterExpressions(n.right);if(127===t.kind&&e.isAsExpression(n)&&e.isTypeReferenceNode(n.type))return n.type.typeName;if(101===t.kind&&e.isForInStatement(n)||159===t.kind&&e.isForOfStatement(n))return e.skipOuterExpressions(n.expression)}return t}function w(e){return P(e,!1)}function I(e,t,r){return M(e,t,!1,r,!1)}function O(e,t){return M(e,t,!0,void 0,!1)}function M(t,r,n,i,a){var o,s=t,c=function(){var a=s.getChildren(t),c=e.binarySearchKey(a,r,(function(e,t){return t}),(function(e,o){var s=n?a[e].getFullStart():a[e].getStart(t,!0);return s>r?1:u(a[e])?a[e-1]&&u(a[e-1])?1:0:i&&s===r&&a[e-1]&&a[e-1].getEnd()===r&&u(a[e-1])?1:-1}));return o?{value:o}:c>=0&&a[c]?(s=a[c],"continue-outer"):{value:s}};e:for(;;){var l=c();if("object"==typeof l)return l.value;switch(l){case"continue-outer":continue e}}function u(e){if((n?e.getFullStart():e.getStart(t,!0))>r)return !1;var s=e.getEnd();if(r<s||r===s&&(1===e.kind||a))return !0;if(i&&s===r){var c=R(r,t,e);if(c&&i(c))return o=c,!0}return !1}}function L(t,r,n){return function r(i){return e.isToken(i)&&i.pos===t.end?i:e.firstDefined(i.getChildren(n),(function(e){return (e.pos<=t.pos&&e.end>t.end||e.pos===t.end)&&H(e,n)?r(e):void 0}))}(r)}function R(t,r,n,i){var a=function a(o){if(B(o)&&1!==o.kind)return o;var s=o.getChildren(r),c=e.binarySearchKey(s,t,(function(e,t){return t}),(function(e,r){return t<s[e].end?!s[e-1]||t>=s[e-1].end?0:1:-1}));if(c>=0&&s[c]){var l=s[c];if(t<l.end){if(l.getStart(r,!i)>=t||!H(l,r)||z(l)){var u=J(s,c,r);return u&&j(u,r)}return a(l)}}e.Debug.assert(void 0!==n||303===o.kind||1===o.kind||e.isJSDocCommentContainingNode(o));var _=J(s,s.length,r);return _&&j(_,r)}(n||r);return e.Debug.assert(!(a&&z(a))),a}function B(t){return e.isToken(t)&&!z(t)}function j(e,t){if(B(e))return e;var r=e.getChildren(t);if(0===r.length)return e;var n=J(r,r.length,t);return n&&j(n,t)}function J(t,r,n){for(var i=r-1;i>=0;i--)if(z(t[i]))e.Debug.assert(i>0,"`JsxText` tokens should not be the first child of `JsxElement | JsxSelfClosingElement`");else if(H(t[i],n))return t[i]}function z(t){return e.isJsxText(t)&&t.containsOnlyTriviaWhiteSpaces}function U(t,r,n){var i=e.tokenToString(t.kind),a=e.tokenToString(r),o=t.getFullStart(),s=n.text.lastIndexOf(a,o);if(-1!==s){if(n.text.lastIndexOf(i,o-1)<s){var c=R(s+1,n);if(c&&c.kind===r)return c}for(var l=t.kind,u=0;;){var _=R(t.getFullStart(),n);if(!_)return;if((t=_).kind===r){if(0===u)return t;u--;}else t.kind===l&&u++;}}}function K(e,t,r){return t?e.getNonNullableType():r?e.getNonOptionalType():e}function V(t,r,n){var i=n.getTypeAtLocation(t);return e.isOptionalChain(t.parent)&&(i=K(i,e.isOptionalChainRoot(t.parent),!0)),(e.isNewExpression(t.parent)?i.getConstructSignatures():i.getCallSignatures()).filter((function(e){return !!e.typeParameters&&e.typeParameters.length>=r}))}function q(t,r){if(-1!==r.text.lastIndexOf("<",t?t.pos:r.text.length))for(var n=t,i=0,a=0;n;){switch(n.kind){case 29:if((n=R(n.getFullStart(),r))&&28===n.kind&&(n=R(n.getFullStart(),r)),!n||!e.isIdentifier(n))return;if(!i)return e.isDeclarationName(n)?void 0:{called:n,nTypeArguments:a};i--;break;case 49:i=3;break;case 48:i=2;break;case 31:i++;break;case 19:if(!(n=U(n,18,r)))return;break;case 21:if(!(n=U(n,20,r)))return;break;case 23:if(!(n=U(n,22,r)))return;break;case 27:a++;break;case 38:case 79:case 10:case 8:case 9:case 110:case 95:case 112:case 94:case 140:case 24:case 51:case 57:case 58:break;default:if(e.isTypeNode(n))break;return}n=R(n.getFullStart(),r);}}function W(t,r,n){return e.formatting.getRangeOfEnclosingComment(t,r,void 0,n)}function H(e,t){return 1===e.kind?!!e.jsDoc:0!==e.getWidth(t)}function G(e,t,r){var n=W(e,t,void 0);return !!n&&r===m.test(e.text.substring(n.pos,n.end))}function Q(t,r,n){return e.createTextSpanFromBounds(t.getStart(r),(n||t).getEnd())}function X(t){if(!t.isUnterminated)return e.createTextSpanFromBounds(t.getStart()+1,t.getEnd()-1)}function Y(e,t){return {span:e,newText:t}}function Z(e){return 151===e.kind}function $(t,r){return {fileExists:function(e){return t.fileExists(e)},getCurrentDirectory:function(){return r.getCurrentDirectory()},readFile:e.maybeBind(r,r.readFile),useCaseSensitiveFileNames:e.maybeBind(r,r.useCaseSensitiveFileNames),getSymlinkCache:e.maybeBind(r,r.getSymlinkCache)||t.getSymlinkCache,getModuleSpecifierCache:e.maybeBind(r,r.getModuleSpecifierCache),getGlobalTypingsCacheLocation:e.maybeBind(r,r.getGlobalTypingsCacheLocation),redirectTargetsMap:t.redirectTargetsMap,getProjectReferenceRedirect:function(e){return t.getProjectReferenceRedirect(e)},isSourceOfProjectReferenceRedirect:function(e){return t.isSourceOfProjectReferenceRedirect(e)},getNearestAncestorDirectoryWithPackageJson:e.maybeBind(r,r.getNearestAncestorDirectoryWithPackageJson),getFileIncludeReasons:function(){return t.getFileIncludeReasons()}}}function ee(e,t){return i$1(i$1({},$(e,t)),{getCommonSourceDirectory:function(){return e.getCommonSourceDirectory()}})}function te(t,r,n,i,a){return e.factory.createImportDeclaration(void 0,void 0,t||r?e.factory.createImportClause(!!a,t,r&&r.length?e.factory.createNamedImports(r):void 0):void 0,"string"==typeof n?re(n,i):n,void 0)}function re(t,r){return e.factory.createStringLiteral(t,0===r)}function ne(t,r){return e.isStringDoubleQuoted(t,r)?1:0}function ie(t,r){if(r.quotePreference&&"auto"!==r.quotePreference)return "single"===r.quotePreference?0:1;var n=t.imports&&e.find(t.imports,(function(t){return e.isStringLiteral(t)&&!e.nodeIsSynthesized(t.parent)}));return n?ne(n,t):1}function ae(t){return "default"!==t.escapedName?t.escapedName:e.firstDefined(t.declarations,(function(t){var r=e.getNameOfDeclaration(t);return r&&79===r.kind?r.escapedText:void 0}))}function oe(t,r,n){return e.textSpanContainsPosition(t,r.getStart(n))&&r.getEnd()<=e.textSpanEnd(t)}function se(e,t){return !!e&&!!t&&e.start===t.start&&e.length===t.length}function ce(t){var r=t.declarations?e.firstOrUndefined(t.declarations):void 0;return !!e.findAncestor(r,(function(t){return !!e.isParameter(t)||!(e.isBindingElement(t)||e.isObjectBindingPattern(t)||e.isArrayBindingPattern(t))&&"quit"}))}e.getLineStartPositionForPosition=function(t,r){return e.getLineStarts(r)[r.getLineAndCharacterOfPosition(t).line]},e.rangeContainsRange=y,e.rangeContainsRangeExclusive=function(e,t){return v(e,t.pos)&&v(e,t.end)},e.rangeContainsPosition=function(e,t){return e.pos<=t&&t<=e.end},e.rangeContainsPositionExclusive=v,e.startEndContainsRange=h,e.rangeContainsStartEnd=function(e,t,r){return e.pos<=t&&e.end>=r},e.rangeOverlapsWithStartEnd=function(e,t,r){return b(e.pos,e.end,t,r)},e.nodeOverlapsWithStartEnd=function(e,t,r,n){return b(e.getStart(t),e.end,r,n)},e.startEndOverlapsWithStartEnd=b,e.positionBelongsToNode=function(t,r,n){return e.Debug.assert(t.pos<=r),r<t.end||!x(t,n)},e.findListItemInfo=function(t){var r=C(t);if(r){var n=r.getChildren();return {listItemIndex:e.indexOfNode(n,t),list:r}}},e.hasChildOfKind=S,e.findChildOfKind=T,e.findContainingList=C,e.getContextualTypeFromParentOrAncestorTypeNode=function(t,r){var n=Le(t,r);if(n)return n;var i=function(t){var r;return e.findAncestor(t,(function(t){return e.isTypeNode(t)&&(r=t),!e.isQualifiedName(t.parent)&&!e.isTypeNode(t.parent)&&!e.isTypeElement(t.parent)})),r}(t);return i&&r.getTypeAtLocation(i)},e.getAdjustedReferenceLocation=w,e.getAdjustedRenameLocation=function(e){return P(e,!0)},e.getTouchingPropertyName=function(t,r){return I(t,r,(function(t){return e.isPropertyNameLiteral(t)||e.isKeyword(t.kind)||e.isPrivateIdentifier(t)}))},e.getTouchingToken=I,e.getTokenAtPosition=O,e.findFirstNonJsxWhitespaceToken=function(e,t){for(var r=O(e,t);z(r);){var n=L(r,r.parent,e);if(!n)return;r=n;}return r},e.findTokenOnLeftOfPosition=function(t,r){var n=O(t,r);return e.isToken(n)&&r>n.getStart(t)&&r<n.getEnd()?n:R(r,t)},e.findNextToken=L,e.findPrecedingToken=R,e.isInString=function(t,r,n){if(void 0===n&&(n=R(r,t)),n&&e.isStringTextContainingNode(n)){var i=n.getStart(t),a=n.getEnd();if(i<r&&r<a)return !0;if(r===a)return !!n.isUnterminated}return !1},e.isInsideJsxElementOrAttribute=function(e,t){var r=O(e,t);return !!r&&(11===r.kind||29===r.kind&&11===r.parent.kind||29===r.kind&&287===r.parent.kind||!(!r||19!==r.kind||287!==r.parent.kind)||29===r.kind&&280===r.parent.kind)},e.isInTemplateString=function(t,r){var n=O(t,r);return e.isTemplateLiteralKind(n.kind)&&r>n.getStart(t)},e.isInJSXText=function(t,r){var n=O(t,r);return !!e.isJsxText(n)||!(18!==n.kind||!e.isJsxExpression(n.parent)||!e.isJsxElement(n.parent.parent))||!(29!==n.kind||!e.isJsxOpeningLikeElement(n.parent)||!e.isJsxElement(n.parent.parent))},e.isInsideJsxElement=function(e,t){return function(r){for(;r;)if(r.kind>=278&&r.kind<=287||11===r.kind||29===r.kind||31===r.kind||79===r.kind||19===r.kind||18===r.kind||43===r.kind)r=r.parent;else {if(277!==r.kind)return !1;if(t>r.getStart(e))return !0;r=r.parent;}return !1}(O(e,t))},e.findPrecedingMatchingToken=U,e.removeOptionality=K,e.isPossiblyTypeArgumentPosition=function t(r,n,i){var a=q(r,n);return void 0!==a&&(e.isPartOfTypeNode(a.called)||0!==V(a.called,a.nTypeArguments,i).length||t(a.called,n,i))},e.getPossibleGenericSignatures=V,e.getPossibleTypeArgumentsInfo=q,e.isInComment=W,e.hasDocComment=function(t,r){var n=O(t,r);return !!e.findAncestor(n,e.isJSDoc)},e.getNodeModifiers=function(t,r){void 0===r&&(r=0);var n=[],i=e.isDeclaration(t)?e.getCombinedNodeFlagsAlwaysIncludeJSDoc(t)&~r:0;return 8&i&&n.push("private"),16&i&&n.push("protected"),4&i&&n.push("public"),(32&i||e.isClassStaticBlockDeclaration(t))&&n.push("static"),128&i&&n.push("abstract"),1&i&&n.push("export"),8192&i&&n.push("deprecated"),8388608&t.flags&&n.push("declare"),270===t.kind&&n.push("export"),n.length>0?n.join(","):""},e.getTypeArgumentOrTypeParameterList=function(t){return 177===t.kind||207===t.kind?t.typeArguments:e.isFunctionLike(t)||256===t.kind||257===t.kind?t.typeParameters:void 0},e.isComment=function(e){return 2===e||3===e},e.isStringOrRegularExpressionOrTemplateLiteral=function(t){return !(10!==t&&13!==t&&!e.isTemplateLiteralKind(t))},e.isPunctuation=function(e){return 18<=e&&e<=78},e.isInsideTemplateLiteral=function(t,r,n){return e.isTemplateLiteralKind(t.kind)&&t.getStart(n)<r&&r<t.end||!!t.isUnterminated&&r===t.end},e.isAccessibilityModifier=function(e){switch(e){case 123:case 121:case 122:return !0}return !1},e.cloneCompilerOptions=function(t){var r=e.clone(t);return e.setConfigFileInOptions(r,t&&t.configFile),r},e.isArrayLiteralOrObjectLiteralDestructuringPattern=function e(t){if(203===t.kind||204===t.kind){if(220===t.parent.kind&&t.parent.left===t&&63===t.parent.operatorToken.kind)return !0;if(243===t.parent.kind&&t.parent.initializer===t)return !0;if(e(294===t.parent.kind?t.parent.parent:t.parent))return !0}return !1},e.isInReferenceComment=function(e,t){return G(e,t,!0)},e.isInNonReferenceComment=function(e,t){return G(e,t,!1)},e.getReplacementSpanForContextToken=function(e){if(e)switch(e.kind){case 10:case 14:return X(e);default:return Q(e)}},e.createTextSpanFromNode=Q,e.createTextSpanFromStringLiteralLikeContent=X,e.createTextRangeFromNode=function(t,r){return e.createRange(t.getStart(r),t.end)},e.createTextSpanFromRange=function(t){return e.createTextSpanFromBounds(t.pos,t.end)},e.createTextRangeFromSpan=function(t){return e.createRange(t.start,t.start+t.length)},e.createTextChangeFromStartLength=function(t,r,n){return Y(e.createTextSpan(t,r),n)},e.createTextChange=Y,e.typeKeywords=[130,128,157,133,95,137,140,143,104,146,147,144,149,150,110,114,152,153,154],e.isTypeKeyword=function(t){return e.contains(e.typeKeywords,t)},e.isTypeKeywordToken=Z,e.isTypeKeywordTokenOrIdentifier=function(t){return Z(t)||e.isIdentifier(t)&&"type"===t.text},e.isExternalModuleSymbol=function(e){return !!(1536&e.flags)&&34===e.name.charCodeAt(0)},e.nodeSeenTracker=function(){var t=[];return function(r){var n=e.getNodeId(r);return !t[n]&&(t[n]=!0)}},e.getSnapshotText=function(e){return e.getText(0,e.getLength())},e.repeatString=function(e,t){for(var r="",n=0;n<t;n++)r+=e;return r},e.skipConstraint=function(e){return e.isTypeParameter()&&e.getConstraint()||e},e.getNameFromPropertyName=function(t){return 161===t.kind?e.isStringOrNumericLiteralLike(t.expression)?t.expression.text:void 0:e.isPrivateIdentifier(t)?e.idText(t):e.getTextOfIdentifierOrLiteral(t)},e.programContainsModules=function(e){return e.getSourceFiles().some((function(t){return !(t.isDeclarationFile||e.isSourceFileFromExternalLibrary(t)||!t.externalModuleIndicator&&!t.commonJsModuleIndicator)}))},e.programContainsEsModules=function(e){return e.getSourceFiles().some((function(t){return !t.isDeclarationFile&&!e.isSourceFileFromExternalLibrary(t)&&!!t.externalModuleIndicator}))},e.compilerOptionsIndicateEsModules=function(t){return !!t.module||e.getEmitScriptTarget(t)>=2||!!t.noEmit},e.createModuleSpecifierResolutionHost=$,e.getModuleSpecifierResolverHost=ee,e.makeImportIfNecessary=function(e,t,r,n){return e||t&&t.length?te(e,t,r,n):void 0},e.makeImport=te,e.makeStringLiteral=re,(g=e.QuotePreference||(e.QuotePreference={}))[g.Single=0]="Single",g[g.Double=1]="Double",e.quotePreferenceFromString=ne,e.getQuotePreference=ie,e.getQuoteFromPreference=function(t){switch(t){case 0:return "'";case 1:return '"';default:return e.Debug.assertNever(t)}},e.symbolNameNoDefault=function(t){var r=ae(t);return void 0===r?void 0:e.unescapeLeadingUnderscores(r)},e.symbolEscapedNameNoDefault=ae,e.isModuleSpecifierLike=function(t){return e.isStringLiteralLike(t)&&(e.isExternalModuleReference(t.parent)||e.isImportDeclaration(t.parent)||e.isRequireCall(t.parent,!1)&&t.parent.arguments[0]===t||e.isImportCall(t.parent)&&t.parent.arguments[0]===t)},e.isObjectBindingElementWithoutPropertyName=function(t){return e.isBindingElement(t)&&e.isObjectBindingPattern(t.parent)&&e.isIdentifier(t.name)&&!t.propertyName},e.getPropertySymbolFromBindingElement=function(e,t){var r=e.getTypeAtLocation(t.parent);return r&&e.getPropertyOfType(r,t.name.text)},e.getParentNodeInSpan=function(t,r,n){if(t)for(;t.parent;){if(e.isSourceFile(t.parent)||!oe(n,t.parent,r))return t;t=t.parent;}},e.findModifier=function(t,r){return t.modifiers&&e.find(t.modifiers,(function(e){return e.kind===r}))},e.insertImports=function(t,r,n,i){var a=236===(e.isArray(n)?n[0]:n).kind?e.isRequireVariableStatement:e.isAnyImportSyntax,o=e.filter(r.statements,a),s=e.isArray(n)?e.stableSort(n,e.OrganizeImports.compareImportsOrRequireStatements):[n];if(o.length)if(o&&e.OrganizeImports.importsAreSorted(o))for(var c=0,l=s;c<l.length;c++){var u=l[c],_=e.OrganizeImports.getImportDeclarationInsertionIndex(o,u);if(0===_){var d=o[0]===r.statements[0]?{leadingTriviaOption:e.textChanges.LeadingTriviaOption.Exclude}:{};t.insertNodeBefore(r,o[0],u,!1,d);}else {var p=o[_-1];t.insertNodeAfter(r,p,u);}}else {var f=e.lastOrUndefined(o);f?t.insertNodesAfter(r,f,s):t.insertNodesAtTopOfFile(r,s,i);}else t.insertNodesAtTopOfFile(r,s,i);},e.getTypeKeywordOfTypeOnlyImport=function(t,r){return e.Debug.assert(t.isTypeOnly),e.cast(t.getChildAt(0,r),Z)},e.textSpansEqual=se,e.documentSpansEqual=function(e,t){return e.fileName===t.fileName&&se(e.textSpan,t.textSpan)},e.forEachUnique=function(e,t){if(e)for(var r=0;r<e.length;r++)if(e.indexOf(e[r])===r){var n=t(e[r],r);if(n)return n}},e.isTextWhiteSpaceLike=function(t,r,n){for(var i=r;i<n;i++)if(!e.isWhiteSpaceLike(t.charCodeAt(i)))return !1;return !0},e.isFirstDeclarationOfSymbolParameter=ce;var le=function(){var t,r,n,i,a=10*e.defaultMaximumTruncationLength;l();var o=function(t){return c(t,e.SymbolDisplayPartKind.text)};return {displayParts:function(){var r=t.length&&t[t.length-1].text;return i>a&&r&&"..."!==r&&(e.isWhiteSpaceLike(r.charCodeAt(r.length-1))||t.push(_e(" ",e.SymbolDisplayPartKind.space)),t.push(_e("...",e.SymbolDisplayPartKind.punctuation))),t},writeKeyword:function(t){return c(t,e.SymbolDisplayPartKind.keyword)},writeOperator:function(t){return c(t,e.SymbolDisplayPartKind.operator)},writePunctuation:function(t){return c(t,e.SymbolDisplayPartKind.punctuation)},writeTrailingSemicolon:function(t){return c(t,e.SymbolDisplayPartKind.punctuation)},writeSpace:function(t){return c(t,e.SymbolDisplayPartKind.space)},writeStringLiteral:function(t){return c(t,e.SymbolDisplayPartKind.stringLiteral)},writeParameter:function(t){return c(t,e.SymbolDisplayPartKind.parameterName)},writeProperty:function(t){return c(t,e.SymbolDisplayPartKind.propertyName)},writeLiteral:function(t){return c(t,e.SymbolDisplayPartKind.stringLiteral)},writeSymbol:function(e,r){i>a||(s(),i+=e.length,t.push(ue(e,r)));},writeLine:function(){i>a||(i+=1,t.push(ye()),r=!0);},write:o,writeComment:o,getText:function(){return ""},getTextPos:function(){return 0},getColumn:function(){return 0},getLine:function(){return 0},isAtStartOfLine:function(){return !1},hasTrailingWhitespace:function(){return !1},hasTrailingComment:function(){return !1},rawWrite:e.notImplemented,getIndent:function(){return n},increaseIndent:function(){n++;},decreaseIndent:function(){n--;},clear:l,trackSymbol:function(){return !1},reportInaccessibleThisError:e.noop,reportInaccessibleUniqueSymbolError:e.noop,reportPrivateInBaseOfClassExpression:e.noop};function s(){if(!(i>a)&&r){var o=e.getIndentString(n);o&&(i+=o.length,t.push(_e(o,e.SymbolDisplayPartKind.space))),r=!1;}}function c(e,r){i>a||(s(),i+=e.length,t.push(_e(e,r)));}function l(){t=[],r=!0,n=0,i=0;}}();function ue(t,r){return _e(t,function(t){var r=t.flags;return 3&r?ce(t)?e.SymbolDisplayPartKind.parameterName:e.SymbolDisplayPartKind.localName:4&r||32768&r||65536&r?e.SymbolDisplayPartKind.propertyName:8&r?e.SymbolDisplayPartKind.enumMemberName:16&r?e.SymbolDisplayPartKind.functionName:32&r?e.SymbolDisplayPartKind.className:64&r?e.SymbolDisplayPartKind.interfaceName:384&r?e.SymbolDisplayPartKind.enumName:1536&r?e.SymbolDisplayPartKind.moduleName:8192&r?e.SymbolDisplayPartKind.methodName:262144&r?e.SymbolDisplayPartKind.typeParameterName:524288&r||2097152&r?e.SymbolDisplayPartKind.aliasName:e.SymbolDisplayPartKind.text}(r))}function _e(t,r){return {text:t,kind:e.SymbolDisplayPartKind[r]}}function de(t){return _e(e.tokenToString(t),e.SymbolDisplayPartKind.keyword)}function pe(t){return _e(t,e.SymbolDisplayPartKind.text)}function fe(t){return _e(t,e.SymbolDisplayPartKind.linkText)}function ge(t,r){return {text:t,kind:e.SymbolDisplayPartKind[e.SymbolDisplayPartKind.linkName],target:{fileName:e.getSourceFileOfNode(r).fileName,textSpan:Q(r)}}}function me(t){return _e(t,e.SymbolDisplayPartKind.link)}function ye(){return _e("\n",e.SymbolDisplayPartKind.lineBreak)}function ve(e){try{return e(le),le.displayParts()}finally{le.clear();}}function he(e){return 0!=(33554432&e.flags)}function be(e){return 0!=(2097152&e.flags)}function xe(e,t){void 0===t&&(t=!0);var r=e&&Se(e);return r&&!t&&Ee(r),r}function De(t,r,n){var i=n(t);return i?e.setOriginalNode(i,t):i=Se(t,n),i&&!r&&Ee(i),i}function Se(t,r){var n=r?function(e){return De(e,!0,r)}:xe,i=r?function(e){return e&&Ce(e,!0,r)}:function(e){return e&&Te(e)},a=e.visitEachChild(t,n,e.nullTransformationContext,i,n);if(a===t){var o=e.isStringLiteral(t)?e.setOriginalNode(e.factory.createStringLiteralFromNode(t),t):e.isNumericLiteral(t)?e.setOriginalNode(e.factory.createNumericLiteral(t.text,t.numericLiteralFlags),t):e.factory.cloneNode(t);return e.setTextRange(o,t)}return a.parent=void 0,a}function Te(t,r){return void 0===r&&(r=!0),t&&e.factory.createNodeArray(t.map((function(e){return xe(e,r)})),t.hasTrailingComma)}function Ce(t,r,n){return e.factory.createNodeArray(t.map((function(e){return De(e,r,n)})),t.hasTrailingComma)}function Ee(e){ke(e),Ne(e);}function ke(e){Fe(e,512,Ae);}function Ne(t){Fe(t,1024,e.getLastChild);}function Fe(t,r,n){e.addEmitFlags(t,r);var i=n(t);i&&Fe(i,r,n);}function Ae(e){return e.forEachChild((function(e){return e}))}function Pe(t,r,n,i,a){e.forEachLeadingCommentRange(n.text,t.pos,Oe(r,n,i,a,e.addSyntheticLeadingComment));}function we(t,r,n,i,a){e.forEachTrailingCommentRange(n.text,t.end,Oe(r,n,i,a,e.addSyntheticTrailingComment));}function Ie(t,r,n,i,a){e.forEachTrailingCommentRange(n.text,t.pos,Oe(r,n,i,a,e.addSyntheticLeadingComment));}function Oe(e,t,r,n,i){return function(a,o,s,c){3===s?(a+=2,o-=2):a+=2,i(e,r||s,t.text.slice(a,o),void 0!==n?n:c);}}function Me(t,r){if(e.startsWith(t,r))return 0;var n=t.indexOf(" "+r);return -1===n&&(n=t.indexOf("."+r)),-1===n&&(n=t.indexOf('"'+r)),-1===n?-1:n+1}function Le(e,t){var r=e.parent;switch(r.kind){case 208:return t.getContextualType(r);case 220:var n=r,i=n.left,a=n.operatorToken,o=n.right;return Re(a.kind)?t.getTypeAtLocation(e===o?i:o):t.getContextualType(e);case 288:return r.expression===e?Be(r,t):void 0;default:return t.getContextualType(e)}}function Re(e){switch(e){case 36:case 34:case 37:case 35:return !0;default:return !1}}function Be(e,t){return t.getTypeAtLocation(e.parent.parent.expression)}function je(e){return 173===e||174===e||175===e||165===e||167===e}function Je(e){return 255===e||170===e||168===e||171===e||172===e}function ze(e){return 260===e}function Ue(e){return 236===e||237===e||239===e||244===e||245===e||246===e||250===e||252===e||166===e||258===e||265===e||264===e||271===e||263===e||270===e}function Ke(e,t){return qe(e,e.fileExists,t)}function Ve(e){try{return e()}catch(e){return}}function qe(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];return Ve((function(){return t&&t.apply(e,r)}))}function We(t,r){if(!r.fileExists)return [];var n=[];return e.forEachAncestorDirectory(e.getDirectoryPath(t),(function(t){var i=e.combinePaths(t,"package.json");if(r.fileExists(i)){var a=He(i,r);a&&n.push(a);}})),n}function He(t,r){if(r.readFile){var n=function(e){try{return JSON.parse(e)}catch(e){return}}(r.readFile(t)||""),a={};if(n)for(var o=0,s=["dependencies","devDependencies","optionalDependencies","peerDependencies"];o<s.length;o++){var c=s[o],l=n[c];if(l){var u=new e.Map;for(var _ in l)u.set(_,l[_]);a[c]=u;}}var d=[[1,a.dependencies],[2,a.devDependencies],[8,a.optionalDependencies],[4,a.peerDependencies]];return i$1(i$1({},a),{parseable:!!n,fileName:t,get:p,has:function(e,t){return !!p(e,t)}})}function p(e,t){void 0===t&&(t=15);for(var r=0,n=d;r<n.length;r++){var i=n[r],a=i[0],o=i[1];if(o&&t&a){var s=o.get(e);if(void 0!==s)return s}}}}function Ge(t){return e.some(t.imports,(function(t){var r=t.text;return e.JsTyping.nodeCoreModules.has(r)}))}function Qe(e){return void 0!==e.file&&void 0!==e.start&&void 0!==e.length}function Xe(t){var r=t.getSourceFile();return !(!r.externalModuleIndicator&&!r.commonJsModuleIndicator)&&(e.isInJSFile(t)||!e.findAncestor(t,e.isGlobalScopeAugmentation))}e.symbolPart=ue,e.displayPart=_e,e.spacePart=function(){return _e(" ",e.SymbolDisplayPartKind.space)},e.keywordPart=de,e.punctuationPart=function(t){return _e(e.tokenToString(t),e.SymbolDisplayPartKind.punctuation)},e.operatorPart=function(t){return _e(e.tokenToString(t),e.SymbolDisplayPartKind.operator)},e.parameterNamePart=function(t){return _e(t,e.SymbolDisplayPartKind.parameterName)},e.propertyNamePart=function(t){return _e(t,e.SymbolDisplayPartKind.propertyName)},e.textOrKeywordPart=function(t){var r=e.stringToToken(t);return void 0===r?pe(t):de(r)},e.textPart=pe,e.typeAliasNamePart=function(t){return _e(t,e.SymbolDisplayPartKind.aliasName)},e.typeParameterNamePart=function(t){return _e(t,e.SymbolDisplayPartKind.typeParameterName)},e.linkTextPart=fe,e.linkNamePart=ge,e.linkPart=me,e.buildLinkParts=function(t,r){var n,i=e.isJSDocLink(t)?"link":e.isJSDocLinkCode(t)?"linkcode":"linkplain",a=[me("{@".concat(i," "))];if(t.name){var o=null==r?void 0:r.getSymbolAtLocation(t.name),s=function(e){if(0===e.indexOf("()"))return 2;if("<"!==e[0])return 0;for(var t=0,r=0;r<e.length;)if("<"===e[r]&&t++,">"===e[r]&&t--,r++,!t)return r;return 0}(t.text),c=e.getTextOfNode(t.name)+t.text.slice(0,s),l=t.text.slice(s),u=(null==o?void 0:o.valueDeclaration)||(null===(n=null==o?void 0:o.declarations)||void 0===n?void 0:n[0]);u?(a.push(ge(c,u)),l&&a.push(fe(l))):a.push(fe(c+(s?"":" ")+l));}else t.text&&a.push(fe(t.text));return a.push(me("}")),a},e.getNewLineOrDefaultFromHost=function(e,t){var r;return (null==t?void 0:t.newLineCharacter)||(null===(r=e.getNewLine)||void 0===r?void 0:r.call(e))||"\r\n"},e.lineBreakPart=ye,e.mapToDisplayParts=ve,e.typeToDisplayParts=function(e,t,r,n){return void 0===n&&(n=0),ve((function(i){e.writeType(t,r,17408|n,i);}))},e.symbolToDisplayParts=function(e,t,r,n,i){return void 0===i&&(i=0),ve((function(a){e.writeSymbol(t,r,n,8|i,a);}))},e.signatureToDisplayParts=function(e,t,r,n){return void 0===n&&(n=0),n|=25632,ve((function(i){e.writeSignature(t,r,n,void 0,i);}))},e.isImportOrExportSpecifierName=function(t){return !!t.parent&&e.isImportOrExportSpecifier(t.parent)&&t.parent.propertyName===t},e.getScriptKind=function(t,r){return e.ensureScriptKind(t,r.getScriptKind&&r.getScriptKind(t))},e.getSymbolTarget=function(t,r){for(var n=t;be(n)||he(n)&&n.target;)n=he(n)&&n.target?n.target:e.skipAlias(n,r);return n},e.getUniqueSymbolId=function(t,r){return e.getSymbolId(e.skipAlias(t,r))},e.getFirstNonSpaceCharacterPosition=function(t,r){for(;e.isWhiteSpaceLike(t.charCodeAt(r));)r+=1;return r},e.getPrecedingNonSpaceCharacterPosition=function(t,r){for(;r>-1&&e.isWhiteSpaceSingleLine(t.charCodeAt(r));)r-=1;return r+1},e.getSynthesizedDeepClone=xe,e.getSynthesizedDeepCloneWithReplacements=De,e.getSynthesizedDeepClones=Te,e.getSynthesizedDeepClonesWithReplacements=Ce,e.suppressLeadingAndTrailingTrivia=Ee,e.suppressLeadingTrivia=ke,e.suppressTrailingTrivia=Ne,e.copyComments=function(e,t){var r=e.getSourceFile();!function(e,t){for(var r=e.getFullStart(),n=e.getStart(),i=r;i<n;i++)if(10===t.charCodeAt(i))return !0;return !1}(e,r.text)?Ie(e,t,r):Pe(e,t,r),we(e,t,r);},e.getUniqueName=function(t,r){for(var n=t,i=1;!e.isFileLevelUniqueName(r,n);i++)n="".concat(t,"_").concat(i);return n},e.getRenameLocation=function(t,r,n,i){for(var a=0,o=-1,s=0,c=t;s<c.length;s++){var l=c[s],u=l.fileName,_=l.textChanges;e.Debug.assert(u===r);for(var d=0,p=_;d<p.length;d++){var f=p[d],g=f.span,m=f.newText,y=Me(m,n);if(-1!==y&&(o=g.start+a+y,!i))return o;a+=m.length-g.length;}}return e.Debug.assert(i),e.Debug.assert(o>=0),o},e.copyLeadingComments=Pe,e.copyTrailingComments=we,e.copyTrailingAsLeadingComments=Ie,e.needsParentheses=function(t){return e.isBinaryExpression(t)&&27===t.operatorToken.kind||e.isObjectLiteralExpression(t)||e.isAsExpression(t)&&e.isObjectLiteralExpression(t.expression)},e.getContextualTypeFromParent=Le,e.quote=function(t,r,n){var i=ie(t,r),a=JSON.stringify(n);return 0===i?"'".concat(e.stripQuotes(a).replace(/'/g,"\\'").replace(/\\"/g,'"'),"'"):a},e.isEqualityOperatorKind=Re,e.isStringLiteralOrTemplate=function(e){switch(e.kind){case 10:case 14:case 222:case 209:return !0;default:return !1}},e.hasIndexSignature=function(e){return !!e.getStringIndexType()||!!e.getNumberIndexType()},e.getSwitchedType=Be,e.ANONYMOUS="anonymous function",e.getTypeNodeIfAccessible=function(e,t,r,n){var i=r.getTypeChecker(),a=!0,o=function(){return a=!1},s=i.typeToTypeNode(e,t,1,{trackSymbol:function(e,t,r){return !(a=a&&0===i.isSymbolAccessible(e,t,r,!1).accessibility)},reportInaccessibleThisError:o,reportPrivateInBaseOfClassExpression:o,reportInaccessibleUniqueSymbolError:o,moduleResolverHost:ee(r,n)});return a?s:void 0},e.syntaxRequiresTrailingCommaOrSemicolonOrASI=je,e.syntaxRequiresTrailingFunctionBlockOrSemicolonOrASI=Je,e.syntaxRequiresTrailingModuleBlockOrSemicolonOrASI=ze,e.syntaxRequiresTrailingSemicolonOrASI=Ue,e.syntaxMayBeASICandidate=e.or(je,Je,ze,Ue),e.positionIsASICandidate=function(t,r,n){var i=e.findAncestor(r,(function(r){return r.end!==t?"quit":e.syntaxMayBeASICandidate(r.kind)}));return !!i&&function(t,r){var n=t.getLastToken(r);if(n&&26===n.kind)return !1;if(je(t.kind)){if(n&&27===n.kind)return !1}else if(ze(t.kind)){if((i=e.last(t.getChildren(r)))&&e.isModuleBlock(i))return !1}else if(Je(t.kind)){var i;if((i=e.last(t.getChildren(r)))&&e.isFunctionBlock(i))return !1}else if(!Ue(t.kind))return !1;if(239===t.kind)return !0;var a=L(t,e.findAncestor(t,(function(e){return !e.parent})),r);return !a||19===a.kind||r.getLineAndCharacterOfPosition(t.getEnd()).line!==r.getLineAndCharacterOfPosition(a.getStart(r)).line}(i,n)},e.probablyUsesSemicolons=function(t){var r=0,n=0;return e.forEachChild(t,(function i(a){if(Ue(a.kind)){var o=a.getLastToken(t);o&&26===o.kind?r++:n++;}return r+n>=5||e.forEachChild(a,i)})),0===r&&n<=1||r/n>.2},e.tryGetDirectories=function(e,t){return qe(e,e.getDirectories,t)||[]},e.tryReadDirectory=function(t,r,n,i,a){return qe(t,t.readDirectory,r,n,i,a)||e.emptyArray},e.tryFileExists=Ke,e.tryDirectoryExists=function(t,r){return Ve((function(){return e.directoryProbablyExists(r,t)}))||!1},e.tryAndIgnoreErrors=Ve,e.tryIOAndConsumeErrors=qe,e.findPackageJsons=function(t,r,n){var i=[];return e.forEachAncestorDirectory(t,(function(t){if(t===n)return !0;var a=e.combinePaths(t,"package.json");Ke(r,a)&&i.push(a);})),i},e.findPackageJson=function(t,r){var n;return e.forEachAncestorDirectory(t,(function(t){return "node_modules"===t||!!(n=e.findConfigFile(t,(function(e){return Ke(r,e)}),"package.json"))||void 0})),n},e.getPackageJsonsVisibleToFile=We,e.createPackageJsonInfo=He,e.createPackageJsonImportFilter=function(t,r,n){var i,a=(n.getPackageJsonsVisibleToFile&&n.getPackageJsonsVisibleToFile(t.fileName)||We(t.fileName,n)).filter((function(e){return e.parseable}));return {allowsImportingAmbientModule:function(t,r){if(!a.length||!t.valueDeclaration)return !0;var n=c(t.valueDeclaration.getSourceFile().fileName,r);if(void 0===n)return !0;var i=e.stripQuotes(t.getName());return !!s(i)||(o(n)||o(i))},allowsImportingSourceFile:function(e,t){if(!a.length)return !0;var r=c(e.fileName,t);return !r||o(r)},allowsImportingSpecifier:function(t){return !(a.length&&!s(t))||(!(!e.pathIsRelative(t)&&!e.isRootedDiskPath(t))||o(t))}};function o(t){for(var r=l(t),n=0,i=a;n<i.length;n++){var o=i[n];if(o.has(r)||o.has(e.getTypesPackageName(r)))return !0}return !1}function s(r){return !!(e.isSourceFileJS(t)&&e.JsTyping.nodeCoreModules.has(r)&&(void 0===i&&(i=Ge(t)),i))}function c(i,a){if(e.stringContains(i,"node_modules")){var o=e.moduleSpecifiers.getNodeModulesPackageName(n.getCompilationSettings(),t.path,i,a,r);if(o)return e.pathIsRelative(o)||e.isRootedDiskPath(o)?void 0:l(o)}}function l(t){var r=e.getPathComponents(e.getPackageNameFromTypesPackageName(t)).slice(1);return e.startsWith(r[0],"@")?"".concat(r[0],"/").concat(r[1]):r[0]}},e.consumesNodeCoreModules=Ge,e.isInsideNodeModules=function(t){return e.contains(e.getPathComponents(t),"node_modules")},e.isDiagnosticWithLocation=Qe,e.findDiagnosticForNode=function(t,r){var n=Q(t),i=e.binarySearchKey(r,n,e.identity,e.compareTextSpans);if(i>=0){var a=r[i];return e.Debug.assertEqual(a.file,t.getSourceFile(),"Diagnostics proided to 'findDiagnosticForNode' must be from a single SourceFile"),e.cast(a,Qe)}},e.getDiagnosticsWithinSpan=function(t,r){var n,i=e.binarySearchKey(r,t.start,(function(e){return e.start}),e.compareValues);for(i<0&&(i=~i);(null===(n=r[i-1])||void 0===n?void 0:n.start)===t.start;)i--;for(var a=[],o=e.textSpanEnd(t);;){var s=e.tryCast(r[i],Qe);if(!s||s.start>o)break;e.textSpanContainsTextSpan(t,s)&&a.push(s),i++;}return a},e.getRefactorContextSpan=function(t){var r=t.startPosition,n=t.endPosition;return e.createTextSpanFromBounds(r,void 0===n?r:n)},e.getFixableErrorSpanExpression=function(t,r){var n=O(t,r.start);return e.findAncestor(n,(function(n){return n.getStart(t)<r.start||n.getEnd()>e.textSpanEnd(r)?"quit":e.isExpression(n)&&se(r,Q(n,t))}))},e.mapOneOrMany=function(t,r,n){return void 0===n&&(n=e.identity),t?e.isArray(t)?n(e.map(t,r)):r(t,0):void 0},e.firstOrOnly=function(t){return e.isArray(t)?e.first(t):t},e.getNameForExportedSymbol=function(t,r){return 33554432&t.flags||"export="!==t.escapedName&&"default"!==t.escapedName?t.name:e.firstDefined(t.declarations,(function(t){var r;return e.isExportAssignment(t)?null===(r=e.tryCast(e.skipOuterExpressions(t.expression),e.isIdentifier))||void 0===r?void 0:r.text:void 0}))||e.codefix.moduleSymbolToValidIdentifier(function(t){var r;return e.Debug.checkDefined(t.parent,"Symbol parent was undefined. Flags: ".concat(e.Debug.formatSymbolFlags(t.flags),". ")+"Declarations: ".concat(null===(r=t.declarations)||void 0===r?void 0:r.map((function(t){var r=e.Debug.formatSyntaxKind(t.kind),n=e.isInJSFile(t),i=t.expression;return (n?"[JS]":"")+r+(i?" (expression: ".concat(e.Debug.formatSyntaxKind(i.kind),")"):"")})).join(", "),"."))}(t),r)},e.stringContainsAt=function(e,t,r){var n=t.length;if(n+r>e.length)return !1;for(var i=0;i<n;i++)if(t.charCodeAt(i)!==e.charCodeAt(i+r))return !1;return !0},e.startsWithUnderscore=function(e){return 95===e.charCodeAt(0)},e.isGlobalDeclaration=function(e){return !Xe(e)},e.isNonGlobalDeclaration=Xe,e.isDeprecatedDeclaration=function(t){return !!(8192&e.getCombinedNodeFlagsAlwaysIncludeJSDoc(t))},e.shouldUseUriStyleNodeCoreModules=function(t,r){var n=e.firstDefined(t.imports,(function(t){if(e.JsTyping.nodeCoreModules.has(t.text))return e.startsWith(t.text,"node:")}));return null!=n?n:r.usesUriStyleNodeCoreModules},e.getNewLineKind=function(e){return "\n"===e?1:0},e.diagnosticToString=function(t){return e.isArray(t)?e.formatStringFromArgs(e.getLocaleSpecificMessage(t[0]),t.slice(1)):e.getLocaleSpecificMessage(t)};}(t),function(e){function t(t){var r,n=1,i=e.createMultiMap(),a=new e.Map,o={isUsableByFile:function(e){return e===r},isEmpty:function(){return !i.size},clear:function(){i.clear(),a.clear(),r=void 0;},add:function(t,s,c,l,u,_,d,p,f){t!==r&&(o.clear(),r=t);var g=1===_&&e.getLocalSymbolForExportDefault(s)||s,m=0===_||e.isExternalModuleSymbol(g)?e.unescapeLeadingUnderscores(c):e.getNameForExportedSymbol(g,p),y=e.stripQuotes(l.name),v=n++,h=e.skipAlias(s,f),b=33554432&s.flags?void 0:s,x=33554432&l.flags?void 0:l;b&&x||a.set(v,[s,l]),i.add(function(t,r,n,i){var a=n||"";return "".concat(t,"|").concat(e.getSymbolId(e.skipAlias(r,i)),"|").concat(a)}(m,s,e.isExternalModuleNameRelative(y)?void 0:y,f),{id:v,symbolTableKey:c,symbolName:m,moduleName:y,moduleFile:u,moduleFileName:null==u?void 0:u.fileName,exportKind:_,targetFlags:h.flags,isFromPackageJson:d,symbol:b,moduleSymbol:x});},get:function(e,t){if(e===r){var n=i.get(t);return null==n?void 0:n.map(s)}},forEach:function(e,t){e===r&&i.forEach((function(e,r){var n=function(e){var t=e.substring(0,e.indexOf("|")),r=e.substring(e.lastIndexOf("|")+1);return {symbolName:t,ambientModuleName:""===r?void 0:r}}(r),i=n.symbolName,a=n.ambientModuleName;t(e.map(s),i,!!a,r);}));},releaseSymbols:function(){a.clear();},onFileChanged:function(t,n,i){return !(c(t)&&c(n)||(r&&r!==n.path||i&&e.consumesNodeCoreModules(t)!==e.consumesNodeCoreModules(n)||!e.arrayIsEqualTo(t.moduleAugmentations,n.moduleAugmentations)||!function(t,r){if(!e.arrayIsEqualTo(t.ambientModuleNames,r.ambientModuleNames))return !1;for(var n=-1,i=-1,a=function(a){var o=function(t){return e.isNonGlobalAmbientModule(t)&&t.name.text===a};if(n=e.findIndex(t.statements,o,n+1),i=e.findIndex(r.statements,o,i+1),t.statements[n]!==r.statements[i])return {value:!1}},o=0,s=r.ambientModuleNames;o<s.length;o++){var c=a(s[o]);if("object"==typeof c)return c.value}return !0}(t,n)?(o.clear(),0):(r=n.path,1)))}};return e.Debug.isDebugging&&Object.defineProperty(o,"__cache",{get:function(){return i}}),o;function s(r){if(r.symbol&&r.moduleSymbol)return r;var n=r.id,i=r.exportKind,o=r.targetFlags,s=r.isFromPackageJson,c=r.moduleFileName,l=a.get(n)||e.emptyArray,u=l[0],_=l[1];if(u&&_)return {symbol:u,moduleSymbol:_,moduleFileName:c,exportKind:i,targetFlags:o,isFromPackageJson:s};var d=(s?t.getPackageJsonAutoImportProvider():t.getCurrentProgram()).getTypeChecker(),p=r.moduleSymbol||_||e.Debug.checkDefined(r.moduleFile?d.getMergedSymbol(r.moduleFile.symbol):d.tryFindAmbientModule(r.moduleName)),f=r.symbol||u||e.Debug.checkDefined(2===i?d.resolveExternalModuleSymbol(p):d.tryGetMemberInModuleExportsAndProperties(e.unescapeLeadingUnderscores(r.symbolTableKey),p),"Could not find symbol '".concat(r.symbolName,"' by key '").concat(r.symbolTableKey,"' in module ").concat(p.name));return a.set(n,[f,p]),{symbol:f,moduleSymbol:p,moduleFileName:c,exportKind:i,targetFlags:o,isFromPackageJson:s}}function c(e){return !(e.commonJsModuleIndicator||e.externalModuleIndicator||e.moduleAugmentations||e.ambientModuleNames)}}function r(t,r,i,a){var o,s;n(t.getTypeChecker(),t.getSourceFiles(),(function(e,r){return a(e,r,t,!1)}));var c=i&&(null===(o=r.getPackageJsonAutoImportProvider)||void 0===o?void 0:o.call(r));if(c){var l=e.timestamp();n(c.getTypeChecker(),c.getSourceFiles(),(function(e,t){return a(e,t,c,!0)})),null===(s=r.log)||void 0===s||s.call(r,"forEachExternalModuleToImportFrom autoImportProvider: ".concat(e.timestamp()-l));}}function n(t,r,n){for(var i=0,a=t.getAmbientModules();i<a.length;i++){var o=a[i];e.stringContains(o.name,"*")||n(o,void 0);}for(var s=0,c=r;s<c.length;s++){var l=c[s];e.isExternalOrCommonJsModule(l)&&n(t.getMergedSymbol(l.symbol),l);}}function a(e,t,r){var n=function(e,t){var r=t.resolveExternalModuleSymbol(e);if(r!==e)return {symbol:r,exportKind:2};var n=t.tryGetMemberInModuleExports("default",e);return n?{symbol:n,exportKind:1}:void 0}(e,t);if(n){var a=n.symbol,o=n.exportKind,c=s(a,t,r);return c&&i$1({symbol:a,exportKind:o},c)}}function o(t,r){return !(r.isUndefinedSymbol(t)||r.isUnknownSymbol(t)||e.isKnownSymbol(t)||e.isPrivateIdentifierSymbol(t))}function s(t,r,n){var i=e.getLocalSymbolForExportDefault(t);if(i)return {symbolForMeaning:i,name:i.name};var a,o=(a=t).declarations&&e.firstDefined(a.declarations,(function(t){var r;return e.isExportAssignment(t)?null===(r=e.tryCast(e.skipOuterExpressions(t.expression),e.isIdentifier))||void 0===r?void 0:r.text:e.isExportSpecifier(t)?(e.Debug.assert("default"===t.name.text,"Expected the specifier to be a default export"),t.propertyName&&t.propertyName.text):void 0}));if(void 0!==o)return {symbolForMeaning:t,name:o};if(2097152&t.flags){var c=r.getImmediateAliasedSymbol(t);if(c&&c.parent)return s(c,r,n)}return "default"!==t.escapedName&&"export="!==t.escapedName?{symbolForMeaning:t,name:t.getName()}:{symbolForMeaning:t,name:e.getNameForExportedSymbol(t,n.target)}}var c,l;(l=e.ImportKind||(e.ImportKind={}))[l.Named=0]="Named",l[l.Default=1]="Default",l[l.Namespace=2]="Namespace",l[l.CommonJS=3]="CommonJS",(c=e.ExportKind||(e.ExportKind={}))[c.Named=0]="Named",c[c.Default=1]="Default",c[c.ExportEquals=2]="ExportEquals",c[c.UMD=3]="UMD",e.createCacheableExportInfoMap=t,e.isImportableFile=function(t,r,n,i,a,o,s){var c;if(r===n)return !1;var l=null==s?void 0:s.get(r.path,n.path,i);if(void 0!==(null==l?void 0:l.isAutoImportable))return l.isAutoImportable;var u=e.hostGetCanonicalFileName(o),_=null===(c=o.getGlobalTypingsCacheLocation)||void 0===c?void 0:c.call(o),d=!!e.moduleSpecifiers.forEachFileNameOfModule(r.fileName,n.fileName,o,!1,(function(i){var a=t.getSourceFile(i);return (a===n||!a)&&function(t,r,n,i){var a=e.forEachAncestorDirectory(r,(function(t){return "node_modules"===e.getBaseFileName(t)?t:void 0})),o=a&&e.getDirectoryPath(n(a));return void 0===o||e.startsWith(n(t),o)||!!i&&e.startsWith(n(i),o)}(r.fileName,i,u,_)}));if(a){var p=d&&a.allowsImportingSourceFile(n,o);return null==s||s.setIsAutoImportable(r.path,n.path,i,p),p}return d},e.forEachExternalModuleToImportFrom=r,e.getExportInfoMap=function(n,i,s,c){var l,u,_,d,p,f=e.timestamp();null===(l=i.getPackageJsonAutoImportProvider)||void 0===l||l.call(i);var g=(null===(u=i.getCachedExportInfoMap)||void 0===u?void 0:u.call(i))||t({getCurrentProgram:function(){return s},getPackageJsonAutoImportProvider:function(){var e;return null===(e=i.getPackageJsonAutoImportProvider)||void 0===e?void 0:e.call(i)}});if(g.isUsableByFile(n.path))return null===(_=i.log)||void 0===_||_.call(i,"getExportInfoMap: cache hit"),g;null===(d=i.log)||void 0===d||d.call(i,"getExportInfoMap: cache miss or empty; calculating new results");var m=s.getCompilerOptions(),y=e.getEmitScriptTarget(m),v=0;return r(s,i,!0,(function(t,r,i,s){++v%100==0&&(null==c||c.throwIfCancellationRequested());var l=new e.Map,u=i.getTypeChecker(),_=a(t,u,m);_&&o(_.symbol,u)&&g.add(n.path,_.symbol,1===_.exportKind?"default":"export=",t,r,_.exportKind,s,y,u),u.forEachExportAndPropertyOfModule(t,(function(i,a){i!==(null==_?void 0:_.symbol)&&o(i,u)&&e.addToSeen(l,a)&&g.add(n.path,i,a,t,r,0,s,y,u);}));})),null===(p=i.log)||void 0===p||p.call(i,"getExportInfoMap: done in ".concat(e.timestamp()-f," ms")),g},e.getDefaultLikeExportInfo=a;}(t),function(e){e.createClassifier=function(){var o=e.createScanner(99,!1);function s(i,s,c){var l=0,u=0,_=[],d=function(t){switch(t){case 3:return {prefix:'"\\\n'};case 2:return {prefix:"'\\\n"};case 1:return {prefix:"/*\n"};case 4:return {prefix:"`\n"};case 5:return {prefix:"}\n",pushTemplate:!0};case 6:return {prefix:"",pushTemplate:!0};case 0:return {prefix:""};default:return e.Debug.assertNever(t)}}(s),p=d.prefix,f=d.pushTemplate;i=p+i;var g=p.length;f&&_.push(15),o.setText(i);var m=0,y=[],v=0;do{l=o.scan(),e.isTrivia(l)||(x(),u=l);var h=o.getTextPos();if(n(o.getTokenPos(),h,g,a(l),y),h>=i.length){var b=r(o,l,e.lastOrUndefined(_));void 0!==b&&(m=b);}}while(1!==l);function x(){switch(l){case 43:case 68:t[u]||13!==o.reScanSlashToken()||(l=13);break;case 29:79===u&&v++;break;case 31:v>0&&v--;break;case 130:case 149:case 146:case 133:case 150:v>0&&!c&&(l=79);break;case 15:_.push(l);break;case 18:_.length>0&&_.push(l);break;case 19:if(_.length>0){var r=e.lastOrUndefined(_);15===r?17===(l=o.reScanTemplateToken(!1))?_.pop():e.Debug.assertEqual(l,16,"Should have been a template middle."):(e.Debug.assertEqual(r,18,"Should have been an open brace"),_.pop());}break;default:if(!e.isKeyword(l))break;(24===u||e.isKeyword(u)&&e.isKeyword(l)&&!function(t,r){if(!e.isAccessibilityModifier(t))return !0;switch(r){case 136:case 148:case 134:case 124:return !0;default:return !1}}(u,l))&&(l=79);}}return {endOfLineState:m,spans:y}}return {getClassificationsForLine:function(t,r,n){return function(t,r){for(var n=[],a=t.spans,o=0,s=0;s<a.length;s+=3){var c=a[s],l=a[s+1],u=a[s+2];if(o>=0){var _=c-o;_>0&&n.push({length:_,classification:e.TokenClass.Whitespace});}n.push({length:l,classification:i(u)}),o=c+l;}var d=r.length-o;return d>0&&n.push({length:d,classification:e.TokenClass.Whitespace}),{entries:n,finalLexState:t.endOfLineState}}(s(t,r,n),t)},getEncodedLexicalClassifications:s}};var t=e.arrayToNumericMap([79,10,8,9,13,108,45,46,21,23,19,110,95],(function(e){return e}),(function(){return !0}));function r(t,r,n){switch(r){case 10:if(!t.isUnterminated())return;for(var i=t.getTokenText(),a=i.length-1,o=0;92===i.charCodeAt(a-o);)o++;if(0==(1&o))return;return 34===i.charCodeAt(0)?3:2;case 3:return t.isUnterminated()?1:void 0;default:if(e.isTemplateLiteralKind(r)){if(!t.isUnterminated())return;switch(r){case 17:return 5;case 14:return 4;default:return e.Debug.fail("Only 'NoSubstitutionTemplateLiteral's and 'TemplateTail's can be unterminated; got SyntaxKind #"+r)}}return 15===n?6:void 0}}function n(e,t,r,n,i){if(8!==n){0===e&&r>0&&(e+=r);var a=t-e;a>0&&i.push(e-r,a,n);}}function i(t){switch(t){case 1:return e.TokenClass.Comment;case 3:return e.TokenClass.Keyword;case 4:return e.TokenClass.NumberLiteral;case 25:return e.TokenClass.BigIntLiteral;case 5:return e.TokenClass.Operator;case 6:return e.TokenClass.StringLiteral;case 8:return e.TokenClass.Whitespace;case 10:return e.TokenClass.Punctuation;case 2:case 11:case 12:case 13:case 14:case 15:case 16:case 9:case 17:return e.TokenClass.Identifier;default:return}}function a(t){if(e.isKeyword(t))return 3;if(function(e){switch(e){case 41:case 43:case 44:case 39:case 40:case 47:case 48:case 49:case 29:case 31:case 32:case 33:case 102:case 101:case 127:case 34:case 35:case 36:case 37:case 50:case 52:case 51:case 55:case 56:case 74:case 73:case 78:case 70:case 71:case 72:case 64:case 65:case 66:case 68:case 69:case 63:case 27:case 60:case 75:case 76:case 77:return !0;default:return !1}}(t)||function(e){switch(e){case 39:case 40:case 54:case 53:case 45:case 46:return !0;default:return !1}}(t))return 5;if(t>=18&&t<=78)return 10;switch(t){case 8:return 4;case 9:return 25;case 10:return 6;case 13:return 7;case 7:case 3:case 2:return 1;case 5:case 4:return 8;case 79:default:return e.isTemplateLiteralKind(t)?6:2}}function o(e,t){switch(t){case 260:case 256:case 257:case 255:case 225:case 212:case 213:e.throwIfCancellationRequested();}}function s(t,r,n,i,a){var s=[];return n.forEachChild((function l(u){if(u&&e.textSpanIntersectsWith(a,u.pos,u.getFullWidth())){if(o(r,u.kind),e.isIdentifier(u)&&!e.nodeIsMissing(u)&&i.has(u.escapedText)){var _=t.getSymbolAtLocation(u),d=_&&c(_,e.getMeaningFromLocation(u),t);d&&function(t,r,n){var i=r-t;e.Debug.assert(i>0,"Classification had non-positive length of ".concat(i)),s.push(t),s.push(i),s.push(n);}(u.getStart(n),u.getEnd(),d);}u.forEachChild(l);}})),{spans:s,endOfLineState:0}}function c(t,r,n){var i=t.getFlags();return 0==(2885600&i)?void 0:32&i?11:384&i?12:524288&i?16:1536&i?4&r||1&r&&function(t){return e.some(t.declarations,(function(t){return e.isModuleDeclaration(t)&&1===e.getModuleInstanceState(t)}))}(t)?14:void 0:2097152&i?c(n.getAliasedSymbol(t),r,n):2&r?64&i?13:262144&i?15:void 0:void 0}function l(e){switch(e){case 1:return "comment";case 2:return "identifier";case 3:return "keyword";case 4:return "number";case 25:return "bigint";case 5:return "operator";case 6:return "string";case 8:return "whitespace";case 9:return "text";case 10:return "punctuation";case 11:return "class name";case 12:return "enum name";case 13:return "interface name";case 14:return "module name";case 15:return "type parameter name";case 16:return "type alias name";case 17:return "parameter name";case 18:return "doc comment tag name";case 19:return "jsx open tag name";case 20:return "jsx close tag name";case 21:return "jsx self closing tag name";case 22:return "jsx attribute";case 23:return "jsx text";case 24:return "jsx attribute string literal value";default:return}}function u(t){e.Debug.assert(t.spans.length%3==0);for(var r=t.spans,n=[],i=0;i<r.length;i+=3)n.push({textSpan:e.createTextSpan(r[i],r[i+1]),classificationType:l(r[i+2])});return n}function _(t,r,n){var i=n.start,a=n.length,s=e.createScanner(99,!1,r.languageVariant,r.text),c=e.createScanner(99,!1,r.languageVariant,r.text),l=[];return v(r),{spans:l,endOfLineState:0};function u(e,t,r){l.push(e),l.push(t),l.push(r);}function _(t,n,i,a){if(3===n){var o=e.parseIsolatedJSDocComment(r.text,i,a);if(o&&o.jsDoc)return e.setParent(o.jsDoc,t),void function(e){var t,r,n,i,a,o,s,c=e.pos;if(e.tags)for(var l=0,_=e.tags;l<_.length;l++){var f=_[l];f.pos!==c&&d(c,f.pos-c),u(f.pos,1,10),u(f.tagName.pos,f.tagName.end-f.tagName.pos,18),c=f.tagName.end;var g=f.tagName.end;switch(f.kind){case 338:var m=f;b(m),g=m.isNameFirst&&(null===(t=m.typeExpression)||void 0===t?void 0:t.end)||m.name.end;break;case 345:var y=f;g=y.isNameFirst&&(null===(r=y.typeExpression)||void 0===r?void 0:r.end)||y.name.end;break;case 342:p(f),c=f.end,g=f.typeParameters.end;break;case 343:var h=f;g=307===(null===(n=h.typeExpression)||void 0===n?void 0:n.kind)&&(null===(i=h.fullName)||void 0===i?void 0:i.end)||(null===(a=h.typeExpression)||void 0===a?void 0:a.end)||g;break;case 336:g=f.typeExpression.end;break;case 341:v(f.typeExpression),c=f.end,g=f.typeExpression.end;break;case 340:case 337:g=f.typeExpression.end;break;case 339:v(f.typeExpression),c=f.end,g=(null===(o=f.typeExpression)||void 0===o?void 0:o.end)||g;break;case 344:g=(null===(s=f.name)||void 0===s?void 0:s.end)||g;break;case 326:case 327:g=f.class.end;}"object"==typeof f.comment?d(f.comment.pos,f.comment.end-f.comment.pos):"string"==typeof f.comment&&d(g,f.end-g);}return void(c!==e.end&&d(c,e.end-c));function b(e){e.isNameFirst&&(d(c,e.name.pos-c),u(e.name.pos,e.name.end-e.name.pos,17),c=e.name.end),e.typeExpression&&(d(c,e.typeExpression.pos-c),v(e.typeExpression),c=e.typeExpression.end),e.isNameFirst||(d(c,e.name.pos-c),u(e.name.pos,e.name.end-e.name.pos,17),c=e.name.end);}}(o.jsDoc)}else if(2===n&&function(t,n){var i=/(\s)(\S+)(\s*)(=)(\s*)('[^']+'|"[^"]+")/gim,a=r.text.substr(t,n),o=/^(\/\/\/\s*)(<)(?:(\S+)((?:[^/]|\/[^>])*)(\/>)?)?/im.exec(a);if(!o)return !1;if(!o[3]||!(o[3]in e.commentPragmas))return !1;var s=t;d(s,o[1].length),u(s+=o[1].length,o[2].length,10),u(s+=o[2].length,o[3].length,21),s+=o[3].length;for(var c=o[4],l=s;;){var _=i.exec(c);if(!_)break;var p=s+_.index+_[1].length;p>l&&(d(l,p-l),l=p),u(l,_[2].length,22),l+=_[2].length,_[3].length&&(d(l,_[3].length),l+=_[3].length),u(l,_[4].length,5),l+=_[4].length,_[5].length&&(d(l,_[5].length),l+=_[5].length),u(l,_[6].length,24),l+=_[6].length;}(s+=o[4].length)>l&&d(l,s-l),o[5]&&(u(s,o[5].length,10),s+=o[5].length);var f=t+n;return s<f&&d(s,f-s),!0}(i,a))return;d(i,a);}function d(e,t){u(e,t,1);}function p(e){for(var t=0,r=e.getChildren();t<r.length;t++)v(r[t]);}function f(t,r,n){var i;for(i=r;i<n&&!e.isLineBreak(t.charCodeAt(i));i++);for(u(r,i-r,1),c.setTextPos(i);c.getTextPos()<n;)g();}function g(){var e=c.getTextPos(),t=c.scan(),r=c.getTextPos(),n=y(t);n&&u(e,r-e,n);}function m(t){if(e.isJSDoc(t))return !0;if(e.nodeIsMissing(t))return !0;var n=function(e){switch(e.parent&&e.parent.kind){case 279:if(e.parent.tagName===e)return 19;break;case 280:if(e.parent.tagName===e)return 20;break;case 278:if(e.parent.tagName===e)return 21;break;case 284:if(e.parent.name===e)return 22}}(t);if(!e.isToken(t)&&11!==t.kind&&void 0===n)return !1;var i=11===t.kind?t.pos:function(t){for(s.setTextPos(t.pos);;){var n=s.getTextPos();if(!e.couldStartTrivia(r.text,n))return n;var i=s.scan(),a=s.getTextPos(),o=a-n;if(!e.isTrivia(i))return n;switch(i){case 4:case 5:continue;case 2:case 3:_(t,i,n,o),s.setTextPos(a);continue;case 7:var c=r.text,l=c.charCodeAt(n);if(60===l||62===l){u(n,o,1);continue}e.Debug.assert(124===l||61===l),f(c,n,a);break;case 6:break;default:e.Debug.assertNever(i);}}}(t),a=t.end-i;if(e.Debug.assert(a>=0),a>0){var o=n||y(t.kind,t);o&&u(i,a,o);}return !0}function y(t,r){if(e.isKeyword(t))return 3;if((29===t||31===t)&&r&&e.getTypeArgumentOrTypeParameterList(r.parent))return 10;if(e.isPunctuation(t)){if(r){var n=r.parent;if(63===t&&(253===n.kind||166===n.kind||163===n.kind||284===n.kind))return 5;if(220===n.kind||218===n.kind||219===n.kind||221===n.kind)return 5}return 10}if(8===t)return 4;if(9===t)return 25;if(10===t)return r&&284===r.parent.kind?24:6;if(13===t)return 6;if(e.isTemplateLiteralKind(t))return 6;if(11===t)return 23;if(79===t){if(r)switch(r.parent.kind){case 256:return r.parent.name===r?11:void 0;case 162:return r.parent.name===r?15:void 0;case 257:return r.parent.name===r?13:void 0;case 259:return r.parent.name===r?12:void 0;case 260:return r.parent.name===r?14:void 0;case 163:return r.parent.name===r?e.isThisIdentifier(r)?3:17:void 0}return 2}}function v(n){if(n&&e.decodedTextSpanIntersectsWith(i,a,n.pos,n.getFullWidth())){o(t,n.kind);for(var s=0,c=n.getChildren(r);s<c.length;s++){var l=c[s];m(l)||v(l);}}}}e.getSemanticClassifications=function(e,t,r,n,i){return u(s(e,t,r,n,i))},e.getEncodedSemanticClassifications=s,e.getSyntacticClassifications=function(e,t,r){return u(_(e,t,r))},e.getEncodedSyntacticClassifications=_;}(t),function(e){var t;(function(t){function r(e,t,r,i){return {spans:n(e,r,i,t),endOfLineState:0}}function n(t,r,n,o){var s=[];return t&&r&&function(t,r,n,o,s){var c=t.getTypeChecker(),u=!1;!function _(d){switch(d.kind){case 260:case 256:case 257:case 255:case 225:case 212:case 213:s.throwIfCancellationRequested();}if(d&&e.textSpanIntersectsWith(n,d.pos,d.getFullWidth())&&0!==d.getFullWidth()){var p=u;if((e.isJsxElement(d)||e.isJsxSelfClosingElement(d))&&(u=!0),e.isJsxExpression(d)&&(u=!1),e.isIdentifier(d)&&!u&&!function(t){var r=t.parent;return r&&(e.isImportClause(r)||e.isImportSpecifier(r)||e.isNamespaceImport(r))}(d)&&!e.isInfinityOrNaNString(d.escapedText)){var f=c.getSymbolAtLocation(d);if(f){2097152&f.flags&&(f=c.getAliasedSymbol(f));var g=function(t,r){var n=t.getFlags();if(32&n)return 0;if(384&n)return 1;if(524288&n)return 5;if(64&n){if(2&r)return 2}else if(262144&n)return 4;var a=t.valueDeclaration||t.declarations&&t.declarations[0];return a&&e.isBindingElement(a)&&(a=i(a)),a&&l.get(a.kind)}(f,e.getMeaningFromLocation(d));if(void 0!==g){var m=0;d.parent&&(e.isBindingElement(d.parent)||l.get(d.parent.kind)===g)&&d.parent.name===d&&(m=1),6===g&&a(d)&&(g=9),g=function(t,r,n){if(7===n||9===n||6===n){var i=t.getTypeAtLocation(r);if(i){var o=function(e){return e(i)||i.isUnion()&&i.types.some(e)};if(6!==n&&o((function(e){return e.getConstructSignatures().length>0})))return 0;if(o((function(e){return e.getCallSignatures().length>0}))&&!o((function(e){return e.getProperties().length>0}))||function(t){for(;a(t);)t=t.parent;return e.isCallExpression(t.parent)&&t.parent.expression===t}(r))return 9===n?11:10}}return n}(c,d,g);var y=f.valueDeclaration;if(y){var v=e.getCombinedModifierFlags(y),h=e.getCombinedNodeFlags(y);32&v&&(m|=2),256&v&&(m|=4),0!==g&&2!==g&&(64&v||2&h||8&f.getFlags())&&(m|=8),7!==g&&10!==g||!function(t,r){return e.isBindingElement(t)&&(t=i(t)),e.isVariableDeclaration(t)?(!e.isSourceFile(t.parent.parent.parent)||e.isCatchClause(t.parent))&&t.getSourceFile()===r:!!e.isFunctionDeclaration(t)&&!e.isSourceFile(t.parent)&&t.getSourceFile()===r}(y,r)||(m|=32),t.isSourceFileDefaultLibrary(y.getSourceFile())&&(m|=16);}else f.declarations&&f.declarations.some((function(e){return t.isSourceFileDefaultLibrary(e.getSourceFile())}))&&(m|=16);o(d,g,m);}}}e.forEachChild(d,_),u=p;}}(r);}(t,r,n,(function(e,t,n){s.push(e.getStart(r),e.getWidth(r),(t+1<<8)+n);}),o),s}function i(t){for(;;){if(!e.isBindingElement(t.parent.parent))return t.parent.parent;t=t.parent.parent;}}function a(t){return e.isQualifiedName(t.parent)&&t.parent.right===t||e.isPropertyAccessExpression(t.parent)&&t.parent.name===t}var o,s,c;(c=t.TokenEncodingConsts||(t.TokenEncodingConsts={}))[c.typeOffset=8]="typeOffset",c[c.modifierMask=255]="modifierMask",(s=t.TokenType||(t.TokenType={}))[s.class=0]="class",s[s.enum=1]="enum",s[s.interface=2]="interface",s[s.namespace=3]="namespace",s[s.typeParameter=4]="typeParameter",s[s.type=5]="type",s[s.parameter=6]="parameter",s[s.variable=7]="variable",s[s.enumMember=8]="enumMember",s[s.property=9]="property",s[s.function=10]="function",s[s.member=11]="member",(o=t.TokenModifier||(t.TokenModifier={}))[o.declaration=0]="declaration",o[o.static=1]="static",o[o.async=2]="async",o[o.readonly=3]="readonly",o[o.defaultLibrary=4]="defaultLibrary",o[o.local=5]="local",t.getSemanticClassifications=function(t,n,i,a){var o=r(t,n,i,a);e.Debug.assert(o.spans.length%3==0);for(var s=o.spans,c=[],l=0;l<s.length;l+=3)c.push({textSpan:e.createTextSpan(s[l],s[l+1]),classificationType:s[l+2]});return c},t.getEncodedSemanticClassifications=r;var l=new e.Map([[253,7],[163,6],[166,9],[260,3],[259,1],[297,8],[256,0],[168,11],[255,10],[212,10],[167,11],[171,9],[172,9],[165,9],[257,2],[258,5],[162,4],[294,9],[295,9]]);})((t=e.classifier||(e.classifier={})).v2020||(t.v2020={}));}(t),function(e){var t;(function(r){function i(e){return {isGlobalCompletion:!1,isMemberCompletion:!1,isNewIdentifierLocation:!0,entries:e.map((function(e){var r=e.name,n=e.kind,i=e.span;return {name:r,kind:n,kindModifiers:a(e.extension),sortText:t.SortText.LocationPriority,replacementSpan:i}}))}}function a(t){switch(t){case".d.ts":return ".d.ts";case".js":return ".js";case".json":return ".json";case".jsx":return ".jsx";case".ts":return ".ts";case".tsx":return ".tsx";case".d.mts":return ".d.mts";case".mjs":return ".mjs";case".mts":return ".mts";case".d.cts":return ".d.cts";case".cjs":return ".cjs";case".cts":return ".cts";case".tsbuildinfo":return e.Debug.fail("Extension ".concat(".tsbuildinfo"," is unsupported."));case void 0:return "";default:return e.Debug.assertNever(t)}}var o,s;function c(r,n,i,a,o,s,c){var d,p,f=l(n.parent);switch(f.kind){case 195:var m=l(f.parent);switch(m.kind){case 177:var y=m,v=e.findAncestor(f,(function(e){return e.parent===y}));return v?{kind:2,types:_(a.getTypeArgumentConstraint(v)),isNewIdentifier:!1}:void 0;case 193:var h=m,b=h.indexType,x=h.objectType;if(!e.rangeContainsPosition(b,i))return;return u(a.getTypeFromTypeNode(x));case 199:return {kind:0,paths:g(r,n,o,s,a,c)};case 186:if(!e.isTypeReferenceNode(m.parent))return;var D=(d=m,p=f,e.mapDefined(d.types,(function(t){return t!==p&&e.isLiteralTypeNode(t)&&e.isStringLiteral(t.literal)?t.literal.text:void 0})));return {kind:2,types:_(a.getTypeArgumentConstraint(m)).filter((function(t){return !e.contains(D,t.value)})),isNewIdentifier:!1};default:return}case 294:return e.isObjectLiteralExpression(f.parent)&&f.name===n?function(r,n){var i=r.getContextualType(n);if(i){var a=r.getContextualType(n,4);return {kind:1,symbols:t.getPropertiesForObjectExpression(i,a,n,r),hasIndexSignature:e.hasIndexSignature(i)}}}(a,f.parent):k();case 206:var S=f,T=S.expression,C=S.argumentExpression;return n===e.skipParentheses(C)?u(a.getTypeAtLocation(T)):void 0;case 207:case 208:if(!function(t){return e.isCallExpression(t.parent)&&e.firstOrUndefined(t.parent.arguments)===t&&e.isIdentifier(t.parent.expression)&&"require"===t.parent.expression.escapedText}(n)&&!e.isImportCall(f)){var E=e.SignatureHelp.getArgumentInfoForCompletions(n,i,r);return E?function(t,r){var n=!1,i=new e.Map,a=[];return r.getResolvedSignature(t.invocation,a,t.argumentCount),{kind:2,types:e.flatMap(a,(function(a){if(e.signatureHasRestParameter(a)||!(t.argumentCount>a.parameters.length)){var o=r.getParameterType(a,t.argumentIndex);return n=n||!!(4&o.flags),_(o,i)}})),isNewIdentifier:n}}(E,a):k()}case 265:case 271:case 276:return {kind:0,paths:g(r,n,o,s,a,c)};default:return k()}function k(){return {kind:2,types:_(e.getContextualTypeFromParent(n,a)),isNewIdentifier:!1}}}function l(t){switch(t.kind){case 190:return e.walkUpParenthesizedTypes(t);case 211:return e.walkUpParenthesizedExpressions(t);default:return t}}function u(t){return t&&{kind:1,symbols:e.filter(t.getApparentProperties(),(function(t){return !(t.valueDeclaration&&e.isPrivateIdentifierClassElementDeclaration(t.valueDeclaration))})),hasIndexSignature:e.hasIndexSignature(t)}}function _(t,r){return void 0===r&&(r=new e.Map),t?(t=e.skipConstraint(t)).isUnion()?e.flatMap(t.types,(function(e){return _(e,r)})):!t.isStringLiteral()||1024&t.flags||!e.addToSeen(r,t.value)?e.emptyArray:[t]:e.emptyArray}function d(e,t,r){return {name:e,kind:t,extension:r}}function p(e){return d(e,"directory",void 0)}function f(t,r,n){var i=function(t,r){var n=Math.max(t.lastIndexOf(e.directorySeparator),t.lastIndexOf(e.altDirectorySeparator)),i=-1!==n?n+1:0,a=t.length-i;return 0===a||e.isIdentifierText(t.substr(i,a),99)?void 0:e.createTextSpan(r+i,a)}(t,r),a=0===t.length?void 0:e.createTextSpan(r,t.length);return n.map((function(t){var r=t.name,n=t.kind,o=t.extension;return -1!==Math.max(r.indexOf(e.directorySeparator),r.indexOf(e.altDirectorySeparator))?{name:r,kind:n,extension:o,span:a}:{name:r,kind:n,extension:o,span:i}}))}function g(t,r,i,a,o,s){return f(r.text,r.getStart(t)+1,function(t,r,i,a,o,s){var c,l=e.normalizeSlashes(r.text),u=t.path,_=e.getDirectoryPath(u);return function(e){if(e&&e.length>=2&&46===e.charCodeAt(0)){var t=e.length>=3&&46===e.charCodeAt(1)?2:1,r=e.charCodeAt(t);return 47===r||92===r}return !1}(l)||!i.baseUrl&&(e.isRootedDiskPath(l)||e.isUrl(l))?function(t,r,i,a,o,s){var c=m(i,s);return i.rootDirs?function(t,r,i,a,o,s,c){var l=function(t,r,i,a){t=t.map((function(t){return e.normalizePath(e.isRootedDiskPath(t)?t:e.combinePaths(r,t))}));var o=e.firstDefined(t,(function(t){return e.containsPath(t,i,r,a)?i.substr(t.length):void 0}));return e.deduplicate(n$3(n$3([],t.map((function(t){return e.combinePaths(t,o)})),!0),[i],!1),e.equateStringsCaseSensitive,e.compareStringsCaseSensitive)}(t,o.project||s.getCurrentDirectory(),i,!(s.useCaseSensitiveFileNames&&s.useCaseSensitiveFileNames()));return e.flatMap(l,(function(e){return v(r,e,a,s,c)}))}(i.rootDirs,t,r,c,i,a,o):v(t,r,c,a,o)}(l,_,i,a,u,(c=e.isStringLiteralLike(r)?e.getModeForUsageLocation(t,r):void 0,"js"===s.importModuleSpecifierEnding||c===e.ModuleKind.ESNext?2:0)):function(t,r,n,i,a){var o=n.baseUrl,s=n.paths,c=[],l=m(n);if(o){var u=n.project||i.getCurrentDirectory(),_=e.normalizePath(e.combinePaths(u,o));v(t,_,l,i,void 0,c),s&&h(c,t,_,l.extensions,s,i);}for(var p=b(t),f=0,g=function(t,r,n){var i=n.getAmbientModules().map((function(t){return e.stripQuotes(t.name)})).filter((function(r){return e.startsWith(r,t)}));if(void 0!==r){var a=e.ensureTrailingDirectorySeparator(r);return i.map((function(t){return e.removePrefix(t,a)}))}return i}(t,p,a);f<g.length;f++){var y=g[f];c.push(d(y,"external module name",void 0));}if(D(i,n,r,p,l,c),e.getEmitModuleResolutionKind(n)===e.ModuleResolutionKind.NodeJs){var x=!1;if(void 0===p)for(var S=function(e){c.some((function(t){return t.name===e}))||(x=!0,c.push(d(e,"external module name",void 0)));},C=0,E=function(t,r){if(!t.readFile||!t.fileExists)return e.emptyArray;for(var n=[],i=0,a=e.findPackageJsons(r,t);i<a.length;i++)for(var o=a[i],s=e.readJson(o,t),c=0,l=T;c<l.length;c++){var u=s[l[c]];if(u)for(var _ in u)u.hasOwnProperty(_)&&!e.startsWith(_,"@types/")&&n.push(_);}return n}(i,r);C<E.length;C++)S(E[C]);x||e.forEachAncestorDirectory(r,(function(r){var n=e.combinePaths(r,"node_modules");e.tryDirectoryExists(i,n)&&v(t,n,l,i,void 0,c);}));}return c}(l,_,i,a,o)}(t,r,i,a,o,s))}function m(t,r){return void 0===r&&(r=0),{extensions:e.flatten(y(t)),includeExtensionsOption:r}}function y(t){var r=e.getSupportedExtensions(t);return e.getEmitModuleResolutionKind(t)===e.ModuleResolutionKind.NodeJs?e.getSupportedExtensionsWithJsonIfResolveJsonModule(t,r):r}function v(t,r,n,i,a,o){var s=n.extensions,c=n.includeExtensionsOption;void 0===o&&(o=[]),void 0===t&&(t=""),t=e.normalizeSlashes(t),e.hasTrailingDirectorySeparator(t)||(t=e.getDirectoryPath(t)),""===t&&(t="."+e.directorySeparator),t=e.ensureTrailingDirectorySeparator(t);var l=e.resolvePath(r,t),u=e.hasTrailingDirectorySeparator(l)?l:e.getDirectoryPath(l),_=!(i.useCaseSensitiveFileNames&&i.useCaseSensitiveFileNames());if(!e.tryDirectoryExists(i,u))return o;var f=e.tryReadDirectory(i,u,s,void 0,["./*"]);if(f){for(var g=new e.Map,m=0,y=f;m<y.length;m++){var v=y[m];if(v=e.normalizePath(v),!a||0!==e.comparePaths(v,a,r,_)){var b=void 0,x=e.moduleSpecifiers.tryGetJSExtensionForFile(v,i.getCompilationSettings());0!==c||e.fileExtensionIsOneOf(v,[".json",".mts",".cts",".d.mts",".d.cts",".mjs",".cjs"])?(e.fileExtensionIsOneOf(v,[".mts",".cts",".d.mts",".d.cts",".mjs",".cjs"])||2===c)&&x?(b=e.changeExtension(e.getBaseFileName(v),x),g.set(b,x)):(b=e.getBaseFileName(v),g.set(b,e.tryGetExtensionFromPath(v))):(b=e.removeFileExtension(e.getBaseFileName(v)),g.set(b,e.tryGetExtensionFromPath(v)));}}g.forEach((function(e,t){o.push(d(t,"script",e));}));}var D=e.tryGetDirectories(i,u);if(D)for(var S=0,T=D;S<T.length;S++){var C=T[S],E=e.getBaseFileName(e.normalizePath(C));"@types"!==E&&o.push(p(E));}var k=e.findPackageJson(u,i);if(k){var N=e.readJson(k,i).typesVersions;if("object"==typeof N){var F=e.getPackageJsonTypesVersionsPaths(N),A=F&&F.paths,P=l.slice(e.ensureTrailingDirectorySeparator(u).length);A&&h(o,P,u,s,A,i);}}return o}function h(t,r,n,i,a,o){for(var s in a)if(e.hasProperty(a,s)){var c=a[s];if(c)for(var l=function(e,r,n){t.some((function(t){return t.name===e}))||t.push(d(e,r,n));},u=0,_=x(s,c,r,n,i,o);u<_.length;u++){var p=_[u];l(p.name,p.kind,p.extension);}}}function b(t){return C(t)?e.hasTrailingDirectorySeparator(t)?t:e.getDirectoryPath(t):void 0}function x(t,r,i,a,o,s){if(!e.endsWith(t,"*"))return e.stringContains(t,"*")?e.emptyArray:u(t);var c=t.slice(0,t.length-1),l=e.tryRemovePrefix(i,c);return void 0===l?u(c):e.flatMap(r,(function(t){return function(t,r,i,a,o){if(o.readDirectory){var s=e.tryParsePattern(i);if(void 0!==s&&!e.isString(s)){var c=e.resolvePath(s.prefix),l=e.hasTrailingDirectorySeparator(s.prefix)?c:e.getDirectoryPath(c),u=e.hasTrailingDirectorySeparator(s.prefix)?"":e.getBaseFileName(c),_=C(t),f=_?e.hasTrailingDirectorySeparator(t)?t:e.getDirectoryPath(t):void 0,g=_?e.combinePaths(l,u+f):l,m=e.normalizePath(s.suffix),y=e.normalizePath(e.combinePaths(r,g)),v=_?y:e.ensureTrailingDirectorySeparator(y)+u,h=m?"**/*":"./*",b=e.mapDefined(e.tryReadDirectory(o,y,a,void 0,[h]),(function(t){var r=e.tryGetExtensionFromPath(t),n=D(t);return void 0===n?void 0:d(e.removeFileExtension(n),"script",r)})),x=e.mapDefined(e.tryGetDirectories(o,y).map((function(t){return e.combinePaths(y,t)})),(function(e){var t=D(e);return void 0===t?void 0:p(t)}));return n$3(n$3([],b,!0),x,!0)}}function D(t){var r,n,i,a=(r=e.normalizePath(t),n=v,i=m,e.startsWith(r,n)&&e.endsWith(r,i)?r.slice(n.length,r.length-i.length):void 0);return void 0===a?void 0:function(t){return t[0]===e.directorySeparator?t.slice(1):t}(a)}}(l,a,t,o,s)}));function u(t){return e.startsWith(t,i)?[p(t)]:e.emptyArray}}function D(t,r,n,i,a,o){void 0===o&&(o=[]);for(var s=new e.Map,c=0,l=e.tryAndIgnoreErrors((function(){return e.getEffectiveTypeRoots(r,t)}))||e.emptyArray;c<l.length;c++)f(l[c]);for(var u=0,_=e.findPackageJsons(n,t);u<_.length;u++){var p=_[u];f(e.combinePaths(e.getDirectoryPath(p),"node_modules/@types"));}return o;function f(n){if(e.tryDirectoryExists(t,n))for(var c=0,l=e.tryGetDirectories(t,n);c<l.length;c++){var u=l[c],_=e.unmangleScopedPackageName(u);if(!r.types||e.contains(r.types,_))if(void 0===i)s.has(_)||(o.push(d(_,"external module name",void 0)),s.set(_,!0));else {var p=e.combinePaths(n,u),f=e.tryRemoveDirectoryPrefix(i,_,e.hostGetCanonicalFileName(t));void 0!==f&&v(f,p,a,t,void 0,o);}}}}r.getStringLiteralCompletions=function(r,n,a,o,s,l,u,_){if(e.isInReferenceComment(r,n))return (d=function(t,r,n,i){var a=e.getTokenAtPosition(t,r),o=e.getLeadingCommentRanges(t.text,a.pos),s=o&&e.find(o,(function(e){return r>=e.pos&&r<=e.end}));if(s){var c=t.text.slice(s.pos,r),l=S.exec(c);if(l){var u=l[1],_=l[2],d=l[3],p=e.getDirectoryPath(t.path),g="path"===_?v(d,p,m(n,1),i,t.path):"types"===_?D(i,n,p,b(d),m(n)):e.Debug.fail();return f(d,s.pos+u.length,g)}}}(r,n,o,s))&&i(d);if(e.isInString(r,n,a)){if(!a||!e.isStringLiteralLike(a))return;var d;return function(r,n,a,o,s,c,l,u){if(void 0!==r){var _=e.createTextSpanFromStringLiteralLikeContent(n);switch(r.kind){case 0:return i(r.paths);case 1:var d=[];return t.getCompletionEntriesFromSymbols(r.symbols,d,n,n,a,a,o,s,99,c,4,u,l),{isGlobalCompletion:!1,isMemberCompletion:!0,isNewIdentifierLocation:r.hasIndexSignature,optionalReplacementSpan:_,entries:d};case 2:return d=r.types.map((function(r){return {name:r.value,kindModifiers:"",kind:"string",sortText:t.SortText.LocationPriority,replacementSpan:e.getReplacementSpanForContextToken(n)}})),{isGlobalCompletion:!1,isMemberCompletion:!1,isNewIdentifierLocation:r.isNewIdentifier,optionalReplacementSpan:_,entries:d};default:return e.Debug.assertNever(r)}}}(d=c(r,a,n,l.getTypeChecker(),o,s,_),a,r,s,l,u,o,_)}},r.getStringLiteralCompletionDetails=function(r,n,i,o,s,l,u,_,d){if(o&&e.isStringLiteralLike(o)){var p=c(n,o,i,s,l,u,d);return p&&function(r,n,i,o,s,c){switch(i.kind){case 0:return (l=e.find(i.paths,(function(e){return e.name===r})))&&t.createCompletionDetails(r,a(l.extension),l.kind,[e.textPart(r)]);case 1:var l;return (l=e.find(i.symbols,(function(e){return e.name===r})))&&t.createCompletionDetailsForSymbol(l,s,o,n,c);case 2:return e.find(i.types,(function(e){return e.value===r}))?t.createCompletionDetails(r,"","type",[e.textPart(r)]):void 0;default:return e.Debug.assertNever(i)}}(r,o,p,n,s,_)}},function(e){e[e.Paths=0]="Paths",e[e.Properties=1]="Properties",e[e.Types=2]="Types";}(o||(o={})),function(e){e[e.Exclude=0]="Exclude",e[e.Include=1]="Include",e[e.ModuleSpecifierCompletion=2]="ModuleSpecifierCompletion";}(s||(s={}));var S=/^(\/\/\/\s*<reference\s+(path|types)\s*=\s*(?:'|"))([^\3"]*)$/,T=["dependencies","devDependencies","peerDependencies","optionalDependencies"];function C(t){return e.stringContains(t,e.directorySeparator)}})((t=e.Completions||(e.Completions={})).StringCompletions||(t.StringCompletions={}));}(t),function(e){!function(t){var r,n,a,o,s,c,l,u;function _(e){return !!(e&&4&e.kind)}function d(e){return !(!e||32!==e.kind)}function p(e){return (_(e)||d(e))&&!!e.isFromPackageJson}function f(r,n,i,a,o,s,c){var l,u,_,d=e.timestamp(),p=!1,f=0,g=0,m=0,y=0,v=c({tryResolve:function(r,c){if(c){var l=e.codefix.getModuleSpecifierForBestExportInfo(r,a,i,n,o);return l&&f++,l}var u=s||o.allowIncompleteCompletions&&g<t.moduleSpecifierResolutionLimit,_=!u&&o.allowIncompleteCompletions&&y<t.moduleSpecifierResolutionCacheAttemptLimit,d=u||_?e.codefix.getModuleSpecifierForBestExportInfo(r,a,i,n,o,_):void 0;return (!u&&!_||_&&!d)&&(p=!0),g+=(null==d?void 0:d.computedWithoutCacheCount)||0,m+=r.length-g,_&&y++,d},resolutionLimitExceeded:function(){return p}}),h=y?" (".concat((m/y*100).toFixed(1),"% hit rate)"):"";return null===(l=n.log)||void 0===l||l.call(n,"".concat(r,": resolved ").concat(g," module specifiers, plus ").concat(f," ambient and ").concat(m," from cache").concat(h)),null===(u=n.log)||void 0===u||u.call(n,"".concat(r,": response is ").concat(p?"incomplete":"complete")),null===(_=n.log)||void 0===_||_.call(n,"".concat(r,": ").concat(e.timestamp()-d)),v}function g(e){return !!(null==e?void 0:e.moduleSpecifier)}function m(e){return {isGlobalCompletion:!1,isMemberCompletion:!1,isNewIdentifierLocation:!1,entries:e}}function y(e,t,r){return {kind:4,keywordCompletions:K(e,t),isNewIdentifierLocation:r}}function v(t){return 79===(null==t?void 0:t.kind)?e.createTextSpanFromNode(t):void 0}function h(t,r){return e.isSourceFileJS(t)&&!e.isCheckJsEnabledForFile(t,r)}function b(e){switch(e){case 0:case 3:case 2:return !0;default:return !1}}function x(t,r,n){return "object"==typeof n?e.pseudoBigIntToString(n)+"n":e.isString(n)?e.quote(t,r,n):JSON.stringify(n)}function D(e,t,n){return {name:x(e,t,n),kind:"string",kindModifiers:"",sortText:r.LocationPriority}}function S(t,r,n,i,o,s,c,l,u,f,g,m,y,v,h,b,x,D,S){var C,k,P,w,I,O,M,L=e.getReplacementSpanForContextToken(n),R=A(g),B=l.getTypeChecker(),j=g&&function(e){return !!(16&e.kind)}(g),J=g&&function(e){return !!(2&e.kind)}(g)||f;if(g&&function(e){return !!(1&e.kind)}(g))P=f?"this".concat(j?"?.":"","[").concat(N(s,D,u),"]"):"this".concat(j?"?.":".").concat(u);else if((J||j)&&y){P=J?"[".concat(f?N(s,D,u):u,"]"):u,(j||y.questionDotToken)&&(P="?.".concat(P));var z=e.findChildOfKind(y,24,s)||e.findChildOfKind(y,28,s);if(!z)return;var U=e.startsWith(u,y.name.text)?y.name.end:z.end;L=e.createTextSpanFromBounds(z.getStart(s),U);}if(v&&(void 0===P&&(P=u),P="{".concat(P,"}"),"boolean"!=typeof v&&(L=e.createTextSpanFromNode(v,s))),g&&function(e){return !!(8&e.kind)}(g)&&y){void 0===P&&(P=u);var K=e.findPrecedingToken(y.pos,s),V="";K&&e.positionIsASICandidate(K.end,K.parent,s)&&(V=";"),V+="(await ".concat(y.expression.getText(),")"),P=f?"".concat(V).concat(P):"".concat(V).concat(j?"?.":".").concat(P),L=e.createTextSpanFromBounds(y.getStart(s),y.end);}if(d(g)&&(O=[e.textPart(g.moduleSpecifier)],h&&(P=(C=function(t,r,n,i,a,o,s){var c,l,u,_=r.getSourceFile(),d=e.createTextSpanFromNode(e.findAncestor(r,e.or(e.isImportDeclaration,e.isImportEqualsDeclaration))||r,_),p=e.quote(_,s,i.moduleSpecifier),f=i.isDefaultExport?1:"export="===i.exportName?2:0,g=s.includeCompletionsWithSnippetText?"$1":"",m=e.codefix.getImportKind(_,f,o,!0),y=(null===(l=null===(c=e.tryCast(r,e.isImportDeclaration))||void 0===c?void 0:c.importClause)||void 0===l?void 0:l.isTypeOnly)||(null===(u=e.tryCast(r,e.isImportEqualsDeclaration))||void 0===u?void 0:u.isTypeOnly),v=re(r,n),h=y?" ".concat(e.tokenToString(151)," "):" ",b=v?"".concat(e.tokenToString(151)," "):"",x=a?";":"";switch(m){case 3:return {replacementSpan:d,insertText:"import".concat(h).concat(e.escapeSnippetText(t)).concat(g," = require(").concat(p,")").concat(x)};case 1:return {replacementSpan:d,insertText:"import".concat(h).concat(e.escapeSnippetText(t)).concat(g," from ").concat(p).concat(x)};case 2:return {replacementSpan:d,insertText:"import".concat(h,"* as ").concat(e.escapeSnippetText(t)," from ").concat(p).concat(x)};case 0:return {replacementSpan:d,insertText:"import".concat(h,"{ ").concat(b).concat(e.escapeSnippetText(t)).concat(g," } from ").concat(p).concat(x)}}}(u,h,i,g,b,x,D)).insertText,L=C.replacementSpan,I=!!D.includeCompletionsWithSnippetText||void 0)),D.includeCompletionsWithClassMemberSnippets&&D.includeCompletionsWithInsertText&&3===S&&function(t,r){if(e.isInJSFile(r))return !1;return !!(106500&t.flags)&&(e.isClassLike(r)||r.parent&&r.parent.parent&&e.isClassElement(r.parent)&&r===r.parent.name&&e.isClassLike(r.parent.parent)||r.parent&&e.isSyntaxList(r)&&e.isClassLike(r.parent))}(t,o)){var q=void 0;P=(k=T(c,l,x,D,u,t,o,i)).insertText,I=k.isSnippet,(null==(q=k.importAdder)?void 0:q.hasFixes())&&(M=!0,R=a.ClassMemberSnippet);}var W=e.SymbolDisplay.getSymbolKind(B,t,o);if("JSX attribute"===W&&(29!==o.kind||o.pos!==o.parent.pos)&&D.includeCompletionsWithSnippetText&&D.jsxAttributeCompletionStyle&&"none"!==D.jsxAttributeCompletionStyle){var H="braces"===D.jsxAttributeCompletionStyle,G=B.getTypeOfSymbolAtLocation(t,o);"auto"!==D.jsxAttributeCompletionStyle||528&G.flags||1048576&G.flags&&e.find(G.types,(function(e){return !!(528&e.flags)}))||(402653316&G.flags||1048576&G.flags&&e.every(G.types,(function(e){return !!(402686084&e.flags)}))?(P="".concat(e.escapeSnippetText(u),"=").concat(e.quote(s,D,"$1")),I=!0):H=!0),H&&(P="".concat(e.escapeSnippetText(u),"={$1}"),I=!0);}if(void 0===P||D.includeCompletionsWithInsertText)return (_(g)||d(g))&&(w=E(g),M=!h),{name:u,kind:W,kindModifiers:e.SymbolDisplay.getSymbolModifiers(B,t),sortText:r,source:R,hasAction:!!M||void 0,isRecommended:F(t,m,B)||void 0,insertText:P,replacementSpan:L,sourceDisplay:O,isSnippet:I,isPackageJsonImport:p(g)||void 0,isImportStatementCompletion:!!h||void 0,data:w}}function T(t,r,n,a,o,s,c,l){var u,_=e.findAncestor(c,e.isClassLike);if(!_)return {insertText:o};var d,p=o,f=r.getTypeChecker(),g=c.getSourceFile(),m=function(t){var r=e.createPrinter(t),n=e.createTextWriter(e.getNewLineCharacter(t)),a=i$1(i$1({},n),{write:function(t){return n.write(e.escapeSnippetText(t))},nonEscapingWrite:n.write,writeLiteral:function(t){return n.writeLiteral(e.escapeSnippetText(t))},writeStringLiteral:function(t){return n.writeStringLiteral(e.escapeSnippetText(t))},writeSymbol:function(t,r){return n.writeSymbol(e.escapeSnippetText(t),r)},writeParameter:function(t){return n.writeParameter(e.escapeSnippetText(t))},writeComment:function(t){return n.writeComment(e.escapeSnippetText(t))},writeProperty:function(t){return n.writeProperty(e.escapeSnippetText(t))}});return {printSnippetList:function(e,t,n){return a.clear(),r.writeList(e,t,n,a),a.getText()}}}({removeComments:!0,module:n.module,target:n.target,omitTrailingSemicolon:!1,newLine:e.getNewLineKind(e.getNewLineCharacter(n,e.maybeBind(t,t.getNewLine)))}),y=e.codefix.createImportAdder(g,r,a,t);if(a.includeCompletionsWithSnippetText){u=!0;var v=e.factory.createExpressionStatement(e.factory.createIdentifier(""));e.setSnippetElement(v,{kind:0,order:0}),d=e.factory.createBlock([v],!0);}else d=e.factory.createBlock([],!0);var h=0,b=l&&126===C(l),x=[];return e.codefix.addNewNodeForMemberSymbol(s,_,g,{program:r,host:t},a,y,(function(t){var r=0;b&&(r|=128),e.isClassElement(t)&&1===f.getMemberOverrideModifierStatus(_,t)&&(r|=16384);var n=0;x.length||(l&&(n=function(t){var r,n=0;return (r=C(t))&&(n|=e.modifierToFlag(r)),e.isPropertyDeclaration(t.parent)&&(n|=e.modifiersToFlags(t.parent.modifiers)),n}(l)),h=t.modifierFlagsCache|r|n),t=e.factory.updateModifiers(t,h&~n),x.push(t);}),d,2,b),x.length&&(p=m.printSnippetList(131073,e.factory.createNodeArray(x),g)),{insertText:p,isSnippet:u,importAdder:y}}function C(t){return e.isModifier(t)?t.kind:e.isIdentifier(t)&&t.originalKeywordKind&&e.isModifierKind(t.originalKeywordKind)?t.originalKeywordKind:void 0}function E(t){var r=t.fileName?void 0:e.stripQuotes(t.moduleSymbol.name),n=!!t.isFromPackageJson||void 0;return d(t)?{exportName:t.exportName,moduleSpecifier:t.moduleSpecifier,ambientModuleName:r,fileName:t.fileName,isPackageJsonImport:n}:{exportName:t.exportName,exportMapKey:t.exportMapKey,fileName:t.fileName,ambientModuleName:t.fileName?void 0:e.stripQuotes(t.moduleSymbol.name),isPackageJsonImport:!!t.isFromPackageJson||void 0}}function k(e,t,r){var n="default"===e.exportName,i=!!e.isPackageJsonImport;return g(e)?{kind:32,exportName:e.exportName,moduleSpecifier:e.moduleSpecifier,symbolName:t,fileName:e.fileName,moduleSymbol:r,isDefaultExport:n,isFromPackageJson:i}:{kind:4,exportName:e.exportName,exportMapKey:e.exportMapKey,symbolName:t,fileName:e.fileName,moduleSymbol:r,isDefaultExport:n,isFromPackageJson:i}}function N(t,r,n){return /^\d+$/.test(n)?n:e.quote(t,r,n)}function F(e,t,r){return e===t||!!(1048576&e.flags)&&r.getExportSymbolOfSymbol(e)===t}function A(t){return _(t)?e.stripQuotes(t.moduleSymbol.name):d(t)?t.moduleSpecifier:1===(null==t?void 0:t.kind)?a.ThisProperty:void 0}function P(t,r,n,i,a,o,s,c,l,u,_,d,p,f,g,m,y,v,h,b,x){for(var D,T,C=e.timestamp(),E=(T=a,e.findAncestor(T,(function(t){return e.isFunctionBlock(t)||function(t){return t.parent&&e.isArrowFunction(t.parent)&&t.parent.body===t}(t)||e.isBindingPattern(t)?"quit":e.isVariableDeclaration(t)}))),k=e.probablyUsesSemicolons(o),N=c.getTypeChecker(),F=new e.Map,A=0;A<t.length;A++){var P=t[A],w=null==b?void 0:b[A],I=J(P,l,w,_,!!m);if(I&&!F.get(I.name)&&(1!==_||!x||j(P,x))){var O=I.name,M=I.needsConvertPropertyAccess,L=null!==(D=null==x?void 0:x[e.getSymbolId(P)])&&void 0!==D?D:11,R=S(P,(oe(P,N)?8+L:L).toString(),n,i,a,o,s,c,O,M,w,h,g,y,v,k,p,d,_);if(R){var B=!(w||void 0===P.parent&&!e.some(P.declarations,(function(e){return e.getSourceFile()===a.getSourceFile()})));F.set(O,B),r.push(R);}}}return u("getCompletionsAtPosition: getCompletionEntriesFromSymbols: "+(e.timestamp()-C)),{has:function(e){return F.has(e)},add:function(e){return F.set(e,!0)}};function j(t,r){if(!e.isSourceFile(a)){if(e.isExportAssignment(a.parent))return !0;if(E&&t.valueDeclaration===E)return !1;var n=e.skipAlias(t,N);if(o.externalModuleIndicator&&!p.allowUmdGlobalAccess&&15===r[e.getSymbolId(t)]&&(16===r[e.getSymbolId(n)]||11===r[e.getSymbolId(n)]))return !1;if(t=n,e.isInRightSideOfInternalImportEqualsDeclaration(a))return !!(1920&t.flags);if(f)return ae(t,N)}return !!(111551&e.getCombinedLocalAndExportSymbolFlags(t))}}function w(t,r,n,i,o,s,c){if(o.data){var l=j(o.name,o.data,t,s);if(l){var u=B(i,n),_=u.contextToken,d=u.previousToken;return {type:"symbol",symbol:l.symbol,location:e.getTouchingPropertyName(n,i),previousToken:d,contextToken:_,isJsxInitializer:!1,isTypeOnlyLocation:!1,origin:l.origin}}}var p=t.getCompilerOptions(),f=R(t,r,n,h(n,p),i,{includeCompletionsForModuleExports:!0,includeCompletionsWithInsertText:!0},o,s);if(!f)return {type:"none"};if(0!==f.kind)return {type:"request",request:f};var g=f.symbols,m=f.literals,y=f.location,v=f.completionKind,b=f.symbolToOriginInfoMap,D=f.contextToken,S=f.previousToken,T=f.isJsxInitializer,C=f.isTypeOnlyLocation,E=e.find(m,(function(e){return x(n,c,e)===o.name}));return void 0!==E?{type:"literal",literal:E}:e.firstDefined(g,(function(t,r){var n=b[r],i=J(t,e.getEmitScriptTarget(p),n,v,f.isJsxIdentifierExpected);return i&&i.name===o.name&&(o.source===a.ClassMemberSnippet&&106500&t.flags||A(n)===o.source)?{type:"symbol",symbol:t,location:y,origin:n,contextToken:D,previousToken:S,isJsxInitializer:T,isTypeOnlyLocation:C}:void 0}))||{type:"none"}}function I(t,r,n){return M(t,"",r,[e.displayPart(t,n)])}function O(t,r,n,i,a,o,s){var c=r.runWithCancellationToken(a,(function(r){return e.SymbolDisplay.getSymbolDisplayPartsDocumentationAndSymbolKind(r,t,n,i,i,7)})),l=c.displayParts,u=c.documentation,_=c.symbolKind,d=c.tags;return M(t.name,e.SymbolDisplay.getSymbolModifiers(r,t),_,l,u,d,o,s)}function M(e,t,r,n,i,a,o,s){return {name:e,kindModifiers:t,kind:r,displayParts:n,documentation:i,tags:a,codeActions:o,source:s,sourceDisplay:s}}function L(t,r,n){var i=n.getAccessibleSymbolChain(t,r,67108863,!1);return i?e.first(i):t.parent&&(function(e){var t;return !!(null===(t=e.declarations)||void 0===t?void 0:t.some((function(e){return 303===e.kind})))}(t.parent)?t:L(t.parent,r,n))}function R(t,n,i,a,o,s,c,l,u){var _=t.getTypeChecker(),d=e.timestamp(),p=e.getTokenAtPosition(i,o);n("getCompletionData: Get current token: "+(e.timestamp()-d)),d=e.timestamp();var g=e.isInComment(i,o,p);n("getCompletionData: Is inside comment: "+(e.timestamp()-d));var m=!1,v=!1;if(g){if(e.hasDocComment(i,o)){if(64===i.text.charCodeAt(o-1))return {kind:1};var h=e.getLineStartPositionForPosition(o,i);if(!/[^\*|\s(/)]/.test(i.text.substring(h,o)))return {kind:2}}var b=function(t,r){var n=e.findAncestor(t,e.isJSDoc);return n&&n.tags&&(e.rangeContainsPosition(n,r)?e.findLast(n.tags,(function(e){return e.pos<r})):void 0)}(p,o);if(b){if(b.tagName.pos<=o&&o<=b.tagName.end)return {kind:1};if(function(e){switch(e.kind){case 338:case 345:case 339:case 341:case 343:return !0;default:return !1}}(b)&&b.typeExpression&&307===b.typeExpression.kind&&((p=e.getTokenAtPosition(i,o))&&(e.isDeclarationName(p)||345===p.parent.kind&&p.parent.name===p)||(m=Ne(b.typeExpression))),!m&&e.isJSDocParameterTag(b)&&(e.nodeIsMissing(b.name)||b.name.pos<=o&&o<=b.name.end))return {kind:3,tag:b}}if(!m)return void n("Returning an empty list because completion was inside a regular comment or plain text part of a JsDoc comment.")}d=e.timestamp();var x=!m&&e.isSourceFileJS(i),D=B(o,i),S=D.previousToken,T=D.contextToken;n("getCompletionData: Get previous token: "+(e.timestamp()-d));var C,E,k,N=p,F=!1,A=!1,P=!1,w=!1,I=!1,O=!1,M=e.getTouchingPropertyName(i,o),R=0,j=!1;if(T){var J=te(T);if(j=J.isNewIdentifierLocation,J.keywordCompletion){if(J.isKeywordOnlyCompletion)return {kind:4,keywordCompletions:[(k=J.keywordCompletion,{name:e.tokenToString(k),kind:"keyword",kindModifiers:"",sortText:r.GlobalsOrKeywords})],isNewIdentifierLocation:j};R=function(t){switch(t){case 151:return 8;default:e.Debug.fail("Unknown mapping from SyntaxKind to KeywordCompletionFilters");}}(J.keywordCompletion);}if(J.replacementNode&&s.includeCompletionsForImportStatements&&s.includeCompletionsWithInsertText&&(E=J.replacementNode),!E&&function(t){var r=e.timestamp(),a=function(t){return (e.isRegularExpressionLiteral(t)||e.isStringTextContainingNode(t))&&(e.rangeContainsPositionExclusive(e.createTextRangeFromSpan(e.createTextSpanFromNode(t)),o)||o===t.end&&(!!t.isUnterminated||e.isRegularExpressionLiteral(t)))}(t)||function(t){var r=t.parent,n=r.kind;switch(t.kind){case 27:return 253===n||function(t){return 254===t.parent.kind&&!e.isPossiblyTypeArgumentPosition(t,i,_)}(t)||236===n||259===n||Te(n)||257===n||201===n||258===n||e.isClassLike(r)&&!!r.typeParameters&&r.typeParameters.end>=t.pos;case 24:return 201===n;case 58:return 202===n;case 22:return 201===n;case 20:return 291===n||Te(n);case 18:return 259===n;case 29:return 256===n||225===n||257===n||258===n||e.isFunctionLikeKind(n);case 124:return 166===n&&!e.isClassLike(r.parent);case 25:return 163===n||!!r.parent&&201===r.parent.kind;case 123:case 121:case 122:return 163===n&&!e.isConstructorDeclaration(r.parent);case 127:return 269===n||274===n||267===n;case 136:case 148:return !$(t);case 79:if(269===n&&t===r.name&&"type"===t.text)return !1;break;case 84:case 92:case 118:case 98:case 113:case 100:case 119:case 85:case 137:return !0;case 151:return 269!==n;case 41:return e.isFunctionLike(t.parent)&&!e.isMethodDeclaration(t.parent)}if(W(G(t))&&$(t))return !1;if(De(t)&&(!e.isIdentifier(t)||e.isParameterPropertyModifier(G(t))||Ne(t)))return !1;switch(G(t)){case 126:case 84:case 85:case 135:case 92:case 98:case 118:case 119:case 121:case 122:case 123:case 124:case 113:return !0;case 131:return e.isPropertyDeclaration(t.parent)}if(e.findAncestor(t.parent,e.isClassLike)&&t===S&&Se(t,o))return !1;var a=e.getAncestor(t.parent,166);if(a&&t!==S&&e.isClassLike(S.parent.parent)&&o<=S.end){if(Se(t,S.end))return !1;if(63!==t.kind&&(e.isInitializedProperty(a)||e.hasType(a)))return !0}return e.isDeclarationName(t)&&!e.isShorthandPropertyAssignment(t.parent)&&!e.isJsxAttribute(t.parent)&&!(e.isClassLike(t.parent)&&(t!==S||o>S.end))}(t)||function(e){if(8===e.kind){var t=e.getFullText();return "."===t.charAt(t.length-1)}return !1}(t)||function(e){if(11===e.kind)return !0;if(31===e.kind&&e.parent){if(279===e.parent.kind)return 279!==M.parent.kind;if(280===e.parent.kind||278===e.parent.kind)return !!e.parent.parent&&277===e.parent.parent.kind}return !1}(t)||e.isBigIntLiteral(t);return n("getCompletionsAtPosition: isCompletionListBlocker: "+(e.timestamp()-r)),a}(T))return n("Returning an empty list because completion was requested in an invalid position."),R?y(R,x,xe()):void 0;var z=T.parent;if(24===T.kind||28===T.kind)switch(F=24===T.kind,A=28===T.kind,z.kind){case 205:N=(C=z).expression;var U=e.getLeftmostAccessExpression(C);if(e.nodeIsMissing(U)||(e.isCallExpression(N)||e.isFunctionLike(N))&&N.end===T.pos&&N.getChildCount(i)&&21!==e.last(N.getChildren(i)).kind)return;break;case 160:N=z.left;break;case 260:N=z.name;break;case 199:N=z;break;case 230:N=z.getFirstToken(i),e.Debug.assert(100===N.kind||103===N.kind);break;default:return}else if(!E&&1===i.languageVariant){if(z&&205===z.kind&&(T=z,z=z.parent),p.parent===M)switch(p.kind){case 31:277!==p.parent.kind&&279!==p.parent.kind||(M=p);break;case 43:278===p.parent.kind&&(M=p);}switch(z.kind){case 280:43===T.kind&&(w=!0,M=T);break;case 220:if(!ee(z))break;case 278:case 277:case 279:O=!0,29===T.kind&&(P=!0,M=T);break;case 287:case 286:19===S.kind&&31===p.kind&&(O=!0);break;case 284:if(z.initializer===S&&S.end<o){O=!0;break}switch(S.kind){case 63:I=!0;break;case 79:O=!0,z!==S.parent&&!z.initializer&&e.findChildOfKind(z,63,i)&&(I=S);}}}}var K=e.timestamp(),V=5,H=!1,X=!1,ne=[],ie=[],oe=[],ce=new e.Map,le=m||!!E&&e.isTypeOnlyImportOrExportDeclaration(M.parent)||!function(t){return t&&(112===t.kind&&(180===t.parent.kind||e.isTypeOfExpression(t.parent))||128===t.kind&&176===t.parent.kind)}(T)&&(e.isPossiblyTypeArgumentPosition(T,i,_)||e.isPartOfTypeNode(M)||function(t){if(t){var r=t.parent.kind;switch(t.kind){case 58:return 166===r||165===r||163===r||253===r||e.isFunctionLikeKind(r);case 63:return 258===r;case 127:return 228===r;case 29:return 177===r||210===r;case 94:return 162===r}}return !1}(T)),ue=e.memoizeOne((function(r){return e.createModuleSpecifierResolutionHost(r?l.getPackageJsonAutoImportProvider():t,l)}));if(F||A)!function(){V=2;var t=e.isLiteralImportTypeNode(N),r=m||t&&!N.isTypeOf||e.isPartOfTypeNode(N.parent)||e.isPossiblyTypeArgumentPosition(T,i,_),n=e.isInRightSideOfInternalImportEqualsDeclaration(N);if(e.isEntityName(N)||t||e.isPropertyAccessExpression(N)){var a=e.isModuleDeclaration(N.parent);a&&(j=!0);var o=_.getSymbolAtLocation(N);if(o&&1920&(o=e.skipAlias(o,_)).flags){var c=_.getExportsOfModule(o);e.Debug.assertEachIsDefined(c,"getExportsOfModule() should all be defined");for(var l=function(e){return _.isValidPropertyAccess(t?N:N.parent,e.name)},u=function(e){return ae(e,_)},d=a?function(e){var t;return !!(1920&e.flags)&&!(null===(t=e.declarations)||void 0===t?void 0:t.every((function(e){return e.parent===N.parent})))}:n?function(e){return u(e)||l(e)}:r?u:l,p=0,f=c;p<f.length;p++){var g=f[p];d(g)&&ne.push(g);}if(!r&&o.declarations&&o.declarations.some((function(e){return 303!==e.kind&&260!==e.kind&&259!==e.kind}))){var y=!1;(v=_.getTypeOfSymbolAtLocation(o,N).getNonOptionalType()).isNullableType()&&((h=F&&!A&&!1!==s.includeAutomaticOptionalChainCompletions)||A)&&(v=v.getNonNullableType(),h&&(y=!0)),me(v,!!(32768&N.flags),y);}return}}if(!r){var v,h,b=e.getThisContainer(N,!1);!e.isSourceFile(b)&&b.parent&&_.getTypeAtLocation(b),y=!1,(v=_.getTypeAtLocation(N).getNonOptionalType()).isNullableType()&&((h=F&&!A&&!1!==s.includeAutomaticOptionalChainCompletions)||A)&&(v=v.getNonNullableType(),h&&(y=!0)),me(v,!!(32768&N.flags),y);}}();else if(P)ne=_.getJsxIntrinsicTagNamesAt(M),e.Debug.assertEachIsDefined(ne,"getJsxIntrinsicTagNames() should all be defined"),he(),V=1,R=0;else if(w){var _e=T.parent.parent.openingElement.tagName,de=_.getSymbolAtLocation(_e);de&&(ne=[de]),V=1,R=0;}else if(!he())return R?y(R,x,j):void 0;n("getCompletionData: Semantic work: "+(e.timestamp()-K));var pe=S&&function(t,r,n,i){var a=t.parent;switch(t.kind){case 79:return e.getContextualTypeFromParent(t,i);case 63:switch(a.kind){case 253:return i.getContextualType(a.initializer);case 220:return i.getTypeAtLocation(a.left);case 284:return i.getContextualTypeForJsxAttribute(a);default:return}case 103:return i.getContextualType(a);case 82:return e.getSwitchedType(e.cast(a,e.isCaseClause),i);case 18:return !e.isJsxExpression(a)||e.isJsxElement(a.parent)||e.isJsxFragment(a.parent)?void 0:i.getContextualTypeForJsxAttribute(a.parent);default:var o=e.SignatureHelp.getArgumentInfoForCompletions(t,r,n);return o?i.getContextualTypeForArgumentAtIndex(o.invocation,o.argumentIndex+(27===t.kind?1:0)):e.isEqualityOperatorKind(t.kind)&&e.isBinaryExpression(a)&&e.isEqualityOperatorKind(a.operatorToken.kind)?i.getTypeAtLocation(a.left):i.getContextualType(t)}}(S,o,i,_),fe=e.mapDefined(pe&&(pe.isUnion()?pe.types:[pe]),(function(e){return !e.isLiteral()||1024&e.flags?void 0:e.value})),ge=S&&pe&&function(t,r,n){return e.firstDefined(r&&(r.isUnion()?r.types:[r]),(function(r){var i=r&&r.symbol;return i&&424&i.flags&&!e.isAbstractConstructorSymbol(i)?L(i,t,n):void 0}))}(S,pe,_);return {kind:0,symbols:ne,completionKind:V,isInSnippetScope:v,propertyAccessToConvert:C,isNewIdentifierLocation:j,location:M,keywordFilters:R,literals:fe,symbolToOriginInfoMap:ie,recommendedCompletion:ge,previousToken:S,contextToken:T,isJsxInitializer:I,insideJsDocTagTypeExpression:m,symbolToSortTextIdMap:oe,isTypeOnlyLocation:le,isJsxIdentifierExpected:O,importCompletionNode:E,hasUnresolvedAutoImports:X};function me(t,r,n){j=!!t.getStringIndexType(),A&&e.some(t.getCallSignatures())&&(j=!0);var i=199===N.kind?N:N.parent;if(a)ne.push.apply(ne,e.filter(Y(t,_),(function(e){return _.isValidPropertyAccessForCompletions(i,t,e)})));else for(var o=0,c=t.getApparentProperties();o<c.length;o++){var l=c[o];_.isValidPropertyAccessForCompletions(i,t,l)&&ye(l,!1,n);}if(r&&s.includeCompletionsWithInsertText){var u=_.getPromisedTypeOfPromise(t);if(u)for(var d=0,p=u.getApparentProperties();d<p.length;d++)l=p[d],_.isValidPropertyAccessForCompletions(i,u,l)&&ye(l,!0,n);}}function ye(r,n,a){var o,c=e.firstDefined(r.declarations,(function(t){return e.tryCast(e.getNameOfDeclaration(t),e.isComputedPropertyName)}));if(c){var u=ve(c.expression),d=u&&_.getSymbolAtLocation(u),p=d&&L(d,T,_);if(p&&e.addToSeen(ce,e.getSymbolId(p))){var f=ne.length;ne.push(p);var g=p.parent;if(g&&e.isExternalModuleSymbol(g)&&_.tryGetMemberInModuleExportsAndProperties(p.name,g)===p){var m=e.isExternalModuleNameRelative(e.stripQuotes(g.name))?null===(o=e.getSourceFileOfModule(g))||void 0===o?void 0:o.fileName:void 0,y=(e.codefix.getModuleSpecifierForBestExportInfo([{exportKind:0,moduleFileName:m,isFromPackageJson:!1,moduleSymbol:g,symbol:p,targetFlags:e.skipAlias(p,_).flags}],i,t,l,s)||{}).moduleSpecifier;if(y){var v={kind:x(6),moduleSymbol:g,isDefaultExport:!1,symbolName:p.name,exportName:p.name,fileName:m,moduleSpecifier:y};ie[f]=v;}}else ie[f]={kind:x(2)};}else s.includeCompletionsWithInsertText&&(b(r),h(r),ne.push(r));}else b(r),h(r),ne.push(r);function h(t){(function(t){return !!(t.valueDeclaration&&32&e.getEffectiveModifierFlags(t.valueDeclaration)&&e.isClassLike(t.valueDeclaration.parent))})(t)&&(oe[e.getSymbolId(t)]=10);}function b(t){s.includeCompletionsWithInsertText&&(n&&e.addToSeen(ce,e.getSymbolId(t))?ie[ne.length]={kind:x(8)}:a&&(ie[ne.length]={kind:16}));}function x(e){return a?16|e:e}}function ve(t){return e.isIdentifier(t)?t:e.isPropertyAccessExpression(t)?ve(t.expression):void 0}function he(){return 1===(function(){var t=function(t){if(t){var r=t.parent;switch(t.kind){case 18:if(e.isTypeLiteralNode(r))return r;break;case 26:case 27:case 79:if(165===r.kind&&e.isTypeLiteralNode(r.parent))return r.parent}}}(T);if(!t)return 0;var r=(e.isIntersectionTypeNode(t.parent)?t.parent:void 0)||t,n=Z(r,_);if(!n)return 0;var i=_.getTypeFromTypeNode(r),a=Y(n,_),o=Y(i,_),s=new e.Set;return o.forEach((function(e){return s.add(e.escapedName)})),ne=e.concatenate(ne,e.filter(a,(function(e){return !s.has(e.escapedName)}))),V=0,j=!0,1}()||function(){var t,r,n=function(t){if(t){var r=t.parent;switch(t.kind){case 18:case 27:if(e.isObjectLiteralExpression(r)||e.isObjectBindingPattern(r))return r;break;case 41:return e.isMethodDeclaration(r)?e.tryCast(r.parent,e.isObjectLiteralExpression):void 0;case 79:return "async"===t.text&&e.isShorthandPropertyAssignment(t.parent)?t.parent.parent:void 0}}}(T);if(!n)return 0;if(V=0,204===n.kind){var i=function(t,r){var n=r.getContextualType(t);return n||(e.isBinaryExpression(t.parent)&&63===t.parent.operatorToken.kind&&t===t.parent.left?r.getTypeAtLocation(t.parent):void 0)}(n,_);if(void 0===i)return 16777216&n.flags?2:(H=!0,0);var a=_.getContextualType(n,4),o=(a||i).getStringIndexType(),s=(a||i).getNumberIndexType();if(j=!!o||!!s,t=Q(i,a,n,_),r=n.properties,0===t.length&&!s)return H=!0,0}else {e.Debug.assert(200===n.kind),j=!1;var c=e.getRootDeclaration(n.parent);if(!e.isVariableLike(c))return e.Debug.fail("Root declaration is not variable-like.");var l=e.hasInitializer(c)||e.hasType(c)||243===c.parent.parent.kind;if(l||163!==c.kind||(e.isExpression(c.parent)?l=!!_.getContextualType(c.parent):168!==c.parent.kind&&172!==c.parent.kind||(l=e.isExpression(c.parent.parent)&&!!_.getContextualType(c.parent.parent))),l){var u=_.getTypeAtLocation(n);if(!u)return 2;t=_.getPropertiesOfType(u).filter((function(e){return _.isPropertyAccessible(n,!1,!1,u,e)})),r=n.elements;}}return t&&t.length>0&&(ne=e.concatenate(ne,function(t,r){if(0===r.length)return t;for(var n=new e.Set,i=new e.Set,a=0,o=r;a<o.length;a++){var s=o[a];if((294===s.kind||295===s.kind||202===s.kind||168===s.kind||171===s.kind||172===s.kind||296===s.kind)&&!Ne(s)){var c=void 0;if(e.isSpreadAssignment(s))Ce(s,n);else if(e.isBindingElement(s)&&s.propertyName)79===s.propertyName.kind&&(c=s.propertyName.escapedText);else {var l=e.getNameOfDeclaration(s);c=l&&e.isPropertyNameLiteral(l)?e.getEscapedTextOfIdentifierOrLiteral(l):void 0;}void 0!==c&&i.add(c);}}var u=t.filter((function(e){return !i.has(e.escapedName)}));return ke(n,u),u}(t,e.Debug.checkDefined(r)))),Ee(),1}()||(E?(j=!0,be(),1):0)||function(){if(!T)return 0;var t=18===T.kind||27===T.kind?e.tryCast(T.parent,e.isNamedImportsOrExports):e.isTypeKeywordTokenOrIdentifier(T)?e.tryCast(T.parent.parent,e.isNamedImportsOrExports):void 0;if(!t)return 0;e.isTypeKeywordTokenOrIdentifier(T)||(R=8);var r=(268===t.kind?t.parent.parent:t.parent).moduleSpecifier;if(!r)return j=!0,268===t.kind?2:0;var n=_.getSymbolAtLocation(r);if(!n)return j=!0,2;V=3,j=!1;var i=_.getExportsAndPropertiesOfModule(n),a=new e.Set(t.elements.filter((function(e){return !Ne(e)})).map((function(e){return (e.propertyName||e.name).escapedText}))),o=i.filter((function(e){return "default"!==e.escapedName&&!a.has(e.escapedName)}));return ne=e.concatenate(ne,o),o.length||(R=0),1}()||function(){var t,r=!T||18!==T.kind&&27!==T.kind?void 0:e.tryCast(T.parent,e.isNamedExports);if(!r)return 0;var n=e.findAncestor(r,e.or(e.isSourceFile,e.isModuleDeclaration));return V=5,j=!1,null===(t=n.locals)||void 0===t||t.forEach((function(t,r){var i,a;ne.push(t),(null===(a=null===(i=n.symbol)||void 0===i?void 0:i.exports)||void 0===a?void 0:a.has(r))&&(oe[e.getSymbolId(t)]=12);})),1}()||(function(t){if(t){var r=t.parent;switch(t.kind){case 20:case 27:return e.isConstructorDeclaration(t.parent)?t.parent:void 0;default:if(De(t))return r.parent}}}(T)?(V=5,j=!0,R=4,1):0)||function(){var t=function(t,r,n,i){switch(n.kind){case 346:return e.tryCast(n.parent,e.isObjectTypeDeclaration);case 1:var a=e.tryCast(e.lastOrUndefined(e.cast(n.parent,e.isSourceFile).statements),e.isObjectTypeDeclaration);if(a&&!e.findChildOfKind(a,19,t))return a;break;case 79:if(e.isPropertyDeclaration(n.parent)&&n.parent.initializer===n)return;if($(n))return e.findAncestor(n,e.isObjectTypeDeclaration)}if(r){if(134===n.kind||e.isIdentifier(r)&&e.isPropertyDeclaration(r.parent)&&e.isClassLike(n))return e.findAncestor(r,e.isClassLike);switch(r.kind){case 63:return;case 26:case 19:return $(n)&&n.parent.name===n?n.parent.parent:e.tryCast(n,e.isObjectTypeDeclaration);case 18:case 27:return e.tryCast(r.parent,e.isObjectTypeDeclaration);default:if(!$(r))return e.getLineAndCharacterOfPosition(t,r.getEnd()).line!==e.getLineAndCharacterOfPosition(t,i).line&&e.isObjectTypeDeclaration(n)?n:void 0;var o=e.isClassLike(r.parent.parent)?W:q;return o(r.kind)||41===r.kind||e.isIdentifier(r)&&o(e.stringToToken(r.text))?r.parent.parent:void 0}}}(i,T,M,o);if(!t)return 0;if(V=3,j=!0,R=41===T.kind?0:e.isClassLike(t)?2:3,!e.isClassLike(t))return 1;var r=26===T.kind?T.parent.parent:T.parent,n=e.isClassElement(r)?e.getEffectiveModifierFlags(r):0;if(79===T.kind&&!Ne(T))switch(T.getText()){case"private":n|=8;break;case"static":n|=32;break;case"override":n|=16384;}if(e.isClassStaticBlockDeclaration(r)&&(n|=32),!(8&n)){var a=e.isClassLike(t)&&16384&n?e.singleElementArray(e.getEffectiveBaseTypeNode(t)):e.getAllSuperTypeNodes(t),s=e.flatMap(a,(function(e){var r=_.getTypeAtLocation(e);return 32&n?(null==r?void 0:r.symbol)&&_.getPropertiesOfType(_.getTypeOfSymbolAtLocation(r.symbol,t)):r&&_.getPropertiesOfType(r)}));ne=e.concatenate(ne,function(t,r,n){for(var i=new e.Set,a=0,o=r;a<o.length;a++){var s=o[a];if(!(166!==s.kind&&168!==s.kind&&171!==s.kind&&172!==s.kind||Ne(s)||e.hasEffectiveModifier(s,8)||e.isStatic(s)!==!!(32&n))){var c=e.getPropertyNameForPropertyNameNode(s.name);c&&i.add(c);}}return t.filter((function(t){return !(i.has(t.escapedName)||!t.declarations||8&e.getDeclarationModifierFlagsFromSymbol(t)||t.valueDeclaration&&e.isPrivateIdentifierClassElementDeclaration(t.valueDeclaration))}))}(s,t.members,n));}return 1}()||function(){var t=function(t){if(t){var r=t.parent;switch(t.kind){case 31:case 30:case 43:case 79:case 205:case 285:case 284:case 286:if(r&&(278===r.kind||279===r.kind)){if(31===t.kind){var n=e.findPrecedingToken(t.pos,i,void 0);if(!r.typeArguments||n&&43===n.kind)break}return r}if(284===r.kind)return r.parent.parent;break;case 10:if(r&&(284===r.kind||286===r.kind))return r.parent.parent;break;case 19:if(r&&287===r.kind&&r.parent&&284===r.parent.kind)return r.parent.parent.parent;if(r&&286===r.kind)return r.parent.parent}}}(T),r=t&&_.getContextualType(t.attributes);if(!r)return 0;var n=t&&_.getContextualType(t.attributes,4);return ne=e.concatenate(ne,function(t,r){for(var n=new e.Set,i=new e.Set,a=0,o=r;a<o.length;a++){var s=o[a];Ne(s)||(284===s.kind?n.add(s.name.escapedText):e.isJsxSpreadAttribute(s)&&Ce(s,i));}var c=t.filter((function(e){return !n.has(e.escapedName)}));return ke(i,c),c}(Q(r,n,t.attributes,_),t.attributes.properties)),Ee(),V=3,j=!1,1}()||(function(){R=function(t){if(t){var r,n=e.findAncestor(t.parent,(function(t){return e.isClassLike(t)?"quit":!(!e.isFunctionLikeDeclaration(t)||r!==t.body)||(r=t,!1)}));return n&&n}}(T)?5:1,V=1,j=xe(),S!==T&&e.Debug.assert(!!S,"Expected 'contextToken' to be defined when different from 'previousToken'.");var t=S!==T?S.getStart():o,r=function(t,r,n){for(var i=t;i&&!e.positionBelongsToNode(i,r,n);)i=i.parent;return i}(T,t,i)||i;v=function(t){switch(t.kind){case 303:case 222:case 287:case 234:return !0;default:return e.isStatement(t)}}(r);var n=2887656|(le?0:111551);ne=e.concatenate(ne,_.getSymbolsInScope(r,n)),e.Debug.assertEachIsDefined(ne,"getSymbolsInScope() should all be defined");for(var a=0,c=ne;a<c.length;a++){var l=c[a];_.isArgumentsSymbol(l)||e.some(l.declarations,(function(e){return e.getSourceFile()===i}))||(oe[e.getSymbolId(l)]=15);}if(s.includeCompletionsWithInsertText&&303!==r.kind){var u=_.tryGetThisTypeAt(r,!1);if(u&&!function(e,t,r){var n=r.resolveName("self",void 0,111551,!1);if(n&&r.getTypeOfSymbolAtLocation(n,t)===e)return !0;var i=r.resolveName("global",void 0,111551,!1);if(i&&r.getTypeOfSymbolAtLocation(i,t)===e)return !0;var a=r.resolveName("globalThis",void 0,111551,!1);return !(!a||r.getTypeOfSymbolAtLocation(a,t)!==e)}(u,i,_))for(var d=0,p=Y(u,_);d<p.length;d++)l=p[d],ie[ne.length]={kind:1},ne.push(l),oe[e.getSymbolId(l)]=14;}be(),le&&(R=T&&e.isAssertionExpression(T.parent)?6:7);}(),1))}function be(){var r,n;if((E||!H&&s.includeCompletionsForModuleExports&&(i.externalModuleIndicator||i.commonJsModuleIndicator||e.compilerOptionsIndicateEsModules(t.getCompilerOptions())||e.programContainsModules(t)))&&(e.Debug.assert(!(null==c?void 0:c.data),"Should not run 'collectAutoImports' when faster path is available via `data`"),!c||c.source)){var a=S===T&&E&&re(E,T)?"":S&&e.isIdentifier(S)?S.text.toLowerCase():"",o=null===(r=l.getModuleSpecifierCache)||void 0===r?void 0:r.call(l),_=e.getExportInfoMap(i,l,t,u),d=null===(n=l.getPackageJsonAutoImportProvider)||void 0===n?void 0:n.call(l),p=c?void 0:e.createPackageJsonImportFilter(i,s,l);f("collectAutoImports",l,t,i,s,!!E,(function(t){_.forEach(i.path,(function(r,n,i,o){if(e.isIdentifierText(n,e.getEmitScriptTarget(l.getCompilationSettings()))&&(c||!e.isStringANonContextualKeyword(n))&&(le||E||111551&r[0].targetFlags)&&(!le||790504&r[0].targetFlags)&&(c&&e.some(r,(function(t){return c.source===e.stripQuotes(t.moduleSymbol.name)}))||!c&&se(n,a))){var s=e.find(r,g);if(!s)return;var u=t.tryResolve(r,i)||{},_=u.exportInfo,d=void 0===_?s:_,p=u.moduleSpecifier,f=1===d.exportKind;m=f&&e.getLocalSymbolForExportDefault(d.symbol)||d.symbol,y={kind:p?32:4,moduleSpecifier:p,symbolName:n,exportMapKey:o,exportName:2===d.exportKind?"export=":d.symbol.name,fileName:d.moduleFileName,isDefaultExport:f,moduleSymbol:d.moduleSymbol,isFromPackageJson:d.isFromPackageJson},v=e.getSymbolId(m),15!==oe[v]&&(ie[ne.length]=y,oe[v]=E?11:16,ne.push(m));}var m,y,v;})),X=t.resolutionLimitExceeded();}));}function g(r){var n=e.tryCast(r.moduleSymbol.valueDeclaration,e.isSourceFile);if(!n){var a=e.stripQuotes(r.moduleSymbol.name);return (!e.JsTyping.nodeCoreModules.has(a)||e.startsWith(a,"node:")===e.shouldUseUriStyleNodeCoreModules(i,t))&&(!p||p.allowsImportingAmbientModule(r.moduleSymbol,ue(r.isFromPackageJson)))}return e.isImportableFile(r.isFromPackageJson?d:t,i,n,s,p,ue(r.isFromPackageJson),o)}}function xe(){if(T){var e=T.parent.kind,t=G(T);switch(t){case 27:return 207===e||170===e||208===e||203===e||220===e||178===e||204===e;case 20:return 207===e||170===e||208===e||211===e||190===e;case 22:return 203===e||175===e||161===e;case 141:case 142:case 100:return !0;case 24:return 260===e;case 18:return 256===e||204===e;case 63:return 253===e||220===e;case 15:return 222===e;case 16:return 232===e;case 131:return 168===e||295===e;case 41:return 168===e}if(W(t))return !0}return !1}function De(t){return !!t.parent&&e.isParameter(t.parent)&&e.isConstructorDeclaration(t.parent.parent)&&(e.isParameterPropertyModifier(t.kind)||e.isDeclarationName(t))}function Se(t,r){return 63!==t.kind&&(26===t.kind||!e.positionsAreOnSameLine(t.end,r,i))}function Te(t){return e.isFunctionLikeKind(t)&&170!==t}function Ce(e,t){var r=e.expression,n=_.getSymbolAtLocation(r),i=n&&_.getTypeOfSymbolAtLocation(n,r),a=i&&i.properties;a&&a.forEach((function(e){t.add(e.name);}));}function Ee(){ne.forEach((function(t){var r;if(16777216&t.flags){var n=e.getSymbolId(t);oe[n]=null!==(r=oe[n])&&void 0!==r?r:12;}}));}function ke(t,r){if(0!==t.size)for(var n=0,i=r;n<i.length;n++){var a=i[n];t.has(a.name)&&(oe[e.getSymbolId(a)]=13);}}function Ne(e){return e.getStart(i)<=o&&o<=e.getEnd()}}function B(t,r){var n=e.findPrecedingToken(t,r);return n&&t<=n.end&&(e.isMemberName(n)||e.isKeyword(n.kind))?{contextToken:e.findPrecedingToken(n.getFullStart(),r,void 0),previousToken:n}:{contextToken:n,previousToken:n}}function j(t,r,n,i){var a=r.isPackageJsonImport?i.getPackageJsonAutoImportProvider():n,o=a.getTypeChecker(),s=r.ambientModuleName?o.tryFindAmbientModule(r.ambientModuleName):r.fileName?o.getMergedSymbol(e.Debug.checkDefined(a.getSourceFile(r.fileName)).symbol):void 0;if(s){var c="export="===r.exportName?o.resolveExternalModuleSymbol(s):o.tryGetMemberInModuleExportsAndProperties(r.exportName,s);if(c)return {symbol:c="default"===r.exportName&&e.getLocalSymbolForExportDefault(c)||c,origin:k(r,t,s)}}}function J(t,r,n,i,a){var o=function(e){return _(e)||d(e)}(n)?n.symbolName:t.name;if(!(void 0===o||1536&t.flags&&e.isSingleOrDoubleQuote(o.charCodeAt(0))||e.isKnownSymbol(t))){var s={name:o,needsConvertPropertyAccess:!1};if(e.isIdentifierText(o,r,a?1:0)||t.valueDeclaration&&e.isPrivateIdentifierClassElementDeclaration(t.valueDeclaration))return s;switch(i){case 3:return;case 0:return {name:JSON.stringify(o),needsConvertPropertyAccess:!1};case 2:case 1:return 32===o.charCodeAt(0)?void 0:{name:o,needsConvertPropertyAccess:!0};case 5:case 4:return s;default:e.Debug.assertNever(i);}}}t.moduleSpecifierResolutionLimit=100,t.moduleSpecifierResolutionCacheAttemptLimit=1e3,function(e){e.LocalDeclarationPriority="10",e.LocationPriority="11",e.OptionalMember="12",e.MemberDeclaredBySpreadAssignment="13",e.SuggestedClassMembers="14",e.GlobalsOrKeywords="15",e.AutoImportSuggestions="16",e.JavascriptIdentifiers="17",e.DeprecatedLocalDeclarationPriority="18",e.DeprecatedLocationPriority="19",e.DeprecatedOptionalMember="20",e.DeprecatedMemberDeclaredBySpreadAssignment="21",e.DeprecatedSuggestedClassMembers="22",e.DeprecatedGlobalsOrKeywords="23",e.DeprecatedAutoImportSuggestions="24";}(r=t.SortText||(t.SortText={})),function(e){e[e.LocalDeclarationPriority=10]="LocalDeclarationPriority",e[e.LocationPriority=11]="LocationPriority",e[e.OptionalMember=12]="OptionalMember",e[e.MemberDeclaredBySpreadAssignment=13]="MemberDeclaredBySpreadAssignment",e[e.SuggestedClassMembers=14]="SuggestedClassMembers",e[e.GlobalsOrKeywords=15]="GlobalsOrKeywords",e[e.AutoImportSuggestions=16]="AutoImportSuggestions",e[e._JavaScriptIdentifiers=17]="_JavaScriptIdentifiers",e[e._DeprecatedStart=18]="_DeprecatedStart",e[e._First=10]="_First",e[e.DeprecatedOffset=8]="DeprecatedOffset";}(n||(n={})),function(e){e.ThisProperty="ThisProperty/",e.ClassMemberSnippet="ClassMemberSnippet/";}(a=t.CompletionSource||(t.CompletionSource={})),function(e){e[e.ThisType=1]="ThisType",e[e.SymbolMember=2]="SymbolMember",e[e.Export=4]="Export",e[e.Promise=8]="Promise",e[e.Nullable=16]="Nullable",e[e.ResolvedExport=32]="ResolvedExport",e[e.SymbolMemberNoExport=2]="SymbolMemberNoExport",e[e.SymbolMemberExport=6]="SymbolMemberExport";}(o||(o={})),function(e){e[e.None=0]="None",e[e.All=1]="All",e[e.ClassElementKeywords=2]="ClassElementKeywords",e[e.InterfaceElementKeywords=3]="InterfaceElementKeywords",e[e.ConstructorParameterKeywords=4]="ConstructorParameterKeywords",e[e.FunctionLikeBodyKeywords=5]="FunctionLikeBodyKeywords",e[e.TypeAssertionKeywords=6]="TypeAssertionKeywords",e[e.TypeKeywords=7]="TypeKeywords",e[e.TypeKeyword=8]="TypeKeyword",e[e.Last=7]="Last";}(s||(s={})),function(e){e[e.Continue=0]="Continue",e[e.Success=1]="Success",e[e.Fail=2]="Fail";}(c||(c={})),t.getCompletionsAtPosition=function(n,a,o,s,c,l,u,_,d){var p,y=B(c,s).previousToken;if(!u||e.isInString(s,c,y)||function(t,r,n,i){switch(r){case".":case"@":return !0;case'"':case"'":case"`":return !!n&&e.isStringLiteralOrTemplate(n)&&i===n.getStart(t)+1;case"#":return !!n&&e.isPrivateIdentifier(n)&&!!e.getContainingClass(n);case"<":return !!n&&29===n.kind&&(!e.isBinaryExpression(n.parent)||ee(n.parent));case"/":return !!n&&(e.isStringLiteralLike(n)?!!e.tryGetImportFromModuleSpecifier(n):43===n.kind&&e.isJsxClosingElement(n.parent));case" ":return !!n&&e.isImportKeyword(n)&&303===n.parent.kind;default:return e.Debug.assertNever(r)}}(s,u,y,c)){if(" "===u)return l.includeCompletionsForImportStatements&&l.includeCompletionsWithInsertText?{isGlobalCompletion:!0,isMemberCompletion:!1,isNewIdentifierLocation:!0,isIncomplete:!0,entries:[]}:void 0;var x=a.getCompilerOptions(),S=l.allowIncompleteCompletions?null===(p=n.getIncompleteCompletionsCache)||void 0===p?void 0:p.call(n):void 0;if(S&&3===_&&y&&e.isIdentifier(y)){var T=function(t,r,n,a,o,s,c){var l=t.get();if(l){var u=n.text.toLowerCase(),_=e.getExportInfoMap(r,o,a,c),d=f("continuePreviousIncompleteResponse",o,a,r,s,!1,(function(t){var n=e.mapDefined(l.entries,(function(n){if(!n.hasAction||!n.source||!n.data||g(n.data))return n;if(se(n.name,u)){var s=e.Debug.checkDefined(j(n.name,n.data,a,o)).origin,c=_.get(r.path,n.data.exportMapKey),l=c&&t.tryResolve(c,!e.isExternalModuleNameRelative(e.stripQuotes(s.moduleSymbol.name)));if(!l)return n;var d=i$1(i$1({},s),{kind:32,moduleSpecifier:l.moduleSpecifier});return n.data=E(d),n.source=A(d),n.sourceDisplay=[e.textPart(d.moduleSpecifier)],n}}));return t.resolutionLimitExceeded()||(l.isIncomplete=void 0),n}));return l.entries=d,l}}(S,s,y,a,n,l,d);if(T)return T}else null==S||S.clear();var C=t.StringCompletions.getStringLiteralCompletions(s,c,y,x,n,a,o,l);if(C)return C;if(y&&e.isBreakOrContinueStatement(y.parent)&&(81===y.kind||86===y.kind||79===y.kind))return function(t){var n=function(t){for(var n=[],i=new e.Map,a=t;a&&!e.isFunctionLike(a);){if(e.isLabeledStatement(a)){var o=a.label.text;i.has(o)||(i.set(o,!0),n.push({name:o,kindModifiers:"",kind:"label",sortText:r.LocationPriority}));}a=a.parent;}return n}(t);if(n.length)return {isGlobalCompletion:!1,isMemberCompletion:!1,isNewIdentifierLocation:!1,entries:n}}(y.parent);var k,N=R(a,o,s,h(s,x),c,l,void 0,n,d);if(N)switch(N.kind){case 0:var F=function(t,n,i,a,o,s,c){var l=s.symbols,u=s.contextToken,_=s.completionKind,d=s.isInSnippetScope,p=s.isNewIdentifierLocation,f=s.location,g=s.propertyAccessToConvert,m=s.keywordFilters,y=s.literals,x=s.symbolToOriginInfoMap,S=s.recommendedCompletion,T=s.isJsxInitializer,C=s.isTypeOnlyLocation,E=s.isJsxIdentifierExpected,k=s.importCompletionNode,N=s.insideJsDocTagTypeExpression,F=s.symbolToSortTextIdMap,A=s.hasUnresolvedAutoImports;if(1===e.getLanguageVariant(t.scriptKind)){var w=function(t,n){var i=e.findAncestor(t,(function(e){switch(e.kind){case 280:return !0;case 43:case 31:case 79:case 205:return !1;default:return "quit"}}));if(i){var a=!!e.findChildOfKind(i,31,n),o=i.parent.openingElement.tagName.getText(n)+(a?"":">");return {isGlobalCompletion:!1,isMemberCompletion:!0,isNewIdentifierLocation:!1,optionalReplacementSpan:e.createTextSpanFromNode(i.tagName),entries:[{name:o,kind:"class",kindModifiers:void 0,sortText:r.LocationPriority}]}}}(f,t);if(w)return w}var I=[];if(h(t,a)){var O=P(l,I,void 0,u,f,t,n,i,e.getEmitScriptTarget(a),o,_,c,a,C,g,E,T,k,S,x,F);!function(t,n,i,a,o){e.getNameTable(t).forEach((function(t,s){if(t!==n){var c=e.unescapeLeadingUnderscores(s);!i.has(c)&&e.isIdentifierText(c,a)&&(i.add(c),o.push({name:c,kind:"warning",kindModifiers:"",sortText:r.JavascriptIdentifiers,isFromUncheckedFile:!0}));}}));}(t,f.pos,O,e.getEmitScriptTarget(a),I);}else {if(!(p||l&&0!==l.length||0!==m))return;P(l,I,void 0,u,f,t,n,i,e.getEmitScriptTarget(a),o,_,c,a,C,g,E,T,k,S,x,F);}if(0!==m)for(var M=new e.Set(I.map((function(e){return e.name}))),L=0,R=K(m,!N&&e.isSourceFileJS(t));L<R.length;L++){var B=R[L];M.has(B.name)||I.push(B);}for(var j=0,J=y;j<J.length;j++){var z=J[j];I.push(D(t,c,z));}return {isGlobalCompletion:d,isIncomplete:!(!c.allowIncompleteCompletions||!A)||void 0,isMemberCompletion:b(_),isNewIdentifierLocation:p,optionalReplacementSpan:v(f),entries:I}}(s,n,a,x,o,N,l);return (null==F?void 0:F.isIncomplete)&&(null==S||S.set(F)),F;case 1:return m(e.JsDoc.getJSDocTagNameCompletions());case 2:return m(e.JsDoc.getJSDocTagCompletions());case 3:return m(e.JsDoc.getJSDocParameterNameCompletions(N.tag));case 4:return k=N.keywordCompletions,{isGlobalCompletion:!1,isMemberCompletion:!1,isNewIdentifierLocation:N.isNewIdentifierLocation,entries:k.slice()};default:return e.Debug.assertNever(N)}}},t.getCompletionEntriesFromSymbols=P,t.getCompletionEntryDetails=function(r,n,i,o,s,c,l,u,p){var f=r.getTypeChecker(),g=r.getCompilerOptions(),m=s.name,y=s.source,v=s.data,h=e.findPrecedingToken(o,i);if(e.isInString(i,o,h))return t.StringCompletions.getStringLiteralCompletionDetails(m,i,o,h,f,g,c,p,u);var b=w(r,n,i,o,s,c,u);switch(b.type){case"request":var D=b.request;switch(D.kind){case 1:return e.JsDoc.getJSDocTagNameCompletionDetails(m);case 2:return e.JsDoc.getJSDocTagCompletionDetails(m);case 3:return e.JsDoc.getJSDocParameterNameCompletionDetails(m);case 4:return e.some(D.keywordCompletions,(function(e){return e.name===m}))?I(m,"keyword",e.SymbolDisplayPartKind.keyword):void 0;default:return e.Debug.assertNever(D)}case"symbol":var S=b.symbol,C=b.location,E=b.contextToken,k=b.origin,N=b.previousToken,F=function(t,r,n,i,o,s,c,l,u,p,f,g,m,y,v){if(null==y?void 0:y.moduleSpecifier){var h=B(p,u),b=h.contextToken,x=h.previousToken;if(x&&te(b||x).replacementNode)return {codeActions:void 0,sourceDisplay:[e.textPart(y.moduleSpecifier)]}}if(v===a.ClassMemberSnippet){var D=T(c,s,l,m,t,o,r,n).importAdder;if(D)return {sourceDisplay:void 0,codeActions:[{changes:e.textChanges.ChangeTracker.with({host:c,formatContext:g,preferences:m},D.writeFixes),description:e.diagnosticToString([e.Diagnostics.Includes_imports_of_types_referenced_by_0,t])}]}}if(!i||!_(i)&&!d(i))return {codeActions:void 0,sourceDisplay:void 0};var S=i.isFromPackageJson?c.getPackageJsonAutoImportProvider().getTypeChecker():s.getTypeChecker(),C=i.moduleSymbol,E=S.getMergedSymbol(e.skipAlias(o.exportSymbol||o,S)),k=e.codefix.getImportCompletionAction(E,C,u,e.getNameForExportedSymbol(o,e.getEmitScriptTarget(l)),c,s,g,f&&e.isIdentifier(f)?f.getStart(u):p,m),N=k.moduleSpecifier,F=k.codeAction;return e.Debug.assert(!(null==y?void 0:y.moduleSpecifier)||N===y.moduleSpecifier),{sourceDisplay:[e.textPart(N)],codeActions:[F]}}(m,C,E,k,S,r,c,g,i,o,N,l,u,v,y);return O(S,f,i,C,p,F.codeActions,F.sourceDisplay);case"literal":var A=b.literal;return I(x(i,u,A),"string","string"==typeof A?e.SymbolDisplayPartKind.stringLiteral:e.SymbolDisplayPartKind.numericLiteral);case"none":return U().some((function(e){return e.name===m}))?I(m,"keyword",e.SymbolDisplayPartKind.keyword):void 0;default:e.Debug.assertNever(b);}},t.createCompletionDetailsForSymbol=O,t.createCompletionDetails=M,t.getCompletionEntrySymbol=function(e,t,r,n,i,a,o){var s=w(e,t,r,n,i,a,o);return "symbol"===s.type?s.symbol:void 0},function(e){e[e.Data=0]="Data",e[e.JsDocTagName=1]="JsDocTagName",e[e.JsDocTag=2]="JsDocTag",e[e.JsDocParameterName=3]="JsDocParameterName",e[e.Keywords=4]="Keywords";}(l||(l={})),(u=t.CompletionKind||(t.CompletionKind={}))[u.ObjectPropertyDeclaration=0]="ObjectPropertyDeclaration",u[u.Global=1]="Global",u[u.PropertyAccess=2]="PropertyAccess",u[u.MemberLike=3]="MemberLike",u[u.String=4]="String",u[u.None=5]="None";var z=[],U=e.memoize((function(){for(var t=[],n=81;n<=159;n++)t.push({name:e.tokenToString(n),kind:"keyword",kindModifiers:"",sortText:r.GlobalsOrKeywords});return t}));function K(t,r){if(!r)return V(t);var n=t+7+1;return z[n]||(z[n]=V(t).filter((function(t){return !function(e){switch(e){case 126:case 130:case 157:case 133:case 135:case 92:case 156:case 117:case 137:case 118:case 139:case 140:case 141:case 142:case 143:case 146:case 147:case 158:case 121:case 122:case 123:case 144:case 149:case 150:case 151:case 153:case 154:return !0;default:return !1}}(e.stringToToken(t.name))})))}function V(t){return z[t]||(z[t]=U().filter((function(r){var n=e.stringToToken(r.name);switch(t){case 0:return !1;case 1:return H(n)||135===n||141===n||151===n||142===n||126===n||e.isTypeKeyword(n)&&152!==n;case 5:return H(n);case 2:return W(n);case 3:return q(n);case 4:return e.isParameterPropertyModifier(n);case 6:return e.isTypeKeyword(n)||85===n;case 7:return e.isTypeKeyword(n);case 8:return 151===n;default:return e.Debug.assertNever(t)}})))}function q(e){return 144===e}function W(t){switch(t){case 126:case 134:case 136:case 148:case 131:case 135:case 158:return !0;default:return e.isClassMemberModifier(t)}}function H(t){return 131===t||132===t||127===t||!e.isContextualKeyword(t)&&!W(t)}function G(t){return e.isIdentifier(t)?t.originalKeywordKind||0:t.kind}function Q(t,r,n,i){var a=r&&r!==t,o=!a||3&r.flags?t:i.getUnionType([t,r]),s=function(t,r,n){return t.isUnion()?n.getAllPossiblePropertiesOfTypes(e.filter(t.types,(function(t){return !(131068&t.flags||n.isArrayLikeType(t)||n.isTypeInvalidDueToUnionDiscriminant(t,r)||e.typeHasCallOrConstructSignatures(t,n)||t.isClass()&&X(t.getApparentProperties()))}))):t.getApparentProperties()}(o,n,i);return o.isClass()&&X(s)?[]:a?e.filter(s,(function(t){return e.some(t.declarations,(function(e){return e.parent!==n}))})):s}function X(t){return e.some(t,(function(t){return !!(24&e.getDeclarationModifierFlagsFromSymbol(t))}))}function Y(t,r){return t.isUnion()?e.Debug.checkEachDefined(r.getAllPossiblePropertiesOfTypes(t.types),"getAllPossiblePropertiesOfTypes() should all be defined"):e.Debug.checkEachDefined(t.getApparentProperties(),"getApparentProperties() should all be defined")}function Z(t,r){if(t){if(e.isTypeNode(t)&&e.isTypeReferenceType(t.parent))return r.getTypeArgumentConstraint(t);var n=Z(t.parent,r);if(n)switch(t.kind){case 165:return r.getTypeOfPropertyOfContextualType(n,t.symbol.escapedName);case 187:case 181:case 186:return n}}}function $(t){return t.parent&&e.isClassOrTypeElement(t.parent)&&e.isObjectTypeDeclaration(t.parent.parent)}function ee(t){var r=t.left;return e.nodeIsMissing(r)}function te(t){var r,n=!1,i=function(){var i=t.parent;if(e.isImportEqualsDeclaration(i))return r=151===t.kind?void 0:151,ie(i.moduleReference)?i:void 0;if(re(i,t)&&ne(i.parent))return i;if(!e.isNamedImports(i)&&!e.isNamespaceImport(i))return e.isImportKeyword(t)&&e.isSourceFile(i)?(r=151,t):e.isImportKeyword(t)&&e.isImportDeclaration(i)?(r=151,ie(i.moduleSpecifier)?i:void 0):void 0;if(i.parent.isTypeOnly||18!==t.kind&&100!==t.kind&&27!==t.kind||(r=151),ne(i)){if(19!==t.kind&&79!==t.kind)return i.parent.parent;n=!0,r=155;}}();return {isKeywordOnlyCompletion:n,keywordCompletion:r,isNewIdentifierLocation:!(!i&&151!==r),replacementNode:i&&e.rangeIsOnSingleLine(i,i.getSourceFile())?i:void 0}}function re(t,r){return e.isImportSpecifier(t)&&(t.isTypeOnly||r===t.name&&e.isTypeKeywordTokenOrIdentifier(r))}function ne(t){return ie(t.parent.parent.moduleSpecifier)&&(e.isNamespaceImport(t)||t.elements.length<2)&&!t.parent.name}function ie(t){var r;return !!e.nodeIsMissing(t)||!(null===(r=e.tryCast(e.isExternalModuleReference(t)?t.expression:t,e.isStringLiteralLike))||void 0===r?void 0:r.text)}function ae(t,r,n){void 0===n&&(n=new e.Map);var i=e.skipAlias(t.exportSymbol||t,r);return !!(788968&i.flags)||r.isUnknownSymbol(i)||!!(1536&i.flags)&&e.addToSeen(n,e.getSymbolId(i))&&r.getExportsOfModule(i).some((function(e){return ae(e,r,n)}))}function oe(t,r){var n=e.skipAlias(t,r).declarations;return !!e.length(n)&&e.every(n,e.isDeprecatedDeclaration)}function se(e,t){if(0===t.length)return !0;for(var r,n=!1,i=0,a=e.length,o=0;o<a;o++){var s=e.charCodeAt(o),c=t.charCodeAt(i);if((s===c||s===(97<=(l=c)&&l<=122?l-32:l))&&(n||(n=void 0===r||97<=r&&r<=122&&65<=s&&s<=90||95===r&&95!==s),n&&i++,i===t.length))return !0;r=s;}var l;return !1}t.getPropertiesForObjectExpression=Q;}(e.Completions||(e.Completions={}));}(t),function(e){!function(t){function r(t,r){return {fileName:r.fileName,textSpan:e.createTextSpanFromNode(t,r),kind:"none"}}function i(t){return e.isThrowStatement(t)?[t]:e.isTryStatement(t)?e.concatenate(t.catchClause?i(t.catchClause):t.tryBlock&&i(t.tryBlock),t.finallyBlock&&i(t.finallyBlock)):e.isFunctionLike(t)?void 0:o(t,i)}function a(t){return e.isBreakOrContinueStatement(t)?[t]:e.isFunctionLike(t)?void 0:o(t,a)}function o(t,r){var n=[];return t.forEachChild((function(t){var i=r(t);void 0!==i&&n.push.apply(n,e.toArray(i));})),n}function s(e,t){var r=c(t);return !!r&&r===e}function c(t){return e.findAncestor(t,(function(r){switch(r.kind){case 248:if(244===t.kind)return !1;case 241:case 242:case 243:case 240:case 239:return !t.label||function(t,r){return !!e.findAncestor(t.parent,(function(t){return e.isLabeledStatement(t)?t.label.escapedText===r:"quit"}))}(r,t.label.escapedText);default:return e.isFunctionLike(r)&&"quit"}}))}function l(t,r){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];return !(!r||!e.contains(n,r.kind)||(t.push(r),0))}function u(t){var r=[];if(l(r,t.getFirstToken(),97,115,90)&&239===t.kind)for(var n=t.getChildren(),i=n.length-1;i>=0&&!l(r,n[i],115);i--);return e.forEach(a(t.statement),(function(e){s(t,e)&&l(r,e.getFirstToken(),81,86);})),r}function _(e){var t=c(e);if(t)switch(t.kind){case 241:case 242:case 243:case 239:case 240:return u(t);case 248:return d(t)}}function d(t){var r=[];return l(r,t.getFirstToken(),107),e.forEach(t.caseBlock.clauses,(function(n){l(r,n.getFirstToken(),82,88),e.forEach(a(n),(function(e){s(t,e)&&l(r,e.getFirstToken(),81);}));})),r}function p(t,r){var n=[];return l(n,t.getFirstToken(),111),t.catchClause&&l(n,t.catchClause.getFirstToken(),83),t.finallyBlock&&l(n,e.findChildOfKind(t,96,r),96),n}function f(t,r){var n=function(t){for(var r=t;r.parent;){var n=r.parent;if(e.isFunctionBlock(n)||303===n.kind)return n;if(e.isTryStatement(n)&&n.tryBlock===r&&n.catchClause)return r;r=n;}}(t);if(n){var a=[];return e.forEach(i(n),(function(t){a.push(e.findChildOfKind(t,109,r));})),e.isFunctionBlock(n)&&e.forEachReturnStatement(n,(function(t){a.push(e.findChildOfKind(t,105,r));})),a}}function g(t,r){var n=e.getContainingFunction(t);if(n){var a=[];return e.forEachReturnStatement(e.cast(n.body,e.isBlock),(function(t){a.push(e.findChildOfKind(t,105,r));})),e.forEach(i(n.body),(function(t){a.push(e.findChildOfKind(t,109,r));})),a}}function m(t){var r=e.getContainingFunction(t);if(r){var n=[];return r.modifiers&&r.modifiers.forEach((function(e){l(n,e,131);})),e.forEachChild(r,(function(t){y(t,(function(t){e.isAwaitExpression(t)&&l(n,t.getFirstToken(),132);}));})),n}}function y(t,r){r(t),e.isFunctionLike(t)||e.isClassLike(t)||e.isInterfaceDeclaration(t)||e.isModuleDeclaration(t)||e.isTypeAliasDeclaration(t)||e.isTypeNode(t)||e.forEachChild(t,(function(e){return y(e,r)}));}t.getDocumentHighlights=function(t,i,a,o,s){var c=e.getTouchingPropertyName(a,o);if(c.parent&&(e.isJsxOpeningElement(c.parent)&&c.parent.tagName===c||e.isJsxClosingElement(c.parent))){var v=c.parent.parent,h=[v.openingElement,v.closingElement].map((function(e){return r(e.tagName,a)}));return [{fileName:a.fileName,highlightSpans:h}]}return function(t,r,n,i,a){var o=new e.Set(a.map((function(e){return e.fileName}))),s=e.FindAllReferences.getReferenceEntriesForNode(t,r,n,a,i,void 0,o);if(s){var c=e.arrayToMultiMap(s.map(e.FindAllReferences.toHighlightSpan),(function(e){return e.fileName}),(function(e){return e.span})),l=e.createGetCanonicalFileName(n.useCaseSensitiveFileNames());return e.mapDefined(e.arrayFrom(c.entries()),(function(t){var r=t[0],i=t[1];if(!o.has(r)){if(!n.redirectTargetsMap.has(e.toPath(r,n.getCurrentDirectory(),l)))return;var s=n.getSourceFile(r);r=e.find(a,(function(e){return !!e.redirectInfo&&e.redirectInfo.redirectTarget===s})).fileName,e.Debug.assert(o.has(r));}return {fileName:r,highlightSpans:i}}))}}(o,c,t,i,s)||function(t,i){var a=function(t,i){switch(t.kind){case 99:case 91:return e.isIfStatement(t.parent)?function(t,n){for(var i=function(t,r){for(var n=[];e.isIfStatement(t.parent)&&t.parent.elseStatement===t;)t=t.parent;for(;;){var i=t.getChildren(r);l(n,i[0],99);for(var a=i.length-1;a>=0&&!l(n,i[a],91);a--);if(!t.elseStatement||!e.isIfStatement(t.elseStatement))break;t=t.elseStatement;}return n}(t,n),a=[],o=0;o<i.length;o++){if(91===i[o].kind&&o<i.length-1){for(var s=i[o],c=i[o+1],u=!0,_=c.getStart(n)-1;_>=s.end;_--)if(!e.isWhiteSpaceSingleLine(n.text.charCodeAt(_))){u=!1;break}if(u){a.push({fileName:n.fileName,textSpan:e.createTextSpanFromBounds(s.getStart(),c.end),kind:"reference"}),o++;continue}}a.push(r(i[o],n));}return a}(t.parent,i):void 0;case 105:return c(t.parent,e.isReturnStatement,g);case 109:return c(t.parent,e.isThrowStatement,f);case 111:case 83:case 96:return c(83===t.kind?t.parent.parent:t.parent,e.isTryStatement,p);case 107:return c(t.parent,e.isSwitchStatement,d);case 82:case 88:return e.isDefaultClause(t.parent)||e.isCaseClause(t.parent)?c(t.parent.parent.parent,e.isSwitchStatement,d):void 0;case 81:case 86:return c(t.parent,e.isBreakOrContinueStatement,_);case 97:case 115:case 90:return c(t.parent,(function(t){return e.isIterationStatement(t,!0)}),u);case 134:return s(e.isConstructorDeclaration,[134]);case 136:case 148:return s(e.isAccessor,[136,148]);case 132:return c(t.parent,e.isAwaitExpression,m);case 131:return v(m(t));case 125:return v(function(t){var r=e.getContainingFunction(t);if(r){var n=[];return e.forEachChild(r,(function(t){y(t,(function(t){e.isYieldExpression(t)&&l(n,t.getFirstToken(),125);}));})),n}}(t));default:return e.isModifierKind(t.kind)&&(e.isDeclaration(t.parent)||e.isVariableStatement(t.parent))?v((a=t.kind,o=t.parent,e.mapDefined(function(t,r){var i=t.parent;switch(i.kind){case 261:case 303:case 234:case 288:case 289:return 128&r&&e.isClassDeclaration(t)?n$3(n$3([],t.members,!0),[t],!1):i.statements;case 170:case 168:case 255:return n$3(n$3([],i.parameters,!0),e.isClassLike(i.parent)?i.parent.members:[],!0);case 256:case 225:case 257:case 181:var a=i.members;if(92&r){var o=e.find(i.members,e.isConstructorDeclaration);if(o)return n$3(n$3([],a,!0),o.parameters,!0)}else if(128&r)return n$3(n$3([],a,!0),[i],!1);return a;case 204:return;default:e.Debug.assertNever(i,"Invalid container kind.");}}(o,e.modifierToFlag(a)),(function(t){return e.findModifier(t,a)})))):void 0}var a,o;function s(r,n){return c(t.parent,r,(function(t){return e.mapDefined(t.symbol.declarations,(function(t){return r(t)?e.find(t.getChildren(i),(function(t){return e.contains(n,t.kind)})):void 0}))}))}function c(e,t,r){return t(e)?v(r(e,i)):void 0}function v(e){return e&&e.map((function(e){return r(e,i)}))}}(t,i);return a&&[{fileName:i.fileName,highlightSpans:a}]}(c,a)};}(e.DocumentHighlights||(e.DocumentHighlights={}));}(t),function(e){function t(e){return !!e.sourceFile}function r(r,i,a){void 0===i&&(i="");var o=new e.Map,s=e.createGetCanonicalFileName(!!r);function c(e,t,r,n,i,a,o){return _(e,t,r,n,i,a,!0,o)}function l(e,t,r,n,i,a,o){return _(e,t,r,n,i,a,!1,o)}function u(r,n){var i=t(r)?r:r.get(e.Debug.checkDefined(n,"If there are more than one scriptKind's for same document the scriptKind should be provided"));return e.Debug.assert(void 0===n||!i||i.sourceFile.scriptKind===n,"Script kind should match provided ScriptKind:".concat(n," and sourceFile.scriptKind: ").concat(null==i?void 0:i.sourceFile.scriptKind,", !entry: ").concat(!i)),i}function _(r,n,i,s,c,l,_,d){var p=6===(d=e.ensureScriptKind(r,d))?100:e.getEmitScriptTarget(i),f=e.getOrUpdate(o,s,(function(){return new e.Map})),g=f.get(n),m=g&&u(g,d);if(!m&&a&&(y=a.getDocument(s,n))&&(e.Debug.assert(_),m={sourceFile:y,languageServiceRefCount:0},v()),m)m.sourceFile.version!==l&&(m.sourceFile=e.updateLanguageServiceSourceFile(m.sourceFile,c,l,c.getChangeRange(m.sourceFile.scriptSnapshot)),a&&a.setDocument(s,n,m.sourceFile)),_&&m.languageServiceRefCount++;else {var y=e.createLanguageServiceSourceFile(r,c,p,l,!1,d);a&&a.setDocument(s,n,y),m={sourceFile:y,languageServiceRefCount:1},v();}return e.Debug.assert(0!==m.languageServiceRefCount),m.sourceFile;function v(){if(g)if(t(g)){var r=new e.Map;r.set(g.sourceFile.scriptKind,g),r.set(d,m),f.set(n,r);}else g.set(d,m);else f.set(n,m);}}function d(r,n,i){var a=e.Debug.checkDefined(o.get(n)),s=a.get(r),c=u(s,i);c.languageServiceRefCount--,e.Debug.assert(c.languageServiceRefCount>=0),0===c.languageServiceRefCount&&(t(s)?a.delete(r):(s.delete(i),1===s.size&&a.set(r,e.firstDefinedIterator(s.values(),e.identity))));}return {acquireDocument:function(t,r,a,o,l){return c(t,e.toPath(t,i,s),r,n(r),a,o,l)},acquireDocumentWithKey:c,updateDocument:function(t,r,a,o,c){return l(t,e.toPath(t,i,s),r,n(r),a,o,c)},updateDocumentWithKey:l,releaseDocument:function(t,r,a){return d(e.toPath(t,i,s),n(r),a)},releaseDocumentWithKey:d,getLanguageServiceRefCounts:function(t,r){return e.arrayFrom(o.entries(),(function(e){var n=e[0],i=e[1].get(t),a=i&&u(i,r);return [n,a&&a.languageServiceRefCount]}))},reportStats:function(){var r=e.arrayFrom(o.keys()).filter((function(e){return e&&"_"===e.charAt(0)})).map((function(e){var r=o.get(e),n=[];return r.forEach((function(e,r){t(e)?n.push({name:r,scriptKind:e.sourceFile.scriptKind,refCount:e.languageServiceRefCount}):e.forEach((function(e,t){return n.push({name:r,scriptKind:t,refCount:e.languageServiceRefCount})}));})),n.sort((function(e,t){return t.refCount-e.refCount})),{bucket:e,sourceFiles:n}}));return JSON.stringify(r,void 0,2)},getKeyForCompilationSettings:n}}function n(t){return e.sourceFileAffectingCompilerOptions.map((function(r){return e.getCompilerOptionValue(t,r)})).join("|")}e.createDocumentRegistry=function(e,t){return r(e,t)},e.createDocumentRegistryInternal=r;}(t),function(e){!function(t){function r(t,r){return e.forEach(303===t.kind?t.statements:t.body.statements,(function(t){return r(t)||c(t)&&e.forEach(t.body&&t.body.statements,r)}))}function n(t,n){if(t.externalModuleIndicator||void 0!==t.imports)for(var i=0,a=t.imports;i<a.length;i++){var o=a[i];n(e.importFromModuleSpecifier(o),o);}else r(t,(function(t){switch(t.kind){case 271:case 265:(r=t).moduleSpecifier&&e.isStringLiteral(r.moduleSpecifier)&&n(r,r.moduleSpecifier);break;case 264:var r;l(r=t)&&n(r,r.moduleReference.expression);}}));}function a(t,r,n){var i=t.parent;if(i){var a=n.getMergedSymbol(i);return e.isExternalModuleSymbol(a)?{exportingModuleSymbol:a,exportKind:r}:void 0}}function o(e,t){return t.getMergedSymbol(s(e).symbol)}function s(t){if(207===t.kind)return t.getSourceFile();var r=t.parent;return 303===r.kind?r:(e.Debug.assert(261===r.kind),e.cast(r.parent,c))}function c(e){return 260===e.kind&&10===e.name.kind}function l(e){return 276===e.moduleReference.kind&&10===e.moduleReference.expression.kind}var u,_;t.createImportTracker=function(t,a,u,_){var d=function(t,r,i){for(var a=new e.Map,o=0,s=t;o<s.length;o++){var c=s[o];i&&i.throwIfCancellationRequested(),n(c,(function(t,n){var i=r.getSymbolAtLocation(n);if(i){var o=e.getSymbolId(i).toString(),s=a.get(o);s||a.set(o,s=[]),s.push(t);}}));}return a}(t,u,_);return function(n,p,f){var g=function(t,n,i,a,l,u){var _=a.exportingModuleSymbol,d=a.exportKind,p=e.nodeSeenTracker(),f=e.nodeSeenTracker(),g=[],m=!!_.globalExports,y=m?void 0:[];return function t(r){var n=x(r);if(n)for(var i=0,a=n;i<a.length;i++){var _=a[i];if(p(_))switch(u&&u.throwIfCancellationRequested(),_.kind){case 207:if(e.isImportCall(_)){S=_,b(e.findAncestor(S,c)||S.getSourceFile(),!!v(S,!0));break}if(!m){var f=_.parent;if(2===d&&253===f.kind){var y=f.name;if(79===y.kind){g.push(y);break}}}break;case 79:break;case 264:h(_,_.name,e.hasSyntacticModifier(_,1),!1);break;case 265:g.push(_);var D=_.importClause&&_.importClause.namedBindings;D&&267===D.kind?h(_,D.name,!1,!0):!m&&e.isDefaultImport(_)&&b(s(_));break;case 271:_.exportClause?273===_.exportClause.kind?b(s(_),!0):g.push(_):t(o(_,l));break;case 199:_.isTypeOf&&!_.qualifier&&v(_)&&b(_.getSourceFile(),!0),g.push(_);break;default:e.Debug.failBadSyntaxKind(_,"Unexpected import kind.");}}var S;}(_),{directImports:g,indirectUsers:function(){if(m)return t;if(_.declarations)for(var r=0,i=_.declarations;r<i.length;r++){var a=i[r];e.isExternalModuleAugmentation(a)&&n.has(a.getSourceFile().fileName)&&b(a);}return y.map(e.getSourceFileOfNode)}()};function v(t,r){return void 0===r&&(r=!1),e.findAncestor(t,(function(t){return r&&c(t)?"quit":e.some(t.modifiers,(function(e){return 93===e.kind}))}))}function h(t,n,i,a){if(2===d)a||g.push(t);else if(!m){var o=s(t);e.Debug.assert(303===o.kind||260===o.kind),i||function(t,n,i){var a=i.getSymbolAtLocation(n);return !!r(t,(function(t){if(e.isExportDeclaration(t)){var r=t.exportClause;return !t.moduleSpecifier&&r&&e.isNamedExports(r)&&r.elements.some((function(e){return i.getExportSpecifierLocalTargetSymbol(e)===a}))}}))}(o,n,l)?b(o,!0):b(o);}}function b(t,r){if(void 0===r&&(r=!1),e.Debug.assert(!m),f(t)&&(y.push(t),r)){var n=l.getMergedSymbol(t.symbol);if(n){e.Debug.assert(!!(1536&n.flags));var i=x(n);if(i)for(var a=0,o=i;a<o.length;a++){var c=o[a];e.isImportTypeNode(c)||b(s(c),!0);}}}}function x(t){return i.get(e.getSymbolId(t).toString())}}(t,a,d,p,u,_),m=g.directImports,y=g.indirectUsers;return i$1({indirectUsers:y},function(t,r,n,i,a){var o=[],s=[];function c(e,t){o.push([e,t]);}if(t)for(var u=0,_=t;u<_.length;u++)d(_[u]);return {importSearches:o,singleReferences:s};function d(t){if(264!==t.kind)if(79!==t.kind)if(199!==t.kind){if(10===t.moduleSpecifier.kind)if(271!==t.kind){var o=t.importClause||{name:void 0,namedBindings:void 0},u=o.name,_=o.namedBindings;if(_)switch(_.kind){case 267:p(_.name);break;case 268:0!==n&&1!==n||f(_);break;default:e.Debug.assertNever(_);}!u||1!==n&&2!==n||a&&u.escapedText!==e.symbolEscapedNameNoDefault(r)||c(u,i.getSymbolAtLocation(u));}else t.exportClause&&e.isNamedExports(t.exportClause)&&f(t.exportClause);}else if(t.qualifier){var d=e.getFirstIdentifier(t.qualifier);d.escapedText===e.symbolName(r)&&s.push(d);}else 2===n&&s.push(t.argument.literal);else p(t);else l(t)&&p(t.name);}function p(e){2!==n||a&&!g(e.escapedText)||c(e,i.getSymbolAtLocation(e));}function f(e){if(e)for(var t=0,n=e.elements;t<n.length;t++){var o=n[t],l=o.name,u=o.propertyName;g((u||l).escapedText)&&(u?(s.push(u),a&&l.escapedText!==r.escapedName||c(l,i.getSymbolAtLocation(l))):c(l,274===o.kind&&o.propertyName?i.getExportSpecifierLocalTargetSymbol(o):i.getSymbolAtLocation(l)));}}function g(e){return e===r.escapedName||0!==n&&"default"===e}}(m,n,p.exportKind,u,f))}},(_=t.ExportKind||(t.ExportKind={}))[_.Named=0]="Named",_[_.Default=1]="Default",_[_.ExportEquals=2]="ExportEquals",(u=t.ImportExport||(t.ImportExport={}))[u.Import=0]="Import",u[u.Export=1]="Export",t.findModuleReferences=function(e,t,r){for(var i=[],a=e.getTypeChecker(),o=0,s=t;o<s.length;o++){var c=s[o],l=r.valueDeclaration;if(303===(null==l?void 0:l.kind)){for(var u=0,_=c.referencedFiles;u<_.length;u++){var d=_[u];e.getSourceFileFromReference(c,d)===l&&i.push({kind:"reference",referencingFile:c,ref:d});}for(var p=0,f=c.typeReferenceDirectives;p<f.length;p++){d=f[p];var g=e.getResolvedTypeReferenceDirectives().get(d.fileName);void 0!==g&&g.resolvedFileName===l.fileName&&i.push({kind:"reference",referencingFile:c,ref:d});}}n(c,(function(e,t){a.getSymbolAtLocation(t)===r&&i.push({kind:"import",literal:t});}));}return i},t.getImportOrExportSymbol=function(t,r,n,i){return i?o():o()||function(){if(function(t){var r=t.parent;switch(r.kind){case 264:return r.name===t&&l(r);case 269:return !r.propertyName;case 266:case 267:return e.Debug.assert(r.name===t),!0;case 202:return e.isInJSFile(t)&&e.isRequireVariableDeclaration(r);default:return !1}}(t)){var i=n.getImmediateAliasedSymbol(r);if(i){"export="===(i=function(t,r){if(t.declarations)for(var n=0,i=t.declarations;n<i.length;n++){var a=i[n];if(e.isExportSpecifier(a)&&!a.propertyName&&!a.parent.parent.moduleSpecifier)return r.getExportSpecifierLocalTargetSymbol(a);if(e.isPropertyAccessExpression(a)&&e.isModuleExportsAccessExpression(a.expression)&&!e.isPrivateIdentifier(a.name))return r.getSymbolAtLocation(a);if(e.isShorthandPropertyAssignment(a)&&e.isBinaryExpression(a.parent.parent)&&2===e.getAssignmentDeclarationKind(a.parent.parent))return r.getExportSpecifierLocalTargetSymbol(a.name)}return t}(i,n)).escapedName&&(i=function(t,r){if(2097152&t.flags)return e.Debug.checkDefined(r.getImmediateAliasedSymbol(t));var n=e.Debug.checkDefined(t.valueDeclaration);return e.isExportAssignment(n)?e.Debug.checkDefined(n.expression.symbol):e.isBinaryExpression(n)?e.Debug.checkDefined(n.right.symbol):e.isSourceFile(n)?e.Debug.checkDefined(n.symbol):e.Debug.fail()}(i,n));var a=e.symbolEscapedNameNoDefault(i);return void 0===a||"default"===a||a===r.escapedName?{kind:0,symbol:i}:void 0}}}();function o(){var a,o=t.parent,l=o.parent;if(r.exportSymbol)return 205===o.kind?(null===(a=r.declarations)||void 0===a?void 0:a.some((function(e){return e===o})))&&e.isBinaryExpression(l)?d(l,!1):void 0:s(r.exportSymbol,c(o));var u=function(t,r){var n=e.isVariableDeclaration(t)?t:e.isBindingElement(t)?e.walkUpBindingElementsAndPatterns(t):void 0;return n?t.name!==r||e.isCatchClause(n.parent)?void 0:e.isVariableStatement(n.parent.parent)?n.parent.parent:void 0:t}(o,t);if(u&&e.hasSyntacticModifier(u,1)){if(e.isImportEqualsDeclaration(u)&&u.moduleReference===t){if(i)return;return {kind:0,symbol:n.getSymbolAtLocation(u.name)}}return s(r,c(u))}if(e.isNamespaceExport(o))return s(r,0);if(e.isExportAssignment(o))return _(o);if(e.isExportAssignment(l))return _(l);if(e.isBinaryExpression(o))return d(o,!0);if(e.isBinaryExpression(l))return d(l,!0);if(e.isJSDocTypedefTag(o))return s(r,0);function _(e){if(e.symbol.parent){var t=e.isExportEquals?2:1;return {kind:1,symbol:r,exportInfo:{exportingModuleSymbol:e.symbol.parent,exportKind:t}}}}function d(t,i){var a;switch(e.getAssignmentDeclarationKind(t)){case 1:a=0;break;case 2:a=2;break;default:return}var o=i?n.getSymbolAtLocation(e.getNameOfAccessExpression(e.cast(t.left,e.isAccessExpression))):r;return o&&s(o,a)}}function s(e,t){var r=a(e,t,n);return r&&{kind:1,symbol:e,exportInfo:r}}function c(t){return e.hasSyntacticModifier(t,512)?1:0}},t.getExportInfo=a;}(e.FindAllReferences||(e.FindAllReferences={}));}(t),function(e){!function(t){var r,a,o,s;function c(e,t){return void 0===t&&(t=1),{kind:t,node:e.name||e,context:u(e)}}function l(e){return e&&void 0===e.kind}function u(t){if(e.isDeclaration(t))return _(t);if(t.parent){if(!e.isDeclaration(t.parent)&&!e.isExportAssignment(t.parent)){if(e.isInJSFile(t)){var r=e.isBinaryExpression(t.parent)?t.parent:e.isAccessExpression(t.parent)&&e.isBinaryExpression(t.parent.parent)&&t.parent.parent.left===t.parent?t.parent.parent:void 0;if(r&&0!==e.getAssignmentDeclarationKind(r))return _(r)}if(e.isJsxOpeningElement(t.parent)||e.isJsxClosingElement(t.parent))return t.parent.parent;if(e.isJsxSelfClosingElement(t.parent)||e.isLabeledStatement(t.parent)||e.isBreakOrContinueStatement(t.parent))return t.parent;if(e.isStringLiteralLike(t)){var n=e.tryGetImportFromModuleSpecifier(t);if(n){var i=e.findAncestor(n,(function(t){return e.isDeclaration(t)||e.isStatement(t)||e.isJSDocTag(t)}));return e.isDeclaration(i)?_(i):i}}var a=e.findAncestor(t,e.isComputedPropertyName);return a?_(a.parent):void 0}return t.parent.name===t||e.isConstructorDeclaration(t.parent)||e.isExportAssignment(t.parent)||(e.isImportOrExportSpecifier(t.parent)||e.isBindingElement(t.parent))&&t.parent.propertyName===t||88===t.kind&&e.hasSyntacticModifier(t.parent,513)?_(t.parent):void 0}}function _(t){if(t)switch(t.kind){case 253:return e.isVariableDeclarationList(t.parent)&&1===t.parent.declarations.length?e.isVariableStatement(t.parent.parent)?t.parent.parent:e.isForInOrOfStatement(t.parent.parent)?_(t.parent.parent):t.parent:t;case 202:return _(t.parent.parent);case 269:return t.parent.parent.parent;case 274:case 267:return t.parent.parent;case 266:case 273:return t.parent;case 220:return e.isExpressionStatement(t.parent)?t.parent:t;case 243:case 242:return {start:t.initializer,end:t.expression};case 294:case 295:return e.isArrayLiteralOrObjectLiteralDestructuringPattern(t.parent)?_(e.findAncestor(t.parent,(function(t){return e.isBinaryExpression(t)||e.isForInOrOfStatement(t)}))):t;default:return t}}function d(e,t,r){if(r){var n=l(r)?b(r.start,t,r.end):b(r,t);return n.start!==e.start||n.length!==e.length?{contextSpan:n}:void 0}}function p(t,n,i,a,o){if(303!==a.kind){var s=t.getTypeChecker();if(295===a.parent.kind){var l=[];return r.getReferenceEntriesForShorthandPropertyAssignment(a,s,(function(e){return l.push(c(e))})),l}if(106===a.kind||e.isSuperProperty(a.parent)){var u=s.getSymbolAtLocation(a);return u.valueDeclaration&&[c(u.valueDeclaration)]}return f(o,a,t,i,n,{implementations:!0,use:1})}}function f(t,n,i,a,o,s,c){return void 0===s&&(s={}),void 0===c&&(c=new e.Set(a.map((function(e){return e.fileName})))),g(r.getReferencedSymbolsForNode(t,n,i,a,o,s,c))}function g(t){return t&&e.flatMap(t,(function(e){return e.references}))}function m(t){var r=t.getSourceFile();return {sourceFile:r,textSpan:b(e.isComputedPropertyName(t)?t.expression:t,r)}}function y(t,n,i){var a=r.getIntersectingMeaningFromDeclarations(i,t),o=t.declarations&&e.firstOrUndefined(t.declarations)||i,s=e.SymbolDisplay.getSymbolDisplayPartsDocumentationAndSymbolKind(n,t,o.getSourceFile(),o,o,a);return {displayParts:s.displayParts,kind:s.symbolKind}}function v(e,t){var r=h(e);if(0===e.kind)return i$1(i$1({},r),{isWriteAccess:!1,isDefinition:!1});var n=e.kind,a=e.node;return i$1(i$1({},r),{isWriteAccess:D(a),isDefinition:S(a,t),isInString:2===n||void 0})}function h(e){if(0===e.kind)return {textSpan:e.textSpan,fileName:e.fileName};var t=e.node.getSourceFile(),r=b(e.node,t);return i$1({textSpan:r,fileName:t.fileName},d(r,t,e.context))}function b(t,r,n){var i=t.getStart(r),a=(n||t).getEnd();return e.isStringLiteralLike(t)&&(e.Debug.assert(void 0===n),i+=1,a-=1),e.createTextSpanFromBounds(i,a)}function x(e){return 0===e.kind?e.textSpan:b(e.node,e.node.getSourceFile())}function D(t){var r=e.getDeclarationFromName(t);return !!r&&function(t){if(8388608&t.flags)return !0;switch(t.kind){case 220:case 202:case 256:case 225:case 88:case 259:case 297:case 274:case 266:case 264:case 269:case 257:case 336:case 343:case 284:case 260:case 263:case 267:case 273:case 163:case 295:case 258:case 162:return !0;case 294:return !e.isArrayLiteralOrObjectLiteralDestructuringPattern(t.parent);case 255:case 212:case 170:case 168:case 171:case 172:return !!t.body;case 253:case 166:return !!t.initializer||e.isCatchClause(t.parent);case 167:case 165:case 345:case 338:return !1;default:return e.Debug.failBadSyntaxKind(t)}}(r)||88===t.kind||e.isWriteAccess(t)}function S(t,r){var n;if(!r)return !1;var i=e.getDeclarationFromName(t)||(88===t.kind?t.parent:e.isLiteralComputedPropertyDeclarationName(t)||134===t.kind&&e.isConstructorDeclaration(t.parent)?t.parent.parent:void 0),a=i&&e.isBinaryExpression(i)?i.left:void 0;return !(!i||!(null===(n=r.declarations)||void 0===n?void 0:n.some((function(e){return e===i||e===a}))))}(s=t.DefinitionKind||(t.DefinitionKind={}))[s.Symbol=0]="Symbol",s[s.Label=1]="Label",s[s.Keyword=2]="Keyword",s[s.This=3]="This",s[s.String=4]="String",s[s.TripleSlashReference=5]="TripleSlashReference",(o=t.EntryKind||(t.EntryKind={}))[o.Span=0]="Span",o[o.Node=1]="Node",o[o.StringLiteral=2]="StringLiteral",o[o.SearchedLocalFoundProperty=3]="SearchedLocalFoundProperty",o[o.SearchedPropertyFoundLocal=4]="SearchedPropertyFoundLocal",t.nodeEntry=c,t.isContextWithStartAndEndNode=l,t.getContextNode=_,t.toContextSpan=d,(a=t.FindReferencesUse||(t.FindReferencesUse={}))[a.Other=0]="Other",a[a.References=1]="References",a[a.Rename=2]="Rename",t.findReferencedSymbols=function(t,n,a,o,s){var c=e.getTouchingPropertyName(o,s),l=r.getReferencedSymbolsForNode(s,c,t,a,n,{use:1}),u=t.getTypeChecker(),p=u.getSymbolAtLocation(c);return l&&l.length?e.mapDefined(l,(function(t){var r=t.definition,a=t.references;return r&&{definition:u.runWithCancellationToken(n,(function(t){return function(t,r,n){var a=function(){switch(t.type){case 0:var a=y(p=t.symbol,r,n),o=a.displayParts,s=a.kind,c=o.map((function(e){return e.text})).join(""),l=p.declarations&&e.firstOrUndefined(p.declarations),u=l?e.getNameOfDeclaration(l)||l:n;return i$1(i$1({},m(u)),{name:c,kind:s,displayParts:o,context:_(l)});case 1:return u=t.node,i$1(i$1({},m(u)),{name:u.text,kind:"label",displayParts:[e.displayPart(u.text,e.SymbolDisplayPartKind.text)]});case 2:u=t.node;var d=e.tokenToString(u.kind);return i$1(i$1({},m(u)),{name:d,kind:"keyword",displayParts:[{text:d,kind:"keyword"}]});case 3:u=t.node;var p,f=(p=r.getSymbolAtLocation(u))&&e.SymbolDisplay.getSymbolDisplayPartsDocumentationAndSymbolKind(r,p,u.getSourceFile(),e.getContainerNode(u),u).displayParts||[e.textPart("this")];return i$1(i$1({},m(u)),{name:"this",kind:"var",displayParts:f});case 4:return u=t.node,i$1(i$1({},m(u)),{name:u.text,kind:"var",displayParts:[e.displayPart(e.getTextOfNode(u),e.SymbolDisplayPartKind.stringLiteral)]});case 5:return {textSpan:e.createTextSpanFromRange(t.reference),sourceFile:t.file,name:t.reference.fileName,kind:"string",displayParts:[e.displayPart('"'.concat(t.reference.fileName,'"'),e.SymbolDisplayPartKind.stringLiteral)]};default:return e.Debug.assertNever(t)}}(),o=a.sourceFile,s=a.textSpan,c=a.name,l=a.kind,u=a.displayParts,p=a.context;return i$1({containerKind:"",containerName:"",fileName:o.fileName,kind:l,name:c,textSpan:s,displayParts:u},d(s,o,p))}(r,t,c)})),references:a.map((function(e){return v(e,p)}))}})):void 0},t.getImplementationsAtPosition=function(t,r,a,o,s){var c,l=e.getTouchingPropertyName(o,s),u=p(t,r,a,l,s);if(205===l.parent.kind||202===l.parent.kind||206===l.parent.kind||106===l.kind)c=u&&n$3([],u,!0);else for(var _=u&&n$3([],u,!0),d=new e.Map;_&&_.length;){var f=_.shift();if(e.addToSeen(d,e.getNodeId(f.node))){c=e.append(c,f);var g=p(t,r,a,f.node,f.node.pos);g&&_.push.apply(_,g);}}var m=t.getTypeChecker();return e.map(c,(function(t){return function(t,r){var n=h(t);if(0!==t.kind){var a=t.node;return i$1(i$1({},n),function(t,r){var n=r.getSymbolAtLocation(e.isDeclaration(t)&&t.name?t.name:t);return n?y(n,r,t):204===t.kind?{kind:"interface",displayParts:[e.punctuationPart(20),e.textPart("object literal"),e.punctuationPart(21)]}:225===t.kind?{kind:"local class",displayParts:[e.punctuationPart(20),e.textPart("anonymous local class"),e.punctuationPart(21)]}:{kind:e.getNodeKind(t),displayParts:[]}}(a,r))}return i$1(i$1({},n),{kind:"",displayParts:[]})}(t,m)}))},t.findReferenceOrRenameEntries=function(t,n,i,a,o,s,c){return e.map(g(r.getReferencedSymbolsForNode(o,a,t,i,n,s)),(function(e){return c(e,a,t.getTypeChecker())}))},t.getReferenceEntriesForNode=f,t.toRenameLocation=function(t,r,n,a){return i$1(i$1({},h(t)),a&&function(t,r,n){if(0!==t.kind&&e.isIdentifier(r)){var i=t.node,a=t.kind,o=i.parent,s=r.text,c=e.isShorthandPropertyAssignment(o);if(c||e.isObjectBindingElementWithoutPropertyName(o)&&o.name===i&&void 0===o.dotDotDotToken){var l={prefixText:s+": "},u={suffixText:": "+s};if(3===a)return l;if(4===a)return u;if(c){var _=o.parent;return e.isObjectLiteralExpression(_)&&e.isBinaryExpression(_.parent)&&e.isModuleExportsAccessExpression(_.parent.left)?l:u}return l}if(e.isImportSpecifier(o)&&!o.propertyName){var d=e.isExportSpecifier(r.parent)?n.getExportSpecifierLocalTargetSymbol(r.parent):n.getSymbolAtLocation(r);return e.contains(d.declarations,o)?{prefixText:s+" as "}:e.emptyOptions}if(e.isExportSpecifier(o)&&!o.propertyName)return r===t.node||n.getSymbolAtLocation(r)===n.getSymbolAtLocation(t.node)?{prefixText:s+" as "}:{suffixText:" as "+s}}return e.emptyOptions}(t,r,n))},t.toReferenceEntry=v,t.toHighlightSpan=function(e){var t=h(e);if(0===e.kind)return {fileName:t.fileName,span:{textSpan:t.textSpan,kind:"reference"}};var r=D(e.node),n=i$1({textSpan:t.textSpan,kind:r?"writtenReference":"reference",isInString:2===e.kind||void 0},t.contextSpan&&{contextSpan:t.contextSpan});return {fileName:t.fileName,span:n}},t.getTextSpanOfEntry=x,function(r){function n(t,r,n){for(var i,a=0,o=r.get(t.path)||e.emptyArray;a<o.length;a++){var s=o[a];if(e.isReferencedFile(s)){var c=n.getSourceFileByPath(s.file),l=e.getReferencedFileLocation(n.getSourceFileByPath,s);e.isReferenceFileLocation(l)&&(i=e.append(i,{kind:0,fileName:c.fileName,textSpan:e.createTextSpanFromRange(l)}));}}return i}function i(t,r,n){if(t.parent&&e.isNamespaceExportDeclaration(t.parent)){var i=n.getAliasedSymbol(r),a=n.getMergedSymbol(i);if(i!==a)return a}}function a(t,r,n,i,a,s){var c=1536&t.flags&&t.declarations&&e.find(t.declarations,e.isSourceFile);if(c){var u=t.exports.get("export="),d=l(r,t,!!u,n,s);if(!u||!s.has(c.fileName))return d;var p=r.getTypeChecker();return o(r,d,_(t=e.skipAlias(u,p),void 0,n,s,p,i,a))}}function o(t){for(var r,n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];for(var a=0,o=n;a<o.length;a++){var c=o[a];if(c&&c.length)if(r)for(var l=function(n){if(!n.definition||0!==n.definition.type)return r.push(n),"continue";var i=n.definition.symbol,a=e.findIndex(r,(function(e){return !!e.definition&&0===e.definition.type&&e.definition.symbol===i}));if(-1===a)return r.push(n),"continue";var o=r[a];r[a]={definition:o.definition,references:o.references.concat(n.references).sort((function(r,n){var i=s(t,r),a=s(t,n);if(i!==a)return e.compareValues(i,a);var o=x(r),c=x(n);return o.start!==c.start?e.compareValues(o.start,c.start):e.compareValues(o.length,c.length)}))};},u=0,_=c;u<_.length;u++){var d=_[u];l(d);}else r=c;}return r}function s(e,t){var r=0===t.kind?e.getSourceFile(t.fileName):t.node.getSourceFile();return e.getSourceFiles().indexOf(r)}function l(r,n,i,a,o){e.Debug.assert(!!n.valueDeclaration);var s=e.mapDefined(t.findModuleReferences(r,a,n),(function(t){if("import"===t.kind){var r=t.literal.parent;if(e.isLiteralTypeNode(r)){var n=e.cast(r.parent,e.isImportTypeNode);if(i&&!n.qualifier)return}return c(t.literal)}return {kind:0,fileName:t.referencingFile.fileName,textSpan:e.createTextSpanFromRange(t.ref)}}));if(n.declarations)for(var l=0,u=n.declarations;l<u.length;l++)switch((f=u[l]).kind){case 303:break;case 260:o.has(f.getSourceFile().fileName)&&s.push(c(f.name));break;default:e.Debug.assert(!!(33554432&n.flags),"Expected a module symbol to be declared by a SourceFile or ModuleDeclaration.");}var _=n.exports.get("export=");if(null==_?void 0:_.declarations)for(var d=0,p=_.declarations;d<p.length;d++){var f,g=(f=p[d]).getSourceFile();if(o.has(g.fileName)){var m=e.isBinaryExpression(f)&&e.isPropertyAccessExpression(f.left)?f.left.expression:e.isExportAssignment(f)?e.Debug.checkDefined(e.findChildOfKind(f,93,g)):e.getNameOfDeclaration(f)||f;s.push(c(m));}}return s.length?[{definition:{type:0,symbol:n},references:s}]:e.emptyArray}function u(t){return 144===t.kind&&e.isTypeOperatorNode(t.parent)&&144===t.parent.operator}function _(t,r,n,i,a,o,s){var c=r&&function(t,r,n,i){var a=r.parent;return e.isExportSpecifier(a)&&i?F(r,t,a,n):e.firstDefined(t.declarations,(function(i){if(!i.parent){if(33554432&t.flags)return;e.Debug.fail("Unexpected symbol at ".concat(e.Debug.formatSyntaxKind(r.kind),": ").concat(e.Debug.formatSymbol(t)));}return e.isTypeLiteralNode(i.parent)&&e.isUnionTypeNode(i.parent.parent)?n.getPropertyOfType(n.getTypeFromTypeNode(i.parent.parent),t.name):void 0}))}(t,r,a,!U(s))||t,l=r?j(r,c):7,u=[],_=new f(n,i,r?function(t){switch(t.kind){case 170:case 134:return 1;case 79:if(e.isClassLike(t.parent))return e.Debug.assert(t.parent.name===t),2;default:return 0}}(r):0,a,o,l,s,u),p=U(s)&&c.declarations?e.find(c.declarations,e.isExportSpecifier):void 0;if(p)N(p.name,c,p,_.createSearch(r,t,void 0),_,!0,!0);else if(r&&88===r.kind&&"default"===c.escapedName&&c.parent)A(r,c,_),g(r,c,{exportingModuleSymbol:c.parent,exportKind:1},_);else {var m=_.createSearch(r,c,void 0,{allSearchSymbols:r?L(c,r,a,2===s.use,!!s.providePrefixAndSuffixTextForRename,!!s.implementations):[c]});d(c,_,m);}return u}function d(t,r,n){var i=function(t){var r=t.declarations,n=t.flags,i=t.parent,a=t.valueDeclaration;if(a&&(212===a.kind||225===a.kind))return a;if(r){if(8196&n){var o=e.find(r,(function(t){return e.hasEffectiveModifier(t,8)||e.isPrivateIdentifierClassElementDeclaration(t)}));return o?e.getAncestor(o,256):void 0}if(!r.some(e.isObjectBindingElementWithoutPropertyName)){var s,c=i&&!(262144&t.flags);if(!c||e.isExternalModuleSymbol(i)&&!i.globalExports){for(var l=0,u=r;l<u.length;l++){var _=u[l],d=e.getContainerNode(_);if(s&&s!==d)return;if(!d||303===d.kind&&!e.isExternalOrCommonJsModule(d))return;if(s=d,e.isFunctionExpression(s))for(var p=void 0;p=e.getNextJSDocCommentLocation(s);)s=p;}return c?s.getSourceFile():s}}}}(t);if(i)C(i,i.getSourceFile(),n,r,!(e.isSourceFile(i)&&!e.contains(r.sourceFiles,i)));else for(var a=0,o=r.sourceFiles;a<o.length;a++){var s=o[a];r.cancellationToken.throwIfCancellationRequested(),v(s,n,r);}}var p;r.getReferencedSymbolsForNode=function(t,r,s,d,p,f,g){var m,y;if(void 0===f&&(f={}),void 0===g&&(g=new e.Set(d.map((function(e){return e.fileName})))),1===f.use?r=e.getAdjustedReferenceLocation(r):2===f.use&&(r=e.getAdjustedRenameLocation(r)),e.isSourceFile(r)){var v=e.GoToDefinition.getReferenceAtPosition(r,t,s);if(!(null==v?void 0:v.file))return;var h=s.getTypeChecker().getMergedSymbol(v.file.symbol);if(h)return l(s,h,!1,d,g);if(!(N=s.getFileIncludeReasons()))return;return [{definition:{type:5,reference:v.reference,file:r},references:n(v.file,N,s)||e.emptyArray}]}if(!f.implementations){var x=function(t,r,n){if(e.isTypeKeyword(t.kind)){if(114===t.kind&&e.isVoidExpression(t.parent))return;if(144===t.kind&&!u(t))return;return function(t,r,n,i){var a=e.flatMap(t,(function(t){return n.throwIfCancellationRequested(),e.mapDefined(b(t,e.tokenToString(r),t),(function(e){if(e.kind===r&&(!i||i(e)))return c(e)}))}));return a.length?[{definition:{type:2,node:a[0].node},references:a}]:void 0}(r,t.kind,n,144===t.kind?u:void 0)}if(e.isStaticModifier(t)&&e.isClassStaticBlockDeclaration(t.parent))return [{definition:{type:2,node:t},references:[c(t)]}];if(e.isJumpStatementTarget(t)){var i=e.getTargetLabel(t.parent,t.text);return i&&S(i.parent,i)}return e.isLabelOfLabeledStatement(t)?S(t.parent,t):e.isThis(t)?function(t,r,n){var i=e.getThisContainer(t,!1),a=32;switch(i.kind){case 168:case 167:if(e.isObjectLiteralMethod(i)){a&=e.getSyntacticModifierFlags(i),i=i.parent;break}case 166:case 165:case 170:case 171:case 172:a&=e.getSyntacticModifierFlags(i),i=i.parent;break;case 303:if(e.isExternalModule(i)||M(t))return;case 255:case 212:break;default:return}var o=e.flatMap(303===i.kind?r:[i.getSourceFile()],(function(t){return n.throwIfCancellationRequested(),b(t,"this",e.isSourceFile(i)?t:i).filter((function(t){if(!e.isThis(t))return !1;var r=e.getThisContainer(t,!1);switch(i.kind){case 212:case 255:return i.symbol===r.symbol;case 168:case 167:return e.isObjectLiteralMethod(i)&&i.symbol===r.symbol;case 225:case 256:case 204:return r.parent&&i.symbol===r.parent.symbol&&e.isStatic(r)===!!a;case 303:return 303===r.kind&&!e.isExternalModule(r)&&!M(t)}}))})).map((function(e){return c(e)}));return [{definition:{type:3,node:e.firstDefined(o,(function(t){return e.isParameter(t.node.parent)?t.node:void 0}))||t},references:o}]}(t,r,n):106===t.kind?function(t){var r=e.getSuperContainer(t,!1);if(r){var n=32;switch(r.kind){case 166:case 165:case 168:case 167:case 170:case 171:case 172:n&=e.getSyntacticModifierFlags(r),r=r.parent;break;default:return}var i=r.getSourceFile(),a=e.mapDefined(b(i,"super",r),(function(t){if(106===t.kind){var i=e.getSuperContainer(t,!1);return i&&e.isStatic(i)===!!n&&i.parent.symbol===r.symbol?c(t):void 0}}));return [{definition:{type:0,symbol:r.symbol},references:a}]}}(t):void 0}(r,d,p);if(x)return x}var D=s.getTypeChecker(),T=D.getSymbolAtLocation(e.isConstructorDeclaration(r)&&r.parent.name||r);if(T){if("export="===T.escapedName)return l(s,T.parent,!1,d,g);var C=a(T,s,d,p,f,g);if(C&&!(33554432&T.flags))return C;var E=i(r,T,D),k=E&&a(E,s,d,p,f,g);return o(s,C,_(T,r,d,g,D,p,f),k)}if(!f.implementations&&e.isStringLiteralLike(r)){if(e.isModuleSpecifierLike(r)){var N=s.getFileIncludeReasons(),F=null===(y=null===(m=r.getSourceFile().resolvedModules)||void 0===m?void 0:m.get(r.text,e.getModeForUsageLocation(r.getSourceFile(),r)))||void 0===y?void 0:y.resolvedFileName,A=F?s.getSourceFile(F):void 0;if(A)return [{definition:{type:4,node:r},references:n(A,N,s)||e.emptyArray}]}return function(t,r,n,i){var a=e.getContextualTypeFromParentOrAncestorTypeNode(t,n),o=e.flatMap(r,(function(r){return i.throwIfCancellationRequested(),e.mapDefined(b(r,t.text),(function(r){if(e.isStringLiteralLike(r)&&r.text===t.text){if(!a)return c(r,2);var i=e.getContextualTypeFromParentOrAncestorTypeNode(r,n);if(a!==n.getStringType()&&a===i)return c(r,2)}}))}));return [{definition:{type:4,node:t},references:o}]}(r,d,D,p)}},r.getReferencesForFileName=function(t,r,i,a){var o,s;void 0===a&&(a=new e.Set(i.map((function(e){return e.fileName}))));var c=null===(o=r.getSourceFile(t))||void 0===o?void 0:o.symbol;if(c)return (null===(s=l(r,c,!1,i,a)[0])||void 0===s?void 0:s.references)||e.emptyArray;var u=r.getFileIncludeReasons(),_=r.getSourceFile(t);return _&&u&&n(_,u,r)||e.emptyArray},function(e){e[e.None=0]="None",e[e.Constructor=1]="Constructor",e[e.Class=2]="Class";}(p||(p={}));var f=function(){function r(t,r,n,i,a,o,s,c){this.sourceFiles=t,this.sourceFilesSet=r,this.specialSearchKind=n,this.checker=i,this.cancellationToken=a,this.searchMeaning=o,this.options=s,this.result=c,this.inheritsFromCache=new e.Map,this.markSeenContainingTypeReference=e.nodeSeenTracker(),this.markSeenReExportRHS=e.nodeSeenTracker(),this.symbolIdToReferences=[],this.sourceFileToSeenSymbols=[];}return r.prototype.includesSourceFile=function(e){return this.sourceFilesSet.has(e.fileName)},r.prototype.getImportSearches=function(e,r){return this.importTracker||(this.importTracker=t.createImportTracker(this.sourceFiles,this.sourceFilesSet,this.checker,this.cancellationToken)),this.importTracker(e,r,2===this.options.use)},r.prototype.createSearch=function(t,r,n,i){void 0===i&&(i={});var a=i.text,o=void 0===a?e.stripQuotes(e.symbolName(e.getLocalSymbolForExportDefault(r)||function(t){if(33555968&t.flags){var r=t.declarations&&e.find(t.declarations,(function(t){return !e.isSourceFile(t)&&!e.isModuleDeclaration(t)}));return r&&r.symbol}}(r)||r)):a,s=i.allSearchSymbols,c=void 0===s?[r]:s;return {symbol:r,comingFrom:n,text:o,escapedText:e.escapeLeadingUnderscores(o),parents:this.options.implementations&&t?function(t,r,n){var i=e.isRightSideOfPropertyAccess(t)?t.parent:void 0,a=i&&n.getTypeAtLocation(i.expression),o=e.mapDefined(a&&(a.isUnionOrIntersection()?a.types:a.symbol===r.parent?void 0:[a]),(function(e){return e.symbol&&96&e.symbol.flags?e.symbol:void 0}));return 0===o.length?void 0:o}(t,r,this.checker):void 0,allSearchSymbols:c,includes:function(t){return e.contains(c,t)}}},r.prototype.referenceAdder=function(t){var r=e.getSymbolId(t),n=this.symbolIdToReferences[r];return n||(n=this.symbolIdToReferences[r]=[],this.result.push({definition:{type:0,symbol:t},references:n})),function(e,t){return n.push(c(e,t))}},r.prototype.addStringOrCommentReference=function(e,t){this.result.push({definition:void 0,references:[{kind:0,fileName:e,textSpan:t}]});},r.prototype.markSearchedSymbols=function(t,r){for(var n=e.getNodeId(t),i=this.sourceFileToSeenSymbols[n]||(this.sourceFileToSeenSymbols[n]=new e.Set),a=!1,o=0,s=r;o<s.length;o++){var c=s[o];a=e.tryAddToSet(i,e.getSymbolId(c))||a;}return a},r}();function g(e,t,r,n){var i=n.getImportSearches(t,r),a=i.importSearches,o=i.singleReferences,s=i.indirectUsers;if(o.length)for(var c=n.referenceAdder(t),l=0,u=o;l<u.length;l++){var _=u[l];m(_,n)&&c(_);}for(var d=0,p=a;d<p.length;d++){var f=p[d],g=f[0],y=f[1];T(g.getSourceFile(),n.createSearch(g,y,1),n);}if(s.length){var h=void 0;switch(r.exportKind){case 0:h=n.createSearch(e,t,1);break;case 1:h=2===n.options.use?void 0:n.createSearch(e,t,1,{text:"default"});}if(h)for(var b=0,x=s;b<x.length;b++)v(x[b],h,n);}}function m(t,r){return !(!E(t,r)||2===r.options.use&&(!e.isIdentifier(t)||e.isImportOrExportSpecifier(t.parent)&&"default"===t.escapedText))}function y(e,t){if(e.declarations)for(var r=0,n=e.declarations;r<n.length;r++){var i=n[r],a=i.getSourceFile();T(a,t.createSearch(i,e,0),t,t.includesSourceFile(a));}}function v(t,r,n){void 0!==e.getNameTable(t).get(r.escapedText)&&T(t,r,n);}function h(t,r,n,i,a){void 0===a&&(a=n);var o=e.isParameterPropertyDeclaration(t.parent,t.parent.parent)?e.first(r.getSymbolsOfParameterPropertyDeclaration(t.parent,t.text)):r.getSymbolAtLocation(t);if(o)for(var s=0,c=b(n,o.name,a);s<c.length;s++){var l=c[s];if(e.isIdentifier(l)&&l!==t&&l.escapedText===t.escapedText){var u=r.getSymbolAtLocation(l);if(u===o||r.getShorthandAssignmentValueSymbol(l.parent)===o||e.isExportSpecifier(l.parent)&&F(l,u,l.parent,r)===o){var _=i(l);if(_)return _}}}}function b(t,r,n){return void 0===n&&(n=t),D(t,r,n).map((function(r){return e.getTouchingPropertyName(t,r)}))}function D(t,r,n){void 0===n&&(n=t);var i=[];if(!r||!r.length)return i;for(var a=t.text,o=a.length,s=r.length,c=a.indexOf(r,n.pos);c>=0&&!(c>n.end);){var l=c+s;0!==c&&e.isIdentifierPart(a.charCodeAt(c-1),99)||l!==o&&e.isIdentifierPart(a.charCodeAt(l),99)||i.push(c),c=a.indexOf(r,c+s+1);}return i}function S(t,r){var n=t.getSourceFile(),i=r.text,a=e.mapDefined(b(n,i,t),(function(t){return t===r||e.isJumpStatementTarget(t)&&e.getTargetLabel(t,i)===r?c(t):void 0}));return [{definition:{type:1,node:r},references:a}]}function T(e,t,r,n){return void 0===n&&(n=!0),r.cancellationToken.throwIfCancellationRequested(),C(e,e,t,r,n)}function C(e,t,r,n,i){if(n.markSearchedSymbols(t,r.allSearchSymbols))for(var a=0,o=D(t,r.text,e);a<o.length;a++)k(t,o[a],r,n,i);}function E(t,r){return !!(e.getMeaningFromLocation(t)&r.searchMeaning)}function k(r,n,i,a,o){var s=e.getTouchingPropertyName(r,n);if(function(t,r){switch(t.kind){case 80:if(e.isJSDocMemberName(t.parent))return !0;case 79:return t.text.length===r.length;case 14:case 10:var n=t;return (e.isLiteralNameOfPropertyDeclarationOrIndexAccess(n)||e.isNameOfModuleDeclaration(t)||e.isExpressionOfExternalModuleImportEqualsDeclaration(t)||e.isCallExpression(t.parent)&&e.isBindableObjectDefinePropertyCall(t.parent)&&t.parent.arguments[1]===t)&&n.text.length===r.length;case 8:return e.isLiteralNameOfPropertyDeclarationOrIndexAccess(t)&&t.text.length===r.length;case 88:return "default".length===r.length;default:return !1}}(s,i.text)){if(E(s,a)){var c=a.checker.getSymbolAtLocation(s);if(c){var l=s.parent;if(!e.isImportSpecifier(l)||l.propertyName!==s){if(e.isExportSpecifier(l))return e.Debug.assert(79===s.kind),void N(s,c,l,i,a,o);var u=function(t,r,n,i){var a=i.checker;return R(r,n,a,!1,2!==i.options.use||!!i.options.providePrefixAndSuffixTextForRename,(function(n,i,a,o){return a&&B(r)!==B(a)&&(a=void 0),t.includes(a||i||n)?{symbol:!i||6&e.getCheckFlags(n)?n:i,kind:o}:void 0}),(function(e){return !(t.parents&&!t.parents.some((function(t){return O(e.parent,t,i.inheritsFromCache,a)})))}))}(i,c,s,a);if(u){switch(a.specialSearchKind){case 0:o&&A(s,u,a);break;case 1:!function(t,r,n,i){e.isNewExpressionTarget(t)&&A(t,n.symbol,i);var a,o=function(){return i.referenceAdder(n.symbol)};if(e.isClassLike(t.parent))e.Debug.assert(88===t.kind||t.parent.name===t),function(t,r,n){var i=P(t);if(i&&i.declarations)for(var a=0,o=i.declarations;a<o.length;a++){var s=o[a],c=e.findChildOfKind(s,134,r);e.Debug.assert(170===s.kind&&!!c),n(c);}t.exports&&t.exports.forEach((function(t){var r=t.valueDeclaration;if(r&&168===r.kind){var i=r.body;i&&z(i,108,(function(t){e.isNewExpressionTarget(t)&&n(t);}));}}));}(n.symbol,r,o());else {var s=(a=t,e.tryGetClassExtendingExpressionWithTypeArguments(e.climbPastPropertyAccess(a).parent));s&&(function(t,r){var n=P(t.symbol);if(n&&n.declarations)for(var i=0,a=n.declarations;i<a.length;i++){var o=a[i];e.Debug.assert(170===o.kind);var s=o.body;s&&z(s,106,(function(t){e.isCallExpressionTarget(t)&&r(t);}));}}(s,o()),function(e,t){if(!function(e){return !!P(e.symbol)}(e)){var r=e.symbol,n=t.createSearch(void 0,r,void 0);d(r,t,n);}}(s,i));}}(s,r,i,a);break;case 2:!function(t,r,n){A(t,r.symbol,n);var i=t.parent;if(2!==n.options.use&&e.isClassLike(i)){e.Debug.assert(i.name===t);for(var a=n.referenceAdder(r.symbol),o=0,s=i.members;o<s.length;o++){var c=s[o];e.isMethodOrAccessor(c)&&e.isStatic(c)&&c.body&&c.body.forEachChild((function t(r){108===r.kind?a(r):e.isFunctionLike(r)||e.isClassLike(r)||r.forEachChild(t);}));}}}(s,i,a);break;default:e.Debug.assertNever(a.specialSearchKind);}e.isInJSFile(s)&&202===s.parent.kind&&e.isRequireVariableDeclaration(s.parent)&&!(c=s.parent.symbol)||function(e,r,n,i){var a=t.getImportOrExportSymbol(e,r,i.checker,1===n.comingFrom);if(a){var o=a.symbol;0===a.kind?U(i.options)||y(o,i):g(e,o,a.exportInfo,i);}}(s,c,i,a);}else !function(t,r,n){var i=t.flags,a=t.valueDeclaration,o=n.checker.getShorthandAssignmentValueSymbol(a),s=a&&e.getNameOfDeclaration(a);33554432&i||!s||!r.includes(o)||A(s,o,n);}(c,i,a);}}}}else !a.options.implementations&&(a.options.findInStrings&&e.isInString(r,n)||a.options.findInComments&&e.isInNonReferenceComment(r,n))&&a.addStringOrCommentReference(r.fileName,e.createTextSpan(n,i.text.length));}function N(r,n,i,a,o,s,c){e.Debug.assert(!c||!!o.options.providePrefixAndSuffixTextForRename,"If alwaysGetReferences is true, then prefix/suffix text must be enabled");var l=i.parent,u=i.propertyName,_=i.name,d=l.parent,p=F(r,n,i,o.checker);if(c||a.includes(p)){if(u?r===u?(d.moduleSpecifier||b(),s&&2!==o.options.use&&o.markSeenReExportRHS(_)&&A(_,e.Debug.checkDefined(i.symbol),o)):o.markSeenReExportRHS(r)&&b():2===o.options.use&&"default"===_.escapedText||b(),!U(o.options)||c){var f=88===r.originalKeywordKind||88===i.name.originalKeywordKind?1:0,m=e.Debug.checkDefined(i.symbol),v=t.getExportInfo(m,f,o.checker);v&&g(r,m,v,o);}if(1!==a.comingFrom&&d.moduleSpecifier&&!u&&!U(o.options)){var h=o.checker.getExportSpecifierLocalTargetSymbol(i);h&&y(h,o);}}function b(){s&&A(r,p,o);}}function F(t,r,n,i){return function(t,r){var n=r.parent,i=r.propertyName,a=r.name;return e.Debug.assert(i===t||a===t),i?i===t:!n.parent.moduleSpecifier}(t,n)&&i.getExportSpecifierLocalTargetSymbol(n)||r}function A(t,r,n){var i="kind"in r?r:{kind:void 0,symbol:r},a=i.kind,o=i.symbol,s=n.referenceAdder(o);n.options.implementations?function(t,r,n){var i;if(!e.isDeclarationName(t)||(8388608&(i=t.parent).flags?e.isInterfaceDeclaration(i)||e.isTypeAliasDeclaration(i):!(e.isVariableLike(i)?e.hasInitializer(i):e.isFunctionLikeDeclaration(i)?i.body:e.isClassLike(i)||e.isModuleOrEnumDeclaration(i)))){if(79===t.kind){295===t.parent.kind&&J(t,n.checker,r);var a=w(t);if(a)r(a);else {var o=e.findAncestor(t,(function(t){return !e.isQualifiedName(t.parent)&&!e.isTypeNode(t.parent)&&!e.isTypeElement(t.parent)})),s=o.parent;if(e.hasType(s)&&s.type===o&&n.markSeenContainingTypeReference(s))if(e.hasInitializer(s))l(s.initializer);else if(e.isFunctionLike(s)&&s.body){var c=s.body;234===c.kind?e.forEachReturnStatement(c,(function(e){e.expression&&l(e.expression);})):l(c);}else e.isAssertionExpression(s)&&l(s.expression);}}}else r(t);function l(e){I(e)&&r(e);}}(t,s,n):s(t,a);}function P(e){return e.members&&e.members.get("__constructor")}function w(t){return e.isIdentifier(t)||e.isPropertyAccessExpression(t)?w(t.parent):e.isExpressionWithTypeArguments(t)?e.tryCast(t.parent.parent,e.isClassLike):void 0}function I(e){switch(e.kind){case 211:return I(e.expression);case 213:case 212:case 204:case 225:case 203:return !0;default:return !1}}function O(t,r,n,i){if(t===r)return !0;var a=e.getSymbolId(t)+","+e.getSymbolId(r),o=n.get(a);if(void 0!==o)return o;n.set(a,!1);var s=!!t.declarations&&t.declarations.some((function(t){return e.getAllSuperTypeNodes(t).some((function(e){var t=i.getTypeAtLocation(e);return !!t&&!!t.symbol&&O(t.symbol,r,n,i)}))}));return n.set(a,s),s}function M(e){return 79===e.kind&&163===e.parent.kind&&e.parent.name===e}function L(e,t,r,n,i,a){var o=[];return R(e,t,r,n,!(n&&i),(function(t,r,n){n&&B(e)!==B(n)&&(n=void 0),o.push(n||r||t);}),(function(){return !a})),o}function R(t,r,n,a,o,s,c){var l=e.getContainingObjectLiteralElement(r);if(l){var u=n.getShorthandAssignmentValueSymbol(r.parent);if(u&&a)return s(u,void 0,void 0,3);var _=n.getContextualType(l.parent),d=_&&e.firstDefined(e.getPropertySymbolsFromContextualType(l,n,_,!0),(function(e){return T(e,4)}));if(d)return d;var p=function(t,r){return e.isArrayLiteralOrObjectLiteralDestructuringPattern(t.parent.parent)?r.getPropertySymbolOfDestructuringAssignment(t):void 0}(r,n),f=p&&s(p,void 0,void 0,4);if(f)return f;var g=u&&s(u,void 0,void 0,3);if(g)return g}var m=i(r,t,n);if(m){var y=s(m,void 0,void 0,1);if(y)return y}var v=T(t);if(v)return v;if(t.valueDeclaration&&e.isParameterPropertyDeclaration(t.valueDeclaration,t.valueDeclaration.parent)){var h=n.getSymbolsOfParameterPropertyDeclaration(e.cast(t.valueDeclaration,e.isParameter),t.name);return e.Debug.assert(2===h.length&&!!(1&h[0].flags)&&!!(4&h[1].flags)),T(1&t.flags?h[1]:h[0])}var b=e.getDeclarationOfKind(t,274);if(!a||b&&!b.propertyName){var x=b&&n.getExportSpecifierLocalTargetSymbol(b);if(x){var D=s(x,void 0,void 0,1);if(D)return D}}if(!a){var S=void 0;return (S=o?e.isObjectBindingElementWithoutPropertyName(r.parent)?e.getPropertySymbolFromBindingElement(n,r.parent):void 0:C(t,n))&&T(S,4)}if(e.Debug.assert(a),o)return (S=C(t,n))&&T(S,4);function T(t,r){return e.firstDefined(n.getRootSymbols(t),(function(i){return s(t,i,void 0,r)||(i.parent&&96&i.parent.flags&&c(i)?function(t,r,n,i){var a=new e.Map;return function t(o){if(96&o.flags&&e.addToSeen(a,e.getSymbolId(o)))return e.firstDefined(o.declarations,(function(a){return e.firstDefined(e.getAllSuperTypeNodes(a),(function(a){var o=n.getTypeAtLocation(a),s=o&&o.symbol&&n.getPropertyOfType(o,r);return o&&s&&(e.firstDefined(n.getRootSymbols(s),i)||t(o.symbol))}))}))}(t)}(i.parent,i.name,n,(function(e){return s(t,i,e,r)})):void 0)}))}function C(t,r){var n=e.getDeclarationOfKind(t,202);if(n&&e.isObjectBindingElementWithoutPropertyName(n))return e.getPropertySymbolFromBindingElement(r,n)}}function B(t){return !!t.valueDeclaration&&!!(32&e.getEffectiveModifierFlags(t.valueDeclaration))}function j(t,r){var n=e.getMeaningFromLocation(t),i=r.declarations;if(i){var a=void 0;do{a=n;for(var o=0,s=i;o<s.length;o++){var c=s[o],l=e.getMeaningFromDeclaration(c);l&n&&(n|=l);}}while(n!==a)}return n}function J(t,r,n){var i=r.getSymbolAtLocation(t),a=r.getShorthandAssignmentValueSymbol(i.valueDeclaration);if(a)for(var o=0,s=a.getDeclarations();o<s.length;o++){var c=s[o];1&e.getMeaningFromDeclaration(c)&&n(c);}}function z(t,r,n){e.forEachChild(t,(function(e){e.kind===r&&n(e),z(e,r,n);}));}function U(e){return 2===e.use&&e.providePrefixAndSuffixTextForRename}r.eachExportReference=function(r,n,i,a,o,s,c,l){for(var u=t.createImportTracker(r,new e.Set(r.map((function(e){return e.fileName}))),n,i)(a,{exportKind:c?1:0,exportingModuleSymbol:o},!1),_=u.importSearches,d=u.indirectUsers,p=0,f=_;p<f.length;p++)l(f[p][0]);for(var g=0,m=d;g<m.length;g++)for(var y=0,v=b(m[g],c?"default":s);y<v.length;y++){var h=v[y],x=n.getSymbolAtLocation(h),D=e.some(null==x?void 0:x.declarations,(function(t){return !!e.tryCast(t,e.isExportAssignment)}));!e.isIdentifier(h)||e.isImportOrExportSpecifier(h.parent)||x!==a&&!D||l(h);}},r.isSymbolReferencedInFile=function(e,t,r,n){return void 0===n&&(n=r),h(e,t,r,(function(){return !0}),n)||!1},r.eachSymbolReferenceInFile=h,r.someSignatureUsage=function(t,r,n,i){if(!t.name||!e.isIdentifier(t.name))return !1;for(var a=e.Debug.checkDefined(n.getSymbolAtLocation(t.name)),o=0,s=r;o<s.length;o++)for(var c=0,l=b(s[o],a.name);c<l.length;c++){var u=l[c];if(e.isIdentifier(u)&&u!==t.name&&u.escapedText===t.name.escapedText){var _=e.climbPastPropertyAccess(u),d=e.isCallExpression(_.parent)&&_.parent.expression===_?_.parent:void 0,p=n.getSymbolAtLocation(u);if(p&&n.getRootSymbols(p).some((function(e){return e===a}))&&i(u,d))return !0}}return !1},r.getIntersectingMeaningFromDeclarations=j,r.getReferenceEntriesForShorthandPropertyAssignment=J;}(r=t.Core||(t.Core={}));}(e.FindAllReferences||(e.FindAllReferences={}));}(t),function(e){!function(t){function r(t){return (e.isFunctionExpression(t)||e.isArrowFunction(t)||e.isClassExpression(t))&&e.isVariableDeclaration(t.parent)&&t===t.parent.initializer&&e.isIdentifier(t.parent.name)&&!!(2&e.getCombinedNodeFlags(t.parent))}function n(t){return e.isSourceFile(t)||e.isModuleDeclaration(t)||e.isFunctionDeclaration(t)||e.isFunctionExpression(t)||e.isClassDeclaration(t)||e.isClassExpression(t)||e.isClassStaticBlockDeclaration(t)||e.isMethodDeclaration(t)||e.isMethodSignature(t)||e.isGetAccessorDeclaration(t)||e.isSetAccessorDeclaration(t)}function i(t){return e.isSourceFile(t)||e.isModuleDeclaration(t)&&e.isIdentifier(t.name)||e.isFunctionDeclaration(t)||e.isClassDeclaration(t)||e.isClassStaticBlockDeclaration(t)||e.isMethodDeclaration(t)||e.isMethodSignature(t)||e.isGetAccessorDeclaration(t)||e.isSetAccessorDeclaration(t)||function(t){return (e.isFunctionExpression(t)||e.isClassExpression(t))&&e.isNamedDeclaration(t)}(t)||r(t)}function a(t){return e.isSourceFile(t)?t:e.isNamedDeclaration(t)?t.name:r(t)?t.parent.name:e.Debug.checkDefined(t.modifiers&&e.find(t.modifiers,o))}function o(e){return 88===e.kind}function s(e,t){var r=a(t);return r&&e.getSymbolAtLocation(r)}function c(t,r){if(r.body)return r;if(e.isConstructorDeclaration(r))return e.getFirstConstructorWithBody(r.parent);if(e.isFunctionDeclaration(r)||e.isMethodDeclaration(r)){var n=s(t,r);return n&&n.valueDeclaration&&e.isFunctionLikeDeclaration(n.valueDeclaration)&&n.valueDeclaration.body?n.valueDeclaration:void 0}return r}function l(t,r){var n,a=s(t,r);if(a&&a.declarations){var o=e.indicesOf(a.declarations),c=e.map(a.declarations,(function(e){return {file:e.getSourceFile().fileName,pos:e.pos}}));o.sort((function(t,r){return e.compareStringsCaseSensitive(c[t].file,c[r].file)||c[t].pos-c[r].pos}));for(var l=void 0,u=0,_=e.map(o,(function(e){return a.declarations[e]}));u<_.length;u++){var d=_[u];i(d)&&(l&&l.parent===d.parent&&l.end===d.pos||(n=e.append(n,d)),l=d);}}return n}function u(t,r){var n,i,a;return e.isClassStaticBlockDeclaration(r)?r:e.isFunctionLikeDeclaration(r)?null!==(i=null!==(n=c(t,r))&&void 0!==n?n:l(t,r))&&void 0!==i?i:r:null!==(a=l(t,r))&&void 0!==a?a:r}function _(t,a){for(var o=t.getTypeChecker(),s=!1;;){if(i(a))return u(o,a);var c;if(n(a))return (c=e.findAncestor(a,i))&&u(o,c);if(e.isDeclarationName(a))return i(a.parent)?u(o,a.parent):n(a.parent)?(c=e.findAncestor(a.parent,i))&&u(o,c):e.isVariableDeclaration(a.parent)&&a.parent.initializer&&r(a.parent.initializer)?a.parent.initializer:void 0;if(e.isConstructorDeclaration(a))return i(a.parent)?a.parent:void 0;if(124!==a.kind||!e.isClassStaticBlockDeclaration(a.parent)){if(e.isVariableDeclaration(a)&&a.initializer&&r(a.initializer))return a.initializer;if(!s){var l=o.getSymbolAtLocation(a);if(l&&(2097152&l.flags&&(l=o.getAliasedSymbol(l)),l.valueDeclaration)){s=!0,a=l.valueDeclaration;continue}}return}a=a.parent;}}function d(t,n){var i=n.getSourceFile(),a=function(t,n){if(e.isSourceFile(n))return {text:n.fileName,pos:0,end:0};if((e.isFunctionDeclaration(n)||e.isClassDeclaration(n))&&!e.isNamedDeclaration(n)){var i=n.modifiers&&e.find(n.modifiers,o);if(i)return {text:"default",pos:i.getStart(),end:i.getEnd()}}if(e.isClassStaticBlockDeclaration(n)){var a=n.getSourceFile(),s=e.skipTrivia(a.text,e.moveRangePastModifiers(n).pos),c=s+6,l=(_=(u=t.getTypeChecker()).getSymbolAtLocation(n.parent))?"".concat(u.symbolToString(_,n.parent)," "):"";return {text:"".concat(l,"static {}"),pos:s,end:c}}var u,_,d=r(n)?n.parent.name:e.Debug.checkDefined(e.getNameOfDeclaration(n),"Expected call hierarchy item to have a name"),p=e.isIdentifier(d)?e.idText(d):e.isStringOrNumericLiteralLike(d)?d.text:e.isComputedPropertyName(d)&&e.isStringOrNumericLiteralLike(d.expression)?d.expression.text:void 0;if(void 0===p&&(_=(u=t.getTypeChecker()).getSymbolAtLocation(d))&&(p=u.symbolToString(_,n)),void 0===p){var f=e.createPrinter({removeComments:!0,omitTrailingSemicolon:!0});p=e.usingSingleLineStringWriter((function(e){return f.writeNode(4,n,n.getSourceFile(),e)}));}return {text:p,pos:d.getStart(),end:d.getEnd()}}(t,n),s=function(t){var n,i;if(r(t))return e.isModuleBlock(t.parent.parent.parent.parent)&&e.isIdentifier(t.parent.parent.parent.parent.parent.name)?t.parent.parent.parent.parent.parent.name.getText():void 0;switch(t.kind){case 171:case 172:case 168:return 204===t.parent.kind?null===(n=e.getAssignedName(t.parent))||void 0===n?void 0:n.getText():null===(i=e.getNameOfDeclaration(t.parent))||void 0===i?void 0:i.getText();case 255:case 256:case 260:if(e.isModuleBlock(t.parent)&&e.isIdentifier(t.parent.parent.name))return t.parent.parent.name.getText()}}(n),c=e.getNodeKind(n),l=e.getNodeModifiers(n),u=e.createTextSpanFromBounds(e.skipTrivia(i.text,n.getFullStart(),!1,!0),n.getEnd()),_=e.createTextSpanFromBounds(a.pos,a.end);return {file:i.fileName,kind:c,kindModifiers:l,name:a.text,containerName:s,span:u,selectionSpan:_}}function p(e){return void 0!==e}function f(t){if(1===t.kind){var r=t.node;if(e.isCallOrNewExpressionTarget(r,!0,!0)||e.isTaggedTemplateTag(r,!0,!0)||e.isDecoratorTarget(r,!0,!0)||e.isJsxOpeningLikeElementTagName(r,!0,!0)||e.isRightSideOfPropertyAccess(r)||e.isArgumentExpressionOfElementAccess(r)){var n=r.getSourceFile();return {declaration:e.findAncestor(r,i)||n,range:e.createTextRangeFromNode(r,n)}}}}function g(t){return e.getNodeId(t.declaration)}t.resolveCallHierarchyDeclaration=_,t.createCallHierarchyItem=d,t.getIncomingCalls=function(t,r,n){if(e.isSourceFile(r)||e.isModuleDeclaration(r)||e.isClassStaticBlockDeclaration(r))return [];var i=a(r),o=e.filter(e.FindAllReferences.findReferenceOrRenameEntries(t,n,t.getSourceFiles(),i,0,{use:1},f),p);return o?e.group(o,g,(function(r){return function(t,r){return {from:d(t,r[0].declaration),fromSpans:e.map(r,(function(t){return e.createTextSpanFromRange(t.range)}))}}(t,r)})):[]},t.getOutgoingCalls=function(t,r){return 8388608&r.flags||e.isMethodSignature(r)?[]:e.group(function(t,r){var n=[],a=function(t,r){function n(n){var i=e.isTaggedTemplateExpression(n)?n.tag:e.isJsxOpeningLikeElement(n)?n.tagName:e.isAccessExpression(n)||e.isClassStaticBlockDeclaration(n)?n:n.expression,a=_(t,i);if(a){var o=e.createTextRangeFromNode(i,n.getSourceFile());if(e.isArray(a))for(var s=0,c=a;s<c.length;s++){var l=c[s];r.push({declaration:l,range:o});}else r.push({declaration:a,range:o});}}return function t(r){if(r&&!(8388608&r.flags))if(i(r)){if(e.isClassLike(r))for(var a=0,o=r.members;a<o.length;a++){var s=o[a];s.name&&e.isComputedPropertyName(s.name)&&t(s.name.expression);}}else {switch(r.kind){case 79:case 264:case 265:case 271:case 257:case 258:return;case 169:return void n(r);case 210:case 228:return void t(r.expression);case 253:case 163:return t(r.name),void t(r.initializer);case 207:case 208:return n(r),t(r.expression),void e.forEach(r.arguments,t);case 209:return n(r),t(r.tag),void t(r.template);case 279:case 278:return n(r),t(r.tagName),void t(r.attributes);case 164:return n(r),void t(r.expression);case 205:case 206:n(r),e.forEachChild(r,t);}e.isPartOfTypeNode(r)||e.forEachChild(r,t);}}}(t,n);switch(r.kind){case 303:!function(t,r){e.forEach(t.statements,r);}(r,a);break;case 260:!function(t,r){!e.hasSyntacticModifier(t,2)&&t.body&&e.isModuleBlock(t.body)&&e.forEach(t.body.statements,r);}(r,a);break;case 255:case 212:case 213:case 168:case 171:case 172:!function(t,r,n){var i=c(t,r);i&&(e.forEach(i.parameters,n),n(i.body));}(t.getTypeChecker(),r,a);break;case 256:case 225:!function(t,r){e.forEach(t.decorators,r);var n=e.getClassExtendsHeritageElement(t);n&&r(n.expression);for(var i=0,a=t.members;i<a.length;i++){var o=a[i];e.forEach(o.decorators,r),e.isPropertyDeclaration(o)?r(o.initializer):e.isConstructorDeclaration(o)&&o.body?(e.forEach(o.parameters,r),r(o.body)):e.isClassStaticBlockDeclaration(o)&&r(o);}}(r,a);break;case 169:!function(e,t){t(e.body);}(r,a);break;default:e.Debug.assertNever(r);}return n}(t,r),g,(function(r){return function(t,r){return {to:d(t,r[0].declaration),fromSpans:e.map(r,(function(t){return e.createTextSpanFromRange(t.range)}))}}(t,r)}))};}(e.CallHierarchy||(e.CallHierarchy={}));}(t),function(e){function t(t,n,i,a){var o=i(t);return function(t){var s=a&&a.tryGetSourcePosition({fileName:t,pos:0}),c=function(t){if(i(t)===o)return n;var r=e.tryRemoveDirectoryPrefix(t,o,i);return void 0===r?void 0:n+"/"+r}(s?s.fileName:t);return s?void 0===c?void 0:function(t,n,i,a){var o=e.getRelativePathFromFile(t,n,a);return r(e.getDirectoryPath(i),o)}(s.fileName,c,t,i):c}}function r(t,r){return e.ensurePathIsNonModuleName(function(t,r){return e.normalizePath(e.combinePaths(t,r))}(t,r))}function n(t,r,n,i){if(r){if(r.resolvedModule){var a=s(r.resolvedModule.resolvedFileName);if(a)return a}return e.forEach(r.failedLookupLocations,(function(t){var r=n(t);return r&&e.find(i,(function(e){return e.fileName===r}))?o(t):void 0}))||e.pathIsRelative(t.text)&&e.forEach(r.failedLookupLocations,o)||r.resolvedModule&&{newFileName:r.resolvedModule.resolvedFileName,updated:!1}}function o(t){return e.endsWith(t,"/package.json")?void 0:s(t)}function s(e){var t=n(e);return t&&{newFileName:t,updated:!0}}}function i(t,r){return e.createRange(t.getStart(r)+1,t.end-1)}function a(t,r){if(e.isObjectLiteralExpression(t))for(var n=0,i=t.properties;n<i.length;n++){var a=i[n];e.isPropertyAssignment(a)&&e.isStringLiteral(a.name)&&r(a,a.name.text);}}e.getEditsForFileRename=function(o,s,c,l,u,_,d){var p=e.hostUsesCaseSensitiveFileNames(l),f=e.createGetCanonicalFileName(p),g=t(s,c,f,d),m=t(c,s,f,d);return e.textChanges.ChangeTracker.with({host:l,formatContext:u,preferences:_},(function(t){!function(t,n,o,s,c,l,u){var _=t.getCompilerOptions().configFile;if(_){var d=e.getDirectoryPath(_.fileName),p=e.getTsConfigObjectLiteralExpression(_);p&&a(p,(function(t,r){switch(r){case"files":case"include":case"exclude":if(f(t)||"include"!==r||!e.isArrayLiteralExpression(t.initializer))return;var i=e.mapDefined(t.initializer.elements,(function(t){return e.isStringLiteral(t)?t.text:void 0}));if(0===i.length)return;var o=e.getFileMatcherPatterns(d,[],i,u,l);return void(e.getRegexFromPattern(e.Debug.checkDefined(o.includeFilePattern),u).test(s)&&!e.getRegexFromPattern(e.Debug.checkDefined(o.includeFilePattern),u).test(c)&&n.insertNodeAfter(_,e.last(t.initializer.elements),e.factory.createStringLiteral(m(c))));case"compilerOptions":return void a(t.initializer,(function(t,r){var n=e.getOptionFromName(r);n&&(n.isFilePath||"list"===n.type&&n.element.isFilePath)?f(t):"paths"===r&&a(t.initializer,(function(t){if(e.isArrayLiteralExpression(t.initializer))for(var r=0,n=t.initializer.elements;r<n.length;r++)g(n[r]);}));}))}}));}function f(t){for(var r=!1,n=0,i=e.isArrayLiteralExpression(t.initializer)?t.initializer.elements:[t.initializer];n<i.length;n++)r=g(i[n])||r;return r}function g(t){if(!e.isStringLiteral(t))return !1;var a=r(d,t.text),s=o(a);return void 0!==s&&(n.replaceRangeWithText(_,i(t,_),m(s)),!0)}function m(t){return e.getRelativePathFromDirectory(d,t,!u)}}(o,t,g,s,c,l.getCurrentDirectory(),p),function(t,a,o,s,c,l){for(var u=t.getSourceFiles(),_=function(_){var d=o(_.fileName),p=null!=d?d:_.fileName,f=e.getDirectoryPath(p),g=s(_.fileName),m=g||_.fileName,y=e.getDirectoryPath(m),v=void 0!==d||void 0!==g;!function(t,r,n,a){for(var o=0,s=t.referencedFiles||e.emptyArray;o<s.length;o++){var c=s[o];void 0!==(_=n(c.fileName))&&_!==t.text.slice(c.pos,c.end)&&r.replaceRangeWithText(t,c,_);}for(var l=0,u=t.imports;l<u.length;l++){var _,d=u[l];void 0!==(_=a(d))&&_!==d.text&&r.replaceRangeWithText(t,i(d,t),_);}}(_,a,(function(t){if(e.pathIsRelative(t)){var n=r(y,t),i=o(n);return void 0===i?void 0:e.ensurePathIsNonModuleName(e.getRelativePathFromDirectory(f,i,l))}}),(function(r){var i=t.getTypeChecker().getSymbolAtLocation(r);if(!(null==i?void 0:i.declarations)||!i.declarations.some((function(t){return e.isAmbientModule(t)}))){var a=void 0!==g?n(r,e.resolveModuleName(r.text,m,t.getCompilerOptions(),c),o,u):function(t,r,i,a,o,s){if(t){var c=e.find(t.declarations,e.isSourceFile).fileName,l=s(c);return void 0===l?{newFileName:c,updated:!1}:{newFileName:l,updated:!0}}var u=e.getModeForUsageLocation(i,r);return n(r,o.resolveModuleNames?o.getResolvedModuleWithFailedLookupLocationsFromCache&&o.getResolvedModuleWithFailedLookupLocationsFromCache(r.text,i.fileName,u):a.getResolvedModuleWithFailedLookupLocationsFromCache(r.text,i.fileName,u),s,a.getSourceFiles())}(i,r,_,t,c,o);return void 0!==a&&(a.updated||v&&e.pathIsRelative(r.text))?e.moduleSpecifiers.updateModuleSpecifier(t.getCompilerOptions(),l(p),a.newFileName,e.createModuleSpecifierResolutionHost(t,c),r.text):void 0}}));},d=0,p=u;d<p.length;d++)_(p[d]);}(o,t,g,m,l,f);}))},e.getPathUpdater=t;}(t),function(e){!function(t){function r(t,r,i){var s,d,f,g=o(r,i,t),m=g&&[(s=g.reference.fileName,d=g.fileName,f=g.unverified,{fileName:d,textSpan:e.createTextSpanFromBounds(0,0),kind:"script",name:s,containerName:void 0,containerKind:void 0,unverified:f})]||e.emptyArray;if(null==g?void 0:g.file)return m;var y=e.getTouchingPropertyName(r,i);if(y!==r){var v=y.parent,h=t.getTypeChecker();if(158===y.kind||e.isJSDocOverrideTag(y)&&e.rangeContainsPosition(y.tagName,i))return function(t,r){var n=e.findAncestor(r,e.isClassElement);if(n&&n.name){var i=e.findAncestor(n,e.isClassLike);if(i){var a=e.getEffectiveBaseTypeNode(i),o=a?t.getTypeAtLocation(a):void 0;if(o){var s=e.unescapeLeadingUnderscores(e.getTextOfPropertyName(n.name)),c=e.hasStaticModifier(n)?t.getPropertyOfType(t.getTypeOfSymbolAtLocation(o.symbol,i),s):t.getPropertyOfType(o,s);if(c)return l(t,c,r)}}}}(h,y)||e.emptyArray;if(e.isJumpStatementTarget(y)){var b=e.getTargetLabel(y.parent,y.text);return b?[_(h,b,"label",y.text,void 0)]:void 0}if(e.isStaticModifier(y)&&e.isClassStaticBlockDeclaration(y.parent)){var x=y.parent.parent,D=c(x,h),S=e.filter(x.members,e.isClassStaticBlockDeclaration),T=D?h.symbolToString(D,x):"",C=y.getSourceFile();return e.map(S,(function(t){var r=e.moveRangePastModifiers(t).pos;return r=e.skipTrivia(C.text,r),_(h,t,"constructor","static {}",T,{start:r,length:"static".length})}))}var E=c(y,h);if(!E)return e.concatenate(m,function(t,r){return e.mapDefined(r.getIndexInfosAtLocation(t),(function(e){return e.declaration&&p(r,e.declaration)}))}(y,h));var k=function(t,r){var n=function(t){var r=e.findAncestor(t,(function(t){return !e.isRightSideOfPropertyAccess(t)})),n=null==r?void 0:r.parent;return n&&e.isCallLikeExpression(n)&&e.getInvokedExpression(n)===r?n:void 0}(r),i=n&&t.getResolvedSignature(n);return e.tryCast(i&&i.declaration,(function(t){return e.isFunctionLike(t)&&!e.isFunctionTypeNode(t)}))}(h,y);if(k&&(!e.isJsxOpeningLikeElement(y.parent)||!function(e){switch(e.kind){case 170:case 179:case 174:return !0;default:return !1}}(k))){var N=p(h,k);if(h.getRootSymbols(E).some((function(t){return function(t,r){return t===r.symbol||t===r.symbol.parent||e.isAssignmentExpression(r.parent)||!e.isCallLikeExpression(r.parent)&&t===r.parent.symbol}(t,k)})))return [N];var F=l(h,E,y,k)||e.emptyArray;return 106===y.kind?n$3([N],F,!0):n$3(n$3([],F,!0),[N],!1)}if(295===y.parent.kind){var A=h.getShorthandAssignmentValueSymbol(E.valueDeclaration),P=(null==A?void 0:A.declarations)?A.declarations.map((function(e){return u(e,h,A,y)})):e.emptyArray;return e.concatenate(P,a(h,y)||e.emptyArray)}if(e.isPropertyName(y)&&e.isBindingElement(v)&&e.isObjectBindingPattern(v.parent)&&y===(v.propertyName||v.name)){var w=e.getNameFromPropertyName(y),I=h.getTypeAtLocation(v.parent);return void 0===w?e.emptyArray:e.flatMap(I.isUnion()?I.types:[I],(function(e){var t=e.getProperty(w);return t&&l(h,t,y)}))}return e.concatenate(m,a(h,y)||l(h,E,y))}}function a(t,r){var n=e.getContainingObjectLiteralElement(r);if(n){var i=n&&t.getContextualType(n.parent);if(i)return e.flatMap(e.getPropertySymbolsFromContextualType(n,t,i,!1),(function(e){return l(t,e,r)}))}}function o(t,r,n){var i,a,o=f(t.referencedFiles,r);if(o)return (l=n.getSourceFileFromReference(t,o))&&{reference:o,fileName:l.fileName,file:l,unverified:!1};var s=f(t.typeReferenceDirectives,r);if(s){var c=n.getResolvedTypeReferenceDirectives().get(s.fileName);return (l=c&&n.getSourceFile(c.resolvedFileName))&&{reference:s,fileName:l.fileName,file:l,unverified:!1}}var l,u=f(t.libReferenceDirectives,r);if(u)return (l=n.getLibFileFromReference(u))&&{reference:u,fileName:l.fileName,file:l,unverified:!1};if(null===(i=t.resolvedModules)||void 0===i?void 0:i.size()){var _=e.getTokenAtPosition(t,r);if(e.isModuleSpecifierLike(_)&&e.isExternalModuleNameRelative(_.text)&&t.resolvedModules.has(_.text,e.getModeForUsageLocation(t,_))){var d=null===(a=t.resolvedModules.get(_.text,e.getModeForUsageLocation(t,_)))||void 0===a?void 0:a.resolvedFileName,p=d||e.resolvePath(e.getDirectoryPath(t.fileName),_.text);return {file:n.getSourceFile(p),fileName:p,reference:{pos:_.getStart(),end:_.getEnd(),fileName:_.text},unverified:!d}}}}function s(t,r,n){return e.flatMap(!t.isUnion()||32&t.flags?[t]:t.types,(function(e){return e.symbol&&l(r,e.symbol,n)}))}function c(t,r){var n=r.getSymbolAtLocation(t);if((null==n?void 0:n.declarations)&&2097152&n.flags&&function(t,r){if(79!==t.kind)return !1;if(t.parent===r)return !0;switch(r.kind){case 266:case 264:return !0;case 269:return 268===r.parent.kind;case 202:case 253:return e.isInJSFile(r)&&e.isRequireVariableDeclaration(r);default:return !1}}(t,n.declarations[0])){var i=r.getAliasedSymbol(n);if(i.declarations)return i}return n}function l(t,r,n,i){var a=e.filter(r.declarations,(function(t){return t!==i&&(!e.isAssignmentDeclaration(t)||t===r.valueDeclaration)}))||void 0;return function(){if(32&r.flags&&!(19&r.flags)&&(e.isNewExpressionTarget(n)||134===n.kind))return o((e.find(a,e.isClassLike)||e.Debug.fail("Expected declaration to have at least one class-like declaration")).members,!0)}()||(e.isCallOrNewExpressionTarget(n)||e.isNameOfFunctionDeclaration(n)?o(a,!1):void 0)||e.map(a,(function(e){return u(e,t,r,n)}));function o(i,a){if(i){var o=i.filter(a?e.isConstructorDeclaration:e.isFunctionLike),s=o.filter((function(e){return !!e.body}));return o.length?0!==s.length?s.map((function(e){return u(e,t,r,n)})):[u(e.last(o),t,r,n)]:void 0}}}function u(t,r,n,i){var a=r.symbolToString(n),o=e.SymbolDisplay.getSymbolKind(r,n,i),s=n.parent?r.symbolToString(n.parent,i):"";return _(r,t,o,a,s)}function _(t,r,n,a,o,s){var c=r.getSourceFile();if(!s){var l=e.getNameOfDeclaration(r)||r;s=e.createTextSpanFromNode(l,c);}return i$1(i$1({fileName:c.fileName,textSpan:s,kind:n,name:a,containerKind:void 0,containerName:o},e.FindAllReferences.toContextSpan(s,c,e.FindAllReferences.getContextNode(r))),{isLocal:!d(t,r)})}function d(t,r){if(t.isDeclarationVisible(r))return !0;if(!r.parent)return !1;if(e.hasInitializer(r.parent)&&r.parent.initializer===r)return d(t,r.parent);switch(r.kind){case 166:case 171:case 172:case 168:if(e.hasEffectiveModifier(r,8))return !1;case 170:case 294:case 295:case 204:case 225:case 213:case 212:return d(t,r.parent);default:return !1}}function p(e,t){return u(t,e,t.symbol,t)}function f(t,r){return e.find(t,(function(t){return e.textRangeContainsPositionInclusive(t,r)}))}t.getDefinitionAtPosition=r,t.getReferenceAtPosition=o,t.getTypeDefinitionAtPosition=function(t,r,n){var i=e.getTouchingPropertyName(r,n);if(i!==r){var a=t.getSymbolAtLocation(i);if(a){var o=t.getTypeOfSymbolAtLocation(a,i),c=function(t,r,n){if(r.symbol===t||t.valueDeclaration&&r.symbol&&e.isVariableDeclaration(t.valueDeclaration)&&t.valueDeclaration.initializer===r.symbol.valueDeclaration){var i=r.getCallSignatures();if(1===i.length)return n.getReturnTypeOfSignature(e.first(i))}}(a,o,t),l=c&&s(c,t,i);return l&&0!==l.length?l:s(o,t,i)}}},t.getDefinitionAndBoundSpan=function(t,n,i){var a=r(t,n,i);if(a&&0!==a.length){var o=f(n.referencedFiles,i)||f(n.typeReferenceDirectives,i)||f(n.libReferenceDirectives,i);if(o)return {definitions:a,textSpan:e.createTextSpanFromRange(o)};var s=e.getTouchingPropertyName(n,i);return {definitions:a,textSpan:e.createTextSpan(s.getStart(),s.getWidth())}}},t.findReferenceInPosition=f;}(e.GoToDefinition||(e.GoToDefinition={}));}(t),function(e){!function(t){var r,i,a=["abstract","access","alias","argument","async","augments","author","borrows","callback","class","classdesc","constant","constructor","constructs","copyright","default","deprecated","description","emits","enum","event","example","exports","extends","external","field","file","fileoverview","fires","function","generator","global","hideconstructor","host","ignore","implements","inheritdoc","inner","instance","interface","kind","lends","license","link","listens","member","memberof","method","mixes","module","name","namespace","override","package","param","private","property","protected","public","readonly","requires","returns","see","since","static","summary","template","this","throws","todo","tutorial","type","typedef","var","variation","version","virtual","yields"];function o(t,r){return e.arraysEqual(t,r,(function(e,t){return e.kind===t.kind&&e.text===t.text}))}function s(t,r){return "string"==typeof t?[e.textPart(t)]:e.flatMap(t,(function(t){return 319===t.kind?[e.textPart(t.text)]:e.buildLinkParts(t,r)}))}function c(t,r){var i=t.comment,a=t.kind,o=function(t){switch(t){case 338:return e.parameterNamePart;case 345:return e.propertyNamePart;case 342:return e.typeParameterNamePart;case 343:case 336:return e.typeAliasNamePart;default:return e.textPart}}(a);switch(a){case 327:case 326:return l(t.class);case 342:return u(t.typeParameters.map((function(e){return e.getText()})).join(", "));case 341:return l(t.typeExpression);case 343:case 336:case 345:case 338:case 344:var c=t.name;return c?l(c):void 0===i?void 0:s(i,r);default:return void 0===i?void 0:s(i,r)}function l(e){return u(e.getText())}function u(t){return i?t.match(/^https?$/)?n$3([e.textPart(t)],s(i,r),!0):n$3([o(t),e.spacePart()],s(i,r),!0):[e.textPart(t)]}}function l(t){return {name:t,kind:"",kindModifiers:"",displayParts:[e.textPart(t)],documentation:e.emptyArray,tags:void 0,codeActions:void 0}}function u(t,r){switch(t.kind){case 255:case 212:case 168:case 170:case 167:case 213:var n=t;return {commentOwner:t,parameters:n.parameters,hasReturn:_(n,r)};case 294:return u(t.initializer,r);case 256:case 257:case 165:case 259:case 297:case 258:return {commentOwner:t};case 236:var i=t.declarationList.declarations,a=1===i.length&&i[0].initializer?function(t){for(;211===t.kind;)t=t.expression;switch(t.kind){case 212:case 213:return t;case 225:return e.find(t.members,e.isConstructorDeclaration)}}(i[0].initializer):void 0;return a?{commentOwner:t,parameters:a.parameters,hasReturn:_(a,r)}:{commentOwner:t};case 303:return "quit";case 260:return 260===t.parent.kind?void 0:{commentOwner:t};case 237:return u(t.expression,r);case 220:var o=t;return 0===e.getAssignmentDeclarationKind(o)?"quit":e.isFunctionLike(o.right)?{commentOwner:t,parameters:o.right.parameters,hasReturn:_(o.right,r)}:{commentOwner:t};case 166:var s=t.initializer;if(s&&(e.isFunctionExpression(s)||e.isArrowFunction(s)))return {commentOwner:t,parameters:s.parameters,hasReturn:_(s,r)}}}function _(t,r){return !!(null==r?void 0:r.generateReturnInDocTemplate)&&(e.isArrowFunction(t)&&e.isExpression(t.body)||e.isFunctionLikeDeclaration(t)&&t.body&&e.isBlock(t.body)&&!!e.forEachReturnStatement(t.body,(function(e){return e})))}t.getJsDocCommentsFromDeclarations=function(t,r){var n=[];return e.forEachUnique(t,(function(t){for(var i=0,a=function(t){switch(t.kind){case 338:case 345:return [t];case 336:case 343:return [t,t.parent];default:return e.getJSDocCommentsAndTags(t)}}(t);i<a.length;i++){var c=a[i];if(!(void 0===c.comment||e.isJSDoc(c)&&343!==t.kind&&336!==t.kind&&c.tags&&c.tags.some((function(e){return 343===e.kind||336===e.kind}))&&!c.tags.some((function(e){return 338===e.kind||339===e.kind})))){var l=s(c.comment,r);e.contains(n,l,o)||n.push(l);}}})),e.flatten(e.intersperse(n,[e.lineBreakPart()]))},t.getJsDocTagsFromDeclarations=function(t,r){var n=[];return e.forEachUnique(t,(function(t){var i=e.getJSDocTags(t);if(!i.some((function(e){return 343===e.kind||336===e.kind}))||i.some((function(e){return 338===e.kind||339===e.kind})))for(var a=0,o=i;a<o.length;a++){var s=o[a];n.push({name:s.tagName.text,text:c(s,r)});}})),n},t.getJSDocTagNameCompletions=function(){return r||(r=e.map(a,(function(t){return {name:t,kind:"keyword",kindModifiers:"",sortText:e.Completions.SortText.LocationPriority}})))},t.getJSDocTagNameCompletionDetails=l,t.getJSDocTagCompletions=function(){return i||(i=e.map(a,(function(t){return {name:"@".concat(t),kind:"keyword",kindModifiers:"",sortText:e.Completions.SortText.LocationPriority}})))},t.getJSDocTagCompletionDetails=l,t.getJSDocParameterNameCompletions=function(t){if(!e.isIdentifier(t.name))return e.emptyArray;var r=t.name.text,n=t.parent,i=n.parent;return e.isFunctionLike(i)?e.mapDefined(i.parameters,(function(i){if(e.isIdentifier(i.name)){var a=i.name.text;if(!n.tags.some((function(r){return r!==t&&e.isJSDocParameterTag(r)&&e.isIdentifier(r.name)&&r.name.escapedText===a}))&&(void 0===r||e.startsWith(a,r)))return {name:a,kind:"parameter",kindModifiers:"",sortText:e.Completions.SortText.LocationPriority}}})):[]},t.getJSDocParameterNameCompletionDetails=function(t){return {name:t,kind:"parameter",kindModifiers:"",displayParts:[e.textPart(t)],documentation:e.emptyArray,tags:void 0,codeActions:void 0}},t.getDocCommentTemplateAtPosition=function(t,r,n,i){var a=e.getTokenAtPosition(r,n),o=e.findAncestor(a,e.isJSDoc);if(!o||void 0===o.comment&&!e.length(o.tags)){var s=a.getStart(r);if(o||!(s<n)){var c=function(t,r){return e.forEachAncestor(t,(function(e){return u(e,r)}))}(a,i);if(c){var l=c.commentOwner,_=c.parameters,d=c.hasReturn;if(!(l.getStart(r)<n)){var p=function(t,r){for(var n=t.text,i=e.getLineStartPositionForPosition(r,t),a=i;a<=r&&e.isWhiteSpaceSingleLine(n.charCodeAt(a));a++);return n.slice(i,a)}(r,n),f=e.hasJSFileExtension(r.fileName),g=(_?function(e,t,r,n){return e.map((function(e,i){var a=e.name,o=e.dotDotDotToken,s=79===a.kind?a.text:"param"+i,c=t?o?"{...any} ":"{any} ":"";return "".concat(r," * @param ").concat(c).concat(s).concat(n)})).join("")}(_||[],f,p,t):"")+(d?function(e,t){return "".concat(e," * @returns").concat(t)}(p,t):"");if(g){var m="/**"+t+p+" * ";return {newText:m+t+g+p+" */"+(s===n?t+p:""),caretOffset:m.length}}return {newText:"/** */",caretOffset:3}}}}}};}(e.JsDoc||(e.JsDoc={}));}(t),function(e){!function(t){function r(e,t){switch(e.kind){case 266:case 269:case 264:var r=t.getSymbolAtLocation(e.name),n=t.getAliasedSymbol(r);return r.escapedName!==n.escapedName;default:return !0}}function n(t,r){var n=e.getNameOfDeclaration(t);return !!n&&(a(n,r)||161===n.kind&&i(n.expression,r))}function i(t,r){return a(t,r)||e.isPropertyAccessExpression(t)&&(r.push(t.name.text),!0)&&i(t.expression,r)}function a(t,r){return e.isPropertyNameLiteral(t)&&(r.push(e.getTextOfIdentifierOrLiteral(t)),!0)}function o(t){var r=[],a=e.getNameOfDeclaration(t);if(a&&161===a.kind&&!i(a.expression,r))return e.emptyArray;r.shift();for(var o=e.getContainerNode(t);o;){if(!n(o,r))return e.emptyArray;o=e.getContainerNode(o);}return r.reverse()}function s(t,r){return e.compareValues(t.matchKind,r.matchKind)||e.compareStringsCaseSensitiveUI(t.name,r.name)}function c(t){var r=t.declaration,n=e.getContainerNode(r),i=n&&e.getNameOfDeclaration(n);return {name:t.name,kind:e.getNodeKind(r),kindModifiers:e.getNodeModifiers(r),matchKind:e.PatternMatchKind[t.matchKind],isCaseSensitive:t.isCaseSensitive,fileName:t.fileName,textSpan:e.createTextSpanFromNode(r),containerName:i?i.text:"",containerKind:i?e.getNodeKind(n):""}}t.getNavigateToItems=function(t,n,i,a,l,u){var _=e.createPatternMatcher(a);if(!_)return e.emptyArray;for(var d=[],p=function(e){if(i.throwIfCancellationRequested(),u&&e.isDeclarationFile)return "continue";e.getNamedDeclarations().forEach((function(t,i){!function(e,t,n,i,a,s){var c=e.getMatchForLastSegmentOfPattern(t);if(c)for(var l=0,u=n;l<u.length;l++){var _=u[l];if(r(_,i))if(e.patternContainsDots){var d=e.getFullMatch(o(_),t);d&&s.push({name:t,fileName:a,matchKind:d.kind,isCaseSensitive:d.isCaseSensitive,declaration:_});}else s.push({name:t,fileName:a,matchKind:c.kind,isCaseSensitive:c.isCaseSensitive,declaration:_});}}(_,i,t,n,e.fileName,d);}));},f=0,g=t;f<g.length;f++)p(g[f]);return d.sort(s),(void 0===l?d:d.slice(0,l)).map(c)};}(e.NavigateTo||(e.NavigateTo={}));}(t),function(e){!function(t){var r,n,a,o,s,c=/\s+/g,l=[],u=[],_=[];function d(){a=void 0,n=void 0,l=[],o=void 0,_=[];}function p(e){return Q(e.getText(a))}function f(e){return e.node.kind}function g(e,t){e.children?e.children.push(t):e.children=[t];}function m(t){e.Debug.assert(!l.length);var r={node:t,name:void 0,additionalNodes:void 0,parent:void 0,children:void 0,indent:0};o=r;for(var n=0,i=t.statements;n<i.length;n++)k(i[n]);return S(),e.Debug.assert(!o&&!l.length),r}function y(e,t){g(o,v(e,t));}function v(t,r){return {node:t,name:r||(e.isDeclaration(t)||e.isExpression(t)?e.getNameOfDeclaration(t):void 0),additionalNodes:void 0,parent:o,children:void 0,indent:o.indent+1}}function h(t){s||(s=new e.Map),s.set(t,!0);}function b(e){for(var t=0;t<e;t++)S();}function x(t,r){for(var n=[];!e.isPropertyNameLiteral(r);){var i=e.getNameOrArgument(r),a=e.getElementOrPropertyAccessName(r);r=r.expression,"prototype"===a||e.isPrivateIdentifier(i)||n.push(i);}n.push(r);for(var o=n.length-1;o>0;o--)D(t,i=n[o]);return [n.length-1,n[0]]}function D(e,t){var r=v(e,t);g(o,r),l.push(o),u.push(s),s=void 0,o=r;}function S(){o.children&&(N(o.children,o),O(o.children)),o=l.pop(),s=u.pop();}function T(e,t,r){D(e,r),k(t),S();}function C(t){t.initializer&&function(e){switch(e.kind){case 213:case 212:case 225:return !0;default:return !1}}(t.initializer)?(D(t),e.forEachChild(t.initializer,k),S()):T(t,t.initializer);}function E(t){return !e.hasDynamicName(t)||220!==t.kind&&e.isPropertyAccessExpression(t.name.expression)&&e.isIdentifier(t.name.expression.expression)&&"Symbol"===e.idText(t.name.expression.expression)}function k(t){var r;if(n.throwIfCancellationRequested(),t&&!e.isToken(t))switch(t.kind){case 170:var i=t;T(i,i.body);for(var a=0,o=i.parameters;a<o.length;a++){var c=o[a];e.isParameterPropertyDeclaration(c,i)&&y(c);}break;case 168:case 171:case 172:case 167:E(t)&&T(t,t.body);break;case 166:E(t)&&C(t);break;case 165:E(t)&&y(t);break;case 266:var l=t;l.name&&y(l.name);var u=l.namedBindings;if(u)if(267===u.kind)y(u);else for(var _=0,d=u.elements;_<d.length;_++)y(d[_]);break;case 295:T(t,t.name);break;case 296:var p=t.expression;e.isIdentifier(p)?y(t,p):y(t);break;case 202:case 294:case 253:var f=t;e.isBindingPattern(f.name)?k(f.name):C(f);break;case 255:var g=t.name;g&&e.isIdentifier(g)&&h(g.text),T(t,t.body);break;case 213:case 212:T(t,t.body);break;case 259:D(t);for(var m=0,v=t.members;m<v.length;m++)V(A=v[m])||y(A);S();break;case 256:case 225:case 257:D(t);for(var N=0,F=t.members;N<F.length;N++){var A;k(A=F[N]);}S();break;case 260:T(t,K(t).body);break;case 270:var P=t.expression;(f=e.isObjectLiteralExpression(P)||e.isCallExpression(P)?P:e.isArrowFunction(P)||e.isFunctionExpression(P)?P.body:void 0)?(D(t),k(f),S()):y(t);break;case 274:case 264:case 175:case 173:case 174:case 258:y(t);break;case 207:case 220:var w=e.getAssignmentDeclarationKind(t);switch(w){case 1:case 2:return void T(t,t.right);case 6:case 3:var I=(J=t).left,O=3===w?I.expression:I,M=0,L=void 0;return e.isIdentifier(O.expression)?(h(O.expression.text),L=O.expression):(M=(r=x(J,O.expression))[0],L=r[1]),6===w?e.isObjectLiteralExpression(J.right)&&J.right.properties.length>0&&(D(J,L),e.forEachChild(J.right,k),S()):e.isFunctionExpression(J.right)||e.isArrowFunction(J.right)?T(t,J.right,L):(D(J,L),T(t,J.right,I.name),S()),void b(M);case 7:case 9:var R=t,B=(L=7===w?R.arguments[0]:R.arguments[0].expression,R.arguments[1]),j=x(t,L);return M=j[0],D(t,j[1]),D(t,e.setTextRange(e.factory.createIdentifier(B.text),B)),k(t.arguments[2]),S(),S(),void b(M);case 5:var J,z=(I=(J=t).left).expression;if(e.isIdentifier(z)&&"prototype"!==e.getElementOrPropertyAccessName(I)&&s&&s.has(z.text))return void(e.isFunctionExpression(J.right)||e.isArrowFunction(J.right)?T(t,J.right,z):e.isBindableStaticAccessExpression(I)&&(D(J,z),T(J.left,J.right,e.getNameOrArgument(I)),S()));break;case 4:case 0:case 8:break;default:e.Debug.assertNever(w);}default:e.hasJSDocNodes(t)&&e.forEach(t.jsDoc,(function(t){e.forEach(t.tags,(function(t){e.isJSDocTypeAlias(t)&&y(t);}));})),e.forEachChild(t,k);}}function N(t,r){var n=new e.Map;e.filterMutate(t,(function(t,i){var a=t.name||e.getNameOfDeclaration(t.node),o=a&&p(a);if(!o)return !0;var s=n.get(o);if(!s)return n.set(o,t),!0;if(s instanceof Array){for(var c=0,l=s;c<l.length;c++){var u;if(A(u=l[c],t,i,r))return !1}return s.push(t),!0}return !A(u=s,t,i,r)&&(n.set(o,[u,t]),!0)}));}t.getNavigationBarItems=function(t,r){n=r,a=t;try{return e.map((i=m(t),o=[],function e(t){if(function(e){if(e.children)return !0;switch(f(e)){case 256:case 225:case 259:case 257:case 260:case 303:case 258:case 343:case 336:return !0;case 213:case 255:case 212:return t(e);default:return !1}function t(e){if(!e.node.body)return !1;switch(f(e.parent)){case 261:case 303:case 168:case 170:return !0;default:return !1}}}(t)&&(o.push(t),t.children))for(var r=0,n=t.children;r<n.length;r++)e(n[r]);}(i),o),j)}finally{d();}var i,o;},t.getNavigationTree=function(e,t){n=t,a=e;try{return B(m(e))}finally{d();}};var F=((r={})[5]=!0,r[3]=!0,r[7]=!0,r[9]=!0,r[0]=!1,r[1]=!1,r[2]=!1,r[8]=!1,r[6]=!0,r[4]=!1,r);function A(t,r,n,a){return !!function(t,r,n,a){function o(t){return e.isFunctionExpression(t)||e.isFunctionDeclaration(t)||e.isVariableDeclaration(t)}var s=e.isBinaryExpression(r.node)||e.isCallExpression(r.node)?e.getAssignmentDeclarationKind(r.node):0,c=e.isBinaryExpression(t.node)||e.isCallExpression(t.node)?e.getAssignmentDeclarationKind(t.node):0;if(F[s]&&F[c]||o(t.node)&&F[s]||o(r.node)&&F[c]||e.isClassDeclaration(t.node)&&P(t.node)&&F[s]||e.isClassDeclaration(r.node)&&F[c]||e.isClassDeclaration(t.node)&&P(t.node)&&o(r.node)||e.isClassDeclaration(r.node)&&o(t.node)&&P(t.node)){var l=t.additionalNodes&&e.lastOrUndefined(t.additionalNodes)||t.node;if(!e.isClassDeclaration(t.node)&&!e.isClassDeclaration(r.node)||o(t.node)||o(r.node)){var u=o(t.node)?t.node:o(r.node)?r.node:void 0;if(void 0!==u){var _=v(e.setTextRange(e.factory.createConstructorDeclaration(void 0,void 0,[],void 0),u));_.indent=t.indent+1,_.children=t.node===u?t.children:r.children,t.children=t.node===u?e.concatenate([_],r.children||[r]):e.concatenate(t.children||[i$1({},t)],[_]);}else (t.children||r.children)&&(t.children=e.concatenate(t.children||[i$1({},t)],r.children||[r]),t.children&&(N(t.children,t),O(t.children)));l=t.node=e.setTextRange(e.factory.createClassDeclaration(void 0,void 0,t.name||e.factory.createIdentifier("__class__"),void 0,void 0,[]),t.node);}else t.children=e.concatenate(t.children,r.children),t.children&&N(t.children,t);var d=r.node;return a.children[n-1].node.end===l.end?e.setTextRange(l,{pos:l.pos,end:d.end}):(t.additionalNodes||(t.additionalNodes=[]),t.additionalNodes.push(e.setTextRange(e.factory.createClassDeclaration(void 0,void 0,t.name||e.factory.createIdentifier("__class__"),void 0,void 0,[]),r.node))),!0}return 0!==s}(t,r,n,a)||!!function(t,r,n){if(t.kind!==r.kind||t.parent!==r.parent&&(!w(t,n)||!w(r,n)))return !1;switch(t.kind){case 166:case 168:case 171:case 172:return e.isStatic(t)===e.isStatic(r);case 260:return I(t,r)&&U(t)===U(r);default:return !0}}(t.node,r.node,a)&&(function(t,r){var n;t.additionalNodes=t.additionalNodes||[],t.additionalNodes.push(r.node),r.additionalNodes&&(n=t.additionalNodes).push.apply(n,r.additionalNodes),t.children=e.concatenate(t.children,r.children),t.children&&(N(t.children,t),O(t.children));}(t,r),!0)}function P(e){return !!(8&e.flags)}function w(t,r){var n=e.isModuleBlock(t.parent)?t.parent.parent:t.parent;return n===r.node||e.contains(r.additionalNodes,n)}function I(e,t){return e.body.kind===t.body.kind&&(260!==e.body.kind||I(e.body,t.body))}function O(e){e.sort(M);}function M(t,r){return e.compareStringsCaseSensitiveUI(L(t.node),L(r.node))||e.compareValues(f(t),f(r))}function L(t){if(260===t.kind)return z(t);var r=e.getNameOfDeclaration(t);if(r&&e.isPropertyName(r)){var n=e.getPropertyNameForPropertyNameNode(r);return n&&e.unescapeLeadingUnderscores(n)}switch(t.kind){case 212:case 213:case 225:return H(t);default:return}}function R(t,r){if(260===t.kind)return Q(z(t));if(r){var n=e.isIdentifier(r)?r.text:e.isElementAccessExpression(r)?"[".concat(p(r.argumentExpression),"]"):p(r);if(n.length>0)return Q(n)}switch(t.kind){case 303:var i=t;return e.isExternalModule(i)?'"'.concat(e.escapeString(e.getBaseFileName(e.removeFileExtension(e.normalizePath(i.fileName)))),'"'):"<global>";case 270:return e.isExportAssignment(t)&&t.isExportEquals?"export=":"default";case 213:case 255:case 212:case 256:case 225:return 512&e.getSyntacticModifierFlags(t)?"default":H(t);case 170:return "constructor";case 174:return "new()";case 173:return "()";case 175:return "[]";default:return "<unknown>"}}function B(t){return {text:R(t.node,t.name),kind:e.getNodeKind(t.node),kindModifiers:W(t.node),spans:J(t),nameSpan:t.name&&q(t.name),childItems:e.map(t.children,B)}}function j(t){return {text:R(t.node,t.name),kind:e.getNodeKind(t.node),kindModifiers:W(t.node),spans:J(t),childItems:e.map(t.children,(function(t){return {text:R(t.node,t.name),kind:e.getNodeKind(t.node),kindModifiers:e.getNodeModifiers(t.node),spans:J(t),childItems:_,indent:0,bolded:!1,grayed:!1}}))||_,indent:t.indent,bolded:!1,grayed:!1}}function J(e){var t=[q(e.node)];if(e.additionalNodes)for(var r=0,n=e.additionalNodes;r<n.length;r++){var i=n[r];t.push(q(i));}return t}function z(t){return e.isAmbientModule(t)?e.getTextOfNode(t.name):U(t)}function U(t){for(var r=[e.getTextOfIdentifierOrLiteral(t.name)];t.body&&260===t.body.kind;)t=t.body,r.push(e.getTextOfIdentifierOrLiteral(t.name));return r.join(".")}function K(t){return t.body&&e.isModuleDeclaration(t.body)?K(t.body):t}function V(e){return !e.name||161===e.name.kind}function q(t){return 303===t.kind?e.createTextSpanFromRange(t):e.createTextSpanFromNode(t,a)}function W(t){return t.parent&&253===t.parent.kind&&(t=t.parent),e.getNodeModifiers(t)}function H(t){var r=t.parent;if(t.name&&e.getFullWidth(t.name)>0)return Q(e.declarationNameToString(t.name));if(e.isVariableDeclaration(r))return Q(e.declarationNameToString(r.name));if(e.isBinaryExpression(r)&&63===r.operatorToken.kind)return p(r.left).replace(c,"");if(e.isPropertyAssignment(r))return p(r.name);if(512&e.getSyntacticModifierFlags(t))return "default";if(e.isClassLike(t))return "<class>";if(e.isCallExpression(r)){var n=G(r.expression);if(void 0!==n){if((n=Q(n)).length>150)return "".concat(n," callback");var i=Q(e.mapDefined(r.arguments,(function(t){return e.isStringLiteralLike(t)?t.getText(a):void 0})).join(", "));return "".concat(n,"(").concat(i,") callback")}}return "<function>"}function G(t){if(e.isIdentifier(t))return t.text;if(e.isPropertyAccessExpression(t)){var r=G(t.expression),n=t.name.text;return void 0===r?n:"".concat(r,".").concat(n)}}function Q(e){return (e=e.length>150?e.substring(0,150)+"...":e).replace(/\\?(\r?\n|\r|\u2028|\u2029)/g,"")}}(e.NavigationBar||(e.NavigationBar={}));}(t),function(e){!function(t){function r(t,r){var n=e.isStringLiteral(r)&&r.text;return e.isString(n)&&e.some(t.moduleAugmentations,(function(t){return e.isStringLiteral(t)&&t.text===n}))}function n(t){return void 0!==t&&e.isStringLiteralLike(t)?t.text:void 0}function i(t){var r;if(0===t.length)return t;var n=function(t){for(var r,n={defaultImports:[],namespaceImports:[],namedImports:[]},i={defaultImports:[],namespaceImports:[],namedImports:[]},a=0,o=t;a<o.length;a++){var s=o[a];if(void 0!==s.importClause){var c=s.importClause.isTypeOnly?n:i,l=s.importClause,u=l.name,_=l.namedBindings;u&&c.defaultImports.push(s),_&&(e.isNamespaceImport(_)?c.namespaceImports.push(s):c.namedImports.push(s));}else r=r||s;}return {importWithoutClause:r,typeOnlyImports:n,regularImports:i}}(t),i=n.importWithoutClause,a=n.typeOnlyImports,c=n.regularImports,l=[];i&&l.push(i);for(var _=0,d=[c,a];_<d.length;_++){var p=d[_],f=p===a,g=p.defaultImports,m=p.namespaceImports,y=p.namedImports;if(f||1!==g.length||1!==m.length||0!==y.length){for(var v=0,h=e.stableSort(m,(function(e,t){return u(e.importClause.namedBindings.name,t.importClause.namedBindings.name)}));v<h.length;v++){var b=h[v];l.push(o(b,void 0,b.importClause.namedBindings));}if(0!==g.length||0!==y.length){var x=void 0,D=[];if(1===g.length)x=g[0].importClause.name;else for(var S=0,T=g;S<T.length;S++)N=T[S],D.push(e.factory.createImportSpecifier(!1,e.factory.createIdentifier("default"),N.importClause.name));D.push.apply(D,e.flatMap(y,(function(e){return e.importClause.namedBindings.elements})));var C=s(D),E=g.length>0?g[0]:y[0],k=0===C.length?x?void 0:e.factory.createNamedImports(e.emptyArray):0===y.length?e.factory.createNamedImports(C):e.factory.updateNamedImports(y[0].importClause.namedBindings,C);f&&x&&k?(l.push(o(E,x,void 0)),l.push(o(null!==(r=y[0])&&void 0!==r?r:E,void 0,k))):l.push(o(E,x,k));}}else {var N=g[0];l.push(o(N,N.importClause.name,m[0].importClause.namedBindings));}}return l}function a(t){if(0===t.length)return t;var r=function(e){for(var t,r=[],n=[],i=0,a=e;i<a.length;i++){var o=a[i];void 0===o.exportClause?t=t||o:o.isTypeOnly?n.push(o):r.push(o);}return {exportWithoutClause:t,namedExports:r,typeOnlyExports:n}}(t),n=r.exportWithoutClause,i=r.namedExports,a=r.typeOnlyExports,o=[];n&&o.push(n);for(var c=0,l=[i,a];c<l.length;c++){var u=l[c];if(0!==u.length){var _=[];_.push.apply(_,e.flatMap(u,(function(t){return t.exportClause&&e.isNamedExports(t.exportClause)?t.exportClause.elements:e.emptyArray})));var d=s(_),p=u[0];o.push(e.factory.updateExportDeclaration(p,p.decorators,p.modifiers,p.isTypeOnly,p.exportClause&&(e.isNamedExports(p.exportClause)?e.factory.updateNamedExports(p.exportClause,d):e.factory.updateNamespaceExport(p.exportClause,p.exportClause.name)),p.moduleSpecifier,p.assertClause));}}return o}function o(t,r,n){return e.factory.updateImportDeclaration(t,t.decorators,t.modifiers,e.factory.updateImportClause(t.importClause,t.importClause.isTypeOnly,r,n),t.moduleSpecifier,t.assertClause)}function s(t){return e.stableSort(t,c)}function c(t,r){return e.compareBooleans(t.isTypeOnly,r.isTypeOnly)||u(t.propertyName||t.name,r.propertyName||r.name)||u(t.name,r.name)}function l(t,r){var i=void 0===t?void 0:n(t),a=void 0===r?void 0:n(r);return e.compareBooleans(void 0===i,void 0===a)||e.compareBooleans(e.isExternalModuleNameRelative(i),e.isExternalModuleNameRelative(a))||e.compareStringsCaseInsensitive(i,a)}function u(t,r){return e.compareStringsCaseInsensitive(t.text,r.text)}function _(t){var r;switch(t.kind){case 264:return null===(r=e.tryCast(t.moduleReference,e.isExternalModuleReference))||void 0===r?void 0:r.expression;case 265:return t.moduleSpecifier;case 236:return t.declarationList.declarations[0].initializer.arguments[0]}}function d(t,r){return l(_(t),_(r))||function(t,r){return e.compareValues(p(t),p(r))}(t,r)}function p(e){var t;switch(e.kind){case 265:return e.importClause?e.importClause.isTypeOnly?1:267===(null===(t=e.importClause.namedBindings)||void 0===t?void 0:t.kind)?2:e.importClause.name?3:4:0;case 264:return 5;case 236:return 6}}t.organizeImports=function(t,s,c,u,_,p){var f=e.textChanges.ChangeTracker.fromContext({host:c,formatContext:s,preferences:_}),g=function(n){return e.stableSort(i(function(t,n,i,a){if(a)return t;for(var s=i.getTypeChecker(),c=s.getJsxNamespace(n),l=s.getJsxFragmentFactory(n),u=!!(2&n.transformFlags),_=[],d=0,p=t;d<p.length;d++){var f=p[d],g=f.importClause,m=f.moduleSpecifier;if(g){var y=g.name,v=g.namedBindings;if(y&&!b(y)&&(y=void 0),v)if(e.isNamespaceImport(v))b(v.name)||(v=void 0);else {var h=v.elements.filter((function(e){return b(e.name)}));h.length<v.elements.length&&(v=h.length?e.factory.updateNamedImports(v,h):void 0);}y||v?_.push(o(f,y,v)):r(n,m)&&(n.isDeclarationFile?_.push(e.factory.createImportDeclaration(f.decorators,f.modifiers,void 0,m,void 0)):_.push(f));}else _.push(f);}return _;function b(t){return u&&(t.text===c||l&&t.text===l)||e.FindAllReferences.Core.isSymbolReferencedInFile(t,s,n)}}(n,t,u,p)),(function(e,t){return d(e,t)}))};h(t.statements.filter(e.isImportDeclaration),g),h(t.statements.filter(e.isExportDeclaration),a);for(var m=0,y=t.statements.filter(e.isAmbientModule);m<y.length;m++){var v=y[m];v.body&&(h(v.body.statements.filter(e.isImportDeclaration),g),h(v.body.statements.filter(e.isExportDeclaration),a));}return f.getChanges();function h(r,i){if(0!==e.length(r)){e.suppressLeadingTrivia(r[0]);var a=e.group(r,(function(e){return n(e.moduleSpecifier)})),o=e.stableSort(a,(function(e,t){return l(e[0].moduleSpecifier,t[0].moduleSpecifier)})),u=e.flatMap(o,(function(e){return n(e[0].moduleSpecifier)?i(e):e}));if(0===u.length)f.deleteNodes(t,r,{trailingTriviaOption:e.textChanges.TrailingTriviaOption.Include},!0);else {var _={leadingTriviaOption:e.textChanges.LeadingTriviaOption.Exclude,trailingTriviaOption:e.textChanges.TrailingTriviaOption.Include,suffix:e.getNewLineOrDefaultFromHost(c,s.options)};f.replaceNodeWithNodes(t,r[0],u,_);var d=f.nodeHasTrailingComment(t,r[0],_);f.deleteNodes(t,r.slice(1),{trailingTriviaOption:e.textChanges.TrailingTriviaOption.Include},d);}}}},t.coalesceImports=i,t.coalesceExports=a,t.compareImportOrExportSpecifiers=c,t.compareModuleSpecifiers=l,t.importsAreSorted=function(t){return e.arrayIsSorted(t,d)},t.importSpecifiersAreSorted=function(t){return e.arrayIsSorted(t,c)},t.getImportDeclarationInsertionIndex=function(t,r){var n=e.binarySearch(t,r,e.identity,d);return n<0?~n:n},t.getImportSpecifierInsertionIndex=function(t,r){var n=e.binarySearch(t,r,e.identity,c);return n<0?~n:n},t.compareImportsOrRequireStatements=d;}(e.OrganizeImports||(e.OrganizeImports={}));}(t),function(e){!function(t){t.collectElements=function(t,r){var u=[];return function(t,r,i){for(var u=40,_=0,d=n$3(n$3([],t.statements,!0),[t.endOfFileToken],!1),p=d.length;_<p;){for(;_<p&&!e.isAnyImportSyntax(d[_]);)m(d[_]),_++;if(_===p)break;for(var f=_;_<p&&e.isAnyImportSyntax(d[_]);)o(d[_],t,r,i),_++;var g=_-1;g!==f&&i.push(s(e.findChildOfKind(d[f],100,t).getStart(t),d[g].getEnd(),"imports"));}function m(n){var _;if(0!==u){r.throwIfCancellationRequested(),(e.isDeclaration(n)||e.isVariableStatement(n)||e.isReturnStatement(n)||1===n.kind)&&o(n,t,r,i),e.isFunctionLike(n)&&e.isBinaryExpression(n.parent)&&e.isPropertyAccessExpression(n.parent.left)&&o(n.parent.left,t,r,i),(e.isBlock(n)||e.isModuleBlock(n))&&a(n.statements.end,t,r,i),(e.isClassLike(n)||e.isInterfaceDeclaration(n))&&a(n.members.end,t,r,i);var d=function(t,r){switch(t.kind){case 234:if(e.isFunctionLike(t.parent))return function(t,r,n){var i=function(t,r,n){if(e.isNodeArrayMultiLine(t.parameters,n)){var i=e.findChildOfKind(t,20,n);if(i)return i}return e.findChildOfKind(r,18,n)}(t,r,n),a=e.findChildOfKind(r,19,n);return i&&a&&c(i,a,t,n,213!==t.kind)}(t.parent,t,r);switch(t.parent.kind){case 239:case 242:case 243:case 241:case 238:case 240:case 247:case 291:return u(t.parent);case 251:var n=t.parent;if(n.tryBlock===t)return u(t.parent);if(n.finallyBlock===t){var i=e.findChildOfKind(n,96,r);if(i)return u(i)}default:return l(e.createTextSpanFromNode(t,r),"code")}case 261:return u(t.parent);case 256:case 225:case 257:case 259:case 262:case 181:case 200:return u(t);case 183:return u(t,!1,!e.isTupleTypeNode(t.parent),22);case 288:case 289:return (a=t.statements).length?l(e.createTextSpanFromRange(a),"code"):void 0;case 204:return o(t);case 203:return o(t,22);case 277:return function(t){var n=e.createTextSpanFromBounds(t.openingElement.getStart(r),t.closingElement.getEnd()),i=t.openingElement.tagName.getText(r);return l(n,"code",n,!1,"<"+i+">...</"+i+">")}(t);case 281:return function(t){var n=e.createTextSpanFromBounds(t.openingFragment.getStart(r),t.closingFragment.getEnd());return l(n,"code",n,!1,"<>...</>")}(t);case 278:case 279:return function(e){if(0!==e.properties.length)return s(e.getStart(r),e.getEnd(),"code")}(t.attributes);case 222:case 14:return function(e){if(14!==e.kind||0!==e.text.length)return s(e.getStart(r),e.getEnd(),"code")}(t);case 201:return u(t,!1,!e.isBindingElement(t.parent),22);case 213:return function(t){if(!e.isBlock(t.body)&&!e.positionsAreOnSameLine(t.body.getFullStart(),t.body.getEnd(),r))return l(e.createTextSpanFromBounds(t.body.getFullStart(),t.body.getEnd()),"code",e.createTextSpanFromNode(t))}(t);case 207:return function(t){if(t.arguments.length){var n=e.findChildOfKind(t,20,r),i=e.findChildOfKind(t,21,r);if(n&&i&&!e.positionsAreOnSameLine(n.pos,i.pos,r))return c(n,i,t,r,!1,!0)}}(t)}var a;function o(t,r){return void 0===r&&(r=18),u(t,!1,!e.isArrayLiteralExpression(t.parent)&&!e.isCallExpression(t.parent),r)}function u(n,i,a,o,s){void 0===i&&(i=!1),void 0===a&&(a=!0),void 0===o&&(o=18),void 0===s&&(s=18===o?19:23);var l=e.findChildOfKind(t,o,r),u=e.findChildOfKind(t,s,r);return l&&u&&c(l,u,n,r,i,a)}}(n,t);d&&i.push(d),u--,e.isCallExpression(n)?(u++,m(n.expression),u--,n.arguments.forEach(m),null===(_=n.typeArguments)||void 0===_||_.forEach(m)):e.isIfStatement(n)&&n.elseStatement&&e.isIfStatement(n.elseStatement)?(m(n.expression),m(n.thenStatement),u++,m(n.elseStatement),u--):n.forEachChild(m),u++;}}}(t,r,u),function(t,r){for(var n=[],a=0,o=t.getLineStarts();a<o.length;a++){var s=o[a],c=t.getLineEndOfPosition(s),u=i(t.text.substring(s,c));if(u&&!e.isInComment(t,s))if(u[1]){var _=n.pop();_&&(_.textSpan.length=c-_.textSpan.start,_.hintSpan.length=c-_.textSpan.start,r.push(_));}else {var d=e.createTextSpanFromBounds(t.text.indexOf("//",s),c);n.push(l(d,"region",d,!1,u[2]||"#region"));}}}(t,u),u.sort((function(e,t){return e.textSpan.start-t.textSpan.start}))};var r=/^#(end)?region(?:\s+(.*))?(?:\r)?$/;function i(t){return t=e.trimStringStart(t),e.startsWith(t,"//")?(t=e.trimString(t.slice(2)),r.exec(t)):null}function a(t,r,n,a){var o=e.getLeadingCommentRanges(r.text,t);if(o){for(var c=-1,l=-1,u=0,_=r.getFullText(),d=0,p=o;d<p.length;d++){var f=p[d],g=f.kind,m=f.pos,y=f.end;switch(n.throwIfCancellationRequested(),g){case 2:if(i(_.slice(m,y))){v(),u=0;break}0===u&&(c=m),l=y,u++;break;case 3:v(),a.push(s(m,y,"comment")),u=0;break;default:e.Debug.assertNever(g);}}v();}function v(){u>1&&a.push(s(c,l,"comment"));}}function o(t,r,n,i){e.isJsxText(t)||a(t.pos,r,n,i);}function s(t,r,n){return l(e.createTextSpanFromBounds(t,r),n)}function c(t,r,n,i,a,o){return void 0===a&&(a=!1),void 0===o&&(o=!0),l(e.createTextSpanFromBounds(o?t.getFullStart():t.getStart(i),r.getEnd()),"code",e.createTextSpanFromNode(n,i),a)}function l(e,t,r,n,i){return void 0===r&&(r=e),void 0===n&&(n=!1),void 0===i&&(i="..."),{textSpan:e,kind:t,hintSpan:r,bannerText:i,autoCollapse:n}}}(e.OutliningElementsCollector||(e.OutliningElementsCollector={}));}(t),function(e){var t;function r(e,t){return {kind:e,isCaseSensitive:t}}function n(e,t){var r=t.get(e);return r||t.set(e,r=y(e)),r}function i(i,a,o){var s=function(e,t){for(var r=e.length-t.length,n=function(r){if(T(t,(function(t,n){return d(e.charCodeAt(n+r))===t})))return {value:r}},i=0;i<=r;i++){var a=n(i);if("object"==typeof a)return a.value}return -1}(i,a.textLowerCase);if(0===s)return r(a.text.length===i.length?t.exact:t.prefix,e.startsWith(i,a.text));if(a.isLowerCase){if(-1===s)return;for(var _=0,p=n(i,o);_<p.length;_++){var f=p[_];if(c(i,f,a.text,!0))return r(t.substring,c(i,f,a.text,!1))}if(a.text.length<i.length&&u(i.charCodeAt(s)))return r(t.substring,!1)}else {if(i.indexOf(a.text)>0)return r(t.substring,!0);if(a.characterSpans.length>0){var g=n(i,o),m=!!l(i,g,a,!1)||!l(i,g,a,!0)&&void 0;if(void 0!==m)return r(t.camelCase,m)}}}function a(e,t,r){if(T(t.totalTextChunk.text,(function(e){return 32!==e&&42!==e}))){var n=i(e,t.totalTextChunk,r);if(n)return n}for(var a,s=0,c=t.subWordTextChunks;s<c.length;s++)a=o(a,i(e,c[s],r));return a}function o(t,r){return e.min(t,r,s)}function s(t,r){return void 0===t?1:void 0===r?-1:e.compareValues(t.kind,r.kind)||e.compareBooleans(!t.isCaseSensitive,!r.isCaseSensitive)}function c(e,t,r,n,i){return void 0===i&&(i={start:0,length:r.length}),i.length<=t.length&&S(0,i.length,(function(a){return function(e,t,r){return r?d(e)===d(t):e===t}(r.charCodeAt(i.start+a),e.charCodeAt(t.start+a),n)}))}function l(t,r,n,i){for(var s=n.characterSpans,l=0,_=0;;){if(_===s.length)return !0;if(l===r.length)return !1;for(var d=r[l],p=!1;_<s.length;_++){var f=s[_];if(p&&(!u(n.text.charCodeAt(s[_-1].start))||!u(n.text.charCodeAt(s[_].start))))break;if(!c(t,d,n.text,i,f))break;p=!0,d=e.createTextSpan(d.start+f.length,d.length-f.length);}l++;}}function u(t){if(t>=65&&t<=90)return !0;if(t<127||!e.isUnicodeIdentifierStart(t,99))return !1;var r=String.fromCharCode(t);return r===r.toUpperCase()}function _(t){if(t>=97&&t<=122)return !0;if(t<127||!e.isUnicodeIdentifierStart(t,99))return !1;var r=String.fromCharCode(t);return r===r.toLowerCase()}function d(e){return e>=65&&e<=90?e-65+97:e<127?e:String.fromCharCode(e).toLowerCase().charCodeAt(0)}function p(e){return e>=48&&e<=57}function f(e){for(var t=[],r=0,n=0,i=0;i<e.length;i++)u(a=e.charCodeAt(i))||_(a)||p(a)||95===a||36===a?(0===n&&(r=i),n++):n>0&&(t.push(g(e.substr(r,n))),n=0);var a;return n>0&&t.push(g(e.substr(r,n))),t}function g(e){var t=e.toLowerCase();return {text:e,textLowerCase:t,isLowerCase:e===t,characterSpans:m(e)}}function m(e){return v(e,!1)}function y(e){return v(e,!0)}function v(t,r){for(var n=[],i=0,a=1;a<t.length;a++){var o=p(t.charCodeAt(a-1)),s=p(t.charCodeAt(a)),c=D(t,r,a),l=r&&x(t,a,i);(h(t.charCodeAt(a-1))||h(t.charCodeAt(a))||o!==s||c||l)&&(b(t,i,a)||n.push(e.createTextSpan(i,a-i)),i=a);}return b(t,i,t.length)||n.push(e.createTextSpan(i,t.length-i)),n}function h(e){switch(e){case 33:case 34:case 35:case 37:case 38:case 39:case 40:case 41:case 42:case 44:case 45:case 46:case 47:case 58:case 59:case 63:case 64:case 91:case 92:case 93:case 95:case 123:case 125:return !0}return !1}function b(e,t,r){return T(e,(function(e){return h(e)&&95!==e}),t,r)}function x(e,t,r){return t!==r&&t+1<e.length&&u(e.charCodeAt(t))&&_(e.charCodeAt(t+1))&&T(e,u,r,t)}function D(e,t,r){var n=u(e.charCodeAt(r-1));return u(e.charCodeAt(r))&&(!t||!n)}function S(e,t,r){for(var n=e;n<t;n++)if(!r(n))return !1;return !0}function T(e,t,r,n){return void 0===r&&(r=0),void 0===n&&(n=e.length),S(r,n,(function(r){return t(e.charCodeAt(r),r)}))}!function(e){e[e.exact=0]="exact",e[e.prefix=1]="prefix",e[e.substring=2]="substring",e[e.camelCase=3]="camelCase";}(t=e.PatternMatchKind||(e.PatternMatchKind={})),e.createPatternMatcher=function(t){var r=new e.Map,n=t.trim().split(".").map((function(e){return {totalTextChunk:g(t=e.trim()),subWordTextChunks:f(t)};var t;}));if(!n.some((function(e){return !e.subWordTextChunks.length})))return {getFullMatch:function(t,i){return function(t,r,n,i){var s;if(a(r,e.last(n),i)&&!(n.length-1>t.length)){for(var c=n.length-2,l=t.length-1;c>=0;c-=1,l-=1)s=o(s,a(t[l],n[c],i));return s}}(t,i,n,r)},getMatchForLastSegmentOfPattern:function(t){return a(t,e.last(n),r)},patternContainsDots:n.length>1}},e.breakIntoCharacterSpans=m,e.breakIntoWordSpans=y;}(t),function(e){e.preProcessFile=function(t,r,n){void 0===r&&(r=!0),void 0===n&&(n=!1);var i,a,o,s={languageVersion:1,pragmas:void 0,checkJsDirective:void 0,referencedFiles:[],typeReferenceDirectives:[],libReferenceDirectives:[],amdDependencies:[],hasNoDefaultLib:void 0,moduleName:void 0},c=[],l=0,u=!1;function _(){return a=o,18===(o=e.scanner.scan())?l++:19===o&&l--,o}function d(){var t=e.scanner.getTokenValue(),r=e.scanner.getTokenPos();return {fileName:t,pos:r,end:r+t.length}}function p(){c.push(d()),f();}function f(){0===l&&(u=!0);}function g(){if(24===a)return !1;var t=e.scanner.getToken();if(100===t){if(20===(t=_())){if(10===(t=_())||14===t)return p(),!0}else {if(10===t)return p(),!0;if(151===t&&e.scanner.lookAhead((function(){var t=e.scanner.scan();return 155!==t&&(41===t||18===t||79===t||e.isKeyword(t))}))&&(t=_()),79===t||e.isKeyword(t))if(155===(t=_())){if(10===(t=_()))return p(),!0}else if(63===t){if(y(!0))return !0}else {if(27!==t)return !0;t=_();}if(18===t){for(t=_();19!==t&&1!==t;)t=_();19===t&&155===(t=_())&&10===(t=_())&&p();}else 41===t&&127===(t=_())&&(79===(t=_())||e.isKeyword(t))&&155===(t=_())&&10===(t=_())&&p();}return !0}return !1}function m(){var t=e.scanner.getToken();if(93===t){if(f(),151===(t=_())&&e.scanner.lookAhead((function(){var t=e.scanner.scan();return 41===t||18===t}))&&(t=_()),18===t){for(t=_();19!==t&&1!==t;)t=_();19===t&&155===(t=_())&&10===(t=_())&&p();}else if(41===t)155===(t=_())&&10===(t=_())&&p();else if(100===t&&(151===(t=_())&&e.scanner.lookAhead((function(){var t=e.scanner.scan();return 79===t||e.isKeyword(t)}))&&(t=_()),(79===t||e.isKeyword(t))&&63===(t=_())&&y(!0)))return !0;return !0}return !1}function y(t,r){void 0===r&&(r=!1);var n=t?_():e.scanner.getToken();return 145===n&&(20===(n=_())&&(10===(n=_())||r&&14===n)&&p(),!0)}function v(){var t=e.scanner.getToken();if(79===t&&"define"===e.scanner.getTokenValue()){if(20!==(t=_()))return !0;if(10===(t=_())||14===t){if(27!==(t=_()))return !0;t=_();}if(22!==t)return !0;for(t=_();23!==t&&1!==t;)10!==t&&14!==t||p(),t=_();return !0}return !1}if(r&&function(){for(e.scanner.setText(t),_();1!==e.scanner.getToken();)135===e.scanner.getToken()&&(141===_()&&10===_()&&(i||(i=[]),i.push({ref:d(),depth:l})),1)||g()||m()||n&&(y(!1,!0)||v())||_();e.scanner.setText(void 0);}(),e.processCommentPragmas(s,t),e.processPragmasIntoFields(s,e.noop),u){if(i)for(var h=0,b=i;h<b.length;h++){var x=b[h];c.push(x.ref);}return {referencedFiles:s.referencedFiles,typeReferenceDirectives:s.typeReferenceDirectives,libReferenceDirectives:s.libReferenceDirectives,importedFiles:c,isLibFile:!!s.hasNoDefaultLib,ambientExternalModules:void 0}}var D=void 0;if(i)for(var S=0,T=i;S<T.length;S++)0===(x=T[S]).depth?(D||(D=[]),D.push(x.ref.fileName)):c.push(x.ref);return {referencedFiles:s.referencedFiles,typeReferenceDirectives:s.typeReferenceDirectives,libReferenceDirectives:s.libReferenceDirectives,importedFiles:c,isLibFile:!!s.hasNoDefaultLib,ambientExternalModules:D}};}(t),function(e){!function(t){function r(e,t,r,n,a,o){return {canRename:!0,fileToRename:void 0,kind:r,displayName:e,fullDisplayName:t,kindModifiers:n,triggerSpan:i(a,o)}}function n(t){return {canRename:!1,localizedErrorMessage:e.getLocaleSpecificMessage(t)}}function i(t,r){var n=t.getStart(r),i=t.getWidth(r);return e.isStringLiteralLike(t)&&(n+=1,i-=2),e.createTextSpan(n,i)}function a(t){switch(t.kind){case 79:case 80:case 10:case 14:case 108:return !0;case 8:return e.isLiteralNameOfPropertyDeclarationOrIndexAccess(t);default:return !1}}t.getRenameInfo=function(t,i,o,s){var c=e.getAdjustedRenameLocation(e.getTouchingPropertyName(i,o));if(a(c)){var l=function(t,i,a,o,s){var c=i.getSymbolAtLocation(t);if(c){var l=c.declarations;if(l&&0!==l.length){if(l.some((function(t){return function(t,r){var n=r.getSourceFile();return t.isSourceFileDefaultLibrary(n)&&e.fileExtensionIs(n.fileName,".d.ts")}(o,t)})))return n(e.Diagnostics.You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library);if(!(e.isIdentifier(t)&&88===t.originalKeywordKind&&c.parent&&1536&c.parent.flags)){if(e.isStringLiteralLike(t)&&e.tryGetImportFromModuleSpecifier(t))return s&&s.allowRenameOfImportPath?function(t,r,i){if(!e.isExternalModuleNameRelative(t.text))return n(e.Diagnostics.You_cannot_rename_a_module_via_a_global_import);var a=i.declarations&&e.find(i.declarations,e.isSourceFile);if(a){var o=e.endsWith(t.text,"/index")||e.endsWith(t.text,"/index.js")?void 0:e.tryRemoveSuffix(e.removeFileExtension(a.fileName),"/index"),s=void 0===o?a.fileName:o,c=void 0===o?"module":"directory",l=t.text.lastIndexOf("/")+1;return {canRename:!0,fileToRename:s,kind:c,displayName:s,fullDisplayName:s,kindModifiers:"",triggerSpan:e.createTextSpan(t.getStart(r)+1+l,t.text.length-l)}}}(t,a,c):void 0;var u=e.SymbolDisplay.getSymbolKind(i,c,t),_=e.isImportOrExportSpecifierName(t)||e.isStringOrNumericLiteralLike(t)&&161===t.parent.kind?e.stripQuotes(e.getTextOfIdentifierOrLiteral(t)):void 0;return r(_||i.symbolToString(c),_||i.getFullyQualifiedName(c),u,e.SymbolDisplay.getSymbolModifiers(i,c),t,a)}}}else if(e.isStringLiteralLike(t)){var d=e.getContextualTypeFromParentOrAncestorTypeNode(t,i);if(d&&(128&d.flags||1048576&d.flags&&e.every(d.types,(function(e){return !!(128&e.flags)}))))return r(t.text,t.text,"string","",t,a)}else if(e.isLabelName(t)){var p=e.getTextOfNode(t);return r(p,p,"label","",t,a)}}(c,t.getTypeChecker(),i,t,s);if(l)return l}return n(e.Diagnostics.You_cannot_rename_this_element)},t.nodeIsEligibleForRename=a;}(e.Rename||(e.Rename={}));}(t),function(e){!function(t){function r(t,r,n){return e.Debug.assert(n.pos<=r),r<n.end||n.getEnd()===r&&e.getTouchingPropertyName(t,r).pos<n.end}t.getSmartSelectionRange=function(t,n){var o,s,c,_={textSpan:e.createTextSpanFromBounds(n.getFullStart(),n.getEnd())},d=n;e:for(;;){var p=a(d);if(!p.length)break;for(var f=0;f<p.length;f++){var g=p[f-1],m=p[f],y=p[f+1];if(e.getTokenPosOfNode(m,n,!0)>t)break e;var v=e.singleOrUndefined(e.getTrailingCommentRanges(n.text,m.end));if(v&&2===v.kind&&S(v.pos,v.end),r(n,t,m)){if(e.isBlock(m)||e.isTemplateSpan(m)||e.isTemplateHead(m)||e.isTemplateTail(m)||g&&e.isTemplateHead(g)||e.isVariableDeclarationList(m)&&e.isVariableStatement(d)||e.isSyntaxList(m)&&e.isVariableDeclarationList(d)||e.isVariableDeclaration(m)&&e.isSyntaxList(d)&&1===p.length||e.isJSDocTypeExpression(m)||e.isJSDocSignature(m)||e.isJSDocTypeLiteral(m)){d=m;break}e.isTemplateSpan(d)&&y&&e.isTemplateMiddleOrTemplateTail(y)&&D(m.getFullStart()-"${".length,y.getStart()+"}".length);var h=e.isSyntaxList(m)&&(18===(c=(s=g)&&s.kind)||22===c||20===c||279===c)&&l(y)&&!e.positionsAreOnSameLine(g.getStart(),y.getStart(),n),b=h?g.getEnd():m.getStart(),x=h?y.getStart():u(n,m);e.hasJSDocNodes(m)&&(null===(o=m.jsDoc)||void 0===o?void 0:o.length)&&D(e.first(m.jsDoc).getStart(),x),D(b,x),(e.isStringLiteral(m)||e.isTemplateLiteral(m))&&D(b+1,x-1),d=m;break}if(f===p.length-1)break e}}return _;function D(r,n){if(r!==n){var a=e.createTextSpanFromBounds(r,n);(!_||!e.textSpansEqual(a,_.textSpan)&&e.textSpanIntersectsWithPosition(a,t))&&(_=i$1({textSpan:a},_&&{parent:_}));}}function S(e,t){D(e,t);for(var r=e;47===n.text.charCodeAt(r);)r++;D(r,t);}};var n=e.or(e.isImportDeclaration,e.isImportEqualsDeclaration);function a(t){if(e.isSourceFile(t))return o(t.getChildAt(0).getChildren(),n);if(e.isMappedTypeNode(t)){var r=t.getChildren(),i=r[0],a=r.slice(1),l=e.Debug.checkDefined(a.pop());e.Debug.assertEqual(i.kind,18),e.Debug.assertEqual(l.kind,19);var u=o(a,(function(e){return e===t.readonlyToken||144===e.kind||e===t.questionToken||57===e.kind}));return [i,c(s(o(u,(function(e){var t=e.kind;return 22===t||162===t||23===t})),(function(e){return 58===e.kind}))),l]}if(e.isPropertySignature(t))return s(a=o(t.getChildren(),(function(r){return r===t.name||e.contains(t.modifiers,r)})),(function(e){return 58===e.kind}));if(e.isParameter(t)){var _=o(t.getChildren(),(function(e){return e===t.dotDotDotToken||e===t.name}));return s(o(_,(function(e){return e===_[0]||e===t.questionToken})),(function(e){return 63===e.kind}))}return e.isBindingElement(t)?s(t.getChildren(),(function(e){return 63===e.kind})):t.getChildren()}function o(e,t){for(var r,n=[],i=0,a=e;i<a.length;i++){var o=a[i];t(o)?(r=r||[]).push(o):(r&&(n.push(c(r)),r=void 0),n.push(o));}return r&&n.push(c(r)),n}function s(t,r,n){if(void 0===n&&(n=!0),t.length<2)return t;var i=e.findIndex(t,r);if(-1===i)return t;var a=t.slice(0,i),o=t[i],s=e.last(t),l=n&&26===s.kind,u=t.slice(i+1,l?t.length-1:void 0),_=e.compact([a.length?c(a):void 0,o,u.length?c(u):void 0]);return l?_.concat(s):_}function c(t){return e.Debug.assertGreaterThanOrEqual(t.length,1),e.setTextRangePosEnd(e.parseNodeFactory.createSyntaxList(t),t[0].pos,e.last(t).end)}function l(e){var t=e&&e.kind;return 19===t||23===t||21===t||280===t}function u(e,t){switch(t.kind){case 338:case 336:case 345:case 343:case 340:return e.getLineEndOfPosition(t.getStart());default:return t.getEnd()}}}(e.SmartSelectionRange||(e.SmartSelectionRange={}));}(t),function(e){!function(t){var r,i;function a(t,r,n){for(var i=t.getFullStart(),a=t.parent;a;){var o=e.findPrecedingToken(i,r,a,!0);if(o)return e.rangeContainsRange(n,o);a=a.parent;}return e.Debug.fail("Could not find preceding token")}function o(t,r){var n=function(t,r){if(29===t.kind||20===t.kind)return {list:p(t.parent,t,r),argumentIndex:0};var n=e.findContainingList(t);return n&&{list:n,argumentIndex:u(n,t)}}(t,r);if(n){var i=n.list,a=n.argumentIndex,o=function(t){var r=t.getChildren(),n=e.countWhere(r,(function(e){return 27!==e.kind}));return r.length>0&&27===e.last(r).kind&&n++,n}(i);return 0!==a&&e.Debug.assertLessThan(a,o),{list:i,argumentIndex:a,argumentCount:o,argumentsSpan:function(t,r){var n=t.getFullStart(),i=e.skipTrivia(r.text,t.getEnd(),!1);return e.createTextSpan(n,i-n)}(i,r)}}}function s(t,r,n){var i=t.parent;if(e.isCallOrNewExpression(i)){var a=i,s=o(t,n);if(!s)return;var c=s.list,l=s.argumentIndex,u=s.argumentCount,d=s.argumentsSpan;return {isTypeParameterList:!!i.typeArguments&&i.typeArguments.pos===c.pos,invocation:{kind:0,node:a},argumentsSpan:d,argumentIndex:l,argumentCount:u}}if(e.isNoSubstitutionTemplateLiteral(t)&&e.isTaggedTemplateExpression(i))return e.isInsideTemplateLiteral(t,r,n)?_(i,0,n):void 0;if(e.isTemplateHead(t)&&209===i.parent.kind){var p=i,f=p.parent;return e.Debug.assert(222===p.kind),_(f,l=e.isInsideTemplateLiteral(t,r,n)?0:1,n)}if(e.isTemplateSpan(i)&&e.isTaggedTemplateExpression(i.parent.parent)){var g=i;if(f=i.parent.parent,e.isTemplateTail(t)&&!e.isInsideTemplateLiteral(t,r,n))return;return _(f,l=function(t,r,n,i){return e.Debug.assert(n>=r.getStart(),"Assumed 'position' could not occur before node."),e.isTemplateLiteralToken(r)?e.isInsideTemplateLiteral(r,n,i)?0:t+2:t+1}(g.parent.templateSpans.indexOf(g),t,r,n),n)}if(e.isJsxOpeningLikeElement(i)){var m=i.attributes.pos,y=e.skipTrivia(n.text,i.attributes.end,!1);return {isTypeParameterList:!1,invocation:{kind:0,node:i},argumentsSpan:e.createTextSpan(m,y-m),argumentIndex:0,argumentCount:1}}var v=e.getPossibleTypeArgumentsInfo(t,n);if(v){var h=v.called,b=v.nTypeArguments;return {isTypeParameterList:!0,invocation:a={kind:1,called:h},argumentsSpan:d=e.createTextSpanFromBounds(h.getStart(n),t.end),argumentIndex:b,argumentCount:b+1}}}function c(t){return e.isBinaryExpression(t.parent)?c(t.parent):t}function l(t){return e.isBinaryExpression(t.left)?l(t.left)+1:2}function u(e,t){for(var r=0,n=0,i=e.getChildren();n<i.length;n++){var a=i[n];if(a===t)break;27!==a.kind&&r++;}return r}function _(t,r,n){var i=e.isNoSubstitutionTemplateLiteral(t.template)?1:t.template.templateSpans.length+1;return 0!==r&&e.Debug.assertLessThan(r,i),{isTypeParameterList:!1,invocation:{kind:0,node:t},argumentsSpan:d(t,n),argumentIndex:r,argumentCount:i}}function d(t,r){var n=t.template,i=n.getStart(),a=n.getEnd();return 222===n.kind&&0===e.last(n.templateSpans).literal.getFullWidth()&&(a=e.skipTrivia(r.text,a,!1)),e.createTextSpan(i,a-i)}function p(t,r,n){var i=t.getChildren(n),a=i.indexOf(r);return e.Debug.assert(a>=0&&i.length>a+1),i[a+1]}function f(t){return 0===t.kind?e.getInvokedExpression(t.node):t.called}function g(e){return 0===e.kind?e.node:1===e.kind?e.called:e.node}!function(e){e[e.Call=0]="Call",e[e.TypeArgs=1]="TypeArgs",e[e.Contextual=2]="Contextual";}(r||(r={})),t.getSignatureHelpItems=function(t,r,n,i,u){var _=t.getTypeChecker(),d=e.findTokenOnLeftOfPosition(r,n);if(d){var p=!!i&&"characterTyped"===i.kind;if(!p||!e.isInString(r,n,d)&&!e.isInComment(r,n)){var m=!!i&&"invoked"===i.kind,h=function(t,r,n,i,a){for(var u=function(t){e.Debug.assert(e.rangeContainsRange(t.parent,t),"Not a subspan",(function(){return "Child: ".concat(e.Debug.formatSyntaxKind(t.kind),", parent: ").concat(e.Debug.formatSyntaxKind(t.parent.kind))}));var a=function(t,r,n,i){return function(t,r,n,i){var a=function(t,r,n){if(20===t.kind||27===t.kind){var i=t.parent;switch(i.kind){case 211:case 168:case 212:case 213:var a=o(t,r);if(!a)return;var s=a.argumentIndex,u=a.argumentCount,_=a.argumentsSpan,d=e.isMethodDeclaration(i)?n.getContextualTypeForObjectLiteralElement(i):n.getContextualType(i);return d&&{contextualType:d,argumentIndex:s,argumentCount:u,argumentsSpan:_};case 220:var p=c(i),f=n.getContextualType(p),g=20===t.kind?0:l(i)-1,m=l(p);return f&&{contextualType:f,argumentIndex:g,argumentCount:m,argumentsSpan:e.createTextSpanFromNode(i)};default:return}}}(t,n,i);if(a){var s,u=a.contextualType,_=a.argumentIndex,d=a.argumentCount,p=a.argumentsSpan,f=u.getNonNullableType(),g=f.getCallSignatures();return 1!==g.length?void 0:{isTypeParameterList:!1,invocation:{kind:2,signature:e.first(g),node:t,symbol:(s=f.symbol,"__type"===s.name&&e.firstDefined(s.declarations,(function(t){return e.isFunctionTypeNode(t)?t.parent.symbol:void 0}))||s)},argumentsSpan:p,argumentIndex:_,argumentCount:d}}}(t,0,n,i)||s(t,r,n)}(t,r,n,i);if(a)return {value:a}},_=t;!e.isSourceFile(_)&&(a||!e.isBlock(_));_=_.parent){var d=u(_);if("object"==typeof d)return d.value}}(d,n,r,_,m);if(h){u.throwIfCancellationRequested();var b=function(t,r,n,i,o){var s=t.invocation,c=t.argumentCount;switch(s.kind){case 0:if(o&&!function(t,r,n){if(!e.isCallOrNewExpression(r))return !1;var i=r.getChildren(n);switch(t.kind){case 20:return e.contains(i,t);case 27:var o=e.findContainingList(t);return !!o&&e.contains(i,o);case 29:return a(t,n,r.expression);default:return !1}}(i,s.node,n))return;var l=[],u=r.getResolvedSignatureForSignatureHelp(s.node,l,c);return 0===l.length?void 0:{kind:0,candidates:l,resolvedSignature:u};case 1:var _=s.called;if(o&&!a(i,n,e.isIdentifier(_)?_.parent:_))return;if(0!==(l=e.getPossibleGenericSignatures(_,c,r)).length)return {kind:0,candidates:l,resolvedSignature:e.first(l)};var d=r.getSymbolAtLocation(_);return d&&{kind:1,symbol:d};case 2:return {kind:0,candidates:[s.signature],resolvedSignature:s.signature};default:return e.Debug.assertNever(s)}}(h,_,r,d,p);return u.throwIfCancellationRequested(),b?_.runWithCancellationToken(u,(function(e){return 0===b.kind?y(b.candidates,b.resolvedSignature,h,r,e):function(e,t,r,n){var i=t.argumentCount,a=t.argumentsSpan,o=t.invocation,s=t.argumentIndex,c=n.getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(e);return c?{items:[v(e,c,n,g(o),r)],applicableSpan:a,selectedItemIndex:0,argumentIndex:s,argumentCount:i}:void 0}(b.symbol,h,r,e)})):e.isSourceFileJS(r)?function(t,r,n){if(2!==t.invocation.kind){var i=f(t.invocation),a=e.isPropertyAccessExpression(i)?i.name.text:void 0,o=r.getTypeChecker();return void 0===a?void 0:e.firstDefined(r.getSourceFiles(),(function(r){return e.firstDefined(r.getNamedDeclarations().get(a),(function(e){var i=e.symbol&&o.getTypeOfSymbolAtLocation(e.symbol,e),a=i&&i.getCallSignatures();if(a&&a.length)return o.runWithCancellationToken(n,(function(e){return y(a,a[0],t,r,e,!0)}))}))}))}}(h,t,u):void 0}}}},function(e){e[e.Candidate=0]="Candidate",e[e.Type=1]="Type";}(i||(i={})),t.getArgumentInfoForCompletions=function(e,t,r){var n=s(e,t,r);return !n||n.isTypeParameterList||0!==n.invocation.kind?void 0:{invocation:n.invocation.node,argumentCount:n.argumentCount,argumentIndex:n.argumentIndex}};var m=70246400;function y(t,r,i,a,o,s){var c,l=i.isTypeParameterList,u=i.argumentCount,_=i.argumentsSpan,d=i.invocation,p=i.argumentIndex,m=g(d),y=2===d.kind?d.symbol:o.getSymbolAtLocation(f(d))||s&&(null===(c=r.declaration)||void 0===c?void 0:c.symbol),v=y?e.symbolToDisplayParts(o,y,s?a:void 0,void 0):e.emptyArray,D=e.map(t,(function(t){return function(t,r,i,a,o,s){var c=(i?b:x)(t,a,o,s);return e.map(c,(function(i){var s=i.isVariadic,c=i.parameters,l=i.prefix,u=i.suffix,_=n$3(n$3([],r,!0),l,!0),d=n$3(n$3([],u,!0),function(t,r,n){return e.mapToDisplayParts((function(e){e.writePunctuation(":"),e.writeSpace(" ");var i=n.getTypePredicateOfSignature(t);i?n.writeTypePredicate(i,r,void 0,e):n.writeType(n.getReturnTypeOfSignature(t),r,void 0,e);}))}(t,o,a),!0),p=t.getDocumentationComment(a),f=t.getJsDocTags();return {isVariadic:s,prefixDisplayParts:_,suffixDisplayParts:d,separatorDisplayParts:h,parameters:c,documentation:p,tags:f}}))}(t,v,l,o,m,a)}));0!==p&&e.Debug.assertLessThan(p,u);for(var S=0,T=0,C=0;C<D.length;C++){var E=D[C];if(t[C]===r&&(S=T,E.length>1))for(var k=0,N=0,F=E;N<F.length;N++){var A=F[N];if(A.isVariadic||A.parameters.length>=u){S=T+k;break}k++;}T+=E.length;}e.Debug.assert(-1!==S);var P={items:e.flatMapToMutable(D,e.identity),applicableSpan:_,selectedItemIndex:S,argumentIndex:p,argumentCount:u},w=P.items[S];if(w.isVariadic){var I=e.findIndex(w.parameters,(function(e){return !!e.isRest}));-1<I&&I<w.parameters.length-1?P.argumentIndex=w.parameters.length:P.argumentIndex=Math.min(P.argumentIndex,w.parameters.length-1);}return P}function v(t,r,i,a,o){var s=e.symbolToDisplayParts(i,t),c=e.createPrinter({removeComments:!0}),l=r.map((function(e){return D(e,i,a,o,c)})),u=t.getDocumentationComment(i),_=t.getJsDocTags(i);return {isVariadic:!1,prefixDisplayParts:n$3(n$3([],s,!0),[e.punctuationPart(29)],!1),suffixDisplayParts:[e.punctuationPart(31)],separatorDisplayParts:h,parameters:l,documentation:u,tags:_}}var h=[e.punctuationPart(27),e.spacePart()];function b(t,r,i,a){var o=(t.target||t).typeParameters,s=e.createPrinter({removeComments:!0}),c=(o||e.emptyArray).map((function(e){return D(e,r,i,a,s)})),l=t.thisParameter?[r.symbolToParameterDeclaration(t.thisParameter,i,m)]:[];return r.getExpandedParameters(t).map((function(t){var o=e.factory.createNodeArray(n$3(n$3([],l,!0),e.map(t,(function(e){return r.symbolToParameterDeclaration(e,i,m)})),!0)),u=e.mapToDisplayParts((function(e){s.writeList(2576,o,a,e);}));return {isVariadic:!1,parameters:c,prefix:[e.punctuationPart(29)],suffix:n$3([e.punctuationPart(31)],u,!0)}}))}function x(t,r,i,a){var o=e.createPrinter({removeComments:!0}),s=e.mapToDisplayParts((function(n){if(t.typeParameters&&t.typeParameters.length){var s=e.factory.createNodeArray(t.typeParameters.map((function(e){return r.typeParameterToDeclaration(e,i,m)})));o.writeList(53776,s,a,n);}})),c=r.getExpandedParameters(t),l=r.hasEffectiveRestParameter(t)?1===c.length?function(e){return !0}:function(e){return !!(e.length&&32768&e[e.length-1].checkFlags)}:function(e){return !1};return c.map((function(t){return {isVariadic:l(t),parameters:t.map((function(t){return function(t,r,n,i,a){var o=e.mapToDisplayParts((function(e){var o=r.symbolToParameterDeclaration(t,n,m);a.writeNode(4,o,i,e);})),s=r.isOptionalParameter(t.valueDeclaration),c=!!(32768&t.checkFlags);return {name:t.name,documentation:t.getDocumentationComment(r),displayParts:o,isOptional:s,isRest:c}}(t,r,i,a,o)})),prefix:n$3(n$3([],s,!0),[e.punctuationPart(20)],!1),suffix:[e.punctuationPart(21)]}}))}function D(t,r,n,i,a){var o=e.mapToDisplayParts((function(e){var o=r.typeParameterToDeclaration(t,n,m);a.writeNode(4,o,i,e);}));return {name:t.symbol.name,documentation:t.symbol.getDocumentationComment(r),displayParts:o,isOptional:!1,isRest:!1}}}(e.SignatureHelp||(e.SignatureHelp={}));}(t),function(e){!function(t){function r(e){return "literals"===e.includeInlayParameterNameHints}t.provideInlayHints=function(t){var n=t.file,i=t.program,a=t.span,o=t.cancellationToken,s=t.preferences,c=n.text,l=i.getCompilerOptions(),u=i.getTypeChecker(),_=[];return function t(i){if(i&&0!==i.getFullWidth()){switch(i.kind){case 260:case 256:case 257:case 255:case 225:case 212:case 168:case 213:o.throwIfCancellationRequested();}if(e.textSpanIntersectsWith(a,i.pos,i.getFullWidth())&&!e.isTypeNode(i))return s.includeInlayVariableTypeHints&&e.isVariableDeclaration(i)||s.includeInlayPropertyDeclarationTypeHints&&e.isPropertyDeclaration(i)?function(t){if(t.initializer&&!e.isBindingPattern(t.name)&&!e.getEffectiveTypeAnnotationNode(t)){var r=u.getTypeAtLocation(t);if(!f(r)){var n=b(r);n&&p(n,t.name.end);}}}(i):s.includeInlayEnumMemberValueHints&&e.isEnumMember(i)?function(e){if(!e.initializer){var t,r,n=u.getConstantValue(e);void 0!==n&&(t=n.toString(),r=e.end,_.push({text:"= ".concat(h(t,30)),position:r,kind:"Enum",whitespaceBefore:!0}));}}(i):function(e){return "literals"===e.includeInlayParameterNameHints||"all"===e.includeInlayParameterNameHints}(s)&&(e.isCallExpression(i)||e.isNewExpression(i))?function(t){var n=t.arguments;if(n&&n.length){var i=[],a=u.getResolvedSignatureForSignatureHelp(t,i);if(a&&i.length)for(var o=0;o<n.length;++o){var c=n[o],l=e.skipParentheses(c);if(!r(s)||y(l)){var _=u.getParameterIdentifierNameAtPosition(a,o);if(_){var p=_[0],f=_[1];if(!s.includeInlayParameterNameHintsWhenArgumentMatchesName&&g(l,p)&&!f)continue;var v=e.unescapeLeadingUnderscores(p);if(m(l,v))continue;d(v,c.getStart(),f);}}}}}(i):(s.includeInlayFunctionParameterTypeHints&&e.isFunctionLikeDeclaration(i)&&e.hasContextSensitiveParameters(i)&&function(t){var r=u.getSignatureFromDeclaration(t);if(r)for(var n=0;n<t.parameters.length&&n<r.parameters.length;++n){var i=t.parameters[n];if(!e.getEffectiveTypeAnnotationNode(i)){var a=v(r.parameters[n]);a&&p(a,i.name.end);}}}(i),s.includeInlayFunctionLikeReturnTypeHints&&function(t){return e.isArrowFunction(t)||e.isFunctionExpression(t)||e.isFunctionDeclaration(t)||e.isMethodDeclaration(t)||e.isGetAccessorDeclaration(t)}(i)&&function(t){if((!e.isArrowFunction(t)||e.findChildOfKind(t,20,n))&&!e.getEffectiveReturnTypeNode(t)&&t.body){var r=u.getSignatureFromDeclaration(t);if(r){var i=u.getReturnTypeOfSignature(r);if(!f(i)){var a=b(i);a&&p(a,function(t){var r=e.findChildOfKind(t,21,n);return r?r.end:t.parameters.end}(t));}}}}(i)),e.forEachChild(i,t)}}(n),_;function d(e,t,r){_.push({text:"".concat(r?"...":"").concat(h(e,30),":"),position:t,kind:"Parameter",whitespaceAfter:!0});}function p(e,t){_.push({text:": ".concat(h(e,30)),position:t,kind:"Type",whitespaceBefore:!0});}function f(e){return e.symbol&&1536&e.symbol.flags}function g(t,r){return e.isIdentifier(t)?t.text===r:!!e.isPropertyAccessExpression(t)&&t.name.text===r}function m(t,r){if(!e.isIdentifierText(r,l.target,e.getLanguageVariant(n.scriptKind)))return !1;var i=e.getLeadingCommentRanges(c,t.pos);if(!(null==i?void 0:i.length))return !1;var a=function(e){return new RegExp("^\\s?/\\*\\*?\\s?".concat(e,"\\s?\\*\\/\\s?$"))}(r);return e.some(i,(function(e){return a.test(c.substring(e.pos,e.end))}))}function y(t){switch(t.kind){case 218:var r=t.operand;return e.isLiteralExpression(r)||e.isIdentifier(r)&&e.isInfinityOrNaNString(r.escapedText);case 110:case 95:case 104:case 14:case 222:return !0;case 79:var n=t.escapedText;return function(e){return "undefined"===e}(n)||e.isInfinityOrNaNString(n)}return e.isLiteralExpression(t)}function v(t){var r=t.valueDeclaration;if(r&&e.isParameter(r)){var n=u.getTypeOfSymbolAtLocation(t,r);if(!f(n))return b(n)}}function h(e,t){return e.length>t?e.substr(0,t-"...".length)+"...":e}function b(t){var r=e.createPrinter({removeComments:!0});return e.usingSingleLineStringWriter((function(i){var a=u.typeToTypeNode(t,void 0,71286784,i);e.Debug.assertIsDefined(a,"should always get typenode"),r.writeNode(4,a,n,i);}))}};}(e.InlayHints||(e.InlayHints={}));}(t),function(e){var t=/^data:(?:application\/json(?:;charset=[uU][tT][fF]-8);base64,([A-Za-z0-9+\/=]+)$)?/;function r(t,r,n){var i=e.tryParseRawSourceMap(r);if(i&&i.sources&&i.file&&i.mappings&&(!i.sourcesContent||!i.sourcesContent.some(e.isString)))return e.createDocumentPositionMapper(t,i,n)}e.getSourceMapper=function(t){var r=e.createGetCanonicalFileName(t.useCaseSensitiveFileNames()),n=t.getCurrentDirectory(),i=new e.Map,a=new e.Map;return {tryGetSourcePosition:function t(r){if(e.isDeclarationFileName(r.fileName)&&c(r.fileName)){var n=s(r.fileName).getSourcePosition(r);return n&&n!==r?t(n)||n:void 0}},tryGetGeneratedPosition:function(i){if(!e.isDeclarationFileName(i.fileName)){var a=c(i.fileName);if(a){var o=t.getProgram();if(!o.isSourceOfProjectReferenceRedirect(a.fileName)){var l=o.getCompilerOptions(),u=e.outFile(l),_=u?e.removeFileExtension(u)+".d.ts":e.getDeclarationEmitOutputFilePathWorker(i.fileName,o.getCompilerOptions(),n,o.getCommonSourceDirectory(),r);if(void 0!==_){var d=s(_,i.fileName).getGeneratedPosition(i);return d===i?void 0:d}}}}},toLineColumnOffset:function(e,t){return l(e).getLineAndCharacterOfPosition(t)},clearCache:function(){i.clear(),a.clear();}};function o(t){return e.toPath(t,n,r)}function s(n,i){var s,c=o(n),u=a.get(c);if(u)return u;if(t.getDocumentPositionMapper)s=t.getDocumentPositionMapper(n,i);else if(t.readFile){var _=l(n);s=_&&e.getDocumentPositionMapper({getSourceFileLike:l,getCanonicalFileName:r,log:function(e){return t.log(e)}},n,e.getLineInfo(_.text,e.getLineStarts(_)),(function(e){return !t.fileExists||t.fileExists(e)?t.readFile(e):void 0}));}return a.set(c,s||e.identitySourceMapConsumer),s||e.identitySourceMapConsumer}function c(e){var r=t.getProgram();if(r){var n=o(e),i=r.getSourceFileByPath(n);return i&&i.resolvedPath===n?i:void 0}}function l(r){return t.getSourceFileLike?t.getSourceFileLike(r):c(r)||function(r){var n=o(r),a=i.get(n);if(void 0!==a)return a||void 0;if(t.readFile&&(!t.fileExists||t.fileExists(n))){var s=t.readFile(n),c=!!s&&function(t,r){return {text:t,lineMap:void 0,getLineAndCharacterOfPosition:function(t){return e.computeLineAndCharacterOfPosition(e.getLineStarts(this),t)}}}(s);return i.set(n,c),c||void 0}i.set(n,!1);}(r)}},e.getDocumentPositionMapper=function(n,i,a,o){var s=e.tryGetSourceMappingURL(a);if(s){var c=t.exec(s);if(c){if(c[1]){var l=c[1];return r(n,e.base64decode(e.sys,l),i)}s=void 0;}}var u=[];s&&u.push(s),u.push(i+".map");for(var _=s&&e.getNormalizedAbsolutePath(s,e.getDirectoryPath(i)),d=0,p=u;d<p.length;d++){var f=p[d],g=e.getNormalizedAbsolutePath(f,e.getDirectoryPath(i)),m=o(g,_);if(e.isString(m))return r(n,m,g);if(void 0!==m)return m||void 0}};}(t),function(e){var t=new e.Map;function r(t){return e.isPropertyAccessExpression(t)?r(t.expression):t}function n(t){switch(t.kind){case 265:var r=t.importClause,n=t.moduleSpecifier;return r&&!r.name&&r.namedBindings&&267===r.namedBindings.kind&&e.isStringLiteral(n)?r.namedBindings.name:void 0;case 264:return t.name;default:return}}function i(e,t){var r=t.getSignatureFromDeclaration(e),n=r?t.getReturnTypeOfSignature(r):void 0;return !!n&&!!t.getPromisedTypeOfPromise(n)}function a(t,r){return e.isReturnStatement(t)&&!!t.expression&&o(t.expression,r)}function o(t,r){if(!s(t)||!c(t)||!t.arguments.every((function(e){return l(e,r)})))return !1;for(var n=t.expression.expression;s(n)||e.isPropertyAccessExpression(n);)if(e.isCallExpression(n)){if(!c(n)||!n.arguments.every((function(e){return l(e,r)})))return !1;n=n.expression.expression;}else n=n.expression;return !0}function s(t){return e.isCallExpression(t)&&(e.hasPropertyAccessExpressionWithName(t,"then")||e.hasPropertyAccessExpressionWithName(t,"catch")||e.hasPropertyAccessExpressionWithName(t,"finally"))}function c(t){var r=t.expression.name.text,n="then"===r?2:"catch"===r||"finally"===r?1:0;return !(t.arguments.length>n)&&(t.arguments.length<n||1===n||e.some(t.arguments,(function(t){return 104===t.kind||e.isIdentifier(t)&&"undefined"===t.text})))}function l(r,n){switch(r.kind){case 255:case 212:if(1&e.getFunctionFlags(r))return !1;case 213:t.set(u(r),!0);case 104:return !0;case 79:case 205:var i=n.getSymbolAtLocation(r);return !!i&&(n.isUndefinedSymbol(i)||e.some(e.skipAlias(i,n).declarations,(function(t){return e.isFunctionLike(t)||e.hasInitializer(t)&&!!t.initializer&&e.isFunctionLike(t.initializer)})));default:return !1}}function u(e){return "".concat(e.pos.toString(),":").concat(e.end.toString())}function _(e){switch(e.kind){case 255:case 168:case 212:case 213:return !0;default:return !1}}e.computeSuggestionDiagnostics=function(o,s,c){s.getSemanticDiagnostics(o,c);var l,d=[],p=s.getTypeChecker();o.impliedNodeFormat!==e.ModuleKind.CommonJS&&!e.fileExtensionIsOneOf(o.fileName,[".cts",".cjs"])&&o.commonJsModuleIndicator&&(e.programContainsEsModules(s)||e.compilerOptionsIndicateEsModules(s.getCompilerOptions()))&&function(t){return t.statements.some((function(t){switch(t.kind){case 236:return t.declarationList.declarations.some((function(t){return !!t.initializer&&e.isRequireCall(r(t.initializer),!0)}));case 237:var n=t.expression;if(!e.isBinaryExpression(n))return e.isRequireCall(n,!0);var i=e.getAssignmentDeclarationKind(n);return 1===i||2===i;default:return !1}}))}(o)&&d.push(e.createDiagnosticForNode((l=o.commonJsModuleIndicator,e.isBinaryExpression(l)?l.left:l),e.Diagnostics.File_is_a_CommonJS_module_it_may_be_converted_to_an_ES_module));var f=e.isSourceFileJS(o);if(t.clear(),function r(n){if(f)(function(t,r){var n,i,a,o;if(212===t.kind){if(e.isVariableDeclaration(t.parent)&&(null===(n=t.symbol.members)||void 0===n?void 0:n.size))return !0;var s=r.getSymbolOfExpando(t,!1);return !(!s||!(null===(i=s.exports)||void 0===i?void 0:i.size)&&!(null===(a=s.members)||void 0===a?void 0:a.size))}return 255===t.kind&&!!(null===(o=t.symbol.members)||void 0===o?void 0:o.size)})(n,p)&&d.push(e.createDiagnosticForNode(e.isVariableDeclaration(n.parent)?n.parent.name:n,e.Diagnostics.This_constructor_function_may_be_converted_to_a_class_declaration));else {if(e.isVariableStatement(n)&&n.parent===o&&2&n.declarationList.flags&&1===n.declarationList.declarations.length){var s=n.declarationList.declarations[0].initializer;s&&e.isRequireCall(s,!0)&&d.push(e.createDiagnosticForNode(s,e.Diagnostics.require_call_may_be_converted_to_an_import));}e.codefix.parameterShouldGetTypeFromJSDoc(n)&&d.push(e.createDiagnosticForNode(n.name||n,e.Diagnostics.JSDoc_types_may_be_moved_to_TypeScript_types));}_(n)&&function(r,n,o){(function(t,r){return !e.isAsyncFunction(t)&&t.body&&e.isBlock(t.body)&&function(t,r){return !!e.forEachReturnStatement(t,(function(e){return a(e,r)}))}(t.body,r)&&i(t,r)})(r,n)&&!t.has(u(r))&&o.push(e.createDiagnosticForNode(!r.name&&e.isVariableDeclaration(r.parent)&&e.isIdentifier(r.parent.name)?r.parent.name:r,e.Diagnostics.This_may_be_converted_to_an_async_function));}(n,p,d),n.forEachChild(r);}(o),e.getAllowSyntheticDefaultImports(s.getCompilerOptions()))for(var g=0,m=o.imports;g<m.length;g++){var y=m[g],v=n(e.importFromModuleSpecifier(y));if(v){var h=e.getResolvedModule(o,y.text,e.getModeForUsageLocation(o,y)),b=h&&s.getSourceFile(h.resolvedFileName);b&&b.externalModuleIndicator&&e.isExportAssignment(b.externalModuleIndicator)&&b.externalModuleIndicator.isExportEquals&&d.push(e.createDiagnosticForNode(v,e.Diagnostics.Import_may_be_converted_to_a_default_import));}}return e.addRange(d,o.bindSuggestionDiagnostics),e.addRange(d,s.getSuggestionDiagnostics(o,c)),d.sort((function(e,t){return e.start-t.start}))},e.returnsPromise=i,e.isReturnStatementWithFixablePromiseHandler=a,e.isFixablePromiseHandler=o,e.canBeConvertedToAsync=_;}(t),function(e){!function(t){var r=70246400;function n(t,r,n){var a=i(t,r,n);if(""!==a)return a;var o=e.getCombinedLocalAndExportSymbolFlags(r);return 32&o?e.getDeclarationOfKind(r,225)?"local class":"class":384&o?"enum":524288&o?"type":64&o?"interface":262144&o?"type parameter":8&o?"enum member":2097152&o?"alias":1536&o?"module":a}function i(t,r,n){var i=t.getRootSymbols(r);if(1===i.length&&8192&e.first(i).flags&&0!==t.getTypeOfSymbolAtLocation(r,n).getNonNullableType().getCallSignatures().length)return "method";if(t.isUndefinedSymbol(r))return "var";if(t.isArgumentsSymbol(r))return "local var";if(108===n.kind&&e.isExpression(n))return "parameter";var a=e.getCombinedLocalAndExportSymbolFlags(r);if(3&a)return e.isFirstDeclarationOfSymbolParameter(r)?"parameter":r.valueDeclaration&&e.isVarConst(r.valueDeclaration)?"const":e.forEach(r.declarations,e.isLet)?"let":o(r)?"local var":"var";if(16&a)return o(r)?"local function":"function";if(32768&a)return "getter";if(65536&a)return "setter";if(8192&a)return "method";if(16384&a)return "constructor";if(4&a){if(33554432&a&&6&r.checkFlags)return e.forEach(t.getRootSymbols(r),(function(e){if(98311&e.getFlags())return "property"}))||(t.getTypeOfSymbolAtLocation(r,n).getCallSignatures().length?"method":"property");switch(n.parent&&n.parent.kind){case 279:case 277:case 278:return 79===n.kind?"property":"JSX attribute";case 284:return "JSX attribute";default:return "property"}}return ""}function a(t){if(t.declarations&&t.declarations.length){var r=t.declarations,n=r[0],i=r.slice(1),a=e.length(i)&&e.isDeprecatedDeclaration(n)&&e.some(i,(function(t){return !e.isDeprecatedDeclaration(t)}))?8192:0,o=e.getNodeModifiers(n,a);if(o)return o.split(",")}return []}function o(t){return !t.parent&&e.forEach(t.declarations,(function(t){if(212===t.kind)return !0;if(253!==t.kind&&255!==t.kind)return !1;for(var r=t.parent;!e.isFunctionBlock(r);r=r.parent)if(303===r.kind||261===r.kind)return !1;return !0}))}t.getSymbolKind=n,t.getSymbolModifiers=function(t,r){if(!r)return "";var n=new e.Set(a(r));if(2097152&r.flags){var i=t.getAliasedSymbol(r);i!==r&&e.forEach(a(i),(function(e){n.add(e);}));}return 16777216&r.flags&&n.add("optional"),n.size>0?e.arrayFrom(n.values()).join(","):""},t.getSymbolDisplayPartsDocumentationAndSymbolKind=function t(a,o,s,c,l,u,_){var d;void 0===u&&(u=e.getMeaningFromLocation(l));var p,f,g,m,y=[],v=[],h=[],b=e.getCombinedLocalAndExportSymbolFlags(o),x=1&u?i(a,o,l):"",D=!1,S=108===l.kind&&e.isInExpressionContext(l),T=!1;if(108===l.kind&&!S)return {displayParts:[e.keywordPart(108)],documentation:[],symbolKind:"primitive type",tags:void 0};if(""!==x||32&b||2097152&b){"getter"!==x&&"setter"!==x||(x="property");var C=void 0;if(p=S?a.getTypeAtLocation(l):a.getTypeOfSymbolAtLocation(o,l),l.parent&&205===l.parent.kind){var E=l.parent.name;(E===l||E&&0===E.getFullWidth())&&(l=l.parent);}var k=void 0;if(e.isCallOrNewExpression(l)?k=l:(e.isCallExpressionTarget(l)||e.isNewExpressionTarget(l)||l.parent&&(e.isJsxOpeningLikeElement(l.parent)||e.isTaggedTemplateExpression(l.parent))&&e.isFunctionLike(o.valueDeclaration))&&(k=l.parent),k){C=a.getResolvedSignature(k);var N=208===k.kind||e.isCallExpression(k)&&106===k.expression.kind,F=N?p.getConstructSignatures():p.getCallSignatures();if(!C||e.contains(F,C.target)||e.contains(F,C)||(C=F.length?F[0]:void 0),C){switch(N&&32&b?(x="constructor",Y(p.symbol,x)):2097152&b?(Z(x="alias"),y.push(e.spacePart()),N&&(4&C.flags&&(y.push(e.keywordPart(126)),y.push(e.spacePart())),y.push(e.keywordPart(103)),y.push(e.spacePart())),X(o)):Y(o,x),x){case"JSX attribute":case"property":case"var":case"const":case"let":case"parameter":case"local var":y.push(e.punctuationPart(58)),y.push(e.spacePart()),16&e.getObjectFlags(p)||!p.symbol||(e.addRange(y,e.symbolToDisplayParts(a,p.symbol,c,void 0,5)),y.push(e.lineBreakPart())),N&&(4&C.flags&&(y.push(e.keywordPart(126)),y.push(e.spacePart())),y.push(e.keywordPart(103)),y.push(e.spacePart())),$(C,F,262144);break;default:$(C,F);}D=!0,T=F.length>1;}}else if(e.isNameOfFunctionDeclaration(l)&&!(98304&b)||134===l.kind&&170===l.parent.kind){var A=l.parent;o.declarations&&e.find(o.declarations,(function(e){return e===(134===l.kind?A.parent:A)}))&&(F=170===A.kind?p.getNonNullableType().getConstructSignatures():p.getNonNullableType().getCallSignatures(),C=a.isImplementationOfOverload(A)?F[0]:a.getSignatureFromDeclaration(A),170===A.kind?(x="constructor",Y(p.symbol,x)):Y(173!==A.kind||2048&p.symbol.flags||4096&p.symbol.flags?o:p.symbol,x),C&&$(C,F),D=!0,T=F.length>1);}}if(32&b&&!D&&!S&&(G(),e.getDeclarationOfKind(o,225)?Z("local class"):y.push(e.keywordPart(84)),y.push(e.spacePart()),X(o),ee(o,s)),64&b&&2&u&&(H(),y.push(e.keywordPart(118)),y.push(e.spacePart()),X(o),ee(o,s)),524288&b&&2&u&&(H(),y.push(e.keywordPart(151)),y.push(e.spacePart()),X(o),ee(o,s),y.push(e.spacePart()),y.push(e.operatorPart(63)),y.push(e.spacePart()),e.addRange(y,e.typeToDisplayParts(a,a.getDeclaredTypeOfSymbol(o),c,8388608))),384&b&&(H(),e.some(o.declarations,(function(t){return e.isEnumDeclaration(t)&&e.isEnumConst(t)}))&&(y.push(e.keywordPart(85)),y.push(e.spacePart())),y.push(e.keywordPart(92)),y.push(e.spacePart()),X(o)),1536&b&&!S){H();var P=(V=e.getDeclarationOfKind(o,260))&&V.name&&79===V.name.kind;y.push(e.keywordPart(P?142:141)),y.push(e.spacePart()),X(o);}if(262144&b&&2&u)if(H(),y.push(e.punctuationPart(20)),y.push(e.textPart("type parameter")),y.push(e.punctuationPart(21)),y.push(e.spacePart()),X(o),o.parent)Q(),X(o.parent,c),ee(o.parent,c);else {var w=e.getDeclarationOfKind(o,162);if(void 0===w)return e.Debug.fail();(V=w.parent)&&(e.isFunctionLikeKind(V.kind)?(Q(),C=a.getSignatureFromDeclaration(V),174===V.kind?(y.push(e.keywordPart(103)),y.push(e.spacePart())):173!==V.kind&&V.name&&X(V.symbol),e.addRange(y,e.signatureToDisplayParts(a,C,s,32))):258===V.kind&&(Q(),y.push(e.keywordPart(151)),y.push(e.spacePart()),X(V.symbol),ee(V.symbol,s)));}if(8&b&&(x="enum member",Y(o,"enum member"),297===(null==(V=null===(d=o.declarations)||void 0===d?void 0:d[0])?void 0:V.kind))){var I=a.getConstantValue(V);void 0!==I&&(y.push(e.spacePart()),y.push(e.operatorPart(63)),y.push(e.spacePart()),y.push(e.displayPart(e.getTextOfConstantValue(I),"number"==typeof I?e.SymbolDisplayPartKind.numericLiteral:e.SymbolDisplayPartKind.stringLiteral)));}if(2097152&o.flags){if(H(),!D){var O=a.getAliasedSymbol(o);if(O!==o&&O.declarations&&O.declarations.length>0){var M=O.declarations[0],L=e.getNameOfDeclaration(M);if(L){var R=e.isModuleWithStringLiteralName(M)&&e.hasSyntacticModifier(M,2),B="default"!==o.name&&!R,j=t(a,O,e.getSourceFileOfNode(M),M,L,u,B?o:O);y.push.apply(y,j.displayParts),y.push(e.lineBreakPart()),g=j.documentation,m=j.tags;}else g=O.getContextualDocumentationComment(M,a),m=O.getJsDocTags(a);}}if(o.declarations)switch(o.declarations[0].kind){case 263:y.push(e.keywordPart(93)),y.push(e.spacePart()),y.push(e.keywordPart(142));break;case 270:y.push(e.keywordPart(93)),y.push(e.spacePart()),y.push(e.keywordPart(o.declarations[0].isExportEquals?63:88));break;case 274:y.push(e.keywordPart(93));break;default:y.push(e.keywordPart(100));}y.push(e.spacePart()),X(o),e.forEach(o.declarations,(function(t){if(264===t.kind){var r=t;if(e.isExternalModuleImportEqualsDeclaration(r))y.push(e.spacePart()),y.push(e.operatorPart(63)),y.push(e.spacePart()),y.push(e.keywordPart(145)),y.push(e.punctuationPart(20)),y.push(e.displayPart(e.getTextOfNode(e.getExternalModuleImportEqualsDeclarationExpression(r)),e.SymbolDisplayPartKind.stringLiteral)),y.push(e.punctuationPart(21));else {var n=a.getSymbolAtLocation(r.moduleReference);n&&(y.push(e.spacePart()),y.push(e.operatorPart(63)),y.push(e.spacePart()),X(n,c));}return !0}}));}if(!D)if(""!==x){if(p)if(S?(H(),y.push(e.keywordPart(108))):Y(o,x),"property"===x||"JSX attribute"===x||3&b||"local var"===x||S){if(y.push(e.punctuationPart(58)),y.push(e.spacePart()),p.symbol&&262144&p.symbol.flags){var J=e.mapToDisplayParts((function(t){var n=a.typeParameterToDeclaration(p,c,r);W().writeNode(4,n,e.getSourceFileOfNode(e.getParseTreeNode(c)),t);}));e.addRange(y,J);}else e.addRange(y,e.typeToDisplayParts(a,p,c));if(o.target&&o.target.tupleLabelDeclaration){var z=o.target.tupleLabelDeclaration;e.Debug.assertNode(z.name,e.isIdentifier),y.push(e.spacePart()),y.push(e.punctuationPart(20)),y.push(e.textPart(e.idText(z.name))),y.push(e.punctuationPart(21));}}else (16&b||8192&b||16384&b||131072&b||98304&b||"method"===x)&&(F=p.getNonNullableType().getCallSignatures()).length&&($(F[0],F),T=F.length>1);}else x=n(a,o,l);if(0!==v.length||T||(v=o.getContextualDocumentationComment(c,a)),0===v.length&&4&b&&o.parent&&o.declarations&&e.forEach(o.parent.declarations,(function(e){return 303===e.kind})))for(var U=0,K=o.declarations;U<K.length;U++){var V;if((V=K[U]).parent&&220===V.parent.kind){var q=a.getSymbolAtLocation(V.parent.right);if(q&&(v=q.getDocumentationComment(a),h=q.getJsDocTags(a),v.length>0))break}}return 0!==h.length||T||(h=o.getJsDocTags(a)),0===v.length&&g&&(v=g),0===h.length&&m&&(h=m),{displayParts:y,documentation:v,symbolKind:x,tags:0===h.length?void 0:h};function W(){return f||(f=e.createPrinter({removeComments:!0})),f}function H(){y.length&&y.push(e.lineBreakPart()),G();}function G(){_&&(Z("alias"),y.push(e.spacePart()));}function Q(){y.push(e.spacePart()),y.push(e.keywordPart(101)),y.push(e.spacePart());}function X(t,r){_&&t===o&&(t=_);var n=e.symbolToDisplayParts(a,t,r||s,void 0,7);e.addRange(y,n),16777216&o.flags&&y.push(e.punctuationPart(57));}function Y(t,r){H(),r&&(Z(r),t&&!e.some(t.declarations,(function(t){return e.isArrowFunction(t)||(e.isFunctionExpression(t)||e.isClassExpression(t))&&!t.name}))&&(y.push(e.spacePart()),X(t)));}function Z(t){switch(t){case"var":case"function":case"let":case"const":case"constructor":return void y.push(e.textOrKeywordPart(t));default:return y.push(e.punctuationPart(20)),y.push(e.textOrKeywordPart(t)),void y.push(e.punctuationPart(21))}}function $(t,r,n){void 0===n&&(n=0),e.addRange(y,e.signatureToDisplayParts(a,t,c,32|n)),r.length>1&&(y.push(e.spacePart()),y.push(e.punctuationPart(20)),y.push(e.operatorPart(39)),y.push(e.displayPart((r.length-1).toString(),e.SymbolDisplayPartKind.numericLiteral)),y.push(e.spacePart()),y.push(e.textPart(2===r.length?"overload":"overloads")),y.push(e.punctuationPart(21))),v=t.getDocumentationComment(a),h=t.getJsDocTags(),r.length>1&&0===v.length&&0===h.length&&(v=r[0].getDocumentationComment(a),h=r[0].getJsDocTags());}function ee(t,n){var i=e.mapToDisplayParts((function(i){var o=a.symbolToTypeParameterDeclarations(t,n,r);W().writeList(53776,o,e.getSourceFileOfNode(e.getParseTreeNode(n)),i);}));e.addRange(y,i);}};}(e.SymbolDisplay||(e.SymbolDisplay={}));}(t),function(e){function t(t,r){var i=[],a=r.compilerOptions?n(r.compilerOptions,i):{},o=e.getDefaultCompilerOptions();for(var s in o)e.hasProperty(o,s)&&void 0===a[s]&&(a[s]=o[s]);for(var c=0,l=e.transpileOptionValueCompilerOptions;c<l.length;c++){var u=l[c];a[u.name]=u.transpileOptionValue;}a.suppressOutputPathCheck=!0,a.allowNonTsExtensions=!0;var _=r.fileName||(r.compilerOptions&&r.compilerOptions.jsx?"module.tsx":"module.ts"),d=e.createSourceFile(_,t,e.getEmitScriptTarget(a));r.moduleName&&(d.moduleName=r.moduleName),r.renamedDependencies&&(d.renamedDependencies=new e.Map(e.getEntries(r.renamedDependencies)));var p,f,g=e.getNewLineCharacter(a),m={getSourceFile:function(t){return t===e.normalizePath(_)?d:void 0},writeFile:function(t,r){e.fileExtensionIs(t,".map")?(e.Debug.assertEqual(f,void 0,"Unexpected multiple source map outputs, file:",t),f=r):(e.Debug.assertEqual(p,void 0,"Unexpected multiple outputs, file:",t),p=r);},getDefaultLibFileName:function(){return "lib.d.ts"},useCaseSensitiveFileNames:function(){return !1},getCanonicalFileName:function(e){return e},getCurrentDirectory:function(){return ""},getNewLine:function(){return g},fileExists:function(e){return e===_},readFile:function(){return ""},directoryExists:function(){return !0},getDirectories:function(){return []}},y=e.createProgram([_],a,m);return r.reportDiagnostics&&(e.addRange(i,y.getSyntacticDiagnostics(d)),e.addRange(i,y.getOptionsDiagnostics())),y.emit(void 0,void 0,void 0,void 0,r.transformers),void 0===p?e.Debug.fail("Output generation failed"):{outputText:p,diagnostics:i,sourceMapText:f}}var r;function n(t,n){r=r||e.filter(e.optionDeclarations,(function(t){return "object"==typeof t.type&&!e.forEachEntry(t.type,(function(e){return "number"!=typeof e}))})),t=e.cloneCompilerOptions(t);for(var i=function(r){if(!e.hasProperty(t,r.name))return "continue";var i=t[r.name];e.isString(i)?t[r.name]=e.parseCustomTypeOption(r,i,n):e.forEachEntry(r.type,(function(e){return e===i}))||n.push(e.createCompilerDiagnosticForInvalidCustomType(r));},a=0,o=r;a<o.length;a++)i(o[a]);return t}e.transpileModule=t,e.transpile=function(r,n,i,a,o){var s=t(r,{compilerOptions:n,fileName:i,reportDiagnostics:!!a,moduleName:o});return e.addRange(a,s.diagnostics),s.outputText},e.fixupCompilerOptions=n;}(t),function(e){!function(t){var r;(r=t.FormattingRequestKind||(t.FormattingRequestKind={}))[r.FormatDocument=0]="FormatDocument",r[r.FormatSelection=1]="FormatSelection",r[r.FormatOnEnter=2]="FormatOnEnter",r[r.FormatOnSemicolon=3]="FormatOnSemicolon",r[r.FormatOnOpeningCurlyBrace=4]="FormatOnOpeningCurlyBrace",r[r.FormatOnClosingCurlyBrace=5]="FormatOnClosingCurlyBrace";var n=function(){function t(e,t,r){this.sourceFile=e,this.formattingRequestKind=t,this.options=r;}return t.prototype.updateContext=function(t,r,n,i,a){this.currentTokenSpan=e.Debug.checkDefined(t),this.currentTokenParent=e.Debug.checkDefined(r),this.nextTokenSpan=e.Debug.checkDefined(n),this.nextTokenParent=e.Debug.checkDefined(i),this.contextNode=e.Debug.checkDefined(a),this.contextNodeAllOnSameLine=void 0,this.nextNodeAllOnSameLine=void 0,this.tokensAreOnSameLine=void 0,this.contextNodeBlockIsOnOneLine=void 0,this.nextNodeBlockIsOnOneLine=void 0;},t.prototype.ContextNodeAllOnSameLine=function(){return void 0===this.contextNodeAllOnSameLine&&(this.contextNodeAllOnSameLine=this.NodeIsOnOneLine(this.contextNode)),this.contextNodeAllOnSameLine},t.prototype.NextNodeAllOnSameLine=function(){return void 0===this.nextNodeAllOnSameLine&&(this.nextNodeAllOnSameLine=this.NodeIsOnOneLine(this.nextTokenParent)),this.nextNodeAllOnSameLine},t.prototype.TokensAreOnSameLine=function(){if(void 0===this.tokensAreOnSameLine){var e=this.sourceFile.getLineAndCharacterOfPosition(this.currentTokenSpan.pos).line,t=this.sourceFile.getLineAndCharacterOfPosition(this.nextTokenSpan.pos).line;this.tokensAreOnSameLine=e===t;}return this.tokensAreOnSameLine},t.prototype.ContextNodeBlockIsOnOneLine=function(){return void 0===this.contextNodeBlockIsOnOneLine&&(this.contextNodeBlockIsOnOneLine=this.BlockIsOnOneLine(this.contextNode)),this.contextNodeBlockIsOnOneLine},t.prototype.NextNodeBlockIsOnOneLine=function(){return void 0===this.nextNodeBlockIsOnOneLine&&(this.nextNodeBlockIsOnOneLine=this.BlockIsOnOneLine(this.nextTokenParent)),this.nextNodeBlockIsOnOneLine},t.prototype.NodeIsOnOneLine=function(e){return this.sourceFile.getLineAndCharacterOfPosition(e.getStart(this.sourceFile)).line===this.sourceFile.getLineAndCharacterOfPosition(e.getEnd()).line},t.prototype.BlockIsOnOneLine=function(t){var r=e.findChildOfKind(t,18,this.sourceFile),n=e.findChildOfKind(t,19,this.sourceFile);return !(!r||!n)&&this.sourceFile.getLineAndCharacterOfPosition(r.getEnd()).line===this.sourceFile.getLineAndCharacterOfPosition(n.getStart(this.sourceFile)).line},t}();t.FormattingContext=n;}(e.formatting||(e.formatting={}));}(t),function(e){var t,r,n,i;t=e.formatting||(e.formatting={}),n=e.createScanner(99,!1,0),i=e.createScanner(99,!1,1),function(e){e[e.Scan=0]="Scan",e[e.RescanGreaterThanToken=1]="RescanGreaterThanToken",e[e.RescanSlashToken=2]="RescanSlashToken",e[e.RescanTemplateToken=3]="RescanTemplateToken",e[e.RescanJsxIdentifier=4]="RescanJsxIdentifier",e[e.RescanJsxText=5]="RescanJsxText",e[e.RescanJsxAttributeValue=6]="RescanJsxAttributeValue";}(r||(r={})),t.getFormattingScanner=function(r,a,o,s,c){var l=1===a?i:n;l.setText(r),l.setTextPos(o);var u,_,d,p,f,g=!0,m=c({advance:function(){f=void 0,l.getStartPos()!==o?g=!!_&&4===e.last(_).kind:l.scan(),u=void 0,_=void 0;for(var t=l.getStartPos();t<s;){var r=l.getToken();if(!e.isTrivia(r))break;l.scan();var n={pos:t,end:l.getStartPos(),kind:r};t=l.getStartPos(),u=e.append(u,n);}d=l.getStartPos();},readTokenInfo:function(r){e.Debug.assert(y());var n,i=function(e){switch(e.kind){case 33:case 71:case 72:case 49:case 48:return !0}return !1}(r)?1:13===r.kind?2:function(e){return 16===e.kind||17===e.kind}(r)?3:function(t){if(t.parent)switch(t.parent.kind){case 284:case 279:case 280:case 278:return e.isKeyword(t.kind)||79===t.kind}return !1}(r)?4:(n=r,e.isJsxText(n)?5:function(t){return t.parent&&e.isJsxAttribute(t.parent)&&t.parent.initializer===t}(r)?6:0);if(f&&i===p)return h(f,r);l.getStartPos()!==d&&(e.Debug.assert(void 0!==f),l.setTextPos(d),l.scan());var a=function(t,r){var n,i=l.getToken();switch(p=0,r){case 1:if(31===i){p=1;var a=l.reScanGreaterToken();return e.Debug.assert(t.kind===a),a}break;case 2:if(43===(n=i)||68===n)return p=2,a=l.reScanSlashToken(),e.Debug.assert(t.kind===a),a;break;case 3:if(19===i)return p=3,l.reScanTemplateToken(!1);break;case 4:return p=4,l.scanJsxIdentifier();case 5:return p=5,l.reScanJsxToken(!1);case 6:return p=6,l.reScanJsxAttributeValue();case 0:break;default:e.Debug.assertNever(r);}return i}(r,i),o=t.createTextRangeWithKind(l.getStartPos(),l.getTextPos(),a);for(_&&(_=void 0);l.getStartPos()<s&&(a=l.scan(),e.isTrivia(a));){var c=t.createTextRangeWithKind(l.getStartPos(),l.getTextPos(),a);if(_||(_=[]),_.push(c),4===a){l.scan();break}}return h(f={leadingTrivia:u,trailingTrivia:_,token:o},r)},readEOFTokenRange:function(){return e.Debug.assert(v()),t.createTextRangeWithKind(l.getStartPos(),l.getTextPos(),1)},isOnToken:y,isOnEOF:v,getCurrentLeadingTrivia:function(){return u},lastTrailingTriviaWasNewLine:function(){return g},skipToEndOf:function(e){l.setTextPos(e.end),d=l.getStartPos(),p=void 0,f=void 0,g=!1,u=void 0,_=void 0;},skipToStartOf:function(e){l.setTextPos(e.pos),d=l.getStartPos(),p=void 0,f=void 0,g=!1,u=void 0,_=void 0;}});return f=void 0,l.setText(void 0),m;function y(){var t=f?f.token.kind:l.getToken();return (f?f.token.pos:l.getStartPos())<s&&1!==t&&!e.isTrivia(t)}function v(){return 1===(f?f.token.kind:l.getToken())}function h(t,r){return e.isToken(r)&&t.token.kind!==r.kind&&(t.token.kind=r.kind),t}};}(t),function(e){var t,r,n;(t=e.formatting||(e.formatting={})).anyContext=e.emptyArray,(n=t.RuleAction||(t.RuleAction={}))[n.StopProcessingSpaceActions=1]="StopProcessingSpaceActions",n[n.StopProcessingTokenActions=2]="StopProcessingTokenActions",n[n.InsertSpace=4]="InsertSpace",n[n.InsertNewLine=8]="InsertNewLine",n[n.DeleteSpace=16]="DeleteSpace",n[n.DeleteToken=32]="DeleteToken",n[n.InsertTrailingSemicolon=64]="InsertTrailingSemicolon",n[n.StopAction=3]="StopAction",n[n.ModifySpaceAction=28]="ModifySpaceAction",n[n.ModifyTokenAction=96]="ModifyTokenAction",(r=t.RuleFlags||(t.RuleFlags={}))[r.None=0]="None",r[r.CanDeleteNewLines=1]="CanDeleteNewLines";}(t),function(e){!function(t){function r(e,t,r,n,i,o){return void 0===o&&(o=0),{leftTokenRange:a(t),rightTokenRange:a(r),rule:{debugName:e,context:n,action:i,flags:o}}}function i(e){return {tokens:e,isSpecific:!0}}function a(t){return "number"==typeof t?i([t]):e.isArray(t)?i(t):t}function o(t,r,n){void 0===n&&(n=[]);for(var a=[],o=t;o<=r;o++)e.contains(n,o)||a.push(o);return i(a)}function s(e,t){return function(r){return r.options&&r.options[e]===t}}function c(e){return function(t){return t.options&&t.options.hasOwnProperty(e)&&!!t.options[e]}}function l(e){return function(t){return t.options&&t.options.hasOwnProperty(e)&&!t.options[e]}}function u(e){return function(t){return !t.options||!t.options.hasOwnProperty(e)||!t.options[e]}}function _(e){return function(t){return !t.options||!t.options.hasOwnProperty(e)||!t.options[e]||t.TokensAreOnSameLine()}}function d(e){return function(t){return !t.options||!t.options.hasOwnProperty(e)||!!t.options[e]}}function p(e){return 241===e.contextNode.kind}function f(e){return !p(e)}function g(e){switch(e.contextNode.kind){case 220:return 27!==e.contextNode.operatorToken.kind;case 221:case 188:case 228:case 274:case 269:case 176:case 186:case 187:return !0;case 202:case 258:case 264:case 270:case 253:case 163:case 297:case 166:case 165:return 63===e.currentTokenSpan.kind||63===e.nextTokenSpan.kind;case 242:case 162:return 101===e.currentTokenSpan.kind||101===e.nextTokenSpan.kind||63===e.currentTokenSpan.kind||63===e.nextTokenSpan.kind;case 243:return 159===e.currentTokenSpan.kind||159===e.nextTokenSpan.kind}return !1}function m(e){return !g(e)}function y(e){return !v(e)}function v(t){var r=t.contextNode.kind;return 166===r||165===r||163===r||253===r||e.isFunctionLikeKind(r)}function h(e){return 221===e.contextNode.kind||188===e.contextNode.kind}function b(e){return e.TokensAreOnSameLine()||C(e)}function x(e){return 200===e.contextNode.kind||194===e.contextNode.kind||function(e){return T(e)&&(e.ContextNodeAllOnSameLine()||e.ContextNodeBlockIsOnOneLine())}(e)}function D(e){return C(e)&&!(e.NextNodeAllOnSameLine()||e.NextNodeBlockIsOnOneLine())}function S(e){return T(e)&&!(e.ContextNodeAllOnSameLine()||e.ContextNodeBlockIsOnOneLine())}function T(e){return E(e.contextNode)}function C(e){return E(e.nextTokenParent)}function E(e){if(P(e))return !0;switch(e.kind){case 234:case 262:case 204:case 261:return !0}return !1}function k(e){switch(e.contextNode.kind){case 255:case 168:case 167:case 171:case 172:case 173:case 212:case 170:case 213:case 257:return !0}return !1}function N(e){return !k(e)}function F(e){return 255===e.contextNode.kind||212===e.contextNode.kind}function A(e){return P(e.contextNode)}function P(e){switch(e.kind){case 256:case 225:case 257:case 259:case 181:case 260:case 271:case 272:case 265:case 268:return !0}return !1}function w(e){switch(e.currentTokenParent.kind){case 256:case 260:case 259:case 291:case 261:case 248:return !0;case 234:var t=e.currentTokenParent.parent;if(!t||213!==t.kind&&212!==t.kind)return !0}return !1}function I(e){switch(e.contextNode.kind){case 238:case 248:case 241:case 242:case 243:case 240:case 251:case 239:case 247:case 291:return !0;default:return !1}}function O(e){return 204===e.contextNode.kind}function M(e){return function(e){return 207===e.contextNode.kind}(e)||function(e){return 208===e.contextNode.kind}(e)}function L(e){return 27!==e.currentTokenSpan.kind}function R(e){return 23!==e.nextTokenSpan.kind}function B(e){return 21!==e.nextTokenSpan.kind}function j(e){return 213===e.contextNode.kind}function J(e){return 199===e.contextNode.kind}function z(e){return e.TokensAreOnSameLine()&&11!==e.contextNode.kind}function U(e){return 11!==e.contextNode.kind}function K(e){return 277!==e.contextNode.kind&&281!==e.contextNode.kind}function V(e){return 287===e.contextNode.kind||286===e.contextNode.kind}function q(e){return 284===e.nextTokenParent.kind}function W(e){return 284===e.contextNode.kind}function H(e){return 278===e.contextNode.kind}function G(e){return !k(e)&&!C(e)}function Q(e){return e.TokensAreOnSameLine()&&!!e.contextNode.decorators&&X(e.currentTokenParent)&&!X(e.nextTokenParent)}function X(t){for(;e.isExpressionNode(t);)t=t.parent;return 164===t.kind}function Y(e){return 254===e.currentTokenParent.kind&&e.currentTokenParent.getStart(e.sourceFile)===e.currentTokenSpan.pos}function Z(e){return 2!==e.formattingRequestKind}function $(e){return 260===e.contextNode.kind}function ee(e){return 181===e.contextNode.kind}function te(e){return 174===e.contextNode.kind}function re(e,t){if(29!==e.kind&&31!==e.kind)return !1;switch(t.kind){case 177:case 210:case 258:case 256:case 225:case 257:case 255:case 212:case 213:case 168:case 167:case 173:case 174:case 207:case 208:case 227:return !0;default:return !1}}function ne(e){return re(e.currentTokenSpan,e.currentTokenParent)||re(e.nextTokenSpan,e.nextTokenParent)}function ie(e){return 210===e.contextNode.kind}function ae(e){return 114===e.currentTokenSpan.kind&&216===e.currentTokenParent.kind}function oe(e){return 223===e.contextNode.kind&&void 0!==e.contextNode.expression}function se(e){return 229===e.contextNode.kind}function ce(e){return !function(e){switch(e.contextNode.kind){case 238:case 241:case 242:case 243:case 239:case 240:return !0;default:return !1}}(e)}function le(t){var r=t.nextTokenSpan.kind,n=t.nextTokenSpan.pos;if(e.isTrivia(r)){var i=t.nextTokenParent===t.currentTokenParent?e.findNextToken(t.currentTokenParent,e.findAncestor(t.currentTokenParent,(function(e){return !e.parent})),t.sourceFile):t.nextTokenParent.getFirstToken(t.sourceFile);if(!i)return !0;r=i.kind,n=i.getStart(t.sourceFile);}return t.sourceFile.getLineAndCharacterOfPosition(t.currentTokenSpan.pos).line===t.sourceFile.getLineAndCharacterOfPosition(n).line?19===r||1===r:233!==r&&26!==r&&(257===t.contextNode.kind||258===t.contextNode.kind?!e.isPropertySignature(t.currentTokenParent)||!!t.currentTokenParent.type||20!==r:e.isPropertyDeclaration(t.currentTokenParent)?!t.currentTokenParent.initializer:241!==t.currentTokenParent.kind&&235!==t.currentTokenParent.kind&&233!==t.currentTokenParent.kind&&22!==r&&20!==r&&39!==r&&40!==r&&43!==r&&13!==r&&27!==r&&222!==r&&15!==r&&14!==r&&24!==r)}function ue(t){return e.positionIsASICandidate(t.currentTokenSpan.end,t.currentTokenParent,t.sourceFile)}t.getAllRules=function(){for(var a=[],T=0;T<=159;T++)1!==T&&a.push(T);function E(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return {tokens:a.filter((function(t){return !e.some((function(e){return e===t}))})),isSpecific:!1}}var P={tokens:a,isSpecific:!1},X=i(n$3(n$3([],a,!0),[3],!1)),re=i(n$3(n$3([],a,!0),[1],!1)),_e=o(81,159),de=o(29,78),pe=[101,102,159,127,139],fe=n$3([79],e.typeKeywords,!0),ge=X,me=i([79,3,84,93,100]),ye=i([21,3,90,111,96,91]),ve=[r("IgnoreBeforeComment",P,[2,3],t.anyContext,1),r("IgnoreAfterLineComment",2,P,t.anyContext,1),r("NotSpaceBeforeColon",P,58,[z,m,y],16),r("SpaceAfterColon",58,P,[z,m],4),r("NoSpaceBeforeQuestionMark",P,57,[z,m,y],16),r("SpaceAfterQuestionMarkInConditionalOperator",57,P,[z,h],4),r("NoSpaceAfterQuestionMark",57,P,[z],16),r("NoSpaceBeforeDot",P,[24,28],[z],16),r("NoSpaceAfterDot",[24,28],P,[z],16),r("NoSpaceBetweenImportParenInImportType",100,20,[z,J],16),r("NoSpaceAfterUnaryPrefixOperator",[45,46,54,53],[8,9,79,20,22,18,108,103],[z,m],16),r("NoSpaceAfterUnaryPreincrementOperator",45,[79,20,108,103],[z],16),r("NoSpaceAfterUnaryPredecrementOperator",46,[79,20,108,103],[z],16),r("NoSpaceBeforeUnaryPostincrementOperator",[79,21,23,103],45,[z,ce],16),r("NoSpaceBeforeUnaryPostdecrementOperator",[79,21,23,103],46,[z,ce],16),r("SpaceAfterPostincrementWhenFollowedByAdd",45,39,[z,g],4),r("SpaceAfterAddWhenFollowedByUnaryPlus",39,39,[z,g],4),r("SpaceAfterAddWhenFollowedByPreincrement",39,45,[z,g],4),r("SpaceAfterPostdecrementWhenFollowedBySubtract",46,40,[z,g],4),r("SpaceAfterSubtractWhenFollowedByUnaryMinus",40,40,[z,g],4),r("SpaceAfterSubtractWhenFollowedByPredecrement",40,46,[z,g],4),r("NoSpaceAfterCloseBrace",19,[27,26],[z],16),r("NewLineBeforeCloseBraceInBlockContext",X,19,[S],8),r("SpaceAfterCloseBrace",19,E(21),[z,w],4),r("SpaceBetweenCloseBraceAndElse",19,91,[z],4),r("SpaceBetweenCloseBraceAndWhile",19,115,[z],4),r("NoSpaceBetweenEmptyBraceBrackets",18,19,[z,O],16),r("SpaceAfterConditionalClosingParen",21,22,[I],4),r("NoSpaceBetweenFunctionKeywordAndStar",98,41,[F],16),r("SpaceAfterStarInGeneratorDeclaration",41,79,[F],4),r("SpaceAfterFunctionInFuncDecl",98,P,[k],4),r("NewLineAfterOpenBraceInBlockContext",18,P,[S],8),r("SpaceAfterGetSetInMember",[136,148],79,[k],4),r("NoSpaceBetweenYieldKeywordAndStar",125,41,[z,oe],16),r("SpaceBetweenYieldOrYieldStarAndOperand",[125,41],P,[z,oe],4),r("NoSpaceBetweenReturnAndSemicolon",105,26,[z],16),r("SpaceAfterCertainKeywords",[113,109,103,89,105,112,132],P,[z],4),r("SpaceAfterLetConstInVariableDeclaration",[119,85],P,[z,Y],4),r("NoSpaceBeforeOpenParenInFuncCall",P,20,[z,M,L],16),r("SpaceBeforeBinaryKeywordOperator",P,pe,[z,g],4),r("SpaceAfterBinaryKeywordOperator",pe,P,[z,g],4),r("SpaceAfterVoidOperator",114,P,[z,ae],4),r("SpaceBetweenAsyncAndOpenParen",131,20,[j,z],4),r("SpaceBetweenAsyncAndFunctionKeyword",131,[98,79],[z],4),r("NoSpaceBetweenTagAndTemplateString",[79,21],[14,15],[z],16),r("SpaceBeforeJsxAttribute",P,79,[q,z],4),r("SpaceBeforeSlashInJsxOpeningElement",P,43,[H,z],4),r("NoSpaceBeforeGreaterThanTokenInJsxOpeningElement",43,31,[H,z],16),r("NoSpaceBeforeEqualInJsxAttribute",P,63,[W,z],16),r("NoSpaceAfterEqualInJsxAttribute",63,P,[W,z],16),r("NoSpaceAfterModuleImport",[141,145],20,[z],16),r("SpaceAfterCertainTypeScriptKeywords",[126,84,135,88,92,93,94,136,117,100,118,141,142,121,123,122,144,148,124,151,155,140,137],P,[z],4),r("SpaceBeforeCertainTypeScriptKeywords",P,[94,117,155],[z],4),r("SpaceAfterModuleName",10,18,[$],4),r("SpaceBeforeArrow",P,38,[z],4),r("SpaceAfterArrow",38,P,[z],4),r("NoSpaceAfterEllipsis",25,79,[z],16),r("NoSpaceAfterOptionalParameters",57,[21,27],[z,m],16),r("NoSpaceBetweenEmptyInterfaceBraceBrackets",18,19,[z,ee],16),r("NoSpaceBeforeOpenAngularBracket",fe,29,[z,ne],16),r("NoSpaceBetweenCloseParenAndAngularBracket",21,29,[z,ne],16),r("NoSpaceAfterOpenAngularBracket",29,P,[z,ne],16),r("NoSpaceBeforeCloseAngularBracket",P,31,[z,ne],16),r("NoSpaceAfterCloseAngularBracket",31,[20,22,31,27],[z,ne,N],16),r("SpaceBeforeAt",[21,79],59,[z],4),r("NoSpaceAfterAt",59,P,[z],16),r("SpaceAfterDecorator",P,[126,79,93,88,84,124,123,121,122,136,148,22,41],[Q],4),r("NoSpaceBeforeNonNullAssertionOperator",P,53,[z,se],16),r("NoSpaceAfterNewKeywordOnConstructorSignature",103,20,[z,te],16),r("SpaceLessThanAndNonJSXTypeAnnotation",29,29,[z],4)],he=[r("SpaceAfterConstructor",134,20,[c("insertSpaceAfterConstructor"),z],4),r("NoSpaceAfterConstructor",134,20,[u("insertSpaceAfterConstructor"),z],16),r("SpaceAfterComma",27,P,[c("insertSpaceAfterCommaDelimiter"),z,K,R,B],4),r("NoSpaceAfterComma",27,P,[u("insertSpaceAfterCommaDelimiter"),z,K],16),r("SpaceAfterAnonymousFunctionKeyword",[98,41],20,[c("insertSpaceAfterFunctionKeywordForAnonymousFunctions"),k],4),r("NoSpaceAfterAnonymousFunctionKeyword",[98,41],20,[u("insertSpaceAfterFunctionKeywordForAnonymousFunctions"),k],16),r("SpaceAfterKeywordInControl",_e,20,[c("insertSpaceAfterKeywordsInControlFlowStatements"),I],4),r("NoSpaceAfterKeywordInControl",_e,20,[u("insertSpaceAfterKeywordsInControlFlowStatements"),I],16),r("SpaceAfterOpenParen",20,P,[c("insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis"),z],4),r("SpaceBeforeCloseParen",P,21,[c("insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis"),z],4),r("SpaceBetweenOpenParens",20,20,[c("insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis"),z],4),r("NoSpaceBetweenParens",20,21,[z],16),r("NoSpaceAfterOpenParen",20,P,[u("insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis"),z],16),r("NoSpaceBeforeCloseParen",P,21,[u("insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis"),z],16),r("SpaceAfterOpenBracket",22,P,[c("insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets"),z],4),r("SpaceBeforeCloseBracket",P,23,[c("insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets"),z],4),r("NoSpaceBetweenBrackets",22,23,[z],16),r("NoSpaceAfterOpenBracket",22,P,[u("insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets"),z],16),r("NoSpaceBeforeCloseBracket",P,23,[u("insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets"),z],16),r("SpaceAfterOpenBrace",18,P,[d("insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces"),x],4),r("SpaceBeforeCloseBrace",P,19,[d("insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces"),x],4),r("NoSpaceBetweenEmptyBraceBrackets",18,19,[z,O],16),r("NoSpaceAfterOpenBrace",18,P,[l("insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces"),z],16),r("NoSpaceBeforeCloseBrace",P,19,[l("insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces"),z],16),r("SpaceBetweenEmptyBraceBrackets",18,19,[c("insertSpaceAfterOpeningAndBeforeClosingEmptyBraces")],4),r("NoSpaceBetweenEmptyBraceBrackets",18,19,[l("insertSpaceAfterOpeningAndBeforeClosingEmptyBraces"),z],16),r("SpaceAfterTemplateHeadAndMiddle",[15,16],P,[c("insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces"),U],4,1),r("SpaceBeforeTemplateMiddleAndTail",P,[16,17],[c("insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces"),z],4),r("NoSpaceAfterTemplateHeadAndMiddle",[15,16],P,[u("insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces"),U],16,1),r("NoSpaceBeforeTemplateMiddleAndTail",P,[16,17],[u("insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces"),z],16),r("SpaceAfterOpenBraceInJsxExpression",18,P,[c("insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces"),z,V],4),r("SpaceBeforeCloseBraceInJsxExpression",P,19,[c("insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces"),z,V],4),r("NoSpaceAfterOpenBraceInJsxExpression",18,P,[u("insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces"),z,V],16),r("NoSpaceBeforeCloseBraceInJsxExpression",P,19,[u("insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces"),z,V],16),r("SpaceAfterSemicolonInFor",26,P,[c("insertSpaceAfterSemicolonInForStatements"),z,p],4),r("NoSpaceAfterSemicolonInFor",26,P,[u("insertSpaceAfterSemicolonInForStatements"),z,p],16),r("SpaceBeforeBinaryOperator",P,de,[c("insertSpaceBeforeAndAfterBinaryOperators"),z,g],4),r("SpaceAfterBinaryOperator",de,P,[c("insertSpaceBeforeAndAfterBinaryOperators"),z,g],4),r("NoSpaceBeforeBinaryOperator",P,de,[u("insertSpaceBeforeAndAfterBinaryOperators"),z,g],16),r("NoSpaceAfterBinaryOperator",de,P,[u("insertSpaceBeforeAndAfterBinaryOperators"),z,g],16),r("SpaceBeforeOpenParenInFuncDecl",P,20,[c("insertSpaceBeforeFunctionParenthesis"),z,k],4),r("NoSpaceBeforeOpenParenInFuncDecl",P,20,[u("insertSpaceBeforeFunctionParenthesis"),z,k],16),r("NewLineBeforeOpenBraceInControl",ye,18,[c("placeOpenBraceOnNewLineForControlBlocks"),I,D],8,1),r("NewLineBeforeOpenBraceInFunction",ge,18,[c("placeOpenBraceOnNewLineForFunctions"),k,D],8,1),r("NewLineBeforeOpenBraceInTypeScriptDeclWithBlock",me,18,[c("placeOpenBraceOnNewLineForFunctions"),A,D],8,1),r("SpaceAfterTypeAssertion",31,P,[c("insertSpaceAfterTypeAssertion"),z,ie],4),r("NoSpaceAfterTypeAssertion",31,P,[u("insertSpaceAfterTypeAssertion"),z,ie],16),r("SpaceBeforeTypeAnnotation",P,[57,58],[c("insertSpaceBeforeTypeAnnotation"),z,v],4),r("NoSpaceBeforeTypeAnnotation",P,[57,58],[u("insertSpaceBeforeTypeAnnotation"),z,v],16),r("NoOptionalSemicolon",26,re,[s("semicolons",e.SemicolonPreference.Remove),le],32),r("OptionalSemicolon",P,re,[s("semicolons",e.SemicolonPreference.Insert),ue],64)],be=[r("NoSpaceBeforeSemicolon",P,26,[z],16),r("SpaceBeforeOpenBraceInControl",ye,18,[_("placeOpenBraceOnNewLineForControlBlocks"),I,Z,b],4,1),r("SpaceBeforeOpenBraceInFunction",ge,18,[_("placeOpenBraceOnNewLineForFunctions"),k,C,Z,b],4,1),r("SpaceBeforeOpenBraceInTypeScriptDeclWithBlock",me,18,[_("placeOpenBraceOnNewLineForFunctions"),A,Z,b],4,1),r("NoSpaceBeforeComma",P,27,[z],16),r("NoSpaceBeforeOpenBracket",E(131,82),22,[z],16),r("NoSpaceAfterCloseBracket",23,P,[z,G],16),r("SpaceAfterSemicolon",26,P,[z],4),r("SpaceBetweenForAndAwaitKeyword",97,132,[z],4),r("SpaceBetweenStatements",[21,90,91,82],P,[z,K,f],4),r("SpaceAfterTryCatchFinally",[111,83,96],18,[z],4)];return n$3(n$3(n$3([],ve,!0),he,!0),be,!0)};}(e.formatting||(e.formatting={}));}(t),function(e){!function(t){var r;function n(e){var t=0;return 1&e&&(t|=28),2&e&&(t|=96),28&e&&(t|=28),96&e&&(t|=96),t}function i(t,r){return e.Debug.assert(t<=159&&r<=159,"Must compute formatting context from tokens"),t*o+r}t.getFormatContext=function(a,c){return {options:a,getRules:(void 0===r&&(l=t.getAllRules(),u=function(e){for(var t=new Array(o*o),r=new Array(t.length),n=0,a=e;n<a.length;n++)for(var c=a[n],l=c.leftTokenRange.isSpecific&&c.rightTokenRange.isSpecific,u=0,_=c.leftTokenRange.tokens;u<_.length;u++)for(var d=_[u],p=0,f=c.rightTokenRange.tokens;p<f.length;p++){var g=i(d,f[p]),m=t[g];void 0===m&&(m=t[g]=[]),s(m,c.rule,l,r,g);}return t}(l),r=function(t){var r=u[i(t.currentTokenSpan.kind,t.nextTokenSpan.kind)];if(r){for(var a=[],o=0,s=0,c=r;s<c.length;s++){var l=c[s],_=~n(o);l.action&_&&e.every(l.context,(function(e){return e(t)}))&&(a.push(l),o|=l.action);}if(a.length)return a}}),r),host:c};var l,u;};var a,o=160;function s(r,n,i,o,s){var c,l,u,_=3&n.action?i?a.StopRulesSpecific:a.StopRulesAny:n.context!==t.anyContext?i?a.ContextRulesSpecific:a.ContextRulesAny:i?a.NoContextRulesSpecific:a.NoContextRulesAny,d=o[s]||0;r.splice(function(e,t){for(var r=0,n=0;n<=t;n+=5)r+=31&e,e>>=5;return r}(d,_),0,n),o[s]=(u=1+((c=d)>>(l=_)&31),e.Debug.assert((31&u)===u,"Adding more rules into the sub-bucket than allowed. Maximum allowed is 32 rules."),c&~(31<<l)|u<<l);}!function(e){e[e.StopRulesSpecific=0]="StopRulesSpecific",e[e.StopRulesAny=5]="StopRulesAny",e[e.ContextRulesSpecific=10]="ContextRulesSpecific",e[e.ContextRulesAny=15]="ContextRulesAny",e[e.NoContextRulesSpecific=20]="NoContextRulesSpecific",e[e.NoContextRulesAny=25]="NoContextRulesAny";}(a||(a={}));}(e.formatting||(e.formatting={}));}(t),function(e){!function(t){var r,n,i,a,o;function s(t,r,n){var i=e.findPrecedingToken(t,n);return i&&i.kind===r&&t===i.getEnd()?i:void 0}function c(e){for(var t=e;t&&t.parent&&t.parent.end===e.end&&!l(t.parent,t);)t=t.parent;return t}function l(t,r){switch(t.kind){case 256:case 257:return e.rangeContainsRange(t.members,r);case 260:var n=t.body;return !!n&&261===n.kind&&e.rangeContainsRange(n.statements,r);case 303:case 234:case 261:return e.rangeContainsRange(t.statements,r);case 291:return e.rangeContainsRange(t.block.statements,r)}return !1}function u(t,r,n,i){return t?_({pos:e.getLineStartPositionForPosition(t.getStart(r),r),end:t.end},r,n,i):[]}function _(r,n,i,a){var o=function(t,r){return function n(i){var a=e.forEachChild(i,(function(n){return e.startEndContainsRange(n.getStart(r),n.end,t)&&n}));if(a){var o=n(a);if(o)return o}return i}(r)}(r,n);return t.getFormattingScanner(n.text,n.languageVariant,function(t,r,n){var i=t.getStart(n);if(i===r.pos&&t.end===r.end)return i;var a=e.findPrecedingToken(r.pos,n);return a?a.end>=r.pos?t.pos:a.end:t.pos}(o,r,n),r.end,(function(s){return d(r,o,t.SmartIndenter.getIndentationForNode(o,r,n,i.options),function(e,r,n){for(var i,a=-1;e;){var o=n.getLineAndCharacterOfPosition(e.getStart(n)).line;if(-1!==a&&o!==a)break;if(t.SmartIndenter.shouldIndentChildNode(r,e,i,n))return r.indentSize;a=o,i=e,e=e.parent;}return 0}(o,i.options,n),s,i,a,function(t,r){if(!t.length)return a;var n=t.filter((function(t){return e.rangeOverlapsWithStartEnd(r,t.start,t.start+t.length)})).sort((function(e,t){return e.start-t.start}));if(!n.length)return a;var i=0;return function(t){for(;;){if(i>=n.length)return !1;var r=n[i];if(t.end<=r.start)return !1;if(e.startEndOverlapsWithStartEnd(t.pos,t.end,r.start,r.start+r.length))return !0;i++;}};function a(){return !1}}(n.parseDiagnostics,r),n)}))}function d(r,n,i,a,o,s,c,l,u){var _,d,f,g,m=s.options,y=s.getRules,v=s.host,h=new t.FormattingContext(u,c,m),b=-1,x=[];if(o.advance(),o.isOnToken()){var D=u.getLineAndCharacterOfPosition(n.getStart(u)).line,S=D;n.decorators&&(S=u.getLineAndCharacterOfPosition(e.getNonDecoratorTokenPosOfNode(n,u)).line),function n(i,a,s,c,p,y){if(e.rangeOverlapsWithStartEnd(r,i.getStart(u),i.getEnd())){var v=E(i,s,p,y),h=a;for(e.forEachChild(i,(function(e){S(e,-1,i,v,s,c,!1);}),(function(r){!function(r,n,a,s){e.Debug.assert(e.isNodeArray(r));var c=function(e,t){switch(e.kind){case 170:case 255:case 212:case 168:case 167:case 213:if(e.typeParameters===t)return 29;if(e.parameters===t)return 20;break;case 207:case 208:if(e.typeArguments===t)return 29;if(e.arguments===t)return 20;break;case 177:if(e.typeArguments===t)return 29;break;case 181:return 18}return 0}(n,r),l=s,_=a;if(0!==c)for(;o.isOnToken()&&!((v=o.readTokenInfo(n)).token.end>r.pos);)if(v.token.kind===c){_=u.getLineAndCharacterOfPosition(v.token.pos).line,T(v,n,s,n);var d=void 0;if(-1!==b)d=b;else {var p=e.getLineStartPositionForPosition(v.token.pos,u);d=t.SmartIndenter.findFirstNonWhitespaceColumn(p,v.token.pos,u,m);}l=E(n,a,d,m.indentSize);}else T(v,n,s,n);for(var f=-1,g=0;g<r.length;g++)f=S(r[g],f,i,l,_,_,!0,0===g);var y=function(e){switch(e){case 20:return 21;case 29:return 31;case 18:return 19}return 0}(c);if(0!==y&&o.isOnToken()){var v;27===(v=o.readTokenInfo(n)).token.kind&&e.isCallLikeExpression(n)&&_!==u.getLineAndCharacterOfPosition(v.token.pos).line&&(o.advance(),v=o.isOnToken()?o.readTokenInfo(n):void 0),v&&v.token.kind===y&&e.rangeContainsRange(n,v.token)&&T(v,n,l,n,!0);}}(r,i,s,v);}));o.isOnToken();){var x=o.readTokenInfo(i);if(x.token.end>i.end)break;T(x,i,v,i);}if(!i.parent&&o.isOnEOF()){var D=o.readEOFTokenRange();D.end<=i.end&&_&&A(D,u.getLineAndCharacterOfPosition(D.pos).line,i,_,f,d,a,v);}}function S(a,s,c,l,_,d,p,f){var y=a.getStart(u),v=u.getLineAndCharacterOfPosition(y).line,x=v;a.decorators&&(x=u.getLineAndCharacterOfPosition(e.getNonDecoratorTokenPosOfNode(a,u)).line);var D=-1;if(p&&e.rangeContainsRange(r,c)&&-1!==(D=function(r,n,i,a,o){if(e.rangeOverlapsWithStartEnd(a,r,n)||e.rangeContainsStartEnd(a,r,n)){if(-1!==o)return o}else {var s=u.getLineAndCharacterOfPosition(r).line,c=e.getLineStartPositionForPosition(r,u),l=t.SmartIndenter.findFirstNonWhitespaceColumn(c,r,u,m);if(s!==i||r===l){var _=t.SmartIndenter.getBaseIndentation(m);return _>l?_:l}}return -1}(y,a.end,_,r,s))&&(s=D),!e.rangeOverlapsWithStartEnd(r,a.pos,a.end))return a.end<r.pos&&o.skipToEndOf(a),s;if(0===a.getFullWidth())return s;for(;o.isOnToken();){if((S=o.readTokenInfo(i)).token.end>y){S.token.pos>y&&o.skipToStartOf(a);break}T(S,i,l,i);}if(!o.isOnToken())return s;if(e.isToken(a)){var S=o.readTokenInfo(a);if(11!==a.kind)return e.Debug.assert(S.token.end===a.end,"Token end is child end"),T(S,i,l,a),s}var C=164===a.kind?v:d,E=function(e,r,n,i,a,o){var s=t.SmartIndenter.shouldIndentChildNode(m,e)?m.indentSize:0;return o===r?{indentation:r===g?b:a.getIndentation(),delta:Math.min(m.indentSize,a.getDelta(e)+s)}:-1===n?20===e.kind&&r===g?{indentation:b,delta:a.getDelta(e)}:t.SmartIndenter.childStartsOnTheSameLineWithElseInIfStatement(i,e,r,u)||t.SmartIndenter.childIsUnindentedBranchOfConditionalExpression(i,e,r,u)||t.SmartIndenter.argumentStartsOnSameLineAsPreviousArgument(i,e,r,u)?{indentation:a.getIndentation(),delta:s}:{indentation:a.getIndentation()+a.getDelta(e),delta:s}:{indentation:n,delta:s}}(a,v,D,i,l,C);return n(a,h,v,x,E.indentation,E.delta),h=i,f&&203===c.kind&&-1===s&&(s=E.indentation),s}function T(t,n,i,a,s){e.Debug.assert(e.rangeContainsRange(n,t.token));var c=o.lastTrailingTriviaWasNewLine(),d=!1;t.leadingTrivia&&N(t.leadingTrivia,n,h,i);var p=0,f=e.rangeContainsRange(r,t.token),m=u.getLineAndCharacterOfPosition(t.token.pos);if(f){var y=l(t.token),v=_;if(p=F(t.token,m,n,h,i),!y)if(0===p){var x=v&&u.getLineAndCharacterOfPosition(v.end).line;d=c&&m.line!==x;}else d=1===p;}if(t.trailingTrivia&&N(t.trailingTrivia,n,h,i),d){var D=f&&!l(t.token)?i.getIndentationForToken(m.line,t.token.kind,a,!!s):-1,S=!0;if(t.leadingTrivia){var T=i.getIndentationForComment(t.token.kind,D,a);S=k(t.leadingTrivia,T,S,(function(e){return P(e.pos,T,!1)}));}-1!==D&&S&&(P(t.token.pos,D,1===p),g=m.line,b=D);}o.advance(),h=n;}}(n,n,D,S,i,a);}if(!o.isOnToken()){var T=t.SmartIndenter.nodeWillIndentChild(m,n,void 0,u,!1)?i+m.indentSize:i,C=o.getCurrentLeadingTrivia();C&&(k(C,T,!1,(function(e){return F(e,u.getLineAndCharacterOfPosition(e.pos),n,n,void 0)})),!1!==m.trimTrailingWhitespace&&function(t){for(var n=_?_.end:r.pos,i=0,a=t;i<a.length;i++){var o=a[i];e.isComment(o.kind)&&(n<o.pos&&M(n,o.pos-1,_),n=o.end+1);}n<r.end&&M(n,r.end,_);}(C));}return x;function E(r,n,i,a){return {getIndentationForComment:function(e,t,r){switch(e){case 19:case 23:case 21:return i+o(r)}return -1!==t?t:i},getIndentationForToken:function(t,a,s,c){return !c&&function(t,i,a){switch(i){case 18:case 19:case 21:case 91:case 115:case 59:return !1;case 43:case 31:switch(a.kind){case 279:case 280:case 278:case 227:return !1}break;case 22:case 23:if(194!==a.kind)return !1}return n!==t&&!(r.decorators&&i===function(t){if(t.modifiers&&t.modifiers.length)return t.modifiers[0].kind;switch(t.kind){case 256:return 84;case 257:return 118;case 255:return 98;case 259:return 259;case 171:return 136;case 172:return 148;case 168:if(t.asteriskToken)return 41;case 166:case 163:var r=e.getNameOfDeclaration(t);if(r)return r.kind}}(r))}(t,a,s)?i+o(s):i},getIndentation:function(){return i},getDelta:o,recomputeIndentation:function(e,n){t.SmartIndenter.shouldIndentChildNode(m,n,r,u)&&(i+=e?m.indentSize:-m.indentSize,a=t.SmartIndenter.shouldIndentChildNode(m,r)?m.indentSize:0);}};function o(e){return t.SmartIndenter.nodeWillIndentChild(m,r,e,u,!0)?a:0}}function k(t,n,i,a){for(var o=0,s=t;o<s.length;o++){var c=s[o],l=e.rangeContainsRange(r,c);switch(c.kind){case 3:l&&w(c,n,!i),i=!1;break;case 2:i&&l&&a(c),i=!1;break;case 4:i=!0;}}return i}function N(t,n,i,a){for(var o=0,s=t;o<s.length;o++){var c=s[o];e.isComment(c.kind)&&e.rangeContainsRange(r,c)&&F(c,u.getLineAndCharacterOfPosition(c.pos),n,i,a);}}function F(e,t,n,i,a){var o=0;return l(e)||(_?o=A(e,t.line,n,_,f,d,i,a):I(u.getLineAndCharacterOfPosition(r.pos).line,t.line)),_=e,d=n,f=t.line,o}function A(t,r,n,i,a,o,s,c){h.updateContext(i,o,t,n,s);var l=y(h),_=!1!==h.options.trimTrailingWhitespace,d=0;return l?e.forEachRight(l,(function(o){switch(d=function(t,r,n,i,a){var o,s=a!==n;switch(t.action){case 1:return 0;case 16:if(r.end!==i.pos)return L(r.end,i.pos-r.end),s?2:0;break;case 32:L(r.pos,r.end-r.pos);break;case 8:if(1!==t.flags&&n!==a)return 0;if(1!=a-n)return R(r.end,i.pos-r.end,e.getNewLineOrDefaultFromHost(v,m)),s?0:1;break;case 4:if(1!==t.flags&&n!==a)return 0;if(1!=i.pos-r.end||32!==u.text.charCodeAt(r.end))return R(r.end,i.pos-r.end," "),s?2:0;break;case 64:o=r.end,x.push(e.createTextChangeFromStartLength(o,0,";"));}return 0}(o,i,a,t,r)){case 2:n.getStart(u)===t.pos&&c.recomputeIndentation(!1,s);break;case 1:n.getStart(u)===t.pos&&c.recomputeIndentation(!0,s);break;default:e.Debug.assert(0===d);}_=_&&!(16&o.action)&&1!==o.flags;})):_=_&&1!==t.kind,r!==a&&_&&I(a,r,i),d}function P(t,r,n){var i=p(r,m);if(n)R(t,0,i);else {var a=u.getLineAndCharacterOfPosition(t),o=e.getStartPositionOfLine(a.line,u);(r!==function(e,t){for(var r=0,n=0;n<t;n++)9===u.text.charCodeAt(e+n)?r+=m.tabSize-r%m.tabSize:r++;return r}(o,a.character)||function(e,t){return e!==u.text.substr(t,e.length)}(i,o))&&R(o,a.character,i);}}function w(r,n,i,a){void 0===a&&(a=!0);var o=u.getLineAndCharacterOfPosition(r.pos).line,s=u.getLineAndCharacterOfPosition(r.end).line;if(o!==s){for(var c=[],l=r.pos,_=o;_<s;_++){var d=e.getEndLinePosition(_,u);c.push({pos:l,end:d}),l=e.getStartPositionOfLine(_+1,u);}if(a&&c.push({pos:l,end:r.end}),0!==c.length){var f=e.getStartPositionOfLine(o,u),g=t.SmartIndenter.findFirstNonWhitespaceCharacterAndColumn(f,c[0].pos,u,m),y=0;i&&(y=1,o++);for(var v=n-g.column,h=y;h<c.length;h++,o++){var b=e.getStartPositionOfLine(o,u),x=0===h?g:t.SmartIndenter.findFirstNonWhitespaceCharacterAndColumn(c[h].pos,c[h].end,u,m),D=x.column+v;if(D>0){var S=p(D,m);R(b,x.character,S);}else L(b,x.character);}}}else i||P(r.pos,n,!1);}function I(t,r,n){for(var i=t;i<r;i++){var a=e.getStartPositionOfLine(i,u),o=e.getEndLinePosition(i,u);if(!(n&&(e.isComment(n.kind)||e.isStringOrRegularExpressionOrTemplateLiteral(n.kind))&&n.pos<=o&&n.end>o)){var s=O(a,o);-1!==s&&(e.Debug.assert(s===a||!e.isWhiteSpaceSingleLine(u.text.charCodeAt(s-1))),L(s,o+1-s));}}}function O(t,r){for(var n=r;n>=t&&e.isWhiteSpaceSingleLine(u.text.charCodeAt(n));)n--;return n!==r?n+1:-1}function M(e,t,r){I(u.getLineAndCharacterOfPosition(e).line,u.getLineAndCharacterOfPosition(t).line+1,r);}function L(t,r){r&&x.push(e.createTextChangeFromStartLength(t,r,""));}function R(t,r,n){(r||n)&&x.push(e.createTextChangeFromStartLength(t,r,n));}}function p(t,r){if((!i||i.tabSize!==r.tabSize||i.indentSize!==r.indentSize)&&(i={tabSize:r.tabSize,indentSize:r.indentSize},a=o=void 0),r.convertTabsToSpaces){var n=void 0,s=Math.floor(t/r.indentSize),c=t%r.indentSize;return o||(o=[]),void 0===o[s]?(n=e.repeatString(" ",r.indentSize*s),o[s]=n):n=o[s],c?n+e.repeatString(" ",c):n}var l=Math.floor(t/r.tabSize),u=t-l*r.tabSize,_=void 0;return a||(a=[]),void 0===a[l]?a[l]=_=e.repeatString("\t",l):_=a[l],u?_+e.repeatString(" ",u):_}t.createTextRangeWithKind=function(t,r,n){var i={pos:t,end:r,kind:n};return e.Debug.isDebugging&&Object.defineProperty(i,"__debugKind",{get:function(){return e.Debug.formatSyntaxKind(n)}}),i},function(e){e[e.Unknown=-1]="Unknown";}(r||(r={})),t.formatOnEnter=function(t,r,n){var i=r.getLineAndCharacterOfPosition(t).line;if(0===i)return [];for(var a=e.getEndLinePosition(i,r);e.isWhiteSpaceSingleLine(r.text.charCodeAt(a));)a--;return e.isLineBreak(r.text.charCodeAt(a))&&a--,_({pos:e.getStartPositionOfLine(i-1,r),end:a+1},r,n,2)},t.formatOnSemicolon=function(e,t,r){return u(c(s(e,26,t)),t,r,3)},t.formatOnOpeningCurly=function(t,r,n){var i=s(t,18,r);if(!i)return [];var a=c(i.parent);return _({pos:e.getLineStartPositionForPosition(a.getStart(r),r),end:t},r,n,4)},t.formatOnClosingCurly=function(e,t,r){return u(c(s(e,19,t)),t,r,5)},t.formatDocument=function(e,t){return _({pos:0,end:e.text.length},e,t,0)},t.formatSelection=function(t,r,n,i){return _({pos:e.getLineStartPositionForPosition(t,n),end:r},n,i,1)},t.formatNodeGivenIndentation=function(e,r,n,i,a,o){var s={pos:0,end:r.text.length};return t.getFormattingScanner(r.text,n,s.pos,s.end,(function(t){return d(s,e,i,a,t,o,1,(function(e){return !1}),r)}))},function(e){e[e.None=0]="None",e[e.LineAdded=1]="LineAdded",e[e.LineRemoved=2]="LineRemoved";}(n||(n={})),t.getRangeOfEnclosingComment=function(t,r,n,i){void 0===i&&(i=e.getTokenAtPosition(t,r));var a=e.findAncestor(i,e.isJSDoc);if(a&&(i=a.parent),!(i.getStart(t)<=r&&r<i.getEnd())){var o=(n=null===n?void 0:void 0===n?e.findPrecedingToken(r,t):n)&&e.getTrailingCommentRanges(t.text,n.end),s=e.getLeadingCommentRangesOfNode(i,t),c=e.concatenate(o,s);return c&&e.find(c,(function(n){return e.rangeContainsPositionExclusive(n,r)||r===n.end&&(2===n.kind||r===t.getFullWidth())}))}},t.getIndentationString=p;}(e.formatting||(e.formatting={}));}(t),function(e){var t;(function(r){var n,i;function a(e){return e.baseIndentSize||0}function o(e,t,r,n,i,o,l){for(var f,g=e.parent;g;){var y=!0;if(r){var v=e.getStart(i);y=v<r.pos||v>r.end;}var h=s(g,e,i),b=h.line===t.line||d(g,e,t.line,i);if(y){var x=null===(f=p(e,i))||void 0===f?void 0:f[0],S=m(e,i,l,!!x&&u(x,i).line>h.line);if(-1!==S)return S+n;if(-1!==(S=c(e,g,t,b,i,l)))return S+n}D(l,g,e,i,o)&&!b&&(n+=l.indentSize);var T=_(g,e,t.line,i);g=(e=g).parent,t=T?i.getLineAndCharacterOfPosition(e.getStart(i)):h;}return n+a(l)}function s(e,t,r){var n=p(t,r),i=n?n.pos:e.getStart(r);return r.getLineAndCharacterOfPosition(i)}function c(t,r,n,i,a,o){return !e.isDeclaration(t)&&!e.isStatementButNotDeclaration(t)||303!==r.kind&&i?-1:v(n,a,o)}function l(t,r,n,i){var a=e.findNextToken(t,r,i);return a?18===a.kind?1:19===a.kind&&n===u(a,i).line?2:0:0}function u(e,t){return t.getLineAndCharacterOfPosition(e.getStart(t))}function _(t,r,n,i){if(!e.isCallExpression(t)||!e.contains(t.arguments,r))return !1;var a=t.expression.getEnd();return e.getLineAndCharacterOfPosition(i,a).line===n}function d(t,r,n,i){if(238===t.kind&&t.elseStatement===r){var a=e.findChildOfKind(t,91,i);return e.Debug.assert(void 0!==a),u(a,i).line===n}return !1}function p(e,t){return e.parent&&f(e.getStart(t),e.getEnd(),e.parent,t)}function f(t,r,n,i){switch(n.kind){case 177:return a(n.typeArguments);case 204:return a(n.properties);case 203:return a(n.elements);case 181:return a(n.members);case 255:case 212:case 213:case 168:case 167:case 173:case 170:case 179:case 174:return a(n.typeParameters)||a(n.parameters);case 256:case 225:case 257:case 258:case 342:return a(n.typeParameters);case 208:case 207:return a(n.typeArguments)||a(n.arguments);case 254:return a(n.declarations);case 268:case 272:return a(n.elements);case 200:case 201:return a(n.elements)}function a(a){return a&&e.rangeContainsStartEnd(function(e,t,r){for(var n=e.getChildren(r),i=1;i<n.length-1;i++)if(n[i].pos===t.pos&&n[i].end===t.end)return {pos:n[i-1].end,end:n[i+1].getStart(r)};return t}(n,a,i),t,r)?a:void 0}}function g(e,t,r){return e?v(t.getLineAndCharacterOfPosition(e.pos),t,r):-1}function m(e,t,r,n){if(e.parent&&254===e.parent.kind)return -1;var i=p(e,t);if(i){var a=i.indexOf(e);if(-1!==a){var o=y(i,a,t,r);if(-1!==o)return o}return g(i,t,r)+(n?r.indentSize:0)}return -1}function y(t,r,n,i){e.Debug.assert(r>=0&&r<t.length);for(var a=u(t[r],n),o=r-1;o>=0;o--)if(27!==t[o].kind){if(n.getLineAndCharacterOfPosition(t[o].end).line!==a.line)return v(a,n,i);a=u(t[o],n);}return -1}function v(e,t,r){var n=t.getPositionOfLineAndCharacter(e.line,0);return b(n,n+e.character,t,r)}function h(t,r,n,i){for(var a=0,o=0,s=t;s<r;s++){var c=n.text.charCodeAt(s);if(!e.isWhiteSpaceSingleLine(c))break;9===c?o+=i.tabSize+o%i.tabSize:o++,a++;}return {column:o,character:a}}function b(e,t,r,n){return h(e,t,r,n).column}function x(t,r,n,i,a){var o=n?n.kind:0;switch(r.kind){case 237:case 256:case 225:case 257:case 259:case 258:case 203:case 234:case 261:case 204:case 181:case 194:case 183:case 262:case 289:case 288:case 211:case 205:case 207:case 208:case 236:case 270:case 246:case 221:case 201:case 200:case 279:case 282:case 278:case 287:case 167:case 173:case 174:case 163:case 178:case 179:case 190:case 209:case 217:case 272:case 268:case 274:case 269:case 166:return !0;case 253:case 294:case 220:if(!t.indentMultiLineObjectLiteralBeginningOnBlankLine&&i&&204===o)return S(i,n);if(220===r.kind&&i&&n&&277===o)return i.getLineAndCharacterOfPosition(e.skipTrivia(i.text,r.pos)).line!==i.getLineAndCharacterOfPosition(e.skipTrivia(i.text,n.pos)).line;if(220!==r.kind)return !0;break;case 239:case 240:case 242:case 243:case 241:case 238:case 255:case 212:case 168:case 170:case 171:case 172:return 234!==o;case 213:return i&&211===o?S(i,n):234!==o;case 271:return 272!==o;case 265:return 266!==o||!!n.namedBindings&&268!==n.namedBindings.kind;case 277:return 280!==o;case 281:return 283!==o;case 187:case 186:if(181===o||183===o)return !1}return a}function D(e,t,r,n,i){return void 0===i&&(i=!1),x(e,t,r,n,!1)&&!(i&&r&&function(e,t){switch(e){case 246:case 250:case 244:case 245:return 234!==t.kind;default:return !1}}(r.kind,t))}function S(t,r){var n=e.skipTrivia(t.text,r.pos);return t.getLineAndCharacterOfPosition(n).line===t.getLineAndCharacterOfPosition(r.end).line}!function(e){e[e.Unknown=-1]="Unknown";}(n||(n={})),r.getIndentation=function(r,n,i,s){if(void 0===s&&(s=!1),r>n.text.length)return a(i);if(i.indentStyle===e.IndentStyle.None)return 0;var c=e.findPrecedingToken(r,n,void 0,!0),_=t.getRangeOfEnclosingComment(n,r,c||null);if(_&&3===_.kind)return function(t,r,n,i){var a=e.getLineAndCharacterOfPosition(t,r).line-1,o=e.getLineAndCharacterOfPosition(t,i.pos).line;if(e.Debug.assert(o>=0),a<=o)return b(e.getStartPositionOfLine(o,t),r,t,n);var s=e.getStartPositionOfLine(a,t),c=h(s,r,t,n),l=c.column,u=c.character;return 0===l?l:42===t.text.charCodeAt(s+u)?l-1:l}(n,r,i,_);if(!c)return a(i);if(e.isStringOrRegularExpressionOrTemplateLiteral(c.kind)&&c.getStart(n)<=r&&r<c.end)return 0;var d=n.getLineAndCharacterOfPosition(r).line;if(i.indentStyle===e.IndentStyle.Block)return function(t,r,n){for(var i=r;i>0;){var a=t.text.charCodeAt(i);if(!e.isWhiteSpaceLike(a))break;i--;}return b(e.getLineStartPositionForPosition(i,t),i,t,n)}(n,r,i);if(27===c.kind&&220!==c.parent.kind){var p=function(t,r,n){var i=e.findListItemInfo(t);return i&&i.listItemIndex>0?y(i.list.getChildren(),i.listItemIndex-1,r,n):-1}(c,n,i);if(-1!==p)return p}var v=function(e,t,r){return t&&f(e,e,t,r)}(r,c.parent,n);return v&&!e.rangeContainsRange(v,c)?g(v,n,i)+i.indentSize:function(t,r,n,i,s,c){for(var _,d=n;d;){if(e.positionBelongsToNode(d,r,t)&&D(c,d,_,t,!0)){var p=u(d,t),f=l(n,d,i,t);return o(d,p,void 0,0!==f?s&&2===f?c.indentSize:0:i!==p.line?c.indentSize:0,t,!0,c)}var g=m(d,t,c,!0);if(-1!==g)return g;_=d,d=d.parent;}return a(c)}(n,r,c,d,s,i)},r.getIndentationForNode=function(e,t,r,n){var i=r.getLineAndCharacterOfPosition(e.getStart(r));return o(e,i,t,0,r,!1,n)},r.getBaseIndentation=a,function(e){e[e.Unknown=0]="Unknown",e[e.OpenBrace=1]="OpenBrace",e[e.CloseBrace=2]="CloseBrace";}(i||(i={})),r.isArgumentAndStartLineOverlapsExpressionBeingCalled=_,r.childStartsOnTheSameLineWithElseInIfStatement=d,r.childIsUnindentedBranchOfConditionalExpression=function(t,r,n,i){if(e.isConditionalExpression(t)&&(r===t.whenTrue||r===t.whenFalse)){var a=e.getLineAndCharacterOfPosition(i,t.condition.end).line;if(r===t.whenTrue)return n===a;var o=u(t.whenTrue,i).line,s=e.getLineAndCharacterOfPosition(i,t.whenTrue.end).line;return a===o&&s===n}return !1},r.argumentStartsOnSameLineAsPreviousArgument=function(t,r,n,i){if(e.isCallOrNewExpression(t)){if(!t.arguments)return !1;var a=e.find(t.arguments,(function(e){return e.pos===r.pos}));if(!a)return !1;var o=t.arguments.indexOf(a);if(0===o)return !1;var s=t.arguments[o-1];if(n===e.getLineAndCharacterOfPosition(i,s.getEnd()).line)return !0}return !1},r.getContainingList=p,r.findFirstNonWhitespaceCharacterAndColumn=h,r.findFirstNonWhitespaceColumn=b,r.nodeWillIndentChild=x,r.shouldIndentChildNode=D;})((t=e.formatting||(e.formatting={})).SmartIndenter||(t.SmartIndenter={}));}(t),function(e){!function(t){function r(t){var r=t.__pos;return e.Debug.assert("number"==typeof r),r}function a(t,r){e.Debug.assert("number"==typeof r),t.__pos=r;}function o(t){var r=t.__end;return e.Debug.assert("number"==typeof r),r}function s(t,r){e.Debug.assert("number"==typeof r),t.__end=r;}var c,l;function u(t,r){return e.skipTrivia(t,r,!1,!0)}!function(e){e[e.Exclude=0]="Exclude",e[e.IncludeAll=1]="IncludeAll",e[e.JSDoc=2]="JSDoc",e[e.StartLine=3]="StartLine";}(c=t.LeadingTriviaOption||(t.LeadingTriviaOption={})),function(e){e[e.Exclude=0]="Exclude",e[e.ExcludeWhitespace=1]="ExcludeWhitespace",e[e.Include=2]="Include";}(l=t.TrailingTriviaOption||(t.TrailingTriviaOption={}));var _,d={leadingTriviaOption:c.Exclude,trailingTriviaOption:l.Exclude};function p(e,t,r,n){return {pos:f(e,t,n),end:m(e,r,n)}}function f(t,r,n,i){var a,o;void 0===i&&(i=!1);var s=n.leadingTriviaOption;if(s===c.Exclude)return r.getStart(t);if(s===c.StartLine){var l=r.getStart(t),_=e.getLineStartPositionForPosition(l,t);return e.rangeContainsPosition(r,_)?_:l}if(s===c.JSDoc){var d=e.getJSDocCommentRanges(r,t.text);if(null==d?void 0:d.length)return e.getLineStartPositionForPosition(d[0].pos,t)}var p=r.getFullStart(),f=r.getStart(t);if(p===f)return f;var g=e.getLineStartPositionForPosition(p,t);if(e.getLineStartPositionForPosition(f,t)===g)return s===c.IncludeAll?p:f;if(i){var m=(null===(a=e.getLeadingCommentRanges(t.text,p))||void 0===a?void 0:a[0])||(null===(o=e.getTrailingCommentRanges(t.text,p))||void 0===o?void 0:o[0]);if(m)return e.skipTrivia(t.text,m.end,!0,!0)}var y=p>0?1:0,v=e.getStartPositionOfLine(e.getLineOfLocalPosition(t,g)+y,t);return v=u(t.text,v),e.getStartPositionOfLine(e.getLineOfLocalPosition(t,v),t)}function g(t,r,n){var i=r.end;if(n.trailingTriviaOption===l.Include){var a=e.getTrailingCommentRanges(t.text,i);if(a)for(var o=e.getLineOfLocalPosition(t,r.end),s=0,c=a;s<c.length;s++){var u=c[s];if(2===u.kind||e.getLineOfLocalPosition(t,u.pos)>o)break;if(e.getLineOfLocalPosition(t,u.end)>o)return e.skipTrivia(t.text,u.end,!0,!0)}}}function m(t,r,n){var i,a=r.end,o=n.trailingTriviaOption;if(o===l.Exclude)return a;if(o===l.ExcludeWhitespace){var s=e.concatenate(e.getTrailingCommentRanges(t.text,a),e.getLeadingCommentRanges(t.text,a));return (null===(i=null==s?void 0:s[s.length-1])||void 0===i?void 0:i.end)||a}var c=g(t,r,n);if(c)return c;var u=e.skipTrivia(t.text,a,!0);return u===a||o!==l.Include&&!e.isLineBreak(t.text.charCodeAt(u-1))?a:u}function y(e,t){return !!t&&!!e.parent&&(27===t.kind||26===t.kind&&204===e.parent.kind)}!function(e){e[e.Remove=0]="Remove",e[e.ReplaceWithSingleNode=1]="ReplaceWithSingleNode",e[e.ReplaceWithMultipleNodes=2]="ReplaceWithMultipleNodes",e[e.Text=3]="Text";}(_||(_={})),t.isThisTypeAnnotatable=function(t){return e.isFunctionExpression(t)||e.isFunctionDeclaration(t)};var v,h,b=function(){function t(t,r){this.newLineCharacter=t,this.formatContext=r,this.changes=[],this.newFiles=[],this.classesWithNodesInsertedAtStart=new e.Map,this.deletedNodes=[];}return t.fromContext=function(r){return new t(e.getNewLineOrDefaultFromHost(r.host,r.formatContext.options),r.formatContext)},t.with=function(e,r){var n=t.fromContext(e);return r(n),n.getChanges()},t.prototype.pushRaw=function(t,r){e.Debug.assertEqual(t.fileName,r.fileName);for(var n=0,i=r.textChanges;n<i.length;n++){var a=i[n];this.changes.push({kind:_.Text,sourceFile:t,text:a.newText,range:e.createTextRangeFromSpan(a.span)});}},t.prototype.deleteRange=function(e,t){this.changes.push({kind:_.Remove,sourceFile:e,range:t});},t.prototype.delete=function(e,t){this.deletedNodes.push({sourceFile:e,node:t});},t.prototype.deleteNode=function(e,t,r){void 0===r&&(r={leadingTriviaOption:c.IncludeAll}),this.deleteRange(e,p(e,t,t,r));},t.prototype.deleteNodes=function(e,t,r,n){void 0===r&&(r={leadingTriviaOption:c.IncludeAll});for(var i=0,a=t;i<a.length;i++){var o=a[i],s=f(e,o,r,n),l=m(e,o,r);this.deleteRange(e,{pos:s,end:l}),n=!!g(e,o,r);}},t.prototype.deleteModifier=function(t,r){this.deleteRange(t,{pos:r.getStart(t),end:e.skipTrivia(t.text,r.end,!0)});},t.prototype.deleteNodeRange=function(e,t,r,n){void 0===n&&(n={leadingTriviaOption:c.IncludeAll});var i=f(e,t,n),a=m(e,r,n);this.deleteRange(e,{pos:i,end:a});},t.prototype.deleteNodeRangeExcludingEnd=function(e,t,r,n){void 0===n&&(n={leadingTriviaOption:c.IncludeAll});var i=f(e,t,n),a=void 0===r?e.text.length:f(e,r,n);this.deleteRange(e,{pos:i,end:a});},t.prototype.replaceRange=function(e,t,r,n){void 0===n&&(n={}),this.changes.push({kind:_.ReplaceWithSingleNode,sourceFile:e,range:t,options:n,node:r});},t.prototype.replaceNode=function(e,t,r,n){void 0===n&&(n=d),this.replaceRange(e,p(e,t,t,n),r,n);},t.prototype.replaceNodeRange=function(e,t,r,n,i){void 0===i&&(i=d),this.replaceRange(e,p(e,t,r,i),n,i);},t.prototype.replaceRangeWithNodes=function(e,t,r,n){void 0===n&&(n={}),this.changes.push({kind:_.ReplaceWithMultipleNodes,sourceFile:e,range:t,options:n,nodes:r});},t.prototype.replaceNodeWithNodes=function(e,t,r,n){void 0===n&&(n=d),this.replaceRangeWithNodes(e,p(e,t,t,n),r,n);},t.prototype.replaceNodeWithText=function(e,t,r){this.replaceRangeWithText(e,p(e,t,t,d),r);},t.prototype.replaceNodeRangeWithNodes=function(e,t,r,n,i){void 0===i&&(i=d),this.replaceRangeWithNodes(e,p(e,t,r,i),n,i);},t.prototype.nodeHasTrailingComment=function(e,t,r){return void 0===r&&(r=d),!!g(e,t,r)},t.prototype.nextCommaToken=function(t,r){var n=e.findNextToken(r,r.parent,t);return n&&27===n.kind?n:void 0},t.prototype.replacePropertyAssignment=function(e,t,r){var n=this.nextCommaToken(e,t)?"":","+this.newLineCharacter;this.replaceNode(e,t,r,{suffix:n});},t.prototype.insertNodeAt=function(t,r,n,i){void 0===i&&(i={}),this.replaceRange(t,e.createRange(r),n,i);},t.prototype.insertNodesAt=function(t,r,n,i){void 0===i&&(i={}),this.replaceRangeWithNodes(t,e.createRange(r),n,i);},t.prototype.insertNodeAtTopOfFile=function(e,t,r){this.insertAtTopOfFile(e,t,r);},t.prototype.insertNodesAtTopOfFile=function(e,t,r){this.insertAtTopOfFile(e,t,r);},t.prototype.insertAtTopOfFile=function(t,r,n){var i=function(t){for(var r,n=0,i=t.statements;n<i.length;n++){var a=i[n];if(!e.isPrologueDirective(a))break;r=a;}var o=0,s=t.text;if(r)return o=r.end,g(),o;var c=e.getShebang(s);void 0!==c&&(o=c.length,g());var l,u,_=e.getLeadingCommentRanges(s,o);if(!_)return o;for(var d=0,p=_;d<p.length;d++){var f=p[d];if(3===f.kind){if(e.isPinnedComment(s,f.pos)){l={range:f,pinnedOrTripleSlash:!0};continue}}else if(e.isRecognizedTripleSlashComment(s,f.pos,f.end)){l={range:f,pinnedOrTripleSlash:!0};continue}if(l){if(l.pinnedOrTripleSlash)break;if(t.getLineAndCharacterOfPosition(f.pos).line>=t.getLineAndCharacterOfPosition(l.range.end).line+2)break}if(t.statements.length&&(void 0===u&&(u=t.getLineAndCharacterOfPosition(t.statements[0].getStart()).line),u<t.getLineAndCharacterOfPosition(f.end).line+2))break;l={range:f,pinnedOrTripleSlash:!1};}return l&&(o=l.range.end,g()),o;function g(){if(o<s.length){var t=s.charCodeAt(o);e.isLineBreak(t)&&++o<s.length&&13===t&&10===s.charCodeAt(o)&&o++;}}}(t),a={prefix:0===i?void 0:this.newLineCharacter,suffix:(e.isLineBreak(t.text.charCodeAt(i))?"":this.newLineCharacter)+(n?this.newLineCharacter:"")};e.isArray(r)?this.insertNodesAt(t,i,r,a):this.insertNodeAt(t,i,r,a);},t.prototype.insertFirstParameter=function(t,r,n){var i=e.firstOrUndefined(r);i?this.insertNodeBefore(t,i,n):this.insertNodeAt(t,r.pos,n);},t.prototype.insertNodeBefore=function(e,t,r,n,i){void 0===n&&(n=!1),void 0===i&&(i={}),this.insertNodeAt(e,f(e,t,i),r,this.getOptionsForInsertNodeBefore(t,r,n));},t.prototype.insertModifierAt=function(t,r,n,i){void 0===i&&(i={}),this.insertNodeAt(t,r,e.factory.createToken(n),i);},t.prototype.insertModifierBefore=function(e,t,r){return this.insertModifierAt(e,r.getStart(e),t,{suffix:" "})},t.prototype.insertCommentBeforeLine=function(t,r,n,i){var a=e.getStartPositionOfLine(r,t),o=e.getFirstNonSpaceCharacterPosition(t.text,a),s=E(t,o),c=e.getTouchingToken(t,s?o:n),l=t.text.slice(a,o),u="".concat(s?"":this.newLineCharacter,"//").concat(i).concat(this.newLineCharacter).concat(l);this.insertText(t,c.getStart(t),u);},t.prototype.insertJsdocCommentBefore=function(t,r,n){var i=r.getStart(t);if(r.jsDoc)for(var a=0,o=r.jsDoc;a<o.length;a++){var s=o[a];this.deleteRange(t,{pos:e.getLineStartPositionForPosition(s.getStart(t),t),end:m(t,s,{})});}var c=e.getPrecedingNonSpaceCharacterPosition(t.text,i-1),l=t.text.slice(c,i);this.insertNodeAt(t,i,n,{preserveLeadingWhitespace:!1,suffix:this.newLineCharacter+l});},t.prototype.replaceRangeWithText=function(e,t,r){this.changes.push({kind:_.Text,sourceFile:e,range:t,text:r});},t.prototype.insertText=function(t,r,n){this.replaceRangeWithText(t,e.createRange(r),n);},t.prototype.tryInsertTypeAnnotation=function(t,r,n){var i,a;if(e.isFunctionLike(r)){if(!(a=e.findChildOfKind(r,21,t))){if(!e.isArrowFunction(r))return !1;a=e.first(r.parameters);}}else a=null!==(i=253===r.kind?r.exclamationToken:r.questionToken)&&void 0!==i?i:r.name;return this.insertNodeAt(t,a.end,n,{prefix:": "}),!0},t.prototype.tryInsertThisTypeAnnotation=function(t,r,n){var i=e.findChildOfKind(r,20,t).getStart(t)+1,a=r.parameters.length?", ":"";this.insertNodeAt(t,i,n,{prefix:"this: ",suffix:a});},t.prototype.insertTypeParameters=function(t,r,n){var i=(e.findChildOfKind(r,20,t)||e.first(r.parameters)).getStart(t);this.insertNodesAt(t,i,n,{prefix:"<",suffix:">",joiner:", "});},t.prototype.getOptionsForInsertNodeBefore=function(t,r,n){return e.isStatement(t)||e.isClassElement(t)?{suffix:n?this.newLineCharacter+this.newLineCharacter:this.newLineCharacter}:e.isVariableDeclaration(t)?{suffix:", "}:e.isParameter(t)?e.isParameter(r)?{suffix:", "}:{}:e.isStringLiteral(t)&&e.isImportDeclaration(t.parent)||e.isNamedImports(t)?{suffix:", "}:e.isImportSpecifier(t)?{suffix:","+(n?this.newLineCharacter:" ")}:e.Debug.failBadSyntaxKind(t)},t.prototype.insertNodeAtConstructorStart=function(t,r,i){var a=e.firstOrUndefined(r.body.statements);a&&r.body.multiLine?this.insertNodeBefore(t,a,i):this.replaceConstructorBody(t,r,n$3([i],r.body.statements,!0));},t.prototype.insertNodeAtConstructorStartAfterSuperCall=function(t,r,i){var a=e.find(r.body.statements,(function(t){return e.isExpressionStatement(t)&&e.isSuperCall(t.expression)}));a&&r.body.multiLine?this.insertNodeAfter(t,a,i):this.replaceConstructorBody(t,r,n$3(n$3([],r.body.statements,!0),[i],!1));},t.prototype.insertNodeAtConstructorEnd=function(t,r,i){var a=e.lastOrUndefined(r.body.statements);a&&r.body.multiLine?this.insertNodeAfter(t,a,i):this.replaceConstructorBody(t,r,n$3(n$3([],r.body.statements,!0),[i],!1));},t.prototype.replaceConstructorBody=function(t,r,n){this.replaceNode(t,r.body,e.factory.createBlock(n,!0));},t.prototype.insertNodeAtEndOfScope=function(t,r,n){var i=f(t,r.getLastToken(),{});this.insertNodeAt(t,i,n,{prefix:e.isLineBreak(t.text.charCodeAt(r.getLastToken().pos))?this.newLineCharacter:this.newLineCharacter+this.newLineCharacter,suffix:this.newLineCharacter});},t.prototype.insertNodeAtClassStart=function(e,t,r){this.insertNodeAtStartWorker(e,t,r);},t.prototype.insertNodeAtObjectStart=function(e,t,r){this.insertNodeAtStartWorker(e,t,r);},t.prototype.insertNodeAtStartWorker=function(e,t,r){var n,i=null!==(n=this.guessIndentationFromExistingMembers(e,t))&&void 0!==n?n:this.computeIndentationForNewMember(e,t);this.insertNodeAt(e,D(t).pos,r,this.getInsertNodeAtStartInsertOptions(e,t,i));},t.prototype.guessIndentationFromExistingMembers=function(t,r){for(var n,i=r,a=0,o=D(r);a<o.length;a++){var s=o[a];if(e.rangeStartPositionsAreOnSameLine(i,s,t))return;var c=s.getStart(t),l=e.formatting.SmartIndenter.findFirstNonWhitespaceColumn(e.getLineStartPositionForPosition(c,t),c,t,this.formatContext.options);if(void 0===n)n=l;else if(l!==n)return;i=s;}return n},t.prototype.computeIndentationForNewMember=function(t,r){var n,i=r.getStart(t);return e.formatting.SmartIndenter.findFirstNonWhitespaceColumn(e.getLineStartPositionForPosition(i,t),i,t,this.formatContext.options)+(null!==(n=this.formatContext.options.indentSize)&&void 0!==n?n:4)},t.prototype.getInsertNodeAtStartInsertOptions=function(t,r,n){var i=0===D(r).length,a=e.addToSeen(this.classesWithNodesInsertedAtStart,e.getNodeId(r),{node:r,sourceFile:t}),o=e.isObjectLiteralExpression(r)&&(!e.isJsonSourceFile(t)||!i);return {indentation:n,prefix:(e.isObjectLiteralExpression(r)&&e.isJsonSourceFile(t)&&i&&!a?",":"")+this.newLineCharacter,suffix:o?",":""}},t.prototype.insertNodeAfterComma=function(e,t,r){var n=this.insertNodeAfterWorker(e,this.nextCommaToken(e,t)||t,r);this.insertNodeAt(e,n,r,this.getInsertNodeAfterOptions(e,t));},t.prototype.insertNodeAfter=function(e,t,r){var n=this.insertNodeAfterWorker(e,t,r);this.insertNodeAt(e,n,r,this.getInsertNodeAfterOptions(e,t));},t.prototype.insertNodeAtEndOfList=function(e,t,r){this.insertNodeAt(e,t.end,r,{prefix:", "});},t.prototype.insertNodesAfter=function(t,r,n){var i=this.insertNodeAfterWorker(t,r,e.first(n));this.insertNodesAt(t,i,n,this.getInsertNodeAfterOptions(t,r));},t.prototype.insertNodeAfterWorker=function(t,r,n){var i,a;return i=r,a=n,((e.isPropertySignature(i)||e.isPropertyDeclaration(i))&&e.isClassOrTypeElement(a)&&161===a.name.kind||e.isStatementButNotDeclaration(i)&&e.isStatementButNotDeclaration(a))&&59!==t.text.charCodeAt(r.end-1)&&this.replaceRange(t,e.createRange(r.end),e.factory.createToken(26)),m(t,r,{})},t.prototype.getInsertNodeAfterOptions=function(t,r){var n=this.getInsertNodeAfterOptionsWorker(r);return i$1(i$1({},n),{prefix:r.end===t.end&&e.isStatement(r)?n.prefix?"\n".concat(n.prefix):"\n":n.prefix})},t.prototype.getInsertNodeAfterOptionsWorker=function(t){switch(t.kind){case 256:case 260:return {prefix:this.newLineCharacter,suffix:this.newLineCharacter};case 253:case 10:case 79:return {prefix:", "};case 294:return {suffix:","+this.newLineCharacter};case 93:return {prefix:" "};case 163:return {};default:return e.Debug.assert(e.isStatement(t)||e.isClassOrTypeElement(t)),{suffix:this.newLineCharacter}}},t.prototype.insertName=function(t,r,n){if(e.Debug.assert(!r.name),213===r.kind){var i=e.findChildOfKind(r,38,t),a=e.findChildOfKind(r,20,t);a?(this.insertNodesAt(t,a.getStart(t),[e.factory.createToken(98),e.factory.createIdentifier(n)],{joiner:" "}),k(this,t,i)):(this.insertText(t,e.first(r.parameters).getStart(t),"function ".concat(n,"(")),this.replaceRange(t,i,e.factory.createToken(21))),234!==r.body.kind&&(this.insertNodesAt(t,r.body.getStart(t),[e.factory.createToken(18),e.factory.createToken(105)],{joiner:" ",suffix:" "}),this.insertNodesAt(t,r.body.end,[e.factory.createToken(26),e.factory.createToken(19)],{joiner:" "}));}else {var o=e.findChildOfKind(r,212===r.kind?98:84,t).end;this.insertNodeAt(t,o,e.factory.createIdentifier(n),{prefix:" "});}},t.prototype.insertExportModifier=function(e,t){this.insertText(e,t.getStart(e),"export ");},t.prototype.insertNodeInListAfter=function(t,r,n,i){if(void 0===i&&(i=e.formatting.SmartIndenter.getContainingList(r,t)),i){var a=e.indexOfNode(i,r);if(!(a<0)){var o=r.getEnd();if(a!==i.length-1){var s=e.getTokenAtPosition(t,r.end);if(s&&y(r,s)){var c=i[a+1],l=u(t.text,c.getFullStart()),_="".concat(e.tokenToString(s.kind)).concat(t.text.substring(s.end,l));this.insertNodesAt(t,l,[n],{suffix:_});}}else {var d=r.getStart(t),p=e.getLineStartPositionForPosition(d,t),f=void 0,g=!1;if(1===i.length)f=27;else {var m=e.findPrecedingToken(r.pos,t);f=y(r,m)?m.kind:27,g=e.getLineStartPositionForPosition(i[a-1].getStart(t),t)!==p;}if(function(t,r){for(var n=r;n<t.length;){var i=t.charCodeAt(n);if(!e.isWhiteSpaceSingleLine(i))return 47===i;n++;}return !1}(t.text,r.end)&&(g=!0),g){this.replaceRange(t,e.createRange(o),e.factory.createToken(f));for(var v=e.formatting.SmartIndenter.findFirstNonWhitespaceColumn(p,d,t,this.formatContext.options),h=e.skipTrivia(t.text,o,!0,!1);h!==o&&e.isLineBreak(t.text.charCodeAt(h-1));)h--;this.replaceRange(t,e.createRange(h),n,{indentation:v,prefix:this.newLineCharacter});}else this.replaceRange(t,e.createRange(o),n,{prefix:"".concat(e.tokenToString(f)," ")});}}}else e.Debug.fail("node is not a list element");},t.prototype.parenthesizeExpression=function(t,r){this.replaceRange(t,e.rangeOfNode(r),e.factory.createParenthesizedExpression(r));},t.prototype.finishClassesWithNodesInsertedAtStart=function(){var t=this;this.classesWithNodesInsertedAtStart.forEach((function(r){var n=r.node,i=r.sourceFile,a=function(t,r){var n=e.findChildOfKind(t,18,r),i=e.findChildOfKind(t,19,r);return [null==n?void 0:n.end,null==i?void 0:i.end]}(n,i),o=a[0],s=a[1];if(void 0!==o&&void 0!==s){var c=0===D(n).length,l=e.positionsAreOnSameLine(o,s,i);c&&l&&o!==s-1&&t.deleteRange(i,e.createRange(o,s-1)),l&&t.insertText(i,s-1,t.newLineCharacter);}}));},t.prototype.finishDeleteDeclarations=function(){for(var t=this,r=new e.Set,n=function(t,n){i.deletedNodes.some((function(r){return r.sourceFile===t&&e.rangeContainsRangeExclusive(r.node,n)}))||(e.isArray(n)?i.deleteRange(t,e.rangeOfTypeParameters(t,n)):h.deleteDeclaration(i,r,t,n));},i=this,a=0,o=this.deletedNodes;a<o.length;a++){var s=o[a];n(s.sourceFile,s.node);}r.forEach((function(n){var i=n.getSourceFile(),a=e.formatting.SmartIndenter.getContainingList(n,i);if(n===e.last(a)){var o=e.findLastIndex(a,(function(e){return !r.has(e)}),a.length-2);-1!==o&&t.deleteRange(i,{pos:a[o].end,end:x(i,a[o+1])});}}));},t.prototype.getChanges=function(e){this.finishDeleteDeclarations(),this.finishClassesWithNodesInsertedAtStart();for(var t=v.getTextChangesFromChanges(this.changes,this.newLineCharacter,this.formatContext,e),r=0,n=this.newFiles;r<n.length;r++){var i=n[r],a=i.oldFile,o=i.fileName,s=i.statements;t.push(v.newFileChanges(a,o,s,this.newLineCharacter,this.formatContext));}return t},t.prototype.createNewFile=function(e,t,r){this.newFiles.push({oldFile:e,fileName:t,statements:r});},t}();function x(t,r){return e.skipTrivia(t.text,f(t,r,{leadingTriviaOption:c.IncludeAll}),!1,!0)}function D(t){return e.isObjectLiteralExpression(t)?t.properties:t.members}function S(t,r){for(var n=r.length-1;n>=0;n--){var i=r[n],a=i.span,o=i.newText;t="".concat(t.substring(0,a.start)).concat(o).concat(t.substring(e.textSpanEnd(a)));}return t}function T(t){var n=e.visitEachChild(t,T,e.nullTransformationContext,C,T),i=e.nodeIsSynthesized(n)?n:Object.create(n);return e.setTextRangePosEnd(i,r(t),o(t)),i}function C(t,n,i,a,s){var c=e.visitNodes(t,n,i,a,s);if(!c)return c;var l=c===t?e.factory.createNodeArray(c.slice(0)):c;return e.setTextRangePosEnd(l,r(t),o(t)),l}function E(t,r){return !(e.isInComment(t,r)||e.isInString(t,r)||e.isInTemplateString(t,r)||e.isInJSXText(t,r))}function k(e,t,r,n){void 0===n&&(n={leadingTriviaOption:c.IncludeAll});var i=f(t,r,n),a=m(t,r,n);e.deleteRange(t,{pos:i,end:a});}function N(t,r,n,i){var a=e.Debug.checkDefined(e.formatting.SmartIndenter.getContainingList(i,n)),o=e.indexOfNode(a,i);e.Debug.assert(-1!==o),1!==a.length?(e.Debug.assert(!r.has(i),"Deleting a node twice"),r.add(i),t.deleteRange(n,{pos:x(n,i),end:o===a.length-1?m(n,i,{}):x(n,a[o+1])})):k(t,n,i);}t.ChangeTracker=b,t.getNewFileText=function(e,t,r,n){return v.newFileChangesWorker(void 0,t,e,r,n)},function(t){function r(t,r,i,a,o){var s=i.map((function(e){return 4===e?"":n(e,t,a).text})).join(a),c=e.createSourceFile("any file name",s,99,!0,r);return S(s,e.formatting.formatDocument(c,o))+a}function n(t,r,n){var i=function(t){var r=0,n=e.createTextWriter(t);function i(t,i){if(i||!function(t){return e.skipTrivia(t,0)===t.length}(t)){r=n.getTextPos();for(var a=0;e.isWhiteSpaceLike(t.charCodeAt(t.length-a-1));)a++;r-=a;}}return {onBeforeEmitNode:function(e){e&&a(e,r);},onAfterEmitNode:function(e){e&&s(e,r);},onBeforeEmitNodeArray:function(e){e&&a(e,r);},onAfterEmitNodeArray:function(e){e&&s(e,r);},onBeforeEmitToken:function(e){e&&a(e,r);},onAfterEmitToken:function(e){e&&s(e,r);},write:function(e){n.write(e),i(e,!1);},writeComment:function(e){n.writeComment(e);},writeKeyword:function(e){n.writeKeyword(e),i(e,!1);},writeOperator:function(e){n.writeOperator(e),i(e,!1);},writePunctuation:function(e){n.writePunctuation(e),i(e,!1);},writeTrailingSemicolon:function(e){n.writeTrailingSemicolon(e),i(e,!1);},writeParameter:function(e){n.writeParameter(e),i(e,!1);},writeProperty:function(e){n.writeProperty(e),i(e,!1);},writeSpace:function(e){n.writeSpace(e),i(e,!1);},writeStringLiteral:function(e){n.writeStringLiteral(e),i(e,!1);},writeSymbol:function(e,t){n.writeSymbol(e,t),i(e,!1);},writeLine:function(e){n.writeLine(e);},increaseIndent:function(){n.increaseIndent();},decreaseIndent:function(){n.decreaseIndent();},getText:function(){return n.getText()},rawWrite:function(e){n.rawWrite(e),i(e,!1);},writeLiteral:function(e){n.writeLiteral(e),i(e,!0);},getTextPos:function(){return n.getTextPos()},getLine:function(){return n.getLine()},getColumn:function(){return n.getColumn()},getIndent:function(){return n.getIndent()},isAtStartOfLine:function(){return n.isAtStartOfLine()},hasTrailingComment:function(){return n.hasTrailingComment()},hasTrailingWhitespace:function(){return n.hasTrailingWhitespace()},clear:function(){n.clear(),r=0;}}}(n),o=e.getNewLineKind(n);return e.createPrinter({newLine:o,neverAsciiEscape:!0,preserveSourceNewlines:!0,terminateUnterminatedLiterals:!0},i).writeNode(4,t,r,i),{text:i.getText(),node:T(t)}}t.getTextChangesFromChanges=function(t,r,a,o){return e.mapDefined(e.group(t,(function(e){return e.sourceFile.path})),(function(t){for(var s=t[0].sourceFile,c=e.stableSort(t,(function(e,t){return e.range.pos-t.range.pos||e.range.end-t.range.end})),l=function(t){e.Debug.assert(c[t].range.end<=c[t+1].range.pos,"Changes overlap",(function(){return "".concat(JSON.stringify(c[t].range)," and ").concat(JSON.stringify(c[t+1].range))}));},u=0;u<c.length-1;u++)l(u);var d=e.mapDefined(c,(function(t){var c=e.createTextSpanFromRange(t.range),l=function(t,r,a,o,s){var c;if(t.kind===_.Remove)return "";if(t.kind===_.Text)return t.text;var l=t.options,u=void 0===l?{}:l,d=t.range.pos,p=function(t){return function(t,r,a,o,s,c,l){var u=o.indentation,_=o.prefix,d=o.delta,p=n(t,r,s),f=p.node,g=p.text;l&&l(f,g);var m=function(t,r){var n=t.options,a=!n.semicolons||n.semicolons===e.SemicolonPreference.Ignore,o=n.semicolons===e.SemicolonPreference.Remove||a&&!e.probablyUsesSemicolons(r);return i$1(i$1({},n),{semicolons:o?e.SemicolonPreference.Remove:e.SemicolonPreference.Ignore})}(c,r),y=void 0!==u?u:e.formatting.SmartIndenter.getIndentation(a,r,m,_===s||e.getLineStartPositionForPosition(a,r)===a);void 0===d&&(d=e.formatting.SmartIndenter.shouldIndentChildNode(m,t)&&m.indentSize||0);var v={text:g,getLineAndCharacterOfPosition:function(t){return e.getLineAndCharacterOfPosition(this,t)}};return S(g,e.formatting.formatNodeGivenIndentation(f,v,r.languageVariant,y,d,i$1(i$1({},c),{options:m})))}(t,r,d,u,a,o,s)},f=t.kind===_.ReplaceWithMultipleNodes?t.nodes.map((function(t){return e.removeSuffix(p(t),a)})).join((null===(c=t.options)||void 0===c?void 0:c.joiner)||a):p(t.node),g=u.preserveLeadingWhitespace||void 0!==u.indentation||e.getLineStartPositionForPosition(d,r)===d?f:f.replace(/^\s+/,"");return (u.prefix||"")+g+(!u.suffix||e.endsWith(g,u.suffix)?"":u.suffix)}(t,s,r,a,o);if(c.length!==l.length||!e.stringContainsAt(s.text,l,c.start))return e.createTextChange(c,l)}));return d.length>0?{fileName:s.fileName,textChanges:d}:void 0}))},t.newFileChanges=function(t,n,i,a,o){var s=r(t,e.getScriptKindFromFileName(n),i,a,o);return {fileName:n,textChanges:[e.createTextChange(e.createTextSpan(0,0),s)],isNewFile:!0}},t.newFileChangesWorker=r,t.getNonformattedText=n;}(v||(v={})),t.applyChanges=S,t.isValidLocationToAddComment=E,function(t){function r(t,r,n){if(n.parent.name){var i=e.Debug.checkDefined(e.getTokenAtPosition(r,n.pos-1));t.deleteRange(r,{pos:i.getStart(r),end:n.end});}else k(t,r,e.getAncestor(n,265));}t.deleteDeclaration=function(t,n,i,a){switch(a.kind){case 163:var o=a.parent;e.isArrowFunction(o)&&1===o.parameters.length&&!e.findChildOfKind(o,20,i)?t.replaceNodeWithText(i,a,"()"):N(t,n,i,a);break;case 265:case 264:k(t,i,a,{leadingTriviaOption:i.imports.length&&a===e.first(i.imports).parent||a===e.find(i.statements,e.isAnyImportSyntax)?c.Exclude:e.hasJSDocNodes(a)?c.JSDoc:c.StartLine});break;case 202:var s=a.parent;201===s.kind&&a!==e.last(s.elements)?k(t,i,a):N(t,n,i,a);break;case 253:!function(t,r,n,i){var a=i.parent;if(291!==a.kind)if(1===a.declarations.length){var o=a.parent;switch(o.kind){case 243:case 242:t.replaceNode(n,i,e.factory.createObjectLiteralExpression());break;case 241:k(t,n,a);break;case 236:k(t,n,o,{leadingTriviaOption:e.hasJSDocNodes(o)?c.JSDoc:c.StartLine});break;default:e.Debug.assertNever(o);}}else N(t,r,n,i);else t.deleteNodeRange(n,e.findChildOfKind(a,20,n),e.findChildOfKind(a,21,n));}(t,n,i,a);break;case 162:N(t,n,i,a);break;case 269:var u=a.parent;1===u.elements.length?r(t,i,u):N(t,n,i,a);break;case 267:r(t,i,a);break;case 26:k(t,i,a,{trailingTriviaOption:l.Exclude});break;case 98:k(t,i,a,{leadingTriviaOption:c.Exclude});break;case 256:case 255:k(t,i,a,{leadingTriviaOption:e.hasJSDocNodes(a)?c.JSDoc:c.StartLine});break;default:a.parent?e.isImportClause(a.parent)&&a.parent.name===a?function(t,r,n){if(n.namedBindings){var i=n.name.getStart(r),a=e.getTokenAtPosition(r,n.name.end);if(a&&27===a.kind){var o=e.skipTrivia(r.text,a.end,!1,!0);t.deleteRange(r,{pos:i,end:o});}else k(t,r,n.name);}else k(t,r,n.parent);}(t,i,a.parent):e.isCallExpression(a.parent)&&e.contains(a.parent.arguments,a)?N(t,n,i,a):k(t,i,a):k(t,i,a);}};}(h||(h={})),t.deleteNode=k;}(e.textChanges||(e.textChanges={}));}(t),function(e){!function(t){var r=e.createMultiMap(),a=new e.Map;function o(e,t,r,n,i,a){return {fixName:e,description:t,changes:r,fixId:n,fixAllDescription:i,commands:a?[a]:void 0}}function c(e,t){return {changes:e,commands:t}}function l(t,r,n){for(var i=0,a=u(t);i<a.length;i++){var o=a[i];e.contains(r,o.code)&&n(o);}}function u(t){var r=t.program,i=t.sourceFile,a=t.cancellationToken;return n$3(n$3(n$3([],r.getSemanticDiagnostics(i,a),!0),r.getSyntacticDiagnostics(i,a),!0),e.computeSuggestionDiagnostics(i,r,a),!0)}t.createCodeFixActionWithoutFixAll=function(t,r,n){return o(t,e.diagnosticToString(n),r,void 0,void 0)},t.createCodeFixAction=function(t,r,n,i,a,s){return o(t,e.diagnosticToString(n),r,i,e.diagnosticToString(a),s)},t.createCodeFixActionMaybeFixAll=function(t,r,n,i,a,s){return o(t,e.diagnosticToString(n),r,i,a&&e.diagnosticToString(a),s)},t.registerCodeFix=function(t){for(var n=0,i=t.errorCodes;n<i.length;n++){var o=i[n];r.add(String(o),t);}if(t.fixIds)for(var s=0,c=t.fixIds;s<c.length;s++){var l=c[s];e.Debug.assert(!a.has(l)),a.set(l,t);}},t.getSupportedErrorCodes=function(){return e.arrayFrom(r.keys())},t.getFixes=function(t){var n=u(t),a=r.get(String(t.errorCode));return e.flatMap(a,(function(r){return e.map(r.getCodeActions(t),function(t,r){for(var n=t.errorCodes,a=0,o=0,c=r;o<c.length;o++){var l=c[o];if(e.contains(n,l.code)&&a++,a>1)break}var u=a<2;return function(e){var t=e.fixId,r=e.fixAllDescription,n=s(e,["fixId","fixAllDescription"]);return u?n:i$1(i$1({},n),{fixId:t,fixAllDescription:r})}}(r,n))}))},t.getAllFixes=function(t){return a.get(e.cast(t.fixId,e.isString)).getAllCodeActions(t)},t.createCombinedCodeActions=c,t.createFileTextChanges=function(e,t){return {fileName:e,textChanges:t}},t.codeFixAll=function(t,r,n){var i=[];return c(e.textChanges.ChangeTracker.with(t,(function(e){return l(t,r,(function(t){return n(e,t,i)}))})),0===i.length?void 0:i)},t.eachDiagnostic=l;}(e.codefix||(e.codefix={}));}(t),function(e){var t,r;t=e.refactor||(e.refactor={}),r=new e.Map,t.registerRefactor=function(e,t){r.set(e,t);},t.getApplicableRefactors=function(n){return e.arrayFrom(e.flatMapIterator(r.values(),(function(e){var r;return n.cancellationToken&&n.cancellationToken.isCancellationRequested()||!(null===(r=e.kinds)||void 0===r?void 0:r.some((function(e){return t.refactorKindBeginsWith(e,n.kind)})))?void 0:e.getAvailableActions(n)})))},t.getEditsForRefactor=function(e,t,n){var i=r.get(t);return i&&i.getEditsForAction(e,n)};}(t),function(e){!function(t){var r="addConvertToUnknownForNonOverlappingTypes",n=[e.Diagnostics.Conversion_of_type_0_to_type_1_may_be_a_mistake_because_neither_type_sufficiently_overlaps_with_the_other_If_this_was_intentional_convert_the_expression_to_unknown_first.code];function i(t,r,n){var i=e.getTokenAtPosition(r,n),a=e.Debug.checkDefined(e.findAncestor(i,(function(t){return e.isAsExpression(t)||e.isTypeAssertionExpression(t)})),"Expected to find an assertion expression"),o=e.isAsExpression(a)?e.factory.createAsExpression(a.expression,e.factory.createKeywordTypeNode(154)):e.factory.createTypeAssertion(e.factory.createKeywordTypeNode(154),a.expression);t.replaceNode(r,a.expression,o);}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var a=e.textChanges.ChangeTracker.with(n,(function(e){return i(e,n.sourceFile,n.span.start)}));return [t.createCodeFixAction(r,a,e.Diagnostics.Add_unknown_conversion_for_non_overlapping_types,r,e.Diagnostics.Add_unknown_to_all_conversions_of_non_overlapping_types)]},fixIds:[r],getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(e,t){return i(e,t.file,t.start)}))}});}(e.codefix||(e.codefix={}));}(t),function(e){var t;(t=e.codefix||(e.codefix={})).registerCodeFix({errorCodes:[e.Diagnostics.await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module.code,e.Diagnostics.for_await_loops_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module.code],getCodeActions:function(r){var n=r.sourceFile,i=e.textChanges.ChangeTracker.with(r,(function(t){var r=e.factory.createExportDeclaration(void 0,void 0,!1,e.factory.createNamedExports([]),void 0);t.insertNodeAtEndOfScope(n,n,r);}));return [t.createCodeFixActionWithoutFixAll("addEmptyExportDeclaration",i,e.Diagnostics.Add_export_to_make_this_file_into_a_module)]}});}(t),function(e){!function(t){var r="addMissingAsync",n=[e.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code,e.Diagnostics.Type_0_is_not_assignable_to_type_1.code,e.Diagnostics.Type_0_is_not_comparable_to_type_1.code];function i(n,i,a,o){var s=a((function(t){return function(t,r,n,i){if(!i||!i.has(e.getNodeId(n))){null==i||i.add(e.getNodeId(n));var a=e.factory.updateModifiers(e.getSynthesizedDeepClone(n,!0),e.factory.createNodeArray(e.factory.createModifiersFromModifierFlags(256|e.getSyntacticModifierFlags(n))));t.replaceNode(r,n,a);}}(t,n.sourceFile,i,o)}));return t.createCodeFixAction(r,s,e.Diagnostics.Add_async_modifier_to_containing_function,r,e.Diagnostics.Add_all_missing_async_modifiers)}function a(t,r){if(r){var n=e.getTokenAtPosition(t,r.start);return e.findAncestor(n,(function(n){return n.getStart(t)<r.start||n.getEnd()>e.textSpanEnd(r)?"quit":(e.isArrowFunction(n)||e.isMethodDeclaration(n)||e.isFunctionExpression(n)||e.isFunctionDeclaration(n))&&e.textSpansEqual(r,e.createTextSpanFromNode(n,t))}))}}t.registerCodeFix({fixIds:[r],errorCodes:n,getCodeActions:function(t){var r=t.sourceFile,n=t.errorCode,o=t.cancellationToken,s=t.program,c=t.span,l=e.find(s.getDiagnosticsProducingTypeChecker().getDiagnostics(r,o),function(t,r){return function(n){var i=n.start,a=n.length,o=n.relatedInformation,s=n.code;return e.isNumber(i)&&e.isNumber(a)&&e.textSpansEqual({start:i,length:a},t)&&s===r&&!!o&&e.some(o,(function(t){return t.code===e.Diagnostics.Did_you_mean_to_mark_this_function_as_async.code}))}}(c,n)),u=a(r,l&&l.relatedInformation&&e.find(l.relatedInformation,(function(t){return t.code===e.Diagnostics.Did_you_mean_to_mark_this_function_as_async.code})));if(u)return [i(t,u,(function(r){return e.textChanges.ChangeTracker.with(t,r)}))]},getAllCodeActions:function(r){var o=r.sourceFile,s=new e.Set;return t.codeFixAll(r,n,(function(t,n){var c=n.relatedInformation&&e.find(n.relatedInformation,(function(t){return t.code===e.Diagnostics.Did_you_mean_to_mark_this_function_as_async.code})),l=a(o,c);if(l)return i(r,l,(function(e){return e(t),[]}),s)}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="addMissingAwait",i=e.Diagnostics.Property_0_does_not_exist_on_type_1.code,a=[e.Diagnostics.This_expression_is_not_callable.code,e.Diagnostics.This_expression_is_not_constructable.code],o=n$3([e.Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type.code,e.Diagnostics.The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type.code,e.Diagnostics.The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type.code,e.Diagnostics.Operator_0_cannot_be_applied_to_type_1.code,e.Diagnostics.Operator_0_cannot_be_applied_to_types_1_and_2.code,e.Diagnostics.This_condition_will_always_return_0_since_the_types_1_and_2_have_no_overlap.code,e.Diagnostics.This_condition_will_always_return_true_since_this_0_is_always_defined.code,e.Diagnostics.Type_0_is_not_an_array_type.code,e.Diagnostics.Type_0_is_not_an_array_type_or_a_string_type.code,e.Diagnostics.Type_0_is_not_an_array_type_or_a_string_type_Use_compiler_option_downlevelIteration_to_allow_iterating_of_iterators.code,e.Diagnostics.Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator.code,e.Diagnostics.Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator.code,e.Diagnostics.Type_0_must_have_a_Symbol_iterator_method_that_returns_an_iterator.code,e.Diagnostics.Type_0_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator.code,e.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code,i],a,!0);function s(t,r,n,i,a){var o=e.getFixableErrorSpanExpression(t,n);return o&&function(t,r,n,i,a){var o=a.getDiagnosticsProducingTypeChecker().getDiagnostics(t,i);return e.some(o,(function(t){var i=t.start,a=t.length,o=t.relatedInformation,s=t.code;return e.isNumber(i)&&e.isNumber(a)&&e.textSpansEqual({start:i,length:a},n)&&s===r&&!!o&&e.some(o,(function(t){return t.code===e.Diagnostics.Did_you_forget_to_use_await.code}))}))}(t,r,n,i,a)&&u(o)?o:void 0}function c(r,n,i,a,s,c){var l=r.sourceFile,d=r.program,p=r.cancellationToken,f=function(t,r,n,i,a){var s=function(t,r){if(e.isPropertyAccessExpression(t.parent)&&e.isIdentifier(t.parent.expression))return {identifiers:[t.parent.expression],isCompleteFix:!0};if(e.isIdentifier(t))return {identifiers:[t],isCompleteFix:!0};if(e.isBinaryExpression(t)){for(var n=void 0,i=!0,a=0,o=[t.left,t.right];a<o.length;a++){var s=o[a],c=r.getTypeAtLocation(s);if(r.getPromisedTypeOfPromise(c)){if(!e.isIdentifier(s)){i=!1;continue}(n||(n=[])).push(s);}}return n&&{identifiers:n,isCompleteFix:i}}}(t,a);if(s){for(var c,l=s.isCompleteFix,_=function(t){var s=a.getSymbolAtLocation(t);if(!s)return "continue";var _=e.tryCast(s.valueDeclaration,e.isVariableDeclaration),d=_&&e.tryCast(_.name,e.isIdentifier),p=e.getAncestor(_,236);if(!_||!p||_.type||!_.initializer||p.getSourceFile()!==r||e.hasSyntacticModifier(p,1)||!d||!u(_.initializer))return l=!1,"continue";var f=i.getSemanticDiagnostics(r,n);if(e.FindAllReferences.Core.eachSymbolReferenceInFile(d,a,r,(function(n){return t!==n&&!function(t,r,n,i){var a=e.isPropertyAccessExpression(t.parent)?t.parent.name:e.isBinaryExpression(t.parent)?t.parent:t,s=e.find(r,(function(e){return e.start===a.getStart(n)&&e.start+e.length===a.getEnd()}));return s&&e.contains(o,s.code)||1&i.getTypeAtLocation(a).flags}(n,f,r,a)})))return l=!1,"continue";(c||(c=[])).push({expression:_.initializer,declarationSymbol:s});},d=0,p=s.identifiers;d<p.length;d++)_(p[d]);return c&&{initializers:c,needsSecondPassForFixAll:!l}}}(n,l,p,d,a);if(f){var g=s((function(t){e.forEach(f.initializers,(function(e){var r=e.expression;return _(t,i,l,a,r,c)})),c&&f.needsSecondPassForFixAll&&_(t,i,l,a,n,c);}));return t.createCodeFixActionWithoutFixAll("addMissingAwaitToInitializer",g,1===f.initializers.length?[e.Diagnostics.Add_await_to_initializer_for_0,f.initializers[0].declarationSymbol.name]:e.Diagnostics.Add_await_to_initializers)}}function l(n,i,a,o,s,c){var l=s((function(e){return _(e,a,n.sourceFile,o,i,c)}));return t.createCodeFixAction(r,l,e.Diagnostics.Add_await,r,e.Diagnostics.Fix_all_expressions_possibly_missing_await)}function u(t){return 32768&t.kind||!!e.findAncestor(t,(function(t){return t.parent&&e.isArrowFunction(t.parent)&&t.parent.body===t||e.isBlock(t)&&(255===t.parent.kind||212===t.parent.kind||213===t.parent.kind||168===t.parent.kind)}))}function _(t,r,n,o,s,c){if(e.isBinaryExpression(s))for(var l=0,u=[s.left,s.right];l<u.length;l++){var _=u[l];if(!(c&&e.isIdentifier(_)&&(g=o.getSymbolAtLocation(_))&&c.has(e.getSymbolId(g)))){var p=o.getTypeAtLocation(_),f=o.getPromisedTypeOfPromise(p)?e.factory.createAwaitExpression(_):_;t.replaceNode(n,_,f);}}else if(r===i&&e.isPropertyAccessExpression(s.parent)){if(c&&e.isIdentifier(s.parent.expression)&&(g=o.getSymbolAtLocation(s.parent.expression))&&c.has(e.getSymbolId(g)))return;t.replaceNode(n,s.parent.expression,e.factory.createParenthesizedExpression(e.factory.createAwaitExpression(s.parent.expression))),d(t,s.parent.expression,n);}else if(e.contains(a,r)&&e.isCallOrNewExpression(s.parent)){if(c&&e.isIdentifier(s)&&(g=o.getSymbolAtLocation(s))&&c.has(e.getSymbolId(g)))return;t.replaceNode(n,s,e.factory.createParenthesizedExpression(e.factory.createAwaitExpression(s))),d(t,s,n);}else {var g;if(c&&e.isVariableDeclaration(s.parent)&&e.isIdentifier(s.parent.name)&&(g=o.getSymbolAtLocation(s.parent.name))&&!e.tryAddToSet(c,e.getSymbolId(g)))return;t.replaceNode(n,s,e.factory.createAwaitExpression(s));}}function d(t,r,n){var i=e.findPrecedingToken(r.pos,n);i&&e.positionIsASICandidate(i.end,i.parent,n)&&t.insertText(n,r.getStart(n),";");}t.registerCodeFix({fixIds:[r],errorCodes:o,getCodeActions:function(t){var r=t.sourceFile,n=t.errorCode,i=s(r,n,t.span,t.cancellationToken,t.program);if(i){var a=t.program.getTypeChecker(),o=function(r){return e.textChanges.ChangeTracker.with(t,r)};return e.compact([c(t,i,n,a,o),l(t,i,n,a,o)])}},getAllCodeActions:function(r){var n=r.sourceFile,i=r.program,a=r.cancellationToken,u=r.program.getTypeChecker(),_=new e.Set;return t.codeFixAll(r,o,(function(e,t){var o=s(n,t.code,t,a,i);if(o){var d=function(t){return t(e),[]};return c(r,o,t.code,u,d,_)||l(r,o,t.code,u,d,_)}}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="addMissingConst",n=[e.Diagnostics.Cannot_find_name_0.code,e.Diagnostics.No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer.code];function i(t,r,n,i,s){var c=e.getTokenAtPosition(r,n),l=e.findAncestor(c,(function(t){return e.isForInOrOfStatement(t.parent)?t.parent.initializer===t:!function(e){switch(e.kind){case 79:case 203:case 204:case 294:case 295:return !0;default:return !1}}(t)&&"quit"}));if(l)return a(t,l,r,s);var u=c.parent;if(e.isBinaryExpression(u)&&63===u.operatorToken.kind&&e.isExpressionStatement(u.parent))return a(t,c,r,s);if(e.isArrayLiteralExpression(u)){var _=i.getTypeChecker();if(!e.every(u.elements,(function(t){return r=t,n=_,!!(i=e.isIdentifier(r)?r:e.isAssignmentExpression(r,!0)&&e.isIdentifier(r.left)?r.left:void 0)&&!n.getSymbolAtLocation(i);var r,n,i;})))return;return a(t,u,r,s)}var d=e.findAncestor(c,(function(t){return !!e.isExpressionStatement(t.parent)||!function(e){switch(e.kind){case 79:case 220:case 27:return !0;default:return !1}}(t)&&"quit"}));if(d){if(!o(d,i.getTypeChecker()))return;return a(t,d,r,s)}}function a(t,r,n,i){i&&!e.tryAddToSet(i,r)||t.insertModifierBefore(n,85,r);}function o(t,r){return !!e.isBinaryExpression(t)&&(27===t.operatorToken.kind?e.every([t.left,t.right],(function(e){return o(e,r)})):63===t.operatorToken.kind&&e.isIdentifier(t.left)&&!r.getSymbolAtLocation(t.left))}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var a=e.textChanges.ChangeTracker.with(n,(function(e){return i(e,n.sourceFile,n.span.start,n.program)}));if(a.length>0)return [t.createCodeFixAction(r,a,e.Diagnostics.Add_const_to_unresolved_variable,r,e.Diagnostics.Add_const_to_all_unresolved_variables)]},fixIds:[r],getAllCodeActions:function(r){var a=new e.Set;return t.codeFixAll(r,n,(function(e,t){return i(e,t.file,t.start,r.program,a)}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="addMissingDeclareProperty",n=[e.Diagnostics.Property_0_will_overwrite_the_base_property_in_1_If_this_is_intentional_add_an_initializer_Otherwise_add_a_declare_modifier_or_remove_the_redundant_declaration.code];function i(t,r,n,i){var a=e.getTokenAtPosition(r,n);if(e.isIdentifier(a)){var o=a.parent;166!==o.kind||i&&!e.tryAddToSet(i,o)||t.insertModifierBefore(r,135,o);}}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var a=e.textChanges.ChangeTracker.with(n,(function(e){return i(e,n.sourceFile,n.span.start)}));if(a.length>0)return [t.createCodeFixAction(r,a,e.Diagnostics.Prefix_with_declare,r,e.Diagnostics.Prefix_all_incorrect_property_declarations_with_declare)]},fixIds:[r],getAllCodeActions:function(r){var a=new e.Set;return t.codeFixAll(r,n,(function(e,t){return i(e,t.file,t.start,a)}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="addMissingInvocationForDecorator",n=[e.Diagnostics._0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write_0.code];function i(t,r,n){var i=e.getTokenAtPosition(r,n),a=e.findAncestor(i,e.isDecorator);e.Debug.assert(!!a,"Expected position to be owned by a decorator.");var o=e.factory.createCallExpression(a.expression,void 0,void 0);t.replaceNode(r,a.expression,o);}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var a=e.textChanges.ChangeTracker.with(n,(function(e){return i(e,n.sourceFile,n.span.start)}));return [t.createCodeFixAction(r,a,e.Diagnostics.Call_decorator_expression,r,e.Diagnostics.Add_to_all_uncalled_decorators)]},fixIds:[r],getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(e,t){return i(e,t.file,t.start)}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="addNameToNamelessParameter",n=[e.Diagnostics.Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1.code];function i(t,r,n){var i=e.getTokenAtPosition(r,n),a=i.parent;if(!e.isParameter(a))return e.Debug.fail("Tried to add a parameter name to a non-parameter: "+e.Debug.formatSyntaxKind(i.kind));var o=a.parent.parameters.indexOf(a);e.Debug.assert(!a.type,"Tried to add a parameter name to a parameter that already had one."),e.Debug.assert(o>-1,"Parameter not found in parent parameter list.");var s=e.factory.createTypeReferenceNode(a.name,void 0),c=e.factory.createParameterDeclaration(void 0,a.modifiers,a.dotDotDotToken,"arg"+o,a.questionToken,a.dotDotDotToken?e.factory.createArrayTypeNode(s):s,a.initializer);t.replaceNode(r,a,c);}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var a=e.textChanges.ChangeTracker.with(n,(function(e){return i(e,n.sourceFile,n.span.start)}));return [t.createCodeFixAction(r,a,e.Diagnostics.Add_parameter_name,r,e.Diagnostics.Add_names_to_all_parameters_without_names)]},fixIds:[r],getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(e,t){return i(e,t.file,t.start)}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="addOptionalPropertyUndefined",i=[e.Diagnostics.Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_type_of_the_target.code,e.Diagnostics.Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties.code,e.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties.code];function a(t,r){var n;if(t){if(e.isBinaryExpression(t.parent)&&63===t.parent.operatorToken.kind)return {source:t.parent.right,target:t.parent.left};if(e.isVariableDeclaration(t.parent)&&t.parent.initializer)return {source:t.parent.initializer,target:t.parent.name};if(e.isCallExpression(t.parent)){var i=r.getSymbolAtLocation(t.parent.expression);if(!(null==i?void 0:i.valueDeclaration)||!e.isFunctionLikeKind(i.valueDeclaration.kind))return;if(!e.isExpression(t))return;var o=t.parent.arguments.indexOf(t);if(-1===o)return;var s=i.valueDeclaration.parameters[o].name;if(e.isIdentifier(s))return {source:t,target:s}}else if(e.isPropertyAssignment(t.parent)&&e.isIdentifier(t.parent.name)||e.isShorthandPropertyAssignment(t.parent)){var c=a(t.parent.parent,r);if(!c)return;var l=r.getPropertyOfType(r.getTypeAtLocation(c.target),t.parent.name.text),u=null===(n=null==l?void 0:l.declarations)||void 0===n?void 0:n[0];if(!u)return;return {source:e.isPropertyAssignment(t.parent)?t.parent.initializer:t.parent.name,target:u}}}}t.registerCodeFix({errorCodes:i,getCodeActions:function(i){var o=i.program.getTypeChecker(),s=function(t,r,n){var i,o,s=a(e.getFixableErrorSpanExpression(t,r),n);if(!s)return e.emptyArray;var c=s.source,l=s.target,u=function(t,r,n){return e.isPropertyAccessExpression(r)&&!!n.getExactOptionalProperties(n.getTypeAtLocation(r.expression)).length&&n.getTypeAtLocation(t)===n.getUndefinedType()}(c,l,n)?n.getTypeAtLocation(l.expression):n.getTypeAtLocation(l);return (null===(o=null===(i=u.symbol)||void 0===i?void 0:i.declarations)||void 0===o?void 0:o.some((function(t){return e.getSourceFileOfNode(t).fileName.match(/\.d\.ts$/)})))?e.emptyArray:n.getExactOptionalProperties(u)}(i.sourceFile,i.span,o);if(s.length){var c=e.textChanges.ChangeTracker.with(i,(function(t){return function(t,r){for(var i=0,a=r;i<a.length;i++){var o=a[i].valueDeclaration;if(o&&(e.isPropertySignature(o)||e.isPropertyDeclaration(o))&&o.type){var s=e.factory.createUnionTypeNode(n$3(n$3([],186===o.type.kind?o.type.types:[o.type],!0),[e.factory.createTypeReferenceNode("undefined")],!1));t.replaceNode(o.getSourceFile(),o.type,s);}}}(t,s)}));return [t.createCodeFixActionWithoutFixAll(r,c,e.Diagnostics.Add_undefined_to_optional_property_type)]}},fixIds:[r]});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="annotateWithTypeFromJSDoc",n=[e.Diagnostics.JSDoc_types_may_be_moved_to_TypeScript_types.code];function i(t,r){var n=e.getTokenAtPosition(t,r);return e.tryCast(e.isParameter(n.parent)?n.parent.parent:n.parent,a)}function a(t){return function(t){return e.isFunctionLikeDeclaration(t)||253===t.kind||165===t.kind||166===t.kind}(t)&&o(t)}function o(t){return e.isFunctionLikeDeclaration(t)?t.parameters.some(o)||!t.type&&!!e.getJSDocReturnType(t):!t.type&&!!e.getJSDocType(t)}function s(t,r,n){if(e.isFunctionLikeDeclaration(n)&&(e.getJSDocReturnType(n)||n.parameters.some((function(t){return !!e.getJSDocType(t)})))){if(!n.typeParameters){var i=e.getJSDocTypeParameterDeclarations(n);i.length&&t.insertTypeParameters(r,n,i);}var a=e.isArrowFunction(n)&&!e.findChildOfKind(n,20,r);a&&t.insertNodeBefore(r,e.first(n.parameters),e.factory.createToken(20));for(var o=0,s=n.parameters;o<s.length;o++){var l=s[o];if(!l.type){var u=e.getJSDocType(l);u&&t.tryInsertTypeAnnotation(r,l,c(u));}}if(a&&t.insertNodeAfter(r,e.last(n.parameters),e.factory.createToken(21)),!n.type){var _=e.getJSDocReturnType(n);_&&t.tryInsertTypeAnnotation(r,n,c(_));}}else {var d=e.Debug.checkDefined(e.getJSDocType(n),"A JSDocType for this declaration should exist");e.Debug.assert(!n.type,"The JSDocType decl should have a type"),t.tryInsertTypeAnnotation(r,n,c(d));}}function c(t){switch(t.kind){case 310:case 311:return e.factory.createTypeReferenceNode("any",e.emptyArray);case 314:return function(t){return e.factory.createUnionTypeNode([e.visitNode(t.type,c),e.factory.createTypeReferenceNode("undefined",e.emptyArray)])}(t);case 313:return c(t.type);case 312:return function(t){return e.factory.createUnionTypeNode([e.visitNode(t.type,c),e.factory.createTypeReferenceNode("null",e.emptyArray)])}(t);case 316:return function(t){return e.factory.createArrayTypeNode(e.visitNode(t.type,c))}(t);case 315:return function(t){var r;return e.factory.createFunctionTypeNode(e.emptyArray,t.parameters.map(l),null!==(r=t.type)&&void 0!==r?r:e.factory.createKeywordTypeNode(130))}(t);case 177:return function(t){var r=t.typeName,n=t.typeArguments;if(e.isIdentifier(t.typeName)){if(e.isJSDocIndexSignature(t))return function(t){var r=e.factory.createParameterDeclaration(void 0,void 0,void 0,146===t.typeArguments[0].kind?"n":"s",void 0,e.factory.createTypeReferenceNode(146===t.typeArguments[0].kind?"number":"string",[]),void 0),n=e.factory.createTypeLiteralNode([e.factory.createIndexSignature(void 0,void 0,[r],t.typeArguments[1])]);return e.setEmitFlags(n,1),n}(t);var i=t.typeName.text;switch(t.typeName.text){case"String":case"Boolean":case"Object":case"Number":i=i.toLowerCase();break;case"array":case"date":case"promise":i=i[0].toUpperCase()+i.slice(1);}r=e.factory.createIdentifier(i),n="Array"!==i&&"Promise"!==i||t.typeArguments?e.visitNodes(t.typeArguments,c):e.factory.createNodeArray([e.factory.createTypeReferenceNode("any",e.emptyArray)]);}return e.factory.createTypeReferenceNode(r,n)}(t);default:var r=e.visitEachChild(t,c,e.nullTransformationContext);return e.setEmitFlags(r,1),r}}function l(t){var r=t.parent.parameters.indexOf(t),n=316===t.type.kind&&r===t.parent.parameters.length-1,i=t.name||(n?"rest":"arg"+r),a=n?e.factory.createToken(25):t.dotDotDotToken;return e.factory.createParameterDeclaration(t.decorators,t.modifiers,a,i,t.questionToken,e.visitNode(t.type,c),t.initializer)}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var a=i(n.sourceFile,n.span.start);if(a){var o=e.textChanges.ChangeTracker.with(n,(function(e){return s(e,n.sourceFile,a)}));return [t.createCodeFixAction(r,o,e.Diagnostics.Annotate_with_type_from_JSDoc,r,e.Diagnostics.Annotate_everything_with_types_from_JSDoc)]}},fixIds:[r],getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(e,t){var r=i(t.file,t.start);r&&s(e,t.file,r);}))}}),t.parameterShouldGetTypeFromJSDoc=a;}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="convertFunctionToEs6Class",n=[e.Diagnostics.This_constructor_function_may_be_converted_to_a_class_declaration.code];function i(t,r,n,i,s,c){var l=i.getSymbolAtLocation(e.getTokenAtPosition(r,n));if(l&&l.valueDeclaration&&19&l.flags){var u=l.valueDeclaration;if(e.isFunctionDeclaration(u))t.replaceNode(r,u,function(t){var r=p(l);t.body&&r.unshift(e.factory.createConstructorDeclaration(void 0,void 0,t.parameters,t.body));var n=a(t,93);return e.factory.createClassDeclaration(void 0,n,t.name,void 0,void 0,r)}(u));else if(e.isVariableDeclaration(u)){var _=function(t){var r=t.initializer;if(r&&e.isFunctionExpression(r)&&e.isIdentifier(t.name)){var n=p(t.symbol);r.body&&n.unshift(e.factory.createConstructorDeclaration(void 0,void 0,r.parameters,r.body));var i=a(t.parent.parent,93);return e.factory.createClassDeclaration(void 0,i,t.name,void 0,void 0,n)}}(u);if(!_)return;var d=u.parent.parent;e.isVariableDeclarationList(u.parent)&&u.parent.declarations.length>1?(t.delete(r,u),t.insertNodeAfter(r,d,_)):t.replaceNode(r,d,_);}}function p(n){var i=[];return n.members&&n.members.forEach((function(e,n){if("constructor"===n&&e.valueDeclaration)t.delete(r,e.valueDeclaration.parent);else {var a=l(e,void 0);a&&i.push.apply(i,a);}})),n.exports&&n.exports.forEach((function(t){if("prototype"===t.name&&t.declarations){var r=t.declarations[0];1===t.declarations.length&&e.isPropertyAccessExpression(r)&&e.isBinaryExpression(r.parent)&&63===r.parent.operatorToken.kind&&e.isObjectLiteralExpression(r.parent.right)&&(n=l(r.parent.right.symbol,void 0))&&i.push.apply(i,n);}else {var n;(n=l(t,[e.factory.createToken(124)]))&&i.push.apply(i,n);}})),i;function l(n,i){var l=[];if(!(8192&n.flags||4096&n.flags))return l;var u,_,d=n.valueDeclaration,p=d.parent,f=p.right;if(u=d,_=f,!(e.isAccessExpression(u)?e.isPropertyAccessExpression(u)&&o(u)||e.isFunctionLike(_):e.every(u.properties,(function(t){return !!(e.isMethodDeclaration(t)||e.isGetOrSetAccessorDeclaration(t)||e.isPropertyAssignment(t)&&e.isFunctionExpression(t.initializer)&&t.name||o(t))}))))return l;var g=p.parent&&237===p.parent.kind?p.parent:p;if(t.delete(r,g),!f)return l.push(e.factory.createPropertyDeclaration([],i,n.name,void 0,void 0,void 0)),l;if(e.isAccessExpression(d)&&(e.isFunctionExpression(f)||e.isArrowFunction(f))){var m=e.getQuotePreference(r,s),y=function(t,r,n){if(e.isPropertyAccessExpression(t))return t.name;var i=t.argumentExpression;return e.isNumericLiteral(i)?i:e.isStringLiteralLike(i)?e.isIdentifierText(i.text,e.getEmitScriptTarget(r))?e.factory.createIdentifier(i.text):e.isNoSubstitutionTemplateLiteral(i)?e.factory.createStringLiteral(i.text,0===n):i:void 0}(d,c,m);return y?h(l,f,y):l}if(e.isObjectLiteralExpression(f))return e.flatMap(f.properties,(function(t){return e.isMethodDeclaration(t)||e.isGetOrSetAccessorDeclaration(t)?l.concat(t):e.isPropertyAssignment(t)&&e.isFunctionExpression(t.initializer)?h(l,t.initializer,t.name):o(t)?l:[]}));if(e.isSourceFileJS(r))return l;if(!e.isPropertyAccessExpression(d))return l;var v=e.factory.createPropertyDeclaration(void 0,i,d.name,void 0,void 0,f);return e.copyLeadingComments(p.parent,v,r),l.push(v),l;function h(t,n,o){return e.isFunctionExpression(n)?function(t,n,o){var s=e.concatenate(i,a(n,131)),c=e.factory.createMethodDeclaration(void 0,s,void 0,o,void 0,void 0,n.parameters,void 0,n.body);return e.copyLeadingComments(p,c,r),t.concat(c)}(t,n,o):function(t,n,o){var s,c=n.body;s=234===c.kind?c:e.factory.createBlock([e.factory.createReturnStatement(c)]);var l=e.concatenate(i,a(n,131)),u=e.factory.createMethodDeclaration(void 0,l,void 0,o,void 0,void 0,n.parameters,void 0,s);return e.copyLeadingComments(p,u,r),t.concat(u)}(t,n,o)}}}}function a(t,r){return e.filter(t.modifiers,(function(e){return e.kind===r}))}function o(t){return !!t.name&&!(!e.isIdentifier(t.name)||"constructor"!==t.name.text)}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var a=e.textChanges.ChangeTracker.with(n,(function(e){return i(e,n.sourceFile,n.span.start,n.program.getTypeChecker(),n.preferences,n.program.getCompilerOptions())}));return [t.createCodeFixAction(r,a,e.Diagnostics.Convert_function_to_an_ES2015_class,r,e.Diagnostics.Convert_all_constructor_functions_to_classes)]},fixIds:[r],getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(t,r){return i(t,r.file,r.start,e.program.getTypeChecker(),e.preferences,e.program.getCompilerOptions())}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r,i="convertToAsyncFunction",a=[e.Diagnostics.This_may_be_converted_to_an_async_function.code],o=!0;function s(t,r,n,i){var a,o=e.getTokenAtPosition(r,n);if(a=e.isIdentifier(o)&&e.isVariableDeclaration(o.parent)&&o.parent.initializer&&e.isFunctionLikeDeclaration(o.parent.initializer)?o.parent.initializer:e.tryCast(e.getContainingFunction(e.getTokenAtPosition(r,n)),e.canBeConvertedToAsync)){var s=new e.Map,l=e.isInJSFile(a),u=function(t,r){if(!t.body)return new e.Set;var n=new e.Set;return e.forEachChild(t.body,(function t(i){c(i,r,"then")?(n.add(e.getNodeId(i)),e.forEach(i.arguments,t)):c(i,r,"catch")||c(i,r,"finally")?(n.add(e.getNodeId(i)),e.forEachChild(i,t)):_(i,r)?n.add(e.getNodeId(i)):e.forEachChild(i,t);})),n}(a,i),f=function(t,r,n){var i=new e.Map,a=e.createMultiMap();return e.forEachChild(t,(function t(o){if(e.isIdentifier(o)){var s=r.getSymbolAtLocation(o);if(s){var c=T(r.getTypeAtLocation(o),r),l=e.getSymbolId(s).toString();if(!c||e.isParameter(o.parent)||e.isFunctionLikeDeclaration(o.parent)||n.has(l)){if(o.parent&&(e.isParameter(o.parent)||e.isVariableDeclaration(o.parent)||e.isBindingElement(o.parent))){var u=o.text,_=a.get(u);if(_&&_.some((function(e){return e!==s}))){var p=d(o,a);i.set(l,p.identifier),n.set(l,p),a.add(u,s);}else {var f=e.getSynthesizedDeepClone(o);n.set(l,N(f)),a.add(u,s);}}}else {var g=e.firstOrUndefined(c.parameters),m=(null==g?void 0:g.valueDeclaration)&&e.isParameter(g.valueDeclaration)&&e.tryCast(g.valueDeclaration.name,e.isIdentifier)||e.factory.createUniqueName("result",16),y=d(m,a);n.set(l,y),a.add(m.text,s);}}}else e.forEachChild(o,t);})),e.getSynthesizedDeepCloneWithReplacements(t,!0,(function(t){if(e.isBindingElement(t)&&e.isIdentifier(t.name)&&e.isObjectBindingPattern(t.parent)){if((a=(n=r.getSymbolAtLocation(t.name))&&i.get(String(e.getSymbolId(n))))&&a.text!==(t.name||t.propertyName).getText())return e.factory.createBindingElement(t.dotDotDotToken,t.propertyName||t.name,a,t.initializer)}else if(e.isIdentifier(t)){var n,a;if(a=(n=r.getSymbolAtLocation(t))&&i.get(String(e.getSymbolId(n))))return e.factory.createIdentifier(a.text)}}))}(a,i,s);if(e.returnsPromise(f,i)){var m=f.body&&e.isBlock(f.body)?function(t,r){var n=[];return e.forEachReturnStatement(t,(function(t){e.isReturnStatementWithFixablePromiseHandler(t,r)&&n.push(t);})),n}(f.body,i):e.emptyArray,y={checker:i,synthNamesMap:s,setOfExpressionsToReturn:u,isInJSFile:l};if(m.length){var v=a.modifiers?a.modifiers.end:a.decorators?e.skipTrivia(r.text,a.decorators.end):a.getStart(r),h=a.modifiers?{prefix:" "}:{suffix:" "};t.insertModifierAt(r,v,131,h);for(var b=function(n){if(e.forEachChild(n,(function i(a){if(e.isCallExpression(a)){var o=g(a,a,y,!1);if(p())return !0;t.replaceNodeWithNodes(r,n,o);}else if(!e.isFunctionLike(a)&&(e.forEachChild(a,i),p()))return !0})),p())return {value:void 0}},x=0,D=m;x<D.length;x++){var S=b(D[x]);if("object"==typeof S)return S.value}}}}}function c(t,r,n){if(!e.isCallExpression(t))return !1;var i=e.hasPropertyAccessExpressionWithName(t,n)&&r.getTypeAtLocation(t);return !(!i||!r.getPromisedTypeOfPromise(i))}function l(t,r){return 0!=(4&e.getObjectFlags(t))&&t.target===r}function u(t,r,n){if("finally"!==t.expression.name.escapedText){var i=n.getTypeAtLocation(t.expression.expression);if(l(i,n.getPromiseType())||l(i,n.getPromiseLikeType())){if("then"!==t.expression.name.escapedText)return e.elementAt(t.typeArguments,0);if(r===e.elementAt(t.arguments,0))return e.elementAt(t.typeArguments,0);if(r===e.elementAt(t.arguments,1))return e.elementAt(t.typeArguments,1)}}}function _(t,r){return !!e.isExpression(t)&&!!r.getPromisedTypeOfPromise(r.getTypeAtLocation(t))}function d(t,r){var n=(r.get(t.text)||e.emptyArray).length;return N(0===n?t:e.factory.createIdentifier(t.text+"_"+n))}function p(){return !o}function f(){return o=!1,e.emptyArray}function g(t,r,n,i,a){if(c(r,n.checker,"then"))return function(t,r,n,i,a,o){if(!r||m(i,r))return h(t,n,i,a,o);if(n&&!m(i,n))return f();var s=E(r,i),c=g(t.expression.expression,t.expression.expression,i,!0,s);if(p())return f();var l=D(r,a,o,s,t,i);return p()?f():e.concatenate(c,l)}(r,e.elementAt(r.arguments,0),e.elementAt(r.arguments,1),n,i,a);if(c(r,n.checker,"catch"))return h(r,e.elementAt(r.arguments,0),n,i,a);if(c(r,n.checker,"finally"))return function(t,r,n,i,a){if(!r||m(n,r))return g(t,t.expression.expression,n,i,a);var o=y(t,n,a),s=g(t,t.expression.expression,n,!0,o);if(p())return f();var c=D(r,i,void 0,void 0,t,n);if(p())return f();var l=e.factory.createBlock(s),u=e.factory.createBlock(c);return v(t,n,e.factory.createTryStatement(l,void 0,u),o,a)}(r,e.elementAt(r.arguments,0),n,i,a);if(e.isPropertyAccessExpression(r))return g(t,r.expression,n,i,a);var o=n.checker.getTypeAtLocation(r);return o&&n.checker.getPromisedTypeOfPromise(o)?(e.Debug.assertNode(e.getOriginalNode(r).parent,e.isPropertyAccessExpression),function(t,r,n,i,a){if(O(t,n)){var o=e.getSynthesizedDeepClone(r);return i&&(o=e.factory.createAwaitExpression(o)),[e.factory.createReturnStatement(o)]}return b(a,e.factory.createAwaitExpression(r),void 0)}(t,r,n,i,a)):f()}function m(t,r){var n=t.checker;if(104===r.kind)return !0;if(e.isIdentifier(r)&&!e.isGeneratedIdentifier(r)&&"undefined"===e.idText(r)){var i=n.getSymbolAtLocation(r);return !i||n.isUndefinedSymbol(i)}return !1}function y(t,r,n){var i;return n&&!O(t,r)&&(I(n)?(i=n,r.synthNamesMap.forEach((function(t,i){if(t.identifier.text===n.identifier.text){var a=(o=n,N(e.factory.createUniqueName(o.identifier.text,16)));r.synthNamesMap.set(i,a);}var o;}))):i=N(e.factory.createUniqueName("result",16),n.types),w(i)),i}function v(t,r,n,i,a){var o,s=[];if(i&&!O(t,r)){o=e.getSynthesizedDeepClone(w(i));var c=i.types,l=r.checker.getUnionType(c,2),u=r.isInJSFile?void 0:r.checker.typeToTypeNode(l,void 0,void 0),_=[e.factory.createVariableDeclaration(o,void 0,u)],d=e.factory.createVariableStatement(void 0,e.factory.createVariableDeclarationList(_,1));s.push(d);}return s.push(n),a&&o&&1===a.kind&&s.push(e.factory.createVariableStatement(void 0,e.factory.createVariableDeclarationList([e.factory.createVariableDeclaration(e.getSynthesizedDeepClone(P(a)),void 0,void 0,o)],2))),s}function h(t,r,n,i,a){if(!r||m(n,r))return g(t,t.expression.expression,n,i,a);var o=E(r,n),s=y(t,n,a),c=g(t,t.expression.expression,n,!0,s);if(p())return f();var l=D(r,i,s,o,t,n);if(p())return f();var u=e.factory.createBlock(c),_=e.factory.createCatchClause(o&&e.getSynthesizedDeepClone(A(o)),e.factory.createBlock(l));return v(t,n,e.factory.createTryStatement(u,_,void 0),s,a)}function b(t,r,n){return !t||k(t)?[e.factory.createExpressionStatement(r)]:I(t)&&t.hasBeenDeclared?[e.factory.createExpressionStatement(e.factory.createAssignment(e.getSynthesizedDeepClone(F(t)),r))]:[e.factory.createVariableStatement(void 0,e.factory.createVariableDeclarationList([e.factory.createVariableDeclaration(e.getSynthesizedDeepClone(A(t)),void 0,n,r)],2))]}function x(t,r){if(r&&t){var i=e.factory.createUniqueName("result",16);return n$3(n$3([],b(N(i),t,r),!0),[e.factory.createReturnStatement(i)],!1)}return [e.factory.createReturnStatement(t)]}function D(t,r,n,i,a,o){var s;switch(t.kind){case 104:break;case 205:case 79:if(!i)break;var c=e.factory.createCallExpression(e.getSynthesizedDeepClone(t),void 0,I(i)?[F(i)]:[]);if(O(a,o))return x(c,u(a,t,o.checker));var l=o.checker.getTypeAtLocation(t),d=o.checker.getSignaturesOfType(l,0);if(!d.length)return f();var p=d[0].getReturnType(),g=b(n,e.factory.createAwaitExpression(c),u(a,t,o.checker));return n&&n.types.push(o.checker.getAwaitedType(p)||p),g;case 212:case 213:var m=t.body,y=null===(s=T(o.checker.getTypeAtLocation(t),o.checker))||void 0===s?void 0:s.getReturnType();if(e.isBlock(m)){for(var v=[],h=!1,D=0,E=m.statements;D<E.length;D++){var k=E[D];if(e.isReturnStatement(k))if(h=!0,e.isReturnStatementWithFixablePromiseHandler(k,o.checker))v=v.concat(C(o,k,r,n));else {var N=y&&k.expression?S(o.checker,y,k.expression):k.expression;v.push.apply(v,x(N,u(a,t,o.checker)));}else {if(r&&e.forEachReturnStatement(k,e.returnTrue))return f();v.push(k);}}return O(a,o)?v.map((function(t){return e.getSynthesizedDeepClone(t)})):function(t,r,n,i){for(var a=[],o=0,s=t;o<s.length;o++){var c=s[o];if(e.isReturnStatement(c)){if(c.expression){var l=_(c.expression,n.checker)?e.factory.createAwaitExpression(c.expression):c.expression;void 0===r?a.push(e.factory.createExpressionStatement(l)):I(r)&&r.hasBeenDeclared?a.push(e.factory.createExpressionStatement(e.factory.createAssignment(F(r),l))):a.push(e.factory.createVariableStatement(void 0,e.factory.createVariableDeclarationList([e.factory.createVariableDeclaration(A(r),void 0,void 0,l)],2)));}}else a.push(e.getSynthesizedDeepClone(c));}return i||void 0===r||a.push(e.factory.createVariableStatement(void 0,e.factory.createVariableDeclarationList([e.factory.createVariableDeclaration(A(r),void 0,void 0,e.factory.createIdentifier("undefined"))],2))),a}(v,n,o,h)}var P=e.isFixablePromiseHandler(m,o.checker)?C(o,e.factory.createReturnStatement(m),r,n):e.emptyArray;if(P.length>0)return P;if(y){if(N=S(o.checker,y,m),O(a,o))return x(N,u(a,t,o.checker));var w=b(n,N,void 0);return n&&n.types.push(o.checker.getAwaitedType(y)||y),w}return f();default:return f()}return e.emptyArray}function S(t,r,n){var i=e.getSynthesizedDeepClone(n);return t.getPromisedTypeOfPromise(r)?e.factory.createAwaitExpression(i):i}function T(t,r){var n=r.getSignaturesOfType(t,0);return e.lastOrUndefined(n)}function C(t,r,n,i){var a=[];return e.forEachChild(r,(function r(o){if(e.isCallExpression(o)){var s=g(o,o,t,n,i);if((a=a.concat(s)).length>0)return}else e.isFunctionLike(o)||e.forEachChild(o,r);})),a}function E(t,r){var n,i=[];if(e.isFunctionLikeDeclaration(t)?t.parameters.length>0&&(n=function t(r){return e.isIdentifier(r)?a(r):function(t,r,n){return void 0===r&&(r=e.emptyArray),void 0===n&&(n=[]),{kind:1,bindingPattern:t,elements:r,types:n}}(r,e.flatMap(r.elements,(function(r){return e.isOmittedExpression(r)?[]:[t(r.name)]})))}(t.parameters[0].name)):e.isIdentifier(t)?n=a(t):e.isPropertyAccessExpression(t)&&e.isIdentifier(t.name)&&(n=a(t.name)),n&&(!("identifier"in n)||"undefined"!==n.identifier.text))return n;function a(t){var n,a=function(e){return e.symbol?e.symbol:r.checker.getSymbolAtLocation(e)}((n=t).original?n.original:n);return a&&r.synthNamesMap.get(e.getSymbolId(a).toString())||N(t,i)}}function k(t){return !t||(I(t)?!t.identifier.text:e.every(t.elements,k))}function N(e,t){return void 0===t&&(t=[]),{kind:0,identifier:e,types:t,hasBeenDeclared:!1,hasBeenReferenced:!1}}function F(e){return e.hasBeenReferenced=!0,e.identifier}function A(e){return I(e)?w(e):P(e)}function P(e){for(var t=0,r=e.elements;t<r.length;t++)A(r[t]);return e.bindingPattern}function w(e){return e.hasBeenDeclared=!0,e.identifier}function I(e){return 0===e.kind}function O(t,r){return !!t.original&&r.setOfExpressionsToReturn.has(e.getNodeId(t.original))}t.registerCodeFix({errorCodes:a,getCodeActions:function(r){o=!0;var n=e.textChanges.ChangeTracker.with(r,(function(e){return s(e,r.sourceFile,r.span.start,r.program.getTypeChecker())}));return o?[t.createCodeFixAction(i,n,e.Diagnostics.Convert_to_async_function,i,e.Diagnostics.Convert_all_to_async_functions)]:[]},fixIds:[i],getAllCodeActions:function(e){return t.codeFixAll(e,a,(function(t,r){return s(t,r.file,r.start,e.program.getTypeChecker())}))}}),function(e){e[e.Identifier=0]="Identifier",e[e.BindingPattern=1]="BindingPattern";}(r||(r={}));}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){function r(t,r,n,i){for(var a=0,o=t.imports;a<o.length;a++){var s=o[a],c=e.getResolvedModule(t,s.text,e.getModeForUsageLocation(t,s));if(c&&c.resolvedFileName===r.fileName){var l=e.importFromModuleSpecifier(s);switch(l.kind){case 264:n.replaceNode(t,l,e.makeImport(l.name,void 0,s,i));break;case 207:e.isRequireCall(l,!1)&&n.replaceNode(t,l,e.factory.createPropertyAccessExpression(e.getSynthesizedDeepClone(l),"default"));}}}}function n(t,r){t.forEachChild((function n(i){if(e.isPropertyAccessExpression(i)&&e.isExportsOrModuleExportsOrAlias(t,i.expression)&&e.isIdentifier(i.name)){var a=i.parent;r(i,e.isBinaryExpression(a)&&a.left===i&&63===a.operatorToken.kind);}i.forEachChild(n);}));}function i(t,r,n,i,l,u,_,p,f){switch(r.kind){case 236:return a(t,r,i,n,l,u,f),!1;case 237:var y=r.expression;switch(y.kind){case 207:return e.isRequireCall(y,!0)&&i.replaceNode(t,r,e.makeImport(void 0,void 0,y.arguments[0],f)),!1;case 220:return 63===y.operatorToken.kind&&function(t,r,n,i,a,l){var u=n.left,_=n.right;if(!e.isPropertyAccessExpression(u))return !1;if(e.isExportsOrModuleExportsOrAlias(t,u)){if(!e.isExportsOrModuleExportsOrAlias(t,_)){var p=e.isObjectLiteralExpression(_)?function(t,r){var n=e.mapAllOrFail(t.properties,(function(t){switch(t.kind){case 171:case 172:case 295:case 296:return;case 294:return e.isIdentifier(t.name)?function(t,r,n){var i=[e.factory.createToken(93)];switch(r.kind){case 212:var a=r.name;if(a&&a.text!==t)return o();case 213:return d(t,i,r,n);case 225:return function(t,r,n,i){return e.factory.createClassDeclaration(e.getSynthesizedDeepClones(n.decorators),e.concatenate(r,e.getSynthesizedDeepClones(n.modifiers)),t,e.getSynthesizedDeepClones(n.typeParameters),e.getSynthesizedDeepClones(n.heritageClauses),c(n.members,i))}(t,i,r,n);default:return o()}function o(){return g(i,e.factory.createIdentifier(t),c(r,n))}}(t.name.text,t.initializer,r):void 0;case 168:return e.isIdentifier(t.name)?d(t.name.text,[e.factory.createToken(93)],t,r):void 0;default:e.Debug.assertNever(t,"Convert to ES6 got invalid prop kind ".concat(t.kind));}}));return n&&[n,!1]}(_,l):e.isRequireCall(_,!0)?function(t,r){var n=t.text,i=r.getSymbolAtLocation(t),a=i?i.exports:e.emptyMap;return a.has("export=")?[[s(n)],!0]:a.has("default")?a.size>1?[[o(n),s(n)],!0]:[[s(n)],!0]:[[o(n)],!1]}(_.arguments[0],r):void 0;return p?(i.replaceNodeWithNodes(t,n.parent,p[0]),p[1]):(i.replaceRangeWithText(t,e.createRange(u.getStart(t),_.pos),"export default"),!0)}i.delete(t,n.parent);}else e.isExportsOrModuleExportsOrAlias(t,u.expression)&&function(t,r,n,i){var a=r.left.name.text,o=i.get(a);if(void 0!==o){var s=[g(void 0,o,r.right),m([e.factory.createExportSpecifier(!1,o,a)])];n.replaceNodeWithNodes(t,r.parent,s);}else !function(t,r,n){var i=t.left,a=t.right,o=t.parent,s=i.name.text;if(!(e.isFunctionExpression(a)||e.isArrowFunction(a)||e.isClassExpression(a))||a.name&&a.name.text!==s)n.replaceNodeRangeWithNodes(r,i.expression,e.findChildOfKind(i,24,r),[e.factory.createToken(93),e.factory.createToken(85)],{joiner:" ",suffix:" "});else {n.replaceRange(r,{pos:i.getStart(r),end:a.getStart(r)},e.factory.createToken(93),{suffix:" "}),a.name||n.insertName(r,a,s);var c=e.findChildOfKind(o,26,r);c&&n.delete(r,c);}}(r,t,n);}(t,n,i,a);return !1}(t,n,y,i,_,p)}default:return !1}}function a(r,n,i,a,o,s,c){var u,_=n.declarationList,d=!1,m=e.map(_.declarations,(function(n){var i=n.name,u=n.initializer;if(u){if(e.isExportsOrModuleExportsOrAlias(r,u))return d=!0,y([]);if(e.isRequireCall(u,!0))return d=!0,function(r,n,i,a,o,s){switch(r.kind){case 200:var c=e.mapAllOrFail(r.elements,(function(t){return t.dotDotDotToken||t.initializer||t.propertyName&&!e.isIdentifier(t.propertyName)||!e.isIdentifier(t.name)?void 0:f(t.propertyName&&t.propertyName.text,t.name.text)}));if(c)return y([e.makeImport(void 0,c,n,s)]);case 201:var u=l(t.moduleSpecifierToValidIdentifier(n.text,o),a);return y([e.makeImport(e.factory.createIdentifier(u),void 0,n,s),g(void 0,e.getSynthesizedDeepClone(r),e.factory.createIdentifier(u))]);case 79:return function(t,r,n,i,a){for(var o,s=n.getSymbolAtLocation(t),c=new e.Map,u=!1,_=0,d=i.original.get(t.text);_<d.length;_++){var p=d[_];if(n.getSymbolAtLocation(p)===s&&p!==t){var f=p.parent;if(e.isPropertyAccessExpression(f)){var g=f.name.text;if("default"===g){u=!0;var m=p.getText();(null!=o?o:o=new e.Map).set(f,e.factory.createIdentifier(m));}else {e.Debug.assert(f.expression===p,"Didn't expect expression === use");var v=c.get(g);void 0===v&&(v=l(g,i),c.set(g,v)),(null!=o?o:o=new e.Map).set(f,e.factory.createIdentifier(v));}}else u=!0;}}var h=0===c.size?void 0:e.arrayFrom(e.mapIterator(c.entries(),(function(t){var r=t[0],n=t[1];return e.factory.createImportSpecifier(!1,r===n?void 0:e.factory.createIdentifier(r),e.factory.createIdentifier(n))})));return h||(u=!0),y([e.makeImport(u?e.getSynthesizedDeepClone(t):void 0,h,r,a)],o)}(r,n,i,a,s);default:return e.Debug.assertNever(r,"Convert to ES module got invalid name kind ".concat(r.kind))}}(i,u.arguments[0],a,o,s,c);if(e.isPropertyAccessExpression(u)&&e.isRequireCall(u.expression,!0))return d=!0,function(t,r,n,i,a){switch(t.kind){case 200:case 201:var o=l(r,i);return y([p(o,r,n,a),g(void 0,t,e.factory.createIdentifier(o))]);case 79:return y([p(t.text,r,n,a)]);default:return e.Debug.assertNever(t,"Convert to ES module got invalid syntax form ".concat(t.kind))}}(i,u.name.text,u.expression.arguments[0],o,c)}return y([e.factory.createVariableStatement(void 0,e.factory.createVariableDeclarationList([n],_.flags))])}));if(d)return i.replaceNodeWithNodes(r,n,e.flatMap(m,(function(e){return e.newImports}))),e.forEach(m,(function(t){t.useSitesToUnqualify&&e.copyEntries(t.useSitesToUnqualify,null!=u?u:u=new e.Map);})),u}function o(e){return m(void 0,e)}function s(t){return m([e.factory.createExportSpecifier(!1,void 0,"default")],t)}function c(t,r){return r&&e.some(e.arrayFrom(r.keys()),(function(r){return e.rangeContainsRange(t,r)}))?e.isArray(t)?e.getSynthesizedDeepClonesWithReplacements(t,!0,n):e.getSynthesizedDeepCloneWithReplacements(t,!0,n):t;function n(e){if(205===e.kind){var t=r.get(e);return r.delete(e),t}}}function l(e,t){for(;t.original.has(e)||t.additional.has(e);)e="_".concat(e);return t.additional.add(e),e}function u(t){var r=e.createMultiMap();return _(t,(function(e){return r.add(e.text,e)})),r}function _(t,r){e.isIdentifier(t)&&function(e){var t=e.parent;switch(t.kind){case 205:return t.name!==e;case 202:case 269:return t.propertyName!==e;default:return !0}}(t)&&r(t),t.forEachChild((function(e){return _(e,r)}));}function d(t,r,n,i){return e.factory.createFunctionDeclaration(e.getSynthesizedDeepClones(n.decorators),e.concatenate(r,e.getSynthesizedDeepClones(n.modifiers)),e.getSynthesizedDeepClone(n.asteriskToken),t,e.getSynthesizedDeepClones(n.typeParameters),e.getSynthesizedDeepClones(n.parameters),e.getSynthesizedDeepClone(n.type),e.factory.converters.convertToFunctionBlock(c(n.body,i)))}function p(t,r,n,i){return "default"===r?e.makeImport(e.factory.createIdentifier(t),void 0,n,i):e.makeImport(void 0,[f(r,t)],n,i)}function f(t,r){return e.factory.createImportSpecifier(!1,void 0!==t&&t!==r?e.factory.createIdentifier(t):void 0,e.factory.createIdentifier(r))}function g(t,r,n){return e.factory.createVariableStatement(t,e.factory.createVariableDeclarationList([e.factory.createVariableDeclaration(r,void 0,void 0,n)],2))}function m(t,r){return e.factory.createExportDeclaration(void 0,void 0,!1,t&&e.factory.createNamedExports(t),void 0===r?void 0:e.factory.createStringLiteral(r))}function y(e,t){return {newImports:e,useSitesToUnqualify:t}}t.registerCodeFix({errorCodes:[e.Diagnostics.File_is_a_CommonJS_module_it_may_be_converted_to_an_ES_module.code],getCodeActions:function(o){var s=o.sourceFile,c=o.program,_=o.preferences,d=e.textChanges.ChangeTracker.with(o,(function(t){if(function(t,r,o,s,c){var _={original:u(t),additional:new e.Set},d=function(t,r,i){var a=new e.Map;return n(t,(function(t){var n=t.name,o=n.text,s=n.originalKeywordKind;!a.has(o)&&(void 0!==s&&e.isNonContextualKeyword(s)||r.resolveName(o,t,111551,!0))&&a.set(o,l("_".concat(o),i));})),a}(t,r,_);!function(t,r,i){n(t,(function(n,a){if(!a){var o=n.name.text;i.replaceNode(t,n,e.factory.createIdentifier(r.get(o)||o));}}));}(t,d,o);for(var p,f=!1,g=0,m=e.filter(t.statements,e.isVariableStatement);g<m.length;g++){var y=m[g],v=a(t,y,o,r,_,s,c);v&&e.copyEntries(v,null!=p?p:p=new e.Map);}for(var h=0,b=e.filter(t.statements,(function(t){return !e.isVariableStatement(t)}));h<b.length;h++){y=b[h];var x=i(t,y,r,o,_,s,d,p,c);f=f||x;}return null==p||p.forEach((function(e,r){o.replaceNode(t,r,e);})),f}(s,c.getTypeChecker(),t,e.getEmitScriptTarget(c.getCompilerOptions()),e.getQuotePreference(s,_)))for(var o=0,d=c.getSourceFiles();o<d.length;o++){var p=d[o];r(p,s,t,e.getQuotePreference(p,_));}}));return [t.createCodeFixActionWithoutFixAll("convertToEsModule",d,e.Diagnostics.Convert_to_ES_module)]}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="correctQualifiedNameToIndexedAccessType",n=[e.Diagnostics.Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_property_1_in_0_with_0_1.code];function i(t,r){var n=e.findAncestor(e.getTokenAtPosition(t,r),e.isQualifiedName);return e.Debug.assert(!!n,"Expected position to be owned by a qualified name."),e.isIdentifier(n.left)?n:void 0}function a(t,r,n){var i=n.right.text,a=e.factory.createIndexedAccessTypeNode(e.factory.createTypeReferenceNode(n.left,void 0),e.factory.createLiteralTypeNode(e.factory.createStringLiteral(i)));t.replaceNode(r,n,a);}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var o=i(n.sourceFile,n.span.start);if(o){var s=e.textChanges.ChangeTracker.with(n,(function(e){return a(e,n.sourceFile,o)})),c="".concat(o.left.text,'["').concat(o.right.text,'"]');return [t.createCodeFixAction(r,s,[e.Diagnostics.Rewrite_as_the_indexed_access_type_0,c],r,e.Diagnostics.Rewrite_all_as_indexed_access_types)]}},fixIds:[r],getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(e,t){var r=i(t.file,t.start);r&&a(e,t.file,r);}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r=[e.Diagnostics.Re_exporting_a_type_when_the_isolatedModules_flag_is_provided_requires_using_export_type.code],n="convertToTypeOnlyExport";function i(t,r){return e.tryCast(e.getTokenAtPosition(r,t.start).parent,e.isExportSpecifier)}function a(t,n,i){if(n){var a=n.parent,o=a.parent,s=function(t,n){var i=t.parent;if(1===i.elements.length)return i.elements;var a=e.getDiagnosticsWithinSpan(e.createTextSpanFromNode(i),n.program.getSemanticDiagnostics(n.sourceFile,n.cancellationToken));return e.filter(i.elements,(function(n){var i;return n===t||(null===(i=e.findDiagnosticForNode(n,a))||void 0===i?void 0:i.code)===r[0]}))}(n,i);if(s.length===a.elements.length)t.insertModifierBefore(i.sourceFile,151,a);else {var c=e.factory.updateExportDeclaration(o,o.decorators,o.modifiers,!1,e.factory.updateNamedExports(a,e.filter(a.elements,(function(t){return !e.contains(s,t)}))),o.moduleSpecifier,void 0),l=e.factory.createExportDeclaration(void 0,void 0,!0,e.factory.createNamedExports(s),o.moduleSpecifier,void 0);t.replaceNode(i.sourceFile,o,c,{leadingTriviaOption:e.textChanges.LeadingTriviaOption.IncludeAll,trailingTriviaOption:e.textChanges.TrailingTriviaOption.Exclude}),t.insertNodeAfter(i.sourceFile,o,l);}}}t.registerCodeFix({errorCodes:r,getCodeActions:function(r){var o=e.textChanges.ChangeTracker.with(r,(function(e){return a(e,i(r.span,r.sourceFile),r)}));if(o.length)return [t.createCodeFixAction(n,o,e.Diagnostics.Convert_to_type_only_export,n,e.Diagnostics.Convert_all_re_exported_types_to_type_only_exports)]},fixIds:[n],getAllCodeActions:function(n){var o=new e.Map;return t.codeFixAll(n,r,(function(t,r){var s=i(r,n.sourceFile);s&&e.addToSeen(o,e.getNodeId(s.parent.parent))&&a(t,s,n);}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r=[e.Diagnostics.This_import_is_never_used_as_a_value_and_must_use_import_type_because_importsNotUsedAsValues_is_set_to_error.code],n="convertToTypeOnlyImport";function i(t,r){return e.tryCast(e.getTokenAtPosition(r,t.start).parent,e.isImportDeclaration)}function a(t,r,n){if(null==r?void 0:r.importClause){var i=r.importClause;t.insertText(n.sourceFile,r.getStart()+"import".length," type"),i.name&&i.namedBindings&&(t.deleteNodeRangeExcludingEnd(n.sourceFile,i.name,r.importClause.namedBindings),t.insertNodeBefore(n.sourceFile,r,e.factory.updateImportDeclaration(r,void 0,void 0,e.factory.createImportClause(!0,i.name,void 0),r.moduleSpecifier,void 0)));}}t.registerCodeFix({errorCodes:r,getCodeActions:function(r){var o=e.textChanges.ChangeTracker.with(r,(function(e){a(e,i(r.span,r.sourceFile),r);}));if(o.length)return [t.createCodeFixAction(n,o,e.Diagnostics.Convert_to_type_only_import,n,e.Diagnostics.Convert_all_imports_not_used_as_a_value_to_type_only_imports)]},fixIds:[n],getAllCodeActions:function(e){return t.codeFixAll(e,r,(function(t,r){a(t,i(r,e.sourceFile),e);}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="convertLiteralTypeToMappedType",n=[e.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0.code];function i(t,r){var n=e.getTokenAtPosition(t,r);if(e.isIdentifier(n)){var i=e.cast(n.parent.parent,e.isPropertySignature),a=n.getText(t);return {container:e.cast(i.parent,e.isTypeLiteralNode),typeNode:i.type,constraint:a,name:"K"===a?"P":"K"}}}function a(t,r,n){var i=n.container,a=n.typeNode,o=n.constraint,s=n.name;t.replaceNode(r,i,e.factory.createMappedTypeNode(void 0,e.factory.createTypeParameterDeclaration(s,e.factory.createTypeReferenceNode(o)),void 0,void 0,a,void 0));}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var o=n.sourceFile,s=n.span,c=i(o,s.start);if(c){var l=c.name,u=c.constraint,_=e.textChanges.ChangeTracker.with(n,(function(e){return a(e,o,c)}));return [t.createCodeFixAction(r,_,[e.Diagnostics.Convert_0_to_1_in_0,u,l],r,e.Diagnostics.Convert_all_type_literals_to_mapped_type)]}},fixIds:[r],getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(e,t){var r=i(t.file,t.start);r&&a(e,t.file,r);}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r=[e.Diagnostics.Class_0_incorrectly_implements_interface_1.code,e.Diagnostics.Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclass.code],n="fixClassIncorrectlyImplementsInterface";function i(t,r){return e.Debug.checkDefined(e.getContainingClass(e.getTokenAtPosition(t,r)),"There should be a containing class")}function a(t){return !(t.valueDeclaration&&8&e.getEffectiveModifierFlags(t.valueDeclaration))}function o(r,n,i,o,s,c){var l=r.program.getTypeChecker(),u=function(t,r){var n=e.getEffectiveBaseTypeNode(t);if(!n)return e.createSymbolTable();var i=r.getTypeAtLocation(n),o=r.getPropertiesOfType(i);return e.createSymbolTable(o.filter(a))}(o,l),_=l.getTypeAtLocation(n),d=l.getPropertiesOfType(_).filter(e.and(a,(function(e){return !u.has(e.escapedName)}))),p=l.getTypeAtLocation(o),f=e.find(o.members,(function(t){return e.isConstructorDeclaration(t)}));p.getNumberIndexType()||m(_,1),p.getStringIndexType()||m(_,0);var g=t.createImportAdder(i,r.program,c,r.host);function m(e,n){var a=l.getIndexInfoOfType(e,n);a&&y(i,o,l.indexInfoToIndexSignatureDeclaration(a,o,void 0,t.getNoopSymbolTrackerWithResolver(r)));}function y(e,t,r){f?s.insertNodeAfter(e,f,r):s.insertNodeAtClassStart(e,t,r);}t.createMissingMemberNodes(o,d,i,r,c,g,(function(e){return y(i,o,e)})),g.writeFixes(s);}t.registerCodeFix({errorCodes:r,getCodeActions:function(r){var a=r.sourceFile,s=r.span,c=i(a,s.start);return e.mapDefined(e.getEffectiveImplementsTypeNodes(c),(function(i){var s=e.textChanges.ChangeTracker.with(r,(function(e){return o(r,i,a,c,e,r.preferences)}));return 0===s.length?void 0:t.createCodeFixAction(n,s,[e.Diagnostics.Implement_interface_0,i.getText(a)],n,e.Diagnostics.Implement_all_unimplemented_interfaces)}))},fixIds:[n],getAllCodeActions:function(n){var a=new e.Map;return t.codeFixAll(n,r,(function(t,r){var s=i(r.file,r.start);if(e.addToSeen(a,e.getNodeId(s)))for(var c=0,l=e.getEffectiveImplementsTypeNodes(s);c<l.length;c++){var u=l[c];o(n,u,r.file,s,t,n.preferences);}}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){t.importFixName="import";var r,a,o="fixMissingImport",s=[e.Diagnostics.Cannot_find_name_0.code,e.Diagnostics.Cannot_find_name_0_Did_you_mean_1.code,e.Diagnostics.Cannot_find_name_0_Did_you_mean_the_instance_member_this_0.code,e.Diagnostics.Cannot_find_name_0_Did_you_mean_the_static_member_1_0.code,e.Diagnostics.Cannot_find_namespace_0.code,e.Diagnostics._0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead.code,e.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here.code,e.Diagnostics.No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer.code];function c(t,r,n,i,a){var o=r.getCompilerOptions(),s=[],c=[],u=new e.Map,d=new e.Map;return {addImportFromDiagnostic:function(e,t){var r=m(t,e.code,e.start,n);r&&r.fixes.length&&p(r);},addImportFromExportedSymbol:function(s,c){var u=e.Debug.checkDefined(s.parent),d=e.getNameForExportedSymbol(s,e.getEmitScriptTarget(o)),g=r.getTypeChecker(),m=g.getMergedSymbol(e.skipAlias(s,g)),y=_(t,m,u,d,a,r,i,n),v=f(t,r),h=l(t,y,u,d,r,void 0,!!c,v,a,i);h&&p({fixes:[h],symbolName:d});},writeFixes:function(r){for(var n,a=e.getQuotePreference(t,i),l=0,_=s;l<_.length;l++){var p=_[l];D(r,t,p);}for(var f=0,g=c;f<g.length;f++)p=g[f],S(r,t,p,a);u.forEach((function(n){var i=n.importClauseOrBindingPattern,a=n.defaultImport,s=n.namedImports;x(r,t,i,a,e.arrayFrom(s.entries(),(function(e){var t=e[0];return {addAsTypeOnly:e[1],name:t}})),o);})),d.forEach((function(t,r){var i=t.useRequire,o=t.defaultImport,s=t.namedImports,c=t.namespaceLikeImport,l=(i?k:E)(r.slice(2),a,o,s&&e.arrayFrom(s.entries(),(function(e){var t=e[0];return {addAsTypeOnly:e[1],name:t}})),c);n=e.combine(n,l);})),n&&e.insertImports(r,t,n,!0);},hasFixes:function(){return s.length>0||c.length>0||u.size>0||d.size>0}};function p(t){var r,n,i=t.fixes,a=t.symbolName,o=e.first(i);switch(o.kind){case 0:s.push(o);break;case 1:c.push(o);break;case 2:var l=o.importClauseOrBindingPattern,_=o.importKind,p=o.addAsTypeOnly,f=String(e.getNodeId(l));if((v=u.get(f))||u.set(f,v={importClauseOrBindingPattern:l,defaultImport:void 0,namedImports:new e.Map}),0===_){var g=null==v?void 0:v.namedImports.get(a);v.namedImports.set(a,h(g,p));}else e.Debug.assert(void 0===v.defaultImport||v.defaultImport.name===a,"(Add to Existing) Default import should be missing or match symbolName"),v.defaultImport={name:a,addAsTypeOnly:h(null===(r=v.defaultImport)||void 0===r?void 0:r.addAsTypeOnly,p)};break;case 3:var m=o.moduleSpecifier,y=(_=o.importKind,o.useRequire),v=function(e,t,r,n){var i=b(e,!0),a=b(e,!1),o=d.get(i),s=d.get(a),c={defaultImport:void 0,namedImports:void 0,namespaceLikeImport:void 0,useRequire:r};return 1===t&&2===n?o||(d.set(i,c),c):1===n&&(o||s)?o||s:s||(d.set(a,c),c)}(m,_,y,p=o.addAsTypeOnly);switch(e.Debug.assert(v.useRequire===y,"(Add new) Tried to add an `import` and a `require` for the same module"),_){case 1:e.Debug.assert(void 0===v.defaultImport||v.defaultImport.name===a,"(Add new) Default import should be missing or match symbolName"),v.defaultImport={name:a,addAsTypeOnly:h(null===(n=v.defaultImport)||void 0===n?void 0:n.addAsTypeOnly,p)};break;case 0:g=(v.namedImports||(v.namedImports=new e.Map)).get(a),v.namedImports.set(a,h(g,p));break;case 3:case 2:e.Debug.assert(void 0===v.namespaceLikeImport||v.namespaceLikeImport.name===a,"Namespacelike import shoudl be missing or match symbolName"),v.namespaceLikeImport={importKind:_,name:a,addAsTypeOnly:p};}break;default:e.Debug.assertNever(o,"fix wasn't never - got kind ".concat(o.kind));}function h(e,t){return Math.max(null!=e?e:0,t)}function b(e,t){return "".concat(t?1:0,"|").concat(e)}}}function l(t,r,n,i,a,o,s,c,l,u){return e.Debug.assert(r.some((function(e){return e.moduleSymbol===n||e.symbol.parent===n})),"Some exportInfo should match the specified moduleSymbol"),y(d(r,i,o,s,c,a,t,l,u),t,a,l,u)}function u(t,r,n,i){var a,o,s=n.getCompilerOptions(),c=u(n.getTypeChecker(),!1);if(c)return c;var l=null===(o=null===(a=i.getPackageJsonAutoImportProvider)||void 0===a?void 0:a.call(i))||void 0===o?void 0:o.getTypeChecker();return e.Debug.checkDefined(l&&u(l,!0),"Could not find symbol in specified module for code actions");function u(n,i){var a=e.getDefaultLikeExportInfo(r,n,s);if(a&&e.skipAlias(a.symbol,n)===t)return {symbol:a.symbol,moduleSymbol:r,moduleFileName:void 0,exportKind:a.exportKind,targetFlags:e.skipAlias(t,n).flags,isFromPackageJson:i};var o=n.tryGetMemberInModuleExportsAndProperties(t.name,r);return o&&e.skipAlias(o,n)===t?{symbol:o,moduleSymbol:r,moduleFileName:void 0,exportKind:0,targetFlags:e.skipAlias(t,n).flags,isFromPackageJson:i}:void 0}}function _(t,r,n,i,a,o,s,c){var l=[],u=o.getCompilerOptions(),_=e.memoizeOne((function(t){return e.createModuleSpecifierResolutionHost(t?a.getPackageJsonAutoImportProvider():o,a)}));return e.forEachExternalModuleToImportFrom(o,a,c,(function(a,o,s,c){var _=s.getTypeChecker();if(!o||a===n||!e.startsWith(t.fileName,e.getDirectoryPath(o.fileName))){var p=e.getDefaultLikeExportInfo(a,_,u);p&&(p.name===i||A(a,e.getEmitScriptTarget(u))===i)&&e.skipAlias(p.symbol,_)===r&&d(s,o,c)&&l.push({symbol:p.symbol,moduleSymbol:a,moduleFileName:null==o?void 0:o.fileName,exportKind:p.exportKind,targetFlags:e.skipAlias(p.symbol,_).flags,isFromPackageJson:c});for(var f=0,g=_.getExportsAndPropertiesOfModule(a);f<g.length;f++){var m=g[f];m.name===i&&_.getMergedSymbol(e.skipAlias(m,_))===r&&d(s,o,c)&&l.push({symbol:m,moduleSymbol:a,moduleFileName:null==o?void 0:o.fileName,exportKind:0,targetFlags:e.skipAlias(m,_).flags,isFromPackageJson:c});}}})),l;function d(r,n,i){var o;return !n||e.isImportableFile(r,t,n,s,void 0,_(i),null===(o=a.getModuleSpecifierCache)||void 0===o?void 0:o.call(a))}}function d(t,r,i,a,o,s,c,l,u){var _=s.getTypeChecker(),d=e.flatMap(t,(function(t){return function(t,r,n,i){var a=t.moduleSymbol,o=t.exportKind,s=t.targetFlags,c=t.symbol;if(!(111551&s)&&e.isSourceFileJS(n))return e.emptyArray;var l=h(n,o,i);return e.mapDefined(n.imports,(function(t){var n=e.importFromModuleSpecifier(t);return e.isRequireVariableDeclaration(n.parent)?r.resolveExternalModuleName(t)===a?{declaration:n.parent,importKind:l,symbol:c,targetFlags:s}:void 0:265!==n.kind&&264!==n.kind||r.getSymbolAtLocation(t)!==a?void 0:{declaration:n,importKind:l,symbol:c,targetFlags:s}}))}(t,_,c,s.getCompilerOptions())})),f=void 0===i?void 0:function(t,r,n,i){return e.firstDefined(t,(function(t){var a=t.declaration,o=function(t){var r,n,i;switch(t.kind){case 253:return null===(r=e.tryCast(t.name,e.isIdentifier))||void 0===r?void 0:r.text;case 264:return t.name.text;case 265:return null===(i=e.tryCast(null===(n=t.importClause)||void 0===n?void 0:n.namedBindings,e.isNamespaceImport))||void 0===i?void 0:i.name.text;default:return e.Debug.assertNever(t)}}(a),s=e.tryGetModuleSpecifierFromDeclaration(a);if(o&&s){var c=function(t,r){var n;switch(t.kind){case 253:return r.resolveExternalModuleName(t.initializer.arguments[0]);case 264:return r.getAliasedSymbol(t.symbol);case 265:var i=e.tryCast(null===(n=t.importClause)||void 0===n?void 0:n.namedBindings,e.isNamespaceImport);return i&&r.getAliasedSymbol(i.symbol);default:return e.Debug.assertNever(t)}}(a,i);if(c&&c.exports.has(e.escapeLeadingUnderscores(r)))return {kind:0,namespacePrefix:o,position:n,moduleSpecifier:s}}}))}(d,r,i,_),m=function(t,r,n,i){return e.firstDefined(t,(function(t){var a=t.declaration,o=t.importKind,s=t.symbol,c=t.targetFlags;if(3!==o&&2!==o&&264!==a.kind){if(253===a.kind)return 0!==o&&1!==o||200!==a.name.kind?void 0:{kind:2,importClauseOrBindingPattern:a.name,importKind:o,moduleSpecifier:a.initializer.arguments[0].text,addAsTypeOnly:4};var l=a.importClause;if(l&&e.isStringLiteralLike(a.moduleSpecifier)){var u=l.name,_=l.namedBindings;if(!l.isTypeOnly||0===o&&_){var d=p(r,!1,s,c,n,i);if(!(1===o&&(u||2===d&&_)||0===o&&267===(null==_?void 0:_.kind)))return {kind:2,importClauseOrBindingPattern:l,importKind:o,moduleSpecifier:a.moduleSpecifier.text,addAsTypeOnly:d}}}}}))}(d,a,_,s.getCompilerOptions()),y=m?[m]:function(t,r,n,i,a,o,s,c,l){var u=e.firstDefined(r,(function(t){return function(t,r,n,i,a){var o=t.declaration,s=t.importKind,c=t.symbol,l=t.targetFlags,u=e.tryGetModuleSpecifierFromDeclaration(o);if(u)return {kind:3,moduleSpecifier:u,importKind:s,addAsTypeOnly:n?4:p(r,!0,c,l,i,a),useRequire:n}}(t,o,s,n.getTypeChecker(),n.getCompilerOptions())}));return u?[u]:g(n,i,a,o,s,t,c,l).fixes}(t,d,s,c,i,a,o,l,u);return n$3(n$3([],f?[f]:e.emptyArray,!0),y,!0)}function p(e,t,r,n,i,a){return e?t&&2===a.importsNotUsedAsValues?2:!a.isolatedModules||!a.preserveValueImports||111551&n&&!i.getTypeOnlyAliasDeclaration(r)?1:2:4}function f(t,r){if(!e.isSourceFileJS(t))return !1;if(t.commonJsModuleIndicator&&!t.externalModuleIndicator)return !0;if(t.externalModuleIndicator&&!t.commonJsModuleIndicator)return !1;var n=r.getCompilerOptions();if(n.configFile)return e.getEmitModuleKind(n)<e.ModuleKind.ES2015;for(var i=0,a=r.getSourceFiles();i<a.length;i++){var o=a[i];if(o!==t&&e.isSourceFileJS(o)&&!r.isSourceFileFromExternalLibrary(o)){if(o.commonJsModuleIndicator&&!o.externalModuleIndicator)return !0;if(o.externalModuleIndicator&&!o.commonJsModuleIndicator)return !1}}return !0}function g(t,r,n,i,a,o,s,c,l){var u=e.isSourceFileJS(r),_=t.getCompilerOptions(),d=e.createModuleSpecifierResolutionHost(t,s),f=e.memoizeOne((function(e){return e?s.getPackageJsonAutoImportProvider().getTypeChecker():t.getTypeChecker()})),g=l?function(t){return {moduleSpecifiers:e.moduleSpecifiers.tryGetModuleSpecifiersFromCache(t,r,d,c),computedWithoutCache:!1}}:function(t,n){return e.moduleSpecifiers.getModuleSpecifiersWithCacheInfo(t,n,_,r,d,c)},m=0,y=e.flatMap(o,(function(e){var t=f(e.isFromPackageJson),o=g(e.moduleSymbol,t),s=o.computedWithoutCache,c=o.moduleSpecifiers,l=!!(111551&e.targetFlags),d=p(i,!0,e.symbol,e.targetFlags,t,_);return m+=s?1:0,null==c?void 0:c.map((function(t){return !l&&u&&void 0!==n?{kind:1,moduleSpecifier:t,position:n,exportInfo:e}:{kind:3,moduleSpecifier:t,importKind:h(r,e.exportKind,_),useRequire:a,addAsTypeOnly:d,exportInfo:e}}))}));return {computedWithoutCacheCount:m,fixes:y}}function m(t,r,n,a){var o,s,c,l,u,_,p=e.getTokenAtPosition(t.sourceFile,n),g=r===e.Diagnostics._0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead.code?function(t,r){var n=t.sourceFile,i=t.program,a=t.host,o=t.preferences,s=i.getTypeChecker(),c=function(t,r){var n=e.isIdentifier(t)?r.getSymbolAtLocation(t):void 0;if(e.isUMDExportSymbol(n))return n;var i=t.parent;return e.isJsxOpeningLikeElement(i)&&i.tagName===t||e.isJsxOpeningFragment(i)?e.tryCast(r.resolveName(r.getJsxNamespace(i),e.isJsxOpeningLikeElement(i)?t:i,111551,!1),e.isUMDExportSymbol):void 0}(r,s);if(c){var l=s.getAliasedSymbol(c),u=c.name,_=[{symbol:c,moduleSymbol:l,moduleFileName:void 0,exportKind:3,targetFlags:l.flags,isFromPackageJson:!1}],p=f(n,i);return {fixes:d(_,u,e.isIdentifier(r)?r.getStart(n):void 0,!1,p,i,n,a,o),symbolName:u}}}(t,p):e.isIdentifier(p)?function(t,r,n){var i=t.sourceFile,a=t.program,o=t.cancellationToken,s=t.host,c=t.preferences,l=a.getTypeChecker(),u=a.getCompilerOptions(),_=function(t,r,n,i){var a,o=n.parent;if((e.isJsxOpeningLikeElement(o)||e.isJsxClosingElement(o))&&o.tagName===n&&(2===(a=i.jsx)||3===a)){var s=r.getJsxNamespace(t);if(e.isIntrinsicJsxName(n.text)||!r.resolveName(s,o,111551,!0))return s}return n.text}(i,l,r,u);e.Debug.assert("default"!==_,"'default' isn't a legal identifier and couldn't occur here");var p=e.isValidTypeOnlyAliasUseSite(r),g=f(i,a),m=function(t,r,n,i,a,o,s,c){var l,u=e.createMultiMap(),_=e.createPackageJsonImportFilter(i,c,s),d=null===(l=s.getModuleSpecifierCache)||void 0===l?void 0:l.call(s),p=e.memoizeOne((function(t){return e.createModuleSpecifierResolutionHost(t?s.getPackageJsonAutoImportProvider():a,s)}));function f(t,r,n,a,o,s){var l=p(s);if(r&&e.isImportableFile(o,i,r,c,_,l,d)||!r&&_.allowsImportingAmbientModule(t,l)){var f=o.getTypeChecker();u.add(e.getUniqueSymbolId(n,f).toString(),{symbol:n,moduleSymbol:t,moduleFileName:null==r?void 0:r.fileName,exportKind:a,targetFlags:e.skipAlias(n,f).flags,isFromPackageJson:s});}}return e.forEachExternalModuleToImportFrom(a,s,o,(function(i,a,o,s){var c=o.getTypeChecker();n.throwIfCancellationRequested();var l=o.getCompilerOptions(),u=e.getDefaultLikeExportInfo(i,c,l);u&&(u.name===t||A(i,e.getEmitScriptTarget(l))===t)&&F(u.symbolForMeaning,r)&&f(i,a,u.symbol,u.exportKind,o,s);var _=c.tryGetMemberInModuleExportsAndProperties(t,i);_&&F(_,r)&&f(i,a,_,0,o,s);})),u}(_,e.getMeaningFromLocation(r),o,i,a,n,s,c);return {fixes:e.arrayFrom(e.flatMapIterator(m.entries(),(function(e){return d(e[1],_,r.getStart(i),p,g,a,i,s,c)}))),symbolName:_}}(t,p,a):void 0;return g&&i$1(i$1({},g),{fixes:(o=g.fixes,s=t.sourceFile,c=t.program,l=t.host,u=t.preferences,_=e.createPackageJsonImportFilter(s,u,l).allowsImportingSpecifier,e.sort(o,(function(t,r){return e.compareValues(t.kind,r.kind)||v(t,r,s,c,_)})))})}function y(t,r,n,i,a){if(e.some(t)){if(0===t[0].kind||2===t[0].kind)return t[0];var o=e.createPackageJsonImportFilter(r,a,i).allowsImportingSpecifier;return t.reduce((function(e,t){return -1===v(t,e,r,n,o)?t:e}))}}function v(t,r,n,i,a){return 0!==t.kind&&0!==r.kind?e.compareBooleans(a(r.moduleSpecifier),a(t.moduleSpecifier))||function(t,r,n,i){return e.startsWith(t,"node:")&&!e.startsWith(r,"node:")?e.shouldUseUriStyleNodeCoreModules(n,i)?-1:1:e.startsWith(r,"node:")&&!e.startsWith(t,"node:")?e.shouldUseUriStyleNodeCoreModules(n,i)?1:-1:0}(t.moduleSpecifier,r.moduleSpecifier,n,i)||e.compareNumberOfDirectorySeparators(t.moduleSpecifier,r.moduleSpecifier):0}function h(t,r,n,i){switch(r){case 0:return 0;case 1:return 1;case 2:return function(t,r,n){var i=e.getAllowSyntheticDefaultImports(r),a=e.isInJSFile(t);if(!a&&e.getEmitModuleKind(r)>=e.ModuleKind.ES2015)return i?1:2;if(a)return e.isExternalModule(t)||n?i?1:2:3;for(var o=0,s=t.statements;o<s.length;o++){var c=s[o];if(e.isImportEqualsDeclaration(c)&&!e.nodeIsMissing(c.moduleReference))return 3}return i?1:3}(t,n,!!i);case 3:return function(t,r,n){if(e.getAllowSyntheticDefaultImports(r))return 1;var i=e.getEmitModuleKind(r);switch(i){case e.ModuleKind.AMD:case e.ModuleKind.CommonJS:case e.ModuleKind.UMD:return e.isInJSFile(t)&&(e.isExternalModule(t)||n)?2:3;case e.ModuleKind.System:case e.ModuleKind.ES2015:case e.ModuleKind.ES2020:case e.ModuleKind.ES2022:case e.ModuleKind.ESNext:case e.ModuleKind.None:return 2;case e.ModuleKind.Node12:case e.ModuleKind.NodeNext:return t.impliedNodeFormat===e.ModuleKind.ESNext?2:3;default:return e.Debug.assertNever(i,"Unexpected moduleKind ".concat(i))}}(t,n,!!i);default:return e.Debug.assertNever(r)}}function b(r,n,i,a,s,c){var l,u=e.textChanges.ChangeTracker.with(r,(function(t){l=function(t,r,n,i,a,o){switch(i.kind){case 0:return D(t,r,i),[e.Diagnostics.Change_0_to_1,n,"".concat(i.namespacePrefix,".").concat(n)];case 1:return S(t,r,i,a),[e.Diagnostics.Change_0_to_1,n,T(i.moduleSpecifier,a)+n];case 2:var s=i.importClauseOrBindingPattern,c=i.importKind,l=i.addAsTypeOnly,u=i.moduleSpecifier;x(t,r,s,1===c?{name:n,addAsTypeOnly:l}:void 0,0===c?[{name:n,addAsTypeOnly:l}]:e.emptyArray,o);var _=e.stripQuotes(u);return [1===c?e.Diagnostics.Add_default_import_0_to_existing_import_declaration_from_1:e.Diagnostics.Add_0_to_existing_import_declaration_from_1,n,_];case 3:c=i.importKind,u=i.moduleSpecifier,l=i.addAsTypeOnly;var d=i.useRequire?k:E,p=1===c?{name:n,addAsTypeOnly:l}:void 0,f=0===c?[{name:n,addAsTypeOnly:l}]:void 0,g=2===c||3===c?{importKind:c,name:n,addAsTypeOnly:l}:void 0;return e.insertImports(t,r,d(u,a,p,f,g),!0),[1===c?e.Diagnostics.Import_default_0_from_module_1:e.Diagnostics.Import_0_from_module_1,n,u];default:return e.Debug.assertNever(i,"Unexpected fix kind ".concat(i.kind))}}(t,n,i,a,s,c);}));return t.createCodeFixAction(t.importFixName,u,l,o,e.Diagnostics.Add_all_missing_imports)}function x(t,r,i,a,o,s){var c;if(200!==i.kind){var l=i.isTypeOnly&&e.some(n$3([a],o,!0),(function(e){return 4===(null==e?void 0:e.addAsTypeOnly)})),u=i.namedBindings&&(null===(c=e.tryCast(i.namedBindings,e.isNamedImports))||void 0===c?void 0:c.elements),_=l&&s.preserveValueImports&&s.isolatedModules;if(a&&(e.Debug.assert(!i.name,"Cannot add a default import to an import clause that already has one"),t.insertNodeAt(r,i.getStart(r),e.factory.createIdentifier(a.name),{suffix:", "})),o.length){var d=e.stableSort(o.map((function(t){return e.factory.createImportSpecifier((!i.isTypeOnly||l)&&C(t),void 0,e.factory.createIdentifier(t.name))})),e.OrganizeImports.compareImportOrExportSpecifiers);if((null==u?void 0:u.length)&&e.OrganizeImports.importSpecifiersAreSorted(u))for(var p=0,f=d;p<f.length;p++){var g=f[p],m=_&&!g.isTypeOnly?0:e.OrganizeImports.getImportSpecifierInsertionIndex(u,g),y=i.namedBindings.elements[m-1];y?t.insertNodeInListAfter(r,y,g):t.insertNodeBefore(r,u[0],g,!e.positionsAreOnSameLine(u[0].getStart(),i.parent.getStart(),r));}else if(null==u?void 0:u.length)for(var v=0,h=d;v<h.length;v++)g=h[v],t.insertNodeInListAfter(r,e.last(u),g,u);else if(d.length){var b=e.factory.createNamedImports(d);i.namedBindings?t.replaceNode(r,i.namedBindings,b):t.insertNodeAfter(r,e.Debug.checkDefined(i.name,"Import clause must have either named imports or a default import"),b);}}if(l&&(t.delete(r,e.getTypeKeywordOfTypeOnlyImport(i,r)),_&&u))for(var x=0,D=u;x<D.length;x++)E=D[x],t.insertModifierBefore(r,151,E);}else {a&&k(i,a.name,"default");for(var S=0,T=o;S<T.length;S++){var E=T[S];k(i,E.name,void 0);}}function k(n,i,a){var o=e.factory.createBindingElement(void 0,a,i);n.elements.length?t.insertNodeInListAfter(r,e.last(n.elements),o):t.replaceNode(r,n,e.factory.createObjectBindingPattern([o]));}}function D(e,t,r){var n=r.namespacePrefix,i=r.position;e.insertText(t,i,n+".");}function S(e,t,r,n){var i=r.moduleSpecifier,a=r.position;e.insertText(t,a,T(i,n));}function T(t,r){var n=e.getQuoteFromPreference(r);return "import(".concat(n).concat(t).concat(n,").")}function C(e){return 2===e.addAsTypeOnly}function E(t,r,n,i,a){var o,s=e.makeStringLiteral(t,r);if(void 0!==n||(null==i?void 0:i.length)){var c=(!n||C(n))&&e.every(i,C);o=e.combine(o,e.makeImport(n&&e.factory.createIdentifier(n.name),null==i?void 0:i.map((function(t){var r=t.addAsTypeOnly,n=t.name;return e.factory.createImportSpecifier(!c&&2===r,void 0,e.factory.createIdentifier(n))})),t,r,c));}if(a){var l=3===a.importKind?e.factory.createImportEqualsDeclaration(void 0,void 0,C(a),e.factory.createIdentifier(a.name),e.factory.createExternalModuleReference(s)):e.factory.createImportDeclaration(void 0,void 0,e.factory.createImportClause(C(a),void 0,e.factory.createNamespaceImport(e.factory.createIdentifier(a.name))),s,void 0);o=e.combine(o,l);}return e.Debug.checkDefined(o)}function k(t,r,n,i,a){var o,s=e.makeStringLiteral(t,r);if(n||(null==i?void 0:i.length)){var c=(null==i?void 0:i.map((function(t){var r=t.name;return e.factory.createBindingElement(void 0,void 0,r)})))||[];n&&c.unshift(e.factory.createBindingElement(void 0,"default",n.name));var l=N(e.factory.createObjectBindingPattern(c),s);o=e.combine(o,l);}return a&&(l=N(a.name,s),o=e.combine(o,l)),e.Debug.checkDefined(o)}function N(t,r){return e.factory.createVariableStatement(void 0,e.factory.createVariableDeclarationList([e.factory.createVariableDeclaration("string"==typeof t?e.factory.createIdentifier(t):t,void 0,void 0,e.factory.createCallExpression(e.factory.createIdentifier("require"),void 0,[r]))],2))}function F(t,r){var n=t.declarations;return e.some(n,(function(t){return !!(e.getMeaningFromDeclaration(t)&r)}))}function A(t,r){return P(e.removeFileExtension(e.stripQuotes(t.name)),r)}function P(t,r){var n=e.getBaseFileName(e.removeSuffix(t,"/index")),i="",a=!0,o=n.charCodeAt(0);e.isIdentifierStart(o,r)?i+=String.fromCharCode(o):a=!1;for(var s=1;s<n.length;s++){var c=n.charCodeAt(s),l=e.isIdentifierPart(c,r);if(l){var u=String.fromCharCode(c);a||(u=u.toUpperCase()),i+=u;}a=l;}return e.isStringANonContextualKeyword(i)?"_".concat(i):i||"_"}t.registerCodeFix({errorCodes:s,getCodeActions:function(t){var r=t.errorCode,n=t.preferences,i=t.sourceFile,a=t.span,o=t.program,s=m(t,r,a.start,!0);if(s){var c=s.fixes,l=s.symbolName,u=e.getQuotePreference(i,n);return c.map((function(e){return b(t,i,l,e,u,o.getCompilerOptions())}))}},fixIds:[o],getAllCodeActions:function(r){var n=c(r.sourceFile,r.program,!0,r.preferences,r.host);return t.eachDiagnostic(r,s,(function(e){return n.addImportFromDiagnostic(e,r)})),t.createCombinedCodeActions(e.textChanges.ChangeTracker.with(r,n.writeFixes))}}),t.createImportAdder=function(e,t,r,n){return c(e,t,!1,r,n)},function(e){e[e.UseNamespace=0]="UseNamespace",e[e.JsdocTypeImport=1]="JsdocTypeImport",e[e.AddToExisting=2]="AddToExisting",e[e.AddNew=3]="AddNew";}(r||(r={})),function(e){e[e.Allowed=1]="Allowed",e[e.Required=2]="Required",e[e.NotAllowed=4]="NotAllowed";}(a||(a={})),t.getImportCompletionAction=function(t,r,n,i,a,o,s,c,d){var p,g,m,y,v=o.getCompilerOptions(),h=e.pathIsBareSpecifier(e.stripQuotes(r.name))?[u(t,r,o,a)]:_(n,t,r,i,a,o,d,!0),x=f(n,o),D=e.isValidTypeOnlyAliasUseSite(e.getTokenAtPosition(n,c)),S=e.Debug.checkDefined(l(n,h,r,i,o,c,D,x,a,d));return {moduleSpecifier:S.moduleSpecifier,codeAction:(p=b({host:a,formatContext:s,preferences:d},n,i,S,e.getQuotePreference(n,d),v),g=p.description,m=p.changes,y=p.commands,{description:g,changes:m,commands:y})}},t.getModuleSpecifierForBestExportInfo=function(e,t,r,n,a,o){var s=g(r,t,void 0,!1,!1,e,n,a,o),c=s.fixes,l=s.computedWithoutCacheCount,u=y(c,t,r,n,a);return u&&i$1(i$1({},u),{computedWithoutCacheCount:l})},t.getImportKind=h,t.moduleSymbolToValidIdentifier=A,t.moduleSpecifierToValidIdentifier=P;}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r,n="fixOverrideModifier",i="fixAddOverrideModifier",a="fixRemoveOverrideModifier",o=[e.Diagnostics.This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0.code,e.Diagnostics.This_member_cannot_have_an_override_modifier_because_its_containing_class_0_does_not_extend_another_class.code,e.Diagnostics.This_member_must_have_an_override_modifier_because_it_overrides_an_abstract_method_that_is_declared_in_the_base_class_0.code,e.Diagnostics.This_member_must_have_an_override_modifier_because_it_overrides_a_member_in_the_base_class_0.code,e.Diagnostics.This_parameter_property_must_have_an_override_modifier_because_it_overrides_a_member_in_base_class_0.code],s=((r={})[e.Diagnostics.This_member_must_have_an_override_modifier_because_it_overrides_a_member_in_the_base_class_0.code]=[e.Diagnostics.Add_override_modifier,i,e.Diagnostics.Add_all_missing_override_modifiers],r[e.Diagnostics.This_member_cannot_have_an_override_modifier_because_its_containing_class_0_does_not_extend_another_class.code]=[e.Diagnostics.Remove_override_modifier,a,e.Diagnostics.Remove_all_unnecessary_override_modifiers],r[e.Diagnostics.This_parameter_property_must_have_an_override_modifier_because_it_overrides_a_member_in_base_class_0.code]=[e.Diagnostics.Add_override_modifier,i,e.Diagnostics.Add_all_missing_override_modifiers],r[e.Diagnostics.This_member_must_have_an_override_modifier_because_it_overrides_an_abstract_method_that_is_declared_in_the_base_class_0.code]=[e.Diagnostics.Add_override_modifier,i,e.Diagnostics.Remove_all_unnecessary_override_modifiers],r[e.Diagnostics.This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0.code]=[e.Diagnostics.Remove_override_modifier,a,e.Diagnostics.Remove_all_unnecessary_override_modifiers],r);function c(t,r,n,i){switch(n){case e.Diagnostics.This_member_must_have_an_override_modifier_because_it_overrides_a_member_in_the_base_class_0.code:case e.Diagnostics.This_member_must_have_an_override_modifier_because_it_overrides_an_abstract_method_that_is_declared_in_the_base_class_0.code:case e.Diagnostics.This_parameter_property_must_have_an_override_modifier_because_it_overrides_a_member_in_base_class_0.code:return function(t,r,n){var i=u(r,n),a=i.modifiers||e.emptyArray,o=e.find(a,e.isStaticModifier),s=e.find(a,e.isAbstractModifier),c=e.find(a,(function(t){return e.isAccessibilityModifier(t.kind)})),l=s?s.end:o?o.end:c?c.end:i.decorators?e.skipTrivia(r.text,i.decorators.end):i.getStart(r),_=c||o||s?{prefix:" "}:{suffix:" "};t.insertModifierAt(r,l,158,_);}(t,r.sourceFile,i);case e.Diagnostics.This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0.code:case e.Diagnostics.This_member_cannot_have_an_override_modifier_because_its_containing_class_0_does_not_extend_another_class.code:return function(t,r,n){var i=u(r,n),a=i.modifiers&&e.find(i.modifiers,(function(e){return 158===e.kind}));e.Debug.assertIsDefined(a),t.deleteModifier(r,a);}(t,r.sourceFile,i);default:e.Debug.fail("Unexpected error code: "+n);}}function l(t){switch(t.kind){case 170:case 166:case 168:case 171:case 172:return !0;case 163:return e.isParameterPropertyDeclaration(t,t.parent);default:return !1}}function u(t,r){var n=e.getTokenAtPosition(t,r),i=e.findAncestor(n,(function(t){return e.isClassLike(t)?"quit":l(t)}));return e.Debug.assert(i&&l(i)),i}t.registerCodeFix({errorCodes:o,getCodeActions:function(r){var i=r.errorCode,a=r.span,o=r.sourceFile,l=s[i];if(!l)return e.emptyArray;var u=l[0],_=l[1],d=l[2];if(e.isSourceFileJS(o))return e.emptyArray;var p=e.textChanges.ChangeTracker.with(r,(function(e){return c(e,r,i,a.start)}));return [t.createCodeFixActionMaybeFixAll(n,p,u,_,d)]},fixIds:[n,i,a],getAllCodeActions:function(r){return t.codeFixAll(r,o,(function(t,n){var i=n.code,a=n.start,o=n.file,l=s[i];l&&l[1]===r.fixId&&!e.isSourceFileJS(o)&&c(t,r,i,a);}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="fixNoPropertyAccessFromIndexSignature",n=[e.Diagnostics.Property_0_comes_from_an_index_signature_so_it_must_be_accessed_with_0.code];function i(t,r,n,i){var a=e.getQuotePreference(r,i),o=e.factory.createStringLiteral(n.name.text,0===a);t.replaceNode(r,n,e.isPropertyAccessChain(n)?e.factory.createElementAccessChain(n.expression,n.questionDotToken,o):e.factory.createElementAccessExpression(n.expression,o));}function a(t,r){return e.cast(e.getTokenAtPosition(t,r).parent,e.isPropertyAccessExpression)}t.registerCodeFix({errorCodes:n,fixIds:[r],getCodeActions:function(n){var o=n.sourceFile,s=n.span,c=n.preferences,l=a(o,s.start),u=e.textChanges.ChangeTracker.with(n,(function(e){return i(e,n.sourceFile,l,c)}));return [t.createCodeFixAction(r,u,[e.Diagnostics.Use_element_access_for_0,l.name.text],r,e.Diagnostics.Use_element_access_for_all_undeclared_properties)]},getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(t,r){return i(t,r.file,a(r.file,r.start),e.preferences)}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="fixImplicitThis",n=[e.Diagnostics.this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation.code];function i(t,r,n,i){var a=e.getTokenAtPosition(r,n);e.Debug.assert(108===a.kind);var o=e.getThisContainer(a,!1);if((e.isFunctionDeclaration(o)||e.isFunctionExpression(o))&&!e.isSourceFile(e.getThisContainer(o,!1))){var s=e.Debug.assertDefined(e.findChildOfKind(o,98,r)),c=o.name,l=e.Debug.assertDefined(o.body);if(e.isFunctionExpression(o)){if(c&&e.FindAllReferences.Core.isSymbolReferencedInFile(c,i,r,l))return;return t.delete(r,s),c&&t.delete(r,c),t.insertText(r,l.pos," =>"),[e.Diagnostics.Convert_function_expression_0_to_arrow_function,c?c.text:e.ANONYMOUS]}return t.replaceNode(r,s,e.factory.createToken(85)),t.insertText(r,c.end," = "),t.insertText(r,l.pos," =>"),[e.Diagnostics.Convert_function_declaration_0_to_arrow_function,c.text]}}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var a,o=n.sourceFile,s=n.program,c=n.span,l=e.textChanges.ChangeTracker.with(n,(function(e){a=i(e,o,c.start,s.getTypeChecker());}));return a?[t.createCodeFixAction(r,l,a,r,e.Diagnostics.Fix_all_implicit_this_errors)]:e.emptyArray},fixIds:[r],getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(t,r){i(t,r.file,r.start,e.program.getTypeChecker());}))}});}(e.codefix||(e.codefix={}));}(t),function(e){var t,r,n;t=e.codefix||(e.codefix={}),r="fixIncorrectNamedTupleSyntax",n=[e.Diagnostics.A_labeled_tuple_element_is_declared_as_optional_with_a_question_mark_after_the_name_and_before_the_colon_rather_than_after_the_type.code,e.Diagnostics.A_labeled_tuple_element_is_declared_as_rest_with_a_before_the_name_rather_than_before_the_type.code],t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var i=n.sourceFile,a=n.span,o=function(t,r){var n=e.getTokenAtPosition(t,r);return e.findAncestor(n,(function(e){return 196===e.kind}))}(i,a.start),s=e.textChanges.ChangeTracker.with(n,(function(t){return function(t,r,n){if(n){for(var i=n.type,a=!1,o=!1;184===i.kind||185===i.kind||190===i.kind;)184===i.kind?a=!0:185===i.kind&&(o=!0),i=i.type;var s=e.factory.updateNamedTupleMember(n,n.dotDotDotToken||(o?e.factory.createToken(25):void 0),n.name,n.questionToken||(a?e.factory.createToken(57):void 0),i);s!==n&&t.replaceNode(r,n,s);}}(t,i,o)}));return [t.createCodeFixAction(r,s,e.Diagnostics.Move_labeled_tuple_element_modifiers_to_labels,r,e.Diagnostics.Move_labeled_tuple_element_modifiers_to_labels)]},fixIds:[r]});}(t),function(e){!function(t){var r="fixSpelling",n=[e.Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2.code,e.Diagnostics.Property_0_may_not_exist_on_type_1_Did_you_mean_2.code,e.Diagnostics.Cannot_find_name_0_Did_you_mean_1.code,e.Diagnostics.Could_not_find_name_0_Did_you_mean_1.code,e.Diagnostics.Cannot_find_namespace_0_Did_you_mean_1.code,e.Diagnostics.Cannot_find_name_0_Did_you_mean_the_instance_member_this_0.code,e.Diagnostics.Cannot_find_name_0_Did_you_mean_the_static_member_1_0.code,e.Diagnostics._0_has_no_exported_member_named_1_Did_you_mean_2.code,e.Diagnostics.This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1.code,e.Diagnostics.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1.code,e.Diagnostics.No_overload_matches_this_call.code,e.Diagnostics.Type_0_is_not_assignable_to_type_1.code];function i(t,r,n,i){var a=e.getTokenAtPosition(t,r),o=a.parent;if(i!==e.Diagnostics.No_overload_matches_this_call.code&&i!==e.Diagnostics.Type_0_is_not_assignable_to_type_1.code||e.isJsxAttribute(o)){var s,c=n.program.getTypeChecker();if(e.isPropertyAccessExpression(o)&&o.name===a){e.Debug.assert(e.isMemberName(a),"Expected an identifier for spelling (property access)");var l=c.getTypeAtLocation(o.expression);32&o.flags&&(l=c.getNonNullableType(l)),s=c.getSuggestedSymbolForNonexistentProperty(a,l);}else if(e.isBinaryExpression(o)&&101===o.operatorToken.kind&&o.left===a&&e.isPrivateIdentifier(a)){var u=c.getTypeAtLocation(o.right);s=c.getSuggestedSymbolForNonexistentProperty(a,u);}else if(e.isQualifiedName(o)&&o.right===a){var _=c.getSymbolAtLocation(o.left);_&&1536&_.flags&&(s=c.getSuggestedSymbolForNonexistentModule(o.right,_));}else if(e.isImportSpecifier(o)&&o.name===a){e.Debug.assertNode(a,e.isIdentifier,"Expected an identifier for spelling (import)");var d=function(t,r,n){if(n&&e.isStringLiteralLike(n.moduleSpecifier)){var i=e.getResolvedModule(t,n.moduleSpecifier.text,e.getModeForUsageLocation(t,n.moduleSpecifier));return i?r.program.getSourceFile(i.resolvedFileName):void 0}}(t,n,e.findAncestor(a,e.isImportDeclaration));d&&d.symbol&&(s=c.getSuggestedSymbolForNonexistentModule(a,d.symbol));}else if(e.isJsxAttribute(o)&&o.name===a){e.Debug.assertNode(a,e.isIdentifier,"Expected an identifier for JSX attribute");var p=e.findAncestor(a,e.isJsxOpeningLikeElement),f=c.getContextualTypeForArgumentAtIndex(p,0);s=c.getSuggestedSymbolForNonexistentJSXAttribute(a,f);}else if(e.hasSyntacticModifier(o,16384)&&e.isClassElement(o)&&o.name===a){var g=e.findAncestor(a,e.isClassLike),m=g?e.getEffectiveBaseTypeNode(g):void 0,y=m?c.getTypeAtLocation(m):void 0;y&&(s=c.getSuggestedSymbolForNonexistentClassMember(e.getTextOfNode(a),y));}else {var v=e.getMeaningFromLocation(a),h=e.getTextOfNode(a);e.Debug.assert(void 0!==h,"name should be defined"),s=c.getSuggestedSymbolForNonexistentSymbol(a,h,function(e){var t=0;return 4&e&&(t|=1920),2&e&&(t|=788968),1&e&&(t|=111551),t}(v));}return void 0===s?void 0:{node:a,suggestedSymbol:s}}}function a(t,r,n,i,a){var o=e.symbolName(i);if(!e.isIdentifierText(o,a)&&e.isPropertyAccessExpression(n.parent)){var s=i.valueDeclaration;s&&e.isNamedDeclaration(s)&&e.isPrivateIdentifier(s.name)?t.replaceNode(r,n,e.factory.createIdentifier(o)):t.replaceNode(r,n.parent,e.factory.createElementAccessExpression(n.parent.expression,e.factory.createStringLiteral(o)));}else t.replaceNode(r,n,e.factory.createIdentifier(o));}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var o=n.sourceFile,s=n.errorCode,c=i(o,n.span.start,n,s);if(c){var l=c.node,u=c.suggestedSymbol,_=e.getEmitScriptTarget(n.host.getCompilationSettings()),d=e.textChanges.ChangeTracker.with(n,(function(e){return a(e,o,l,u,_)}));return [t.createCodeFixAction("spelling",d,[e.Diagnostics.Change_spelling_to_0,e.symbolName(u)],r,e.Diagnostics.Fix_all_detected_spelling_errors)]}},fixIds:[r],getAllCodeActions:function(r){return t.codeFixAll(r,n,(function(t,n){var o=i(n.file,n.start,r,n.code),s=e.getEmitScriptTarget(r.host.getCompilationSettings());o&&a(t,r.sourceFile,o.node,o.suggestedSymbol,s);}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r,n="returnValueCorrect",i="fixAddReturnStatement",a="fixRemoveBracesFromArrowFunctionBody",o="fixWrapTheBlockWithParen",s=[e.Diagnostics.A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value.code,e.Diagnostics.Type_0_is_not_assignable_to_type_1.code,e.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code];function c(t,r,n){var i=t.createSymbol(4,r.escapedText);i.type=t.getTypeAtLocation(n);var a=e.createSymbolTable([i]);return t.createAnonymousType(void 0,a,[],[],[])}function l(t,n,i,a){if(n.body&&e.isBlock(n.body)&&1===e.length(n.body.statements)){var o=e.first(n.body.statements);if(e.isExpressionStatement(o)&&u(t,n,t.getTypeAtLocation(o.expression),i,a))return {declaration:n,kind:r.MissingReturnStatement,expression:o.expression,statement:o,commentSource:o.expression};if(e.isLabeledStatement(o)&&e.isExpressionStatement(o.statement)){var s=e.factory.createObjectLiteralExpression([e.factory.createPropertyAssignment(o.label,o.statement.expression)]);if(u(t,n,c(t,o.label,o.statement.expression),i,a))return e.isArrowFunction(n)?{declaration:n,kind:r.MissingParentheses,expression:s,statement:o,commentSource:o.statement.expression}:{declaration:n,kind:r.MissingReturnStatement,expression:s,statement:o,commentSource:o.statement.expression}}else if(e.isBlock(o)&&1===e.length(o.statements)){var l=e.first(o.statements);if(e.isLabeledStatement(l)&&e.isExpressionStatement(l.statement)&&(s=e.factory.createObjectLiteralExpression([e.factory.createPropertyAssignment(l.label,l.statement.expression)]),u(t,n,c(t,l.label,l.statement.expression),i,a)))return {declaration:n,kind:r.MissingReturnStatement,expression:s,statement:o,commentSource:l}}}}function u(t,r,n,i,a){if(a){var o=t.getSignatureFromDeclaration(r);if(o){e.hasSyntacticModifier(r,256)&&(n=t.createPromiseType(n));var s=t.createSignature(r,o.typeParameters,o.thisParameter,o.parameters,n,void 0,o.minArgumentCount,o.flags);n=t.createAnonymousType(void 0,e.createSymbolTable(),[s],[],[]);}else n=t.getAnyType();}return t.isTypeAssignableTo(n,i)}function _(t,r,n,i){var a=e.getTokenAtPosition(r,n);if(a.parent){var o=e.findAncestor(a.parent,e.isFunctionLikeDeclaration);switch(i){case e.Diagnostics.A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value.code:if(!(o&&o.body&&o.type&&e.rangeContainsRange(o.type,a)))return;return l(t,o,t.getTypeFromTypeNode(o.type),!1);case e.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code:if(!o||!e.isCallExpression(o.parent)||!o.body)return;var s=o.parent.arguments.indexOf(o),c=t.getContextualTypeForArgumentAtIndex(o.parent,s);if(!c)return;return l(t,o,c,!0);case e.Diagnostics.Type_0_is_not_assignable_to_type_1.code:if(!e.isDeclarationName(a)||!e.isVariableLike(a.parent)&&!e.isJsxAttribute(a.parent))return;var u=function(t){switch(t.kind){case 253:case 163:case 202:case 166:case 294:return t.initializer;case 284:return t.initializer&&(e.isJsxExpression(t.initializer)?t.initializer.expression:void 0);case 295:case 165:case 297:case 345:case 338:return}}(a.parent);if(!u||!e.isFunctionLikeDeclaration(u)||!u.body)return;return l(t,u,t.getTypeAtLocation(a.parent),!0)}}}function d(t,r,n,i){e.suppressLeadingAndTrailingTrivia(n);var a=e.probablyUsesSemicolons(r);t.replaceNode(r,i,e.factory.createReturnStatement(n),{leadingTriviaOption:e.textChanges.LeadingTriviaOption.Exclude,trailingTriviaOption:e.textChanges.TrailingTriviaOption.Exclude,suffix:a?";":void 0});}function p(t,r,n,i,a,o){var s=o||e.needsParentheses(i)?e.factory.createParenthesizedExpression(i):i;e.suppressLeadingAndTrailingTrivia(a),e.copyComments(a,s),t.replaceNode(r,n.body,s);}function f(t,r,n,i){t.replaceNode(r,n.body,e.factory.createParenthesizedExpression(i));}function g(r,a,o){var s=e.textChanges.ChangeTracker.with(r,(function(e){return d(e,r.sourceFile,a,o)}));return t.createCodeFixAction(n,s,e.Diagnostics.Add_a_return_statement,i,e.Diagnostics.Add_all_missing_return_statement)}function m(r,i,a){var s=e.textChanges.ChangeTracker.with(r,(function(e){return f(e,r.sourceFile,i,a)}));return t.createCodeFixAction(n,s,e.Diagnostics.Wrap_the_following_body_with_parentheses_which_should_be_an_object_literal,o,e.Diagnostics.Wrap_all_object_literal_with_parentheses)}!function(e){e[e.MissingReturnStatement=0]="MissingReturnStatement",e[e.MissingParentheses=1]="MissingParentheses";}(r||(r={})),t.registerCodeFix({errorCodes:s,fixIds:[i,a,o],getCodeActions:function(i){var o=i.program,s=i.sourceFile,c=i.span.start,l=i.errorCode,u=_(o.getTypeChecker(),s,c,l);if(u)return u.kind===r.MissingReturnStatement?e.append([g(i,u.expression,u.statement)],e.isArrowFunction(u.declaration)?function(r,i,o,s){var c=e.textChanges.ChangeTracker.with(r,(function(e){return p(e,r.sourceFile,i,o,s,!1)}));return t.createCodeFixAction(n,c,e.Diagnostics.Remove_braces_from_arrow_function_body,a,e.Diagnostics.Remove_braces_from_all_arrow_function_bodies_with_relevant_issues)}(i,u.declaration,u.expression,u.commentSource):void 0):[m(i,u.declaration,u.expression)]},getAllCodeActions:function(r){return t.codeFixAll(r,s,(function(t,n){var s=_(r.program.getTypeChecker(),n.file,n.start,n.code);if(s)switch(r.fixId){case i:d(t,n.file,s.expression,s.statement);break;case a:if(!e.isArrowFunction(s.declaration))return;p(t,n.file,s.declaration,s.expression,s.commentSource,!1);break;case o:if(!e.isArrowFunction(s.declaration))return;f(t,n.file,s.declaration,s.expression);break;default:e.Debug.fail(JSON.stringify(r.fixId));}}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r,i="fixMissingMember",a="fixMissingProperties",o="fixMissingAttributes",s="fixMissingFunctionDeclaration",c=[e.Diagnostics.Property_0_does_not_exist_on_type_1.code,e.Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2.code,e.Diagnostics.Property_0_is_missing_in_type_1_but_required_in_type_2.code,e.Diagnostics.Type_0_is_missing_the_following_properties_from_type_1_Colon_2.code,e.Diagnostics.Type_0_is_missing_the_following_properties_from_type_1_Colon_2_and_3_more.code,e.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code,e.Diagnostics.Cannot_find_name_0.code];function l(t,r,n,i,a){var o=e.getTokenAtPosition(t,r),s=o.parent;if(n===e.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code){if(18!==o.kind||!e.isObjectLiteralExpression(s)||!e.isCallExpression(s.parent))return;var c=e.findIndex(s.parent.arguments,(function(e){return e===s}));if(c<0)return;var l=e.singleOrUndefined(i.getSignaturesOfType(i.getTypeAtLocation(s.parent.expression),0));if(!(l&&l.declaration&&l.parameters[c]))return;var _=l.parameters[c].valueDeclaration;if(!(_&&e.isParameter(_)&&e.isIdentifier(_.name)))return;var d=e.arrayFrom(i.getUnmatchedProperties(i.getTypeAtLocation(s),i.getTypeAtLocation(_),!1,!1));if(!e.length(d))return;return {kind:3,token:_.name,properties:d,indentation:0,parentDeclaration:s}}if(e.isMemberName(o)){if(e.isIdentifier(o)&&e.hasInitializer(s)&&s.initializer&&e.isObjectLiteralExpression(s.initializer)){if(d=e.arrayFrom(i.getUnmatchedProperties(i.getTypeAtLocation(s.initializer),i.getTypeAtLocation(o),!1,!1)),!e.length(d))return;return {kind:3,token:o,properties:d,indentation:void 0,parentDeclaration:s.initializer}}if(e.isIdentifier(o)&&e.isJsxOpeningLikeElement(o.parent)){var p=function(t,r){var n=t.getContextualType(r.attributes);if(void 0===n)return e.emptyArray;var i=n.getProperties();if(!e.length(i))return e.emptyArray;for(var a=new e.Set,o=0,s=r.attributes.properties;o<s.length;o++){var c=s[o];if(e.isJsxAttribute(c)&&a.add(c.name.escapedText),e.isJsxSpreadAttribute(c))for(var l=0,u=t.getTypeAtLocation(c.expression).getProperties();l<u.length;l++){var _=u[l];a.add(_.escapedName);}}return e.filter(i,(function(t){return !(16777216&t.flags||48&e.getCheckFlags(t)||a.has(t.escapedName))}))}(i,o.parent);if(!e.length(p))return;return {kind:4,token:o,attributes:p,parentDeclaration:o.parent}}if(e.isIdentifier(o)&&e.isCallExpression(s))return {kind:2,token:o,call:s,sourceFile:t,modifierFlags:0,parentDeclaration:t};if(e.isPropertyAccessExpression(s)){var f=e.skipConstraint(i.getTypeAtLocation(s.expression)),g=f.symbol;if(g&&g.declarations){if(e.isIdentifier(o)&&e.isCallExpression(s.parent)){var m=e.find(g.declarations,e.isModuleDeclaration),y=null==m?void 0:m.getSourceFile();if(m&&y&&!u(a,y))return {kind:2,token:o,call:s.parent,sourceFile:t,modifierFlags:1,parentDeclaration:m};var v=e.find(g.declarations,e.isSourceFile);if(t.commonJsModuleIndicator)return;if(v&&!u(a,v))return {kind:2,token:o,call:s.parent,sourceFile:v,modifierFlags:1,parentDeclaration:v}}var h=e.find(g.declarations,e.isClassLike);if(h||!e.isPrivateIdentifier(o)){var b=h||e.find(g.declarations,e.isInterfaceDeclaration);if(b&&!u(a,b.getSourceFile())){var x=(f.target||f)!==i.getDeclaredTypeOfSymbol(g);if(x&&(e.isPrivateIdentifier(o)||e.isInterfaceDeclaration(b)))return;var D=b.getSourceFile(),S=(x?32:0)|(e.startsWithUnderscore(o.text)?8:0),T=e.isSourceFileJS(D);return {kind:1,token:o,call:e.tryCast(s.parent,e.isCallExpression),modifierFlags:S,parentDeclaration:b,declSourceFile:D,isJSFile:T}}var C=e.find(g.declarations,e.isEnumDeclaration);return !C||e.isPrivateIdentifier(o)||u(a,C.getSourceFile())?void 0:{kind:0,token:o,parentDeclaration:C}}}}}}function u(e,t){return e.isSourceFileFromExternalLibrary(t)||e.isSourceFileDefaultLibrary(t)}function _(t,r,n,i,a){var o=i.text;if(a){if(225===n.kind)return;var s=n.name.getText(),c=d(e.factory.createIdentifier(s),o);t.insertNodeAfter(r,n,c);}else if(e.isPrivateIdentifier(i)){var l=e.factory.createPropertyDeclaration(void 0,void 0,o,void 0,void 0,void 0),u=g(n);u?t.insertNodeAfter(r,u,l):t.insertNodeAtClassStart(r,n,l);}else {var _=e.getFirstConstructorWithBody(n);if(!_)return;var p=d(e.factory.createThis(),o);t.insertNodeAtConstructorEnd(r,_,p);}}function d(t,r){return e.factory.createExpressionStatement(e.factory.createAssignment(e.factory.createPropertyAccessExpression(t,r),D()))}function p(t,r,n){var i;if(220===n.parent.parent.kind){var a=n.parent.parent,o=n.parent===a.left?a.right:a.left,s=t.getWidenedType(t.getBaseTypeOfLiteralType(t.getTypeAtLocation(o)));i=t.typeToTypeNode(s,r,1);}else {var c=t.getContextualType(n.parent);i=c?t.typeToTypeNode(c,void 0,1):void 0;}return i||e.factory.createKeywordTypeNode(130)}function f(t,r,n,i,a,o){var s=e.factory.createPropertyDeclaration(void 0,o?e.factory.createNodeArray(e.factory.createModifiersFromModifierFlags(o)):void 0,i,void 0,a,void 0),c=g(n);c?t.insertNodeAfter(r,c,s):t.insertNodeAtClassStart(r,n,s);}function g(t){for(var r,n=0,i=t.members;n<i.length;n++){var a=i[n];if(!e.isPropertyDeclaration(a))break;r=a;}return r}function m(r,n,i,a,o,s,c){var l=t.createImportAdder(c,r.program,r.preferences,r.host),u=t.createSignatureDeclarationFromCallExpression(168,r,l,i,a,o,s),_=e.findAncestor(i,(function(t){return e.isMethodDeclaration(t)||e.isConstructorDeclaration(t)}));_&&_.parent===s?n.insertNodeAfter(c,_,u):n.insertNodeAtClassStart(c,s,u),l.writeFixes(n);}function y(t,r,n){var i=n.token,a=n.parentDeclaration,o=e.some(a.members,(function(e){var t=r.getTypeAtLocation(e);return !!(t&&402653316&t.flags)})),s=e.factory.createEnumMember(i,o?e.factory.createStringLiteral(i.text):void 0);t.replaceNode(a.getSourceFile(),a,e.factory.updateEnumDeclaration(a,a.decorators,a.modifiers,a.name,e.concatenate(a.members,e.singleElementArray(s))),{leadingTriviaOption:e.textChanges.LeadingTriviaOption.IncludeAll,trailingTriviaOption:e.textChanges.TrailingTriviaOption.Exclude});}function v(r,n,i){var a=t.createImportAdder(n.sourceFile,n.program,n.preferences,n.host),o=t.createSignatureDeclarationFromCallExpression(255,n,a,i.call,e.idText(i.token),i.modifierFlags,i.parentDeclaration);r.insertNodeAtEndOfScope(i.sourceFile,i.parentDeclaration,o);}function h(r,i,a){var o=t.createImportAdder(i.sourceFile,i.program,i.preferences,i.host),s=e.getQuotePreference(i.sourceFile,i.preferences),c=i.program.getTypeChecker(),l=a.parentDeclaration.attributes,u=e.some(l.properties,e.isJsxSpreadAttribute),_=e.map(a.attributes,(function(t){var r=t.valueDeclaration?x(i,c,o,s,c.getTypeAtLocation(t.valueDeclaration)):D();return e.factory.createJsxAttribute(e.factory.createIdentifier(t.name),e.factory.createJsxExpression(void 0,r))})),d=e.factory.createJsxAttributes(u?n$3(n$3([],_,!0),l.properties,!0):n$3(n$3([],l.properties,!0),_,!0)),p={prefix:l.pos===l.end?" ":void 0};r.replaceNode(i.sourceFile,l,d,p);}function b(r,i,a){var o=t.createImportAdder(i.sourceFile,i.program,i.preferences,i.host),s=e.getQuotePreference(i.sourceFile,i.preferences),c=i.program.getTypeChecker(),l=e.map(a.properties,(function(t){var r=t.valueDeclaration?x(i,c,o,s,c.getTypeAtLocation(t.valueDeclaration)):D();return e.factory.createPropertyAssignment(t.name,r)})),u={leadingTriviaOption:e.textChanges.LeadingTriviaOption.Exclude,trailingTriviaOption:e.textChanges.TrailingTriviaOption.Exclude,indentation:a.indentation};r.replaceNode(i.sourceFile,a.parentDeclaration,e.factory.createObjectLiteralExpression(n$3(n$3([],a.parentDeclaration.properties,!0),l,!0),!0),u);}function x(r,n,i,a,o){if(3&o.flags)return D();if(134217732&o.flags)return e.factory.createStringLiteral("",0===a);if(8&o.flags)return e.factory.createNumericLiteral(0);if(64&o.flags)return e.factory.createBigIntLiteral("0n");if(16&o.flags)return e.factory.createFalse();if(1056&o.flags){var s=o.symbol.exports?e.firstOrUndefined(e.arrayFrom(o.symbol.exports.values())):o.symbol,c=n.symbolToExpression(o.symbol.parent?o.symbol.parent:o.symbol,111551,void 0,void 0);return void 0===s||void 0===c?e.factory.createNumericLiteral(0):e.factory.createPropertyAccessExpression(c,n.symbolToString(s))}if(256&o.flags)return e.factory.createNumericLiteral(o.value);if(2048&o.flags)return e.factory.createBigIntLiteral(o.value);if(128&o.flags)return e.factory.createStringLiteral(o.value,0===a);if(512&o.flags)return o===n.getFalseType()||o===n.getFalseType(!0)?e.factory.createFalse():e.factory.createTrue();if(65536&o.flags)return e.factory.createNull();if(1048576&o.flags){var l=e.firstDefined(o.types,(function(e){return x(r,n,i,a,e)}));return null!=l?l:D()}if(n.isArrayLikeType(o))return e.factory.createArrayLiteralExpression();if(function(t){return 524288&t.flags&&(128&e.getObjectFlags(t)||t.symbol&&e.tryCast(e.singleOrUndefined(t.symbol.declarations),e.isTypeLiteralNode))}(o)){var u=e.map(n.getPropertiesOfType(o),(function(t){var o=t.valueDeclaration?x(r,n,i,a,n.getTypeAtLocation(t.valueDeclaration)):D();return e.factory.createPropertyAssignment(t.name,o)}));return e.factory.createObjectLiteralExpression(u,!0)}if(16&e.getObjectFlags(o)){if(void 0===e.find(o.symbol.declarations||e.emptyArray,e.or(e.isFunctionTypeNode,e.isMethodSignature,e.isMethodDeclaration)))return D();var _=n.getSignaturesOfType(o,0);if(void 0===_)return D();var d=t.createSignatureDeclarationFromSignature(212,r,a,_[0],t.createStubbedBody(e.Diagnostics.Function_not_implemented.message,a),void 0,void 0,void 0,void 0,i);return null!=d?d:D()}if(1&e.getObjectFlags(o)){var p=e.getClassLikeDeclarationOfSymbol(o.symbol);if(void 0===p||e.hasAbstractModifier(p))return D();var f=e.getFirstConstructorWithBody(p);return f&&e.length(f.parameters)?D():e.factory.createNewExpression(e.factory.createIdentifier(o.symbol.name),void 0,void 0)}return D()}function D(){return e.factory.createIdentifier("undefined")}t.registerCodeFix({errorCodes:c,getCodeActions:function(r){var n=r.program.getTypeChecker(),c=l(r.sourceFile,r.span.start,r.errorCode,n,r.program);if(c){if(3===c.kind){var u=e.textChanges.ChangeTracker.with(r,(function(e){return b(e,r,c)}));return [t.createCodeFixAction(a,u,e.Diagnostics.Add_missing_properties,a,e.Diagnostics.Add_all_missing_properties)]}return 4===c.kind?(u=e.textChanges.ChangeTracker.with(r,(function(e){return h(e,r,c)})),[t.createCodeFixAction(o,u,e.Diagnostics.Add_missing_attributes,o,e.Diagnostics.Add_all_missing_attributes)]):2===c.kind?(u=e.textChanges.ChangeTracker.with(r,(function(e){return v(e,r,c)})),[t.createCodeFixAction(s,u,[e.Diagnostics.Add_missing_function_declaration_0,c.token.text],s,e.Diagnostics.Add_all_missing_function_declarations)]):0===c.kind?(u=e.textChanges.ChangeTracker.with(r,(function(e){return y(e,r.program.getTypeChecker(),c)})),[t.createCodeFixAction(i,u,[e.Diagnostics.Add_missing_enum_member_0,c.token.text],i,e.Diagnostics.Add_all_missing_members)]):e.concatenate(function(r,n){var a=n.parentDeclaration,o=n.declSourceFile,s=n.modifierFlags,c=n.token,l=n.call;if(void 0!==l&&!e.isPrivateIdentifier(c)){var u=c.text,_=function(t){return e.textChanges.ChangeTracker.with(r,(function(e){return m(r,e,l,c,t,a,o)}))},d=[t.createCodeFixAction(i,_(32&s),[32&s?e.Diagnostics.Declare_static_method_0:e.Diagnostics.Declare_method_0,u],i,e.Diagnostics.Add_all_missing_members)];return 8&s&&d.unshift(t.createCodeFixActionWithoutFixAll(i,_(8),[e.Diagnostics.Declare_private_method_0,u])),d}}(r,c),function(r,n){return n.isJSFile?e.singleElementArray(function(r,n){var a=n.parentDeclaration,o=n.declSourceFile,s=n.modifierFlags,c=n.token;if(!e.isInterfaceDeclaration(a)){var l=e.textChanges.ChangeTracker.with(r,(function(e){return _(e,o,a,c,!!(32&s))}));if(0!==l.length){var u=32&s?e.Diagnostics.Initialize_static_property_0:e.isPrivateIdentifier(c)?e.Diagnostics.Declare_a_private_field_named_0:e.Diagnostics.Initialize_property_0_in_the_constructor;return t.createCodeFixAction(i,l,[u,c.text],i,e.Diagnostics.Add_all_missing_members)}}}(r,n)):function(r,n){var a=n.parentDeclaration,o=n.declSourceFile,s=n.modifierFlags,c=n.token,l=c.text,u=32&s,_=p(r.program.getTypeChecker(),a,c),d=function(t){return e.textChanges.ChangeTracker.with(r,(function(e){return f(e,o,a,l,_,t)}))},g=[t.createCodeFixAction(i,d(32&s),[u?e.Diagnostics.Declare_static_property_0:e.Diagnostics.Declare_property_0,l],i,e.Diagnostics.Add_all_missing_members)];return u||e.isPrivateIdentifier(c)||(8&s&&g.unshift(t.createCodeFixActionWithoutFixAll(i,d(8),[e.Diagnostics.Declare_private_property_0,l])),g.push(function(r,n,a,o,s){var c=e.factory.createKeywordTypeNode(149),l=e.factory.createParameterDeclaration(void 0,void 0,void 0,"x",void 0,c,void 0),u=e.factory.createIndexSignature(void 0,void 0,[l],s),_=e.textChanges.ChangeTracker.with(r,(function(e){return e.insertNodeAtClassStart(n,a,u)}));return t.createCodeFixActionWithoutFixAll(i,_,[e.Diagnostics.Add_index_signature_for_property_0,o])}(r,o,a,c.text,_))),g}(r,n)}(r,c))}},fixIds:[i,s,a,o],getAllCodeActions:function(r){var n=r.program,i=r.fixId,u=n.getTypeChecker(),d=new e.Map,g=new e.Map;return t.createCombinedCodeActions(e.textChanges.ChangeTracker.with(r,(function(x){t.eachDiagnostic(r,c,(function(t){var n=l(t.file,t.start,t.code,u,r.program);if(n&&e.addToSeen(d,e.getNodeId(n.parentDeclaration)+"#"+n.token.text))if(i===s&&2===n.kind)v(x,r,n);else if(i===a&&3===n.kind)b(x,r,n);else if(i===o&&4===n.kind)h(x,r,n);else if(0===n.kind&&y(x,u,n),1===n.kind){var c=n.parentDeclaration,_=n.token,p=e.getOrUpdate(g,c,(function(){return []}));p.some((function(e){return e.token.text===_.text}))||p.push(n);}})),g.forEach((function(i,a){for(var o=t.getAllSupers(a,u),s=function(t){if(o.some((function(e){var r=g.get(e);return !!r&&r.some((function(e){return e.token.text===t.token.text}))})))return "continue";var i=t.parentDeclaration,a=t.declSourceFile,s=t.modifierFlags,c=t.token,l=t.call,u=t.isJSFile;if(l&&!e.isPrivateIdentifier(c))m(r,x,l,c,32&s,i,a);else if(u&&!e.isInterfaceDeclaration(i))_(x,a,i,c,!!(32&s));else {var d=p(n.getTypeChecker(),i,c);f(x,a,i,c.text,d,32&s);}},c=0,l=i;c<l.length;c++)s(l[c]);}));})))}}),function(e){e[e.Enum=0]="Enum",e[e.ClassOrInterface=1]="ClassOrInterface",e[e.Function=2]="Function",e[e.ObjectLiteral=3]="ObjectLiteral",e[e.JsxAttributes=4]="JsxAttributes";}(r||(r={}));}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="addMissingNewOperator",n=[e.Diagnostics.Value_of_type_0_is_not_callable_Did_you_mean_to_include_new.code];function i(t,r,n){var i=e.cast(function(t,r){for(var n=e.getTokenAtPosition(t,r.start),i=e.textSpanEnd(r);n.end<i;)n=n.parent;return n}(r,n),e.isCallExpression),a=e.factory.createNewExpression(i.expression,i.typeArguments,i.arguments);t.replaceNode(r,i,a);}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var a=n.sourceFile,o=n.span,s=e.textChanges.ChangeTracker.with(n,(function(e){return i(e,a,o)}));return [t.createCodeFixAction(r,s,e.Diagnostics.Add_missing_new_operator_to_call,r,e.Diagnostics.Add_missing_new_operator_to_all_calls)]},fixIds:[r],getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(t,r){return i(t,e.sourceFile,r)}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="installTypesPackage",n=e.Diagnostics.Cannot_find_module_0_or_its_corresponding_type_declarations.code,i=[n,e.Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type.code];function a(e,t){return {type:"install package",file:e,packageName:t}}function o(t,r){var n=e.tryCast(e.getTokenAtPosition(t,r),e.isStringLiteral);if(n){var i=n.text,a=e.parsePackageName(i).packageName;return e.isExternalModuleNameRelative(a)?void 0:a}}function s(t,r,i){var a;return i===n?e.JsTyping.nodeCoreModules.has(t)?"@types/node":void 0:(null===(a=r.isKnownTypesPackageName)||void 0===a?void 0:a.call(r,t))?e.getTypesPackageName(t):void 0}t.registerCodeFix({errorCodes:i,getCodeActions:function(n){var i=n.host,c=n.sourceFile,l=o(c,n.span.start);if(void 0!==l){var u=s(l,i,n.errorCode);return void 0===u?[]:[t.createCodeFixAction("fixCannotFindModule",[],[e.Diagnostics.Install_0,u],r,e.Diagnostics.Install_all_missing_types_packages,a(c.fileName,u))]}},fixIds:[r],getAllCodeActions:function(n){return t.codeFixAll(n,i,(function(t,i,c){var l=o(i.file,i.start);if(void 0!==l)switch(n.fixId){case r:var u=s(l,n.host,i.code);u&&c.push(a(i.file.fileName,u));break;default:e.Debug.fail("Bad fixId: ".concat(n.fixId));}}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r=[e.Diagnostics.Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2.code,e.Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1.code],n="fixClassDoesntImplementInheritedAbstractMember";function i(t,r){var n=e.getTokenAtPosition(t,r);return e.cast(n.parent,e.isClassLike)}function a(r,n,i,a,s){var c=e.getEffectiveBaseTypeNode(r),l=i.program.getTypeChecker(),u=l.getTypeAtLocation(c),_=l.getPropertiesOfType(u).filter(o),d=t.createImportAdder(n,i.program,s,i.host);t.createMissingMemberNodes(r,_,n,i,s,d,(function(e){return a.insertNodeAtClassStart(n,r,e)})),d.writeFixes(a);}function o(t){var r=e.getSyntacticModifierFlags(e.first(t.getDeclarations()));return !(8&r||!(128&r))}t.registerCodeFix({errorCodes:r,getCodeActions:function(r){var o=r.sourceFile,s=r.span,c=e.textChanges.ChangeTracker.with(r,(function(e){return a(i(o,s.start),o,r,e,r.preferences)}));return 0===c.length?void 0:[t.createCodeFixAction(n,c,e.Diagnostics.Implement_inherited_abstract_class,n,e.Diagnostics.Implement_all_inherited_abstract_classes)]},fixIds:[n],getAllCodeActions:function(n){var o=new e.Map;return t.codeFixAll(n,r,(function(t,r){var s=i(r.file,r.start);e.addToSeen(o,e.getNodeId(s))&&a(s,n.sourceFile,n,t,n.preferences);}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="classSuperMustPrecedeThisAccess",n=[e.Diagnostics.super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class.code];function i(e,t,r,n){e.insertNodeAtConstructorStart(t,r,n),e.delete(t,n);}function a(t,r){var n=e.getTokenAtPosition(t,r);if(108===n.kind){var i=e.getContainingFunction(n),a=o(i.body);return a&&!a.expression.arguments.some((function(t){return e.isPropertyAccessExpression(t)&&t.expression===n}))?{constructor:i,superCall:a}:void 0}}function o(t){return e.isExpressionStatement(t)&&e.isSuperCall(t.expression)?t:e.isFunctionLike(t)?void 0:e.forEachChild(t,o)}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var o=n.sourceFile,s=n.span,c=a(o,s.start);if(c){var l=c.constructor,u=c.superCall,_=e.textChanges.ChangeTracker.with(n,(function(e){return i(e,o,l,u)}));return [t.createCodeFixAction(r,_,e.Diagnostics.Make_super_call_the_first_statement_in_the_constructor,r,e.Diagnostics.Make_all_super_calls_the_first_statement_in_their_constructor)]}},fixIds:[r],getAllCodeActions:function(r){var o=r.sourceFile,s=new e.Map;return t.codeFixAll(r,n,(function(t,r){var n=a(r.file,r.start);if(n){var c=n.constructor,l=n.superCall;e.addToSeen(s,e.getNodeId(c.parent))&&i(t,o,c,l);}}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="constructorForDerivedNeedSuperCall",n=[e.Diagnostics.Constructors_for_derived_classes_must_contain_a_super_call.code];function i(t,r){var n=e.getTokenAtPosition(t,r);return e.Debug.assert(e.isConstructorDeclaration(n.parent),"token should be at the constructor declaration"),n.parent}function a(t,r,n){var i=e.factory.createExpressionStatement(e.factory.createCallExpression(e.factory.createSuper(),void 0,e.emptyArray));t.insertNodeAtConstructorStart(r,n,i);}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var o=n.sourceFile,s=n.span,c=i(o,s.start),l=e.textChanges.ChangeTracker.with(n,(function(e){return a(e,o,c)}));return [t.createCodeFixAction(r,l,e.Diagnostics.Add_missing_super_call,r,e.Diagnostics.Add_all_missing_super_calls)]},fixIds:[r],getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(t,r){return a(t,e.sourceFile,i(r.file,r.start))}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="enableExperimentalDecorators",n=[e.Diagnostics.Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_in_your_tsconfig_or_jsconfig_to_remove_this_warning.code];function i(r,n){t.setJsonCompilerOptionValue(r,n,"experimentalDecorators",e.factory.createTrue());}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var a=n.program.getCompilerOptions().configFile;if(void 0!==a){var o=e.textChanges.ChangeTracker.with(n,(function(e){return i(e,a)}));return [t.createCodeFixActionWithoutFixAll(r,o,e.Diagnostics.Enable_the_experimentalDecorators_option_in_your_configuration_file)]}},fixIds:[r],getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(t){var r=e.program.getCompilerOptions().configFile;void 0!==r&&i(t,r);}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="fixEnableJsxFlag",n=[e.Diagnostics.Cannot_use_JSX_unless_the_jsx_flag_is_provided.code];function i(r,n){t.setJsonCompilerOptionValue(r,n,"jsx",e.factory.createStringLiteral("react"));}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var a=n.program.getCompilerOptions().configFile;if(void 0!==a){var o=e.textChanges.ChangeTracker.with(n,(function(e){return i(e,a)}));return [t.createCodeFixActionWithoutFixAll(r,o,e.Diagnostics.Enable_the_jsx_flag_in_your_configuration_file)]}},fixIds:[r],getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(t){var r=e.program.getCompilerOptions().configFile;void 0!==r&&i(t,r);}))}});}(e.codefix||(e.codefix={}));}(t),function(e){var t;(t=e.codefix||(e.codefix={})).registerCodeFix({errorCodes:[e.Diagnostics.Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher.code,e.Diagnostics.Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher.code],getCodeActions:function(r){var n=r.program.getCompilerOptions(),i=n.configFile;if(void 0!==i){var a=[],o=e.getEmitModuleKind(n);if(o>=e.ModuleKind.ES2015&&o<e.ModuleKind.ESNext){var s=e.textChanges.ChangeTracker.with(r,(function(r){t.setJsonCompilerOptionValue(r,i,"module",e.factory.createStringLiteral("esnext"));}));a.push(t.createCodeFixActionWithoutFixAll("fixModuleOption",s,[e.Diagnostics.Set_the_module_option_in_your_configuration_file_to_0,"esnext"]));}var c=e.getEmitScriptTarget(n);return (c<4||c>99)&&(s=e.textChanges.ChangeTracker.with(r,(function(r){if(e.getTsConfigObjectLiteralExpression(i)){var n=[["target",e.factory.createStringLiteral("es2017")]];o===e.ModuleKind.CommonJS&&n.push(["module",e.factory.createStringLiteral("commonjs")]),t.setJsonCompilerOptionValues(r,i,n);}})),a.push(t.createCodeFixActionWithoutFixAll("fixTargetOption",s,[e.Diagnostics.Set_the_target_option_in_your_configuration_file_to_0,"es2017"]))),a.length?a:void 0}}});}(t),function(e){!function(t){var r="fixPropertyAssignment",n=[e.Diagnostics.Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_part_of_a_destructuring_pattern.code];function i(t,r,n){t.replaceNode(r,n,e.factory.createPropertyAssignment(n.name,n.objectAssignmentInitializer));}function a(t,r){return e.cast(e.getTokenAtPosition(t,r).parent,e.isShorthandPropertyAssignment)}t.registerCodeFix({errorCodes:n,fixIds:[r],getCodeActions:function(n){var o=a(n.sourceFile,n.span.start),s=e.textChanges.ChangeTracker.with(n,(function(e){return i(e,n.sourceFile,o)}));return [t.createCodeFixAction(r,s,[e.Diagnostics.Change_0_to_1,"=",":"],r,[e.Diagnostics.Switch_each_misused_0_to_1,"=",":"])]},getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(e,t){return i(e,t.file,a(t.file,t.start))}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="extendsInterfaceBecomesImplements",n=[e.Diagnostics.Cannot_extend_an_interface_0_Did_you_mean_implements.code];function i(t,r){var n=e.getTokenAtPosition(t,r),i=e.getContainingClass(n).heritageClauses,a=i[0].getFirstToken();return 94===a.kind?{extendsToken:a,heritageClauses:i}:void 0}function a(t,r,n,i){if(t.replaceNode(r,n,e.factory.createToken(117)),2===i.length&&94===i[0].token&&117===i[1].token){var a=i[1].getFirstToken(),o=a.getFullStart();t.replaceRange(r,{pos:o,end:o},e.factory.createToken(27));for(var s=r.text,c=a.end;c<s.length&&e.isWhiteSpaceSingleLine(s.charCodeAt(c));)c++;t.deleteRange(r,{pos:a.getStart(),end:c});}}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var o=n.sourceFile,s=i(o,n.span.start);if(s){var c=s.extendsToken,l=s.heritageClauses,u=e.textChanges.ChangeTracker.with(n,(function(e){return a(e,o,c,l)}));return [t.createCodeFixAction(r,u,e.Diagnostics.Change_extends_to_implements,r,e.Diagnostics.Change_all_extended_interfaces_to_implements)]}},fixIds:[r],getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(e,t){var r=i(t.file,t.start);r&&a(e,t.file,r.extendsToken,r.heritageClauses);}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="forgottenThisPropertyAccess",n=e.Diagnostics.Cannot_find_name_0_Did_you_mean_the_static_member_1_0.code,i=[e.Diagnostics.Cannot_find_name_0_Did_you_mean_the_instance_member_this_0.code,e.Diagnostics.Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member_declaration_property_access_or_on_the_left_hand_side_of_an_in_expression.code,n];function a(t,r,i){var a=e.getTokenAtPosition(t,r);if(e.isIdentifier(a)||e.isPrivateIdentifier(a))return {node:a,className:i===n?e.getContainingClass(a).name.text:void 0}}function o(t,r,n){var i=n.node,a=n.className;e.suppressLeadingAndTrailingTrivia(i),t.replaceNode(r,i,e.factory.createPropertyAccessExpression(a?e.factory.createIdentifier(a):e.factory.createThis(),i));}t.registerCodeFix({errorCodes:i,getCodeActions:function(n){var i=n.sourceFile,s=a(i,n.span.start,n.errorCode);if(s){var c=e.textChanges.ChangeTracker.with(n,(function(e){return o(e,i,s)}));return [t.createCodeFixAction(r,c,[e.Diagnostics.Add_0_to_unresolved_variable,s.className||"this"],r,e.Diagnostics.Add_qualifier_to_all_unresolved_variables_matching_a_member_name)]}},fixIds:[r],getAllCodeActions:function(e){return t.codeFixAll(e,i,(function(t,r){var n=a(r.file,r.start,r.code);n&&o(t,e.sourceFile,n);}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="fixInvalidJsxCharacters_expression",n="fixInvalidJsxCharacters_htmlEntity",i=[e.Diagnostics.Unexpected_token_Did_you_mean_or_gt.code,e.Diagnostics.Unexpected_token_Did_you_mean_or_rbrace.code];t.registerCodeFix({errorCodes:i,fixIds:[r,n],getCodeActions:function(i){var a=i.sourceFile,s=i.preferences,c=i.span,l=e.textChanges.ChangeTracker.with(i,(function(e){return o(e,s,a,c.start,!1)})),u=e.textChanges.ChangeTracker.with(i,(function(e){return o(e,s,a,c.start,!0)}));return [t.createCodeFixAction(r,l,e.Diagnostics.Wrap_invalid_character_in_an_expression_container,r,e.Diagnostics.Wrap_all_invalid_characters_in_an_expression_container),t.createCodeFixAction(n,u,e.Diagnostics.Convert_invalid_character_to_its_html_entity_code,n,e.Diagnostics.Convert_all_invalid_characters_to_HTML_entity_code)]},getAllCodeActions:function(e){return t.codeFixAll(e,i,(function(t,r){return o(t,e.preferences,r.file,r.start,e.fixId===n)}))}});var a={">":"&gt;","}":"&rbrace;"};function o(t,r,n,i,o){var s=n.getText()[i];if(function(t){return e.hasProperty(a,t)}(s)){var c=o?a[s]:"{".concat(e.quote(n,r,s),"}");t.replaceRangeWithText(n,{pos:i,end:i+1},c);}}}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="unusedIdentifier",n="unusedIdentifier_prefix",i="unusedIdentifier_delete",a="unusedIdentifier_deleteImports",o="unusedIdentifier_infer",s=[e.Diagnostics._0_is_declared_but_its_value_is_never_read.code,e.Diagnostics._0_is_declared_but_never_used.code,e.Diagnostics.Property_0_is_declared_but_its_value_is_never_read.code,e.Diagnostics.All_imports_in_import_declaration_are_unused.code,e.Diagnostics.All_destructured_elements_are_unused.code,e.Diagnostics.All_variables_are_unused.code,e.Diagnostics.All_type_parameters_are_unused.code];function c(t,r,n){t.replaceNode(r,n.parent,e.factory.createKeywordTypeNode(154));}function l(n,a){return t.createCodeFixAction(r,n,a,i,e.Diagnostics.Delete_all_unused_declarations)}function u(t,r,n){t.delete(r,e.Debug.checkDefined(e.cast(n.parent,e.isDeclarationWithTypeParameterChildren).typeParameters,"The type parameter to delete should exist"));}function _(e){return 100===e.kind||79===e.kind&&(269===e.parent.kind||266===e.parent.kind)}function d(t){return 100===t.kind?e.tryCast(t.parent,e.isImportDeclaration):void 0}function p(t,r){return e.isVariableDeclarationList(r.parent)&&e.first(r.parent.getChildren(t))===r}function f(e,t,r){e.delete(t,236===r.parent.kind?r.parent:r);}function g(t,r,n,i){r!==e.Diagnostics.Property_0_is_declared_but_its_value_is_never_read.code&&(137===i.kind&&(i=e.cast(i.parent,e.isInferTypeNode).typeParameter.name),e.isIdentifier(i)&&function(e){switch(e.parent.kind){case 163:case 162:return !0;case 253:switch(e.parent.parent.parent.kind){case 243:case 242:return !0}}return !1}(i)&&(t.replaceNode(n,i,e.factory.createIdentifier("_".concat(i.text))),e.isParameter(i.parent)&&e.getJSDocParameterTags(i.parent).forEach((function(r){e.isIdentifier(r.name)&&t.replaceNode(n,r.name,e.factory.createIdentifier("_".concat(r.name.text)));}))));}function m(t,r,n,i,a,o,s,c){!function(t,r,n,i,a,o,s,c){var l=t.parent;if(e.isParameter(l))!function(t,r,n,i,a,o,s,c){void 0===c&&(c=!1),function(t,r,n,i,a,o,s){var c=n.parent;switch(c.kind){case 168:case 170:var l=c.parameters.indexOf(n),u=e.isMethodDeclaration(c)?c.name:c,_=e.FindAllReferences.Core.getReferencedSymbolsForNode(c.pos,u,a,i,o);if(_)for(var d=0,p=_;d<p.length;d++)for(var f=0,g=p[d].references;f<g.length;f++){var m=g[f];if(1===m.kind){var y=e.isSuperKeyword(m.node)&&e.isCallExpression(m.node.parent)&&m.node.parent.arguments.length>l,h=e.isPropertyAccessExpression(m.node.parent)&&e.isSuperKeyword(m.node.parent.expression)&&e.isCallExpression(m.node.parent.parent)&&m.node.parent.parent.arguments.length>l,b=(e.isMethodDeclaration(m.node.parent)||e.isMethodSignature(m.node.parent))&&m.node.parent!==n.parent&&m.node.parent.parameters.length>l;if(y||h||b)return !1}}return !0;case 255:return !c.name||!function(t,r,n){return !!e.FindAllReferences.Core.eachSymbolReferenceInFile(n,t,r,(function(t){return e.isIdentifier(t)&&e.isCallExpression(t.parent)&&t.parent.arguments.indexOf(t)>=0}))}(t,r,c.name)||v(c,n,s);case 212:case 213:return v(c,n,s);case 172:return !1;default:return e.Debug.failBadSyntaxKind(c)}}(i,r,n,a,o,s,c)&&(n.modifiers&&n.modifiers.length>0&&(!e.isIdentifier(n.name)||e.FindAllReferences.Core.isSymbolReferencedInFile(n.name,i,r))?n.modifiers.forEach((function(e){return t.deleteModifier(r,e)})):!n.initializer&&y(n,i,a)&&t.delete(r,n));}(r,n,l,i,a,o,s,c);else if(!(c&&e.isIdentifier(t)&&e.FindAllReferences.Core.isSymbolReferencedInFile(t,i,n))){var u=e.isImportClause(l)?t:e.isComputedPropertyName(l)?l.parent:l;e.Debug.assert(u!==n,"should not delete whole source file"),r.delete(n,u);}}(r,n,t,i,a,o,s,c),e.isIdentifier(r)&&e.FindAllReferences.Core.eachSymbolReferenceInFile(r,i,t,(function(r){var i;e.isPropertyAccessExpression(r.parent)&&r.parent.name===r&&(r=r.parent),!c&&(i=r,(e.isBinaryExpression(i.parent)&&i.parent.left===i||(e.isPostfixUnaryExpression(i.parent)||e.isPrefixUnaryExpression(i.parent))&&i.parent.operand===i)&&e.isExpressionStatement(i.parent.parent))&&n.delete(t,r.parent.parent);}));}function y(t,r,n){var i=t.parent.parameters.indexOf(t);return !e.FindAllReferences.Core.someSignatureUsage(t.parent,n,r,(function(e,t){return !t||t.arguments.length>i}))}function v(t,r,n){var i=t.parameters,a=i.indexOf(r);return e.Debug.assert(-1!==a,"The parameter should already be in the list"),n?i.slice(a+1).every((function(t){return e.isIdentifier(t.name)&&!t.symbol.isReferenced})):a===i.length-1}t.registerCodeFix({errorCodes:s,getCodeActions:function(i){var s=i.errorCode,y=i.sourceFile,v=i.program,h=i.cancellationToken,b=v.getTypeChecker(),x=v.getSourceFiles(),D=e.getTokenAtPosition(y,i.span.start);if(e.isJSDocTemplateTag(D))return [l(e.textChanges.ChangeTracker.with(i,(function(e){return e.delete(y,D)})),e.Diagnostics.Remove_template_tag)];if(29===D.kind)return [l(T=e.textChanges.ChangeTracker.with(i,(function(e){return u(e,y,D)})),e.Diagnostics.Remove_type_parameters)];var S=d(D);if(S){var T=e.textChanges.ChangeTracker.with(i,(function(e){return e.delete(y,S)}));return [t.createCodeFixAction(r,T,[e.Diagnostics.Remove_import_from_0,e.showModuleSpecifier(S)],a,e.Diagnostics.Delete_all_unused_imports)]}if(_(D)&&(F=e.textChanges.ChangeTracker.with(i,(function(e){return m(y,D,e,b,x,v,h,!1)}))).length)return [t.createCodeFixAction(r,F,[e.Diagnostics.Remove_unused_declaration_for_Colon_0,D.getText(y)],a,e.Diagnostics.Delete_all_unused_imports)];if(e.isObjectBindingPattern(D.parent)||e.isArrayBindingPattern(D.parent)){if(e.isParameter(D.parent.parent)){var C=D.parent.elements,E=[C.length>1?e.Diagnostics.Remove_unused_declarations_for_Colon_0:e.Diagnostics.Remove_unused_declaration_for_Colon_0,e.map(C,(function(e){return e.getText(y)})).join(", ")];return [l(e.textChanges.ChangeTracker.with(i,(function(t){return function(t,r,n){e.forEach(n.elements,(function(e){return t.delete(r,e)}));}(t,y,D.parent)})),E)]}return [l(e.textChanges.ChangeTracker.with(i,(function(e){return e.delete(y,D.parent.parent)})),e.Diagnostics.Remove_unused_destructuring_declaration)]}if(p(y,D))return [l(e.textChanges.ChangeTracker.with(i,(function(e){return f(e,y,D.parent)})),e.Diagnostics.Remove_variable_statement)];var k=[];if(137===D.kind){T=e.textChanges.ChangeTracker.with(i,(function(e){return c(e,y,D)}));var N=e.cast(D.parent,e.isInferTypeNode).typeParameter.name.text;k.push(t.createCodeFixAction(r,T,[e.Diagnostics.Replace_infer_0_with_unknown,N],o,e.Diagnostics.Replace_all_unused_infer_with_unknown));}else {var F;(F=e.textChanges.ChangeTracker.with(i,(function(e){return m(y,D,e,b,x,v,h,!1)}))).length&&(N=e.isComputedPropertyName(D.parent)?D.parent:D,k.push(l(F,[e.Diagnostics.Remove_unused_declaration_for_Colon_0,N.getText(y)])));}var A=e.textChanges.ChangeTracker.with(i,(function(e){return g(e,s,y,D)}));return A.length&&k.push(t.createCodeFixAction(r,A,[e.Diagnostics.Prefix_0_with_an_underscore,D.getText(y)],n,e.Diagnostics.Prefix_all_unused_declarations_with_where_possible)),k},fixIds:[n,i,a,o],getAllCodeActions:function(r){var l=r.sourceFile,v=r.program,h=r.cancellationToken,b=v.getTypeChecker(),x=v.getSourceFiles();return t.codeFixAll(r,s,(function(t,s){var D=e.getTokenAtPosition(l,s.start);switch(r.fixId){case n:g(t,s.code,l,D);break;case a:var S=d(D);S?t.delete(l,S):_(D)&&m(l,D,t,b,x,v,h,!0);break;case i:if(137===D.kind||_(D))break;if(e.isJSDocTemplateTag(D))t.delete(l,D);else if(29===D.kind)u(t,l,D);else if(e.isObjectBindingPattern(D.parent)){if(D.parent.parent.initializer)break;e.isParameter(D.parent.parent)&&!y(D.parent.parent,b,x)||t.delete(l,D.parent.parent);}else {if(e.isArrayBindingPattern(D.parent.parent)&&D.parent.parent.parent.initializer)break;p(l,D)?f(t,l,D.parent):m(l,D,t,b,x,v,h,!0);}break;case o:137===D.kind&&c(t,l,D);break;default:e.Debug.fail(JSON.stringify(r.fixId));}}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="fixUnreachableCode",n=[e.Diagnostics.Unreachable_code_detected.code];function i(t,r,n,i,a){var o=e.getTokenAtPosition(r,n),s=e.findAncestor(o,e.isStatement);if(s.getStart(r)!==o.getStart(r)){var c=JSON.stringify({statementKind:e.Debug.formatSyntaxKind(s.kind),tokenKind:e.Debug.formatSyntaxKind(o.kind),errorCode:a,start:n,length:i});e.Debug.fail("Token and statement should start at the same point. "+c);}var l=(e.isBlock(s.parent)?s.parent:s).parent;if(!e.isBlock(s.parent)||s===e.first(s.parent.statements))switch(l.kind){case 238:if(l.elseStatement){if(e.isBlock(s.parent))break;return void t.replaceNode(r,s,e.factory.createBlock(e.emptyArray))}case 240:case 241:return void t.delete(r,l)}if(e.isBlock(s.parent)){var u=n+i,_=e.Debug.checkDefined(function(e,t){for(var r,n=0,i=e;n<i.length;n++){var a=i[n];if(!(a.pos<u))break;r=a;}return r}(e.sliceAfter(s.parent.statements,s)),"Some statement should be last");t.deleteNodeRange(r,s,_);}else t.delete(r,s);}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var a=e.textChanges.ChangeTracker.with(n,(function(e){return i(e,n.sourceFile,n.span.start,n.span.length,n.errorCode)}));return [t.createCodeFixAction(r,a,e.Diagnostics.Remove_unreachable_code,r,e.Diagnostics.Remove_all_unreachable_code)]},fixIds:[r],getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(e,t){return i(e,t.file,t.start,t.length,t.code)}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="fixUnusedLabel",n=[e.Diagnostics.Unused_label.code];function i(t,r,n){var i=e.getTokenAtPosition(r,n),a=e.cast(i.parent,e.isLabeledStatement),o=i.getStart(r),s=a.statement.getStart(r),c=e.positionsAreOnSameLine(o,s,r)?s:e.skipTrivia(r.text,e.findChildOfKind(a,58,r).end,!0);t.deleteRange(r,{pos:o,end:c});}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var a=e.textChanges.ChangeTracker.with(n,(function(e){return i(e,n.sourceFile,n.span.start)}));return [t.createCodeFixAction(r,a,e.Diagnostics.Remove_unused_label,r,e.Diagnostics.Remove_all_unused_labels)]},fixIds:[r],getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(e,t){return i(e,t.file,t.start)}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="fixJSDocTypes_plain",n="fixJSDocTypes_nullable",i=[e.Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments.code];function a(e,t,r,n,i){e.replaceNode(t,r,i.typeToTypeNode(n,r,void 0));}function o(t,r,n){var i=e.findAncestor(e.getTokenAtPosition(t,r),s),a=i&&i.type;return a&&{typeNode:a,type:n.getTypeFromTypeNode(a)}}function s(e){switch(e.kind){case 228:case 173:case 174:case 255:case 171:case 175:case 194:case 168:case 167:case 163:case 166:case 165:case 172:case 258:case 210:case 253:return !0;default:return !1}}t.registerCodeFix({errorCodes:i,getCodeActions:function(i){var s=i.sourceFile,c=i.program.getTypeChecker(),l=o(s,i.span.start,c);if(l){var u=l.typeNode,_=l.type,d=u.getText(s),p=[f(_,r,e.Diagnostics.Change_all_jsdoc_style_types_to_TypeScript)];return 312===u.kind&&p.push(f(c.getNullableType(_,32768),n,e.Diagnostics.Change_all_jsdoc_style_types_to_TypeScript_and_add_undefined_to_nullable_types)),p}function f(r,n,o){var l=e.textChanges.ChangeTracker.with(i,(function(e){return a(e,s,u,r,c)}));return t.createCodeFixAction("jdocTypes",l,[e.Diagnostics.Change_0_to_1,d,c.typeToString(r)],n,o)}},fixIds:[r,n],getAllCodeActions:function(e){var r=e.fixId,s=e.program,c=e.sourceFile,l=s.getTypeChecker();return t.codeFixAll(e,i,(function(e,t){var i=o(t.file,t.start,l);if(i){var s=i.typeNode,u=i.type,_=312===s.kind&&r===n?l.getNullableType(u,32768):u;a(e,c,s,_,l);}}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="fixMissingCallParentheses",n=[e.Diagnostics.This_condition_will_always_return_true_since_this_function_is_always_defined_Did_you_mean_to_call_it_instead.code];function i(e,t,r){e.replaceNodeWithText(t,r,"".concat(r.text,"()"));}function a(t,r){var n=e.getTokenAtPosition(t,r);if(e.isPropertyAccessExpression(n.parent)){for(var i=n.parent;e.isPropertyAccessExpression(i.parent);)i=i.parent;return i.name}if(e.isIdentifier(n))return n}t.registerCodeFix({errorCodes:n,fixIds:[r],getCodeActions:function(n){var o=a(n.sourceFile,n.span.start);if(o){var s=e.textChanges.ChangeTracker.with(n,(function(e){return i(e,n.sourceFile,o)}));return [t.createCodeFixAction(r,s,e.Diagnostics.Add_missing_call_parentheses,r,e.Diagnostics.Add_all_missing_call_parentheses)]}},getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(e,t){var r=a(t.file,t.start);r&&i(e,t.file,r);}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="fixAwaitInSyncFunction",n=[e.Diagnostics.await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules.code,e.Diagnostics.for_await_loops_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules.code];function i(t,r){var n=e.getTokenAtPosition(t,r),i=e.getContainingFunction(n);if(i){var a,o;switch(i.kind){case 168:a=i.name;break;case 255:case 212:a=e.findChildOfKind(i,98,t);break;case 213:var s=i.typeParameters?29:20;a=e.findChildOfKind(i,s,t)||e.first(i.parameters);break;default:return}return a&&{insertBefore:a,returnType:(o=i,o.type?o.type:e.isVariableDeclaration(o.parent)&&o.parent.type&&e.isFunctionTypeNode(o.parent.type)?o.parent.type.type:void 0)}}}function a(t,r,n){var i=n.insertBefore,a=n.returnType;if(a){var o=e.getEntityNameFromTypeNode(a);o&&79===o.kind&&"Promise"===o.text||t.replaceNode(r,a,e.factory.createTypeReferenceNode("Promise",e.factory.createNodeArray([a])));}t.insertModifierBefore(r,131,i);}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var o=n.sourceFile,s=n.span,c=i(o,s.start);if(c){var l=e.textChanges.ChangeTracker.with(n,(function(e){return a(e,o,c)}));return [t.createCodeFixAction(r,l,e.Diagnostics.Add_async_modifier_to_containing_function,r,e.Diagnostics.Add_all_missing_async_modifiers)]}},fixIds:[r],getAllCodeActions:function(r){var o=new e.Map;return t.codeFixAll(r,n,(function(t,n){var s=i(n.file,n.start);s&&e.addToSeen(o,e.getNodeId(s.insertBefore))&&a(t,r.sourceFile,s);}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r=[e.Diagnostics._0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property.code,e.Diagnostics._0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor.code],n="fixPropertyOverrideAccessor";function i(r,n,i,a,o){var s,c;if(a===e.Diagnostics._0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property.code)s=n,c=n+i;else if(a===e.Diagnostics._0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor.code){var l=o.program.getTypeChecker(),u=e.getTokenAtPosition(r,n).parent;e.Debug.assert(e.isAccessor(u),"error span of fixPropertyOverrideAccessor should only be on an accessor");var _=u.parent;e.Debug.assert(e.isClassLike(_),"erroneous accessors should only be inside classes");var d=e.singleOrUndefined(t.getAllSupers(_,l));if(!d)return [];var p=e.unescapeLeadingUnderscores(e.getTextOfPropertyName(u.name)),f=l.getPropertyOfType(l.getTypeAtLocation(d),p);if(!f||!f.valueDeclaration)return [];s=f.valueDeclaration.pos,c=f.valueDeclaration.end,r=e.getSourceFileOfNode(f.valueDeclaration);}else e.Debug.fail("fixPropertyOverrideAccessor codefix got unexpected error code "+a);return t.generateAccessorFromProperty(r,o.program,s,c,o,e.Diagnostics.Generate_get_and_set_accessors.message)}t.registerCodeFix({errorCodes:r,getCodeActions:function(r){var a=i(r.sourceFile,r.span.start,r.span.length,r.errorCode,r);if(a)return [t.createCodeFixAction(n,a,e.Diagnostics.Generate_get_and_set_accessors,n,e.Diagnostics.Generate_get_and_set_accessors_for_all_overriding_properties)]},fixIds:[n],getAllCodeActions:function(e){return t.codeFixAll(e,r,(function(t,r){var n=i(r.file,r.start,r.length,r.code,e);if(n)for(var a=0,o=n;a<o.length;a++){var s=o[a];t.pushRaw(e.sourceFile,s);}}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="inferFromUsage",i=[e.Diagnostics.Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined.code,e.Diagnostics.Variable_0_implicitly_has_an_1_type.code,e.Diagnostics.Parameter_0_implicitly_has_an_1_type.code,e.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type.code,e.Diagnostics.Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation.code,e.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type.code,e.Diagnostics.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation.code,e.Diagnostics.Member_0_implicitly_has_an_1_type.code,e.Diagnostics.Variable_0_implicitly_has_type_1_in_some_locations_but_a_better_type_may_be_inferred_from_usage.code,e.Diagnostics.Variable_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage.code,e.Diagnostics.Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage.code,e.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage.code,e.Diagnostics.Property_0_implicitly_has_type_any_but_a_better_type_for_its_get_accessor_may_be_inferred_from_usage.code,e.Diagnostics._0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage.code,e.Diagnostics.Property_0_implicitly_has_type_any_but_a_better_type_for_its_set_accessor_may_be_inferred_from_usage.code,e.Diagnostics.Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage.code,e.Diagnostics.this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation.code];function a(t,r){switch(t){case e.Diagnostics.Parameter_0_implicitly_has_an_1_type.code:case e.Diagnostics.Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage.code:return e.isSetAccessorDeclaration(e.getContainingFunction(r))?e.Diagnostics.Infer_type_of_0_from_usage:e.Diagnostics.Infer_parameter_types_from_usage;case e.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type.code:case e.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage.code:return e.Diagnostics.Infer_parameter_types_from_usage;case e.Diagnostics.this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation.code:return e.Diagnostics.Infer_this_type_of_0_from_usage;default:return e.Diagnostics.Infer_type_of_0_from_usage}}function o(r,n,i,a,o,d,m,y,v){if(e.isParameterPropertyModifier(i.kind)||79===i.kind||25===i.kind||108===i.kind){var h=i.parent,b=t.createImportAdder(n,o,v,y);switch(a=function(t){switch(t){case e.Diagnostics.Variable_0_implicitly_has_type_1_in_some_locations_but_a_better_type_may_be_inferred_from_usage.code:return e.Diagnostics.Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined.code;case e.Diagnostics.Variable_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage.code:return e.Diagnostics.Variable_0_implicitly_has_an_1_type.code;case e.Diagnostics.Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage.code:return e.Diagnostics.Parameter_0_implicitly_has_an_1_type.code;case e.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage.code:return e.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type.code;case e.Diagnostics.Property_0_implicitly_has_type_any_but_a_better_type_for_its_get_accessor_may_be_inferred_from_usage.code:return e.Diagnostics.Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation.code;case e.Diagnostics._0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage.code:return e.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type.code;case e.Diagnostics.Property_0_implicitly_has_type_any_but_a_better_type_for_its_set_accessor_may_be_inferred_from_usage.code:return e.Diagnostics.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation.code;case e.Diagnostics.Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage.code:return e.Diagnostics.Member_0_implicitly_has_an_1_type.code}return t}(a)){case e.Diagnostics.Member_0_implicitly_has_an_1_type.code:case e.Diagnostics.Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined.code:if(e.isVariableDeclaration(h)&&m(h)||e.isPropertyDeclaration(h)||e.isPropertySignature(h))return s(r,b,n,h,o,y,d),b.writeFixes(r),h;if(e.isPropertyAccessExpression(h)){var x=p(h.name,o,d),D=e.getTypeNodeIfAccessible(x,h,o,y);if(D){var S=e.factory.createJSDocTypeTag(void 0,e.factory.createJSDocTypeExpression(D),void 0);_(r,n,e.cast(h.parent.parent,e.isExpressionStatement),[S]);}return b.writeFixes(r),h}return;case e.Diagnostics.Variable_0_implicitly_has_an_1_type.code:var T=o.getTypeChecker().getSymbolAtLocation(i);return T&&T.valueDeclaration&&e.isVariableDeclaration(T.valueDeclaration)&&m(T.valueDeclaration)?(s(r,b,n,T.valueDeclaration,o,y,d),b.writeFixes(r),T.valueDeclaration):void 0}var C=e.getContainingFunction(i);if(void 0!==C){var E;switch(a){case e.Diagnostics.Parameter_0_implicitly_has_an_1_type.code:if(e.isSetAccessorDeclaration(C)){c(r,b,n,C,o,y,d),E=C;break}case e.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type.code:if(m(C)){var k=e.cast(h,e.isParameter);!function(t,r,n,i,a,o,s,c){if(e.isIdentifier(i.name)){var _=function(t,r,n,i){var a=f(t,r,n,i);return a&&g(n,a,i).parameters(t)||t.parameters.map((function(t){return {declaration:t,type:e.isIdentifier(t.name)?p(t.name,n,i):n.getTypeChecker().getAnyType()}}))}(a,n,o,c);if(e.Debug.assert(a.parameters.length===_.length,"Parameter count and inference count should match"),e.isInJSFile(a))u(t,n,_,o,s);else {var d=e.isArrowFunction(a)&&!e.findChildOfKind(a,20,n);d&&t.insertNodeBefore(n,e.first(a.parameters),e.factory.createToken(20));for(var m=0,y=_;m<y.length;m++){var v=y[m],h=v.declaration,b=v.type;!h||h.type||h.initializer||l(t,r,n,h,b,o,s);}d&&t.insertNodeAfter(n,e.last(a.parameters),e.factory.createToken(21));}}}(r,b,n,k,C,o,y,d),E=k;}break;case e.Diagnostics.Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation.code:case e.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type.code:e.isGetAccessorDeclaration(C)&&e.isIdentifier(C.name)&&(l(r,b,n,C,p(C.name,o,d),o,y),E=C);break;case e.Diagnostics.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation.code:e.isSetAccessorDeclaration(C)&&(c(r,b,n,C,o,y,d),E=C);break;case e.Diagnostics.this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation.code:e.textChanges.isThisTypeAnnotatable(C)&&m(C)&&(function(t,r,n,i,a,o){var s=f(n,r,i,o);if(s&&s.length){var c=g(i,s,o).thisParameter(),l=e.getTypeNodeIfAccessible(c,n,i,a);l&&(e.isInJSFile(n)?function(t,r,n,i){_(t,r,n,[e.factory.createJSDocThisTag(void 0,e.factory.createJSDocTypeExpression(i))]);}(t,r,n,l):t.tryInsertThisTypeAnnotation(r,n,l));}}(r,n,C,o,y,d),E=C);break;default:return e.Debug.fail(String(a))}return b.writeFixes(r),E}}}function s(t,r,n,i,a,o,s){e.isIdentifier(i.name)&&l(t,r,n,i,p(i.name,a,s),a,o);}function c(t,r,n,i,a,o,s){var c=e.firstOrUndefined(i.parameters);if(c&&e.isIdentifier(i.name)&&e.isIdentifier(c.name)){var _=p(i.name,a,s);_===a.getTypeChecker().getAnyType()&&(_=p(c.name,a,s)),e.isInJSFile(i)?u(t,n,[{declaration:c,type:_}],a,o):l(t,r,n,c,_,a,o);}}function l(r,n,i,a,o,s,c){var l=e.getTypeNodeIfAccessible(o,a,s,c);if(l)if(e.isInJSFile(i)&&165!==a.kind){var u=e.isVariableDeclaration(a)?e.tryCast(a.parent.parent,e.isVariableStatement):a;if(!u)return;var d=e.factory.createJSDocTypeExpression(l);_(r,i,u,[e.isGetAccessorDeclaration(a)?e.factory.createJSDocReturnTag(void 0,d,void 0):e.factory.createJSDocTypeTag(void 0,d,void 0)]);}else (function(r,n,i,a,o,s){var c=t.tryGetAutoImportableReferenceFromTypeNode(r,s);return !(!c||!a.tryInsertTypeAnnotation(i,n,c.typeNode))&&(e.forEach(c.symbols,(function(e){return o.addImportFromExportedSymbol(e,!0)})),!0)})(l,a,i,r,n,e.getEmitScriptTarget(s.getCompilerOptions()))||r.tryInsertTypeAnnotation(i,a,l);}function u(t,r,n,i,a){var o=n.length&&n[0].declaration.parent;if(o){var s=e.mapDefined(n,(function(t){var r=t.declaration;if(!r.initializer&&!e.getJSDocType(r)&&e.isIdentifier(r.name)){var n=t.type&&e.getTypeNodeIfAccessible(t.type,r,i,a);if(n){var o=e.factory.cloneNode(r.name);return e.setEmitFlags(o,3584),{name:e.factory.cloneNode(r.name),param:r,isOptional:!!t.isOptional,typeNode:n}}}}));if(s.length)if(e.isArrowFunction(o)||e.isFunctionExpression(o)){var c=e.isArrowFunction(o)&&!e.findChildOfKind(o,20,r);c&&t.insertNodeBefore(r,e.first(o.parameters),e.factory.createToken(20)),e.forEach(s,(function(n){var i=n.typeNode,a=n.param,o=e.factory.createJSDocTypeTag(void 0,e.factory.createJSDocTypeExpression(i)),s=e.factory.createJSDocComment(void 0,[o]);t.insertNodeAt(r,a.getStart(r),s,{suffix:" "});})),c&&t.insertNodeAfter(r,e.last(o.parameters),e.factory.createToken(21));}else {var l=e.map(s,(function(t){var r=t.name,n=t.typeNode,i=t.isOptional;return e.factory.createJSDocParameterTag(void 0,r,!!i,e.factory.createJSDocTypeExpression(n),!1,void 0)}));_(t,r,o,l);}}}function _(t,r,i,a){var o,s=e.flatMap(i.jsDoc,(function(t){return "string"==typeof t.comment?e.factory.createJSDocText(t.comment):t.comment})),c=e.flatMapToMutable(i.jsDoc,(function(e){return e.tags})),l=a.filter((function(t){return !c||!c.some((function(r,n){var i=function(t,r){if(t.kind===r.kind)switch(t.kind){case 338:var n=t,i=r;return e.isIdentifier(n.name)&&e.isIdentifier(i.name)&&n.name.escapedText===i.name.escapedText?e.factory.createJSDocParameterTag(void 0,i.name,!1,i.typeExpression,i.isNameFirst,n.comment):void 0;case 339:return e.factory.createJSDocReturnTag(void 0,r.typeExpression,t.comment)}}(r,t);return i&&(c[n]=i),!!i}))})),u=e.factory.createJSDocComment(e.factory.createNodeArray(e.intersperse(s,e.factory.createJSDocText("\n"))),e.factory.createNodeArray(n$3(n$3([],c||e.emptyArray,!0),l,!0))),_=213===i.kind?166===(o=i).parent.kind?o.parent:o.parent.parent:i;_.jsDoc=i.jsDoc,_.jsDocCache=i.jsDocCache,t.insertJsdocCommentBefore(r,_,u);}function d(t,r,n){return e.mapDefined(e.FindAllReferences.getReferenceEntriesForNode(-1,t,r,r.getSourceFiles(),n),(function(t){return 0!==t.kind?e.tryCast(t.node,e.isIdentifier):void 0}))}function p(e,t,r){return g(t,d(e,t,r),r).single()}function f(t,r,n,i){var a;switch(t.kind){case 170:a=e.findChildOfKind(t,134,r);break;case 213:case 212:var o=t.parent;a=(e.isVariableDeclaration(o)||e.isPropertyDeclaration(o))&&e.isIdentifier(o.name)?o.name:t.name;break;case 255:case 168:case 167:a=t.name;}if(a)return d(a,n,i)}function g(t,r,i){var a=t.getTypeChecker(),o={string:function(){return a.getStringType()},number:function(){return a.getNumberType()},Array:function(e){return a.createArrayType(e)},Promise:function(e){return a.createPromiseType(e)}},s=[a.getStringType(),a.getNumberType(),a.createArrayType(a.getAnyType()),a.createPromiseType(a.getAnyType())];return {single:function(){return f(l(r))},parameters:function(o){if(0!==r.length&&o.parameters){for(var s={isNumber:void 0,isString:void 0,isNumberOrString:void 0,candidateTypes:void 0,properties:void 0,calls:void 0,constructs:void 0,numberIndex:void 0,stringIndex:void 0,candidateThisTypes:void 0,inferredTypes:void 0},c=0,_=r;c<_.length;c++){var p=_[c];i.throwIfCancellationRequested(),u(p,s);}var g=n$3(n$3([],s.constructs||[],!0),s.calls||[],!0);return o.parameters.map((function(r,n){for(var s=[],c=e.isRestParameter(r),u=!1,_=0,p=g;_<p.length;_++){var m=p[_];if(m.argumentTypes.length<=n)u=e.isInJSFile(o),s.push(a.getUndefinedType());else if(c)for(var y=n;y<m.argumentTypes.length;y++)s.push(a.getBaseTypeOfLiteralType(m.argumentTypes[y]));else s.push(a.getBaseTypeOfLiteralType(m.argumentTypes[n]));}if(e.isIdentifier(r.name)){var v=l(d(r.name,t,i));s.push.apply(s,c?e.mapDefined(v,a.getElementTypeOfArrayType):v);}var h=f(s);return {type:c?a.createArrayType(h):h,isOptional:u&&!c,declaration:r}}))}},thisParameter:function(){for(var t={isNumber:void 0,isString:void 0,isNumberOrString:void 0,candidateTypes:void 0,properties:void 0,calls:void 0,constructs:void 0,numberIndex:void 0,stringIndex:void 0,candidateThisTypes:void 0,inferredTypes:void 0},n=0,a=r;n<a.length;n++){var o=a[n];i.throwIfCancellationRequested(),u(o,t);}return f(t.candidateThisTypes||e.emptyArray)}};function c(t){for(var r=new e.Map,n=0,i=t;n<i.length;n++){var a=i[n];a.properties&&a.properties.forEach((function(e,t){r.has(t)||r.set(t,[]),r.get(t).push(e);}));}var o=new e.Map;return r.forEach((function(e,t){o.set(t,c(e));})),{isNumber:t.some((function(e){return e.isNumber})),isString:t.some((function(e){return e.isString})),isNumberOrString:t.some((function(e){return e.isNumberOrString})),candidateTypes:e.flatMap(t,(function(e){return e.candidateTypes})),properties:o,calls:e.flatMap(t,(function(e){return e.calls})),constructs:e.flatMap(t,(function(e){return e.constructs})),numberIndex:e.forEach(t,(function(e){return e.numberIndex})),stringIndex:e.forEach(t,(function(e){return e.stringIndex})),candidateThisTypes:e.flatMap(t,(function(e){return e.candidateThisTypes})),inferredTypes:void 0}}function l(e){for(var t={isNumber:void 0,isString:void 0,isNumberOrString:void 0,candidateTypes:void 0,properties:void 0,calls:void 0,constructs:void 0,numberIndex:void 0,stringIndex:void 0,candidateThisTypes:void 0,inferredTypes:void 0},r=0,n=e;r<n.length;r++){var a=n[r];i.throwIfCancellationRequested(),u(a,t);}return g(t)}function u(t,r){for(;e.isRightSideOfQualifiedNameOrPropertyAccess(t);)t=t.parent;switch(t.parent.kind){case 237:!function(t,r){v(r,e.isCallExpression(t)?a.getVoidType():a.getAnyType());}(t,r);break;case 219:r.isNumber=!0;break;case 218:!function(e,t){switch(e.operator){case 45:case 46:case 40:case 54:t.isNumber=!0;break;case 39:t.isNumberOrString=!0;}}(t.parent,r);break;case 220:!function(t,r,n){switch(r.operatorToken.kind){case 42:case 41:case 43:case 44:case 47:case 48:case 49:case 50:case 51:case 52:case 65:case 67:case 66:case 68:case 69:case 73:case 74:case 78:case 70:case 72:case 71:case 40:case 29:case 32:case 31:case 33:var i=a.getTypeAtLocation(r.left===t?r.right:r.left);1056&i.flags?v(n,i):n.isNumber=!0;break;case 64:case 39:var o=a.getTypeAtLocation(r.left===t?r.right:r.left);1056&o.flags?v(n,o):296&o.flags?n.isNumber=!0:402653316&o.flags?n.isString=!0:1&o.flags||(n.isNumberOrString=!0);break;case 63:case 34:case 36:case 37:case 35:v(n,a.getTypeAtLocation(r.left===t?r.right:r.left));break;case 101:t===r.left&&(n.isString=!0);break;case 56:case 60:t!==r.left||253!==t.parent.parent.kind&&!e.isAssignmentExpression(t.parent.parent,!0)||v(n,a.getTypeAtLocation(r.right));}}(t,t.parent,r);break;case 288:case 289:!function(e,t){v(t,a.getTypeAtLocation(e.parent.parent.expression));}(t.parent,r);break;case 207:case 208:t.parent.expression===t?function(e,t){var r={argumentTypes:[],return_:{isNumber:void 0,isString:void 0,isNumberOrString:void 0,candidateTypes:void 0,properties:void 0,calls:void 0,constructs:void 0,numberIndex:void 0,stringIndex:void 0,candidateThisTypes:void 0,inferredTypes:void 0}};if(e.arguments)for(var n=0,i=e.arguments;n<i.length;n++){var o=i[n];r.argumentTypes.push(a.getTypeAtLocation(o));}u(e,r.return_),207===e.kind?(t.calls||(t.calls=[])).push(r):(t.constructs||(t.constructs=[])).push(r);}(t.parent,r):_(t,r);break;case 205:!function(t,r){var n=e.escapeLeadingUnderscores(t.name.text);r.properties||(r.properties=new e.Map);var i=r.properties.get(n)||{isNumber:void 0,isString:void 0,isNumberOrString:void 0,candidateTypes:void 0,properties:void 0,calls:void 0,constructs:void 0,numberIndex:void 0,stringIndex:void 0,candidateThisTypes:void 0,inferredTypes:void 0};u(t,i),r.properties.set(n,i);}(t.parent,r);break;case 206:!function(e,t,r){if(t!==e.argumentExpression){var n=a.getTypeAtLocation(e.argumentExpression),i={isNumber:void 0,isString:void 0,isNumberOrString:void 0,candidateTypes:void 0,properties:void 0,calls:void 0,constructs:void 0,numberIndex:void 0,stringIndex:void 0,candidateThisTypes:void 0,inferredTypes:void 0};u(e,i),296&n.flags?r.numberIndex=i:r.stringIndex=i;}else r.isNumberOrString=!0;}(t.parent,t,r);break;case 294:case 295:!function(t,r){var n=e.isVariableDeclaration(t.parent.parent)?t.parent.parent:t.parent;h(r,a.getTypeAtLocation(n));}(t.parent,r);break;case 166:!function(e,t){h(t,a.getTypeAtLocation(e.parent));}(t.parent,r);break;case 253:var n=t.parent,i=n.name,o=n.initializer;if(t===i){o&&v(r,a.getTypeAtLocation(o));break}default:return _(t,r)}}function _(t,r){e.isExpressionNode(t)&&v(r,a.getContextualType(t));}function p(e){return f(g(e))}function f(t){if(!t.length)return a.getAnyType();var r=a.getUnionType([a.getStringType(),a.getNumberType()]),n=function(t,r){for(var n=[],i=0,a=t;i<a.length;i++)for(var o=a[i],s=0,c=r;s<c.length;s++){var l=c[s],u=l.high,_=l.low;u(o)&&(e.Debug.assert(!_(o),"Priority can't have both low and high"),n.push(_));}return t.filter((function(e){return n.every((function(t){return !t(e)}))}))}(t,[{high:function(e){return e===a.getStringType()||e===a.getNumberType()},low:function(e){return e===r}},{high:function(e){return !(16385&e.flags)},low:function(e){return !!(16385&e.flags)}},{high:function(t){return !(114689&t.flags||16&e.getObjectFlags(t))},low:function(t){return !!(16&e.getObjectFlags(t))}}]),i=n.filter((function(t){return 16&e.getObjectFlags(t)}));return i.length&&(n=n.filter((function(t){return !(16&e.getObjectFlags(t))}))).push(function(t){if(1===t.length)return t[0];for(var r=[],n=[],i=[],o=[],s=!1,c=!1,l=e.createMultiMap(),u=0,_=t;u<_.length;u++){for(var d=_[u],p=0,f=a.getPropertiesOfType(d);p<f.length;p++){var g=f[p];l.add(g.name,g.valueDeclaration?a.getTypeOfSymbolAtLocation(g,g.valueDeclaration):a.getAnyType());}r.push.apply(r,a.getSignaturesOfType(d,0)),n.push.apply(n,a.getSignaturesOfType(d,1));var m=a.getIndexInfoOfType(d,0);m&&(i.push(m.type),s=s||m.isReadonly);var y=a.getIndexInfoOfType(d,1);y&&(o.push(y.type),c=c||y.isReadonly);}var v=e.mapEntries(l,(function(e,r){var n=r.length<t.length?16777216:0,i=a.createSymbol(4|n,e);return i.type=a.getUnionType(r),[e,i]})),h=[];return i.length&&h.push(a.createIndexInfo(a.getStringType(),a.getUnionType(i),s)),o.length&&h.push(a.createIndexInfo(a.getNumberType(),a.getUnionType(o),c)),a.createAnonymousType(t[0].symbol,v,r,n,h)}(i)),a.getWidenedType(a.getUnionType(n.map(a.getBaseTypeOfLiteralType),2))}function g(t){var r,n,i,c=[];return t.isNumber&&c.push(a.getNumberType()),t.isString&&c.push(a.getStringType()),t.isNumberOrString&&c.push(a.getUnionType([a.getStringType(),a.getNumberType()])),t.numberIndex&&c.push(a.createArrayType(p(t.numberIndex))),((null===(r=t.properties)||void 0===r?void 0:r.size)||(null===(n=t.calls)||void 0===n?void 0:n.length)||(null===(i=t.constructs)||void 0===i?void 0:i.length)||t.stringIndex)&&c.push(function(t){var r=new e.Map;t.properties&&t.properties.forEach((function(e,t){var n=a.createSymbol(4,t);n.type=p(e),r.set(t,n);}));var n=t.calls?[y(t.calls)]:[],i=t.constructs?[y(t.constructs)]:[],o=t.stringIndex?[a.createIndexInfo(a.getStringType(),p(t.stringIndex),!1)]:[];return a.createAnonymousType(void 0,r,n,i,o)}(t)),c.push.apply(c,(t.candidateTypes||[]).map((function(e){return a.getBaseTypeOfLiteralType(e)}))),c.push.apply(c,function(t){if(!t.properties||!t.properties.size)return [];var r=s.filter((function(r){return function(t,r){return !!r.properties&&!e.forEachEntry(r.properties,(function(r,n){var i,o=a.getTypeOfPropertyOfType(t,n);return !(o&&(r.calls?a.getSignaturesOfType(o,0).length&&a.isTypeAssignableTo(o,(i=r.calls,a.createAnonymousType(void 0,e.createSymbolTable(),[y(i)],e.emptyArray,e.emptyArray))):a.isTypeAssignableTo(o,p(r))))}))}(r,t)}));return 0<r.length&&r.length<3?r.map((function(r){return function(t,r){if(!(4&e.getObjectFlags(t)&&r.properties))return t;var n=t.target,i=e.singleOrUndefined(n.typeParameters);if(!i)return t;var s=[];return r.properties.forEach((function(t,r){var o=a.getTypeOfPropertyOfType(n,r);e.Debug.assert(!!o,"generic should have all the properties of its reference."),s.push.apply(s,m(o,p(t),i));})),o[t.symbol.escapedName](f(s))}(r,t)})):[]}(t)),c}function m(t,r,n){if(t===n)return [r];if(3145728&t.flags)return e.flatMap(t.types,(function(e){return m(e,r,n)}));if(4&e.getObjectFlags(t)&&4&e.getObjectFlags(r)){var i=a.getTypeArguments(t),o=a.getTypeArguments(r),s=[];if(i&&o)for(var c=0;c<i.length;c++)o[c]&&s.push.apply(s,m(i[c],o[c],n));return s}var l=a.getSignaturesOfType(t,0),u=a.getSignaturesOfType(r,0);return 1===l.length&&1===u.length?function(t,r,n){for(var i=[],o=0;o<t.parameters.length;o++){var s=t.parameters[o],c=r.parameters[o],l=t.declaration&&e.isRestParameter(t.declaration.parameters[o]);if(!c)break;var u=s.valueDeclaration?a.getTypeOfSymbolAtLocation(s,s.valueDeclaration):a.getAnyType(),_=l&&a.getElementTypeOfArrayType(u);_&&(u=_);var d=c.type||(c.valueDeclaration?a.getTypeOfSymbolAtLocation(c,c.valueDeclaration):a.getAnyType());i.push.apply(i,m(u,d,n));}var p=a.getReturnTypeOfSignature(t),f=a.getReturnTypeOfSignature(r);return i.push.apply(i,m(p,f,n)),i}(l[0],u[0],n):[]}function y(t){for(var r=[],n=Math.max.apply(Math,t.map((function(e){return e.argumentTypes.length}))),i=function(n){var i=a.createSymbol(1,e.escapeLeadingUnderscores("arg".concat(n)));i.type=f(t.map((function(e){return e.argumentTypes[n]||a.getUndefinedType()}))),t.some((function(e){return void 0===e.argumentTypes[n]}))&&(i.flags|=16777216),r.push(i);},o=0;o<n;o++)i(o);var s=p(c(t.map((function(e){return e.return_}))));return a.createSignature(void 0,void 0,void 0,r,s,void 0,n,0)}function v(e,t){!t||1&t.flags||131072&t.flags||(e.candidateTypes||(e.candidateTypes=[])).push(t);}function h(e,t){!t||1&t.flags||131072&t.flags||(e.candidateThisTypes||(e.candidateThisTypes=[])).push(t);}}t.registerCodeFix({errorCodes:i,getCodeActions:function(n){var i,s=n.sourceFile,c=n.program,l=n.span.start,u=n.errorCode,_=n.cancellationToken,d=n.host,p=n.preferences,f=e.getTokenAtPosition(s,l),g=e.textChanges.ChangeTracker.with(n,(function(t){i=o(t,s,f,u,c,_,e.returnTrue,d,p);})),m=i&&e.getNameOfDeclaration(i);return m&&0!==g.length?[t.createCodeFixAction(r,g,[a(u,f),m.getText(s)],r,e.Diagnostics.Infer_all_types_from_usage)]:void 0},fixIds:[r],getAllCodeActions:function(r){var n=r.sourceFile,a=r.program,s=r.cancellationToken,c=r.host,l=r.preferences,u=e.nodeSeenTracker();return t.codeFixAll(r,i,(function(t,r){o(t,n,e.getTokenAtPosition(r.file,r.start),r.code,a,s,u,c,l);}))}}),t.addJSDocTags=_;}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="fixReturnTypeInAsyncFunction",n=[e.Diagnostics.The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type_Did_you_mean_to_write_Promise_0.code];function i(t,r,n){if(!e.isInJSFile(t)){var i=e.getTokenAtPosition(t,n),a=e.findAncestor(i,e.isFunctionLikeDeclaration),o=null==a?void 0:a.type;if(o){var s=r.getTypeFromTypeNode(o),c=r.getAwaitedType(s)||r.getVoidType(),l=r.typeToTypeNode(c,o,void 0);return l?{returnTypeNode:o,returnType:s,promisedTypeNode:l,promisedType:c}:void 0}}}function a(t,r,n,i){t.replaceNode(r,n,e.factory.createTypeReferenceNode("Promise",[i]));}t.registerCodeFix({errorCodes:n,fixIds:[r],getCodeActions:function(n){var o=n.sourceFile,s=n.program,c=n.span,l=s.getTypeChecker(),u=i(o,s.getTypeChecker(),c.start);if(u){var _=u.returnTypeNode,d=u.returnType,p=u.promisedTypeNode,f=u.promisedType,g=e.textChanges.ChangeTracker.with(n,(function(e){return a(e,o,_,p)}));return [t.createCodeFixAction(r,g,[e.Diagnostics.Replace_0_with_Promise_1,l.typeToString(d),l.typeToString(f)],r,e.Diagnostics.Fix_all_incorrect_return_type_of_an_async_functions)]}},getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(t,r){var n=i(r.file,e.program.getTypeChecker(),r.start);n&&a(t,r.file,n.returnTypeNode,n.promisedTypeNode);}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="disableJsDiagnostics",n="disableJsDiagnostics",i=e.mapDefined(Object.keys(e.Diagnostics),(function(t){var r=e.Diagnostics[t];return r.category===e.DiagnosticCategory.Error?r.code:void 0}));function a(t,r,n,i){var a=e.getLineAndCharacterOfPosition(r,n).line;i&&!e.tryAddToSet(i,a)||t.insertCommentBeforeLine(r,a,n," @ts-ignore");}t.registerCodeFix({errorCodes:i,getCodeActions:function(i){var o=i.sourceFile,s=i.program,c=i.span,l=i.host,u=i.formatContext;if(e.isInJSFile(o)&&e.isCheckJsEnabledForFile(o,s.getCompilerOptions())){var _=o.checkJsDirective?"":e.getNewLineOrDefaultFromHost(l,u.options),d=[t.createCodeFixActionWithoutFixAll(r,[t.createFileTextChanges(o.fileName,[e.createTextChange(o.checkJsDirective?e.createTextSpanFromBounds(o.checkJsDirective.pos,o.checkJsDirective.end):e.createTextSpan(0,0),"// @ts-nocheck".concat(_))])],e.Diagnostics.Disable_checking_for_this_file)];return e.textChanges.isValidLocationToAddComment(o,c.start)&&d.unshift(t.createCodeFixAction(r,e.textChanges.ChangeTracker.with(i,(function(e){return a(e,o,c.start)})),e.Diagnostics.Ignore_this_error_message,n,e.Diagnostics.Add_ts_ignore_to_all_error_messages)),d}},fixIds:[n],getAllCodeActions:function(r){var n=new e.Set;return t.codeFixAll(r,i,(function(t,r){e.textChanges.isValidLocationToAddComment(r.file,r.start)&&a(t,r.file,r.start,n);}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){function r(t){return {trackSymbol:function(){return !1},moduleResolverHost:e.getModuleSpecifierResolverHost(t.program,t.host)}}function n(t,n,a,c,l,u,_,p,g,m){void 0===g&&(g=3),void 0===m&&(m=!1);var y=t.getDeclarations();if(y&&y.length){var v=c.program.getTypeChecker(),h=e.getEmitScriptTarget(c.program.getCompilerOptions()),b=y[0],x=e.getSynthesizedDeepClone(e.getNameOfDeclaration(b),!1),D=function(t){return 4&t?e.factory.createToken(123):16&t?e.factory.createToken(122):void 0}(e.getEffectiveModifierFlags(b)),S=D?e.factory.createNodeArray([D]):void 0,T=v.getWidenedType(v.getTypeOfSymbolAtLocation(t,n)),C=!!(16777216&t.flags),E=!!(8388608&n.flags)||m,k=e.getQuotePreference(a,l);switch(b.kind){case 165:case 166:var N=0===k?268435456:void 0,F=v.typeToTypeNode(T,n,N,r(c));u&&(A=d(F,h))&&(F=A.typeNode,f(u,A.symbols)),_(e.factory.createPropertyDeclaration(void 0,S,x,C&&2&g?e.factory.createToken(57):void 0,F,void 0));break;case 171:case 172:var A,P=v.typeToTypeNode(T,n,void 0,r(c)),w=e.getAllAccessorDeclarations(y,b),I=w.secondAccessor?[w.firstAccessor,w.secondAccessor]:[w.firstAccessor];u&&(A=d(P,h))&&(P=A.typeNode,f(u,A.symbols));for(var O=0,M=I;O<M.length;O++){var L=M[O];if(e.isGetAccessorDeclaration(L))_(e.factory.createGetAccessorDeclaration(void 0,S,x,e.emptyArray,P,E?void 0:p||s(k)));else {e.Debug.assertNode(L,e.isSetAccessorDeclaration,"The counterpart to a getter should be a setter");var R=e.getSetAccessorValueParameter(L),B=R&&e.isIdentifier(R.name)?e.idText(R.name):void 0;_(e.factory.createSetAccessorDeclaration(void 0,S,x,o(1,[B],[P],1,!1),E?void 0:p||s(k)));}}break;case 167:case 168:var j=v.getSignaturesOfType(T,0);if(!e.some(j))break;if(1===y.length){e.Debug.assert(1===j.length,"One declaration implies one signature"),U(k,j[0],S,x,E?void 0:p||s(k));break}for(var J=0,z=j;J<z.length;J++)U(k,z[J],e.getSynthesizedDeepClones(S,!1),e.getSynthesizedDeepClone(x,!1));E||(y.length>j.length?U(k,v.getSignatureFromDeclaration(y[y.length-1]),S,x,p||s(k)):(e.Debug.assert(y.length===j.length,"Declarations and signatures should match count"),_(function(t,n,i,a,c,l,u,_,d){for(var p=a[0],f=a[0].minArgumentCount,g=!1,m=0,y=a;m<y.length;m++){var v=y[m];f=Math.min(v.minArgumentCount,f),e.signatureHasRestParameter(v)&&(g=!0),v.parameters.length>=p.parameters.length&&(!e.signatureHasRestParameter(v)||e.signatureHasRestParameter(p))&&(p=v);}var h=p.parameters.length-(e.signatureHasRestParameter(p)?1:0),b=p.parameters.map((function(e){return e.name})),x=o(h,b,void 0,f,!1);if(g){var D=e.factory.createArrayTypeNode(e.factory.createKeywordTypeNode(130)),S=e.factory.createParameterDeclaration(void 0,void 0,e.factory.createToken(25),b[h]||"rest",h>=f?e.factory.createToken(57):void 0,D,void 0);x.push(S);}return function(t,r,n,i,a,o,c,l){return e.factory.createMethodDeclaration(void 0,t,void 0,r,n?e.factory.createToken(57):void 0,void 0,a,o,l||s(c))}(u,c,l,0,x,function(t,n,i,a){if(e.length(t)){var o=n.getUnionType(e.map(t,n.getReturnTypeOfSignature));return n.typeToTypeNode(o,a,void 0,r(i))}}(a,t,n,i),_,d)}(v,c,n,j,x,C&&!!(1&g),S,k,p))));}}function U(e,t,r,a,o){var s=i(168,c,e,t,o,a,r,C&&!!(1&g),n,u);s&&_(s);}}function i(t,n,i,a,o,s,c,l,u,_){var p=n.program,g=p.getTypeChecker(),m=e.getEmitScriptTarget(p.getCompilerOptions()),y=1073742081|(0===i?268435456:0),v=g.signatureToSignatureDeclaration(a,t,u,y,r(n));if(v){var h=v.typeParameters,b=v.parameters,x=v.type;if(_){if(h){var D=e.sameMap(h,(function(t){var r,n=t.constraint,i=t.default;return n&&(r=d(n,m))&&(n=r.typeNode,f(_,r.symbols)),i&&(r=d(i,m))&&(i=r.typeNode,f(_,r.symbols)),e.factory.updateTypeParameterDeclaration(t,t.name,n,i)}));h!==D&&(h=e.setTextRange(e.factory.createNodeArray(D,h.hasTrailingComma),h));}var S=e.sameMap(b,(function(t){var r=d(t.type,m),n=t.type;return r&&(n=r.typeNode,f(_,r.symbols)),e.factory.updateParameterDeclaration(t,t.decorators,t.modifiers,t.dotDotDotToken,t.name,t.questionToken,n,t.initializer)}));if(b!==S&&(b=e.setTextRange(e.factory.createNodeArray(S,b.hasTrailingComma),b)),x){var T=d(x,m);T&&(x=T.typeNode,f(_,T.symbols));}}var C=l?e.factory.createToken(57):void 0,E=v.asteriskToken;return e.isFunctionExpression(v)?e.factory.updateFunctionExpression(v,c,v.asteriskToken,e.tryCast(s,e.isIdentifier),h,b,x,null!=o?o:v.body):e.isArrowFunction(v)?e.factory.updateArrowFunction(v,c,h,b,x,v.equalsGreaterThanToken,null!=o?o:v.body):e.isMethodDeclaration(v)?e.factory.updateMethodDeclaration(v,void 0,c,E,null!=s?s:e.factory.createIdentifier(""),C,h,b,x,o):void 0}}function a(t,r,n,i,a,o,s){var c=t.typeToTypeNode(n,i,o,s);if(c&&e.isImportTypeNode(c)){var l=d(c,a);l&&(f(r,l.symbols),c=l.typeNode);}return e.getSynthesizedDeepClone(c)}function o(t,r,n,i,a){for(var o=[],s=0;s<t;s++){var c=e.factory.createParameterDeclaration(void 0,void 0,void 0,r&&r[s]||"arg".concat(s),void 0!==i&&s>=i?e.factory.createToken(57):void 0,a?void 0:n&&n[s]||e.factory.createKeywordTypeNode(130),void 0);o.push(c);}return o}function s(t){return c(e.Diagnostics.Method_not_implemented.message,t)}function c(t,r){return e.factory.createBlock([e.factory.createThrowStatement(e.factory.createNewExpression(e.factory.createIdentifier("Error"),void 0,[e.factory.createStringLiteral(t,0===r)]))],!0)}function l(t,r,n){var i=e.getTsConfigObjectLiteralExpression(r);if(i){var a=_(i,"compilerOptions");if(void 0!==a){var o=a.initializer;if(e.isObjectLiteralExpression(o))for(var s=0,c=n;s<c.length;s++){var l=c[s],d=l[0],p=l[1],f=_(o,d);void 0===f?t.insertNodeAtObjectStart(r,o,u(d,p)):t.replaceNode(r,f.initializer,p);}}else t.insertNodeAtObjectStart(r,i,u("compilerOptions",e.factory.createObjectLiteralExpression(n.map((function(e){return u(e[0],e[1])})),!0)));}}function u(t,r){return e.factory.createPropertyAssignment(e.factory.createStringLiteral(t),r)}function _(t,r){return e.find(t.properties,(function(t){return e.isPropertyAssignment(t)&&!!t.name&&e.isStringLiteral(t.name)&&t.name.text===r}))}function d(t,r){var n,i=e.visitNode(t,(function t(i){var a;if(e.isLiteralImportTypeNode(i)&&i.qualifier){var o=e.getFirstIdentifier(i.qualifier),s=e.getNameForExportedSymbol(o.symbol,r),c=s!==o.text?p(i.qualifier,e.factory.createIdentifier(s)):i.qualifier;n=e.append(n,o.symbol);var l=null===(a=i.typeArguments)||void 0===a?void 0:a.map(t);return e.factory.createTypeReferenceNode(c,l)}return e.visitEachChild(i,t,e.nullTransformationContext)}));if(n&&i)return {typeNode:i,symbols:n}}function p(t,r){return 79===t.kind?r:e.factory.createQualifiedName(p(t.left,r),t.right)}function f(e,t){t.forEach((function(t){return e.addImportFromExportedSymbol(t,!0)}));}var g;t.createMissingMemberNodes=function(e,t,r,i,a,o,s){for(var c=e.symbol.members,l=0,u=t;l<u.length;l++){var _=u[l];c.has(_.escapedName)||n(_,e,r,i,a,o,s,void 0);}},t.getNoopSymbolTrackerWithResolver=r,(g=t.PreserveOptionalFlags||(t.PreserveOptionalFlags={}))[g.Method=1]="Method",g[g.Property=2]="Property",g[g.All=3]="All",t.addNewNodeForMemberSymbol=n,t.createSignatureDeclarationFromSignature=i,t.createSignatureDeclarationFromCallExpression=function(t,n,i,l,u,_,d){var p=e.getQuotePreference(n.sourceFile,n.preferences),f=e.getEmitScriptTarget(n.program.getCompilerOptions()),g=r(n),m=n.program.getTypeChecker(),y=e.isInJSFile(d),v=l.typeArguments,h=l.arguments,b=l.parent,x=y?void 0:m.getContextualType(l),D=e.map(h,(function(t){return e.isIdentifier(t)?t.text:e.isPropertyAccessExpression(t)&&e.isIdentifier(t.name)?t.name.text:void 0})),S=y?[]:e.map(h,(function(e){return a(m,i,m.getBaseTypeOfLiteralType(m.getTypeAtLocation(e)),d,f,void 0,g)})),T=_?e.factory.createNodeArray(e.factory.createModifiersFromModifierFlags(_)):void 0,C=e.isYieldExpression(b)?e.factory.createToken(41):void 0,E=y||void 0===v?void 0:e.map(v,(function(t,r){return e.factory.createTypeParameterDeclaration(84+v.length-1<=90?String.fromCharCode(84+r):"T".concat(r))})),k=o(h.length,D,S,void 0,y),N=y||void 0===x?void 0:m.typeToTypeNode(x,d,void 0,g);return 168===t?e.factory.createMethodDeclaration(void 0,T,C,u,void 0,E,k,N,e.isInterfaceDeclaration(d)?void 0:s(p)):e.factory.createFunctionDeclaration(void 0,T,C,u,E,k,N,c(e.Diagnostics.Function_not_implemented.message,p))},t.typeToAutoImportableTypeNode=a,t.createStubbedBody=c,t.setJsonCompilerOptionValues=l,t.setJsonCompilerOptionValue=function(e,t,r,n){l(e,t,[[r,n]]);},t.createJsonPropertyAssignment=u,t.findJsonProperty=_,t.tryGetAutoImportableReferenceFromTypeNode=d,t.importSymbols=f;}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){function r(t){return e.isParameterPropertyDeclaration(t,t.parent)||e.isPropertyDeclaration(t)||e.isPropertyAssignment(t)}function i(t,r){return e.isIdentifier(r)?e.factory.createIdentifier(t):e.factory.createStringLiteral(t)}function a(t,r,n){var i=r?n.name:e.factory.createThis();return e.isIdentifier(t)?e.factory.createPropertyAccessExpression(i,t):e.factory.createElementAccessExpression(i,e.factory.createStringLiteralFromNode(t))}function o(t,n,a,o,s){void 0===s&&(s=!0);var l=e.getTokenAtPosition(t,a),u=a===o&&s,_=e.findAncestor(l.parent,r);if(!_||!e.nodeOverlapsWithStartEnd(_.name,t,a,o)&&!u)return {error:e.getLocaleSpecificMessage(e.Diagnostics.Could_not_find_property_for_which_to_generate_accessor)};if(!function(t){return e.isIdentifier(t)||e.isStringLiteral(t)}(_.name))return {error:e.getLocaleSpecificMessage(e.Diagnostics.Name_is_not_valid)};if(124!=(124|e.getEffectiveModifierFlags(_)))return {error:e.getLocaleSpecificMessage(e.Diagnostics.Can_only_convert_property_with_modifier)};var d=_.name.text,p=e.startsWithUnderscore(d),f=i(p?d:e.getUniqueName("_".concat(d),t),_.name),g=i(p?e.getUniqueName(d.substring(1),t):d,_.name);return {isStatic:e.hasStaticModifier(_),isReadonly:e.hasEffectiveReadonlyModifier(_),type:c(_,n),container:163===_.kind?_.parent.parent:_.parent,originalName:_.name.text,declaration:_,fieldName:f,accessorName:g,renameAccessor:p}}function s(t,r,n,i,a){e.isParameterPropertyDeclaration(i,i.parent)?t.insertNodeAtClassStart(r,a,n):e.isPropertyAssignment(i)?t.insertNodeAfterComma(r,i,n):t.insertNodeAfter(r,i,n);}function c(t,r){var i=e.getTypeAnnotationNode(t);if(e.isPropertyDeclaration(t)&&i&&t.questionToken){var a=r.getTypeChecker(),o=a.getTypeFromTypeNode(i);if(!a.isTypeAssignableTo(a.getUndefinedType(),o)){var s=e.isUnionTypeNode(i)?i.types:[i];return e.factory.createUnionTypeNode(n$3(n$3([],s,!0),[e.factory.createKeywordTypeNode(152)],!1))}}return i}t.generateAccessorFromProperty=function(t,r,n,i,c,l){var u=o(t,r,n,i);if(u&&!e.refactor.isRefactorErrorInfo(u)){var _,d,p=e.textChanges.ChangeTracker.fromContext(c),f=u.isStatic,g=u.isReadonly,m=u.fieldName,y=u.accessorName,v=u.originalName,h=u.type,b=u.container,x=u.declaration;if(e.suppressLeadingAndTrailingTrivia(m),e.suppressLeadingAndTrailingTrivia(y),e.suppressLeadingAndTrailingTrivia(x),e.suppressLeadingAndTrailingTrivia(b),e.isClassLike(b)){var D=e.getEffectiveModifierFlags(x);if(e.isSourceFileJS(t)){var S=e.createModifiers(D);_=S,d=S;}else _=e.createModifiers(function(e){return e&=-65,16&(e&=-9)||(e|=4),e}(D)),d=e.createModifiers(function(e){return e&=-5,8|(e&=-17)}(D));}!function(t,r,n,i,a,o){e.isPropertyDeclaration(n)?function(t,r,n,i,a,o){var s=e.factory.updatePropertyDeclaration(n,n.decorators,o,a,n.questionToken||n.exclamationToken,i,n.initializer);t.replaceNode(r,n,s);}(t,r,n,i,a,o):e.isPropertyAssignment(n)?function(t,r,n,i){var a=e.factory.updatePropertyAssignment(n,i,n.initializer);t.replacePropertyAssignment(r,n,a);}(t,r,n,a):t.replaceNode(r,n,e.factory.updateParameterDeclaration(n,n.decorators,o,n.dotDotDotToken,e.cast(a,e.isIdentifier),n.questionToken,n.type,n.initializer));}(p,t,x,h,m,d);var T=function(t,r,n,i,o,s){return e.factory.createGetAccessorDeclaration(void 0,i,r,void 0,n,e.factory.createBlock([e.factory.createReturnStatement(a(t,o,s))],!0))}(m,y,h,_,f,b);if(e.suppressLeadingAndTrailingTrivia(T),s(p,t,T,x,b),g){var C=e.getFirstConstructorWithBody(b);C&&function(t,r,n,i,a){n.body&&n.body.forEachChild((function n(o){e.isElementAccessExpression(o)&&108===o.expression.kind&&e.isStringLiteral(o.argumentExpression)&&o.argumentExpression.text===a&&e.isWriteAccess(o)&&t.replaceNode(r,o.argumentExpression,e.factory.createStringLiteral(i)),e.isPropertyAccessExpression(o)&&108===o.expression.kind&&o.name.text===a&&e.isWriteAccess(o)&&t.replaceNode(r,o.name,e.factory.createIdentifier(i)),e.isFunctionLike(o)||e.isClassLike(o)||o.forEachChild(n);}));}(p,t,C,m.text,v);}else {var E=function(t,r,n,i,o,s){return e.factory.createSetAccessorDeclaration(void 0,i,r,[e.factory.createParameterDeclaration(void 0,void 0,void 0,e.factory.createIdentifier("value"),void 0,n)],e.factory.createBlock([e.factory.createExpressionStatement(e.factory.createAssignment(a(t,o,s),e.factory.createIdentifier("value")))],!0))}(m,y,h,_,f,b);e.suppressLeadingAndTrailingTrivia(E),s(p,t,E,x,b);}return p.getChanges()}},t.getAccessorConvertiblePropertyAtPosition=o,t.getAllSupers=function(t,r){for(var n=[];t;){var i=e.getClassExtendsHeritageElement(t),a=i&&r.getSymbolAtLocation(i.expression);if(!a)break;var o=2097152&a.flags?r.getAliasedSymbol(a):a,s=o.declarations&&e.find(o.declarations,e.isClassLike);if(!s)break;n.push(s),t=s;}return n};}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="invalidImportSyntax";function n(n,i,a,o){var s=e.textChanges.ChangeTracker.with(n,(function(e){return e.replaceNode(i,a,o)}));return t.createCodeFixActionWithoutFixAll(r,s,[e.Diagnostics.Replace_import_with_0,s[0].textChanges[0].newText])}function i(i,a){var o=i.program.getTypeChecker().getTypeAtLocation(a);if(!o.symbol||!o.symbol.originatingImport)return [];var s=[],c=o.symbol.originatingImport;if(e.isImportCall(c)||e.addRange(s,function(t,r){var i=e.getSourceFileOfNode(r),a=e.getNamespaceDeclarationNode(r),o=t.program.getCompilerOptions(),s=[];return s.push(n(t,i,r,e.makeImport(a.name,void 0,r.moduleSpecifier,e.getQuotePreference(i,t.preferences)))),e.getEmitModuleKind(o)===e.ModuleKind.CommonJS&&s.push(n(t,i,r,e.factory.createImportEqualsDeclaration(void 0,void 0,!1,a.name,e.factory.createExternalModuleReference(r.moduleSpecifier)))),s}(i,c)),e.isExpression(a)&&(!e.isNamedDeclaration(a.parent)||a.parent.name!==a)){var l=i.sourceFile,u=e.textChanges.ChangeTracker.with(i,(function(t){return t.replaceNode(l,a,e.factory.createPropertyAccessExpression(a,"default"),{})}));s.push(t.createCodeFixActionWithoutFixAll(r,u,e.Diagnostics.Use_synthetic_default_member));}return s}t.registerCodeFix({errorCodes:[e.Diagnostics.This_expression_is_not_callable.code,e.Diagnostics.This_expression_is_not_constructable.code],getCodeActions:function(t){var r=t.sourceFile,n=e.Diagnostics.This_expression_is_not_callable.code===t.errorCode?207:208,a=e.findAncestor(e.getTokenAtPosition(r,t.span.start),(function(e){return e.kind===n}));return a?i(t,a.expression):[]}}),t.registerCodeFix({errorCodes:[e.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code,e.Diagnostics.Type_0_does_not_satisfy_the_constraint_1.code,e.Diagnostics.Type_0_is_not_assignable_to_type_1.code,e.Diagnostics.Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated.code,e.Diagnostics.Type_predicate_0_is_not_assignable_to_1.code,e.Diagnostics.Property_0_of_type_1_is_not_assignable_to_2_index_type_3.code,e.Diagnostics._0_index_type_1_is_not_assignable_to_2_index_type_3.code,e.Diagnostics.Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2.code,e.Diagnostics.Property_0_in_type_1_is_not_assignable_to_type_2.code,e.Diagnostics.Property_0_of_JSX_spread_attribute_is_not_assignable_to_target_property.code,e.Diagnostics.The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1.code],getCodeActions:function(t){var r=t.sourceFile,n=e.findAncestor(e.getTokenAtPosition(r,t.span.start),(function(e){return e.getStart()===t.span.start&&e.getEnd()===t.span.start+t.span.length}));return n?i(t,n):[]}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="strictClassInitialization",n="addMissingPropertyDefiniteAssignmentAssertions",i="addMissingPropertyUndefinedType",a="addMissingPropertyInitializer",o=[e.Diagnostics.Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor.code];function s(t,r){var n=e.getTokenAtPosition(t,r);return e.isIdentifier(n)?e.cast(n.parent,e.isPropertyDeclaration):void 0}function c(i,a){var o=e.textChanges.ChangeTracker.with(i,(function(e){return l(e,i.sourceFile,a)}));return t.createCodeFixAction(r,o,[e.Diagnostics.Add_definite_assignment_assertion_to_property_0,a.getText()],n,e.Diagnostics.Add_definite_assignment_assertions_to_all_uninitialized_properties)}function l(t,r,n){var i=e.factory.updatePropertyDeclaration(n,n.decorators,n.modifiers,n.name,e.factory.createToken(53),n.type,n.initializer);t.replaceNode(r,n,i);}function u(n,a){var o=e.textChanges.ChangeTracker.with(n,(function(e){return _(e,n.sourceFile,a)}));return t.createCodeFixAction(r,o,[e.Diagnostics.Add_undefined_type_to_property_0,a.name.getText()],i,e.Diagnostics.Add_undefined_type_to_all_uninitialized_properties)}function _(t,r,n){var i=e.factory.createKeywordTypeNode(152),a=n.type,o=e.isUnionTypeNode(a)?a.types.concat(i):[a,i];t.replaceNode(r,a,e.factory.createUnionTypeNode(o));}function d(t,r,n,i){var a=e.factory.updatePropertyDeclaration(n,n.decorators,n.modifiers,n.name,n.questionToken,n.type,i);t.replaceNode(r,n,a);}function p(e,t){return f(e,e.getTypeFromTypeNode(t.type))}function f(t,r){if(512&r.flags)return r===t.getFalseType()||r===t.getFalseType(!0)?e.factory.createFalse():e.factory.createTrue();if(r.isStringLiteral())return e.factory.createStringLiteral(r.value);if(r.isNumberLiteral())return e.factory.createNumericLiteral(r.value);if(2048&r.flags)return e.factory.createBigIntLiteral(r.value);if(r.isUnion())return e.firstDefined(r.types,(function(e){return f(t,e)}));if(r.isClass()){var n=e.getClassLikeDeclarationOfSymbol(r.symbol);if(!n||e.hasSyntacticModifier(n,128))return;var i=e.getFirstConstructorWithBody(n);if(i&&i.parameters.length)return;return e.factory.createNewExpression(e.factory.createIdentifier(r.symbol.name),void 0,void 0)}return t.isArrayLikeType(r)?e.factory.createArrayLiteralExpression():void 0}t.registerCodeFix({errorCodes:o,getCodeActions:function(n){var i=s(n.sourceFile,n.span.start);if(i){var o=[u(n,i),c(n,i)];return e.append(o,function(n,i){var o=p(n.program.getTypeChecker(),i);if(o){var s=e.textChanges.ChangeTracker.with(n,(function(e){return d(e,n.sourceFile,i,o)}));return t.createCodeFixAction(r,s,[e.Diagnostics.Add_initializer_to_property_0,i.name.getText()],a,e.Diagnostics.Add_initializers_to_all_uninitialized_properties)}}(n,i)),o}},fixIds:[n,i,a],getAllCodeActions:function(r){return t.codeFixAll(r,o,(function(t,o){var c=s(o.file,o.start);if(c)switch(r.fixId){case n:l(t,o.file,c);break;case i:_(t,o.file,c);break;case a:var u=p(r.program.getTypeChecker(),c);if(!u)return;d(t,o.file,c,u);break;default:e.Debug.fail(JSON.stringify(r.fixId));}}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="requireInTs",n=[e.Diagnostics.require_call_may_be_converted_to_an_import.code];function i(t,r,n){var i=n.allowSyntheticDefaults,a=n.defaultImportName,o=n.namedImports,s=n.statement,c=n.required;t.replaceNode(r,s,a&&!i?e.factory.createImportEqualsDeclaration(void 0,void 0,!1,a,e.factory.createExternalModuleReference(c)):e.factory.createImportDeclaration(void 0,void 0,e.factory.createImportClause(!1,a,o),c,void 0));}function a(t,r,n){var i=e.getTokenAtPosition(t,n).parent;if(!e.isRequireCall(i,!0))throw e.Debug.failBadSyntaxKind(i);var a=e.cast(i.parent,e.isVariableDeclaration),o=e.tryCast(a.name,e.isIdentifier),s=e.isObjectBindingPattern(a.name)?function(t){for(var r=[],n=0,i=t.elements;n<i.length;n++){var a=i[n];if(!e.isIdentifier(a.name)||a.initializer)return;r.push(e.factory.createImportSpecifier(!1,e.tryCast(a.propertyName,e.isIdentifier),a.name));}if(r.length)return e.factory.createNamedImports(r)}(a.name):void 0;if(o||s)return {allowSyntheticDefaults:e.getAllowSyntheticDefaultImports(r.getCompilerOptions()),defaultImportName:o,namedImports:s,statement:e.cast(a.parent.parent,e.isVariableStatement),required:e.first(i.arguments)}}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var o=a(n.sourceFile,n.program,n.span.start);if(o){var s=e.textChanges.ChangeTracker.with(n,(function(e){return i(e,n.sourceFile,o)}));return [t.createCodeFixAction(r,s,e.Diagnostics.Convert_require_to_import,r,e.Diagnostics.Convert_all_require_to_import)]}},fixIds:[r],getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(t,r){var n=a(r.file,e.program,r.start);n&&i(t,e.sourceFile,n);}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="useDefaultImport",n=[e.Diagnostics.Import_may_be_converted_to_a_default_import.code];function i(t,r){var n=e.getTokenAtPosition(t,r);if(e.isIdentifier(n)){var i=n.parent;if(e.isImportEqualsDeclaration(i)&&e.isExternalModuleReference(i.moduleReference))return {importNode:i,name:n,moduleSpecifier:i.moduleReference.expression};if(e.isNamespaceImport(i)){var a=i.parent.parent;return {importNode:a,name:n,moduleSpecifier:a.moduleSpecifier}}}}function a(t,r,n,i){t.replaceNode(r,n.importNode,e.makeImport(n.name,void 0,n.moduleSpecifier,e.getQuotePreference(r,i)));}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var o=n.sourceFile,s=n.span.start,c=i(o,s);if(c){var l=e.textChanges.ChangeTracker.with(n,(function(e){return a(e,o,c,n.preferences)}));return [t.createCodeFixAction(r,l,e.Diagnostics.Convert_to_default_import,r,e.Diagnostics.Convert_all_to_default_imports)]}},fixIds:[r],getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(t,r){var n=i(r.file,r.start);n&&a(t,r.file,n,e.preferences);}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="useBigintLiteral",n=[e.Diagnostics.Numeric_literals_with_absolute_values_equal_to_2_53_or_greater_are_too_large_to_be_represented_accurately_as_integers.code];function i(t,r,n){var i=e.tryCast(e.getTokenAtPosition(r,n.start),e.isNumericLiteral);if(i){var a=i.getText(r)+"n";t.replaceNode(r,i,e.factory.createBigIntLiteral(a));}}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var a=e.textChanges.ChangeTracker.with(n,(function(e){return i(e,n.sourceFile,n.span)}));if(a.length>0)return [t.createCodeFixAction(r,a,e.Diagnostics.Convert_to_a_bigint_numeric_literal,r,e.Diagnostics.Convert_all_to_bigint_numeric_literals)]},fixIds:[r],getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(e,t){return i(e,t.file,t)}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="fixAddModuleReferTypeMissingTypeof",n=[e.Diagnostics.Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0.code];function i(t,r){var n=e.getTokenAtPosition(t,r);return e.Debug.assert(100===n.kind,"This token should be an ImportKeyword"),e.Debug.assert(199===n.parent.kind,"Token parent should be an ImportType"),n.parent}function a(t,r,n){var i=e.factory.updateImportTypeNode(n,n.argument,n.qualifier,n.typeArguments,!0);t.replaceNode(r,n,i);}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var o=n.sourceFile,s=n.span,c=i(o,s.start),l=e.textChanges.ChangeTracker.with(n,(function(e){return a(e,o,c)}));return [t.createCodeFixAction(r,l,e.Diagnostics.Add_missing_typeof,r,e.Diagnostics.Add_missing_typeof)]},fixIds:[r],getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(t,r){return a(t,e.sourceFile,i(r.file,r.start))}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="wrapJsxInFragment",n=[e.Diagnostics.JSX_expressions_must_have_one_parent_element.code];function i(t,r){var n=e.getTokenAtPosition(t,r).parent.parent;if((e.isBinaryExpression(n)||(n=n.parent,e.isBinaryExpression(n)))&&e.nodeIsMissing(n.operatorToken))return n}function a(t,r,n){var i=function(t){for(var r=[],n=t;;){if(e.isBinaryExpression(n)&&e.nodeIsMissing(n.operatorToken)&&27===n.operatorToken.kind){if(r.push(n.left),e.isJsxChild(n.right))return r.push(n.right),r;if(e.isBinaryExpression(n.right)){n=n.right;continue}return}return}}(n);i&&t.replaceNode(r,n,e.factory.createJsxFragment(e.factory.createJsxOpeningFragment(),i,e.factory.createJsxJsxClosingFragment()));}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var o=n.sourceFile,s=n.span,c=i(o,s.start);if(c){var l=e.textChanges.ChangeTracker.with(n,(function(e){return a(e,o,c)}));return [t.createCodeFixAction(r,l,e.Diagnostics.Wrap_in_JSX_fragment,r,e.Diagnostics.Wrap_all_unparented_JSX_in_JSX_fragment)]}},fixIds:[r],getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(t,r){var n=i(e.sourceFile,r.start);n&&a(t,e.sourceFile,n);}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="fixConvertToMappedObjectType",i=[e.Diagnostics.An_index_signature_parameter_type_cannot_be_a_literal_type_or_generic_type_Consider_using_a_mapped_object_type_instead.code];function a(t,r){var n=e.getTokenAtPosition(t,r),i=e.cast(n.parent.parent,e.isIndexSignatureDeclaration);if(!e.isClassDeclaration(i.parent))return {indexSignature:i,container:e.isInterfaceDeclaration(i.parent)?i.parent:e.cast(i.parent.parent,e.isTypeAliasDeclaration)}}function o(t,r,i){var a,o,s=i.indexSignature,c=i.container,l=(e.isInterfaceDeclaration(c)?c.members:c.type.members).filter((function(t){return !e.isIndexSignatureDeclaration(t)})),u=e.first(s.parameters),_=e.factory.createTypeParameterDeclaration(e.cast(u.name,e.isIdentifier),u.type),d=e.factory.createMappedTypeNode(e.hasEffectiveReadonlyModifier(s)?e.factory.createModifier(144):void 0,_,void 0,s.questionToken,s.type,void 0),p=e.factory.createIntersectionTypeNode(n$3(n$3(n$3([],e.getAllSuperTypeNodes(c),!0),[d],!1),l.length?[e.factory.createTypeLiteralNode(l)]:e.emptyArray,!0));t.replaceNode(r,c,(a=c,o=p,e.factory.createTypeAliasDeclaration(a.decorators,a.modifiers,a.name,a.typeParameters,o)));}t.registerCodeFix({errorCodes:i,getCodeActions:function(n){var i=n.sourceFile,s=n.span,c=a(i,s.start);if(c){var l=e.textChanges.ChangeTracker.with(n,(function(e){return o(e,i,c)})),u=e.idText(c.container.name);return [t.createCodeFixAction(r,l,[e.Diagnostics.Convert_0_to_mapped_object_type,u],r,[e.Diagnostics.Convert_0_to_mapped_object_type,u])]}},fixIds:[r],getAllCodeActions:function(e){return t.codeFixAll(e,i,(function(e,t){var r=a(t.file,t.start);r&&o(e,t.file,r);}))}});}(e.codefix||(e.codefix={}));}(t),function(e){var t,r,n;t=e.codefix||(e.codefix={}),r="removeAccidentalCallParentheses",n=[e.Diagnostics.This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without.code],t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var i=e.findAncestor(e.getTokenAtPosition(n.sourceFile,n.span.start),e.isCallExpression);if(i){var a=e.textChanges.ChangeTracker.with(n,(function(e){e.deleteRange(n.sourceFile,{pos:i.expression.end,end:i.end});}));return [t.createCodeFixActionWithoutFixAll(r,a,e.Diagnostics.Remove_parentheses)]}},fixIds:[r]});}(t),function(e){!function(t){var r="removeUnnecessaryAwait",n=[e.Diagnostics.await_has_no_effect_on_the_type_of_this_expression.code];function i(t,r,n){var i=e.tryCast(e.getTokenAtPosition(r,n.start),(function(e){return 132===e.kind})),a=i&&e.tryCast(i.parent,e.isAwaitExpression);if(a){var o=a;if(e.isParenthesizedExpression(a.parent)){var s=e.getLeftmostExpression(a.expression,!1);if(e.isIdentifier(s)){var c=e.findPrecedingToken(a.parent.pos,r);c&&103!==c.kind&&(o=a.parent);}}t.replaceNode(r,o,a.expression);}}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var a=e.textChanges.ChangeTracker.with(n,(function(e){return i(e,n.sourceFile,n.span)}));if(a.length>0)return [t.createCodeFixAction(r,a,e.Diagnostics.Remove_unnecessary_await,r,e.Diagnostics.Remove_all_unnecessary_uses_of_await)]},fixIds:[r],getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(e,t){return i(e,t.file,t)}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r=[e.Diagnostics.A_type_only_import_can_specify_a_default_import_or_named_bindings_but_not_both.code],n="splitTypeOnlyImport";function i(t,r){return e.findAncestor(e.getTokenAtPosition(t,r.start),e.isImportDeclaration)}function a(t,r,n){if(r){var i=e.Debug.checkDefined(r.importClause);t.replaceNode(n.sourceFile,r,e.factory.updateImportDeclaration(r,r.decorators,r.modifiers,e.factory.updateImportClause(i,i.isTypeOnly,i.name,void 0),r.moduleSpecifier,r.assertClause)),t.insertNodeAfter(n.sourceFile,r,e.factory.createImportDeclaration(void 0,void 0,e.factory.updateImportClause(i,i.isTypeOnly,void 0,i.namedBindings),r.moduleSpecifier,r.assertClause));}}t.registerCodeFix({errorCodes:r,fixIds:[n],getCodeActions:function(r){var o=e.textChanges.ChangeTracker.with(r,(function(e){return a(e,i(r.sourceFile,r.span),r)}));if(o.length)return [t.createCodeFixAction(n,o,e.Diagnostics.Split_into_two_separate_import_declarations,n,e.Diagnostics.Split_all_invalid_type_only_imports)]},getAllCodeActions:function(e){return t.codeFixAll(e,r,(function(t,r){a(t,i(e.sourceFile,r),e);}))}});}(e.codefix||(e.codefix={}));}(t),function(e){var t,r,n;t=e.codefix||(e.codefix={}),r="fixConvertConstToLet",n=[e.Diagnostics.Cannot_assign_to_0_because_it_is_a_constant.code],t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var i=n.sourceFile,a=n.span,o=n.program,s=function(t,r,n){var i,a=n.getTypeChecker().getSymbolAtLocation(e.getTokenAtPosition(t,r)),o=e.tryCast(null===(i=null==a?void 0:a.valueDeclaration)||void 0===i?void 0:i.parent,e.isVariableDeclarationList);if(void 0!==o){var s=e.findChildOfKind(o,85,t);if(void 0!==s)return e.createRange(s.pos,s.end)}}(i,a.start,o);if(void 0!==s){var c=e.textChanges.ChangeTracker.with(n,(function(e){return function(e,t,r){e.replaceRangeWithText(t,r,"let");}(e,i,s)}));return [t.createCodeFixAction(r,c,e.Diagnostics.Convert_const_to_let,r,e.Diagnostics.Convert_const_to_let)]}},fixIds:[r]});}(t),function(e){!function(t){var r="fixExpectedComma",n=[e.Diagnostics._0_expected.code];function i(t,r,n){var i=e.getTokenAtPosition(t,r);return 26===i.kind&&i.parent&&(e.isObjectLiteralExpression(i.parent)||e.isArrayLiteralExpression(i.parent))?{node:i}:void 0}function a(t,r,n){var i=n.node,a=e.factory.createToken(27);t.replaceNode(r,i,a);}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var o=n.sourceFile,s=i(o,n.span.start);if(s){var c=e.textChanges.ChangeTracker.with(n,(function(e){return a(e,o,s)}));return [t.createCodeFixAction(r,c,[e.Diagnostics.Change_0_to_1,";",","],r,[e.Diagnostics.Change_0_to_1,";",","])]}},fixIds:[r],getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(t,r){var n=i(r.file,r.start);n&&a(t,e.sourceFile,n);}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="addVoidToPromise",n=[e.Diagnostics.Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise.code];function i(t,r,n,i,a){var o=e.getTokenAtPosition(r,n.start);if(e.isIdentifier(o)&&e.isCallExpression(o.parent)&&o.parent.expression===o&&0===o.parent.arguments.length){var s=i.getTypeChecker(),c=s.getSymbolAtLocation(o),l=null==c?void 0:c.valueDeclaration;if(l&&e.isParameter(l)&&e.isNewExpression(l.parent.parent)&&!(null==a?void 0:a.has(l))){null==a||a.add(l);var u=function(t){var r;if(!e.isInJSFile(t))return t.typeArguments;if(e.isParenthesizedExpression(t.parent)){var n=null===(r=e.getJSDocTypeTag(t.parent))||void 0===r?void 0:r.typeExpression.type;if(n&&e.isTypeReferenceNode(n)&&e.isIdentifier(n.typeName)&&"Promise"===e.idText(n.typeName))return n.typeArguments}}(l.parent.parent);if(e.some(u)){var _=u[0],d=!e.isUnionTypeNode(_)&&!e.isParenthesizedTypeNode(_)&&e.isParenthesizedTypeNode(e.factory.createUnionTypeNode([_,e.factory.createKeywordTypeNode(114)]).types[0]);d&&t.insertText(r,_.pos,"("),t.insertText(r,_.end,d?") | void":" | void");}else {var p=s.getResolvedSignature(o.parent),f=null==p?void 0:p.parameters[0],g=f&&s.getTypeOfSymbolAtLocation(f,l.parent.parent);e.isInJSFile(l)?(!g||3&g.flags)&&(t.insertText(r,l.parent.parent.end,")"),t.insertText(r,e.skipTrivia(r.text,l.parent.parent.pos),"/** @type {Promise<void>} */(")):(!g||2&g.flags)&&t.insertText(r,l.parent.parent.expression.end,"<void>");}}}}t.registerCodeFix({errorCodes:n,fixIds:[r],getCodeActions:function(n){var a=e.textChanges.ChangeTracker.with(n,(function(e){return i(e,n.sourceFile,n.span,n.program)}));if(a.length>0)return [t.createCodeFixAction("addVoidToPromise",a,e.Diagnostics.Add_void_to_Promise_resolved_without_a_value,r,e.Diagnostics.Add_void_to_all_Promises_resolved_without_a_value)]},getAllCodeActions:function(r){return t.codeFixAll(r,n,(function(t,n){return i(t,n.file,n,r.program,new e.Set)}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="Convert export",n={name:"Convert default export to named export",description:e.Diagnostics.Convert_default_export_to_named_export.message,kind:"refactor.rewrite.export.named"},a={name:"Convert named export to default export",description:e.Diagnostics.Convert_named_export_to_default_export.message,kind:"refactor.rewrite.export.default"};function o(t,r){void 0===r&&(r=!0);var n=t.file,i=t.program,a=e.getRefactorContextSpan(t),o=e.getTokenAtPosition(n,a.start),s=o.parent&&1&e.getSyntacticModifierFlags(o.parent)&&r?o.parent:e.getParentNodeInSpan(o,n,a);if(!s||!(e.isSourceFile(s.parent)||e.isModuleBlock(s.parent)&&e.isAmbientModule(s.parent.parent)))return {error:e.getLocaleSpecificMessage(e.Diagnostics.Could_not_find_export_statement)};var c=e.isSourceFile(s.parent)?s.parent.symbol:s.parent.parent.symbol,l=e.getSyntacticModifierFlags(s)||(e.isExportAssignment(s)&&!s.isExportEquals?513:0),u=!!(512&l);if(!(1&l)||!u&&c.exports.has("default"))return {error:e.getLocaleSpecificMessage(e.Diagnostics.This_file_already_has_a_default_export)};var _=i.getTypeChecker(),d=function(t){return e.isIdentifier(t)&&_.getSymbolAtLocation(t)?void 0:{error:e.getLocaleSpecificMessage(e.Diagnostics.Can_only_convert_named_export)}};switch(s.kind){case 255:case 256:case 257:case 259:case 258:case 260:if(!(g=s).name)return;return d(g.name)||{exportNode:g,exportName:g.name,wasDefault:u,exportingModuleSymbol:c};case 236:var p=s;if(!(2&p.declarationList.flags)||1!==p.declarationList.declarations.length)return;var f=e.first(p.declarationList.declarations);if(!f.initializer)return;return e.Debug.assert(!u,"Can't have a default flag here"),d(f.name)||{exportNode:p,exportName:f.name,wasDefault:u,exportingModuleSymbol:c};case 270:var g;if((g=s).isExportEquals)return;return d(g.expression)||{exportNode:g,exportName:g.expression,wasDefault:u,exportingModuleSymbol:c};default:return}}function s(t,r){return e.factory.createImportSpecifier(!1,t===r?void 0:e.factory.createIdentifier(t),e.factory.createIdentifier(r))}function c(t,r){return e.factory.createExportSpecifier(!1,t===r?void 0:e.factory.createIdentifier(t),e.factory.createIdentifier(r))}t.registerRefactor(r,{kinds:[n.kind,a.kind],getAvailableActions:function(s){var c=o(s,"invoked"===s.triggerReason);if(!c)return e.emptyArray;if(!t.isRefactorErrorInfo(c)){var l=c.wasDefault?n:a;return [{name:r,description:l.description,actions:[l]}]}return s.preferences.provideRefactorNotApplicableReason?[{name:r,description:e.Diagnostics.Convert_default_export_to_named_export.message,actions:[i$1(i$1({},n),{notApplicableReason:c.error}),i$1(i$1({},a),{notApplicableReason:c.error})]}]:e.emptyArray},getEditsForAction:function(r,i){e.Debug.assert(i===n.name||i===a.name,"Unexpected action name");var l=o(r);return e.Debug.assert(l&&!t.isRefactorErrorInfo(l),"Expected applicable refactor info"),{edits:e.textChanges.ChangeTracker.with(r,(function(t){return function(t,r,n,i,a){(function(t,r,n,i){var a=r.wasDefault,o=r.exportNode,s=r.exportName;if(a)if(e.isExportAssignment(o)&&!o.isExportEquals){var l=o.expression,u=c(l.text,l.text);n.replaceNode(t,o,e.factory.createExportDeclaration(void 0,void 0,!1,e.factory.createNamedExports([u])));}else n.delete(t,e.Debug.checkDefined(e.findModifier(o,88),"Should find a default keyword in modifier list"));else {var _=e.Debug.checkDefined(e.findModifier(o,93),"Should find an export keyword in modifier list");switch(o.kind){case 255:case 256:case 257:n.insertNodeAfter(t,_,e.factory.createToken(88));break;case 236:var d=e.first(o.declarationList.declarations);if(!e.FindAllReferences.Core.isSymbolReferencedInFile(s,i,t)&&!d.type){n.replaceNode(t,o,e.factory.createExportDefault(e.Debug.checkDefined(d.initializer,"Initializer was previously known to be present")));break}case 259:case 258:case 260:n.deleteModifier(t,_),n.insertNodeAfter(t,o,e.factory.createExportDefault(e.factory.createIdentifier(s.text)));break;default:e.Debug.fail("Unexpected exportNode kind ".concat(o.kind));}}})(t,n,i,r.getTypeChecker()),function(t,r,n,i){var a=r.wasDefault,o=r.exportName,l=r.exportingModuleSymbol,u=t.getTypeChecker(),_=e.Debug.checkDefined(u.getSymbolAtLocation(o),"Export name should resolve to a symbol");e.FindAllReferences.Core.eachExportReference(t.getSourceFiles(),u,i,_,l,o.text,a,(function(t){var r=t.getSourceFile();a?function(t,r,n,i){var a=r.parent;switch(a.kind){case 205:n.replaceNode(t,r,e.factory.createIdentifier(i));break;case 269:case 274:var o=a;n.replaceNode(t,o,s(i,o.name.text));break;case 266:var c=a;e.Debug.assert(c.name===r,"Import clause name should match provided ref"),o=s(i,r.text);var l=c.namedBindings;if(l)if(267===l.kind){n.deleteRange(t,{pos:r.getStart(t),end:l.getStart(t)});var u=e.isStringLiteral(c.parent.moduleSpecifier)?e.quotePreferenceFromString(c.parent.moduleSpecifier,t):1,_=e.makeImport(void 0,[s(i,r.text)],c.parent.moduleSpecifier,u);n.insertNodeAfter(t,c.parent,_);}else n.delete(t,r),n.insertNodeAtEndOfList(t,l.elements,o);else n.replaceNode(t,r,e.factory.createNamedImports([o]));break;default:e.Debug.failBadSyntaxKind(a);}}(r,t,n,o.text):function(t,r,n){var i=r.parent;switch(i.kind){case 205:n.replaceNode(t,r,e.factory.createIdentifier("default"));break;case 269:var a=e.factory.createIdentifier(i.name.text);1===i.parent.elements.length?n.replaceNode(t,i.parent,a):(n.delete(t,i),n.insertNodeBefore(t,i.parent,a));break;case 274:n.replaceNode(t,i,c("default",i.name.text));break;default:e.Debug.assertNever(i,"Unexpected parent kind ".concat(i.kind));}}(r,t,n);}));}(r,n,i,a);}(r.file,r.program,l,t,r.cancellationToken)})),renameFilename:void 0,renameLocation:void 0}}});}(e.refactor||(e.refactor={}));}(t),function(e){!function(t){var r="Convert import",n={name:"Convert namespace import to named imports",description:e.Diagnostics.Convert_namespace_import_to_named_imports.message,kind:"refactor.rewrite.import.named"},a={name:"Convert named imports to namespace import",description:e.Diagnostics.Convert_named_imports_to_namespace_import.message,kind:"refactor.rewrite.import.namespace"};function o(t,r){void 0===r&&(r=!0);var n=t.file,i=e.getRefactorContextSpan(t),a=e.getTokenAtPosition(n,i.start),o=r?e.findAncestor(a,e.isImportDeclaration):e.getParentNodeInSpan(a,n,i);if(!o||!e.isImportDeclaration(o))return {error:"Selection is not an import declaration."};var s=i.start+i.length,c=e.findNextToken(o,o.parent,n);if(!(c&&s>c.getStart())){var l=o.importClause;return l?l.namedBindings?l.namedBindings:{error:e.getLocaleSpecificMessage(e.Diagnostics.Could_not_find_namespace_import_or_named_imports)}:{error:e.getLocaleSpecificMessage(e.Diagnostics.Could_not_find_import_clause)}}}function s(t){return e.isPropertyAccessExpression(t)?t.name:t.right}function c(t,r,n){return e.factory.createImportDeclaration(void 0,void 0,e.factory.createImportClause(!1,r,n&&n.length?e.factory.createNamedImports(n):void 0),t.moduleSpecifier,void 0)}t.registerRefactor(r,{kinds:[n.kind,a.kind],getAvailableActions:function(s){var c=o(s,"invoked"===s.triggerReason);if(!c)return e.emptyArray;if(!t.isRefactorErrorInfo(c)){var l=267===c.kind?n:a;return [{name:r,description:l.description,actions:[l]}]}return s.preferences.provideRefactorNotApplicableReason?[{name:r,description:n.description,actions:[i$1(i$1({},n),{notApplicableReason:c.error})]},{name:r,description:a.description,actions:[i$1(i$1({},a),{notApplicableReason:c.error})]}]:e.emptyArray},getEditsForAction:function(r,i){e.Debug.assert(i===n.name||i===a.name,"Unexpected action name");var l=o(r);return e.Debug.assert(l&&!t.isRefactorErrorInfo(l),"Expected applicable refactor info"),{edits:e.textChanges.ChangeTracker.with(r,(function(t){return n=r.file,i=r.program,a=t,o=l,u=i.getTypeChecker(),void(267===o.kind?function(t,r,n,i,a){var o=!1,l=[],u=new e.Map;e.FindAllReferences.Core.eachSymbolReferenceInFile(i.name,r,t,(function(t){if(e.isPropertyAccessOrQualifiedName(t.parent)){var n=s(t.parent).text;r.resolveName(n,t,67108863,!0)&&u.set(n,!0),e.Debug.assert(function(t){return e.isPropertyAccessExpression(t)?t.expression:t.left}(t.parent)===t,"Parent expression should match id"),l.push(t.parent);}else o=!0;}));for(var _=new e.Map,d=0,p=l;d<p.length;d++){var f=p[d],g=s(f).text,m=_.get(g);void 0===m&&_.set(g,m=u.has(g)?e.getUniqueName(g,t):g),n.replaceNode(t,f,e.factory.createIdentifier(m));}var y=[];_.forEach((function(t,r){y.push(e.factory.createImportSpecifier(!1,t===r?void 0:e.factory.createIdentifier(r),e.factory.createIdentifier(t)));}));var v=i.parent.parent;o&&!a?n.insertNodeAfter(t,v,c(v,void 0,y)):n.replaceNode(t,v,c(v,o?e.factory.createIdentifier(i.name.text):void 0,y));}(n,u,a,o,e.getAllowSyntheticDefaultImports(i.getCompilerOptions())):function(t,r,n,i){var a=i.parent.parent,o=a.moduleSpecifier,s=new e.Set;i.elements.forEach((function(e){var t=r.getSymbolAtLocation(e.name);t&&s.add(t);}));var l=o&&e.isStringLiteral(o)?e.codefix.moduleSpecifierToValidIdentifier(o.text,99):"module";for(var u=i.elements.some((function(n){return !!e.FindAllReferences.Core.eachSymbolReferenceInFile(n.name,r,t,(function(t){var n=r.resolveName(l,t,67108863,!0);return !!n&&(!s.has(n)||e.isExportSpecifier(t.parent))}))}))?e.getUniqueName(l,t):l,_=new e.Set,d=function(i){var a=(i.propertyName||i.name).text;e.FindAllReferences.Core.eachSymbolReferenceInFile(i.name,r,t,(function(r){var o=e.factory.createPropertyAccessExpression(e.factory.createIdentifier(u),a);e.isShorthandPropertyAssignment(r.parent)?n.replaceNode(t,r.parent,e.factory.createPropertyAssignment(r.text,o)):e.isExportSpecifier(r.parent)?_.add(i):n.replaceNode(t,r,o);}));},p=0,f=i.elements;p<f.length;p++)d(f[p]);if(n.replaceNode(t,i,e.factory.createNamespaceImport(e.factory.createIdentifier(u))),_.size){var g=e.arrayFrom(_.values()).map((function(t){return e.factory.createImportSpecifier(t.isTypeOnly,t.propertyName&&e.factory.createIdentifier(t.propertyName.text),e.factory.createIdentifier(t.name.text))}));n.insertNodeAfter(t,i.parent.parent,c(a,void 0,g));}}(n,u,a,o));var n,i,a,o,u;})),renameFilename:void 0,renameLocation:void 0}}});}(e.refactor||(e.refactor={}));}(t),function(e){var t;(function(r){var n="Convert to optional chain expression",a=e.getLocaleSpecificMessage(e.Diagnostics.Convert_to_optional_chain_expression),o={name:n,description:a,kind:"refactor.rewrite.expression.optionalChain"};function s(t){return e.isBinaryExpression(t)||e.isConditionalExpression(t)}function c(t){return s(t)||function(t){return e.isExpressionStatement(t)||e.isReturnStatement(t)||e.isVariableStatement(t)}(t)}function l(t,r){void 0===r&&(r=!0);var n=t.file,i=t.program,a=e.getRefactorContextSpan(t),o=0===a.length;if(!o||r){var l=e.getTokenAtPosition(n,a.start),d=e.findTokenOnLeftOfPosition(n,a.start+a.length),f=e.createTextSpanFromBounds(l.pos,d&&d.end>=l.pos?d.getEnd():l.getEnd()),g=o?function(e){for(;e.parent;){if(c(e)&&!c(e.parent))return e;e=e.parent;}}(l):function(e,t){for(;e.parent;){if(c(e)&&0!==t.length&&e.end>=t.start+t.length)return e;e=e.parent;}}(l,f),m=g&&c(g)?function(t){if(s(t))return t;if(e.isVariableStatement(t)){var r=e.getSingleVariableOfVariableStatement(t),n=null==r?void 0:r.initializer;return n&&s(n)?n:void 0}return t.expression&&s(t.expression)?t.expression:void 0}(g):void 0;if(!m)return {error:e.getLocaleSpecificMessage(e.Diagnostics.Could_not_find_convertible_access_expression)};var y=i.getTypeChecker();return e.isConditionalExpression(m)?function(t,r){var n=t.condition,i=p(t.whenTrue);if(!i||r.isNullableType(r.getTypeAtLocation(i)))return {error:e.getLocaleSpecificMessage(e.Diagnostics.Could_not_find_convertible_access_expression)};if((e.isPropertyAccessExpression(n)||e.isIdentifier(n))&&_(n,i.expression))return {finalExpression:i,occurrences:[n],expression:t};if(e.isBinaryExpression(n)){var a=u(i.expression,n);return a?{finalExpression:i,occurrences:a,expression:t}:{error:e.getLocaleSpecificMessage(e.Diagnostics.Could_not_find_matching_access_expressions)}}}(m,y):function(t){if(55!==t.operatorToken.kind)return {error:e.getLocaleSpecificMessage(e.Diagnostics.Can_only_convert_logical_AND_access_chains)};var r=p(t.right);if(!r)return {error:e.getLocaleSpecificMessage(e.Diagnostics.Could_not_find_convertible_access_expression)};var n=u(r.expression,t.left);return n?{finalExpression:r,occurrences:n,expression:t}:{error:e.getLocaleSpecificMessage(e.Diagnostics.Could_not_find_matching_access_expressions)}}(m)}}function u(t,r){for(var n=[];e.isBinaryExpression(r)&&55===r.operatorToken.kind;){var i=_(e.skipParentheses(t),e.skipParentheses(r.right));if(!i)break;n.push(i),t=i,r=r.left;}var a=_(t,r);return a&&n.push(a),n.length>0?n:void 0}function _(t,r){if(e.isIdentifier(r)||e.isPropertyAccessExpression(r)||e.isElementAccessExpression(r))return function(t,r){for(;(e.isCallExpression(t)||e.isPropertyAccessExpression(t)||e.isElementAccessExpression(t))&&d(t)!==d(r);)t=t.expression;for(;e.isPropertyAccessExpression(t)&&e.isPropertyAccessExpression(r)||e.isElementAccessExpression(t)&&e.isElementAccessExpression(r);){if(d(t)!==d(r))return !1;t=t.expression,r=r.expression;}return e.isIdentifier(t)&&e.isIdentifier(r)&&t.getText()===r.getText()}(t,r)?r:void 0}function d(t){return e.isIdentifier(t)||e.isStringOrNumericLiteralLike(t)?t.getText():e.isPropertyAccessExpression(t)?d(t.name):e.isElementAccessExpression(t)?d(t.argumentExpression):void 0}function p(t){return t=e.skipParentheses(t),e.isBinaryExpression(t)?p(t.left):(e.isPropertyAccessExpression(t)||e.isElementAccessExpression(t)||e.isCallExpression(t))&&!e.isOptionalChain(t)?t:void 0}function f(t,r,n){if(e.isPropertyAccessExpression(r)||e.isElementAccessExpression(r)||e.isCallExpression(r)){var i=f(t,r.expression,n),a=n.length>0?n[n.length-1]:void 0,o=(null==a?void 0:a.getText())===r.expression.getText();if(o&&n.pop(),e.isCallExpression(r))return o?e.factory.createCallChain(i,e.factory.createToken(28),r.typeArguments,r.arguments):e.factory.createCallChain(i,r.questionDotToken,r.typeArguments,r.arguments);if(e.isPropertyAccessExpression(r))return o?e.factory.createPropertyAccessChain(i,e.factory.createToken(28),r.name):e.factory.createPropertyAccessChain(i,r.questionDotToken,r.name);if(e.isElementAccessExpression(r))return o?e.factory.createElementAccessChain(i,e.factory.createToken(28),r.argumentExpression):e.factory.createElementAccessChain(i,r.questionDotToken,r.argumentExpression)}return r}t.registerRefactor(n,{kinds:[o.kind],getAvailableActions:function(r){var s=l(r,"invoked"===r.triggerReason);return s?t.isRefactorErrorInfo(s)?r.preferences.provideRefactorNotApplicableReason?[{name:n,description:a,actions:[i$1(i$1({},o),{notApplicableReason:s.error})]}]:e.emptyArray:[{name:n,description:a,actions:[o]}]:e.emptyArray},getEditsForAction:function(r,n){var i=l(r);return e.Debug.assert(i&&!t.isRefactorErrorInfo(i),"Expected applicable refactor info"),{edits:e.textChanges.ChangeTracker.with(r,(function(t){return function(t,r,n,i,a){var o=i.finalExpression,s=i.occurrences,c=i.expression,l=s[s.length-1],u=f(r,o,s);u&&(e.isPropertyAccessExpression(u)||e.isElementAccessExpression(u)||e.isCallExpression(u))&&(e.isBinaryExpression(c)?n.replaceNodeRange(t,l,o,u):e.isConditionalExpression(c)&&n.replaceNode(t,c,e.factory.createBinaryExpression(u,e.factory.createToken(60),c.whenFalse)));}(r.file,r.program.getTypeChecker(),t,i)})),renameFilename:void 0,renameLocation:void 0}}});})((t=e.refactor||(e.refactor={})).convertToOptionalChainExpression||(t.convertToOptionalChainExpression={}));}(t),function(e){var t;(function(r){var n="Convert overload list to single signature",i=e.Diagnostics.Convert_overload_list_to_single_signature.message,a={name:n,description:i,kind:"refactor.rewrite.function.overloadList"};function o(e){switch(e.kind){case 167:case 168:case 173:case 170:case 174:case 255:return !0}return !1}function s(t,r,n){var i=e.getTokenAtPosition(t,r),a=e.findAncestor(i,o);if(a){var s=n.getTypeChecker(),c=a.symbol;if(c){var l=c.declarations;if(!(e.length(l)<=1)&&e.every(l,(function(r){return e.getSourceFileOfNode(r)===t}))&&o(l[0])){var u=l[0].kind;if(e.every(l,(function(e){return e.kind===u}))){var _=l;if(!e.some(_,(function(t){return !!t.typeParameters||e.some(t.parameters,(function(t){return !!t.decorators||!!t.modifiers||!e.isIdentifier(t.name)}))}))){var d=e.mapDefined(_,(function(e){return s.getSignatureFromDeclaration(e)}));if(e.length(d)===e.length(l)){var p=s.getReturnTypeOfSignature(d[0]);if(e.every(d,(function(e){return s.getReturnTypeOfSignature(e)===p})))return _}}}}}}}t.registerRefactor(n,{kinds:[a.kind],getEditsForAction:function(t){var r=t.file,n=t.startPosition,i=t.program,a=s(r,n,i);if(a){var o=i.getTypeChecker(),c=a[a.length-1],l=c;switch(c.kind){case 167:l=e.factory.updateMethodSignature(c,c.modifiers,c.name,c.questionToken,c.typeParameters,u(a),c.type);break;case 168:l=e.factory.updateMethodDeclaration(c,c.decorators,c.modifiers,c.asteriskToken,c.name,c.questionToken,c.typeParameters,u(a),c.type,c.body);break;case 173:l=e.factory.updateCallSignature(c,c.typeParameters,u(a),c.type);break;case 170:l=e.factory.updateConstructorDeclaration(c,c.decorators,c.modifiers,u(a),c.body);break;case 174:l=e.factory.updateConstructSignature(c,c.typeParameters,u(a),c.type);break;case 255:l=e.factory.updateFunctionDeclaration(c,c.decorators,c.modifiers,c.asteriskToken,c.name,c.typeParameters,u(a),c.type,c.body);break;default:return e.Debug.failBadSyntaxKind(c,"Unhandled signature kind in overload list conversion refactoring")}if(l!==c)return {renameFilename:void 0,renameLocation:void 0,edits:e.textChanges.ChangeTracker.with(t,(function(e){e.replaceNodeRange(r,a[0],a[a.length-1],l);}))}}function u(t){var r=t[t.length-1];return e.isFunctionLikeDeclaration(r)&&r.body&&(t=t.slice(0,t.length-1)),e.factory.createNodeArray([e.factory.createParameterDeclaration(void 0,void 0,e.factory.createToken(25),"args",void 0,e.factory.createUnionTypeNode(e.map(t,_)))])}function _(t){var r=e.map(t.parameters,d);return e.setEmitFlags(e.factory.createTupleTypeNode(r),e.some(r,(function(t){return !!e.length(e.getSyntheticLeadingComments(t))}))?0:1)}function d(t){e.Debug.assert(e.isIdentifier(t.name));var r=e.setTextRange(e.factory.createNamedTupleMember(t.dotDotDotToken,t.name,t.questionToken,t.type||e.factory.createKeywordTypeNode(130)),t),n=t.symbol&&t.symbol.getDocumentationComment(o);if(n){var i=e.displayPartsToString(n);i.length&&e.setSyntheticLeadingComments(r,[{text:"*\n".concat(i.split("\n").map((function(e){return " * ".concat(e)})).join("\n"),"\n "),kind:3,pos:-1,end:-1,hasTrailingNewLine:!0,hasLeadingNewline:!0}]);}return r}},getAvailableActions:function(t){return s(t.file,t.startPosition,t.program)?[{name:n,description:i,actions:[a]}]:e.emptyArray}});})((t=e.refactor||(e.refactor={})).addOrRemoveBracesToArrowFunction||(t.addOrRemoveBracesToArrowFunction={}));}(t),function(e){var t;(function(r){var n,a,o,s,c="Extract Symbol",l={name:"Extract Constant",description:e.getLocaleSpecificMessage(e.Diagnostics.Extract_constant),kind:"refactor.extract.constant"},u={name:"Extract Function",description:e.getLocaleSpecificMessage(e.Diagnostics.Extract_function),kind:"refactor.extract.function"};function _(r){var n=r.kind,a=p(r.file,e.getRefactorContextSpan(r),"invoked"===r.triggerReason),o=a.targetRange;if(void 0===o){if(!a.errors||0===a.errors.length||!r.preferences.provideRefactorNotApplicableReason)return e.emptyArray;var s=[];return t.refactorKindBeginsWith(u.kind,n)&&s.push({name:c,description:u.description,actions:[i$1(i$1({},u),{notApplicableReason:F(a.errors)})]}),t.refactorKindBeginsWith(l.kind,n)&&s.push({name:c,description:l.description,actions:[i$1(i$1({},l),{notApplicableReason:F(a.errors)})]}),s}var _=function(t,r){var n=m(t,r),i=n.scopes,a=n.readsAndWrites,o=a.functionErrorsPerScope,s=a.constantErrorsPerScope;return i.map((function(t,r){var n,i,a=function(t){return e.isFunctionLikeDeclaration(t)?"inner function":e.isClassLike(t)?"method":"function"}(t),c=function(t){return e.isClassLike(t)?"readonly field":"constant"}(t),l=e.isFunctionLikeDeclaration(t)?function(t){switch(t.kind){case 170:return "constructor";case 212:case 255:return t.name?"function '".concat(t.name.text,"'"):e.ANONYMOUS;case 213:return "arrow function";case 168:return "method '".concat(t.name.getText(),"'");case 171:return "'get ".concat(t.name.getText(),"'");case 172:return "'set ".concat(t.name.getText(),"'");default:throw e.Debug.assertNever(t,"Unexpected scope kind ".concat(t.kind))}}(t):e.isClassLike(t)?function(e){return 256===e.kind?e.name?"class '".concat(e.name.text,"'"):"anonymous class declaration":e.name?"class expression '".concat(e.name.text,"'"):"anonymous class expression"}(t):function(e){return 261===e.kind?"namespace '".concat(e.parent.name.getText(),"'"):e.externalModuleIndicator?0:1}(t);return 1===l?(n=e.formatStringFromArgs(e.getLocaleSpecificMessage(e.Diagnostics.Extract_to_0_in_1_scope),[a,"global"]),i=e.formatStringFromArgs(e.getLocaleSpecificMessage(e.Diagnostics.Extract_to_0_in_1_scope),[c,"global"])):0===l?(n=e.formatStringFromArgs(e.getLocaleSpecificMessage(e.Diagnostics.Extract_to_0_in_1_scope),[a,"module"]),i=e.formatStringFromArgs(e.getLocaleSpecificMessage(e.Diagnostics.Extract_to_0_in_1_scope),[c,"module"])):(n=e.formatStringFromArgs(e.getLocaleSpecificMessage(e.Diagnostics.Extract_to_0_in_1),[a,l]),i=e.formatStringFromArgs(e.getLocaleSpecificMessage(e.Diagnostics.Extract_to_0_in_1),[c,l])),0!==r||e.isClassLike(t)||(i=e.formatStringFromArgs(e.getLocaleSpecificMessage(e.Diagnostics.Extract_to_0_in_enclosing_scope),[c])),{functionExtraction:{description:n,errors:o[r]},constantExtraction:{description:i,errors:s[r]}}}))}(o,r);if(void 0===_)return e.emptyArray;for(var d,f,g=[],y=new e.Map,v=[],h=new e.Map,b=0,x=0,D=_;x<D.length;x++){var S=D[x],T=S.functionExtraction,C=S.constantExtraction,E=T.description;if(t.refactorKindBeginsWith(u.kind,n)&&(0===T.errors.length?y.has(E)||(y.set(E,!0),g.push({description:E,name:"function_scope_".concat(b),kind:u.kind})):d||(d={description:E,name:"function_scope_".concat(b),notApplicableReason:F(T.errors),kind:u.kind})),t.refactorKindBeginsWith(l.kind,n))if(0===C.errors.length){var k=C.description;h.has(k)||(h.set(k,!0),v.push({description:k,name:"constant_scope_".concat(b),kind:l.kind}));}else f||(f={description:E,name:"constant_scope_".concat(b),notApplicableReason:F(C.errors),kind:l.kind});b++;}var N=[];return g.length?N.push({name:c,description:e.getLocaleSpecificMessage(e.Diagnostics.Extract_function),actions:g}):r.preferences.provideRefactorNotApplicableReason&&d&&N.push({name:c,description:e.getLocaleSpecificMessage(e.Diagnostics.Extract_function),actions:[d]}),v.length?N.push({name:c,description:e.getLocaleSpecificMessage(e.Diagnostics.Extract_constant),actions:v}):r.preferences.provideRefactorNotApplicableReason&&f&&N.push({name:c,description:e.getLocaleSpecificMessage(e.Diagnostics.Extract_constant),actions:[f]}),N.length?N:e.emptyArray;function F(e){var t=e[0].messageText;return "string"!=typeof t&&(t=t.messageText),t}}function d(t,r){var n=p(t.file,e.getRefactorContextSpan(t)).targetRange,i=/^function_scope_(\d+)$/.exec(r);if(i){var o=+i[1];return e.Debug.assert(isFinite(o),"Expected to parse a finite number from the function scope index"),function(t,r,n){var i=m(t,r),o=i.scopes,s=i.readsAndWrites,c=s.target,l=s.usagesPerScope,u=s.functionErrorsPerScope,_=s.exposedVariableDeclarations;return e.Debug.assert(!u[n].length,"The extraction went missing? How?"),r.cancellationToken.throwIfCancellationRequested(),function(t,r,n,i,o,s){var c,l,u=n.usages,_=n.typeParameterUsages,d=n.substitutions,p=s.program.getTypeChecker(),f=e.getEmitScriptTarget(s.program.getCompilerOptions()),g=e.codefix.createImportAdder(s.file,s.program,s.preferences,s.host),m=r.getSourceFile(),x=e.getUniqueName(e.isClassLike(r)?"newMethod":"newFunction",m),D=e.isInJSFile(r),T=e.factory.createIdentifier(x),C=[],E=[];u.forEach((function(t,n){var i;if(!D){var a=p.getTypeOfSymbolAtLocation(t.symbol,t.node);a=p.getBaseTypeOfLiteralType(a),i=e.codefix.typeToAutoImportableTypeNode(p,g,a,r,f,1);}var o=e.factory.createParameterDeclaration(void 0,void 0,void 0,n,void 0,i);C.push(o),2===t.usage&&(l||(l=[])).push(t),E.push(e.factory.createIdentifier(n));}));var k=e.arrayFrom(_.values()).map((function(e){return {type:e,declaration:y(e)}})).sort(v),N=0===k.length?void 0:k.map((function(e){return e.declaration})),F=void 0!==N?N.map((function(t){return e.factory.createTypeReferenceNode(t.name,void 0)})):void 0;if(e.isExpression(t)&&!D){var A=p.getContextualType(t);c=p.typeToTypeNode(A,r,1);}var P,w=function(t,r,n,i,a){var o,s=void 0!==n||r.length>0;if(e.isBlock(t)&&!s&&0===i.size)return {body:e.factory.createBlock(t.statements,!0),returnValueProperty:void 0};var c=!1,l=e.factory.createNodeArray(e.isBlock(t)?t.statements.slice(0):[e.isStatement(t)?t:e.factory.createReturnStatement(e.skipParentheses(t))]);if(s||i.size){var u=e.visitNodes(l,(function t(a){if(!c&&e.isReturnStatement(a)&&s){var l=h(r,n);return a.expression&&(o||(o="__return"),l.unshift(e.factory.createPropertyAssignment(o,e.visitNode(a.expression,t)))),1===l.length?e.factory.createReturnStatement(l[0].name):e.factory.createReturnStatement(e.factory.createObjectLiteralExpression(l))}var u=c;c=c||e.isFunctionLikeDeclaration(a)||e.isClassLike(a);var _=i.get(e.getNodeId(a).toString()),d=_?e.getSynthesizedDeepClone(_):e.visitEachChild(a,t,e.nullTransformationContext);return c=u,d})).slice();if(s&&!a&&e.isStatement(t)){var _=h(r,n);1===_.length?u.push(e.factory.createReturnStatement(_[0].name)):u.push(e.factory.createReturnStatement(e.factory.createObjectLiteralExpression(_)));}return {body:e.factory.createBlock(u,!0),returnValueProperty:o}}return {body:e.factory.createBlock(l,!0),returnValueProperty:void 0}}(t,i,l,d,!!(o.facts&a.HasReturn)),I=w.body,O=w.returnValueProperty;if(e.suppressLeadingAndTrailingTrivia(I),e.isClassLike(r)){var M=D?[]:[e.factory.createModifier(121)];o.facts&a.InStaticRegion&&M.push(e.factory.createModifier(124)),o.facts&a.IsAsyncFunction&&M.push(e.factory.createModifier(131)),P=e.factory.createMethodDeclaration(void 0,M.length?M:void 0,o.facts&a.IsGenerator?e.factory.createToken(41):void 0,T,void 0,N,C,c,I);}else P=e.factory.createFunctionDeclaration(void 0,o.facts&a.IsAsyncFunction?[e.factory.createToken(131)]:void 0,o.facts&a.IsGenerator?e.factory.createToken(41):void 0,T,N,C,c,I);var L=e.textChanges.ChangeTracker.fromContext(s),R=function(t,r){return e.find(function(t){if(e.isFunctionLikeDeclaration(t)){var r=t.body;if(e.isBlock(r))return r.statements}else {if(e.isModuleBlock(t)||e.isSourceFile(t))return t.statements;if(e.isClassLike(t))return t.members;e.assertType(t);}return e.emptyArray}(r),(function(r){return r.pos>=t&&e.isFunctionLikeDeclaration(r)&&!e.isConstructorDeclaration(r)}))}((b(o.range)?e.last(o.range):o.range).end,r);R?L.insertNodeBefore(s.file,R,P,!0):L.insertNodeAtEndOfScope(s.file,r,P),g.writeFixes(L);var B=[],j=function(t,r,n){var i=e.factory.createIdentifier(n);if(e.isClassLike(t)){var o=r.facts&a.InStaticRegion?e.factory.createIdentifier(t.name.text):e.factory.createThis();return e.factory.createPropertyAccessExpression(o,i)}return i}(r,o,x),J=e.factory.createCallExpression(j,F,E);if(o.facts&a.IsGenerator&&(J=e.factory.createYieldExpression(e.factory.createToken(41),J)),o.facts&a.IsAsyncFunction&&(J=e.factory.createAwaitExpression(J)),S(t)&&(J=e.factory.createJsxExpression(void 0,J)),i.length&&!l)if(e.Debug.assert(!O,"Expected no returnValueProperty"),e.Debug.assert(!(o.facts&a.HasReturn),"Expected RangeFacts.HasReturn flag to be unset"),1===i.length){var z=i[0];B.push(e.factory.createVariableStatement(void 0,e.factory.createVariableDeclarationList([e.factory.createVariableDeclaration(e.getSynthesizedDeepClone(z.name),void 0,e.getSynthesizedDeepClone(z.type),J)],z.parent.flags)));}else {for(var U=[],K=[],V=i[0].parent.flags,q=!1,W=0,H=i;W<H.length;W++){z=H[W],U.push(e.factory.createBindingElement(void 0,void 0,e.getSynthesizedDeepClone(z.name)));var G=p.typeToTypeNode(p.getBaseTypeOfLiteralType(p.getTypeAtLocation(z)),r,1);K.push(e.factory.createPropertySignature(void 0,z.symbol.name,void 0,G)),q=q||void 0!==z.type,V&=z.parent.flags;}var Q=q?e.factory.createTypeLiteralNode(K):void 0;Q&&e.setEmitFlags(Q,1),B.push(e.factory.createVariableStatement(void 0,e.factory.createVariableDeclarationList([e.factory.createVariableDeclaration(e.factory.createObjectBindingPattern(U),void 0,Q,J)],V)));}else if(i.length||l){if(i.length)for(var X=0,Y=i;X<Y.length;X++){var Z=(z=Y[X]).parent.flags;2&Z&&(Z=-3&Z|1),B.push(e.factory.createVariableStatement(void 0,e.factory.createVariableDeclarationList([e.factory.createVariableDeclaration(z.symbol.name,void 0,re(z.type))],Z)));}O&&B.push(e.factory.createVariableStatement(void 0,e.factory.createVariableDeclarationList([e.factory.createVariableDeclaration(O,void 0,re(c))],1)));var $=h(i,l);O&&$.unshift(e.factory.createShorthandPropertyAssignment(O)),1===$.length?(e.Debug.assert(!O,"Shouldn't have returnValueProperty here"),B.push(e.factory.createExpressionStatement(e.factory.createAssignment($[0].name,J))),o.facts&a.HasReturn&&B.push(e.factory.createReturnStatement())):(B.push(e.factory.createExpressionStatement(e.factory.createAssignment(e.factory.createObjectLiteralExpression($),J))),O&&B.push(e.factory.createReturnStatement(e.factory.createIdentifier(O))));}else o.facts&a.HasReturn?B.push(e.factory.createReturnStatement(J)):b(o.range)?B.push(e.factory.createExpressionStatement(J)):B.push(J);b(o.range)?L.replaceNodeRangeWithNodes(s.file,e.first(o.range),e.last(o.range),B):L.replaceNodeWithNodes(s.file,o.range,B);var ee=L.getChanges(),te=(b(o.range)?e.first(o.range):o.range).getSourceFile().fileName;return {renameFilename:te,renameLocation:e.getRenameLocation(ee,te,x,!1),edits:ee};function re(t){if(void 0!==t){for(var r=e.getSynthesizedDeepClone(t),n=r;e.isParenthesizedTypeNode(n);)n=n.type;return e.isUnionTypeNode(n)&&e.find(n.types,(function(e){return 152===e.kind}))?r:e.factory.createUnionTypeNode([r,e.factory.createKeywordTypeNode(152)])}}}(c,o[n],l[n],_,t,r)}(n,t,o)}var s=/^constant_scope_(\d+)$/.exec(r);if(s)return o=+s[1],e.Debug.assert(isFinite(o),"Expected to parse a finite number from the constant scope index"),function(t,r,n){var i=m(t,r),o=i.scopes,s=i.readsAndWrites,c=s.target,l=s.usagesPerScope,u=s.constantErrorsPerScope,_=s.exposedVariableDeclarations;return e.Debug.assert(!u[n].length,"The extraction went missing? How?"),e.Debug.assert(0===_.length,"Extract constant accepted a range containing a variable declaration?"),r.cancellationToken.throwIfCancellationRequested(),function(t,r,n,i,o){var s,c=n.substitutions,l=o.program.getTypeChecker(),u=r.getSourceFile(),_=e.getUniqueName(e.isClassLike(r)?"newProperty":"newLocal",u),d=e.isInJSFile(r),p=d||!l.isContextSensitive(t)?void 0:l.typeToTypeNode(l.getContextualType(t),r,1),f=function(t,r){return r.size?function t(n){var i=r.get(e.getNodeId(n).toString());return i?e.getSynthesizedDeepClone(i):e.visitEachChild(n,t,e.nullTransformationContext)}(t):t}(e.skipParentheses(t),c);s=function(n,i){if(void 0===n)return {variableType:n,initializer:i};if(!e.isFunctionExpression(i)&&!e.isArrowFunction(i)||i.typeParameters)return {variableType:n,initializer:i};var a=l.getTypeAtLocation(t),o=e.singleOrUndefined(l.getSignaturesOfType(a,0));if(!o)return {variableType:n,initializer:i};if(o.getTypeParameters())return {variableType:n,initializer:i};for(var s=[],c=!1,u=0,_=i.parameters;u<_.length;u++){var d=_[u];if(d.type)s.push(d);else {var p=l.getTypeAtLocation(d);p===l.getAnyType()&&(c=!0),s.push(e.factory.updateParameterDeclaration(d,d.decorators,d.modifiers,d.dotDotDotToken,d.name,d.questionToken,d.type||l.typeToTypeNode(p,r,1),d.initializer));}}if(c)return {variableType:n,initializer:i};if(n=void 0,e.isArrowFunction(i))i=e.factory.updateArrowFunction(i,t.modifiers,i.typeParameters,s,i.type||l.typeToTypeNode(o.getReturnType(),r,1),i.equalsGreaterThanToken,i.body);else {if(o&&o.thisParameter){var f=e.firstOrUndefined(s);if(!f||e.isIdentifier(f.name)&&"this"!==f.name.escapedText){var g=l.getTypeOfSymbolAtLocation(o.thisParameter,t);s.splice(0,0,e.factory.createParameterDeclaration(void 0,void 0,void 0,"this",void 0,l.typeToTypeNode(g,r,1)));}}i=e.factory.updateFunctionExpression(i,t.modifiers,i.asteriskToken,i.name,i.typeParameters,s,i.type||l.typeToTypeNode(o.getReturnType(),r,1),i.body);}return {variableType:n,initializer:i}}(p,f),p=s.variableType,f=s.initializer,e.suppressLeadingAndTrailingTrivia(f);var m=e.textChanges.ChangeTracker.fromContext(o);if(e.isClassLike(r)){e.Debug.assert(!d,"Cannot extract to a JS class");var y=[];y.push(e.factory.createModifier(121)),i&a.InStaticRegion&&y.push(e.factory.createModifier(124)),y.push(e.factory.createModifier(144));var v=e.factory.createPropertyDeclaration(void 0,y,_,void 0,p,f),h=e.factory.createPropertyAccessExpression(i&a.InStaticRegion?e.factory.createIdentifier(r.name.getText()):e.factory.createThis(),e.factory.createIdentifier(_));S(t)&&(h=e.factory.createJsxExpression(void 0,h));var b=function(t,r){var n,i=r.members;e.Debug.assert(i.length>0,"Found no members");for(var a=!0,o=0,s=i;o<s.length;o++){var c=s[o];if(c.pos>t)return n||i[0];if(a&&!e.isPropertyDeclaration(c)){if(void 0!==n)return c;a=!1;}n=c;}return void 0===n?e.Debug.fail():n}(t.pos,r);m.insertNodeBefore(o.file,b,v,!0),m.replaceNode(o.file,t,h);}else {var x=e.factory.createVariableDeclaration(_,void 0,p,f),T=function(t,r){for(var n;void 0!==t&&t!==r;){if(e.isVariableDeclaration(t)&&t.initializer===n&&e.isVariableDeclarationList(t.parent)&&t.parent.declarations.length>1)return t;n=t,t=t.parent;}}(t,r);if(T)m.insertNodeBefore(o.file,T,x),h=e.factory.createIdentifier(_),m.replaceNode(o.file,t,h);else if(237===t.parent.kind&&r===e.findAncestor(t,g)){var C=e.factory.createVariableStatement(void 0,e.factory.createVariableDeclarationList([x],2));m.replaceNode(o.file,t.parent,C);}else C=e.factory.createVariableStatement(void 0,e.factory.createVariableDeclarationList([x],2)),0===(b=function(t,r){var n;e.Debug.assert(!e.isClassLike(r));for(var i=t;i!==r;i=i.parent)g(i)&&(n=i);for(i=(n||t).parent;;i=i.parent){if(D(i)){for(var a=void 0,o=0,s=i.statements;o<s.length;o++){var c=s[o];if(c.pos>t.pos)break;a=c;}return !a&&e.isCaseClause(i)?(e.Debug.assert(e.isSwitchStatement(i.parent.parent),"Grandparent isn't a switch statement"),i.parent.parent):e.Debug.checkDefined(a,"prevStatement failed to get set")}e.Debug.assert(i!==r,"Didn't encounter a block-like before encountering scope");}}(t,r)).pos?m.insertNodeAtTopOfFile(o.file,C,!1):m.insertNodeBefore(o.file,b,C,!1),237===t.parent.kind?m.delete(o.file,t.parent):(h=e.factory.createIdentifier(_),S(t)&&(h=e.factory.createJsxExpression(void 0,h)),m.replaceNode(o.file,t,h));}var E=m.getChanges(),k=t.getSourceFile().fileName;return {renameFilename:k,renameLocation:e.getRenameLocation(E,k,_,!0),edits:E}}(e.isExpression(c)?c:c.statements[0].expression,o[n],l[n],t.facts,r)}(n,t,o);e.Debug.fail("Unrecognized action name");}function p(t,r,i){void 0===i&&(i=!0);var o=r.length;if(0===o&&!i)return {errors:[e.createFileDiagnostic(t,r.start,o,n.cannotExtractEmpty)]};var s=0===o&&i,c=e.findFirstNonJsxWhitespaceToken(t,r.start),l=e.findTokenOnLeftOfPosition(t,e.textSpanEnd(r)),u=c&&l&&i?function(e,t,r){var n=e.getStart(r),i=t.getEnd();return 59===r.text.charCodeAt(i)&&i++,{start:n,length:i-n}}(c,l,t):r,_=s?function(t){return e.findAncestor(t,(function(t){return t.parent&&x(t)&&!e.isBinaryExpression(t.parent)}))}(c):e.getParentNodeInSpan(c,t,u),d=s?_:e.getParentNodeInSpan(l,t,u),p=[],g=a.None;if(!_||!d)return {errors:[e.createFileDiagnostic(t,r.start,o,n.cannotExtractRange)]};if(e.isJSDoc(_))return {errors:[e.createFileDiagnostic(t,r.start,o,n.cannotExtractJSDoc)]};if(_.parent!==d.parent)return {errors:[e.createFileDiagnostic(t,r.start,o,n.cannotExtractRange)]};if(_!==d){if(!D(_.parent))return {errors:[e.createFileDiagnostic(t,r.start,o,n.cannotExtractRange)]};for(var m=[],y=0,v=_.parent.statements;y<v.length;y++){var h=v[y];if(h===_||m.length){var b=C(h);if(b)return {errors:b};m.push(h);}if(h===d)break}return m.length?{targetRange:{range:m,facts:g,declarations:p}}:{errors:[e.createFileDiagnostic(t,r.start,o,n.cannotExtractRange)]}}if(e.isReturnStatement(_)&&!_.expression)return {errors:[e.createFileDiagnostic(t,r.start,o,n.cannotExtractRange)]};var S=function(t){if(e.isReturnStatement(t)){if(t.expression)return t.expression}else if(e.isVariableStatement(t)){for(var r=0,n=void 0,i=0,a=t.declarationList.declarations;i<a.length;i++){var o=a[i];o.initializer&&(r++,n=o.initializer);}if(1===r)return n}else if(e.isVariableDeclaration(t)&&t.initializer)return t.initializer;return t}(_),T=function(t){if(e.isIdentifier(e.isExpressionStatement(t)?t.expression:t))return [e.createDiagnosticForNode(t,n.cannotExtractIdentifier)]}(S)||C(S);return T?{errors:T}:{targetRange:{range:f(S),facts:g,declarations:p}};function C(t){var i;if(function(e){e[e.None=0]="None",e[e.Break=1]="Break",e[e.Continue=2]="Continue",e[e.Return=4]="Return";}(i||(i={})),e.Debug.assert(t.pos<=t.end,"This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809 (1)"),e.Debug.assert(!e.positionIsSynthesized(t.pos),"This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809 (2)"),!(e.isStatement(t)||e.isExpressionNode(t)&&x(t)))return [e.createDiagnosticForNode(t,n.statementOrExpressionExpected)];if(8388608&t.flags)return [e.createDiagnosticForNode(t,n.cannotExtractAmbientBlock)];var o,s=e.getContainingClass(t);s&&function(t,r){for(var n=t;n!==r;){if(166===n.kind){e.isStatic(n)&&(g|=a.InStaticRegion);break}if(163===n.kind){170===e.getContainingFunction(n).kind&&(g|=a.InStaticRegion);break}168===n.kind&&e.isStatic(n)&&(g|=a.InStaticRegion),n=n.parent;}}(t,s);var c,l=4;return function t(i){if(o)return !0;if(e.isDeclaration(i)){var s=253===i.kind?i.parent.parent:i;if(e.hasSyntacticModifier(s,1))return (o||(o=[])).push(e.createDiagnosticForNode(i,n.cannotExtractExportedEntity)),!0;p.push(i.symbol);}switch(i.kind){case 265:return (o||(o=[])).push(e.createDiagnosticForNode(i,n.cannotExtractImport)),!0;case 270:return (o||(o=[])).push(e.createDiagnosticForNode(i,n.cannotExtractExportedEntity)),!0;case 106:if(207===i.parent.kind){var u=e.getContainingClass(i);if(u.pos<r.start||u.end>=r.start+r.length)return (o||(o=[])).push(e.createDiagnosticForNode(i,n.cannotExtractSuper)),!0}else g|=a.UsesThis;break;case 213:e.forEachChild(i,(function t(r){if(e.isThis(r))g|=a.UsesThis;else {if(e.isClassLike(r)||e.isFunctionLike(r)&&!e.isArrowFunction(r))return !1;e.forEachChild(r,t);}}));case 256:case 255:e.isSourceFile(i.parent)&&void 0===i.parent.externalModuleIndicator&&(o||(o=[])).push(e.createDiagnosticForNode(i,n.functionWillNotBeVisibleInTheNewScope));case 225:case 212:case 168:case 170:case 171:case 172:return !1}var _=l;switch(i.kind){case 238:case 251:l=0;break;case 234:i.parent&&251===i.parent.kind&&i.parent.finallyBlock===i&&(l=4);break;case 289:case 288:l|=1;break;default:e.isIterationStatement(i,!1)&&(l|=3);}switch(i.kind){case 191:case 108:g|=a.UsesThis;break;case 249:var d=i.label;(c||(c=[])).push(d.escapedText),e.forEachChild(i,t),c.pop();break;case 245:case 244:(d=i.label)?e.contains(c,d.escapedText)||(o||(o=[])).push(e.createDiagnosticForNode(i,n.cannotExtractRangeContainingLabeledBreakOrContinueStatementWithTargetOutsideOfTheRange)):l&(245===i.kind?1:2)||(o||(o=[])).push(e.createDiagnosticForNode(i,n.cannotExtractRangeContainingConditionalBreakOrContinueStatements));break;case 217:g|=a.IsAsyncFunction;break;case 223:g|=a.IsGenerator;break;case 246:4&l?g|=a.HasReturn:(o||(o=[])).push(e.createDiagnosticForNode(i,n.cannotExtractRangeContainingConditionalReturnStatement));break;default:e.forEachChild(i,t);}l=_;}(t),o}}function f(t){return e.isStatement(t)?[t]:e.isExpressionNode(t)?e.isExpressionStatement(t.parent)?[t.parent]:t:void 0}function g(t){return e.isFunctionLikeDeclaration(t)||e.isSourceFile(t)||e.isModuleBlock(t)||e.isClassLike(t)}function m(t,r){var i=r.file,o=function(t){var r=b(t.range)?e.first(t.range):t.range;if(t.facts&a.UsesThis){var n=e.getContainingClass(r);if(n){var i=e.findAncestor(r,e.isFunctionLikeDeclaration);return i?[i,n]:[n]}}for(var o=[];;)if(163===(r=r.parent).kind&&(r=e.findAncestor(r,(function(t){return e.isFunctionLikeDeclaration(t)})).parent),g(r)&&(o.push(r),303===r.kind))return o}(t);return {scopes:o,readsAndWrites:function(t,r,i,o,s,c){var l,u,_=new e.Map,d=[],p=[],f=[],g=[],m=[],y=new e.Map,v=[],h=b(t.range)?1===t.range.length&&e.isExpressionStatement(t.range[0])?t.range[0].expression:void 0:t.range;if(void 0===h){var x=t.range,D=e.first(x).getStart(),S=e.last(x).end;u=e.createFileDiagnostic(o,D,S-D,n.expressionExpected);}else 147456&s.getTypeAtLocation(h).flags&&(u=e.createDiagnosticForNode(h,n.uselessConstantType));for(var T=0,C=r;T<C.length;T++){var E=C[T];d.push({usages:new e.Map,typeParameterUsages:new e.Map,substitutions:new e.Map}),p.push(new e.Map),f.push([]);var k=[];u&&k.push(u),e.isClassLike(E)&&e.isInJSFile(E)&&k.push(e.createDiagnosticForNode(E,n.cannotExtractToJSClass)),e.isArrowFunction(E)&&!e.isBlock(E.body)&&k.push(e.createDiagnosticForNode(E,n.cannotExtractToExpressionArrowFunction)),g.push(k);}var N,F=new e.Map,A=b(t.range)?e.factory.createBlock(t.range):t.range,P=b(t.range)?e.first(t.range):t.range,w=(N=P,!!e.findAncestor(N,(function(t){return e.isDeclarationWithTypeParameters(t)&&0!==e.getEffectiveTypeParameterDeclarations(t).length})));if(function c(l,u){if(void 0===u&&(u=1),w&&K(s.getTypeAtLocation(l)),e.isDeclaration(l)&&l.symbol&&m.push(l),e.isAssignmentExpression(l))c(l.left,2),c(l.right);else if(e.isUnaryExpressionWithWrite(l))c(l.operand,2);else if(e.isPropertyAccessExpression(l)||e.isElementAccessExpression(l))e.forEachChild(l,c);else if(e.isIdentifier(l)){if(!l.parent)return;if(e.isQualifiedName(l.parent)&&l!==l.parent.left)return;if(e.isPropertyAccessExpression(l.parent)&&l!==l.parent.expression)return;!function(c,l,u){var _=function(c,l,u){var _=V(c);if(_){var m=e.getSymbolId(_).toString(),y=F.get(m);if(y&&y>=l)return m;if(F.set(m,l),y){for(var v=0,h=d;v<h.length;v++){var b=h[v];b.usages.get(c.text)&&b.usages.set(c.text,{usage:l,symbol:_,node:c});}return m}var x=_.getDeclarations(),D=x&&e.find(x,(function(e){return e.getSourceFile()===o}));if(D&&!e.rangeContainsStartEnd(i,D.getStart(),D.end)){if(t.facts&a.IsGenerator&&2===l){for(var S=e.createDiagnosticForNode(c,n.cannotExtractRangeThatContainsWritesToReferencesLocatedOutsideOfTheTargetRangeInGenerators),T=0,C=f;T<C.length;T++)C[T].push(S);for(var E=0,k=g;E<k.length;E++)k[E].push(S);}for(var N=0;N<r.length;N++){var A=r[N];if(s.resolveName(_.name,A,_.flags,!1)!==_&&!p[N].has(m)){var P=q(_.exportSymbol||_,A,u);P?p[N].set(m,P):u?262144&_.flags||(S=e.createDiagnosticForNode(c,n.typeWillNotBeVisibleInTheNewScope),f[N].push(S),g[N].push(S)):d[N].usages.set(c.text,{usage:l,symbol:_,node:c});}}return m}}}(c,l,u);if(_)for(var m=0;m<r.length;m++){var y=p[m].get(_);y&&d[m].substitutions.set(e.getNodeId(c).toString(),y);}}(l,u,e.isPartOfTypeNode(l));}else e.forEachChild(l,c);}(A),w&&!b(t.range)&&K(s.getContextualType(t.range)),_.size>0){for(var I=new e.Map,O=0,M=P;void 0!==M&&O<r.length;M=M.parent)if(M===r[O]&&(I.forEach((function(e,t){d[O].typeParameterUsages.set(t,e);})),O++),e.isDeclarationWithTypeParameters(M))for(var L=0,R=e.getEffectiveTypeParameterDeclarations(M);L<R.length;L++){var B=R[L],j=s.getTypeAtLocation(B);_.has(j.id.toString())&&I.set(j.id.toString(),j);}e.Debug.assert(O===r.length,"Should have iterated all scopes");}if(m.length){var J=e.isBlockScope(r[0],r[0].parent)?r[0]:e.getEnclosingBlockScopeContainer(r[0]);e.forEachChild(J,(function r(n){if(!(n===t.range||b(t.range)&&t.range.indexOf(n)>=0)){var i=e.isIdentifier(n)?V(n):s.getSymbolAtLocation(n);if(i){var a=e.find(m,(function(e){return e.symbol===i}));if(a)if(e.isVariableDeclaration(a)){var o=a.symbol.id.toString();y.has(o)||(v.push(a),y.set(o,!0));}else l=l||a;}e.forEachChild(n,r);}}));}for(var z=function(r){var i=d[r];if(r>0&&(i.usages.size>0||i.typeParameterUsages.size>0)){var a=b(t.range)?t.range[0]:t.range;g[r].push(e.createDiagnosticForNode(a,n.cannotAccessVariablesFromNestedScopes));}var o,s=!1;if(d[r].usages.forEach((function(t){2===t.usage&&(s=!0,106500&t.symbol.flags&&t.symbol.valueDeclaration&&e.hasEffectiveModifier(t.symbol.valueDeclaration,64)&&(o=t.symbol.valueDeclaration));})),e.Debug.assert(b(t.range)||0===v.length,"No variable declarations expected if something was extracted"),s&&!b(t.range)){var c=e.createDiagnosticForNode(t.range,n.cannotWriteInExpression);f[r].push(c),g[r].push(c);}else o&&r>0?(c=e.createDiagnosticForNode(o,n.cannotExtractReadonlyPropertyInitializerOutsideConstructor),f[r].push(c),g[r].push(c)):l&&(c=e.createDiagnosticForNode(l,n.cannotExtractExportedEntity),f[r].push(c),g[r].push(c));},U=0;U<r.length;U++)z(U);return {target:A,usagesPerScope:d,functionErrorsPerScope:f,constantErrorsPerScope:g,exposedVariableDeclarations:v};function K(e){for(var t=0,r=s.getSymbolWalker((function(){return c.throwIfCancellationRequested(),!0})).walkType(e).visitedTypes;t<r.length;t++){var n=r[t];n.isTypeParameter()&&_.set(n.id.toString(),n);}}function V(t){return t.parent&&e.isShorthandPropertyAssignment(t.parent)&&t.parent.name===t?s.getShorthandAssignmentValueSymbol(t.parent):s.getSymbolAtLocation(t)}function q(t,r,n){if(t){var i=t.getDeclarations();if(i&&i.some((function(e){return e.parent===r})))return e.factory.createIdentifier(t.name);var a=q(t.parent,r,n);if(void 0!==a)return n?e.factory.createQualifiedName(a,e.factory.createIdentifier(t.name)):e.factory.createPropertyAccessExpression(a,t.name)}}}(t,o,function(t,r){return b(t.range)?{pos:e.first(t.range).getStart(r),end:e.last(t.range).getEnd()}:t.range}(t,i),i,r.program.getTypeChecker(),r.cancellationToken)}}function y(e){var t,r=e.symbol;if(r&&r.declarations)for(var n=0,i=r.declarations;n<i.length;n++){var a=i[n];(void 0===t||a.pos<t.pos)&&(t=a);}return t}function v(t,r){var n=t.type,i=t.declaration,a=r.type,o=r.declaration;return e.compareProperties(i,o,"pos",e.compareValues)||e.compareStringsCaseSensitive(n.symbol?n.symbol.getName():"",a.symbol?a.symbol.getName():"")||e.compareValues(n.id,a.id)}function h(t,r){var n=e.map(t,(function(t){return e.factory.createShorthandPropertyAssignment(t.symbol.name)})),i=e.map(r,(function(t){return e.factory.createShorthandPropertyAssignment(t.symbol.name)}));return void 0===n?i:void 0===i?n:n.concat(i)}function b(t){return e.isArray(t)}function x(e){var t=e.parent;switch(t.kind){case 297:return !1}switch(e.kind){case 10:return 265!==t.kind&&269!==t.kind;case 224:case 200:case 202:return !1;case 79:return 202!==t.kind&&269!==t.kind&&274!==t.kind}return !0}function D(e){switch(e.kind){case 234:case 303:case 261:case 288:return !0;default:return !1}}function S(t){return (e.isJsxElement(t)||e.isJsxSelfClosingElement(t)||e.isJsxFragment(t))&&(e.isJsxElement(t.parent)||e.isJsxFragment(t.parent))}t.registerRefactor(c,{kinds:[l.kind,u.kind],getAvailableActions:_,getEditsForAction:d}),r.getAvailableActions=_,r.getEditsForAction=d,function(t){function r(t){return {message:t,code:0,category:e.DiagnosticCategory.Message,key:t}}t.cannotExtractRange=r("Cannot extract range."),t.cannotExtractImport=r("Cannot extract import statement."),t.cannotExtractSuper=r("Cannot extract super call."),t.cannotExtractJSDoc=r("Cannot extract JSDoc."),t.cannotExtractEmpty=r("Cannot extract empty range."),t.expressionExpected=r("expression expected."),t.uselessConstantType=r("No reason to extract constant of type."),t.statementOrExpressionExpected=r("Statement or expression expected."),t.cannotExtractRangeContainingConditionalBreakOrContinueStatements=r("Cannot extract range containing conditional break or continue statements."),t.cannotExtractRangeContainingConditionalReturnStatement=r("Cannot extract range containing conditional return statement."),t.cannotExtractRangeContainingLabeledBreakOrContinueStatementWithTargetOutsideOfTheRange=r("Cannot extract range containing labeled break or continue with target outside of the range."),t.cannotExtractRangeThatContainsWritesToReferencesLocatedOutsideOfTheTargetRangeInGenerators=r("Cannot extract range containing writes to references located outside of the target range in generators."),t.typeWillNotBeVisibleInTheNewScope=r("Type will not visible in the new scope."),t.functionWillNotBeVisibleInTheNewScope=r("Function will not visible in the new scope."),t.cannotExtractIdentifier=r("Select more than a single identifier."),t.cannotExtractExportedEntity=r("Cannot extract exported declaration"),t.cannotWriteInExpression=r("Cannot write back side-effects when extracting an expression"),t.cannotExtractReadonlyPropertyInitializerOutsideConstructor=r("Cannot move initialization of read-only class property outside of the constructor"),t.cannotExtractAmbientBlock=r("Cannot extract code from ambient contexts"),t.cannotAccessVariablesFromNestedScopes=r("Cannot access variables from nested scopes"),t.cannotExtractToJSClass=r("Cannot extract constant to a class scope in JS"),t.cannotExtractToExpressionArrowFunction=r("Cannot extract constant to an arrow function without a block");}(n=r.Messages||(r.Messages={})),function(e){e[e.None=0]="None",e[e.HasReturn=1]="HasReturn",e[e.IsGenerator=2]="IsGenerator",e[e.IsAsyncFunction=4]="IsAsyncFunction",e[e.UsesThis=8]="UsesThis",e[e.InStaticRegion=16]="InStaticRegion";}(a||(a={})),r.getRangeToExtract=p,function(e){e[e.Module=0]="Module",e[e.Global=1]="Global";}(o||(o={})),function(e){e[e.Read=1]="Read",e[e.Write=2]="Write";}(s||(s={}));})((t=e.refactor||(e.refactor={})).extractSymbol||(t.extractSymbol={}));}(t),function(e){!function(t){var r="Extract type",n={name:"Extract to type alias",description:e.getLocaleSpecificMessage(e.Diagnostics.Extract_to_type_alias),kind:"refactor.extract.type"},a={name:"Extract to interface",description:e.getLocaleSpecificMessage(e.Diagnostics.Extract_to_interface),kind:"refactor.extract.interface"},o={name:"Extract to typedef",description:e.getLocaleSpecificMessage(e.Diagnostics.Extract_to_typedef),kind:"refactor.extract.typedef"};function s(t,r){void 0===r&&(r=!0);var n=t.file,i=t.startPosition,a=e.isSourceFileJS(n),o=e.getTokenAtPosition(n,i),s=e.createTextRangeFromSpan(e.getRefactorContextSpan(t)),u=s.pos===s.end&&r,_=e.findAncestor(o,(function(t){return t.parent&&e.isTypeNode(t)&&!l(s,t.parent,n)&&(u||e.nodeOverlapsWithStartEnd(o,n,s.pos,s.end))}));if(!_||!e.isTypeNode(_))return {error:e.getLocaleSpecificMessage(e.Diagnostics.Selection_is_not_a_valid_type_node)};var d=t.program.getTypeChecker(),p=e.Debug.checkDefined(e.findAncestor(_,e.isStatement),"Should find a statement"),f=function(t,r,n,i){var a=[];return function o(s){if(e.isTypeReferenceNode(s)){if(e.isIdentifier(s.typeName)&&(null==(d=t.resolveName(s.typeName.text,s.typeName,262144,!0))?void 0:d.declarations)){var c=e.cast(e.first(d.declarations),e.isTypeParameterDeclaration);l(n,c,i)&&!l(r,c,i)&&e.pushIfUnique(a,c);}}else if(e.isInferTypeNode(s)){var u=e.findAncestor(s,(function(t){return e.isConditionalTypeNode(t)&&l(t.extendsType,s,i)}));if(!u||!l(r,u,i))return !0}else if(e.isTypePredicateNode(s)||e.isThisTypeNode(s)){var _=e.findAncestor(s.parent,e.isFunctionLike);if(_&&_.type&&l(_.type,s,i)&&!l(r,_,i))return !0}else if(e.isTypeQueryNode(s)){var d;if(e.isIdentifier(s.exprName)){if((null==(d=t.resolveName(s.exprName.text,s.exprName,111551,!1))?void 0:d.valueDeclaration)&&l(n,d.valueDeclaration,i)&&!l(r,d.valueDeclaration,i))return !0}else if(e.isThisIdentifier(s.exprName.left)&&!l(r,s.parent,i))return !0}return i&&e.isTupleTypeNode(s)&&e.getLineAndCharacterOfPosition(i,s.pos).line===e.getLineAndCharacterOfPosition(i,s.end).line&&e.setEmitFlags(s,1),e.forEachChild(s,o)}(r)?void 0:a}(d,_,p,n);return f?{isJS:a,selection:_,firstStatement:p,typeParameters:f,typeElements:c(d,_)}:{error:e.getLocaleSpecificMessage(e.Diagnostics.No_type_could_be_extracted_from_this_type_node)}}function c(t,r){if(r){if(e.isIntersectionTypeNode(r)){for(var n=[],i=new e.Map,a=0,o=r.types;a<o.length;a++){var s=c(t,o[a]);if(!s||!s.every((function(t){return t.name&&e.addToSeen(i,e.getNameFromPropertyName(t.name))})))return;e.addRange(n,s);}return n}return e.isParenthesizedTypeNode(r)?c(t,r.type):e.isTypeLiteralNode(r)?r.members:void 0}}function l(t,r,n){return e.rangeContainsStartEnd(t,e.skipTrivia(n.text,r.pos),r.end)}t.registerRefactor(r,{kinds:[n.kind,a.kind,o.kind],getAvailableActions:function(c){var l=s(c,"invoked"===c.triggerReason);return l?t.isRefactorErrorInfo(l)?c.preferences.provideRefactorNotApplicableReason?[{name:r,description:e.getLocaleSpecificMessage(e.Diagnostics.Extract_type),actions:[i$1(i$1({},o),{notApplicableReason:l.error}),i$1(i$1({},n),{notApplicableReason:l.error}),i$1(i$1({},a),{notApplicableReason:l.error})]}]:e.emptyArray:[{name:r,description:e.getLocaleSpecificMessage(e.Diagnostics.Extract_type),actions:l.isJS?[o]:e.append([n],l.typeElements&&a)}]:e.emptyArray},getEditsForAction:function(r,i){var c=r.file,l=s(r);e.Debug.assert(l&&!t.isRefactorErrorInfo(l),"Expected to find a range to extract");var u=e.getUniqueName("NewType",c),_=e.textChanges.ChangeTracker.with(r,(function(t){switch(i){case n.name:return e.Debug.assert(!l.isJS,"Invalid actionName/JS combo"),function(t,r,n,i){var a=i.firstStatement,o=i.selection,s=i.typeParameters,c=e.factory.createTypeAliasDeclaration(void 0,void 0,n,s.map((function(t){return e.factory.updateTypeParameterDeclaration(t,t.name,t.constraint,void 0)})),o);t.insertNodeBefore(r,a,e.ignoreSourceNewlines(c),!0),t.replaceNode(r,o,e.factory.createTypeReferenceNode(n,s.map((function(t){return e.factory.createTypeReferenceNode(t.name,void 0)}))),{leadingTriviaOption:e.textChanges.LeadingTriviaOption.Exclude,trailingTriviaOption:e.textChanges.TrailingTriviaOption.ExcludeWhitespace});}(t,c,u,l);case o.name:return e.Debug.assert(l.isJS,"Invalid actionName/JS combo"),function(t,r,n,i){var a=i.firstStatement,o=i.selection,s=i.typeParameters,c=e.factory.createJSDocTypedefTag(e.factory.createIdentifier("typedef"),e.factory.createJSDocTypeExpression(o),e.factory.createIdentifier(n)),l=[];e.forEach(s,(function(t){var r=e.getEffectiveConstraintOfTypeParameter(t),n=e.factory.createTypeParameterDeclaration(t.name),i=e.factory.createJSDocTemplateTag(e.factory.createIdentifier("template"),r&&e.cast(r,e.isJSDocTypeExpression),[n]);l.push(i);})),t.insertNodeBefore(r,a,e.factory.createJSDocComment(void 0,e.factory.createNodeArray(e.concatenate(l,[c]))),!0),t.replaceNode(r,o,e.factory.createTypeReferenceNode(n,s.map((function(t){return e.factory.createTypeReferenceNode(t.name,void 0)}))));}(t,c,u,l);case a.name:return e.Debug.assert(!l.isJS&&!!l.typeElements,"Invalid actionName/JS combo"),function(t,r,n,i){var a,o=i.firstStatement,s=i.selection,c=i.typeParameters,l=i.typeElements,u=e.factory.createInterfaceDeclaration(void 0,void 0,n,c,void 0,l);e.setTextRange(u,null===(a=l[0])||void 0===a?void 0:a.parent),t.insertNodeBefore(r,o,e.ignoreSourceNewlines(u),!0),t.replaceNode(r,s,e.factory.createTypeReferenceNode(n,c.map((function(t){return e.factory.createTypeReferenceNode(t.name,void 0)}))),{leadingTriviaOption:e.textChanges.LeadingTriviaOption.Exclude,trailingTriviaOption:e.textChanges.TrailingTriviaOption.ExcludeWhitespace});}(t,c,u,l);default:e.Debug.fail("Unexpected action name");}})),d=c.fileName;return {edits:_,renameFilename:d,renameLocation:e.getRenameLocation(_,d,u,!1)}}});}(e.refactor||(e.refactor={}));}(t),function(e){var t,r,n,a;(t=e.refactor||(e.refactor={})).generateGetAccessorAndSetAccessor||(t.generateGetAccessorAndSetAccessor={}),r="Generate 'get' and 'set' accessors",n=e.Diagnostics.Generate_get_and_set_accessors.message,a={name:r,description:n,kind:"refactor.rewrite.property.generateAccessors"},t.registerRefactor(r,{kinds:[a.kind],getEditsForAction:function(r,n){if(r.endPosition){var i=e.codefix.getAccessorConvertiblePropertyAtPosition(r.file,r.program,r.startPosition,r.endPosition);e.Debug.assert(i&&!t.isRefactorErrorInfo(i),"Expected applicable refactor info");var a=e.codefix.generateAccessorFromProperty(r.file,r.program,r.startPosition,r.endPosition,r,n);if(a){var o=r.file.fileName,s=i.renameAccessor?i.accessorName:i.fieldName;return {renameFilename:o,renameLocation:(e.isIdentifier(s)?0:-1)+e.getRenameLocation(a,o,s.text,e.isParameter(i.declaration)),edits:a}}}},getAvailableActions:function(o){if(!o.endPosition)return e.emptyArray;var s=e.codefix.getAccessorConvertiblePropertyAtPosition(o.file,o.program,o.startPosition,o.endPosition,"invoked"===o.triggerReason);return s?t.isRefactorErrorInfo(s)?o.preferences.provideRefactorNotApplicableReason?[{name:r,description:n,actions:[i$1(i$1({},a),{notApplicableReason:s.error})]}]:e.emptyArray:[{name:r,description:n,actions:[a]}]:e.emptyArray}});}(t),function(e){var t;(t=e.refactor||(e.refactor={})).isRefactorErrorInfo=function(e){return void 0!==e.error},t.refactorKindBeginsWith=function(e,t){return !t||e.substr(0,t.length)===t};}(t),function(e){!function(t){var r="Move to a new file",a=e.getLocaleSpecificMessage(e.Diagnostics.Move_to_a_new_file),o={name:r,description:a,kind:"refactor.move.newFile"};function s(t){var r=function(t){var r=t.file,n=e.createTextRangeFromSpan(e.getRefactorContextSpan(t)),i=r.statements,a=e.findIndex(i,(function(e){return e.end>n.pos}));if(-1!==a){var o=i[a];if(e.isNamedDeclaration(o)&&o.name&&e.rangeContainsRange(o.name,n))return {toMove:[i[a]],afterLast:i[a+1]};if(!(n.pos>o.getStart(r))){var s=e.findIndex(i,(function(e){return e.end>n.end}),a);if(-1===s||!(0===s||i[s].getStart(r)<n.end))return {toMove:i.slice(a,-1===s?i.length:s),afterLast:-1===s?void 0:i[s]}}}}(t);if(void 0!==r){var n=[],i=[],a=r.toMove,o=r.afterLast;return e.getRangesWhere(a,c,(function(e,t){for(var r=e;r<t;r++)n.push(a[r]);i.push({first:a[e],afterLast:o});})),0===n.length?void 0:{all:n,ranges:i}}}function c(t){return !function(t){switch(t.kind){case 265:return !0;case 264:return !e.hasSyntacticModifier(t,1);case 236:return t.declarationList.declarations.every((function(t){return !!t.initializer&&e.isRequireCall(t.initializer,!0)}));default:return !1}}(t)&&!e.isPrologueDirective(t)}function l(e,t,r){for(var n=0,i=t;n<i.length;n++){var a=i[n],o=a.first,s=a.afterLast;r.deleteNodeRangeExcludingEnd(e,o,s);}}function u(e){return 265===e.kind?e.moduleSpecifier:264===e.kind?e.moduleReference.expression:e.initializer.arguments[0]}function _(t,r){if(e.isImportDeclaration(t))e.isStringLiteral(t.moduleSpecifier)&&r(t);else if(e.isImportEqualsDeclaration(t))e.isExternalModuleReference(t.moduleReference)&&e.isStringLiteralLike(t.moduleReference.expression)&&r(t);else if(e.isVariableStatement(t))for(var n=0,i=t.declarationList.declarations;n<i.length;n++){var a=i[n];a.initializer&&e.isRequireCall(a.initializer,!0)&&r(a);}}function d(t,r,n,i,a){if(n=e.ensurePathIsNonModuleName(n),i){var o=r.map((function(t){return e.factory.createImportSpecifier(!1,void 0,e.factory.createIdentifier(t))}));return e.makeImportIfNecessary(t,o,n,a)}e.Debug.assert(!t,"No default import should exist");var s=r.map((function(t){return e.factory.createBindingElement(void 0,void 0,t)}));return s.length?p(e.factory.createObjectBindingPattern(s),void 0,f(e.factory.createStringLiteral(n))):void 0}function p(t,r,n,i){return void 0===i&&(i=2),e.factory.createVariableStatement(void 0,e.factory.createVariableDeclarationList([e.factory.createVariableDeclaration(t,void 0,r,n)],i))}function f(t){return e.factory.createCallExpression(e.factory.createIdentifier("require"),void 0,[t])}function g(t,r,n,i){switch(r.kind){case 265:!function(t,r,n,i){if(r.importClause){var a=r.importClause,o=a.name,s=a.namedBindings,c=!o||i(o),l=!s||(267===s.kind?i(s.name):0!==s.elements.length&&s.elements.every((function(e){return i(e.name)})));if(c&&l)n.delete(t,r);else if(o&&c&&n.delete(t,o),s)if(l)n.replaceNode(t,r.importClause,e.factory.updateImportClause(r.importClause,r.importClause.isTypeOnly,o,void 0));else if(268===s.kind)for(var u=0,_=s.elements;u<_.length;u++){var d=_[u];i(d.name)&&n.delete(t,d);}}}(t,r,n,i);break;case 264:i(r.name)&&n.delete(t,r);break;case 253:!function(t,r,n,i){var a=r.name;switch(a.kind){case 79:i(a)&&n.delete(t,a);break;case 201:break;case 200:if(a.elements.every((function(t){return e.isIdentifier(t.name)&&i(t.name)})))n.delete(t,e.isVariableDeclarationList(r.parent)&&1===r.parent.declarations.length?r.parent.parent:r);else for(var o=0,s=a.elements;o<s.length;o++){var c=s[o];e.isIdentifier(c.name)&&i(c.name)&&n.delete(t,c.name);}}}(t,r,n,i);break;default:e.Debug.assertNever(r,"Unexpected import decl kind ".concat(r.kind));}}function m(t){switch(t.kind){case 264:case 269:case 266:case 267:return !0;case 253:return y(t);case 202:return e.isVariableDeclaration(t.parent.parent)&&y(t.parent.parent);default:return !1}}function y(t){return e.isSourceFile(t.parent.parent.parent)&&!!t.initializer&&e.isRequireCall(t.initializer,!0)}function v(t,r,n){switch(t.kind){case 265:var i=t.importClause;if(!i)return;var a=i.name&&n(i.name)?i.name:void 0,o=i.namedBindings&&function(t,r){if(267===t.kind)return r(t.name)?t:void 0;var n=t.elements.filter((function(e){return r(e.name)}));return n.length?e.factory.createNamedImports(n):void 0}(i.namedBindings,n);return a||o?e.factory.createImportDeclaration(void 0,void 0,e.factory.createImportClause(!1,a,o),r,void 0):void 0;case 264:return n(t.name)?t:void 0;case 253:var s=function(t,r){switch(t.kind){case 79:return r(t)?t:void 0;case 201:return t;case 200:var n=t.elements.filter((function(t){return t.propertyName||!e.isIdentifier(t.name)||r(t.name)}));return n.length?e.factory.createObjectBindingPattern(n):void 0}}(t.name,n);return s?p(s,t.type,f(r),t.parent.flags):void 0;default:return e.Debug.assertNever(t,"Unexpected import kind ".concat(t.kind))}}function h(t,r,n){t.forEachChild((function t(i){if(e.isIdentifier(i)&&!e.isDeclarationName(i)){var a=r.getSymbolAtLocation(i);a&&n(a);}else i.forEachChild(t);}));}t.registerRefactor(r,{kinds:[o.kind],getAvailableActions:function(t){var n=s(t);return t.preferences.allowTextChangesInNewFiles&&n?[{name:r,description:a,actions:[o]}]:t.preferences.provideRefactorNotApplicableReason?[{name:r,description:a,actions:[i$1(i$1({},o),{notApplicableReason:e.getLocaleSpecificMessage(e.Diagnostics.Selection_is_not_a_valid_statement_or_statements)})]}]:e.emptyArray},getEditsForAction:function(t,i){e.Debug.assert(i===r,"Wrong refactor invoked");var a=e.Debug.checkDefined(s(t));return {edits:e.textChanges.ChangeTracker.with(t,(function(r){return i=t.file,o=t.program,s=a,c=r,p=t.host,y=t.preferences,T=o.getTypeChecker(),P=function(t,r,n){var i=new b,a=new b,o=new b,s=function(t){if(void 0!==t){var r=n.getJsxNamespace(t),i=n.resolveName(r,t,1920,!0);return i&&e.some(i.declarations,m)?i:void 0}}(e.find(r,(function(e){return !!(2&e.transformFlags)})));s&&a.add(s);for(var c=0,l=r;c<l.length;c++)S(y=l[c],(function(t){i.add(e.Debug.checkDefined(e.isExpressionStatement(t)?n.getSymbolAtLocation(t.expression.left):t.symbol,"Need a symbol here"));}));for(var u=0,_=r;u<_.length;u++)h(y=_[u],n,(function(r){if(r.declarations)for(var n=0,s=r.declarations;n<s.length;n++){var c=s[n];m(c)?a.add(r):x(c)&&(l=c,(e.isVariableDeclaration(l)?l.parent.parent.parent:l.parent)===t)&&!i.has(r)&&o.add(r);}var l;}));for(var d=a.clone(),p=new b,f=0,g=t.statements;f<g.length;f++){var y=g[f];e.contains(r,y)||(s&&2&y.transformFlags&&d.delete(s),h(y,n,(function(e){i.has(e)&&p.add(e),d.delete(e);})));}return {movedSymbols:i,newFileImportsFromOldFile:o,oldFileImportsFromNewFile:p,oldImportsNeededByNewFile:a,unusedImportsFromOldFile:d}}(i,s.all,T),w=e.getDirectoryPath(i.fileName),I=e.extensionFromPath(i.fileName),M=(O=function(t,r,n,i){for(var a=t,o=1;;o++){var s=e.combinePaths(n,a+r);if(!i.fileExists(s))return a;a="".concat(t,".").concat(o);}}(P.movedSymbols.forEachEntry(e.symbolNameNoDefault)||"newFile",I,w,p))+I,c.createNewFile(i,e.combinePaths(w,M),function(t,r,i,a,o,s,c){var p=o.getTypeChecker(),m=e.takeWhile(t.statements,e.isPrologueDirective);if(!t.externalModuleIndicator&&!t.commonJsModuleIndicator)return l(t,a.ranges,i),n$3(n$3([],m,!0),a.all,!0);var y=!!t.externalModuleIndicator,h=e.getQuotePreference(t,c),b=function(t,r,n,i){var a,o=[];return t.forEach((function(t){"default"===t.escapedName?a=e.factory.createIdentifier(e.symbolNameNoDefault(t)):o.push(t.name);})),d(a,o,r,n,i)}(r.oldFileImportsFromNewFile,s,y,h);b&&e.insertImports(i,t,b,!0),function(t,r,n,i,a){for(var o=0,s=t.statements;o<s.length;o++){var c=s[o];e.contains(r,c)||_(c,(function(e){return g(t,e,n,(function(e){return i.has(a.getSymbolAtLocation(e))}))}));}}(t,a.all,i,r.unusedImportsFromOldFile,p),l(t,a.ranges,i),function(t,r,n,i,a){for(var o=r.getTypeChecker(),s=function(r){if(r===n)return "continue";for(var s=function(s){_(s,(function(c){if(o.getSymbolAtLocation(u(c))===n.symbol){var l=function(t){var r=e.isBindingElement(t.parent)?e.getPropertySymbolFromBindingElement(o,t.parent):e.skipAlias(o.getSymbolAtLocation(t),o);return !!r&&i.has(r)};g(r,c,t,l);var _=e.combinePaths(e.getDirectoryPath(u(c).text),a),d=v(c,e.factory.createStringLiteral(_),l);d&&t.insertNodeAfter(r,s,d);var p=function(t){switch(t.kind){case 265:return t.importClause&&t.importClause.namedBindings&&267===t.importClause.namedBindings.kind?t.importClause.namedBindings.name:void 0;case 264:return t.name;case 253:return e.tryCast(t.name,e.isIdentifier);default:return e.Debug.assertNever(t,"Unexpected node kind ".concat(t.kind))}}(c);p&&function(t,r,n,i,a,o,s,c){var l=e.codefix.moduleSpecifierToValidIdentifier(a,99),u=!1,_=[];if(e.FindAllReferences.Core.eachSymbolReferenceInFile(s,n,r,(function(t){e.isPropertyAccessExpression(t.parent)&&(u=u||!!n.resolveName(l,t,67108863,!0),i.has(n.getSymbolAtLocation(t.parent.name))&&_.push(t));})),_.length){for(var d=u?e.getUniqueName(l,r):l,p=0,g=_;p<g.length;p++){var m=g[p];t.replaceNode(r,m,e.factory.createIdentifier(d));}t.insertNodeAfter(r,c,function(t,r,n){var i=e.factory.createIdentifier(r),a=e.factory.createStringLiteral(n);switch(t.kind){case 265:return e.factory.createImportDeclaration(void 0,void 0,e.factory.createImportClause(!1,void 0,e.factory.createNamespaceImport(i)),a,void 0);case 264:return e.factory.createImportEqualsDeclaration(void 0,void 0,!1,i,e.factory.createExternalModuleReference(a));case 253:return e.factory.createVariableDeclaration(i,void 0,void 0,f(a));default:return e.Debug.assertNever(t,"Unexpected node kind ".concat(t.kind))}}(c,a,o));}}(t,r,o,i,a,_,p,c);}}));},c=0,l=r.statements;c<l.length;c++)s(l[c]);},c=0,l=r.getSourceFiles();c<l.length;c++)s(l[c]);}(i,o,t,r.movedSymbols,s);var T=function(t,r,n,i,a,o,s){for(var c,l=[],p=0,f=t.statements;p<f.length;p++)_(f[p],(function(t){e.append(l,v(t,u(t),(function(e){return r.has(a.getSymbolAtLocation(e))})));}));var g=[],m=e.nodeSeenTracker();return n.forEach((function(r){if(r.declarations)for(var n=0,a=r.declarations;n<a.length;n++){var s=a[n];if(x(s)){var l=(_=s,e.isExpressionStatement(_)?e.tryCast(_.expression.left.name,e.isIdentifier):e.tryCast(_.name,e.isIdentifier));if(l){var u=C(s);m(u)&&E(t,u,l,i,o),e.hasSyntacticModifier(s,512)?c=l:g.push(l.text);}}}var _;})),e.append(l,d(c,g,e.removeFileExtension(e.getBaseFileName(t.fileName)),o,s)),l}(t,r.oldImportsNeededByNewFile,r.newFileImportsFromOldFile,i,p,y,h),P=function(t,r,i,a){return e.flatMap(r,(function(r){if(s=r,e.Debug.assert(e.isSourceFile(s.parent),"Node parent should be a SourceFile"),(D(s)||e.isVariableStatement(s))&&!k(t,r,a)&&S(r,(function(t){return i.has(e.Debug.checkDefined(t.symbol))}))){var o=function(e,t){return t?[N(e)]:function(e){return n$3([e],F(e).map(A),!0)}(e)}(r,a);if(o)return o}var s;return r}))}(t,a.all,r.oldFileImportsFromNewFile,y);return T.length&&P.length?n$3(n$3(n$3(n$3([],m,!0),T,!0),[4],!1),P,!0):n$3(n$3(n$3([],m,!0),T,!0),P,!0)}(i,P,c,s,o,O,y)),void function(t,r,n,i,a){var o=t.getCompilerOptions().configFile;if(o){var s=e.normalizePath(e.combinePaths(n,"..",i)),c=e.getRelativePathFromFile(o.fileName,s,a),l=o.statements[0]&&e.tryCast(o.statements[0].expression,e.isObjectLiteralExpression),u=l&&e.find(l.properties,(function(t){return e.isPropertyAssignment(t)&&e.isStringLiteral(t.name)&&"files"===t.name.text}));u&&e.isArrayLiteralExpression(u.initializer)&&r.insertNodeInListAfter(o,e.last(u.initializer.elements),e.factory.createStringLiteral(c),u.initializer.elements);}}(o,c,i.fileName,M,e.hostGetCanonicalFileName(p));var i,o,s,c,p,y,T,P,w,I,O,M;})),renameFilename:void 0,renameLocation:void 0}}});var b=function(){function t(){this.map=new e.Map;}return t.prototype.add=function(t){this.map.set(String(e.getSymbolId(t)),t);},t.prototype.has=function(t){return this.map.has(String(e.getSymbolId(t)))},t.prototype.delete=function(t){this.map.delete(String(e.getSymbolId(t)));},t.prototype.forEach=function(e){this.map.forEach(e);},t.prototype.forEachEntry=function(t){return e.forEachEntry(this.map,t)},t.prototype.clone=function(){var r=new t;return e.copyEntries(this.map,r.map),r},t}();function x(t){return D(t)&&e.isSourceFile(t.parent)||e.isVariableDeclaration(t)&&e.isSourceFile(t.parent.parent.parent)}function D(e){switch(e.kind){case 255:case 256:case 260:case 259:case 258:case 257:case 264:return !0;default:return !1}}function S(t,r){switch(t.kind){case 255:case 256:case 260:case 259:case 258:case 257:case 264:return r(t);case 236:return e.firstDefined(t.declarationList.declarations,(function(e){return T(e.name,r)}));case 237:var n=t.expression;return e.isBinaryExpression(n)&&1===e.getAssignmentDeclarationKind(n)?r(t):void 0}}function T(t,r){switch(t.kind){case 79:return r(e.cast(t.parent,(function(t){return e.isVariableDeclaration(t)||e.isBindingElement(t)})));case 201:case 200:return e.firstDefined(t.elements,(function(t){return e.isOmittedExpression(t)?void 0:T(t.name,r)}));default:return e.Debug.assertNever(t,"Unexpected name kind ".concat(t.kind))}}function C(t){switch(t.kind){case 253:return t.parent.parent;case 202:return C(e.cast(t.parent.parent,(function(t){return e.isVariableDeclaration(t)||e.isBindingElement(t)})));default:return t}}function E(t,r,n,i,a){if(!k(t,r,a,n))if(a)e.isExpressionStatement(r)||i.insertExportModifier(t,r);else {var o=F(r);0!==o.length&&i.insertNodesAfter(t,r,o.map(A));}}function k(t,r,n,i){var a;return n?!e.isExpressionStatement(r)&&e.hasSyntacticModifier(r,1)||!(!i||!(null===(a=t.symbol.exports)||void 0===a?void 0:a.has(i.escapedText))):F(r).some((function(r){return t.symbol.exports.has(e.escapeLeadingUnderscores(r))}))}function N(t){var r=e.concatenate([e.factory.createModifier(93)],t.modifiers);switch(t.kind){case 255:return e.factory.updateFunctionDeclaration(t,t.decorators,r,t.asteriskToken,t.name,t.typeParameters,t.parameters,t.type,t.body);case 256:return e.factory.updateClassDeclaration(t,t.decorators,r,t.name,t.typeParameters,t.heritageClauses,t.members);case 236:return e.factory.updateVariableStatement(t,r,t.declarationList);case 260:return e.factory.updateModuleDeclaration(t,t.decorators,r,t.name,t.body);case 259:return e.factory.updateEnumDeclaration(t,t.decorators,r,t.name,t.members);case 258:return e.factory.updateTypeAliasDeclaration(t,t.decorators,r,t.name,t.typeParameters,t.type);case 257:return e.factory.updateInterfaceDeclaration(t,t.decorators,r,t.name,t.typeParameters,t.heritageClauses,t.members);case 264:return e.factory.updateImportEqualsDeclaration(t,t.decorators,r,t.isTypeOnly,t.name,t.moduleReference);case 237:return e.Debug.fail();default:return e.Debug.assertNever(t,"Unexpected declaration kind ".concat(t.kind))}}function F(t){switch(t.kind){case 255:case 256:return [t.name.text];case 236:return e.mapDefined(t.declarationList.declarations,(function(t){return e.isIdentifier(t.name)?t.name.text:void 0}));case 260:case 259:case 258:case 257:case 264:return e.emptyArray;case 237:return e.Debug.fail("Can't export an ExpressionStatement");default:return e.Debug.assertNever(t,"Unexpected decl kind ".concat(t.kind))}}function A(t){return e.factory.createExpressionStatement(e.factory.createBinaryExpression(e.factory.createPropertyAccessExpression(e.factory.createIdentifier("exports"),e.factory.createIdentifier(t)),63,e.factory.createIdentifier(t)))}}(e.refactor||(e.refactor={}));}(t),function(e){var t;(function(r){var n="Add or remove braces in an arrow function",a=e.Diagnostics.Add_or_remove_braces_in_an_arrow_function.message,o={name:"Add braces to arrow function",description:e.Diagnostics.Add_braces_to_arrow_function.message,kind:"refactor.rewrite.arrow.braces.add"},s={name:"Remove braces from arrow function",description:e.Diagnostics.Remove_braces_from_arrow_function.message,kind:"refactor.rewrite.arrow.braces.remove"};function c(r,n,i,a){void 0===i&&(i=!0);var c=e.getTokenAtPosition(r,n),l=e.getContainingFunction(c);if(!l)return {error:e.getLocaleSpecificMessage(e.Diagnostics.Could_not_find_a_containing_arrow_function)};if(!e.isArrowFunction(l))return {error:e.getLocaleSpecificMessage(e.Diagnostics.Containing_function_is_not_an_arrow_function)};if(e.rangeContainsRange(l,c)&&(!e.rangeContainsRange(l.body,c)||i)){if(t.refactorKindBeginsWith(o.kind,a)&&e.isExpression(l.body))return {func:l,addBraces:!0,expression:l.body};if(t.refactorKindBeginsWith(s.kind,a)&&e.isBlock(l.body)&&1===l.body.statements.length){var u=e.first(l.body.statements);if(e.isReturnStatement(u))return {func:l,addBraces:!1,expression:u.expression,returnStatement:u}}}}t.registerRefactor(n,{kinds:[s.kind],getEditsForAction:function(r,n){var i=r.file,a=r.startPosition,l=c(i,a);e.Debug.assert(l&&!t.isRefactorErrorInfo(l),"Expected applicable refactor info");var u,_=l.expression,d=l.returnStatement,p=l.func;if(n===o.name){var f=e.factory.createReturnStatement(_);u=e.factory.createBlock([f],!0),e.copyLeadingComments(_,f,i,3,!0);}else if(n===s.name&&d){var g=_||e.factory.createVoidZero();u=e.needsParentheses(g)?e.factory.createParenthesizedExpression(g):g,e.copyTrailingAsLeadingComments(d,u,i,3,!1),e.copyLeadingComments(d,u,i,3,!1),e.copyTrailingComments(d,u,i,3,!1);}else e.Debug.fail("invalid action");return {renameFilename:void 0,renameLocation:void 0,edits:e.textChanges.ChangeTracker.with(r,(function(e){e.replaceNode(i,p.body,u);}))}},getAvailableActions:function(r){var l=c(r.file,r.startPosition,"invoked"===r.triggerReason);return l?t.isRefactorErrorInfo(l)?r.preferences.provideRefactorNotApplicableReason?[{name:n,description:a,actions:[i$1(i$1({},o),{notApplicableReason:l.error}),i$1(i$1({},s),{notApplicableReason:l.error})]}]:e.emptyArray:[{name:n,description:a,actions:[l.addBraces?o:s]}]:e.emptyArray}});})((t=e.refactor||(e.refactor={})).addOrRemoveBracesToArrowFunction||(t.addOrRemoveBracesToArrowFunction={}));}(t),function(e){var t;(function(r){var i="Convert parameters to destructured object",a=e.getLocaleSpecificMessage(e.Diagnostics.Convert_parameters_to_destructured_object),o={name:i,description:a,kind:"refactor.rewrite.parameters.toDestructured"};function s(t,r){var n=e.getContainingObjectLiteralElement(t);if(n){var i=r.getContextualTypeForObjectLiteralElement(n),a=null==i?void 0:i.getSymbol();if(a&&!(6&e.getCheckFlags(a)))return a}}function c(t){var r=t.node;return e.isImportSpecifier(r.parent)||e.isImportClause(r.parent)||e.isImportEqualsDeclaration(r.parent)||e.isNamespaceImport(r.parent)||e.isExportSpecifier(r.parent)||e.isExportAssignment(r.parent)?r:void 0}function l(t){if(e.isDeclaration(t.node.parent))return t.node}function u(t){if(t.node.parent){var r=t.node,n=r.parent;switch(n.kind){case 207:case 208:var i=e.tryCast(n,e.isCallOrNewExpression);if(i&&i.expression===r)return i;break;case 205:var a=e.tryCast(n,e.isPropertyAccessExpression);if(a&&a.parent&&a.name===r){var o=e.tryCast(a.parent,e.isCallOrNewExpression);if(o&&o.expression===a)return o}break;case 206:var s=e.tryCast(n,e.isElementAccessExpression);if(s&&s.parent&&s.argumentExpression===r){var c=e.tryCast(s.parent,e.isCallOrNewExpression);if(c&&c.expression===s)return c}}}}function _(t){if(t.node.parent){var r=t.node,n=r.parent;switch(n.kind){case 205:var i=e.tryCast(n,e.isPropertyAccessExpression);if(i&&i.expression===r)return i;break;case 206:var a=e.tryCast(n,e.isElementAccessExpression);if(a&&a.expression===r)return a}}}function d(t){var r=t.node;if(2===e.getMeaningFromLocation(r)||e.isExpressionWithTypeArgumentsInClassExtendsClause(r.parent))return r}function p(t,r,n){var i=e.getTouchingToken(t,r),a=e.getContainingFunctionDeclaration(i);if(!function(t){var r=e.findAncestor(t,e.isJSDocNode);if(r){var n=e.findAncestor(r,(function(t){return !e.isJSDocNode(t)}));return !!n&&e.isFunctionLikeDeclaration(n)}return !1}(i))return !(a&&function(t,r){var n;if(!function(t,r){return function(e){return y(e)?e.length-1:e.length}(t)>=2&&e.every(t,(function(t){return function(t,r){if(e.isRestParameter(t)){var n=r.getTypeAtLocation(t);if(!r.isArrayType(n)&&!r.isTupleType(n))return !1}return !t.modifiers&&!t.decorators&&e.isIdentifier(t.name)}(t,r)}))}(t.parameters,r))return !1;switch(t.kind){case 255:return g(t)&&f(t,r);case 168:if(e.isObjectLiteralExpression(t.parent)){var i=s(t.name,r);return 1===(null===(n=null==i?void 0:i.declarations)||void 0===n?void 0:n.length)&&f(t,r)}return f(t,r);case 170:return e.isClassDeclaration(t.parent)?g(t.parent)&&f(t,r):m(t.parent.parent)&&f(t,r);case 212:case 213:return m(t.parent)}return !1}(a,n)&&e.rangeContainsRange(a,i))||a.body&&e.rangeContainsRange(a.body,i)?void 0:a}function f(e,t){return !!e.body&&!t.isImplementationOfOverload(e)}function g(t){return !!t.name||!!e.findModifier(t,88)}function m(t){return e.isVariableDeclaration(t)&&e.isVarConst(t)&&e.isIdentifier(t.name)&&!t.type}function y(t){return t.length>0&&e.isThis(t[0].name)}function v(t){return y(t)&&(t=e.factory.createNodeArray(t.slice(1),t.hasTrailingComma)),t}function h(t,r){var n=v(t.parameters),i=e.isRestParameter(e.last(n)),a=i?r.slice(0,n.length-1):r,o=e.map(a,(function(t,r){var i,a,o=(i=x(n[r]),a=t,e.isIdentifier(a)&&e.getTextOfIdentifierOrLiteral(a)===i?e.factory.createShorthandPropertyAssignment(i):e.factory.createPropertyAssignment(i,a));return e.suppressLeadingAndTrailingTrivia(o.name),e.isPropertyAssignment(o)&&e.suppressLeadingAndTrailingTrivia(o.initializer),e.copyComments(t,o),o}));if(i&&r.length>=n.length){var s=r.slice(n.length-1),c=e.factory.createPropertyAssignment(x(e.last(n)),e.factory.createArrayLiteralExpression(s));o.push(c);}return e.factory.createObjectLiteralExpression(o,!1)}function b(t,r,n){var i,a,o,s=r.getTypeChecker(),c=v(t.parameters),l=e.map(c,(function(t){var r=e.factory.createBindingElement(void 0,void 0,x(t),e.isRestParameter(t)&&g(t)?e.factory.createArrayLiteralExpression():t.initializer);return e.suppressLeadingAndTrailingTrivia(r),t.initializer&&r.initializer&&e.copyComments(t.initializer,r.initializer),r})),u=e.factory.createObjectBindingPattern(l),_=(i=c,a=e.map(i,(function(t){var i,a,o=t.type;o||!t.initializer&&!e.isRestParameter(t)||(i=t,a=s.getTypeAtLocation(i),o=e.getTypeNodeIfAccessible(a,i,r,n));var c=e.factory.createPropertySignature(void 0,x(t),g(t)?e.factory.createToken(57):t.questionToken,o);return e.suppressLeadingAndTrailingTrivia(c),e.copyComments(t.name,c.name),t.type&&c.type&&e.copyComments(t.type,c.type),c})),e.addEmitFlags(e.factory.createTypeLiteralNode(a),1));e.every(c,g)&&(o=e.factory.createObjectLiteralExpression());var d=e.factory.createParameterDeclaration(void 0,void 0,void 0,u,void 0,_,o);if(y(t.parameters)){var p=t.parameters[0],f=e.factory.createParameterDeclaration(void 0,void 0,void 0,p.name,void 0,p.type);return e.suppressLeadingAndTrailingTrivia(f.name),e.copyComments(p.name,f.name),p.type&&(e.suppressLeadingAndTrailingTrivia(f.type),e.copyComments(p.type,f.type)),e.factory.createNodeArray([f,d])}return e.factory.createNodeArray([d]);function g(t){if(e.isRestParameter(t)){var r=s.getTypeAtLocation(t);return !s.isTupleType(r)}return s.isOptionalParameter(t)}}function x(t){return e.getTextOfIdentifierOrLiteral(t.name)}t.registerRefactor(i,{kinds:[o.kind],getEditsForAction:function(t,r){e.Debug.assert(r===i,"Unexpected action name");var a=t.file,o=t.startPosition,f=t.program,g=t.cancellationToken,m=t.host,y=p(a,o,f.getTypeChecker());if(y&&g){var v=function(t,r,i){var a=function(t){switch(t.kind){case 255:return t.name?[t.name]:[e.Debug.checkDefined(e.findModifier(t,88),"Nameless function declaration should be a default export")];case 168:return [t.name];case 170:var r=e.Debug.checkDefined(e.findChildOfKind(t,134,t.getSourceFile()),"Constructor declaration should have constructor keyword");return 225===t.parent.kind?[t.parent.parent.name,r]:[r];case 213:return [t.parent.name];case 212:return t.name?[t.name,t.parent.name]:[t.parent.name];default:return e.Debug.assertNever(t,"Unexpected function declaration kind ".concat(t.kind))}}(t),o=e.isConstructorDeclaration(t)?function(t){switch(t.parent.kind){case 256:var r=t.parent;return r.name?[r.name]:[e.Debug.checkDefined(e.findModifier(r,88),"Nameless class declaration should be a default export")];case 225:var n=t.parent,i=t.parent.parent,a=n.name;return a?[a,i.name]:[i.name]}}(t):[],p=e.deduplicate(n$3(n$3([],a,!0),o,!0),e.equateValues),f=r.getTypeChecker(),g=function(r){for(var n={accessExpressions:[],typeUsages:[]},i={functionCalls:[],declarations:[],classReferences:n,valid:!0},p=e.map(a,m),g=e.map(o,m),y=e.isConstructorDeclaration(t),v=e.map(a,(function(e){return s(e,f)})),h=0,b=r;h<b.length;h++){var x=b[h];if(0!==x.kind){if(e.contains(v,m(x.node))){if(k=x.node.parent,e.isMethodSignature(k)&&(e.isInterfaceDeclaration(k.parent)||e.isTypeLiteralNode(k.parent))){i.signature=x.node.parent;continue}if(S=u(x)){i.functionCalls.push(S);continue}}var D=s(x.node,f);if(D&&e.contains(v,D)&&(T=l(x))){i.declarations.push(T);continue}if(e.contains(p,m(x.node))||e.isNewExpressionTarget(x.node)){var S;if(c(x))continue;if(T=l(x)){i.declarations.push(T);continue}if(S=u(x)){i.functionCalls.push(S);continue}}if(y&&e.contains(g,m(x.node))){var T;if(c(x))continue;if(T=l(x)){i.declarations.push(T);continue}var C=_(x);if(C){n.accessExpressions.push(C);continue}if(e.isClassDeclaration(t.parent)){var E=d(x);if(E){n.typeUsages.push(E);continue}}}i.valid=!1;}else i.valid=!1;}var k;return i}(e.flatMap(p,(function(t){return e.FindAllReferences.getReferenceEntriesForNode(-1,t,r,r.getSourceFiles(),i)})));return e.every(g.declarations,(function(t){return e.contains(p,t)}))||(g.valid=!1),g;function m(t){var r=f.getSymbolAtLocation(t);return r&&e.getSymbolTarget(r,f)}}(y,f,g);return v.valid?{renameFilename:void 0,renameLocation:void 0,edits:e.textChanges.ChangeTracker.with(t,(function(t){return function(t,r,n,i,a,o){var s=o.signature,c=e.map(b(a,r,n),(function(t){return e.getSynthesizedDeepClone(t)}));s&&p(s,e.map(b(s,r,n),(function(t){return e.getSynthesizedDeepClone(t)}))),p(a,c);for(var l=0,u=e.sortAndDeduplicate(o.functionCalls,(function(t,r){return e.compareValues(t.pos,r.pos)}));l<u.length;l++){var _=u[l];if(_.arguments&&_.arguments.length){var d=e.getSynthesizedDeepClone(h(a,_.arguments),!0);i.replaceNodeRange(e.getSourceFileOfNode(_),e.first(_.arguments),e.last(_.arguments),d,{leadingTriviaOption:e.textChanges.LeadingTriviaOption.IncludeAll,trailingTriviaOption:e.textChanges.TrailingTriviaOption.Include});}}function p(r,n){i.replaceNodeRangeWithNodes(t,e.first(r.parameters),e.last(r.parameters),n,{joiner:", ",indentation:0,leadingTriviaOption:e.textChanges.LeadingTriviaOption.IncludeAll,trailingTriviaOption:e.textChanges.TrailingTriviaOption.Include});}}(a,f,m,t,y,v)}))}:{edits:[]}}},getAvailableActions:function(t){var r=t.file,n=t.startPosition;return e.isSourceFileJS(r)?e.emptyArray:p(r,n,t.program.getTypeChecker())?[{name:i,description:a,actions:[o]}]:e.emptyArray}});})((t=e.refactor||(e.refactor={})).convertParamsToDestructuredObject||(t.convertParamsToDestructuredObject={}));}(t),function(e){var t;(function(r){var n="Convert to template string",a=e.getLocaleSpecificMessage(e.Diagnostics.Convert_to_template_string),o={name:n,description:a,kind:"refactor.rewrite.string"};function s(t,r){var n=e.getTokenAtPosition(t,r),i=l(n);return !u(i).isValidConcatenation&&e.isParenthesizedExpression(i.parent)&&e.isBinaryExpression(i.parent.parent)?i.parent.parent:n}function c(t,r){var n=l(r),i=t.file,a=function(t,r){var n=t.nodes,i=function(t,r){return function(n,i){n<t.length&&e.copyTrailingComments(t[n],i,r,3,!1);}}(t.operators,r),a=function(t,r,n){return function(i,a){for(;i.length>0;){var o=i.shift();e.copyTrailingComments(t[o],a,r,3,!1),n(o,a);}}}(n,r,i),o=d(0,n),s=o[0],c=o[1],l=o[2],u=o[3];if(s===n.length){var f=e.factory.createNoSubstitutionTemplateLiteral(c,l);return a(u,f),f}var g=[],m=e.factory.createTemplateHead(c,l);a(u,m);for(var y,v=function(t){var r=function(t){return e.isParenthesizedExpression(t)&&(p(t),t=t.expression),t}(n[t]);i(t,r);var o=d(t+1,n),s=o[0],c=o[1],l=o[2],u=o[3],f=(t=s-1)==n.length-1;if(e.isTemplateExpression(r)){var m=e.map(r.templateSpans,(function(t,n){p(t);var i=n===r.templateSpans.length-1,a=t.literal.text+(i?c:""),o=_(t.literal)+(i?l:"");return e.factory.createTemplateSpan(t.expression,f?e.factory.createTemplateTail(a,o):e.factory.createTemplateMiddle(a,o))}));g.push.apply(g,m);}else {var v=f?e.factory.createTemplateTail(c,l):e.factory.createTemplateMiddle(c,l);a(u,v),g.push(e.factory.createTemplateSpan(r,v));}y=t;},h=s;h<n.length;h++)v(h),h=y;return e.factory.createTemplateExpression(m,g)}(u(n),i),o=e.getTrailingCommentRanges(i.text,n.end);if(o){var s=o[o.length-1],c={pos:o[0].pos,end:s.end};return e.textChanges.ChangeTracker.with(t,(function(e){e.deleteRange(i,c),e.replaceNode(i,n,a);}))}return e.textChanges.ChangeTracker.with(t,(function(e){return e.replaceNode(i,n,a)}))}function l(t){return e.findAncestor(t.parent,(function(t){switch(t.kind){case 205:case 206:return !1;case 222:case 220:return !(e.isBinaryExpression(t.parent)&&(r=t.parent,63!==r.operatorToken.kind));default:return "quit"}var r;}))||t}function u(t){var r=function(t){if(!e.isBinaryExpression(t))return {nodes:[t],operators:[],validOperators:!0,hasString:e.isStringLiteral(t)||e.isNoSubstitutionTemplateLiteral(t)};var n=r(t.left),i=n.nodes,a=n.operators,o=n.hasString,s=n.validOperators;if(!(o||e.isStringLiteral(t.right)||e.isTemplateExpression(t.right)))return {nodes:[t],operators:[],hasString:!1,validOperators:!0};var c=39===t.operatorToken.kind,l=s&&c;return i.push(t.right),a.push(t.operatorToken),{nodes:i,operators:a,hasString:!0,validOperators:l}},n=r(t),i=n.nodes,a=n.operators,o=n.validOperators,s=n.hasString;return {nodes:i,operators:a,isValidConcatenation:o&&s}}function _(t){var r=e.isTemplateHead(t)||e.isTemplateMiddle(t)?-2:-1;return e.getTextOfNode(t).slice(1,r)}function d(t,r){for(var n=[],i="",a="";t<r.length;){var o=r[t];if(!e.isStringLiteralLike(o)){if(e.isTemplateExpression(o)){i+=o.head.text,a+=_(o.head);break}break}i+=o.text,a+=e.getTextOfNode(o).slice(1,-1).replace(/\\.|[$`]/g,(function(e){return "\\"===e[0]?e:"\\"+e})),n.push(t),t++;}return [t,i,a,n]}function p(t){var r=t.getSourceFile();e.copyTrailingComments(t,t.expression,r,3,!1),e.copyTrailingAsLeadingComments(t.expression,t.expression,r,3,!1);}t.registerRefactor(n,{kinds:[o.kind],getEditsForAction:function(t,r){var n=s(t.file,t.startPosition);switch(r){case a:return {edits:c(t,n)};default:return e.Debug.fail("invalid action")}},getAvailableActions:function(t){var r=l(s(t.file,t.startPosition)),c={name:n,description:a,actions:[]};return e.isBinaryExpression(r)&&u(r).isValidConcatenation?(c.actions.push(o),[c]):t.preferences.provideRefactorNotApplicableReason?(c.actions.push(i$1(i$1({},o),{notApplicableReason:e.getLocaleSpecificMessage(e.Diagnostics.Can_only_convert_string_concatenation)})),[c]):e.emptyArray}});})((t=e.refactor||(e.refactor={})).convertStringOrTemplateLiteral||(t.convertStringOrTemplateLiteral={}));}(t),function(e){var t;(function(r){var n="Convert arrow function or function expression",a=e.getLocaleSpecificMessage(e.Diagnostics.Convert_arrow_function_or_function_expression),o={name:"Convert to anonymous function",description:e.getLocaleSpecificMessage(e.Diagnostics.Convert_to_anonymous_function),kind:"refactor.rewrite.function.anonymous"},s={name:"Convert to named function",description:e.getLocaleSpecificMessage(e.Diagnostics.Convert_to_named_function),kind:"refactor.rewrite.function.named"},c={name:"Convert to arrow function",description:e.getLocaleSpecificMessage(e.Diagnostics.Convert_to_arrow_function),kind:"refactor.rewrite.function.arrow"};function l(t){var r=!1;return t.forEachChild((function t(n){e.isThis(n)?r=!0:e.isClassLike(n)||e.isFunctionDeclaration(n)||e.isFunctionExpression(n)||e.forEachChild(n,t);})),r}function u(t,r,n){var i=e.getTokenAtPosition(t,r),a=n.getTypeChecker(),o=function(t,r,n){if(function(t){return e.isVariableDeclaration(t)||e.isVariableDeclarationList(t)&&1===t.declarations.length}(n)){var i=(e.isVariableDeclaration(n)?n:e.first(n.declarations)).initializer;return i&&(e.isArrowFunction(i)||e.isFunctionExpression(i)&&!d(t,r,i))?i:void 0}}(t,a,i.parent);if(o&&!l(o.body)&&!a.containsArgumentsReference(o))return {selectedVariableDeclaration:!0,func:o};var s=e.getContainingFunction(i);if(s&&(e.isFunctionExpression(s)||e.isArrowFunction(s))&&!e.rangeContainsRange(s.body,i)&&!l(s.body)&&!a.containsArgumentsReference(s)){if(e.isFunctionExpression(s)&&d(t,a,s))return;return {selectedVariableDeclaration:!1,func:s}}}function _(t){if(e.isExpression(t)){var r=e.factory.createReturnStatement(t),n=t.getSourceFile();return e.suppressLeadingAndTrailingTrivia(r),e.copyTrailingAsLeadingComments(t,r,n,void 0,!0),e.factory.createBlock([r],!0)}return t}function d(t,r,n){return !!n.name&&e.FindAllReferences.Core.isSymbolReferencedInFile(n.name,r,t)}t.registerRefactor(n,{kinds:[o.kind,s.kind,c.kind],getEditsForAction:function(t,r){var n=u(t.file,t.startPosition,t.program);if(n){var i=n.func,a=[];switch(r){case o.name:a.push.apply(a,function(t,r){var n=t.file,i=_(r.body),a=e.factory.createFunctionExpression(r.modifiers,r.asteriskToken,void 0,r.typeParameters,r.parameters,r.type,i);return e.textChanges.ChangeTracker.with(t,(function(e){return e.replaceNode(n,r,a)}))}(t,i));break;case s.name:var l=function(t){var r=t.parent;if(e.isVariableDeclaration(r)&&e.isVariableDeclarationInVariableStatement(r)){var n=r.parent,i=n.parent;return e.isVariableDeclarationList(n)&&e.isVariableStatement(i)&&e.isIdentifier(r.name)?{variableDeclaration:r,variableDeclarationList:n,statement:i,name:r.name}:void 0}}(i);if(!l)return;a.push.apply(a,function(t,r,n){var i=t.file,a=_(r.body),o=n.variableDeclaration,s=n.variableDeclarationList,c=n.statement,l=n.name;e.suppressLeadingTrivia(c);var u=1&e.getCombinedModifierFlags(o)|e.getEffectiveModifierFlags(r),d=e.factory.createModifiersFromModifierFlags(u),p=e.factory.createFunctionDeclaration(r.decorators,e.length(d)?d:void 0,r.asteriskToken,l,r.typeParameters,r.parameters,r.type,a);return 1===s.declarations.length?e.textChanges.ChangeTracker.with(t,(function(e){return e.replaceNode(i,c,p)})):e.textChanges.ChangeTracker.with(t,(function(e){e.delete(i,o),e.insertNodeAfter(i,c,p);}))}(t,i,l));break;case c.name:if(!e.isFunctionExpression(i))return;a.push.apply(a,function(t,r){var n,i=t.file,a=r.body.statements[0];!function(t,r){return 1===t.statements.length&&e.isReturnStatement(r)&&!!r.expression}(r.body,a)?n=r.body:(n=a.expression,e.suppressLeadingAndTrailingTrivia(n),e.copyComments(a,n));var o=e.factory.createArrowFunction(r.modifiers,r.typeParameters,r.parameters,r.type,e.factory.createToken(38),n);return e.textChanges.ChangeTracker.with(t,(function(e){return e.replaceNode(i,r,o)}))}(t,i));break;default:return e.Debug.fail("invalid action")}return {renameFilename:void 0,renameLocation:void 0,edits:a}}},getAvailableActions:function(r){var l=r.file,_=r.startPosition,d=r.program,p=r.kind,f=u(l,_,d);if(!f)return e.emptyArray;var g,m=f.selectedVariableDeclaration,y=f.func,v=[],h=[];return t.refactorKindBeginsWith(s.kind,p)&&((g=m||e.isArrowFunction(y)&&e.isVariableDeclaration(y.parent)?void 0:e.getLocaleSpecificMessage(e.Diagnostics.Could_not_convert_to_named_function))?h.push(i$1(i$1({},s),{notApplicableReason:g})):v.push(s)),t.refactorKindBeginsWith(o.kind,p)&&((g=!m&&e.isArrowFunction(y)?void 0:e.getLocaleSpecificMessage(e.Diagnostics.Could_not_convert_to_anonymous_function))?h.push(i$1(i$1({},o),{notApplicableReason:g})):v.push(o)),t.refactorKindBeginsWith(c.kind,p)&&((g=e.isFunctionExpression(y)?void 0:e.getLocaleSpecificMessage(e.Diagnostics.Could_not_convert_to_arrow_function))?h.push(i$1(i$1({},c),{notApplicableReason:g})):v.push(c)),[{name:n,description:a,actions:0===v.length&&r.preferences.provideRefactorNotApplicableReason?h:v}]}});})((t=e.refactor||(e.refactor={})).convertArrowFunctionOrFunctionExpression||(t.convertArrowFunctionOrFunctionExpression={}));}(t),function(e){var t;(function(r){var n="Infer function return type",a=e.Diagnostics.Infer_function_return_type.message,o={name:n,description:a,kind:"refactor.rewrite.function.returnType"};function s(r){if(!e.isInJSFile(r.file)&&t.refactorKindBeginsWith(o.kind,r.kind)){var n=e.getTokenAtPosition(r.file,r.startPosition),i=e.findAncestor(n,(function(t){return e.isBlock(t)||t.parent&&e.isArrowFunction(t.parent)&&(38===t.kind||t.parent.body===t)?"quit":function(e){switch(e.kind){case 255:case 212:case 213:case 168:return !0;default:return !1}}(t)}));if(!i||!i.body||i.type)return {error:e.getLocaleSpecificMessage(e.Diagnostics.Return_type_must_be_inferred_from_a_function)};var a=r.program.getTypeChecker(),s=function(t,r){if(t.isImplementationOfOverload(r)){var n=t.getTypeAtLocation(r).getCallSignatures();if(n.length>1)return t.getUnionType(e.mapDefined(n,(function(e){return e.getReturnType()})))}var i=t.getSignatureFromDeclaration(r);if(i)return t.getReturnTypeOfSignature(i)}(a,i);if(!s)return {error:e.getLocaleSpecificMessage(e.Diagnostics.Could_not_determine_function_return_type)};var c=a.typeToTypeNode(s,i,1);return c?{declaration:i,returnTypeNode:c}:void 0}}t.registerRefactor(n,{kinds:[o.kind],getEditsForAction:function(r){var n=s(r);if(n&&!t.isRefactorErrorInfo(n))return {renameFilename:void 0,renameLocation:void 0,edits:e.textChanges.ChangeTracker.with(r,(function(t){return i=r.file,a=t,o=n.declaration,s=n.returnTypeNode,c=e.findChildOfKind(o,21,i),void((u=(l=e.isArrowFunction(o)&&void 0===c)?e.first(o.parameters):c)&&(l&&(a.insertNodeBefore(i,u,e.factory.createToken(20)),a.insertNodeAfter(i,u,e.factory.createToken(21))),a.insertNodeAt(i,u.end,s,{prefix:": "})));var i,a,o,s,c,l,u;}))}},getAvailableActions:function(r){var c=s(r);return c?t.isRefactorErrorInfo(c)?r.preferences.provideRefactorNotApplicableReason?[{name:n,description:a,actions:[i$1(i$1({},o),{notApplicableReason:c.error})]}]:e.emptyArray:[{name:n,description:a,actions:[o]}]:e.emptyArray}});})((t=e.refactor||(e.refactor={})).inferFunctionReturnType||(t.inferFunctionReturnType={}));}(t),function(e){function t(t,n,i,a){var o=e.isNodeKind(t)?new r(t,n,i):79===t?new u(79,n,i):80===t?new _(80,n,i):new l(t,n,i);return o.parent=a,o.flags=25358336&a.flags,o}e.servicesVersion="0.8";var r=function(){function r(e,t,r){this.pos=t,this.end=r,this.flags=0,this.modifierFlagsCache=0,this.transformFlags=0,this.parent=void 0,this.kind=e;}return r.prototype.assertHasRealPosition=function(t){e.Debug.assert(!e.positionIsSynthesized(this.pos)&&!e.positionIsSynthesized(this.end),t||"Node must have a real position for this operation");},r.prototype.getSourceFile=function(){return e.getSourceFileOfNode(this)},r.prototype.getStart=function(t,r){return this.assertHasRealPosition(),e.getTokenPosOfNode(this,t,r)},r.prototype.getFullStart=function(){return this.assertHasRealPosition(),this.pos},r.prototype.getEnd=function(){return this.assertHasRealPosition(),this.end},r.prototype.getWidth=function(e){return this.assertHasRealPosition(),this.getEnd()-this.getStart(e)},r.prototype.getFullWidth=function(){return this.assertHasRealPosition(),this.end-this.pos},r.prototype.getLeadingTriviaWidth=function(e){return this.assertHasRealPosition(),this.getStart(e)-this.pos},r.prototype.getFullText=function(e){return this.assertHasRealPosition(),(e||this.getSourceFile()).text.substring(this.pos,this.end)},r.prototype.getText=function(e){return this.assertHasRealPosition(),e||(e=this.getSourceFile()),e.text.substring(this.getStart(e),this.getEnd())},r.prototype.getChildCount=function(e){return this.getChildren(e).length},r.prototype.getChildAt=function(e,t){return this.getChildren(t)[e]},r.prototype.getChildren=function(r){return this.assertHasRealPosition("Node without a real position cannot be scanned and thus has no token nodes - use forEachChild and collect the result if that's fine"),this._children||(this._children=function(r,n){if(!e.isNodeKind(r.kind))return e.emptyArray;var i=[];if(e.isJSDocCommentContainingNode(r))return r.forEachChild((function(e){i.push(e);})),i;e.scanner.setText((n||r.getSourceFile()).text);var o=r.pos,s=function(e){a(i,o,e.pos,r),i.push(e),o=e.end;};return e.forEach(r.jsDoc,s),o=r.pos,r.forEachChild(s,(function(e){a(i,o,e.pos,r),i.push(function(e,r){var n=t(346,e.pos,e.end,r);n._children=[];for(var i=e.pos,o=0,s=e;o<s.length;o++){var c=s[o];a(n._children,i,c.pos,r),n._children.push(c),i=c.end;}return a(n._children,i,e.end,r),n}(e,r)),o=e.end;})),a(i,o,r.end,r),e.scanner.setText(void 0),i}(this,r))},r.prototype.getFirstToken=function(t){this.assertHasRealPosition();var r=this.getChildren(t);if(r.length){var n=e.find(r,(function(e){return e.kind<307||e.kind>345}));return n.kind<160?n:n.getFirstToken(t)}},r.prototype.getLastToken=function(t){this.assertHasRealPosition();var r=this.getChildren(t),n=e.lastOrUndefined(r);if(n)return n.kind<160?n:n.getLastToken(t)},r.prototype.forEachChild=function(t,r){return e.forEachChild(this,t,r)},r}();function a(r,n,i,a){for(e.scanner.setTextPos(n);n<i;){var o=e.scanner.scan(),s=e.scanner.getTextPos();if(s<=i&&(79===o&&e.Debug.fail("Did not expect ".concat(e.Debug.formatSyntaxKind(a.kind)," to have an Identifier in its trivia")),r.push(t(o,n,s,a))),n=s,1===o)break}}var o=function(){function t(e,t){this.pos=e,this.end=t,this.flags=0,this.modifierFlagsCache=0,this.transformFlags=0,this.parent=void 0;}return t.prototype.getSourceFile=function(){return e.getSourceFileOfNode(this)},t.prototype.getStart=function(t,r){return e.getTokenPosOfNode(this,t,r)},t.prototype.getFullStart=function(){return this.pos},t.prototype.getEnd=function(){return this.end},t.prototype.getWidth=function(e){return this.getEnd()-this.getStart(e)},t.prototype.getFullWidth=function(){return this.end-this.pos},t.prototype.getLeadingTriviaWidth=function(e){return this.getStart(e)-this.pos},t.prototype.getFullText=function(e){return (e||this.getSourceFile()).text.substring(this.pos,this.end)},t.prototype.getText=function(e){return e||(e=this.getSourceFile()),e.text.substring(this.getStart(e),this.getEnd())},t.prototype.getChildCount=function(){return this.getChildren().length},t.prototype.getChildAt=function(e){return this.getChildren()[e]},t.prototype.getChildren=function(){return 1===this.kind&&this.jsDoc||e.emptyArray},t.prototype.getFirstToken=function(){},t.prototype.getLastToken=function(){},t.prototype.forEachChild=function(){},t}(),s=function(){function t(e,t){this.flags=e,this.escapedName=t;}return t.prototype.getFlags=function(){return this.flags},Object.defineProperty(t.prototype,"name",{get:function(){return e.symbolName(this)},enumerable:!1,configurable:!0}),t.prototype.getEscapedName=function(){return this.escapedName},t.prototype.getName=function(){return this.name},t.prototype.getDeclarations=function(){return this.declarations},t.prototype.getDocumentationComment=function(t){if(!this.documentationComment)if(this.documentationComment=e.emptyArray,!this.declarations&&this.target&&this.target.tupleLabelDeclaration){var r=this.target.tupleLabelDeclaration;this.documentationComment=g([r],t);}else this.documentationComment=g(this.declarations,t);return this.documentationComment},t.prototype.getContextualDocumentationComment=function(t,r){switch(null==t?void 0:t.kind){case 171:return this.contextualGetAccessorDocumentationComment||(this.contextualGetAccessorDocumentationComment=e.emptyArray,this.contextualGetAccessorDocumentationComment=g(e.filter(this.declarations,e.isGetAccessor),r)),this.contextualGetAccessorDocumentationComment;case 172:return this.contextualSetAccessorDocumentationComment||(this.contextualSetAccessorDocumentationComment=e.emptyArray,this.contextualSetAccessorDocumentationComment=g(e.filter(this.declarations,e.isSetAccessor),r)),this.contextualSetAccessorDocumentationComment;default:return this.getDocumentationComment(r)}},t.prototype.getJsDocTags=function(t){return void 0===this.tags&&(this.tags=e.JsDoc.getJsDocTagsFromDeclarations(this.declarations,t)),this.tags},t}(),l=function(e){function t(t,r,n){var i=e.call(this,r,n)||this;return i.kind=t,i}return c(t,e),t}(o),u=function(t){function r(e,r,n){var i=t.call(this,r,n)||this;return i.kind=79,i}return c(r,t),Object.defineProperty(r.prototype,"text",{get:function(){return e.idText(this)},enumerable:!1,configurable:!0}),r}(o);u.prototype.kind=79;var _=function(t){function r(e,r,n){return t.call(this,r,n)||this}return c(r,t),Object.defineProperty(r.prototype,"text",{get:function(){return e.idText(this)},enumerable:!1,configurable:!0}),r}(o);_.prototype.kind=80;var d=function(){function t(e,t){this.checker=e,this.flags=t;}return t.prototype.getFlags=function(){return this.flags},t.prototype.getSymbol=function(){return this.symbol},t.prototype.getProperties=function(){return this.checker.getPropertiesOfType(this)},t.prototype.getProperty=function(e){return this.checker.getPropertyOfType(this,e)},t.prototype.getApparentProperties=function(){return this.checker.getAugmentedPropertiesOfType(this)},t.prototype.getCallSignatures=function(){return this.checker.getSignaturesOfType(this,0)},t.prototype.getConstructSignatures=function(){return this.checker.getSignaturesOfType(this,1)},t.prototype.getStringIndexType=function(){return this.checker.getIndexTypeOfType(this,0)},t.prototype.getNumberIndexType=function(){return this.checker.getIndexTypeOfType(this,1)},t.prototype.getBaseTypes=function(){return this.isClassOrInterface()?this.checker.getBaseTypes(this):void 0},t.prototype.isNullableType=function(){return this.checker.isNullableType(this)},t.prototype.getNonNullableType=function(){return this.checker.getNonNullableType(this)},t.prototype.getNonOptionalType=function(){return this.checker.getNonOptionalType(this)},t.prototype.getConstraint=function(){return this.checker.getBaseConstraintOfType(this)},t.prototype.getDefault=function(){return this.checker.getDefaultFromTypeParameter(this)},t.prototype.isUnion=function(){return !!(1048576&this.flags)},t.prototype.isIntersection=function(){return !!(2097152&this.flags)},t.prototype.isUnionOrIntersection=function(){return !!(3145728&this.flags)},t.prototype.isLiteral=function(){return !!(384&this.flags)},t.prototype.isStringLiteral=function(){return !!(128&this.flags)},t.prototype.isNumberLiteral=function(){return !!(256&this.flags)},t.prototype.isTypeParameter=function(){return !!(262144&this.flags)},t.prototype.isClassOrInterface=function(){return !!(3&e.getObjectFlags(this))},t.prototype.isClass=function(){return !!(1&e.getObjectFlags(this))},Object.defineProperty(t.prototype,"typeArguments",{get:function(){if(4&e.getObjectFlags(this))return this.checker.getTypeArguments(this)},enumerable:!1,configurable:!0}),t}(),p=function(){function t(e,t){this.checker=e,this.flags=t;}return t.prototype.getDeclaration=function(){return this.declaration},t.prototype.getTypeParameters=function(){return this.typeParameters},t.prototype.getParameters=function(){return this.parameters},t.prototype.getReturnType=function(){return this.checker.getReturnTypeOfSignature(this)},t.prototype.getDocumentationComment=function(){return this.documentationComment||(this.documentationComment=g(e.singleElementArray(this.declaration),this.checker))},t.prototype.getJsDocTags=function(){return void 0===this.jsDocTags&&(this.jsDocTags=this.declaration?function(t,r){var i=e.JsDoc.getJsDocTagsFromDeclarations([t],r);if(0===i.length||f(t)){var a=m(r,t,(function(e){var t;return 1===(null===(t=e.declarations)||void 0===t?void 0:t.length)?e.getJsDocTags():void 0}));a&&(i=n$3(n$3([],a,!0),i,!0));}return i}(this.declaration,this.checker):[]),this.jsDocTags},t}();function f(t){return e.getJSDocTags(t).some((function(e){return "inheritDoc"===e.tagName.text}))}function g(t,r){if(!t)return e.emptyArray;var n=e.JsDoc.getJsDocCommentsFromDeclarations(t,r);if(r&&(0===n.length||t.some(f)))for(var i=new e.Set,a=0,o=t;a<o.length;a++){var s=o[a],c=m(r,s,(function(e){if(!i.has(e))return i.add(e),e.getDocumentationComment(r)}));c&&(n=0===n.length?c.slice():c.concat(e.lineBreakPart(),n));}return n}function m(t,r,n){var i,a=170===(null===(i=r.parent)||void 0===i?void 0:i.kind)?r.parent.parent:r.parent;if(a)return e.firstDefined(e.getAllSuperTypeNodes(a),(function(e){var i=t.getPropertyOfType(t.getTypeAtLocation(e),r.symbol.name);return i?n(i):void 0}))}var y=function(t){function r(e,r,n){var i=t.call(this,e,r,n)||this;return i.kind=303,i}return c(r,t),r.prototype.update=function(t,r){return e.updateSourceFile(this,t,r)},r.prototype.getLineAndCharacterOfPosition=function(t){return e.getLineAndCharacterOfPosition(this,t)},r.prototype.getLineStarts=function(){return e.getLineStarts(this)},r.prototype.getPositionOfLineAndCharacter=function(t,r,n){return e.computePositionOfLineAndCharacter(e.getLineStarts(this),t,r,this.text,n)},r.prototype.getLineEndOfPosition=function(e){var t,r=this.getLineAndCharacterOfPosition(e).line,n=this.getLineStarts();r+1>=n.length&&(t=this.getEnd()),t||(t=n[r+1]-1);var i=this.getFullText();return "\n"===i[t]&&"\r"===i[t-1]?t-1:t},r.prototype.getNamedDeclarations=function(){return this.namedDeclarations||(this.namedDeclarations=this.computeNamedDeclarations()),this.namedDeclarations},r.prototype.computeNamedDeclarations=function(){var t=e.createMultiMap();return this.forEachChild((function i(a){switch(a.kind){case 255:case 212:case 168:case 167:var o=a,s=n(o);if(s){var c=function(e){var r=t.get(e);return r||t.set(e,r=[]),r}(s),l=e.lastOrUndefined(c);l&&o.parent===l.parent&&o.symbol===l.symbol?o.body&&!l.body&&(c[c.length-1]=o):c.push(o);}e.forEachChild(a,i);break;case 256:case 225:case 257:case 258:case 259:case 260:case 264:case 274:case 269:case 266:case 267:case 171:case 172:case 181:r(a),e.forEachChild(a,i);break;case 163:if(!e.hasSyntacticModifier(a,16476))break;case 253:case 202:var u=a;if(e.isBindingPattern(u.name)){e.forEachChild(u.name,i);break}u.initializer&&i(u.initializer);case 297:case 166:case 165:r(a);break;case 271:var _=a;_.exportClause&&(e.isNamedExports(_.exportClause)?e.forEach(_.exportClause.elements,i):i(_.exportClause.name));break;case 265:var d=a.importClause;d&&(d.name&&r(d.name),d.namedBindings&&(267===d.namedBindings.kind?r(d.namedBindings):e.forEach(d.namedBindings.elements,i)));break;case 220:0!==e.getAssignmentDeclarationKind(a)&&r(a);default:e.forEachChild(a,i);}})),t;function r(e){var r=n(e);r&&t.add(r,e);}function n(t){var r=e.getNonAssignedNameOfDeclaration(t);return r&&(e.isComputedPropertyName(r)&&e.isPropertyAccessExpression(r.expression)?r.expression.name.text:e.isPropertyName(r)?e.getNameFromPropertyName(r):void 0)}},r}(r),v=function(){function t(e,t,r){this.fileName=e,this.text=t,this.skipTrivia=r;}return t.prototype.getLineAndCharacterOfPosition=function(t){return e.getLineAndCharacterOfPosition(this,t)},t}();function h(t){var r=!0;for(var n in t)if(e.hasProperty(t,n)&&!b(n)){r=!1;break}if(r)return t;var i={};for(var n in t)e.hasProperty(t,n)&&(i[b(n)?n:n.charAt(0).toLowerCase()+n.substr(1)]=t[n]);return i}function b(e){return !e.length||e.charAt(0)===e.charAt(0).toLowerCase()}e.toEditorSettings=h,e.displayPartsToString=function(t){return t?e.map(t,(function(e){return e.text})).join(""):""},e.getDefaultCompilerOptions=function(){return {target:1,jsx:1}},e.getSupportedCodeFixes=function(){return e.codefix.getSupportedErrorCodes()};var x=function(){function t(t,r){this.host=t,this.currentDirectory=t.getCurrentDirectory(),this.fileNameToEntry=new e.Map;for(var n=0,i=t.getScriptFileNames();n<i.length;n++){var a=i[n];this.createEntry(a,e.toPath(a,this.currentDirectory,r));}}return t.prototype.createEntry=function(t,r){var n,i=this.host.getScriptSnapshot(t);return n=i?{hostFileName:t,version:this.host.getScriptVersion(t),scriptSnapshot:i,scriptKind:e.getScriptKind(t,this.host)}:t,this.fileNameToEntry.set(r,n),n},t.prototype.getEntryByPath=function(e){return this.fileNameToEntry.get(e)},t.prototype.getHostFileInformation=function(t){var r=this.fileNameToEntry.get(t);return e.isString(r)?void 0:r},t.prototype.getOrCreateEntryByPath=function(t,r){var n=this.getEntryByPath(r)||this.createEntry(t,r);return e.isString(n)?void 0:n},t.prototype.getRootFileNames=function(){var t=[];return this.fileNameToEntry.forEach((function(r){e.isString(r)?t.push(r):t.push(r.hostFileName);})),t},t.prototype.getScriptSnapshot=function(e){var t=this.getHostFileInformation(e);return t&&t.scriptSnapshot},t}(),D=function(){function t(e){this.host=e;}return t.prototype.getCurrentSourceFile=function(t){var r=this.host.getScriptSnapshot(t);if(!r)throw new Error("Could not find file: '"+t+"'.");var n,i=e.getScriptKind(t,this.host),a=this.host.getScriptVersion(t);if(this.currentFileName!==t)n=T(t,r,99,a,!0,i);else if(this.currentFileVersion!==a){var o=r.getChangeRange(this.currentFileScriptSnapshot);n=C(this.currentSourceFile,r,a,o);}return n&&(this.currentFileVersion=a,this.currentFileName=t,this.currentFileScriptSnapshot=r,this.currentSourceFile=n),this.currentSourceFile},t}();function S(e,t,r){e.version=r,e.scriptSnapshot=t;}function T(t,r,n,i,a,o){var s=e.createSourceFile(t,e.getSnapshotText(r),n,a,o);return S(s,r,i),s}function C(t,r,n,i,a){if(i&&n!==t.version){var o=void 0,s=0!==i.span.start?t.text.substr(0,i.span.start):"",c=e.textSpanEnd(i.span)!==t.text.length?t.text.substr(e.textSpanEnd(i.span)):"";if(0===i.newLength)o=s&&c?s+c:s||c;else {var l=r.getText(i.span.start,i.span.start+i.newLength);o=s&&c?s+l+c:s?s+l:l+c;}var u=e.updateSourceFile(t,o,i,a);return S(u,r,n),u.nameTable=void 0,t!==u&&t.scriptSnapshot&&(t.scriptSnapshot.dispose&&t.scriptSnapshot.dispose(),t.scriptSnapshot=void 0),u}return T(t.fileName,r,t.languageVersion,n,!0,t.scriptKind)}e.createLanguageServiceSourceFile=T,e.updateLanguageServiceSourceFile=C;var E={isCancellationRequested:e.returnFalse,throwIfCancellationRequested:e.noop},k=function(){function t(e){this.cancellationToken=e;}return t.prototype.isCancellationRequested=function(){return this.cancellationToken.isCancellationRequested()},t.prototype.throwIfCancellationRequested=function(){if(this.isCancellationRequested())throw null===e.tracing||void 0===e.tracing||e.tracing.instant("session","cancellationThrown",{kind:"CancellationTokenObject"}),new e.OperationCanceledException},t}(),N=function(){function t(e,t){void 0===t&&(t=20),this.hostCancellationToken=e,this.throttleWaitMilliseconds=t,this.lastCancellationCheckTime=0;}return t.prototype.isCancellationRequested=function(){var t=e.timestamp();return Math.abs(t-this.lastCancellationCheckTime)>=this.throttleWaitMilliseconds&&(this.lastCancellationCheckTime=t,this.hostCancellationToken.isCancellationRequested())},t.prototype.throwIfCancellationRequested=function(){if(this.isCancellationRequested())throw null===e.tracing||void 0===e.tracing||e.tracing.instant("session","cancellationThrown",{kind:"ThrottledCancellationToken"}),new e.OperationCanceledException},t}();e.ThrottledCancellationToken=N;var F=["getSemanticDiagnostics","getSuggestionDiagnostics","getCompilerOptionsDiagnostics","getSemanticClassifications","getEncodedSemanticClassifications","getCodeFixesAtPosition","getCombinedCodeFix","applyCodeActionCommand","organizeImports","getEditsForFileRename","getEmitOutput","getApplicableRefactors","getEditsForRefactor","prepareCallHierarchy","provideCallHierarchyIncomingCalls","provideCallHierarchyOutgoingCalls","provideInlayHints"],A=n$3(n$3([],F,!0),["getCompletionsAtPosition","getCompletionEntryDetails","getCompletionEntrySymbol","getSignatureHelpItems","getQuickInfoAtPosition","getDefinitionAtPosition","getDefinitionAndBoundSpan","getImplementationAtPosition","getTypeDefinitionAtPosition","getReferencesAtPosition","findReferences","getOccurrencesAtPosition","getDocumentHighlights","getNavigateToItems","getRenameInfo","findRenameLocations","getApplicableRefactors"],!1);function P(t){var r=function(t){switch(t.kind){case 10:case 14:case 8:if(161===t.parent.kind)return e.isObjectLiteralElement(t.parent.parent)?t.parent.parent:void 0;case 79:return !e.isObjectLiteralElement(t.parent)||204!==t.parent.parent.kind&&285!==t.parent.parent.kind||t.parent.name!==t?void 0:t.parent}}(t);return r&&(e.isObjectLiteralExpression(r.parent)||e.isJsxAttributes(r.parent))?r:void 0}function w(t,r,n,i){var a=e.getNameFromPropertyName(t.name);if(!a)return e.emptyArray;if(!n.isUnion())return (o=n.getProperty(a))?[o]:e.emptyArray;var o,s=e.mapDefined(n.types,(function(n){return (e.isObjectLiteralExpression(t.parent)||e.isJsxAttributes(t.parent))&&r.isTypeInvalidDueToUnionDiscriminant(n,t.parent)?void 0:n.getProperty(a)}));return i&&(0===s.length||s.length===n.types.length)&&(o=n.getProperty(a))?[o]:0===s.length?e.mapDefined(n.types,(function(e){return e.getProperty(a)})):s}e.createLanguageService=function(t,r,a){var o,s;void 0===r&&(r=e.createDocumentRegistry(t.useCaseSensitiveFileNames&&t.useCaseSensitiveFileNames(),t.getCurrentDirectory())),s=void 0===a?e.LanguageServiceMode.Semantic:"boolean"==typeof a?a?e.LanguageServiceMode.Syntactic:e.LanguageServiceMode.Semantic:a;var c,l,u=new D(t),_=0,d=t.getCancellationToken?new k(t.getCancellationToken()):E,p=t.getCurrentDirectory();function f(e){t.log&&t.log(e);}!e.localizedDiagnosticMessages&&t.getLocalizedDiagnosticMessages&&e.setLocalizedDiagnosticMessages(t.getLocalizedDiagnosticMessages());var g=e.hostUsesCaseSensitiveFileNames(t),m=e.createGetCanonicalFileName(g),y=e.getSourceMapper({useCaseSensitiveFileNames:function(){return g},getCurrentDirectory:function(){return p},getProgram:S,fileExists:e.maybeBind(t,t.fileExists),readFile:e.maybeBind(t,t.readFile),getDocumentPositionMapper:e.maybeBind(t,t.getDocumentPositionMapper),getSourceFileLike:e.maybeBind(t,t.getSourceFileLike),log:f});function v(e){var t=c.getSourceFile(e);if(!t){var r=new Error("Could not find source file: '".concat(e,"'."));throw r.ProgramFiles=c.getSourceFiles().map((function(e){return e.fileName})),r}return t}function b(){var n,i,a;if(e.Debug.assert(s!==e.LanguageServiceMode.Syntactic),t.getProjectVersion){var o=t.getProjectVersion();if(o){if(l===o&&!(null===(n=t.hasChangedAutomaticTypeDirectiveNames)||void 0===n?void 0:n.call(t)))return;l=o;}}var u=t.getTypeRootsVersion?t.getTypeRootsVersion():0;_!==u&&(f("TypeRoots version has changed; provide new program"),c=void 0,_=u);var v,h=new x(t,m),b=h.getRootFileNames(),D=t.getCompilationSettings()||{target:1,jsx:1},S=t.hasInvalidatedResolution||e.returnFalse,T=e.maybeBind(t,t.hasChangedAutomaticTypeDirectiveNames),C=null===(i=t.getProjectReferences)||void 0===i?void 0:i.call(t),E={useCaseSensitiveFileNames:g,fileExists:P,readFile:w,readDirectory:I,trace:e.maybeBind(t,t.trace),getCurrentDirectory:function(){return p},onUnRecoverableConfigFileDiagnostic:e.noop};if(!e.isProgramUptoDate(c,b,D,(function(e,r){return t.getScriptVersion(r)}),P,S,T,A,C)){var k={getSourceFile:M,getSourceFileByPath:L,getCancellationToken:function(){return d},getCanonicalFileName:m,useCaseSensitiveFileNames:function(){return g},getNewLine:function(){return e.getNewLineCharacter(D,(function(){return e.getNewLineOrDefaultFromHost(t)}))},getDefaultLibFileName:function(e){return t.getDefaultLibFileName(e)},writeFile:e.noop,getCurrentDirectory:function(){return p},fileExists:P,readFile:w,getSymlinkCache:e.maybeBind(t,t.getSymlinkCache),realpath:e.maybeBind(t,t.realpath),directoryExists:function(r){return e.directoryProbablyExists(r,t)},getDirectories:function(e){return t.getDirectories?t.getDirectories(e):[]},readDirectory:I,onReleaseOldSourceFile:O,onReleaseParsedCommandLine:function(e,r,n){var i;t.getParsedCommandLine?null===(i=t.onReleaseParsedCommandLine)||void 0===i||i.call(t,e,r,n):r&&O(r.sourceFile,n);},hasInvalidatedResolution:S,hasChangedAutomaticTypeDirectiveNames:T,trace:E.trace,resolveModuleNames:e.maybeBind(t,t.resolveModuleNames),resolveTypeReferenceDirectives:e.maybeBind(t,t.resolveTypeReferenceDirectives),useSourceOfProjectReferenceRedirect:e.maybeBind(t,t.useSourceOfProjectReferenceRedirect),getParsedCommandLine:A};null===(a=t.setCompilerHost)||void 0===a||a.call(t,k);var N=r.getKeyForCompilationSettings(D),F={rootNames:b,options:D,host:k,oldProgram:c,projectReferences:C};return c=e.createProgram(F),h=void 0,v=void 0,y.clearCache(),void c.getTypeChecker()}function A(r){var n=e.toPath(r,p,m),i=null==v?void 0:v.get(n);if(void 0!==i)return i||void 0;var a=t.getParsedCommandLine?t.getParsedCommandLine(r):function(t){var r=M(t);return r?(r.path=e.toPath(t,p,m),r.resolvedPath=r.path,r.originalFileName=r.fileName,e.parseJsonSourceFileConfigFileContent(r,E,e.getNormalizedAbsolutePath(e.getDirectoryPath(t),p),void 0,e.getNormalizedAbsolutePath(t,p))):void 0}(r);return (v||(v=new e.Map)).set(n,a||!1),a}function P(r){var n=e.toPath(r,p,m),i=h&&h.getEntryByPath(n);return i?!e.isString(i):!!t.fileExists&&t.fileExists(r)}function w(r){var n=e.toPath(r,p,m),i=h&&h.getEntryByPath(n);return i?e.isString(i)?void 0:e.getSnapshotText(i.scriptSnapshot):t.readFile&&t.readFile(r)}function I(r,n,i,a,o){return e.Debug.checkDefined(t.readDirectory,"'LanguageServiceHost.readDirectory' must be implemented to correctly process 'projectReferences'"),t.readDirectory(r,n,i,a,o)}function O(e,t){var n=r.getKeyForCompilationSettings(t);r.releaseDocumentWithKey(e.resolvedPath,n,e.scriptKind);}function M(t,r,n,i){return L(t,e.toPath(t,p,m),0,0,i)}function L(t,n,i,a,o){e.Debug.assert(void 0!==h,"getOrCreateSourceFileByPath called after typical CompilerHost lifetime, check the callstack something with a reference to an old host.");var s=h&&h.getOrCreateEntryByPath(t,n);if(s){if(!o){var l=c&&c.getSourceFileByPath(n);if(l){if(s.scriptKind===l.scriptKind)return r.updateDocumentWithKey(t,n,D,N,s.scriptSnapshot,s.version,s.scriptKind);r.releaseDocumentWithKey(l.resolvedPath,r.getKeyForCompilationSettings(c.getCompilerOptions()),l.scriptKind);}}return r.acquireDocumentWithKey(t,n,D,N,s.scriptSnapshot,s.version,s.scriptKind)}}}function S(){if(s!==e.LanguageServiceMode.Syntactic)return b(),c;e.Debug.assert(void 0===c);}function T(t,r,n){var i=e.normalizePath(t);e.Debug.assert(n.some((function(t){return e.normalizePath(t)===i}))),b();var a=e.mapDefined(n,(function(e){return c.getSourceFile(e)})),o=v(t);return e.DocumentHighlights.getDocumentHighlights(c,d,o,r,a)}function C(t,r,n,i){b();var a=n&&2===n.use?c.getSourceFiles().filter((function(e){return !c.isSourceFileDefaultLibrary(e)})):c.getSourceFiles();return e.FindAllReferences.findReferenceOrRenameEntries(c,d,a,t,r,n,i)}var N=new e.Map(e.getEntries(((o={})[18]=19,o[20]=21,o[22]=23,o[31]=29,o)));function I(r){var n;return e.Debug.assertEqual(r.type,"install package"),t.installPackage?t.installPackage({fileName:(n=r.file,e.toPath(n,p,m)),packageName:r.packageName}):Promise.reject("Host does not implement `installPackage`")}function O(e,t){return {lineStarts:e.getLineStarts(),firstLine:e.getLineAndCharacterOfPosition(t.pos).line,lastLine:e.getLineAndCharacterOfPosition(t.end).line}}function M(t,r,n){for(var i=u.getCurrentSourceFile(t),a=[],o=O(i,r),s=o.lineStarts,c=o.firstLine,l=o.lastLine,_=n||!1,d=Number.MAX_VALUE,p=new e.Map,f=new RegExp(/\S/),g=e.isInsideJsxElement(i,s[c]),m=g?"{/*":"//",y=c;y<=l;y++){var v=i.text.substring(s[y],i.getLineEndOfPosition(s[y])),h=f.exec(v);h&&(d=Math.min(d,h.index),p.set(y.toString(),h.index),v.substr(h.index,m.length)!==m&&(_=void 0===n||n));}for(y=c;y<=l;y++)if(c===l||s[y]!==r.end){var b=p.get(y.toString());void 0!==b&&(g?a.push.apply(a,L(t,{pos:s[y]+d,end:i.getLineEndOfPosition(s[y])},_,g)):_?a.push({newText:m,span:{length:0,start:s[y]+d}}):i.text.substr(s[y]+b,m.length)===m&&a.push({newText:"",span:{length:m.length,start:s[y]+b}}));}return a}function L(t,r,n,i){for(var a,o=u.getCurrentSourceFile(t),s=[],c=o.text,l=!1,_=n||!1,d=[],p=r.pos,f=void 0!==i?i:e.isInsideJsxElement(o,p),g=f?"{/*":"/*",m=f?"*/}":"*/",y=f?"\\{\\/\\*":"\\/\\*",v=f?"\\*\\/\\}":"\\*\\/";p<=r.end;){var h=c.substr(p,g.length)===g?g.length:0,b=e.isInComment(o,p+h);if(b)f&&(b.pos--,b.end++),d.push(b.pos),3===b.kind&&d.push(b.end),l=!0,p=b.end+1;else {var x=c.substring(p,r.end).search("(".concat(y,")|(").concat(v,")"));_=void 0!==n?n:_||!e.isTextWhiteSpaceLike(c,p,-1===x?r.end:p+x),p=-1===x?r.end+1:p+x+m.length;}}if(_||!l){2!==(null===(a=e.isInComment(o,r.pos))||void 0===a?void 0:a.kind)&&e.insertSorted(d,r.pos,e.compareValues),e.insertSorted(d,r.end,e.compareValues);var D=d[0];c.substr(D,g.length)!==g&&s.push({newText:g,span:{length:0,start:D}});for(var S=1;S<d.length-1;S++)c.substr(d[S]-m.length,m.length)!==m&&s.push({newText:m,span:{length:0,start:d[S]}}),c.substr(d[S],g.length)!==g&&s.push({newText:g,span:{length:0,start:d[S]}});s.length%2!=0&&s.push({newText:m,span:{length:0,start:d[d.length-1]}});}else for(var T=0,C=d;T<C.length;T++){var E=C[T],k=E-m.length>0?E-m.length:0;h=c.substr(k,m.length)===m?m.length:0,s.push({newText:"",span:{length:g.length,start:E-h}});}return s}function R(t){var r=t.openingElement,n=t.closingElement,i=t.parent;return !e.tagNamesAreEquivalent(r.tagName,n.tagName)||e.isJsxElement(i)&&e.tagNamesAreEquivalent(r.tagName,i.openingElement.tagName)&&R(i)}function B(t){var r=t.closingFragment,n=t.parent;return !!(65536&r.flags)||e.isJsxFragment(n)&&B(n)}function j(r,n,i,a,o,s){var c="number"==typeof n?[n,void 0]:[n.pos,n.end];return {file:r,startPosition:c[0],endPosition:c[1],program:S(),host:t,formatContext:e.formatting.getFormatContext(a,t),cancellationToken:d,preferences:i,triggerReason:o,kind:s}}N.forEach((function(e,t){return N.set(e.toString(),Number(t))}));var J={dispose:function(){if(c){var n=r.getKeyForCompilationSettings(c.getCompilerOptions());e.forEach(c.getSourceFiles(),(function(e){return r.releaseDocumentWithKey(e.resolvedPath,n,e.scriptKind)})),c=void 0;}t=void 0;},cleanupSemanticCache:function(){c=void 0;},getSyntacticDiagnostics:function(e){return b(),c.getSyntacticDiagnostics(v(e),d).slice()},getSemanticDiagnostics:function(t){b();var r=v(t),i=c.getSemanticDiagnostics(r,d);if(!e.getEmitDeclarations(c.getCompilerOptions()))return i.slice();var a=c.getDeclarationDiagnostics(r,d);return n$3(n$3([],i,!0),a,!0)},getSuggestionDiagnostics:function(t){return b(),e.computeSuggestionDiagnostics(v(t),c,d)},getCompilerOptionsDiagnostics:function(){return b(),n$3(n$3([],c.getOptionsDiagnostics(d),!0),c.getGlobalDiagnostics(d),!0)},getSyntacticClassifications:function(t,r){return e.getSyntacticClassifications(d,u.getCurrentSourceFile(t),r)},getSemanticClassifications:function(t,r,n){return b(),"2020"===(n||"original")?e.classifier.v2020.getSemanticClassifications(c,d,v(t),r):e.getSemanticClassifications(c.getTypeChecker(),d,v(t),c.getClassifiableNames(),r)},getEncodedSyntacticClassifications:function(t,r){return e.getEncodedSyntacticClassifications(d,u.getCurrentSourceFile(t),r)},getEncodedSemanticClassifications:function(t,r,n){return b(),"original"===(n||"original")?e.getEncodedSemanticClassifications(c.getTypeChecker(),d,v(t),c.getClassifiableNames(),r):e.classifier.v2020.getEncodedSemanticClassifications(c,d,v(t),r)},getCompletionsAtPosition:function(r,n,a){void 0===a&&(a=e.emptyOptions);var o=i$1(i$1({},e.identity(a)),{includeCompletionsForModuleExports:a.includeCompletionsForModuleExports||a.includeExternalModuleExports,includeCompletionsWithInsertText:a.includeCompletionsWithInsertText||a.includeInsertTextCompletions});return b(),e.Completions.getCompletionsAtPosition(t,c,f,v(r),n,o,a.triggerCharacter,a.triggerKind,d)},getCompletionEntryDetails:function(r,n,i,a,o,s,l){return void 0===s&&(s=e.emptyOptions),b(),e.Completions.getCompletionEntryDetails(c,f,v(r),n,{name:i,source:o,data:l},t,a&&e.formatting.getFormatContext(a,t),s,d)},getCompletionEntrySymbol:function(r,n,i,a,o){return void 0===o&&(o=e.emptyOptions),b(),e.Completions.getCompletionEntrySymbol(c,f,v(r),n,{name:i,source:a},t,o)},getSignatureHelpItems:function(t,r,n){var i=(void 0===n?e.emptyOptions:n).triggerReason;b();var a=v(t);return e.SignatureHelp.getSignatureHelpItems(c,a,r,i,d)},getQuickInfoAtPosition:function(t,r){b();var n=v(t),i=e.getTouchingPropertyName(n,r);if(i!==n){var a=c.getTypeChecker(),o=function(t){return e.isNewExpression(t.parent)&&t.pos===t.parent.pos?t.parent.expression:e.isNamedTupleMember(t.parent)&&t.pos===t.parent.pos?t.parent:t}(i),s=function(t,r){var n=P(t);if(n){var i=r.getContextualType(n.parent),a=i&&w(n,r,i,!1);if(a&&1===a.length)return e.first(a)}return r.getSymbolAtLocation(t)}(o,a);if(!s||a.isUnknownSymbol(s)){var l=function(t,r,n){switch(r.kind){case 79:return !e.isLabelName(r)&&!e.isTagName(r)&&!e.isConstTypeReference(r.parent);case 205:case 160:return !e.isInComment(t,n);case 108:case 191:case 106:case 196:return !0;default:return !1}}(n,o,r)?a.getTypeAtLocation(o):void 0;return l&&{kind:"",kindModifiers:"",textSpan:e.createTextSpanFromNode(o,n),displayParts:a.runWithCancellationToken(d,(function(t){return e.typeToDisplayParts(t,l,e.getContainerNode(o))})),documentation:l.symbol?l.symbol.getDocumentationComment(a):void 0,tags:l.symbol?l.symbol.getJsDocTags(a):void 0}}var u=a.runWithCancellationToken(d,(function(t){return e.SymbolDisplay.getSymbolDisplayPartsDocumentationAndSymbolKind(t,s,n,e.getContainerNode(o),o)})),_=u.symbolKind,p=u.displayParts,f=u.documentation,g=u.tags;return {kind:_,kindModifiers:e.SymbolDisplay.getSymbolModifiers(a,s),textSpan:e.createTextSpanFromNode(o,n),displayParts:p,documentation:f,tags:g}}},getDefinitionAtPosition:function(t,r){return b(),e.GoToDefinition.getDefinitionAtPosition(c,v(t),r)},getDefinitionAndBoundSpan:function(t,r){return b(),e.GoToDefinition.getDefinitionAndBoundSpan(c,v(t),r)},getImplementationAtPosition:function(t,r){return b(),e.FindAllReferences.getImplementationsAtPosition(c,d,c.getSourceFiles(),v(t),r)},getTypeDefinitionAtPosition:function(t,r){return b(),e.GoToDefinition.getTypeDefinitionAtPosition(c.getTypeChecker(),v(t),r)},getReferencesAtPosition:function(t,r){return b(),C(e.getTouchingPropertyName(v(t),r),r,{use:1},(function(t,r,n){return e.FindAllReferences.toReferenceEntry(t,n.getSymbolAtLocation(r))}))},findReferences:function(t,r){return b(),e.FindAllReferences.findReferencedSymbols(c,d,c.getSourceFiles(),v(t),r)},getFileReferences:function(t){var r;b();var n=null===(r=c.getSourceFile(t))||void 0===r?void 0:r.symbol;return e.FindAllReferences.Core.getReferencesForFileName(t,c,c.getSourceFiles()).map((function(t){return e.FindAllReferences.toReferenceEntry(t,n)}))},getOccurrencesAtPosition:function(t,r){return e.flatMap(T(t,r,[t]),(function(e){return e.highlightSpans.map((function(t){return i$1(i$1({fileName:e.fileName,textSpan:t.textSpan,isWriteAccess:"writtenReference"===t.kind,isDefinition:!1},t.isInString&&{isInString:!0}),t.contextSpan&&{contextSpan:t.contextSpan})}))}))},getDocumentHighlights:T,getNameOrDottedNameSpan:function(t,r,n){var i=u.getCurrentSourceFile(t),a=e.getTouchingPropertyName(i,r);if(a!==i){switch(a.kind){case 205:case 160:case 10:case 95:case 110:case 104:case 106:case 108:case 191:case 79:break;default:return}for(var o=a;;)if(e.isRightSideOfPropertyAccess(o)||e.isRightSideOfQualifiedName(o))o=o.parent;else {if(!e.isNameOfModuleDeclaration(o))break;if(260!==o.parent.parent.kind||o.parent.parent.body!==o.parent)break;o=o.parent.parent.name;}return e.createTextSpanFromBounds(o.getStart(),a.getEnd())}},getBreakpointStatementAtPosition:function(t,r){var n=u.getCurrentSourceFile(t);return e.BreakpointResolver.spanInSourceFileAtLocation(n,r)},getNavigateToItems:function(t,r,n,i){void 0===i&&(i=!1),b();var a=n?[v(n)]:c.getSourceFiles();return e.NavigateTo.getNavigateToItems(a,c.getTypeChecker(),d,t,r,i)},getRenameInfo:function(t,r,n){return b(),e.Rename.getRenameInfo(c,v(t),r,n)},getSmartSelectionRange:function(t,r){return e.SmartSelectionRange.getSmartSelectionRange(r,u.getCurrentSourceFile(t))},findRenameLocations:function(t,r,n,a,o){b();var s=v(t),c=e.getAdjustedRenameLocation(e.getTouchingPropertyName(s,r));if(e.Rename.nodeIsEligibleForRename(c)){if(e.isIdentifier(c)&&(e.isJsxOpeningElement(c.parent)||e.isJsxClosingElement(c.parent))&&e.isIntrinsicJsxName(c.escapedText)){var l=c.parent.parent;return [l.openingElement,l.closingElement].map((function(t){var r=e.createTextSpanFromNode(t.tagName,s);return i$1({fileName:s.fileName,textSpan:r},e.FindAllReferences.toContextSpan(r,s,t.parent))}))}return C(c,r,{findInStrings:n,findInComments:a,providePrefixAndSuffixTextForRename:o,use:2},(function(t,r,n){return e.FindAllReferences.toRenameLocation(t,r,n,o||!1)}))}},getNavigationBarItems:function(t){return e.NavigationBar.getNavigationBarItems(u.getCurrentSourceFile(t),d)},getNavigationTree:function(t){return e.NavigationBar.getNavigationTree(u.getCurrentSourceFile(t),d)},getOutliningSpans:function(t){var r=u.getCurrentSourceFile(t);return e.OutliningElementsCollector.collectElements(r,d)},getTodoComments:function(t,r){b();var n=v(t);d.throwIfCancellationRequested();var i,a,o=n.text,s=[];if(r.length>0&&(a=n.fileName,!e.stringContains(a,"/node_modules/")))for(var c=function(){var t="("+/(?:^(?:\s|\*)*)/.source+"|"+/(?:\/\/+\s*)/.source+"|"+/(?:\/\*+\s*)/.source+")",n="(?:"+e.map(r,(function(e){return "("+e.text.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")+")"})).join("|")+")";return new RegExp(t+"("+n+/(?:.*?)/.source+")"+/(?:$|\*\/)/.source,"gim")}(),l=void 0;l=c.exec(o);){d.throwIfCancellationRequested(),e.Debug.assert(l.length===r.length+3);var u=l[1],_=l.index+u.length;if(e.isInComment(n,_)){for(var p=void 0,f=0;f<r.length;f++)l[f+3]&&(p=r[f]);if(void 0===p)return e.Debug.fail();if(!((i=o.charCodeAt(_+p.text.length))>=97&&i<=122||i>=65&&i<=90||i>=48&&i<=57)){var g=l[2];s.push({descriptor:p,message:g,position:_});}}}return s},getBraceMatchingAtPosition:function(t,r){var n=u.getCurrentSourceFile(t),i=e.getTouchingToken(n,r),a=i.getStart(n)===r?N.get(i.kind.toString()):void 0,o=a&&e.findChildOfKind(i.parent,a,n);return o?[e.createTextSpanFromNode(i,n),e.createTextSpanFromNode(o,n)].sort((function(e,t){return e.start-t.start})):e.emptyArray},getIndentationAtPosition:function(t,r,n){var i=e.timestamp(),a=h(n),o=u.getCurrentSourceFile(t);f("getIndentationAtPosition: getCurrentSourceFile: "+(e.timestamp()-i)),i=e.timestamp();var s=e.formatting.SmartIndenter.getIndentation(r,o,a);return f("getIndentationAtPosition: computeIndentation : "+(e.timestamp()-i)),s},getFormattingEditsForRange:function(r,n,i,a){var o=u.getCurrentSourceFile(r);return e.formatting.formatSelection(n,i,o,e.formatting.getFormatContext(h(a),t))},getFormattingEditsForDocument:function(r,n){return e.formatting.formatDocument(u.getCurrentSourceFile(r),e.formatting.getFormatContext(h(n),t))},getFormattingEditsAfterKeystroke:function(r,n,i,a){var o=u.getCurrentSourceFile(r),s=e.formatting.getFormatContext(h(a),t);if(!e.isInComment(o,n))switch(i){case"{":return e.formatting.formatOnOpeningCurly(n,o,s);case"}":return e.formatting.formatOnClosingCurly(n,o,s);case";":return e.formatting.formatOnSemicolon(n,o,s);case"\n":return e.formatting.formatOnEnter(n,o,s)}return []},getDocCommentTemplateAtPosition:function(r,n,i){return e.JsDoc.getDocCommentTemplateAtPosition(e.getNewLineOrDefaultFromHost(t),u.getCurrentSourceFile(r),n,i)},isValidBraceCompletionAtPosition:function(t,r,n){if(60===n)return !1;var i=u.getCurrentSourceFile(t);if(e.isInString(i,r))return !1;if(e.isInsideJsxElementOrAttribute(i,r))return 123===n;if(e.isInTemplateString(i,r))return !1;switch(n){case 39:case 34:case 96:return !e.isInComment(i,r)}return !0},getJsxClosingTagAtPosition:function(t,r){var n=u.getCurrentSourceFile(t),i=e.findPrecedingToken(r,n);if(i){var a=31===i.kind&&e.isJsxOpeningElement(i.parent)?i.parent.parent:e.isJsxText(i)&&e.isJsxElement(i.parent)?i.parent:void 0;if(a&&R(a))return {newText:"</".concat(a.openingElement.tagName.getText(n),">")};var o=31===i.kind&&e.isJsxOpeningFragment(i.parent)?i.parent.parent:e.isJsxText(i)&&e.isJsxFragment(i.parent)?i.parent:void 0;return o&&B(o)?{newText:"</>"}:void 0}},getSpanOfEnclosingComment:function(t,r,n){var i=u.getCurrentSourceFile(t),a=e.formatting.getRangeOfEnclosingComment(i,r);return !a||n&&3!==a.kind?void 0:e.createTextSpanFromRange(a)},getCodeFixesAtPosition:function(r,n,i,a,o,s){void 0===s&&(s=e.emptyOptions),b();var l=v(r),u=e.createTextSpanFromBounds(n,i),_=e.formatting.getFormatContext(o,t);return e.flatMap(e.deduplicate(a,e.equateValues,e.compareValues),(function(r){return d.throwIfCancellationRequested(),e.codefix.getFixes({errorCode:r,sourceFile:l,span:u,program:c,host:t,cancellationToken:d,formatContext:_,preferences:s})}))},getCombinedCodeFix:function(r,n,i,a){void 0===a&&(a=e.emptyOptions),b(),e.Debug.assert("file"===r.type);var o=v(r.fileName),s=e.formatting.getFormatContext(i,t);return e.codefix.getAllFixes({fixId:n,sourceFile:o,program:c,host:t,cancellationToken:d,formatContext:s,preferences:a})},applyCodeActionCommand:function(t,r){var n="string"==typeof t?r:t;return e.isArray(n)?Promise.all(n.map((function(e){return I(e)}))):I(n)},organizeImports:function(r,n,i){void 0===i&&(i=e.emptyOptions),b(),e.Debug.assert("file"===r.type);var a=v(r.fileName),o=e.formatting.getFormatContext(n,t);return e.OrganizeImports.organizeImports(a,o,t,c,i,r.skipDestructiveCodeActions)},getEditsForFileRename:function(r,n,i,a){return void 0===a&&(a=e.emptyOptions),e.getEditsForFileRename(S(),r,n,t,e.formatting.getFormatContext(i,t),a,y)},getEmitOutput:function(r,n,i){b();var a=v(r),o=t.getCustomTransformers&&t.getCustomTransformers();return e.getFileEmitOutput(c,a,!!n,d,o,i)},getNonBoundSourceFile:function(e){return u.getCurrentSourceFile(e)},getProgram:S,getAutoImportProvider:function(){var e;return null===(e=t.getPackageJsonAutoImportProvider)||void 0===e?void 0:e.call(t)},getApplicableRefactors:function(t,r,n,i,a){void 0===n&&(n=e.emptyOptions),b();var o=v(t);return e.refactor.getApplicableRefactors(j(o,r,n,e.emptyOptions,i,a))},getEditsForRefactor:function(t,r,n,i,a,o){void 0===o&&(o=e.emptyOptions),b();var s=v(t);return e.refactor.getEditsForRefactor(j(s,n,o,r),i,a)},toLineColumnOffset:function(e,t){return 0===t?{line:0,character:0}:y.toLineColumnOffset(e,t)},getSourceMapper:function(){return y},clearSourceMapperCache:function(){return y.clearCache()},prepareCallHierarchy:function(t,r){b();var n=e.CallHierarchy.resolveCallHierarchyDeclaration(c,e.getTouchingPropertyName(v(t),r));return n&&e.mapOneOrMany(n,(function(t){return e.CallHierarchy.createCallHierarchyItem(c,t)}))},provideCallHierarchyIncomingCalls:function(t,r){b();var n=v(t),i=e.firstOrOnly(e.CallHierarchy.resolveCallHierarchyDeclaration(c,0===r?n:e.getTouchingPropertyName(n,r)));return i?e.CallHierarchy.getIncomingCalls(c,i,d):[]},provideCallHierarchyOutgoingCalls:function(t,r){b();var n=v(t),i=e.firstOrOnly(e.CallHierarchy.resolveCallHierarchyDeclaration(c,0===r?n:e.getTouchingPropertyName(n,r)));return i?e.CallHierarchy.getOutgoingCalls(c,i):[]},toggleLineComment:M,toggleMultilineComment:L,commentSelection:function(e,t){var r=O(u.getCurrentSourceFile(e),t);return r.firstLine===r.lastLine&&t.pos!==t.end?L(e,t,!0):M(e,t,!0)},uncommentSelection:function(t,r){var n=u.getCurrentSourceFile(t),i=[],a=r.pos,o=r.end;a===o&&(o+=e.isInsideJsxElement(n,a)?2:1);for(var s=a;s<=o;s++){var c=e.isInComment(n,s);if(c){switch(c.kind){case 2:i.push.apply(i,M(t,{end:c.end,pos:c.pos+1},!1));break;case 3:i.push.apply(i,L(t,{end:c.end,pos:c.pos+1},!1));}s=c.end+1;}}return i},provideInlayHints:function(r,n,i){void 0===i&&(i=e.emptyOptions),b();var a=v(r);return e.InlayHints.provideInlayHints(function(e,r,n){return {file:e,program:S(),host:t,span:r,preferences:n,cancellationToken:d}}(a,n,i))}};switch(s){case e.LanguageServiceMode.Semantic:break;case e.LanguageServiceMode.PartialSemantic:F.forEach((function(e){return J[e]=function(){throw new Error("LanguageService Operation: ".concat(e," not allowed in LanguageServiceMode.PartialSemantic"))}}));break;case e.LanguageServiceMode.Syntactic:A.forEach((function(e){return J[e]=function(){throw new Error("LanguageService Operation: ".concat(e," not allowed in LanguageServiceMode.Syntactic"))}}));break;default:e.Debug.assertNever(s);}return J},e.getNameTable=function(t){return t.nameTable||function(t){var r=t.nameTable=new e.Map;t.forEachChild((function t(n){if(e.isIdentifier(n)&&!e.isTagName(n)&&n.escapedText||e.isStringOrNumericLiteralLike(n)&&function(t){return e.isDeclarationName(t)||276===t.parent.kind||function(e){return e&&e.parent&&206===e.parent.kind&&e.parent.argumentExpression===e}(t)||e.isLiteralComputedPropertyDeclarationName(t)}(n)){var i=e.getEscapedTextOfIdentifierOrLiteral(n);r.set(i,void 0===r.get(i)?n.pos:-1);}else e.isPrivateIdentifier(n)&&(i=n.escapedText,r.set(i,void 0===r.get(i)?n.pos:-1));if(e.forEachChild(n,t),e.hasJSDocNodes(n))for(var a=0,o=n.jsDoc;a<o.length;a++){var s=o[a];e.forEachChild(s,t);}}));}(t),t.nameTable},e.getContainingObjectLiteralElement=P,e.getPropertySymbolsFromContextualType=w,e.setObjectAllocator({getNodeConstructor:function(){return r},getTokenConstructor:function(){return l},getIdentifierConstructor:function(){return u},getPrivateIdentifierConstructor:function(){return _},getSourceFileConstructor:function(){return y},getSymbolConstructor:function(){return s},getTypeConstructor:function(){return d},getSignatureConstructor:function(){return p},getSourceMapSourceConstructor:function(){return v}});}(t),function(e){(e.BreakpointResolver||(e.BreakpointResolver={})).spanInSourceFileAtLocation=function(t,r){if(!t.isDeclarationFile){var n=e.getTokenAtPosition(t,r),i=t.getLineAndCharacterOfPosition(r).line;if(t.getLineAndCharacterOfPosition(n.getStart(t)).line>i){var a=e.findPrecedingToken(n.pos,t);if(!a||t.getLineAndCharacterOfPosition(a.getEnd()).line!==i)return;n=a;}if(!(8388608&n.flags))return _(n)}function o(r,n){var i=r.decorators?e.skipTrivia(t.text,r.decorators.end):r.getStart(t);return e.createTextSpanFromBounds(i,(n||r).getEnd())}function s(r,n){return o(r,e.findNextToken(n,n.parent,t))}function c(e,r){return e&&i===t.getLineAndCharacterOfPosition(e.getStart(t)).line?_(e):_(r)}function l(r){return _(e.findPrecedingToken(r.pos,t))}function u(r){return _(e.findNextToken(r,r.parent,t))}function _(r){if(r){var n=r.parent;switch(r.kind){case 236:return x(r.declarationList.declarations[0]);case 253:case 166:case 165:return x(r);case 163:return function t(r){if(e.isBindingPattern(r.name))return C(r.name);if(function(t){return !!t.initializer||void 0!==t.dotDotDotToken||e.hasSyntacticModifier(t,12)}(r))return o(r);var n=r.parent,i=n.parameters.indexOf(r);return e.Debug.assert(-1!==i),0!==i?t(n.parameters[i-1]):_(n.body)}(r);case 255:case 168:case 167:case 171:case 172:case 170:case 212:case 213:return function(e){if(e.body)return D(e)?o(e):_(e.body)}(r);case 234:if(e.isFunctionBlock(r))return v=(y=r).statements.length?y.statements[0]:y.getLastToken(),D(y.parent)?c(y.parent,v):_(v);case 261:return S(r);case 291:return S(r.block);case 237:return o(r.expression);case 246:return o(r.getChildAt(0),r.expression);case 240:return s(r,r.expression);case 239:return _(r.statement);case 252:return o(r.getChildAt(0));case 238:return s(r,r.expression);case 249:return _(r.statement);case 245:case 244:return o(r.getChildAt(0),r.label);case 241:return (m=r).initializer?T(m):m.condition?o(m.condition):m.incrementor?o(m.incrementor):void 0;case 242:return s(r,r.expression);case 243:return T(r);case 248:return s(r,r.expression);case 288:case 289:return _(r.statements[0]);case 251:return S(r.tryBlock);case 250:case 270:return o(r,r.expression);case 264:return o(r,r.moduleReference);case 265:case 271:return o(r,r.moduleSpecifier);case 260:if(1!==e.getModuleInstanceState(r))return;case 256:case 259:case 297:case 202:return o(r);case 247:return _(r.statement);case 164:return h=n.decorators,e.createTextSpanFromBounds(e.skipTrivia(t.text,h.pos),h.end);case 200:case 201:return C(r);case 257:case 258:return;case 26:case 1:return c(e.findPrecedingToken(r.pos,t));case 27:return l(r);case 18:return function(r){switch(r.parent.kind){case 259:var n=r.parent;return c(e.findPrecedingToken(r.pos,t,r.parent),n.members.length?n.members[0]:n.getLastToken(t));case 256:var i=r.parent;return c(e.findPrecedingToken(r.pos,t,r.parent),i.members.length?i.members[0]:i.getLastToken(t));case 262:return c(r.parent.parent,r.parent.clauses[0])}return _(r.parent)}(r);case 19:return function(t){switch(t.parent.kind){case 261:if(1!==e.getModuleInstanceState(t.parent.parent))return;case 259:case 256:return o(t);case 234:if(e.isFunctionBlock(t.parent))return o(t);case 291:return _(e.lastOrUndefined(t.parent.statements));case 262:var r=t.parent,n=e.lastOrUndefined(r.clauses);return n?_(e.lastOrUndefined(n.statements)):void 0;case 200:var i=t.parent;return _(e.lastOrUndefined(i.elements)||i);default:if(e.isArrayLiteralOrObjectLiteralDestructuringPattern(t.parent)){var a=t.parent;return o(e.lastOrUndefined(a.properties)||a)}return _(t.parent)}}(r);case 23:return function(t){switch(t.parent.kind){case 201:var r=t.parent;return o(e.lastOrUndefined(r.elements)||r);default:if(e.isArrayLiteralOrObjectLiteralDestructuringPattern(t.parent)){var n=t.parent;return o(e.lastOrUndefined(n.elements)||n)}return _(t.parent)}}(r);case 20:return function(e){return 239===e.parent.kind||207===e.parent.kind||208===e.parent.kind?l(e):211===e.parent.kind?u(e):_(e.parent)}(r);case 21:return function(e){switch(e.parent.kind){case 212:case 255:case 213:case 168:case 167:case 171:case 172:case 170:case 240:case 239:case 241:case 243:case 207:case 208:case 211:return l(e);default:return _(e.parent)}}(r);case 58:return function(t){return e.isFunctionLike(t.parent)||294===t.parent.kind||163===t.parent.kind?l(t):_(t.parent)}(r);case 31:case 29:return function(e){return 210===e.parent.kind?u(e):_(e.parent)}(r);case 115:return function(e){return 239===e.parent.kind?s(e,e.parent.expression):_(e.parent)}(r);case 91:case 83:case 96:return u(r);case 159:return function(e){return 243===e.parent.kind?u(e):_(e.parent)}(r);default:if(e.isArrayLiteralOrObjectLiteralDestructuringPattern(r))return E(r);if((79===r.kind||224===r.kind||294===r.kind||295===r.kind)&&e.isArrayLiteralOrObjectLiteralDestructuringPattern(n))return o(r);if(220===r.kind){var i=r,a=i.left,d=i.operatorToken;if(e.isArrayLiteralOrObjectLiteralDestructuringPattern(a))return E(a);if(63===d.kind&&e.isArrayLiteralOrObjectLiteralDestructuringPattern(r.parent))return o(r);if(27===d.kind)return _(a)}if(e.isExpressionNode(r))switch(n.kind){case 239:return l(r);case 164:return _(r.parent);case 241:case 243:return o(r);case 220:if(27===r.parent.operatorToken.kind)return o(r);break;case 213:if(r.parent.body===r)return o(r)}switch(r.parent.kind){case 294:if(r.parent.name===r&&!e.isArrayLiteralOrObjectLiteralDestructuringPattern(r.parent.parent))return _(r.parent.initializer);break;case 210:if(r.parent.type===r)return u(r.parent.type);break;case 253:case 163:var p=r.parent,f=p.initializer,g=p.type;if(f===r||g===r||e.isAssignmentOperator(r.kind))return l(r);break;case 220:if(a=r.parent.left,e.isArrayLiteralOrObjectLiteralDestructuringPattern(a)&&r!==a)return l(r);break;default:if(e.isFunctionLike(r.parent)&&r.parent.type===r)return l(r)}return _(r.parent)}}var m,y,v,h;function b(r){return e.isVariableDeclarationList(r.parent)&&r.parent.declarations[0]===r?o(e.findPrecedingToken(r.pos,t,r.parent),r):o(r)}function x(r){if(242===r.parent.parent.kind)return _(r.parent.parent);var n=r.parent;return e.isBindingPattern(r.name)?C(r.name):r.initializer||e.hasSyntacticModifier(r,1)||243===n.parent.kind?b(r):e.isVariableDeclarationList(r.parent)&&r.parent.declarations[0]!==r?_(e.findPrecedingToken(r.pos,t,r.parent)):void 0}function D(t){return e.hasSyntacticModifier(t,1)||256===t.parent.kind&&170!==t.kind}function S(r){switch(r.parent.kind){case 260:if(1!==e.getModuleInstanceState(r.parent))return;case 240:case 238:case 242:return c(r.parent,r.statements[0]);case 241:case 243:return c(e.findPrecedingToken(r.pos,t,r.parent),r.statements[0])}return _(r.statements[0])}function T(e){if(254!==e.initializer.kind)return _(e.initializer);var t=e.initializer;return t.declarations.length>0?_(t.declarations[0]):void 0}function C(t){var r=e.forEach(t.elements,(function(e){return 226!==e.kind?e:void 0}));return r?_(r):202===t.parent.kind?o(t.parent):b(t.parent)}function E(t){e.Debug.assert(201!==t.kind&&200!==t.kind);var r=203===t.kind?t.elements:t.properties,n=e.forEach(r,(function(e){return 226!==e.kind?e:void 0}));return n?_(n):o(220===t.parent.kind?t.parent:t)}}};}(t),function(e){e.transform=function(t,r,n){var i=[];n=e.fixupCompilerOptions(n,i);var a=e.isArray(t)?t:[t],o=e.transformNodes(void 0,void 0,e.factory,n,a,r,!0);return o.diagnostics=e.concatenate(o.diagnostics,i),o};}(t);var l=function(){return this}();!function(e){function t(e,t){e&&e.log("*INTERNAL ERROR* - Exception in typescript services: "+t.message);}var r=function(){function t(e){this.scriptSnapshotShim=e;}return t.prototype.getText=function(e,t){return this.scriptSnapshotShim.getText(e,t)},t.prototype.getLength=function(){return this.scriptSnapshotShim.getLength()},t.prototype.getChangeRange=function(t){var r=t,n=this.scriptSnapshotShim.getChangeRange(r.scriptSnapshotShim);if(null===n)return null;var i=JSON.parse(n);return e.createTextChangeRange(e.createTextSpan(i.span.start,i.span.length),i.newLength)},t.prototype.dispose=function(){"dispose"in this.scriptSnapshotShim&&this.scriptSnapshotShim.dispose();},t}(),a=function(){function t(t){var r=this;this.shimHost=t,this.loggingEnabled=!1,this.tracingEnabled=!1,"getModuleResolutionsForFile"in this.shimHost&&(this.resolveModuleNames=function(t,n){var i=JSON.parse(r.shimHost.getModuleResolutionsForFile(n));return e.map(t,(function(t){var r=e.getProperty(i,t);return r?{resolvedFileName:r,extension:e.extensionFromPath(r),isExternalLibraryImport:!1}:void 0}))}),"directoryExists"in this.shimHost&&(this.directoryExists=function(e){return r.shimHost.directoryExists(e)}),"getTypeReferenceDirectiveResolutionsForFile"in this.shimHost&&(this.resolveTypeReferenceDirectives=function(t,n){var i=JSON.parse(r.shimHost.getTypeReferenceDirectiveResolutionsForFile(n));return e.map(t,(function(t){return e.getProperty(i,t)}))});}return t.prototype.log=function(e){this.loggingEnabled&&this.shimHost.log(e);},t.prototype.trace=function(e){this.tracingEnabled&&this.shimHost.trace(e);},t.prototype.error=function(e){this.shimHost.error(e);},t.prototype.getProjectVersion=function(){if(this.shimHost.getProjectVersion)return this.shimHost.getProjectVersion()},t.prototype.getTypeRootsVersion=function(){return this.shimHost.getTypeRootsVersion?this.shimHost.getTypeRootsVersion():0},t.prototype.useCaseSensitiveFileNames=function(){return !!this.shimHost.useCaseSensitiveFileNames&&this.shimHost.useCaseSensitiveFileNames()},t.prototype.getCompilationSettings=function(){var e=this.shimHost.getCompilationSettings();if(null===e||""===e)throw Error("LanguageServiceShimHostAdapter.getCompilationSettings: empty compilationSettings");var t=JSON.parse(e);return t.allowNonTsExtensions=!0,t},t.prototype.getScriptFileNames=function(){var e=this.shimHost.getScriptFileNames();return JSON.parse(e)},t.prototype.getScriptSnapshot=function(e){var t=this.shimHost.getScriptSnapshot(e);return t&&new r(t)},t.prototype.getScriptKind=function(e){return "getScriptKind"in this.shimHost?this.shimHost.getScriptKind(e):0},t.prototype.getScriptVersion=function(e){return this.shimHost.getScriptVersion(e)},t.prototype.getLocalizedDiagnosticMessages=function(){var e=this.shimHost.getLocalizedDiagnosticMessages();if(null===e||""===e)return null;try{return JSON.parse(e)}catch(e){return this.log(e.description||"diagnosticMessages.generated.json has invalid JSON format"),null}},t.prototype.getCancellationToken=function(){var t=this.shimHost.getCancellationToken();return new e.ThrottledCancellationToken(t)},t.prototype.getCurrentDirectory=function(){return this.shimHost.getCurrentDirectory()},t.prototype.getDirectories=function(e){return JSON.parse(this.shimHost.getDirectories(e))},t.prototype.getDefaultLibFileName=function(e){return this.shimHost.getDefaultLibFileName(JSON.stringify(e))},t.prototype.readDirectory=function(t,r,n,i,a){var o=e.getFileMatcherPatterns(t,n,i,this.shimHost.useCaseSensitiveFileNames(),this.shimHost.getCurrentDirectory());return JSON.parse(this.shimHost.readDirectory(t,JSON.stringify(r),JSON.stringify(o.basePaths),o.excludePattern,o.includeFilePattern,o.includeDirectoryPattern,a))},t.prototype.readFile=function(e,t){return this.shimHost.readFile(e,t)},t.prototype.fileExists=function(e){return this.shimHost.fileExists(e)},t}();e.LanguageServiceShimHostAdapter=a;var o=function(){function t(e){var t=this;this.shimHost=e,this.useCaseSensitiveFileNames=!!this.shimHost.useCaseSensitiveFileNames&&this.shimHost.useCaseSensitiveFileNames(),"directoryExists"in this.shimHost?this.directoryExists=function(e){return t.shimHost.directoryExists(e)}:this.directoryExists=void 0,"realpath"in this.shimHost?this.realpath=function(e){return t.shimHost.realpath(e)}:this.realpath=void 0;}return t.prototype.readDirectory=function(t,r,n,i,a){var o=e.getFileMatcherPatterns(t,n,i,this.shimHost.useCaseSensitiveFileNames(),this.shimHost.getCurrentDirectory());return JSON.parse(this.shimHost.readDirectory(t,JSON.stringify(r),JSON.stringify(o.basePaths),o.excludePattern,o.includeFilePattern,o.includeDirectoryPattern,a))},t.prototype.fileExists=function(e){return this.shimHost.fileExists(e)},t.prototype.readFile=function(e){return this.shimHost.readFile(e)},t.prototype.getDirectories=function(e){return JSON.parse(this.shimHost.getDirectories(e))},t}();function u(e,t,r,n){return _(e,t,!0,r,n)}function _(r,n,i,a,o){try{var s=function(t,r,n,i){var a;i&&(t.log(r),a=e.timestamp());var o=n();if(i){var s=e.timestamp();if(t.log("".concat(r," completed in ").concat(s-a," msec")),e.isString(o)){var c=o;c.length>128&&(c=c.substring(0,128)+"..."),t.log(" result.length=".concat(c.length,", result='").concat(JSON.stringify(c),"'"));}}return o}(r,n,a,o);return i?JSON.stringify({result:s}):s}catch(i){return i instanceof e.OperationCanceledException?JSON.stringify({canceled:!0}):(t(r,i),i.description=n,JSON.stringify({error:i}))}}e.CoreServicesShimHostAdapter=o;var d=function(){function e(e){this.factory=e,e.registerShim(this);}return e.prototype.dispose=function(e){this.factory.unregisterShim(this);},e}();function p(t,r){return t.map((function(t){return function(t,r){return {message:e.flattenDiagnosticMessageText(t.messageText,r),start:t.start,length:t.length,category:e.diagnosticCategoryName(t),code:t.code,reportsUnnecessary:t.reportsUnnecessary,reportsDeprecated:t.reportsDeprecated}}(t,r)}))}e.realizeDiagnostics=p;var f=function(t){function r(e,r,n){var i=t.call(this,e)||this;return i.host=r,i.languageService=n,i.logPerformance=!1,i.logger=i.host,i}return c(r,t),r.prototype.forwardJSONCall=function(e,t){return u(this.logger,e,t,this.logPerformance)},r.prototype.dispose=function(e){this.logger.log("dispose()"),this.languageService.dispose(),this.languageService=null,l&&l.CollectGarbage&&(l.CollectGarbage(),this.logger.log("CollectGarbage()")),this.logger=null,t.prototype.dispose.call(this,e);},r.prototype.refresh=function(e){this.forwardJSONCall("refresh(".concat(e,")"),(function(){return null}));},r.prototype.cleanupSemanticCache=function(){var e=this;this.forwardJSONCall("cleanupSemanticCache()",(function(){return e.languageService.cleanupSemanticCache(),null}));},r.prototype.realizeDiagnostics=function(t){return p(t,e.getNewLineOrDefaultFromHost(this.host))},r.prototype.getSyntacticClassifications=function(t,r,n){var i=this;return this.forwardJSONCall("getSyntacticClassifications('".concat(t,"', ").concat(r,", ").concat(n,")"),(function(){return i.languageService.getSyntacticClassifications(t,e.createTextSpan(r,n))}))},r.prototype.getSemanticClassifications=function(t,r,n){var i=this;return this.forwardJSONCall("getSemanticClassifications('".concat(t,"', ").concat(r,", ").concat(n,")"),(function(){return i.languageService.getSemanticClassifications(t,e.createTextSpan(r,n))}))},r.prototype.getEncodedSyntacticClassifications=function(t,r,n){var i=this;return this.forwardJSONCall("getEncodedSyntacticClassifications('".concat(t,"', ").concat(r,", ").concat(n,")"),(function(){return g(i.languageService.getEncodedSyntacticClassifications(t,e.createTextSpan(r,n)))}))},r.prototype.getEncodedSemanticClassifications=function(t,r,n){var i=this;return this.forwardJSONCall("getEncodedSemanticClassifications('".concat(t,"', ").concat(r,", ").concat(n,")"),(function(){return g(i.languageService.getEncodedSemanticClassifications(t,e.createTextSpan(r,n)))}))},r.prototype.getSyntacticDiagnostics=function(e){var t=this;return this.forwardJSONCall("getSyntacticDiagnostics('".concat(e,"')"),(function(){var r=t.languageService.getSyntacticDiagnostics(e);return t.realizeDiagnostics(r)}))},r.prototype.getSemanticDiagnostics=function(e){var t=this;return this.forwardJSONCall("getSemanticDiagnostics('".concat(e,"')"),(function(){var r=t.languageService.getSemanticDiagnostics(e);return t.realizeDiagnostics(r)}))},r.prototype.getSuggestionDiagnostics=function(e){var t=this;return this.forwardJSONCall("getSuggestionDiagnostics('".concat(e,"')"),(function(){return t.realizeDiagnostics(t.languageService.getSuggestionDiagnostics(e))}))},r.prototype.getCompilerOptionsDiagnostics=function(){var e=this;return this.forwardJSONCall("getCompilerOptionsDiagnostics()",(function(){var t=e.languageService.getCompilerOptionsDiagnostics();return e.realizeDiagnostics(t)}))},r.prototype.getQuickInfoAtPosition=function(e,t){var r=this;return this.forwardJSONCall("getQuickInfoAtPosition('".concat(e,"', ").concat(t,")"),(function(){return r.languageService.getQuickInfoAtPosition(e,t)}))},r.prototype.getNameOrDottedNameSpan=function(e,t,r){var n=this;return this.forwardJSONCall("getNameOrDottedNameSpan('".concat(e,"', ").concat(t,", ").concat(r,")"),(function(){return n.languageService.getNameOrDottedNameSpan(e,t,r)}))},r.prototype.getBreakpointStatementAtPosition=function(e,t){var r=this;return this.forwardJSONCall("getBreakpointStatementAtPosition('".concat(e,"', ").concat(t,")"),(function(){return r.languageService.getBreakpointStatementAtPosition(e,t)}))},r.prototype.getSignatureHelpItems=function(e,t,r){var n=this;return this.forwardJSONCall("getSignatureHelpItems('".concat(e,"', ").concat(t,")"),(function(){return n.languageService.getSignatureHelpItems(e,t,r)}))},r.prototype.getDefinitionAtPosition=function(e,t){var r=this;return this.forwardJSONCall("getDefinitionAtPosition('".concat(e,"', ").concat(t,")"),(function(){return r.languageService.getDefinitionAtPosition(e,t)}))},r.prototype.getDefinitionAndBoundSpan=function(e,t){var r=this;return this.forwardJSONCall("getDefinitionAndBoundSpan('".concat(e,"', ").concat(t,")"),(function(){return r.languageService.getDefinitionAndBoundSpan(e,t)}))},r.prototype.getTypeDefinitionAtPosition=function(e,t){var r=this;return this.forwardJSONCall("getTypeDefinitionAtPosition('".concat(e,"', ").concat(t,")"),(function(){return r.languageService.getTypeDefinitionAtPosition(e,t)}))},r.prototype.getImplementationAtPosition=function(e,t){var r=this;return this.forwardJSONCall("getImplementationAtPosition('".concat(e,"', ").concat(t,")"),(function(){return r.languageService.getImplementationAtPosition(e,t)}))},r.prototype.getRenameInfo=function(e,t,r){var n=this;return this.forwardJSONCall("getRenameInfo('".concat(e,"', ").concat(t,")"),(function(){return n.languageService.getRenameInfo(e,t,r)}))},r.prototype.getSmartSelectionRange=function(e,t){var r=this;return this.forwardJSONCall("getSmartSelectionRange('".concat(e,"', ").concat(t,")"),(function(){return r.languageService.getSmartSelectionRange(e,t)}))},r.prototype.findRenameLocations=function(e,t,r,n,i){var a=this;return this.forwardJSONCall("findRenameLocations('".concat(e,"', ").concat(t,", ").concat(r,", ").concat(n,", ").concat(i,")"),(function(){return a.languageService.findRenameLocations(e,t,r,n,i)}))},r.prototype.getBraceMatchingAtPosition=function(e,t){var r=this;return this.forwardJSONCall("getBraceMatchingAtPosition('".concat(e,"', ").concat(t,")"),(function(){return r.languageService.getBraceMatchingAtPosition(e,t)}))},r.prototype.isValidBraceCompletionAtPosition=function(e,t,r){var n=this;return this.forwardJSONCall("isValidBraceCompletionAtPosition('".concat(e,"', ").concat(t,", ").concat(r,")"),(function(){return n.languageService.isValidBraceCompletionAtPosition(e,t,r)}))},r.prototype.getSpanOfEnclosingComment=function(e,t,r){var n=this;return this.forwardJSONCall("getSpanOfEnclosingComment('".concat(e,"', ").concat(t,")"),(function(){return n.languageService.getSpanOfEnclosingComment(e,t,r)}))},r.prototype.getIndentationAtPosition=function(e,t,r){var n=this;return this.forwardJSONCall("getIndentationAtPosition('".concat(e,"', ").concat(t,")"),(function(){var i=JSON.parse(r);return n.languageService.getIndentationAtPosition(e,t,i)}))},r.prototype.getReferencesAtPosition=function(e,t){var r=this;return this.forwardJSONCall("getReferencesAtPosition('".concat(e,"', ").concat(t,")"),(function(){return r.languageService.getReferencesAtPosition(e,t)}))},r.prototype.findReferences=function(e,t){var r=this;return this.forwardJSONCall("findReferences('".concat(e,"', ").concat(t,")"),(function(){return r.languageService.findReferences(e,t)}))},r.prototype.getFileReferences=function(e){var t=this;return this.forwardJSONCall("getFileReferences('".concat(e,")"),(function(){return t.languageService.getFileReferences(e)}))},r.prototype.getOccurrencesAtPosition=function(e,t){var r=this;return this.forwardJSONCall("getOccurrencesAtPosition('".concat(e,"', ").concat(t,")"),(function(){return r.languageService.getOccurrencesAtPosition(e,t)}))},r.prototype.getDocumentHighlights=function(t,r,n){var i=this;return this.forwardJSONCall("getDocumentHighlights('".concat(t,"', ").concat(r,")"),(function(){var a=i.languageService.getDocumentHighlights(t,r,JSON.parse(n)),o=e.toFileNameLowerCase(e.normalizeSlashes(t));return e.filter(a,(function(t){return e.toFileNameLowerCase(e.normalizeSlashes(t.fileName))===o}))}))},r.prototype.getCompletionsAtPosition=function(e,t,r){var n=this;return this.forwardJSONCall("getCompletionsAtPosition('".concat(e,"', ").concat(t,", ").concat(r,")"),(function(){return n.languageService.getCompletionsAtPosition(e,t,r)}))},r.prototype.getCompletionEntryDetails=function(e,t,r,n,i,a,o){var s=this;return this.forwardJSONCall("getCompletionEntryDetails('".concat(e,"', ").concat(t,", '").concat(r,"')"),(function(){var c=void 0===n?void 0:JSON.parse(n);return s.languageService.getCompletionEntryDetails(e,t,r,c,i,a,o)}))},r.prototype.getFormattingEditsForRange=function(e,t,r,n){var i=this;return this.forwardJSONCall("getFormattingEditsForRange('".concat(e,"', ").concat(t,", ").concat(r,")"),(function(){var a=JSON.parse(n);return i.languageService.getFormattingEditsForRange(e,t,r,a)}))},r.prototype.getFormattingEditsForDocument=function(e,t){var r=this;return this.forwardJSONCall("getFormattingEditsForDocument('".concat(e,"')"),(function(){var n=JSON.parse(t);return r.languageService.getFormattingEditsForDocument(e,n)}))},r.prototype.getFormattingEditsAfterKeystroke=function(e,t,r,n){var i=this;return this.forwardJSONCall("getFormattingEditsAfterKeystroke('".concat(e,"', ").concat(t,", '").concat(r,"')"),(function(){var a=JSON.parse(n);return i.languageService.getFormattingEditsAfterKeystroke(e,t,r,a)}))},r.prototype.getDocCommentTemplateAtPosition=function(e,t,r){var n=this;return this.forwardJSONCall("getDocCommentTemplateAtPosition('".concat(e,"', ").concat(t,")"),(function(){return n.languageService.getDocCommentTemplateAtPosition(e,t,r)}))},r.prototype.getNavigateToItems=function(e,t,r){var n=this;return this.forwardJSONCall("getNavigateToItems('".concat(e,"', ").concat(t,", ").concat(r,")"),(function(){return n.languageService.getNavigateToItems(e,t,r)}))},r.prototype.getNavigationBarItems=function(e){var t=this;return this.forwardJSONCall("getNavigationBarItems('".concat(e,"')"),(function(){return t.languageService.getNavigationBarItems(e)}))},r.prototype.getNavigationTree=function(e){var t=this;return this.forwardJSONCall("getNavigationTree('".concat(e,"')"),(function(){return t.languageService.getNavigationTree(e)}))},r.prototype.getOutliningSpans=function(e){var t=this;return this.forwardJSONCall("getOutliningSpans('".concat(e,"')"),(function(){return t.languageService.getOutliningSpans(e)}))},r.prototype.getTodoComments=function(e,t){var r=this;return this.forwardJSONCall("getTodoComments('".concat(e,"')"),(function(){return r.languageService.getTodoComments(e,JSON.parse(t))}))},r.prototype.prepareCallHierarchy=function(e,t){var r=this;return this.forwardJSONCall("prepareCallHierarchy('".concat(e,"', ").concat(t,")"),(function(){return r.languageService.prepareCallHierarchy(e,t)}))},r.prototype.provideCallHierarchyIncomingCalls=function(e,t){var r=this;return this.forwardJSONCall("provideCallHierarchyIncomingCalls('".concat(e,"', ").concat(t,")"),(function(){return r.languageService.provideCallHierarchyIncomingCalls(e,t)}))},r.prototype.provideCallHierarchyOutgoingCalls=function(e,t){var r=this;return this.forwardJSONCall("provideCallHierarchyOutgoingCalls('".concat(e,"', ").concat(t,")"),(function(){return r.languageService.provideCallHierarchyOutgoingCalls(e,t)}))},r.prototype.provideInlayHints=function(e,t,r){var n=this;return this.forwardJSONCall("provideInlayHints('".concat(e,"', '").concat(JSON.stringify(t),"', ").concat(JSON.stringify(r),")"),(function(){return n.languageService.provideInlayHints(e,t,r)}))},r.prototype.getEmitOutput=function(e){var t=this;return this.forwardJSONCall("getEmitOutput('".concat(e,"')"),(function(){var r=t.languageService.getEmitOutput(e),n=r.diagnostics,a=s(r,["diagnostics"]);return i$1(i$1({},a),{diagnostics:t.realizeDiagnostics(n)})}))},r.prototype.getEmitOutputObject=function(e){var t=this;return _(this.logger,"getEmitOutput('".concat(e,"')"),!1,(function(){return t.languageService.getEmitOutput(e)}),this.logPerformance)},r.prototype.toggleLineComment=function(e,t){var r=this;return this.forwardJSONCall("toggleLineComment('".concat(e,"', '").concat(JSON.stringify(t),"')"),(function(){return r.languageService.toggleLineComment(e,t)}))},r.prototype.toggleMultilineComment=function(e,t){var r=this;return this.forwardJSONCall("toggleMultilineComment('".concat(e,"', '").concat(JSON.stringify(t),"')"),(function(){return r.languageService.toggleMultilineComment(e,t)}))},r.prototype.commentSelection=function(e,t){var r=this;return this.forwardJSONCall("commentSelection('".concat(e,"', '").concat(JSON.stringify(t),"')"),(function(){return r.languageService.commentSelection(e,t)}))},r.prototype.uncommentSelection=function(e,t){var r=this;return this.forwardJSONCall("uncommentSelection('".concat(e,"', '").concat(JSON.stringify(t),"')"),(function(){return r.languageService.uncommentSelection(e,t)}))},r}(d);function g(e){return {spans:e.spans.join(","),endOfLineState:e.endOfLineState}}var m=function(t){function r(r,n){var i=t.call(this,r)||this;return i.logger=n,i.logPerformance=!1,i.classifier=e.createClassifier(),i}return c(r,t),r.prototype.getEncodedLexicalClassifications=function(e,t,r){var n=this;return void 0===r&&(r=!1),u(this.logger,"getEncodedLexicalClassifications",(function(){return g(n.classifier.getEncodedLexicalClassifications(e,t,r))}),this.logPerformance)},r.prototype.getClassificationsForLine=function(e,t,r){void 0===r&&(r=!1);for(var n=this.classifier.getClassificationsForLine(e,t,r),i="",a=0,o=n.entries;a<o.length;a++){var s=o[a];i+=s.length+"\n",i+=s.classification+"\n";}return i+n.finalLexState},r}(d),y=function(t){function r(e,r,n){var i=t.call(this,e)||this;return i.logger=r,i.host=n,i.logPerformance=!1,i}return c(r,t),r.prototype.forwardJSONCall=function(e,t){return u(this.logger,e,t,this.logPerformance)},r.prototype.resolveModuleName=function(t,r,n){var i=this;return this.forwardJSONCall("resolveModuleName('".concat(t,"')"),(function(){var a=JSON.parse(n),o=e.resolveModuleName(r,e.normalizeSlashes(t),a,i.host),s=o.resolvedModule?o.resolvedModule.resolvedFileName:void 0;return o.resolvedModule&&".ts"!==o.resolvedModule.extension&&".tsx"!==o.resolvedModule.extension&&".d.ts"!==o.resolvedModule.extension&&(s=void 0),{resolvedFileName:s,failedLookupLocations:o.failedLookupLocations}}))},r.prototype.resolveTypeReferenceDirective=function(t,r,n){var i=this;return this.forwardJSONCall("resolveTypeReferenceDirective(".concat(t,")"),(function(){var a=JSON.parse(n),o=e.resolveTypeReferenceDirective(r,e.normalizeSlashes(t),a,i.host);return {resolvedFileName:o.resolvedTypeReferenceDirective?o.resolvedTypeReferenceDirective.resolvedFileName:void 0,primary:!o.resolvedTypeReferenceDirective||o.resolvedTypeReferenceDirective.primary,failedLookupLocations:o.failedLookupLocations}}))},r.prototype.getPreProcessedFileInfo=function(t,r){var n=this;return this.forwardJSONCall("getPreProcessedFileInfo('".concat(t,"')"),(function(){var t=e.preProcessFile(e.getSnapshotText(r),!0,!0);return {referencedFiles:n.convertFileReferences(t.referencedFiles),importedFiles:n.convertFileReferences(t.importedFiles),ambientExternalModules:t.ambientExternalModules,isLibFile:t.isLibFile,typeReferenceDirectives:n.convertFileReferences(t.typeReferenceDirectives),libReferenceDirectives:n.convertFileReferences(t.libReferenceDirectives)}}))},r.prototype.getAutomaticTypeDirectiveNames=function(t){var r=this;return this.forwardJSONCall("getAutomaticTypeDirectiveNames('".concat(t,"')"),(function(){var n=JSON.parse(t);return e.getAutomaticTypeDirectiveNames(n,r.host)}))},r.prototype.convertFileReferences=function(t){if(t){for(var r=[],n=0,i=t;n<i.length;n++){var a=i[n];r.push({path:e.normalizeSlashes(a.fileName),position:a.pos,length:a.end-a.pos});}return r}},r.prototype.getTSConfigFileInfo=function(t,r){var i=this;return this.forwardJSONCall("getTSConfigFileInfo('".concat(t,"')"),(function(){var a=e.parseJsonText(t,e.getSnapshotText(r)),o=e.normalizeSlashes(t),s=e.parseJsonSourceFileConfigFileContent(a,i.host,e.getDirectoryPath(o),{},o);return {options:s.options,typeAcquisition:s.typeAcquisition,files:s.fileNames,raw:s.raw,errors:p(n$3(n$3([],a.parseDiagnostics,!0),s.errors,!0),"\r\n")}}))},r.prototype.getDefaultCompilationSettings=function(){return this.forwardJSONCall("getDefaultCompilationSettings()",(function(){return e.getDefaultCompilerOptions()}))},r.prototype.discoverTypings=function(t){var r=this,n=e.createGetCanonicalFileName(!1);return this.forwardJSONCall("discoverTypings()",(function(){var i=JSON.parse(t);return void 0===r.safeList&&(r.safeList=e.JsTyping.loadSafeList(r.host,e.toPath(i.safeListPath,i.safeListPath,n))),e.JsTyping.discoverTypings(r.host,(function(e){return r.logger.log(e)}),i.fileNames,e.toPath(i.projectRootPath,i.projectRootPath,n),r.safeList,i.packageNameToTypingLocation,i.typeAcquisition,i.unresolvedImports,i.typesRegistry)}))},r}(d),v=function(){function r(){this._shims=[];}return r.prototype.getServicesVersion=function(){return e.servicesVersion},r.prototype.createLanguageServiceShim=function(r){try{void 0===this.documentRegistry&&(this.documentRegistry=e.createDocumentRegistry(r.useCaseSensitiveFileNames&&r.useCaseSensitiveFileNames(),r.getCurrentDirectory()));var n=new a(r),i=e.createLanguageService(n,this.documentRegistry,!1);return new f(this,r,i)}catch(e){throw t(r,e),e}},r.prototype.createClassifierShim=function(e){try{return new m(this,e)}catch(r){throw t(e,r),r}},r.prototype.createCoreServicesShim=function(e){try{var r=new o(e);return new y(this,e,r)}catch(r){throw t(e,r),r}},r.prototype.close=function(){e.clear(this._shims),this.documentRegistry=void 0;},r.prototype.registerShim=function(e){this._shims.push(e);},r.prototype.unregisterShim=function(e){for(var t=0;t<this._shims.length;t++)if(this._shims[t]===e)return void delete this._shims[t];throw new Error("Invalid operation")},r}();e.TypeScriptServicesFactory=v;}(t),function(){if("object"!=typeof globalThis)try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,"undefined"==typeof globalThis&&(window.globalThis=window),delete Object.prototype.__magic__;}catch(e){window.globalThis=window;}}(),("undefined"==typeof process||process.browser)&&(globalThis.TypeScript=globalThis.TypeScript||{},globalThis.TypeScript.Services=globalThis.TypeScript.Services||{},globalThis.TypeScript.Services.TypeScriptServicesFactory=t.TypeScriptServicesFactory,globalThis.toolsVersion=t.versionMajorMinor),"undefined"!=typeof module&&module.exports&&(module.exports=t),function(e){var t={since:"4.0",warnAfter:"4.1",message:"Use the appropriate method on 'ts.factory' or the 'factory' supplied by your transformation context instead."};e.createNodeArray=e.Debug.deprecate(e.factory.createNodeArray,t),e.createNumericLiteral=e.Debug.deprecate(e.factory.createNumericLiteral,t),e.createBigIntLiteral=e.Debug.deprecate(e.factory.createBigIntLiteral,t),e.createStringLiteral=e.Debug.deprecate(e.factory.createStringLiteral,t),e.createStringLiteralFromNode=e.Debug.deprecate(e.factory.createStringLiteralFromNode,t),e.createRegularExpressionLiteral=e.Debug.deprecate(e.factory.createRegularExpressionLiteral,t),e.createLoopVariable=e.Debug.deprecate(e.factory.createLoopVariable,t),e.createUniqueName=e.Debug.deprecate(e.factory.createUniqueName,t),e.createPrivateIdentifier=e.Debug.deprecate(e.factory.createPrivateIdentifier,t),e.createSuper=e.Debug.deprecate(e.factory.createSuper,t),e.createThis=e.Debug.deprecate(e.factory.createThis,t),e.createNull=e.Debug.deprecate(e.factory.createNull,t),e.createTrue=e.Debug.deprecate(e.factory.createTrue,t),e.createFalse=e.Debug.deprecate(e.factory.createFalse,t),e.createModifier=e.Debug.deprecate(e.factory.createModifier,t),e.createModifiersFromModifierFlags=e.Debug.deprecate(e.factory.createModifiersFromModifierFlags,t),e.createQualifiedName=e.Debug.deprecate(e.factory.createQualifiedName,t),e.updateQualifiedName=e.Debug.deprecate(e.factory.updateQualifiedName,t),e.createComputedPropertyName=e.Debug.deprecate(e.factory.createComputedPropertyName,t),e.updateComputedPropertyName=e.Debug.deprecate(e.factory.updateComputedPropertyName,t),e.createTypeParameterDeclaration=e.Debug.deprecate(e.factory.createTypeParameterDeclaration,t),e.updateTypeParameterDeclaration=e.Debug.deprecate(e.factory.updateTypeParameterDeclaration,t),e.createParameter=e.Debug.deprecate(e.factory.createParameterDeclaration,t),e.updateParameter=e.Debug.deprecate(e.factory.updateParameterDeclaration,t),e.createDecorator=e.Debug.deprecate(e.factory.createDecorator,t),e.updateDecorator=e.Debug.deprecate(e.factory.updateDecorator,t),e.createProperty=e.Debug.deprecate(e.factory.createPropertyDeclaration,t),e.updateProperty=e.Debug.deprecate(e.factory.updatePropertyDeclaration,t),e.createMethod=e.Debug.deprecate(e.factory.createMethodDeclaration,t),e.updateMethod=e.Debug.deprecate(e.factory.updateMethodDeclaration,t),e.createConstructor=e.Debug.deprecate(e.factory.createConstructorDeclaration,t),e.updateConstructor=e.Debug.deprecate(e.factory.updateConstructorDeclaration,t),e.createGetAccessor=e.Debug.deprecate(e.factory.createGetAccessorDeclaration,t),e.updateGetAccessor=e.Debug.deprecate(e.factory.updateGetAccessorDeclaration,t),e.createSetAccessor=e.Debug.deprecate(e.factory.createSetAccessorDeclaration,t),e.updateSetAccessor=e.Debug.deprecate(e.factory.updateSetAccessorDeclaration,t),e.createCallSignature=e.Debug.deprecate(e.factory.createCallSignature,t),e.updateCallSignature=e.Debug.deprecate(e.factory.updateCallSignature,t),e.createConstructSignature=e.Debug.deprecate(e.factory.createConstructSignature,t),e.updateConstructSignature=e.Debug.deprecate(e.factory.updateConstructSignature,t),e.updateIndexSignature=e.Debug.deprecate(e.factory.updateIndexSignature,t),e.createKeywordTypeNode=e.Debug.deprecate(e.factory.createKeywordTypeNode,t),e.createTypePredicateNodeWithModifier=e.Debug.deprecate(e.factory.createTypePredicateNode,t),e.updateTypePredicateNodeWithModifier=e.Debug.deprecate(e.factory.updateTypePredicateNode,t),e.createTypeReferenceNode=e.Debug.deprecate(e.factory.createTypeReferenceNode,t),e.updateTypeReferenceNode=e.Debug.deprecate(e.factory.updateTypeReferenceNode,t),e.createFunctionTypeNode=e.Debug.deprecate(e.factory.createFunctionTypeNode,t),e.updateFunctionTypeNode=e.Debug.deprecate(e.factory.updateFunctionTypeNode,t),e.createConstructorTypeNode=e.Debug.deprecate((function(t,r,n){return e.factory.createConstructorTypeNode(void 0,t,r,n)}),t),e.updateConstructorTypeNode=e.Debug.deprecate((function(t,r,n,i){return e.factory.updateConstructorTypeNode(t,t.modifiers,r,n,i)}),t),e.createTypeQueryNode=e.Debug.deprecate(e.factory.createTypeQueryNode,t),e.updateTypeQueryNode=e.Debug.deprecate(e.factory.updateTypeQueryNode,t),e.createTypeLiteralNode=e.Debug.deprecate(e.factory.createTypeLiteralNode,t),e.updateTypeLiteralNode=e.Debug.deprecate(e.factory.updateTypeLiteralNode,t),e.createArrayTypeNode=e.Debug.deprecate(e.factory.createArrayTypeNode,t),e.updateArrayTypeNode=e.Debug.deprecate(e.factory.updateArrayTypeNode,t),e.createTupleTypeNode=e.Debug.deprecate(e.factory.createTupleTypeNode,t),e.updateTupleTypeNode=e.Debug.deprecate(e.factory.updateTupleTypeNode,t),e.createOptionalTypeNode=e.Debug.deprecate(e.factory.createOptionalTypeNode,t),e.updateOptionalTypeNode=e.Debug.deprecate(e.factory.updateOptionalTypeNode,t),e.createRestTypeNode=e.Debug.deprecate(e.factory.createRestTypeNode,t),e.updateRestTypeNode=e.Debug.deprecate(e.factory.updateRestTypeNode,t),e.createUnionTypeNode=e.Debug.deprecate(e.factory.createUnionTypeNode,t),e.updateUnionTypeNode=e.Debug.deprecate(e.factory.updateUnionTypeNode,t),e.createIntersectionTypeNode=e.Debug.deprecate(e.factory.createIntersectionTypeNode,t),e.updateIntersectionTypeNode=e.Debug.deprecate(e.factory.updateIntersectionTypeNode,t),e.createConditionalTypeNode=e.Debug.deprecate(e.factory.createConditionalTypeNode,t),e.updateConditionalTypeNode=e.Debug.deprecate(e.factory.updateConditionalTypeNode,t),e.createInferTypeNode=e.Debug.deprecate(e.factory.createInferTypeNode,t),e.updateInferTypeNode=e.Debug.deprecate(e.factory.updateInferTypeNode,t),e.createImportTypeNode=e.Debug.deprecate(e.factory.createImportTypeNode,t),e.updateImportTypeNode=e.Debug.deprecate(e.factory.updateImportTypeNode,t),e.createParenthesizedType=e.Debug.deprecate(e.factory.createParenthesizedType,t),e.updateParenthesizedType=e.Debug.deprecate(e.factory.updateParenthesizedType,t),e.createThisTypeNode=e.Debug.deprecate(e.factory.createThisTypeNode,t),e.updateTypeOperatorNode=e.Debug.deprecate(e.factory.updateTypeOperatorNode,t),e.createIndexedAccessTypeNode=e.Debug.deprecate(e.factory.createIndexedAccessTypeNode,t),e.updateIndexedAccessTypeNode=e.Debug.deprecate(e.factory.updateIndexedAccessTypeNode,t),e.createMappedTypeNode=e.Debug.deprecate(e.factory.createMappedTypeNode,t),e.updateMappedTypeNode=e.Debug.deprecate(e.factory.updateMappedTypeNode,t),e.createLiteralTypeNode=e.Debug.deprecate(e.factory.createLiteralTypeNode,t),e.updateLiteralTypeNode=e.Debug.deprecate(e.factory.updateLiteralTypeNode,t),e.createObjectBindingPattern=e.Debug.deprecate(e.factory.createObjectBindingPattern,t),e.updateObjectBindingPattern=e.Debug.deprecate(e.factory.updateObjectBindingPattern,t),e.createArrayBindingPattern=e.Debug.deprecate(e.factory.createArrayBindingPattern,t),e.updateArrayBindingPattern=e.Debug.deprecate(e.factory.updateArrayBindingPattern,t),e.createBindingElement=e.Debug.deprecate(e.factory.createBindingElement,t),e.updateBindingElement=e.Debug.deprecate(e.factory.updateBindingElement,t),e.createArrayLiteral=e.Debug.deprecate(e.factory.createArrayLiteralExpression,t),e.updateArrayLiteral=e.Debug.deprecate(e.factory.updateArrayLiteralExpression,t),e.createObjectLiteral=e.Debug.deprecate(e.factory.createObjectLiteralExpression,t),e.updateObjectLiteral=e.Debug.deprecate(e.factory.updateObjectLiteralExpression,t),e.createPropertyAccess=e.Debug.deprecate(e.factory.createPropertyAccessExpression,t),e.updatePropertyAccess=e.Debug.deprecate(e.factory.updatePropertyAccessExpression,t),e.createPropertyAccessChain=e.Debug.deprecate(e.factory.createPropertyAccessChain,t),e.updatePropertyAccessChain=e.Debug.deprecate(e.factory.updatePropertyAccessChain,t),e.createElementAccess=e.Debug.deprecate(e.factory.createElementAccessExpression,t),e.updateElementAccess=e.Debug.deprecate(e.factory.updateElementAccessExpression,t),e.createElementAccessChain=e.Debug.deprecate(e.factory.createElementAccessChain,t),e.updateElementAccessChain=e.Debug.deprecate(e.factory.updateElementAccessChain,t),e.createCall=e.Debug.deprecate(e.factory.createCallExpression,t),e.updateCall=e.Debug.deprecate(e.factory.updateCallExpression,t),e.createCallChain=e.Debug.deprecate(e.factory.createCallChain,t),e.updateCallChain=e.Debug.deprecate(e.factory.updateCallChain,t),e.createNew=e.Debug.deprecate(e.factory.createNewExpression,t),e.updateNew=e.Debug.deprecate(e.factory.updateNewExpression,t),e.createTypeAssertion=e.Debug.deprecate(e.factory.createTypeAssertion,t),e.updateTypeAssertion=e.Debug.deprecate(e.factory.updateTypeAssertion,t),e.createParen=e.Debug.deprecate(e.factory.createParenthesizedExpression,t),e.updateParen=e.Debug.deprecate(e.factory.updateParenthesizedExpression,t),e.createFunctionExpression=e.Debug.deprecate(e.factory.createFunctionExpression,t),e.updateFunctionExpression=e.Debug.deprecate(e.factory.updateFunctionExpression,t),e.createDelete=e.Debug.deprecate(e.factory.createDeleteExpression,t),e.updateDelete=e.Debug.deprecate(e.factory.updateDeleteExpression,t),e.createTypeOf=e.Debug.deprecate(e.factory.createTypeOfExpression,t),e.updateTypeOf=e.Debug.deprecate(e.factory.updateTypeOfExpression,t),e.createVoid=e.Debug.deprecate(e.factory.createVoidExpression,t),e.updateVoid=e.Debug.deprecate(e.factory.updateVoidExpression,t),e.createAwait=e.Debug.deprecate(e.factory.createAwaitExpression,t),e.updateAwait=e.Debug.deprecate(e.factory.updateAwaitExpression,t),e.createPrefix=e.Debug.deprecate(e.factory.createPrefixUnaryExpression,t),e.updatePrefix=e.Debug.deprecate(e.factory.updatePrefixUnaryExpression,t),e.createPostfix=e.Debug.deprecate(e.factory.createPostfixUnaryExpression,t),e.updatePostfix=e.Debug.deprecate(e.factory.updatePostfixUnaryExpression,t),e.createBinary=e.Debug.deprecate(e.factory.createBinaryExpression,t),e.updateConditional=e.Debug.deprecate(e.factory.updateConditionalExpression,t),e.createTemplateExpression=e.Debug.deprecate(e.factory.createTemplateExpression,t),e.updateTemplateExpression=e.Debug.deprecate(e.factory.updateTemplateExpression,t),e.createTemplateHead=e.Debug.deprecate(e.factory.createTemplateHead,t),e.createTemplateMiddle=e.Debug.deprecate(e.factory.createTemplateMiddle,t),e.createTemplateTail=e.Debug.deprecate(e.factory.createTemplateTail,t),e.createNoSubstitutionTemplateLiteral=e.Debug.deprecate(e.factory.createNoSubstitutionTemplateLiteral,t),e.updateYield=e.Debug.deprecate(e.factory.updateYieldExpression,t),e.createSpread=e.Debug.deprecate(e.factory.createSpreadElement,t),e.updateSpread=e.Debug.deprecate(e.factory.updateSpreadElement,t),e.createOmittedExpression=e.Debug.deprecate(e.factory.createOmittedExpression,t),e.createAsExpression=e.Debug.deprecate(e.factory.createAsExpression,t),e.updateAsExpression=e.Debug.deprecate(e.factory.updateAsExpression,t),e.createNonNullExpression=e.Debug.deprecate(e.factory.createNonNullExpression,t),e.updateNonNullExpression=e.Debug.deprecate(e.factory.updateNonNullExpression,t),e.createNonNullChain=e.Debug.deprecate(e.factory.createNonNullChain,t),e.updateNonNullChain=e.Debug.deprecate(e.factory.updateNonNullChain,t),e.createMetaProperty=e.Debug.deprecate(e.factory.createMetaProperty,t),e.updateMetaProperty=e.Debug.deprecate(e.factory.updateMetaProperty,t),e.createTemplateSpan=e.Debug.deprecate(e.factory.createTemplateSpan,t),e.updateTemplateSpan=e.Debug.deprecate(e.factory.updateTemplateSpan,t),e.createSemicolonClassElement=e.Debug.deprecate(e.factory.createSemicolonClassElement,t),e.createBlock=e.Debug.deprecate(e.factory.createBlock,t),e.updateBlock=e.Debug.deprecate(e.factory.updateBlock,t),e.createVariableStatement=e.Debug.deprecate(e.factory.createVariableStatement,t),e.updateVariableStatement=e.Debug.deprecate(e.factory.updateVariableStatement,t),e.createEmptyStatement=e.Debug.deprecate(e.factory.createEmptyStatement,t),e.createExpressionStatement=e.Debug.deprecate(e.factory.createExpressionStatement,t),e.updateExpressionStatement=e.Debug.deprecate(e.factory.updateExpressionStatement,t),e.createStatement=e.Debug.deprecate(e.factory.createExpressionStatement,t),e.updateStatement=e.Debug.deprecate(e.factory.updateExpressionStatement,t),e.createIf=e.Debug.deprecate(e.factory.createIfStatement,t),e.updateIf=e.Debug.deprecate(e.factory.updateIfStatement,t),e.createDo=e.Debug.deprecate(e.factory.createDoStatement,t),e.updateDo=e.Debug.deprecate(e.factory.updateDoStatement,t),e.createWhile=e.Debug.deprecate(e.factory.createWhileStatement,t),e.updateWhile=e.Debug.deprecate(e.factory.updateWhileStatement,t),e.createFor=e.Debug.deprecate(e.factory.createForStatement,t),e.updateFor=e.Debug.deprecate(e.factory.updateForStatement,t),e.createForIn=e.Debug.deprecate(e.factory.createForInStatement,t),e.updateForIn=e.Debug.deprecate(e.factory.updateForInStatement,t),e.createForOf=e.Debug.deprecate(e.factory.createForOfStatement,t),e.updateForOf=e.Debug.deprecate(e.factory.updateForOfStatement,t),e.createContinue=e.Debug.deprecate(e.factory.createContinueStatement,t),e.updateContinue=e.Debug.deprecate(e.factory.updateContinueStatement,t),e.createBreak=e.Debug.deprecate(e.factory.createBreakStatement,t),e.updateBreak=e.Debug.deprecate(e.factory.updateBreakStatement,t),e.createReturn=e.Debug.deprecate(e.factory.createReturnStatement,t),e.updateReturn=e.Debug.deprecate(e.factory.updateReturnStatement,t),e.createWith=e.Debug.deprecate(e.factory.createWithStatement,t),e.updateWith=e.Debug.deprecate(e.factory.updateWithStatement,t),e.createSwitch=e.Debug.deprecate(e.factory.createSwitchStatement,t),e.updateSwitch=e.Debug.deprecate(e.factory.updateSwitchStatement,t),e.createLabel=e.Debug.deprecate(e.factory.createLabeledStatement,t),e.updateLabel=e.Debug.deprecate(e.factory.updateLabeledStatement,t),e.createThrow=e.Debug.deprecate(e.factory.createThrowStatement,t),e.updateThrow=e.Debug.deprecate(e.factory.updateThrowStatement,t),e.createTry=e.Debug.deprecate(e.factory.createTryStatement,t),e.updateTry=e.Debug.deprecate(e.factory.updateTryStatement,t),e.createDebuggerStatement=e.Debug.deprecate(e.factory.createDebuggerStatement,t),e.createVariableDeclarationList=e.Debug.deprecate(e.factory.createVariableDeclarationList,t),e.updateVariableDeclarationList=e.Debug.deprecate(e.factory.updateVariableDeclarationList,t),e.createFunctionDeclaration=e.Debug.deprecate(e.factory.createFunctionDeclaration,t),e.updateFunctionDeclaration=e.Debug.deprecate(e.factory.updateFunctionDeclaration,t),e.createClassDeclaration=e.Debug.deprecate(e.factory.createClassDeclaration,t),e.updateClassDeclaration=e.Debug.deprecate(e.factory.updateClassDeclaration,t),e.createInterfaceDeclaration=e.Debug.deprecate(e.factory.createInterfaceDeclaration,t),e.updateInterfaceDeclaration=e.Debug.deprecate(e.factory.updateInterfaceDeclaration,t),e.createTypeAliasDeclaration=e.Debug.deprecate(e.factory.createTypeAliasDeclaration,t),e.updateTypeAliasDeclaration=e.Debug.deprecate(e.factory.updateTypeAliasDeclaration,t),e.createEnumDeclaration=e.Debug.deprecate(e.factory.createEnumDeclaration,t),e.updateEnumDeclaration=e.Debug.deprecate(e.factory.updateEnumDeclaration,t),e.createModuleDeclaration=e.Debug.deprecate(e.factory.createModuleDeclaration,t),e.updateModuleDeclaration=e.Debug.deprecate(e.factory.updateModuleDeclaration,t),e.createModuleBlock=e.Debug.deprecate(e.factory.createModuleBlock,t),e.updateModuleBlock=e.Debug.deprecate(e.factory.updateModuleBlock,t),e.createCaseBlock=e.Debug.deprecate(e.factory.createCaseBlock,t),e.updateCaseBlock=e.Debug.deprecate(e.factory.updateCaseBlock,t),e.createNamespaceExportDeclaration=e.Debug.deprecate(e.factory.createNamespaceExportDeclaration,t),e.updateNamespaceExportDeclaration=e.Debug.deprecate(e.factory.updateNamespaceExportDeclaration,t),e.createImportEqualsDeclaration=e.Debug.deprecate(e.factory.createImportEqualsDeclaration,t),e.updateImportEqualsDeclaration=e.Debug.deprecate(e.factory.updateImportEqualsDeclaration,t),e.createImportDeclaration=e.Debug.deprecate(e.factory.createImportDeclaration,t),e.updateImportDeclaration=e.Debug.deprecate(e.factory.updateImportDeclaration,t),e.createNamespaceImport=e.Debug.deprecate(e.factory.createNamespaceImport,t),e.updateNamespaceImport=e.Debug.deprecate(e.factory.updateNamespaceImport,t),e.createNamedImports=e.Debug.deprecate(e.factory.createNamedImports,t),e.updateNamedImports=e.Debug.deprecate(e.factory.updateNamedImports,t),e.createImportSpecifier=e.Debug.deprecate(e.factory.createImportSpecifier,t),e.updateImportSpecifier=e.Debug.deprecate(e.factory.updateImportSpecifier,t),e.createExportAssignment=e.Debug.deprecate(e.factory.createExportAssignment,t),e.updateExportAssignment=e.Debug.deprecate(e.factory.updateExportAssignment,t),e.createNamedExports=e.Debug.deprecate(e.factory.createNamedExports,t),e.updateNamedExports=e.Debug.deprecate(e.factory.updateNamedExports,t),e.createExportSpecifier=e.Debug.deprecate(e.factory.createExportSpecifier,t),e.updateExportSpecifier=e.Debug.deprecate(e.factory.updateExportSpecifier,t),e.createExternalModuleReference=e.Debug.deprecate(e.factory.createExternalModuleReference,t),e.updateExternalModuleReference=e.Debug.deprecate(e.factory.updateExternalModuleReference,t),e.createJSDocTypeExpression=e.Debug.deprecate(e.factory.createJSDocTypeExpression,t),e.createJSDocTypeTag=e.Debug.deprecate(e.factory.createJSDocTypeTag,t),e.createJSDocReturnTag=e.Debug.deprecate(e.factory.createJSDocReturnTag,t),e.createJSDocThisTag=e.Debug.deprecate(e.factory.createJSDocThisTag,t),e.createJSDocComment=e.Debug.deprecate(e.factory.createJSDocComment,t),e.createJSDocParameterTag=e.Debug.deprecate(e.factory.createJSDocParameterTag,t),e.createJSDocClassTag=e.Debug.deprecate(e.factory.createJSDocClassTag,t),e.createJSDocAugmentsTag=e.Debug.deprecate(e.factory.createJSDocAugmentsTag,t),e.createJSDocEnumTag=e.Debug.deprecate(e.factory.createJSDocEnumTag,t),e.createJSDocTemplateTag=e.Debug.deprecate(e.factory.createJSDocTemplateTag,t),e.createJSDocTypedefTag=e.Debug.deprecate(e.factory.createJSDocTypedefTag,t),e.createJSDocCallbackTag=e.Debug.deprecate(e.factory.createJSDocCallbackTag,t),e.createJSDocSignature=e.Debug.deprecate(e.factory.createJSDocSignature,t),e.createJSDocPropertyTag=e.Debug.deprecate(e.factory.createJSDocPropertyTag,t),e.createJSDocTypeLiteral=e.Debug.deprecate(e.factory.createJSDocTypeLiteral,t),e.createJSDocImplementsTag=e.Debug.deprecate(e.factory.createJSDocImplementsTag,t),e.createJSDocAuthorTag=e.Debug.deprecate(e.factory.createJSDocAuthorTag,t),e.createJSDocPublicTag=e.Debug.deprecate(e.factory.createJSDocPublicTag,t),e.createJSDocPrivateTag=e.Debug.deprecate(e.factory.createJSDocPrivateTag,t),e.createJSDocProtectedTag=e.Debug.deprecate(e.factory.createJSDocProtectedTag,t),e.createJSDocReadonlyTag=e.Debug.deprecate(e.factory.createJSDocReadonlyTag,t),e.createJSDocTag=e.Debug.deprecate(e.factory.createJSDocUnknownTag,t),e.createJsxElement=e.Debug.deprecate(e.factory.createJsxElement,t),e.updateJsxElement=e.Debug.deprecate(e.factory.updateJsxElement,t),e.createJsxSelfClosingElement=e.Debug.deprecate(e.factory.createJsxSelfClosingElement,t),e.updateJsxSelfClosingElement=e.Debug.deprecate(e.factory.updateJsxSelfClosingElement,t),e.createJsxOpeningElement=e.Debug.deprecate(e.factory.createJsxOpeningElement,t),e.updateJsxOpeningElement=e.Debug.deprecate(e.factory.updateJsxOpeningElement,t),e.createJsxClosingElement=e.Debug.deprecate(e.factory.createJsxClosingElement,t),e.updateJsxClosingElement=e.Debug.deprecate(e.factory.updateJsxClosingElement,t),e.createJsxFragment=e.Debug.deprecate(e.factory.createJsxFragment,t),e.createJsxText=e.Debug.deprecate(e.factory.createJsxText,t),e.updateJsxText=e.Debug.deprecate(e.factory.updateJsxText,t),e.createJsxOpeningFragment=e.Debug.deprecate(e.factory.createJsxOpeningFragment,t),e.createJsxJsxClosingFragment=e.Debug.deprecate(e.factory.createJsxJsxClosingFragment,t),e.updateJsxFragment=e.Debug.deprecate(e.factory.updateJsxFragment,t),e.createJsxAttribute=e.Debug.deprecate(e.factory.createJsxAttribute,t),e.updateJsxAttribute=e.Debug.deprecate(e.factory.updateJsxAttribute,t),e.createJsxAttributes=e.Debug.deprecate(e.factory.createJsxAttributes,t),e.updateJsxAttributes=e.Debug.deprecate(e.factory.updateJsxAttributes,t),e.createJsxSpreadAttribute=e.Debug.deprecate(e.factory.createJsxSpreadAttribute,t),e.updateJsxSpreadAttribute=e.Debug.deprecate(e.factory.updateJsxSpreadAttribute,t),e.createJsxExpression=e.Debug.deprecate(e.factory.createJsxExpression,t),e.updateJsxExpression=e.Debug.deprecate(e.factory.updateJsxExpression,t),e.createCaseClause=e.Debug.deprecate(e.factory.createCaseClause,t),e.updateCaseClause=e.Debug.deprecate(e.factory.updateCaseClause,t),e.createDefaultClause=e.Debug.deprecate(e.factory.createDefaultClause,t),e.updateDefaultClause=e.Debug.deprecate(e.factory.updateDefaultClause,t),e.createHeritageClause=e.Debug.deprecate(e.factory.createHeritageClause,t),e.updateHeritageClause=e.Debug.deprecate(e.factory.updateHeritageClause,t),e.createCatchClause=e.Debug.deprecate(e.factory.createCatchClause,t),e.updateCatchClause=e.Debug.deprecate(e.factory.updateCatchClause,t),e.createPropertyAssignment=e.Debug.deprecate(e.factory.createPropertyAssignment,t),e.updatePropertyAssignment=e.Debug.deprecate(e.factory.updatePropertyAssignment,t),e.createShorthandPropertyAssignment=e.Debug.deprecate(e.factory.createShorthandPropertyAssignment,t),e.updateShorthandPropertyAssignment=e.Debug.deprecate(e.factory.updateShorthandPropertyAssignment,t),e.createSpreadAssignment=e.Debug.deprecate(e.factory.createSpreadAssignment,t),e.updateSpreadAssignment=e.Debug.deprecate(e.factory.updateSpreadAssignment,t),e.createEnumMember=e.Debug.deprecate(e.factory.createEnumMember,t),e.updateEnumMember=e.Debug.deprecate(e.factory.updateEnumMember,t),e.updateSourceFileNode=e.Debug.deprecate(e.factory.updateSourceFile,t),e.createNotEmittedStatement=e.Debug.deprecate(e.factory.createNotEmittedStatement,t),e.createPartiallyEmittedExpression=e.Debug.deprecate(e.factory.createPartiallyEmittedExpression,t),e.updatePartiallyEmittedExpression=e.Debug.deprecate(e.factory.updatePartiallyEmittedExpression,t),e.createCommaList=e.Debug.deprecate(e.factory.createCommaListExpression,t),e.updateCommaList=e.Debug.deprecate(e.factory.updateCommaListExpression,t),e.createBundle=e.Debug.deprecate(e.factory.createBundle,t),e.updateBundle=e.Debug.deprecate(e.factory.updateBundle,t),e.createImmediatelyInvokedFunctionExpression=e.Debug.deprecate(e.factory.createImmediatelyInvokedFunctionExpression,t),e.createImmediatelyInvokedArrowFunction=e.Debug.deprecate(e.factory.createImmediatelyInvokedArrowFunction,t),e.createVoidZero=e.Debug.deprecate(e.factory.createVoidZero,t),e.createExportDefault=e.Debug.deprecate(e.factory.createExportDefault,t),e.createExternalModuleExport=e.Debug.deprecate(e.factory.createExternalModuleExport,t),e.createNamespaceExport=e.Debug.deprecate(e.factory.createNamespaceExport,t),e.updateNamespaceExport=e.Debug.deprecate(e.factory.updateNamespaceExport,t),e.createToken=e.Debug.deprecate((function(t){return e.factory.createToken(t)}),t),e.createIdentifier=e.Debug.deprecate((function(t){return e.factory.createIdentifier(t,void 0,void 0)}),t),e.createTempVariable=e.Debug.deprecate((function(t){return e.factory.createTempVariable(t,void 0)}),t),e.getGeneratedNameForNode=e.Debug.deprecate((function(t){return e.factory.getGeneratedNameForNode(t,void 0)}),t),e.createOptimisticUniqueName=e.Debug.deprecate((function(t){return e.factory.createUniqueName(t,16)}),t),e.createFileLevelUniqueName=e.Debug.deprecate((function(t){return e.factory.createUniqueName(t,48)}),t),e.createIndexSignature=e.Debug.deprecate((function(t,r,n,i){return e.factory.createIndexSignature(t,r,n,i)}),t),e.createTypePredicateNode=e.Debug.deprecate((function(t,r){return e.factory.createTypePredicateNode(void 0,t,r)}),t),e.updateTypePredicateNode=e.Debug.deprecate((function(t,r,n){return e.factory.updateTypePredicateNode(t,void 0,r,n)}),t),e.createLiteral=e.Debug.deprecate((function(t){return "number"==typeof t?e.factory.createNumericLiteral(t):"object"==typeof t&&"base10Value"in t?e.factory.createBigIntLiteral(t):"boolean"==typeof t?t?e.factory.createTrue():e.factory.createFalse():"string"==typeof t?e.factory.createStringLiteral(t,void 0):e.factory.createStringLiteralFromNode(t)}),{since:"4.0",warnAfter:"4.1",message:"Use `factory.createStringLiteral`, `factory.createStringLiteralFromNode`, `factory.createNumericLiteral`, `factory.createBigIntLiteral`, `factory.createTrue`, `factory.createFalse`, or the factory supplied by your transformation context instead."}),e.createMethodSignature=e.Debug.deprecate((function(t,r,n,i,a){return e.factory.createMethodSignature(void 0,i,a,t,r,n)}),t),e.updateMethodSignature=e.Debug.deprecate((function(t,r,n,i,a,o){return e.factory.updateMethodSignature(t,t.modifiers,a,o,r,n,i)}),t),e.createTypeOperatorNode=e.Debug.deprecate((function(t,r){var n;return r?n=t:(r=t,n=140),e.factory.createTypeOperatorNode(n,r)}),t),e.createTaggedTemplate=e.Debug.deprecate((function(t,r,n){var i;return n?i=r:n=r,e.factory.createTaggedTemplateExpression(t,i,n)}),t),e.updateTaggedTemplate=e.Debug.deprecate((function(t,r,n,i){var a;return i?a=n:i=n,e.factory.updateTaggedTemplateExpression(t,r,a,i)}),t),e.updateBinary=e.Debug.deprecate((function(t,r,n,i){return void 0===i&&(i=t.operatorToken),"number"==typeof i&&(i=i===t.operatorToken.kind?t.operatorToken:e.factory.createToken(i)),e.factory.updateBinaryExpression(t,r,i,n)}),t),e.createConditional=e.Debug.deprecate((function(t,r,n,i,a){return 5===arguments.length?e.factory.createConditionalExpression(t,r,n,i,a):3===arguments.length?e.factory.createConditionalExpression(t,e.factory.createToken(57),r,e.factory.createToken(58),n):e.Debug.fail("Argument count mismatch")}),t),e.createYield=e.Debug.deprecate((function(t,r){var n;return r?n=t:r=t,e.factory.createYieldExpression(n,r)}),t),e.createClassExpression=e.Debug.deprecate((function(t,r,n,i,a){return e.factory.createClassExpression(void 0,t,r,n,i,a)}),t),e.updateClassExpression=e.Debug.deprecate((function(t,r,n,i,a,o){return e.factory.updateClassExpression(t,void 0,r,n,i,a,o)}),t),e.createPropertySignature=e.Debug.deprecate((function(t,r,n,i,a){var o=e.factory.createPropertySignature(t,r,n,i);return o.initializer=a,o}),t),e.updatePropertySignature=e.Debug.deprecate((function(t,r,n,i,a,o){var s=e.factory.updatePropertySignature(t,r,n,i,a);return t.initializer!==o&&(s===t&&(s=e.factory.cloneNode(t)),s.initializer=o),s}),t),e.createExpressionWithTypeArguments=e.Debug.deprecate((function(t,r){return e.factory.createExpressionWithTypeArguments(r,t)}),t),e.updateExpressionWithTypeArguments=e.Debug.deprecate((function(t,r,n){return e.factory.updateExpressionWithTypeArguments(t,n,r)}),t),e.createArrowFunction=e.Debug.deprecate((function(t,r,n,i,a,o){return 6===arguments.length?e.factory.createArrowFunction(t,r,n,i,a,o):5===arguments.length?e.factory.createArrowFunction(t,r,n,i,void 0,a):e.Debug.fail("Argument count mismatch")}),t),e.updateArrowFunction=e.Debug.deprecate((function(t,r,n,i,a,o,s){return 7===arguments.length?e.factory.updateArrowFunction(t,r,n,i,a,o,s):6===arguments.length?e.factory.updateArrowFunction(t,r,n,i,a,t.equalsGreaterThanToken,o):e.Debug.fail("Argument count mismatch")}),t),e.createVariableDeclaration=e.Debug.deprecate((function(t,r,n,i){return 4===arguments.length?e.factory.createVariableDeclaration(t,r,n,i):arguments.length>=1&&arguments.length<=3?e.factory.createVariableDeclaration(t,void 0,r,n):e.Debug.fail("Argument count mismatch")}),t),e.updateVariableDeclaration=e.Debug.deprecate((function(t,r,n,i,a){return 5===arguments.length?e.factory.updateVariableDeclaration(t,r,n,i,a):4===arguments.length?e.factory.updateVariableDeclaration(t,r,t.exclamationToken,n,i):e.Debug.fail("Argument count mismatch")}),t),e.createImportClause=e.Debug.deprecate((function(t,r,n){return void 0===n&&(n=!1),e.factory.createImportClause(n,t,r)}),t),e.updateImportClause=e.Debug.deprecate((function(t,r,n,i){return e.factory.updateImportClause(t,i,r,n)}),t),e.createExportDeclaration=e.Debug.deprecate((function(t,r,n,i,a){return void 0===a&&(a=!1),e.factory.createExportDeclaration(t,r,a,n,i)}),t),e.updateExportDeclaration=e.Debug.deprecate((function(t,r,n,i,a,o){return e.factory.updateExportDeclaration(t,r,n,o,i,a,t.assertClause)}),t),e.createJSDocParamTag=e.Debug.deprecate((function(t,r,n,i){return e.factory.createJSDocParameterTag(void 0,t,r,n,!1,i?e.factory.createNodeArray([e.factory.createJSDocText(i)]):void 0)}),t),e.createComma=e.Debug.deprecate((function(t,r){return e.factory.createComma(t,r)}),t),e.createLessThan=e.Debug.deprecate((function(t,r){return e.factory.createLessThan(t,r)}),t),e.createAssignment=e.Debug.deprecate((function(t,r){return e.factory.createAssignment(t,r)}),t),e.createStrictEquality=e.Debug.deprecate((function(t,r){return e.factory.createStrictEquality(t,r)}),t),e.createStrictInequality=e.Debug.deprecate((function(t,r){return e.factory.createStrictInequality(t,r)}),t),e.createAdd=e.Debug.deprecate((function(t,r){return e.factory.createAdd(t,r)}),t),e.createSubtract=e.Debug.deprecate((function(t,r){return e.factory.createSubtract(t,r)}),t),e.createLogicalAnd=e.Debug.deprecate((function(t,r){return e.factory.createLogicalAnd(t,r)}),t),e.createLogicalOr=e.Debug.deprecate((function(t,r){return e.factory.createLogicalOr(t,r)}),t),e.createPostfixIncrement=e.Debug.deprecate((function(t){return e.factory.createPostfixIncrement(t)}),t),e.createLogicalNot=e.Debug.deprecate((function(t){return e.factory.createLogicalNot(t)}),t),e.createNode=e.Debug.deprecate((function(t,r,n){return void 0===r&&(r=0),void 0===n&&(n=0),e.setTextRangePosEnd(303===t?e.parseBaseNodeFactory.createBaseSourceFileNode(t):79===t?e.parseBaseNodeFactory.createBaseIdentifierNode(t):80===t?e.parseBaseNodeFactory.createBasePrivateIdentifierNode(t):e.isNodeKind(t)?e.parseBaseNodeFactory.createBaseNode(t):e.parseBaseNodeFactory.createBaseTokenNode(t),r,n)}),{since:"4.0",warnAfter:"4.1",message:"Use an appropriate `factory` method instead."}),e.getMutableClone=e.Debug.deprecate((function(t){var r=e.factory.cloneNode(t);return e.setTextRange(r,t),e.setParent(r,t.parent),r}),{since:"4.0",warnAfter:"4.1",message:"Use an appropriate `factory.update...` method instead, use `setCommentRange` or `setSourceMapRange`, and avoid setting `parent`."}),e.isTypeAssertion=e.Debug.deprecate((function(e){return 210===e.kind}),{since:"4.0",warnAfter:"4.1",message:"Use `isTypeAssertionExpression` instead."}),e.isIdentifierOrPrivateIdentifier=e.Debug.deprecate((function(t){return e.isMemberName(t)}),{since:"4.2",warnAfter:"4.3",message:"Use `isMemberName` instead."});}(t);
  8194. /**
  8195. * Begins the process of minifying a user's JavaScript
  8196. * @param config the Stencil configuration file that was provided as a part of the build step
  8197. * @param compilerCtx the current compiler context
  8198. * @param opts minification options that specify how the JavaScript ought to be minified
  8199. * @returns the minified JavaScript result
  8200. */
  8201. const optimizeModule = async (config, compilerCtx, opts) => {
  8202. if ((!opts.minify && opts.sourceTarget !== 'es5') || opts.input === '') {
  8203. return {
  8204. output: opts.input,
  8205. diagnostics: [],
  8206. sourceMap: opts.sourceMap,
  8207. };
  8208. }
  8209. const isDebug = config.logLevel === 'debug';
  8210. const cacheKey = await compilerCtx.cache.createKey('optimizeModule', minfyJsId, opts, isDebug);
  8211. const cachedContent = await compilerCtx.cache.get(cacheKey);
  8212. if (cachedContent != null) {
  8213. const cachedMap = await compilerCtx.cache.get(cacheKey + 'Map');
  8214. return {
  8215. output: cachedContent,
  8216. diagnostics: [],
  8217. sourceMap: cachedMap ? JSON.parse(cachedMap) : null,
  8218. };
  8219. }
  8220. let minifyOpts;
  8221. let code = opts.input;
  8222. if (opts.isCore) {
  8223. // IS_ESM_BUILD is replaced at build time so systemjs and esm builds have diff values
  8224. // not using the BUILD conditional since rollup would input the same value
  8225. code = code.replace(/\/\* IS_ESM_BUILD \*\//g, '&& false /* IS_SYSTEM_JS_BUILD */');
  8226. }
  8227. if (opts.sourceTarget === 'es5' || opts.minify) {
  8228. minifyOpts = getTerserOptions(config, opts.sourceTarget, isDebug);
  8229. if (config.sourceMap) {
  8230. minifyOpts.sourceMap = { content: opts.sourceMap };
  8231. }
  8232. const compressOpts = minifyOpts.compress;
  8233. const mangleOptions = minifyOpts.mangle;
  8234. if (opts.sourceTarget !== 'es5' && opts.isCore) {
  8235. if (!isDebug) {
  8236. compressOpts.passes = 2;
  8237. compressOpts.global_defs = {
  8238. supportsListenerOptions: true,
  8239. 'plt.$cssShim$': false,
  8240. };
  8241. compressOpts.pure_funcs = compressOpts.pure_funcs || [];
  8242. compressOpts.pure_funcs = ['getHostRef', ...compressOpts.pure_funcs];
  8243. }
  8244. mangleOptions.properties = {
  8245. regex: '^\\$.+\\$$',
  8246. debug: isDebug,
  8247. };
  8248. compressOpts.inline = 1;
  8249. compressOpts.unsafe = true;
  8250. compressOpts.unsafe_undefined = true;
  8251. }
  8252. }
  8253. const shouldTranspile = opts.sourceTarget === 'es5';
  8254. const results = await compilerCtx.worker.prepareModule(code, minifyOpts, shouldTranspile, opts.inlineHelpers);
  8255. if (results != null &&
  8256. typeof results.output === 'string' &&
  8257. results.diagnostics.length === 0 &&
  8258. compilerCtx != null) {
  8259. if (opts.isCore) {
  8260. results.output = results.output.replace(/disconnectedCallback\(\)\{\},/g, '');
  8261. }
  8262. await compilerCtx.cache.put(cacheKey, results.output);
  8263. if (results.sourceMap) {
  8264. await compilerCtx.cache.put(cacheKey + 'Map', JSON.stringify(results.sourceMap));
  8265. }
  8266. }
  8267. return results;
  8268. };
  8269. /**
  8270. * Builds a configuration object to be used by Terser for the purposes of minifying a user's JavaScript
  8271. * @param config the Stencil configuration file that was provided as a part of the build step
  8272. * @param sourceTarget the version of JavaScript being targeted (e.g. ES2017)
  8273. * @param prettyOutput if true, set the necessary flags to beautify the output of terser
  8274. * @returns the minification options
  8275. */
  8276. const getTerserOptions = (config, sourceTarget, prettyOutput) => {
  8277. const opts = {
  8278. ie8: false,
  8279. safari10: !!config.extras.safari10,
  8280. format: {},
  8281. sourceMap: config.sourceMap,
  8282. };
  8283. if (sourceTarget === 'es5') {
  8284. opts.ecma = opts.format.ecma = 5;
  8285. opts.compress = false;
  8286. opts.mangle = true;
  8287. }
  8288. else {
  8289. opts.mangle = {
  8290. properties: {
  8291. regex: '^\\$.+\\$$',
  8292. },
  8293. };
  8294. opts.compress = {
  8295. pure_getters: true,
  8296. keep_fargs: false,
  8297. passes: 2,
  8298. };
  8299. opts.ecma = opts.format.ecma = opts.compress.ecma = 2018;
  8300. opts.toplevel = true;
  8301. opts.module = true;
  8302. opts.mangle.toplevel = true;
  8303. opts.compress.arrows = true;
  8304. opts.compress.module = true;
  8305. opts.compress.toplevel = true;
  8306. }
  8307. if (prettyOutput) {
  8308. opts.mangle = { keep_fnames: true };
  8309. opts.compress = {};
  8310. opts.compress.drop_console = false;
  8311. opts.compress.drop_debugger = false;
  8312. opts.compress.pure_funcs = [];
  8313. opts.format.beautify = true;
  8314. opts.format.indent_level = 2;
  8315. opts.format.comments = 'all';
  8316. }
  8317. return opts;
  8318. };
  8319. /**
  8320. * This method is likely to be called by a worker on the compiler context, rather than directly.
  8321. * @param input the source code to minify
  8322. * @param minifyOpts options to be used by the minifier
  8323. * @param transpileToEs5 if true, use the TypeScript compiler to transpile the input to ES5 prior to minification
  8324. * @param inlineHelpers when true, emits less terse JavaScript by allowing global helpers created by the TypeScript
  8325. * compiler to be added directly to the transpiled source. Used only if `transpileToEs5` is true.
  8326. * @returns minified input, as JavaScript
  8327. */
  8328. const prepareModule = async (input, minifyOpts, transpileToEs5, inlineHelpers) => {
  8329. var _a;
  8330. const results = {
  8331. output: input,
  8332. diagnostics: [],
  8333. sourceMap: null,
  8334. };
  8335. if (transpileToEs5) {
  8336. const tsResults = t.transpileModule(input, {
  8337. fileName: 'module.ts',
  8338. compilerOptions: {
  8339. sourceMap: !!minifyOpts.sourceMap,
  8340. allowJs: true,
  8341. target: t.ScriptTarget.ES5,
  8342. module: t.ModuleKind.ESNext,
  8343. removeComments: false,
  8344. isolatedModules: true,
  8345. skipLibCheck: true,
  8346. noEmitHelpers: !inlineHelpers,
  8347. importHelpers: !inlineHelpers,
  8348. },
  8349. reportDiagnostics: false,
  8350. });
  8351. results.output = tsResults.outputText;
  8352. if (tsResults.sourceMapText) {
  8353. // need to merge sourcemaps at this point
  8354. const mergeMap = mergeSourceMap((_a = minifyOpts.sourceMap) === null || _a === void 0 ? void 0 : _a.content, JSON.parse(tsResults.sourceMapText));
  8355. minifyOpts.sourceMap = { content: mergeMap };
  8356. }
  8357. }
  8358. if (minifyOpts) {
  8359. return minifyJs(results.output, minifyOpts);
  8360. }
  8361. return results;
  8362. };
  8363. const getScopeId = (tagName, mode) => {
  8364. return 'sc-' + tagName + (mode && mode !== DEFAULT_STYLE_MODE ? '-' + mode : '');
  8365. };
  8366. const getAbsoluteBuildDir = (outputTarget) => {
  8367. const relativeBuildDir = relative$1(outputTarget.dir, outputTarget.buildDir);
  8368. return join('/', relativeBuildDir) + '/';
  8369. };
  8370. const optimizeCriticalPath = (doc, criticalBundlers, outputTarget) => {
  8371. const buildDir = getAbsoluteBuildDir(outputTarget);
  8372. const paths = criticalBundlers.map((path) => join(buildDir, path));
  8373. injectModulePreloads(doc, paths);
  8374. };
  8375. const injectModulePreloads = (doc, paths) => {
  8376. const existingLinks = Array.from(doc.querySelectorAll('link[rel=modulepreload]')).map((link) => link.getAttribute('href'));
  8377. const addLinks = paths.filter((path) => !existingLinks.includes(path)).map((path) => createModulePreload(doc, path));
  8378. const head = doc.head;
  8379. const firstScript = head.querySelector('script');
  8380. if (firstScript) {
  8381. for (const link of addLinks) {
  8382. head.insertBefore(link, firstScript);
  8383. }
  8384. }
  8385. else {
  8386. for (const link of addLinks) {
  8387. head.appendChild(link);
  8388. }
  8389. }
  8390. };
  8391. const createModulePreload = (doc, href) => {
  8392. const link = doc.createElement('link');
  8393. link.setAttribute('rel', 'modulepreload');
  8394. link.setAttribute('href', href);
  8395. return link;
  8396. };
  8397. const optimizeJs = async (inputOpts) => {
  8398. const result = {
  8399. output: inputOpts.input,
  8400. diagnostics: [],
  8401. sourceMap: null,
  8402. };
  8403. try {
  8404. const prettyOutput = !!inputOpts.pretty;
  8405. const config = {
  8406. extras: {
  8407. safari10: true,
  8408. },
  8409. };
  8410. const sourceTarget = inputOpts.target === 'es5' ? 'es5' : 'latest';
  8411. const minifyOpts = getTerserOptions(config, sourceTarget, prettyOutput);
  8412. const minifyResults = await minifyJs(inputOpts.input, minifyOpts);
  8413. if (minifyResults.diagnostics.length > 0) {
  8414. result.diagnostics.push(...minifyResults.diagnostics);
  8415. }
  8416. else {
  8417. result.output = minifyResults.output;
  8418. result.sourceMap = minifyResults.sourceMap;
  8419. }
  8420. }
  8421. catch (e) {
  8422. catchError(result.diagnostics, e);
  8423. }
  8424. return result;
  8425. };
  8426. const inlineExternalStyleSheets = async (sys, appDir, doc) => {
  8427. const documentLinks = Array.from(doc.querySelectorAll('link[rel=stylesheet]'));
  8428. if (documentLinks.length === 0) {
  8429. return;
  8430. }
  8431. await Promise.all(documentLinks.map(async (link) => {
  8432. const href = link.getAttribute('href');
  8433. if (!href.startsWith('/') || link.getAttribute('media') !== null) {
  8434. return;
  8435. }
  8436. const fsPath = join(appDir, href);
  8437. try {
  8438. let styles = await sys.readFile(fsPath);
  8439. const optimizeResults = await optimizeCss$1({
  8440. input: styles,
  8441. });
  8442. styles = optimizeResults.output;
  8443. // insert inline <style>
  8444. const inlinedStyles = doc.createElement('style');
  8445. inlinedStyles.innerHTML = styles;
  8446. link.parentNode.insertBefore(inlinedStyles, link);
  8447. link.remove();
  8448. // mark inlinedStyle as treeshakable
  8449. inlinedStyles.setAttribute('data-styles', '');
  8450. // since it's no longer a critical resource
  8451. link.setAttribute('media', '(max-width: 0px)');
  8452. link.setAttribute('importance', 'low');
  8453. link.setAttribute('onload', `this.media=''`);
  8454. // move <link rel="stylesheet"> to the end of <body>
  8455. doc.body.appendChild(link);
  8456. }
  8457. catch (e) { }
  8458. }));
  8459. };
  8460. const minifyScriptElements = async (doc, addMinifiedAttr) => {
  8461. const scriptElms = Array.from(doc.querySelectorAll('script')).filter((scriptElm) => {
  8462. if (scriptElm.hasAttribute('src') || scriptElm.hasAttribute(dataMinifiedAttr)) {
  8463. return false;
  8464. }
  8465. const scriptType = scriptElm.getAttribute('type');
  8466. if (typeof scriptType === 'string' && scriptType !== 'module' && scriptType !== 'text/javascript') {
  8467. return false;
  8468. }
  8469. return true;
  8470. });
  8471. if (scriptElms.length === 0) {
  8472. return;
  8473. }
  8474. await Promise.all(scriptElms.map(async (scriptElm) => {
  8475. const content = scriptElm.innerHTML.trim();
  8476. if (content.length > 0) {
  8477. const opts = {
  8478. input: content,
  8479. sourceMap: false,
  8480. target: 'latest',
  8481. };
  8482. if (scriptElm.getAttribute('type') !== 'module') {
  8483. opts.target = 'es5';
  8484. }
  8485. const optimizeResults = await optimizeJs(opts);
  8486. if (optimizeResults.diagnostics.length === 0) {
  8487. scriptElm.innerHTML = optimizeResults.output;
  8488. }
  8489. if (addMinifiedAttr) {
  8490. scriptElm.setAttribute(dataMinifiedAttr, '');
  8491. }
  8492. }
  8493. }));
  8494. };
  8495. const minifyStyleElements = async (sys, appDir, doc, currentUrl, addMinifiedAttr) => {
  8496. const styleElms = Array.from(doc.querySelectorAll('style')).filter((styleElm) => {
  8497. if (styleElm.hasAttribute(dataMinifiedAttr)) {
  8498. return false;
  8499. }
  8500. return true;
  8501. });
  8502. await Promise.all(styleElms.map(async (styleElm) => {
  8503. const content = styleElm.innerHTML.trim();
  8504. if (content.length > 0) {
  8505. const optimizeResults = await optimizeCss$1({
  8506. input: content,
  8507. minify: true,
  8508. async resolveUrl(urlProp) {
  8509. const assetUrl = new URL(urlProp, currentUrl);
  8510. const hash = await getAssetFileHash(sys, appDir, assetUrl);
  8511. assetUrl.searchParams.append('v', hash);
  8512. return assetUrl.pathname + assetUrl.search;
  8513. },
  8514. });
  8515. if (optimizeResults.diagnostics.length === 0) {
  8516. styleElm.innerHTML = optimizeResults.output;
  8517. }
  8518. if (addMinifiedAttr) {
  8519. styleElm.setAttribute(dataMinifiedAttr, '');
  8520. }
  8521. }
  8522. }));
  8523. };
  8524. const excludeStaticComponents = (doc, hydrateOpts, hydrateResults) => {
  8525. const staticComponents = hydrateOpts.staticComponents.filter((tag) => {
  8526. return hydrateResults.components.some((cmp) => cmp.tag === tag);
  8527. });
  8528. if (staticComponents.length > 0) {
  8529. const stencilScriptElm = doc.querySelector('script[data-stencil-namespace]');
  8530. if (stencilScriptElm) {
  8531. const namespace = stencilScriptElm.getAttribute('data-stencil-namespace');
  8532. let scriptContent = excludeComponentScript.replace('__NAMESPACE__', namespace);
  8533. scriptContent = scriptContent.replace('__EXCLUDE__', JSON.stringify(staticComponents));
  8534. const dataOptsScript = doc.createElement('script');
  8535. dataOptsScript.innerHTML = scriptContent;
  8536. dataOptsScript.setAttribute(dataMinifiedAttr, '');
  8537. stencilScriptElm.parentNode.insertBefore(dataOptsScript, stencilScriptElm.nextSibling);
  8538. }
  8539. }
  8540. };
  8541. const excludeComponentScript = `
  8542. (function(){
  8543. var s=document.querySelector('[data-stencil-namespace="__NAMESPACE__"]');
  8544. s&&((s['data-opts']=s['data-opts']||{}).exclude=__EXCLUDE__);
  8545. })();
  8546. `
  8547. .replace(/\n/g, '')
  8548. .trim();
  8549. const addModulePreloads = (doc, hydrateOpts, hydrateResults, componentGraph) => {
  8550. if (!componentGraph) {
  8551. return false;
  8552. }
  8553. const staticComponents = hydrateOpts.staticComponents || [];
  8554. const cmpTags = hydrateResults.components.filter((cmp) => !staticComponents.includes(cmp.tag));
  8555. const modulePreloads = unique(flatOne(cmpTags.map((cmp) => getScopeId(cmp.tag, cmp.mode)).map((scopeId) => componentGraph.get(scopeId) || [])));
  8556. injectModulePreloads(doc, modulePreloads);
  8557. return true;
  8558. };
  8559. const removeModulePreloads = (doc) => {
  8560. const links = doc.querySelectorAll('link[rel="modulepreload"]');
  8561. for (let i = links.length - 1; i >= 0; i--) {
  8562. const href = links[i].getAttribute('href');
  8563. if (href && href.includes('/p-')) {
  8564. links[i].remove();
  8565. }
  8566. }
  8567. };
  8568. const removeStencilScripts = (doc) => {
  8569. const stencilScripts = doc.querySelectorAll('script[data-stencil]');
  8570. for (let i = stencilScripts.length - 1; i >= 0; i--) {
  8571. stencilScripts[i].remove();
  8572. }
  8573. };
  8574. const hasStencilScript = (doc) => {
  8575. return !!doc.querySelector('script[data-stencil]');
  8576. };
  8577. const hashAssets = async (sys, prerenderCtx, diagnostics, hydrateOpts, appDir, doc, currentUrl) => {
  8578. // do one at a time to prevent too many opened files and memory usage issues
  8579. // hash id is cached in each worker, so shouldn't have to do this for every page
  8580. // update the stylesheet content first so the hash url()s are apart of the file's hash too
  8581. const links = Array.from(doc.querySelectorAll('link[rel=stylesheet][href]'));
  8582. for (const link of links) {
  8583. const href = link.getAttribute('href');
  8584. if (isString$1(href) && href.length > 0) {
  8585. const stylesheetUrl = new URL(href, currentUrl);
  8586. if (currentUrl.host === stylesheetUrl.host) {
  8587. try {
  8588. const filePath = join(appDir, stylesheetUrl.pathname);
  8589. if (prerenderCtx.hashedFile.has(filePath)) {
  8590. continue;
  8591. }
  8592. prerenderCtx.hashedFile.add(filePath);
  8593. let css = await sys.readFile(filePath);
  8594. if (isString$1(css) && css.length > 0) {
  8595. css = await minifyCss({
  8596. css,
  8597. async resolveUrl(urlProp) {
  8598. const assetUrl = new URL(urlProp, stylesheetUrl);
  8599. const hash = await getAssetFileHash(sys, appDir, assetUrl);
  8600. assetUrl.searchParams.append('v', hash);
  8601. return assetUrl.pathname + assetUrl.search;
  8602. },
  8603. });
  8604. sys.writeFileSync(filePath, css);
  8605. }
  8606. }
  8607. catch (e) {
  8608. catchError(diagnostics, e);
  8609. }
  8610. }
  8611. }
  8612. }
  8613. await hashAsset(sys, hydrateOpts, appDir, doc, currentUrl, 'link[rel="stylesheet"]', ['href']);
  8614. await hashAsset(sys, hydrateOpts, appDir, doc, currentUrl, 'link[rel="prefetch"]', ['href']);
  8615. await hashAsset(sys, hydrateOpts, appDir, doc, currentUrl, 'link[rel="preload"]', ['href']);
  8616. await hashAsset(sys, hydrateOpts, appDir, doc, currentUrl, 'link[rel="modulepreload"]', ['href']);
  8617. await hashAsset(sys, hydrateOpts, appDir, doc, currentUrl, 'link[rel="icon"]', ['href']);
  8618. await hashAsset(sys, hydrateOpts, appDir, doc, currentUrl, 'link[rel="apple-touch-icon"]', ['href']);
  8619. await hashAsset(sys, hydrateOpts, appDir, doc, currentUrl, 'link[rel="manifest"]', ['href']);
  8620. await hashAsset(sys, hydrateOpts, appDir, doc, currentUrl, 'script', ['src']);
  8621. await hashAsset(sys, hydrateOpts, appDir, doc, currentUrl, 'img', ['src', 'srcset']);
  8622. await hashAsset(sys, hydrateOpts, appDir, doc, currentUrl, 'picture > source', ['srcset']);
  8623. const pageStates = Array.from(doc.querySelectorAll('script[data-stencil-static="page.state"][type="application/json"]'));
  8624. if (pageStates.length > 0) {
  8625. await Promise.all(pageStates.map(async (pageStateScript) => {
  8626. const pageState = JSON.parse(pageStateScript.textContent);
  8627. if (pageState && Array.isArray(pageState.ast)) {
  8628. for (const node of pageState.ast) {
  8629. if (Array.isArray(node)) {
  8630. await hashPageStateAstAssets(sys, hydrateOpts, appDir, currentUrl, pageStateScript, node);
  8631. }
  8632. }
  8633. pageStateScript.textContent = JSON.stringify(pageState);
  8634. }
  8635. }));
  8636. }
  8637. };
  8638. const hashAsset = async (sys, hydrateOpts, appDir, doc, currentUrl, selector, srcAttrs) => {
  8639. const elms = Array.from(doc.querySelectorAll(selector));
  8640. // do one at a time to prevent too many opened files and memory usage issues
  8641. for (const elm of elms) {
  8642. for (const attrName of srcAttrs) {
  8643. const srcValues = getAttrUrls(attrName, elm.getAttribute(attrName));
  8644. for (const srcValue of srcValues) {
  8645. const assetUrl = new URL(srcValue.src, currentUrl);
  8646. if (assetUrl.hostname === currentUrl.hostname) {
  8647. if (hydrateOpts.hashAssets === 'querystring' && !assetUrl.searchParams.has('v')) {
  8648. try {
  8649. const hash = await getAssetFileHash(sys, appDir, assetUrl);
  8650. if (isString$1(hash)) {
  8651. assetUrl.searchParams.append('v', hash);
  8652. const attrValue = setAttrUrls(assetUrl, srcValue.descriptor);
  8653. elm.setAttribute(attrName, attrValue);
  8654. }
  8655. }
  8656. catch (e) { }
  8657. }
  8658. }
  8659. }
  8660. }
  8661. }
  8662. };
  8663. const hashPageStateAstAssets = async (sys, hydrateOpts, appDir, currentUrl, pageStateScript, node) => {
  8664. const tagName = node[0];
  8665. const attrs = node[1];
  8666. if (isString$1(tagName)) {
  8667. if (attrs) {
  8668. if (tagName === 'img' || tagName === 'source') {
  8669. for (const attrName of ['src', 'srcset']) {
  8670. const srcValues = getAttrUrls(attrName, attrs[attrName]);
  8671. for (const srcValue of srcValues) {
  8672. const assetUrl = new URL(srcValue.src, currentUrl);
  8673. if (assetUrl.hostname === currentUrl.hostname) {
  8674. if (hydrateOpts.hashAssets === 'querystring' && !assetUrl.searchParams.has('v')) {
  8675. try {
  8676. const hash = await getAssetFileHash(sys, appDir, assetUrl);
  8677. if (isString$1(hash)) {
  8678. assetUrl.searchParams.append('v', hash);
  8679. const attrValue = setAttrUrls(assetUrl, srcValue.descriptor);
  8680. attrs[attrName] = attrValue;
  8681. }
  8682. }
  8683. catch (e) { }
  8684. }
  8685. }
  8686. }
  8687. }
  8688. }
  8689. }
  8690. for (let i = 2, l = node.length; i < l; i++) {
  8691. if (Array.isArray(node[i])) {
  8692. await hashPageStateAstAssets(sys, hydrateOpts, appDir, currentUrl, pageStateScript, node[i]);
  8693. }
  8694. }
  8695. }
  8696. };
  8697. const getAttrUrls = (attrName, attrValue) => {
  8698. const srcValues = [];
  8699. if (isString$1(attrValue)) {
  8700. if (attrName.toLowerCase() === 'srcset') {
  8701. attrValue
  8702. .split(',')
  8703. .map((a) => a.trim())
  8704. .filter((a) => a.length > 0)
  8705. .forEach((src) => {
  8706. const spaceSplt = src.split(' ');
  8707. if (spaceSplt[0].length > 0) {
  8708. srcValues.push({ src: spaceSplt[0], descriptor: spaceSplt[1] });
  8709. }
  8710. });
  8711. }
  8712. else {
  8713. srcValues.push({ src: attrValue });
  8714. }
  8715. }
  8716. return srcValues;
  8717. };
  8718. const setAttrUrls = (url, descriptor) => {
  8719. let src = url.pathname + url.search;
  8720. if (isString$1(descriptor)) {
  8721. src += ' ' + descriptor;
  8722. }
  8723. return src;
  8724. };
  8725. const hashedAssets = new Map();
  8726. const getAssetFileHash = async (sys, appDir, assetUrl) => {
  8727. let p = hashedAssets.get(assetUrl.pathname);
  8728. if (!p) {
  8729. const assetFilePath = join(appDir, assetUrl.pathname);
  8730. p = sys.generateFileHash(assetFilePath, 10);
  8731. hashedAssets.set(assetUrl.pathname, p);
  8732. }
  8733. return p;
  8734. };
  8735. const dataMinifiedAttr = 'data-m';
  8736. const crawlAnchorsForNextUrls = (prerenderConfig, diagnostics, baseUrl, currentUrl, parsedAnchors) => {
  8737. if (!Array.isArray(parsedAnchors) || parsedAnchors.length === 0) {
  8738. return [];
  8739. }
  8740. const basePathParts = baseUrl.pathname.split('/');
  8741. // filterAnchor(): filter which anchors to actually crawl
  8742. // normalizeUrl(): normalize href strings into URL objects
  8743. // filterUrl(): filter which urls to actually crawl
  8744. // normalizeHref(): normalize URL objects into href strings
  8745. return parsedAnchors
  8746. .filter((anchor) => {
  8747. // filter which anchors to actually crawl
  8748. if (typeof prerenderConfig.filterAnchor === 'function') {
  8749. // user filterAnchor()
  8750. try {
  8751. const userFilterAnchor = prerenderConfig.filterAnchor(anchor, currentUrl);
  8752. if (userFilterAnchor === false) {
  8753. return false;
  8754. }
  8755. }
  8756. catch (e) {
  8757. // user filterAnchor() error
  8758. catchError(diagnostics, e);
  8759. return false;
  8760. }
  8761. }
  8762. // standard filterAnchor()
  8763. return standardFilterAnchor(diagnostics, anchor);
  8764. })
  8765. .map((anchor) => {
  8766. // normalize href strings into URL objects
  8767. if (typeof prerenderConfig.normalizeUrl === 'function') {
  8768. try {
  8769. // user normalizeUrl()
  8770. const userNormalizedUrl = prerenderConfig.normalizeUrl(anchor.href, currentUrl);
  8771. // standard normalizeUrl(), after user normalized
  8772. return standardNormalizeUrl(diagnostics, userNormalizedUrl.href, currentUrl);
  8773. }
  8774. catch (e) {
  8775. // user normalizeUrl() error
  8776. catchError(diagnostics, e);
  8777. }
  8778. }
  8779. // standard normalizeUrl(), no user normalized
  8780. return standardNormalizeUrl(diagnostics, anchor.href, currentUrl);
  8781. })
  8782. .filter((url) => {
  8783. // filter which urls to actually crawl
  8784. if (typeof prerenderConfig.filterUrl === 'function') {
  8785. // user filterUrl()
  8786. try {
  8787. const userFilterUrl = prerenderConfig.filterUrl(url, currentUrl);
  8788. if (userFilterUrl === false) {
  8789. return false;
  8790. }
  8791. }
  8792. catch (e) {
  8793. // user filterUrl() error
  8794. catchError(diagnostics, e);
  8795. return false;
  8796. }
  8797. }
  8798. // standard filterUrl()
  8799. return standardFilterUrl(diagnostics, url, currentUrl, basePathParts);
  8800. })
  8801. .map((url) => {
  8802. // standard normalize href
  8803. // normalize URL objects into href strings
  8804. return standardNormalizeHref(prerenderConfig, diagnostics, url);
  8805. })
  8806. .reduce((hrefs, href) => {
  8807. // remove any duplicate hrefs from the array
  8808. if (!hrefs.includes(href)) {
  8809. hrefs.push(href);
  8810. }
  8811. return hrefs;
  8812. }, [])
  8813. .sort((a, b) => {
  8814. // sort the hrefs so the urls with the least amount
  8815. // of directories are first, then by alphabetical
  8816. const partsA = a.split('/').length;
  8817. const partsB = b.split('/').length;
  8818. if (partsA < partsB)
  8819. return -1;
  8820. if (partsA > partsB)
  8821. return 1;
  8822. if (a < b)
  8823. return -1;
  8824. if (a > b)
  8825. return 1;
  8826. return 0;
  8827. });
  8828. };
  8829. const standardFilterAnchor = (diagnostics, attrs, _base) => {
  8830. try {
  8831. let href = attrs.href;
  8832. if (typeof attrs.download === 'string') {
  8833. return false;
  8834. }
  8835. if (typeof href === 'string') {
  8836. href = href.trim();
  8837. if (href !== '' && !href.startsWith('#') && !href.startsWith('?')) {
  8838. const target = attrs.target;
  8839. if (typeof target === 'string' && attrs.target.trim().toLowerCase() !== '_self') {
  8840. return false;
  8841. }
  8842. return true;
  8843. }
  8844. }
  8845. }
  8846. catch (e) {
  8847. catchError(diagnostics, e);
  8848. }
  8849. return false;
  8850. };
  8851. const standardNormalizeUrl = (diagnostics, href, currentUrl) => {
  8852. if (typeof href === 'string') {
  8853. try {
  8854. const outputUrl = new URL(href, currentUrl.href);
  8855. outputUrl.protocol = currentUrl.href;
  8856. outputUrl.hash = '';
  8857. outputUrl.search = '';
  8858. const parts = outputUrl.pathname.split('/');
  8859. const lastPart = parts[parts.length - 1];
  8860. if (lastPart === 'index.html' || lastPart === 'index.htm') {
  8861. parts.pop();
  8862. outputUrl.pathname = parts.join('/');
  8863. }
  8864. return outputUrl;
  8865. }
  8866. catch (e) {
  8867. catchError(diagnostics, e);
  8868. }
  8869. }
  8870. return null;
  8871. };
  8872. const standardFilterUrl = (diagnostics, url, currentUrl, basePathParts) => {
  8873. try {
  8874. if (url.hostname != null && currentUrl.hostname != null && url.hostname !== currentUrl.hostname) {
  8875. return false;
  8876. }
  8877. if (shouldSkipExtension(url.pathname)) {
  8878. return false;
  8879. }
  8880. const inputPathParts = url.pathname.split('/');
  8881. if (inputPathParts.length < basePathParts.length) {
  8882. return false;
  8883. }
  8884. for (let i = 0; i < basePathParts.length; i++) {
  8885. const basePathPart = basePathParts[i];
  8886. const inputPathPart = inputPathParts[i];
  8887. if (basePathParts.length - 1 === i && basePathPart === '') {
  8888. break;
  8889. }
  8890. if (basePathPart !== inputPathPart) {
  8891. return false;
  8892. }
  8893. }
  8894. return true;
  8895. }
  8896. catch (e) {
  8897. catchError(diagnostics, e);
  8898. }
  8899. return false;
  8900. };
  8901. const standardNormalizeHref = (prerenderConfig, diagnostics, url) => {
  8902. try {
  8903. if (url != null && typeof url.href === 'string') {
  8904. let href = url.href.trim();
  8905. if (prerenderConfig.trailingSlash) {
  8906. // url should have a trailing slash
  8907. if (!href.endsWith('/')) {
  8908. const parts = url.pathname.split('/');
  8909. const lastPart = parts[parts.length - 1];
  8910. if (!lastPart.includes('.')) {
  8911. // does not end with a slash and last part does not have a dot
  8912. href += '/';
  8913. }
  8914. }
  8915. }
  8916. else {
  8917. // url should NOT have a trailing slash
  8918. if (href.endsWith('/') && url.pathname !== '/') {
  8919. // this has a trailing slash and it's not the root path
  8920. href = href.slice(0, -1);
  8921. }
  8922. }
  8923. return href;
  8924. }
  8925. }
  8926. catch (e) {
  8927. catchError(diagnostics, e);
  8928. }
  8929. return null;
  8930. };
  8931. const shouldSkipExtension = (filename) => SKIP_EXT.has(extname(filename).toLowerCase());
  8932. const extname = (str) => {
  8933. const parts = str.split('.');
  8934. return parts[parts.length - 1].toLowerCase();
  8935. };
  8936. const SKIP_EXT = new Set(['zip', 'rar', 'tar', 'gz', 'bz2', 'png', 'jpeg', 'jpg', 'gif', 'pdf', 'tiff', 'psd']);
  8937. const prerenderCtx = {
  8938. buildId: null,
  8939. componentGraph: null,
  8940. prerenderConfig: null,
  8941. ensuredDirs: null,
  8942. templateHtml: null,
  8943. hashedFile: null,
  8944. };
  8945. const getPrerenderCtx = (prerenderRequest) => {
  8946. if (prerenderRequest.buildId !== prerenderCtx.buildId) {
  8947. prerenderCtx.buildId = prerenderRequest.buildId;
  8948. prerenderCtx.componentGraph = null;
  8949. prerenderCtx.prerenderConfig = null;
  8950. prerenderCtx.ensuredDirs = new Set();
  8951. prerenderCtx.templateHtml = null;
  8952. prerenderCtx.hashedFile = new Set();
  8953. }
  8954. return prerenderCtx;
  8955. };
  8956. const getHydrateOptions = (prerenderConfig, url, diagnostics) => {
  8957. const prerenderUrl = url.href;
  8958. const opts = {
  8959. url: prerenderUrl,
  8960. addModulePreloads: true,
  8961. approximateLineWidth: 100,
  8962. hashAssets: 'querystring',
  8963. inlineExternalStyleSheets: false,
  8964. minifyScriptElements: true,
  8965. minifyStyleElements: true,
  8966. removeAttributeQuotes: true,
  8967. removeBooleanAttributeQuotes: true,
  8968. removeEmptyAttributes: true,
  8969. removeHtmlComments: true,
  8970. };
  8971. if (prerenderConfig.canonicalUrl === null || prerenderConfig.canonicalUrl === false) {
  8972. opts.canonicalUrl = null;
  8973. }
  8974. else if (typeof prerenderConfig.canonicalUrl === 'function') {
  8975. try {
  8976. opts.canonicalUrl = prerenderConfig.canonicalUrl(url);
  8977. }
  8978. catch (e) {
  8979. catchError(diagnostics, e);
  8980. }
  8981. }
  8982. else {
  8983. opts.canonicalUrl = prerenderUrl;
  8984. }
  8985. if (typeof prerenderConfig.hydrateOptions === 'function') {
  8986. try {
  8987. const userOpts = prerenderConfig.hydrateOptions(url);
  8988. if (userOpts != null) {
  8989. if (userOpts.prettyHtml && typeof userOpts.removeAttributeQuotes !== 'boolean') {
  8990. opts.removeAttributeQuotes = false;
  8991. }
  8992. Object.assign(opts, userOpts);
  8993. }
  8994. }
  8995. catch (e) {
  8996. catchError(diagnostics, e);
  8997. }
  8998. }
  8999. return opts;
  9000. };
  9001. const nodeRequire = (id) => {
  9002. const results = {
  9003. module: undefined,
  9004. id,
  9005. diagnostics: [],
  9006. };
  9007. if (IS_NODE_ENV) {
  9008. try {
  9009. const fs = require('fs');
  9010. const path = require('path');
  9011. results.id = path.resolve(id);
  9012. // ensure we cleared out node's internal require() cache for this file
  9013. delete require.cache[results.id];
  9014. // let's override node's require for a second
  9015. // don't worry, we'll revert this when we're done
  9016. require.extensions['.ts'] = (module, fileName) => {
  9017. let sourceText = fs.readFileSync(fileName, 'utf8');
  9018. if (fileName.endsWith('.ts')) {
  9019. // looks like we've got a typed config file
  9020. // let's transpile it to .js quick
  9021. const tsResults = t.transpileModule(sourceText, {
  9022. fileName,
  9023. compilerOptions: {
  9024. module: t.ModuleKind.CommonJS,
  9025. moduleResolution: t.ModuleResolutionKind.NodeJs,
  9026. esModuleInterop: true,
  9027. target: t.ScriptTarget.ES2017,
  9028. allowJs: true,
  9029. },
  9030. });
  9031. sourceText = tsResults.outputText;
  9032. results.diagnostics.push(...tsResults.diagnostics.map(loadTypeScriptDiagnostic));
  9033. }
  9034. else {
  9035. // quick hack to turn a modern es module
  9036. // into and old school commonjs module
  9037. sourceText = sourceText.replace(/export\s+\w+\s+(\w+)/gm, 'exports.$1');
  9038. }
  9039. try {
  9040. module._compile(sourceText, fileName);
  9041. }
  9042. catch (e) {
  9043. catchError(results.diagnostics, e);
  9044. }
  9045. };
  9046. // let's do this!
  9047. results.module = require(results.id);
  9048. // all set, let's go ahead and reset the require back to the default
  9049. require.extensions['.ts'] = undefined;
  9050. }
  9051. catch (e) {
  9052. catchError(results.diagnostics, e);
  9053. }
  9054. }
  9055. return results;
  9056. };
  9057. const getPrerenderConfig = (diagnostics, prerenderConfigPath) => {
  9058. const prerenderConfig = {};
  9059. if (isString$1(prerenderConfigPath)) {
  9060. const results = nodeRequire(prerenderConfigPath);
  9061. diagnostics.push(...results.diagnostics);
  9062. if (results.module != null && typeof results.module === 'object') {
  9063. if (results.module.config != null && typeof results.module.config === 'object') {
  9064. Object.assign(prerenderConfig, results.module.config);
  9065. }
  9066. else {
  9067. Object.assign(prerenderConfig, results.module);
  9068. }
  9069. }
  9070. }
  9071. return prerenderConfig;
  9072. };
  9073. const prerenderWorker = async (sys, prerenderRequest) => {
  9074. // worker thread!
  9075. const results = {
  9076. diagnostics: [],
  9077. anchorUrls: [],
  9078. filePath: prerenderRequest.writeToFilePath,
  9079. };
  9080. try {
  9081. const prerenderCtx = getPrerenderCtx(prerenderRequest);
  9082. const url = new URL(prerenderRequest.url, prerenderRequest.devServerHostUrl);
  9083. const baseUrl = new URL(prerenderRequest.baseUrl);
  9084. const componentGraph = getComponentGraph(sys, prerenderCtx, prerenderRequest.componentGraphPath);
  9085. // webpack work-around/hack
  9086. const hydrateApp = requireFunc(prerenderRequest.hydrateAppFilePath);
  9087. if (prerenderCtx.templateHtml == null) {
  9088. // cache template html in this process
  9089. prerenderCtx.templateHtml = sys.readFileSync(prerenderRequest.templateId);
  9090. }
  9091. // create a new window by cloning the cached parsed window
  9092. const win = hydrateApp.createWindowFromHtml(prerenderCtx.templateHtml, prerenderRequest.templateId);
  9093. const doc = win.document;
  9094. win.location.href = url.href;
  9095. // patch this new window
  9096. if (isFunction(sys.applyPrerenderGlobalPatch)) {
  9097. sys.applyPrerenderGlobalPatch({
  9098. devServerHostUrl: prerenderRequest.devServerHostUrl,
  9099. window: win,
  9100. });
  9101. }
  9102. if (prerenderCtx.prerenderConfig == null) {
  9103. prerenderCtx.prerenderConfig = getPrerenderConfig(results.diagnostics, prerenderRequest.prerenderConfigPath);
  9104. }
  9105. const prerenderConfig = prerenderCtx.prerenderConfig;
  9106. const hydrateOpts = getHydrateOptions(prerenderConfig, url, results.diagnostics);
  9107. if (prerenderRequest.staticSite || hydrateOpts.staticDocument) {
  9108. hydrateOpts.addModulePreloads = false;
  9109. hydrateOpts.clientHydrateAnnotations = false;
  9110. }
  9111. if (typeof hydrateOpts.buildId !== 'string') {
  9112. hydrateOpts.buildId = prerenderRequest.buildId;
  9113. }
  9114. if (typeof prerenderConfig.beforeHydrate === 'function') {
  9115. try {
  9116. const rtn = prerenderConfig.beforeHydrate(doc, url);
  9117. if (isPromise(rtn)) {
  9118. await rtn;
  9119. }
  9120. }
  9121. catch (e) {
  9122. catchError(results.diagnostics, e);
  9123. }
  9124. }
  9125. // parse the html to dom nodes, hydrate the components, then
  9126. // serialize the hydrated dom nodes back to into html
  9127. const hydrateResults = (await hydrateApp.hydrateDocument(doc, hydrateOpts));
  9128. results.diagnostics.push(...hydrateResults.diagnostics);
  9129. if (typeof prerenderConfig.filePath === 'function') {
  9130. try {
  9131. const userWriteToFilePath = prerenderConfig.filePath(url, results.filePath);
  9132. if (typeof userWriteToFilePath === 'string') {
  9133. results.filePath = userWriteToFilePath;
  9134. }
  9135. }
  9136. catch (e) {
  9137. catchError(results.diagnostics, e);
  9138. }
  9139. }
  9140. if (hydrateOpts.staticDocument) {
  9141. removeStencilScripts(doc);
  9142. removeModulePreloads(doc);
  9143. }
  9144. else {
  9145. if (Array.isArray(hydrateOpts.staticComponents)) {
  9146. excludeStaticComponents(doc, hydrateOpts, hydrateResults);
  9147. }
  9148. if (hydrateOpts.addModulePreloads) {
  9149. if (!prerenderRequest.isDebug) {
  9150. addModulePreloads(doc, hydrateOpts, hydrateResults, componentGraph);
  9151. }
  9152. }
  9153. else {
  9154. // remove module preloads
  9155. removeModulePreloads(doc);
  9156. }
  9157. }
  9158. const docPromises = [];
  9159. if (hydrateOpts.minifyStyleElements && !prerenderRequest.isDebug) {
  9160. docPromises.push(minifyStyleElements(sys, prerenderRequest.appDir, doc, url, false));
  9161. }
  9162. if (hydrateOpts.minifyScriptElements && !prerenderRequest.isDebug) {
  9163. docPromises.push(minifyScriptElements(doc, false));
  9164. }
  9165. if (hydrateOpts.hashAssets && !prerenderRequest.isDebug) {
  9166. try {
  9167. docPromises.push(hashAssets(sys, prerenderCtx, results.diagnostics, hydrateOpts, prerenderRequest.appDir, doc, url));
  9168. }
  9169. catch (e) {
  9170. catchError(results.diagnostics, e);
  9171. }
  9172. }
  9173. if (docPromises.length > 0) {
  9174. await Promise.all(docPromises);
  9175. }
  9176. if (prerenderConfig.crawlUrls !== false) {
  9177. results.anchorUrls = crawlAnchorsForNextUrls(prerenderConfig, results.diagnostics, baseUrl, url, hydrateResults.anchors);
  9178. }
  9179. if (typeof prerenderConfig.afterHydrate === 'function') {
  9180. try {
  9181. const rtn = prerenderConfig.afterHydrate(doc, url, results);
  9182. if (isPromise(rtn)) {
  9183. await rtn;
  9184. }
  9185. }
  9186. catch (e) {
  9187. catchError(results.diagnostics, e);
  9188. }
  9189. }
  9190. if (typeof hydrateResults.httpStatus === 'number' && hydrateResults.httpStatus >= 400) {
  9191. try {
  9192. win.close();
  9193. }
  9194. catch (e) { }
  9195. return results;
  9196. }
  9197. const html = hydrateApp.serializeDocumentToString(doc, hydrateOpts);
  9198. prerenderEnsureDir(sys, prerenderCtx, results.filePath);
  9199. const writePromise = sys.writeFile(results.filePath, html);
  9200. if (Array.isArray(hydrateResults.staticData) && hydrateResults.staticData.length > 0) {
  9201. const pageDir = dirname(results.filePath);
  9202. await Promise.all(hydrateResults.staticData.map(async (s) => {
  9203. if (s.type === 'application/json') {
  9204. const data = {
  9205. [s.id]: JSON.parse(s.content),
  9206. components: hydrateResults.components.map((c) => c.tag),
  9207. };
  9208. const dataFileName = `${s.id}.json`;
  9209. const dataFilePath = join(pageDir, dataFileName);
  9210. await sys.writeFile(dataFilePath, JSON.stringify(data));
  9211. }
  9212. else {
  9213. const contentFileName = `${s.id}.txt`;
  9214. const contentFilePath = join(pageDir, contentFileName);
  9215. await sys.writeFile(contentFilePath, s.content);
  9216. }
  9217. }));
  9218. }
  9219. await writePromise;
  9220. try {
  9221. win.close();
  9222. }
  9223. catch (e) { }
  9224. }
  9225. catch (e) {
  9226. // ahh man! what happened!
  9227. catchError(results.diagnostics, e);
  9228. }
  9229. return results;
  9230. };
  9231. const getComponentGraph = (sys, prerenderCtx, componentGraphPath) => {
  9232. if (componentGraphPath == null) {
  9233. return undefined;
  9234. }
  9235. if (prerenderCtx.componentGraph == null) {
  9236. const componentGraphJson = JSON.parse(sys.readFileSync(componentGraphPath));
  9237. prerenderCtx.componentGraph = new Map(Object.entries(componentGraphJson));
  9238. }
  9239. return prerenderCtx.componentGraph;
  9240. };
  9241. const prerenderEnsureDir = (sys, prerenderCtx, p) => {
  9242. const allDirs = [];
  9243. while (true) {
  9244. p = normalizePath$1(sys.platformPath.dirname(p));
  9245. if (typeof p === 'string' && p.length > 0 && !isRootPath(p)) {
  9246. allDirs.push(p);
  9247. }
  9248. else {
  9249. break;
  9250. }
  9251. }
  9252. allDirs.reverse();
  9253. for (let i = 0; i < allDirs.length; i++) {
  9254. const dir = allDirs[i];
  9255. if (!prerenderCtx.ensuredDirs.has(dir)) {
  9256. prerenderCtx.ensuredDirs.add(dir);
  9257. sys.createDirSync(dir);
  9258. }
  9259. }
  9260. };
  9261. var chars$3 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
  9262. function encode$2(decoded) {
  9263. var sourceFileIndex = 0; // second field
  9264. var sourceCodeLine = 0; // third field
  9265. var sourceCodeColumn = 0; // fourth field
  9266. var nameIndex = 0; // fifth field
  9267. var mappings = '';
  9268. for (var i = 0; i < decoded.length; i++) {
  9269. var line = decoded[i];
  9270. if (i > 0)
  9271. mappings += ';';
  9272. if (line.length === 0)
  9273. continue;
  9274. var generatedCodeColumn = 0; // first field
  9275. var lineMappings = [];
  9276. for (var _i = 0, line_1 = line; _i < line_1.length; _i++) {
  9277. var segment = line_1[_i];
  9278. var segmentMappings = encodeInteger$2(segment[0] - generatedCodeColumn);
  9279. generatedCodeColumn = segment[0];
  9280. if (segment.length > 1) {
  9281. segmentMappings +=
  9282. encodeInteger$2(segment[1] - sourceFileIndex) +
  9283. encodeInteger$2(segment[2] - sourceCodeLine) +
  9284. encodeInteger$2(segment[3] - sourceCodeColumn);
  9285. sourceFileIndex = segment[1];
  9286. sourceCodeLine = segment[2];
  9287. sourceCodeColumn = segment[3];
  9288. }
  9289. if (segment.length === 5) {
  9290. segmentMappings += encodeInteger$2(segment[4] - nameIndex);
  9291. nameIndex = segment[4];
  9292. }
  9293. lineMappings.push(segmentMappings);
  9294. }
  9295. mappings += lineMappings.join(',');
  9296. }
  9297. return mappings;
  9298. }
  9299. function encodeInteger$2(num) {
  9300. var result = '';
  9301. num = num < 0 ? (-num << 1) | 1 : num << 1;
  9302. do {
  9303. var clamped = num & 31;
  9304. num >>>= 5;
  9305. if (num > 0) {
  9306. clamped |= 32;
  9307. }
  9308. result += chars$3[clamped];
  9309. } while (num > 0);
  9310. return result;
  9311. }
  9312. var BitSet$2 = function BitSet(arg) {
  9313. this.bits = arg instanceof BitSet ? arg.bits.slice() : [];
  9314. };
  9315. BitSet$2.prototype.add = function add (n) {
  9316. this.bits[n >> 5] |= 1 << (n & 31);
  9317. };
  9318. BitSet$2.prototype.has = function has (n) {
  9319. return !!(this.bits[n >> 5] & (1 << (n & 31)));
  9320. };
  9321. var Chunk$3 = function Chunk(start, end, content) {
  9322. this.start = start;
  9323. this.end = end;
  9324. this.original = content;
  9325. this.intro = '';
  9326. this.outro = '';
  9327. this.content = content;
  9328. this.storeName = false;
  9329. this.edited = false;
  9330. // we make these non-enumerable, for sanity while debugging
  9331. Object.defineProperties(this, {
  9332. previous: { writable: true, value: null },
  9333. next: { writable: true, value: null }
  9334. });
  9335. };
  9336. Chunk$3.prototype.appendLeft = function appendLeft (content) {
  9337. this.outro += content;
  9338. };
  9339. Chunk$3.prototype.appendRight = function appendRight (content) {
  9340. this.intro = this.intro + content;
  9341. };
  9342. Chunk$3.prototype.clone = function clone () {
  9343. var chunk = new Chunk$3(this.start, this.end, this.original);
  9344. chunk.intro = this.intro;
  9345. chunk.outro = this.outro;
  9346. chunk.content = this.content;
  9347. chunk.storeName = this.storeName;
  9348. chunk.edited = this.edited;
  9349. return chunk;
  9350. };
  9351. Chunk$3.prototype.contains = function contains (index) {
  9352. return this.start < index && index < this.end;
  9353. };
  9354. Chunk$3.prototype.eachNext = function eachNext (fn) {
  9355. var chunk = this;
  9356. while (chunk) {
  9357. fn(chunk);
  9358. chunk = chunk.next;
  9359. }
  9360. };
  9361. Chunk$3.prototype.eachPrevious = function eachPrevious (fn) {
  9362. var chunk = this;
  9363. while (chunk) {
  9364. fn(chunk);
  9365. chunk = chunk.previous;
  9366. }
  9367. };
  9368. Chunk$3.prototype.edit = function edit (content, storeName, contentOnly) {
  9369. this.content = content;
  9370. if (!contentOnly) {
  9371. this.intro = '';
  9372. this.outro = '';
  9373. }
  9374. this.storeName = storeName;
  9375. this.edited = true;
  9376. return this;
  9377. };
  9378. Chunk$3.prototype.prependLeft = function prependLeft (content) {
  9379. this.outro = content + this.outro;
  9380. };
  9381. Chunk$3.prototype.prependRight = function prependRight (content) {
  9382. this.intro = content + this.intro;
  9383. };
  9384. Chunk$3.prototype.split = function split (index) {
  9385. var sliceIndex = index - this.start;
  9386. var originalBefore = this.original.slice(0, sliceIndex);
  9387. var originalAfter = this.original.slice(sliceIndex);
  9388. this.original = originalBefore;
  9389. var newChunk = new Chunk$3(index, this.end, originalAfter);
  9390. newChunk.outro = this.outro;
  9391. this.outro = '';
  9392. this.end = index;
  9393. if (this.edited) {
  9394. // TODO is this block necessary?...
  9395. newChunk.edit('', false);
  9396. this.content = '';
  9397. } else {
  9398. this.content = originalBefore;
  9399. }
  9400. newChunk.next = this.next;
  9401. if (newChunk.next) { newChunk.next.previous = newChunk; }
  9402. newChunk.previous = this;
  9403. this.next = newChunk;
  9404. return newChunk;
  9405. };
  9406. Chunk$3.prototype.toString = function toString () {
  9407. return this.intro + this.content + this.outro;
  9408. };
  9409. Chunk$3.prototype.trimEnd = function trimEnd (rx) {
  9410. this.outro = this.outro.replace(rx, '');
  9411. if (this.outro.length) { return true; }
  9412. var trimmed = this.content.replace(rx, '');
  9413. if (trimmed.length) {
  9414. if (trimmed !== this.content) {
  9415. this.split(this.start + trimmed.length).edit('', undefined, true);
  9416. }
  9417. return true;
  9418. } else {
  9419. this.edit('', undefined, true);
  9420. this.intro = this.intro.replace(rx, '');
  9421. if (this.intro.length) { return true; }
  9422. }
  9423. };
  9424. Chunk$3.prototype.trimStart = function trimStart (rx) {
  9425. this.intro = this.intro.replace(rx, '');
  9426. if (this.intro.length) { return true; }
  9427. var trimmed = this.content.replace(rx, '');
  9428. if (trimmed.length) {
  9429. if (trimmed !== this.content) {
  9430. this.split(this.end - trimmed.length);
  9431. this.edit('', undefined, true);
  9432. }
  9433. return true;
  9434. } else {
  9435. this.edit('', undefined, true);
  9436. this.outro = this.outro.replace(rx, '');
  9437. if (this.outro.length) { return true; }
  9438. }
  9439. };
  9440. var btoa$3 = function () {
  9441. throw new Error('Unsupported environment: `window.btoa` or `Buffer` should be supported.');
  9442. };
  9443. if (typeof window !== 'undefined' && typeof window.btoa === 'function') {
  9444. btoa$3 = function (str) { return window.btoa(unescape(encodeURIComponent(str))); };
  9445. } else if (typeof Buffer === 'function') {
  9446. btoa$3 = function (str) { return Buffer.from(str, 'utf-8').toString('base64'); };
  9447. }
  9448. var SourceMap$2 = function SourceMap(properties) {
  9449. this.version = 3;
  9450. this.file = properties.file;
  9451. this.sources = properties.sources;
  9452. this.sourcesContent = properties.sourcesContent;
  9453. this.names = properties.names;
  9454. this.mappings = encode$2(properties.mappings);
  9455. };
  9456. SourceMap$2.prototype.toString = function toString () {
  9457. return JSON.stringify(this);
  9458. };
  9459. SourceMap$2.prototype.toUrl = function toUrl () {
  9460. return 'data:application/json;charset=utf-8;base64,' + btoa$3(this.toString());
  9461. };
  9462. function guessIndent$2(code) {
  9463. var lines = code.split('\n');
  9464. var tabbed = lines.filter(function (line) { return /^\t+/.test(line); });
  9465. var spaced = lines.filter(function (line) { return /^ {2,}/.test(line); });
  9466. if (tabbed.length === 0 && spaced.length === 0) {
  9467. return null;
  9468. }
  9469. // More lines tabbed than spaced? Assume tabs, and
  9470. // default to tabs in the case of a tie (or nothing
  9471. // to go on)
  9472. if (tabbed.length >= spaced.length) {
  9473. return '\t';
  9474. }
  9475. // Otherwise, we need to guess the multiple
  9476. var min = spaced.reduce(function (previous, current) {
  9477. var numSpaces = /^ +/.exec(current)[0].length;
  9478. return Math.min(numSpaces, previous);
  9479. }, Infinity);
  9480. return new Array(min + 1).join(' ');
  9481. }
  9482. function getRelativePath$2(from, to) {
  9483. var fromParts = from.split(/[/\\]/);
  9484. var toParts = to.split(/[/\\]/);
  9485. fromParts.pop(); // get dirname
  9486. while (fromParts[0] === toParts[0]) {
  9487. fromParts.shift();
  9488. toParts.shift();
  9489. }
  9490. if (fromParts.length) {
  9491. var i = fromParts.length;
  9492. while (i--) { fromParts[i] = '..'; }
  9493. }
  9494. return fromParts.concat(toParts).join('/');
  9495. }
  9496. var toString$3 = Object.prototype.toString;
  9497. function isObject$3(thing) {
  9498. return toString$3.call(thing) === '[object Object]';
  9499. }
  9500. function getLocator$3(source) {
  9501. var originalLines = source.split('\n');
  9502. var lineOffsets = [];
  9503. for (var i = 0, pos = 0; i < originalLines.length; i++) {
  9504. lineOffsets.push(pos);
  9505. pos += originalLines[i].length + 1;
  9506. }
  9507. return function locate(index) {
  9508. var i = 0;
  9509. var j = lineOffsets.length;
  9510. while (i < j) {
  9511. var m = (i + j) >> 1;
  9512. if (index < lineOffsets[m]) {
  9513. j = m;
  9514. } else {
  9515. i = m + 1;
  9516. }
  9517. }
  9518. var line = i - 1;
  9519. var column = index - lineOffsets[line];
  9520. return { line: line, column: column };
  9521. };
  9522. }
  9523. var Mappings$2 = function Mappings(hires) {
  9524. this.hires = hires;
  9525. this.generatedCodeLine = 0;
  9526. this.generatedCodeColumn = 0;
  9527. this.raw = [];
  9528. this.rawSegments = this.raw[this.generatedCodeLine] = [];
  9529. this.pending = null;
  9530. };
  9531. Mappings$2.prototype.addEdit = function addEdit (sourceIndex, content, loc, nameIndex) {
  9532. if (content.length) {
  9533. var segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column];
  9534. if (nameIndex >= 0) {
  9535. segment.push(nameIndex);
  9536. }
  9537. this.rawSegments.push(segment);
  9538. } else if (this.pending) {
  9539. this.rawSegments.push(this.pending);
  9540. }
  9541. this.advance(content);
  9542. this.pending = null;
  9543. };
  9544. Mappings$2.prototype.addUneditedChunk = function addUneditedChunk (sourceIndex, chunk, original, loc, sourcemapLocations) {
  9545. var originalCharIndex = chunk.start;
  9546. var first = true;
  9547. while (originalCharIndex < chunk.end) {
  9548. if (this.hires || first || sourcemapLocations.has(originalCharIndex)) {
  9549. this.rawSegments.push([this.generatedCodeColumn, sourceIndex, loc.line, loc.column]);
  9550. }
  9551. if (original[originalCharIndex] === '\n') {
  9552. loc.line += 1;
  9553. loc.column = 0;
  9554. this.generatedCodeLine += 1;
  9555. this.raw[this.generatedCodeLine] = this.rawSegments = [];
  9556. this.generatedCodeColumn = 0;
  9557. first = true;
  9558. } else {
  9559. loc.column += 1;
  9560. this.generatedCodeColumn += 1;
  9561. first = false;
  9562. }
  9563. originalCharIndex += 1;
  9564. }
  9565. this.pending = null;
  9566. };
  9567. Mappings$2.prototype.advance = function advance (str) {
  9568. if (!str) { return; }
  9569. var lines = str.split('\n');
  9570. if (lines.length > 1) {
  9571. for (var i = 0; i < lines.length - 1; i++) {
  9572. this.generatedCodeLine++;
  9573. this.raw[this.generatedCodeLine] = this.rawSegments = [];
  9574. }
  9575. this.generatedCodeColumn = 0;
  9576. }
  9577. this.generatedCodeColumn += lines[lines.length - 1].length;
  9578. };
  9579. var n$2 = '\n';
  9580. var warned$2 = {
  9581. insertLeft: false,
  9582. insertRight: false,
  9583. storeName: false
  9584. };
  9585. var MagicString$2 = function MagicString(string, options) {
  9586. if ( options === void 0 ) options = {};
  9587. var chunk = new Chunk$3(0, string.length, string);
  9588. Object.defineProperties(this, {
  9589. original: { writable: true, value: string },
  9590. outro: { writable: true, value: '' },
  9591. intro: { writable: true, value: '' },
  9592. firstChunk: { writable: true, value: chunk },
  9593. lastChunk: { writable: true, value: chunk },
  9594. lastSearchedChunk: { writable: true, value: chunk },
  9595. byStart: { writable: true, value: {} },
  9596. byEnd: { writable: true, value: {} },
  9597. filename: { writable: true, value: options.filename },
  9598. indentExclusionRanges: { writable: true, value: options.indentExclusionRanges },
  9599. sourcemapLocations: { writable: true, value: new BitSet$2() },
  9600. storedNames: { writable: true, value: {} },
  9601. indentStr: { writable: true, value: guessIndent$2(string) }
  9602. });
  9603. this.byStart[0] = chunk;
  9604. this.byEnd[string.length] = chunk;
  9605. };
  9606. MagicString$2.prototype.addSourcemapLocation = function addSourcemapLocation (char) {
  9607. this.sourcemapLocations.add(char);
  9608. };
  9609. MagicString$2.prototype.append = function append (content) {
  9610. if (typeof content !== 'string') { throw new TypeError('outro content must be a string'); }
  9611. this.outro += content;
  9612. return this;
  9613. };
  9614. MagicString$2.prototype.appendLeft = function appendLeft (index, content) {
  9615. if (typeof content !== 'string') { throw new TypeError('inserted content must be a string'); }
  9616. this._split(index);
  9617. var chunk = this.byEnd[index];
  9618. if (chunk) {
  9619. chunk.appendLeft(content);
  9620. } else {
  9621. this.intro += content;
  9622. }
  9623. return this;
  9624. };
  9625. MagicString$2.prototype.appendRight = function appendRight (index, content) {
  9626. if (typeof content !== 'string') { throw new TypeError('inserted content must be a string'); }
  9627. this._split(index);
  9628. var chunk = this.byStart[index];
  9629. if (chunk) {
  9630. chunk.appendRight(content);
  9631. } else {
  9632. this.outro += content;
  9633. }
  9634. return this;
  9635. };
  9636. MagicString$2.prototype.clone = function clone () {
  9637. var cloned = new MagicString$2(this.original, { filename: this.filename });
  9638. var originalChunk = this.firstChunk;
  9639. var clonedChunk = (cloned.firstChunk = cloned.lastSearchedChunk = originalChunk.clone());
  9640. while (originalChunk) {
  9641. cloned.byStart[clonedChunk.start] = clonedChunk;
  9642. cloned.byEnd[clonedChunk.end] = clonedChunk;
  9643. var nextOriginalChunk = originalChunk.next;
  9644. var nextClonedChunk = nextOriginalChunk && nextOriginalChunk.clone();
  9645. if (nextClonedChunk) {
  9646. clonedChunk.next = nextClonedChunk;
  9647. nextClonedChunk.previous = clonedChunk;
  9648. clonedChunk = nextClonedChunk;
  9649. }
  9650. originalChunk = nextOriginalChunk;
  9651. }
  9652. cloned.lastChunk = clonedChunk;
  9653. if (this.indentExclusionRanges) {
  9654. cloned.indentExclusionRanges = this.indentExclusionRanges.slice();
  9655. }
  9656. cloned.sourcemapLocations = new BitSet$2(this.sourcemapLocations);
  9657. cloned.intro = this.intro;
  9658. cloned.outro = this.outro;
  9659. return cloned;
  9660. };
  9661. MagicString$2.prototype.generateDecodedMap = function generateDecodedMap (options) {
  9662. var this$1 = this;
  9663. options = options || {};
  9664. var sourceIndex = 0;
  9665. var names = Object.keys(this.storedNames);
  9666. var mappings = new Mappings$2(options.hires);
  9667. var locate = getLocator$3(this.original);
  9668. if (this.intro) {
  9669. mappings.advance(this.intro);
  9670. }
  9671. this.firstChunk.eachNext(function (chunk) {
  9672. var loc = locate(chunk.start);
  9673. if (chunk.intro.length) { mappings.advance(chunk.intro); }
  9674. if (chunk.edited) {
  9675. mappings.addEdit(
  9676. sourceIndex,
  9677. chunk.content,
  9678. loc,
  9679. chunk.storeName ? names.indexOf(chunk.original) : -1
  9680. );
  9681. } else {
  9682. mappings.addUneditedChunk(sourceIndex, chunk, this$1.original, loc, this$1.sourcemapLocations);
  9683. }
  9684. if (chunk.outro.length) { mappings.advance(chunk.outro); }
  9685. });
  9686. return {
  9687. file: options.file ? options.file.split(/[/\\]/).pop() : null,
  9688. sources: [options.source ? getRelativePath$2(options.file || '', options.source) : null],
  9689. sourcesContent: options.includeContent ? [this.original] : [null],
  9690. names: names,
  9691. mappings: mappings.raw
  9692. };
  9693. };
  9694. MagicString$2.prototype.generateMap = function generateMap (options) {
  9695. return new SourceMap$2(this.generateDecodedMap(options));
  9696. };
  9697. MagicString$2.prototype.getIndentString = function getIndentString () {
  9698. return this.indentStr === null ? '\t' : this.indentStr;
  9699. };
  9700. MagicString$2.prototype.indent = function indent (indentStr, options) {
  9701. var pattern = /^[^\r\n]/gm;
  9702. if (isObject$3(indentStr)) {
  9703. options = indentStr;
  9704. indentStr = undefined;
  9705. }
  9706. indentStr = indentStr !== undefined ? indentStr : this.indentStr || '\t';
  9707. if (indentStr === '') { return this; } // noop
  9708. options = options || {};
  9709. // Process exclusion ranges
  9710. var isExcluded = {};
  9711. if (options.exclude) {
  9712. var exclusions =
  9713. typeof options.exclude[0] === 'number' ? [options.exclude] : options.exclude;
  9714. exclusions.forEach(function (exclusion) {
  9715. for (var i = exclusion[0]; i < exclusion[1]; i += 1) {
  9716. isExcluded[i] = true;
  9717. }
  9718. });
  9719. }
  9720. var shouldIndentNextCharacter = options.indentStart !== false;
  9721. var replacer = function (match) {
  9722. if (shouldIndentNextCharacter) { return ("" + indentStr + match); }
  9723. shouldIndentNextCharacter = true;
  9724. return match;
  9725. };
  9726. this.intro = this.intro.replace(pattern, replacer);
  9727. var charIndex = 0;
  9728. var chunk = this.firstChunk;
  9729. while (chunk) {
  9730. var end = chunk.end;
  9731. if (chunk.edited) {
  9732. if (!isExcluded[charIndex]) {
  9733. chunk.content = chunk.content.replace(pattern, replacer);
  9734. if (chunk.content.length) {
  9735. shouldIndentNextCharacter = chunk.content[chunk.content.length - 1] === '\n';
  9736. }
  9737. }
  9738. } else {
  9739. charIndex = chunk.start;
  9740. while (charIndex < end) {
  9741. if (!isExcluded[charIndex]) {
  9742. var char = this.original[charIndex];
  9743. if (char === '\n') {
  9744. shouldIndentNextCharacter = true;
  9745. } else if (char !== '\r' && shouldIndentNextCharacter) {
  9746. shouldIndentNextCharacter = false;
  9747. if (charIndex === chunk.start) {
  9748. chunk.prependRight(indentStr);
  9749. } else {
  9750. this._splitChunk(chunk, charIndex);
  9751. chunk = chunk.next;
  9752. chunk.prependRight(indentStr);
  9753. }
  9754. }
  9755. }
  9756. charIndex += 1;
  9757. }
  9758. }
  9759. charIndex = chunk.end;
  9760. chunk = chunk.next;
  9761. }
  9762. this.outro = this.outro.replace(pattern, replacer);
  9763. return this;
  9764. };
  9765. MagicString$2.prototype.insert = function insert () {
  9766. throw new Error('magicString.insert(...) is deprecated. Use prependRight(...) or appendLeft(...)');
  9767. };
  9768. MagicString$2.prototype.insertLeft = function insertLeft (index, content) {
  9769. if (!warned$2.insertLeft) {
  9770. console.warn('magicString.insertLeft(...) is deprecated. Use magicString.appendLeft(...) instead'); // eslint-disable-line no-console
  9771. warned$2.insertLeft = true;
  9772. }
  9773. return this.appendLeft(index, content);
  9774. };
  9775. MagicString$2.prototype.insertRight = function insertRight (index, content) {
  9776. if (!warned$2.insertRight) {
  9777. console.warn('magicString.insertRight(...) is deprecated. Use magicString.prependRight(...) instead'); // eslint-disable-line no-console
  9778. warned$2.insertRight = true;
  9779. }
  9780. return this.prependRight(index, content);
  9781. };
  9782. MagicString$2.prototype.move = function move (start, end, index) {
  9783. if (index >= start && index <= end) { throw new Error('Cannot move a selection inside itself'); }
  9784. this._split(start);
  9785. this._split(end);
  9786. this._split(index);
  9787. var first = this.byStart[start];
  9788. var last = this.byEnd[end];
  9789. var oldLeft = first.previous;
  9790. var oldRight = last.next;
  9791. var newRight = this.byStart[index];
  9792. if (!newRight && last === this.lastChunk) { return this; }
  9793. var newLeft = newRight ? newRight.previous : this.lastChunk;
  9794. if (oldLeft) { oldLeft.next = oldRight; }
  9795. if (oldRight) { oldRight.previous = oldLeft; }
  9796. if (newLeft) { newLeft.next = first; }
  9797. if (newRight) { newRight.previous = last; }
  9798. if (!first.previous) { this.firstChunk = last.next; }
  9799. if (!last.next) {
  9800. this.lastChunk = first.previous;
  9801. this.lastChunk.next = null;
  9802. }
  9803. first.previous = newLeft;
  9804. last.next = newRight || null;
  9805. if (!newLeft) { this.firstChunk = first; }
  9806. if (!newRight) { this.lastChunk = last; }
  9807. return this;
  9808. };
  9809. MagicString$2.prototype.overwrite = function overwrite (start, end, content, options) {
  9810. if (typeof content !== 'string') { throw new TypeError('replacement content must be a string'); }
  9811. while (start < 0) { start += this.original.length; }
  9812. while (end < 0) { end += this.original.length; }
  9813. if (end > this.original.length) { throw new Error('end is out of bounds'); }
  9814. if (start === end)
  9815. { throw new Error('Cannot overwrite a zero-length range – use appendLeft or prependRight instead'); }
  9816. this._split(start);
  9817. this._split(end);
  9818. if (options === true) {
  9819. if (!warned$2.storeName) {
  9820. console.warn('The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string'); // eslint-disable-line no-console
  9821. warned$2.storeName = true;
  9822. }
  9823. options = { storeName: true };
  9824. }
  9825. var storeName = options !== undefined ? options.storeName : false;
  9826. var contentOnly = options !== undefined ? options.contentOnly : false;
  9827. if (storeName) {
  9828. var original = this.original.slice(start, end);
  9829. this.storedNames[original] = true;
  9830. }
  9831. var first = this.byStart[start];
  9832. var last = this.byEnd[end];
  9833. if (first) {
  9834. if (end > first.end && first.next !== this.byStart[first.end]) {
  9835. throw new Error('Cannot overwrite across a split point');
  9836. }
  9837. first.edit(content, storeName, contentOnly);
  9838. if (first !== last) {
  9839. var chunk = first.next;
  9840. while (chunk !== last) {
  9841. chunk.edit('', false);
  9842. chunk = chunk.next;
  9843. }
  9844. chunk.edit('', false);
  9845. }
  9846. } else {
  9847. // must be inserting at the end
  9848. var newChunk = new Chunk$3(start, end, '').edit(content, storeName);
  9849. // TODO last chunk in the array may not be the last chunk, if it's moved...
  9850. last.next = newChunk;
  9851. newChunk.previous = last;
  9852. }
  9853. return this;
  9854. };
  9855. MagicString$2.prototype.prepend = function prepend (content) {
  9856. if (typeof content !== 'string') { throw new TypeError('outro content must be a string'); }
  9857. this.intro = content + this.intro;
  9858. return this;
  9859. };
  9860. MagicString$2.prototype.prependLeft = function prependLeft (index, content) {
  9861. if (typeof content !== 'string') { throw new TypeError('inserted content must be a string'); }
  9862. this._split(index);
  9863. var chunk = this.byEnd[index];
  9864. if (chunk) {
  9865. chunk.prependLeft(content);
  9866. } else {
  9867. this.intro = content + this.intro;
  9868. }
  9869. return this;
  9870. };
  9871. MagicString$2.prototype.prependRight = function prependRight (index, content) {
  9872. if (typeof content !== 'string') { throw new TypeError('inserted content must be a string'); }
  9873. this._split(index);
  9874. var chunk = this.byStart[index];
  9875. if (chunk) {
  9876. chunk.prependRight(content);
  9877. } else {
  9878. this.outro = content + this.outro;
  9879. }
  9880. return this;
  9881. };
  9882. MagicString$2.prototype.remove = function remove (start, end) {
  9883. while (start < 0) { start += this.original.length; }
  9884. while (end < 0) { end += this.original.length; }
  9885. if (start === end) { return this; }
  9886. if (start < 0 || end > this.original.length) { throw new Error('Character is out of bounds'); }
  9887. if (start > end) { throw new Error('end must be greater than start'); }
  9888. this._split(start);
  9889. this._split(end);
  9890. var chunk = this.byStart[start];
  9891. while (chunk) {
  9892. chunk.intro = '';
  9893. chunk.outro = '';
  9894. chunk.edit('');
  9895. chunk = end > chunk.end ? this.byStart[chunk.end] : null;
  9896. }
  9897. return this;
  9898. };
  9899. MagicString$2.prototype.lastChar = function lastChar () {
  9900. if (this.outro.length)
  9901. { return this.outro[this.outro.length - 1]; }
  9902. var chunk = this.lastChunk;
  9903. do {
  9904. if (chunk.outro.length)
  9905. { return chunk.outro[chunk.outro.length - 1]; }
  9906. if (chunk.content.length)
  9907. { return chunk.content[chunk.content.length - 1]; }
  9908. if (chunk.intro.length)
  9909. { return chunk.intro[chunk.intro.length - 1]; }
  9910. } while (chunk = chunk.previous);
  9911. if (this.intro.length)
  9912. { return this.intro[this.intro.length - 1]; }
  9913. return '';
  9914. };
  9915. MagicString$2.prototype.lastLine = function lastLine () {
  9916. var lineIndex = this.outro.lastIndexOf(n$2);
  9917. if (lineIndex !== -1)
  9918. { return this.outro.substr(lineIndex + 1); }
  9919. var lineStr = this.outro;
  9920. var chunk = this.lastChunk;
  9921. do {
  9922. if (chunk.outro.length > 0) {
  9923. lineIndex = chunk.outro.lastIndexOf(n$2);
  9924. if (lineIndex !== -1)
  9925. { return chunk.outro.substr(lineIndex + 1) + lineStr; }
  9926. lineStr = chunk.outro + lineStr;
  9927. }
  9928. if (chunk.content.length > 0) {
  9929. lineIndex = chunk.content.lastIndexOf(n$2);
  9930. if (lineIndex !== -1)
  9931. { return chunk.content.substr(lineIndex + 1) + lineStr; }
  9932. lineStr = chunk.content + lineStr;
  9933. }
  9934. if (chunk.intro.length > 0) {
  9935. lineIndex = chunk.intro.lastIndexOf(n$2);
  9936. if (lineIndex !== -1)
  9937. { return chunk.intro.substr(lineIndex + 1) + lineStr; }
  9938. lineStr = chunk.intro + lineStr;
  9939. }
  9940. } while (chunk = chunk.previous);
  9941. lineIndex = this.intro.lastIndexOf(n$2);
  9942. if (lineIndex !== -1)
  9943. { return this.intro.substr(lineIndex + 1) + lineStr; }
  9944. return this.intro + lineStr;
  9945. };
  9946. MagicString$2.prototype.slice = function slice (start, end) {
  9947. if ( start === void 0 ) start = 0;
  9948. if ( end === void 0 ) end = this.original.length;
  9949. while (start < 0) { start += this.original.length; }
  9950. while (end < 0) { end += this.original.length; }
  9951. var result = '';
  9952. // find start chunk
  9953. var chunk = this.firstChunk;
  9954. while (chunk && (chunk.start > start || chunk.end <= start)) {
  9955. // found end chunk before start
  9956. if (chunk.start < end && chunk.end >= end) {
  9957. return result;
  9958. }
  9959. chunk = chunk.next;
  9960. }
  9961. if (chunk && chunk.edited && chunk.start !== start)
  9962. { throw new Error(("Cannot use replaced character " + start + " as slice start anchor.")); }
  9963. var startChunk = chunk;
  9964. while (chunk) {
  9965. if (chunk.intro && (startChunk !== chunk || chunk.start === start)) {
  9966. result += chunk.intro;
  9967. }
  9968. var containsEnd = chunk.start < end && chunk.end >= end;
  9969. if (containsEnd && chunk.edited && chunk.end !== end)
  9970. { throw new Error(("Cannot use replaced character " + end + " as slice end anchor.")); }
  9971. var sliceStart = startChunk === chunk ? start - chunk.start : 0;
  9972. var sliceEnd = containsEnd ? chunk.content.length + end - chunk.end : chunk.content.length;
  9973. result += chunk.content.slice(sliceStart, sliceEnd);
  9974. if (chunk.outro && (!containsEnd || chunk.end === end)) {
  9975. result += chunk.outro;
  9976. }
  9977. if (containsEnd) {
  9978. break;
  9979. }
  9980. chunk = chunk.next;
  9981. }
  9982. return result;
  9983. };
  9984. // TODO deprecate this? not really very useful
  9985. MagicString$2.prototype.snip = function snip (start, end) {
  9986. var clone = this.clone();
  9987. clone.remove(0, start);
  9988. clone.remove(end, clone.original.length);
  9989. return clone;
  9990. };
  9991. MagicString$2.prototype._split = function _split (index) {
  9992. if (this.byStart[index] || this.byEnd[index]) { return; }
  9993. var chunk = this.lastSearchedChunk;
  9994. var searchForward = index > chunk.end;
  9995. while (chunk) {
  9996. if (chunk.contains(index)) { return this._splitChunk(chunk, index); }
  9997. chunk = searchForward ? this.byStart[chunk.end] : this.byEnd[chunk.start];
  9998. }
  9999. };
  10000. MagicString$2.prototype._splitChunk = function _splitChunk (chunk, index) {
  10001. if (chunk.edited && chunk.content.length) {
  10002. // zero-length edited chunks are a special case (overlapping replacements)
  10003. var loc = getLocator$3(this.original)(index);
  10004. throw new Error(
  10005. ("Cannot split a chunk that has already been edited (" + (loc.line) + ":" + (loc.column) + " – \"" + (chunk.original) + "\")")
  10006. );
  10007. }
  10008. var newChunk = chunk.split(index);
  10009. this.byEnd[index] = chunk;
  10010. this.byStart[index] = newChunk;
  10011. this.byEnd[newChunk.end] = newChunk;
  10012. if (chunk === this.lastChunk) { this.lastChunk = newChunk; }
  10013. this.lastSearchedChunk = chunk;
  10014. return true;
  10015. };
  10016. MagicString$2.prototype.toString = function toString () {
  10017. var str = this.intro;
  10018. var chunk = this.firstChunk;
  10019. while (chunk) {
  10020. str += chunk.toString();
  10021. chunk = chunk.next;
  10022. }
  10023. return str + this.outro;
  10024. };
  10025. MagicString$2.prototype.isEmpty = function isEmpty () {
  10026. var chunk = this.firstChunk;
  10027. do {
  10028. if (chunk.intro.length && chunk.intro.trim() ||
  10029. chunk.content.length && chunk.content.trim() ||
  10030. chunk.outro.length && chunk.outro.trim())
  10031. { return false; }
  10032. } while (chunk = chunk.next);
  10033. return true;
  10034. };
  10035. MagicString$2.prototype.length = function length () {
  10036. var chunk = this.firstChunk;
  10037. var length = 0;
  10038. do {
  10039. length += chunk.intro.length + chunk.content.length + chunk.outro.length;
  10040. } while (chunk = chunk.next);
  10041. return length;
  10042. };
  10043. MagicString$2.prototype.trimLines = function trimLines () {
  10044. return this.trim('[\\r\\n]');
  10045. };
  10046. MagicString$2.prototype.trim = function trim (charType) {
  10047. return this.trimStart(charType).trimEnd(charType);
  10048. };
  10049. MagicString$2.prototype.trimEndAborted = function trimEndAborted (charType) {
  10050. var rx = new RegExp((charType || '\\s') + '+$');
  10051. this.outro = this.outro.replace(rx, '');
  10052. if (this.outro.length) { return true; }
  10053. var chunk = this.lastChunk;
  10054. do {
  10055. var end = chunk.end;
  10056. var aborted = chunk.trimEnd(rx);
  10057. // if chunk was trimmed, we have a new lastChunk
  10058. if (chunk.end !== end) {
  10059. if (this.lastChunk === chunk) {
  10060. this.lastChunk = chunk.next;
  10061. }
  10062. this.byEnd[chunk.end] = chunk;
  10063. this.byStart[chunk.next.start] = chunk.next;
  10064. this.byEnd[chunk.next.end] = chunk.next;
  10065. }
  10066. if (aborted) { return true; }
  10067. chunk = chunk.previous;
  10068. } while (chunk);
  10069. return false;
  10070. };
  10071. MagicString$2.prototype.trimEnd = function trimEnd (charType) {
  10072. this.trimEndAborted(charType);
  10073. return this;
  10074. };
  10075. MagicString$2.prototype.trimStartAborted = function trimStartAborted (charType) {
  10076. var rx = new RegExp('^' + (charType || '\\s') + '+');
  10077. this.intro = this.intro.replace(rx, '');
  10078. if (this.intro.length) { return true; }
  10079. var chunk = this.firstChunk;
  10080. do {
  10081. var end = chunk.end;
  10082. var aborted = chunk.trimStart(rx);
  10083. if (chunk.end !== end) {
  10084. // special case...
  10085. if (chunk === this.lastChunk) { this.lastChunk = chunk.next; }
  10086. this.byEnd[chunk.end] = chunk;
  10087. this.byStart[chunk.next.start] = chunk.next;
  10088. this.byEnd[chunk.next.end] = chunk.next;
  10089. }
  10090. if (aborted) { return true; }
  10091. chunk = chunk.next;
  10092. } while (chunk);
  10093. return false;
  10094. };
  10095. MagicString$2.prototype.trimStart = function trimStart (charType) {
  10096. this.trimStartAborted(charType);
  10097. return this;
  10098. };
  10099. function parseStyleDocs(styleDocs, styleText) {
  10100. if (typeof styleText !== 'string') {
  10101. return;
  10102. }
  10103. let startIndex;
  10104. while ((startIndex = styleText.indexOf(CSS_DOC_START)) > -1) {
  10105. styleText = styleText.substring(startIndex + CSS_DOC_START.length);
  10106. const endIndex = styleText.indexOf(CSS_DOC_END);
  10107. if (endIndex === -1) {
  10108. break;
  10109. }
  10110. const comment = styleText.substring(0, endIndex);
  10111. parseCssComment(styleDocs, comment);
  10112. styleText = styleText.substring(endIndex + CSS_DOC_END.length);
  10113. }
  10114. }
  10115. function parseCssComment(styleDocs, comment) {
  10116. /**
  10117. * @prop --max-width: Max width of the alert
  10118. */
  10119. const lines = comment.split(/\r?\n/).map((line) => {
  10120. line = line.trim();
  10121. while (line.startsWith('*')) {
  10122. line = line.substring(1).trim();
  10123. }
  10124. return line;
  10125. });
  10126. comment = lines.join(' ').replace(/\t/g, ' ').trim();
  10127. while (comment.includes(' ')) {
  10128. comment = comment.replace(' ', ' ');
  10129. }
  10130. const docs = comment.split(CSS_PROP_ANNOTATION);
  10131. docs.forEach((d) => {
  10132. const doc = d.trim();
  10133. if (!doc.startsWith(`--`)) {
  10134. return;
  10135. }
  10136. const splt = doc.split(`:`);
  10137. const cssDoc = {
  10138. name: splt[0].trim(),
  10139. docs: (splt.shift() && splt.join(`:`)).trim(),
  10140. annotation: 'prop',
  10141. };
  10142. if (!styleDocs.some((c) => c.name === cssDoc.name && c.annotation === 'prop')) {
  10143. styleDocs.push(cssDoc);
  10144. }
  10145. });
  10146. return styleDocs;
  10147. }
  10148. const CSS_DOC_START = `/**`;
  10149. const CSS_DOC_END = `*/`;
  10150. const CSS_PROP_ANNOTATION = `@prop`;
  10151. /**
  10152. * @license
  10153. * Copyright Google Inc. All Rights Reserved.
  10154. *
  10155. * Use of this source code is governed by an MIT-style license that can be
  10156. * found in the LICENSE file at https://angular.io/license
  10157. *
  10158. * This file is a port of shadowCSS from webcomponents.js to TypeScript.
  10159. * https://github.com/webcomponents/webcomponentsjs/blob/4efecd7e0e/src/ShadowCSS/ShadowCSS.js
  10160. * https://github.com/angular/angular/blob/master/packages/compiler/src/shadow_css.ts
  10161. */
  10162. const safeSelector = (selector) => {
  10163. const placeholders = [];
  10164. let index = 0;
  10165. let content;
  10166. // Replaces attribute selectors with placeholders.
  10167. // The WS in [attr="va lue"] would otherwise be interpreted as a selector separator.
  10168. selector = selector.replace(/(\[[^\]]*\])/g, (_, keep) => {
  10169. const replaceBy = `__ph-${index}__`;
  10170. placeholders.push(keep);
  10171. index++;
  10172. return replaceBy;
  10173. });
  10174. // Replaces the expression in `:nth-child(2n + 1)` with a placeholder.
  10175. // WS and "+" would otherwise be interpreted as selector separators.
  10176. content = selector.replace(/(:nth-[-\w]+)(\([^)]+\))/g, (_, pseudo, exp) => {
  10177. const replaceBy = `__ph-${index}__`;
  10178. placeholders.push(exp);
  10179. index++;
  10180. return pseudo + replaceBy;
  10181. });
  10182. const ss = {
  10183. content,
  10184. placeholders,
  10185. };
  10186. return ss;
  10187. };
  10188. const restoreSafeSelector = (placeholders, content) => {
  10189. return content.replace(/__ph-(\d+)__/g, (_, index) => placeholders[+index]);
  10190. };
  10191. const _polyfillHost = '-shadowcsshost';
  10192. const _polyfillSlotted = '-shadowcssslotted';
  10193. // note: :host-context pre-processed to -shadowcsshostcontext.
  10194. const _polyfillHostContext = '-shadowcsscontext';
  10195. const _parenSuffix = ')(?:\\((' + '(?:\\([^)(]*\\)|[^)(]*)+?' + ')\\))?([^,{]*)';
  10196. const _cssColonHostRe = new RegExp('(' + _polyfillHost + _parenSuffix, 'gim');
  10197. const _cssColonHostContextRe = new RegExp('(' + _polyfillHostContext + _parenSuffix, 'gim');
  10198. const _cssColonSlottedRe = new RegExp('(' + _polyfillSlotted + _parenSuffix, 'gim');
  10199. const _polyfillHostNoCombinator = _polyfillHost + '-no-combinator';
  10200. const _polyfillHostNoCombinatorRe = /-shadowcsshost-no-combinator([^\s]*)/;
  10201. const _shadowDOMSelectorsRe = [/::shadow/g, /::content/g];
  10202. const _selectorReSuffix = '([>\\s~+[.,{:][\\s\\S]*)?$';
  10203. const _polyfillHostRe = /-shadowcsshost/gim;
  10204. const _colonHostRe = /:host/gim;
  10205. const _colonSlottedRe = /::slotted/gim;
  10206. const _colonHostContextRe = /:host-context/gim;
  10207. const _commentRe = /\/\*\s*[\s\S]*?\*\//g;
  10208. const stripComments = (input) => {
  10209. return input.replace(_commentRe, '');
  10210. };
  10211. const _commentWithHashRe = /\/\*\s*#\s*source(Mapping)?URL=[\s\S]+?\*\//g;
  10212. const extractCommentsWithHash = (input) => {
  10213. return input.match(_commentWithHashRe) || [];
  10214. };
  10215. const _ruleRe = /(\s*)([^;\{\}]+?)(\s*)((?:{%BLOCK%}?\s*;?)|(?:\s*;))/g;
  10216. const _curlyRe = /([{}])/g;
  10217. const _selectorPartsRe = /(^.*?[^\\])??((:+)(.*)|$)/;
  10218. const OPEN_CURLY = '{';
  10219. const CLOSE_CURLY = '}';
  10220. const BLOCK_PLACEHOLDER = '%BLOCK%';
  10221. const processRules = (input, ruleCallback) => {
  10222. const inputWithEscapedBlocks = escapeBlocks(input);
  10223. let nextBlockIndex = 0;
  10224. return inputWithEscapedBlocks.escapedString.replace(_ruleRe, (...m) => {
  10225. const selector = m[2];
  10226. let content = '';
  10227. let suffix = m[4];
  10228. let contentPrefix = '';
  10229. if (suffix && suffix.startsWith('{' + BLOCK_PLACEHOLDER)) {
  10230. content = inputWithEscapedBlocks.blocks[nextBlockIndex++];
  10231. suffix = suffix.substring(BLOCK_PLACEHOLDER.length + 1);
  10232. contentPrefix = '{';
  10233. }
  10234. const cssRule = {
  10235. selector,
  10236. content,
  10237. };
  10238. const rule = ruleCallback(cssRule);
  10239. return `${m[1]}${rule.selector}${m[3]}${contentPrefix}${rule.content}${suffix}`;
  10240. });
  10241. };
  10242. const escapeBlocks = (input) => {
  10243. const inputParts = input.split(_curlyRe);
  10244. const resultParts = [];
  10245. const escapedBlocks = [];
  10246. let bracketCount = 0;
  10247. let currentBlockParts = [];
  10248. for (let partIndex = 0; partIndex < inputParts.length; partIndex++) {
  10249. const part = inputParts[partIndex];
  10250. if (part === CLOSE_CURLY) {
  10251. bracketCount--;
  10252. }
  10253. if (bracketCount > 0) {
  10254. currentBlockParts.push(part);
  10255. }
  10256. else {
  10257. if (currentBlockParts.length > 0) {
  10258. escapedBlocks.push(currentBlockParts.join(''));
  10259. resultParts.push(BLOCK_PLACEHOLDER);
  10260. currentBlockParts = [];
  10261. }
  10262. resultParts.push(part);
  10263. }
  10264. if (part === OPEN_CURLY) {
  10265. bracketCount++;
  10266. }
  10267. }
  10268. if (currentBlockParts.length > 0) {
  10269. escapedBlocks.push(currentBlockParts.join(''));
  10270. resultParts.push(BLOCK_PLACEHOLDER);
  10271. }
  10272. const strEscapedBlocks = {
  10273. escapedString: resultParts.join(''),
  10274. blocks: escapedBlocks,
  10275. };
  10276. return strEscapedBlocks;
  10277. };
  10278. const insertPolyfillHostInCssText = (selector) => {
  10279. selector = selector
  10280. .replace(_colonHostContextRe, _polyfillHostContext)
  10281. .replace(_colonHostRe, _polyfillHost)
  10282. .replace(_colonSlottedRe, _polyfillSlotted);
  10283. return selector;
  10284. };
  10285. const convertColonRule = (cssText, regExp, partReplacer) => {
  10286. // m[1] = :host(-context), m[2] = contents of (), m[3] rest of rule
  10287. return cssText.replace(regExp, (...m) => {
  10288. if (m[2]) {
  10289. const parts = m[2].split(',');
  10290. const r = [];
  10291. for (let i = 0; i < parts.length; i++) {
  10292. const p = parts[i].trim();
  10293. if (!p)
  10294. break;
  10295. r.push(partReplacer(_polyfillHostNoCombinator, p, m[3]));
  10296. }
  10297. return r.join(',');
  10298. }
  10299. else {
  10300. return _polyfillHostNoCombinator + m[3];
  10301. }
  10302. });
  10303. };
  10304. const colonHostPartReplacer = (host, part, suffix) => {
  10305. return host + part.replace(_polyfillHost, '') + suffix;
  10306. };
  10307. const convertColonHost = (cssText) => {
  10308. return convertColonRule(cssText, _cssColonHostRe, colonHostPartReplacer);
  10309. };
  10310. const colonHostContextPartReplacer = (host, part, suffix) => {
  10311. if (part.indexOf(_polyfillHost) > -1) {
  10312. return colonHostPartReplacer(host, part, suffix);
  10313. }
  10314. else {
  10315. return host + part + suffix + ', ' + part + ' ' + host + suffix;
  10316. }
  10317. };
  10318. const convertColonSlotted = (cssText, slotScopeId) => {
  10319. const slotClass = '.' + slotScopeId + ' > ';
  10320. const selectors = [];
  10321. cssText = cssText.replace(_cssColonSlottedRe, (...m) => {
  10322. if (m[2]) {
  10323. const compound = m[2].trim();
  10324. const suffix = m[3];
  10325. const slottedSelector = slotClass + compound + suffix;
  10326. let prefixSelector = '';
  10327. for (let i = m[4] - 1; i >= 0; i--) {
  10328. const char = m[5][i];
  10329. if (char === '}' || char === ',') {
  10330. break;
  10331. }
  10332. prefixSelector = char + prefixSelector;
  10333. }
  10334. const orgSelector = prefixSelector + slottedSelector;
  10335. const addedSelector = `${prefixSelector.trimRight()}${slottedSelector.trim()}`;
  10336. if (orgSelector.trim() !== addedSelector.trim()) {
  10337. const updatedSelector = `${addedSelector}, ${orgSelector}`;
  10338. selectors.push({
  10339. orgSelector,
  10340. updatedSelector,
  10341. });
  10342. }
  10343. return slottedSelector;
  10344. }
  10345. else {
  10346. return _polyfillHostNoCombinator + m[3];
  10347. }
  10348. });
  10349. return {
  10350. selectors,
  10351. cssText,
  10352. };
  10353. };
  10354. const convertColonHostContext = (cssText) => {
  10355. return convertColonRule(cssText, _cssColonHostContextRe, colonHostContextPartReplacer);
  10356. };
  10357. const convertShadowDOMSelectors = (cssText) => {
  10358. return _shadowDOMSelectorsRe.reduce((result, pattern) => result.replace(pattern, ' '), cssText);
  10359. };
  10360. const makeScopeMatcher = (scopeSelector) => {
  10361. const lre = /\[/g;
  10362. const rre = /\]/g;
  10363. scopeSelector = scopeSelector.replace(lre, '\\[').replace(rre, '\\]');
  10364. return new RegExp('^(' + scopeSelector + ')' + _selectorReSuffix, 'm');
  10365. };
  10366. const selectorNeedsScoping = (selector, scopeSelector) => {
  10367. const re = makeScopeMatcher(scopeSelector);
  10368. return !re.test(selector);
  10369. };
  10370. const injectScopingSelector = (selector, scopingSelector) => {
  10371. return selector.replace(_selectorPartsRe, (_, before = '', _colonGroup, colon = '', after = '') => {
  10372. return before + scopingSelector + colon + after;
  10373. });
  10374. };
  10375. const applySimpleSelectorScope = (selector, scopeSelector, hostSelector) => {
  10376. // In Android browser, the lastIndex is not reset when the regex is used in String.replace()
  10377. _polyfillHostRe.lastIndex = 0;
  10378. if (_polyfillHostRe.test(selector)) {
  10379. const replaceBy = `.${hostSelector}`;
  10380. return selector
  10381. .replace(_polyfillHostNoCombinatorRe, (_, selector) => injectScopingSelector(selector, replaceBy))
  10382. .replace(_polyfillHostRe, replaceBy + ' ');
  10383. }
  10384. return scopeSelector + ' ' + selector;
  10385. };
  10386. const applyStrictSelectorScope = (selector, scopeSelector, hostSelector) => {
  10387. const isRe = /\[is=([^\]]*)\]/g;
  10388. scopeSelector = scopeSelector.replace(isRe, (_, ...parts) => parts[0]);
  10389. const className = '.' + scopeSelector;
  10390. const _scopeSelectorPart = (p) => {
  10391. let scopedP = p.trim();
  10392. if (!scopedP) {
  10393. return '';
  10394. }
  10395. if (p.indexOf(_polyfillHostNoCombinator) > -1) {
  10396. scopedP = applySimpleSelectorScope(p, scopeSelector, hostSelector);
  10397. }
  10398. else {
  10399. // remove :host since it should be unnecessary
  10400. const t = p.replace(_polyfillHostRe, '');
  10401. if (t.length > 0) {
  10402. scopedP = injectScopingSelector(t, className);
  10403. }
  10404. }
  10405. return scopedP;
  10406. };
  10407. const safeContent = safeSelector(selector);
  10408. selector = safeContent.content;
  10409. let scopedSelector = '';
  10410. let startIndex = 0;
  10411. let res;
  10412. const sep = /( |>|\+|~(?!=))\s*/g;
  10413. // If a selector appears before :host it should not be shimmed as it
  10414. // matches on ancestor elements and not on elements in the host's shadow
  10415. // `:host-context(div)` is transformed to
  10416. // `-shadowcsshost-no-combinatordiv, div -shadowcsshost-no-combinator`
  10417. // the `div` is not part of the component in the 2nd selectors and should not be scoped.
  10418. // Historically `component-tag:host` was matching the component so we also want to preserve
  10419. // this behavior to avoid breaking legacy apps (it should not match).
  10420. // The behavior should be:
  10421. // - `tag:host` -> `tag[h]` (this is to avoid breaking legacy apps, should not match anything)
  10422. // - `tag :host` -> `tag [h]` (`tag` is not scoped because it's considered part of a
  10423. // `:host-context(tag)`)
  10424. const hasHost = selector.indexOf(_polyfillHostNoCombinator) > -1;
  10425. // Only scope parts after the first `-shadowcsshost-no-combinator` when it is present
  10426. let shouldScope = !hasHost;
  10427. while ((res = sep.exec(selector)) !== null) {
  10428. const separator = res[1];
  10429. const part = selector.slice(startIndex, res.index).trim();
  10430. shouldScope = shouldScope || part.indexOf(_polyfillHostNoCombinator) > -1;
  10431. const scopedPart = shouldScope ? _scopeSelectorPart(part) : part;
  10432. scopedSelector += `${scopedPart} ${separator} `;
  10433. startIndex = sep.lastIndex;
  10434. }
  10435. const part = selector.substring(startIndex);
  10436. shouldScope = shouldScope || part.indexOf(_polyfillHostNoCombinator) > -1;
  10437. scopedSelector += shouldScope ? _scopeSelectorPart(part) : part;
  10438. // replace the placeholders with their original values
  10439. return restoreSafeSelector(safeContent.placeholders, scopedSelector);
  10440. };
  10441. const scopeSelector = (selector, scopeSelectorText, hostSelector, slotSelector) => {
  10442. return selector
  10443. .split(',')
  10444. .map((shallowPart) => {
  10445. if (slotSelector && shallowPart.indexOf('.' + slotSelector) > -1) {
  10446. return shallowPart.trim();
  10447. }
  10448. if (selectorNeedsScoping(shallowPart, scopeSelectorText)) {
  10449. return applyStrictSelectorScope(shallowPart, scopeSelectorText, hostSelector).trim();
  10450. }
  10451. else {
  10452. return shallowPart.trim();
  10453. }
  10454. })
  10455. .join(', ');
  10456. };
  10457. const scopeSelectors = (cssText, scopeSelectorText, hostSelector, slotSelector, commentOriginalSelector) => {
  10458. return processRules(cssText, (rule) => {
  10459. let selector = rule.selector;
  10460. let content = rule.content;
  10461. if (rule.selector[0] !== '@') {
  10462. selector = scopeSelector(rule.selector, scopeSelectorText, hostSelector, slotSelector);
  10463. }
  10464. else if (rule.selector.startsWith('@media') ||
  10465. rule.selector.startsWith('@supports') ||
  10466. rule.selector.startsWith('@page') ||
  10467. rule.selector.startsWith('@document')) {
  10468. content = scopeSelectors(rule.content, scopeSelectorText, hostSelector, slotSelector);
  10469. }
  10470. const cssRule = {
  10471. selector: selector.replace(/\s{2,}/g, ' ').trim(),
  10472. content,
  10473. };
  10474. return cssRule;
  10475. });
  10476. };
  10477. const scopeCssText = (cssText, scopeId, hostScopeId, slotScopeId, commentOriginalSelector) => {
  10478. cssText = insertPolyfillHostInCssText(cssText);
  10479. cssText = convertColonHost(cssText);
  10480. cssText = convertColonHostContext(cssText);
  10481. const slotted = convertColonSlotted(cssText, slotScopeId);
  10482. cssText = slotted.cssText;
  10483. cssText = convertShadowDOMSelectors(cssText);
  10484. if (scopeId) {
  10485. cssText = scopeSelectors(cssText, scopeId, hostScopeId, slotScopeId);
  10486. }
  10487. cssText = cssText.replace(/-shadowcsshost-no-combinator/g, `.${hostScopeId}`);
  10488. cssText = cssText.replace(/>\s*\*\s+([^{, ]+)/gm, ' $1 ');
  10489. return {
  10490. cssText: cssText.trim(),
  10491. slottedSelectors: slotted.selectors,
  10492. };
  10493. };
  10494. const scopeCss = (cssText, scopeId, commentOriginalSelector) => {
  10495. const hostScopeId = scopeId + '-h';
  10496. const slotScopeId = scopeId + '-s';
  10497. const commentsWithHash = extractCommentsWithHash(cssText);
  10498. cssText = stripComments(cssText);
  10499. const orgSelectors = [];
  10500. if (commentOriginalSelector) {
  10501. const processCommentedSelector = (rule) => {
  10502. const placeholder = `/*!@___${orgSelectors.length}___*/`;
  10503. const comment = `/*!@${rule.selector}*/`;
  10504. orgSelectors.push({ placeholder, comment });
  10505. rule.selector = placeholder + rule.selector;
  10506. return rule;
  10507. };
  10508. cssText = processRules(cssText, (rule) => {
  10509. if (rule.selector[0] !== '@') {
  10510. return processCommentedSelector(rule);
  10511. }
  10512. else if (rule.selector.startsWith('@media') ||
  10513. rule.selector.startsWith('@supports') ||
  10514. rule.selector.startsWith('@page') ||
  10515. rule.selector.startsWith('@document')) {
  10516. rule.content = processRules(rule.content, processCommentedSelector);
  10517. return rule;
  10518. }
  10519. return rule;
  10520. });
  10521. }
  10522. const scoped = scopeCssText(cssText, scopeId, hostScopeId, slotScopeId);
  10523. cssText = [scoped.cssText, ...commentsWithHash].join('\n');
  10524. if (commentOriginalSelector) {
  10525. orgSelectors.forEach(({ placeholder, comment }) => {
  10526. cssText = cssText.replace(placeholder, comment);
  10527. });
  10528. }
  10529. scoped.slottedSelectors.forEach((slottedSelector) => {
  10530. cssText = cssText.replace(slottedSelector.orgSelector, slottedSelector.updatedSelector);
  10531. });
  10532. return cssText;
  10533. };
  10534. const serializeImportPath = (data, styleImportData) => {
  10535. let p = data.importeePath;
  10536. if (isString$1(p)) {
  10537. if (isString$1(data.importerPath) && isAbsolute$1(data.importeePath)) {
  10538. p = relative$1(dirname(data.importerPath), data.importeePath);
  10539. }
  10540. p = normalizePath$1(p);
  10541. if (!p.startsWith('.')) {
  10542. p = './' + p;
  10543. }
  10544. if (styleImportData === 'queryparams' || styleImportData === undefined) {
  10545. const paramData = {};
  10546. if (isString$1(data.tag)) {
  10547. paramData.tag = data.tag;
  10548. }
  10549. if (isString$1(data.mode) && data.mode !== DEFAULT_STYLE_MODE) {
  10550. paramData.mode = data.mode;
  10551. }
  10552. if (isString$1(data.encapsulation) && data.encapsulation !== 'none') {
  10553. paramData.encapsulation = data.encapsulation;
  10554. }
  10555. const paramEntries = Object.entries(paramData);
  10556. if (paramEntries.length > 0) {
  10557. const params = new URLSearchParams(paramEntries);
  10558. p += '?' + params.toString();
  10559. }
  10560. }
  10561. }
  10562. return p;
  10563. };
  10564. const parseImportPath = (importPath) => {
  10565. const parsedPath = {
  10566. importPath,
  10567. basename: null,
  10568. ext: null,
  10569. data: null,
  10570. };
  10571. if (isString$1(importPath)) {
  10572. const pathParts = importPath.split('?');
  10573. parsedPath.basename = basename(pathParts[0].trim());
  10574. const extParts = parsedPath.basename.toLowerCase().split('.');
  10575. if (extParts.length > 1) {
  10576. parsedPath.ext = extParts[extParts.length - 1];
  10577. if (parsedPath.ext === 'ts' && extParts[extParts.length - 2] === 'd') {
  10578. parsedPath.ext = 'd.ts';
  10579. }
  10580. }
  10581. if (pathParts.length > 1) {
  10582. const params = pathParts[1];
  10583. const urlParams = new URLSearchParams(params);
  10584. const tag = urlParams.get('tag');
  10585. if (tag != null) {
  10586. parsedPath.data = {
  10587. tag,
  10588. encapsulation: urlParams.get('encapsulation') || 'none',
  10589. mode: urlParams.get('mode') || DEFAULT_STYLE_MODE,
  10590. };
  10591. }
  10592. }
  10593. else if (parsedPath.basename.endsWith('.css')) {
  10594. parsedPath.data = {
  10595. encapsulation: 'none',
  10596. };
  10597. }
  10598. }
  10599. return parsedPath;
  10600. };
  10601. const stripCssComments = (input) => {
  10602. let isInsideString = null;
  10603. let currentCharacter = '';
  10604. let returnValue = '';
  10605. for (let i = 0; i < input.length; i++) {
  10606. currentCharacter = input[i];
  10607. if (input[i - 1] !== '\\') {
  10608. if (currentCharacter === '"' || currentCharacter === "'") {
  10609. if (isInsideString === currentCharacter) {
  10610. isInsideString = null;
  10611. }
  10612. else if (!isInsideString) {
  10613. isInsideString = currentCharacter;
  10614. }
  10615. }
  10616. }
  10617. // Find beginning of /* type comment
  10618. if (!isInsideString && currentCharacter === '/' && input[i + 1] === '*') {
  10619. // Ignore important comment when configured to preserve comments using important syntax: /*!
  10620. let j = i + 2;
  10621. // Iterate over comment
  10622. for (; j < input.length; j++) {
  10623. // Find end of comment
  10624. if (input[j] === '*' && input[j + 1] === '/') {
  10625. break;
  10626. }
  10627. }
  10628. // Resume iteration over CSS string from the end of the comment
  10629. i = j + 1;
  10630. continue;
  10631. }
  10632. returnValue += currentCharacter;
  10633. }
  10634. return returnValue;
  10635. };
  10636. const transformCssToEsm = async (input) => {
  10637. const results = transformCssToEsmModule(input);
  10638. const optimizeResults = await optimizeCss$1({
  10639. autoprefixer: input.autoprefixer,
  10640. input: results.styleText,
  10641. filePath: input.file,
  10642. minify: true,
  10643. sourceMap: input.sourceMap,
  10644. });
  10645. results.diagnostics.push(...optimizeResults.diagnostics);
  10646. if (hasError(optimizeResults.diagnostics)) {
  10647. return results;
  10648. }
  10649. results.styleText = optimizeResults.output;
  10650. return generateTransformCssToEsm(input, results);
  10651. };
  10652. const transformCssToEsmSync = (input) => {
  10653. const results = transformCssToEsmModule(input);
  10654. return generateTransformCssToEsm(input, results);
  10655. };
  10656. const transformCssToEsmModule = (input) => {
  10657. const results = {
  10658. styleText: input.input,
  10659. output: '',
  10660. map: null,
  10661. diagnostics: [],
  10662. imports: [],
  10663. defaultVarName: createCssVarName(input.file, input.mode),
  10664. styleDocs: [],
  10665. };
  10666. if (input.docs) {
  10667. parseStyleDocs(results.styleDocs, input.input);
  10668. }
  10669. try {
  10670. const varNames = new Set([results.defaultVarName]);
  10671. if (isString$1(input.tag)) {
  10672. if (input.encapsulation === 'scoped' || (input.encapsulation === 'shadow' && input.commentOriginalSelector)) {
  10673. const scopeId = getScopeId(input.tag, input.mode);
  10674. results.styleText = scopeCss(results.styleText, scopeId, input.commentOriginalSelector);
  10675. }
  10676. }
  10677. const cssImports = getCssToEsmImports(varNames, results.styleText, input.file, input.mode);
  10678. cssImports.forEach((cssImport) => {
  10679. // remove the original css @imports
  10680. results.styleText = results.styleText.replace(cssImport.srcImportText, '');
  10681. const importPath = serializeImportPath({
  10682. importeePath: cssImport.filePath,
  10683. importerPath: input.file,
  10684. tag: input.tag,
  10685. encapsulation: input.encapsulation,
  10686. mode: input.mode,
  10687. }, input.styleImportData);
  10688. // str.append(`import ${cssImport.varName} from '${importPath}';\n`);
  10689. results.imports.push({
  10690. varName: cssImport.varName,
  10691. importPath,
  10692. });
  10693. });
  10694. }
  10695. catch (e) {
  10696. catchError(results.diagnostics, e);
  10697. }
  10698. return results;
  10699. };
  10700. const generateTransformCssToEsm = (input, results) => {
  10701. const s = new MagicString$2('');
  10702. if (input.module === 'cjs') {
  10703. // CommonJS
  10704. results.imports.forEach((cssImport) => {
  10705. s.append(`const ${cssImport.varName} = require('${cssImport.importPath}');\n`);
  10706. });
  10707. s.append(`const ${results.defaultVarName} = `);
  10708. results.imports.forEach((cssImport) => {
  10709. s.append(`${cssImport.varName} + `);
  10710. });
  10711. s.append(`${JSON.stringify(results.styleText)};\n`);
  10712. s.append(`module.exports = ${results.defaultVarName};`);
  10713. }
  10714. else {
  10715. // ESM
  10716. results.imports.forEach((cssImport) => {
  10717. s.append(`import ${cssImport.varName} from '${cssImport.importPath}';\n`);
  10718. });
  10719. s.append(`const ${results.defaultVarName} = `);
  10720. results.imports.forEach((cssImport) => {
  10721. s.append(`${cssImport.varName} + `);
  10722. });
  10723. s.append(`${JSON.stringify(results.styleText)};\n`);
  10724. s.append(`export default ${results.defaultVarName};`);
  10725. }
  10726. results.output = s.toString();
  10727. return results;
  10728. };
  10729. const getCssToEsmImports = (varNames, cssText, filePath, modeName) => {
  10730. const cssImports = [];
  10731. if (!cssText.includes('@import')) {
  10732. // no @import at all, so don't bother
  10733. return cssImports;
  10734. }
  10735. cssText = stripCssComments(cssText);
  10736. const dir = path$5.dirname(filePath);
  10737. let r;
  10738. while ((r = CSS_IMPORT_RE.exec(cssText))) {
  10739. const cssImportData = {
  10740. srcImportText: r[0],
  10741. url: r[4].replace(/[\"\'\)]/g, ''),
  10742. filePath: null,
  10743. varName: null,
  10744. };
  10745. if (!isLocalCssImport$1(cssImportData.srcImportText)) {
  10746. // do nothing for @import url(http://external.css)
  10747. continue;
  10748. }
  10749. else if (isCssNodeModule$1(cssImportData.url)) {
  10750. // do not resolve this path cuz it starts with node resolve id ~
  10751. continue;
  10752. }
  10753. else if (path$5.isAbsolute(cssImportData.url)) {
  10754. // absolute path already
  10755. cssImportData.filePath = normalizePath$1(cssImportData.url);
  10756. }
  10757. else {
  10758. // relative path
  10759. cssImportData.filePath = normalizePath$1(path$5.resolve(dir, cssImportData.url));
  10760. }
  10761. cssImportData.varName = createCssVarName(cssImportData.filePath, modeName);
  10762. if (varNames.has(cssImportData.varName)) {
  10763. cssImportData.varName += varNames.size;
  10764. }
  10765. varNames.add(cssImportData.varName);
  10766. cssImports.push(cssImportData);
  10767. }
  10768. return cssImports;
  10769. };
  10770. const CSS_IMPORT_RE = /(@import)\s+(url\()?\s?(.*?)\s?\)?([^;]*);?/gi;
  10771. const isCssNodeModule$1 = (url) => {
  10772. return url.startsWith('~');
  10773. };
  10774. const isLocalCssImport$1 = (srcImport) => {
  10775. srcImport = srcImport.toLowerCase();
  10776. if (srcImport.includes('url(')) {
  10777. srcImport = srcImport.replace(/\"/g, '');
  10778. srcImport = srcImport.replace(/\'/g, '');
  10779. srcImport = srcImport.replace(/\s/g, '');
  10780. if (srcImport.includes('url(http') || srcImport.includes('url(//')) {
  10781. return false;
  10782. }
  10783. }
  10784. return true;
  10785. };
  10786. const createCssVarName = (filePath, modeName) => {
  10787. let varName = path$5.basename(filePath);
  10788. if (modeName && modeName !== DEFAULT_STYLE_MODE && !varName.includes(modeName)) {
  10789. varName = modeName + '-' + varName;
  10790. }
  10791. return createJsVarName(varName);
  10792. };
  10793. const createWorkerContext = (sys) => ({
  10794. transformCssToEsm,
  10795. prepareModule,
  10796. optimizeCss: optimizeCss$1,
  10797. prerenderWorker: (prerenderRequest) => prerenderWorker(sys, prerenderRequest),
  10798. });
  10799. const createWorkerMessageHandler = (sys) => {
  10800. const workerCtx = createWorkerContext(sys);
  10801. return (msgToWorker) => {
  10802. const fnName = msgToWorker.args[0];
  10803. const fnArgs = msgToWorker.args.slice(1);
  10804. const fn = workerCtx[fnName];
  10805. if (typeof fn === 'function') {
  10806. return fn.apply(null, fnArgs);
  10807. }
  10808. };
  10809. };
  10810. const initWebWorkerThread = (msgHandler) => {
  10811. let isQueued = false;
  10812. const tick = Promise.resolve();
  10813. const msgsFromWorkerQueue = [];
  10814. const drainMsgQueueFromWorkerToMain = () => {
  10815. isQueued = false;
  10816. self.postMessage(msgsFromWorkerQueue);
  10817. msgsFromWorkerQueue.length = 0;
  10818. };
  10819. const queueMsgFromWorkerToMain = (msgFromWorkerToMain) => {
  10820. msgsFromWorkerQueue.push(msgFromWorkerToMain);
  10821. if (!isQueued) {
  10822. isQueued = true;
  10823. tick.then(drainMsgQueueFromWorkerToMain);
  10824. }
  10825. };
  10826. const error = (stencilMsgId, err) => {
  10827. const errMsgFromWorkerToMain = {
  10828. stencilId: stencilMsgId,
  10829. stencilRtnValue: null,
  10830. stencilRtnError: 'Error',
  10831. };
  10832. if (isString$1(err)) {
  10833. errMsgFromWorkerToMain.stencilRtnError += ': ' + err;
  10834. }
  10835. else if (err) {
  10836. if (err.stack) {
  10837. errMsgFromWorkerToMain.stencilRtnError += ': ' + err.stack;
  10838. }
  10839. else if (err.message) {
  10840. errMsgFromWorkerToMain.stencilRtnError += ': ' + err.message;
  10841. }
  10842. }
  10843. queueMsgFromWorkerToMain(errMsgFromWorkerToMain);
  10844. };
  10845. const receiveMsgFromMainToWorker = async (msgToWorker) => {
  10846. if (msgToWorker && isNumber$1(msgToWorker.stencilId)) {
  10847. try {
  10848. // run the handler to get the data
  10849. const msgFromWorkerToMain = {
  10850. stencilId: msgToWorker.stencilId,
  10851. stencilRtnValue: await msgHandler(msgToWorker),
  10852. stencilRtnError: null,
  10853. };
  10854. queueMsgFromWorkerToMain(msgFromWorkerToMain);
  10855. }
  10856. catch (e) {
  10857. // error occurred while running the task
  10858. error(msgToWorker.stencilId, e);
  10859. }
  10860. }
  10861. };
  10862. self.onmessage = (ev) => {
  10863. // message from the main thread
  10864. const msgsFromMainToWorker = ev.data;
  10865. if (Array.isArray(msgsFromMainToWorker)) {
  10866. for (const msgFromMainToWorker of msgsFromMainToWorker) {
  10867. receiveMsgFromMainToWorker(msgFromMainToWorker);
  10868. }
  10869. }
  10870. };
  10871. self.onerror = (e) => {
  10872. // uncaught error occurred on the worker thread
  10873. error(-1, e);
  10874. };
  10875. };
  10876. class Cache {
  10877. constructor(config, cacheFs) {
  10878. this.config = config;
  10879. this.cacheFs = cacheFs;
  10880. this.failed = 0;
  10881. this.skip = false;
  10882. this.sys = config.sys;
  10883. this.logger = config.logger;
  10884. }
  10885. async initCacheDir() {
  10886. if (this.config._isTesting || !this.config.cacheDir) {
  10887. return;
  10888. }
  10889. if (!this.config.enableCache || !this.cacheFs) {
  10890. this.config.logger.info(`cache optimizations disabled`);
  10891. this.clearDiskCache();
  10892. return;
  10893. }
  10894. this.config.logger.debug(`cache enabled, cacheDir: ${this.config.cacheDir}`);
  10895. try {
  10896. const readmeFilePath = join(this.config.cacheDir, '_README.log');
  10897. await this.cacheFs.writeFile(readmeFilePath, CACHE_DIR_README);
  10898. }
  10899. catch (e) {
  10900. this.logger.error(`Cache, initCacheDir: ${e}`);
  10901. this.config.enableCache = false;
  10902. }
  10903. }
  10904. async get(key) {
  10905. if (!this.config.enableCache || this.skip) {
  10906. return null;
  10907. }
  10908. if (this.failed >= MAX_FAILED) {
  10909. if (!this.skip) {
  10910. this.skip = true;
  10911. this.logger.debug(`cache had ${this.failed} failed ops, skip disk ops for remander of build`);
  10912. }
  10913. return null;
  10914. }
  10915. let result;
  10916. try {
  10917. result = await this.cacheFs.readFile(this.getCacheFilePath(key));
  10918. this.failed = 0;
  10919. this.skip = false;
  10920. }
  10921. catch (e) {
  10922. this.failed++;
  10923. result = null;
  10924. }
  10925. return result;
  10926. }
  10927. async put(key, value) {
  10928. if (!this.config.enableCache) {
  10929. return false;
  10930. }
  10931. let result;
  10932. try {
  10933. await this.cacheFs.writeFile(this.getCacheFilePath(key), value);
  10934. result = true;
  10935. }
  10936. catch (e) {
  10937. this.failed++;
  10938. result = false;
  10939. }
  10940. return result;
  10941. }
  10942. async has(key) {
  10943. const val = await this.get(key);
  10944. return typeof val === 'string';
  10945. }
  10946. async createKey(domain, ...args) {
  10947. if (!this.config.enableCache) {
  10948. return domain + Math.random() * 9999999;
  10949. }
  10950. const hash = await this.sys.generateContentHash(JSON.stringify(args), 32);
  10951. return domain + '_' + hash;
  10952. }
  10953. async commit() {
  10954. if (this.config.enableCache) {
  10955. this.skip = false;
  10956. this.failed = 0;
  10957. await this.cacheFs.commit();
  10958. await this.clearExpiredCache();
  10959. }
  10960. }
  10961. clear() {
  10962. if (this.cacheFs != null) {
  10963. this.cacheFs.clearCache();
  10964. }
  10965. }
  10966. async clearExpiredCache() {
  10967. if (this.cacheFs == null || this.sys.cacheStorage == null) {
  10968. return;
  10969. }
  10970. const now = Date.now();
  10971. const lastClear = (await this.sys.cacheStorage.get(EXP_STORAGE_KEY));
  10972. if (lastClear != null) {
  10973. const diff = now - lastClear;
  10974. if (diff < ONE_DAY) {
  10975. return;
  10976. }
  10977. const fs = this.cacheFs.sys;
  10978. const cachedFileNames = await fs.readDir(this.config.cacheDir);
  10979. const cachedFilePaths = cachedFileNames.map((f) => join(this.config.cacheDir, f));
  10980. let totalCleared = 0;
  10981. const promises = cachedFilePaths.map(async (filePath) => {
  10982. const stat = await fs.stat(filePath);
  10983. const lastModified = stat.mtimeMs;
  10984. const diff = now - lastModified;
  10985. if (diff > ONE_WEEK) {
  10986. await fs.removeFile(filePath);
  10987. totalCleared++;
  10988. }
  10989. });
  10990. await Promise.all(promises);
  10991. this.logger.debug(`clearExpiredCache, cachedFileNames: ${cachedFileNames.length}, totalCleared: ${totalCleared}`);
  10992. }
  10993. this.logger.debug(`clearExpiredCache, set last clear`);
  10994. await this.sys.cacheStorage.set(EXP_STORAGE_KEY, now);
  10995. }
  10996. async clearDiskCache() {
  10997. if (this.cacheFs != null) {
  10998. const hasAccess = await this.cacheFs.access(this.config.cacheDir);
  10999. if (hasAccess) {
  11000. await this.cacheFs.remove(this.config.cacheDir);
  11001. await this.cacheFs.commit();
  11002. }
  11003. }
  11004. }
  11005. getCacheFilePath(key) {
  11006. return join(this.config.cacheDir, key) + '.log';
  11007. }
  11008. getMemoryStats() {
  11009. if (this.cacheFs != null) {
  11010. return this.cacheFs.getMemoryStats();
  11011. }
  11012. return null;
  11013. }
  11014. }
  11015. const MAX_FAILED = 100;
  11016. const ONE_DAY = 1000 * 60 * 60 * 24;
  11017. const ONE_WEEK = ONE_DAY * 7;
  11018. const EXP_STORAGE_KEY = `last_clear_expired_cache`;
  11019. const CACHE_DIR_README = `# Stencil Cache Directory
  11020. This directory contains files which the compiler has
  11021. cached for faster builds. To disable caching, please set
  11022. "enableCache: false" within the stencil config.
  11023. To change the cache directory, please update the
  11024. "cacheDir" property within the stencil config.
  11025. `;
  11026. /**
  11027. * The CompilerCtx is a persistent object that's reused throughout
  11028. * all builds and rebuilds. The data within this object is used
  11029. * for in-memory caching, and can be reset, but the object itself
  11030. * is always the same.
  11031. */
  11032. class CompilerContext {
  11033. constructor() {
  11034. this.version = 2;
  11035. this.activeBuildId = -1;
  11036. this.activeFilesAdded = [];
  11037. this.activeFilesDeleted = [];
  11038. this.activeFilesUpdated = [];
  11039. this.activeDirsAdded = [];
  11040. this.activeDirsDeleted = [];
  11041. this.addWatchDir = noop$1;
  11042. this.addWatchFile = noop$1;
  11043. this.cssModuleImports = new Map();
  11044. this.changedFiles = new Set();
  11045. this.changedModules = new Set();
  11046. this.collections = [];
  11047. this.compilerOptions = null;
  11048. this.events = buildEvents();
  11049. this.hasSuccessfulBuild = false;
  11050. this.isActivelyBuilding = false;
  11051. this.lastBuildResults = null;
  11052. this.moduleMap = new Map();
  11053. this.nodeMap = new WeakMap();
  11054. this.resolvedCollections = new Set();
  11055. this.rollupCache = new Map();
  11056. this.rollupCacheHydrate = null;
  11057. this.rollupCacheLazy = null;
  11058. this.rollupCacheNative = null;
  11059. this.styleModeNames = new Set();
  11060. this.worker = null;
  11061. }
  11062. reset() {
  11063. this.cache.clear();
  11064. this.cssModuleImports.clear();
  11065. this.cachedGlobalStyle = null;
  11066. this.collections.length = 0;
  11067. this.compilerOptions = null;
  11068. this.hasSuccessfulBuild = false;
  11069. this.rollupCacheHydrate = null;
  11070. this.rollupCacheLazy = null;
  11071. this.rollupCacheNative = null;
  11072. this.moduleMap.clear();
  11073. this.resolvedCollections.clear();
  11074. if (this.fs != null) {
  11075. this.fs.clearCache();
  11076. }
  11077. }
  11078. }
  11079. const getModuleLegacy = (_config, compilerCtx, sourceFilePath) => {
  11080. sourceFilePath = normalizePath$1(sourceFilePath);
  11081. const moduleFile = compilerCtx.moduleMap.get(sourceFilePath);
  11082. if (moduleFile != null) {
  11083. return moduleFile;
  11084. }
  11085. else {
  11086. const sourceFileDir = dirname(sourceFilePath);
  11087. const sourceFileExt = extname$1(sourceFilePath);
  11088. const sourceFileName = basename(sourceFilePath, sourceFileExt);
  11089. const jsFilePath = join(sourceFileDir, sourceFileName + '.js');
  11090. const moduleFile = {
  11091. sourceFilePath: sourceFilePath,
  11092. jsFilePath: jsFilePath,
  11093. cmps: [],
  11094. coreRuntimeApis: [],
  11095. collectionName: null,
  11096. dtsFilePath: null,
  11097. excludeFromCollection: false,
  11098. externalImports: [],
  11099. hasVdomAttribute: false,
  11100. hasVdomXlink: false,
  11101. hasVdomClass: false,
  11102. hasVdomFunctional: false,
  11103. hasVdomKey: false,
  11104. hasVdomListener: false,
  11105. hasVdomPropOrAttr: false,
  11106. hasVdomRef: false,
  11107. hasVdomRender: false,
  11108. hasVdomStyle: false,
  11109. hasVdomText: false,
  11110. htmlAttrNames: [],
  11111. htmlTagNames: [],
  11112. htmlParts: [],
  11113. isCollectionDependency: false,
  11114. isLegacy: false,
  11115. localImports: [],
  11116. originalCollectionComponentPath: null,
  11117. originalImports: [],
  11118. potentialCmpRefs: [],
  11119. staticSourceFile: null,
  11120. staticSourceFileText: '',
  11121. sourceMapPath: null,
  11122. sourceMapFileText: null,
  11123. };
  11124. compilerCtx.moduleMap.set(sourceFilePath, moduleFile);
  11125. return moduleFile;
  11126. }
  11127. };
  11128. const resetModuleLegacy = (moduleFile) => {
  11129. moduleFile.cmps.length = 0;
  11130. moduleFile.coreRuntimeApis.length = 0;
  11131. moduleFile.collectionName = null;
  11132. moduleFile.dtsFilePath = null;
  11133. moduleFile.excludeFromCollection = false;
  11134. moduleFile.externalImports.length = 0;
  11135. moduleFile.isCollectionDependency = false;
  11136. moduleFile.localImports.length = 0;
  11137. moduleFile.originalCollectionComponentPath = null;
  11138. moduleFile.originalImports.length = 0;
  11139. moduleFile.hasVdomXlink = false;
  11140. moduleFile.hasVdomAttribute = false;
  11141. moduleFile.hasVdomClass = false;
  11142. moduleFile.hasVdomFunctional = false;
  11143. moduleFile.hasVdomKey = false;
  11144. moduleFile.hasVdomListener = false;
  11145. moduleFile.hasVdomRef = false;
  11146. moduleFile.hasVdomRender = false;
  11147. moduleFile.hasVdomStyle = false;
  11148. moduleFile.hasVdomText = false;
  11149. moduleFile.htmlAttrNames.length = 0;
  11150. moduleFile.htmlTagNames.length = 0;
  11151. moduleFile.potentialCmpRefs.length = 0;
  11152. };
  11153. const relativeImport = (pathFrom, pathTo, ext, addPrefix = true) => {
  11154. let relativePath = relative$1(dirname(pathFrom), dirname(pathTo));
  11155. if (addPrefix) {
  11156. if (relativePath === '') {
  11157. relativePath = '.';
  11158. }
  11159. else if (relativePath[0] !== '.') {
  11160. relativePath = './' + relativePath;
  11161. }
  11162. }
  11163. return normalizePath$1(`${relativePath}/${basename(pathTo, ext)}`);
  11164. };
  11165. const getComponentsDtsSrcFilePath = (config) => join(config.srcDir, GENERATED_DTS$1);
  11166. const getComponentsDtsTypesFilePath = (outputTarget) => join(outputTarget.typesDir, GENERATED_DTS$1);
  11167. const isOutputTargetDist = (o) => o.type === DIST;
  11168. const isOutputTargetDistCollection = (o) => o.type === DIST_COLLECTION;
  11169. const isOutputTargetDistCustomElements = (o) => o.type === DIST_CUSTOM_ELEMENTS;
  11170. const isOutputTargetDistCustomElementsBundle = (o) => o.type === DIST_CUSTOM_ELEMENTS_BUNDLE;
  11171. const isOutputTargetCopy = (o) => o.type === COPY;
  11172. const isOutputTargetDistLazy = (o) => o.type === DIST_LAZY;
  11173. const isOutputTargetAngular = (o) => o.type === ANGULAR;
  11174. const isOutputTargetDistLazyLoader = (o) => o.type === DIST_LAZY_LOADER;
  11175. const isOutputTargetDistGlobalStyles = (o) => o.type === DIST_GLOBAL_STYLES;
  11176. const isOutputTargetHydrate = (o) => o.type === DIST_HYDRATE_SCRIPT;
  11177. const isOutputTargetCustom = (o) => o.type === CUSTOM;
  11178. const isOutputTargetDocs = (o) => o.type === DOCS_README || o.type === DOCS_JSON || o.type === DOCS_CUSTOM || o.type === DOCS_VSCODE;
  11179. const isOutputTargetDocsReadme = (o) => o.type === DOCS_README;
  11180. const isOutputTargetDocsJson = (o) => o.type === DOCS_JSON;
  11181. const isOutputTargetDocsCustom = (o) => o.type === DOCS_CUSTOM;
  11182. const isOutputTargetDocsVscode = (o) => o.type === DOCS_VSCODE;
  11183. const isOutputTargetWww = (o) => o.type === WWW;
  11184. const isOutputTargetStats = (o) => o.type === STATS;
  11185. const isOutputTargetDistTypes = (o) => o.type === DIST_TYPES;
  11186. const getComponentsFromModules = (moduleFiles) => sortBy(flatOne(moduleFiles.map((m) => m.cmps)), (c) => c.tagName);
  11187. const ANGULAR = `angular`;
  11188. const COPY = 'copy';
  11189. const CUSTOM = `custom`;
  11190. const DIST = `dist`;
  11191. const DIST_COLLECTION = `dist-collection`;
  11192. const DIST_CUSTOM_ELEMENTS = `dist-custom-elements`;
  11193. const DIST_CUSTOM_ELEMENTS_BUNDLE = `dist-custom-elements-bundle`;
  11194. const DIST_TYPES = `dist-types`;
  11195. const DIST_HYDRATE_SCRIPT = `dist-hydrate-script`;
  11196. const DIST_LAZY = `dist-lazy`;
  11197. const DIST_LAZY_LOADER = `dist-lazy-loader`;
  11198. const DIST_GLOBAL_STYLES = 'dist-global-styles';
  11199. const DOCS_CUSTOM = 'docs-custom';
  11200. const DOCS_JSON = `docs-json`;
  11201. const DOCS_README = `docs-readme`;
  11202. const DOCS_VSCODE = `docs-vscode`;
  11203. const STATS = `stats`;
  11204. const WWW = `www`;
  11205. const VALID_TYPES = [
  11206. // DIST
  11207. WWW,
  11208. DIST,
  11209. DIST_COLLECTION,
  11210. DIST_CUSTOM_ELEMENTS,
  11211. DIST_CUSTOM_ELEMENTS_BUNDLE,
  11212. DIST_LAZY,
  11213. DIST_HYDRATE_SCRIPT,
  11214. // DOCS
  11215. DOCS_JSON,
  11216. DOCS_README,
  11217. DOCS_VSCODE,
  11218. DOCS_CUSTOM,
  11219. // MISC
  11220. ANGULAR,
  11221. COPY,
  11222. CUSTOM,
  11223. STATS,
  11224. ];
  11225. const GENERATED_DTS$1 = 'components.d.ts';
  11226. var concatMap$1 = function (xs, fn) {
  11227. var res = [];
  11228. for (var i = 0; i < xs.length; i++) {
  11229. var x = fn(xs[i], i);
  11230. if (isArray$7(x)) res.push.apply(res, x);
  11231. else res.push(x);
  11232. }
  11233. return res;
  11234. };
  11235. var isArray$7 = Array.isArray || function (xs) {
  11236. return Object.prototype.toString.call(xs) === '[object Array]';
  11237. };
  11238. var balancedMatch$1 = balanced$1;
  11239. function balanced$1(a, b, str) {
  11240. if (a instanceof RegExp) a = maybeMatch$1(a, str);
  11241. if (b instanceof RegExp) b = maybeMatch$1(b, str);
  11242. var r = range$1(a, b, str);
  11243. return r && {
  11244. start: r[0],
  11245. end: r[1],
  11246. pre: str.slice(0, r[0]),
  11247. body: str.slice(r[0] + a.length, r[1]),
  11248. post: str.slice(r[1] + b.length)
  11249. };
  11250. }
  11251. function maybeMatch$1(reg, str) {
  11252. var m = str.match(reg);
  11253. return m ? m[0] : null;
  11254. }
  11255. balanced$1.range = range$1;
  11256. function range$1(a, b, str) {
  11257. var begs, beg, left, right, result;
  11258. var ai = str.indexOf(a);
  11259. var bi = str.indexOf(b, ai + 1);
  11260. var i = ai;
  11261. if (ai >= 0 && bi > 0) {
  11262. begs = [];
  11263. left = str.length;
  11264. while (i >= 0 && !result) {
  11265. if (i == ai) {
  11266. begs.push(i);
  11267. ai = str.indexOf(a, i + 1);
  11268. } else if (begs.length == 1) {
  11269. result = [ begs.pop(), bi ];
  11270. } else {
  11271. beg = begs.pop();
  11272. if (beg < left) {
  11273. left = beg;
  11274. right = bi;
  11275. }
  11276. bi = str.indexOf(b, i + 1);
  11277. }
  11278. i = ai < bi && ai >= 0 ? ai : bi;
  11279. }
  11280. if (begs.length) {
  11281. result = [ left, right ];
  11282. }
  11283. }
  11284. return result;
  11285. }
  11286. var braceExpansion$1 = expandTop$1;
  11287. var escSlash$1 = '\0SLASH'+Math.random()+'\0';
  11288. var escOpen$1 = '\0OPEN'+Math.random()+'\0';
  11289. var escClose$1 = '\0CLOSE'+Math.random()+'\0';
  11290. var escComma$1 = '\0COMMA'+Math.random()+'\0';
  11291. var escPeriod$1 = '\0PERIOD'+Math.random()+'\0';
  11292. function numeric$1(str) {
  11293. return parseInt(str, 10) == str
  11294. ? parseInt(str, 10)
  11295. : str.charCodeAt(0);
  11296. }
  11297. function escapeBraces$1(str) {
  11298. return str.split('\\\\').join(escSlash$1)
  11299. .split('\\{').join(escOpen$1)
  11300. .split('\\}').join(escClose$1)
  11301. .split('\\,').join(escComma$1)
  11302. .split('\\.').join(escPeriod$1);
  11303. }
  11304. function unescapeBraces$1(str) {
  11305. return str.split(escSlash$1).join('\\')
  11306. .split(escOpen$1).join('{')
  11307. .split(escClose$1).join('}')
  11308. .split(escComma$1).join(',')
  11309. .split(escPeriod$1).join('.');
  11310. }
  11311. // Basically just str.split(","), but handling cases
  11312. // where we have nested braced sections, which should be
  11313. // treated as individual members, like {a,{b,c},d}
  11314. function parseCommaParts$1(str) {
  11315. if (!str)
  11316. return [''];
  11317. var parts = [];
  11318. var m = balancedMatch$1('{', '}', str);
  11319. if (!m)
  11320. return str.split(',');
  11321. var pre = m.pre;
  11322. var body = m.body;
  11323. var post = m.post;
  11324. var p = pre.split(',');
  11325. p[p.length-1] += '{' + body + '}';
  11326. var postParts = parseCommaParts$1(post);
  11327. if (post.length) {
  11328. p[p.length-1] += postParts.shift();
  11329. p.push.apply(p, postParts);
  11330. }
  11331. parts.push.apply(parts, p);
  11332. return parts;
  11333. }
  11334. function expandTop$1(str) {
  11335. if (!str)
  11336. return [];
  11337. // I don't know why Bash 4.3 does this, but it does.
  11338. // Anything starting with {} will have the first two bytes preserved
  11339. // but *only* at the top level, so {},a}b will not expand to anything,
  11340. // but a{},b}c will be expanded to [a}c,abc].
  11341. // One could argue that this is a bug in Bash, but since the goal of
  11342. // this module is to match Bash's rules, we escape a leading {}
  11343. if (str.substr(0, 2) === '{}') {
  11344. str = '\\{\\}' + str.substr(2);
  11345. }
  11346. return expand$1(escapeBraces$1(str), true).map(unescapeBraces$1);
  11347. }
  11348. function embrace$1(str) {
  11349. return '{' + str + '}';
  11350. }
  11351. function isPadded$1(el) {
  11352. return /^-?0\d/.test(el);
  11353. }
  11354. function lte$1(i, y) {
  11355. return i <= y;
  11356. }
  11357. function gte$1(i, y) {
  11358. return i >= y;
  11359. }
  11360. function expand$1(str, isTop) {
  11361. var expansions = [];
  11362. var m = balancedMatch$1('{', '}', str);
  11363. if (!m || /\$$/.test(m.pre)) return [str];
  11364. var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
  11365. var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
  11366. var isSequence = isNumericSequence || isAlphaSequence;
  11367. var isOptions = m.body.indexOf(',') >= 0;
  11368. if (!isSequence && !isOptions) {
  11369. // {a},b}
  11370. if (m.post.match(/,.*\}/)) {
  11371. str = m.pre + '{' + m.body + escClose$1 + m.post;
  11372. return expand$1(str);
  11373. }
  11374. return [str];
  11375. }
  11376. var n;
  11377. if (isSequence) {
  11378. n = m.body.split(/\.\./);
  11379. } else {
  11380. n = parseCommaParts$1(m.body);
  11381. if (n.length === 1) {
  11382. // x{{a,b}}y ==> x{a}y x{b}y
  11383. n = expand$1(n[0], false).map(embrace$1);
  11384. if (n.length === 1) {
  11385. var post = m.post.length
  11386. ? expand$1(m.post, false)
  11387. : [''];
  11388. return post.map(function(p) {
  11389. return m.pre + n[0] + p;
  11390. });
  11391. }
  11392. }
  11393. }
  11394. // at this point, n is the parts, and we know it's not a comma set
  11395. // with a single entry.
  11396. // no need to expand pre, since it is guaranteed to be free of brace-sets
  11397. var pre = m.pre;
  11398. var post = m.post.length
  11399. ? expand$1(m.post, false)
  11400. : [''];
  11401. var N;
  11402. if (isSequence) {
  11403. var x = numeric$1(n[0]);
  11404. var y = numeric$1(n[1]);
  11405. var width = Math.max(n[0].length, n[1].length);
  11406. var incr = n.length == 3
  11407. ? Math.abs(numeric$1(n[2]))
  11408. : 1;
  11409. var test = lte$1;
  11410. var reverse = y < x;
  11411. if (reverse) {
  11412. incr *= -1;
  11413. test = gte$1;
  11414. }
  11415. var pad = n.some(isPadded$1);
  11416. N = [];
  11417. for (var i = x; test(i, y); i += incr) {
  11418. var c;
  11419. if (isAlphaSequence) {
  11420. c = String.fromCharCode(i);
  11421. if (c === '\\')
  11422. c = '';
  11423. } else {
  11424. c = String(i);
  11425. if (pad) {
  11426. var need = width - c.length;
  11427. if (need > 0) {
  11428. var z = new Array(need + 1).join('0');
  11429. if (i < 0)
  11430. c = '-' + z + c.slice(1);
  11431. else
  11432. c = z + c;
  11433. }
  11434. }
  11435. }
  11436. N.push(c);
  11437. }
  11438. } else {
  11439. N = concatMap$1(n, function(el) { return expand$1(el, false) });
  11440. }
  11441. for (var j = 0; j < N.length; j++) {
  11442. for (var k = 0; k < post.length; k++) {
  11443. var expansion = pre + N[j] + post[k];
  11444. if (!isTop || isSequence || expansion)
  11445. expansions.push(expansion);
  11446. }
  11447. }
  11448. return expansions;
  11449. }
  11450. var minimatch_1$1 = minimatch$1;
  11451. minimatch$1.Minimatch = Minimatch$2;
  11452. var path$1 = { sep: '/' };
  11453. try {
  11454. path$1 = path$4;
  11455. } catch (er) {}
  11456. var GLOBSTAR$1 = minimatch$1.GLOBSTAR = Minimatch$2.GLOBSTAR = {};
  11457. var plTypes$1 = {
  11458. '!': { open: '(?:(?!(?:', close: '))[^/]*?)'},
  11459. '?': { open: '(?:', close: ')?' },
  11460. '+': { open: '(?:', close: ')+' },
  11461. '*': { open: '(?:', close: ')*' },
  11462. '@': { open: '(?:', close: ')' }
  11463. };
  11464. // any single thing other than /
  11465. // don't need to escape / when using new RegExp()
  11466. var qmark$1 = '[^/]';
  11467. // * => any number of characters
  11468. var star$1 = qmark$1 + '*?';
  11469. // ** when dots are allowed. Anything goes, except .. and .
  11470. // not (^ or / followed by one or two dots followed by $ or /),
  11471. // followed by anything, any number of times.
  11472. var twoStarDot$1 = '(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?';
  11473. // not a ^ or / followed by a dot,
  11474. // followed by anything, any number of times.
  11475. var twoStarNoDot$1 = '(?:(?!(?:\\\/|^)\\.).)*?';
  11476. // characters that need to be escaped in RegExp.
  11477. var reSpecials$1 = charSet$1('().*{}+?[]^$\\!');
  11478. // "abc" -> { a:true, b:true, c:true }
  11479. function charSet$1 (s) {
  11480. return s.split('').reduce(function (set, c) {
  11481. set[c] = true;
  11482. return set
  11483. }, {})
  11484. }
  11485. // normalizes slashes.
  11486. var slashSplit$1 = /\/+/;
  11487. minimatch$1.filter = filter$1;
  11488. function filter$1 (pattern, options) {
  11489. options = options || {};
  11490. return function (p, i, list) {
  11491. return minimatch$1(p, pattern, options)
  11492. }
  11493. }
  11494. function ext$1 (a, b) {
  11495. a = a || {};
  11496. b = b || {};
  11497. var t = {};
  11498. Object.keys(b).forEach(function (k) {
  11499. t[k] = b[k];
  11500. });
  11501. Object.keys(a).forEach(function (k) {
  11502. t[k] = a[k];
  11503. });
  11504. return t
  11505. }
  11506. minimatch$1.defaults = function (def) {
  11507. if (!def || !Object.keys(def).length) return minimatch$1
  11508. var orig = minimatch$1;
  11509. var m = function minimatch (p, pattern, options) {
  11510. return orig.minimatch(p, pattern, ext$1(def, options))
  11511. };
  11512. m.Minimatch = function Minimatch (pattern, options) {
  11513. return new orig.Minimatch(pattern, ext$1(def, options))
  11514. };
  11515. return m
  11516. };
  11517. Minimatch$2.defaults = function (def) {
  11518. if (!def || !Object.keys(def).length) return Minimatch$2
  11519. return minimatch$1.defaults(def).Minimatch
  11520. };
  11521. function minimatch$1 (p, pattern, options) {
  11522. if (typeof pattern !== 'string') {
  11523. throw new TypeError('glob pattern string required')
  11524. }
  11525. if (!options) options = {};
  11526. // shortcut: comments match nothing.
  11527. if (!options.nocomment && pattern.charAt(0) === '#') {
  11528. return false
  11529. }
  11530. // "" only matches ""
  11531. if (pattern.trim() === '') return p === ''
  11532. return new Minimatch$2(pattern, options).match(p)
  11533. }
  11534. function Minimatch$2 (pattern, options) {
  11535. if (!(this instanceof Minimatch$2)) {
  11536. return new Minimatch$2(pattern, options)
  11537. }
  11538. if (typeof pattern !== 'string') {
  11539. throw new TypeError('glob pattern string required')
  11540. }
  11541. if (!options) options = {};
  11542. pattern = pattern.trim();
  11543. // windows support: need to use /, not \
  11544. if (path$1.sep !== '/') {
  11545. pattern = pattern.split(path$1.sep).join('/');
  11546. }
  11547. this.options = options;
  11548. this.set = [];
  11549. this.pattern = pattern;
  11550. this.regexp = null;
  11551. this.negate = false;
  11552. this.comment = false;
  11553. this.empty = false;
  11554. // make the set of regexps etc.
  11555. this.make();
  11556. }
  11557. Minimatch$2.prototype.debug = function () {};
  11558. Minimatch$2.prototype.make = make$1;
  11559. function make$1 () {
  11560. // don't do it more than once.
  11561. if (this._made) return
  11562. var pattern = this.pattern;
  11563. var options = this.options;
  11564. // empty patterns and comments match nothing.
  11565. if (!options.nocomment && pattern.charAt(0) === '#') {
  11566. this.comment = true;
  11567. return
  11568. }
  11569. if (!pattern) {
  11570. this.empty = true;
  11571. return
  11572. }
  11573. // step 1: figure out negation, etc.
  11574. this.parseNegate();
  11575. // step 2: expand braces
  11576. var set = this.globSet = this.braceExpand();
  11577. if (options.debug) this.debug = console.error;
  11578. this.debug(this.pattern, set);
  11579. // step 3: now we have a set, so turn each one into a series of path-portion
  11580. // matching patterns.
  11581. // These will be regexps, except in the case of "**", which is
  11582. // set to the GLOBSTAR object for globstar behavior,
  11583. // and will not contain any / characters
  11584. set = this.globParts = set.map(function (s) {
  11585. return s.split(slashSplit$1)
  11586. });
  11587. this.debug(this.pattern, set);
  11588. // glob --> regexps
  11589. set = set.map(function (s, si, set) {
  11590. return s.map(this.parse, this)
  11591. }, this);
  11592. this.debug(this.pattern, set);
  11593. // filter out everything that didn't compile properly.
  11594. set = set.filter(function (s) {
  11595. return s.indexOf(false) === -1
  11596. });
  11597. this.debug(this.pattern, set);
  11598. this.set = set;
  11599. }
  11600. Minimatch$2.prototype.parseNegate = parseNegate$1;
  11601. function parseNegate$1 () {
  11602. var pattern = this.pattern;
  11603. var negate = false;
  11604. var options = this.options;
  11605. var negateOffset = 0;
  11606. if (options.nonegate) return
  11607. for (var i = 0, l = pattern.length
  11608. ; i < l && pattern.charAt(i) === '!'
  11609. ; i++) {
  11610. negate = !negate;
  11611. negateOffset++;
  11612. }
  11613. if (negateOffset) this.pattern = pattern.substr(negateOffset);
  11614. this.negate = negate;
  11615. }
  11616. // Brace expansion:
  11617. // a{b,c}d -> abd acd
  11618. // a{b,}c -> abc ac
  11619. // a{0..3}d -> a0d a1d a2d a3d
  11620. // a{b,c{d,e}f}g -> abg acdfg acefg
  11621. // a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg
  11622. //
  11623. // Invalid sets are not expanded.
  11624. // a{2..}b -> a{2..}b
  11625. // a{b}c -> a{b}c
  11626. minimatch$1.braceExpand = function (pattern, options) {
  11627. return braceExpand$1(pattern, options)
  11628. };
  11629. Minimatch$2.prototype.braceExpand = braceExpand$1;
  11630. function braceExpand$1 (pattern, options) {
  11631. if (!options) {
  11632. if (this instanceof Minimatch$2) {
  11633. options = this.options;
  11634. } else {
  11635. options = {};
  11636. }
  11637. }
  11638. pattern = typeof pattern === 'undefined'
  11639. ? this.pattern : pattern;
  11640. if (typeof pattern === 'undefined') {
  11641. throw new TypeError('undefined pattern')
  11642. }
  11643. if (options.nobrace ||
  11644. !pattern.match(/\{.*\}/)) {
  11645. // shortcut. no need to expand.
  11646. return [pattern]
  11647. }
  11648. return braceExpansion$1(pattern)
  11649. }
  11650. // parse a component of the expanded set.
  11651. // At this point, no pattern may contain "/" in it
  11652. // so we're going to return a 2d array, where each entry is the full
  11653. // pattern, split on '/', and then turned into a regular expression.
  11654. // A regexp is made at the end which joins each array with an
  11655. // escaped /, and another full one which joins each regexp with |.
  11656. //
  11657. // Following the lead of Bash 4.1, note that "**" only has special meaning
  11658. // when it is the *only* thing in a path portion. Otherwise, any series
  11659. // of * is equivalent to a single *. Globstar behavior is enabled by
  11660. // default, and can be disabled by setting options.noglobstar.
  11661. Minimatch$2.prototype.parse = parse$4;
  11662. var SUBPARSE$1 = {};
  11663. function parse$4 (pattern, isSub) {
  11664. if (pattern.length > 1024 * 64) {
  11665. throw new TypeError('pattern is too long')
  11666. }
  11667. var options = this.options;
  11668. // shortcuts
  11669. if (!options.noglobstar && pattern === '**') return GLOBSTAR$1
  11670. if (pattern === '') return ''
  11671. var re = '';
  11672. var hasMagic = !!options.nocase;
  11673. var escaping = false;
  11674. // ? => one single character
  11675. var patternListStack = [];
  11676. var negativeLists = [];
  11677. var stateChar;
  11678. var inClass = false;
  11679. var reClassStart = -1;
  11680. var classStart = -1;
  11681. // . and .. never match anything that doesn't start with .,
  11682. // even when options.dot is set.
  11683. var patternStart = pattern.charAt(0) === '.' ? '' // anything
  11684. // not (start or / followed by . or .. followed by / or end)
  11685. : options.dot ? '(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))'
  11686. : '(?!\\.)';
  11687. var self = this;
  11688. function clearStateChar () {
  11689. if (stateChar) {
  11690. // we had some state-tracking character
  11691. // that wasn't consumed by this pass.
  11692. switch (stateChar) {
  11693. case '*':
  11694. re += star$1;
  11695. hasMagic = true;
  11696. break
  11697. case '?':
  11698. re += qmark$1;
  11699. hasMagic = true;
  11700. break
  11701. default:
  11702. re += '\\' + stateChar;
  11703. break
  11704. }
  11705. self.debug('clearStateChar %j %j', stateChar, re);
  11706. stateChar = false;
  11707. }
  11708. }
  11709. for (var i = 0, len = pattern.length, c
  11710. ; (i < len) && (c = pattern.charAt(i))
  11711. ; i++) {
  11712. this.debug('%s\t%s %s %j', pattern, i, re, c);
  11713. // skip over any that are escaped.
  11714. if (escaping && reSpecials$1[c]) {
  11715. re += '\\' + c;
  11716. escaping = false;
  11717. continue
  11718. }
  11719. switch (c) {
  11720. case '/':
  11721. // completely not allowed, even escaped.
  11722. // Should already be path-split by now.
  11723. return false
  11724. case '\\':
  11725. clearStateChar();
  11726. escaping = true;
  11727. continue
  11728. // the various stateChar values
  11729. // for the "extglob" stuff.
  11730. case '?':
  11731. case '*':
  11732. case '+':
  11733. case '@':
  11734. case '!':
  11735. this.debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c);
  11736. // all of those are literals inside a class, except that
  11737. // the glob [!a] means [^a] in regexp
  11738. if (inClass) {
  11739. this.debug(' in class');
  11740. if (c === '!' && i === classStart + 1) c = '^';
  11741. re += c;
  11742. continue
  11743. }
  11744. // if we already have a stateChar, then it means
  11745. // that there was something like ** or +? in there.
  11746. // Handle the stateChar, then proceed with this one.
  11747. self.debug('call clearStateChar %j', stateChar);
  11748. clearStateChar();
  11749. stateChar = c;
  11750. // if extglob is disabled, then +(asdf|foo) isn't a thing.
  11751. // just clear the statechar *now*, rather than even diving into
  11752. // the patternList stuff.
  11753. if (options.noext) clearStateChar();
  11754. continue
  11755. case '(':
  11756. if (inClass) {
  11757. re += '(';
  11758. continue
  11759. }
  11760. if (!stateChar) {
  11761. re += '\\(';
  11762. continue
  11763. }
  11764. patternListStack.push({
  11765. type: stateChar,
  11766. start: i - 1,
  11767. reStart: re.length,
  11768. open: plTypes$1[stateChar].open,
  11769. close: plTypes$1[stateChar].close
  11770. });
  11771. // negation is (?:(?!js)[^/]*)
  11772. re += stateChar === '!' ? '(?:(?!(?:' : '(?:';
  11773. this.debug('plType %j %j', stateChar, re);
  11774. stateChar = false;
  11775. continue
  11776. case ')':
  11777. if (inClass || !patternListStack.length) {
  11778. re += '\\)';
  11779. continue
  11780. }
  11781. clearStateChar();
  11782. hasMagic = true;
  11783. var pl = patternListStack.pop();
  11784. // negation is (?:(?!js)[^/]*)
  11785. // The others are (?:<pattern>)<type>
  11786. re += pl.close;
  11787. if (pl.type === '!') {
  11788. negativeLists.push(pl);
  11789. }
  11790. pl.reEnd = re.length;
  11791. continue
  11792. case '|':
  11793. if (inClass || !patternListStack.length || escaping) {
  11794. re += '\\|';
  11795. escaping = false;
  11796. continue
  11797. }
  11798. clearStateChar();
  11799. re += '|';
  11800. continue
  11801. // these are mostly the same in regexp and glob
  11802. case '[':
  11803. // swallow any state-tracking char before the [
  11804. clearStateChar();
  11805. if (inClass) {
  11806. re += '\\' + c;
  11807. continue
  11808. }
  11809. inClass = true;
  11810. classStart = i;
  11811. reClassStart = re.length;
  11812. re += c;
  11813. continue
  11814. case ']':
  11815. // a right bracket shall lose its special
  11816. // meaning and represent itself in
  11817. // a bracket expression if it occurs
  11818. // first in the list. -- POSIX.2 2.8.3.2
  11819. if (i === classStart + 1 || !inClass) {
  11820. re += '\\' + c;
  11821. escaping = false;
  11822. continue
  11823. }
  11824. // handle the case where we left a class open.
  11825. // "[z-a]" is valid, equivalent to "\[z-a\]"
  11826. if (inClass) {
  11827. // split where the last [ was, make sure we don't have
  11828. // an invalid re. if so, re-walk the contents of the
  11829. // would-be class to re-translate any characters that
  11830. // were passed through as-is
  11831. // TODO: It would probably be faster to determine this
  11832. // without a try/catch and a new RegExp, but it's tricky
  11833. // to do safely. For now, this is safe and works.
  11834. var cs = pattern.substring(classStart + 1, i);
  11835. try {
  11836. RegExp('[' + cs + ']');
  11837. } catch (er) {
  11838. // not a valid class!
  11839. var sp = this.parse(cs, SUBPARSE$1);
  11840. re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]';
  11841. hasMagic = hasMagic || sp[1];
  11842. inClass = false;
  11843. continue
  11844. }
  11845. }
  11846. // finish up the class.
  11847. hasMagic = true;
  11848. inClass = false;
  11849. re += c;
  11850. continue
  11851. default:
  11852. // swallow any state char that wasn't consumed
  11853. clearStateChar();
  11854. if (escaping) {
  11855. // no need
  11856. escaping = false;
  11857. } else if (reSpecials$1[c]
  11858. && !(c === '^' && inClass)) {
  11859. re += '\\';
  11860. }
  11861. re += c;
  11862. } // switch
  11863. } // for
  11864. // handle the case where we left a class open.
  11865. // "[abc" is valid, equivalent to "\[abc"
  11866. if (inClass) {
  11867. // split where the last [ was, and escape it
  11868. // this is a huge pita. We now have to re-walk
  11869. // the contents of the would-be class to re-translate
  11870. // any characters that were passed through as-is
  11871. cs = pattern.substr(classStart + 1);
  11872. sp = this.parse(cs, SUBPARSE$1);
  11873. re = re.substr(0, reClassStart) + '\\[' + sp[0];
  11874. hasMagic = hasMagic || sp[1];
  11875. }
  11876. // handle the case where we had a +( thing at the *end*
  11877. // of the pattern.
  11878. // each pattern list stack adds 3 chars, and we need to go through
  11879. // and escape any | chars that were passed through as-is for the regexp.
  11880. // Go through and escape them, taking care not to double-escape any
  11881. // | chars that were already escaped.
  11882. for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) {
  11883. var tail = re.slice(pl.reStart + pl.open.length);
  11884. this.debug('setting tail', re, pl);
  11885. // maybe some even number of \, then maybe 1 \, followed by a |
  11886. tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, function (_, $1, $2) {
  11887. if (!$2) {
  11888. // the | isn't already escaped, so escape it.
  11889. $2 = '\\';
  11890. }
  11891. // need to escape all those slashes *again*, without escaping the
  11892. // one that we need for escaping the | character. As it works out,
  11893. // escaping an even number of slashes can be done by simply repeating
  11894. // it exactly after itself. That's why this trick works.
  11895. //
  11896. // I am sorry that you have to see this.
  11897. return $1 + $1 + $2 + '|'
  11898. });
  11899. this.debug('tail=%j\n %s', tail, tail, pl, re);
  11900. var t = pl.type === '*' ? star$1
  11901. : pl.type === '?' ? qmark$1
  11902. : '\\' + pl.type;
  11903. hasMagic = true;
  11904. re = re.slice(0, pl.reStart) + t + '\\(' + tail;
  11905. }
  11906. // handle trailing things that only matter at the very end.
  11907. clearStateChar();
  11908. if (escaping) {
  11909. // trailing \\
  11910. re += '\\\\';
  11911. }
  11912. // only need to apply the nodot start if the re starts with
  11913. // something that could conceivably capture a dot
  11914. var addPatternStart = false;
  11915. switch (re.charAt(0)) {
  11916. case '.':
  11917. case '[':
  11918. case '(': addPatternStart = true;
  11919. }
  11920. // Hack to work around lack of negative lookbehind in JS
  11921. // A pattern like: *.!(x).!(y|z) needs to ensure that a name
  11922. // like 'a.xyz.yz' doesn't match. So, the first negative
  11923. // lookahead, has to look ALL the way ahead, to the end of
  11924. // the pattern.
  11925. for (var n = negativeLists.length - 1; n > -1; n--) {
  11926. var nl = negativeLists[n];
  11927. var nlBefore = re.slice(0, nl.reStart);
  11928. var nlFirst = re.slice(nl.reStart, nl.reEnd - 8);
  11929. var nlLast = re.slice(nl.reEnd - 8, nl.reEnd);
  11930. var nlAfter = re.slice(nl.reEnd);
  11931. nlLast += nlAfter;
  11932. // Handle nested stuff like *(*.js|!(*.json)), where open parens
  11933. // mean that we should *not* include the ) in the bit that is considered
  11934. // "after" the negated section.
  11935. var openParensBefore = nlBefore.split('(').length - 1;
  11936. var cleanAfter = nlAfter;
  11937. for (i = 0; i < openParensBefore; i++) {
  11938. cleanAfter = cleanAfter.replace(/\)[+*?]?/, '');
  11939. }
  11940. nlAfter = cleanAfter;
  11941. var dollar = '';
  11942. if (nlAfter === '' && isSub !== SUBPARSE$1) {
  11943. dollar = '$';
  11944. }
  11945. var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast;
  11946. re = newRe;
  11947. }
  11948. // if the re is not "" at this point, then we need to make sure
  11949. // it doesn't match against an empty path part.
  11950. // Otherwise a/* will match a/, which it should not.
  11951. if (re !== '' && hasMagic) {
  11952. re = '(?=.)' + re;
  11953. }
  11954. if (addPatternStart) {
  11955. re = patternStart + re;
  11956. }
  11957. // parsing just a piece of a larger pattern.
  11958. if (isSub === SUBPARSE$1) {
  11959. return [re, hasMagic]
  11960. }
  11961. // skip the regexp for non-magical patterns
  11962. // unescape anything in it, though, so that it'll be
  11963. // an exact match against a file etc.
  11964. if (!hasMagic) {
  11965. return globUnescape$1(pattern)
  11966. }
  11967. var flags = options.nocase ? 'i' : '';
  11968. try {
  11969. var regExp = new RegExp('^' + re + '$', flags);
  11970. } catch (er) {
  11971. // If it was an invalid regular expression, then it can't match
  11972. // anything. This trick looks for a character after the end of
  11973. // the string, which is of course impossible, except in multi-line
  11974. // mode, but it's not a /m regex.
  11975. return new RegExp('$.')
  11976. }
  11977. regExp._glob = pattern;
  11978. regExp._src = re;
  11979. return regExp
  11980. }
  11981. minimatch$1.makeRe = function (pattern, options) {
  11982. return new Minimatch$2(pattern, options || {}).makeRe()
  11983. };
  11984. Minimatch$2.prototype.makeRe = makeRe$1;
  11985. function makeRe$1 () {
  11986. if (this.regexp || this.regexp === false) return this.regexp
  11987. // at this point, this.set is a 2d array of partial
  11988. // pattern strings, or "**".
  11989. //
  11990. // It's better to use .match(). This function shouldn't
  11991. // be used, really, but it's pretty convenient sometimes,
  11992. // when you just want to work with a regex.
  11993. var set = this.set;
  11994. if (!set.length) {
  11995. this.regexp = false;
  11996. return this.regexp
  11997. }
  11998. var options = this.options;
  11999. var twoStar = options.noglobstar ? star$1
  12000. : options.dot ? twoStarDot$1
  12001. : twoStarNoDot$1;
  12002. var flags = options.nocase ? 'i' : '';
  12003. var re = set.map(function (pattern) {
  12004. return pattern.map(function (p) {
  12005. return (p === GLOBSTAR$1) ? twoStar
  12006. : (typeof p === 'string') ? regExpEscape$1(p)
  12007. : p._src
  12008. }).join('\\\/')
  12009. }).join('|');
  12010. // must match entire pattern
  12011. // ending in a * or ** will make it less strict.
  12012. re = '^(?:' + re + ')$';
  12013. // can match anything, as long as it's not this.
  12014. if (this.negate) re = '^(?!' + re + ').*$';
  12015. try {
  12016. this.regexp = new RegExp(re, flags);
  12017. } catch (ex) {
  12018. this.regexp = false;
  12019. }
  12020. return this.regexp
  12021. }
  12022. minimatch$1.match = function (list, pattern, options) {
  12023. options = options || {};
  12024. var mm = new Minimatch$2(pattern, options);
  12025. list = list.filter(function (f) {
  12026. return mm.match(f)
  12027. });
  12028. if (mm.options.nonull && !list.length) {
  12029. list.push(pattern);
  12030. }
  12031. return list
  12032. };
  12033. Minimatch$2.prototype.match = match$1;
  12034. function match$1 (f, partial) {
  12035. this.debug('match', f, this.pattern);
  12036. // short-circuit in the case of busted things.
  12037. // comments, etc.
  12038. if (this.comment) return false
  12039. if (this.empty) return f === ''
  12040. if (f === '/' && partial) return true
  12041. var options = this.options;
  12042. // windows: need to use /, not \
  12043. if (path$1.sep !== '/') {
  12044. f = f.split(path$1.sep).join('/');
  12045. }
  12046. // treat the test path as a set of pathparts.
  12047. f = f.split(slashSplit$1);
  12048. this.debug(this.pattern, 'split', f);
  12049. // just ONE of the pattern sets in this.set needs to match
  12050. // in order for it to be valid. If negating, then just one
  12051. // match means that we have failed.
  12052. // Either way, return on the first hit.
  12053. var set = this.set;
  12054. this.debug(this.pattern, 'set', set);
  12055. // Find the basename of the path by looking for the last non-empty segment
  12056. var filename;
  12057. var i;
  12058. for (i = f.length - 1; i >= 0; i--) {
  12059. filename = f[i];
  12060. if (filename) break
  12061. }
  12062. for (i = 0; i < set.length; i++) {
  12063. var pattern = set[i];
  12064. var file = f;
  12065. if (options.matchBase && pattern.length === 1) {
  12066. file = [filename];
  12067. }
  12068. var hit = this.matchOne(file, pattern, partial);
  12069. if (hit) {
  12070. if (options.flipNegate) return true
  12071. return !this.negate
  12072. }
  12073. }
  12074. // didn't get any hits. this is success if it's a negative
  12075. // pattern, failure otherwise.
  12076. if (options.flipNegate) return false
  12077. return this.negate
  12078. }
  12079. // set partial to true to test if, for example,
  12080. // "/a/b" matches the start of "/*/b/*/d"
  12081. // Partial means, if you run out of file before you run
  12082. // out of pattern, then that's fine, as long as all
  12083. // the parts match.
  12084. Minimatch$2.prototype.matchOne = function (file, pattern, partial) {
  12085. var options = this.options;
  12086. this.debug('matchOne',
  12087. { 'this': this, file: file, pattern: pattern });
  12088. this.debug('matchOne', file.length, pattern.length);
  12089. for (var fi = 0,
  12090. pi = 0,
  12091. fl = file.length,
  12092. pl = pattern.length
  12093. ; (fi < fl) && (pi < pl)
  12094. ; fi++, pi++) {
  12095. this.debug('matchOne loop');
  12096. var p = pattern[pi];
  12097. var f = file[fi];
  12098. this.debug(pattern, p, f);
  12099. // should be impossible.
  12100. // some invalid regexp stuff in the set.
  12101. if (p === false) return false
  12102. if (p === GLOBSTAR$1) {
  12103. this.debug('GLOBSTAR', [pattern, p, f]);
  12104. // "**"
  12105. // a/**/b/**/c would match the following:
  12106. // a/b/x/y/z/c
  12107. // a/x/y/z/b/c
  12108. // a/b/x/b/x/c
  12109. // a/b/c
  12110. // To do this, take the rest of the pattern after
  12111. // the **, and see if it would match the file remainder.
  12112. // If so, return success.
  12113. // If not, the ** "swallows" a segment, and try again.
  12114. // This is recursively awful.
  12115. //
  12116. // a/**/b/**/c matching a/b/x/y/z/c
  12117. // - a matches a
  12118. // - doublestar
  12119. // - matchOne(b/x/y/z/c, b/**/c)
  12120. // - b matches b
  12121. // - doublestar
  12122. // - matchOne(x/y/z/c, c) -> no
  12123. // - matchOne(y/z/c, c) -> no
  12124. // - matchOne(z/c, c) -> no
  12125. // - matchOne(c, c) yes, hit
  12126. var fr = fi;
  12127. var pr = pi + 1;
  12128. if (pr === pl) {
  12129. this.debug('** at the end');
  12130. // a ** at the end will just swallow the rest.
  12131. // We have found a match.
  12132. // however, it will not swallow /.x, unless
  12133. // options.dot is set.
  12134. // . and .. are *never* matched by **, for explosively
  12135. // exponential reasons.
  12136. for (; fi < fl; fi++) {
  12137. if (file[fi] === '.' || file[fi] === '..' ||
  12138. (!options.dot && file[fi].charAt(0) === '.')) return false
  12139. }
  12140. return true
  12141. }
  12142. // ok, let's see if we can swallow whatever we can.
  12143. while (fr < fl) {
  12144. var swallowee = file[fr];
  12145. this.debug('\nglobstar while', file, fr, pattern, pr, swallowee);
  12146. // XXX remove this slice. Just pass the start index.
  12147. if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
  12148. this.debug('globstar found match!', fr, fl, swallowee);
  12149. // found a match.
  12150. return true
  12151. } else {
  12152. // can't swallow "." or ".." ever.
  12153. // can only swallow ".foo" when explicitly asked.
  12154. if (swallowee === '.' || swallowee === '..' ||
  12155. (!options.dot && swallowee.charAt(0) === '.')) {
  12156. this.debug('dot detected!', file, fr, pattern, pr);
  12157. break
  12158. }
  12159. // ** swallows a segment, and continue.
  12160. this.debug('globstar swallow a segment, and continue');
  12161. fr++;
  12162. }
  12163. }
  12164. // no match was found.
  12165. // However, in partial mode, we can't say this is necessarily over.
  12166. // If there's more *pattern* left, then
  12167. if (partial) {
  12168. // ran out of file
  12169. this.debug('\n>>> no match, partial?', file, fr, pattern, pr);
  12170. if (fr === fl) return true
  12171. }
  12172. return false
  12173. }
  12174. // something other than **
  12175. // non-magic patterns just have to match exactly
  12176. // patterns with magic have been turned into regexps.
  12177. var hit;
  12178. if (typeof p === 'string') {
  12179. if (options.nocase) {
  12180. hit = f.toLowerCase() === p.toLowerCase();
  12181. } else {
  12182. hit = f === p;
  12183. }
  12184. this.debug('string match', p, f, hit);
  12185. } else {
  12186. hit = f.match(p);
  12187. this.debug('pattern match', p, f, hit);
  12188. }
  12189. if (!hit) return false
  12190. }
  12191. // Note: ending in / means that we'll get a final ""
  12192. // at the end of the pattern. This can only match a
  12193. // corresponding "" at the end of the file.
  12194. // If the file ends in /, then it can only match a
  12195. // a pattern that ends in /, unless the pattern just
  12196. // doesn't have any more for it. But, a/b/ should *not*
  12197. // match "a/b/*", even though "" matches against the
  12198. // [^/]*? pattern, except in partial mode, where it might
  12199. // simply not be reached yet.
  12200. // However, a/b/ should still satisfy a/*
  12201. // now either we fell off the end of the pattern, or we're done.
  12202. if (fi === fl && pi === pl) {
  12203. // ran out of pattern and filename at the same time.
  12204. // an exact hit!
  12205. return true
  12206. } else if (fi === fl) {
  12207. // ran out of file, but still had pattern left.
  12208. // this is ok if we're doing the match as part of
  12209. // a glob fs traversal.
  12210. return partial
  12211. } else if (pi === pl) {
  12212. // ran out of pattern, still have file left.
  12213. // this is only acceptable if we're on the very last
  12214. // empty segment of a file with a trailing slash.
  12215. // a/* should match a/b/
  12216. var emptyFileEnd = (fi === fl - 1) && (file[fi] === '');
  12217. return emptyFileEnd
  12218. }
  12219. // should be unreachable.
  12220. throw new Error('wtf?')
  12221. };
  12222. // replace stuff like \* with *
  12223. function globUnescape$1 (s) {
  12224. return s.replace(/\\(.)/g, '$1')
  12225. }
  12226. function regExpEscape$1 (s) {
  12227. return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&')
  12228. }
  12229. const generateHmr = (config, compilerCtx, buildCtx) => {
  12230. if (config.devServer == null || config.devServer.reloadStrategy == null) {
  12231. return null;
  12232. }
  12233. const hmr = {
  12234. reloadStrategy: config.devServer.reloadStrategy,
  12235. versionId: Date.now().toString().substring(6) + '' + Math.round(Math.random() * 89999 + 10000),
  12236. };
  12237. if (buildCtx.scriptsAdded.length > 0) {
  12238. hmr.scriptsAdded = buildCtx.scriptsAdded.slice();
  12239. }
  12240. if (buildCtx.scriptsDeleted.length > 0) {
  12241. hmr.scriptsDeleted = buildCtx.scriptsDeleted.slice();
  12242. }
  12243. const excludeHmr = excludeHmrFiles(config, config.devServer.excludeHmr, buildCtx.filesChanged);
  12244. if (excludeHmr.length > 0) {
  12245. hmr.excludeHmr = excludeHmr.slice();
  12246. }
  12247. if (buildCtx.hasHtmlChanges) {
  12248. hmr.indexHtmlUpdated = true;
  12249. }
  12250. if (buildCtx.hasServiceWorkerChanges) {
  12251. hmr.serviceWorkerUpdated = true;
  12252. }
  12253. const outputTargetsWww = config.outputTargets.filter(isOutputTargetWww);
  12254. const componentsUpdated = getComponentsUpdated(compilerCtx, buildCtx);
  12255. if (componentsUpdated) {
  12256. hmr.componentsUpdated = componentsUpdated;
  12257. }
  12258. if (Object.keys(buildCtx.stylesUpdated).length > 0) {
  12259. hmr.inlineStylesUpdated = sortBy(buildCtx.stylesUpdated.map((s) => {
  12260. return {
  12261. styleId: getScopeId(s.styleTag, s.styleMode),
  12262. styleTag: s.styleTag,
  12263. styleText: s.styleText,
  12264. };
  12265. }), (s) => s.styleId);
  12266. }
  12267. const externalStylesUpdated = getExternalStylesUpdated(buildCtx, outputTargetsWww);
  12268. if (externalStylesUpdated) {
  12269. hmr.externalStylesUpdated = externalStylesUpdated;
  12270. }
  12271. const externalImagesUpdated = getImagesUpdated(buildCtx, outputTargetsWww);
  12272. if (externalImagesUpdated) {
  12273. hmr.imagesUpdated = externalImagesUpdated;
  12274. }
  12275. return hmr;
  12276. };
  12277. const getComponentsUpdated = (compilerCtx, buildCtx) => {
  12278. // find all of the components that would be affected from the file changes
  12279. if (!buildCtx.filesChanged) {
  12280. return null;
  12281. }
  12282. const filesToLookForImporters = buildCtx.filesChanged.filter((f) => {
  12283. return f.endsWith('.ts') || f.endsWith('.tsx') || f.endsWith('.js') || f.endsWith('.jsx');
  12284. });
  12285. if (filesToLookForImporters.length === 0) {
  12286. return null;
  12287. }
  12288. const changedScriptFiles = [];
  12289. const checkedFiles = new Set();
  12290. const allModuleFiles = buildCtx.moduleFiles.filter((m) => m.localImports && m.localImports.length > 0);
  12291. while (filesToLookForImporters.length > 0) {
  12292. const scriptFile = filesToLookForImporters.shift();
  12293. addTsFileImporters(allModuleFiles, filesToLookForImporters, checkedFiles, changedScriptFiles, scriptFile);
  12294. }
  12295. const tags = changedScriptFiles.reduce((tags, changedTsFile) => {
  12296. const moduleFile = compilerCtx.moduleMap.get(changedTsFile);
  12297. if (moduleFile != null) {
  12298. moduleFile.cmps.forEach((cmp) => {
  12299. if (typeof cmp.tagName === 'string') {
  12300. if (!tags.includes(cmp.tagName)) {
  12301. tags.push(cmp.tagName);
  12302. }
  12303. }
  12304. });
  12305. }
  12306. return tags;
  12307. }, []);
  12308. if (tags.length === 0) {
  12309. return null;
  12310. }
  12311. return tags.sort();
  12312. };
  12313. const addTsFileImporters = (allModuleFiles, filesToLookForImporters, checkedFiles, changedScriptFiles, scriptFile) => {
  12314. if (!changedScriptFiles.includes(scriptFile)) {
  12315. // add it to our list of files to transpile
  12316. changedScriptFiles.push(scriptFile);
  12317. }
  12318. if (checkedFiles.has(scriptFile)) {
  12319. // already checked this file
  12320. return;
  12321. }
  12322. checkedFiles.add(scriptFile);
  12323. // get all the ts files that import this ts file
  12324. const tsFilesThatImportsThisTsFile = allModuleFiles.reduce((arr, moduleFile) => {
  12325. moduleFile.localImports.forEach((localImport) => {
  12326. let checkFile = localImport;
  12327. if (checkFile === scriptFile) {
  12328. arr.push(moduleFile.sourceFilePath);
  12329. return;
  12330. }
  12331. checkFile = localImport + '.tsx';
  12332. if (checkFile === scriptFile) {
  12333. arr.push(moduleFile.sourceFilePath);
  12334. return;
  12335. }
  12336. checkFile = localImport + '.ts';
  12337. if (checkFile === scriptFile) {
  12338. arr.push(moduleFile.sourceFilePath);
  12339. return;
  12340. }
  12341. checkFile = localImport + '.js';
  12342. if (checkFile === scriptFile) {
  12343. arr.push(moduleFile.sourceFilePath);
  12344. return;
  12345. }
  12346. });
  12347. return arr;
  12348. }, []);
  12349. // add all the files that import this ts file to the list of ts files we need to look through
  12350. tsFilesThatImportsThisTsFile.forEach((tsFileThatImportsThisTsFile) => {
  12351. // if we add to this array, then the while look will keep working until it's empty
  12352. filesToLookForImporters.push(tsFileThatImportsThisTsFile);
  12353. });
  12354. };
  12355. const getExternalStylesUpdated = (buildCtx, outputTargetsWww) => {
  12356. if (!buildCtx.isRebuild || outputTargetsWww.length === 0) {
  12357. return null;
  12358. }
  12359. const cssFiles = buildCtx.filesWritten.filter((f) => f.endsWith('.css'));
  12360. if (cssFiles.length === 0) {
  12361. return null;
  12362. }
  12363. return cssFiles.map((cssFile) => basename(cssFile)).sort();
  12364. };
  12365. const getImagesUpdated = (buildCtx, outputTargetsWww) => {
  12366. if (outputTargetsWww.length === 0) {
  12367. return null;
  12368. }
  12369. const imageFiles = buildCtx.filesChanged.reduce((arr, filePath) => {
  12370. if (IMAGE_EXT.some((ext) => filePath.toLowerCase().endsWith(ext))) {
  12371. const fileName = basename(filePath);
  12372. if (!arr.includes(fileName)) {
  12373. arr.push(fileName);
  12374. }
  12375. }
  12376. return arr;
  12377. }, []);
  12378. if (imageFiles.length === 0) {
  12379. return null;
  12380. }
  12381. return imageFiles.sort();
  12382. };
  12383. const excludeHmrFiles = (config, excludeHmr, filesChanged) => {
  12384. const excludeFiles = [];
  12385. if (!excludeHmr || excludeHmr.length === 0) {
  12386. return excludeFiles;
  12387. }
  12388. excludeHmr.forEach((excludeHmr) => {
  12389. return filesChanged
  12390. .map((fileChanged) => {
  12391. let shouldExclude = false;
  12392. if (isGlob(excludeHmr)) {
  12393. shouldExclude = minimatch_1$1(fileChanged, excludeHmr);
  12394. }
  12395. else {
  12396. shouldExclude = normalizePath$1(excludeHmr) === normalizePath$1(fileChanged);
  12397. }
  12398. if (shouldExclude) {
  12399. config.logger.debug(`excludeHmr: ${fileChanged}`);
  12400. excludeFiles.push(basename(fileChanged));
  12401. }
  12402. return shouldExclude;
  12403. })
  12404. .some((r) => r);
  12405. });
  12406. return excludeFiles.sort();
  12407. };
  12408. const IMAGE_EXT = ['.png', '.jpg', '.jpeg', '.gif', '.webp', '.ico', '.svg'];
  12409. /**
  12410. * A new BuildCtx object is created for every build
  12411. * and rebuild.
  12412. */
  12413. class BuildContext {
  12414. constructor(config, compilerCtx) {
  12415. this.buildId = -1;
  12416. this.buildMessages = [];
  12417. this.buildResults = null;
  12418. this.bundleBuildCount = 0;
  12419. this.collections = [];
  12420. this.completedTasks = [];
  12421. this.components = [];
  12422. this.componentGraph = new Map();
  12423. this.data = {};
  12424. this.buildStats = undefined;
  12425. this.diagnostics = [];
  12426. this.dirsAdded = [];
  12427. this.dirsDeleted = [];
  12428. this.entryModules = [];
  12429. this.filesAdded = [];
  12430. this.filesChanged = [];
  12431. this.filesDeleted = [];
  12432. this.filesUpdated = [];
  12433. this.filesWritten = [];
  12434. this.globalStyle = undefined;
  12435. this.hasConfigChanges = false;
  12436. this.hasFinished = false;
  12437. this.hasHtmlChanges = false;
  12438. this.hasPrintedResults = false;
  12439. this.hasServiceWorkerChanges = false;
  12440. this.hasScriptChanges = true;
  12441. this.hasStyleChanges = true;
  12442. this.hydrateAppFilePath = null;
  12443. this.indexBuildCount = 0;
  12444. this.indexDoc = undefined;
  12445. this.isRebuild = false;
  12446. this.moduleFiles = [];
  12447. this.outputs = [];
  12448. this.packageJson = {};
  12449. this.packageJsonFilePath = null;
  12450. this.pendingCopyTasks = [];
  12451. this.requiresFullBuild = true;
  12452. this.scriptsAdded = [];
  12453. this.scriptsDeleted = [];
  12454. this.startTime = Date.now();
  12455. this.styleBuildCount = 0;
  12456. this.stylesPromise = null;
  12457. this.stylesUpdated = [];
  12458. this.timeSpan = null;
  12459. this.transpileBuildCount = 0;
  12460. this.config = config;
  12461. this.compilerCtx = compilerCtx;
  12462. this.buildId = ++this.compilerCtx.activeBuildId;
  12463. this.debug = config.logger.debug.bind(config.logger);
  12464. }
  12465. start() {
  12466. // get the build id from the incremented activeBuildId
  12467. // print out a good message
  12468. const msg = `${this.isRebuild ? 'rebuild' : 'build'}, ${this.config.fsNamespace}, ${this.config.devMode ? 'dev' : 'prod'} mode, started`;
  12469. const buildLog = {
  12470. buildId: this.buildId,
  12471. messages: [],
  12472. progress: 0,
  12473. };
  12474. this.compilerCtx.events.emit('buildLog', buildLog);
  12475. // create a timespan for this build
  12476. this.timeSpan = this.createTimeSpan(msg);
  12477. // create a build timestamp for this build
  12478. this.timestamp = getBuildTimestamp();
  12479. // debug log our new build
  12480. this.debug(`start build, ${this.timestamp}`);
  12481. const buildStart = {
  12482. buildId: this.buildId,
  12483. timestamp: this.timestamp,
  12484. };
  12485. this.compilerCtx.events.emit('buildStart', buildStart);
  12486. }
  12487. createTimeSpan(msg, debug) {
  12488. if (!this.hasFinished || debug) {
  12489. if (debug) {
  12490. if (this.config.watch) {
  12491. msg = `${this.config.logger.cyan('[' + this.buildId + ']')} ${msg}`;
  12492. }
  12493. }
  12494. const timeSpan = this.config.logger.createTimeSpan(msg, debug, this.buildMessages);
  12495. if (!debug && this.compilerCtx.events) {
  12496. const buildLog = {
  12497. buildId: this.buildId,
  12498. messages: this.buildMessages,
  12499. progress: getProgress(this.completedTasks),
  12500. };
  12501. this.compilerCtx.events.emit('buildLog', buildLog);
  12502. }
  12503. return {
  12504. duration: () => {
  12505. return timeSpan.duration();
  12506. },
  12507. finish: (finishedMsg, color, bold, newLineSuffix) => {
  12508. if (!this.hasFinished || debug) {
  12509. if (debug) {
  12510. if (this.config.watch) {
  12511. finishedMsg = `${this.config.logger.cyan('[' + this.buildId + ']')} ${finishedMsg}`;
  12512. }
  12513. }
  12514. timeSpan.finish(finishedMsg, color, bold, newLineSuffix);
  12515. if (!debug) {
  12516. const buildLog = {
  12517. buildId: this.buildId,
  12518. messages: this.buildMessages.slice(),
  12519. progress: getProgress(this.completedTasks),
  12520. };
  12521. this.compilerCtx.events.emit('buildLog', buildLog);
  12522. }
  12523. }
  12524. return timeSpan.duration();
  12525. },
  12526. };
  12527. }
  12528. return {
  12529. duration() {
  12530. return 0;
  12531. },
  12532. finish() {
  12533. return 0;
  12534. },
  12535. };
  12536. }
  12537. debug(msg) {
  12538. this.config.logger.debug(msg);
  12539. }
  12540. get hasError() {
  12541. return hasError(this.diagnostics);
  12542. }
  12543. get hasWarning() {
  12544. return hasWarning(this.diagnostics);
  12545. }
  12546. progress(t) {
  12547. this.completedTasks.push(t);
  12548. }
  12549. async validateTypesBuild() {
  12550. if (this.hasError) {
  12551. // no need to wait on this one since
  12552. // we already aborted this build
  12553. return;
  12554. }
  12555. if (!this.validateTypesPromise) {
  12556. // there is no pending validate types promise
  12557. // so it probably already finished
  12558. // so no need to wait on anything
  12559. return;
  12560. }
  12561. if (!this.config.watch) {
  12562. // this is not a watch build, so we need to make
  12563. // sure that the type validation has finished
  12564. this.debug(`build, non-watch, waiting on validateTypes`);
  12565. await this.validateTypesPromise;
  12566. this.debug(`build, non-watch, finished waiting on validateTypes`);
  12567. }
  12568. }
  12569. }
  12570. const getBuildTimestamp = () => {
  12571. const d = new Date();
  12572. // YYYY-MM-DDThh:mm:ss
  12573. let timestamp = d.getUTCFullYear() + '-';
  12574. timestamp += ('0' + (d.getUTCMonth() + 1)).slice(-2) + '-';
  12575. timestamp += ('0' + d.getUTCDate()).slice(-2) + 'T';
  12576. timestamp += ('0' + d.getUTCHours()).slice(-2) + ':';
  12577. timestamp += ('0' + d.getUTCMinutes()).slice(-2) + ':';
  12578. timestamp += ('0' + d.getUTCSeconds()).slice(-2);
  12579. return timestamp;
  12580. };
  12581. const getProgress = (completedTasks) => {
  12582. let progressIndex = 0;
  12583. const taskKeys = Object.keys(ProgressTask);
  12584. taskKeys.forEach((taskKey, index) => {
  12585. if (completedTasks.includes(ProgressTask[taskKey])) {
  12586. progressIndex = index;
  12587. }
  12588. });
  12589. return (progressIndex + 1) / taskKeys.length;
  12590. };
  12591. const ProgressTask = {
  12592. emptyOutputTargets: {},
  12593. transpileApp: {},
  12594. generateStyles: {},
  12595. generateOutputTargets: {},
  12596. validateTypesBuild: {},
  12597. writeBuildFiles: {},
  12598. };
  12599. const generateBuildResults = (config, compilerCtx, buildCtx) => {
  12600. const componentGraph = buildCtx.componentGraph ? fromEntries(buildCtx.componentGraph.entries()) : undefined;
  12601. const buildResults = {
  12602. buildId: buildCtx.buildId,
  12603. diagnostics: normalizeDiagnostics(compilerCtx, buildCtx.diagnostics),
  12604. dirsAdded: buildCtx.dirsAdded.slice().sort(),
  12605. dirsDeleted: buildCtx.dirsDeleted.slice().sort(),
  12606. duration: Date.now() - buildCtx.startTime,
  12607. filesAdded: buildCtx.filesAdded.slice().sort(),
  12608. filesChanged: buildCtx.filesChanged.slice().sort(),
  12609. filesDeleted: buildCtx.filesDeleted.slice().sort(),
  12610. filesUpdated: buildCtx.filesUpdated.slice().sort(),
  12611. hasError: hasError(buildCtx.diagnostics),
  12612. hasSuccessfulBuild: compilerCtx.hasSuccessfulBuild,
  12613. isRebuild: buildCtx.isRebuild,
  12614. namespace: config.namespace,
  12615. outputs: compilerCtx.fs.getBuildOutputs(),
  12616. rootDir: config.rootDir,
  12617. srcDir: config.srcDir,
  12618. timestamp: getBuildTimestamp(),
  12619. componentGraph,
  12620. };
  12621. const hmr = generateHmr(config, compilerCtx, buildCtx);
  12622. if (hmr != null) {
  12623. buildResults.hmr = hmr;
  12624. }
  12625. if (isString$1(buildCtx.hydrateAppFilePath)) {
  12626. buildResults.hydrateAppFilePath = buildCtx.hydrateAppFilePath;
  12627. }
  12628. compilerCtx.lastBuildResults = Object.assign({}, buildResults);
  12629. return buildResults;
  12630. };
  12631. /**
  12632. * Generates the Build Stats from the buildCtx. Writes any files to the file system.
  12633. * @param config the project build configuration
  12634. * @param buildCtx An instance of the build which holds the details about the build
  12635. * @returns CompilerBuildStats or an Object including diagnostics.
  12636. */
  12637. function generateBuildStats(config, buildCtx) {
  12638. const buildResults = buildCtx.buildResults;
  12639. let jsonData;
  12640. try {
  12641. if (buildResults.hasError) {
  12642. jsonData = {
  12643. diagnostics: buildResults.diagnostics,
  12644. };
  12645. }
  12646. else {
  12647. const stats = {
  12648. timestamp: buildResults.timestamp,
  12649. compiler: {
  12650. name: config.sys.name,
  12651. version: config.sys.version,
  12652. },
  12653. app: {
  12654. namespace: config.namespace,
  12655. fsNamespace: config.fsNamespace,
  12656. components: Object.keys(buildResults.componentGraph).length,
  12657. entries: Object.keys(buildResults.componentGraph).length,
  12658. bundles: buildResults.outputs.reduce((total, en) => total + en.files.length, 0),
  12659. outputs: getAppOutputs(config, buildResults),
  12660. },
  12661. options: {
  12662. minifyJs: config.minifyJs,
  12663. minifyCss: config.minifyCss,
  12664. hashFileNames: config.hashFileNames,
  12665. hashedFileNameLength: config.hashedFileNameLength,
  12666. buildEs5: config.buildEs5,
  12667. },
  12668. formats: {
  12669. esmBrowser: sanitizeBundlesForStats(buildCtx.esmBrowserComponentBundle),
  12670. esm: sanitizeBundlesForStats(buildCtx.esmComponentBundle),
  12671. es5: sanitizeBundlesForStats(buildCtx.es5ComponentBundle),
  12672. system: sanitizeBundlesForStats(buildCtx.systemComponentBundle),
  12673. commonjs: sanitizeBundlesForStats(buildCtx.commonJsComponentBundle),
  12674. },
  12675. components: getComponentsFileMap(config, buildCtx),
  12676. entries: buildCtx.entryModules,
  12677. componentGraph: buildResults.componentGraph,
  12678. sourceGraph: getSourceGraph(config, buildCtx),
  12679. rollupResults: buildCtx.rollupResults,
  12680. collections: getCollections(config, buildCtx),
  12681. };
  12682. jsonData = stats;
  12683. }
  12684. }
  12685. catch (e) {
  12686. const diagnostic = {
  12687. messageText: `Generate Build Stats Error: ` + e,
  12688. level: `error`,
  12689. type: `build`,
  12690. };
  12691. jsonData = {
  12692. diagnostics: [diagnostic],
  12693. };
  12694. }
  12695. return jsonData;
  12696. }
  12697. /**
  12698. * Writes the files from the stats config to the file system
  12699. * @param config the project build configuration
  12700. * @param buildCtx An instance of the build which holds the details about the build
  12701. * @returns
  12702. */
  12703. async function writeBuildStats(config, data) {
  12704. const statsTargets = config.outputTargets.filter(isOutputTargetStats);
  12705. await Promise.all(statsTargets.map(async (outputTarget) => {
  12706. const result = await config.sys.writeFile(outputTarget.file, JSON.stringify(data, null, 2));
  12707. if (result.error) {
  12708. config.logger.warn([`Stats failed to write file to ${outputTarget.file}`]);
  12709. }
  12710. }));
  12711. }
  12712. function sanitizeBundlesForStats(bundleArray) {
  12713. if (!bundleArray) {
  12714. return [];
  12715. }
  12716. return bundleArray.map((bundle) => {
  12717. return {
  12718. key: bundle.entryKey,
  12719. components: bundle.cmps.map((c) => c.tagName),
  12720. bundleId: bundle.output.bundleId,
  12721. fileName: bundle.output.fileName,
  12722. imports: bundle.rollupResult.imports,
  12723. // code: bundle.rollupResult.code, // (use this to debug)
  12724. // Currently, this number is inaccurate vs what seems to be on disk.
  12725. originalByteSize: byteSize(bundle.rollupResult.code),
  12726. };
  12727. });
  12728. }
  12729. function getSourceGraph(config, buildCtx) {
  12730. let sourceGraph = {};
  12731. sortBy(buildCtx.moduleFiles, (m) => m.sourceFilePath).forEach((moduleFile) => {
  12732. const key = relativePath$1(config, moduleFile.sourceFilePath);
  12733. sourceGraph[key] = moduleFile.localImports.map((localImport) => relativePath$1(config, localImport)).sort();
  12734. });
  12735. return sourceGraph;
  12736. }
  12737. function getAppOutputs(config, buildResults) {
  12738. return buildResults.outputs.map((output) => {
  12739. return {
  12740. name: output.type,
  12741. files: output.files.length,
  12742. generatedFiles: output.files.map((file) => relativePath$1(config, file)),
  12743. };
  12744. });
  12745. }
  12746. function getComponentsFileMap(config, buildCtx) {
  12747. return buildCtx.components.map((component) => {
  12748. return {
  12749. tag: component.tagName,
  12750. path: relativePath$1(config, component.jsFilePath),
  12751. source: relativePath$1(config, component.sourceFilePath),
  12752. elementRef: component.elementRef,
  12753. componentClassName: component.componentClassName,
  12754. assetsDirs: component.assetsDirs,
  12755. dependencies: component.dependencies,
  12756. dependents: component.dependents,
  12757. directDependencies: component.directDependencies,
  12758. directDependents: component.directDependents,
  12759. docs: component.docs,
  12760. encapsulation: component.encapsulation,
  12761. excludeFromCollection: component.excludeFromCollection,
  12762. events: component.events,
  12763. internal: component.internal,
  12764. legacyConnect: component.legacyConnect,
  12765. legacyContext: component.legacyContext,
  12766. listeners: component.listeners,
  12767. methods: component.methods,
  12768. potentialCmpRefs: component.potentialCmpRefs,
  12769. properties: component.properties,
  12770. shadowDelegatesFocus: component.shadowDelegatesFocus,
  12771. states: component.states,
  12772. };
  12773. });
  12774. }
  12775. function getCollections(config, buildCtx) {
  12776. return buildCtx.collections
  12777. .map((c) => {
  12778. return {
  12779. name: c.collectionName,
  12780. source: relativePath$1(config, c.moduleDir),
  12781. tags: c.moduleFiles.map((m) => m.cmps.map((cmp) => cmp.tagName)).sort(),
  12782. };
  12783. })
  12784. .sort((a, b) => {
  12785. if (a.name < b.name)
  12786. return -1;
  12787. if (a.name > b.name)
  12788. return 1;
  12789. return 0;
  12790. });
  12791. }
  12792. function relativePath$1(config, file) {
  12793. return config.sys.normalizePath(config.sys.platformPath.relative(config.rootDir, file));
  12794. }
  12795. /**
  12796. * Finish a build as having completed successfully
  12797. * @param buildCtx the build context for the build being aborted
  12798. * @returns the build results
  12799. */
  12800. const buildFinish = async (buildCtx) => {
  12801. const results = await buildDone(buildCtx.config, buildCtx.compilerCtx, buildCtx, false);
  12802. const buildLog = {
  12803. buildId: buildCtx.buildId,
  12804. messages: buildCtx.buildMessages.slice(),
  12805. progress: 1,
  12806. };
  12807. buildCtx.compilerCtx.events.emit('buildLog', buildLog);
  12808. return results;
  12809. };
  12810. /**
  12811. * Finish a build early due to failure. During the build process, a fatal error has occurred where the compiler cannot
  12812. * continue further
  12813. * @param buildCtx the build context for the build being aborted
  12814. * @returns the build results
  12815. */
  12816. const buildAbort = (buildCtx) => {
  12817. return buildDone(buildCtx.config, buildCtx.compilerCtx, buildCtx, true);
  12818. };
  12819. /**
  12820. * Mark a build as done
  12821. * @param config the Stencil configuration used for the build
  12822. * @param compilerCtx the compiler context associated with the build
  12823. * @param buildCtx the build context associated with the build to mark as done
  12824. * @param aborted true if the build ended early due to failure, false otherwise
  12825. * @returns the build results
  12826. */
  12827. const buildDone = async (config, compilerCtx, buildCtx, aborted) => {
  12828. if (buildCtx.hasFinished && buildCtx.buildResults) {
  12829. // we've already marked this build as finished and
  12830. // already created the build results, just return these
  12831. return buildCtx.buildResults;
  12832. }
  12833. // create the build results data
  12834. buildCtx.buildResults = generateBuildResults(config, compilerCtx, buildCtx);
  12835. // After the build results are available on the buildCtx, call the stats and set it.
  12836. // We will use this later to write the files.
  12837. buildCtx.buildStats = generateBuildStats(config, buildCtx);
  12838. await writeBuildStats(config, buildCtx.buildStats);
  12839. buildCtx.debug(`${aborted ? 'aborted' : 'finished'} build, ${buildCtx.buildResults.duration}ms`);
  12840. // log any errors/warnings
  12841. if (!buildCtx.hasFinished) {
  12842. // haven't set this build as finished yet
  12843. if (!buildCtx.hasPrintedResults) {
  12844. cleanDiagnosticsRelativePath(config, buildCtx.buildResults.diagnostics);
  12845. config.logger.printDiagnostics(buildCtx.buildResults.diagnostics);
  12846. }
  12847. const hasChanges = buildCtx.hasScriptChanges || buildCtx.hasStyleChanges;
  12848. if (buildCtx.isRebuild && hasChanges && buildCtx.buildResults.hmr && !aborted) {
  12849. // this is a rebuild, and we've got hmr data
  12850. // and this build hasn't been aborted
  12851. logHmr(config.logger, buildCtx);
  12852. }
  12853. // create a nice pretty message stating what happened
  12854. const buildText = buildCtx.isRebuild ? 'rebuild' : 'build';
  12855. const watchText = config.watch ? ', watching for changes...' : '';
  12856. let buildStatus = 'finished';
  12857. let statusColor = 'green';
  12858. if (buildCtx.hasError) {
  12859. // gosh darn, build had errors
  12860. // ಥ_ಥ
  12861. buildStatus = 'failed';
  12862. statusColor = 'red';
  12863. }
  12864. else {
  12865. // successful build!
  12866. // ┏(°.°)┛ ┗(°.°)┓ ┗(°.°)┛ ┏(°.°)┓
  12867. compilerCtx.changedFiles.clear();
  12868. compilerCtx.hasSuccessfulBuild = true;
  12869. buildCtx.buildResults.hasSuccessfulBuild = true;
  12870. }
  12871. // print out the time it took to build
  12872. // and add the duration to the build results
  12873. if (!buildCtx.hasPrintedResults) {
  12874. buildCtx.timeSpan.finish(`${buildText} ${buildStatus}${watchText}`, statusColor, true, true);
  12875. buildCtx.hasPrintedResults = true;
  12876. }
  12877. // emit a buildFinish event for anyone who cares
  12878. compilerCtx.events.emit('buildFinish', buildCtx.buildResults);
  12879. // write all of our logs to disk if config'd to do so
  12880. // do this even if there are errors or not the active build
  12881. if (isFunction(config.logger.writeLogs)) {
  12882. config.logger.writeLogs(buildCtx.isRebuild);
  12883. }
  12884. }
  12885. // it's official, this build has finished
  12886. buildCtx.hasFinished = true;
  12887. if (!config.watch) {
  12888. compilerCtx.reset();
  12889. if (IS_NODE_ENV && global.gc) {
  12890. buildCtx.debug(`triggering forced gc`);
  12891. global.gc();
  12892. buildCtx.debug(`forced gc finished`);
  12893. }
  12894. }
  12895. return buildCtx.buildResults;
  12896. };
  12897. const logHmr = (logger, buildCtx) => {
  12898. // this is a rebuild, and we've got hmr data
  12899. // and this build hasn't been aborted
  12900. const hmr = buildCtx.buildResults.hmr;
  12901. if (hmr.componentsUpdated) {
  12902. cleanupUpdateMsg(logger, `updated component`, hmr.componentsUpdated);
  12903. }
  12904. if (hmr.inlineStylesUpdated) {
  12905. const inlineStyles = hmr.inlineStylesUpdated
  12906. .map((s) => s.styleTag)
  12907. .reduce((arr, v) => {
  12908. if (!arr.includes(v)) {
  12909. arr.push(v);
  12910. }
  12911. return arr;
  12912. }, []);
  12913. cleanupUpdateMsg(logger, `updated style`, inlineStyles);
  12914. }
  12915. if (hmr.externalStylesUpdated) {
  12916. cleanupUpdateMsg(logger, `updated stylesheet`, hmr.externalStylesUpdated);
  12917. }
  12918. if (hmr.imagesUpdated) {
  12919. cleanupUpdateMsg(logger, `updated image`, hmr.imagesUpdated);
  12920. }
  12921. };
  12922. const cleanupUpdateMsg = (logger, msg, fileNames) => {
  12923. if (fileNames.length > 0) {
  12924. let fileMsg = '';
  12925. if (fileNames.length > 7) {
  12926. const remaining = fileNames.length - 6;
  12927. fileNames = fileNames.slice(0, 6);
  12928. fileMsg = fileNames.join(', ') + `, +${remaining} others`;
  12929. }
  12930. else {
  12931. fileMsg = fileNames.join(', ');
  12932. }
  12933. if (fileNames.length > 1) {
  12934. msg += 's';
  12935. }
  12936. logger.info(`${msg}: ${logger.cyan(fileMsg)}`);
  12937. }
  12938. };
  12939. /**
  12940. * Update the relative file path for diagnostics. The updates are done in place.
  12941. * @param config the Stencil configuration associated with the current build
  12942. * @param diagnostics the diagnostics to update
  12943. */
  12944. const cleanDiagnosticsRelativePath = (config, diagnostics) => {
  12945. diagnostics.forEach((diagnostic) => {
  12946. if (!diagnostic.relFilePath && !isRemoteUrl(diagnostic.absFilePath) && diagnostic.absFilePath && config.rootDir) {
  12947. diagnostic.relFilePath = relative$1(config.rootDir, diagnostic.absFilePath);
  12948. }
  12949. });
  12950. };
  12951. const CONTENT_REF_ID = 'r';
  12952. const ORG_LOCATION_ID = 'o';
  12953. const SLOT_NODE_ID = 's';
  12954. const TEXT_NODE_ID = 't';
  12955. const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
  12956. const XLINK_NS = 'http://www.w3.org/1999/xlink';
  12957. const attrHandler = {
  12958. get(obj, prop) {
  12959. if (prop in obj) {
  12960. return obj[prop];
  12961. }
  12962. if (typeof prop !== 'symbol' && !isNaN(prop)) {
  12963. return obj.__items[prop];
  12964. }
  12965. return undefined;
  12966. },
  12967. };
  12968. const createAttributeProxy = (caseInsensitive) => new Proxy(new MockAttributeMap(caseInsensitive), attrHandler);
  12969. class MockAttributeMap {
  12970. constructor(caseInsensitive = false) {
  12971. this.caseInsensitive = caseInsensitive;
  12972. this.__items = [];
  12973. }
  12974. get length() {
  12975. return this.__items.length;
  12976. }
  12977. item(index) {
  12978. return this.__items[index] || null;
  12979. }
  12980. setNamedItem(attr) {
  12981. attr.namespaceURI = null;
  12982. this.setNamedItemNS(attr);
  12983. }
  12984. setNamedItemNS(attr) {
  12985. if (attr != null && attr.value != null) {
  12986. attr.value = String(attr.value);
  12987. }
  12988. const existingAttr = this.__items.find((a) => a.name === attr.name && a.namespaceURI === attr.namespaceURI);
  12989. if (existingAttr != null) {
  12990. existingAttr.value = attr.value;
  12991. }
  12992. else {
  12993. this.__items.push(attr);
  12994. }
  12995. }
  12996. getNamedItem(attrName) {
  12997. if (this.caseInsensitive) {
  12998. attrName = attrName.toLowerCase();
  12999. }
  13000. return this.getNamedItemNS(null, attrName);
  13001. }
  13002. getNamedItemNS(namespaceURI, attrName) {
  13003. namespaceURI = getNamespaceURI(namespaceURI);
  13004. return (this.__items.find((attr) => attr.name === attrName && getNamespaceURI(attr.namespaceURI) === namespaceURI) || null);
  13005. }
  13006. removeNamedItem(attr) {
  13007. this.removeNamedItemNS(attr);
  13008. }
  13009. removeNamedItemNS(attr) {
  13010. for (let i = 0, ii = this.__items.length; i < ii; i++) {
  13011. if (this.__items[i].name === attr.name && this.__items[i].namespaceURI === attr.namespaceURI) {
  13012. this.__items.splice(i, 1);
  13013. break;
  13014. }
  13015. }
  13016. }
  13017. [Symbol.iterator]() {
  13018. let i = 0;
  13019. return {
  13020. next: () => ({
  13021. done: i === this.length,
  13022. value: this.item(i++),
  13023. }),
  13024. };
  13025. }
  13026. get [Symbol.toStringTag]() {
  13027. return 'MockAttributeMap';
  13028. }
  13029. }
  13030. function getNamespaceURI(namespaceURI) {
  13031. return namespaceURI === XLINK_NS ? null : namespaceURI;
  13032. }
  13033. function cloneAttributes(srcAttrs, sortByName = false) {
  13034. const dstAttrs = new MockAttributeMap(srcAttrs.caseInsensitive);
  13035. if (srcAttrs != null) {
  13036. const attrLen = srcAttrs.length;
  13037. if (sortByName && attrLen > 1) {
  13038. const sortedAttrs = [];
  13039. for (let i = 0; i < attrLen; i++) {
  13040. const srcAttr = srcAttrs.item(i);
  13041. const dstAttr = new MockAttr(srcAttr.name, srcAttr.value, srcAttr.namespaceURI);
  13042. sortedAttrs.push(dstAttr);
  13043. }
  13044. sortedAttrs.sort(sortAttributes).forEach((attr) => {
  13045. dstAttrs.setNamedItemNS(attr);
  13046. });
  13047. }
  13048. else {
  13049. for (let i = 0; i < attrLen; i++) {
  13050. const srcAttr = srcAttrs.item(i);
  13051. const dstAttr = new MockAttr(srcAttr.name, srcAttr.value, srcAttr.namespaceURI);
  13052. dstAttrs.setNamedItemNS(dstAttr);
  13053. }
  13054. }
  13055. }
  13056. return dstAttrs;
  13057. }
  13058. function sortAttributes(a, b) {
  13059. if (a.name < b.name)
  13060. return -1;
  13061. if (a.name > b.name)
  13062. return 1;
  13063. return 0;
  13064. }
  13065. class MockAttr {
  13066. constructor(attrName, attrValue, namespaceURI = null) {
  13067. this._name = attrName;
  13068. this._value = String(attrValue);
  13069. this._namespaceURI = namespaceURI;
  13070. }
  13071. get name() {
  13072. return this._name;
  13073. }
  13074. set name(value) {
  13075. this._name = value;
  13076. }
  13077. get value() {
  13078. return this._value;
  13079. }
  13080. set value(value) {
  13081. this._value = String(value);
  13082. }
  13083. get nodeName() {
  13084. return this._name;
  13085. }
  13086. set nodeName(value) {
  13087. this._name = value;
  13088. }
  13089. get nodeValue() {
  13090. return this._value;
  13091. }
  13092. set nodeValue(value) {
  13093. this._value = String(value);
  13094. }
  13095. get namespaceURI() {
  13096. return this._namespaceURI;
  13097. }
  13098. set namespaceURI(namespaceURI) {
  13099. this._namespaceURI = namespaceURI;
  13100. }
  13101. }
  13102. class MockCustomElementRegistry {
  13103. constructor(win) {
  13104. this.win = win;
  13105. }
  13106. define(tagName, cstr, options) {
  13107. if (tagName.toLowerCase() !== tagName) {
  13108. throw new Error(`Failed to execute 'define' on 'CustomElementRegistry': "${tagName}" is not a valid custom element name`);
  13109. }
  13110. if (this.__registry == null) {
  13111. this.__registry = new Map();
  13112. }
  13113. this.__registry.set(tagName, { cstr, options });
  13114. if (this.__whenDefined != null) {
  13115. const whenDefinedResolveFns = this.__whenDefined.get(tagName);
  13116. if (whenDefinedResolveFns != null) {
  13117. whenDefinedResolveFns.forEach((whenDefinedResolveFn) => {
  13118. whenDefinedResolveFn();
  13119. });
  13120. whenDefinedResolveFns.length = 0;
  13121. this.__whenDefined.delete(tagName);
  13122. }
  13123. }
  13124. const doc = this.win.document;
  13125. if (doc != null) {
  13126. const hosts = doc.querySelectorAll(tagName);
  13127. hosts.forEach((host) => {
  13128. if (upgradedElements.has(host) === false) {
  13129. tempDisableCallbacks.add(doc);
  13130. const upgradedCmp = createCustomElement(this, doc, tagName);
  13131. for (let i = 0; i < host.childNodes.length; i++) {
  13132. const childNode = host.childNodes[i];
  13133. childNode.remove();
  13134. upgradedCmp.appendChild(childNode);
  13135. }
  13136. tempDisableCallbacks.delete(doc);
  13137. if (proxyElements.has(host)) {
  13138. proxyElements.set(host, upgradedCmp);
  13139. }
  13140. }
  13141. fireConnectedCallback(host);
  13142. });
  13143. }
  13144. }
  13145. get(tagName) {
  13146. if (this.__registry != null) {
  13147. const def = this.__registry.get(tagName.toLowerCase());
  13148. if (def != null) {
  13149. return def.cstr;
  13150. }
  13151. }
  13152. return undefined;
  13153. }
  13154. upgrade(_rootNode) {
  13155. //
  13156. }
  13157. clear() {
  13158. if (this.__registry != null) {
  13159. this.__registry.clear();
  13160. }
  13161. if (this.__whenDefined != null) {
  13162. this.__whenDefined.clear();
  13163. }
  13164. }
  13165. whenDefined(tagName) {
  13166. tagName = tagName.toLowerCase();
  13167. if (this.__registry != null && this.__registry.has(tagName) === true) {
  13168. return Promise.resolve(this.__registry.get(tagName).cstr);
  13169. }
  13170. return new Promise((resolve) => {
  13171. if (this.__whenDefined == null) {
  13172. this.__whenDefined = new Map();
  13173. }
  13174. let whenDefinedResolveFns = this.__whenDefined.get(tagName);
  13175. if (whenDefinedResolveFns == null) {
  13176. whenDefinedResolveFns = [];
  13177. this.__whenDefined.set(tagName, whenDefinedResolveFns);
  13178. }
  13179. whenDefinedResolveFns.push(resolve);
  13180. });
  13181. }
  13182. }
  13183. function createCustomElement(customElements, ownerDocument, tagName) {
  13184. const Cstr = customElements.get(tagName);
  13185. if (Cstr != null) {
  13186. const cmp = new Cstr(ownerDocument);
  13187. cmp.nodeName = tagName.toUpperCase();
  13188. upgradedElements.add(cmp);
  13189. return cmp;
  13190. }
  13191. const host = new Proxy({}, {
  13192. get(obj, prop) {
  13193. const elm = proxyElements.get(host);
  13194. if (elm != null) {
  13195. return elm[prop];
  13196. }
  13197. return obj[prop];
  13198. },
  13199. set(obj, prop, val) {
  13200. const elm = proxyElements.get(host);
  13201. if (elm != null) {
  13202. elm[prop] = val;
  13203. }
  13204. else {
  13205. obj[prop] = val;
  13206. }
  13207. return true;
  13208. },
  13209. has(obj, prop) {
  13210. const elm = proxyElements.get(host);
  13211. if (prop in elm) {
  13212. return true;
  13213. }
  13214. if (prop in obj) {
  13215. return true;
  13216. }
  13217. return false;
  13218. },
  13219. });
  13220. const elm = new MockHTMLElement(ownerDocument, tagName);
  13221. proxyElements.set(host, elm);
  13222. return host;
  13223. }
  13224. const proxyElements = new WeakMap();
  13225. const upgradedElements = new WeakSet();
  13226. function connectNode(ownerDocument, node) {
  13227. node.ownerDocument = ownerDocument;
  13228. if (node.nodeType === 1 /* ELEMENT_NODE */) {
  13229. if (ownerDocument != null && node.nodeName.includes('-')) {
  13230. const win = ownerDocument.defaultView;
  13231. if (win != null && typeof node.connectedCallback === 'function' && node.isConnected) {
  13232. fireConnectedCallback(node);
  13233. }
  13234. const shadowRoot = node.shadowRoot;
  13235. if (shadowRoot != null) {
  13236. shadowRoot.childNodes.forEach((childNode) => {
  13237. connectNode(ownerDocument, childNode);
  13238. });
  13239. }
  13240. }
  13241. node.childNodes.forEach((childNode) => {
  13242. connectNode(ownerDocument, childNode);
  13243. });
  13244. }
  13245. else {
  13246. node.childNodes.forEach((childNode) => {
  13247. childNode.ownerDocument = ownerDocument;
  13248. });
  13249. }
  13250. }
  13251. function fireConnectedCallback(node) {
  13252. if (typeof node.connectedCallback === 'function') {
  13253. if (tempDisableCallbacks.has(node.ownerDocument) === false) {
  13254. try {
  13255. node.connectedCallback();
  13256. }
  13257. catch (e) {
  13258. console.error(e);
  13259. }
  13260. }
  13261. }
  13262. }
  13263. function disconnectNode(node) {
  13264. if (node.nodeType === 1 /* ELEMENT_NODE */) {
  13265. if (node.nodeName.includes('-') === true && typeof node.disconnectedCallback === 'function') {
  13266. if (tempDisableCallbacks.has(node.ownerDocument) === false) {
  13267. try {
  13268. node.disconnectedCallback();
  13269. }
  13270. catch (e) {
  13271. console.error(e);
  13272. }
  13273. }
  13274. }
  13275. node.childNodes.forEach(disconnectNode);
  13276. }
  13277. }
  13278. function attributeChanged(node, attrName, oldValue, newValue) {
  13279. attrName = attrName.toLowerCase();
  13280. const observedAttributes = node.constructor.observedAttributes;
  13281. if (Array.isArray(observedAttributes) === true &&
  13282. observedAttributes.some((obs) => obs.toLowerCase() === attrName) === true) {
  13283. try {
  13284. node.attributeChangedCallback(attrName, oldValue, newValue);
  13285. }
  13286. catch (e) {
  13287. console.error(e);
  13288. }
  13289. }
  13290. }
  13291. function checkAttributeChanged(node) {
  13292. return node.nodeName.includes('-') === true && typeof node.attributeChangedCallback === 'function';
  13293. }
  13294. const tempDisableCallbacks = new Set();
  13295. function dataset(elm) {
  13296. const ds = {};
  13297. const attributes = elm.attributes;
  13298. const attrLen = attributes.length;
  13299. for (let i = 0; i < attrLen; i++) {
  13300. const attr = attributes.item(i);
  13301. const nodeName = attr.nodeName;
  13302. if (nodeName.startsWith('data-')) {
  13303. ds[dashToPascalCase(nodeName)] = attr.nodeValue;
  13304. }
  13305. }
  13306. return new Proxy(ds, {
  13307. get(_obj, camelCaseProp) {
  13308. return ds[camelCaseProp];
  13309. },
  13310. set(_obj, camelCaseProp, value) {
  13311. const dataAttr = toDataAttribute(camelCaseProp);
  13312. elm.setAttribute(dataAttr, value);
  13313. return true;
  13314. },
  13315. });
  13316. }
  13317. function toDataAttribute(str) {
  13318. return ('data-' +
  13319. String(str)
  13320. .replace(/([A-Z0-9])/g, (g) => ' ' + g[0])
  13321. .trim()
  13322. .replace(/ /g, '-')
  13323. .toLowerCase());
  13324. }
  13325. function dashToPascalCase(str) {
  13326. str = String(str).slice(5);
  13327. return str
  13328. .split('-')
  13329. .map((segment, index) => {
  13330. if (index === 0) {
  13331. return segment.charAt(0).toLowerCase() + segment.slice(1);
  13332. }
  13333. return segment.charAt(0).toUpperCase() + segment.slice(1);
  13334. })
  13335. .join('');
  13336. }
  13337. // Sizzle 2.3.6
  13338. const Sizzle = (function() {
  13339. const window = {
  13340. document: {
  13341. createElement() {
  13342. return {};
  13343. },
  13344. nodeType: 9,
  13345. documentElement: {
  13346. nodeType: 1,
  13347. nodeName: 'HTML'
  13348. }
  13349. }
  13350. };
  13351. const module = { exports: {} };
  13352. /*! Sizzle v2.3.6 | (c) JS Foundation and other contributors | js.foundation */
  13353. !function(e){var t,n,r,i,o,u,l,a,c,s,d,f,p,h,g,m,y,v,w,b="sizzle"+1*new Date,N=e.document,C=0,x=0,E=ae(),A=ae(),S=ae(),D=ae(),T=function(e,t){return e===t&&(d=!0),0},L={}.hasOwnProperty,q=[],I=q.pop,B=q.push,R=q.push,$=q.slice,k=function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return -1},H="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",P="(?:\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",z="\\["+M+"*("+P+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+P+"))|)"+M+"*\\]",F=":("+P+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+z+")*)|.*)\\)|)",O=new RegExp(M+"+","g"),j=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),G=new RegExp("^"+M+"*,"+M+"*"),U=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),V=new RegExp(M+"|>"),X=new RegExp(F),J=new RegExp("^"+P+"$"),K={ID:new RegExp("^#("+P+")"),CLASS:new RegExp("^\\.("+P+")"),TAG:new RegExp("^("+P+"|[*])"),ATTR:new RegExp("^"+z),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+H+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Q=/HTML$/i,W=/^(?:input|select|textarea|button)$/i,Y=/^h\d$/i,Z=/^[^{]+\{\s*\[native \w/,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){f();},ue=ve(function(e){return !0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{R.apply(q=$.call(N.childNodes),N.childNodes),q[N.childNodes.length].nodeType;}catch(e){R={apply:q.length?function(e,t){B.apply(e,$.call(t));}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1;}};}function le(e,t,r,i){var o,l,c,s,d,h,y,v=t&&t.ownerDocument,N=t?t.nodeType:9;if(r=r||[],"string"!=typeof e||!e||1!==N&&9!==N&&11!==N)return r;if(!i&&(f(t),t=t||p,g)){if(11!==N&&(d=_.exec(e)))if(o=d[1]){if(9===N){if(!(c=t.getElementById(o)))return r;if(c.id===o)return r.push(c),r}else if(v&&(c=v.getElementById(o))&&w(t,c)&&c.id===o)return r.push(c),r}else {if(d[2])return R.apply(r,t.getElementsByTagName(e)),r;if((o=d[3])&&n.getElementsByClassName&&t.getElementsByClassName)return R.apply(r,t.getElementsByClassName(o)),r}if(n.qsa&&!D[e+" "]&&(!m||!m.test(e))&&(1!==N||"object"!==t.nodeName.toLowerCase())){if(y=e,v=t,1===N&&(V.test(e)||U.test(e))){(v=ee.test(e)&&ge(t.parentNode)||t)===t&&n.scope||((s=t.getAttribute("id"))?s=s.replace(re,ie):t.setAttribute("id",s=b)),l=(h=u(e)).length;while(l--)h[l]=(s?"#"+s:":scope")+" "+ye(h[l]);y=h.join(",");}try{return R.apply(r,v.querySelectorAll(y)),r}catch(t){D(e,!0);}finally{s===b&&t.removeAttribute("id");}}}return a(e.replace(j,"$1"),t,r,i)}function ae(){var e=[];function t(n,i){return e.push(n+" ")>r.cacheLength&&delete t[e.shift()],t[n+" "]=i}return t}function ce(e){return e[b]=!0,e}function se(e){var t=p.createElement("fieldset");try{return !!e(t)}catch(e){return !1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null;}}function de(e,t){var n=e.split("|"),i=n.length;while(i--)r.attrHandle[n[i]]=t;}function fe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return -1;return e?1:-1}function pe(e){return function(t){return "form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&ue(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function he(e){return ce(function(t){return t=+t,ce(function(n,r){var i,o=e([],n.length,t),u=o.length;while(u--)n[i=o[u]]&&(n[i]=!(r[i]=n[i]));})})}function ge(e){return e&&void 0!==e.getElementsByTagName&&e}n=le.support={},o=le.isXML=function(e){var t=e&&e.namespaceURI,n=e&&(e.ownerDocument||e).documentElement;return !Q.test(t||n&&n.nodeName||"HTML")},f=le.setDocument=function(e){var t,i,u=e?e.ownerDocument||e:N;return u!=p&&9===u.nodeType&&u.documentElement?(p=u,h=p.documentElement,g=!o(p),N!=p&&(i=p.defaultView)&&i.top!==i&&(i.addEventListener?i.addEventListener("unload",oe,!1):i.attachEvent&&i.attachEvent("onunload",oe)),n.scope=se(function(e){return h.appendChild(e).appendChild(p.createElement("div")),void 0!==e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),n.attributes=se(function(e){return e.className="i",!e.getAttribute("className")}),n.getElementsByTagName=se(function(e){return e.appendChild(p.createComment("")),!e.getElementsByTagName("*").length}),n.getElementsByClassName=Z.test(p.getElementsByClassName),n.getById=se(function(e){return h.appendChild(e).id=b,!p.getElementsByName||!p.getElementsByName(b).length}),n.getById?(r.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},r.find.ID=function(e,t){if(void 0!==t.getElementById&&g){var n=t.getElementById(e);return n?[n]:[]}}):(r.filter.ID=function(e){var t=e.replace(te,ne);return function(e){var n=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},r.find.ID=function(e,t){if(void 0!==t.getElementById&&g){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return [o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return [o]}return []}}),r.find.TAG=n.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):n.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},r.find.CLASS=n.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&g)return t.getElementsByClassName(e)},y=[],m=[],(n.qsa=Z.test(p.querySelectorAll))&&(se(function(e){var t;h.appendChild(e).innerHTML="<a id='"+b+"'></a><select id='"+b+"-\r\\' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&m.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||m.push("\\["+M+"*(?:value|"+H+")"),e.querySelectorAll("[id~="+b+"-]").length||m.push("~="),(t=p.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||m.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||m.push(":checked"),e.querySelectorAll("a#"+b+"+*").length||m.push(".#.+[+~]"),e.querySelectorAll("\\\f"),m.push("[\\r\\n\\f]");}),se(function(e){e.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var t=p.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&m.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&m.push(":enabled",":disabled"),h.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&m.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),m.push(",.*:");})),(n.matchesSelector=Z.test(v=h.matches||h.webkitMatchesSelector||h.mozMatchesSelector||h.oMatchesSelector||h.msMatchesSelector))&&se(function(e){n.disconnectedMatch=v.call(e,"*"),v.call(e,"[s!='']:x"),y.push("!=",F);}),m=m.length&&new RegExp(m.join("|")),y=y.length&&new RegExp(y.join("|")),t=Z.test(h.compareDocumentPosition),w=t||Z.test(h.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return !0;return !1},T=t?function(e,t){if(e===t)return d=!0,0;var r=!e.compareDocumentPosition-!t.compareDocumentPosition;return r||(1&(r=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!n.sortDetached&&t.compareDocumentPosition(e)===r?e==p||e.ownerDocument==N&&w(N,e)?-1:t==p||t.ownerDocument==N&&w(N,t)?1:s?k(s,e)-k(s,t):0:4&r?-1:1)}:function(e,t){if(e===t)return d=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,u=[e],l=[t];if(!i||!o)return e==p?-1:t==p?1:i?-1:o?1:s?k(s,e)-k(s,t):0;if(i===o)return fe(e,t);n=e;while(n=n.parentNode)u.unshift(n);n=t;while(n=n.parentNode)l.unshift(n);while(u[r]===l[r])r++;return r?fe(u[r],l[r]):u[r]==N?-1:l[r]==N?1:0},p):p},le.matches=function(e,t){return le(e,null,null,t)},le.matchesSelector=function(e,t){if(f(e),n.matchesSelector&&g&&!D[t+" "]&&(!y||!y.test(t))&&(!m||!m.test(t)))try{var r=v.call(e,t);if(r||n.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(e){D(t,!0);}return le(t,p,null,[e]).length>0},le.contains=function(e,t){return (e.ownerDocument||e)!=p&&f(e),w(e,t)},le.attr=function(e,t){(e.ownerDocument||e)!=p&&f(e);var i=r.attrHandle[t.toLowerCase()],o=i&&L.call(r.attrHandle,t.toLowerCase())?i(e,t,!g):void 0;return void 0!==o?o:n.attributes||!g?e.getAttribute(t):(o=e.getAttributeNode(t))&&o.specified?o.value:null},le.escape=function(e){return (e+"").replace(re,ie)},le.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},le.uniqueSort=function(e){var t,r=[],i=0,o=0;if(d=!n.detectDuplicates,s=!n.sortStable&&e.slice(0),e.sort(T),d){while(t=e[o++])t===e[o]&&(i=r.push(o));while(i--)e.splice(r[i],1);}return s=null,e},i=le.getText=function(e){var t,n="",r=0,o=e.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=i(e);}else if(3===o||4===o)return e.nodeValue}else while(t=e[r++])n+=i(t);return n},(r=le.selectors={cacheLength:50,createPseudo:ce,match:K,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||le.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&le.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return K.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=u(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return "*"===e?function(){return !0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=E[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&E(e,function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=le.attr(r,e);return null==i?"!="===t:!t||(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i.replace(O," ")+" ").indexOf(n)>-1:"|="===t&&(i===n||i.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),u="last"!==e.slice(-4),l="of-type"===t;return 1===r&&0===i?function(e){return !!e.parentNode}:function(t,n,a){var c,s,d,f,p,h,g=o!==u?"nextSibling":"previousSibling",m=t.parentNode,y=l&&t.nodeName.toLowerCase(),v=!a&&!l,w=!1;if(m){if(o){while(g){f=t;while(f=f[g])if(l?f.nodeName.toLowerCase()===y:1===f.nodeType)return !1;h=g="only"===e&&!h&&"nextSibling";}return !0}if(h=[u?m.firstChild:m.lastChild],u&&v){w=(p=(c=(s=(d=(f=m)[b]||(f[b]={}))[f.uniqueID]||(d[f.uniqueID]={}))[e]||[])[0]===C&&c[1])&&c[2],f=p&&m.childNodes[p];while(f=++p&&f&&f[g]||(w=p=0)||h.pop())if(1===f.nodeType&&++w&&f===t){s[e]=[C,p,w];break}}else if(v&&(w=p=(c=(s=(d=(f=t)[b]||(f[b]={}))[f.uniqueID]||(d[f.uniqueID]={}))[e]||[])[0]===C&&c[1]),!1===w)while(f=++p&&f&&f[g]||(w=p=0)||h.pop())if((l?f.nodeName.toLowerCase()===y:1===f.nodeType)&&++w&&(v&&((s=(d=f[b]||(f[b]={}))[f.uniqueID]||(d[f.uniqueID]={}))[e]=[C,w]),f===t))break;return (w-=i)===r||w%r==0&&w/r>=0}}},PSEUDO:function(e,t){var n,i=r.pseudos[e]||r.setFilters[e.toLowerCase()]||le.error("unsupported pseudo: "+e);return i[b]?i(t):i.length>1?(n=[e,e,"",t],r.setFilters.hasOwnProperty(e.toLowerCase())?ce(function(e,n){var r,o=i(e,t),u=o.length;while(u--)e[r=k(e,o[u])]=!(n[r]=o[u]);}):function(e){return i(e,0,n)}):i}},pseudos:{not:ce(function(e){var t=[],n=[],r=l(e.replace(j,"$1"));return r[b]?ce(function(e,t,n,i){var o,u=r(e,null,i,[]),l=e.length;while(l--)(o=u[l])&&(e[l]=!(t[l]=o));}):function(e,i,o){return t[0]=e,r(t,null,o,n),t[0]=null,!n.pop()}}),has:ce(function(e){return function(t){return le(e,t).length>0}}),contains:ce(function(e){return e=e.replace(te,ne),function(t){return (t.textContent||i(t)).indexOf(e)>-1}}),lang:ce(function(e){return J.test(e||"")||le.error("unsupported lang: "+e),e=e.replace(te,ne).toLowerCase(),function(t){var n;do{if(n=g?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return (n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return !1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===h},focus:function(e){return e===p.activeElement&&(!p.hasFocus||p.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:pe(!1),disabled:pe(!0),checked:function(e){var t=e.nodeName.toLowerCase();return "input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return !0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return !1;return !0},parent:function(e){return !r.pseudos.empty(e)},header:function(e){return Y.test(e.nodeName)},input:function(e){return W.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return "input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return "input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:he(function(){return [0]}),last:he(function(e,t){return [t-1]}),eq:he(function(e,t,n){return [n<0?n+t:n]}),even:he(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:he(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:he(function(e,t,n){for(var r=n<0?n+t:n>t?t:n;--r>=0;)e.push(r);return e}),gt:he(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}}).pseudos.nth=r.pseudos.eq;for(t in {radio:!0,checkbox:!0,file:!0,password:!0,image:!0})r.pseudos[t]=function(e){return function(t){return "input"===t.nodeName.toLowerCase()&&t.type===e}}(t);for(t in {submit:!0,reset:!0})r.pseudos[t]=function(e){return function(t){var n=t.nodeName.toLowerCase();return ("input"===n||"button"===n)&&t.type===e}}(t);function me(){}me.prototype=r.filters=r.pseudos,r.setFilters=new me,u=le.tokenize=function(e,t){var n,i,o,u,l,a,c,s=A[e+" "];if(s)return t?0:s.slice(0);l=e,a=[],c=r.preFilter;while(l){n&&!(i=G.exec(l))||(i&&(l=l.slice(i[0].length)||l),a.push(o=[])),n=!1,(i=U.exec(l))&&(n=i.shift(),o.push({value:n,type:i[0].replace(j," ")}),l=l.slice(n.length));for(u in r.filter)!(i=K[u].exec(l))||c[u]&&!(i=c[u](i))||(n=i.shift(),o.push({value:n,type:u,matches:i}),l=l.slice(n.length));if(!n)break}return t?l.length:l?le.error(e):A(e,a).slice(0)};function ye(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function ve(e,t,n){var r=t.dir,i=t.next,o=i||r,u=n&&"parentNode"===o,l=x++;return t.first?function(t,n,i){while(t=t[r])if(1===t.nodeType||u)return e(t,n,i);return !1}:function(t,n,a){var c,s,d,f=[C,l];if(a){while(t=t[r])if((1===t.nodeType||u)&&e(t,n,a))return !0}else while(t=t[r])if(1===t.nodeType||u)if(d=t[b]||(t[b]={}),s=d[t.uniqueID]||(d[t.uniqueID]={}),i&&i===t.nodeName.toLowerCase())t=t[r]||t;else {if((c=s[o])&&c[0]===C&&c[1]===l)return f[2]=c[2];if(s[o]=f,f[2]=e(t,n,a))return !0}return !1}}function we(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return !1;return !0}:e[0]}function be(e,t,n){for(var r=0,i=t.length;r<i;r++)le(e,t[r],n);return n}function Ne(e,t,n,r,i){for(var o,u=[],l=0,a=e.length,c=null!=t;l<a;l++)(o=e[l])&&(n&&!n(o,r,i)||(u.push(o),c&&t.push(l)));return u}function Ce(e,t,n,r,i,o){return r&&!r[b]&&(r=Ce(r)),i&&!i[b]&&(i=Ce(i,o)),ce(function(o,u,l,a){var c,s,d,f=[],p=[],h=u.length,g=o||be(t||"*",l.nodeType?[l]:l,[]),m=!e||!o&&t?g:Ne(g,f,e,l,a),y=n?i||(o?e:h||r)?[]:u:m;if(n&&n(m,y,l,a),r){c=Ne(y,p),r(c,[],l,a),s=c.length;while(s--)(d=c[s])&&(y[p[s]]=!(m[p[s]]=d));}if(o){if(i||e){if(i){c=[],s=y.length;while(s--)(d=y[s])&&c.push(m[s]=d);i(null,y=[],c,a);}s=y.length;while(s--)(d=y[s])&&(c=i?k(o,d):f[s])>-1&&(o[c]=!(u[c]=d));}}else y=Ne(y===u?y.splice(h,y.length):y),i?i(null,u,y,a):R.apply(u,y);})}function xe(e){for(var t,n,i,o=e.length,u=r.relative[e[0].type],l=u||r.relative[" "],a=u?1:0,s=ve(function(e){return e===t},l,!0),d=ve(function(e){return k(t,e)>-1},l,!0),f=[function(e,n,r){var i=!u&&(r||n!==c)||((t=n).nodeType?s(e,n,r):d(e,n,r));return t=null,i}];a<o;a++)if(n=r.relative[e[a].type])f=[ve(we(f),n)];else {if((n=r.filter[e[a].type].apply(null,e[a].matches))[b]){for(i=++a;i<o;i++)if(r.relative[e[i].type])break;return Ce(a>1&&we(f),a>1&&ye(e.slice(0,a-1).concat({value:" "===e[a-2].type?"*":""})).replace(j,"$1"),n,a<i&&xe(e.slice(a,i)),i<o&&xe(e=e.slice(i)),i<o&&ye(e))}f.push(n);}return we(f)}function Ee(e,t){var n=t.length>0,i=e.length>0,o=function(o,u,l,a,s){var d,h,m,y=0,v="0",w=o&&[],b=[],N=c,x=o||i&&r.find.TAG("*",s),E=C+=null==N?1:Math.random()||.1,A=x.length;for(s&&(c=u==p||u||s);v!==A&&null!=(d=x[v]);v++){if(i&&d){h=0,u||d.ownerDocument==p||(f(d),l=!g);while(m=e[h++])if(m(d,u||p,l)){a.push(d);break}s&&(C=E);}n&&((d=!m&&d)&&y--,o&&w.push(d));}if(y+=v,n&&v!==y){h=0;while(m=t[h++])m(w,b,u,l);if(o){if(y>0)while(v--)w[v]||b[v]||(b[v]=I.call(a));b=Ne(b);}R.apply(a,b),s&&!o&&b.length>0&&y+t.length>1&&le.uniqueSort(a);}return s&&(C=E,c=N),w};return n?ce(o):o}l=le.compile=function(e,t){var n,r=[],i=[],o=S[e+" "];if(!o){t||(t=u(e)),n=t.length;while(n--)(o=xe(t[n]))[b]?r.push(o):i.push(o);(o=S(e,Ee(i,r))).selector=e;}return o},a=le.select=function(e,t,n,i){var o,a,c,s,d,f="function"==typeof e&&e,p=!i&&u(e=f.selector||e);if(n=n||[],1===p.length){if((a=p[0]=p[0].slice(0)).length>2&&"ID"===(c=a[0]).type&&9===t.nodeType&&g&&r.relative[a[1].type]){if(!(t=(r.find.ID(c.matches[0].replace(te,ne),t)||[])[0]))return n;f&&(t=t.parentNode),e=e.slice(a.shift().value.length);}o=K.needsContext.test(e)?0:a.length;while(o--){if(c=a[o],r.relative[s=c.type])break;if((d=r.find[s])&&(i=d(c.matches[0].replace(te,ne),ee.test(a[0].type)&&ge(t.parentNode)||t))){if(a.splice(o,1),!(e=i.length&&ye(a)))return R.apply(n,i),n;break}}}return (f||l(e,p))(i,t,!g,n,!t||ee.test(e)&&ge(t.parentNode)||t),n},n.sortStable=b.split("").sort(T).join("")===b,n.detectDuplicates=!!d,f(),n.sortDetached=se(function(e){return 1&e.compareDocumentPosition(p.createElement("fieldset"))}),se(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||de("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),n.attributes&&se(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||de("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),se(function(e){return null==e.getAttribute("disabled")})||de(H,function(e,t,n){var r;if(!n)return !0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null});var Ae=e.Sizzle;le.noConflict=function(){return e.Sizzle===le&&(e.Sizzle=Ae),le},"function"==typeof define&&define.amd?define(function(){return le}):"undefined"!=typeof module&&module.exports?module.exports=le:e.Sizzle=le;}(window);
  13354. //# sourceMappingURL=sizzle.min.map
  13355. return module.exports;
  13356. })();
  13357. function matches(selector, elm) {
  13358. const r = Sizzle.matches(selector, [elm]);
  13359. return r.length > 0;
  13360. }
  13361. function selectOne(selector, elm) {
  13362. const r = Sizzle(selector, elm);
  13363. return r[0] || null;
  13364. }
  13365. function selectAll(selector, elm) {
  13366. return Sizzle(selector, elm);
  13367. }
  13368. class MockClassList {
  13369. constructor(elm) {
  13370. this.elm = elm;
  13371. }
  13372. add(...classNames) {
  13373. const clsNames = getItems(this.elm);
  13374. let updated = false;
  13375. classNames.forEach((className) => {
  13376. className = String(className);
  13377. validateClass(className);
  13378. if (clsNames.includes(className) === false) {
  13379. clsNames.push(className);
  13380. updated = true;
  13381. }
  13382. });
  13383. if (updated) {
  13384. this.elm.setAttributeNS(null, 'class', clsNames.join(' '));
  13385. }
  13386. }
  13387. remove(...classNames) {
  13388. const clsNames = getItems(this.elm);
  13389. let updated = false;
  13390. classNames.forEach((className) => {
  13391. className = String(className);
  13392. validateClass(className);
  13393. const index = clsNames.indexOf(className);
  13394. if (index > -1) {
  13395. clsNames.splice(index, 1);
  13396. updated = true;
  13397. }
  13398. });
  13399. if (updated) {
  13400. this.elm.setAttributeNS(null, 'class', clsNames.filter((c) => c.length > 0).join(' '));
  13401. }
  13402. }
  13403. contains(className) {
  13404. className = String(className);
  13405. return getItems(this.elm).includes(className);
  13406. }
  13407. toggle(className) {
  13408. className = String(className);
  13409. if (this.contains(className) === true) {
  13410. this.remove(className);
  13411. }
  13412. else {
  13413. this.add(className);
  13414. }
  13415. }
  13416. get length() {
  13417. return getItems(this.elm).length;
  13418. }
  13419. item(index) {
  13420. return getItems(this.elm)[index];
  13421. }
  13422. toString() {
  13423. return getItems(this.elm).join(' ');
  13424. }
  13425. }
  13426. function validateClass(className) {
  13427. if (className === '') {
  13428. throw new Error('The token provided must not be empty.');
  13429. }
  13430. if (/\s/.test(className)) {
  13431. throw new Error(`The token provided ('${className}') contains HTML space characters, which are not valid in tokens.`);
  13432. }
  13433. }
  13434. function getItems(elm) {
  13435. const className = elm.getAttribute('class');
  13436. if (typeof className === 'string' && className.length > 0) {
  13437. return className
  13438. .trim()
  13439. .split(' ')
  13440. .filter((c) => c.length > 0);
  13441. }
  13442. return [];
  13443. }
  13444. class MockCSSStyleDeclaration {
  13445. constructor() {
  13446. this._styles = new Map();
  13447. }
  13448. setProperty(prop, value) {
  13449. prop = jsCaseToCssCase(prop);
  13450. if (value == null || value === '') {
  13451. this._styles.delete(prop);
  13452. }
  13453. else {
  13454. this._styles.set(prop, String(value));
  13455. }
  13456. }
  13457. getPropertyValue(prop) {
  13458. prop = jsCaseToCssCase(prop);
  13459. return String(this._styles.get(prop) || '');
  13460. }
  13461. removeProperty(prop) {
  13462. prop = jsCaseToCssCase(prop);
  13463. this._styles.delete(prop);
  13464. }
  13465. get length() {
  13466. return this._styles.size;
  13467. }
  13468. get cssText() {
  13469. const cssText = [];
  13470. this._styles.forEach((value, prop) => {
  13471. cssText.push(`${prop}: ${value};`);
  13472. });
  13473. return cssText.join(' ').trim();
  13474. }
  13475. set cssText(cssText) {
  13476. if (cssText == null || cssText === '') {
  13477. this._styles.clear();
  13478. return;
  13479. }
  13480. cssText.split(';').forEach((rule) => {
  13481. rule = rule.trim();
  13482. if (rule.length > 0) {
  13483. const splt = rule.split(':');
  13484. if (splt.length > 1) {
  13485. const prop = splt[0].trim();
  13486. const value = splt.slice(1).join(':').trim();
  13487. if (prop !== '' && value !== '') {
  13488. this._styles.set(jsCaseToCssCase(prop), value);
  13489. }
  13490. }
  13491. }
  13492. });
  13493. }
  13494. }
  13495. function createCSSStyleDeclaration() {
  13496. return new Proxy(new MockCSSStyleDeclaration(), cssProxyHandler);
  13497. }
  13498. const cssProxyHandler = {
  13499. get(cssStyle, prop) {
  13500. if (prop in cssStyle) {
  13501. return cssStyle[prop];
  13502. }
  13503. prop = cssCaseToJsCase(prop);
  13504. return cssStyle.getPropertyValue(prop);
  13505. },
  13506. set(cssStyle, prop, value) {
  13507. if (prop in cssStyle) {
  13508. cssStyle[prop] = value;
  13509. }
  13510. else {
  13511. cssStyle.setProperty(prop, value);
  13512. }
  13513. return true;
  13514. },
  13515. };
  13516. function cssCaseToJsCase(str) {
  13517. // font-size to fontSize
  13518. if (str.length > 1 && str.includes('-') === true) {
  13519. str = str
  13520. .toLowerCase()
  13521. .split('-')
  13522. .map((segment) => segment.charAt(0).toUpperCase() + segment.slice(1))
  13523. .join('');
  13524. str = str.slice(0, 1).toLowerCase() + str.slice(1);
  13525. }
  13526. return str;
  13527. }
  13528. function jsCaseToCssCase(str) {
  13529. // fontSize to font-size
  13530. if (str.length > 1 && str.includes('-') === false && /[A-Z]/.test(str) === true) {
  13531. str = str
  13532. .replace(/([A-Z])/g, (g) => ' ' + g[0])
  13533. .trim()
  13534. .replace(/ /g, '-')
  13535. .toLowerCase();
  13536. }
  13537. return str;
  13538. }
  13539. class MockEvent {
  13540. constructor(type, eventInitDict) {
  13541. this.bubbles = false;
  13542. this.cancelBubble = false;
  13543. this.cancelable = false;
  13544. this.composed = false;
  13545. this.currentTarget = null;
  13546. this.defaultPrevented = false;
  13547. this.srcElement = null;
  13548. this.target = null;
  13549. if (typeof type !== 'string') {
  13550. throw new Error(`Event type required`);
  13551. }
  13552. this.type = type;
  13553. this.timeStamp = Date.now();
  13554. if (eventInitDict != null) {
  13555. Object.assign(this, eventInitDict);
  13556. }
  13557. }
  13558. preventDefault() {
  13559. this.defaultPrevented = true;
  13560. }
  13561. stopPropagation() {
  13562. this.cancelBubble = true;
  13563. }
  13564. stopImmediatePropagation() {
  13565. this.cancelBubble = true;
  13566. }
  13567. composedPath() {
  13568. const composedPath = [];
  13569. let currentElement = this.target;
  13570. while (currentElement) {
  13571. composedPath.push(currentElement);
  13572. if (!currentElement.parentElement && currentElement.nodeName === "#document" /* DOCUMENT_NODE */) {
  13573. // the current element doesn't have a parent, but we've detected it's our root document node. push the window
  13574. // object associated with the document onto the path
  13575. composedPath.push(currentElement.defaultView);
  13576. break;
  13577. }
  13578. currentElement = currentElement.parentElement;
  13579. }
  13580. return composedPath;
  13581. }
  13582. }
  13583. class MockCustomEvent extends MockEvent {
  13584. constructor(type, customEventInitDic) {
  13585. super(type);
  13586. this.detail = null;
  13587. if (customEventInitDic != null) {
  13588. Object.assign(this, customEventInitDic);
  13589. }
  13590. }
  13591. }
  13592. class MockKeyboardEvent extends MockEvent {
  13593. constructor(type, keyboardEventInitDic) {
  13594. super(type);
  13595. this.code = '';
  13596. this.key = '';
  13597. this.altKey = false;
  13598. this.ctrlKey = false;
  13599. this.metaKey = false;
  13600. this.shiftKey = false;
  13601. this.location = 0;
  13602. this.repeat = false;
  13603. if (keyboardEventInitDic != null) {
  13604. Object.assign(this, keyboardEventInitDic);
  13605. }
  13606. }
  13607. }
  13608. class MockMouseEvent extends MockEvent {
  13609. constructor(type, mouseEventInitDic) {
  13610. super(type);
  13611. this.screenX = 0;
  13612. this.screenY = 0;
  13613. this.clientX = 0;
  13614. this.clientY = 0;
  13615. this.ctrlKey = false;
  13616. this.shiftKey = false;
  13617. this.altKey = false;
  13618. this.metaKey = false;
  13619. this.button = 0;
  13620. this.buttons = 0;
  13621. this.relatedTarget = null;
  13622. if (mouseEventInitDic != null) {
  13623. Object.assign(this, mouseEventInitDic);
  13624. }
  13625. }
  13626. }
  13627. class MockEventListener {
  13628. constructor(type, handler) {
  13629. this.type = type;
  13630. this.handler = handler;
  13631. }
  13632. }
  13633. function addEventListener(elm, type, handler) {
  13634. const target = elm;
  13635. if (target.__listeners == null) {
  13636. target.__listeners = [];
  13637. }
  13638. target.__listeners.push(new MockEventListener(type, handler));
  13639. }
  13640. function removeEventListener(elm, type, handler) {
  13641. const target = elm;
  13642. if (target != null && Array.isArray(target.__listeners) === true) {
  13643. const elmListener = target.__listeners.find((e) => e.type === type && e.handler === handler);
  13644. if (elmListener != null) {
  13645. const index = target.__listeners.indexOf(elmListener);
  13646. target.__listeners.splice(index, 1);
  13647. }
  13648. }
  13649. }
  13650. function resetEventListeners(target) {
  13651. if (target != null && target.__listeners != null) {
  13652. target.__listeners = null;
  13653. }
  13654. }
  13655. function triggerEventListener(elm, ev) {
  13656. if (elm == null || ev.cancelBubble === true) {
  13657. return;
  13658. }
  13659. const target = elm;
  13660. ev.currentTarget = elm;
  13661. if (Array.isArray(target.__listeners) === true) {
  13662. const listeners = target.__listeners.filter((e) => e.type === ev.type);
  13663. listeners.forEach((listener) => {
  13664. try {
  13665. listener.handler.call(target, ev);
  13666. }
  13667. catch (err) {
  13668. console.error(err);
  13669. }
  13670. });
  13671. }
  13672. if (ev.bubbles === false) {
  13673. return;
  13674. }
  13675. if (elm.nodeName === "#document" /* DOCUMENT_NODE */) {
  13676. triggerEventListener(elm.defaultView, ev);
  13677. }
  13678. else {
  13679. triggerEventListener(elm.parentElement, ev);
  13680. }
  13681. }
  13682. function dispatchEvent(currentTarget, ev) {
  13683. ev.target = currentTarget;
  13684. triggerEventListener(currentTarget, ev);
  13685. return true;
  13686. }
  13687. function serializeNodeToHtml(elm, opts = {}) {
  13688. const output = {
  13689. currentLineWidth: 0,
  13690. indent: 0,
  13691. isWithinBody: false,
  13692. text: [],
  13693. };
  13694. if (opts.prettyHtml) {
  13695. if (typeof opts.indentSpaces !== 'number') {
  13696. opts.indentSpaces = 2;
  13697. }
  13698. if (typeof opts.newLines !== 'boolean') {
  13699. opts.newLines = true;
  13700. }
  13701. opts.approximateLineWidth = -1;
  13702. }
  13703. else {
  13704. opts.prettyHtml = false;
  13705. if (typeof opts.newLines !== 'boolean') {
  13706. opts.newLines = false;
  13707. }
  13708. if (typeof opts.indentSpaces !== 'number') {
  13709. opts.indentSpaces = 0;
  13710. }
  13711. }
  13712. if (typeof opts.approximateLineWidth !== 'number') {
  13713. opts.approximateLineWidth = -1;
  13714. }
  13715. if (typeof opts.removeEmptyAttributes !== 'boolean') {
  13716. opts.removeEmptyAttributes = true;
  13717. }
  13718. if (typeof opts.removeAttributeQuotes !== 'boolean') {
  13719. opts.removeAttributeQuotes = false;
  13720. }
  13721. if (typeof opts.removeBooleanAttributeQuotes !== 'boolean') {
  13722. opts.removeBooleanAttributeQuotes = false;
  13723. }
  13724. if (typeof opts.removeHtmlComments !== 'boolean') {
  13725. opts.removeHtmlComments = false;
  13726. }
  13727. if (typeof opts.serializeShadowRoot !== 'boolean') {
  13728. opts.serializeShadowRoot = false;
  13729. }
  13730. if (opts.outerHtml) {
  13731. serializeToHtml(elm, opts, output, false);
  13732. }
  13733. else {
  13734. for (let i = 0, ii = elm.childNodes.length; i < ii; i++) {
  13735. serializeToHtml(elm.childNodes[i], opts, output, false);
  13736. }
  13737. }
  13738. if (output.text[0] === '\n') {
  13739. output.text.shift();
  13740. }
  13741. if (output.text[output.text.length - 1] === '\n') {
  13742. output.text.pop();
  13743. }
  13744. return output.text.join('');
  13745. }
  13746. function serializeToHtml(node, opts, output, isShadowRoot) {
  13747. if (node.nodeType === 1 /* ELEMENT_NODE */ || isShadowRoot) {
  13748. const tagName = isShadowRoot ? 'mock:shadow-root' : getTagName(node);
  13749. if (tagName === 'body') {
  13750. output.isWithinBody = true;
  13751. }
  13752. const ignoreTag = opts.excludeTags != null && opts.excludeTags.includes(tagName);
  13753. if (ignoreTag === false) {
  13754. const isWithinWhitespaceSensitiveNode = opts.newLines || opts.indentSpaces > 0 ? isWithinWhitespaceSensitive(node) : false;
  13755. if (opts.newLines && !isWithinWhitespaceSensitiveNode) {
  13756. output.text.push('\n');
  13757. output.currentLineWidth = 0;
  13758. }
  13759. if (opts.indentSpaces > 0 && !isWithinWhitespaceSensitiveNode) {
  13760. for (let i = 0; i < output.indent; i++) {
  13761. output.text.push(' ');
  13762. }
  13763. output.currentLineWidth += output.indent;
  13764. }
  13765. output.text.push('<' + tagName);
  13766. output.currentLineWidth += tagName.length + 1;
  13767. const attrsLength = node.attributes.length;
  13768. const attributes = opts.prettyHtml && attrsLength > 1
  13769. ? cloneAttributes(node.attributes, true)
  13770. : node.attributes;
  13771. for (let i = 0; i < attrsLength; i++) {
  13772. const attr = attributes.item(i);
  13773. const attrName = attr.name;
  13774. if (attrName === 'style') {
  13775. continue;
  13776. }
  13777. let attrValue = attr.value;
  13778. if (opts.removeEmptyAttributes && attrValue === '' && REMOVE_EMPTY_ATTR.has(attrName)) {
  13779. continue;
  13780. }
  13781. const attrNamespaceURI = attr.namespaceURI;
  13782. if (attrNamespaceURI == null) {
  13783. output.currentLineWidth += attrName.length + 1;
  13784. if (opts.approximateLineWidth > 0 && output.currentLineWidth > opts.approximateLineWidth) {
  13785. output.text.push('\n' + attrName);
  13786. output.currentLineWidth = 0;
  13787. }
  13788. else {
  13789. output.text.push(' ' + attrName);
  13790. }
  13791. }
  13792. else if (attrNamespaceURI === 'http://www.w3.org/XML/1998/namespace') {
  13793. output.text.push(' xml:' + attrName);
  13794. output.currentLineWidth += attrName.length + 5;
  13795. }
  13796. else if (attrNamespaceURI === 'http://www.w3.org/2000/xmlns/') {
  13797. if (attrName !== 'xmlns') {
  13798. output.text.push(' xmlns:' + attrName);
  13799. output.currentLineWidth += attrName.length + 7;
  13800. }
  13801. else {
  13802. output.text.push(' ' + attrName);
  13803. output.currentLineWidth += attrName.length + 1;
  13804. }
  13805. }
  13806. else if (attrNamespaceURI === XLINK_NS) {
  13807. output.text.push(' xlink:' + attrName);
  13808. output.currentLineWidth += attrName.length + 7;
  13809. }
  13810. else {
  13811. output.text.push(' ' + attrNamespaceURI + ':' + attrName);
  13812. output.currentLineWidth += attrNamespaceURI.length + attrName.length + 2;
  13813. }
  13814. if (opts.prettyHtml && attrName === 'class') {
  13815. attrValue = attr.value = attrValue
  13816. .split(' ')
  13817. .filter((t) => t !== '')
  13818. .sort()
  13819. .join(' ')
  13820. .trim();
  13821. }
  13822. if (attrValue === '') {
  13823. if (opts.removeBooleanAttributeQuotes && BOOLEAN_ATTR.has(attrName)) {
  13824. continue;
  13825. }
  13826. if (opts.removeEmptyAttributes && attrName.startsWith('data-')) {
  13827. continue;
  13828. }
  13829. }
  13830. if (opts.removeAttributeQuotes && CAN_REMOVE_ATTR_QUOTES.test(attrValue)) {
  13831. output.text.push('=' + escapeString(attrValue, true));
  13832. output.currentLineWidth += attrValue.length + 1;
  13833. }
  13834. else {
  13835. output.text.push('="' + escapeString(attrValue, true) + '"');
  13836. output.currentLineWidth += attrValue.length + 3;
  13837. }
  13838. }
  13839. if (node.hasAttribute('style')) {
  13840. const cssText = node.style.cssText;
  13841. if (opts.approximateLineWidth > 0 &&
  13842. output.currentLineWidth + cssText.length + 10 > opts.approximateLineWidth) {
  13843. output.text.push(`\nstyle="${cssText}">`);
  13844. output.currentLineWidth = 0;
  13845. }
  13846. else {
  13847. output.text.push(` style="${cssText}">`);
  13848. output.currentLineWidth += cssText.length + 10;
  13849. }
  13850. }
  13851. else {
  13852. output.text.push('>');
  13853. output.currentLineWidth += 1;
  13854. }
  13855. }
  13856. if (EMPTY_ELEMENTS.has(tagName) === false) {
  13857. if (opts.serializeShadowRoot && node.shadowRoot != null) {
  13858. output.indent = output.indent + opts.indentSpaces;
  13859. serializeToHtml(node.shadowRoot, opts, output, true);
  13860. output.indent = output.indent - opts.indentSpaces;
  13861. if (opts.newLines &&
  13862. (node.childNodes.length === 0 ||
  13863. (node.childNodes.length === 1 &&
  13864. node.childNodes[0].nodeType === 3 /* TEXT_NODE */ &&
  13865. node.childNodes[0].nodeValue.trim() === ''))) {
  13866. output.text.push('\n');
  13867. output.currentLineWidth = 0;
  13868. for (let i = 0; i < output.indent; i++) {
  13869. output.text.push(' ');
  13870. }
  13871. output.currentLineWidth += output.indent;
  13872. }
  13873. }
  13874. if (opts.excludeTagContent == null || opts.excludeTagContent.includes(tagName) === false) {
  13875. const childNodes = tagName === 'template' ? node.content.childNodes : node.childNodes;
  13876. const childNodeLength = childNodes.length;
  13877. if (childNodeLength > 0) {
  13878. if (childNodeLength === 1 &&
  13879. childNodes[0].nodeType === 3 /* TEXT_NODE */ &&
  13880. (typeof childNodes[0].nodeValue !== 'string' || childNodes[0].nodeValue.trim() === '')) ;
  13881. else {
  13882. const isWithinWhitespaceSensitiveNode = opts.newLines || opts.indentSpaces > 0 ? isWithinWhitespaceSensitive(node) : false;
  13883. if (!isWithinWhitespaceSensitiveNode && opts.indentSpaces > 0 && ignoreTag === false) {
  13884. output.indent = output.indent + opts.indentSpaces;
  13885. }
  13886. for (let i = 0; i < childNodeLength; i++) {
  13887. serializeToHtml(childNodes[i], opts, output, false);
  13888. }
  13889. if (ignoreTag === false) {
  13890. if (opts.newLines && !isWithinWhitespaceSensitiveNode) {
  13891. output.text.push('\n');
  13892. output.currentLineWidth = 0;
  13893. }
  13894. if (opts.indentSpaces > 0 && !isWithinWhitespaceSensitiveNode) {
  13895. output.indent = output.indent - opts.indentSpaces;
  13896. for (let i = 0; i < output.indent; i++) {
  13897. output.text.push(' ');
  13898. }
  13899. output.currentLineWidth += output.indent;
  13900. }
  13901. }
  13902. }
  13903. }
  13904. if (ignoreTag === false) {
  13905. output.text.push('</' + tagName + '>');
  13906. output.currentLineWidth += tagName.length + 3;
  13907. }
  13908. }
  13909. }
  13910. if (opts.approximateLineWidth > 0 && STRUCTURE_ELEMENTS.has(tagName)) {
  13911. output.text.push('\n');
  13912. output.currentLineWidth = 0;
  13913. }
  13914. if (tagName === 'body') {
  13915. output.isWithinBody = false;
  13916. }
  13917. }
  13918. else if (node.nodeType === 3 /* TEXT_NODE */) {
  13919. let textContent = node.nodeValue;
  13920. if (typeof textContent === 'string') {
  13921. const trimmedTextContent = textContent.trim();
  13922. if (trimmedTextContent === '') {
  13923. // this text node is whitespace only
  13924. if (isWithinWhitespaceSensitive(node)) {
  13925. // whitespace matters within this element
  13926. // just add the exact text we were given
  13927. output.text.push(textContent);
  13928. output.currentLineWidth += textContent.length;
  13929. }
  13930. else if (opts.approximateLineWidth > 0 && !output.isWithinBody) ;
  13931. else if (!opts.prettyHtml) {
  13932. // this text node is only whitespace, and it's not
  13933. // within a whitespace sensitive element like <pre> or <code>
  13934. // so replace the entire white space with a single new line
  13935. output.currentLineWidth += 1;
  13936. if (opts.approximateLineWidth > 0 && output.currentLineWidth > opts.approximateLineWidth) {
  13937. // good enough for a new line
  13938. // for perf these are all just estimates
  13939. // we don't care to ensure exact line lengths
  13940. output.text.push('\n');
  13941. output.currentLineWidth = 0;
  13942. }
  13943. else {
  13944. // let's keep it all on the same line yet
  13945. output.text.push(' ');
  13946. }
  13947. }
  13948. }
  13949. else {
  13950. // this text node has text content
  13951. const isWithinWhitespaceSensitiveNode = opts.newLines || opts.indentSpaces > 0 || opts.prettyHtml ? isWithinWhitespaceSensitive(node) : false;
  13952. if (opts.newLines && !isWithinWhitespaceSensitiveNode) {
  13953. output.text.push('\n');
  13954. output.currentLineWidth = 0;
  13955. }
  13956. if (opts.indentSpaces > 0 && !isWithinWhitespaceSensitiveNode) {
  13957. for (let i = 0; i < output.indent; i++) {
  13958. output.text.push(' ');
  13959. }
  13960. output.currentLineWidth += output.indent;
  13961. }
  13962. let textContentLength = textContent.length;
  13963. if (textContentLength > 0) {
  13964. // this text node has text content
  13965. const parentTagName = node.parentNode != null && node.parentNode.nodeType === 1 /* ELEMENT_NODE */
  13966. ? node.parentNode.nodeName
  13967. : null;
  13968. if (NON_ESCAPABLE_CONTENT.has(parentTagName)) {
  13969. // this text node cannot have its content escaped since it's going
  13970. // into an element like <style> or <script>
  13971. if (isWithinWhitespaceSensitive(node)) {
  13972. output.text.push(textContent);
  13973. }
  13974. else {
  13975. output.text.push(trimmedTextContent);
  13976. textContentLength = trimmedTextContent.length;
  13977. }
  13978. output.currentLineWidth += textContentLength;
  13979. }
  13980. else {
  13981. // this text node is going into a normal element and html can be escaped
  13982. if (opts.prettyHtml && !isWithinWhitespaceSensitiveNode) {
  13983. // pretty print the text node
  13984. output.text.push(escapeString(textContent.replace(/\s\s+/g, ' ').trim(), false));
  13985. output.currentLineWidth += textContentLength;
  13986. }
  13987. else {
  13988. // not pretty printing the text node
  13989. if (isWithinWhitespaceSensitive(node)) {
  13990. output.currentLineWidth += textContentLength;
  13991. }
  13992. else {
  13993. // this element is not a whitespace sensitive one, like <pre> or <code> so
  13994. // any whitespace at the start and end can be cleaned up to just be one space
  13995. if (/\s/.test(textContent.charAt(0))) {
  13996. textContent = ' ' + textContent.trimLeft();
  13997. }
  13998. textContentLength = textContent.length;
  13999. if (textContentLength > 1) {
  14000. if (/\s/.test(textContent.charAt(textContentLength - 1))) {
  14001. if (opts.approximateLineWidth > 0 &&
  14002. output.currentLineWidth + textContentLength > opts.approximateLineWidth) {
  14003. textContent = textContent.trimRight() + '\n';
  14004. output.currentLineWidth = 0;
  14005. }
  14006. else {
  14007. textContent = textContent.trimRight() + ' ';
  14008. }
  14009. }
  14010. }
  14011. output.currentLineWidth += textContentLength;
  14012. }
  14013. output.text.push(escapeString(textContent, false));
  14014. }
  14015. }
  14016. }
  14017. }
  14018. }
  14019. }
  14020. else if (node.nodeType === 8 /* COMMENT_NODE */) {
  14021. const nodeValue = node.nodeValue;
  14022. if (opts.removeHtmlComments) {
  14023. const isHydrateAnnotation = nodeValue.startsWith(CONTENT_REF_ID + '.') ||
  14024. nodeValue.startsWith(ORG_LOCATION_ID + '.') ||
  14025. nodeValue.startsWith(SLOT_NODE_ID + '.') ||
  14026. nodeValue.startsWith(TEXT_NODE_ID + '.');
  14027. if (!isHydrateAnnotation) {
  14028. return;
  14029. }
  14030. }
  14031. const isWithinWhitespaceSensitiveNode = opts.newLines || opts.indentSpaces > 0 ? isWithinWhitespaceSensitive(node) : false;
  14032. if (opts.newLines && !isWithinWhitespaceSensitiveNode) {
  14033. output.text.push('\n');
  14034. output.currentLineWidth = 0;
  14035. }
  14036. if (opts.indentSpaces > 0 && !isWithinWhitespaceSensitiveNode) {
  14037. for (let i = 0; i < output.indent; i++) {
  14038. output.text.push(' ');
  14039. }
  14040. output.currentLineWidth += output.indent;
  14041. }
  14042. output.text.push('<!--' + nodeValue + '-->');
  14043. output.currentLineWidth += nodeValue.length + 7;
  14044. }
  14045. else if (node.nodeType === 10 /* DOCUMENT_TYPE_NODE */) {
  14046. output.text.push('<!doctype html>');
  14047. }
  14048. }
  14049. const AMP_REGEX = /&/g;
  14050. const NBSP_REGEX = /\u00a0/g;
  14051. const DOUBLE_QUOTE_REGEX = /"/g;
  14052. const LT_REGEX = /</g;
  14053. const GT_REGEX = />/g;
  14054. const CAN_REMOVE_ATTR_QUOTES = /^[^ \t\n\f\r"'`=<>\/\\-]+$/;
  14055. function getTagName(element) {
  14056. if (element.namespaceURI === 'http://www.w3.org/1999/xhtml') {
  14057. return element.nodeName.toLowerCase();
  14058. }
  14059. else {
  14060. return element.nodeName;
  14061. }
  14062. }
  14063. function escapeString(str, attrMode) {
  14064. str = str.replace(AMP_REGEX, '&amp;').replace(NBSP_REGEX, '&nbsp;');
  14065. if (attrMode) {
  14066. return str.replace(DOUBLE_QUOTE_REGEX, '&quot;');
  14067. }
  14068. return str.replace(LT_REGEX, '&lt;').replace(GT_REGEX, '&gt;');
  14069. }
  14070. function isWithinWhitespaceSensitive(node) {
  14071. while (node != null) {
  14072. if (WHITESPACE_SENSITIVE.has(node.nodeName)) {
  14073. return true;
  14074. }
  14075. node = node.parentNode;
  14076. }
  14077. return false;
  14078. }
  14079. /*@__PURE__*/ const NON_ESCAPABLE_CONTENT = new Set([
  14080. 'STYLE',
  14081. 'SCRIPT',
  14082. 'IFRAME',
  14083. 'NOSCRIPT',
  14084. 'XMP',
  14085. 'NOEMBED',
  14086. 'NOFRAMES',
  14087. 'PLAINTEXT',
  14088. ]);
  14089. /*@__PURE__*/ const WHITESPACE_SENSITIVE = new Set([
  14090. 'CODE',
  14091. 'OUTPUT',
  14092. 'PLAINTEXT',
  14093. 'PRE',
  14094. 'SCRIPT',
  14095. 'TEMPLATE',
  14096. 'TEXTAREA',
  14097. ]);
  14098. /*@__PURE__*/ const EMPTY_ELEMENTS = new Set([
  14099. 'area',
  14100. 'base',
  14101. 'basefont',
  14102. 'bgsound',
  14103. 'br',
  14104. 'col',
  14105. 'embed',
  14106. 'frame',
  14107. 'hr',
  14108. 'img',
  14109. 'input',
  14110. 'keygen',
  14111. 'link',
  14112. 'meta',
  14113. 'param',
  14114. 'source',
  14115. 'trace',
  14116. 'wbr',
  14117. ]);
  14118. /*@__PURE__*/ const REMOVE_EMPTY_ATTR = new Set(['class', 'dir', 'id', 'lang', 'name', 'title']);
  14119. /*@__PURE__*/ const BOOLEAN_ATTR = new Set([
  14120. 'allowfullscreen',
  14121. 'async',
  14122. 'autofocus',
  14123. 'autoplay',
  14124. 'checked',
  14125. 'compact',
  14126. 'controls',
  14127. 'declare',
  14128. 'default',
  14129. 'defaultchecked',
  14130. 'defaultmuted',
  14131. 'defaultselected',
  14132. 'defer',
  14133. 'disabled',
  14134. 'enabled',
  14135. 'formnovalidate',
  14136. 'hidden',
  14137. 'indeterminate',
  14138. 'inert',
  14139. 'ismap',
  14140. 'itemscope',
  14141. 'loop',
  14142. 'multiple',
  14143. 'muted',
  14144. 'nohref',
  14145. 'nomodule',
  14146. 'noresize',
  14147. 'noshade',
  14148. 'novalidate',
  14149. 'nowrap',
  14150. 'open',
  14151. 'pauseonexit',
  14152. 'readonly',
  14153. 'required',
  14154. 'reversed',
  14155. 'scoped',
  14156. 'seamless',
  14157. 'selected',
  14158. 'sortable',
  14159. 'truespeed',
  14160. 'typemustmatch',
  14161. 'visible',
  14162. ]);
  14163. /*@__PURE__*/ const STRUCTURE_ELEMENTS = new Set([
  14164. 'html',
  14165. 'body',
  14166. 'head',
  14167. 'iframe',
  14168. 'meta',
  14169. 'link',
  14170. 'base',
  14171. 'title',
  14172. 'script',
  14173. 'style',
  14174. ]);
  14175. // Parse5 6.0.1
  14176. const e=function(e){const t=[65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111];var n="�",s={EOF:-1,NULL:0,TABULATION:9,CARRIAGE_RETURN:13,LINE_FEED:10,FORM_FEED:12,SPACE:32,EXCLAMATION_MARK:33,QUOTATION_MARK:34,NUMBER_SIGN:35,AMPERSAND:38,APOSTROPHE:39,HYPHEN_MINUS:45,SOLIDUS:47,DIGIT_0:48,DIGIT_9:57,SEMICOLON:59,LESS_THAN_SIGN:60,EQUALS_SIGN:61,GREATER_THAN_SIGN:62,QUESTION_MARK:63,LATIN_CAPITAL_A:65,LATIN_CAPITAL_F:70,LATIN_CAPITAL_X:88,LATIN_CAPITAL_Z:90,RIGHT_SQUARE_BRACKET:93,GRAVE_ACCENT:96,LATIN_SMALL_A:97,LATIN_SMALL_F:102,LATIN_SMALL_X:120,LATIN_SMALL_Z:122,REPLACEMENT_CHARACTER:65533},r=function(e){return e>=55296&&e<=57343},i=function(e){return 32!==e&&10!==e&&13!==e&&9!==e&&12!==e&&e>=1&&e<=31||e>=127&&e<=159},o=function(e){return e>=64976&&e<=65007||t.indexOf(e)>-1},a="unexpected-null-character",T="invalid-first-character-of-tag-name",E="missing-semicolon-after-character-reference",h="eof-before-tag-name",c="eof-in-tag",_="missing-whitespace-after-doctype-public-keyword",l="missing-whitespace-between-doctype-public-and-system-identifiers",m="missing-whitespace-after-doctype-system-keyword",p="missing-quote-before-doctype-public-identifier",A="missing-quote-before-doctype-system-identifier",u="missing-doctype-public-identifier",N="missing-doctype-system-identifier",d="abrupt-doctype-public-identifier",C="abrupt-doctype-system-identifier",O="eof-in-script-html-comment-like-text",f="eof-in-doctype",S="abrupt-closing-of-empty-comment",R="eof-in-comment",I="absence-of-digits-in-numeric-character-reference",L="end-tag-without-matching-open-element",k="misplaced-start-tag-for-head-element";const M=s;var g=new Uint16Array([4,52,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,106,303,412,810,1432,1701,1796,1987,2114,2360,2420,2484,3170,3251,4140,4393,4575,4610,5106,5512,5728,6117,6274,6315,6345,6427,6516,7002,7910,8733,9323,9870,10170,10631,10893,11318,11386,11467,12773,13092,14474,14922,15448,15542,16419,17666,18166,18611,19004,19095,19298,19397,4,16,69,77,97,98,99,102,103,108,109,110,111,112,114,115,116,117,140,150,158,169,176,194,199,210,216,222,226,242,256,266,283,294,108,105,103,5,198,1,59,148,1,198,80,5,38,1,59,156,1,38,99,117,116,101,5,193,1,59,167,1,193,114,101,118,101,59,1,258,4,2,105,121,182,191,114,99,5,194,1,59,189,1,194,59,1,1040,114,59,3,55349,56580,114,97,118,101,5,192,1,59,208,1,192,112,104,97,59,1,913,97,99,114,59,1,256,100,59,1,10835,4,2,103,112,232,237,111,110,59,1,260,102,59,3,55349,56632,112,108,121,70,117,110,99,116,105,111,110,59,1,8289,105,110,103,5,197,1,59,264,1,197,4,2,99,115,272,277,114,59,3,55349,56476,105,103,110,59,1,8788,105,108,100,101,5,195,1,59,292,1,195,109,108,5,196,1,59,301,1,196,4,8,97,99,101,102,111,114,115,117,321,350,354,383,388,394,400,405,4,2,99,114,327,336,107,115,108,97,115,104,59,1,8726,4,2,118,119,342,345,59,1,10983,101,100,59,1,8966,121,59,1,1041,4,3,99,114,116,362,369,379,97,117,115,101,59,1,8757,110,111,117,108,108,105,115,59,1,8492,97,59,1,914,114,59,3,55349,56581,112,102,59,3,55349,56633,101,118,101,59,1,728,99,114,59,1,8492,109,112,101,113,59,1,8782,4,14,72,79,97,99,100,101,102,104,105,108,111,114,115,117,442,447,456,504,542,547,569,573,577,616,678,784,790,796,99,121,59,1,1063,80,89,5,169,1,59,454,1,169,4,3,99,112,121,464,470,497,117,116,101,59,1,262,4,2,59,105,476,478,1,8914,116,97,108,68,105,102,102,101,114,101,110,116,105,97,108,68,59,1,8517,108,101,121,115,59,1,8493,4,4,97,101,105,111,514,520,530,535,114,111,110,59,1,268,100,105,108,5,199,1,59,528,1,199,114,99,59,1,264,110,105,110,116,59,1,8752,111,116,59,1,266,4,2,100,110,553,560,105,108,108,97,59,1,184,116,101,114,68,111,116,59,1,183,114,59,1,8493,105,59,1,935,114,99,108,101,4,4,68,77,80,84,591,596,603,609,111,116,59,1,8857,105,110,117,115,59,1,8854,108,117,115,59,1,8853,105,109,101,115,59,1,8855,111,4,2,99,115,623,646,107,119,105,115,101,67,111,110,116,111,117,114,73,110,116,101,103,114,97,108,59,1,8754,101,67,117,114,108,121,4,2,68,81,658,671,111,117,98,108,101,81,117,111,116,101,59,1,8221,117,111,116,101,59,1,8217,4,4,108,110,112,117,688,701,736,753,111,110,4,2,59,101,696,698,1,8759,59,1,10868,4,3,103,105,116,709,717,722,114,117,101,110,116,59,1,8801,110,116,59,1,8751,111,117,114,73,110,116,101,103,114,97,108,59,1,8750,4,2,102,114,742,745,59,1,8450,111,100,117,99,116,59,1,8720,110,116,101,114,67,108,111,99,107,119,105,115,101,67,111,110,116,111,117,114,73,110,116,101,103,114,97,108,59,1,8755,111,115,115,59,1,10799,99,114,59,3,55349,56478,112,4,2,59,67,803,805,1,8915,97,112,59,1,8781,4,11,68,74,83,90,97,99,101,102,105,111,115,834,850,855,860,865,888,903,916,921,1011,1415,4,2,59,111,840,842,1,8517,116,114,97,104,100,59,1,10513,99,121,59,1,1026,99,121,59,1,1029,99,121,59,1,1039,4,3,103,114,115,873,879,883,103,101,114,59,1,8225,114,59,1,8609,104,118,59,1,10980,4,2,97,121,894,900,114,111,110,59,1,270,59,1,1044,108,4,2,59,116,910,912,1,8711,97,59,1,916,114,59,3,55349,56583,4,2,97,102,927,998,4,2,99,109,933,992,114,105,116,105,99,97,108,4,4,65,68,71,84,950,957,978,985,99,117,116,101,59,1,180,111,4,2,116,117,964,967,59,1,729,98,108,101,65,99,117,116,101,59,1,733,114,97,118,101,59,1,96,105,108,100,101,59,1,732,111,110,100,59,1,8900,102,101,114,101,110,116,105,97,108,68,59,1,8518,4,4,112,116,117,119,1021,1026,1048,1249,102,59,3,55349,56635,4,3,59,68,69,1034,1036,1041,1,168,111,116,59,1,8412,113,117,97,108,59,1,8784,98,108,101,4,6,67,68,76,82,85,86,1065,1082,1101,1189,1211,1236,111,110,116,111,117,114,73,110,116,101,103,114,97,108,59,1,8751,111,4,2,116,119,1089,1092,59,1,168,110,65,114,114,111,119,59,1,8659,4,2,101,111,1107,1141,102,116,4,3,65,82,84,1117,1124,1136,114,114,111,119,59,1,8656,105,103,104,116,65,114,114,111,119,59,1,8660,101,101,59,1,10980,110,103,4,2,76,82,1149,1177,101,102,116,4,2,65,82,1158,1165,114,114,111,119,59,1,10232,105,103,104,116,65,114,114,111,119,59,1,10234,105,103,104,116,65,114,114,111,119,59,1,10233,105,103,104,116,4,2,65,84,1199,1206,114,114,111,119,59,1,8658,101,101,59,1,8872,112,4,2,65,68,1218,1225,114,114,111,119,59,1,8657,111,119,110,65,114,114,111,119,59,1,8661,101,114,116,105,99,97,108,66,97,114,59,1,8741,110,4,6,65,66,76,82,84,97,1264,1292,1299,1352,1391,1408,114,114,111,119,4,3,59,66,85,1276,1278,1283,1,8595,97,114,59,1,10515,112,65,114,114,111,119,59,1,8693,114,101,118,101,59,1,785,101,102,116,4,3,82,84,86,1310,1323,1334,105,103,104,116,86,101,99,116,111,114,59,1,10576,101,101,86,101,99,116,111,114,59,1,10590,101,99,116,111,114,4,2,59,66,1345,1347,1,8637,97,114,59,1,10582,105,103,104,116,4,2,84,86,1362,1373,101,101,86,101,99,116,111,114,59,1,10591,101,99,116,111,114,4,2,59,66,1384,1386,1,8641,97,114,59,1,10583,101,101,4,2,59,65,1399,1401,1,8868,114,114,111,119,59,1,8615,114,114,111,119,59,1,8659,4,2,99,116,1421,1426,114,59,3,55349,56479,114,111,107,59,1,272,4,16,78,84,97,99,100,102,103,108,109,111,112,113,115,116,117,120,1466,1470,1478,1489,1515,1520,1525,1536,1544,1593,1609,1617,1650,1664,1668,1677,71,59,1,330,72,5,208,1,59,1476,1,208,99,117,116,101,5,201,1,59,1487,1,201,4,3,97,105,121,1497,1503,1512,114,111,110,59,1,282,114,99,5,202,1,59,1510,1,202,59,1,1069,111,116,59,1,278,114,59,3,55349,56584,114,97,118,101,5,200,1,59,1534,1,200,101,109,101,110,116,59,1,8712,4,2,97,112,1550,1555,99,114,59,1,274,116,121,4,2,83,86,1563,1576,109,97,108,108,83,113,117,97,114,101,59,1,9723,101,114,121,83,109,97,108,108,83,113,117,97,114,101,59,1,9643,4,2,103,112,1599,1604,111,110,59,1,280,102,59,3,55349,56636,115,105,108,111,110,59,1,917,117,4,2,97,105,1624,1640,108,4,2,59,84,1631,1633,1,10869,105,108,100,101,59,1,8770,108,105,98,114,105,117,109,59,1,8652,4,2,99,105,1656,1660,114,59,1,8496,109,59,1,10867,97,59,1,919,109,108,5,203,1,59,1675,1,203,4,2,105,112,1683,1689,115,116,115,59,1,8707,111,110,101,110,116,105,97,108,69,59,1,8519,4,5,99,102,105,111,115,1713,1717,1722,1762,1791,121,59,1,1060,114,59,3,55349,56585,108,108,101,100,4,2,83,86,1732,1745,109,97,108,108,83,113,117,97,114,101,59,1,9724,101,114,121,83,109,97,108,108,83,113,117,97,114,101,59,1,9642,4,3,112,114,117,1770,1775,1781,102,59,3,55349,56637,65,108,108,59,1,8704,114,105,101,114,116,114,102,59,1,8497,99,114,59,1,8497,4,12,74,84,97,98,99,100,102,103,111,114,115,116,1822,1827,1834,1848,1855,1877,1882,1887,1890,1896,1978,1984,99,121,59,1,1027,5,62,1,59,1832,1,62,109,109,97,4,2,59,100,1843,1845,1,915,59,1,988,114,101,118,101,59,1,286,4,3,101,105,121,1863,1869,1874,100,105,108,59,1,290,114,99,59,1,284,59,1,1043,111,116,59,1,288,114,59,3,55349,56586,59,1,8921,112,102,59,3,55349,56638,101,97,116,101,114,4,6,69,70,71,76,83,84,1915,1933,1944,1953,1959,1971,113,117,97,108,4,2,59,76,1925,1927,1,8805,101,115,115,59,1,8923,117,108,108,69,113,117,97,108,59,1,8807,114,101,97,116,101,114,59,1,10914,101,115,115,59,1,8823,108,97,110,116,69,113,117,97,108,59,1,10878,105,108,100,101,59,1,8819,99,114,59,3,55349,56482,59,1,8811,4,8,65,97,99,102,105,111,115,117,2005,2012,2026,2032,2036,2049,2073,2089,82,68,99,121,59,1,1066,4,2,99,116,2018,2023,101,107,59,1,711,59,1,94,105,114,99,59,1,292,114,59,1,8460,108,98,101,114,116,83,112,97,99,101,59,1,8459,4,2,112,114,2055,2059,102,59,1,8461,105,122,111,110,116,97,108,76,105,110,101,59,1,9472,4,2,99,116,2079,2083,114,59,1,8459,114,111,107,59,1,294,109,112,4,2,68,69,2097,2107,111,119,110,72,117,109,112,59,1,8782,113,117,97,108,59,1,8783,4,14,69,74,79,97,99,100,102,103,109,110,111,115,116,117,2144,2149,2155,2160,2171,2189,2194,2198,2209,2245,2307,2329,2334,2341,99,121,59,1,1045,108,105,103,59,1,306,99,121,59,1,1025,99,117,116,101,5,205,1,59,2169,1,205,4,2,105,121,2177,2186,114,99,5,206,1,59,2184,1,206,59,1,1048,111,116,59,1,304,114,59,1,8465,114,97,118,101,5,204,1,59,2207,1,204,4,3,59,97,112,2217,2219,2238,1,8465,4,2,99,103,2225,2229,114,59,1,298,105,110,97,114,121,73,59,1,8520,108,105,101,115,59,1,8658,4,2,116,118,2251,2281,4,2,59,101,2257,2259,1,8748,4,2,103,114,2265,2271,114,97,108,59,1,8747,115,101,99,116,105,111,110,59,1,8898,105,115,105,98,108,101,4,2,67,84,2293,2300,111,109,109,97,59,1,8291,105,109,101,115,59,1,8290,4,3,103,112,116,2315,2320,2325,111,110,59,1,302,102,59,3,55349,56640,97,59,1,921,99,114,59,1,8464,105,108,100,101,59,1,296,4,2,107,109,2347,2352,99,121,59,1,1030,108,5,207,1,59,2358,1,207,4,5,99,102,111,115,117,2372,2386,2391,2397,2414,4,2,105,121,2378,2383,114,99,59,1,308,59,1,1049,114,59,3,55349,56589,112,102,59,3,55349,56641,4,2,99,101,2403,2408,114,59,3,55349,56485,114,99,121,59,1,1032,107,99,121,59,1,1028,4,7,72,74,97,99,102,111,115,2436,2441,2446,2452,2467,2472,2478,99,121,59,1,1061,99,121,59,1,1036,112,112,97,59,1,922,4,2,101,121,2458,2464,100,105,108,59,1,310,59,1,1050,114,59,3,55349,56590,112,102,59,3,55349,56642,99,114,59,3,55349,56486,4,11,74,84,97,99,101,102,108,109,111,115,116,2508,2513,2520,2562,2585,2981,2986,3004,3011,3146,3167,99,121,59,1,1033,5,60,1,59,2518,1,60,4,5,99,109,110,112,114,2532,2538,2544,2548,2558,117,116,101,59,1,313,98,100,97,59,1,923,103,59,1,10218,108,97,99,101,116,114,102,59,1,8466,114,59,1,8606,4,3,97,101,121,2570,2576,2582,114,111,110,59,1,317,100,105,108,59,1,315,59,1,1051,4,2,102,115,2591,2907,116,4,10,65,67,68,70,82,84,85,86,97,114,2614,2663,2672,2728,2735,2760,2820,2870,2888,2895,4,2,110,114,2620,2633,103,108,101,66,114,97,99,107,101,116,59,1,10216,114,111,119,4,3,59,66,82,2644,2646,2651,1,8592,97,114,59,1,8676,105,103,104,116,65,114,114,111,119,59,1,8646,101,105,108,105,110,103,59,1,8968,111,4,2,117,119,2679,2692,98,108,101,66,114,97,99,107,101,116,59,1,10214,110,4,2,84,86,2699,2710,101,101,86,101,99,116,111,114,59,1,10593,101,99,116,111,114,4,2,59,66,2721,2723,1,8643,97,114,59,1,10585,108,111,111,114,59,1,8970,105,103,104,116,4,2,65,86,2745,2752,114,114,111,119,59,1,8596,101,99,116,111,114,59,1,10574,4,2,101,114,2766,2792,101,4,3,59,65,86,2775,2777,2784,1,8867,114,114,111,119,59,1,8612,101,99,116,111,114,59,1,10586,105,97,110,103,108,101,4,3,59,66,69,2806,2808,2813,1,8882,97,114,59,1,10703,113,117,97,108,59,1,8884,112,4,3,68,84,86,2829,2841,2852,111,119,110,86,101,99,116,111,114,59,1,10577,101,101,86,101,99,116,111,114,59,1,10592,101,99,116,111,114,4,2,59,66,2863,2865,1,8639,97,114,59,1,10584,101,99,116,111,114,4,2,59,66,2881,2883,1,8636,97,114,59,1,10578,114,114,111,119,59,1,8656,105,103,104,116,97,114,114,111,119,59,1,8660,115,4,6,69,70,71,76,83,84,2922,2936,2947,2956,2962,2974,113,117,97,108,71,114,101,97,116,101,114,59,1,8922,117,108,108,69,113,117,97,108,59,1,8806,114,101,97,116,101,114,59,1,8822,101,115,115,59,1,10913,108,97,110,116,69,113,117,97,108,59,1,10877,105,108,100,101,59,1,8818,114,59,3,55349,56591,4,2,59,101,2992,2994,1,8920,102,116,97,114,114,111,119,59,1,8666,105,100,111,116,59,1,319,4,3,110,112,119,3019,3110,3115,103,4,4,76,82,108,114,3030,3058,3070,3098,101,102,116,4,2,65,82,3039,3046,114,114,111,119,59,1,10229,105,103,104,116,65,114,114,111,119,59,1,10231,105,103,104,116,65,114,114,111,119,59,1,10230,101,102,116,4,2,97,114,3079,3086,114,114,111,119,59,1,10232,105,103,104,116,97,114,114,111,119,59,1,10234,105,103,104,116,97,114,114,111,119,59,1,10233,102,59,3,55349,56643,101,114,4,2,76,82,3123,3134,101,102,116,65,114,114,111,119,59,1,8601,105,103,104,116,65,114,114,111,119,59,1,8600,4,3,99,104,116,3154,3158,3161,114,59,1,8466,59,1,8624,114,111,107,59,1,321,59,1,8810,4,8,97,99,101,102,105,111,115,117,3188,3192,3196,3222,3227,3237,3243,3248,112,59,1,10501,121,59,1,1052,4,2,100,108,3202,3213,105,117,109,83,112,97,99,101,59,1,8287,108,105,110,116,114,102,59,1,8499,114,59,3,55349,56592,110,117,115,80,108,117,115,59,1,8723,112,102,59,3,55349,56644,99,114,59,1,8499,59,1,924,4,9,74,97,99,101,102,111,115,116,117,3271,3276,3283,3306,3422,3427,4120,4126,4137,99,121,59,1,1034,99,117,116,101,59,1,323,4,3,97,101,121,3291,3297,3303,114,111,110,59,1,327,100,105,108,59,1,325,59,1,1053,4,3,103,115,119,3314,3380,3415,97,116,105,118,101,4,3,77,84,86,3327,3340,3365,101,100,105,117,109,83,112,97,99,101,59,1,8203,104,105,4,2,99,110,3348,3357,107,83,112,97,99,101,59,1,8203,83,112,97,99,101,59,1,8203,101,114,121,84,104,105,110,83,112,97,99,101,59,1,8203,116,101,100,4,2,71,76,3389,3405,114,101,97,116,101,114,71,114,101,97,116,101,114,59,1,8811,101,115,115,76,101,115,115,59,1,8810,76,105,110,101,59,1,10,114,59,3,55349,56593,4,4,66,110,112,116,3437,3444,3460,3464,114,101,97,107,59,1,8288,66,114,101,97,107,105,110,103,83,112,97,99,101,59,1,160,102,59,1,8469,4,13,59,67,68,69,71,72,76,78,80,82,83,84,86,3492,3494,3517,3536,3578,3657,3685,3784,3823,3860,3915,4066,4107,1,10988,4,2,111,117,3500,3510,110,103,114,117,101,110,116,59,1,8802,112,67,97,112,59,1,8813,111,117,98,108,101,86,101,114,116,105,99,97,108,66,97,114,59,1,8742,4,3,108,113,120,3544,3552,3571,101,109,101,110,116,59,1,8713,117,97,108,4,2,59,84,3561,3563,1,8800,105,108,100,101,59,3,8770,824,105,115,116,115,59,1,8708,114,101,97,116,101,114,4,7,59,69,70,71,76,83,84,3600,3602,3609,3621,3631,3637,3650,1,8815,113,117,97,108,59,1,8817,117,108,108,69,113,117,97,108,59,3,8807,824,114,101,97,116,101,114,59,3,8811,824,101,115,115,59,1,8825,108,97,110,116,69,113,117,97,108,59,3,10878,824,105,108,100,101,59,1,8821,117,109,112,4,2,68,69,3666,3677,111,119,110,72,117,109,112,59,3,8782,824,113,117,97,108,59,3,8783,824,101,4,2,102,115,3692,3724,116,84,114,105,97,110,103,108,101,4,3,59,66,69,3709,3711,3717,1,8938,97,114,59,3,10703,824,113,117,97,108,59,1,8940,115,4,6,59,69,71,76,83,84,3739,3741,3748,3757,3764,3777,1,8814,113,117,97,108,59,1,8816,114,101,97,116,101,114,59,1,8824,101,115,115,59,3,8810,824,108,97,110,116,69,113,117,97,108,59,3,10877,824,105,108,100,101,59,1,8820,101,115,116,101,100,4,2,71,76,3795,3812,114,101,97,116,101,114,71,114,101,97,116,101,114,59,3,10914,824,101,115,115,76,101,115,115,59,3,10913,824,114,101,99,101,100,101,115,4,3,59,69,83,3838,3840,3848,1,8832,113,117,97,108,59,3,10927,824,108,97,110,116,69,113,117,97,108,59,1,8928,4,2,101,105,3866,3881,118,101,114,115,101,69,108,101,109,101,110,116,59,1,8716,103,104,116,84,114,105,97,110,103,108,101,4,3,59,66,69,3900,3902,3908,1,8939,97,114,59,3,10704,824,113,117,97,108,59,1,8941,4,2,113,117,3921,3973,117,97,114,101,83,117,4,2,98,112,3933,3952,115,101,116,4,2,59,69,3942,3945,3,8847,824,113,117,97,108,59,1,8930,101,114,115,101,116,4,2,59,69,3963,3966,3,8848,824,113,117,97,108,59,1,8931,4,3,98,99,112,3981,4e3,4045,115,101,116,4,2,59,69,3990,3993,3,8834,8402,113,117,97,108,59,1,8840,99,101,101,100,115,4,4,59,69,83,84,4015,4017,4025,4037,1,8833,113,117,97,108,59,3,10928,824,108,97,110,116,69,113,117,97,108,59,1,8929,105,108,100,101,59,3,8831,824,101,114,115,101,116,4,2,59,69,4056,4059,3,8835,8402,113,117,97,108,59,1,8841,105,108,100,101,4,4,59,69,70,84,4080,4082,4089,4100,1,8769,113,117,97,108,59,1,8772,117,108,108,69,113,117,97,108,59,1,8775,105,108,100,101,59,1,8777,101,114,116,105,99,97,108,66,97,114,59,1,8740,99,114,59,3,55349,56489,105,108,100,101,5,209,1,59,4135,1,209,59,1,925,4,14,69,97,99,100,102,103,109,111,112,114,115,116,117,118,4170,4176,4187,4205,4212,4217,4228,4253,4259,4292,4295,4316,4337,4346,108,105,103,59,1,338,99,117,116,101,5,211,1,59,4185,1,211,4,2,105,121,4193,4202,114,99,5,212,1,59,4200,1,212,59,1,1054,98,108,97,99,59,1,336,114,59,3,55349,56594,114,97,118,101,5,210,1,59,4226,1,210,4,3,97,101,105,4236,4241,4246,99,114,59,1,332,103,97,59,1,937,99,114,111,110,59,1,927,112,102,59,3,55349,56646,101,110,67,117,114,108,121,4,2,68,81,4272,4285,111,117,98,108,101,81,117,111,116,101,59,1,8220,117,111,116,101,59,1,8216,59,1,10836,4,2,99,108,4301,4306,114,59,3,55349,56490,97,115,104,5,216,1,59,4314,1,216,105,4,2,108,109,4323,4332,100,101,5,213,1,59,4330,1,213,101,115,59,1,10807,109,108,5,214,1,59,4344,1,214,101,114,4,2,66,80,4354,4380,4,2,97,114,4360,4364,114,59,1,8254,97,99,4,2,101,107,4372,4375,59,1,9182,101,116,59,1,9140,97,114,101,110,116,104,101,115,105,115,59,1,9180,4,9,97,99,102,104,105,108,111,114,115,4413,4422,4426,4431,4435,4438,4448,4471,4561,114,116,105,97,108,68,59,1,8706,121,59,1,1055,114,59,3,55349,56595,105,59,1,934,59,1,928,117,115,77,105,110,117,115,59,1,177,4,2,105,112,4454,4467,110,99,97,114,101,112,108,97,110,101,59,1,8460,102,59,1,8473,4,4,59,101,105,111,4481,4483,4526,4531,1,10939,99,101,100,101,115,4,4,59,69,83,84,4498,4500,4507,4519,1,8826,113,117,97,108,59,1,10927,108,97,110,116,69,113,117,97,108,59,1,8828,105,108,100,101,59,1,8830,109,101,59,1,8243,4,2,100,112,4537,4543,117,99,116,59,1,8719,111,114,116,105,111,110,4,2,59,97,4555,4557,1,8759,108,59,1,8733,4,2,99,105,4567,4572,114,59,3,55349,56491,59,1,936,4,4,85,102,111,115,4585,4594,4599,4604,79,84,5,34,1,59,4592,1,34,114,59,3,55349,56596,112,102,59,1,8474,99,114,59,3,55349,56492,4,12,66,69,97,99,101,102,104,105,111,114,115,117,4636,4642,4650,4681,4704,4763,4767,4771,5047,5069,5081,5094,97,114,114,59,1,10512,71,5,174,1,59,4648,1,174,4,3,99,110,114,4658,4664,4668,117,116,101,59,1,340,103,59,1,10219,114,4,2,59,116,4675,4677,1,8608,108,59,1,10518,4,3,97,101,121,4689,4695,4701,114,111,110,59,1,344,100,105,108,59,1,342,59,1,1056,4,2,59,118,4710,4712,1,8476,101,114,115,101,4,2,69,85,4722,4748,4,2,108,113,4728,4736,101,109,101,110,116,59,1,8715,117,105,108,105,98,114,105,117,109,59,1,8651,112,69,113,117,105,108,105,98,114,105,117,109,59,1,10607,114,59,1,8476,111,59,1,929,103,104,116,4,8,65,67,68,70,84,85,86,97,4792,4840,4849,4905,4912,4972,5022,5040,4,2,110,114,4798,4811,103,108,101,66,114,97,99,107,101,116,59,1,10217,114,111,119,4,3,59,66,76,4822,4824,4829,1,8594,97,114,59,1,8677,101,102,116,65,114,114,111,119,59,1,8644,101,105,108,105,110,103,59,1,8969,111,4,2,117,119,4856,4869,98,108,101,66,114,97,99,107,101,116,59,1,10215,110,4,2,84,86,4876,4887,101,101,86,101,99,116,111,114,59,1,10589,101,99,116,111,114,4,2,59,66,4898,4900,1,8642,97,114,59,1,10581,108,111,111,114,59,1,8971,4,2,101,114,4918,4944,101,4,3,59,65,86,4927,4929,4936,1,8866,114,114,111,119,59,1,8614,101,99,116,111,114,59,1,10587,105,97,110,103,108,101,4,3,59,66,69,4958,4960,4965,1,8883,97,114,59,1,10704,113,117,97,108,59,1,8885,112,4,3,68,84,86,4981,4993,5004,111,119,110,86,101,99,116,111,114,59,1,10575,101,101,86,101,99,116,111,114,59,1,10588,101,99,116,111,114,4,2,59,66,5015,5017,1,8638,97,114,59,1,10580,101,99,116,111,114,4,2,59,66,5033,5035,1,8640,97,114,59,1,10579,114,114,111,119,59,1,8658,4,2,112,117,5053,5057,102,59,1,8477,110,100,73,109,112,108,105,101,115,59,1,10608,105,103,104,116,97,114,114,111,119,59,1,8667,4,2,99,104,5087,5091,114,59,1,8475,59,1,8625,108,101,68,101,108,97,121,101,100,59,1,10740,4,13,72,79,97,99,102,104,105,109,111,113,115,116,117,5134,5150,5157,5164,5198,5203,5259,5265,5277,5283,5374,5380,5385,4,2,67,99,5140,5146,72,99,121,59,1,1065,121,59,1,1064,70,84,99,121,59,1,1068,99,117,116,101,59,1,346,4,5,59,97,101,105,121,5176,5178,5184,5190,5195,1,10940,114,111,110,59,1,352,100,105,108,59,1,350,114,99,59,1,348,59,1,1057,114,59,3,55349,56598,111,114,116,4,4,68,76,82,85,5216,5227,5238,5250,111,119,110,65,114,114,111,119,59,1,8595,101,102,116,65,114,114,111,119,59,1,8592,105,103,104,116,65,114,114,111,119,59,1,8594,112,65,114,114,111,119,59,1,8593,103,109,97,59,1,931,97,108,108,67,105,114,99,108,101,59,1,8728,112,102,59,3,55349,56650,4,2,114,117,5289,5293,116,59,1,8730,97,114,101,4,4,59,73,83,85,5306,5308,5322,5367,1,9633,110,116,101,114,115,101,99,116,105,111,110,59,1,8851,117,4,2,98,112,5329,5347,115,101,116,4,2,59,69,5338,5340,1,8847,113,117,97,108,59,1,8849,101,114,115,101,116,4,2,59,69,5358,5360,1,8848,113,117,97,108,59,1,8850,110,105,111,110,59,1,8852,99,114,59,3,55349,56494,97,114,59,1,8902,4,4,98,99,109,112,5395,5420,5475,5478,4,2,59,115,5401,5403,1,8912,101,116,4,2,59,69,5411,5413,1,8912,113,117,97,108,59,1,8838,4,2,99,104,5426,5468,101,101,100,115,4,4,59,69,83,84,5440,5442,5449,5461,1,8827,113,117,97,108,59,1,10928,108,97,110,116,69,113,117,97,108,59,1,8829,105,108,100,101,59,1,8831,84,104,97,116,59,1,8715,59,1,8721,4,3,59,101,115,5486,5488,5507,1,8913,114,115,101,116,4,2,59,69,5498,5500,1,8835,113,117,97,108,59,1,8839,101,116,59,1,8913,4,11,72,82,83,97,99,102,104,105,111,114,115,5536,5546,5552,5567,5579,5602,5607,5655,5695,5701,5711,79,82,78,5,222,1,59,5544,1,222,65,68,69,59,1,8482,4,2,72,99,5558,5563,99,121,59,1,1035,121,59,1,1062,4,2,98,117,5573,5576,59,1,9,59,1,932,4,3,97,101,121,5587,5593,5599,114,111,110,59,1,356,100,105,108,59,1,354,59,1,1058,114,59,3,55349,56599,4,2,101,105,5613,5631,4,2,114,116,5619,5627,101,102,111,114,101,59,1,8756,97,59,1,920,4,2,99,110,5637,5647,107,83,112,97,99,101,59,3,8287,8202,83,112,97,99,101,59,1,8201,108,100,101,4,4,59,69,70,84,5668,5670,5677,5688,1,8764,113,117,97,108,59,1,8771,117,108,108,69,113,117,97,108,59,1,8773,105,108,100,101,59,1,8776,112,102,59,3,55349,56651,105,112,108,101,68,111,116,59,1,8411,4,2,99,116,5717,5722,114,59,3,55349,56495,114,111,107,59,1,358,4,14,97,98,99,100,102,103,109,110,111,112,114,115,116,117,5758,5789,5805,5823,5830,5835,5846,5852,5921,5937,6089,6095,6101,6108,4,2,99,114,5764,5774,117,116,101,5,218,1,59,5772,1,218,114,4,2,59,111,5781,5783,1,8607,99,105,114,59,1,10569,114,4,2,99,101,5796,5800,121,59,1,1038,118,101,59,1,364,4,2,105,121,5811,5820,114,99,5,219,1,59,5818,1,219,59,1,1059,98,108,97,99,59,1,368,114,59,3,55349,56600,114,97,118,101,5,217,1,59,5844,1,217,97,99,114,59,1,362,4,2,100,105,5858,5905,101,114,4,2,66,80,5866,5892,4,2,97,114,5872,5876,114,59,1,95,97,99,4,2,101,107,5884,5887,59,1,9183,101,116,59,1,9141,97,114,101,110,116,104,101,115,105,115,59,1,9181,111,110,4,2,59,80,5913,5915,1,8899,108,117,115,59,1,8846,4,2,103,112,5927,5932,111,110,59,1,370,102,59,3,55349,56652,4,8,65,68,69,84,97,100,112,115,5955,5985,5996,6009,6026,6033,6044,6075,114,114,111,119,4,3,59,66,68,5967,5969,5974,1,8593,97,114,59,1,10514,111,119,110,65,114,114,111,119,59,1,8645,111,119,110,65,114,114,111,119,59,1,8597,113,117,105,108,105,98,114,105,117,109,59,1,10606,101,101,4,2,59,65,6017,6019,1,8869,114,114,111,119,59,1,8613,114,114,111,119,59,1,8657,111,119,110,97,114,114,111,119,59,1,8661,101,114,4,2,76,82,6052,6063,101,102,116,65,114,114,111,119,59,1,8598,105,103,104,116,65,114,114,111,119,59,1,8599,105,4,2,59,108,6082,6084,1,978,111,110,59,1,933,105,110,103,59,1,366,99,114,59,3,55349,56496,105,108,100,101,59,1,360,109,108,5,220,1,59,6115,1,220,4,9,68,98,99,100,101,102,111,115,118,6137,6143,6148,6152,6166,6250,6255,6261,6267,97,115,104,59,1,8875,97,114,59,1,10987,121,59,1,1042,97,115,104,4,2,59,108,6161,6163,1,8873,59,1,10982,4,2,101,114,6172,6175,59,1,8897,4,3,98,116,121,6183,6188,6238,97,114,59,1,8214,4,2,59,105,6194,6196,1,8214,99,97,108,4,4,66,76,83,84,6209,6214,6220,6231,97,114,59,1,8739,105,110,101,59,1,124,101,112,97,114,97,116,111,114,59,1,10072,105,108,100,101,59,1,8768,84,104,105,110,83,112,97,99,101,59,1,8202,114,59,3,55349,56601,112,102,59,3,55349,56653,99,114,59,3,55349,56497,100,97,115,104,59,1,8874,4,5,99,101,102,111,115,6286,6292,6298,6303,6309,105,114,99,59,1,372,100,103,101,59,1,8896,114,59,3,55349,56602,112,102,59,3,55349,56654,99,114,59,3,55349,56498,4,4,102,105,111,115,6325,6330,6333,6339,114,59,3,55349,56603,59,1,926,112,102,59,3,55349,56655,99,114,59,3,55349,56499,4,9,65,73,85,97,99,102,111,115,117,6365,6370,6375,6380,6391,6405,6410,6416,6422,99,121,59,1,1071,99,121,59,1,1031,99,121,59,1,1070,99,117,116,101,5,221,1,59,6389,1,221,4,2,105,121,6397,6402,114,99,59,1,374,59,1,1067,114,59,3,55349,56604,112,102,59,3,55349,56656,99,114,59,3,55349,56500,109,108,59,1,376,4,8,72,97,99,100,101,102,111,115,6445,6450,6457,6472,6477,6501,6505,6510,99,121,59,1,1046,99,117,116,101,59,1,377,4,2,97,121,6463,6469,114,111,110,59,1,381,59,1,1047,111,116,59,1,379,4,2,114,116,6483,6497,111,87,105,100,116,104,83,112,97,99,101,59,1,8203,97,59,1,918,114,59,1,8488,112,102,59,1,8484,99,114,59,3,55349,56501,4,16,97,98,99,101,102,103,108,109,110,111,112,114,115,116,117,119,6550,6561,6568,6612,6622,6634,6645,6672,6699,6854,6870,6923,6933,6963,6974,6983,99,117,116,101,5,225,1,59,6559,1,225,114,101,118,101,59,1,259,4,6,59,69,100,105,117,121,6582,6584,6588,6591,6600,6609,1,8766,59,3,8766,819,59,1,8767,114,99,5,226,1,59,6598,1,226,116,101,5,180,1,59,6607,1,180,59,1,1072,108,105,103,5,230,1,59,6620,1,230,4,2,59,114,6628,6630,1,8289,59,3,55349,56606,114,97,118,101,5,224,1,59,6643,1,224,4,2,101,112,6651,6667,4,2,102,112,6657,6663,115,121,109,59,1,8501,104,59,1,8501,104,97,59,1,945,4,2,97,112,6678,6692,4,2,99,108,6684,6688,114,59,1,257,103,59,1,10815,5,38,1,59,6697,1,38,4,2,100,103,6705,6737,4,5,59,97,100,115,118,6717,6719,6724,6727,6734,1,8743,110,100,59,1,10837,59,1,10844,108,111,112,101,59,1,10840,59,1,10842,4,7,59,101,108,109,114,115,122,6753,6755,6758,6762,6814,6835,6848,1,8736,59,1,10660,101,59,1,8736,115,100,4,2,59,97,6770,6772,1,8737,4,8,97,98,99,100,101,102,103,104,6790,6793,6796,6799,6802,6805,6808,6811,59,1,10664,59,1,10665,59,1,10666,59,1,10667,59,1,10668,59,1,10669,59,1,10670,59,1,10671,116,4,2,59,118,6821,6823,1,8735,98,4,2,59,100,6830,6832,1,8894,59,1,10653,4,2,112,116,6841,6845,104,59,1,8738,59,1,197,97,114,114,59,1,9084,4,2,103,112,6860,6865,111,110,59,1,261,102,59,3,55349,56658,4,7,59,69,97,101,105,111,112,6886,6888,6891,6897,6900,6904,6908,1,8776,59,1,10864,99,105,114,59,1,10863,59,1,8778,100,59,1,8779,115,59,1,39,114,111,120,4,2,59,101,6917,6919,1,8776,113,59,1,8778,105,110,103,5,229,1,59,6931,1,229,4,3,99,116,121,6941,6946,6949,114,59,3,55349,56502,59,1,42,109,112,4,2,59,101,6957,6959,1,8776,113,59,1,8781,105,108,100,101,5,227,1,59,6972,1,227,109,108,5,228,1,59,6981,1,228,4,2,99,105,6989,6997,111,110,105,110,116,59,1,8755,110,116,59,1,10769,4,16,78,97,98,99,100,101,102,105,107,108,110,111,112,114,115,117,7036,7041,7119,7135,7149,7155,7219,7224,7347,7354,7463,7489,7786,7793,7814,7866,111,116,59,1,10989,4,2,99,114,7047,7094,107,4,4,99,101,112,115,7058,7064,7073,7080,111,110,103,59,1,8780,112,115,105,108,111,110,59,1,1014,114,105,109,101,59,1,8245,105,109,4,2,59,101,7088,7090,1,8765,113,59,1,8909,4,2,118,119,7100,7105,101,101,59,1,8893,101,100,4,2,59,103,7113,7115,1,8965,101,59,1,8965,114,107,4,2,59,116,7127,7129,1,9141,98,114,107,59,1,9142,4,2,111,121,7141,7146,110,103,59,1,8780,59,1,1073,113,117,111,59,1,8222,4,5,99,109,112,114,116,7167,7181,7188,7193,7199,97,117,115,4,2,59,101,7176,7178,1,8757,59,1,8757,112,116,121,118,59,1,10672,115,105,59,1,1014,110,111,117,59,1,8492,4,3,97,104,119,7207,7210,7213,59,1,946,59,1,8502,101,101,110,59,1,8812,114,59,3,55349,56607,103,4,7,99,111,115,116,117,118,119,7241,7262,7288,7305,7328,7335,7340,4,3,97,105,117,7249,7253,7258,112,59,1,8898,114,99,59,1,9711,112,59,1,8899,4,3,100,112,116,7270,7275,7281,111,116,59,1,10752,108,117,115,59,1,10753,105,109,101,115,59,1,10754,4,2,113,116,7294,7300,99,117,112,59,1,10758,97,114,59,1,9733,114,105,97,110,103,108,101,4,2,100,117,7318,7324,111,119,110,59,1,9661,112,59,1,9651,112,108,117,115,59,1,10756,101,101,59,1,8897,101,100,103,101,59,1,8896,97,114,111,119,59,1,10509,4,3,97,107,111,7362,7436,7458,4,2,99,110,7368,7432,107,4,3,108,115,116,7377,7386,7394,111,122,101,110,103,101,59,1,10731,113,117,97,114,101,59,1,9642,114,105,97,110,103,108,101,4,4,59,100,108,114,7411,7413,7419,7425,1,9652,111,119,110,59,1,9662,101,102,116,59,1,9666,105,103,104,116,59,1,9656,107,59,1,9251,4,2,49,51,7442,7454,4,2,50,52,7448,7451,59,1,9618,59,1,9617,52,59,1,9619,99,107,59,1,9608,4,2,101,111,7469,7485,4,2,59,113,7475,7478,3,61,8421,117,105,118,59,3,8801,8421,116,59,1,8976,4,4,112,116,119,120,7499,7504,7517,7523,102,59,3,55349,56659,4,2,59,116,7510,7512,1,8869,111,109,59,1,8869,116,105,101,59,1,8904,4,12,68,72,85,86,98,100,104,109,112,116,117,118,7549,7571,7597,7619,7655,7660,7682,7708,7715,7721,7728,7750,4,4,76,82,108,114,7559,7562,7565,7568,59,1,9559,59,1,9556,59,1,9558,59,1,9555,4,5,59,68,85,100,117,7583,7585,7588,7591,7594,1,9552,59,1,9574,59,1,9577,59,1,9572,59,1,9575,4,4,76,82,108,114,7607,7610,7613,7616,59,1,9565,59,1,9562,59,1,9564,59,1,9561,4,7,59,72,76,82,104,108,114,7635,7637,7640,7643,7646,7649,7652,1,9553,59,1,9580,59,1,9571,59,1,9568,59,1,9579,59,1,9570,59,1,9567,111,120,59,1,10697,4,4,76,82,108,114,7670,7673,7676,7679,59,1,9557,59,1,9554,59,1,9488,59,1,9484,4,5,59,68,85,100,117,7694,7696,7699,7702,7705,1,9472,59,1,9573,59,1,9576,59,1,9516,59,1,9524,105,110,117,115,59,1,8863,108,117,115,59,1,8862,105,109,101,115,59,1,8864,4,4,76,82,108,114,7738,7741,7744,7747,59,1,9563,59,1,9560,59,1,9496,59,1,9492,4,7,59,72,76,82,104,108,114,7766,7768,7771,7774,7777,7780,7783,1,9474,59,1,9578,59,1,9569,59,1,9566,59,1,9532,59,1,9508,59,1,9500,114,105,109,101,59,1,8245,4,2,101,118,7799,7804,118,101,59,1,728,98,97,114,5,166,1,59,7812,1,166,4,4,99,101,105,111,7824,7829,7834,7846,114,59,3,55349,56503,109,105,59,1,8271,109,4,2,59,101,7841,7843,1,8765,59,1,8909,108,4,3,59,98,104,7855,7857,7860,1,92,59,1,10693,115,117,98,59,1,10184,4,2,108,109,7872,7885,108,4,2,59,101,7879,7881,1,8226,116,59,1,8226,112,4,3,59,69,101,7894,7896,7899,1,8782,59,1,10926,4,2,59,113,7905,7907,1,8783,59,1,8783,4,15,97,99,100,101,102,104,105,108,111,114,115,116,117,119,121,7942,8021,8075,8080,8121,8126,8157,8279,8295,8430,8446,8485,8491,8707,8726,4,3,99,112,114,7950,7956,8007,117,116,101,59,1,263,4,6,59,97,98,99,100,115,7970,7972,7977,7984,7998,8003,1,8745,110,100,59,1,10820,114,99,117,112,59,1,10825,4,2,97,117,7990,7994,112,59,1,10827,112,59,1,10823,111,116,59,1,10816,59,3,8745,65024,4,2,101,111,8013,8017,116,59,1,8257,110,59,1,711,4,4,97,101,105,117,8031,8046,8056,8061,4,2,112,114,8037,8041,115,59,1,10829,111,110,59,1,269,100,105,108,5,231,1,59,8054,1,231,114,99,59,1,265,112,115,4,2,59,115,8069,8071,1,10828,109,59,1,10832,111,116,59,1,267,4,3,100,109,110,8088,8097,8104,105,108,5,184,1,59,8095,1,184,112,116,121,118,59,1,10674,116,5,162,2,59,101,8112,8114,1,162,114,100,111,116,59,1,183,114,59,3,55349,56608,4,3,99,101,105,8134,8138,8154,121,59,1,1095,99,107,4,2,59,109,8146,8148,1,10003,97,114,107,59,1,10003,59,1,967,114,4,7,59,69,99,101,102,109,115,8174,8176,8179,8258,8261,8268,8273,1,9675,59,1,10691,4,3,59,101,108,8187,8189,8193,1,710,113,59,1,8791,101,4,2,97,100,8200,8223,114,114,111,119,4,2,108,114,8210,8216,101,102,116,59,1,8634,105,103,104,116,59,1,8635,4,5,82,83,97,99,100,8235,8238,8241,8246,8252,59,1,174,59,1,9416,115,116,59,1,8859,105,114,99,59,1,8858,97,115,104,59,1,8861,59,1,8791,110,105,110,116,59,1,10768,105,100,59,1,10991,99,105,114,59,1,10690,117,98,115,4,2,59,117,8288,8290,1,9827,105,116,59,1,9827,4,4,108,109,110,112,8305,8326,8376,8400,111,110,4,2,59,101,8313,8315,1,58,4,2,59,113,8321,8323,1,8788,59,1,8788,4,2,109,112,8332,8344,97,4,2,59,116,8339,8341,1,44,59,1,64,4,3,59,102,108,8352,8354,8358,1,8705,110,59,1,8728,101,4,2,109,120,8365,8371,101,110,116,59,1,8705,101,115,59,1,8450,4,2,103,105,8382,8395,4,2,59,100,8388,8390,1,8773,111,116,59,1,10861,110,116,59,1,8750,4,3,102,114,121,8408,8412,8417,59,3,55349,56660,111,100,59,1,8720,5,169,2,59,115,8424,8426,1,169,114,59,1,8471,4,2,97,111,8436,8441,114,114,59,1,8629,115,115,59,1,10007,4,2,99,117,8452,8457,114,59,3,55349,56504,4,2,98,112,8463,8474,4,2,59,101,8469,8471,1,10959,59,1,10961,4,2,59,101,8480,8482,1,10960,59,1,10962,100,111,116,59,1,8943,4,7,100,101,108,112,114,118,119,8507,8522,8536,8550,8600,8697,8702,97,114,114,4,2,108,114,8516,8519,59,1,10552,59,1,10549,4,2,112,115,8528,8532,114,59,1,8926,99,59,1,8927,97,114,114,4,2,59,112,8545,8547,1,8630,59,1,10557,4,6,59,98,99,100,111,115,8564,8566,8573,8587,8592,8596,1,8746,114,99,97,112,59,1,10824,4,2,97,117,8579,8583,112,59,1,10822,112,59,1,10826,111,116,59,1,8845,114,59,1,10821,59,3,8746,65024,4,4,97,108,114,118,8610,8623,8663,8672,114,114,4,2,59,109,8618,8620,1,8631,59,1,10556,121,4,3,101,118,119,8632,8651,8656,113,4,2,112,115,8639,8645,114,101,99,59,1,8926,117,99,99,59,1,8927,101,101,59,1,8910,101,100,103,101,59,1,8911,101,110,5,164,1,59,8670,1,164,101,97,114,114,111,119,4,2,108,114,8684,8690,101,102,116,59,1,8630,105,103,104,116,59,1,8631,101,101,59,1,8910,101,100,59,1,8911,4,2,99,105,8713,8721,111,110,105,110,116,59,1,8754,110,116,59,1,8753,108,99,116,121,59,1,9005,4,19,65,72,97,98,99,100,101,102,104,105,106,108,111,114,115,116,117,119,122,8773,8778,8783,8821,8839,8854,8887,8914,8930,8944,9036,9041,9058,9197,9227,9258,9281,9297,9305,114,114,59,1,8659,97,114,59,1,10597,4,4,103,108,114,115,8793,8799,8805,8809,103,101,114,59,1,8224,101,116,104,59,1,8504,114,59,1,8595,104,4,2,59,118,8816,8818,1,8208,59,1,8867,4,2,107,108,8827,8834,97,114,111,119,59,1,10511,97,99,59,1,733,4,2,97,121,8845,8851,114,111,110,59,1,271,59,1,1076,4,3,59,97,111,8862,8864,8880,1,8518,4,2,103,114,8870,8876,103,101,114,59,1,8225,114,59,1,8650,116,115,101,113,59,1,10871,4,3,103,108,109,8895,8902,8907,5,176,1,59,8900,1,176,116,97,59,1,948,112,116,121,118,59,1,10673,4,2,105,114,8920,8926,115,104,116,59,1,10623,59,3,55349,56609,97,114,4,2,108,114,8938,8941,59,1,8643,59,1,8642,4,5,97,101,103,115,118,8956,8986,8989,8996,9001,109,4,3,59,111,115,8965,8967,8983,1,8900,110,100,4,2,59,115,8975,8977,1,8900,117,105,116,59,1,9830,59,1,9830,59,1,168,97,109,109,97,59,1,989,105,110,59,1,8946,4,3,59,105,111,9009,9011,9031,1,247,100,101,5,247,2,59,111,9020,9022,1,247,110,116,105,109,101,115,59,1,8903,110,120,59,1,8903,99,121,59,1,1106,99,4,2,111,114,9048,9053,114,110,59,1,8990,111,112,59,1,8973,4,5,108,112,116,117,119,9070,9076,9081,9130,9144,108,97,114,59,1,36,102,59,3,55349,56661,4,5,59,101,109,112,115,9093,9095,9109,9116,9122,1,729,113,4,2,59,100,9102,9104,1,8784,111,116,59,1,8785,105,110,117,115,59,1,8760,108,117,115,59,1,8724,113,117,97,114,101,59,1,8865,98,108,101,98,97,114,119,101,100,103,101,59,1,8966,110,4,3,97,100,104,9153,9160,9172,114,114,111,119,59,1,8595,111,119,110,97,114,114,111,119,115,59,1,8650,97,114,112,111,111,110,4,2,108,114,9184,9190,101,102,116,59,1,8643,105,103,104,116,59,1,8642,4,2,98,99,9203,9211,107,97,114,111,119,59,1,10512,4,2,111,114,9217,9222,114,110,59,1,8991,111,112,59,1,8972,4,3,99,111,116,9235,9248,9252,4,2,114,121,9241,9245,59,3,55349,56505,59,1,1109,108,59,1,10742,114,111,107,59,1,273,4,2,100,114,9264,9269,111,116,59,1,8945,105,4,2,59,102,9276,9278,1,9663,59,1,9662,4,2,97,104,9287,9292,114,114,59,1,8693,97,114,59,1,10607,97,110,103,108,101,59,1,10662,4,2,99,105,9311,9315,121,59,1,1119,103,114,97,114,114,59,1,10239,4,18,68,97,99,100,101,102,103,108,109,110,111,112,113,114,115,116,117,120,9361,9376,9398,9439,9444,9447,9462,9495,9531,9585,9598,9614,9659,9755,9771,9792,9808,9826,4,2,68,111,9367,9372,111,116,59,1,10871,116,59,1,8785,4,2,99,115,9382,9392,117,116,101,5,233,1,59,9390,1,233,116,101,114,59,1,10862,4,4,97,105,111,121,9408,9414,9430,9436,114,111,110,59,1,283,114,4,2,59,99,9421,9423,1,8790,5,234,1,59,9428,1,234,108,111,110,59,1,8789,59,1,1101,111,116,59,1,279,59,1,8519,4,2,68,114,9453,9458,111,116,59,1,8786,59,3,55349,56610,4,3,59,114,115,9470,9472,9482,1,10906,97,118,101,5,232,1,59,9480,1,232,4,2,59,100,9488,9490,1,10902,111,116,59,1,10904,4,4,59,105,108,115,9505,9507,9515,9518,1,10905,110,116,101,114,115,59,1,9191,59,1,8467,4,2,59,100,9524,9526,1,10901,111,116,59,1,10903,4,3,97,112,115,9539,9544,9564,99,114,59,1,275,116,121,4,3,59,115,118,9554,9556,9561,1,8709,101,116,59,1,8709,59,1,8709,112,4,2,49,59,9571,9583,4,2,51,52,9577,9580,59,1,8196,59,1,8197,1,8195,4,2,103,115,9591,9594,59,1,331,112,59,1,8194,4,2,103,112,9604,9609,111,110,59,1,281,102,59,3,55349,56662,4,3,97,108,115,9622,9635,9640,114,4,2,59,115,9629,9631,1,8917,108,59,1,10723,117,115,59,1,10865,105,4,3,59,108,118,9649,9651,9656,1,949,111,110,59,1,949,59,1,1013,4,4,99,115,117,118,9669,9686,9716,9747,4,2,105,111,9675,9680,114,99,59,1,8790,108,111,110,59,1,8789,4,2,105,108,9692,9696,109,59,1,8770,97,110,116,4,2,103,108,9705,9710,116,114,59,1,10902,101,115,115,59,1,10901,4,3,97,101,105,9724,9729,9734,108,115,59,1,61,115,116,59,1,8799,118,4,2,59,68,9741,9743,1,8801,68,59,1,10872,112,97,114,115,108,59,1,10725,4,2,68,97,9761,9766,111,116,59,1,8787,114,114,59,1,10609,4,3,99,100,105,9779,9783,9788,114,59,1,8495,111,116,59,1,8784,109,59,1,8770,4,2,97,104,9798,9801,59,1,951,5,240,1,59,9806,1,240,4,2,109,114,9814,9822,108,5,235,1,59,9820,1,235,111,59,1,8364,4,3,99,105,112,9834,9838,9843,108,59,1,33,115,116,59,1,8707,4,2,101,111,9849,9859,99,116,97,116,105,111,110,59,1,8496,110,101,110,116,105,97,108,101,59,1,8519,4,12,97,99,101,102,105,106,108,110,111,112,114,115,9896,9910,9914,9921,9954,9960,9967,9989,9994,10027,10036,10164,108,108,105,110,103,100,111,116,115,101,113,59,1,8786,121,59,1,1092,109,97,108,101,59,1,9792,4,3,105,108,114,9929,9935,9950,108,105,103,59,1,64259,4,2,105,108,9941,9945,103,59,1,64256,105,103,59,1,64260,59,3,55349,56611,108,105,103,59,1,64257,108,105,103,59,3,102,106,4,3,97,108,116,9975,9979,9984,116,59,1,9837,105,103,59,1,64258,110,115,59,1,9649,111,102,59,1,402,4,2,112,114,1e4,10005,102,59,3,55349,56663,4,2,97,107,10011,10016,108,108,59,1,8704,4,2,59,118,10022,10024,1,8916,59,1,10969,97,114,116,105,110,116,59,1,10765,4,2,97,111,10042,10159,4,2,99,115,10048,10155,4,6,49,50,51,52,53,55,10062,10102,10114,10135,10139,10151,4,6,50,51,52,53,54,56,10076,10083,10086,10093,10096,10099,5,189,1,59,10081,1,189,59,1,8531,5,188,1,59,10091,1,188,59,1,8533,59,1,8537,59,1,8539,4,2,51,53,10108,10111,59,1,8532,59,1,8534,4,3,52,53,56,10122,10129,10132,5,190,1,59,10127,1,190,59,1,8535,59,1,8540,53,59,1,8536,4,2,54,56,10145,10148,59,1,8538,59,1,8541,56,59,1,8542,108,59,1,8260,119,110,59,1,8994,99,114,59,3,55349,56507,4,17,69,97,98,99,100,101,102,103,105,106,108,110,111,114,115,116,118,10206,10217,10247,10254,10268,10273,10358,10363,10374,10380,10385,10406,10458,10464,10470,10497,10610,4,2,59,108,10212,10214,1,8807,59,1,10892,4,3,99,109,112,10225,10231,10244,117,116,101,59,1,501,109,97,4,2,59,100,10239,10241,1,947,59,1,989,59,1,10886,114,101,118,101,59,1,287,4,2,105,121,10260,10265,114,99,59,1,285,59,1,1075,111,116,59,1,289,4,4,59,108,113,115,10283,10285,10288,10308,1,8805,59,1,8923,4,3,59,113,115,10296,10298,10301,1,8805,59,1,8807,108,97,110,116,59,1,10878,4,4,59,99,100,108,10318,10320,10324,10345,1,10878,99,59,1,10921,111,116,4,2,59,111,10332,10334,1,10880,4,2,59,108,10340,10342,1,10882,59,1,10884,4,2,59,101,10351,10354,3,8923,65024,115,59,1,10900,114,59,3,55349,56612,4,2,59,103,10369,10371,1,8811,59,1,8921,109,101,108,59,1,8503,99,121,59,1,1107,4,4,59,69,97,106,10395,10397,10400,10403,1,8823,59,1,10898,59,1,10917,59,1,10916,4,4,69,97,101,115,10416,10419,10434,10453,59,1,8809,112,4,2,59,112,10426,10428,1,10890,114,111,120,59,1,10890,4,2,59,113,10440,10442,1,10888,4,2,59,113,10448,10450,1,10888,59,1,8809,105,109,59,1,8935,112,102,59,3,55349,56664,97,118,101,59,1,96,4,2,99,105,10476,10480,114,59,1,8458,109,4,3,59,101,108,10489,10491,10494,1,8819,59,1,10894,59,1,10896,5,62,6,59,99,100,108,113,114,10512,10514,10527,10532,10538,10545,1,62,4,2,99,105,10520,10523,59,1,10919,114,59,1,10874,111,116,59,1,8919,80,97,114,59,1,10645,117,101,115,116,59,1,10876,4,5,97,100,101,108,115,10557,10574,10579,10599,10605,4,2,112,114,10563,10570,112,114,111,120,59,1,10886,114,59,1,10616,111,116,59,1,8919,113,4,2,108,113,10586,10592,101,115,115,59,1,8923,108,101,115,115,59,1,10892,101,115,115,59,1,8823,105,109,59,1,8819,4,2,101,110,10616,10626,114,116,110,101,113,113,59,3,8809,65024,69,59,3,8809,65024,4,10,65,97,98,99,101,102,107,111,115,121,10653,10658,10713,10718,10724,10760,10765,10786,10850,10875,114,114,59,1,8660,4,4,105,108,109,114,10668,10674,10678,10684,114,115,112,59,1,8202,102,59,1,189,105,108,116,59,1,8459,4,2,100,114,10690,10695,99,121,59,1,1098,4,3,59,99,119,10703,10705,10710,1,8596,105,114,59,1,10568,59,1,8621,97,114,59,1,8463,105,114,99,59,1,293,4,3,97,108,114,10732,10748,10754,114,116,115,4,2,59,117,10741,10743,1,9829,105,116,59,1,9829,108,105,112,59,1,8230,99,111,110,59,1,8889,114,59,3,55349,56613,115,4,2,101,119,10772,10779,97,114,111,119,59,1,10533,97,114,111,119,59,1,10534,4,5,97,109,111,112,114,10798,10803,10809,10839,10844,114,114,59,1,8703,116,104,116,59,1,8763,107,4,2,108,114,10816,10827,101,102,116,97,114,114,111,119,59,1,8617,105,103,104,116,97,114,114,111,119,59,1,8618,102,59,3,55349,56665,98,97,114,59,1,8213,4,3,99,108,116,10858,10863,10869,114,59,3,55349,56509,97,115,104,59,1,8463,114,111,107,59,1,295,4,2,98,112,10881,10887,117,108,108,59,1,8259,104,101,110,59,1,8208,4,15,97,99,101,102,103,105,106,109,110,111,112,113,115,116,117,10925,10936,10958,10977,10990,11001,11039,11045,11101,11192,11220,11226,11237,11285,11299,99,117,116,101,5,237,1,59,10934,1,237,4,3,59,105,121,10944,10946,10955,1,8291,114,99,5,238,1,59,10953,1,238,59,1,1080,4,2,99,120,10964,10968,121,59,1,1077,99,108,5,161,1,59,10975,1,161,4,2,102,114,10983,10986,59,1,8660,59,3,55349,56614,114,97,118,101,5,236,1,59,10999,1,236,4,4,59,105,110,111,11011,11013,11028,11034,1,8520,4,2,105,110,11019,11024,110,116,59,1,10764,116,59,1,8749,102,105,110,59,1,10716,116,97,59,1,8489,108,105,103,59,1,307,4,3,97,111,112,11053,11092,11096,4,3,99,103,116,11061,11065,11088,114,59,1,299,4,3,101,108,112,11073,11076,11082,59,1,8465,105,110,101,59,1,8464,97,114,116,59,1,8465,104,59,1,305,102,59,1,8887,101,100,59,1,437,4,5,59,99,102,111,116,11113,11115,11121,11136,11142,1,8712,97,114,101,59,1,8453,105,110,4,2,59,116,11129,11131,1,8734,105,101,59,1,10717,100,111,116,59,1,305,4,5,59,99,101,108,112,11154,11156,11161,11179,11186,1,8747,97,108,59,1,8890,4,2,103,114,11167,11173,101,114,115,59,1,8484,99,97,108,59,1,8890,97,114,104,107,59,1,10775,114,111,100,59,1,10812,4,4,99,103,112,116,11202,11206,11211,11216,121,59,1,1105,111,110,59,1,303,102,59,3,55349,56666,97,59,1,953,114,111,100,59,1,10812,117,101,115,116,5,191,1,59,11235,1,191,4,2,99,105,11243,11248,114,59,3,55349,56510,110,4,5,59,69,100,115,118,11261,11263,11266,11271,11282,1,8712,59,1,8953,111,116,59,1,8949,4,2,59,118,11277,11279,1,8948,59,1,8947,59,1,8712,4,2,59,105,11291,11293,1,8290,108,100,101,59,1,297,4,2,107,109,11305,11310,99,121,59,1,1110,108,5,239,1,59,11316,1,239,4,6,99,102,109,111,115,117,11332,11346,11351,11357,11363,11380,4,2,105,121,11338,11343,114,99,59,1,309,59,1,1081,114,59,3,55349,56615,97,116,104,59,1,567,112,102,59,3,55349,56667,4,2,99,101,11369,11374,114,59,3,55349,56511,114,99,121,59,1,1112,107,99,121,59,1,1108,4,8,97,99,102,103,104,106,111,115,11404,11418,11433,11438,11445,11450,11455,11461,112,112,97,4,2,59,118,11413,11415,1,954,59,1,1008,4,2,101,121,11424,11430,100,105,108,59,1,311,59,1,1082,114,59,3,55349,56616,114,101,101,110,59,1,312,99,121,59,1,1093,99,121,59,1,1116,112,102,59,3,55349,56668,99,114,59,3,55349,56512,4,23,65,66,69,72,97,98,99,100,101,102,103,104,106,108,109,110,111,112,114,115,116,117,118,11515,11538,11544,11555,11560,11721,11780,11818,11868,12136,12160,12171,12203,12208,12246,12275,12327,12509,12523,12569,12641,12732,12752,4,3,97,114,116,11523,11528,11532,114,114,59,1,8666,114,59,1,8656,97,105,108,59,1,10523,97,114,114,59,1,10510,4,2,59,103,11550,11552,1,8806,59,1,10891,97,114,59,1,10594,4,9,99,101,103,109,110,112,113,114,116,11580,11586,11594,11600,11606,11624,11627,11636,11694,117,116,101,59,1,314,109,112,116,121,118,59,1,10676,114,97,110,59,1,8466,98,100,97,59,1,955,103,4,3,59,100,108,11615,11617,11620,1,10216,59,1,10641,101,59,1,10216,59,1,10885,117,111,5,171,1,59,11634,1,171,114,4,8,59,98,102,104,108,112,115,116,11655,11657,11669,11673,11677,11681,11685,11690,1,8592,4,2,59,102,11663,11665,1,8676,115,59,1,10527,115,59,1,10525,107,59,1,8617,112,59,1,8619,108,59,1,10553,105,109,59,1,10611,108,59,1,8610,4,3,59,97,101,11702,11704,11709,1,10923,105,108,59,1,10521,4,2,59,115,11715,11717,1,10925,59,3,10925,65024,4,3,97,98,114,11729,11734,11739,114,114,59,1,10508,114,107,59,1,10098,4,2,97,107,11745,11758,99,4,2,101,107,11752,11755,59,1,123,59,1,91,4,2,101,115,11764,11767,59,1,10635,108,4,2,100,117,11774,11777,59,1,10639,59,1,10637,4,4,97,101,117,121,11790,11796,11811,11815,114,111,110,59,1,318,4,2,100,105,11802,11807,105,108,59,1,316,108,59,1,8968,98,59,1,123,59,1,1083,4,4,99,113,114,115,11828,11832,11845,11864,97,59,1,10550,117,111,4,2,59,114,11840,11842,1,8220,59,1,8222,4,2,100,117,11851,11857,104,97,114,59,1,10599,115,104,97,114,59,1,10571,104,59,1,8626,4,5,59,102,103,113,115,11880,11882,12008,12011,12031,1,8804,116,4,5,97,104,108,114,116,11895,11913,11935,11947,11996,114,114,111,119,4,2,59,116,11905,11907,1,8592,97,105,108,59,1,8610,97,114,112,111,111,110,4,2,100,117,11925,11931,111,119,110,59,1,8637,112,59,1,8636,101,102,116,97,114,114,111,119,115,59,1,8647,105,103,104,116,4,3,97,104,115,11959,11974,11984,114,114,111,119,4,2,59,115,11969,11971,1,8596,59,1,8646,97,114,112,111,111,110,115,59,1,8651,113,117,105,103,97,114,114,111,119,59,1,8621,104,114,101,101,116,105,109,101,115,59,1,8907,59,1,8922,4,3,59,113,115,12019,12021,12024,1,8804,59,1,8806,108,97,110,116,59,1,10877,4,5,59,99,100,103,115,12043,12045,12049,12070,12083,1,10877,99,59,1,10920,111,116,4,2,59,111,12057,12059,1,10879,4,2,59,114,12065,12067,1,10881,59,1,10883,4,2,59,101,12076,12079,3,8922,65024,115,59,1,10899,4,5,97,100,101,103,115,12095,12103,12108,12126,12131,112,112,114,111,120,59,1,10885,111,116,59,1,8918,113,4,2,103,113,12115,12120,116,114,59,1,8922,103,116,114,59,1,10891,116,114,59,1,8822,105,109,59,1,8818,4,3,105,108,114,12144,12150,12156,115,104,116,59,1,10620,111,111,114,59,1,8970,59,3,55349,56617,4,2,59,69,12166,12168,1,8822,59,1,10897,4,2,97,98,12177,12198,114,4,2,100,117,12184,12187,59,1,8637,4,2,59,108,12193,12195,1,8636,59,1,10602,108,107,59,1,9604,99,121,59,1,1113,4,5,59,97,99,104,116,12220,12222,12227,12235,12241,1,8810,114,114,59,1,8647,111,114,110,101,114,59,1,8990,97,114,100,59,1,10603,114,105,59,1,9722,4,2,105,111,12252,12258,100,111,116,59,1,320,117,115,116,4,2,59,97,12267,12269,1,9136,99,104,101,59,1,9136,4,4,69,97,101,115,12285,12288,12303,12322,59,1,8808,112,4,2,59,112,12295,12297,1,10889,114,111,120,59,1,10889,4,2,59,113,12309,12311,1,10887,4,2,59,113,12317,12319,1,10887,59,1,8808,105,109,59,1,8934,4,8,97,98,110,111,112,116,119,122,12345,12359,12364,12421,12446,12467,12474,12490,4,2,110,114,12351,12355,103,59,1,10220,114,59,1,8701,114,107,59,1,10214,103,4,3,108,109,114,12373,12401,12409,101,102,116,4,2,97,114,12382,12389,114,114,111,119,59,1,10229,105,103,104,116,97,114,114,111,119,59,1,10231,97,112,115,116,111,59,1,10236,105,103,104,116,97,114,114,111,119,59,1,10230,112,97,114,114,111,119,4,2,108,114,12433,12439,101,102,116,59,1,8619,105,103,104,116,59,1,8620,4,3,97,102,108,12454,12458,12462,114,59,1,10629,59,3,55349,56669,117,115,59,1,10797,105,109,101,115,59,1,10804,4,2,97,98,12480,12485,115,116,59,1,8727,97,114,59,1,95,4,3,59,101,102,12498,12500,12506,1,9674,110,103,101,59,1,9674,59,1,10731,97,114,4,2,59,108,12517,12519,1,40,116,59,1,10643,4,5,97,99,104,109,116,12535,12540,12548,12561,12564,114,114,59,1,8646,111,114,110,101,114,59,1,8991,97,114,4,2,59,100,12556,12558,1,8651,59,1,10605,59,1,8206,114,105,59,1,8895,4,6,97,99,104,105,113,116,12583,12589,12594,12597,12614,12635,113,117,111,59,1,8249,114,59,3,55349,56513,59,1,8624,109,4,3,59,101,103,12606,12608,12611,1,8818,59,1,10893,59,1,10895,4,2,98,117,12620,12623,59,1,91,111,4,2,59,114,12630,12632,1,8216,59,1,8218,114,111,107,59,1,322,5,60,8,59,99,100,104,105,108,113,114,12660,12662,12675,12680,12686,12692,12698,12705,1,60,4,2,99,105,12668,12671,59,1,10918,114,59,1,10873,111,116,59,1,8918,114,101,101,59,1,8907,109,101,115,59,1,8905,97,114,114,59,1,10614,117,101,115,116,59,1,10875,4,2,80,105,12711,12716,97,114,59,1,10646,4,3,59,101,102,12724,12726,12729,1,9667,59,1,8884,59,1,9666,114,4,2,100,117,12739,12746,115,104,97,114,59,1,10570,104,97,114,59,1,10598,4,2,101,110,12758,12768,114,116,110,101,113,113,59,3,8808,65024,69,59,3,8808,65024,4,14,68,97,99,100,101,102,104,105,108,110,111,112,115,117,12803,12809,12893,12908,12914,12928,12933,12937,13011,13025,13032,13049,13052,13069,68,111,116,59,1,8762,4,4,99,108,112,114,12819,12827,12849,12887,114,5,175,1,59,12825,1,175,4,2,101,116,12833,12836,59,1,9794,4,2,59,101,12842,12844,1,10016,115,101,59,1,10016,4,2,59,115,12855,12857,1,8614,116,111,4,4,59,100,108,117,12869,12871,12877,12883,1,8614,111,119,110,59,1,8615,101,102,116,59,1,8612,112,59,1,8613,107,101,114,59,1,9646,4,2,111,121,12899,12905,109,109,97,59,1,10793,59,1,1084,97,115,104,59,1,8212,97,115,117,114,101,100,97,110,103,108,101,59,1,8737,114,59,3,55349,56618,111,59,1,8487,4,3,99,100,110,12945,12954,12985,114,111,5,181,1,59,12952,1,181,4,4,59,97,99,100,12964,12966,12971,12976,1,8739,115,116,59,1,42,105,114,59,1,10992,111,116,5,183,1,59,12983,1,183,117,115,4,3,59,98,100,12995,12997,13e3,1,8722,59,1,8863,4,2,59,117,13006,13008,1,8760,59,1,10794,4,2,99,100,13017,13021,112,59,1,10971,114,59,1,8230,112,108,117,115,59,1,8723,4,2,100,112,13038,13044,101,108,115,59,1,8871,102,59,3,55349,56670,59,1,8723,4,2,99,116,13058,13063,114,59,3,55349,56514,112,111,115,59,1,8766,4,3,59,108,109,13077,13079,13087,1,956,116,105,109,97,112,59,1,8888,97,112,59,1,8888,4,24,71,76,82,86,97,98,99,100,101,102,103,104,105,106,108,109,111,112,114,115,116,117,118,119,13142,13165,13217,13229,13247,13330,13359,13414,13420,13508,13513,13579,13602,13626,13631,13762,13767,13855,13936,13995,14214,14285,14312,14432,4,2,103,116,13148,13152,59,3,8921,824,4,2,59,118,13158,13161,3,8811,8402,59,3,8811,824,4,3,101,108,116,13173,13200,13204,102,116,4,2,97,114,13181,13188,114,114,111,119,59,1,8653,105,103,104,116,97,114,114,111,119,59,1,8654,59,3,8920,824,4,2,59,118,13210,13213,3,8810,8402,59,3,8810,824,105,103,104,116,97,114,114,111,119,59,1,8655,4,2,68,100,13235,13241,97,115,104,59,1,8879,97,115,104,59,1,8878,4,5,98,99,110,112,116,13259,13264,13270,13275,13308,108,97,59,1,8711,117,116,101,59,1,324,103,59,3,8736,8402,4,5,59,69,105,111,112,13287,13289,13293,13298,13302,1,8777,59,3,10864,824,100,59,3,8779,824,115,59,1,329,114,111,120,59,1,8777,117,114,4,2,59,97,13316,13318,1,9838,108,4,2,59,115,13325,13327,1,9838,59,1,8469,4,2,115,117,13336,13344,112,5,160,1,59,13342,1,160,109,112,4,2,59,101,13352,13355,3,8782,824,59,3,8783,824,4,5,97,101,111,117,121,13371,13385,13391,13407,13411,4,2,112,114,13377,13380,59,1,10819,111,110,59,1,328,100,105,108,59,1,326,110,103,4,2,59,100,13399,13401,1,8775,111,116,59,3,10861,824,112,59,1,10818,59,1,1085,97,115,104,59,1,8211,4,7,59,65,97,100,113,115,120,13436,13438,13443,13466,13472,13478,13494,1,8800,114,114,59,1,8663,114,4,2,104,114,13450,13454,107,59,1,10532,4,2,59,111,13460,13462,1,8599,119,59,1,8599,111,116,59,3,8784,824,117,105,118,59,1,8802,4,2,101,105,13484,13489,97,114,59,1,10536,109,59,3,8770,824,105,115,116,4,2,59,115,13503,13505,1,8708,59,1,8708,114,59,3,55349,56619,4,4,69,101,115,116,13523,13527,13563,13568,59,3,8807,824,4,3,59,113,115,13535,13537,13559,1,8817,4,3,59,113,115,13545,13547,13551,1,8817,59,3,8807,824,108,97,110,116,59,3,10878,824,59,3,10878,824,105,109,59,1,8821,4,2,59,114,13574,13576,1,8815,59,1,8815,4,3,65,97,112,13587,13592,13597,114,114,59,1,8654,114,114,59,1,8622,97,114,59,1,10994,4,3,59,115,118,13610,13612,13623,1,8715,4,2,59,100,13618,13620,1,8956,59,1,8954,59,1,8715,99,121,59,1,1114,4,7,65,69,97,100,101,115,116,13647,13652,13656,13661,13665,13737,13742,114,114,59,1,8653,59,3,8806,824,114,114,59,1,8602,114,59,1,8229,4,4,59,102,113,115,13675,13677,13703,13725,1,8816,116,4,2,97,114,13684,13691,114,114,111,119,59,1,8602,105,103,104,116,97,114,114,111,119,59,1,8622,4,3,59,113,115,13711,13713,13717,1,8816,59,3,8806,824,108,97,110,116,59,3,10877,824,4,2,59,115,13731,13734,3,10877,824,59,1,8814,105,109,59,1,8820,4,2,59,114,13748,13750,1,8814,105,4,2,59,101,13757,13759,1,8938,59,1,8940,105,100,59,1,8740,4,2,112,116,13773,13778,102,59,3,55349,56671,5,172,3,59,105,110,13787,13789,13829,1,172,110,4,4,59,69,100,118,13800,13802,13806,13812,1,8713,59,3,8953,824,111,116,59,3,8949,824,4,3,97,98,99,13820,13823,13826,59,1,8713,59,1,8951,59,1,8950,105,4,2,59,118,13836,13838,1,8716,4,3,97,98,99,13846,13849,13852,59,1,8716,59,1,8958,59,1,8957,4,3,97,111,114,13863,13892,13899,114,4,4,59,97,115,116,13874,13876,13883,13888,1,8742,108,108,101,108,59,1,8742,108,59,3,11005,8421,59,3,8706,824,108,105,110,116,59,1,10772,4,3,59,99,101,13907,13909,13914,1,8832,117,101,59,1,8928,4,2,59,99,13920,13923,3,10927,824,4,2,59,101,13929,13931,1,8832,113,59,3,10927,824,4,4,65,97,105,116,13946,13951,13971,13982,114,114,59,1,8655,114,114,4,3,59,99,119,13961,13963,13967,1,8603,59,3,10547,824,59,3,8605,824,103,104,116,97,114,114,111,119,59,1,8603,114,105,4,2,59,101,13990,13992,1,8939,59,1,8941,4,7,99,104,105,109,112,113,117,14011,14036,14060,14080,14085,14090,14106,4,4,59,99,101,114,14021,14023,14028,14032,1,8833,117,101,59,1,8929,59,3,10928,824,59,3,55349,56515,111,114,116,4,2,109,112,14045,14050,105,100,59,1,8740,97,114,97,108,108,101,108,59,1,8742,109,4,2,59,101,14067,14069,1,8769,4,2,59,113,14075,14077,1,8772,59,1,8772,105,100,59,1,8740,97,114,59,1,8742,115,117,4,2,98,112,14098,14102,101,59,1,8930,101,59,1,8931,4,3,98,99,112,14114,14157,14171,4,4,59,69,101,115,14124,14126,14130,14133,1,8836,59,3,10949,824,59,1,8840,101,116,4,2,59,101,14141,14144,3,8834,8402,113,4,2,59,113,14151,14153,1,8840,59,3,10949,824,99,4,2,59,101,14164,14166,1,8833,113,59,3,10928,824,4,4,59,69,101,115,14181,14183,14187,14190,1,8837,59,3,10950,824,59,1,8841,101,116,4,2,59,101,14198,14201,3,8835,8402,113,4,2,59,113,14208,14210,1,8841,59,3,10950,824,4,4,103,105,108,114,14224,14228,14238,14242,108,59,1,8825,108,100,101,5,241,1,59,14236,1,241,103,59,1,8824,105,97,110,103,108,101,4,2,108,114,14254,14269,101,102,116,4,2,59,101,14263,14265,1,8938,113,59,1,8940,105,103,104,116,4,2,59,101,14279,14281,1,8939,113,59,1,8941,4,2,59,109,14291,14293,1,957,4,3,59,101,115,14301,14303,14308,1,35,114,111,59,1,8470,112,59,1,8199,4,9,68,72,97,100,103,105,108,114,115,14332,14338,14344,14349,14355,14369,14376,14408,14426,97,115,104,59,1,8877,97,114,114,59,1,10500,112,59,3,8781,8402,97,115,104,59,1,8876,4,2,101,116,14361,14365,59,3,8805,8402,59,3,62,8402,110,102,105,110,59,1,10718,4,3,65,101,116,14384,14389,14393,114,114,59,1,10498,59,3,8804,8402,4,2,59,114,14399,14402,3,60,8402,105,101,59,3,8884,8402,4,2,65,116,14414,14419,114,114,59,1,10499,114,105,101,59,3,8885,8402,105,109,59,3,8764,8402,4,3,65,97,110,14440,14445,14468,114,114,59,1,8662,114,4,2,104,114,14452,14456,107,59,1,10531,4,2,59,111,14462,14464,1,8598,119,59,1,8598,101,97,114,59,1,10535,4,18,83,97,99,100,101,102,103,104,105,108,109,111,112,114,115,116,117,118,14512,14515,14535,14560,14597,14603,14618,14643,14657,14662,14701,14741,14747,14769,14851,14877,14907,14916,59,1,9416,4,2,99,115,14521,14531,117,116,101,5,243,1,59,14529,1,243,116,59,1,8859,4,2,105,121,14541,14557,114,4,2,59,99,14548,14550,1,8858,5,244,1,59,14555,1,244,59,1,1086,4,5,97,98,105,111,115,14572,14577,14583,14587,14591,115,104,59,1,8861,108,97,99,59,1,337,118,59,1,10808,116,59,1,8857,111,108,100,59,1,10684,108,105,103,59,1,339,4,2,99,114,14609,14614,105,114,59,1,10687,59,3,55349,56620,4,3,111,114,116,14626,14630,14640,110,59,1,731,97,118,101,5,242,1,59,14638,1,242,59,1,10689,4,2,98,109,14649,14654,97,114,59,1,10677,59,1,937,110,116,59,1,8750,4,4,97,99,105,116,14672,14677,14693,14698,114,114,59,1,8634,4,2,105,114,14683,14687,114,59,1,10686,111,115,115,59,1,10683,110,101,59,1,8254,59,1,10688,4,3,97,101,105,14709,14714,14719,99,114,59,1,333,103,97,59,1,969,4,3,99,100,110,14727,14733,14736,114,111,110,59,1,959,59,1,10678,117,115,59,1,8854,112,102,59,3,55349,56672,4,3,97,101,108,14755,14759,14764,114,59,1,10679,114,112,59,1,10681,117,115,59,1,8853,4,7,59,97,100,105,111,115,118,14785,14787,14792,14831,14837,14841,14848,1,8744,114,114,59,1,8635,4,4,59,101,102,109,14802,14804,14817,14824,1,10845,114,4,2,59,111,14811,14813,1,8500,102,59,1,8500,5,170,1,59,14822,1,170,5,186,1,59,14829,1,186,103,111,102,59,1,8886,114,59,1,10838,108,111,112,101,59,1,10839,59,1,10843,4,3,99,108,111,14859,14863,14873,114,59,1,8500,97,115,104,5,248,1,59,14871,1,248,108,59,1,8856,105,4,2,108,109,14884,14893,100,101,5,245,1,59,14891,1,245,101,115,4,2,59,97,14901,14903,1,8855,115,59,1,10806,109,108,5,246,1,59,14914,1,246,98,97,114,59,1,9021,4,12,97,99,101,102,104,105,108,109,111,114,115,117,14948,14992,14996,15033,15038,15068,15090,15189,15192,15222,15427,15441,114,4,4,59,97,115,116,14959,14961,14976,14989,1,8741,5,182,2,59,108,14968,14970,1,182,108,101,108,59,1,8741,4,2,105,108,14982,14986,109,59,1,10995,59,1,11005,59,1,8706,121,59,1,1087,114,4,5,99,105,109,112,116,15009,15014,15019,15024,15027,110,116,59,1,37,111,100,59,1,46,105,108,59,1,8240,59,1,8869,101,110,107,59,1,8241,114,59,3,55349,56621,4,3,105,109,111,15046,15057,15063,4,2,59,118,15052,15054,1,966,59,1,981,109,97,116,59,1,8499,110,101,59,1,9742,4,3,59,116,118,15076,15078,15087,1,960,99,104,102,111,114,107,59,1,8916,59,1,982,4,2,97,117,15096,15119,110,4,2,99,107,15103,15115,107,4,2,59,104,15110,15112,1,8463,59,1,8462,118,59,1,8463,115,4,9,59,97,98,99,100,101,109,115,116,15140,15142,15148,15151,15156,15168,15171,15179,15184,1,43,99,105,114,59,1,10787,59,1,8862,105,114,59,1,10786,4,2,111,117,15162,15165,59,1,8724,59,1,10789,59,1,10866,110,5,177,1,59,15177,1,177,105,109,59,1,10790,119,111,59,1,10791,59,1,177,4,3,105,112,117,15200,15208,15213,110,116,105,110,116,59,1,10773,102,59,3,55349,56673,110,100,5,163,1,59,15220,1,163,4,10,59,69,97,99,101,105,110,111,115,117,15244,15246,15249,15253,15258,15334,15347,15367,15416,15421,1,8826,59,1,10931,112,59,1,10935,117,101,59,1,8828,4,2,59,99,15264,15266,1,10927,4,6,59,97,99,101,110,115,15280,15282,15290,15299,15303,15329,1,8826,112,112,114,111,120,59,1,10935,117,114,108,121,101,113,59,1,8828,113,59,1,10927,4,3,97,101,115,15311,15319,15324,112,112,114,111,120,59,1,10937,113,113,59,1,10933,105,109,59,1,8936,105,109,59,1,8830,109,101,4,2,59,115,15342,15344,1,8242,59,1,8473,4,3,69,97,115,15355,15358,15362,59,1,10933,112,59,1,10937,105,109,59,1,8936,4,3,100,102,112,15375,15378,15404,59,1,8719,4,3,97,108,115,15386,15392,15398,108,97,114,59,1,9006,105,110,101,59,1,8978,117,114,102,59,1,8979,4,2,59,116,15410,15412,1,8733,111,59,1,8733,105,109,59,1,8830,114,101,108,59,1,8880,4,2,99,105,15433,15438,114,59,3,55349,56517,59,1,968,110,99,115,112,59,1,8200,4,6,102,105,111,112,115,117,15462,15467,15472,15478,15485,15491,114,59,3,55349,56622,110,116,59,1,10764,112,102,59,3,55349,56674,114,105,109,101,59,1,8279,99,114,59,3,55349,56518,4,3,97,101,111,15499,15520,15534,116,4,2,101,105,15506,15515,114,110,105,111,110,115,59,1,8461,110,116,59,1,10774,115,116,4,2,59,101,15528,15530,1,63,113,59,1,8799,116,5,34,1,59,15540,1,34,4,21,65,66,72,97,98,99,100,101,102,104,105,108,109,110,111,112,114,115,116,117,120,15586,15609,15615,15620,15796,15855,15893,15931,15977,16001,16039,16183,16204,16222,16228,16285,16312,16318,16363,16408,16416,4,3,97,114,116,15594,15599,15603,114,114,59,1,8667,114,59,1,8658,97,105,108,59,1,10524,97,114,114,59,1,10511,97,114,59,1,10596,4,7,99,100,101,110,113,114,116,15636,15651,15656,15664,15687,15696,15770,4,2,101,117,15642,15646,59,3,8765,817,116,101,59,1,341,105,99,59,1,8730,109,112,116,121,118,59,1,10675,103,4,4,59,100,101,108,15675,15677,15680,15683,1,10217,59,1,10642,59,1,10661,101,59,1,10217,117,111,5,187,1,59,15694,1,187,114,4,11,59,97,98,99,102,104,108,112,115,116,119,15721,15723,15727,15739,15742,15746,15750,15754,15758,15763,15767,1,8594,112,59,1,10613,4,2,59,102,15733,15735,1,8677,115,59,1,10528,59,1,10547,115,59,1,10526,107,59,1,8618,112,59,1,8620,108,59,1,10565,105,109,59,1,10612,108,59,1,8611,59,1,8605,4,2,97,105,15776,15781,105,108,59,1,10522,111,4,2,59,110,15788,15790,1,8758,97,108,115,59,1,8474,4,3,97,98,114,15804,15809,15814,114,114,59,1,10509,114,107,59,1,10099,4,2,97,107,15820,15833,99,4,2,101,107,15827,15830,59,1,125,59,1,93,4,2,101,115,15839,15842,59,1,10636,108,4,2,100,117,15849,15852,59,1,10638,59,1,10640,4,4,97,101,117,121,15865,15871,15886,15890,114,111,110,59,1,345,4,2,100,105,15877,15882,105,108,59,1,343,108,59,1,8969,98,59,1,125,59,1,1088,4,4,99,108,113,115,15903,15907,15914,15927,97,59,1,10551,100,104,97,114,59,1,10601,117,111,4,2,59,114,15922,15924,1,8221,59,1,8221,104,59,1,8627,4,3,97,99,103,15939,15966,15970,108,4,4,59,105,112,115,15950,15952,15957,15963,1,8476,110,101,59,1,8475,97,114,116,59,1,8476,59,1,8477,116,59,1,9645,5,174,1,59,15975,1,174,4,3,105,108,114,15985,15991,15997,115,104,116,59,1,10621,111,111,114,59,1,8971,59,3,55349,56623,4,2,97,111,16007,16028,114,4,2,100,117,16014,16017,59,1,8641,4,2,59,108,16023,16025,1,8640,59,1,10604,4,2,59,118,16034,16036,1,961,59,1,1009,4,3,103,110,115,16047,16167,16171,104,116,4,6,97,104,108,114,115,116,16063,16081,16103,16130,16143,16155,114,114,111,119,4,2,59,116,16073,16075,1,8594,97,105,108,59,1,8611,97,114,112,111,111,110,4,2,100,117,16093,16099,111,119,110,59,1,8641,112,59,1,8640,101,102,116,4,2,97,104,16112,16120,114,114,111,119,115,59,1,8644,97,114,112,111,111,110,115,59,1,8652,105,103,104,116,97,114,114,111,119,115,59,1,8649,113,117,105,103,97,114,114,111,119,59,1,8605,104,114,101,101,116,105,109,101,115,59,1,8908,103,59,1,730,105,110,103,100,111,116,115,101,113,59,1,8787,4,3,97,104,109,16191,16196,16201,114,114,59,1,8644,97,114,59,1,8652,59,1,8207,111,117,115,116,4,2,59,97,16214,16216,1,9137,99,104,101,59,1,9137,109,105,100,59,1,10990,4,4,97,98,112,116,16238,16252,16257,16278,4,2,110,114,16244,16248,103,59,1,10221,114,59,1,8702,114,107,59,1,10215,4,3,97,102,108,16265,16269,16273,114,59,1,10630,59,3,55349,56675,117,115,59,1,10798,105,109,101,115,59,1,10805,4,2,97,112,16291,16304,114,4,2,59,103,16298,16300,1,41,116,59,1,10644,111,108,105,110,116,59,1,10770,97,114,114,59,1,8649,4,4,97,99,104,113,16328,16334,16339,16342,113,117,111,59,1,8250,114,59,3,55349,56519,59,1,8625,4,2,98,117,16348,16351,59,1,93,111,4,2,59,114,16358,16360,1,8217,59,1,8217,4,3,104,105,114,16371,16377,16383,114,101,101,59,1,8908,109,101,115,59,1,8906,105,4,4,59,101,102,108,16394,16396,16399,16402,1,9657,59,1,8885,59,1,9656,116,114,105,59,1,10702,108,117,104,97,114,59,1,10600,59,1,8478,4,19,97,98,99,100,101,102,104,105,108,109,111,112,113,114,115,116,117,119,122,16459,16466,16472,16572,16590,16672,16687,16746,16844,16850,16924,16963,16988,17115,17121,17154,17206,17614,17656,99,117,116,101,59,1,347,113,117,111,59,1,8218,4,10,59,69,97,99,101,105,110,112,115,121,16494,16496,16499,16513,16518,16531,16536,16556,16564,16569,1,8827,59,1,10932,4,2,112,114,16505,16508,59,1,10936,111,110,59,1,353,117,101,59,1,8829,4,2,59,100,16524,16526,1,10928,105,108,59,1,351,114,99,59,1,349,4,3,69,97,115,16544,16547,16551,59,1,10934,112,59,1,10938,105,109,59,1,8937,111,108,105,110,116,59,1,10771,105,109,59,1,8831,59,1,1089,111,116,4,3,59,98,101,16582,16584,16587,1,8901,59,1,8865,59,1,10854,4,7,65,97,99,109,115,116,120,16606,16611,16634,16642,16646,16652,16668,114,114,59,1,8664,114,4,2,104,114,16618,16622,107,59,1,10533,4,2,59,111,16628,16630,1,8600,119,59,1,8600,116,5,167,1,59,16640,1,167,105,59,1,59,119,97,114,59,1,10537,109,4,2,105,110,16659,16665,110,117,115,59,1,8726,59,1,8726,116,59,1,10038,114,4,2,59,111,16679,16682,3,55349,56624,119,110,59,1,8994,4,4,97,99,111,121,16697,16702,16716,16739,114,112,59,1,9839,4,2,104,121,16708,16713,99,121,59,1,1097,59,1,1096,114,116,4,2,109,112,16724,16729,105,100,59,1,8739,97,114,97,108,108,101,108,59,1,8741,5,173,1,59,16744,1,173,4,2,103,109,16752,16770,109,97,4,3,59,102,118,16762,16764,16767,1,963,59,1,962,59,1,962,4,8,59,100,101,103,108,110,112,114,16788,16790,16795,16806,16817,16828,16832,16838,1,8764,111,116,59,1,10858,4,2,59,113,16801,16803,1,8771,59,1,8771,4,2,59,69,16812,16814,1,10910,59,1,10912,4,2,59,69,16823,16825,1,10909,59,1,10911,101,59,1,8774,108,117,115,59,1,10788,97,114,114,59,1,10610,97,114,114,59,1,8592,4,4,97,101,105,116,16860,16883,16891,16904,4,2,108,115,16866,16878,108,115,101,116,109,105,110,117,115,59,1,8726,104,112,59,1,10803,112,97,114,115,108,59,1,10724,4,2,100,108,16897,16900,59,1,8739,101,59,1,8995,4,2,59,101,16910,16912,1,10922,4,2,59,115,16918,16920,1,10924,59,3,10924,65024,4,3,102,108,112,16932,16938,16958,116,99,121,59,1,1100,4,2,59,98,16944,16946,1,47,4,2,59,97,16952,16954,1,10692,114,59,1,9023,102,59,3,55349,56676,97,4,2,100,114,16970,16985,101,115,4,2,59,117,16978,16980,1,9824,105,116,59,1,9824,59,1,8741,4,3,99,115,117,16996,17028,17089,4,2,97,117,17002,17015,112,4,2,59,115,17009,17011,1,8851,59,3,8851,65024,112,4,2,59,115,17022,17024,1,8852,59,3,8852,65024,117,4,2,98,112,17035,17062,4,3,59,101,115,17043,17045,17048,1,8847,59,1,8849,101,116,4,2,59,101,17056,17058,1,8847,113,59,1,8849,4,3,59,101,115,17070,17072,17075,1,8848,59,1,8850,101,116,4,2,59,101,17083,17085,1,8848,113,59,1,8850,4,3,59,97,102,17097,17099,17112,1,9633,114,4,2,101,102,17106,17109,59,1,9633,59,1,9642,59,1,9642,97,114,114,59,1,8594,4,4,99,101,109,116,17131,17136,17142,17148,114,59,3,55349,56520,116,109,110,59,1,8726,105,108,101,59,1,8995,97,114,102,59,1,8902,4,2,97,114,17160,17172,114,4,2,59,102,17167,17169,1,9734,59,1,9733,4,2,97,110,17178,17202,105,103,104,116,4,2,101,112,17188,17197,112,115,105,108,111,110,59,1,1013,104,105,59,1,981,115,59,1,175,4,5,98,99,109,110,112,17218,17351,17420,17423,17427,4,9,59,69,100,101,109,110,112,114,115,17238,17240,17243,17248,17261,17267,17279,17285,17291,1,8834,59,1,10949,111,116,59,1,10941,4,2,59,100,17254,17256,1,8838,111,116,59,1,10947,117,108,116,59,1,10945,4,2,69,101,17273,17276,59,1,10955,59,1,8842,108,117,115,59,1,10943,97,114,114,59,1,10617,4,3,101,105,117,17299,17335,17339,116,4,3,59,101,110,17308,17310,17322,1,8834,113,4,2,59,113,17317,17319,1,8838,59,1,10949,101,113,4,2,59,113,17330,17332,1,8842,59,1,10955,109,59,1,10951,4,2,98,112,17345,17348,59,1,10965,59,1,10963,99,4,6,59,97,99,101,110,115,17366,17368,17376,17385,17389,17415,1,8827,112,112,114,111,120,59,1,10936,117,114,108,121,101,113,59,1,8829,113,59,1,10928,4,3,97,101,115,17397,17405,17410,112,112,114,111,120,59,1,10938,113,113,59,1,10934,105,109,59,1,8937,105,109,59,1,8831,59,1,8721,103,59,1,9834,4,13,49,50,51,59,69,100,101,104,108,109,110,112,115,17455,17462,17469,17476,17478,17481,17496,17509,17524,17530,17536,17548,17554,5,185,1,59,17460,1,185,5,178,1,59,17467,1,178,5,179,1,59,17474,1,179,1,8835,59,1,10950,4,2,111,115,17487,17491,116,59,1,10942,117,98,59,1,10968,4,2,59,100,17502,17504,1,8839,111,116,59,1,10948,115,4,2,111,117,17516,17520,108,59,1,10185,98,59,1,10967,97,114,114,59,1,10619,117,108,116,59,1,10946,4,2,69,101,17542,17545,59,1,10956,59,1,8843,108,117,115,59,1,10944,4,3,101,105,117,17562,17598,17602,116,4,3,59,101,110,17571,17573,17585,1,8835,113,4,2,59,113,17580,17582,1,8839,59,1,10950,101,113,4,2,59,113,17593,17595,1,8843,59,1,10956,109,59,1,10952,4,2,98,112,17608,17611,59,1,10964,59,1,10966,4,3,65,97,110,17622,17627,17650,114,114,59,1,8665,114,4,2,104,114,17634,17638,107,59,1,10534,4,2,59,111,17644,17646,1,8601,119,59,1,8601,119,97,114,59,1,10538,108,105,103,5,223,1,59,17664,1,223,4,13,97,98,99,100,101,102,104,105,111,112,114,115,119,17694,17709,17714,17737,17742,17749,17754,17860,17905,17957,17964,18090,18122,4,2,114,117,17700,17706,103,101,116,59,1,8982,59,1,964,114,107,59,1,9140,4,3,97,101,121,17722,17728,17734,114,111,110,59,1,357,100,105,108,59,1,355,59,1,1090,111,116,59,1,8411,108,114,101,99,59,1,8981,114,59,3,55349,56625,4,4,101,105,107,111,17764,17805,17836,17851,4,2,114,116,17770,17786,101,4,2,52,102,17777,17780,59,1,8756,111,114,101,59,1,8756,97,4,3,59,115,118,17795,17797,17802,1,952,121,109,59,1,977,59,1,977,4,2,99,110,17811,17831,107,4,2,97,115,17818,17826,112,112,114,111,120,59,1,8776,105,109,59,1,8764,115,112,59,1,8201,4,2,97,115,17842,17846,112,59,1,8776,105,109,59,1,8764,114,110,5,254,1,59,17858,1,254,4,3,108,109,110,17868,17873,17901,100,101,59,1,732,101,115,5,215,3,59,98,100,17884,17886,17898,1,215,4,2,59,97,17892,17894,1,8864,114,59,1,10801,59,1,10800,116,59,1,8749,4,3,101,112,115,17913,17917,17953,97,59,1,10536,4,4,59,98,99,102,17927,17929,17934,17939,1,8868,111,116,59,1,9014,105,114,59,1,10993,4,2,59,111,17945,17948,3,55349,56677,114,107,59,1,10970,97,59,1,10537,114,105,109,101,59,1,8244,4,3,97,105,112,17972,17977,18082,100,101,59,1,8482,4,7,97,100,101,109,112,115,116,17993,18051,18056,18059,18066,18072,18076,110,103,108,101,4,5,59,100,108,113,114,18009,18011,18017,18032,18035,1,9653,111,119,110,59,1,9663,101,102,116,4,2,59,101,18026,18028,1,9667,113,59,1,8884,59,1,8796,105,103,104,116,4,2,59,101,18045,18047,1,9657,113,59,1,8885,111,116,59,1,9708,59,1,8796,105,110,117,115,59,1,10810,108,117,115,59,1,10809,98,59,1,10701,105,109,101,59,1,10811,101,122,105,117,109,59,1,9186,4,3,99,104,116,18098,18111,18116,4,2,114,121,18104,18108,59,3,55349,56521,59,1,1094,99,121,59,1,1115,114,111,107,59,1,359,4,2,105,111,18128,18133,120,116,59,1,8812,104,101,97,100,4,2,108,114,18143,18154,101,102,116,97,114,114,111,119,59,1,8606,105,103,104,116,97,114,114,111,119,59,1,8608,4,18,65,72,97,98,99,100,102,103,104,108,109,111,112,114,115,116,117,119,18204,18209,18214,18234,18250,18268,18292,18308,18319,18343,18379,18397,18413,18504,18547,18553,18584,18603,114,114,59,1,8657,97,114,59,1,10595,4,2,99,114,18220,18230,117,116,101,5,250,1,59,18228,1,250,114,59,1,8593,114,4,2,99,101,18241,18245,121,59,1,1118,118,101,59,1,365,4,2,105,121,18256,18265,114,99,5,251,1,59,18263,1,251,59,1,1091,4,3,97,98,104,18276,18281,18287,114,114,59,1,8645,108,97,99,59,1,369,97,114,59,1,10606,4,2,105,114,18298,18304,115,104,116,59,1,10622,59,3,55349,56626,114,97,118,101,5,249,1,59,18317,1,249,4,2,97,98,18325,18338,114,4,2,108,114,18332,18335,59,1,8639,59,1,8638,108,107,59,1,9600,4,2,99,116,18349,18374,4,2,111,114,18355,18369,114,110,4,2,59,101,18363,18365,1,8988,114,59,1,8988,111,112,59,1,8975,114,105,59,1,9720,4,2,97,108,18385,18390,99,114,59,1,363,5,168,1,59,18395,1,168,4,2,103,112,18403,18408,111,110,59,1,371,102,59,3,55349,56678,4,6,97,100,104,108,115,117,18427,18434,18445,18470,18475,18494,114,114,111,119,59,1,8593,111,119,110,97,114,114,111,119,59,1,8597,97,114,112,111,111,110,4,2,108,114,18457,18463,101,102,116,59,1,8639,105,103,104,116,59,1,8638,117,115,59,1,8846,105,4,3,59,104,108,18484,18486,18489,1,965,59,1,978,111,110,59,1,965,112,97,114,114,111,119,115,59,1,8648,4,3,99,105,116,18512,18537,18542,4,2,111,114,18518,18532,114,110,4,2,59,101,18526,18528,1,8989,114,59,1,8989,111,112,59,1,8974,110,103,59,1,367,114,105,59,1,9721,99,114,59,3,55349,56522,4,3,100,105,114,18561,18566,18572,111,116,59,1,8944,108,100,101,59,1,361,105,4,2,59,102,18579,18581,1,9653,59,1,9652,4,2,97,109,18590,18595,114,114,59,1,8648,108,5,252,1,59,18601,1,252,97,110,103,108,101,59,1,10663,4,15,65,66,68,97,99,100,101,102,108,110,111,112,114,115,122,18643,18648,18661,18667,18847,18851,18857,18904,18909,18915,18931,18937,18943,18949,18996,114,114,59,1,8661,97,114,4,2,59,118,18656,18658,1,10984,59,1,10985,97,115,104,59,1,8872,4,2,110,114,18673,18679,103,114,116,59,1,10652,4,7,101,107,110,112,114,115,116,18695,18704,18711,18720,18742,18754,18810,112,115,105,108,111,110,59,1,1013,97,112,112,97,59,1,1008,111,116,104,105,110,103,59,1,8709,4,3,104,105,114,18728,18732,18735,105,59,1,981,59,1,982,111,112,116,111,59,1,8733,4,2,59,104,18748,18750,1,8597,111,59,1,1009,4,2,105,117,18760,18766,103,109,97,59,1,962,4,2,98,112,18772,18791,115,101,116,110,101,113,4,2,59,113,18784,18787,3,8842,65024,59,3,10955,65024,115,101,116,110,101,113,4,2,59,113,18803,18806,3,8843,65024,59,3,10956,65024,4,2,104,114,18816,18822,101,116,97,59,1,977,105,97,110,103,108,101,4,2,108,114,18834,18840,101,102,116,59,1,8882,105,103,104,116,59,1,8883,121,59,1,1074,97,115,104,59,1,8866,4,3,101,108,114,18865,18884,18890,4,3,59,98,101,18873,18875,18880,1,8744,97,114,59,1,8891,113,59,1,8794,108,105,112,59,1,8942,4,2,98,116,18896,18901,97,114,59,1,124,59,1,124,114,59,3,55349,56627,116,114,105,59,1,8882,115,117,4,2,98,112,18923,18927,59,3,8834,8402,59,3,8835,8402,112,102,59,3,55349,56679,114,111,112,59,1,8733,116,114,105,59,1,8883,4,2,99,117,18955,18960,114,59,3,55349,56523,4,2,98,112,18966,18981,110,4,2,69,101,18973,18977,59,3,10955,65024,59,3,8842,65024,110,4,2,69,101,18988,18992,59,3,10956,65024,59,3,8843,65024,105,103,122,97,103,59,1,10650,4,7,99,101,102,111,112,114,115,19020,19026,19061,19066,19072,19075,19089,105,114,99,59,1,373,4,2,100,105,19032,19055,4,2,98,103,19038,19043,97,114,59,1,10847,101,4,2,59,113,19050,19052,1,8743,59,1,8793,101,114,112,59,1,8472,114,59,3,55349,56628,112,102,59,3,55349,56680,59,1,8472,4,2,59,101,19081,19083,1,8768,97,116,104,59,1,8768,99,114,59,3,55349,56524,4,14,99,100,102,104,105,108,109,110,111,114,115,117,118,119,19125,19146,19152,19157,19173,19176,19192,19197,19202,19236,19252,19269,19286,19291,4,3,97,105,117,19133,19137,19142,112,59,1,8898,114,99,59,1,9711,112,59,1,8899,116,114,105,59,1,9661,114,59,3,55349,56629,4,2,65,97,19163,19168,114,114,59,1,10234,114,114,59,1,10231,59,1,958,4,2,65,97,19182,19187,114,114,59,1,10232,114,114,59,1,10229,97,112,59,1,10236,105,115,59,1,8955,4,3,100,112,116,19210,19215,19230,111,116,59,1,10752,4,2,102,108,19221,19225,59,3,55349,56681,117,115,59,1,10753,105,109,101,59,1,10754,4,2,65,97,19242,19247,114,114,59,1,10233,114,114,59,1,10230,4,2,99,113,19258,19263,114,59,3,55349,56525,99,117,112,59,1,10758,4,2,112,116,19275,19281,108,117,115,59,1,10756,114,105,59,1,9651,101,101,59,1,8897,101,100,103,101,59,1,8896,4,8,97,99,101,102,105,111,115,117,19316,19335,19349,19357,19362,19367,19373,19379,99,4,2,117,121,19323,19332,116,101,5,253,1,59,19330,1,253,59,1,1103,4,2,105,121,19341,19346,114,99,59,1,375,59,1,1099,110,5,165,1,59,19355,1,165,114,59,3,55349,56630,99,121,59,1,1111,112,102,59,3,55349,56682,99,114,59,3,55349,56526,4,2,99,109,19385,19389,121,59,1,1102,108,5,255,1,59,19395,1,255,4,10,97,99,100,101,102,104,105,111,115,119,19419,19426,19441,19446,19462,19467,19472,19480,19486,19492,99,117,116,101,59,1,378,4,2,97,121,19432,19438,114,111,110,59,1,382,59,1,1079,111,116,59,1,380,4,2,101,116,19452,19458,116,114,102,59,1,8488,97,59,1,950,114,59,3,55349,56631,99,121,59,1,1078,103,114,97,114,114,59,1,8669,112,102,59,3,55349,56683,99,114,59,3,55349,56527,4,2,106,110,19498,19501,59,1,8205,106,59,1,8204]);const P=s,H={DASH_DASH_STRING:[45,45],DOCTYPE_STRING:[68,79,67,84,89,80,69],CDATA_START_STRING:[91,67,68,65,84,65,91],SCRIPT_STRING:[115,99,114,105,112,116],PUBLIC_STRING:[80,85,66,76,73,67],SYSTEM_STRING:[83,89,83,84,69,77]},D={128:8364,130:8218,131:402,132:8222,133:8230,134:8224,135:8225,136:710,137:8240,138:352,139:8249,140:338,142:381,145:8216,146:8217,147:8220,148:8221,149:8226,150:8211,151:8212,152:732,153:8482,154:353,155:8250,156:339,158:382,159:376},F="DATA_STATE",U="RCDATA_STATE",G="RAWTEXT_STATE",B="SCRIPT_DATA_STATE",K="PLAINTEXT_STATE",b="TAG_OPEN_STATE",x="END_TAG_OPEN_STATE",y="TAG_NAME_STATE",v="RCDATA_LESS_THAN_SIGN_STATE",Y="RCDATA_END_TAG_OPEN_STATE",w="RCDATA_END_TAG_NAME_STATE",Q="RAWTEXT_LESS_THAN_SIGN_STATE",X="RAWTEXT_END_TAG_OPEN_STATE",W="RAWTEXT_END_TAG_NAME_STATE",V="SCRIPT_DATA_LESS_THAN_SIGN_STATE",j="SCRIPT_DATA_END_TAG_OPEN_STATE",z="SCRIPT_DATA_END_TAG_NAME_STATE",q="SCRIPT_DATA_ESCAPE_START_STATE",J="SCRIPT_DATA_ESCAPE_START_DASH_STATE",Z="SCRIPT_DATA_ESCAPED_STATE",$="SCRIPT_DATA_ESCAPED_DASH_STATE",ee="SCRIPT_DATA_ESCAPED_DASH_DASH_STATE",te="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN_STATE",ne="SCRIPT_DATA_ESCAPED_END_TAG_OPEN_STATE",se="SCRIPT_DATA_ESCAPED_END_TAG_NAME_STATE",re="SCRIPT_DATA_DOUBLE_ESCAPE_START_STATE",ie="SCRIPT_DATA_DOUBLE_ESCAPED_STATE",oe="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_STATE",ae="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH_STATE",Te="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN_STATE",Ee="SCRIPT_DATA_DOUBLE_ESCAPE_END_STATE",he="BEFORE_ATTRIBUTE_NAME_STATE",ce="ATTRIBUTE_NAME_STATE",_e="AFTER_ATTRIBUTE_NAME_STATE",le="BEFORE_ATTRIBUTE_VALUE_STATE",me="ATTRIBUTE_VALUE_DOUBLE_QUOTED_STATE",pe="ATTRIBUTE_VALUE_SINGLE_QUOTED_STATE",Ae="ATTRIBUTE_VALUE_UNQUOTED_STATE",ue="AFTER_ATTRIBUTE_VALUE_QUOTED_STATE",Ne="SELF_CLOSING_START_TAG_STATE",de="BOGUS_COMMENT_STATE",Ce="MARKUP_DECLARATION_OPEN_STATE",Oe="COMMENT_START_STATE",fe="COMMENT_START_DASH_STATE",Se="COMMENT_STATE",Re="COMMENT_LESS_THAN_SIGN_STATE",Ie="COMMENT_LESS_THAN_SIGN_BANG_STATE",Le="COMMENT_LESS_THAN_SIGN_BANG_DASH_STATE",ke="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH_STATE",Me="COMMENT_END_DASH_STATE",ge="COMMENT_END_STATE",Pe="COMMENT_END_BANG_STATE",He="DOCTYPE_STATE",De="BEFORE_DOCTYPE_NAME_STATE",Fe="DOCTYPE_NAME_STATE",Ue="AFTER_DOCTYPE_NAME_STATE",Ge="AFTER_DOCTYPE_PUBLIC_KEYWORD_STATE",Be="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER_STATE",Ke="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED_STATE",be="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED_STATE",xe="AFTER_DOCTYPE_PUBLIC_IDENTIFIER_STATE",ye="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS_STATE",ve="AFTER_DOCTYPE_SYSTEM_KEYWORD_STATE",Ye="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER_STATE",we="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED_STATE",Qe="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED_STATE",Xe="AFTER_DOCTYPE_SYSTEM_IDENTIFIER_STATE",We="BOGUS_DOCTYPE_STATE",Ve="CDATA_SECTION_STATE",je="CDATA_SECTION_BRACKET_STATE",ze="CDATA_SECTION_END_STATE",qe="CHARACTER_REFERENCE_STATE",Je="NAMED_CHARACTER_REFERENCE_STATE",Ze="AMBIGUOS_AMPERSAND_STATE",$e="NUMERIC_CHARACTER_REFERENCE_STATE",et="HEXADEMICAL_CHARACTER_REFERENCE_START_STATE",tt="DECIMAL_CHARACTER_REFERENCE_START_STATE",nt="HEXADEMICAL_CHARACTER_REFERENCE_STATE",st="DECIMAL_CHARACTER_REFERENCE_STATE",rt="NUMERIC_CHARACTER_REFERENCE_END_STATE";function it(e){return e===P.SPACE||e===P.LINE_FEED||e===P.TABULATION||e===P.FORM_FEED}function ot(e){return e>=P.DIGIT_0&&e<=P.DIGIT_9}function at(e){return e>=P.LATIN_CAPITAL_A&&e<=P.LATIN_CAPITAL_Z}function Tt(e){return e>=P.LATIN_SMALL_A&&e<=P.LATIN_SMALL_Z}function Et(e){return Tt(e)||at(e)}function ht(e){return Et(e)||ot(e)}function ct(e){return e>=P.LATIN_CAPITAL_A&&e<=P.LATIN_CAPITAL_F}function _t(e){return e>=P.LATIN_SMALL_A&&e<=P.LATIN_SMALL_F}function lt(e){return e+32}function mt(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(e>>>10&1023|55296)+String.fromCharCode(56320|1023&e))}function pt(e){return String.fromCharCode(lt(e))}function At(e,t){const n=g[++e];let s=++e,r=s+n-1;for(;s<=r;){const e=s+r>>>1,i=g[e];if(i<t)s=e+1;else {if(!(i>t))return g[e+n];r=e-1;}}return -1}class ut{constructor(){this.preprocessor=new class{constructor(){this.html=null,this.pos=-1,this.lastGapPos=-1,this.lastCharPos=-1,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=65536;}_err(){}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos;}_processSurrogate(e){if(this.pos!==this.lastCharPos){const t=this.html.charCodeAt(this.pos+1);if(function(e){return e>=56320&&e<=57343}(t))return this.pos++,this._addGap(),1024*(e-55296)+9216+t}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,M.EOF;return this._err("surrogate-in-input-stream"),e}dropParsedChunk(){this.pos>this.bufferWaterline&&(this.lastCharPos-=this.pos,this.html=this.html.substring(this.pos),this.pos=0,this.lastGapPos=-1,this.gapStack=[]);}write(e,t){this.html?this.html+=e:this.html=e,this.lastCharPos=this.html.length-1,this.endOfChunkHit=!1,this.lastChunkWritten=t;}insertHtmlAtCurrentPos(e){this.html=this.html.substring(0,this.pos+1)+e+this.html.substring(this.pos+1,this.html.length),this.lastCharPos=this.html.length-1,this.endOfChunkHit=!1;}advance(){if(this.pos++,this.pos>this.lastCharPos)return this.endOfChunkHit=!this.lastChunkWritten,M.EOF;let e=this.html.charCodeAt(this.pos);return this.skipNextNewLine&&e===M.LINE_FEED?(this.skipNextNewLine=!1,this._addGap(),this.advance()):e===M.CARRIAGE_RETURN?(this.skipNextNewLine=!0,M.LINE_FEED):(this.skipNextNewLine=!1,r(e)&&(e=this._processSurrogate(e)),e>31&&e<127||e===M.LINE_FEED||e===M.CARRIAGE_RETURN||e>159&&e<64976||this._checkForProblematicCharacters(e),e)}_checkForProblematicCharacters(e){i(e)?this._err("control-character-in-input-stream"):o(e)&&this._err("noncharacter-in-input-stream");}retreat(){this.pos===this.lastGapPos&&(this.lastGapPos=this.gapStack.pop(),this.pos--),this.pos--;}},this.tokenQueue=[],this.allowCDATA=!1,this.state=F,this.returnState="",this.charRefCode=-1,this.tempBuff=[],this.lastStartTagName="",this.consumedAfterSnapshot=-1,this.active=!1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr=null;}_err(){}_errOnNextCodePoint(e){this._consume(),this._err(e),this._unconsume();}getNextToken(){for(;!this.tokenQueue.length&&this.active;){this.consumedAfterSnapshot=0;const e=this._consume();this._ensureHibernation()||this[this.state](e);}return this.tokenQueue.shift()}write(e,t){this.active=!0,this.preprocessor.write(e,t);}insertHtmlAtCurrentPos(e){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(e);}_ensureHibernation(){if(this.preprocessor.endOfChunkHit){for(;this.consumedAfterSnapshot>0;this.consumedAfterSnapshot--)this.preprocessor.retreat();return this.active=!1,this.tokenQueue.push({type:ut.HIBERNATION_TOKEN}),!0}return !1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_unconsume(){this.consumedAfterSnapshot--,this.preprocessor.retreat();}_reconsumeInState(e){this.state=e,this._unconsume();}_consumeSequenceIfMatch(e,t,n){let s=0,r=!0;const i=e.length;let o,a=0,T=t;for(;a<i;a++){if(a>0&&(T=this._consume(),s++),T===P.EOF){r=!1;break}if(o=e[a],T!==o&&(n||T!==lt(o))){r=!1;break}}if(!r)for(;s--;)this._unconsume();return r}_isTempBufferEqualToScriptString(){if(this.tempBuff.length!==H.SCRIPT_STRING.length)return !1;for(let e=0;e<this.tempBuff.length;e++)if(this.tempBuff[e]!==H.SCRIPT_STRING[e])return !1;return !0}_createStartTagToken(){this.currentToken={type:ut.START_TAG_TOKEN,tagName:"",selfClosing:!1,ackSelfClosing:!1,attrs:[]};}_createEndTagToken(){this.currentToken={type:ut.END_TAG_TOKEN,tagName:"",selfClosing:!1,attrs:[]};}_createCommentToken(){this.currentToken={type:ut.COMMENT_TOKEN,data:""};}_createDoctypeToken(e){this.currentToken={type:ut.DOCTYPE_TOKEN,name:e,forceQuirks:!1,publicId:null,systemId:null};}_createCharacterToken(e,t){this.currentCharacterToken={type:e,chars:t};}_createEOFToken(){this.currentToken={type:ut.EOF_TOKEN};}_createAttr(e){this.currentAttr={name:e,value:""};}_leaveAttrName(e){null===ut.getTokenAttr(this.currentToken,this.currentAttr.name)?this.currentToken.attrs.push(this.currentAttr):this._err("duplicate-attribute"),this.state=e;}_leaveAttrValue(e){this.state=e;}_emitCurrentToken(){this._emitCurrentCharacterToken();const e=this.currentToken;this.currentToken=null,e.type===ut.START_TAG_TOKEN?this.lastStartTagName=e.tagName:e.type===ut.END_TAG_TOKEN&&(e.attrs.length>0&&this._err("end-tag-with-attributes"),e.selfClosing&&this._err("end-tag-with-trailing-solidus")),this.tokenQueue.push(e);}_emitCurrentCharacterToken(){this.currentCharacterToken&&(this.tokenQueue.push(this.currentCharacterToken),this.currentCharacterToken=null);}_emitEOFToken(){this._createEOFToken(),this._emitCurrentToken();}_appendCharToCurrentCharacterToken(e,t){this.currentCharacterToken&&this.currentCharacterToken.type!==e&&this._emitCurrentCharacterToken(),this.currentCharacterToken?this.currentCharacterToken.chars+=t:this._createCharacterToken(e,t);}_emitCodePoint(e){let t=ut.CHARACTER_TOKEN;it(e)?t=ut.WHITESPACE_CHARACTER_TOKEN:e===P.NULL&&(t=ut.NULL_CHARACTER_TOKEN),this._appendCharToCurrentCharacterToken(t,mt(e));}_emitSeveralCodePoints(e){for(let t=0;t<e.length;t++)this._emitCodePoint(e[t]);}_emitChars(e){this._appendCharToCurrentCharacterToken(ut.CHARACTER_TOKEN,e);}_matchNamedCharacterReference(e){let t=null,n=1,s=At(0,e);for(this.tempBuff.push(e);s>-1;){const e=g[s],r=e<7;r&&1&e&&(t=2&e?[g[++s],g[++s]]:[g[++s]],n=0);const i=this._consume();if(this.tempBuff.push(i),n++,i===P.EOF)break;s=r?4&e?At(s,i):-1:i===e?++s:-1;}for(;n--;)this.tempBuff.pop(),this._unconsume();return t}_isCharacterReferenceInAttribute(){return this.returnState===me||this.returnState===pe||this.returnState===Ae}_isCharacterReferenceAttributeQuirk(e){if(!e&&this._isCharacterReferenceInAttribute()){const e=this._consume();return this._unconsume(),e===P.EQUALS_SIGN||ht(e)}return !1}_flushCodePointsConsumedAsCharacterReference(){if(this._isCharacterReferenceInAttribute())for(let e=0;e<this.tempBuff.length;e++)this.currentAttr.value+=mt(this.tempBuff[e]);else this._emitSeveralCodePoints(this.tempBuff);this.tempBuff=[];}[F](e){this.preprocessor.dropParsedChunk(),e===P.LESS_THAN_SIGN?this.state=b:e===P.AMPERSAND?(this.returnState=F,this.state=qe):e===P.NULL?(this._err(a),this._emitCodePoint(e)):e===P.EOF?this._emitEOFToken():this._emitCodePoint(e);}[U](e){this.preprocessor.dropParsedChunk(),e===P.AMPERSAND?(this.returnState=U,this.state=qe):e===P.LESS_THAN_SIGN?this.state=v:e===P.NULL?(this._err(a),this._emitChars(n)):e===P.EOF?this._emitEOFToken():this._emitCodePoint(e);}[G](e){this.preprocessor.dropParsedChunk(),e===P.LESS_THAN_SIGN?this.state=Q:e===P.NULL?(this._err(a),this._emitChars(n)):e===P.EOF?this._emitEOFToken():this._emitCodePoint(e);}[B](e){this.preprocessor.dropParsedChunk(),e===P.LESS_THAN_SIGN?this.state=V:e===P.NULL?(this._err(a),this._emitChars(n)):e===P.EOF?this._emitEOFToken():this._emitCodePoint(e);}[K](e){this.preprocessor.dropParsedChunk(),e===P.NULL?(this._err(a),this._emitChars(n)):e===P.EOF?this._emitEOFToken():this._emitCodePoint(e);}[b](e){e===P.EXCLAMATION_MARK?this.state=Ce:e===P.SOLIDUS?this.state=x:Et(e)?(this._createStartTagToken(),this._reconsumeInState(y)):e===P.QUESTION_MARK?(this._err("unexpected-question-mark-instead-of-tag-name"),this._createCommentToken(),this._reconsumeInState(de)):e===P.EOF?(this._err(h),this._emitChars("<"),this._emitEOFToken()):(this._err(T),this._emitChars("<"),this._reconsumeInState(F));}[x](e){Et(e)?(this._createEndTagToken(),this._reconsumeInState(y)):e===P.GREATER_THAN_SIGN?(this._err("missing-end-tag-name"),this.state=F):e===P.EOF?(this._err(h),this._emitChars("</"),this._emitEOFToken()):(this._err(T),this._createCommentToken(),this._reconsumeInState(de));}[y](e){it(e)?this.state=he:e===P.SOLIDUS?this.state=Ne:e===P.GREATER_THAN_SIGN?(this.state=F,this._emitCurrentToken()):at(e)?this.currentToken.tagName+=pt(e):e===P.NULL?(this._err(a),this.currentToken.tagName+=n):e===P.EOF?(this._err(c),this._emitEOFToken()):this.currentToken.tagName+=mt(e);}[v](e){e===P.SOLIDUS?(this.tempBuff=[],this.state=Y):(this._emitChars("<"),this._reconsumeInState(U));}[Y](e){Et(e)?(this._createEndTagToken(),this._reconsumeInState(w)):(this._emitChars("</"),this._reconsumeInState(U));}[w](e){if(at(e))this.currentToken.tagName+=pt(e),this.tempBuff.push(e);else if(Tt(e))this.currentToken.tagName+=mt(e),this.tempBuff.push(e);else {if(this.lastStartTagName===this.currentToken.tagName){if(it(e))return void(this.state=he);if(e===P.SOLIDUS)return void(this.state=Ne);if(e===P.GREATER_THAN_SIGN)return this.state=F,void this._emitCurrentToken()}this._emitChars("</"),this._emitSeveralCodePoints(this.tempBuff),this._reconsumeInState(U);}}[Q](e){e===P.SOLIDUS?(this.tempBuff=[],this.state=X):(this._emitChars("<"),this._reconsumeInState(G));}[X](e){Et(e)?(this._createEndTagToken(),this._reconsumeInState(W)):(this._emitChars("</"),this._reconsumeInState(G));}[W](e){if(at(e))this.currentToken.tagName+=pt(e),this.tempBuff.push(e);else if(Tt(e))this.currentToken.tagName+=mt(e),this.tempBuff.push(e);else {if(this.lastStartTagName===this.currentToken.tagName){if(it(e))return void(this.state=he);if(e===P.SOLIDUS)return void(this.state=Ne);if(e===P.GREATER_THAN_SIGN)return this._emitCurrentToken(),void(this.state=F)}this._emitChars("</"),this._emitSeveralCodePoints(this.tempBuff),this._reconsumeInState(G);}}[V](e){e===P.SOLIDUS?(this.tempBuff=[],this.state=j):e===P.EXCLAMATION_MARK?(this.state=q,this._emitChars("<!")):(this._emitChars("<"),this._reconsumeInState(B));}[j](e){Et(e)?(this._createEndTagToken(),this._reconsumeInState(z)):(this._emitChars("</"),this._reconsumeInState(B));}[z](e){if(at(e))this.currentToken.tagName+=pt(e),this.tempBuff.push(e);else if(Tt(e))this.currentToken.tagName+=mt(e),this.tempBuff.push(e);else {if(this.lastStartTagName===this.currentToken.tagName){if(it(e))return void(this.state=he);if(e===P.SOLIDUS)return void(this.state=Ne);if(e===P.GREATER_THAN_SIGN)return this._emitCurrentToken(),void(this.state=F)}this._emitChars("</"),this._emitSeveralCodePoints(this.tempBuff),this._reconsumeInState(B);}}[q](e){e===P.HYPHEN_MINUS?(this.state=J,this._emitChars("-")):this._reconsumeInState(B);}[J](e){e===P.HYPHEN_MINUS?(this.state=ee,this._emitChars("-")):this._reconsumeInState(B);}[Z](e){e===P.HYPHEN_MINUS?(this.state=$,this._emitChars("-")):e===P.LESS_THAN_SIGN?this.state=te:e===P.NULL?(this._err(a),this._emitChars(n)):e===P.EOF?(this._err(O),this._emitEOFToken()):this._emitCodePoint(e);}[$](e){e===P.HYPHEN_MINUS?(this.state=ee,this._emitChars("-")):e===P.LESS_THAN_SIGN?this.state=te:e===P.NULL?(this._err(a),this.state=Z,this._emitChars(n)):e===P.EOF?(this._err(O),this._emitEOFToken()):(this.state=Z,this._emitCodePoint(e));}[ee](e){e===P.HYPHEN_MINUS?this._emitChars("-"):e===P.LESS_THAN_SIGN?this.state=te:e===P.GREATER_THAN_SIGN?(this.state=B,this._emitChars(">")):e===P.NULL?(this._err(a),this.state=Z,this._emitChars(n)):e===P.EOF?(this._err(O),this._emitEOFToken()):(this.state=Z,this._emitCodePoint(e));}[te](e){e===P.SOLIDUS?(this.tempBuff=[],this.state=ne):Et(e)?(this.tempBuff=[],this._emitChars("<"),this._reconsumeInState(re)):(this._emitChars("<"),this._reconsumeInState(Z));}[ne](e){Et(e)?(this._createEndTagToken(),this._reconsumeInState(se)):(this._emitChars("</"),this._reconsumeInState(Z));}[se](e){if(at(e))this.currentToken.tagName+=pt(e),this.tempBuff.push(e);else if(Tt(e))this.currentToken.tagName+=mt(e),this.tempBuff.push(e);else {if(this.lastStartTagName===this.currentToken.tagName){if(it(e))return void(this.state=he);if(e===P.SOLIDUS)return void(this.state=Ne);if(e===P.GREATER_THAN_SIGN)return this._emitCurrentToken(),void(this.state=F)}this._emitChars("</"),this._emitSeveralCodePoints(this.tempBuff),this._reconsumeInState(Z);}}[re](e){it(e)||e===P.SOLIDUS||e===P.GREATER_THAN_SIGN?(this.state=this._isTempBufferEqualToScriptString()?ie:Z,this._emitCodePoint(e)):at(e)?(this.tempBuff.push(lt(e)),this._emitCodePoint(e)):Tt(e)?(this.tempBuff.push(e),this._emitCodePoint(e)):this._reconsumeInState(Z);}[ie](e){e===P.HYPHEN_MINUS?(this.state=oe,this._emitChars("-")):e===P.LESS_THAN_SIGN?(this.state=Te,this._emitChars("<")):e===P.NULL?(this._err(a),this._emitChars(n)):e===P.EOF?(this._err(O),this._emitEOFToken()):this._emitCodePoint(e);}[oe](e){e===P.HYPHEN_MINUS?(this.state=ae,this._emitChars("-")):e===P.LESS_THAN_SIGN?(this.state=Te,this._emitChars("<")):e===P.NULL?(this._err(a),this.state=ie,this._emitChars(n)):e===P.EOF?(this._err(O),this._emitEOFToken()):(this.state=ie,this._emitCodePoint(e));}[ae](e){e===P.HYPHEN_MINUS?this._emitChars("-"):e===P.LESS_THAN_SIGN?(this.state=Te,this._emitChars("<")):e===P.GREATER_THAN_SIGN?(this.state=B,this._emitChars(">")):e===P.NULL?(this._err(a),this.state=ie,this._emitChars(n)):e===P.EOF?(this._err(O),this._emitEOFToken()):(this.state=ie,this._emitCodePoint(e));}[Te](e){e===P.SOLIDUS?(this.tempBuff=[],this.state=Ee,this._emitChars("/")):this._reconsumeInState(ie);}[Ee](e){it(e)||e===P.SOLIDUS||e===P.GREATER_THAN_SIGN?(this.state=this._isTempBufferEqualToScriptString()?Z:ie,this._emitCodePoint(e)):at(e)?(this.tempBuff.push(lt(e)),this._emitCodePoint(e)):Tt(e)?(this.tempBuff.push(e),this._emitCodePoint(e)):this._reconsumeInState(ie);}[he](e){it(e)||(e===P.SOLIDUS||e===P.GREATER_THAN_SIGN||e===P.EOF?this._reconsumeInState(_e):e===P.EQUALS_SIGN?(this._err("unexpected-equals-sign-before-attribute-name"),this._createAttr("="),this.state=ce):(this._createAttr(""),this._reconsumeInState(ce)));}[ce](e){it(e)||e===P.SOLIDUS||e===P.GREATER_THAN_SIGN||e===P.EOF?(this._leaveAttrName(_e),this._unconsume()):e===P.EQUALS_SIGN?this._leaveAttrName(le):at(e)?this.currentAttr.name+=pt(e):e===P.QUOTATION_MARK||e===P.APOSTROPHE||e===P.LESS_THAN_SIGN?(this._err("unexpected-character-in-attribute-name"),this.currentAttr.name+=mt(e)):e===P.NULL?(this._err(a),this.currentAttr.name+=n):this.currentAttr.name+=mt(e);}[_e](e){it(e)||(e===P.SOLIDUS?this.state=Ne:e===P.EQUALS_SIGN?this.state=le:e===P.GREATER_THAN_SIGN?(this.state=F,this._emitCurrentToken()):e===P.EOF?(this._err(c),this._emitEOFToken()):(this._createAttr(""),this._reconsumeInState(ce)));}[le](e){it(e)||(e===P.QUOTATION_MARK?this.state=me:e===P.APOSTROPHE?this.state=pe:e===P.GREATER_THAN_SIGN?(this._err("missing-attribute-value"),this.state=F,this._emitCurrentToken()):this._reconsumeInState(Ae));}[me](e){e===P.QUOTATION_MARK?this.state=ue:e===P.AMPERSAND?(this.returnState=me,this.state=qe):e===P.NULL?(this._err(a),this.currentAttr.value+=n):e===P.EOF?(this._err(c),this._emitEOFToken()):this.currentAttr.value+=mt(e);}[pe](e){e===P.APOSTROPHE?this.state=ue:e===P.AMPERSAND?(this.returnState=pe,this.state=qe):e===P.NULL?(this._err(a),this.currentAttr.value+=n):e===P.EOF?(this._err(c),this._emitEOFToken()):this.currentAttr.value+=mt(e);}[Ae](e){it(e)?this._leaveAttrValue(he):e===P.AMPERSAND?(this.returnState=Ae,this.state=qe):e===P.GREATER_THAN_SIGN?(this._leaveAttrValue(F),this._emitCurrentToken()):e===P.NULL?(this._err(a),this.currentAttr.value+=n):e===P.QUOTATION_MARK||e===P.APOSTROPHE||e===P.LESS_THAN_SIGN||e===P.EQUALS_SIGN||e===P.GRAVE_ACCENT?(this._err("unexpected-character-in-unquoted-attribute-value"),this.currentAttr.value+=mt(e)):e===P.EOF?(this._err(c),this._emitEOFToken()):this.currentAttr.value+=mt(e);}[ue](e){it(e)?this._leaveAttrValue(he):e===P.SOLIDUS?this._leaveAttrValue(Ne):e===P.GREATER_THAN_SIGN?(this._leaveAttrValue(F),this._emitCurrentToken()):e===P.EOF?(this._err(c),this._emitEOFToken()):(this._err("missing-whitespace-between-attributes"),this._reconsumeInState(he));}[Ne](e){e===P.GREATER_THAN_SIGN?(this.currentToken.selfClosing=!0,this.state=F,this._emitCurrentToken()):e===P.EOF?(this._err(c),this._emitEOFToken()):(this._err("unexpected-solidus-in-tag"),this._reconsumeInState(he));}[de](e){e===P.GREATER_THAN_SIGN?(this.state=F,this._emitCurrentToken()):e===P.EOF?(this._emitCurrentToken(),this._emitEOFToken()):e===P.NULL?(this._err(a),this.currentToken.data+=n):this.currentToken.data+=mt(e);}[Ce](e){this._consumeSequenceIfMatch(H.DASH_DASH_STRING,e,!0)?(this._createCommentToken(),this.state=Oe):this._consumeSequenceIfMatch(H.DOCTYPE_STRING,e,!1)?this.state=He:this._consumeSequenceIfMatch(H.CDATA_START_STRING,e,!0)?this.allowCDATA?this.state=Ve:(this._err("cdata-in-html-content"),this._createCommentToken(),this.currentToken.data="[CDATA[",this.state=de):this._ensureHibernation()||(this._err("incorrectly-opened-comment"),this._createCommentToken(),this._reconsumeInState(de));}[Oe](e){e===P.HYPHEN_MINUS?this.state=fe:e===P.GREATER_THAN_SIGN?(this._err(S),this.state=F,this._emitCurrentToken()):this._reconsumeInState(Se);}[fe](e){e===P.HYPHEN_MINUS?this.state=ge:e===P.GREATER_THAN_SIGN?(this._err(S),this.state=F,this._emitCurrentToken()):e===P.EOF?(this._err(R),this._emitCurrentToken(),this._emitEOFToken()):(this.currentToken.data+="-",this._reconsumeInState(Se));}[Se](e){e===P.HYPHEN_MINUS?this.state=Me:e===P.LESS_THAN_SIGN?(this.currentToken.data+="<",this.state=Re):e===P.NULL?(this._err(a),this.currentToken.data+=n):e===P.EOF?(this._err(R),this._emitCurrentToken(),this._emitEOFToken()):this.currentToken.data+=mt(e);}[Re](e){e===P.EXCLAMATION_MARK?(this.currentToken.data+="!",this.state=Ie):e===P.LESS_THAN_SIGN?this.currentToken.data+="!":this._reconsumeInState(Se);}[Ie](e){e===P.HYPHEN_MINUS?this.state=Le:this._reconsumeInState(Se);}[Le](e){e===P.HYPHEN_MINUS?this.state=ke:this._reconsumeInState(Me);}[ke](e){e!==P.GREATER_THAN_SIGN&&e!==P.EOF&&this._err("nested-comment"),this._reconsumeInState(ge);}[Me](e){e===P.HYPHEN_MINUS?this.state=ge:e===P.EOF?(this._err(R),this._emitCurrentToken(),this._emitEOFToken()):(this.currentToken.data+="-",this._reconsumeInState(Se));}[ge](e){e===P.GREATER_THAN_SIGN?(this.state=F,this._emitCurrentToken()):e===P.EXCLAMATION_MARK?this.state=Pe:e===P.HYPHEN_MINUS?this.currentToken.data+="-":e===P.EOF?(this._err(R),this._emitCurrentToken(),this._emitEOFToken()):(this.currentToken.data+="--",this._reconsumeInState(Se));}[Pe](e){e===P.HYPHEN_MINUS?(this.currentToken.data+="--!",this.state=Me):e===P.GREATER_THAN_SIGN?(this._err("incorrectly-closed-comment"),this.state=F,this._emitCurrentToken()):e===P.EOF?(this._err(R),this._emitCurrentToken(),this._emitEOFToken()):(this.currentToken.data+="--!",this._reconsumeInState(Se));}[He](e){it(e)?this.state=De:e===P.GREATER_THAN_SIGN?this._reconsumeInState(De):e===P.EOF?(this._err(f),this._createDoctypeToken(null),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._err("missing-whitespace-before-doctype-name"),this._reconsumeInState(De));}[De](e){it(e)||(at(e)?(this._createDoctypeToken(pt(e)),this.state=Fe):e===P.NULL?(this._err(a),this._createDoctypeToken(n),this.state=Fe):e===P.GREATER_THAN_SIGN?(this._err("missing-doctype-name"),this._createDoctypeToken(null),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this.state=F):e===P.EOF?(this._err(f),this._createDoctypeToken(null),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._createDoctypeToken(mt(e)),this.state=Fe));}[Fe](e){it(e)?this.state=Ue:e===P.GREATER_THAN_SIGN?(this.state=F,this._emitCurrentToken()):at(e)?this.currentToken.name+=pt(e):e===P.NULL?(this._err(a),this.currentToken.name+=n):e===P.EOF?(this._err(f),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):this.currentToken.name+=mt(e);}[Ue](e){it(e)||(e===P.GREATER_THAN_SIGN?(this.state=F,this._emitCurrentToken()):e===P.EOF?(this._err(f),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):this._consumeSequenceIfMatch(H.PUBLIC_STRING,e,!1)?this.state=Ge:this._consumeSequenceIfMatch(H.SYSTEM_STRING,e,!1)?this.state=ve:this._ensureHibernation()||(this._err("invalid-character-sequence-after-doctype-name"),this.currentToken.forceQuirks=!0,this._reconsumeInState(We)));}[Ge](e){it(e)?this.state=Be:e===P.QUOTATION_MARK?(this._err(_),this.currentToken.publicId="",this.state=Ke):e===P.APOSTROPHE?(this._err(_),this.currentToken.publicId="",this.state=be):e===P.GREATER_THAN_SIGN?(this._err(u),this.currentToken.forceQuirks=!0,this.state=F,this._emitCurrentToken()):e===P.EOF?(this._err(f),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._err(p),this.currentToken.forceQuirks=!0,this._reconsumeInState(We));}[Be](e){it(e)||(e===P.QUOTATION_MARK?(this.currentToken.publicId="",this.state=Ke):e===P.APOSTROPHE?(this.currentToken.publicId="",this.state=be):e===P.GREATER_THAN_SIGN?(this._err(u),this.currentToken.forceQuirks=!0,this.state=F,this._emitCurrentToken()):e===P.EOF?(this._err(f),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._err(p),this.currentToken.forceQuirks=!0,this._reconsumeInState(We)));}[Ke](e){e===P.QUOTATION_MARK?this.state=xe:e===P.NULL?(this._err(a),this.currentToken.publicId+=n):e===P.GREATER_THAN_SIGN?(this._err(d),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this.state=F):e===P.EOF?(this._err(f),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):this.currentToken.publicId+=mt(e);}[be](e){e===P.APOSTROPHE?this.state=xe:e===P.NULL?(this._err(a),this.currentToken.publicId+=n):e===P.GREATER_THAN_SIGN?(this._err(d),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this.state=F):e===P.EOF?(this._err(f),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):this.currentToken.publicId+=mt(e);}[xe](e){it(e)?this.state=ye:e===P.GREATER_THAN_SIGN?(this.state=F,this._emitCurrentToken()):e===P.QUOTATION_MARK?(this._err(l),this.currentToken.systemId="",this.state=we):e===P.APOSTROPHE?(this._err(l),this.currentToken.systemId="",this.state=Qe):e===P.EOF?(this._err(f),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._err(A),this.currentToken.forceQuirks=!0,this._reconsumeInState(We));}[ye](e){it(e)||(e===P.GREATER_THAN_SIGN?(this._emitCurrentToken(),this.state=F):e===P.QUOTATION_MARK?(this.currentToken.systemId="",this.state=we):e===P.APOSTROPHE?(this.currentToken.systemId="",this.state=Qe):e===P.EOF?(this._err(f),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._err(A),this.currentToken.forceQuirks=!0,this._reconsumeInState(We)));}[ve](e){it(e)?this.state=Ye:e===P.QUOTATION_MARK?(this._err(m),this.currentToken.systemId="",this.state=we):e===P.APOSTROPHE?(this._err(m),this.currentToken.systemId="",this.state=Qe):e===P.GREATER_THAN_SIGN?(this._err(N),this.currentToken.forceQuirks=!0,this.state=F,this._emitCurrentToken()):e===P.EOF?(this._err(f),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._err(A),this.currentToken.forceQuirks=!0,this._reconsumeInState(We));}[Ye](e){it(e)||(e===P.QUOTATION_MARK?(this.currentToken.systemId="",this.state=we):e===P.APOSTROPHE?(this.currentToken.systemId="",this.state=Qe):e===P.GREATER_THAN_SIGN?(this._err(N),this.currentToken.forceQuirks=!0,this.state=F,this._emitCurrentToken()):e===P.EOF?(this._err(f),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._err(A),this.currentToken.forceQuirks=!0,this._reconsumeInState(We)));}[we](e){e===P.QUOTATION_MARK?this.state=Xe:e===P.NULL?(this._err(a),this.currentToken.systemId+=n):e===P.GREATER_THAN_SIGN?(this._err(C),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this.state=F):e===P.EOF?(this._err(f),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):this.currentToken.systemId+=mt(e);}[Qe](e){e===P.APOSTROPHE?this.state=Xe:e===P.NULL?(this._err(a),this.currentToken.systemId+=n):e===P.GREATER_THAN_SIGN?(this._err(C),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this.state=F):e===P.EOF?(this._err(f),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):this.currentToken.systemId+=mt(e);}[Xe](e){it(e)||(e===P.GREATER_THAN_SIGN?(this._emitCurrentToken(),this.state=F):e===P.EOF?(this._err(f),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._err("unexpected-character-after-doctype-system-identifier"),this._reconsumeInState(We)));}[We](e){e===P.GREATER_THAN_SIGN?(this._emitCurrentToken(),this.state=F):e===P.NULL?this._err(a):e===P.EOF&&(this._emitCurrentToken(),this._emitEOFToken());}[Ve](e){e===P.RIGHT_SQUARE_BRACKET?this.state=je:e===P.EOF?(this._err("eof-in-cdata"),this._emitEOFToken()):this._emitCodePoint(e);}[je](e){e===P.RIGHT_SQUARE_BRACKET?this.state=ze:(this._emitChars("]"),this._reconsumeInState(Ve));}[ze](e){e===P.GREATER_THAN_SIGN?this.state=F:e===P.RIGHT_SQUARE_BRACKET?this._emitChars("]"):(this._emitChars("]]"),this._reconsumeInState(Ve));}[qe](e){this.tempBuff=[P.AMPERSAND],e===P.NUMBER_SIGN?(this.tempBuff.push(e),this.state=$e):ht(e)?this._reconsumeInState(Je):(this._flushCodePointsConsumedAsCharacterReference(),this._reconsumeInState(this.returnState));}[Je](e){const t=this._matchNamedCharacterReference(e);if(this._ensureHibernation())this.tempBuff=[P.AMPERSAND];else if(t){const e=this.tempBuff[this.tempBuff.length-1]===P.SEMICOLON;this._isCharacterReferenceAttributeQuirk(e)||(e||this._errOnNextCodePoint(E),this.tempBuff=t),this._flushCodePointsConsumedAsCharacterReference(),this.state=this.returnState;}else this._flushCodePointsConsumedAsCharacterReference(),this.state=Ze;}[Ze](e){ht(e)?this._isCharacterReferenceInAttribute()?this.currentAttr.value+=mt(e):this._emitCodePoint(e):(e===P.SEMICOLON&&this._err("unknown-named-character-reference"),this._reconsumeInState(this.returnState));}[$e](e){this.charRefCode=0,e===P.LATIN_SMALL_X||e===P.LATIN_CAPITAL_X?(this.tempBuff.push(e),this.state=et):this._reconsumeInState(tt);}[et](e){!function(e){return ot(e)||ct(e)||_t(e)}(e)?(this._err(I),this._flushCodePointsConsumedAsCharacterReference(),this._reconsumeInState(this.returnState)):this._reconsumeInState(nt);}[tt](e){ot(e)?this._reconsumeInState(st):(this._err(I),this._flushCodePointsConsumedAsCharacterReference(),this._reconsumeInState(this.returnState));}[nt](e){ct(e)?this.charRefCode=16*this.charRefCode+e-55:_t(e)?this.charRefCode=16*this.charRefCode+e-87:ot(e)?this.charRefCode=16*this.charRefCode+e-48:e===P.SEMICOLON?this.state=rt:(this._err(E),this._reconsumeInState(rt));}[st](e){ot(e)?this.charRefCode=10*this.charRefCode+e-48:e===P.SEMICOLON?this.state=rt:(this._err(E),this._reconsumeInState(rt));}[rt](){if(this.charRefCode===P.NULL)this._err("null-character-reference"),this.charRefCode=P.REPLACEMENT_CHARACTER;else if(this.charRefCode>1114111)this._err("character-reference-outside-unicode-range"),this.charRefCode=P.REPLACEMENT_CHARACTER;else if(r(this.charRefCode))this._err("surrogate-character-reference"),this.charRefCode=P.REPLACEMENT_CHARACTER;else if(o(this.charRefCode))this._err("noncharacter-character-reference");else if(i(this.charRefCode)||this.charRefCode===P.CARRIAGE_RETURN){this._err("control-character-reference");const e=D[this.charRefCode];e&&(this.charRefCode=e);}this.tempBuff=[this.charRefCode],this._flushCodePointsConsumedAsCharacterReference(),this._reconsumeInState(this.returnState);}}ut.CHARACTER_TOKEN="CHARACTER_TOKEN",ut.NULL_CHARACTER_TOKEN="NULL_CHARACTER_TOKEN",ut.WHITESPACE_CHARACTER_TOKEN="WHITESPACE_CHARACTER_TOKEN",ut.START_TAG_TOKEN="START_TAG_TOKEN",ut.END_TAG_TOKEN="END_TAG_TOKEN",ut.COMMENT_TOKEN="COMMENT_TOKEN",ut.DOCTYPE_TOKEN="DOCTYPE_TOKEN",ut.EOF_TOKEN="EOF_TOKEN",ut.HIBERNATION_TOKEN="HIBERNATION_TOKEN",ut.MODE={DATA:F,RCDATA:U,RAWTEXT:G,SCRIPT_DATA:B,PLAINTEXT:K},ut.getTokenAttr=function(e,t){for(let n=e.attrs.length-1;n>=0;n--)if(e.attrs[n].name===t)return e.attrs[n].value;return null};var Nt=ut;function dt(e,t,n){return e(n={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}()}},n.exports),n.exports}var Ct=dt((function(e,t){const n=t.NAMESPACES={HTML:"http://www.w3.org/1999/xhtml",MATHML:"http://www.w3.org/1998/Math/MathML",SVG:"http://www.w3.org/2000/svg",XLINK:"http://www.w3.org/1999/xlink",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"};t.ATTRS={TYPE:"type",ACTION:"action",ENCODING:"encoding",PROMPT:"prompt",NAME:"name",COLOR:"color",FACE:"face",SIZE:"size"},t.DOCUMENT_MODE={NO_QUIRKS:"no-quirks",QUIRKS:"quirks",LIMITED_QUIRKS:"limited-quirks"};const s=t.TAG_NAMES={A:"a",ADDRESS:"address",ANNOTATION_XML:"annotation-xml",APPLET:"applet",AREA:"area",ARTICLE:"article",ASIDE:"aside",B:"b",BASE:"base",BASEFONT:"basefont",BGSOUND:"bgsound",BIG:"big",BLOCKQUOTE:"blockquote",BODY:"body",BR:"br",BUTTON:"button",CAPTION:"caption",CENTER:"center",CODE:"code",COL:"col",COLGROUP:"colgroup",DD:"dd",DESC:"desc",DETAILS:"details",DIALOG:"dialog",DIR:"dir",DIV:"div",DL:"dl",DT:"dt",EM:"em",EMBED:"embed",FIELDSET:"fieldset",FIGCAPTION:"figcaption",FIGURE:"figure",FONT:"font",FOOTER:"footer",FOREIGN_OBJECT:"foreignObject",FORM:"form",FRAME:"frame",FRAMESET:"frameset",H1:"h1",H2:"h2",H3:"h3",H4:"h4",H5:"h5",H6:"h6",HEAD:"head",HEADER:"header",HGROUP:"hgroup",HR:"hr",HTML:"html",I:"i",IMG:"img",IMAGE:"image",INPUT:"input",IFRAME:"iframe",KEYGEN:"keygen",LABEL:"label",LI:"li",LINK:"link",LISTING:"listing",MAIN:"main",MALIGNMARK:"malignmark",MARQUEE:"marquee",MATH:"math",MENU:"menu",META:"meta",MGLYPH:"mglyph",MI:"mi",MO:"mo",MN:"mn",MS:"ms",MTEXT:"mtext",NAV:"nav",NOBR:"nobr",NOFRAMES:"noframes",NOEMBED:"noembed",NOSCRIPT:"noscript",OBJECT:"object",OL:"ol",OPTGROUP:"optgroup",OPTION:"option",P:"p",PARAM:"param",PLAINTEXT:"plaintext",PRE:"pre",RB:"rb",RP:"rp",RT:"rt",RTC:"rtc",RUBY:"ruby",S:"s",SCRIPT:"script",SECTION:"section",SELECT:"select",SOURCE:"source",SMALL:"small",SPAN:"span",STRIKE:"strike",STRONG:"strong",STYLE:"style",SUB:"sub",SUMMARY:"summary",SUP:"sup",TABLE:"table",TBODY:"tbody",TEMPLATE:"template",TEXTAREA:"textarea",TFOOT:"tfoot",TD:"td",TH:"th",THEAD:"thead",TITLE:"title",TR:"tr",TRACK:"track",TT:"tt",U:"u",UL:"ul",SVG:"svg",VAR:"var",WBR:"wbr",XMP:"xmp"};t.SPECIAL_ELEMENTS={[n.HTML]:{[s.ADDRESS]:!0,[s.APPLET]:!0,[s.AREA]:!0,[s.ARTICLE]:!0,[s.ASIDE]:!0,[s.BASE]:!0,[s.BASEFONT]:!0,[s.BGSOUND]:!0,[s.BLOCKQUOTE]:!0,[s.BODY]:!0,[s.BR]:!0,[s.BUTTON]:!0,[s.CAPTION]:!0,[s.CENTER]:!0,[s.COL]:!0,[s.COLGROUP]:!0,[s.DD]:!0,[s.DETAILS]:!0,[s.DIR]:!0,[s.DIV]:!0,[s.DL]:!0,[s.DT]:!0,[s.EMBED]:!0,[s.FIELDSET]:!0,[s.FIGCAPTION]:!0,[s.FIGURE]:!0,[s.FOOTER]:!0,[s.FORM]:!0,[s.FRAME]:!0,[s.FRAMESET]:!0,[s.H1]:!0,[s.H2]:!0,[s.H3]:!0,[s.H4]:!0,[s.H5]:!0,[s.H6]:!0,[s.HEAD]:!0,[s.HEADER]:!0,[s.HGROUP]:!0,[s.HR]:!0,[s.HTML]:!0,[s.IFRAME]:!0,[s.IMG]:!0,[s.INPUT]:!0,[s.LI]:!0,[s.LINK]:!0,[s.LISTING]:!0,[s.MAIN]:!0,[s.MARQUEE]:!0,[s.MENU]:!0,[s.META]:!0,[s.NAV]:!0,[s.NOEMBED]:!0,[s.NOFRAMES]:!0,[s.NOSCRIPT]:!0,[s.OBJECT]:!0,[s.OL]:!0,[s.P]:!0,[s.PARAM]:!0,[s.PLAINTEXT]:!0,[s.PRE]:!0,[s.SCRIPT]:!0,[s.SECTION]:!0,[s.SELECT]:!0,[s.SOURCE]:!0,[s.STYLE]:!0,[s.SUMMARY]:!0,[s.TABLE]:!0,[s.TBODY]:!0,[s.TD]:!0,[s.TEMPLATE]:!0,[s.TEXTAREA]:!0,[s.TFOOT]:!0,[s.TH]:!0,[s.THEAD]:!0,[s.TITLE]:!0,[s.TR]:!0,[s.TRACK]:!0,[s.UL]:!0,[s.WBR]:!0,[s.XMP]:!0},[n.MATHML]:{[s.MI]:!0,[s.MO]:!0,[s.MN]:!0,[s.MS]:!0,[s.MTEXT]:!0,[s.ANNOTATION_XML]:!0},[n.SVG]:{[s.TITLE]:!0,[s.FOREIGN_OBJECT]:!0,[s.DESC]:!0}};}));const Ot=Ct.TAG_NAMES,ft=Ct.NAMESPACES;function St(e){switch(e.length){case 1:return e===Ot.P;case 2:return e===Ot.RB||e===Ot.RP||e===Ot.RT||e===Ot.DD||e===Ot.DT||e===Ot.LI;case 3:return e===Ot.RTC;case 6:return e===Ot.OPTION;case 8:return e===Ot.OPTGROUP}return !1}function Rt(e){switch(e.length){case 1:return e===Ot.P;case 2:return e===Ot.RB||e===Ot.RP||e===Ot.RT||e===Ot.DD||e===Ot.DT||e===Ot.LI||e===Ot.TD||e===Ot.TH||e===Ot.TR;case 3:return e===Ot.RTC;case 5:return e===Ot.TBODY||e===Ot.TFOOT||e===Ot.THEAD;case 6:return e===Ot.OPTION;case 7:return e===Ot.CAPTION;case 8:return e===Ot.OPTGROUP||e===Ot.COLGROUP}return !1}function It(e,t){switch(e.length){case 2:if(e===Ot.TD||e===Ot.TH)return t===ft.HTML;if(e===Ot.MI||e===Ot.MO||e===Ot.MN||e===Ot.MS)return t===ft.MATHML;break;case 4:if(e===Ot.HTML)return t===ft.HTML;if(e===Ot.DESC)return t===ft.SVG;break;case 5:if(e===Ot.TABLE)return t===ft.HTML;if(e===Ot.MTEXT)return t===ft.MATHML;if(e===Ot.TITLE)return t===ft.SVG;break;case 6:return (e===Ot.APPLET||e===Ot.OBJECT)&&t===ft.HTML;case 7:return (e===Ot.CAPTION||e===Ot.MARQUEE)&&t===ft.HTML;case 8:return e===Ot.TEMPLATE&&t===ft.HTML;case 13:return e===Ot.FOREIGN_OBJECT&&t===ft.SVG;case 14:return e===Ot.ANNOTATION_XML&&t===ft.MATHML}return !1}class Lt{constructor(e){this.length=0,this.entries=[],this.treeAdapter=e,this.bookmark=null;}_getNoahArkConditionCandidates(e){const t=[];if(this.length>=3){const n=this.treeAdapter.getAttrList(e).length,s=this.treeAdapter.getTagName(e),r=this.treeAdapter.getNamespaceURI(e);for(let e=this.length-1;e>=0;e--){const i=this.entries[e];if(i.type===Lt.MARKER_ENTRY)break;const o=i.element,a=this.treeAdapter.getAttrList(o);this.treeAdapter.getTagName(o)===s&&this.treeAdapter.getNamespaceURI(o)===r&&a.length===n&&t.push({idx:e,attrs:a});}}return t.length<3?[]:t}_ensureNoahArkCondition(e){const t=this._getNoahArkConditionCandidates(e);let n=t.length;if(n){const s=this.treeAdapter.getAttrList(e),r=s.length,i=Object.create(null);for(let e=0;e<r;e++){const t=s[e];i[t.name]=t.value;}for(let e=0;e<r;e++)for(let s=0;s<n;s++){const r=t[s].attrs[e];if(i[r.name]!==r.value&&(t.splice(s,1),n--),t.length<3)return}for(let e=n-1;e>=2;e--)this.entries.splice(t[e].idx,1),this.length--;}}insertMarker(){this.entries.push({type:Lt.MARKER_ENTRY}),this.length++;}pushElement(e,t){this._ensureNoahArkCondition(e),this.entries.push({type:Lt.ELEMENT_ENTRY,element:e,token:t}),this.length++;}insertElementAfterBookmark(e,t){let n=this.length-1;for(;n>=0&&this.entries[n]!==this.bookmark;n--);this.entries.splice(n+1,0,{type:Lt.ELEMENT_ENTRY,element:e,token:t}),this.length++;}removeEntry(e){for(let t=this.length-1;t>=0;t--)if(this.entries[t]===e){this.entries.splice(t,1),this.length--;break}}clearToLastMarker(){for(;this.length;){const e=this.entries.pop();if(this.length--,e.type===Lt.MARKER_ENTRY)break}}getElementEntryInScopeWithTagName(e){for(let t=this.length-1;t>=0;t--){const n=this.entries[t];if(n.type===Lt.MARKER_ENTRY)return null;if(this.treeAdapter.getTagName(n.element)===e)return n}return null}getElementEntry(e){for(let t=this.length-1;t>=0;t--){const n=this.entries[t];if(n.type===Lt.ELEMENT_ENTRY&&n.element===e)return n}return null}}Lt.MARKER_ENTRY="MARKER_ENTRY",Lt.ELEMENT_ENTRY="ELEMENT_ENTRY";var kt=Lt;class Mt{constructor(e){const t={},n=this._getOverriddenMethods(this,t);for(const s of Object.keys(n))"function"==typeof n[s]&&(t[s]=e[s],e[s]=n[s]);}_getOverriddenMethods(){throw new Error("Not implemented")}}Mt.install=function(e,t,n){e.__mixins||(e.__mixins=[]);for(let n=0;n<e.__mixins.length;n++)if(e.__mixins[n].constructor===t)return e.__mixins[n];const s=new t(e,n);return e.__mixins.push(s),s};var gt=Mt,Pt=class extends gt{constructor(e){super(e),this.preprocessor=e,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.offset=0,this.col=0,this.line=1;}_getOverriddenMethods(e,t){return {advance(){const n=this.pos+1,s=this.html[n];return e.isEol&&(e.isEol=!1,e.line++,e.lineStartPos=n),("\n"===s||"\r"===s&&"\n"!==this.html[n+1])&&(e.isEol=!0),e.col=n-e.lineStartPos+1,e.offset=e.droppedBufferSize+n,t.advance.call(this)},retreat(){t.retreat.call(this),e.isEol=!1,e.col=this.pos-e.lineStartPos+1;},dropParsedChunk(){const n=this.pos;t.dropParsedChunk.call(this);const s=n-this.pos;e.lineStartPos-=s,e.droppedBufferSize+=s,e.offset=e.droppedBufferSize+this.pos;}}}},Ht=class extends gt{constructor(e){super(e),this.tokenizer=e,this.posTracker=gt.install(e.preprocessor,Pt),this.currentAttrLocation=null,this.ctLoc=null;}_getCurrentLocation(){return {startLine:this.posTracker.line,startCol:this.posTracker.col,startOffset:this.posTracker.offset,endLine:-1,endCol:-1,endOffset:-1}}_attachCurrentAttrLocationInfo(){this.currentAttrLocation.endLine=this.posTracker.line,this.currentAttrLocation.endCol=this.posTracker.col,this.currentAttrLocation.endOffset=this.posTracker.offset;const e=this.tokenizer.currentToken,t=this.tokenizer.currentAttr;e.location.attrs||(e.location.attrs=Object.create(null)),e.location.attrs[t.name]=this.currentAttrLocation;}_getOverriddenMethods(e,t){const n={_createStartTagToken(){t._createStartTagToken.call(this),this.currentToken.location=e.ctLoc;},_createEndTagToken(){t._createEndTagToken.call(this),this.currentToken.location=e.ctLoc;},_createCommentToken(){t._createCommentToken.call(this),this.currentToken.location=e.ctLoc;},_createDoctypeToken(n){t._createDoctypeToken.call(this,n),this.currentToken.location=e.ctLoc;},_createCharacterToken(n,s){t._createCharacterToken.call(this,n,s),this.currentCharacterToken.location=e.ctLoc;},_createEOFToken(){t._createEOFToken.call(this),this.currentToken.location=e._getCurrentLocation();},_createAttr(n){t._createAttr.call(this,n),e.currentAttrLocation=e._getCurrentLocation();},_leaveAttrName(n){t._leaveAttrName.call(this,n),e._attachCurrentAttrLocationInfo();},_leaveAttrValue(n){t._leaveAttrValue.call(this,n),e._attachCurrentAttrLocationInfo();},_emitCurrentToken(){const n=this.currentToken.location;this.currentCharacterToken&&(this.currentCharacterToken.location.endLine=n.startLine,this.currentCharacterToken.location.endCol=n.startCol,this.currentCharacterToken.location.endOffset=n.startOffset),this.currentToken.type===Nt.EOF_TOKEN?(n.endLine=n.startLine,n.endCol=n.startCol,n.endOffset=n.startOffset):(n.endLine=e.posTracker.line,n.endCol=e.posTracker.col+1,n.endOffset=e.posTracker.offset+1),t._emitCurrentToken.call(this);},_emitCurrentCharacterToken(){const n=this.currentCharacterToken&&this.currentCharacterToken.location;n&&-1===n.endOffset&&(n.endLine=e.posTracker.line,n.endCol=e.posTracker.col,n.endOffset=e.posTracker.offset),t._emitCurrentCharacterToken.call(this);}};return Object.keys(Nt.MODE).forEach((s=>{const r=Nt.MODE[s];n[r]=function(n){e.ctLoc=e._getCurrentLocation(),t[r].call(this,n);};})),n}},Dt=class extends gt{constructor(e,t){super(e),this.onItemPop=t.onItemPop;}_getOverriddenMethods(e,t){return {pop(){e.onItemPop(this.current),t.pop.call(this);},popAllUpToHtmlElement(){for(let t=this.stackTop;t>0;t--)e.onItemPop(this.items[t]);t.popAllUpToHtmlElement.call(this);},remove(n){e.onItemPop(this.current),t.remove.call(this,n);}}}};const Ft=Ct.TAG_NAMES;var Ut=class extends gt{constructor(e){super(e),this.parser=e,this.treeAdapter=this.parser.treeAdapter,this.posTracker=null,this.lastStartTagToken=null,this.lastFosterParentingLocation=null,this.currentToken=null;}_setStartLocation(e){let t=null;this.lastStartTagToken&&(t=Object.assign({},this.lastStartTagToken.location),t.startTag=this.lastStartTagToken.location),this.treeAdapter.setNodeSourceCodeLocation(e,t);}_setEndLocation(e,t){if(this.treeAdapter.getNodeSourceCodeLocation(e)&&t.location){const n=t.location,s=this.treeAdapter.getTagName(e),r={};t.type===Nt.END_TAG_TOKEN&&s===t.tagName?(r.endTag=Object.assign({},n),r.endLine=n.endLine,r.endCol=n.endCol,r.endOffset=n.endOffset):(r.endLine=n.startLine,r.endCol=n.startCol,r.endOffset=n.startOffset),this.treeAdapter.updateNodeSourceCodeLocation(e,r);}}_getOverriddenMethods(e,t){return {_bootstrap(n,s){t._bootstrap.call(this,n,s),e.lastStartTagToken=null,e.lastFosterParentingLocation=null,e.currentToken=null;const r=gt.install(this.tokenizer,Ht);e.posTracker=r.posTracker,gt.install(this.openElements,Dt,{onItemPop:function(t){e._setEndLocation(t,e.currentToken);}});},_runParsingLoop(n){t._runParsingLoop.call(this,n);for(let t=this.openElements.stackTop;t>=0;t--)e._setEndLocation(this.openElements.items[t],e.currentToken);},_processTokenInForeignContent(n){e.currentToken=n,t._processTokenInForeignContent.call(this,n);},_processToken(n){if(e.currentToken=n,t._processToken.call(this,n),n.type===Nt.END_TAG_TOKEN&&(n.tagName===Ft.HTML||n.tagName===Ft.BODY&&this.openElements.hasInScope(Ft.BODY)))for(let t=this.openElements.stackTop;t>=0;t--){const s=this.openElements.items[t];if(this.treeAdapter.getTagName(s)===n.tagName){e._setEndLocation(s,n);break}}},_setDocumentType(e){t._setDocumentType.call(this,e);const n=this.treeAdapter.getChildNodes(this.document),s=n.length;for(let t=0;t<s;t++){const s=n[t];if(this.treeAdapter.isDocumentTypeNode(s)){this.treeAdapter.setNodeSourceCodeLocation(s,e.location);break}}},_attachElementToTree(n){e._setStartLocation(n),e.lastStartTagToken=null,t._attachElementToTree.call(this,n);},_appendElement(n,s){e.lastStartTagToken=n,t._appendElement.call(this,n,s);},_insertElement(n,s){e.lastStartTagToken=n,t._insertElement.call(this,n,s);},_insertTemplate(n){e.lastStartTagToken=n,t._insertTemplate.call(this,n);const s=this.treeAdapter.getTemplateContent(this.openElements.current);this.treeAdapter.setNodeSourceCodeLocation(s,null);},_insertFakeRootElement(){t._insertFakeRootElement.call(this),this.treeAdapter.setNodeSourceCodeLocation(this.openElements.current,null);},_appendCommentNode(e,n){t._appendCommentNode.call(this,e,n);const s=this.treeAdapter.getChildNodes(n),r=s[s.length-1];this.treeAdapter.setNodeSourceCodeLocation(r,e.location);},_findFosterParentingLocation(){return e.lastFosterParentingLocation=t._findFosterParentingLocation.call(this),e.lastFosterParentingLocation},_insertCharacters(n){t._insertCharacters.call(this,n);const s=this._shouldFosterParentOnInsertion(),r=s&&e.lastFosterParentingLocation.parent||this.openElements.currentTmplContent||this.openElements.current,i=this.treeAdapter.getChildNodes(r),o=s&&e.lastFosterParentingLocation.beforeElement?i.indexOf(e.lastFosterParentingLocation.beforeElement)-1:i.length-1,a=i[o];if(this.treeAdapter.getNodeSourceCodeLocation(a)){const{endLine:e,endCol:t,endOffset:s}=n.location;this.treeAdapter.updateNodeSourceCodeLocation(a,{endLine:e,endCol:t,endOffset:s});}else this.treeAdapter.setNodeSourceCodeLocation(a,n.location);}}}},Gt=class extends gt{constructor(e,t){super(e),this.posTracker=null,this.onParseError=t.onParseError;}_setErrorLocation(e){e.startLine=e.endLine=this.posTracker.line,e.startCol=e.endCol=this.posTracker.col,e.startOffset=e.endOffset=this.posTracker.offset;}_reportError(e){const t={code:e,startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1};this._setErrorLocation(t),this.onParseError(t);}_getOverriddenMethods(e){return {_err(t){e._reportError(t);}}}},Bt=class extends Gt{constructor(e,t){super(e,t),this.posTracker=gt.install(e,Pt),this.lastErrOffset=-1;}_reportError(e){this.lastErrOffset!==this.posTracker.offset&&(this.lastErrOffset=this.posTracker.offset,super._reportError(e));}},Kt=class extends Gt{constructor(e,t){super(e,t);const n=gt.install(e.preprocessor,Bt,t);this.posTracker=n.posTracker;}},bt=class extends Gt{constructor(e,t){super(e,t),this.opts=t,this.ctLoc=null,this.locBeforeToken=!1;}_setErrorLocation(e){this.ctLoc&&(e.startLine=this.ctLoc.startLine,e.startCol=this.ctLoc.startCol,e.startOffset=this.ctLoc.startOffset,e.endLine=this.locBeforeToken?this.ctLoc.startLine:this.ctLoc.endLine,e.endCol=this.locBeforeToken?this.ctLoc.startCol:this.ctLoc.endCol,e.endOffset=this.locBeforeToken?this.ctLoc.startOffset:this.ctLoc.endOffset);}_getOverriddenMethods(e,t){return {_bootstrap(n,s){t._bootstrap.call(this,n,s),gt.install(this.tokenizer,Kt,e.opts),gt.install(this.tokenizer,Ht);},_processInputToken(n){e.ctLoc=n.location,t._processInputToken.call(this,n);},_err(t,n){e.locBeforeToken=n&&n.beforeToken,e._reportError(t);}}}},xt=dt((function(e,t){const{DOCUMENT_MODE:n}=Ct;t.createDocument=function(){return {nodeName:"#document",mode:n.NO_QUIRKS,childNodes:[]}},t.createDocumentFragment=function(){return {nodeName:"#document-fragment",childNodes:[]}},t.createElement=function(e,t,n){return {nodeName:e,tagName:e,attrs:n,namespaceURI:t,childNodes:[],parentNode:null}},t.createCommentNode=function(e){return {nodeName:"#comment",data:e,parentNode:null}};const s=function(e){return {nodeName:"#text",value:e,parentNode:null}},r=t.appendChild=function(e,t){e.childNodes.push(t),t.parentNode=e;},i=t.insertBefore=function(e,t,n){const s=e.childNodes.indexOf(n);e.childNodes.splice(s,0,t),t.parentNode=e;};t.setTemplateContent=function(e,t){e.content=t;},t.getTemplateContent=function(e){return e.content},t.setDocumentType=function(e,t,n,s){let i=null;for(let t=0;t<e.childNodes.length;t++)if("#documentType"===e.childNodes[t].nodeName){i=e.childNodes[t];break}i?(i.name=t,i.publicId=n,i.systemId=s):r(e,{nodeName:"#documentType",name:t,publicId:n,systemId:s});},t.setDocumentMode=function(e,t){e.mode=t;},t.getDocumentMode=function(e){return e.mode},t.detachNode=function(e){if(e.parentNode){const t=e.parentNode.childNodes.indexOf(e);e.parentNode.childNodes.splice(t,1),e.parentNode=null;}},t.insertText=function(e,t){if(e.childNodes.length){const n=e.childNodes[e.childNodes.length-1];if("#text"===n.nodeName)return void(n.value+=t)}r(e,s(t));},t.insertTextBefore=function(e,t,n){const r=e.childNodes[e.childNodes.indexOf(n)-1];r&&"#text"===r.nodeName?r.value+=t:i(e,s(t),n);},t.adoptAttributes=function(e,t){const n=[];for(let t=0;t<e.attrs.length;t++)n.push(e.attrs[t].name);for(let s=0;s<t.length;s++)-1===n.indexOf(t[s].name)&&e.attrs.push(t[s]);},t.getFirstChild=function(e){return e.childNodes[0]},t.getChildNodes=function(e){return e.childNodes},t.getParentNode=function(e){return e.parentNode},t.getAttrList=function(e){return e.attrs},t.getTagName=function(e){return e.tagName},t.getNamespaceURI=function(e){return e.namespaceURI},t.getTextNodeContent=function(e){return e.value},t.getCommentNodeContent=function(e){return e.data},t.getDocumentTypeNodeName=function(e){return e.name},t.getDocumentTypeNodePublicId=function(e){return e.publicId},t.getDocumentTypeNodeSystemId=function(e){return e.systemId},t.isTextNode=function(e){return "#text"===e.nodeName},t.isCommentNode=function(e){return "#comment"===e.nodeName},t.isDocumentTypeNode=function(e){return "#documentType"===e.nodeName},t.isElementNode=function(e){return !!e.tagName},t.setNodeSourceCodeLocation=function(e,t){e.sourceCodeLocation=t;},t.getNodeSourceCodeLocation=function(e){return e.sourceCodeLocation},t.updateNodeSourceCodeLocation=function(e,t){e.sourceCodeLocation=Object.assign(e.sourceCodeLocation,t);};}));const{DOCUMENT_MODE:yt}=Ct,vt="html",Yt=["+//silmaril//dtd html pro v0r11 19970101//","-//as//dtd html 3.0 aswedit + extensions//","-//advasoft ltd//dtd html 3.0 aswedit + extensions//","-//ietf//dtd html 2.0 level 1//","-//ietf//dtd html 2.0 level 2//","-//ietf//dtd html 2.0 strict level 1//","-//ietf//dtd html 2.0 strict level 2//","-//ietf//dtd html 2.0 strict//","-//ietf//dtd html 2.0//","-//ietf//dtd html 2.1e//","-//ietf//dtd html 3.0//","-//ietf//dtd html 3.2 final//","-//ietf//dtd html 3.2//","-//ietf//dtd html 3//","-//ietf//dtd html level 0//","-//ietf//dtd html level 1//","-//ietf//dtd html level 2//","-//ietf//dtd html level 3//","-//ietf//dtd html strict level 0//","-//ietf//dtd html strict level 1//","-//ietf//dtd html strict level 2//","-//ietf//dtd html strict level 3//","-//ietf//dtd html strict//","-//ietf//dtd html//","-//metrius//dtd metrius presentational//","-//microsoft//dtd internet explorer 2.0 html strict//","-//microsoft//dtd internet explorer 2.0 html//","-//microsoft//dtd internet explorer 2.0 tables//","-//microsoft//dtd internet explorer 3.0 html strict//","-//microsoft//dtd internet explorer 3.0 html//","-//microsoft//dtd internet explorer 3.0 tables//","-//netscape comm. corp.//dtd html//","-//netscape comm. corp.//dtd strict html//","-//o'reilly and associates//dtd html 2.0//","-//o'reilly and associates//dtd html extended 1.0//","-//o'reilly and associates//dtd html extended relaxed 1.0//","-//sq//dtd html 2.0 hotmetal + extensions//","-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//","-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//","-//spyglass//dtd html 2.0 extended//","-//sun microsystems corp.//dtd hotjava html//","-//sun microsystems corp.//dtd hotjava strict html//","-//w3c//dtd html 3 1995-03-24//","-//w3c//dtd html 3.2 draft//","-//w3c//dtd html 3.2 final//","-//w3c//dtd html 3.2//","-//w3c//dtd html 3.2s draft//","-//w3c//dtd html 4.0 frameset//","-//w3c//dtd html 4.0 transitional//","-//w3c//dtd html experimental 19960712//","-//w3c//dtd html experimental 970421//","-//w3c//dtd w3 html//","-//w3o//dtd w3 html 3.0//","-//webtechs//dtd mozilla html 2.0//","-//webtechs//dtd mozilla html//"],wt=Yt.concat(["-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"]),Qt=["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"],Xt=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],Wt=Xt.concat(["-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"]);function Vt(e,t){for(let n=0;n<t.length;n++)if(0===e.indexOf(t[n]))return !0;return !1}var jt=dt((function(e,t){const n=Ct.TAG_NAMES,s=Ct.NAMESPACES,r=Ct.ATTRS,i={attributename:"attributeName",attributetype:"attributeType",basefrequency:"baseFrequency",baseprofile:"baseProfile",calcmode:"calcMode",clippathunits:"clipPathUnits",diffuseconstant:"diffuseConstant",edgemode:"edgeMode",filterunits:"filterUnits",glyphref:"glyphRef",gradienttransform:"gradientTransform",gradientunits:"gradientUnits",kernelmatrix:"kernelMatrix",kernelunitlength:"kernelUnitLength",keypoints:"keyPoints",keysplines:"keySplines",keytimes:"keyTimes",lengthadjust:"lengthAdjust",limitingconeangle:"limitingConeAngle",markerheight:"markerHeight",markerunits:"markerUnits",markerwidth:"markerWidth",maskcontentunits:"maskContentUnits",maskunits:"maskUnits",numoctaves:"numOctaves",pathlength:"pathLength",patterncontentunits:"patternContentUnits",patterntransform:"patternTransform",patternunits:"patternUnits",pointsatx:"pointsAtX",pointsaty:"pointsAtY",pointsatz:"pointsAtZ",preservealpha:"preserveAlpha",preserveaspectratio:"preserveAspectRatio",primitiveunits:"primitiveUnits",refx:"refX",refy:"refY",repeatcount:"repeatCount",repeatdur:"repeatDur",requiredextensions:"requiredExtensions",requiredfeatures:"requiredFeatures",specularconstant:"specularConstant",specularexponent:"specularExponent",spreadmethod:"spreadMethod",startoffset:"startOffset",stddeviation:"stdDeviation",stitchtiles:"stitchTiles",surfacescale:"surfaceScale",systemlanguage:"systemLanguage",tablevalues:"tableValues",targetx:"targetX",targety:"targetY",textlength:"textLength",viewbox:"viewBox",viewtarget:"viewTarget",xchannelselector:"xChannelSelector",ychannelselector:"yChannelSelector",zoomandpan:"zoomAndPan"},o={"xlink:actuate":{prefix:"xlink",name:"actuate",namespace:s.XLINK},"xlink:arcrole":{prefix:"xlink",name:"arcrole",namespace:s.XLINK},"xlink:href":{prefix:"xlink",name:"href",namespace:s.XLINK},"xlink:role":{prefix:"xlink",name:"role",namespace:s.XLINK},"xlink:show":{prefix:"xlink",name:"show",namespace:s.XLINK},"xlink:title":{prefix:"xlink",name:"title",namespace:s.XLINK},"xlink:type":{prefix:"xlink",name:"type",namespace:s.XLINK},"xml:base":{prefix:"xml",name:"base",namespace:s.XML},"xml:lang":{prefix:"xml",name:"lang",namespace:s.XML},"xml:space":{prefix:"xml",name:"space",namespace:s.XML},xmlns:{prefix:"",name:"xmlns",namespace:s.XMLNS},"xmlns:xlink":{prefix:"xmlns",name:"xlink",namespace:s.XMLNS}},a=t.SVG_TAG_NAMES_ADJUSTMENT_MAP={altglyph:"altGlyph",altglyphdef:"altGlyphDef",altglyphitem:"altGlyphItem",animatecolor:"animateColor",animatemotion:"animateMotion",animatetransform:"animateTransform",clippath:"clipPath",feblend:"feBlend",fecolormatrix:"feColorMatrix",fecomponenttransfer:"feComponentTransfer",fecomposite:"feComposite",feconvolvematrix:"feConvolveMatrix",fediffuselighting:"feDiffuseLighting",fedisplacementmap:"feDisplacementMap",fedistantlight:"feDistantLight",feflood:"feFlood",fefunca:"feFuncA",fefuncb:"feFuncB",fefuncg:"feFuncG",fefuncr:"feFuncR",fegaussianblur:"feGaussianBlur",feimage:"feImage",femerge:"feMerge",femergenode:"feMergeNode",femorphology:"feMorphology",feoffset:"feOffset",fepointlight:"fePointLight",fespecularlighting:"feSpecularLighting",fespotlight:"feSpotLight",fetile:"feTile",feturbulence:"feTurbulence",foreignobject:"foreignObject",glyphref:"glyphRef",lineargradient:"linearGradient",radialgradient:"radialGradient",textpath:"textPath"},T={[n.B]:!0,[n.BIG]:!0,[n.BLOCKQUOTE]:!0,[n.BODY]:!0,[n.BR]:!0,[n.CENTER]:!0,[n.CODE]:!0,[n.DD]:!0,[n.DIV]:!0,[n.DL]:!0,[n.DT]:!0,[n.EM]:!0,[n.EMBED]:!0,[n.H1]:!0,[n.H2]:!0,[n.H3]:!0,[n.H4]:!0,[n.H5]:!0,[n.H6]:!0,[n.HEAD]:!0,[n.HR]:!0,[n.I]:!0,[n.IMG]:!0,[n.LI]:!0,[n.LISTING]:!0,[n.MENU]:!0,[n.META]:!0,[n.NOBR]:!0,[n.OL]:!0,[n.P]:!0,[n.PRE]:!0,[n.RUBY]:!0,[n.S]:!0,[n.SMALL]:!0,[n.SPAN]:!0,[n.STRONG]:!0,[n.STRIKE]:!0,[n.SUB]:!0,[n.SUP]:!0,[n.TABLE]:!0,[n.TT]:!0,[n.U]:!0,[n.UL]:!0,[n.VAR]:!0};t.causesExit=function(e){const t=e.tagName;return !(t!==n.FONT||null===Nt.getTokenAttr(e,r.COLOR)&&null===Nt.getTokenAttr(e,r.SIZE)&&null===Nt.getTokenAttr(e,r.FACE))||T[t]},t.adjustTokenMathMLAttrs=function(e){for(let t=0;t<e.attrs.length;t++)if("definitionurl"===e.attrs[t].name){e.attrs[t].name="definitionURL";break}},t.adjustTokenSVGAttrs=function(e){for(let t=0;t<e.attrs.length;t++){const n=i[e.attrs[t].name];n&&(e.attrs[t].name=n);}},t.adjustTokenXMLAttrs=function(e){for(let t=0;t<e.attrs.length;t++){const n=o[e.attrs[t].name];n&&(e.attrs[t].prefix=n.prefix,e.attrs[t].name=n.name,e.attrs[t].namespace=n.namespace);}},t.adjustTokenSVGTagName=function(e){const t=a[e.tagName];t&&(e.tagName=t);},t.isIntegrationPoint=function(e,t,i,o){return !(o&&o!==s.HTML||!function(e,t,i){if(t===s.MATHML&&e===n.ANNOTATION_XML)for(let e=0;e<i.length;e++)if(i[e].name===r.ENCODING){const t=i[e].value.toLowerCase();return "text/html"===t||"application/xhtml+xml"===t}return t===s.SVG&&(e===n.FOREIGN_OBJECT||e===n.DESC||e===n.TITLE)}(e,t,i))||!(o&&o!==s.MATHML||!function(e,t){return t===s.MATHML&&(e===n.MI||e===n.MO||e===n.MN||e===n.MS||e===n.MTEXT)}(e,t))};}));const zt=Ct.TAG_NAMES,qt=Ct.NAMESPACES,Jt=Ct.ATTRS,Zt={scriptingEnabled:!0,sourceCodeLocationInfo:!1,onParseError:null,treeAdapter:xt},$t="hidden",en="INITIAL_MODE",tn="BEFORE_HTML_MODE",nn="BEFORE_HEAD_MODE",sn="IN_HEAD_MODE",rn="IN_HEAD_NO_SCRIPT_MODE",on="AFTER_HEAD_MODE",an="IN_BODY_MODE",Tn="TEXT_MODE",En="IN_TABLE_MODE",hn="IN_TABLE_TEXT_MODE",cn="IN_CAPTION_MODE",_n="IN_COLUMN_GROUP_MODE",ln="IN_TABLE_BODY_MODE",mn="IN_ROW_MODE",pn="IN_CELL_MODE",An="IN_SELECT_MODE",un="IN_SELECT_IN_TABLE_MODE",Nn="IN_TEMPLATE_MODE",dn="AFTER_BODY_MODE",Cn="IN_FRAMESET_MODE",On="AFTER_FRAMESET_MODE",fn="AFTER_AFTER_BODY_MODE",Sn="AFTER_AFTER_FRAMESET_MODE",Rn={[zt.TR]:mn,[zt.TBODY]:ln,[zt.THEAD]:ln,[zt.TFOOT]:ln,[zt.CAPTION]:cn,[zt.COLGROUP]:_n,[zt.TABLE]:En,[zt.BODY]:an,[zt.FRAMESET]:Cn},In={[zt.CAPTION]:En,[zt.COLGROUP]:En,[zt.TBODY]:En,[zt.TFOOT]:En,[zt.THEAD]:En,[zt.COL]:_n,[zt.TR]:ln,[zt.TD]:mn,[zt.TH]:mn},Ln={[en]:{[Nt.CHARACTER_TOKEN]:vn,[Nt.NULL_CHARACTER_TOKEN]:vn,[Nt.WHITESPACE_CHARACTER_TOKEN]:Gn,[Nt.COMMENT_TOKEN]:Kn,[Nt.DOCTYPE_TOKEN]:function(e,t){e._setDocumentType(t);const n=t.forceQuirks?Ct.DOCUMENT_MODE.QUIRKS:function(e){if(e.name!==vt)return yt.QUIRKS;const t=e.systemId;if(t&&"http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd"===t.toLowerCase())return yt.QUIRKS;let n=e.publicId;if(null!==n){if(n=n.toLowerCase(),Qt.indexOf(n)>-1)return yt.QUIRKS;let e=null===t?wt:Yt;if(Vt(n,e))return yt.QUIRKS;if(e=null===t?Xt:Wt,Vt(n,e))return yt.LIMITED_QUIRKS}return yt.NO_QUIRKS}(t);(function(e){return e.name===vt&&null===e.publicId&&(null===e.systemId||"about:legacy-compat"===e.systemId)})(t)||e._err("non-conforming-doctype"),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=tn;},[Nt.START_TAG_TOKEN]:vn,[Nt.END_TAG_TOKEN]:vn,[Nt.EOF_TOKEN]:vn},[tn]:{[Nt.CHARACTER_TOKEN]:Yn,[Nt.NULL_CHARACTER_TOKEN]:Yn,[Nt.WHITESPACE_CHARACTER_TOKEN]:Gn,[Nt.COMMENT_TOKEN]:Kn,[Nt.DOCTYPE_TOKEN]:Gn,[Nt.START_TAG_TOKEN]:function(e,t){t.tagName===zt.HTML?(e._insertElement(t,qt.HTML),e.insertionMode=nn):Yn(e,t);},[Nt.END_TAG_TOKEN]:function(e,t){const n=t.tagName;n!==zt.HTML&&n!==zt.HEAD&&n!==zt.BODY&&n!==zt.BR||Yn(e,t);},[Nt.EOF_TOKEN]:Yn},[nn]:{[Nt.CHARACTER_TOKEN]:wn,[Nt.NULL_CHARACTER_TOKEN]:wn,[Nt.WHITESPACE_CHARACTER_TOKEN]:Gn,[Nt.COMMENT_TOKEN]:Kn,[Nt.DOCTYPE_TOKEN]:Bn,[Nt.START_TAG_TOKEN]:function(e,t){const n=t.tagName;n===zt.HTML?as(e,t):n===zt.HEAD?(e._insertElement(t,qt.HTML),e.headElement=e.openElements.current,e.insertionMode=sn):wn(e,t);},[Nt.END_TAG_TOKEN]:function(e,t){const n=t.tagName;n===zt.HEAD||n===zt.BODY||n===zt.HTML||n===zt.BR?wn(e,t):e._err(L);},[Nt.EOF_TOKEN]:wn},[sn]:{[Nt.CHARACTER_TOKEN]:Wn,[Nt.NULL_CHARACTER_TOKEN]:Wn,[Nt.WHITESPACE_CHARACTER_TOKEN]:xn,[Nt.COMMENT_TOKEN]:Kn,[Nt.DOCTYPE_TOKEN]:Bn,[Nt.START_TAG_TOKEN]:Qn,[Nt.END_TAG_TOKEN]:Xn,[Nt.EOF_TOKEN]:Wn},[rn]:{[Nt.CHARACTER_TOKEN]:Vn,[Nt.NULL_CHARACTER_TOKEN]:Vn,[Nt.WHITESPACE_CHARACTER_TOKEN]:xn,[Nt.COMMENT_TOKEN]:Kn,[Nt.DOCTYPE_TOKEN]:Bn,[Nt.START_TAG_TOKEN]:function(e,t){const n=t.tagName;n===zt.HTML?as(e,t):n===zt.BASEFONT||n===zt.BGSOUND||n===zt.HEAD||n===zt.LINK||n===zt.META||n===zt.NOFRAMES||n===zt.STYLE?Qn(e,t):n===zt.NOSCRIPT?e._err("nested-noscript-in-head"):Vn(e,t);},[Nt.END_TAG_TOKEN]:function(e,t){const n=t.tagName;n===zt.NOSCRIPT?(e.openElements.pop(),e.insertionMode=sn):n===zt.BR?Vn(e,t):e._err(L);},[Nt.EOF_TOKEN]:Vn},[on]:{[Nt.CHARACTER_TOKEN]:jn,[Nt.NULL_CHARACTER_TOKEN]:jn,[Nt.WHITESPACE_CHARACTER_TOKEN]:xn,[Nt.COMMENT_TOKEN]:Kn,[Nt.DOCTYPE_TOKEN]:Bn,[Nt.START_TAG_TOKEN]:function(e,t){const n=t.tagName;n===zt.HTML?as(e,t):n===zt.BODY?(e._insertElement(t,qt.HTML),e.framesetOk=!1,e.insertionMode=an):n===zt.FRAMESET?(e._insertElement(t,qt.HTML),e.insertionMode=Cn):n===zt.BASE||n===zt.BASEFONT||n===zt.BGSOUND||n===zt.LINK||n===zt.META||n===zt.NOFRAMES||n===zt.SCRIPT||n===zt.STYLE||n===zt.TEMPLATE||n===zt.TITLE?(e._err("abandoned-head-element-child"),e.openElements.push(e.headElement),Qn(e,t),e.openElements.remove(e.headElement)):n===zt.HEAD?e._err(k):jn(e,t);},[Nt.END_TAG_TOKEN]:function(e,t){const n=t.tagName;n===zt.BODY||n===zt.HTML||n===zt.BR?jn(e,t):n===zt.TEMPLATE?Xn(e,t):e._err(L);},[Nt.EOF_TOKEN]:jn},[an]:{[Nt.CHARACTER_TOKEN]:qn,[Nt.NULL_CHARACTER_TOKEN]:Gn,[Nt.WHITESPACE_CHARACTER_TOKEN]:zn,[Nt.COMMENT_TOKEN]:Kn,[Nt.DOCTYPE_TOKEN]:Gn,[Nt.START_TAG_TOKEN]:as,[Nt.END_TAG_TOKEN]:cs,[Nt.EOF_TOKEN]:_s},[Tn]:{[Nt.CHARACTER_TOKEN]:xn,[Nt.NULL_CHARACTER_TOKEN]:xn,[Nt.WHITESPACE_CHARACTER_TOKEN]:xn,[Nt.COMMENT_TOKEN]:Gn,[Nt.DOCTYPE_TOKEN]:Gn,[Nt.START_TAG_TOKEN]:Gn,[Nt.END_TAG_TOKEN]:function(e,t){t.tagName===zt.SCRIPT&&(e.pendingScript=e.openElements.current),e.openElements.pop(),e.insertionMode=e.originalInsertionMode;},[Nt.EOF_TOKEN]:function(e,t){e._err("eof-in-element-that-can-contain-only-text"),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e._processToken(t);}},[En]:{[Nt.CHARACTER_TOKEN]:ls,[Nt.NULL_CHARACTER_TOKEN]:ls,[Nt.WHITESPACE_CHARACTER_TOKEN]:ls,[Nt.COMMENT_TOKEN]:Kn,[Nt.DOCTYPE_TOKEN]:Gn,[Nt.START_TAG_TOKEN]:ms,[Nt.END_TAG_TOKEN]:ps,[Nt.EOF_TOKEN]:_s},[hn]:{[Nt.CHARACTER_TOKEN]:function(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0;},[Nt.NULL_CHARACTER_TOKEN]:Gn,[Nt.WHITESPACE_CHARACTER_TOKEN]:function(e,t){e.pendingCharacterTokens.push(t);},[Nt.COMMENT_TOKEN]:us,[Nt.DOCTYPE_TOKEN]:us,[Nt.START_TAG_TOKEN]:us,[Nt.END_TAG_TOKEN]:us,[Nt.EOF_TOKEN]:us},[cn]:{[Nt.CHARACTER_TOKEN]:qn,[Nt.NULL_CHARACTER_TOKEN]:Gn,[Nt.WHITESPACE_CHARACTER_TOKEN]:zn,[Nt.COMMENT_TOKEN]:Kn,[Nt.DOCTYPE_TOKEN]:Gn,[Nt.START_TAG_TOKEN]:function(e,t){const n=t.tagName;n===zt.CAPTION||n===zt.COL||n===zt.COLGROUP||n===zt.TBODY||n===zt.TD||n===zt.TFOOT||n===zt.TH||n===zt.THEAD||n===zt.TR?e.openElements.hasInTableScope(zt.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(zt.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=En,e._processToken(t)):as(e,t);},[Nt.END_TAG_TOKEN]:function(e,t){const n=t.tagName;n===zt.CAPTION||n===zt.TABLE?e.openElements.hasInTableScope(zt.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(zt.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=En,n===zt.TABLE&&e._processToken(t)):n!==zt.BODY&&n!==zt.COL&&n!==zt.COLGROUP&&n!==zt.HTML&&n!==zt.TBODY&&n!==zt.TD&&n!==zt.TFOOT&&n!==zt.TH&&n!==zt.THEAD&&n!==zt.TR&&cs(e,t);},[Nt.EOF_TOKEN]:_s},[_n]:{[Nt.CHARACTER_TOKEN]:Ns,[Nt.NULL_CHARACTER_TOKEN]:Ns,[Nt.WHITESPACE_CHARACTER_TOKEN]:xn,[Nt.COMMENT_TOKEN]:Kn,[Nt.DOCTYPE_TOKEN]:Gn,[Nt.START_TAG_TOKEN]:function(e,t){const n=t.tagName;n===zt.HTML?as(e,t):n===zt.COL?(e._appendElement(t,qt.HTML),t.ackSelfClosing=!0):n===zt.TEMPLATE?Qn(e,t):Ns(e,t);},[Nt.END_TAG_TOKEN]:function(e,t){const n=t.tagName;n===zt.COLGROUP?e.openElements.currentTagName===zt.COLGROUP&&(e.openElements.pop(),e.insertionMode=En):n===zt.TEMPLATE?Xn(e,t):n!==zt.COL&&Ns(e,t);},[Nt.EOF_TOKEN]:_s},[ln]:{[Nt.CHARACTER_TOKEN]:ls,[Nt.NULL_CHARACTER_TOKEN]:ls,[Nt.WHITESPACE_CHARACTER_TOKEN]:ls,[Nt.COMMENT_TOKEN]:Kn,[Nt.DOCTYPE_TOKEN]:Gn,[Nt.START_TAG_TOKEN]:function(e,t){const n=t.tagName;n===zt.TR?(e.openElements.clearBackToTableBodyContext(),e._insertElement(t,qt.HTML),e.insertionMode=mn):n===zt.TH||n===zt.TD?(e.openElements.clearBackToTableBodyContext(),e._insertFakeElement(zt.TR),e.insertionMode=mn,e._processToken(t)):n===zt.CAPTION||n===zt.COL||n===zt.COLGROUP||n===zt.TBODY||n===zt.TFOOT||n===zt.THEAD?e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=En,e._processToken(t)):ms(e,t);},[Nt.END_TAG_TOKEN]:function(e,t){const n=t.tagName;n===zt.TBODY||n===zt.TFOOT||n===zt.THEAD?e.openElements.hasInTableScope(n)&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=En):n===zt.TABLE?e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=En,e._processToken(t)):(n!==zt.BODY&&n!==zt.CAPTION&&n!==zt.COL&&n!==zt.COLGROUP||n!==zt.HTML&&n!==zt.TD&&n!==zt.TH&&n!==zt.TR)&&ps(e,t);},[Nt.EOF_TOKEN]:_s},[mn]:{[Nt.CHARACTER_TOKEN]:ls,[Nt.NULL_CHARACTER_TOKEN]:ls,[Nt.WHITESPACE_CHARACTER_TOKEN]:ls,[Nt.COMMENT_TOKEN]:Kn,[Nt.DOCTYPE_TOKEN]:Gn,[Nt.START_TAG_TOKEN]:function(e,t){const n=t.tagName;n===zt.TH||n===zt.TD?(e.openElements.clearBackToTableRowContext(),e._insertElement(t,qt.HTML),e.insertionMode=pn,e.activeFormattingElements.insertMarker()):n===zt.CAPTION||n===zt.COL||n===zt.COLGROUP||n===zt.TBODY||n===zt.TFOOT||n===zt.THEAD||n===zt.TR?e.openElements.hasInTableScope(zt.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=ln,e._processToken(t)):ms(e,t);},[Nt.END_TAG_TOKEN]:function(e,t){const n=t.tagName;n===zt.TR?e.openElements.hasInTableScope(zt.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=ln):n===zt.TABLE?e.openElements.hasInTableScope(zt.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=ln,e._processToken(t)):n===zt.TBODY||n===zt.TFOOT||n===zt.THEAD?(e.openElements.hasInTableScope(n)||e.openElements.hasInTableScope(zt.TR))&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=ln,e._processToken(t)):(n!==zt.BODY&&n!==zt.CAPTION&&n!==zt.COL&&n!==zt.COLGROUP||n!==zt.HTML&&n!==zt.TD&&n!==zt.TH)&&ps(e,t);},[Nt.EOF_TOKEN]:_s},[pn]:{[Nt.CHARACTER_TOKEN]:qn,[Nt.NULL_CHARACTER_TOKEN]:Gn,[Nt.WHITESPACE_CHARACTER_TOKEN]:zn,[Nt.COMMENT_TOKEN]:Kn,[Nt.DOCTYPE_TOKEN]:Gn,[Nt.START_TAG_TOKEN]:function(e,t){const n=t.tagName;n===zt.CAPTION||n===zt.COL||n===zt.COLGROUP||n===zt.TBODY||n===zt.TD||n===zt.TFOOT||n===zt.TH||n===zt.THEAD||n===zt.TR?(e.openElements.hasInTableScope(zt.TD)||e.openElements.hasInTableScope(zt.TH))&&(e._closeTableCell(),e._processToken(t)):as(e,t);},[Nt.END_TAG_TOKEN]:function(e,t){const n=t.tagName;n===zt.TD||n===zt.TH?e.openElements.hasInTableScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=mn):n===zt.TABLE||n===zt.TBODY||n===zt.TFOOT||n===zt.THEAD||n===zt.TR?e.openElements.hasInTableScope(n)&&(e._closeTableCell(),e._processToken(t)):n!==zt.BODY&&n!==zt.CAPTION&&n!==zt.COL&&n!==zt.COLGROUP&&n!==zt.HTML&&cs(e,t);},[Nt.EOF_TOKEN]:_s},[An]:{[Nt.CHARACTER_TOKEN]:xn,[Nt.NULL_CHARACTER_TOKEN]:Gn,[Nt.WHITESPACE_CHARACTER_TOKEN]:xn,[Nt.COMMENT_TOKEN]:Kn,[Nt.DOCTYPE_TOKEN]:Gn,[Nt.START_TAG_TOKEN]:ds,[Nt.END_TAG_TOKEN]:Cs,[Nt.EOF_TOKEN]:_s},[un]:{[Nt.CHARACTER_TOKEN]:xn,[Nt.NULL_CHARACTER_TOKEN]:Gn,[Nt.WHITESPACE_CHARACTER_TOKEN]:xn,[Nt.COMMENT_TOKEN]:Kn,[Nt.DOCTYPE_TOKEN]:Gn,[Nt.START_TAG_TOKEN]:function(e,t){const n=t.tagName;n===zt.CAPTION||n===zt.TABLE||n===zt.TBODY||n===zt.TFOOT||n===zt.THEAD||n===zt.TR||n===zt.TD||n===zt.TH?(e.openElements.popUntilTagNamePopped(zt.SELECT),e._resetInsertionMode(),e._processToken(t)):ds(e,t);},[Nt.END_TAG_TOKEN]:function(e,t){const n=t.tagName;n===zt.CAPTION||n===zt.TABLE||n===zt.TBODY||n===zt.TFOOT||n===zt.THEAD||n===zt.TR||n===zt.TD||n===zt.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(zt.SELECT),e._resetInsertionMode(),e._processToken(t)):Cs(e,t);},[Nt.EOF_TOKEN]:_s},[Nn]:{[Nt.CHARACTER_TOKEN]:qn,[Nt.NULL_CHARACTER_TOKEN]:Gn,[Nt.WHITESPACE_CHARACTER_TOKEN]:zn,[Nt.COMMENT_TOKEN]:Kn,[Nt.DOCTYPE_TOKEN]:Gn,[Nt.START_TAG_TOKEN]:function(e,t){const n=t.tagName;if(n===zt.BASE||n===zt.BASEFONT||n===zt.BGSOUND||n===zt.LINK||n===zt.META||n===zt.NOFRAMES||n===zt.SCRIPT||n===zt.STYLE||n===zt.TEMPLATE||n===zt.TITLE)Qn(e,t);else {const s=In[n]||an;e._popTmplInsertionMode(),e._pushTmplInsertionMode(s),e.insertionMode=s,e._processToken(t);}},[Nt.END_TAG_TOKEN]:function(e,t){t.tagName===zt.TEMPLATE&&Xn(e,t);},[Nt.EOF_TOKEN]:Os},[dn]:{[Nt.CHARACTER_TOKEN]:fs,[Nt.NULL_CHARACTER_TOKEN]:fs,[Nt.WHITESPACE_CHARACTER_TOKEN]:zn,[Nt.COMMENT_TOKEN]:function(e,t){e._appendCommentNode(t,e.openElements.items[0]);},[Nt.DOCTYPE_TOKEN]:Gn,[Nt.START_TAG_TOKEN]:function(e,t){t.tagName===zt.HTML?as(e,t):fs(e,t);},[Nt.END_TAG_TOKEN]:function(e,t){t.tagName===zt.HTML?e.fragmentContext||(e.insertionMode=fn):fs(e,t);},[Nt.EOF_TOKEN]:yn},[Cn]:{[Nt.CHARACTER_TOKEN]:Gn,[Nt.NULL_CHARACTER_TOKEN]:Gn,[Nt.WHITESPACE_CHARACTER_TOKEN]:xn,[Nt.COMMENT_TOKEN]:Kn,[Nt.DOCTYPE_TOKEN]:Gn,[Nt.START_TAG_TOKEN]:function(e,t){const n=t.tagName;n===zt.HTML?as(e,t):n===zt.FRAMESET?e._insertElement(t,qt.HTML):n===zt.FRAME?(e._appendElement(t,qt.HTML),t.ackSelfClosing=!0):n===zt.NOFRAMES&&Qn(e,t);},[Nt.END_TAG_TOKEN]:function(e,t){t.tagName!==zt.FRAMESET||e.openElements.isRootHtmlElementCurrent()||(e.openElements.pop(),e.fragmentContext||e.openElements.currentTagName===zt.FRAMESET||(e.insertionMode=On));},[Nt.EOF_TOKEN]:yn},[On]:{[Nt.CHARACTER_TOKEN]:Gn,[Nt.NULL_CHARACTER_TOKEN]:Gn,[Nt.WHITESPACE_CHARACTER_TOKEN]:xn,[Nt.COMMENT_TOKEN]:Kn,[Nt.DOCTYPE_TOKEN]:Gn,[Nt.START_TAG_TOKEN]:function(e,t){const n=t.tagName;n===zt.HTML?as(e,t):n===zt.NOFRAMES&&Qn(e,t);},[Nt.END_TAG_TOKEN]:function(e,t){t.tagName===zt.HTML&&(e.insertionMode=Sn);},[Nt.EOF_TOKEN]:yn},[fn]:{[Nt.CHARACTER_TOKEN]:Ss,[Nt.NULL_CHARACTER_TOKEN]:Ss,[Nt.WHITESPACE_CHARACTER_TOKEN]:zn,[Nt.COMMENT_TOKEN]:bn,[Nt.DOCTYPE_TOKEN]:Gn,[Nt.START_TAG_TOKEN]:function(e,t){t.tagName===zt.HTML?as(e,t):Ss(e,t);},[Nt.END_TAG_TOKEN]:Ss,[Nt.EOF_TOKEN]:yn},[Sn]:{[Nt.CHARACTER_TOKEN]:Gn,[Nt.NULL_CHARACTER_TOKEN]:Gn,[Nt.WHITESPACE_CHARACTER_TOKEN]:zn,[Nt.COMMENT_TOKEN]:bn,[Nt.DOCTYPE_TOKEN]:Gn,[Nt.START_TAG_TOKEN]:function(e,t){const n=t.tagName;n===zt.HTML?as(e,t):n===zt.NOFRAMES&&Qn(e,t);},[Nt.END_TAG_TOKEN]:Gn,[Nt.EOF_TOKEN]:yn}};var kn=class{constructor(e){this.options=function(e,t){return [e,t=t||Object.create(null)].reduce(((e,t)=>(Object.keys(t).forEach((n=>{e[n]=t[n];})),e)),Object.create(null))}(Zt,e),this.treeAdapter=this.options.treeAdapter,this.pendingScript=null,this.options.sourceCodeLocationInfo&&gt.install(this,Ut),this.options.onParseError&&gt.install(this,bt,{onParseError:this.options.onParseError});}parse(e){const t=this.treeAdapter.createDocument();return this._bootstrap(t,null),this.tokenizer.write(e,!0),this._runParsingLoop(null),t}parseFragment(e,t){t||(t=this.treeAdapter.createElement(zt.TEMPLATE,qt.HTML,[]));const n=this.treeAdapter.createElement("documentmock",qt.HTML,[]);this._bootstrap(n,t),this.treeAdapter.getTagName(t)===zt.TEMPLATE&&this._pushTmplInsertionMode(Nn),this._initTokenizerForFragmentParsing(),this._insertFakeRootElement(),this._resetInsertionMode(),this._findFormInFragmentContext(),this.tokenizer.write(e,!0),this._runParsingLoop(null);const s=this.treeAdapter.getFirstChild(n),r=this.treeAdapter.createDocumentFragment();return this._adoptNodes(s,r),r}_bootstrap(e,t){this.tokenizer=new Nt(this.options),this.stopped=!1,this.insertionMode=en,this.originalInsertionMode="",this.document=e,this.fragmentContext=t,this.headElement=null,this.formElement=null,this.openElements=new class{constructor(e,t){this.stackTop=-1,this.items=[],this.current=e,this.currentTagName=null,this.currentTmplContent=null,this.tmplCount=0,this.treeAdapter=t;}_indexOf(e){let t=-1;for(let n=this.stackTop;n>=0;n--)if(this.items[n]===e){t=n;break}return t}_isInTemplate(){return this.currentTagName===Ot.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===ft.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagName=this.current&&this.treeAdapter.getTagName(this.current),this.currentTmplContent=this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):null;}push(e){this.items[++this.stackTop]=e,this._updateCurrentElement(),this._isInTemplate()&&this.tmplCount++;}pop(){this.stackTop--,this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this._updateCurrentElement();}replace(e,t){const n=this._indexOf(e);this.items[n]=t,n===this.stackTop&&this._updateCurrentElement();}insertAfter(e,t){const n=this._indexOf(e)+1;this.items.splice(n,0,t),n===++this.stackTop&&this._updateCurrentElement();}popUntilTagNamePopped(e){for(;this.stackTop>-1;){const t=this.currentTagName,n=this.treeAdapter.getNamespaceURI(this.current);if(this.pop(),t===e&&n===ft.HTML)break}}popUntilElementPopped(e){for(;this.stackTop>-1;){const t=this.current;if(this.pop(),t===e)break}}popUntilNumberedHeaderPopped(){for(;this.stackTop>-1;){const e=this.currentTagName,t=this.treeAdapter.getNamespaceURI(this.current);if(this.pop(),e===Ot.H1||e===Ot.H2||e===Ot.H3||e===Ot.H4||e===Ot.H5||e===Ot.H6&&t===ft.HTML)break}}popUntilTableCellPopped(){for(;this.stackTop>-1;){const e=this.currentTagName,t=this.treeAdapter.getNamespaceURI(this.current);if(this.pop(),e===Ot.TD||e===Ot.TH&&t===ft.HTML)break}}popAllUpToHtmlElement(){this.stackTop=0,this._updateCurrentElement();}clearBackToTableContext(){for(;this.currentTagName!==Ot.TABLE&&this.currentTagName!==Ot.TEMPLATE&&this.currentTagName!==Ot.HTML||this.treeAdapter.getNamespaceURI(this.current)!==ft.HTML;)this.pop();}clearBackToTableBodyContext(){for(;this.currentTagName!==Ot.TBODY&&this.currentTagName!==Ot.TFOOT&&this.currentTagName!==Ot.THEAD&&this.currentTagName!==Ot.TEMPLATE&&this.currentTagName!==Ot.HTML||this.treeAdapter.getNamespaceURI(this.current)!==ft.HTML;)this.pop();}clearBackToTableRowContext(){for(;this.currentTagName!==Ot.TR&&this.currentTagName!==Ot.TEMPLATE&&this.currentTagName!==Ot.HTML||this.treeAdapter.getNamespaceURI(this.current)!==ft.HTML;)this.pop();}remove(e){for(let t=this.stackTop;t>=0;t--)if(this.items[t]===e){this.items.splice(t,1),this.stackTop--,this._updateCurrentElement();break}}tryPeekProperlyNestedBodyElement(){const e=this.items[1];return e&&this.treeAdapter.getTagName(e)===Ot.BODY?e:null}contains(e){return this._indexOf(e)>-1}getCommonAncestor(e){let t=this._indexOf(e);return --t>=0?this.items[t]:null}isRootHtmlElementCurrent(){return 0===this.stackTop&&this.currentTagName===Ot.HTML}hasInScope(e){for(let t=this.stackTop;t>=0;t--){const n=this.treeAdapter.getTagName(this.items[t]),s=this.treeAdapter.getNamespaceURI(this.items[t]);if(n===e&&s===ft.HTML)return !0;if(It(n,s))return !1}return !0}hasNumberedHeaderInScope(){for(let e=this.stackTop;e>=0;e--){const t=this.treeAdapter.getTagName(this.items[e]),n=this.treeAdapter.getNamespaceURI(this.items[e]);if((t===Ot.H1||t===Ot.H2||t===Ot.H3||t===Ot.H4||t===Ot.H5||t===Ot.H6)&&n===ft.HTML)return !0;if(It(t,n))return !1}return !0}hasInListItemScope(e){for(let t=this.stackTop;t>=0;t--){const n=this.treeAdapter.getTagName(this.items[t]),s=this.treeAdapter.getNamespaceURI(this.items[t]);if(n===e&&s===ft.HTML)return !0;if((n===Ot.UL||n===Ot.OL)&&s===ft.HTML||It(n,s))return !1}return !0}hasInButtonScope(e){for(let t=this.stackTop;t>=0;t--){const n=this.treeAdapter.getTagName(this.items[t]),s=this.treeAdapter.getNamespaceURI(this.items[t]);if(n===e&&s===ft.HTML)return !0;if(n===Ot.BUTTON&&s===ft.HTML||It(n,s))return !1}return !0}hasInTableScope(e){for(let t=this.stackTop;t>=0;t--){const n=this.treeAdapter.getTagName(this.items[t]);if(this.treeAdapter.getNamespaceURI(this.items[t])===ft.HTML){if(n===e)return !0;if(n===Ot.TABLE||n===Ot.TEMPLATE||n===Ot.HTML)return !1}}return !0}hasTableBodyContextInTableScope(){for(let e=this.stackTop;e>=0;e--){const t=this.treeAdapter.getTagName(this.items[e]);if(this.treeAdapter.getNamespaceURI(this.items[e])===ft.HTML){if(t===Ot.TBODY||t===Ot.THEAD||t===Ot.TFOOT)return !0;if(t===Ot.TABLE||t===Ot.HTML)return !1}}return !0}hasInSelectScope(e){for(let t=this.stackTop;t>=0;t--){const n=this.treeAdapter.getTagName(this.items[t]);if(this.treeAdapter.getNamespaceURI(this.items[t])===ft.HTML){if(n===e)return !0;if(n!==Ot.OPTION&&n!==Ot.OPTGROUP)return !1}}return !0}generateImpliedEndTags(){for(;St(this.currentTagName);)this.pop();}generateImpliedEndTagsThoroughly(){for(;Rt(this.currentTagName);)this.pop();}generateImpliedEndTagsWithExclusion(e){for(;St(this.currentTagName)&&this.currentTagName!==e;)this.pop();}}(this.document,this.treeAdapter),this.activeFormattingElements=new kt(this.treeAdapter),this.tmplInsertionModeStack=[],this.tmplInsertionModeStackTop=-1,this.currentTmplInsertionMode=null,this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1;}_err(){}_runParsingLoop(e){for(;!this.stopped;){this._setupTokenizerCDATAMode();const t=this.tokenizer.getNextToken();if(t.type===Nt.HIBERNATION_TOKEN)break;if(this.skipNextNewLine&&(this.skipNextNewLine=!1,t.type===Nt.WHITESPACE_CHARACTER_TOKEN&&"\n"===t.chars[0])){if(1===t.chars.length)continue;t.chars=t.chars.substr(1);}if(this._processInputToken(t),e&&this.pendingScript)break}}runParsingLoopForCurrentChunk(e,t){if(this._runParsingLoop(t),t&&this.pendingScript){const e=this.pendingScript;return this.pendingScript=null,void t(e)}e&&e();}_setupTokenizerCDATAMode(){const e=this._getAdjustedCurrentElement();this.tokenizer.allowCDATA=e&&e!==this.document&&this.treeAdapter.getNamespaceURI(e)!==qt.HTML&&!this._isIntegrationPoint(e);}_switchToTextParsing(e,t){this._insertElement(e,qt.HTML),this.tokenizer.state=t,this.originalInsertionMode=this.insertionMode,this.insertionMode=Tn;}switchToPlaintextParsing(){this.insertionMode=Tn,this.originalInsertionMode=an,this.tokenizer.state=Nt.MODE.PLAINTEXT;}_getAdjustedCurrentElement(){return 0===this.openElements.stackTop&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let e=this.fragmentContext;do{if(this.treeAdapter.getTagName(e)===zt.FORM){this.formElement=e;break}e=this.treeAdapter.getParentNode(e);}while(e)}_initTokenizerForFragmentParsing(){if(this.treeAdapter.getNamespaceURI(this.fragmentContext)===qt.HTML){const e=this.treeAdapter.getTagName(this.fragmentContext);e===zt.TITLE||e===zt.TEXTAREA?this.tokenizer.state=Nt.MODE.RCDATA:e===zt.STYLE||e===zt.XMP||e===zt.IFRAME||e===zt.NOEMBED||e===zt.NOFRAMES||e===zt.NOSCRIPT?this.tokenizer.state=Nt.MODE.RAWTEXT:e===zt.SCRIPT?this.tokenizer.state=Nt.MODE.SCRIPT_DATA:e===zt.PLAINTEXT&&(this.tokenizer.state=Nt.MODE.PLAINTEXT);}}_setDocumentType(e){const t=e.name||"",n=e.publicId||"",s=e.systemId||"";this.treeAdapter.setDocumentType(this.document,t,n,s);}_attachElementToTree(e){if(this._shouldFosterParentOnInsertion())this._fosterParentElement(e);else {const t=this.openElements.currentTmplContent||this.openElements.current;this.treeAdapter.appendChild(t,e);}}_appendElement(e,t){const n=this.treeAdapter.createElement(e.tagName,t,e.attrs);this._attachElementToTree(n);}_insertElement(e,t){const n=this.treeAdapter.createElement(e.tagName,t,e.attrs);this._attachElementToTree(n),this.openElements.push(n);}_insertFakeElement(e){const t=this.treeAdapter.createElement(e,qt.HTML,[]);this._attachElementToTree(t),this.openElements.push(t);}_insertTemplate(e){const t=this.treeAdapter.createElement(e.tagName,qt.HTML,e.attrs),n=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(t,n),this._attachElementToTree(t),this.openElements.push(t);}_insertFakeRootElement(){const e=this.treeAdapter.createElement(zt.HTML,qt.HTML,[]);this.treeAdapter.appendChild(this.openElements.current,e),this.openElements.push(e);}_appendCommentNode(e,t){const n=this.treeAdapter.createCommentNode(e.data);this.treeAdapter.appendChild(t,n);}_insertCharacters(e){if(this._shouldFosterParentOnInsertion())this._fosterParentText(e.chars);else {const t=this.openElements.currentTmplContent||this.openElements.current;this.treeAdapter.insertText(t,e.chars);}}_adoptNodes(e,t){for(let n=this.treeAdapter.getFirstChild(e);n;n=this.treeAdapter.getFirstChild(e))this.treeAdapter.detachNode(n),this.treeAdapter.appendChild(t,n);}_shouldProcessTokenInForeignContent(e){const t=this._getAdjustedCurrentElement();if(!t||t===this.document)return !1;const n=this.treeAdapter.getNamespaceURI(t);if(n===qt.HTML)return !1;if(this.treeAdapter.getTagName(t)===zt.ANNOTATION_XML&&n===qt.MATHML&&e.type===Nt.START_TAG_TOKEN&&e.tagName===zt.SVG)return !1;const s=e.type===Nt.CHARACTER_TOKEN||e.type===Nt.NULL_CHARACTER_TOKEN||e.type===Nt.WHITESPACE_CHARACTER_TOKEN;return !((e.type===Nt.START_TAG_TOKEN&&e.tagName!==zt.MGLYPH&&e.tagName!==zt.MALIGNMARK||s)&&this._isIntegrationPoint(t,qt.MATHML)||(e.type===Nt.START_TAG_TOKEN||s)&&this._isIntegrationPoint(t,qt.HTML)||e.type===Nt.EOF_TOKEN)}_processToken(e){Ln[this.insertionMode][e.type](this,e);}_processTokenInBodyMode(e){Ln.IN_BODY_MODE[e.type](this,e);}_processTokenInForeignContent(e){e.type===Nt.CHARACTER_TOKEN?function(e,t){e._insertCharacters(t),e.framesetOk=!1;}(this,e):e.type===Nt.NULL_CHARACTER_TOKEN?function(e,t){t.chars=n,e._insertCharacters(t);}(this,e):e.type===Nt.WHITESPACE_CHARACTER_TOKEN?xn(this,e):e.type===Nt.COMMENT_TOKEN?Kn(this,e):e.type===Nt.START_TAG_TOKEN?function(e,t){if(jt.causesExit(t)&&!e.fragmentContext){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==qt.HTML&&!e._isIntegrationPoint(e.openElements.current);)e.openElements.pop();e._processToken(t);}else {const n=e._getAdjustedCurrentElement(),s=e.treeAdapter.getNamespaceURI(n);s===qt.MATHML?jt.adjustTokenMathMLAttrs(t):s===qt.SVG&&(jt.adjustTokenSVGTagName(t),jt.adjustTokenSVGAttrs(t)),jt.adjustTokenXMLAttrs(t),t.selfClosing?e._appendElement(t,s):e._insertElement(t,s),t.ackSelfClosing=!0;}}(this,e):e.type===Nt.END_TAG_TOKEN&&function(e,t){for(let n=e.openElements.stackTop;n>0;n--){const s=e.openElements.items[n];if(e.treeAdapter.getNamespaceURI(s)===qt.HTML){e._processToken(t);break}if(e.treeAdapter.getTagName(s).toLowerCase()===t.tagName){e.openElements.popUntilElementPopped(s);break}}}(this,e);}_processInputToken(e){this._shouldProcessTokenInForeignContent(e)?this._processTokenInForeignContent(e):this._processToken(e),e.type===Nt.START_TAG_TOKEN&&e.selfClosing&&!e.ackSelfClosing&&this._err("non-void-html-element-start-tag-with-trailing-solidus");}_isIntegrationPoint(e,t){const n=this.treeAdapter.getTagName(e),s=this.treeAdapter.getNamespaceURI(e),r=this.treeAdapter.getAttrList(e);return jt.isIntegrationPoint(n,s,r,t)}_reconstructActiveFormattingElements(){const e=this.activeFormattingElements.length;if(e){let t=e,n=null;do{if(t--,n=this.activeFormattingElements.entries[t],n.type===kt.MARKER_ENTRY||this.openElements.contains(n.element)){t++;break}}while(t>0);for(let s=t;s<e;s++)n=this.activeFormattingElements.entries[s],this._insertElement(n.token,this.treeAdapter.getNamespaceURI(n.element)),n.element=this.openElements.current;}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=mn;}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(zt.P),this.openElements.popUntilTagNamePopped(zt.P);}_resetInsertionMode(){for(let e=this.openElements.stackTop,t=!1;e>=0;e--){let n=this.openElements.items[e];0===e&&(t=!0,this.fragmentContext&&(n=this.fragmentContext));const s=this.treeAdapter.getTagName(n),r=Rn[s];if(r){this.insertionMode=r;break}if(!(t||s!==zt.TD&&s!==zt.TH)){this.insertionMode=pn;break}if(!t&&s===zt.HEAD){this.insertionMode=sn;break}if(s===zt.SELECT){this._resetInsertionModeForSelect(e);break}if(s===zt.TEMPLATE){this.insertionMode=this.currentTmplInsertionMode;break}if(s===zt.HTML){this.insertionMode=this.headElement?on:nn;break}if(t){this.insertionMode=an;break}}}_resetInsertionModeForSelect(e){if(e>0)for(let t=e-1;t>0;t--){const e=this.openElements.items[t],n=this.treeAdapter.getTagName(e);if(n===zt.TEMPLATE)break;if(n===zt.TABLE)return void(this.insertionMode=un)}this.insertionMode=An;}_pushTmplInsertionMode(e){this.tmplInsertionModeStack.push(e),this.tmplInsertionModeStackTop++,this.currentTmplInsertionMode=e;}_popTmplInsertionMode(){this.tmplInsertionModeStack.pop(),this.tmplInsertionModeStackTop--,this.currentTmplInsertionMode=this.tmplInsertionModeStack[this.tmplInsertionModeStackTop];}_isElementCausesFosterParenting(e){const t=this.treeAdapter.getTagName(e);return t===zt.TABLE||t===zt.TBODY||t===zt.TFOOT||t===zt.THEAD||t===zt.TR}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this._isElementCausesFosterParenting(this.openElements.current)}_findFosterParentingLocation(){const e={parent:null,beforeElement:null};for(let t=this.openElements.stackTop;t>=0;t--){const n=this.openElements.items[t],s=this.treeAdapter.getTagName(n),r=this.treeAdapter.getNamespaceURI(n);if(s===zt.TEMPLATE&&r===qt.HTML){e.parent=this.treeAdapter.getTemplateContent(n);break}if(s===zt.TABLE){e.parent=this.treeAdapter.getParentNode(n),e.parent?e.beforeElement=n:e.parent=this.openElements.items[t-1];break}}return e.parent||(e.parent=this.openElements.items[0]),e}_fosterParentElement(e){const t=this._findFosterParentingLocation();t.beforeElement?this.treeAdapter.insertBefore(t.parent,e,t.beforeElement):this.treeAdapter.appendChild(t.parent,e);}_fosterParentText(e){const t=this._findFosterParentingLocation();t.beforeElement?this.treeAdapter.insertTextBefore(t.parent,e,t.beforeElement):this.treeAdapter.insertText(t.parent,e);}_isSpecialElement(e){const t=this.treeAdapter.getTagName(e),n=this.treeAdapter.getNamespaceURI(e);return Ct.SPECIAL_ELEMENTS[n][t]}};function Mn(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(t.tagName);return n?e.openElements.contains(n.element)?e.openElements.hasInScope(t.tagName)||(n=null):(e.activeFormattingElements.removeEntry(n),n=null):hs(e,t),n}function gn(e,t){let n=null;for(let s=e.openElements.stackTop;s>=0;s--){const r=e.openElements.items[s];if(r===t.element)break;e._isSpecialElement(r)&&(n=r);}return n||(e.openElements.popUntilElementPopped(t.element),e.activeFormattingElements.removeEntry(t)),n}function Pn(e,t,n){let s=t,r=e.openElements.getCommonAncestor(t);for(let i=0,o=r;o!==n;i++,o=r){r=e.openElements.getCommonAncestor(o);const n=e.activeFormattingElements.getElementEntry(o),a=n&&i>=3;!n||a?(a&&e.activeFormattingElements.removeEntry(n),e.openElements.remove(o)):(o=Hn(e,n),s===t&&(e.activeFormattingElements.bookmark=n),e.treeAdapter.detachNode(s),e.treeAdapter.appendChild(o,s),s=o);}return s}function Hn(e,t){const n=e.treeAdapter.getNamespaceURI(t.element),s=e.treeAdapter.createElement(t.token.tagName,n,t.token.attrs);return e.openElements.replace(t.element,s),t.element=s,s}function Dn(e,t,n){if(e._isElementCausesFosterParenting(t))e._fosterParentElement(n);else {const s=e.treeAdapter.getTagName(t),r=e.treeAdapter.getNamespaceURI(t);s===zt.TEMPLATE&&r===qt.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n);}}function Fn(e,t,n){const s=e.treeAdapter.getNamespaceURI(n.element),r=n.token,i=e.treeAdapter.createElement(r.tagName,s,r.attrs);e._adoptNodes(t,i),e.treeAdapter.appendChild(t,i),e.activeFormattingElements.insertElementAfterBookmark(i,n.token),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,i);}function Un(e,t){let n;for(let s=0;s<8&&(n=Mn(e,t),n);s++){const t=gn(e,n);if(!t)break;e.activeFormattingElements.bookmark=n;const s=Pn(e,t,n.element),r=e.openElements.getCommonAncestor(n.element);e.treeAdapter.detachNode(s),Dn(e,r,s),Fn(e,t,n);}}function Gn(){}function Bn(e){e._err("misplaced-doctype");}function Kn(e,t){e._appendCommentNode(t,e.openElements.currentTmplContent||e.openElements.current);}function bn(e,t){e._appendCommentNode(t,e.document);}function xn(e,t){e._insertCharacters(t);}function yn(e){e.stopped=!0;}function vn(e,t){e._err("missing-doctype",{beforeToken:!0}),e.treeAdapter.setDocumentMode(e.document,Ct.DOCUMENT_MODE.QUIRKS),e.insertionMode=tn,e._processToken(t);}function Yn(e,t){e._insertFakeRootElement(),e.insertionMode=nn,e._processToken(t);}function wn(e,t){e._insertFakeElement(zt.HEAD),e.headElement=e.openElements.current,e.insertionMode=sn,e._processToken(t);}function Qn(e,t){const n=t.tagName;n===zt.HTML?as(e,t):n===zt.BASE||n===zt.BASEFONT||n===zt.BGSOUND||n===zt.LINK||n===zt.META?(e._appendElement(t,qt.HTML),t.ackSelfClosing=!0):n===zt.TITLE?e._switchToTextParsing(t,Nt.MODE.RCDATA):n===zt.NOSCRIPT?e.options.scriptingEnabled?e._switchToTextParsing(t,Nt.MODE.RAWTEXT):(e._insertElement(t,qt.HTML),e.insertionMode=rn):n===zt.NOFRAMES||n===zt.STYLE?e._switchToTextParsing(t,Nt.MODE.RAWTEXT):n===zt.SCRIPT?e._switchToTextParsing(t,Nt.MODE.SCRIPT_DATA):n===zt.TEMPLATE?(e._insertTemplate(t,qt.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=Nn,e._pushTmplInsertionMode(Nn)):n===zt.HEAD?e._err(k):Wn(e,t);}function Xn(e,t){const n=t.tagName;n===zt.HEAD?(e.openElements.pop(),e.insertionMode=on):n===zt.BODY||n===zt.BR||n===zt.HTML?Wn(e,t):n===zt.TEMPLATE&&e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagName!==zt.TEMPLATE&&e._err("closing-of-element-with-open-child-elements"),e.openElements.popUntilTagNamePopped(zt.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e._popTmplInsertionMode(),e._resetInsertionMode()):e._err(L);}function Wn(e,t){e.openElements.pop(),e.insertionMode=on,e._processToken(t);}function Vn(e,t){const n=t.type===Nt.EOF_TOKEN?"open-elements-left-after-eof":"disallowed-content-in-noscript-in-head";e._err(n),e.openElements.pop(),e.insertionMode=sn,e._processToken(t);}function jn(e,t){e._insertFakeElement(zt.BODY),e.insertionMode=an,e._processToken(t);}function zn(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t);}function qn(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1;}function Jn(e,t){e.openElements.hasInButtonScope(zt.P)&&e._closePElement(),e._insertElement(t,qt.HTML);}function Zn(e,t){e.openElements.hasInButtonScope(zt.P)&&e._closePElement(),e._insertElement(t,qt.HTML),e.skipNextNewLine=!0,e.framesetOk=!1;}function $n(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,qt.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t);}function es(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,qt.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1;}function ts(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,qt.HTML),e.framesetOk=!1,t.ackSelfClosing=!0;}function ns(e,t){e._appendElement(t,qt.HTML),t.ackSelfClosing=!0;}function ss(e,t){e._switchToTextParsing(t,Nt.MODE.RAWTEXT);}function rs(e,t){e.openElements.currentTagName===zt.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,qt.HTML);}function is(e,t){e.openElements.hasInScope(zt.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,qt.HTML);}function os(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,qt.HTML);}function as(e,t){const n=t.tagName;switch(n.length){case 1:n===zt.I||n===zt.S||n===zt.B||n===zt.U?$n(e,t):n===zt.P?Jn(e,t):n===zt.A?function(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(zt.A);n&&(Un(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,qt.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t);}(e,t):os(e,t);break;case 2:n===zt.DL||n===zt.OL||n===zt.UL?Jn(e,t):n===zt.H1||n===zt.H2||n===zt.H3||n===zt.H4||n===zt.H5||n===zt.H6?function(e,t){e.openElements.hasInButtonScope(zt.P)&&e._closePElement();const n=e.openElements.currentTagName;n!==zt.H1&&n!==zt.H2&&n!==zt.H3&&n!==zt.H4&&n!==zt.H5&&n!==zt.H6||e.openElements.pop(),e._insertElement(t,qt.HTML);}(e,t):n===zt.LI||n===zt.DD||n===zt.DT?function(e,t){e.framesetOk=!1;const n=t.tagName;for(let t=e.openElements.stackTop;t>=0;t--){const s=e.openElements.items[t],r=e.treeAdapter.getTagName(s);let i=null;if(n===zt.LI&&r===zt.LI?i=zt.LI:n!==zt.DD&&n!==zt.DT||r!==zt.DD&&r!==zt.DT||(i=r),i){e.openElements.generateImpliedEndTagsWithExclusion(i),e.openElements.popUntilTagNamePopped(i);break}if(r!==zt.ADDRESS&&r!==zt.DIV&&r!==zt.P&&e._isSpecialElement(s))break}e.openElements.hasInButtonScope(zt.P)&&e._closePElement(),e._insertElement(t,qt.HTML);}(e,t):n===zt.EM||n===zt.TT?$n(e,t):n===zt.BR?ts(e,t):n===zt.HR?function(e,t){e.openElements.hasInButtonScope(zt.P)&&e._closePElement(),e._appendElement(t,qt.HTML),e.framesetOk=!1,t.ackSelfClosing=!0;}(e,t):n===zt.RB?is(e,t):n===zt.RT||n===zt.RP?function(e,t){e.openElements.hasInScope(zt.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(zt.RTC),e._insertElement(t,qt.HTML);}(e,t):n!==zt.TH&&n!==zt.TD&&n!==zt.TR&&os(e,t);break;case 3:n===zt.DIV||n===zt.DIR||n===zt.NAV?Jn(e,t):n===zt.PRE?Zn(e,t):n===zt.BIG?$n(e,t):n===zt.IMG||n===zt.WBR?ts(e,t):n===zt.XMP?function(e,t){e.openElements.hasInButtonScope(zt.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,Nt.MODE.RAWTEXT);}(e,t):n===zt.SVG?function(e,t){e._reconstructActiveFormattingElements(),jt.adjustTokenSVGAttrs(t),jt.adjustTokenXMLAttrs(t),t.selfClosing?e._appendElement(t,qt.SVG):e._insertElement(t,qt.SVG),t.ackSelfClosing=!0;}(e,t):n===zt.RTC?is(e,t):n!==zt.COL&&os(e,t);break;case 4:n===zt.HTML?function(e,t){0===e.openElements.tmplCount&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs);}(e,t):n===zt.BASE||n===zt.LINK||n===zt.META?Qn(e,t):n===zt.BODY?function(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&0===e.openElements.tmplCount&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs));}(e,t):n===zt.MAIN||n===zt.MENU?Jn(e,t):n===zt.FORM?function(e,t){const n=e.openElements.tmplCount>0;e.formElement&&!n||(e.openElements.hasInButtonScope(zt.P)&&e._closePElement(),e._insertElement(t,qt.HTML),n||(e.formElement=e.openElements.current));}(e,t):n===zt.CODE||n===zt.FONT?$n(e,t):n===zt.NOBR?function(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(zt.NOBR)&&(Un(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,qt.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t);}(e,t):n===zt.AREA?ts(e,t):n===zt.MATH?function(e,t){e._reconstructActiveFormattingElements(),jt.adjustTokenMathMLAttrs(t),jt.adjustTokenXMLAttrs(t),t.selfClosing?e._appendElement(t,qt.MATHML):e._insertElement(t,qt.MATHML),t.ackSelfClosing=!0;}(e,t):n===zt.MENU?function(e,t){e.openElements.hasInButtonScope(zt.P)&&e._closePElement(),e._insertElement(t,qt.HTML);}(e,t):n!==zt.HEAD&&os(e,t);break;case 5:n===zt.STYLE||n===zt.TITLE?Qn(e,t):n===zt.ASIDE?Jn(e,t):n===zt.SMALL?$n(e,t):n===zt.TABLE?function(e,t){e.treeAdapter.getDocumentMode(e.document)!==Ct.DOCUMENT_MODE.QUIRKS&&e.openElements.hasInButtonScope(zt.P)&&e._closePElement(),e._insertElement(t,qt.HTML),e.framesetOk=!1,e.insertionMode=En;}(e,t):n===zt.EMBED?ts(e,t):n===zt.INPUT?function(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,qt.HTML);const n=Nt.getTokenAttr(t,Jt.TYPE);n&&n.toLowerCase()===$t||(e.framesetOk=!1),t.ackSelfClosing=!0;}(e,t):n===zt.PARAM||n===zt.TRACK?ns(e,t):n===zt.IMAGE?function(e,t){t.tagName=zt.IMG,ts(e,t);}(e,t):n!==zt.FRAME&&n!==zt.TBODY&&n!==zt.TFOOT&&n!==zt.THEAD&&os(e,t);break;case 6:n===zt.SCRIPT?Qn(e,t):n===zt.CENTER||n===zt.FIGURE||n===zt.FOOTER||n===zt.HEADER||n===zt.HGROUP||n===zt.DIALOG?Jn(e,t):n===zt.BUTTON?function(e,t){e.openElements.hasInScope(zt.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(zt.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,qt.HTML),e.framesetOk=!1;}(e,t):n===zt.STRIKE||n===zt.STRONG?$n(e,t):n===zt.APPLET||n===zt.OBJECT?es(e,t):n===zt.KEYGEN?ts(e,t):n===zt.SOURCE?ns(e,t):n===zt.IFRAME?function(e,t){e.framesetOk=!1,e._switchToTextParsing(t,Nt.MODE.RAWTEXT);}(e,t):n===zt.SELECT?function(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,qt.HTML),e.framesetOk=!1,e.insertionMode===En||e.insertionMode===cn||e.insertionMode===ln||e.insertionMode===mn||e.insertionMode===pn?e.insertionMode=un:e.insertionMode=An;}(e,t):n===zt.OPTION?rs(e,t):os(e,t);break;case 7:n===zt.BGSOUND?Qn(e,t):n===zt.DETAILS||n===zt.ADDRESS||n===zt.ARTICLE||n===zt.SECTION||n===zt.SUMMARY?Jn(e,t):n===zt.LISTING?Zn(e,t):n===zt.MARQUEE?es(e,t):n===zt.NOEMBED?ss(e,t):n!==zt.CAPTION&&os(e,t);break;case 8:n===zt.BASEFONT?Qn(e,t):n===zt.FRAMESET?function(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,qt.HTML),e.insertionMode=Cn);}(e,t):n===zt.FIELDSET?Jn(e,t):n===zt.TEXTAREA?function(e,t){e._insertElement(t,qt.HTML),e.skipNextNewLine=!0,e.tokenizer.state=Nt.MODE.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=Tn;}(e,t):n===zt.TEMPLATE?Qn(e,t):n===zt.NOSCRIPT?e.options.scriptingEnabled?ss(e,t):os(e,t):n===zt.OPTGROUP?rs(e,t):n!==zt.COLGROUP&&os(e,t);break;case 9:n===zt.PLAINTEXT?function(e,t){e.openElements.hasInButtonScope(zt.P)&&e._closePElement(),e._insertElement(t,qt.HTML),e.tokenizer.state=Nt.MODE.PLAINTEXT;}(e,t):os(e,t);break;case 10:n===zt.BLOCKQUOTE||n===zt.FIGCAPTION?Jn(e,t):os(e,t);break;default:os(e,t);}}function Ts(e,t){const n=t.tagName;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n));}function Es(e,t){const n=t.tagName;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker());}function hs(e,t){const n=t.tagName;for(let t=e.openElements.stackTop;t>0;t--){const s=e.openElements.items[t];if(e.treeAdapter.getTagName(s)===n){e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilElementPopped(s);break}if(e._isSpecialElement(s))break}}function cs(e,t){const n=t.tagName;switch(n.length){case 1:n===zt.A||n===zt.B||n===zt.I||n===zt.S||n===zt.U?Un(e,t):n===zt.P?function(e){e.openElements.hasInButtonScope(zt.P)||e._insertFakeElement(zt.P),e._closePElement();}(e):hs(e,t);break;case 2:n===zt.DL||n===zt.UL||n===zt.OL?Ts(e,t):n===zt.LI?function(e){e.openElements.hasInListItemScope(zt.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(zt.LI),e.openElements.popUntilTagNamePopped(zt.LI));}(e):n===zt.DD||n===zt.DT?function(e,t){const n=t.tagName;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n));}(e,t):n===zt.H1||n===zt.H2||n===zt.H3||n===zt.H4||n===zt.H5||n===zt.H6?function(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped());}(e):n===zt.BR?function(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(zt.BR),e.openElements.pop(),e.framesetOk=!1;}(e):n===zt.EM||n===zt.TT?Un(e,t):hs(e,t);break;case 3:n===zt.BIG?Un(e,t):n===zt.DIR||n===zt.DIV||n===zt.NAV||n===zt.PRE?Ts(e,t):hs(e,t);break;case 4:n===zt.BODY?function(e){e.openElements.hasInScope(zt.BODY)&&(e.insertionMode=dn);}(e):n===zt.HTML?function(e,t){e.openElements.hasInScope(zt.BODY)&&(e.insertionMode=dn,e._processToken(t));}(e,t):n===zt.FORM?function(e){const t=e.openElements.tmplCount>0,n=e.formElement;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(zt.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(zt.FORM):e.openElements.remove(n));}(e):n===zt.CODE||n===zt.FONT||n===zt.NOBR?Un(e,t):n===zt.MAIN||n===zt.MENU?Ts(e,t):hs(e,t);break;case 5:n===zt.ASIDE?Ts(e,t):n===zt.SMALL?Un(e,t):hs(e,t);break;case 6:n===zt.CENTER||n===zt.FIGURE||n===zt.FOOTER||n===zt.HEADER||n===zt.HGROUP||n===zt.DIALOG?Ts(e,t):n===zt.APPLET||n===zt.OBJECT?Es(e,t):n===zt.STRIKE||n===zt.STRONG?Un(e,t):hs(e,t);break;case 7:n===zt.ADDRESS||n===zt.ARTICLE||n===zt.DETAILS||n===zt.SECTION||n===zt.SUMMARY||n===zt.LISTING?Ts(e,t):n===zt.MARQUEE?Es(e,t):hs(e,t);break;case 8:n===zt.FIELDSET?Ts(e,t):n===zt.TEMPLATE?Xn(e,t):hs(e,t);break;case 10:n===zt.BLOCKQUOTE||n===zt.FIGCAPTION?Ts(e,t):hs(e,t);break;default:hs(e,t);}}function _s(e,t){e.tmplInsertionModeStackTop>-1?Os(e,t):e.stopped=!0;}function ls(e,t){const n=e.openElements.currentTagName;n===zt.TABLE||n===zt.TBODY||n===zt.TFOOT||n===zt.THEAD||n===zt.TR?(e.pendingCharacterTokens=[],e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=hn,e._processToken(t)):As(e,t);}function ms(e,t){const n=t.tagName;switch(n.length){case 2:n===zt.TD||n===zt.TH||n===zt.TR?function(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(zt.TBODY),e.insertionMode=ln,e._processToken(t);}(e,t):As(e,t);break;case 3:n===zt.COL?function(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(zt.COLGROUP),e.insertionMode=_n,e._processToken(t);}(e,t):As(e,t);break;case 4:n===zt.FORM?function(e,t){e.formElement||0!==e.openElements.tmplCount||(e._insertElement(t,qt.HTML),e.formElement=e.openElements.current,e.openElements.pop());}(e,t):As(e,t);break;case 5:n===zt.TABLE?function(e,t){e.openElements.hasInTableScope(zt.TABLE)&&(e.openElements.popUntilTagNamePopped(zt.TABLE),e._resetInsertionMode(),e._processToken(t));}(e,t):n===zt.STYLE?Qn(e,t):n===zt.TBODY||n===zt.TFOOT||n===zt.THEAD?function(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,qt.HTML),e.insertionMode=ln;}(e,t):n===zt.INPUT?function(e,t){const n=Nt.getTokenAttr(t,Jt.TYPE);n&&n.toLowerCase()===$t?e._appendElement(t,qt.HTML):As(e,t),t.ackSelfClosing=!0;}(e,t):As(e,t);break;case 6:n===zt.SCRIPT?Qn(e,t):As(e,t);break;case 7:n===zt.CAPTION?function(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,qt.HTML),e.insertionMode=cn;}(e,t):As(e,t);break;case 8:n===zt.COLGROUP?function(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,qt.HTML),e.insertionMode=_n;}(e,t):n===zt.TEMPLATE?Qn(e,t):As(e,t);break;default:As(e,t);}}function ps(e,t){const n=t.tagName;n===zt.TABLE?e.openElements.hasInTableScope(zt.TABLE)&&(e.openElements.popUntilTagNamePopped(zt.TABLE),e._resetInsertionMode()):n===zt.TEMPLATE?Xn(e,t):n!==zt.BODY&&n!==zt.CAPTION&&n!==zt.COL&&n!==zt.COLGROUP&&n!==zt.HTML&&n!==zt.TBODY&&n!==zt.TD&&n!==zt.TFOOT&&n!==zt.TH&&n!==zt.THEAD&&n!==zt.TR&&As(e,t);}function As(e,t){const n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,e._processTokenInBodyMode(t),e.fosterParentingEnabled=n;}function us(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n<e.pendingCharacterTokens.length;n++)As(e,e.pendingCharacterTokens[n]);else for(;n<e.pendingCharacterTokens.length;n++)e._insertCharacters(e.pendingCharacterTokens[n]);e.insertionMode=e.originalInsertionMode,e._processToken(t);}function Ns(e,t){e.openElements.currentTagName===zt.COLGROUP&&(e.openElements.pop(),e.insertionMode=En,e._processToken(t));}function ds(e,t){const n=t.tagName;n===zt.HTML?as(e,t):n===zt.OPTION?(e.openElements.currentTagName===zt.OPTION&&e.openElements.pop(),e._insertElement(t,qt.HTML)):n===zt.OPTGROUP?(e.openElements.currentTagName===zt.OPTION&&e.openElements.pop(),e.openElements.currentTagName===zt.OPTGROUP&&e.openElements.pop(),e._insertElement(t,qt.HTML)):n===zt.INPUT||n===zt.KEYGEN||n===zt.TEXTAREA||n===zt.SELECT?e.openElements.hasInSelectScope(zt.SELECT)&&(e.openElements.popUntilTagNamePopped(zt.SELECT),e._resetInsertionMode(),n!==zt.SELECT&&e._processToken(t)):n!==zt.SCRIPT&&n!==zt.TEMPLATE||Qn(e,t);}function Cs(e,t){const n=t.tagName;if(n===zt.OPTGROUP){const t=e.openElements.items[e.openElements.stackTop-1],n=t&&e.treeAdapter.getTagName(t);e.openElements.currentTagName===zt.OPTION&&n===zt.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagName===zt.OPTGROUP&&e.openElements.pop();}else n===zt.OPTION?e.openElements.currentTagName===zt.OPTION&&e.openElements.pop():n===zt.SELECT&&e.openElements.hasInSelectScope(zt.SELECT)?(e.openElements.popUntilTagNamePopped(zt.SELECT),e._resetInsertionMode()):n===zt.TEMPLATE&&Xn(e,t);}function Os(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(zt.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e._popTmplInsertionMode(),e._resetInsertionMode(),e._processToken(t)):e.stopped=!0;}function fs(e,t){e.insertionMode=an,e._processToken(t);}function Ss(e,t){e.insertionMode=an,e._processToken(t);}return e.parse=function(e,t){return new kn(t).parse(e)},e.parseFragment=function(e,t,n){return "string"==typeof e&&(n=t,t=e,e=null),new kn(n).parseFragment(t,e)},Object.defineProperty(e,"__esModule",{value:!0}),e}({});const parse$3=e.parse;const parseFragment=e.parseFragment;
  14177. const docParser = new WeakMap();
  14178. function parseDocumentUtil(ownerDocument, html) {
  14179. const doc = parse$3(html.trim(), getParser(ownerDocument));
  14180. doc.documentElement = doc.firstElementChild;
  14181. doc.head = doc.documentElement.firstElementChild;
  14182. doc.body = doc.head.nextElementSibling;
  14183. return doc;
  14184. }
  14185. function parseFragmentUtil(ownerDocument, html) {
  14186. if (typeof html === 'string') {
  14187. html = html.trim();
  14188. }
  14189. else {
  14190. html = '';
  14191. }
  14192. const frag = parseFragment(html, getParser(ownerDocument));
  14193. return frag;
  14194. }
  14195. function getParser(ownerDocument) {
  14196. let parseOptions = docParser.get(ownerDocument);
  14197. if (parseOptions != null) {
  14198. return parseOptions;
  14199. }
  14200. const treeAdapter = {
  14201. createDocument() {
  14202. const doc = ownerDocument.createElement("#document" /* DOCUMENT_NODE */);
  14203. doc['x-mode'] = 'no-quirks';
  14204. return doc;
  14205. },
  14206. setNodeSourceCodeLocation(node, location) {
  14207. node.sourceCodeLocation = location;
  14208. },
  14209. getNodeSourceCodeLocation(node) {
  14210. return node.sourceCodeLocation;
  14211. },
  14212. createDocumentFragment() {
  14213. return ownerDocument.createDocumentFragment();
  14214. },
  14215. createElement(tagName, namespaceURI, attrs) {
  14216. const elm = ownerDocument.createElementNS(namespaceURI, tagName);
  14217. for (let i = 0; i < attrs.length; i++) {
  14218. const attr = attrs[i];
  14219. if (attr.namespace == null || attr.namespace === 'http://www.w3.org/1999/xhtml') {
  14220. elm.setAttribute(attr.name, attr.value);
  14221. }
  14222. else {
  14223. elm.setAttributeNS(attr.namespace, attr.name, attr.value);
  14224. }
  14225. }
  14226. return elm;
  14227. },
  14228. createCommentNode(data) {
  14229. return ownerDocument.createComment(data);
  14230. },
  14231. appendChild(parentNode, newNode) {
  14232. parentNode.appendChild(newNode);
  14233. },
  14234. insertBefore(parentNode, newNode, referenceNode) {
  14235. parentNode.insertBefore(newNode, referenceNode);
  14236. },
  14237. setTemplateContent(templateElement, contentElement) {
  14238. templateElement.content = contentElement;
  14239. },
  14240. getTemplateContent(templateElement) {
  14241. return templateElement.content;
  14242. },
  14243. setDocumentType(doc, name, publicId, systemId) {
  14244. let doctypeNode = doc.childNodes.find((n) => n.nodeType === 10 /* DOCUMENT_TYPE_NODE */);
  14245. if (doctypeNode == null) {
  14246. doctypeNode = ownerDocument.createDocumentTypeNode();
  14247. doc.insertBefore(doctypeNode, doc.firstChild);
  14248. }
  14249. doctypeNode.nodeValue = '!DOCTYPE';
  14250. doctypeNode['x-name'] = name;
  14251. doctypeNode['x-publicId'] = publicId;
  14252. doctypeNode['x-systemId'] = systemId;
  14253. },
  14254. setDocumentMode(doc, mode) {
  14255. doc['x-mode'] = mode;
  14256. },
  14257. getDocumentMode(doc) {
  14258. return doc['x-mode'];
  14259. },
  14260. detachNode(node) {
  14261. node.remove();
  14262. },
  14263. insertText(parentNode, text) {
  14264. const lastChild = parentNode.lastChild;
  14265. if (lastChild != null && lastChild.nodeType === 3 /* TEXT_NODE */) {
  14266. lastChild.nodeValue += text;
  14267. }
  14268. else {
  14269. parentNode.appendChild(ownerDocument.createTextNode(text));
  14270. }
  14271. },
  14272. insertTextBefore(parentNode, text, referenceNode) {
  14273. const prevNode = parentNode.childNodes[parentNode.childNodes.indexOf(referenceNode) - 1];
  14274. if (prevNode != null && prevNode.nodeType === 3 /* TEXT_NODE */) {
  14275. prevNode.nodeValue += text;
  14276. }
  14277. else {
  14278. parentNode.insertBefore(ownerDocument.createTextNode(text), referenceNode);
  14279. }
  14280. },
  14281. adoptAttributes(recipient, attrs) {
  14282. for (let i = 0; i < attrs.length; i++) {
  14283. const attr = attrs[i];
  14284. if (recipient.hasAttributeNS(attr.namespace, attr.name) === false) {
  14285. recipient.setAttributeNS(attr.namespace, attr.name, attr.value);
  14286. }
  14287. }
  14288. },
  14289. getFirstChild(node) {
  14290. return node.childNodes[0];
  14291. },
  14292. getChildNodes(node) {
  14293. return node.childNodes;
  14294. },
  14295. getParentNode(node) {
  14296. return node.parentNode;
  14297. },
  14298. getAttrList(element) {
  14299. const attrs = element.attributes.__items.map((attr) => {
  14300. return {
  14301. name: attr.name,
  14302. value: attr.value,
  14303. namespace: attr.namespaceURI,
  14304. prefix: null,
  14305. };
  14306. });
  14307. return attrs;
  14308. },
  14309. getTagName(element) {
  14310. if (element.namespaceURI === 'http://www.w3.org/1999/xhtml') {
  14311. return element.nodeName.toLowerCase();
  14312. }
  14313. else {
  14314. return element.nodeName;
  14315. }
  14316. },
  14317. getNamespaceURI(element) {
  14318. return element.namespaceURI;
  14319. },
  14320. getTextNodeContent(textNode) {
  14321. return textNode.nodeValue;
  14322. },
  14323. getCommentNodeContent(commentNode) {
  14324. return commentNode.nodeValue;
  14325. },
  14326. getDocumentTypeNodeName(doctypeNode) {
  14327. return doctypeNode['x-name'];
  14328. },
  14329. getDocumentTypeNodePublicId(doctypeNode) {
  14330. return doctypeNode['x-publicId'];
  14331. },
  14332. getDocumentTypeNodeSystemId(doctypeNode) {
  14333. return doctypeNode['x-systemId'];
  14334. },
  14335. isTextNode(node) {
  14336. return node.nodeType === 3 /* TEXT_NODE */;
  14337. },
  14338. isCommentNode(node) {
  14339. return node.nodeType === 8 /* COMMENT_NODE */;
  14340. },
  14341. isDocumentTypeNode(node) {
  14342. return node.nodeType === 10 /* DOCUMENT_TYPE_NODE */;
  14343. },
  14344. isElementNode(node) {
  14345. return node.nodeType === 1 /* ELEMENT_NODE */;
  14346. },
  14347. };
  14348. parseOptions = {
  14349. treeAdapter: treeAdapter,
  14350. };
  14351. docParser.set(ownerDocument, parseOptions);
  14352. return parseOptions;
  14353. }
  14354. class MockNode {
  14355. constructor(ownerDocument, nodeType, nodeName, nodeValue) {
  14356. this.ownerDocument = ownerDocument;
  14357. this.nodeType = nodeType;
  14358. this.nodeName = nodeName;
  14359. this._nodeValue = nodeValue;
  14360. this.parentNode = null;
  14361. this.childNodes = [];
  14362. }
  14363. appendChild(newNode) {
  14364. if (newNode.nodeType === 11 /* DOCUMENT_FRAGMENT_NODE */) {
  14365. const nodes = newNode.childNodes.slice();
  14366. for (const child of nodes) {
  14367. this.appendChild(child);
  14368. }
  14369. }
  14370. else {
  14371. newNode.remove();
  14372. newNode.parentNode = this;
  14373. this.childNodes.push(newNode);
  14374. connectNode(this.ownerDocument, newNode);
  14375. }
  14376. return newNode;
  14377. }
  14378. append(...items) {
  14379. items.forEach((item) => {
  14380. const isNode = typeof item === 'object' && item !== null && 'nodeType' in item;
  14381. this.appendChild(isNode ? item : this.ownerDocument.createTextNode(String(item)));
  14382. });
  14383. }
  14384. prepend(...items) {
  14385. const firstChild = this.firstChild;
  14386. items.forEach((item) => {
  14387. const isNode = typeof item === 'object' && item !== null && 'nodeType' in item;
  14388. this.insertBefore(isNode ? item : this.ownerDocument.createTextNode(String(item)), firstChild);
  14389. });
  14390. }
  14391. cloneNode(deep) {
  14392. throw new Error(`invalid node type to clone: ${this.nodeType}, deep: ${deep}`);
  14393. }
  14394. compareDocumentPosition(_other) {
  14395. // unimplemented
  14396. // https://developer.mozilla.org/en-US/docs/Web/API/Node/compareDocumentPosition
  14397. return -1;
  14398. }
  14399. get firstChild() {
  14400. return this.childNodes[0] || null;
  14401. }
  14402. insertBefore(newNode, referenceNode) {
  14403. if (newNode.nodeType === 11 /* DOCUMENT_FRAGMENT_NODE */) {
  14404. for (let i = 0, ii = newNode.childNodes.length; i < ii; i++) {
  14405. insertBefore(this, newNode.childNodes[i], referenceNode);
  14406. }
  14407. }
  14408. else {
  14409. insertBefore(this, newNode, referenceNode);
  14410. }
  14411. return newNode;
  14412. }
  14413. get isConnected() {
  14414. let node = this;
  14415. while (node != null) {
  14416. if (node.nodeType === 9 /* DOCUMENT_NODE */) {
  14417. return true;
  14418. }
  14419. node = node.parentNode;
  14420. if (node != null && node.nodeType === 11 /* DOCUMENT_FRAGMENT_NODE */) {
  14421. node = node.host;
  14422. }
  14423. }
  14424. return false;
  14425. }
  14426. isSameNode(node) {
  14427. return this === node;
  14428. }
  14429. get lastChild() {
  14430. return this.childNodes[this.childNodes.length - 1] || null;
  14431. }
  14432. get nextSibling() {
  14433. if (this.parentNode != null) {
  14434. const index = this.parentNode.childNodes.indexOf(this) + 1;
  14435. return this.parentNode.childNodes[index] || null;
  14436. }
  14437. return null;
  14438. }
  14439. get nodeValue() {
  14440. return this._nodeValue;
  14441. }
  14442. set nodeValue(value) {
  14443. this._nodeValue = value;
  14444. }
  14445. get parentElement() {
  14446. return this.parentNode || null;
  14447. }
  14448. set parentElement(value) {
  14449. this.parentNode = value;
  14450. }
  14451. get previousSibling() {
  14452. if (this.parentNode != null) {
  14453. const index = this.parentNode.childNodes.indexOf(this) - 1;
  14454. return this.parentNode.childNodes[index] || null;
  14455. }
  14456. return null;
  14457. }
  14458. contains(otherNode) {
  14459. if (otherNode === this) {
  14460. return true;
  14461. }
  14462. return this.childNodes.includes(otherNode);
  14463. }
  14464. removeChild(childNode) {
  14465. const index = this.childNodes.indexOf(childNode);
  14466. if (index > -1) {
  14467. this.childNodes.splice(index, 1);
  14468. if (this.nodeType === 1 /* ELEMENT_NODE */) {
  14469. const wasConnected = this.isConnected;
  14470. childNode.parentNode = null;
  14471. if (wasConnected === true) {
  14472. disconnectNode(childNode);
  14473. }
  14474. }
  14475. else {
  14476. childNode.parentNode = null;
  14477. }
  14478. }
  14479. else {
  14480. throw new Error(`node not found within childNodes during removeChild`);
  14481. }
  14482. return childNode;
  14483. }
  14484. remove() {
  14485. if (this.parentNode != null) {
  14486. this.parentNode.removeChild(this);
  14487. }
  14488. }
  14489. replaceChild(newChild, oldChild) {
  14490. if (oldChild.parentNode === this) {
  14491. this.insertBefore(newChild, oldChild);
  14492. oldChild.remove();
  14493. return newChild;
  14494. }
  14495. return null;
  14496. }
  14497. get textContent() {
  14498. return this._nodeValue;
  14499. }
  14500. set textContent(value) {
  14501. this._nodeValue = String(value);
  14502. }
  14503. }
  14504. MockNode.ELEMENT_NODE = 1;
  14505. MockNode.TEXT_NODE = 3;
  14506. MockNode.PROCESSING_INSTRUCTION_NODE = 7;
  14507. MockNode.COMMENT_NODE = 8;
  14508. MockNode.DOCUMENT_NODE = 9;
  14509. MockNode.DOCUMENT_TYPE_NODE = 10;
  14510. MockNode.DOCUMENT_FRAGMENT_NODE = 11;
  14511. class MockNodeList {
  14512. constructor(ownerDocument, childNodes, length) {
  14513. this.ownerDocument = ownerDocument;
  14514. this.childNodes = childNodes;
  14515. this.length = length;
  14516. }
  14517. }
  14518. class MockElement extends MockNode {
  14519. constructor(ownerDocument, nodeName) {
  14520. super(ownerDocument, 1 /* ELEMENT_NODE */, typeof nodeName === 'string' ? nodeName : null, null);
  14521. this.namespaceURI = null;
  14522. }
  14523. addEventListener(type, handler) {
  14524. addEventListener(this, type, handler);
  14525. }
  14526. attachShadow(_opts) {
  14527. const shadowRoot = this.ownerDocument.createDocumentFragment();
  14528. this.shadowRoot = shadowRoot;
  14529. return shadowRoot;
  14530. }
  14531. get shadowRoot() {
  14532. return this.__shadowRoot || null;
  14533. }
  14534. set shadowRoot(shadowRoot) {
  14535. if (shadowRoot != null) {
  14536. shadowRoot.host = this;
  14537. this.__shadowRoot = shadowRoot;
  14538. }
  14539. else {
  14540. delete this.__shadowRoot;
  14541. }
  14542. }
  14543. get attributes() {
  14544. if (this.__attributeMap == null) {
  14545. this.__attributeMap = createAttributeProxy(false);
  14546. }
  14547. return this.__attributeMap;
  14548. }
  14549. set attributes(attrs) {
  14550. this.__attributeMap = attrs;
  14551. }
  14552. get children() {
  14553. return this.childNodes.filter((n) => n.nodeType === 1 /* ELEMENT_NODE */);
  14554. }
  14555. get childElementCount() {
  14556. return this.childNodes.filter((n) => n.nodeType === 1 /* ELEMENT_NODE */).length;
  14557. }
  14558. get className() {
  14559. return this.getAttributeNS(null, 'class') || '';
  14560. }
  14561. set className(value) {
  14562. this.setAttributeNS(null, 'class', value);
  14563. }
  14564. get classList() {
  14565. return new MockClassList(this);
  14566. }
  14567. click() {
  14568. dispatchEvent(this, new MockEvent('click', { bubbles: true, cancelable: true, composed: true }));
  14569. }
  14570. cloneNode(_deep) {
  14571. // implemented on MockElement.prototype from within element.ts
  14572. return null;
  14573. }
  14574. closest(selector) {
  14575. let elm = this;
  14576. while (elm != null) {
  14577. if (elm.matches(selector)) {
  14578. return elm;
  14579. }
  14580. elm = elm.parentNode;
  14581. }
  14582. return null;
  14583. }
  14584. get dataset() {
  14585. return dataset(this);
  14586. }
  14587. get dir() {
  14588. return this.getAttributeNS(null, 'dir') || '';
  14589. }
  14590. set dir(value) {
  14591. this.setAttributeNS(null, 'dir', value);
  14592. }
  14593. dispatchEvent(ev) {
  14594. return dispatchEvent(this, ev);
  14595. }
  14596. get firstElementChild() {
  14597. return this.children[0] || null;
  14598. }
  14599. getAttribute(attrName) {
  14600. if (attrName === 'style') {
  14601. if (this.__style != null && this.__style.length > 0) {
  14602. return this.style.cssText;
  14603. }
  14604. return null;
  14605. }
  14606. const attr = this.attributes.getNamedItem(attrName);
  14607. if (attr != null) {
  14608. return attr.value;
  14609. }
  14610. return null;
  14611. }
  14612. getAttributeNS(namespaceURI, attrName) {
  14613. const attr = this.attributes.getNamedItemNS(namespaceURI, attrName);
  14614. if (attr != null) {
  14615. return attr.value;
  14616. }
  14617. return null;
  14618. }
  14619. getBoundingClientRect() {
  14620. return { bottom: 0, height: 0, left: 0, right: 0, top: 0, width: 0, x: 0, y: 0 };
  14621. }
  14622. getRootNode(opts) {
  14623. const isComposed = opts != null && opts.composed === true;
  14624. let node = this;
  14625. while (node.parentNode != null) {
  14626. node = node.parentNode;
  14627. if (isComposed === true && node.parentNode == null && node.host != null) {
  14628. node = node.host;
  14629. }
  14630. }
  14631. return node;
  14632. }
  14633. get draggable() {
  14634. return this.getAttributeNS(null, 'draggable') === 'true';
  14635. }
  14636. set draggable(value) {
  14637. this.setAttributeNS(null, 'draggable', value);
  14638. }
  14639. hasChildNodes() {
  14640. return this.childNodes.length > 0;
  14641. }
  14642. get id() {
  14643. return this.getAttributeNS(null, 'id') || '';
  14644. }
  14645. set id(value) {
  14646. this.setAttributeNS(null, 'id', value);
  14647. }
  14648. get innerHTML() {
  14649. if (this.childNodes.length === 0) {
  14650. return '';
  14651. }
  14652. return serializeNodeToHtml(this, {
  14653. newLines: false,
  14654. indentSpaces: 0,
  14655. });
  14656. }
  14657. set innerHTML(html) {
  14658. if (NON_ESCAPABLE_CONTENT.has(this.nodeName) === true) {
  14659. setTextContent(this, html);
  14660. }
  14661. else {
  14662. for (let i = this.childNodes.length - 1; i >= 0; i--) {
  14663. this.removeChild(this.childNodes[i]);
  14664. }
  14665. if (typeof html === 'string') {
  14666. const frag = parseFragmentUtil(this.ownerDocument, html);
  14667. while (frag.childNodes.length > 0) {
  14668. this.appendChild(frag.childNodes[0]);
  14669. }
  14670. }
  14671. }
  14672. }
  14673. get innerText() {
  14674. const text = [];
  14675. getTextContent(this.childNodes, text);
  14676. return text.join('');
  14677. }
  14678. set innerText(value) {
  14679. setTextContent(this, value);
  14680. }
  14681. insertAdjacentElement(position, elm) {
  14682. if (position === 'beforebegin') {
  14683. insertBefore(this.parentNode, elm, this);
  14684. }
  14685. else if (position === 'afterbegin') {
  14686. this.prepend(elm);
  14687. }
  14688. else if (position === 'beforeend') {
  14689. this.appendChild(elm);
  14690. }
  14691. else if (position === 'afterend') {
  14692. insertBefore(this.parentNode, elm, this.nextSibling);
  14693. }
  14694. return elm;
  14695. }
  14696. insertAdjacentHTML(position, html) {
  14697. const frag = parseFragmentUtil(this.ownerDocument, html);
  14698. if (position === 'beforebegin') {
  14699. while (frag.childNodes.length > 0) {
  14700. insertBefore(this.parentNode, frag.childNodes[0], this);
  14701. }
  14702. }
  14703. else if (position === 'afterbegin') {
  14704. while (frag.childNodes.length > 0) {
  14705. this.prepend(frag.childNodes[frag.childNodes.length - 1]);
  14706. }
  14707. }
  14708. else if (position === 'beforeend') {
  14709. while (frag.childNodes.length > 0) {
  14710. this.appendChild(frag.childNodes[0]);
  14711. }
  14712. }
  14713. else if (position === 'afterend') {
  14714. while (frag.childNodes.length > 0) {
  14715. insertBefore(this.parentNode, frag.childNodes[frag.childNodes.length - 1], this.nextSibling);
  14716. }
  14717. }
  14718. }
  14719. insertAdjacentText(position, text) {
  14720. const elm = this.ownerDocument.createTextNode(text);
  14721. if (position === 'beforebegin') {
  14722. insertBefore(this.parentNode, elm, this);
  14723. }
  14724. else if (position === 'afterbegin') {
  14725. this.prepend(elm);
  14726. }
  14727. else if (position === 'beforeend') {
  14728. this.appendChild(elm);
  14729. }
  14730. else if (position === 'afterend') {
  14731. insertBefore(this.parentNode, elm, this.nextSibling);
  14732. }
  14733. }
  14734. hasAttribute(attrName) {
  14735. if (attrName === 'style') {
  14736. return this.__style != null && this.__style.length > 0;
  14737. }
  14738. return this.getAttribute(attrName) !== null;
  14739. }
  14740. hasAttributeNS(namespaceURI, name) {
  14741. return this.getAttributeNS(namespaceURI, name) !== null;
  14742. }
  14743. get hidden() {
  14744. return this.hasAttributeNS(null, 'hidden');
  14745. }
  14746. set hidden(isHidden) {
  14747. if (isHidden === true) {
  14748. this.setAttributeNS(null, 'hidden', '');
  14749. }
  14750. else {
  14751. this.removeAttributeNS(null, 'hidden');
  14752. }
  14753. }
  14754. get lang() {
  14755. return this.getAttributeNS(null, 'lang') || '';
  14756. }
  14757. set lang(value) {
  14758. this.setAttributeNS(null, 'lang', value);
  14759. }
  14760. get lastElementChild() {
  14761. const children = this.children;
  14762. return children[children.length - 1] || null;
  14763. }
  14764. matches(selector) {
  14765. return matches(selector, this);
  14766. }
  14767. get nextElementSibling() {
  14768. const parentElement = this.parentElement;
  14769. if (parentElement != null &&
  14770. (parentElement.nodeType === 1 /* ELEMENT_NODE */ ||
  14771. parentElement.nodeType === 11 /* DOCUMENT_FRAGMENT_NODE */ ||
  14772. parentElement.nodeType === 9 /* DOCUMENT_NODE */)) {
  14773. const children = parentElement.children;
  14774. const index = children.indexOf(this) + 1;
  14775. return parentElement.children[index] || null;
  14776. }
  14777. return null;
  14778. }
  14779. get outerHTML() {
  14780. return serializeNodeToHtml(this, {
  14781. newLines: false,
  14782. outerHtml: true,
  14783. indentSpaces: 0,
  14784. });
  14785. }
  14786. get previousElementSibling() {
  14787. const parentElement = this.parentElement;
  14788. if (parentElement != null &&
  14789. (parentElement.nodeType === 1 /* ELEMENT_NODE */ ||
  14790. parentElement.nodeType === 11 /* DOCUMENT_FRAGMENT_NODE */ ||
  14791. parentElement.nodeType === 9 /* DOCUMENT_NODE */)) {
  14792. const children = parentElement.children;
  14793. const index = children.indexOf(this) - 1;
  14794. return parentElement.children[index] || null;
  14795. }
  14796. return null;
  14797. }
  14798. getElementsByClassName(classNames) {
  14799. const classes = classNames
  14800. .trim()
  14801. .split(' ')
  14802. .filter((c) => c.length > 0);
  14803. const results = [];
  14804. getElementsByClassName(this, classes, results);
  14805. return results;
  14806. }
  14807. getElementsByTagName(tagName) {
  14808. const results = [];
  14809. getElementsByTagName(this, tagName.toLowerCase(), results);
  14810. return results;
  14811. }
  14812. querySelector(selector) {
  14813. return selectOne(selector, this);
  14814. }
  14815. querySelectorAll(selector) {
  14816. return selectAll(selector, this);
  14817. }
  14818. removeAttribute(attrName) {
  14819. if (attrName === 'style') {
  14820. delete this.__style;
  14821. }
  14822. else {
  14823. const attr = this.attributes.getNamedItem(attrName);
  14824. if (attr != null) {
  14825. this.attributes.removeNamedItemNS(attr);
  14826. if (checkAttributeChanged(this) === true) {
  14827. attributeChanged(this, attrName, attr.value, null);
  14828. }
  14829. }
  14830. }
  14831. }
  14832. removeAttributeNS(namespaceURI, attrName) {
  14833. const attr = this.attributes.getNamedItemNS(namespaceURI, attrName);
  14834. if (attr != null) {
  14835. this.attributes.removeNamedItemNS(attr);
  14836. if (checkAttributeChanged(this) === true) {
  14837. attributeChanged(this, attrName, attr.value, null);
  14838. }
  14839. }
  14840. }
  14841. removeEventListener(type, handler) {
  14842. removeEventListener(this, type, handler);
  14843. }
  14844. setAttribute(attrName, value) {
  14845. if (attrName === 'style') {
  14846. this.style = value;
  14847. }
  14848. else {
  14849. const attributes = this.attributes;
  14850. let attr = attributes.getNamedItem(attrName);
  14851. const checkAttrChanged = checkAttributeChanged(this);
  14852. if (attr != null) {
  14853. if (checkAttrChanged === true) {
  14854. const oldValue = attr.value;
  14855. attr.value = value;
  14856. if (oldValue !== attr.value) {
  14857. attributeChanged(this, attr.name, oldValue, attr.value);
  14858. }
  14859. }
  14860. else {
  14861. attr.value = value;
  14862. }
  14863. }
  14864. else {
  14865. if (attributes.caseInsensitive) {
  14866. attrName = attrName.toLowerCase();
  14867. }
  14868. attr = new MockAttr(attrName, value);
  14869. attributes.__items.push(attr);
  14870. if (checkAttrChanged === true) {
  14871. attributeChanged(this, attrName, null, attr.value);
  14872. }
  14873. }
  14874. }
  14875. }
  14876. setAttributeNS(namespaceURI, attrName, value) {
  14877. const attributes = this.attributes;
  14878. let attr = attributes.getNamedItemNS(namespaceURI, attrName);
  14879. const checkAttrChanged = checkAttributeChanged(this);
  14880. if (attr != null) {
  14881. if (checkAttrChanged === true) {
  14882. const oldValue = attr.value;
  14883. attr.value = value;
  14884. if (oldValue !== attr.value) {
  14885. attributeChanged(this, attr.name, oldValue, attr.value);
  14886. }
  14887. }
  14888. else {
  14889. attr.value = value;
  14890. }
  14891. }
  14892. else {
  14893. attr = new MockAttr(attrName, value, namespaceURI);
  14894. attributes.__items.push(attr);
  14895. if (checkAttrChanged === true) {
  14896. attributeChanged(this, attrName, null, attr.value);
  14897. }
  14898. }
  14899. }
  14900. get style() {
  14901. if (this.__style == null) {
  14902. this.__style = createCSSStyleDeclaration();
  14903. }
  14904. return this.__style;
  14905. }
  14906. set style(val) {
  14907. if (typeof val === 'string') {
  14908. if (this.__style == null) {
  14909. this.__style = createCSSStyleDeclaration();
  14910. }
  14911. this.__style.cssText = val;
  14912. }
  14913. else {
  14914. this.__style = val;
  14915. }
  14916. }
  14917. get tabIndex() {
  14918. return parseInt(this.getAttributeNS(null, 'tabindex') || '-1', 10);
  14919. }
  14920. set tabIndex(value) {
  14921. this.setAttributeNS(null, 'tabindex', value);
  14922. }
  14923. get tagName() {
  14924. return this.nodeName;
  14925. }
  14926. set tagName(value) {
  14927. this.nodeName = value;
  14928. }
  14929. get textContent() {
  14930. const text = [];
  14931. getTextContent(this.childNodes, text);
  14932. return text.join('');
  14933. }
  14934. set textContent(value) {
  14935. setTextContent(this, value);
  14936. }
  14937. get title() {
  14938. return this.getAttributeNS(null, 'title') || '';
  14939. }
  14940. set title(value) {
  14941. this.setAttributeNS(null, 'title', value);
  14942. }
  14943. onanimationstart() {
  14944. /**/
  14945. }
  14946. onanimationend() {
  14947. /**/
  14948. }
  14949. onanimationiteration() {
  14950. /**/
  14951. }
  14952. onabort() {
  14953. /**/
  14954. }
  14955. onauxclick() {
  14956. /**/
  14957. }
  14958. onbeforecopy() {
  14959. /**/
  14960. }
  14961. onbeforecut() {
  14962. /**/
  14963. }
  14964. onbeforepaste() {
  14965. /**/
  14966. }
  14967. onblur() {
  14968. /**/
  14969. }
  14970. oncancel() {
  14971. /**/
  14972. }
  14973. oncanplay() {
  14974. /**/
  14975. }
  14976. oncanplaythrough() {
  14977. /**/
  14978. }
  14979. onchange() {
  14980. /**/
  14981. }
  14982. onclick() {
  14983. /**/
  14984. }
  14985. onclose() {
  14986. /**/
  14987. }
  14988. oncontextmenu() {
  14989. /**/
  14990. }
  14991. oncopy() {
  14992. /**/
  14993. }
  14994. oncuechange() {
  14995. /**/
  14996. }
  14997. oncut() {
  14998. /**/
  14999. }
  15000. ondblclick() {
  15001. /**/
  15002. }
  15003. ondrag() {
  15004. /**/
  15005. }
  15006. ondragend() {
  15007. /**/
  15008. }
  15009. ondragenter() {
  15010. /**/
  15011. }
  15012. ondragleave() {
  15013. /**/
  15014. }
  15015. ondragover() {
  15016. /**/
  15017. }
  15018. ondragstart() {
  15019. /**/
  15020. }
  15021. ondrop() {
  15022. /**/
  15023. }
  15024. ondurationchange() {
  15025. /**/
  15026. }
  15027. onemptied() {
  15028. /**/
  15029. }
  15030. onended() {
  15031. /**/
  15032. }
  15033. onerror() {
  15034. /**/
  15035. }
  15036. onfocus() {
  15037. /**/
  15038. }
  15039. onfocusin() {
  15040. /**/
  15041. }
  15042. onfocusout() {
  15043. /**/
  15044. }
  15045. onformdata() {
  15046. /**/
  15047. }
  15048. onfullscreenchange() {
  15049. /**/
  15050. }
  15051. onfullscreenerror() {
  15052. /**/
  15053. }
  15054. ongotpointercapture() {
  15055. /**/
  15056. }
  15057. oninput() {
  15058. /**/
  15059. }
  15060. oninvalid() {
  15061. /**/
  15062. }
  15063. onkeydown() {
  15064. /**/
  15065. }
  15066. onkeypress() {
  15067. /**/
  15068. }
  15069. onkeyup() {
  15070. /**/
  15071. }
  15072. onload() {
  15073. /**/
  15074. }
  15075. onloadeddata() {
  15076. /**/
  15077. }
  15078. onloadedmetadata() {
  15079. /**/
  15080. }
  15081. onloadstart() {
  15082. /**/
  15083. }
  15084. onlostpointercapture() {
  15085. /**/
  15086. }
  15087. onmousedown() {
  15088. /**/
  15089. }
  15090. onmouseenter() {
  15091. /**/
  15092. }
  15093. onmouseleave() {
  15094. /**/
  15095. }
  15096. onmousemove() {
  15097. /**/
  15098. }
  15099. onmouseout() {
  15100. /**/
  15101. }
  15102. onmouseover() {
  15103. /**/
  15104. }
  15105. onmouseup() {
  15106. /**/
  15107. }
  15108. onmousewheel() {
  15109. /**/
  15110. }
  15111. onpaste() {
  15112. /**/
  15113. }
  15114. onpause() {
  15115. /**/
  15116. }
  15117. onplay() {
  15118. /**/
  15119. }
  15120. onplaying() {
  15121. /**/
  15122. }
  15123. onpointercancel() {
  15124. /**/
  15125. }
  15126. onpointerdown() {
  15127. /**/
  15128. }
  15129. onpointerenter() {
  15130. /**/
  15131. }
  15132. onpointerleave() {
  15133. /**/
  15134. }
  15135. onpointermove() {
  15136. /**/
  15137. }
  15138. onpointerout() {
  15139. /**/
  15140. }
  15141. onpointerover() {
  15142. /**/
  15143. }
  15144. onpointerup() {
  15145. /**/
  15146. }
  15147. onprogress() {
  15148. /**/
  15149. }
  15150. onratechange() {
  15151. /**/
  15152. }
  15153. onreset() {
  15154. /**/
  15155. }
  15156. onresize() {
  15157. /**/
  15158. }
  15159. onscroll() {
  15160. /**/
  15161. }
  15162. onsearch() {
  15163. /**/
  15164. }
  15165. onseeked() {
  15166. /**/
  15167. }
  15168. onseeking() {
  15169. /**/
  15170. }
  15171. onselect() {
  15172. /**/
  15173. }
  15174. onselectstart() {
  15175. /**/
  15176. }
  15177. onstalled() {
  15178. /**/
  15179. }
  15180. onsubmit() {
  15181. /**/
  15182. }
  15183. onsuspend() {
  15184. /**/
  15185. }
  15186. ontimeupdate() {
  15187. /**/
  15188. }
  15189. ontoggle() {
  15190. /**/
  15191. }
  15192. onvolumechange() {
  15193. /**/
  15194. }
  15195. onwaiting() {
  15196. /**/
  15197. }
  15198. onwebkitfullscreenchange() {
  15199. /**/
  15200. }
  15201. onwebkitfullscreenerror() {
  15202. /**/
  15203. }
  15204. onwheel() {
  15205. /**/
  15206. }
  15207. toString(opts) {
  15208. return serializeNodeToHtml(this, opts);
  15209. }
  15210. }
  15211. function getElementsByClassName(elm, classNames, foundElms) {
  15212. const children = elm.children;
  15213. for (let i = 0, ii = children.length; i < ii; i++) {
  15214. const childElm = children[i];
  15215. for (let j = 0, jj = classNames.length; j < jj; j++) {
  15216. if (childElm.classList.contains(classNames[j])) {
  15217. foundElms.push(childElm);
  15218. }
  15219. }
  15220. getElementsByClassName(childElm, classNames, foundElms);
  15221. }
  15222. }
  15223. function getElementsByTagName(elm, tagName, foundElms) {
  15224. const children = elm.children;
  15225. for (let i = 0, ii = children.length; i < ii; i++) {
  15226. const childElm = children[i];
  15227. if (tagName === '*' || childElm.nodeName.toLowerCase() === tagName) {
  15228. foundElms.push(childElm);
  15229. }
  15230. getElementsByTagName(childElm, tagName, foundElms);
  15231. }
  15232. }
  15233. function resetElement(elm) {
  15234. resetEventListeners(elm);
  15235. delete elm.__attributeMap;
  15236. delete elm.__shadowRoot;
  15237. delete elm.__style;
  15238. }
  15239. function insertBefore(parentNode, newNode, referenceNode) {
  15240. if (newNode !== referenceNode) {
  15241. newNode.remove();
  15242. newNode.parentNode = parentNode;
  15243. newNode.ownerDocument = parentNode.ownerDocument;
  15244. if (referenceNode != null) {
  15245. const index = parentNode.childNodes.indexOf(referenceNode);
  15246. if (index > -1) {
  15247. parentNode.childNodes.splice(index, 0, newNode);
  15248. }
  15249. else {
  15250. throw new Error(`referenceNode not found in parentNode.childNodes`);
  15251. }
  15252. }
  15253. else {
  15254. parentNode.childNodes.push(newNode);
  15255. }
  15256. connectNode(parentNode.ownerDocument, newNode);
  15257. }
  15258. return newNode;
  15259. }
  15260. class MockHTMLElement extends MockElement {
  15261. constructor(ownerDocument, nodeName) {
  15262. super(ownerDocument, typeof nodeName === 'string' ? nodeName.toUpperCase() : null);
  15263. this.namespaceURI = 'http://www.w3.org/1999/xhtml';
  15264. }
  15265. get tagName() {
  15266. return this.nodeName;
  15267. }
  15268. set tagName(value) {
  15269. this.nodeName = value;
  15270. }
  15271. get attributes() {
  15272. if (this.__attributeMap == null) {
  15273. this.__attributeMap = createAttributeProxy(true);
  15274. }
  15275. return this.__attributeMap;
  15276. }
  15277. set attributes(attrs) {
  15278. this.__attributeMap = attrs;
  15279. }
  15280. }
  15281. class MockTextNode extends MockNode {
  15282. constructor(ownerDocument, text) {
  15283. super(ownerDocument, 3 /* TEXT_NODE */, "#text" /* TEXT_NODE */, text);
  15284. }
  15285. cloneNode(_deep) {
  15286. return new MockTextNode(null, this.nodeValue);
  15287. }
  15288. get textContent() {
  15289. return this.nodeValue;
  15290. }
  15291. set textContent(text) {
  15292. this.nodeValue = text;
  15293. }
  15294. get data() {
  15295. return this.nodeValue;
  15296. }
  15297. set data(text) {
  15298. this.nodeValue = text;
  15299. }
  15300. get wholeText() {
  15301. if (this.parentNode != null) {
  15302. const text = [];
  15303. for (let i = 0, ii = this.parentNode.childNodes.length; i < ii; i++) {
  15304. const childNode = this.parentNode.childNodes[i];
  15305. if (childNode.nodeType === 3 /* TEXT_NODE */) {
  15306. text.push(childNode.nodeValue);
  15307. }
  15308. }
  15309. return text.join('');
  15310. }
  15311. return this.nodeValue;
  15312. }
  15313. }
  15314. function getTextContent(childNodes, text) {
  15315. for (let i = 0, ii = childNodes.length; i < ii; i++) {
  15316. const childNode = childNodes[i];
  15317. if (childNode.nodeType === 3 /* TEXT_NODE */) {
  15318. text.push(childNode.nodeValue);
  15319. }
  15320. else if (childNode.nodeType === 1 /* ELEMENT_NODE */) {
  15321. getTextContent(childNode.childNodes, text);
  15322. }
  15323. }
  15324. }
  15325. function setTextContent(elm, text) {
  15326. for (let i = elm.childNodes.length - 1; i >= 0; i--) {
  15327. elm.removeChild(elm.childNodes[i]);
  15328. }
  15329. const textNode = new MockTextNode(elm.ownerDocument, text);
  15330. elm.appendChild(textNode);
  15331. }
  15332. class MockComment extends MockNode {
  15333. constructor(ownerDocument, data) {
  15334. super(ownerDocument, 8 /* COMMENT_NODE */, "#comment" /* COMMENT_NODE */, data);
  15335. }
  15336. cloneNode(_deep) {
  15337. return new MockComment(null, this.nodeValue);
  15338. }
  15339. get textContent() {
  15340. return this.nodeValue;
  15341. }
  15342. set textContent(text) {
  15343. this.nodeValue = text;
  15344. }
  15345. }
  15346. class MockDocumentFragment extends MockHTMLElement {
  15347. constructor(ownerDocument) {
  15348. super(ownerDocument, null);
  15349. this.nodeName = "#document-fragment" /* DOCUMENT_FRAGMENT_NODE */;
  15350. this.nodeType = 11 /* DOCUMENT_FRAGMENT_NODE */;
  15351. }
  15352. getElementById(id) {
  15353. return getElementById(this, id);
  15354. }
  15355. cloneNode(deep) {
  15356. const cloned = new MockDocumentFragment(null);
  15357. if (deep) {
  15358. for (let i = 0, ii = this.childNodes.length; i < ii; i++) {
  15359. const childNode = this.childNodes[i];
  15360. if (childNode.nodeType === 1 /* ELEMENT_NODE */ ||
  15361. childNode.nodeType === 3 /* TEXT_NODE */ ||
  15362. childNode.nodeType === 8 /* COMMENT_NODE */) {
  15363. const clonedChildNode = this.childNodes[i].cloneNode(true);
  15364. cloned.appendChild(clonedChildNode);
  15365. }
  15366. }
  15367. }
  15368. return cloned;
  15369. }
  15370. }
  15371. class MockDocumentTypeNode extends MockHTMLElement {
  15372. constructor(ownerDocument) {
  15373. super(ownerDocument, '!DOCTYPE');
  15374. this.nodeType = 10 /* DOCUMENT_TYPE_NODE */;
  15375. this.setAttribute('html', '');
  15376. }
  15377. }
  15378. class MockCSSRule {
  15379. constructor(parentStyleSheet) {
  15380. this.parentStyleSheet = parentStyleSheet;
  15381. this.cssText = '';
  15382. this.type = 0;
  15383. }
  15384. }
  15385. class MockCSSStyleSheet {
  15386. constructor(ownerNode) {
  15387. this.type = 'text/css';
  15388. this.parentStyleSheet = null;
  15389. this.cssRules = [];
  15390. this.ownerNode = ownerNode;
  15391. }
  15392. get rules() {
  15393. return this.cssRules;
  15394. }
  15395. set rules(rules) {
  15396. this.cssRules = rules;
  15397. }
  15398. deleteRule(index) {
  15399. if (index >= 0 && index < this.cssRules.length) {
  15400. this.cssRules.splice(index, 1);
  15401. updateStyleTextNode(this.ownerNode);
  15402. }
  15403. }
  15404. insertRule(rule, index = 0) {
  15405. if (typeof index !== 'number') {
  15406. index = 0;
  15407. }
  15408. if (index < 0) {
  15409. index = 0;
  15410. }
  15411. if (index > this.cssRules.length) {
  15412. index = this.cssRules.length;
  15413. }
  15414. const cssRule = new MockCSSRule(this);
  15415. cssRule.cssText = rule;
  15416. this.cssRules.splice(index, 0, cssRule);
  15417. updateStyleTextNode(this.ownerNode);
  15418. return index;
  15419. }
  15420. }
  15421. function getStyleElementText(styleElm) {
  15422. const output = [];
  15423. for (let i = 0; i < styleElm.childNodes.length; i++) {
  15424. output.push(styleElm.childNodes[i].nodeValue);
  15425. }
  15426. return output.join('');
  15427. }
  15428. function setStyleElementText(styleElm, text) {
  15429. // keeping the innerHTML and the sheet.cssRules connected
  15430. // is not technically correct, but since we're doing
  15431. // SSR we'll need to turn any assigned cssRules into
  15432. // real text, not just properties that aren't rendered
  15433. const sheet = styleElm.sheet;
  15434. sheet.cssRules.length = 0;
  15435. sheet.insertRule(text);
  15436. updateStyleTextNode(styleElm);
  15437. }
  15438. function updateStyleTextNode(styleElm) {
  15439. const childNodeLen = styleElm.childNodes.length;
  15440. if (childNodeLen > 1) {
  15441. for (let i = childNodeLen - 1; i >= 1; i--) {
  15442. styleElm.removeChild(styleElm.childNodes[i]);
  15443. }
  15444. }
  15445. else if (childNodeLen < 1) {
  15446. styleElm.appendChild(styleElm.ownerDocument.createTextNode(''));
  15447. }
  15448. const textNode = styleElm.childNodes[0];
  15449. textNode.nodeValue = styleElm.sheet.cssRules.map((r) => r.cssText).join('\n');
  15450. }
  15451. function createElement(ownerDocument, tagName) {
  15452. if (typeof tagName !== 'string' || tagName === '' || !/^[a-z0-9-_:]+$/i.test(tagName)) {
  15453. throw new Error(`The tag name provided (${tagName}) is not a valid name.`);
  15454. }
  15455. tagName = tagName.toLowerCase();
  15456. switch (tagName) {
  15457. case 'a':
  15458. return new MockAnchorElement(ownerDocument);
  15459. case 'base':
  15460. return new MockBaseElement(ownerDocument);
  15461. case 'button':
  15462. return new MockButtonElement(ownerDocument);
  15463. case 'canvas':
  15464. return new MockCanvasElement(ownerDocument);
  15465. case 'form':
  15466. return new MockFormElement(ownerDocument);
  15467. case 'img':
  15468. return new MockImageElement(ownerDocument);
  15469. case 'input':
  15470. return new MockInputElement(ownerDocument);
  15471. case 'link':
  15472. return new MockLinkElement(ownerDocument);
  15473. case 'meta':
  15474. return new MockMetaElement(ownerDocument);
  15475. case 'script':
  15476. return new MockScriptElement(ownerDocument);
  15477. case 'style':
  15478. return new MockStyleElement(ownerDocument);
  15479. case 'template':
  15480. return new MockTemplateElement(ownerDocument);
  15481. case 'title':
  15482. return new MockTitleElement(ownerDocument);
  15483. }
  15484. if (ownerDocument != null && tagName.includes('-')) {
  15485. const win = ownerDocument.defaultView;
  15486. if (win != null && win.customElements != null) {
  15487. return createCustomElement(win.customElements, ownerDocument, tagName);
  15488. }
  15489. }
  15490. return new MockHTMLElement(ownerDocument, tagName);
  15491. }
  15492. function createElementNS(ownerDocument, namespaceURI, tagName) {
  15493. if (namespaceURI === 'http://www.w3.org/1999/xhtml') {
  15494. return createElement(ownerDocument, tagName);
  15495. }
  15496. else if (namespaceURI === 'http://www.w3.org/2000/svg') {
  15497. return new MockSVGElement(ownerDocument, tagName);
  15498. }
  15499. else {
  15500. return new MockElement(ownerDocument, tagName);
  15501. }
  15502. }
  15503. class MockAnchorElement extends MockHTMLElement {
  15504. constructor(ownerDocument) {
  15505. super(ownerDocument, 'a');
  15506. }
  15507. get href() {
  15508. return fullUrl(this, 'href');
  15509. }
  15510. set href(value) {
  15511. this.setAttribute('href', value);
  15512. }
  15513. get pathname() {
  15514. return new URL(this.href).pathname;
  15515. }
  15516. }
  15517. class MockButtonElement extends MockHTMLElement {
  15518. constructor(ownerDocument) {
  15519. super(ownerDocument, 'button');
  15520. }
  15521. }
  15522. patchPropAttributes(MockButtonElement.prototype, {
  15523. type: String,
  15524. }, {
  15525. type: 'submit',
  15526. });
  15527. class MockImageElement extends MockHTMLElement {
  15528. constructor(ownerDocument) {
  15529. super(ownerDocument, 'img');
  15530. }
  15531. get draggable() {
  15532. return this.getAttributeNS(null, 'draggable') !== 'false';
  15533. }
  15534. set draggable(value) {
  15535. this.setAttributeNS(null, 'draggable', value);
  15536. }
  15537. get src() {
  15538. return fullUrl(this, 'src');
  15539. }
  15540. set src(value) {
  15541. this.setAttribute('src', value);
  15542. }
  15543. }
  15544. patchPropAttributes(MockImageElement.prototype, {
  15545. height: Number,
  15546. width: Number,
  15547. });
  15548. class MockInputElement extends MockHTMLElement {
  15549. constructor(ownerDocument) {
  15550. super(ownerDocument, 'input');
  15551. }
  15552. get list() {
  15553. const listId = this.getAttribute('list');
  15554. if (listId) {
  15555. return this.ownerDocument.getElementById(listId);
  15556. }
  15557. return null;
  15558. }
  15559. }
  15560. patchPropAttributes(MockInputElement.prototype, {
  15561. accept: String,
  15562. autocomplete: String,
  15563. autofocus: Boolean,
  15564. capture: String,
  15565. checked: Boolean,
  15566. disabled: Boolean,
  15567. form: String,
  15568. formaction: String,
  15569. formenctype: String,
  15570. formmethod: String,
  15571. formnovalidate: String,
  15572. formtarget: String,
  15573. height: Number,
  15574. inputmode: String,
  15575. max: String,
  15576. maxLength: Number,
  15577. min: String,
  15578. minLength: Number,
  15579. multiple: Boolean,
  15580. name: String,
  15581. pattern: String,
  15582. placeholder: String,
  15583. required: Boolean,
  15584. readOnly: Boolean,
  15585. size: Number,
  15586. spellCheck: Boolean,
  15587. src: String,
  15588. step: String,
  15589. type: String,
  15590. value: String,
  15591. width: Number,
  15592. }, {
  15593. type: 'text',
  15594. });
  15595. class MockFormElement extends MockHTMLElement {
  15596. constructor(ownerDocument) {
  15597. super(ownerDocument, 'form');
  15598. }
  15599. }
  15600. patchPropAttributes(MockFormElement.prototype, {
  15601. name: String,
  15602. });
  15603. class MockLinkElement extends MockHTMLElement {
  15604. constructor(ownerDocument) {
  15605. super(ownerDocument, 'link');
  15606. }
  15607. get href() {
  15608. return fullUrl(this, 'href');
  15609. }
  15610. set href(value) {
  15611. this.setAttribute('href', value);
  15612. }
  15613. }
  15614. patchPropAttributes(MockLinkElement.prototype, {
  15615. crossorigin: String,
  15616. media: String,
  15617. rel: String,
  15618. type: String,
  15619. });
  15620. class MockMetaElement extends MockHTMLElement {
  15621. constructor(ownerDocument) {
  15622. super(ownerDocument, 'meta');
  15623. }
  15624. }
  15625. patchPropAttributes(MockMetaElement.prototype, {
  15626. charset: String,
  15627. content: String,
  15628. name: String,
  15629. });
  15630. class MockScriptElement extends MockHTMLElement {
  15631. constructor(ownerDocument) {
  15632. super(ownerDocument, 'script');
  15633. }
  15634. get src() {
  15635. return fullUrl(this, 'src');
  15636. }
  15637. set src(value) {
  15638. this.setAttribute('src', value);
  15639. }
  15640. }
  15641. patchPropAttributes(MockScriptElement.prototype, {
  15642. type: String,
  15643. });
  15644. class MockStyleElement extends MockHTMLElement {
  15645. constructor(ownerDocument) {
  15646. super(ownerDocument, 'style');
  15647. this.sheet = new MockCSSStyleSheet(this);
  15648. }
  15649. get innerHTML() {
  15650. return getStyleElementText(this);
  15651. }
  15652. set innerHTML(value) {
  15653. setStyleElementText(this, value);
  15654. }
  15655. get innerText() {
  15656. return getStyleElementText(this);
  15657. }
  15658. set innerText(value) {
  15659. setStyleElementText(this, value);
  15660. }
  15661. get textContent() {
  15662. return getStyleElementText(this);
  15663. }
  15664. set textContent(value) {
  15665. setStyleElementText(this, value);
  15666. }
  15667. }
  15668. class MockSVGElement extends MockElement {
  15669. // SVGElement properties and methods
  15670. get ownerSVGElement() {
  15671. return null;
  15672. }
  15673. get viewportElement() {
  15674. return null;
  15675. }
  15676. focus() {
  15677. /**/
  15678. }
  15679. onunload() {
  15680. /**/
  15681. }
  15682. // SVGGeometryElement properties and methods
  15683. get pathLength() {
  15684. return 0;
  15685. }
  15686. isPointInFill(_pt) {
  15687. return false;
  15688. }
  15689. isPointInStroke(_pt) {
  15690. return false;
  15691. }
  15692. getTotalLength() {
  15693. return 0;
  15694. }
  15695. }
  15696. class MockBaseElement extends MockHTMLElement {
  15697. constructor(ownerDocument) {
  15698. super(ownerDocument, 'base');
  15699. }
  15700. get href() {
  15701. return fullUrl(this, 'href');
  15702. }
  15703. set href(value) {
  15704. this.setAttribute('href', value);
  15705. }
  15706. }
  15707. class MockTemplateElement extends MockHTMLElement {
  15708. constructor(ownerDocument) {
  15709. super(ownerDocument, 'template');
  15710. this.content = new MockDocumentFragment(ownerDocument);
  15711. }
  15712. get innerHTML() {
  15713. return this.content.innerHTML;
  15714. }
  15715. set innerHTML(html) {
  15716. this.content.innerHTML = html;
  15717. }
  15718. cloneNode(deep) {
  15719. const cloned = new MockTemplateElement(null);
  15720. cloned.attributes = cloneAttributes(this.attributes);
  15721. const styleCssText = this.getAttribute('style');
  15722. if (styleCssText != null && styleCssText.length > 0) {
  15723. cloned.setAttribute('style', styleCssText);
  15724. }
  15725. cloned.content = this.content.cloneNode(deep);
  15726. if (deep) {
  15727. for (let i = 0, ii = this.childNodes.length; i < ii; i++) {
  15728. const clonedChildNode = this.childNodes[i].cloneNode(true);
  15729. cloned.appendChild(clonedChildNode);
  15730. }
  15731. }
  15732. return cloned;
  15733. }
  15734. }
  15735. class MockTitleElement extends MockHTMLElement {
  15736. constructor(ownerDocument) {
  15737. super(ownerDocument, 'title');
  15738. }
  15739. get text() {
  15740. return this.textContent;
  15741. }
  15742. set text(value) {
  15743. this.textContent = value;
  15744. }
  15745. }
  15746. class MockCanvasElement extends MockHTMLElement {
  15747. constructor(ownerDocument) {
  15748. super(ownerDocument, 'canvas');
  15749. }
  15750. getContext() {
  15751. return {
  15752. fillRect() {
  15753. return;
  15754. },
  15755. clearRect() { },
  15756. getImageData: function (_, __, w, h) {
  15757. return {
  15758. data: new Array(w * h * 4),
  15759. };
  15760. },
  15761. putImageData() { },
  15762. createImageData: function () {
  15763. return [];
  15764. },
  15765. setTransform() { },
  15766. drawImage() { },
  15767. save() { },
  15768. fillText() { },
  15769. restore() { },
  15770. beginPath() { },
  15771. moveTo() { },
  15772. lineTo() { },
  15773. closePath() { },
  15774. stroke() { },
  15775. translate() { },
  15776. scale() { },
  15777. rotate() { },
  15778. arc() { },
  15779. fill() { },
  15780. measureText() {
  15781. return { width: 0 };
  15782. },
  15783. transform() { },
  15784. rect() { },
  15785. clip() { },
  15786. };
  15787. }
  15788. }
  15789. function fullUrl(elm, attrName) {
  15790. const val = elm.getAttribute(attrName) || '';
  15791. if (elm.ownerDocument != null) {
  15792. const win = elm.ownerDocument.defaultView;
  15793. if (win != null) {
  15794. const loc = win.location;
  15795. if (loc != null) {
  15796. try {
  15797. const url = new URL(val, loc.href);
  15798. return url.href;
  15799. }
  15800. catch (e) { }
  15801. }
  15802. }
  15803. }
  15804. return val.replace(/\'|\"/g, '').trim();
  15805. }
  15806. function patchPropAttributes(prototype, attrs, defaults = {}) {
  15807. Object.keys(attrs).forEach((propName) => {
  15808. const attr = attrs[propName];
  15809. const defaultValue = defaults[propName];
  15810. if (attr === Boolean) {
  15811. Object.defineProperty(prototype, propName, {
  15812. get() {
  15813. return this.hasAttribute(propName);
  15814. },
  15815. set(value) {
  15816. if (value) {
  15817. this.setAttribute(propName, '');
  15818. }
  15819. else {
  15820. this.removeAttribute(propName);
  15821. }
  15822. },
  15823. });
  15824. }
  15825. else if (attr === Number) {
  15826. Object.defineProperty(prototype, propName, {
  15827. get() {
  15828. const value = this.getAttribute(propName);
  15829. return value ? parseInt(value, 10) : defaultValue === undefined ? 0 : defaultValue;
  15830. },
  15831. set(value) {
  15832. this.setAttribute(propName, value);
  15833. },
  15834. });
  15835. }
  15836. else {
  15837. Object.defineProperty(prototype, propName, {
  15838. get() {
  15839. return this.hasAttribute(propName) ? this.getAttribute(propName) : defaultValue || '';
  15840. },
  15841. set(value) {
  15842. this.setAttribute(propName, value);
  15843. },
  15844. });
  15845. }
  15846. });
  15847. }
  15848. MockElement.prototype.cloneNode = function (deep) {
  15849. // because we're creating elements, which extending specific HTML base classes there
  15850. // is a MockElement circular reference that bundling has trouble dealing with so
  15851. // the fix is to add cloneNode() to MockElement's prototype after the HTML classes
  15852. const cloned = createElement(this.ownerDocument, this.nodeName);
  15853. cloned.attributes = cloneAttributes(this.attributes);
  15854. const styleCssText = this.getAttribute('style');
  15855. if (styleCssText != null && styleCssText.length > 0) {
  15856. cloned.setAttribute('style', styleCssText);
  15857. }
  15858. if (deep) {
  15859. for (let i = 0, ii = this.childNodes.length; i < ii; i++) {
  15860. const clonedChildNode = this.childNodes[i].cloneNode(true);
  15861. cloned.appendChild(clonedChildNode);
  15862. }
  15863. }
  15864. return cloned;
  15865. };
  15866. let sharedDocument;
  15867. function parseHtmlToDocument(html, ownerDocument = null) {
  15868. if (ownerDocument == null) {
  15869. if (sharedDocument == null) {
  15870. sharedDocument = new MockDocument();
  15871. }
  15872. ownerDocument = sharedDocument;
  15873. }
  15874. return parseDocumentUtil(ownerDocument, html);
  15875. }
  15876. class MockHeaders {
  15877. constructor(init) {
  15878. this._values = [];
  15879. if (typeof init === 'object') {
  15880. if (typeof init[Symbol.iterator] === 'function') {
  15881. const kvs = [];
  15882. for (const kv of init) {
  15883. if (typeof kv[Symbol.iterator] === 'function') {
  15884. kvs.push([...kv]);
  15885. }
  15886. }
  15887. for (const kv of kvs) {
  15888. this.append(kv[0], kv[1]);
  15889. }
  15890. }
  15891. else {
  15892. for (const key in init) {
  15893. this.append(key, init[key]);
  15894. }
  15895. }
  15896. }
  15897. }
  15898. append(key, value) {
  15899. this._values.push([key, value + '']);
  15900. }
  15901. delete(key) {
  15902. key = key.toLowerCase();
  15903. for (let i = this._values.length - 1; i >= 0; i--) {
  15904. if (this._values[i][0].toLowerCase() === key) {
  15905. this._values.splice(i, 1);
  15906. }
  15907. }
  15908. }
  15909. entries() {
  15910. const entries = [];
  15911. for (const kv of this.keys()) {
  15912. entries.push([kv, this.get(kv)]);
  15913. }
  15914. let index = -1;
  15915. return {
  15916. next() {
  15917. index++;
  15918. return {
  15919. value: entries[index],
  15920. done: !entries[index],
  15921. };
  15922. },
  15923. [Symbol.iterator]() {
  15924. return this;
  15925. },
  15926. };
  15927. }
  15928. forEach(cb) {
  15929. for (const kv of this.entries()) {
  15930. cb(kv[1], kv[0]);
  15931. }
  15932. }
  15933. get(key) {
  15934. const rtn = [];
  15935. key = key.toLowerCase();
  15936. for (const kv of this._values) {
  15937. if (kv[0].toLowerCase() === key) {
  15938. rtn.push(kv[1]);
  15939. }
  15940. }
  15941. return rtn.length > 0 ? rtn.join(', ') : null;
  15942. }
  15943. has(key) {
  15944. key = key.toLowerCase();
  15945. for (const kv of this._values) {
  15946. if (kv[0].toLowerCase() === key) {
  15947. return true;
  15948. }
  15949. }
  15950. return false;
  15951. }
  15952. keys() {
  15953. const keys = [];
  15954. for (const kv of this._values) {
  15955. const key = kv[0].toLowerCase();
  15956. if (!keys.includes(key)) {
  15957. keys.push(key);
  15958. }
  15959. }
  15960. let index = -1;
  15961. return {
  15962. next() {
  15963. index++;
  15964. return {
  15965. value: keys[index],
  15966. done: !keys[index],
  15967. };
  15968. },
  15969. [Symbol.iterator]() {
  15970. return this;
  15971. },
  15972. };
  15973. }
  15974. set(key, value) {
  15975. for (const kv of this._values) {
  15976. if (kv[0].toLowerCase() === key.toLowerCase()) {
  15977. kv[1] = value + '';
  15978. return;
  15979. }
  15980. }
  15981. this.append(key, value);
  15982. }
  15983. values() {
  15984. const values = this._values;
  15985. let index = -1;
  15986. return {
  15987. next() {
  15988. index++;
  15989. const done = !values[index];
  15990. return {
  15991. value: done ? undefined : values[index][1],
  15992. done,
  15993. };
  15994. },
  15995. [Symbol.iterator]() {
  15996. return this;
  15997. },
  15998. };
  15999. }
  16000. [Symbol.iterator]() {
  16001. return this.entries();
  16002. }
  16003. }
  16004. class MockRequest {
  16005. constructor(input, init = {}) {
  16006. this._method = 'GET';
  16007. this._url = '/';
  16008. this.bodyUsed = false;
  16009. this.cache = 'default';
  16010. this.credentials = 'same-origin';
  16011. this.integrity = '';
  16012. this.keepalive = false;
  16013. this.mode = 'cors';
  16014. this.redirect = 'follow';
  16015. this.referrer = 'about:client';
  16016. this.referrerPolicy = '';
  16017. if (typeof input === 'string') {
  16018. this.url = input;
  16019. }
  16020. else if (input) {
  16021. Object.assign(this, input);
  16022. this.headers = new MockHeaders(input.headers);
  16023. }
  16024. Object.assign(this, init);
  16025. if (init.headers) {
  16026. this.headers = new MockHeaders(init.headers);
  16027. }
  16028. if (!this.headers) {
  16029. this.headers = new MockHeaders();
  16030. }
  16031. }
  16032. get url() {
  16033. if (typeof this._url === 'string') {
  16034. return new URL(this._url, location.href).href;
  16035. }
  16036. return new URL('/', location.href).href;
  16037. }
  16038. set url(value) {
  16039. this._url = value;
  16040. }
  16041. get method() {
  16042. if (typeof this._method === 'string') {
  16043. return this._method.toUpperCase();
  16044. }
  16045. return 'GET';
  16046. }
  16047. set method(value) {
  16048. this._method = value;
  16049. }
  16050. clone() {
  16051. const clone = { ...this };
  16052. clone.headers = new MockHeaders(this.headers);
  16053. return new MockRequest(clone);
  16054. }
  16055. }
  16056. class MockResponse {
  16057. constructor(body, init = {}) {
  16058. this.ok = true;
  16059. this.status = 200;
  16060. this.statusText = '';
  16061. this.type = 'default';
  16062. this.url = '';
  16063. this._body = body;
  16064. if (init) {
  16065. Object.assign(this, init);
  16066. }
  16067. this.headers = new MockHeaders(init.headers);
  16068. }
  16069. async json() {
  16070. return JSON.parse(this._body);
  16071. }
  16072. async text() {
  16073. return this._body;
  16074. }
  16075. clone() {
  16076. const initClone = { ...this };
  16077. initClone.headers = new MockHeaders(this.headers);
  16078. return new MockResponse(this._body, initClone);
  16079. }
  16080. }
  16081. class MockDOMParser {
  16082. parseFromString(htmlToParse, mimeType) {
  16083. if (mimeType !== 'text/html') {
  16084. console.error('XML parsing not implemented yet, continuing as html');
  16085. }
  16086. return parseHtmlToDocument(htmlToParse);
  16087. }
  16088. }
  16089. function addGlobalsToWindowPrototype(mockWinPrototype) {
  16090. GLOBAL_CONSTRUCTORS.forEach(([cstrName, Cstr]) => {
  16091. Object.defineProperty(mockWinPrototype, cstrName, {
  16092. get() {
  16093. return this['__' + cstrName] || Cstr;
  16094. },
  16095. set(cstr) {
  16096. this['__' + cstrName] = cstr;
  16097. },
  16098. configurable: true,
  16099. enumerable: true,
  16100. });
  16101. });
  16102. }
  16103. const GLOBAL_CONSTRUCTORS = [
  16104. ['CustomEvent', MockCustomEvent],
  16105. ['Event', MockEvent],
  16106. ['Headers', MockHeaders],
  16107. ['KeyboardEvent', MockKeyboardEvent],
  16108. ['MouseEvent', MockMouseEvent],
  16109. ['Request', MockRequest],
  16110. ['Response', MockResponse],
  16111. ['DOMParser', MockDOMParser],
  16112. ['HTMLAnchorElement', MockAnchorElement],
  16113. ['HTMLBaseElement', MockBaseElement],
  16114. ['HTMLButtonElement', MockButtonElement],
  16115. ['HTMLCanvasElement', MockCanvasElement],
  16116. ['HTMLFormElement', MockFormElement],
  16117. ['HTMLImageElement', MockImageElement],
  16118. ['HTMLInputElement', MockInputElement],
  16119. ['HTMLLinkElement', MockLinkElement],
  16120. ['HTMLMetaElement', MockMetaElement],
  16121. ['HTMLScriptElement', MockScriptElement],
  16122. ['HTMLStyleElement', MockStyleElement],
  16123. ['HTMLTemplateElement', MockTemplateElement],
  16124. ['HTMLTitleElement', MockTitleElement],
  16125. ];
  16126. const consoleNoop = () => {
  16127. /**/
  16128. };
  16129. function createConsole() {
  16130. return {
  16131. debug: consoleNoop,
  16132. error: consoleNoop,
  16133. info: consoleNoop,
  16134. log: consoleNoop,
  16135. warn: consoleNoop,
  16136. dir: consoleNoop,
  16137. dirxml: consoleNoop,
  16138. table: consoleNoop,
  16139. trace: consoleNoop,
  16140. group: consoleNoop,
  16141. groupCollapsed: consoleNoop,
  16142. groupEnd: consoleNoop,
  16143. clear: consoleNoop,
  16144. count: consoleNoop,
  16145. countReset: consoleNoop,
  16146. assert: consoleNoop,
  16147. profile: consoleNoop,
  16148. profileEnd: consoleNoop,
  16149. time: consoleNoop,
  16150. timeLog: consoleNoop,
  16151. timeEnd: consoleNoop,
  16152. timeStamp: consoleNoop,
  16153. context: consoleNoop,
  16154. memory: consoleNoop,
  16155. };
  16156. }
  16157. class MockHistory {
  16158. constructor() {
  16159. this.items = [];
  16160. }
  16161. get length() {
  16162. return this.items.length;
  16163. }
  16164. back() {
  16165. this.go(-1);
  16166. }
  16167. forward() {
  16168. this.go(1);
  16169. }
  16170. go(_value) {
  16171. //
  16172. }
  16173. pushState(_state, _title, _url) {
  16174. //
  16175. }
  16176. replaceState(_state, _title, _url) {
  16177. //
  16178. }
  16179. }
  16180. class MockIntersectionObserver {
  16181. constructor() {
  16182. /**/
  16183. }
  16184. disconnect() {
  16185. /**/
  16186. }
  16187. observe() {
  16188. /**/
  16189. }
  16190. takeRecords() {
  16191. return [];
  16192. }
  16193. unobserve() {
  16194. /**/
  16195. }
  16196. }
  16197. class MockLocation {
  16198. constructor() {
  16199. this.ancestorOrigins = null;
  16200. this.protocol = '';
  16201. this.host = '';
  16202. this.hostname = '';
  16203. this.port = '';
  16204. this.pathname = '';
  16205. this.search = '';
  16206. this.hash = '';
  16207. this.username = '';
  16208. this.password = '';
  16209. this.origin = '';
  16210. this._href = '';
  16211. }
  16212. get href() {
  16213. return this._href;
  16214. }
  16215. set href(value) {
  16216. const url = new URL(value, 'http://mockdoc.stenciljs.com');
  16217. this._href = url.href;
  16218. this.protocol = url.protocol;
  16219. this.host = url.host;
  16220. this.hostname = url.hostname;
  16221. this.port = url.port;
  16222. this.pathname = url.pathname;
  16223. this.search = url.search;
  16224. this.hash = url.hash;
  16225. this.username = url.username;
  16226. this.password = url.password;
  16227. this.origin = url.origin;
  16228. }
  16229. assign(_url) {
  16230. //
  16231. }
  16232. reload(_forcedReload) {
  16233. //
  16234. }
  16235. replace(_url) {
  16236. //
  16237. }
  16238. toString() {
  16239. return this.href;
  16240. }
  16241. }
  16242. class MockNavigator {
  16243. constructor() {
  16244. this.appCodeName = 'MockNavigator';
  16245. this.appName = 'MockNavigator';
  16246. this.appVersion = 'MockNavigator';
  16247. this.platform = 'MockNavigator';
  16248. this.userAgent = 'MockNavigator';
  16249. }
  16250. }
  16251. /**
  16252. * https://developer.mozilla.org/en-US/docs/Web/API/Performance
  16253. */
  16254. class MockPerformance {
  16255. constructor() {
  16256. this.timeOrigin = Date.now();
  16257. }
  16258. addEventListener() {
  16259. //
  16260. }
  16261. clearMarks() {
  16262. //
  16263. }
  16264. clearMeasures() {
  16265. //
  16266. }
  16267. clearResourceTimings() {
  16268. //
  16269. }
  16270. dispatchEvent() {
  16271. return true;
  16272. }
  16273. getEntries() {
  16274. return [];
  16275. }
  16276. getEntriesByName() {
  16277. return [];
  16278. }
  16279. getEntriesByType() {
  16280. return [];
  16281. }
  16282. // Stencil's implementation of `mark` is non-compliant with the `Performance` interface. Because Stencil will
  16283. // instantiate an instance of this class and may attempt to assign it to a variable of type `Performance`, the return
  16284. // type must match the `Performance` interface (rather than typing this function as returning `void` and ignoring the
  16285. // associated errors returned by the type checker)
  16286. // @ts-ignore
  16287. mark() {
  16288. //
  16289. }
  16290. // Stencil's implementation of `measure` is non-compliant with the `Performance` interface. Because Stencil will
  16291. // instantiate an instance of this class and may attempt to assign it to a variable of type `Performance`, the return
  16292. // type must match the `Performance` interface (rather than typing this function as returning `void` and ignoring the
  16293. // associated errors returned by the type checker)
  16294. // @ts-ignore
  16295. measure() {
  16296. //
  16297. }
  16298. get navigation() {
  16299. return {};
  16300. }
  16301. now() {
  16302. return Date.now() - this.timeOrigin;
  16303. }
  16304. get onresourcetimingbufferfull() {
  16305. return null;
  16306. }
  16307. removeEventListener() {
  16308. //
  16309. }
  16310. setResourceTimingBufferSize() {
  16311. //
  16312. }
  16313. get timing() {
  16314. return {};
  16315. }
  16316. toJSON() {
  16317. //
  16318. }
  16319. }
  16320. function resetPerformance(perf) {
  16321. if (perf != null) {
  16322. try {
  16323. perf.timeOrigin = Date.now();
  16324. }
  16325. catch (e) { }
  16326. }
  16327. }
  16328. class MockStorage {
  16329. constructor() {
  16330. this.items = new Map();
  16331. }
  16332. key(_value) {
  16333. //
  16334. }
  16335. getItem(key) {
  16336. key = String(key);
  16337. if (this.items.has(key)) {
  16338. return this.items.get(key);
  16339. }
  16340. return null;
  16341. }
  16342. setItem(key, value) {
  16343. if (value == null) {
  16344. value = 'null';
  16345. }
  16346. this.items.set(String(key), String(value));
  16347. }
  16348. removeItem(key) {
  16349. this.items.delete(String(key));
  16350. }
  16351. clear() {
  16352. this.items.clear();
  16353. }
  16354. }
  16355. const nativeClearInterval = clearInterval;
  16356. const nativeClearTimeout = clearTimeout;
  16357. const nativeSetInterval = setInterval;
  16358. const nativeSetTimeout = setTimeout;
  16359. const nativeURL = URL;
  16360. class MockWindow {
  16361. constructor(html = null) {
  16362. if (html !== false) {
  16363. this.document = new MockDocument(html, this);
  16364. }
  16365. else {
  16366. this.document = null;
  16367. }
  16368. this.performance = new MockPerformance();
  16369. this.customElements = new MockCustomElementRegistry(this);
  16370. this.console = createConsole();
  16371. resetWindowDefaults(this);
  16372. resetWindowDimensions(this);
  16373. }
  16374. addEventListener(type, handler) {
  16375. addEventListener(this, type, handler);
  16376. }
  16377. alert(msg) {
  16378. if (this.console) {
  16379. this.console.debug(msg);
  16380. }
  16381. else {
  16382. console.debug(msg);
  16383. }
  16384. }
  16385. blur() {
  16386. /**/
  16387. }
  16388. cancelAnimationFrame(id) {
  16389. this.__clearTimeout(id);
  16390. }
  16391. cancelIdleCallback(id) {
  16392. this.__clearTimeout(id);
  16393. }
  16394. get CharacterData() {
  16395. if (this.__charDataCstr == null) {
  16396. const ownerDocument = this.document;
  16397. this.__charDataCstr = class extends MockNode {
  16398. constructor() {
  16399. super(ownerDocument, 0, 'test', '');
  16400. throw new Error('Illegal constructor: cannot construct CharacterData');
  16401. }
  16402. };
  16403. }
  16404. return this.__charDataCstr;
  16405. }
  16406. set CharacterData(charDataCstr) {
  16407. this.__charDataCstr = charDataCstr;
  16408. }
  16409. clearInterval(id) {
  16410. this.__clearInterval(id);
  16411. }
  16412. clearTimeout(id) {
  16413. this.__clearTimeout(id);
  16414. }
  16415. close() {
  16416. resetWindow(this);
  16417. }
  16418. confirm() {
  16419. return false;
  16420. }
  16421. get CSS() {
  16422. return {
  16423. supports: () => true,
  16424. };
  16425. }
  16426. get Document() {
  16427. if (this.__docCstr == null) {
  16428. const win = this;
  16429. this.__docCstr = class extends MockDocument {
  16430. constructor() {
  16431. super(false, win);
  16432. throw new Error('Illegal constructor: cannot construct Document');
  16433. }
  16434. };
  16435. }
  16436. return this.__docCstr;
  16437. }
  16438. set Document(docCstr) {
  16439. this.__docCstr = docCstr;
  16440. }
  16441. get DocumentFragment() {
  16442. if (this.__docFragCstr == null) {
  16443. const ownerDocument = this.document;
  16444. this.__docFragCstr = class extends MockDocumentFragment {
  16445. constructor() {
  16446. super(ownerDocument);
  16447. throw new Error('Illegal constructor: cannot construct DocumentFragment');
  16448. }
  16449. };
  16450. }
  16451. return this.__docFragCstr;
  16452. }
  16453. set DocumentFragment(docFragCstr) {
  16454. this.__docFragCstr = docFragCstr;
  16455. }
  16456. get DocumentType() {
  16457. if (this.__docTypeCstr == null) {
  16458. const ownerDocument = this.document;
  16459. this.__docTypeCstr = class extends MockNode {
  16460. constructor() {
  16461. super(ownerDocument, 0, 'test', '');
  16462. throw new Error('Illegal constructor: cannot construct DocumentType');
  16463. }
  16464. };
  16465. }
  16466. return this.__docTypeCstr;
  16467. }
  16468. set DocumentType(docTypeCstr) {
  16469. this.__docTypeCstr = docTypeCstr;
  16470. }
  16471. get DOMTokenList() {
  16472. if (this.__domTokenListCstr == null) {
  16473. this.__domTokenListCstr = class MockDOMTokenList {
  16474. };
  16475. }
  16476. return this.__domTokenListCstr;
  16477. }
  16478. set DOMTokenList(domTokenListCstr) {
  16479. this.__domTokenListCstr = domTokenListCstr;
  16480. }
  16481. dispatchEvent(ev) {
  16482. return dispatchEvent(this, ev);
  16483. }
  16484. get Element() {
  16485. if (this.__elementCstr == null) {
  16486. const ownerDocument = this.document;
  16487. this.__elementCstr = class extends MockElement {
  16488. constructor() {
  16489. super(ownerDocument, '');
  16490. throw new Error('Illegal constructor: cannot construct Element');
  16491. }
  16492. };
  16493. }
  16494. return this.__elementCstr;
  16495. }
  16496. fetch(input, init) {
  16497. if (typeof fetch === 'function') {
  16498. return fetch(input, init);
  16499. }
  16500. throw new Error(`fetch() not implemented`);
  16501. }
  16502. focus() {
  16503. /**/
  16504. }
  16505. getComputedStyle(_) {
  16506. return {
  16507. cssText: '',
  16508. length: 0,
  16509. parentRule: null,
  16510. getPropertyPriority() {
  16511. return null;
  16512. },
  16513. getPropertyValue() {
  16514. return '';
  16515. },
  16516. item() {
  16517. return null;
  16518. },
  16519. removeProperty() {
  16520. return null;
  16521. },
  16522. setProperty() {
  16523. return null;
  16524. },
  16525. };
  16526. }
  16527. get globalThis() {
  16528. return this;
  16529. }
  16530. get history() {
  16531. if (this.__history == null) {
  16532. this.__history = new MockHistory();
  16533. }
  16534. return this.__history;
  16535. }
  16536. set history(hsty) {
  16537. this.__history = hsty;
  16538. }
  16539. get JSON() {
  16540. return JSON;
  16541. }
  16542. get HTMLElement() {
  16543. if (this.__htmlElementCstr == null) {
  16544. const ownerDocument = this.document;
  16545. this.__htmlElementCstr = class extends MockHTMLElement {
  16546. constructor() {
  16547. super(ownerDocument, '');
  16548. const observedAttributes = this.constructor.observedAttributes;
  16549. if (Array.isArray(observedAttributes) && typeof this.attributeChangedCallback === 'function') {
  16550. observedAttributes.forEach((attrName) => {
  16551. const attrValue = this.getAttribute(attrName);
  16552. if (attrValue != null) {
  16553. this.attributeChangedCallback(attrName, null, attrValue);
  16554. }
  16555. });
  16556. }
  16557. }
  16558. };
  16559. }
  16560. return this.__htmlElementCstr;
  16561. }
  16562. set HTMLElement(htmlElementCstr) {
  16563. this.__htmlElementCstr = htmlElementCstr;
  16564. }
  16565. get IntersectionObserver() {
  16566. return MockIntersectionObserver;
  16567. }
  16568. get localStorage() {
  16569. if (this.__localStorage == null) {
  16570. this.__localStorage = new MockStorage();
  16571. }
  16572. return this.__localStorage;
  16573. }
  16574. set localStorage(locStorage) {
  16575. this.__localStorage = locStorage;
  16576. }
  16577. get location() {
  16578. if (this.__location == null) {
  16579. this.__location = new MockLocation();
  16580. }
  16581. return this.__location;
  16582. }
  16583. set location(val) {
  16584. if (typeof val === 'string') {
  16585. if (this.__location == null) {
  16586. this.__location = new MockLocation();
  16587. }
  16588. this.__location.href = val;
  16589. }
  16590. else {
  16591. this.__location = val;
  16592. }
  16593. }
  16594. matchMedia() {
  16595. return {
  16596. matches: false,
  16597. };
  16598. }
  16599. get Node() {
  16600. if (this.__nodeCstr == null) {
  16601. const ownerDocument = this.document;
  16602. this.__nodeCstr = class extends MockNode {
  16603. constructor() {
  16604. super(ownerDocument, 0, 'test', '');
  16605. throw new Error('Illegal constructor: cannot construct Node');
  16606. }
  16607. };
  16608. }
  16609. return this.__nodeCstr;
  16610. }
  16611. get NodeList() {
  16612. if (this.__nodeListCstr == null) {
  16613. const ownerDocument = this.document;
  16614. this.__nodeListCstr = class extends MockNodeList {
  16615. constructor() {
  16616. super(ownerDocument, [], 0);
  16617. throw new Error('Illegal constructor: cannot construct NodeList');
  16618. }
  16619. };
  16620. }
  16621. return this.__nodeListCstr;
  16622. }
  16623. get navigator() {
  16624. if (this.__navigator == null) {
  16625. this.__navigator = new MockNavigator();
  16626. }
  16627. return this.__navigator;
  16628. }
  16629. set navigator(nav) {
  16630. this.__navigator = nav;
  16631. }
  16632. get parent() {
  16633. return null;
  16634. }
  16635. prompt() {
  16636. return '';
  16637. }
  16638. open() {
  16639. return null;
  16640. }
  16641. get origin() {
  16642. return this.location.origin;
  16643. }
  16644. removeEventListener(type, handler) {
  16645. removeEventListener(this, type, handler);
  16646. }
  16647. requestAnimationFrame(callback) {
  16648. return this.setTimeout(() => {
  16649. callback(Date.now());
  16650. }, 0);
  16651. }
  16652. requestIdleCallback(callback) {
  16653. return this.setTimeout(() => {
  16654. callback({
  16655. didTimeout: false,
  16656. timeRemaining: () => 0,
  16657. });
  16658. }, 0);
  16659. }
  16660. scroll(_x, _y) {
  16661. /**/
  16662. }
  16663. scrollBy(_x, _y) {
  16664. /**/
  16665. }
  16666. scrollTo(_x, _y) {
  16667. /**/
  16668. }
  16669. get self() {
  16670. return this;
  16671. }
  16672. get sessionStorage() {
  16673. if (this.__sessionStorage == null) {
  16674. this.__sessionStorage = new MockStorage();
  16675. }
  16676. return this.__sessionStorage;
  16677. }
  16678. set sessionStorage(locStorage) {
  16679. this.__sessionStorage = locStorage;
  16680. }
  16681. setInterval(callback, ms, ...args) {
  16682. if (this.__timeouts == null) {
  16683. this.__timeouts = new Set();
  16684. }
  16685. ms = Math.min(ms, this.__maxTimeout);
  16686. if (this.__allowInterval) {
  16687. const intervalId = this.__setInterval(() => {
  16688. if (this.__timeouts) {
  16689. this.__timeouts.delete(intervalId);
  16690. try {
  16691. callback(...args);
  16692. }
  16693. catch (e) {
  16694. if (this.console) {
  16695. this.console.error(e);
  16696. }
  16697. else {
  16698. console.error(e);
  16699. }
  16700. }
  16701. }
  16702. }, ms);
  16703. if (this.__timeouts) {
  16704. this.__timeouts.add(intervalId);
  16705. }
  16706. return intervalId;
  16707. }
  16708. const timeoutId = this.__setTimeout(() => {
  16709. if (this.__timeouts) {
  16710. this.__timeouts.delete(timeoutId);
  16711. try {
  16712. callback(...args);
  16713. }
  16714. catch (e) {
  16715. if (this.console) {
  16716. this.console.error(e);
  16717. }
  16718. else {
  16719. console.error(e);
  16720. }
  16721. }
  16722. }
  16723. }, ms);
  16724. if (this.__timeouts) {
  16725. this.__timeouts.add(timeoutId);
  16726. }
  16727. return timeoutId;
  16728. }
  16729. setTimeout(callback, ms, ...args) {
  16730. if (this.__timeouts == null) {
  16731. this.__timeouts = new Set();
  16732. }
  16733. ms = Math.min(ms, this.__maxTimeout);
  16734. const timeoutId = this.__setTimeout(() => {
  16735. if (this.__timeouts) {
  16736. this.__timeouts.delete(timeoutId);
  16737. try {
  16738. callback(...args);
  16739. }
  16740. catch (e) {
  16741. if (this.console) {
  16742. this.console.error(e);
  16743. }
  16744. else {
  16745. console.error(e);
  16746. }
  16747. }
  16748. }
  16749. }, ms);
  16750. if (this.__timeouts) {
  16751. this.__timeouts.add(timeoutId);
  16752. }
  16753. return timeoutId;
  16754. }
  16755. get top() {
  16756. return this;
  16757. }
  16758. get window() {
  16759. return this;
  16760. }
  16761. onanimationstart() {
  16762. /**/
  16763. }
  16764. onanimationend() {
  16765. /**/
  16766. }
  16767. onanimationiteration() {
  16768. /**/
  16769. }
  16770. onabort() {
  16771. /**/
  16772. }
  16773. onauxclick() {
  16774. /**/
  16775. }
  16776. onbeforecopy() {
  16777. /**/
  16778. }
  16779. onbeforecut() {
  16780. /**/
  16781. }
  16782. onbeforepaste() {
  16783. /**/
  16784. }
  16785. onblur() {
  16786. /**/
  16787. }
  16788. oncancel() {
  16789. /**/
  16790. }
  16791. oncanplay() {
  16792. /**/
  16793. }
  16794. oncanplaythrough() {
  16795. /**/
  16796. }
  16797. onchange() {
  16798. /**/
  16799. }
  16800. onclick() {
  16801. /**/
  16802. }
  16803. onclose() {
  16804. /**/
  16805. }
  16806. oncontextmenu() {
  16807. /**/
  16808. }
  16809. oncopy() {
  16810. /**/
  16811. }
  16812. oncuechange() {
  16813. /**/
  16814. }
  16815. oncut() {
  16816. /**/
  16817. }
  16818. ondblclick() {
  16819. /**/
  16820. }
  16821. ondrag() {
  16822. /**/
  16823. }
  16824. ondragend() {
  16825. /**/
  16826. }
  16827. ondragenter() {
  16828. /**/
  16829. }
  16830. ondragleave() {
  16831. /**/
  16832. }
  16833. ondragover() {
  16834. /**/
  16835. }
  16836. ondragstart() {
  16837. /**/
  16838. }
  16839. ondrop() {
  16840. /**/
  16841. }
  16842. ondurationchange() {
  16843. /**/
  16844. }
  16845. onemptied() {
  16846. /**/
  16847. }
  16848. onended() {
  16849. /**/
  16850. }
  16851. onerror() {
  16852. /**/
  16853. }
  16854. onfocus() {
  16855. /**/
  16856. }
  16857. onfocusin() {
  16858. /**/
  16859. }
  16860. onfocusout() {
  16861. /**/
  16862. }
  16863. onformdata() {
  16864. /**/
  16865. }
  16866. onfullscreenchange() {
  16867. /**/
  16868. }
  16869. onfullscreenerror() {
  16870. /**/
  16871. }
  16872. ongotpointercapture() {
  16873. /**/
  16874. }
  16875. oninput() {
  16876. /**/
  16877. }
  16878. oninvalid() {
  16879. /**/
  16880. }
  16881. onkeydown() {
  16882. /**/
  16883. }
  16884. onkeypress() {
  16885. /**/
  16886. }
  16887. onkeyup() {
  16888. /**/
  16889. }
  16890. onload() {
  16891. /**/
  16892. }
  16893. onloadeddata() {
  16894. /**/
  16895. }
  16896. onloadedmetadata() {
  16897. /**/
  16898. }
  16899. onloadstart() {
  16900. /**/
  16901. }
  16902. onlostpointercapture() {
  16903. /**/
  16904. }
  16905. onmousedown() {
  16906. /**/
  16907. }
  16908. onmouseenter() {
  16909. /**/
  16910. }
  16911. onmouseleave() {
  16912. /**/
  16913. }
  16914. onmousemove() {
  16915. /**/
  16916. }
  16917. onmouseout() {
  16918. /**/
  16919. }
  16920. onmouseover() {
  16921. /**/
  16922. }
  16923. onmouseup() {
  16924. /**/
  16925. }
  16926. onmousewheel() {
  16927. /**/
  16928. }
  16929. onpaste() {
  16930. /**/
  16931. }
  16932. onpause() {
  16933. /**/
  16934. }
  16935. onplay() {
  16936. /**/
  16937. }
  16938. onplaying() {
  16939. /**/
  16940. }
  16941. onpointercancel() {
  16942. /**/
  16943. }
  16944. onpointerdown() {
  16945. /**/
  16946. }
  16947. onpointerenter() {
  16948. /**/
  16949. }
  16950. onpointerleave() {
  16951. /**/
  16952. }
  16953. onpointermove() {
  16954. /**/
  16955. }
  16956. onpointerout() {
  16957. /**/
  16958. }
  16959. onpointerover() {
  16960. /**/
  16961. }
  16962. onpointerup() {
  16963. /**/
  16964. }
  16965. onprogress() {
  16966. /**/
  16967. }
  16968. onratechange() {
  16969. /**/
  16970. }
  16971. onreset() {
  16972. /**/
  16973. }
  16974. onresize() {
  16975. /**/
  16976. }
  16977. onscroll() {
  16978. /**/
  16979. }
  16980. onsearch() {
  16981. /**/
  16982. }
  16983. onseeked() {
  16984. /**/
  16985. }
  16986. onseeking() {
  16987. /**/
  16988. }
  16989. onselect() {
  16990. /**/
  16991. }
  16992. onselectstart() {
  16993. /**/
  16994. }
  16995. onstalled() {
  16996. /**/
  16997. }
  16998. onsubmit() {
  16999. /**/
  17000. }
  17001. onsuspend() {
  17002. /**/
  17003. }
  17004. ontimeupdate() {
  17005. /**/
  17006. }
  17007. ontoggle() {
  17008. /**/
  17009. }
  17010. onvolumechange() {
  17011. /**/
  17012. }
  17013. onwaiting() {
  17014. /**/
  17015. }
  17016. onwebkitfullscreenchange() {
  17017. /**/
  17018. }
  17019. onwebkitfullscreenerror() {
  17020. /**/
  17021. }
  17022. onwheel() {
  17023. /**/
  17024. }
  17025. }
  17026. addGlobalsToWindowPrototype(MockWindow.prototype);
  17027. function resetWindowDefaults(win) {
  17028. win.__clearInterval = nativeClearInterval;
  17029. win.__clearTimeout = nativeClearTimeout;
  17030. win.__setInterval = nativeSetInterval;
  17031. win.__setTimeout = nativeSetTimeout;
  17032. win.__maxTimeout = 30000;
  17033. win.__allowInterval = true;
  17034. win.URL = nativeURL;
  17035. }
  17036. function cloneWindow(srcWin, opts = {}) {
  17037. if (srcWin == null) {
  17038. return null;
  17039. }
  17040. const clonedWin = new MockWindow(false);
  17041. if (!opts.customElementProxy) {
  17042. // TODO(STENCIL-345) - Evaluate reconciling MockWindow, Window differences
  17043. // @ts-ignore
  17044. srcWin.customElements = null;
  17045. }
  17046. if (srcWin.document != null) {
  17047. const clonedDoc = new MockDocument(false, clonedWin);
  17048. clonedWin.document = clonedDoc;
  17049. clonedDoc.documentElement = srcWin.document.documentElement.cloneNode(true);
  17050. }
  17051. else {
  17052. clonedWin.document = new MockDocument(null, clonedWin);
  17053. }
  17054. return clonedWin;
  17055. }
  17056. function cloneDocument(srcDoc) {
  17057. if (srcDoc == null) {
  17058. return null;
  17059. }
  17060. const dstWin = cloneWindow(srcDoc.defaultView);
  17061. return dstWin.document;
  17062. }
  17063. function resetWindow(win) {
  17064. if (win != null) {
  17065. if (win.__timeouts) {
  17066. win.__timeouts.forEach((timeoutId) => {
  17067. nativeClearInterval(timeoutId);
  17068. nativeClearTimeout(timeoutId);
  17069. });
  17070. win.__timeouts.clear();
  17071. }
  17072. if (win.customElements && win.customElements.clear) {
  17073. win.customElements.clear();
  17074. }
  17075. resetDocument(win.document);
  17076. resetPerformance(win.performance);
  17077. for (const key in win) {
  17078. if (win.hasOwnProperty(key) && key !== 'document' && key !== 'performance' && key !== 'customElements') {
  17079. delete win[key];
  17080. }
  17081. }
  17082. resetWindowDefaults(win);
  17083. resetWindowDimensions(win);
  17084. resetEventListeners(win);
  17085. if (win.document != null) {
  17086. try {
  17087. win.document.defaultView = win;
  17088. }
  17089. catch (e) { }
  17090. }
  17091. // ensure we don't hold onto nodeFetch values
  17092. win.fetch = null;
  17093. win.Headers = null;
  17094. win.Request = null;
  17095. win.Response = null;
  17096. win.FetchError = null;
  17097. }
  17098. }
  17099. function resetWindowDimensions(win) {
  17100. try {
  17101. win.devicePixelRatio = 1;
  17102. win.innerHeight = 768;
  17103. win.innerWidth = 1366;
  17104. win.pageXOffset = 0;
  17105. win.pageYOffset = 0;
  17106. win.screenLeft = 0;
  17107. win.screenTop = 0;
  17108. win.screenX = 0;
  17109. win.screenY = 0;
  17110. win.scrollX = 0;
  17111. win.scrollY = 0;
  17112. win.screen = {
  17113. availHeight: win.innerHeight,
  17114. availLeft: 0,
  17115. availTop: 0,
  17116. availWidth: win.innerWidth,
  17117. colorDepth: 24,
  17118. height: win.innerHeight,
  17119. keepAwake: false,
  17120. orientation: {
  17121. angle: 0,
  17122. type: 'portrait-primary',
  17123. },
  17124. pixelDepth: 24,
  17125. width: win.innerWidth,
  17126. };
  17127. }
  17128. catch (e) { }
  17129. }
  17130. class MockDocument extends MockHTMLElement {
  17131. constructor(html = null, win = null) {
  17132. super(null, null);
  17133. this.nodeName = "#document" /* DOCUMENT_NODE */;
  17134. this.nodeType = 9 /* DOCUMENT_NODE */;
  17135. this.defaultView = win;
  17136. this.cookie = '';
  17137. this.referrer = '';
  17138. this.appendChild(this.createDocumentTypeNode());
  17139. if (typeof html === 'string') {
  17140. const parsedDoc = parseDocumentUtil(this, html);
  17141. const documentElement = parsedDoc.children.find((elm) => elm.nodeName === 'HTML');
  17142. if (documentElement != null) {
  17143. this.appendChild(documentElement);
  17144. setOwnerDocument(documentElement, this);
  17145. }
  17146. }
  17147. else if (html !== false) {
  17148. const documentElement = new MockHTMLElement(this, 'html');
  17149. this.appendChild(documentElement);
  17150. documentElement.appendChild(new MockHTMLElement(this, 'head'));
  17151. documentElement.appendChild(new MockHTMLElement(this, 'body'));
  17152. }
  17153. }
  17154. get dir() {
  17155. return this.documentElement.dir;
  17156. }
  17157. set dir(value) {
  17158. this.documentElement.dir = value;
  17159. }
  17160. get location() {
  17161. if (this.defaultView != null) {
  17162. return this.defaultView.location;
  17163. }
  17164. return null;
  17165. }
  17166. set location(val) {
  17167. if (this.defaultView != null) {
  17168. this.defaultView.location = val;
  17169. }
  17170. }
  17171. get baseURI() {
  17172. const baseNode = this.head.childNodes.find((node) => node.nodeName === 'BASE');
  17173. if (baseNode) {
  17174. return baseNode.href;
  17175. }
  17176. return this.URL;
  17177. }
  17178. get URL() {
  17179. return this.location.href;
  17180. }
  17181. get styleSheets() {
  17182. return this.querySelectorAll('style');
  17183. }
  17184. get scripts() {
  17185. return this.querySelectorAll('script');
  17186. }
  17187. get forms() {
  17188. return this.querySelectorAll('form');
  17189. }
  17190. get images() {
  17191. return this.querySelectorAll('img');
  17192. }
  17193. get scrollingElement() {
  17194. return this.documentElement;
  17195. }
  17196. get documentElement() {
  17197. for (let i = this.childNodes.length - 1; i >= 0; i--) {
  17198. if (this.childNodes[i].nodeName === 'HTML') {
  17199. return this.childNodes[i];
  17200. }
  17201. }
  17202. const documentElement = new MockHTMLElement(this, 'html');
  17203. this.appendChild(documentElement);
  17204. return documentElement;
  17205. }
  17206. set documentElement(documentElement) {
  17207. for (let i = this.childNodes.length - 1; i >= 0; i--) {
  17208. if (this.childNodes[i].nodeType !== 10 /* DOCUMENT_TYPE_NODE */) {
  17209. this.childNodes[i].remove();
  17210. }
  17211. }
  17212. if (documentElement != null) {
  17213. this.appendChild(documentElement);
  17214. setOwnerDocument(documentElement, this);
  17215. }
  17216. }
  17217. get head() {
  17218. const documentElement = this.documentElement;
  17219. for (let i = 0; i < documentElement.childNodes.length; i++) {
  17220. if (documentElement.childNodes[i].nodeName === 'HEAD') {
  17221. return documentElement.childNodes[i];
  17222. }
  17223. }
  17224. const head = new MockHTMLElement(this, 'head');
  17225. documentElement.insertBefore(head, documentElement.firstChild);
  17226. return head;
  17227. }
  17228. set head(head) {
  17229. const documentElement = this.documentElement;
  17230. for (let i = documentElement.childNodes.length - 1; i >= 0; i--) {
  17231. if (documentElement.childNodes[i].nodeName === 'HEAD') {
  17232. documentElement.childNodes[i].remove();
  17233. }
  17234. }
  17235. if (head != null) {
  17236. documentElement.insertBefore(head, documentElement.firstChild);
  17237. setOwnerDocument(head, this);
  17238. }
  17239. }
  17240. get body() {
  17241. const documentElement = this.documentElement;
  17242. for (let i = documentElement.childNodes.length - 1; i >= 0; i--) {
  17243. if (documentElement.childNodes[i].nodeName === 'BODY') {
  17244. return documentElement.childNodes[i];
  17245. }
  17246. }
  17247. const body = new MockHTMLElement(this, 'body');
  17248. documentElement.appendChild(body);
  17249. return body;
  17250. }
  17251. set body(body) {
  17252. const documentElement = this.documentElement;
  17253. for (let i = documentElement.childNodes.length - 1; i >= 0; i--) {
  17254. if (documentElement.childNodes[i].nodeName === 'BODY') {
  17255. documentElement.childNodes[i].remove();
  17256. }
  17257. }
  17258. if (body != null) {
  17259. documentElement.appendChild(body);
  17260. setOwnerDocument(body, this);
  17261. }
  17262. }
  17263. appendChild(newNode) {
  17264. newNode.remove();
  17265. newNode.parentNode = this;
  17266. this.childNodes.push(newNode);
  17267. return newNode;
  17268. }
  17269. createComment(data) {
  17270. return new MockComment(this, data);
  17271. }
  17272. createAttribute(attrName) {
  17273. return new MockAttr(attrName.toLowerCase(), '');
  17274. }
  17275. createAttributeNS(namespaceURI, attrName) {
  17276. return new MockAttr(attrName, '', namespaceURI);
  17277. }
  17278. createElement(tagName) {
  17279. if (tagName === "#document" /* DOCUMENT_NODE */) {
  17280. const doc = new MockDocument(false);
  17281. doc.nodeName = tagName;
  17282. doc.parentNode = null;
  17283. return doc;
  17284. }
  17285. return createElement(this, tagName);
  17286. }
  17287. createElementNS(namespaceURI, tagName) {
  17288. const elmNs = createElementNS(this, namespaceURI, tagName);
  17289. elmNs.namespaceURI = namespaceURI;
  17290. return elmNs;
  17291. }
  17292. createTextNode(text) {
  17293. return new MockTextNode(this, text);
  17294. }
  17295. createDocumentFragment() {
  17296. return new MockDocumentFragment(this);
  17297. }
  17298. createDocumentTypeNode() {
  17299. return new MockDocumentTypeNode(this);
  17300. }
  17301. getElementById(id) {
  17302. return getElementById(this, id);
  17303. }
  17304. getElementsByName(elmName) {
  17305. return getElementsByName(this, elmName.toLowerCase());
  17306. }
  17307. get title() {
  17308. const title = this.head.childNodes.find((elm) => elm.nodeName === 'TITLE');
  17309. if (title != null && typeof title.textContent === 'string') {
  17310. return title.textContent.trim();
  17311. }
  17312. return '';
  17313. }
  17314. set title(value) {
  17315. const head = this.head;
  17316. let title = head.childNodes.find((elm) => elm.nodeName === 'TITLE');
  17317. if (title == null) {
  17318. title = this.createElement('title');
  17319. head.appendChild(title);
  17320. }
  17321. title.textContent = value;
  17322. }
  17323. }
  17324. function createDocument(html = null) {
  17325. return new MockWindow(html).document;
  17326. }
  17327. function resetDocument(doc) {
  17328. if (doc != null) {
  17329. resetEventListeners(doc);
  17330. const documentElement = doc.documentElement;
  17331. if (documentElement != null) {
  17332. resetElement(documentElement);
  17333. for (let i = 0, ii = documentElement.childNodes.length; i < ii; i++) {
  17334. const childNode = documentElement.childNodes[i];
  17335. resetElement(childNode);
  17336. childNode.childNodes.length = 0;
  17337. }
  17338. }
  17339. for (const key in doc) {
  17340. if (doc.hasOwnProperty(key) && !DOC_KEY_KEEPERS.has(key)) {
  17341. delete doc[key];
  17342. }
  17343. }
  17344. try {
  17345. doc.nodeName = "#document" /* DOCUMENT_NODE */;
  17346. }
  17347. catch (e) { }
  17348. try {
  17349. doc.nodeType = 9 /* DOCUMENT_NODE */;
  17350. }
  17351. catch (e) { }
  17352. try {
  17353. doc.cookie = '';
  17354. }
  17355. catch (e) { }
  17356. try {
  17357. doc.referrer = '';
  17358. }
  17359. catch (e) { }
  17360. }
  17361. }
  17362. const DOC_KEY_KEEPERS = new Set([
  17363. 'nodeName',
  17364. 'nodeType',
  17365. 'nodeValue',
  17366. 'ownerDocument',
  17367. 'parentNode',
  17368. 'childNodes',
  17369. '_shadowRoot',
  17370. ]);
  17371. function getElementById(elm, id) {
  17372. const children = elm.children;
  17373. for (let i = 0, ii = children.length; i < ii; i++) {
  17374. const childElm = children[i];
  17375. if (childElm.id === id) {
  17376. return childElm;
  17377. }
  17378. const childElmFound = getElementById(childElm, id);
  17379. if (childElmFound != null) {
  17380. return childElmFound;
  17381. }
  17382. }
  17383. return null;
  17384. }
  17385. function getElementsByName(elm, elmName, foundElms = []) {
  17386. const children = elm.children;
  17387. for (let i = 0, ii = children.length; i < ii; i++) {
  17388. const childElm = children[i];
  17389. if (childElm.name && childElm.name.toLowerCase() === elmName) {
  17390. foundElms.push(childElm);
  17391. }
  17392. getElementsByName(childElm, elmName, foundElms);
  17393. }
  17394. return foundElms;
  17395. }
  17396. function setOwnerDocument(elm, ownerDocument) {
  17397. for (let i = 0, ii = elm.childNodes.length; i < ii; i++) {
  17398. elm.childNodes[i].ownerDocument = ownerDocument;
  17399. if (elm.childNodes[i].nodeType === 1 /* ELEMENT_NODE */) {
  17400. setOwnerDocument(elm.childNodes[i], ownerDocument);
  17401. }
  17402. }
  17403. }
  17404. const isEmptable = (o) => isOutputTargetDist(o) ||
  17405. isOutputTargetDistCustomElements(o) ||
  17406. isOutputTargetDistCustomElementsBundle(o) ||
  17407. isOutputTargetWww(o) ||
  17408. isOutputTargetDistLazy(o) ||
  17409. isOutputTargetDistLazyLoader(o) ||
  17410. isOutputTargetHydrate(o);
  17411. const emptyOutputTargets = async (config, compilerCtx, buildCtx) => {
  17412. if (buildCtx.isRebuild) {
  17413. return;
  17414. }
  17415. const cleanDirs = config.outputTargets
  17416. .filter(isEmptable)
  17417. .filter((o) => o.empty === true)
  17418. .map((o) => o.dir || o.esmDir)
  17419. .filter(isString$1);
  17420. if (cleanDirs.length === 0) {
  17421. return;
  17422. }
  17423. const timeSpan = buildCtx.createTimeSpan(`cleaning ${cleanDirs.length} dirs`, true);
  17424. await compilerCtx.fs.emptyDirs(cleanDirs);
  17425. timeSpan.finish('cleaning dirs finished');
  17426. };
  17427. const parseCssImports = async (config, compilerCtx, buildCtx, srcFilePath, resolvedFilePath, styleText, styleDocs) => {
  17428. const isCssEntry = resolvedFilePath.toLowerCase().endsWith('.css');
  17429. const allCssImports = [];
  17430. const concatStyleText = await updateCssImports(config, compilerCtx, buildCtx, isCssEntry, srcFilePath, resolvedFilePath, styleText, allCssImports, new Set(), styleDocs);
  17431. return {
  17432. imports: allCssImports,
  17433. styleText: concatStyleText,
  17434. };
  17435. };
  17436. const updateCssImports = async (config, compilerCtx, buildCtx, isCssEntry, srcFilePath, resolvedFilePath, styleText, allCssImports, noLoop, styleDocs) => {
  17437. if (noLoop.has(resolvedFilePath)) {
  17438. return styleText;
  17439. }
  17440. noLoop.add(resolvedFilePath);
  17441. if (styleDocs != null) {
  17442. parseStyleDocs(styleDocs, styleText);
  17443. }
  17444. const cssImports = await getCssImports(config, compilerCtx, buildCtx, resolvedFilePath, styleText);
  17445. if (cssImports.length === 0) {
  17446. return styleText;
  17447. }
  17448. for (const cssImport of cssImports) {
  17449. if (!allCssImports.includes(cssImport.filePath)) {
  17450. allCssImports.push(cssImport.filePath);
  17451. }
  17452. }
  17453. await Promise.all(cssImports.map(async (cssImportData) => {
  17454. await concatCssImport(config, compilerCtx, buildCtx, isCssEntry, srcFilePath, cssImportData, allCssImports, noLoop, styleDocs);
  17455. }));
  17456. return replaceImportDeclarations(styleText, cssImports, isCssEntry);
  17457. };
  17458. const concatCssImport = async (config, compilerCtx, buildCtx, isCssEntry, srcFilePath, cssImportData, allCssImports, noLoop, styleDocs) => {
  17459. cssImportData.styleText = await loadStyleText(compilerCtx, cssImportData);
  17460. if (typeof cssImportData.styleText === 'string') {
  17461. cssImportData.styleText = await updateCssImports(config, compilerCtx, buildCtx, isCssEntry, cssImportData.filePath, cssImportData.filePath, cssImportData.styleText, allCssImports, noLoop, styleDocs);
  17462. }
  17463. else {
  17464. const err = buildError(buildCtx.diagnostics);
  17465. err.messageText = `Unable to read css import: ${cssImportData.srcImport}`;
  17466. err.absFilePath = srcFilePath;
  17467. }
  17468. };
  17469. const loadStyleText = async (compilerCtx, cssImportData) => {
  17470. let styleText = null;
  17471. try {
  17472. styleText = await compilerCtx.fs.readFile(cssImportData.filePath);
  17473. }
  17474. catch (e) {
  17475. if (cssImportData.altFilePath) {
  17476. try {
  17477. styleText = await compilerCtx.fs.readFile(cssImportData.filePath);
  17478. }
  17479. catch (e) { }
  17480. }
  17481. }
  17482. return styleText;
  17483. };
  17484. const getCssImports = async (config, compilerCtx, buildCtx, filePath, styleText) => {
  17485. const imports = [];
  17486. if (!styleText.includes('@import')) {
  17487. // no @import at all, so don't bother
  17488. return imports;
  17489. }
  17490. styleText = stripCssComments(styleText);
  17491. const dir = dirname(filePath);
  17492. const importeeExt = filePath.split('.').pop().toLowerCase();
  17493. let r;
  17494. const IMPORT_RE = /(@import)\s+(url\()?\s?(.*?)\s?\)?([^;]*);?/gi;
  17495. while ((r = IMPORT_RE.exec(styleText))) {
  17496. const cssImportData = {
  17497. srcImport: r[0],
  17498. url: r[4].replace(/[\"\'\)]/g, ''),
  17499. };
  17500. if (!isLocalCssImport(cssImportData.srcImport)) {
  17501. // do nothing for @import url(http://external.css)
  17502. config.logger.debug(`did not resolve external css @import: ${cssImportData.srcImport}`);
  17503. continue;
  17504. }
  17505. if (isCssNodeModule(cssImportData.url)) {
  17506. // node resolve this path cuz it starts with ~
  17507. await resolveCssNodeModule(config, compilerCtx, buildCtx.diagnostics, filePath, cssImportData);
  17508. }
  17509. else if (isAbsolute$1(cssImportData.url)) {
  17510. // absolute path already
  17511. cssImportData.filePath = normalizePath$1(cssImportData.url);
  17512. }
  17513. else {
  17514. // relative path
  17515. cssImportData.filePath = normalizePath$1(join(dir, cssImportData.url));
  17516. }
  17517. if (importeeExt !== 'css' && !cssImportData.filePath.toLowerCase().endsWith('.css')) {
  17518. cssImportData.filePath += `.${importeeExt}`;
  17519. if (importeeExt === 'scss') {
  17520. const fileName = '_' + basename(cssImportData.filePath);
  17521. const dirPath = dirname(cssImportData.filePath);
  17522. cssImportData.altFilePath = normalizePath$1(join(dirPath, fileName));
  17523. }
  17524. }
  17525. if (typeof cssImportData.filePath === 'string') {
  17526. imports.push(cssImportData);
  17527. }
  17528. }
  17529. return imports;
  17530. };
  17531. const isCssNodeModule = (url) => url.startsWith('~');
  17532. const resolveCssNodeModule = async (config, compilerCtx, diagnostics, filePath, cssImportData) => {
  17533. try {
  17534. const m = getModuleId(cssImportData.url);
  17535. const resolved = await resolveModuleIdAsync(config.sys, compilerCtx.fs, {
  17536. moduleId: m.moduleId,
  17537. containingFile: filePath,
  17538. exts: [],
  17539. packageFilter: (pkg) => {
  17540. if (m.filePath !== '') {
  17541. pkg.main = m.filePath;
  17542. }
  17543. return pkg;
  17544. },
  17545. });
  17546. cssImportData.filePath = resolved.resolveId;
  17547. cssImportData.updatedImport = `@import "${cssImportData.filePath}";`;
  17548. }
  17549. catch (e) {
  17550. const d = buildError(diagnostics);
  17551. d.messageText = `Unable to resolve node module for CSS @import: ${cssImportData.url}`;
  17552. d.absFilePath = filePath;
  17553. }
  17554. };
  17555. const isLocalCssImport = (srcImport) => {
  17556. srcImport = srcImport.toLowerCase();
  17557. if (srcImport.includes('url(')) {
  17558. srcImport = srcImport.replace(/\"/g, '');
  17559. srcImport = srcImport.replace(/\'/g, '');
  17560. srcImport = srcImport.replace(/\s/g, '');
  17561. if (srcImport.includes('url(http') || srcImport.includes('url(//')) {
  17562. return false;
  17563. }
  17564. }
  17565. return true;
  17566. };
  17567. const replaceImportDeclarations = (styleText, cssImports, isCssEntry) => {
  17568. for (const cssImport of cssImports) {
  17569. if (isCssEntry) {
  17570. if (typeof cssImport.styleText === 'string') {
  17571. styleText = styleText.replace(cssImport.srcImport, cssImport.styleText);
  17572. }
  17573. }
  17574. else if (typeof cssImport.updatedImport === 'string') {
  17575. styleText = styleText.replace(cssImport.srcImport, cssImport.updatedImport);
  17576. }
  17577. }
  17578. return styleText;
  17579. };
  17580. const optimizeCss = async (config, compilerCtx, diagnostics, styleText, filePath) => {
  17581. if (typeof styleText !== 'string' || !styleText.length) {
  17582. // don't bother with invalid data
  17583. return styleText;
  17584. }
  17585. if ((config.autoprefixCss === false || config.autoprefixCss === null) && !config.minifyCss) {
  17586. // don't wanna autoprefix or minify, so just skip this
  17587. return styleText;
  17588. }
  17589. if (typeof filePath === 'string') {
  17590. filePath = normalizePath$1(filePath);
  17591. }
  17592. const opts = {
  17593. input: styleText,
  17594. filePath: filePath,
  17595. autoprefixer: config.autoprefixCss,
  17596. minify: config.minifyCss,
  17597. };
  17598. const cacheKey = await compilerCtx.cache.createKey('optimizeCss', optimizeCssId, opts);
  17599. const cachedContent = await compilerCtx.cache.get(cacheKey);
  17600. if (cachedContent != null) {
  17601. // let's use the cached data we already figured out
  17602. return cachedContent;
  17603. }
  17604. const minifyResults = await compilerCtx.worker.optimizeCss(opts);
  17605. minifyResults.diagnostics.forEach((d) => {
  17606. // collect up any diagnostics from minifying
  17607. diagnostics.push(d);
  17608. });
  17609. if (typeof minifyResults.output === 'string' && !hasError(diagnostics)) {
  17610. // cool, we got valid minified output
  17611. // only cache if we got a cache key, if not it probably has an @import
  17612. await compilerCtx.cache.put(cacheKey, minifyResults.output);
  17613. return minifyResults.output;
  17614. }
  17615. return styleText;
  17616. };
  17617. const runPluginResolveId = async (pluginCtx, importee) => {
  17618. for (const plugin of pluginCtx.config.plugins) {
  17619. if (isFunction(plugin.resolveId)) {
  17620. try {
  17621. const results = plugin.resolveId(importee, null, pluginCtx);
  17622. if (results != null) {
  17623. if (isFunction(results.then)) {
  17624. const promiseResults = await results;
  17625. if (promiseResults != null) {
  17626. return promiseResults;
  17627. }
  17628. }
  17629. else if (isString$1(results)) {
  17630. return results;
  17631. }
  17632. }
  17633. }
  17634. catch (e) {
  17635. catchError(pluginCtx.diagnostics, e);
  17636. }
  17637. }
  17638. }
  17639. // default resolvedId
  17640. return importee;
  17641. };
  17642. const runPluginLoad = async (pluginCtx, id) => {
  17643. for (const plugin of pluginCtx.config.plugins) {
  17644. if (isFunction(plugin.load)) {
  17645. try {
  17646. const results = plugin.load(id, pluginCtx);
  17647. if (results != null) {
  17648. if (isFunction(results.then)) {
  17649. const promiseResults = await results;
  17650. if (promiseResults != null) {
  17651. return promiseResults;
  17652. }
  17653. }
  17654. else if (isString$1(results)) {
  17655. return results;
  17656. }
  17657. }
  17658. }
  17659. catch (e) {
  17660. catchError(pluginCtx.diagnostics, e);
  17661. }
  17662. }
  17663. }
  17664. // default load()
  17665. return pluginCtx.fs.readFile(id);
  17666. };
  17667. const runPluginTransforms = async (config, compilerCtx, buildCtx, id, cmp) => {
  17668. const pluginCtx = {
  17669. config: config,
  17670. sys: config.sys,
  17671. fs: compilerCtx.fs,
  17672. cache: compilerCtx.cache,
  17673. diagnostics: [],
  17674. };
  17675. const resolvedId = await runPluginResolveId(pluginCtx, id);
  17676. const sourceText = await runPluginLoad(pluginCtx, resolvedId);
  17677. if (!isString$1(sourceText)) {
  17678. const diagnostic = buildError(buildCtx.diagnostics);
  17679. diagnostic.header = `Unable to find "${basename(id)}"`;
  17680. diagnostic.messageText = `The file "${relative$1(config.rootDir, id)}" was unable to load.`;
  17681. return null;
  17682. }
  17683. const transformResults = {
  17684. code: sourceText,
  17685. id: id,
  17686. };
  17687. const isRawCssFile = transformResults.id.toLowerCase().endsWith('.css');
  17688. const shouldParseCssDocs = cmp != null && config.outputTargets.some(isOutputTargetDocs);
  17689. if (isRawCssFile) {
  17690. // concat all css @imports into one file
  17691. // when the entry file is a .css file (not .scss)
  17692. // do this BEFORE transformations on css files
  17693. if (shouldParseCssDocs && cmp != null) {
  17694. cmp.styleDocs = cmp.styleDocs || [];
  17695. const cssParseResults = await parseCssImports(config, compilerCtx, buildCtx, id, id, transformResults.code, cmp.styleDocs);
  17696. transformResults.code = cssParseResults.styleText;
  17697. transformResults.dependencies = cssParseResults.imports;
  17698. }
  17699. else {
  17700. const cssParseResults = await parseCssImports(config, compilerCtx, buildCtx, id, id, transformResults.code);
  17701. transformResults.code = cssParseResults.styleText;
  17702. transformResults.dependencies = cssParseResults.imports;
  17703. }
  17704. }
  17705. for (const plugin of pluginCtx.config.plugins) {
  17706. if (isFunction(plugin.transform)) {
  17707. try {
  17708. let pluginTransformResults;
  17709. const results = plugin.transform(transformResults.code, transformResults.id, pluginCtx);
  17710. if (results != null) {
  17711. if (isFunction(results.then)) {
  17712. pluginTransformResults = await results;
  17713. }
  17714. else {
  17715. pluginTransformResults = results;
  17716. }
  17717. if (pluginTransformResults != null) {
  17718. if (isString$1(pluginTransformResults)) {
  17719. transformResults.code = pluginTransformResults;
  17720. }
  17721. else {
  17722. if (isString$1(pluginTransformResults.code)) {
  17723. transformResults.code = pluginTransformResults.code;
  17724. }
  17725. if (isString$1(pluginTransformResults.id)) {
  17726. transformResults.id = pluginTransformResults.id;
  17727. }
  17728. }
  17729. }
  17730. }
  17731. }
  17732. catch (e) {
  17733. catchError(buildCtx.diagnostics, e);
  17734. }
  17735. }
  17736. }
  17737. buildCtx.diagnostics.push(...pluginCtx.diagnostics);
  17738. if (!isRawCssFile) {
  17739. // sass precompiler just ran and converted @import "my.css" into @import url("my.css")
  17740. // because of the ".css" extension. Sass did NOT concat the ".css" files into the output
  17741. // but only updated it to use url() instead. Let's go ahead and concat the url() css
  17742. // files into one file like we did for raw .css files.
  17743. // do this AFTER transformations on non-css files
  17744. if (shouldParseCssDocs && cmp != null) {
  17745. cmp.styleDocs = cmp.styleDocs || [];
  17746. const cssParseResults = await parseCssImports(config, compilerCtx, buildCtx, id, transformResults.id, transformResults.code, cmp.styleDocs);
  17747. transformResults.code = cssParseResults.styleText;
  17748. transformResults.dependencies = cssParseResults.imports;
  17749. }
  17750. else {
  17751. const cssParseResults = await parseCssImports(config, compilerCtx, buildCtx, id, transformResults.id, transformResults.code);
  17752. transformResults.code = cssParseResults.styleText;
  17753. transformResults.dependencies = cssParseResults.imports;
  17754. }
  17755. }
  17756. return transformResults;
  17757. };
  17758. const runPluginTransformsEsmImports = async (config, compilerCtx, buildCtx, code, id) => {
  17759. const pluginCtx = {
  17760. config: config,
  17761. sys: config.sys,
  17762. fs: compilerCtx.fs,
  17763. cache: compilerCtx.cache,
  17764. diagnostics: [],
  17765. };
  17766. const transformResults = {
  17767. code,
  17768. id,
  17769. map: null,
  17770. diagnostics: [],
  17771. dependencies: [],
  17772. };
  17773. const isRawCssFile = id.toLowerCase().endsWith('.css');
  17774. if (isRawCssFile) {
  17775. // concat all css @imports into one file
  17776. // when the entry file is a .css file (not .scss)
  17777. // do this BEFORE transformations on css files
  17778. const cssParseResults = await parseCssImports(config, compilerCtx, buildCtx, id, id, transformResults.code);
  17779. transformResults.code = cssParseResults.styleText;
  17780. if (Array.isArray(cssParseResults.imports)) {
  17781. transformResults.dependencies.push(...cssParseResults.imports);
  17782. }
  17783. }
  17784. for (const plugin of pluginCtx.config.plugins) {
  17785. if (isFunction(plugin.transform)) {
  17786. try {
  17787. let pluginTransformResults;
  17788. const results = plugin.transform(transformResults.code, transformResults.id, pluginCtx);
  17789. if (results != null) {
  17790. if (isFunction(results.then)) {
  17791. pluginTransformResults = await results;
  17792. }
  17793. else {
  17794. pluginTransformResults = results;
  17795. }
  17796. if (pluginTransformResults != null) {
  17797. if (isString$1(pluginTransformResults)) {
  17798. transformResults.code = pluginTransformResults;
  17799. }
  17800. else {
  17801. if (isString$1(pluginTransformResults.code)) {
  17802. transformResults.code = pluginTransformResults.code;
  17803. }
  17804. if (isString$1(pluginTransformResults.id)) {
  17805. transformResults.id = pluginTransformResults.id;
  17806. }
  17807. if (Array.isArray(pluginTransformResults.dependencies)) {
  17808. const imports = pluginTransformResults.dependencies.filter((f) => !transformResults.dependencies.includes(f));
  17809. transformResults.dependencies.push(...imports);
  17810. }
  17811. }
  17812. }
  17813. }
  17814. }
  17815. catch (e) {
  17816. catchError(transformResults.diagnostics, e);
  17817. }
  17818. }
  17819. }
  17820. transformResults.diagnostics.push(...pluginCtx.diagnostics);
  17821. if (!isRawCssFile) {
  17822. // precompilers just ran and converted @import "my.css" into @import url("my.css")
  17823. // because of the ".css" extension. Precompilers did NOT concat the ".css" files into
  17824. // the output but only updated it to use url() instead. Let's go ahead and concat
  17825. // the url() css files into one file like we did for raw .css files. Do this
  17826. // AFTER transformations on non-css files
  17827. const cssParseResults = await parseCssImports(config, compilerCtx, buildCtx, id, transformResults.id, transformResults.code);
  17828. transformResults.code = cssParseResults.styleText;
  17829. if (Array.isArray(cssParseResults.imports)) {
  17830. const imports = cssParseResults.imports.filter((f) => !transformResults.dependencies.includes(f));
  17831. transformResults.dependencies.push(...imports);
  17832. }
  17833. }
  17834. return transformResults;
  17835. };
  17836. const generateGlobalStyles = async (config, compilerCtx, buildCtx) => {
  17837. const outputTargets = config.outputTargets.filter(isOutputTargetDistGlobalStyles);
  17838. if (outputTargets.length === 0) {
  17839. return;
  17840. }
  17841. const globalStyles = await buildGlobalStyles(config, compilerCtx, buildCtx);
  17842. if (globalStyles) {
  17843. await Promise.all(outputTargets.map((o) => compilerCtx.fs.writeFile(o.file, globalStyles)));
  17844. }
  17845. };
  17846. const buildGlobalStyles = async (config, compilerCtx, buildCtx) => {
  17847. let globalStylePath = config.globalStyle;
  17848. if (!globalStylePath) {
  17849. return null;
  17850. }
  17851. const canSkip = await canSkipGlobalStyles(config, compilerCtx, buildCtx);
  17852. if (canSkip) {
  17853. return compilerCtx.cachedGlobalStyle;
  17854. }
  17855. try {
  17856. globalStylePath = normalizePath$1(globalStylePath);
  17857. compilerCtx.addWatchFile(globalStylePath);
  17858. const transformResults = await runPluginTransforms(config, compilerCtx, buildCtx, globalStylePath);
  17859. if (transformResults) {
  17860. const optimizedCss = await optimizeCss(config, compilerCtx, buildCtx.diagnostics, transformResults.code, globalStylePath);
  17861. compilerCtx.cachedGlobalStyle = optimizedCss;
  17862. if (Array.isArray(transformResults.dependencies)) {
  17863. const cssModuleImports = compilerCtx.cssModuleImports.get(globalStylePath) || [];
  17864. transformResults.dependencies.forEach((dep) => {
  17865. compilerCtx.addWatchFile(dep);
  17866. if (!cssModuleImports.includes(dep)) {
  17867. cssModuleImports.push(dep);
  17868. }
  17869. });
  17870. compilerCtx.cssModuleImports.set(globalStylePath, cssModuleImports);
  17871. }
  17872. return optimizedCss;
  17873. }
  17874. }
  17875. catch (e) {
  17876. const d = catchError(buildCtx.diagnostics, e);
  17877. d.absFilePath = globalStylePath;
  17878. }
  17879. compilerCtx.cachedGlobalStyle = null;
  17880. return null;
  17881. };
  17882. const canSkipGlobalStyles = async (config, compilerCtx, buildCtx) => {
  17883. if (!compilerCtx.cachedGlobalStyle) {
  17884. return false;
  17885. }
  17886. if (buildCtx.requiresFullBuild) {
  17887. return false;
  17888. }
  17889. if (buildCtx.isRebuild && !buildCtx.hasStyleChanges) {
  17890. return true;
  17891. }
  17892. if (buildCtx.filesChanged.includes(config.globalStyle)) {
  17893. // changed file IS the global entry style
  17894. return false;
  17895. }
  17896. const cssModuleImports = compilerCtx.cssModuleImports.get(config.globalStyle);
  17897. if (cssModuleImports && buildCtx.filesChanged.some((f) => cssModuleImports.includes(f))) {
  17898. return false;
  17899. }
  17900. const hasChangedImports = await hasChangedImportFile(config, compilerCtx, buildCtx, config.globalStyle, compilerCtx.cachedGlobalStyle, []);
  17901. if (hasChangedImports) {
  17902. return false;
  17903. }
  17904. return true;
  17905. };
  17906. const hasChangedImportFile = async (config, compilerCtx, buildCtx, filePath, content, noLoop) => {
  17907. if (noLoop.includes(filePath)) {
  17908. return false;
  17909. }
  17910. noLoop.push(filePath);
  17911. return hasChangedImportContent(config, compilerCtx, buildCtx, filePath, content, noLoop);
  17912. };
  17913. const hasChangedImportContent = async (config, compilerCtx, buildCtx, filePath, content, checkedFiles) => {
  17914. const cssImports = await getCssImports(config, compilerCtx, buildCtx, filePath, content);
  17915. if (cssImports.length === 0) {
  17916. // don't bother
  17917. return false;
  17918. }
  17919. const isChangedImport = buildCtx.filesChanged.some((changedFilePath) => {
  17920. return cssImports.some((c) => c.filePath === changedFilePath);
  17921. });
  17922. if (isChangedImport) {
  17923. // one of the changed files is an import of this file
  17924. return true;
  17925. }
  17926. // keep diggin'
  17927. const promises = cssImports.map(async (cssImportData) => {
  17928. try {
  17929. const content = await compilerCtx.fs.readFile(cssImportData.filePath);
  17930. return hasChangedImportFile(config, compilerCtx, buildCtx, cssImportData.filePath, content, checkedFiles);
  17931. }
  17932. catch (e) {
  17933. return false;
  17934. }
  17935. });
  17936. const results = await Promise.all(promises);
  17937. return results.includes(true);
  17938. };
  17939. const outputAngular = async (config, compilerCtx, buildCtx) => {
  17940. if (!config.buildDist) {
  17941. return;
  17942. }
  17943. const angularOutputTargets = config.outputTargets.filter(isOutputTargetAngular);
  17944. if (angularOutputTargets.length === 0) {
  17945. return;
  17946. }
  17947. const timespan = buildCtx.createTimeSpan(`generate angular proxies started`, true);
  17948. await Promise.all(angularOutputTargets.map((outputTarget) => angularDirectiveProxyOutput(config, compilerCtx, buildCtx, outputTarget)));
  17949. timespan.finish(`generate angular proxies finished`);
  17950. };
  17951. const angularDirectiveProxyOutput = (config, compilerCtx, buildCtx, outputTarget) => {
  17952. const filteredComponents = getFilteredComponents(outputTarget.excludeComponents, buildCtx.components);
  17953. return Promise.all([
  17954. generateProxies(config, compilerCtx, buildCtx, filteredComponents, outputTarget),
  17955. generateAngularArray(compilerCtx, filteredComponents, outputTarget),
  17956. generateAngularUtils(compilerCtx, outputTarget),
  17957. ]);
  17958. };
  17959. const getFilteredComponents = (excludeComponents = [], cmps) => {
  17960. return sortBy(cmps, (cmp) => cmp.tagName).filter((c) => !excludeComponents.includes(c.tagName) && !c.internal);
  17961. };
  17962. const generateProxies = async (config, compilerCtx, buildCtx, components, outputTarget) => {
  17963. const proxies = getProxies(components);
  17964. const distTypesDir = dirname(buildCtx.packageJson.types);
  17965. const dtsFilePath = join(config.rootDir, distTypesDir, GENERATED_DTS);
  17966. const componentsTypeFile = relativeImport(outputTarget.directivesProxyFile, dtsFilePath, '.d.ts');
  17967. const imports = `/* eslint-disable */
  17968. /* tslint:disable */
  17969. /* auto-generated angular directive proxies */
  17970. import { ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, EventEmitter, NgZone } from '@angular/core';`;
  17971. const sourceImports = !outputTarget.componentCorePackage
  17972. ? `import { Components } from '${componentsTypeFile}';`
  17973. : `import { Components } from '${outputTarget.componentCorePackage}';`;
  17974. const final = [imports, getProxyUtils(outputTarget), sourceImports, proxies];
  17975. const finalText = final.join('\n') + '\n';
  17976. const tsSourceFile = t.createSourceFile(GENERATED_DTS, finalText, t.ScriptTarget.Latest, false);
  17977. const tsPrinter = t.createPrinter({
  17978. newLine: t.NewLineKind.LineFeed,
  17979. });
  17980. const formattedCode = tsPrinter.printFile(tsSourceFile);
  17981. return compilerCtx.fs.writeFile(outputTarget.directivesProxyFile, formattedCode);
  17982. };
  17983. const getProxies = (components) => {
  17984. return components.map(getProxy).join('\n');
  17985. };
  17986. const getProxyCmp = (inputs, methods) => {
  17987. const hasInputs = inputs.length > 0;
  17988. const hasMethods = methods.length > 0;
  17989. const proxMeta = [];
  17990. if (!hasInputs && !hasMethods) {
  17991. return '';
  17992. }
  17993. if (hasInputs)
  17994. proxMeta.push(`inputs: ['${inputs.join(`', '`)}']`);
  17995. if (hasMethods)
  17996. proxMeta.push(`'methods': ['${methods.join(`', '`)}']`);
  17997. return `@ProxyCmp({${proxMeta.join(', ')}})`;
  17998. };
  17999. const getProxy = (cmpMeta) => {
  18000. // Collect component meta
  18001. const inputs = getInputs(cmpMeta);
  18002. const outputs = getOutputs(cmpMeta);
  18003. const methods = getMethods(cmpMeta);
  18004. const hasOutputs = outputs.length > 0;
  18005. // Generate Angular @Directive
  18006. const directiveOpts = [
  18007. `selector: \'${cmpMeta.tagName}\'`,
  18008. `changeDetection: ChangeDetectionStrategy.OnPush`,
  18009. `template: '<ng-content></ng-content>'`,
  18010. ];
  18011. if (inputs.length > 0) {
  18012. directiveOpts.push(`inputs: ['${inputs.join(`', '`)}']`);
  18013. }
  18014. const tagNameAsPascal = dashToPascalCase$1(cmpMeta.tagName);
  18015. const lines = [
  18016. `
  18017. export declare interface ${tagNameAsPascal} extends Components.${tagNameAsPascal} {}
  18018. ${getProxyCmp(inputs, methods)}
  18019. @Component({ ${directiveOpts.join(', ')} })
  18020. export class ${tagNameAsPascal} {`,
  18021. ];
  18022. // Generate outputs
  18023. outputs.forEach((output) => {
  18024. lines.push(` ${output}!: EventEmitter<CustomEvent>;`);
  18025. });
  18026. lines.push(' protected el: HTMLElement;');
  18027. lines.push(` constructor(c: ChangeDetectorRef, r: ElementRef, protected z: NgZone) {
  18028. c.detach();
  18029. this.el = r.nativeElement;`);
  18030. if (hasOutputs) {
  18031. lines.push(` proxyOutputs(this, this.el, ['${outputs.join(`', '`)}']);`);
  18032. }
  18033. lines.push(` }`);
  18034. lines.push(`}`);
  18035. return lines.join('\n');
  18036. };
  18037. const getInputs = (cmpMeta) => {
  18038. return [
  18039. ...cmpMeta.properties.filter((prop) => !prop.internal).map((prop) => prop.name),
  18040. ...cmpMeta.virtualProperties.map((prop) => prop.name),
  18041. ].sort();
  18042. };
  18043. const getOutputs = (cmpMeta) => {
  18044. return cmpMeta.events.filter((ev) => !ev.internal).map((prop) => prop.name);
  18045. };
  18046. const getMethods = (cmpMeta) => {
  18047. return cmpMeta.methods.filter((method) => !method.internal).map((prop) => prop.name);
  18048. };
  18049. const getProxyUtils = (outputTarget) => {
  18050. if (!outputTarget.directivesUtilsFile) {
  18051. return PROXY_UTILS.replace(/export function/g, 'function');
  18052. }
  18053. else {
  18054. const utilsPath = relativeImport(outputTarget.directivesProxyFile, outputTarget.directivesUtilsFile, '.ts');
  18055. return `import { ProxyCmp, proxyOutputs } from '${utilsPath}';\n`;
  18056. }
  18057. };
  18058. const generateAngularArray = (compilerCtx, components, outputTarget) => {
  18059. if (!outputTarget.directivesArrayFile) {
  18060. return Promise.resolve();
  18061. }
  18062. const proxyPath = relativeImport(outputTarget.directivesArrayFile, outputTarget.directivesProxyFile, '.ts');
  18063. const directives = components
  18064. .map((cmpMeta) => dashToPascalCase$1(cmpMeta.tagName))
  18065. .map((className) => ` d.${className}`)
  18066. .join(',\n');
  18067. const c = `
  18068. import type * as d from '${proxyPath}';
  18069. export const DIRECTIVES = [
  18070. ${directives}
  18071. ];
  18072. `;
  18073. return compilerCtx.fs.writeFile(outputTarget.directivesArrayFile, c);
  18074. };
  18075. const generateAngularUtils = async (compilerCtx, outputTarget) => {
  18076. if (outputTarget.directivesUtilsFile) {
  18077. await compilerCtx.fs.writeFile(outputTarget.directivesUtilsFile, '/* eslint-disable */\n/* tslint:disable */\n' + PROXY_UTILS);
  18078. }
  18079. };
  18080. const PROXY_UTILS = `import { fromEvent } from 'rxjs';
  18081. export const proxyInputs = (Cmp: any, inputs: string[]) => {
  18082. const Prototype = Cmp.prototype;
  18083. inputs.forEach(item => {
  18084. Object.defineProperty(Prototype, item, {
  18085. get() {
  18086. return this.el[item];
  18087. },
  18088. set(val: any) {
  18089. this.z.runOutsideAngular(() => (this.el[item] = val));
  18090. }
  18091. });
  18092. });
  18093. };
  18094. export const proxyMethods = (Cmp: any, methods: string[]) => {
  18095. const Prototype = Cmp.prototype;
  18096. methods.forEach(methodName => {
  18097. Prototype[methodName] = function () {
  18098. const args = arguments;
  18099. return this.z.runOutsideAngular(() =>
  18100. this.el[methodName].apply(this.el, args)
  18101. );
  18102. };
  18103. });
  18104. };
  18105. export const proxyOutputs = (instance: any, el: any, events: string[]) => {
  18106. events.forEach(eventName => instance[eventName] = fromEvent(el, eventName));
  18107. }
  18108. export function ProxyCmp(opts: { inputs?: any; methods?: any }) {
  18109. const decorator = function(cls: any){
  18110. if (opts.inputs) {
  18111. proxyInputs(cls, opts.inputs);
  18112. }
  18113. if (opts.methods) {
  18114. proxyMethods(cls, opts.methods);
  18115. }
  18116. return cls;
  18117. };
  18118. return decorator;
  18119. }
  18120. `;
  18121. const GENERATED_DTS = 'components.d.ts';
  18122. const getComponentAssetsCopyTasks = (config, buildCtx, dest, collectionsPath) => {
  18123. if (!dest) {
  18124. return [];
  18125. }
  18126. // get a list of all the directories to copy
  18127. // these paths should be absolute
  18128. const copyTasks = [];
  18129. const cmps = buildCtx.components;
  18130. cmps
  18131. .filter((cmp) => cmp.assetsDirs != null && cmp.assetsDirs.length > 0)
  18132. .forEach((cmp) => {
  18133. if (!collectionsPath) {
  18134. cmp.assetsDirs.forEach((assetsMeta) => {
  18135. copyTasks.push({
  18136. src: assetsMeta.absolutePath,
  18137. dest: join(dest, assetsMeta.cmpRelativePath),
  18138. warn: false,
  18139. keepDirStructure: false,
  18140. });
  18141. });
  18142. }
  18143. else if (!cmp.excludeFromCollection && !cmp.isCollectionDependency) {
  18144. cmp.assetsDirs.forEach((assetsMeta) => {
  18145. const collectionDirDestination = join(dest, relative$1(config.srcDir, assetsMeta.absolutePath));
  18146. copyTasks.push({
  18147. src: assetsMeta.absolutePath,
  18148. dest: collectionDirDestination,
  18149. warn: false,
  18150. keepDirStructure: false,
  18151. });
  18152. });
  18153. }
  18154. });
  18155. buildCtx.debug(`getComponentAssetsCopyTasks: ${copyTasks.length}`);
  18156. return copyTasks;
  18157. };
  18158. const canSkipAssetsCopy = (compilerCtx, entryModules, filesChanged) => {
  18159. if (!compilerCtx.hasSuccessfulBuild) {
  18160. // always copy assets if we haven't had a successful build yet
  18161. // cannot skip build
  18162. return false;
  18163. }
  18164. // assume we want to skip copying assets again
  18165. let shouldSkipAssetsCopy = true;
  18166. // loop through each of the changed files
  18167. filesChanged.forEach((changedFile) => {
  18168. // get the directory of where the changed file is in
  18169. const changedFileDirPath = normalizePath$1(dirname(changedFile));
  18170. // loop through all the possible asset directories
  18171. entryModules.forEach((entryModule) => {
  18172. entryModule.cmps.forEach((cmp) => {
  18173. if (cmp.assetsDirs != null) {
  18174. // loop through each of the asset directories of each component
  18175. cmp.assetsDirs.forEach((assetsDir) => {
  18176. // get the absolute of the asset directory
  18177. const assetDirPath = normalizePath$1(assetsDir.absolutePath);
  18178. // if the changed file directory is this asset directory
  18179. // then we should recopy everything over again
  18180. if (changedFileDirPath === assetDirPath) {
  18181. shouldSkipAssetsCopy = false;
  18182. return;
  18183. }
  18184. });
  18185. }
  18186. });
  18187. });
  18188. });
  18189. return shouldSkipAssetsCopy;
  18190. };
  18191. const getSrcAbsPath = (config, src) => {
  18192. if (isAbsolute$1(src)) {
  18193. return src;
  18194. }
  18195. return join(config.srcDir, src);
  18196. };
  18197. const getDestAbsPath = (src, destAbsPath, destRelPath) => {
  18198. if (destRelPath) {
  18199. if (isAbsolute$1(destRelPath)) {
  18200. return destRelPath;
  18201. }
  18202. else {
  18203. return join(destAbsPath, destRelPath);
  18204. }
  18205. }
  18206. if (isAbsolute$1(src)) {
  18207. throw new Error(`copy task, "dest" property must exist if "src" property is an absolute path: ${src}`);
  18208. }
  18209. return destAbsPath;
  18210. };
  18211. const outputCopy = async (config, compilerCtx, buildCtx) => {
  18212. const outputTargets = config.outputTargets.filter(isOutputTargetCopy);
  18213. if (outputTargets.length === 0) {
  18214. return;
  18215. }
  18216. const changedFiles = [...buildCtx.filesUpdated, ...buildCtx.filesAdded, ...buildCtx.dirsAdded];
  18217. const copyTasks = [];
  18218. const needsCopyAssets = !canSkipAssetsCopy(compilerCtx, buildCtx.entryModules, buildCtx.filesChanged);
  18219. outputTargets.forEach((o) => {
  18220. if (needsCopyAssets && o.copyAssets) {
  18221. copyTasks.push(...getComponentAssetsCopyTasks(config, buildCtx, o.dir, o.copyAssets === 'collection'));
  18222. }
  18223. copyTasks.push(...getCopyTasks(config, buildCtx, o, changedFiles));
  18224. });
  18225. if (copyTasks.length > 0) {
  18226. const timespan = buildCtx.createTimeSpan(`copy started`);
  18227. let copiedFiles = 0;
  18228. try {
  18229. const copyResults = await config.sys.copy(copyTasks, config.srcDir);
  18230. if (copyResults != null) {
  18231. buildCtx.diagnostics.push(...copyResults.diagnostics);
  18232. compilerCtx.fs.cancelDeleteDirectoriesFromDisk(copyResults.dirPaths);
  18233. compilerCtx.fs.cancelDeleteFilesFromDisk(copyResults.filePaths);
  18234. copiedFiles = copyResults.filePaths.length;
  18235. }
  18236. }
  18237. catch (e) {
  18238. const err = buildError(buildCtx.diagnostics);
  18239. if (e instanceof Error) {
  18240. err.messageText = e.message;
  18241. }
  18242. }
  18243. timespan.finish(`copy finished (${copiedFiles} file${copiedFiles === 1 ? '' : 's'})`);
  18244. }
  18245. };
  18246. const getCopyTasks = (config, buildCtx, o, changedFiles) => {
  18247. if (!Array.isArray(o.copy)) {
  18248. return [];
  18249. }
  18250. const copyTasks = !buildCtx.isRebuild || buildCtx.requiresFullBuild ? o.copy : filterCopyTasks(config, o.copy, changedFiles);
  18251. return copyTasks.map((t) => transformToAbs(t, o.dir));
  18252. };
  18253. const filterCopyTasks = (config, tasks, changedFiles) => {
  18254. if (Array.isArray(tasks)) {
  18255. return tasks.filter((copy) => {
  18256. let copySrc = copy.src;
  18257. if (isGlob(copySrc)) {
  18258. // test the glob
  18259. copySrc = join(config.srcDir, copySrc);
  18260. if (changedFiles.some(minimatch_1$1.filter(copySrc))) {
  18261. return true;
  18262. }
  18263. }
  18264. else {
  18265. copySrc = normalizePath$1(getSrcAbsPath(config, copySrc + '/'));
  18266. if (changedFiles.some((f) => f.startsWith(copySrc))) {
  18267. return true;
  18268. }
  18269. }
  18270. return false;
  18271. });
  18272. }
  18273. return [];
  18274. };
  18275. const transformToAbs = (copyTask, dest) => {
  18276. return {
  18277. src: copyTask.src,
  18278. dest: getDestAbsPath(copyTask.src, dest, copyTask.dest),
  18279. keepDirStructure: typeof copyTask.keepDirStructure === 'boolean' ? copyTask.keepDirStructure : copyTask.dest == null,
  18280. warn: copyTask.warn !== false,
  18281. };
  18282. };
  18283. const removeCollectionImports = (compilerCtx) => {
  18284. /*
  18285. // remove side effect collection imports like:
  18286. import 'ionicons';
  18287. // do not remove collection imports with importClauses:
  18288. import * as asdf 'ionicons';
  18289. import { asdf } '@ionic/core';
  18290. */
  18291. return () => {
  18292. return (tsSourceFile) => {
  18293. let madeUpdates = false;
  18294. const statements = tsSourceFile.statements.slice();
  18295. for (let i = statements.length - 1; i >= 0; i--) {
  18296. const n = statements[i];
  18297. if (t.isImportDeclaration(n)) {
  18298. if (!n.importClause && n.moduleSpecifier && t.isStringLiteral(n.moduleSpecifier)) {
  18299. // must not have an import clause
  18300. // must have a module specifier and
  18301. // the module specifier must be a string literal
  18302. const importPath = n.moduleSpecifier.text;
  18303. // test if this side effect import is a collection
  18304. const isCollectionImport = compilerCtx.collections.some((c) => {
  18305. return c.collectionName === importPath || c.moduleId === importPath;
  18306. });
  18307. if (isCollectionImport) {
  18308. // turns out this is a side effect import is a collection,
  18309. // we actually don't want to include this in the JS output
  18310. // we've already gather the types we needed, kthxbai
  18311. madeUpdates = true;
  18312. statements.splice(i, 1);
  18313. }
  18314. }
  18315. }
  18316. }
  18317. if (madeUpdates) {
  18318. return t.updateSourceFileNode(tsSourceFile, statements);
  18319. }
  18320. return tsSourceFile;
  18321. };
  18322. };
  18323. };
  18324. const STENCIL_CORE_ID = '@stencil/core';
  18325. const STENCIL_INTERNAL_ID = '@stencil/core/internal';
  18326. const STENCIL_APP_DATA_ID = '@stencil/core/internal/app-data';
  18327. const STENCIL_APP_GLOBALS_ID = '@stencil/core/internal/app-globals';
  18328. const STENCIL_HYDRATE_FACTORY_ID = '@stencil/core/hydrate-factory';
  18329. const STENCIL_INTERNAL_CLIENT_ID = '@stencil/core/internal/client';
  18330. const STENCIL_INTERNAL_CLIENT_PATCH_BROWSER_ID = '@stencil/core/internal/client/patch-browser';
  18331. const STENCIL_INTERNAL_CLIENT_PATCH_ESM_ID = '@stencil/core/internal/client/patch-esm';
  18332. const STENCIL_INTERNAL_HYDRATE_ID = '@stencil/core/internal/hydrate';
  18333. const STENCIL_MOCK_DOC_ID = '@stencil/core/mock-doc';
  18334. const APP_DATA_CONDITIONAL = '?app-data=conditional';
  18335. const LAZY_BROWSER_ENTRY_ID = '@lazy-browser-entrypoint' + APP_DATA_CONDITIONAL;
  18336. const LAZY_EXTERNAL_ENTRY_ID = '@lazy-external-entrypoint' + APP_DATA_CONDITIONAL;
  18337. const USER_INDEX_ENTRY_ID = '@user-index-entrypoint';
  18338. const appDataPlugin = (config, compilerCtx, buildCtx, build, platform) => {
  18339. if (!platform) {
  18340. return {
  18341. name: 'appDataPlugin',
  18342. };
  18343. }
  18344. const globalScripts = getGlobalScriptData(config, compilerCtx);
  18345. return {
  18346. name: 'appDataPlugin',
  18347. resolveId(id, importer) {
  18348. if (id === STENCIL_APP_DATA_ID || id === STENCIL_APP_GLOBALS_ID) {
  18349. if (platform === 'worker') {
  18350. this.error('@stencil/core packages cannot be imported from a worker.');
  18351. }
  18352. if (platform === 'hydrate' || STENCIL_APP_GLOBALS_ID) {
  18353. // hydrate will always bundle app-data and runtime
  18354. // and the load() fn will build a custom globals import
  18355. return id;
  18356. }
  18357. else if (platform === 'client' && importer && importer.endsWith(APP_DATA_CONDITIONAL)) {
  18358. // since the importer ends with ?app-data=conditional we know that
  18359. // we need to build custom app-data based off of component metadata
  18360. // return the same "id" so that the "load()" method knows to
  18361. // build custom app-data
  18362. return id;
  18363. }
  18364. // for a client build that does not have ?app-data=conditional at the end then we
  18365. // do not want to create custom app-data, but should use the default
  18366. }
  18367. return null;
  18368. },
  18369. load(id) {
  18370. if (id === STENCIL_APP_GLOBALS_ID) {
  18371. const s = new MagicString$2(``);
  18372. appendGlobalScripts(globalScripts, s);
  18373. return s.toString();
  18374. }
  18375. if (id === STENCIL_APP_DATA_ID) {
  18376. // build custom app-data based off of component metadata
  18377. const s = new MagicString$2(``);
  18378. appendNamespace(config, s);
  18379. appendBuildConditionals(config, build, s);
  18380. appendEnv(config, s);
  18381. return s.toString();
  18382. }
  18383. if (id !== config.globalScript) {
  18384. return null;
  18385. }
  18386. const module = compilerCtx.moduleMap.get(config.globalScript);
  18387. if (!module) {
  18388. return null;
  18389. }
  18390. else if (!module.sourceMapFileText) {
  18391. return {
  18392. code: module.staticSourceFileText,
  18393. map: null,
  18394. };
  18395. }
  18396. const sourceMap = JSON.parse(module.sourceMapFileText);
  18397. sourceMap.sources = sourceMap.sources.map((src) => basename(src));
  18398. return { code: module.staticSourceFileText, map: sourceMap };
  18399. },
  18400. transform(code, id) {
  18401. id = normalizePath$1(id);
  18402. if (globalScripts.some((s) => s.path === id)) {
  18403. const program = this.parse(code, {});
  18404. const needsDefault = !program.body.some((s) => s.type === 'ExportDefaultDeclaration');
  18405. const defaultExport = needsDefault ? '\nexport const globalFn = () => {};\nexport default globalFn;' : '';
  18406. code = getContextImport(platform) + code + defaultExport;
  18407. const compilerOptions = { ...config.tsCompilerOptions };
  18408. compilerOptions.module = t.ModuleKind.ESNext;
  18409. const results = t.transpileModule(code, {
  18410. compilerOptions,
  18411. fileName: id,
  18412. transformers: {
  18413. after: [removeCollectionImports(compilerCtx)],
  18414. },
  18415. });
  18416. buildCtx.diagnostics.push(...loadTypeScriptDiagnostics(results.diagnostics));
  18417. if (config.sourceMap) {
  18418. // generate the sourcemap for global script
  18419. const codeMs = new MagicString$2(code);
  18420. const codeMap = codeMs.generateMap({
  18421. source: id,
  18422. // this is the name of the sourcemap, not to be confused with the `file` field in a generated sourcemap
  18423. file: id + '.map',
  18424. includeContent: true,
  18425. hires: true,
  18426. });
  18427. return { code: results.outputText, map: codeMap };
  18428. }
  18429. return { code: results.outputText };
  18430. }
  18431. return null;
  18432. },
  18433. };
  18434. };
  18435. const getGlobalScriptData = (config, compilerCtx) => {
  18436. const globalScripts = [];
  18437. if (isString$1(config.globalScript)) {
  18438. const mod = compilerCtx.moduleMap.get(config.globalScript);
  18439. const globalScript = compilerCtx.version === 2 ? config.globalScript : mod && mod.jsFilePath;
  18440. if (globalScript) {
  18441. globalScripts.push({
  18442. defaultName: createJsVarName(config.namespace + 'GlobalScript'),
  18443. path: normalizePath$1(globalScript),
  18444. });
  18445. }
  18446. }
  18447. compilerCtx.collections.forEach((collection) => {
  18448. if (collection.global != null && isString$1(collection.global.sourceFilePath)) {
  18449. let defaultName = createJsVarName(collection.collectionName + 'GlobalScript');
  18450. if (globalScripts.some((s) => s.defaultName === defaultName)) {
  18451. defaultName += globalScripts.length;
  18452. }
  18453. globalScripts.push({
  18454. defaultName,
  18455. path: normalizePath$1(collection.global.sourceFilePath),
  18456. });
  18457. }
  18458. });
  18459. return globalScripts;
  18460. };
  18461. const appendGlobalScripts = (globalScripts, s) => {
  18462. if (globalScripts.length === 1) {
  18463. s.prepend(`import appGlobalScript from '${globalScripts[0].path}';\n`);
  18464. s.append(`export const globalScripts = appGlobalScript;\n`);
  18465. }
  18466. else if (globalScripts.length > 1) {
  18467. globalScripts.forEach((globalScript) => {
  18468. s.prepend(`import ${globalScript.defaultName} from '${globalScript.path}';\n`);
  18469. });
  18470. s.append(`export const globalScripts = () => {\n`);
  18471. globalScripts.forEach((globalScript) => {
  18472. s.append(` ${globalScript.defaultName}();\n`);
  18473. });
  18474. s.append(`};\n`);
  18475. }
  18476. else {
  18477. s.append(`export const globalScripts = () => {};\n`);
  18478. }
  18479. };
  18480. const appendBuildConditionals = (config, build, s) => {
  18481. const buildData = Object.keys(build)
  18482. .sort()
  18483. .map((key) => key + ': ' + (build[key] ? 'true' : 'false'))
  18484. .join(', ');
  18485. s.append(`export const BUILD = /* ${config.fsNamespace} */ { ${buildData} };\n`);
  18486. };
  18487. const appendEnv = (config, s) => {
  18488. s.append(`export const Env = /* ${config.fsNamespace} */ ${JSON.stringify(config.env)};\n`);
  18489. };
  18490. const appendNamespace = (config, s) => {
  18491. s.append(`export const NAMESPACE = '${config.fsNamespace}';\n`);
  18492. };
  18493. const getContextImport = (platform) => {
  18494. return `import { Context } from '${platform === 'hydrate' ? STENCIL_INTERNAL_HYDRATE_ID : STENCIL_CORE_ID}';\n`;
  18495. };
  18496. const coreResolvePlugin = (config, compilerCtx, platform, externalRuntime) => {
  18497. const compilerExe = config.sys.getCompilerExecutingPath();
  18498. const internalClient = getStencilInternalModule(config, compilerExe, 'client/index.js');
  18499. const internalClientPatchBrowser = getStencilInternalModule(config, compilerExe, 'client/patch-browser.js');
  18500. const internalClientPatchEsm = getStencilInternalModule(config, compilerExe, 'client/patch-esm.js');
  18501. const internalHydrate = getStencilInternalModule(config, compilerExe, 'hydrate/index.js');
  18502. return {
  18503. name: 'coreResolvePlugin',
  18504. resolveId(id) {
  18505. if (id === STENCIL_CORE_ID || id === STENCIL_INTERNAL_ID) {
  18506. if (platform === 'client') {
  18507. if (externalRuntime) {
  18508. return {
  18509. id: STENCIL_INTERNAL_CLIENT_ID,
  18510. external: true,
  18511. };
  18512. }
  18513. // adding ?app-data=conditional as an identifier to ensure we don't
  18514. // use the default app-data, but build a custom one based on component meta
  18515. return internalClient + APP_DATA_CONDITIONAL;
  18516. }
  18517. if (platform === 'hydrate') {
  18518. return internalHydrate;
  18519. }
  18520. }
  18521. if (id === STENCIL_INTERNAL_CLIENT_ID) {
  18522. if (externalRuntime) {
  18523. // not bunding the client runtime and the user's component together this
  18524. // must be the custom elements build, where @stencil/core/internal/client
  18525. // is an import, rather than bundling
  18526. return {
  18527. id: STENCIL_INTERNAL_CLIENT_ID,
  18528. external: true,
  18529. };
  18530. }
  18531. // importing @stencil/core/internal/client directly, so it shouldn't get
  18532. // the custom app-data conditionals
  18533. return internalClient;
  18534. }
  18535. if (id === STENCIL_INTERNAL_CLIENT_PATCH_BROWSER_ID) {
  18536. if (externalRuntime) {
  18537. return {
  18538. id: STENCIL_INTERNAL_CLIENT_PATCH_BROWSER_ID,
  18539. external: true,
  18540. };
  18541. }
  18542. return internalClientPatchBrowser;
  18543. }
  18544. if (id === STENCIL_INTERNAL_CLIENT_PATCH_ESM_ID) {
  18545. if (externalRuntime) {
  18546. return {
  18547. id: STENCIL_INTERNAL_CLIENT_PATCH_ESM_ID,
  18548. external: true,
  18549. };
  18550. }
  18551. return internalClientPatchEsm;
  18552. }
  18553. if (id === STENCIL_INTERNAL_HYDRATE_ID) {
  18554. return internalHydrate;
  18555. }
  18556. return null;
  18557. },
  18558. async load(filePath) {
  18559. if (filePath && !filePath.startsWith('\0')) {
  18560. filePath = normalizeFsPath(filePath);
  18561. if (filePath === internalClient || filePath === internalHydrate) {
  18562. if (platform === 'worker') {
  18563. return `
  18564. export const Build = {
  18565. isDev: ${config.devMode},
  18566. isBrowser: true,
  18567. isServer: false,
  18568. isTesting: false,
  18569. };`;
  18570. }
  18571. let code = await compilerCtx.fs.readFile(filePath);
  18572. if (typeof code !== 'string' && isRemoteUrl(compilerExe)) {
  18573. const url = getStencilModuleUrl(compilerExe, filePath);
  18574. code = await fetchModuleAsync(config.sys, compilerCtx.fs, packageVersions, url, filePath);
  18575. }
  18576. if (typeof code === 'string') {
  18577. const hydratedFlag = config.hydratedFlag;
  18578. if (hydratedFlag) {
  18579. const hydratedFlagHead = getHydratedFlagHead(hydratedFlag);
  18580. if (HYDRATED_CSS !== hydratedFlagHead) {
  18581. code = code.replace(HYDRATED_CSS, hydratedFlagHead);
  18582. if (hydratedFlag.name !== 'hydrated') {
  18583. code = code.replace(`.classList.add("hydrated")`, `.classList.add("${hydratedFlag.name}")`);
  18584. code = code.replace(`.classList.add('hydrated')`, `.classList.add('${hydratedFlag.name}')`);
  18585. code = code.replace(`.setAttribute("hydrated",`, `.setAttribute("${hydratedFlag.name}",`);
  18586. code = code.replace(`.setAttribute('hydrated',`, `.setAttribute('${hydratedFlag.name}',`);
  18587. }
  18588. }
  18589. }
  18590. else {
  18591. code = code.replace(HYDRATED_CSS, '{}');
  18592. }
  18593. }
  18594. return code;
  18595. }
  18596. }
  18597. return null;
  18598. },
  18599. resolveImportMeta(prop, { format }) {
  18600. if (config.extras.dynamicImportShim && prop === 'url' && format === 'es') {
  18601. return '""';
  18602. }
  18603. return null;
  18604. },
  18605. };
  18606. };
  18607. const getStencilInternalModule = (config, compilerExe, internalModule) => {
  18608. if (isRemoteUrl(compilerExe)) {
  18609. return normalizePath$1(config.sys.getLocalModulePath({
  18610. rootDir: config.rootDir,
  18611. moduleId: '@stencil/core',
  18612. path: 'internal/' + internalModule,
  18613. }));
  18614. }
  18615. const compilerExeDir = dirname(compilerExe);
  18616. return normalizePath$1(join(compilerExeDir, '..', 'internal', internalModule));
  18617. };
  18618. const getHydratedFlagHead = (h) => {
  18619. // {visibility:hidden}.hydrated{visibility:inherit}
  18620. let initial;
  18621. let hydrated;
  18622. if (!String(h.initialValue) || h.initialValue === '' || h.initialValue == null) {
  18623. initial = '';
  18624. }
  18625. else {
  18626. initial = `{${h.property}:${h.initialValue}}`;
  18627. }
  18628. const selector = h.selector === 'attribute' ? `[${h.name}]` : `.${h.name}`;
  18629. if (!String(h.hydratedValue) || h.hydratedValue === '' || h.hydratedValue == null) {
  18630. hydrated = '';
  18631. }
  18632. else {
  18633. hydrated = `${selector}{${h.property}:${h.hydratedValue}}`;
  18634. }
  18635. return initial + hydrated;
  18636. };
  18637. var minimalisticAssert = assert;
  18638. function assert(val, msg) {
  18639. if (!val)
  18640. throw new Error(msg || 'Assertion failed');
  18641. }
  18642. assert.equal = function assertEqual(l, r, msg) {
  18643. if (l != r)
  18644. throw new Error(msg || ('Assertion failed: ' + l + ' != ' + r));
  18645. };
  18646. var inherits_browser$1 = createCommonjsModule$1(function (module) {
  18647. if (typeof Object.create === 'function') {
  18648. // implementation from standard node.js 'util' module
  18649. module.exports = function inherits(ctor, superCtor) {
  18650. if (superCtor) {
  18651. ctor.super_ = superCtor;
  18652. ctor.prototype = Object.create(superCtor.prototype, {
  18653. constructor: {
  18654. value: ctor,
  18655. enumerable: false,
  18656. writable: true,
  18657. configurable: true
  18658. }
  18659. });
  18660. }
  18661. };
  18662. } else {
  18663. // old school shim for old browsers
  18664. module.exports = function inherits(ctor, superCtor) {
  18665. if (superCtor) {
  18666. ctor.super_ = superCtor;
  18667. var TempCtor = function () {};
  18668. TempCtor.prototype = superCtor.prototype;
  18669. ctor.prototype = new TempCtor();
  18670. ctor.prototype.constructor = ctor;
  18671. }
  18672. };
  18673. }
  18674. });
  18675. const require$$0 = /*@__PURE__*/getAugmentedNamespace$1(util$4);
  18676. var inherits$2 = createCommonjsModule$1(function (module) {
  18677. try {
  18678. var util = require$$0;
  18679. /* istanbul ignore next */
  18680. if (typeof util.inherits !== 'function') throw '';
  18681. module.exports = util.inherits;
  18682. } catch (e) {
  18683. /* istanbul ignore next */
  18684. module.exports = inherits_browser$1;
  18685. }
  18686. });
  18687. var inherits_1 = inherits$2;
  18688. function isSurrogatePair(msg, i) {
  18689. if ((msg.charCodeAt(i) & 0xFC00) !== 0xD800) {
  18690. return false;
  18691. }
  18692. if (i < 0 || i + 1 >= msg.length) {
  18693. return false;
  18694. }
  18695. return (msg.charCodeAt(i + 1) & 0xFC00) === 0xDC00;
  18696. }
  18697. function toArray(msg, enc) {
  18698. if (Array.isArray(msg))
  18699. return msg.slice();
  18700. if (!msg)
  18701. return [];
  18702. var res = [];
  18703. if (typeof msg === 'string') {
  18704. if (!enc) {
  18705. // Inspired by stringToUtf8ByteArray() in closure-library by Google
  18706. // https://github.com/google/closure-library/blob/8598d87242af59aac233270742c8984e2b2bdbe0/closure/goog/crypt/crypt.js#L117-L143
  18707. // Apache License 2.0
  18708. // https://github.com/google/closure-library/blob/master/LICENSE
  18709. var p = 0;
  18710. for (var i = 0; i < msg.length; i++) {
  18711. var c = msg.charCodeAt(i);
  18712. if (c < 128) {
  18713. res[p++] = c;
  18714. } else if (c < 2048) {
  18715. res[p++] = (c >> 6) | 192;
  18716. res[p++] = (c & 63) | 128;
  18717. } else if (isSurrogatePair(msg, i)) {
  18718. c = 0x10000 + ((c & 0x03FF) << 10) + (msg.charCodeAt(++i) & 0x03FF);
  18719. res[p++] = (c >> 18) | 240;
  18720. res[p++] = ((c >> 12) & 63) | 128;
  18721. res[p++] = ((c >> 6) & 63) | 128;
  18722. res[p++] = (c & 63) | 128;
  18723. } else {
  18724. res[p++] = (c >> 12) | 224;
  18725. res[p++] = ((c >> 6) & 63) | 128;
  18726. res[p++] = (c & 63) | 128;
  18727. }
  18728. }
  18729. } else if (enc === 'hex') {
  18730. msg = msg.replace(/[^a-z0-9]+/ig, '');
  18731. if (msg.length % 2 !== 0)
  18732. msg = '0' + msg;
  18733. for (i = 0; i < msg.length; i += 2)
  18734. res.push(parseInt(msg[i] + msg[i + 1], 16));
  18735. }
  18736. } else {
  18737. for (i = 0; i < msg.length; i++)
  18738. res[i] = msg[i] | 0;
  18739. }
  18740. return res;
  18741. }
  18742. var toArray_1 = toArray;
  18743. function toHex(msg) {
  18744. var res = '';
  18745. for (var i = 0; i < msg.length; i++)
  18746. res += zero2(msg[i].toString(16));
  18747. return res;
  18748. }
  18749. var toHex_1 = toHex;
  18750. function htonl(w) {
  18751. var res = (w >>> 24) |
  18752. ((w >>> 8) & 0xff00) |
  18753. ((w << 8) & 0xff0000) |
  18754. ((w & 0xff) << 24);
  18755. return res >>> 0;
  18756. }
  18757. var htonl_1 = htonl;
  18758. function toHex32(msg, endian) {
  18759. var res = '';
  18760. for (var i = 0; i < msg.length; i++) {
  18761. var w = msg[i];
  18762. if (endian === 'little')
  18763. w = htonl(w);
  18764. res += zero8(w.toString(16));
  18765. }
  18766. return res;
  18767. }
  18768. var toHex32_1 = toHex32;
  18769. function zero2(word) {
  18770. if (word.length === 1)
  18771. return '0' + word;
  18772. else
  18773. return word;
  18774. }
  18775. var zero2_1 = zero2;
  18776. function zero8(word) {
  18777. if (word.length === 7)
  18778. return '0' + word;
  18779. else if (word.length === 6)
  18780. return '00' + word;
  18781. else if (word.length === 5)
  18782. return '000' + word;
  18783. else if (word.length === 4)
  18784. return '0000' + word;
  18785. else if (word.length === 3)
  18786. return '00000' + word;
  18787. else if (word.length === 2)
  18788. return '000000' + word;
  18789. else if (word.length === 1)
  18790. return '0000000' + word;
  18791. else
  18792. return word;
  18793. }
  18794. var zero8_1 = zero8;
  18795. function join32(msg, start, end, endian) {
  18796. var len = end - start;
  18797. minimalisticAssert(len % 4 === 0);
  18798. var res = new Array(len / 4);
  18799. for (var i = 0, k = start; i < res.length; i++, k += 4) {
  18800. var w;
  18801. if (endian === 'big')
  18802. w = (msg[k] << 24) | (msg[k + 1] << 16) | (msg[k + 2] << 8) | msg[k + 3];
  18803. else
  18804. w = (msg[k + 3] << 24) | (msg[k + 2] << 16) | (msg[k + 1] << 8) | msg[k];
  18805. res[i] = w >>> 0;
  18806. }
  18807. return res;
  18808. }
  18809. var join32_1 = join32;
  18810. function split32(msg, endian) {
  18811. var res = new Array(msg.length * 4);
  18812. for (var i = 0, k = 0; i < msg.length; i++, k += 4) {
  18813. var m = msg[i];
  18814. if (endian === 'big') {
  18815. res[k] = m >>> 24;
  18816. res[k + 1] = (m >>> 16) & 0xff;
  18817. res[k + 2] = (m >>> 8) & 0xff;
  18818. res[k + 3] = m & 0xff;
  18819. } else {
  18820. res[k + 3] = m >>> 24;
  18821. res[k + 2] = (m >>> 16) & 0xff;
  18822. res[k + 1] = (m >>> 8) & 0xff;
  18823. res[k] = m & 0xff;
  18824. }
  18825. }
  18826. return res;
  18827. }
  18828. var split32_1 = split32;
  18829. function rotr32$1(w, b) {
  18830. return (w >>> b) | (w << (32 - b));
  18831. }
  18832. var rotr32_1 = rotr32$1;
  18833. function rotl32(w, b) {
  18834. return (w << b) | (w >>> (32 - b));
  18835. }
  18836. var rotl32_1 = rotl32;
  18837. function sum32$1(a, b) {
  18838. return (a + b) >>> 0;
  18839. }
  18840. var sum32_1 = sum32$1;
  18841. function sum32_3(a, b, c) {
  18842. return (a + b + c) >>> 0;
  18843. }
  18844. var sum32_3_1 = sum32_3;
  18845. function sum32_4$1(a, b, c, d) {
  18846. return (a + b + c + d) >>> 0;
  18847. }
  18848. var sum32_4_1 = sum32_4$1;
  18849. function sum32_5$1(a, b, c, d, e) {
  18850. return (a + b + c + d + e) >>> 0;
  18851. }
  18852. var sum32_5_1 = sum32_5$1;
  18853. function sum64(buf, pos, ah, al) {
  18854. var bh = buf[pos];
  18855. var bl = buf[pos + 1];
  18856. var lo = (al + bl) >>> 0;
  18857. var hi = (lo < al ? 1 : 0) + ah + bh;
  18858. buf[pos] = hi >>> 0;
  18859. buf[pos + 1] = lo;
  18860. }
  18861. var sum64_1 = sum64;
  18862. function sum64_hi(ah, al, bh, bl) {
  18863. var lo = (al + bl) >>> 0;
  18864. var hi = (lo < al ? 1 : 0) + ah + bh;
  18865. return hi >>> 0;
  18866. }
  18867. var sum64_hi_1 = sum64_hi;
  18868. function sum64_lo(ah, al, bh, bl) {
  18869. var lo = al + bl;
  18870. return lo >>> 0;
  18871. }
  18872. var sum64_lo_1 = sum64_lo;
  18873. function sum64_4_hi(ah, al, bh, bl, ch, cl, dh, dl) {
  18874. var carry = 0;
  18875. var lo = al;
  18876. lo = (lo + bl) >>> 0;
  18877. carry += lo < al ? 1 : 0;
  18878. lo = (lo + cl) >>> 0;
  18879. carry += lo < cl ? 1 : 0;
  18880. lo = (lo + dl) >>> 0;
  18881. carry += lo < dl ? 1 : 0;
  18882. var hi = ah + bh + ch + dh + carry;
  18883. return hi >>> 0;
  18884. }
  18885. var sum64_4_hi_1 = sum64_4_hi;
  18886. function sum64_4_lo(ah, al, bh, bl, ch, cl, dh, dl) {
  18887. var lo = al + bl + cl + dl;
  18888. return lo >>> 0;
  18889. }
  18890. var sum64_4_lo_1 = sum64_4_lo;
  18891. function sum64_5_hi(ah, al, bh, bl, ch, cl, dh, dl, eh, el) {
  18892. var carry = 0;
  18893. var lo = al;
  18894. lo = (lo + bl) >>> 0;
  18895. carry += lo < al ? 1 : 0;
  18896. lo = (lo + cl) >>> 0;
  18897. carry += lo < cl ? 1 : 0;
  18898. lo = (lo + dl) >>> 0;
  18899. carry += lo < dl ? 1 : 0;
  18900. lo = (lo + el) >>> 0;
  18901. carry += lo < el ? 1 : 0;
  18902. var hi = ah + bh + ch + dh + eh + carry;
  18903. return hi >>> 0;
  18904. }
  18905. var sum64_5_hi_1 = sum64_5_hi;
  18906. function sum64_5_lo(ah, al, bh, bl, ch, cl, dh, dl, eh, el) {
  18907. var lo = al + bl + cl + dl + el;
  18908. return lo >>> 0;
  18909. }
  18910. var sum64_5_lo_1 = sum64_5_lo;
  18911. function rotr64_hi(ah, al, num) {
  18912. var r = (al << (32 - num)) | (ah >>> num);
  18913. return r >>> 0;
  18914. }
  18915. var rotr64_hi_1 = rotr64_hi;
  18916. function rotr64_lo(ah, al, num) {
  18917. var r = (ah << (32 - num)) | (al >>> num);
  18918. return r >>> 0;
  18919. }
  18920. var rotr64_lo_1 = rotr64_lo;
  18921. function shr64_hi(ah, al, num) {
  18922. return ah >>> num;
  18923. }
  18924. var shr64_hi_1 = shr64_hi;
  18925. function shr64_lo(ah, al, num) {
  18926. var r = (ah << (32 - num)) | (al >>> num);
  18927. return r >>> 0;
  18928. }
  18929. var shr64_lo_1 = shr64_lo;
  18930. var utils$1 = {
  18931. inherits: inherits_1,
  18932. toArray: toArray_1,
  18933. toHex: toHex_1,
  18934. htonl: htonl_1,
  18935. toHex32: toHex32_1,
  18936. zero2: zero2_1,
  18937. zero8: zero8_1,
  18938. join32: join32_1,
  18939. split32: split32_1,
  18940. rotr32: rotr32_1,
  18941. rotl32: rotl32_1,
  18942. sum32: sum32_1,
  18943. sum32_3: sum32_3_1,
  18944. sum32_4: sum32_4_1,
  18945. sum32_5: sum32_5_1,
  18946. sum64: sum64_1,
  18947. sum64_hi: sum64_hi_1,
  18948. sum64_lo: sum64_lo_1,
  18949. sum64_4_hi: sum64_4_hi_1,
  18950. sum64_4_lo: sum64_4_lo_1,
  18951. sum64_5_hi: sum64_5_hi_1,
  18952. sum64_5_lo: sum64_5_lo_1,
  18953. rotr64_hi: rotr64_hi_1,
  18954. rotr64_lo: rotr64_lo_1,
  18955. shr64_hi: shr64_hi_1,
  18956. shr64_lo: shr64_lo_1
  18957. };
  18958. function BlockHash$1() {
  18959. this.pending = null;
  18960. this.pendingTotal = 0;
  18961. this.blockSize = this.constructor.blockSize;
  18962. this.outSize = this.constructor.outSize;
  18963. this.hmacStrength = this.constructor.hmacStrength;
  18964. this.padLength = this.constructor.padLength / 8;
  18965. this.endian = 'big';
  18966. this._delta8 = this.blockSize / 8;
  18967. this._delta32 = this.blockSize / 32;
  18968. }
  18969. var BlockHash_1 = BlockHash$1;
  18970. BlockHash$1.prototype.update = function update(msg, enc) {
  18971. // Convert message to array, pad it, and join into 32bit blocks
  18972. msg = utils$1.toArray(msg, enc);
  18973. if (!this.pending)
  18974. this.pending = msg;
  18975. else
  18976. this.pending = this.pending.concat(msg);
  18977. this.pendingTotal += msg.length;
  18978. // Enough data, try updating
  18979. if (this.pending.length >= this._delta8) {
  18980. msg = this.pending;
  18981. // Process pending data in blocks
  18982. var r = msg.length % this._delta8;
  18983. this.pending = msg.slice(msg.length - r, msg.length);
  18984. if (this.pending.length === 0)
  18985. this.pending = null;
  18986. msg = utils$1.join32(msg, 0, msg.length - r, this.endian);
  18987. for (var i = 0; i < msg.length; i += this._delta32)
  18988. this._update(msg, i, i + this._delta32);
  18989. }
  18990. return this;
  18991. };
  18992. BlockHash$1.prototype.digest = function digest(enc) {
  18993. this.update(this._pad());
  18994. minimalisticAssert(this.pending === null);
  18995. return this._digest(enc);
  18996. };
  18997. BlockHash$1.prototype._pad = function pad() {
  18998. var len = this.pendingTotal;
  18999. var bytes = this._delta8;
  19000. var k = bytes - ((len + this.padLength) % bytes);
  19001. var res = new Array(k + this.padLength);
  19002. res[0] = 0x80;
  19003. for (var i = 1; i < k; i++)
  19004. res[i] = 0;
  19005. // Append length
  19006. len <<= 3;
  19007. if (this.endian === 'big') {
  19008. for (var t = 8; t < this.padLength; t++)
  19009. res[i++] = 0;
  19010. res[i++] = 0;
  19011. res[i++] = 0;
  19012. res[i++] = 0;
  19013. res[i++] = 0;
  19014. res[i++] = (len >>> 24) & 0xff;
  19015. res[i++] = (len >>> 16) & 0xff;
  19016. res[i++] = (len >>> 8) & 0xff;
  19017. res[i++] = len & 0xff;
  19018. } else {
  19019. res[i++] = len & 0xff;
  19020. res[i++] = (len >>> 8) & 0xff;
  19021. res[i++] = (len >>> 16) & 0xff;
  19022. res[i++] = (len >>> 24) & 0xff;
  19023. res[i++] = 0;
  19024. res[i++] = 0;
  19025. res[i++] = 0;
  19026. res[i++] = 0;
  19027. for (t = 8; t < this.padLength; t++)
  19028. res[i++] = 0;
  19029. }
  19030. return res;
  19031. };
  19032. var common$2 = {
  19033. BlockHash: BlockHash_1
  19034. };
  19035. var rotr32 = utils$1.rotr32;
  19036. function ft_1(s, x, y, z) {
  19037. if (s === 0)
  19038. return ch32$1(x, y, z);
  19039. if (s === 1 || s === 3)
  19040. return p32(x, y, z);
  19041. if (s === 2)
  19042. return maj32$1(x, y, z);
  19043. }
  19044. var ft_1_1 = ft_1;
  19045. function ch32$1(x, y, z) {
  19046. return (x & y) ^ ((~x) & z);
  19047. }
  19048. var ch32_1 = ch32$1;
  19049. function maj32$1(x, y, z) {
  19050. return (x & y) ^ (x & z) ^ (y & z);
  19051. }
  19052. var maj32_1 = maj32$1;
  19053. function p32(x, y, z) {
  19054. return x ^ y ^ z;
  19055. }
  19056. var p32_1 = p32;
  19057. function s0_256$1(x) {
  19058. return rotr32(x, 2) ^ rotr32(x, 13) ^ rotr32(x, 22);
  19059. }
  19060. var s0_256_1 = s0_256$1;
  19061. function s1_256$1(x) {
  19062. return rotr32(x, 6) ^ rotr32(x, 11) ^ rotr32(x, 25);
  19063. }
  19064. var s1_256_1 = s1_256$1;
  19065. function g0_256$1(x) {
  19066. return rotr32(x, 7) ^ rotr32(x, 18) ^ (x >>> 3);
  19067. }
  19068. var g0_256_1 = g0_256$1;
  19069. function g1_256$1(x) {
  19070. return rotr32(x, 17) ^ rotr32(x, 19) ^ (x >>> 10);
  19071. }
  19072. var g1_256_1 = g1_256$1;
  19073. var common$1 = {
  19074. ft_1: ft_1_1,
  19075. ch32: ch32_1,
  19076. maj32: maj32_1,
  19077. p32: p32_1,
  19078. s0_256: s0_256_1,
  19079. s1_256: s1_256_1,
  19080. g0_256: g0_256_1,
  19081. g1_256: g1_256_1
  19082. };
  19083. var sum32 = utils$1.sum32;
  19084. var sum32_4 = utils$1.sum32_4;
  19085. var sum32_5 = utils$1.sum32_5;
  19086. var ch32 = common$1.ch32;
  19087. var maj32 = common$1.maj32;
  19088. var s0_256 = common$1.s0_256;
  19089. var s1_256 = common$1.s1_256;
  19090. var g0_256 = common$1.g0_256;
  19091. var g1_256 = common$1.g1_256;
  19092. var BlockHash = common$2.BlockHash;
  19093. var sha256_K = [
  19094. 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5,
  19095. 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,
  19096. 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3,
  19097. 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,
  19098. 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc,
  19099. 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,
  19100. 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7,
  19101. 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,
  19102. 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13,
  19103. 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,
  19104. 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3,
  19105. 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,
  19106. 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5,
  19107. 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,
  19108. 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208,
  19109. 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2
  19110. ];
  19111. function SHA256() {
  19112. if (!(this instanceof SHA256))
  19113. return new SHA256();
  19114. BlockHash.call(this);
  19115. this.h = [
  19116. 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a,
  19117. 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19
  19118. ];
  19119. this.k = sha256_K;
  19120. this.W = new Array(64);
  19121. }
  19122. utils$1.inherits(SHA256, BlockHash);
  19123. var _256 = SHA256;
  19124. SHA256.blockSize = 512;
  19125. SHA256.outSize = 256;
  19126. SHA256.hmacStrength = 192;
  19127. SHA256.padLength = 64;
  19128. SHA256.prototype._update = function _update(msg, start) {
  19129. var W = this.W;
  19130. for (var i = 0; i < 16; i++)
  19131. W[i] = msg[start + i];
  19132. for (; i < W.length; i++)
  19133. W[i] = sum32_4(g1_256(W[i - 2]), W[i - 7], g0_256(W[i - 15]), W[i - 16]);
  19134. var a = this.h[0];
  19135. var b = this.h[1];
  19136. var c = this.h[2];
  19137. var d = this.h[3];
  19138. var e = this.h[4];
  19139. var f = this.h[5];
  19140. var g = this.h[6];
  19141. var h = this.h[7];
  19142. minimalisticAssert(this.k.length === W.length);
  19143. for (i = 0; i < W.length; i++) {
  19144. var T1 = sum32_5(h, s1_256(e), ch32(e, f, g), this.k[i], W[i]);
  19145. var T2 = sum32(s0_256(a), maj32(a, b, c));
  19146. h = g;
  19147. g = f;
  19148. f = e;
  19149. e = sum32(d, T1);
  19150. d = c;
  19151. c = b;
  19152. b = a;
  19153. a = sum32(T1, T2);
  19154. }
  19155. this.h[0] = sum32(this.h[0], a);
  19156. this.h[1] = sum32(this.h[1], b);
  19157. this.h[2] = sum32(this.h[2], c);
  19158. this.h[3] = sum32(this.h[3], d);
  19159. this.h[4] = sum32(this.h[4], e);
  19160. this.h[5] = sum32(this.h[5], f);
  19161. this.h[6] = sum32(this.h[6], g);
  19162. this.h[7] = sum32(this.h[7], h);
  19163. };
  19164. SHA256.prototype._digest = function digest(enc) {
  19165. if (enc === 'hex')
  19166. return utils$1.toHex32(this.h, 'big');
  19167. else
  19168. return utils$1.split32(this.h, 'big');
  19169. };
  19170. //@ts-ignore
  19171. const createHash$1 = () => _256();
  19172. /*
  19173. @license
  19174. Rollup.js v2.42.3
  19175. Mon, 22 Mar 2021 14:48:44 GMT - commit f67e6c9b2cb4066f2ddcdb6d45308f840b2ac62f
  19176. https://github.com/rollup/rollup
  19177. Released under the MIT License.
  19178. */
  19179. var version$1 = "2.42.3";
  19180. var charToInteger = {};
  19181. var chars$1 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
  19182. for (var i = 0; i < chars$1.length; i++) {
  19183. charToInteger[chars$1.charCodeAt(i)] = i;
  19184. }
  19185. function decode(mappings) {
  19186. var decoded = [];
  19187. var line = [];
  19188. var segment = [
  19189. 0,
  19190. 0,
  19191. 0,
  19192. 0,
  19193. 0,
  19194. ];
  19195. var j = 0;
  19196. for (var i = 0, shift = 0, value = 0; i < mappings.length; i++) {
  19197. var c = mappings.charCodeAt(i);
  19198. if (c === 44) { // ","
  19199. segmentify(line, segment, j);
  19200. j = 0;
  19201. }
  19202. else if (c === 59) { // ";"
  19203. segmentify(line, segment, j);
  19204. j = 0;
  19205. decoded.push(line);
  19206. line = [];
  19207. segment[0] = 0;
  19208. }
  19209. else {
  19210. var integer = charToInteger[c];
  19211. if (integer === undefined) {
  19212. throw new Error('Invalid character (' + String.fromCharCode(c) + ')');
  19213. }
  19214. var hasContinuationBit = integer & 32;
  19215. integer &= 31;
  19216. value += integer << shift;
  19217. if (hasContinuationBit) {
  19218. shift += 5;
  19219. }
  19220. else {
  19221. var shouldNegate = value & 1;
  19222. value >>>= 1;
  19223. if (shouldNegate) {
  19224. value = value === 0 ? -0x80000000 : -value;
  19225. }
  19226. segment[j] += value;
  19227. j++;
  19228. value = shift = 0; // reset
  19229. }
  19230. }
  19231. }
  19232. segmentify(line, segment, j);
  19233. decoded.push(line);
  19234. return decoded;
  19235. }
  19236. function segmentify(line, segment, j) {
  19237. // This looks ugly, but we're creating specialized arrays with a specific
  19238. // length. This is much faster than creating a new array (which v8 expands to
  19239. // a capacity of 17 after pushing the first item), or slicing out a subarray
  19240. // (which is slow). Length 4 is assumed to be the most frequent, followed by
  19241. // length 5 (since not everything will have an associated name), followed by
  19242. // length 1 (it's probably rare for a source substring to not have an
  19243. // associated segment data).
  19244. if (j === 4)
  19245. line.push([segment[0], segment[1], segment[2], segment[3]]);
  19246. else if (j === 5)
  19247. line.push([segment[0], segment[1], segment[2], segment[3], segment[4]]);
  19248. else if (j === 1)
  19249. line.push([segment[0]]);
  19250. }
  19251. function encode$1(decoded) {
  19252. var sourceFileIndex = 0; // second field
  19253. var sourceCodeLine = 0; // third field
  19254. var sourceCodeColumn = 0; // fourth field
  19255. var nameIndex = 0; // fifth field
  19256. var mappings = '';
  19257. for (var i = 0; i < decoded.length; i++) {
  19258. var line = decoded[i];
  19259. if (i > 0)
  19260. mappings += ';';
  19261. if (line.length === 0)
  19262. continue;
  19263. var generatedCodeColumn = 0; // first field
  19264. var lineMappings = [];
  19265. for (var _i = 0, line_1 = line; _i < line_1.length; _i++) {
  19266. var segment = line_1[_i];
  19267. var segmentMappings = encodeInteger$1(segment[0] - generatedCodeColumn);
  19268. generatedCodeColumn = segment[0];
  19269. if (segment.length > 1) {
  19270. segmentMappings +=
  19271. encodeInteger$1(segment[1] - sourceFileIndex) +
  19272. encodeInteger$1(segment[2] - sourceCodeLine) +
  19273. encodeInteger$1(segment[3] - sourceCodeColumn);
  19274. sourceFileIndex = segment[1];
  19275. sourceCodeLine = segment[2];
  19276. sourceCodeColumn = segment[3];
  19277. }
  19278. if (segment.length === 5) {
  19279. segmentMappings += encodeInteger$1(segment[4] - nameIndex);
  19280. nameIndex = segment[4];
  19281. }
  19282. lineMappings.push(segmentMappings);
  19283. }
  19284. mappings += lineMappings.join(',');
  19285. }
  19286. return mappings;
  19287. }
  19288. function encodeInteger$1(num) {
  19289. var result = '';
  19290. num = num < 0 ? (-num << 1) | 1 : num << 1;
  19291. do {
  19292. var clamped = num & 31;
  19293. num >>>= 5;
  19294. if (num > 0) {
  19295. clamped |= 32;
  19296. }
  19297. result += chars$1[clamped];
  19298. } while (num > 0);
  19299. return result;
  19300. }
  19301. var BitSet$1 = function BitSet(arg) {
  19302. this.bits = arg instanceof BitSet ? arg.bits.slice() : [];
  19303. };
  19304. BitSet$1.prototype.add = function add (n) {
  19305. this.bits[n >> 5] |= 1 << (n & 31);
  19306. };
  19307. BitSet$1.prototype.has = function has (n) {
  19308. return !!(this.bits[n >> 5] & (1 << (n & 31)));
  19309. };
  19310. var Chunk$1 = function Chunk(start, end, content) {
  19311. this.start = start;
  19312. this.end = end;
  19313. this.original = content;
  19314. this.intro = '';
  19315. this.outro = '';
  19316. this.content = content;
  19317. this.storeName = false;
  19318. this.edited = false;
  19319. // we make these non-enumerable, for sanity while debugging
  19320. Object.defineProperties(this, {
  19321. previous: { writable: true, value: null },
  19322. next: { writable: true, value: null }
  19323. });
  19324. };
  19325. Chunk$1.prototype.appendLeft = function appendLeft (content) {
  19326. this.outro += content;
  19327. };
  19328. Chunk$1.prototype.appendRight = function appendRight (content) {
  19329. this.intro = this.intro + content;
  19330. };
  19331. Chunk$1.prototype.clone = function clone () {
  19332. var chunk = new Chunk$1(this.start, this.end, this.original);
  19333. chunk.intro = this.intro;
  19334. chunk.outro = this.outro;
  19335. chunk.content = this.content;
  19336. chunk.storeName = this.storeName;
  19337. chunk.edited = this.edited;
  19338. return chunk;
  19339. };
  19340. Chunk$1.prototype.contains = function contains (index) {
  19341. return this.start < index && index < this.end;
  19342. };
  19343. Chunk$1.prototype.eachNext = function eachNext (fn) {
  19344. var chunk = this;
  19345. while (chunk) {
  19346. fn(chunk);
  19347. chunk = chunk.next;
  19348. }
  19349. };
  19350. Chunk$1.prototype.eachPrevious = function eachPrevious (fn) {
  19351. var chunk = this;
  19352. while (chunk) {
  19353. fn(chunk);
  19354. chunk = chunk.previous;
  19355. }
  19356. };
  19357. Chunk$1.prototype.edit = function edit (content, storeName, contentOnly) {
  19358. this.content = content;
  19359. if (!contentOnly) {
  19360. this.intro = '';
  19361. this.outro = '';
  19362. }
  19363. this.storeName = storeName;
  19364. this.edited = true;
  19365. return this;
  19366. };
  19367. Chunk$1.prototype.prependLeft = function prependLeft (content) {
  19368. this.outro = content + this.outro;
  19369. };
  19370. Chunk$1.prototype.prependRight = function prependRight (content) {
  19371. this.intro = content + this.intro;
  19372. };
  19373. Chunk$1.prototype.split = function split (index) {
  19374. var sliceIndex = index - this.start;
  19375. var originalBefore = this.original.slice(0, sliceIndex);
  19376. var originalAfter = this.original.slice(sliceIndex);
  19377. this.original = originalBefore;
  19378. var newChunk = new Chunk$1(index, this.end, originalAfter);
  19379. newChunk.outro = this.outro;
  19380. this.outro = '';
  19381. this.end = index;
  19382. if (this.edited) {
  19383. // TODO is this block necessary?...
  19384. newChunk.edit('', false);
  19385. this.content = '';
  19386. } else {
  19387. this.content = originalBefore;
  19388. }
  19389. newChunk.next = this.next;
  19390. if (newChunk.next) { newChunk.next.previous = newChunk; }
  19391. newChunk.previous = this;
  19392. this.next = newChunk;
  19393. return newChunk;
  19394. };
  19395. Chunk$1.prototype.toString = function toString () {
  19396. return this.intro + this.content + this.outro;
  19397. };
  19398. Chunk$1.prototype.trimEnd = function trimEnd (rx) {
  19399. this.outro = this.outro.replace(rx, '');
  19400. if (this.outro.length) { return true; }
  19401. var trimmed = this.content.replace(rx, '');
  19402. if (trimmed.length) {
  19403. if (trimmed !== this.content) {
  19404. this.split(this.start + trimmed.length).edit('', undefined, true);
  19405. }
  19406. return true;
  19407. } else {
  19408. this.edit('', undefined, true);
  19409. this.intro = this.intro.replace(rx, '');
  19410. if (this.intro.length) { return true; }
  19411. }
  19412. };
  19413. Chunk$1.prototype.trimStart = function trimStart (rx) {
  19414. this.intro = this.intro.replace(rx, '');
  19415. if (this.intro.length) { return true; }
  19416. var trimmed = this.content.replace(rx, '');
  19417. if (trimmed.length) {
  19418. if (trimmed !== this.content) {
  19419. this.split(this.end - trimmed.length);
  19420. this.edit('', undefined, true);
  19421. }
  19422. return true;
  19423. } else {
  19424. this.edit('', undefined, true);
  19425. this.outro = this.outro.replace(rx, '');
  19426. if (this.outro.length) { return true; }
  19427. }
  19428. };
  19429. var btoa$2 = function () {
  19430. throw new Error('Unsupported environment: `window.btoa` or `Buffer` should be supported.');
  19431. };
  19432. if (typeof window !== 'undefined' && typeof window.btoa === 'function') {
  19433. btoa$2 = function (str) { return window.btoa(unescape(encodeURIComponent(str))); };
  19434. } else if (typeof Buffer === 'function') {
  19435. btoa$2 = function (str) { return Buffer.from(str, 'utf-8').toString('base64'); };
  19436. }
  19437. var SourceMap$1 = function SourceMap(properties) {
  19438. this.version = 3;
  19439. this.file = properties.file;
  19440. this.sources = properties.sources;
  19441. this.sourcesContent = properties.sourcesContent;
  19442. this.names = properties.names;
  19443. this.mappings = encode$1(properties.mappings);
  19444. };
  19445. SourceMap$1.prototype.toString = function toString () {
  19446. return JSON.stringify(this);
  19447. };
  19448. SourceMap$1.prototype.toUrl = function toUrl () {
  19449. return 'data:application/json;charset=utf-8;base64,' + btoa$2(this.toString());
  19450. };
  19451. function guessIndent$1(code) {
  19452. var lines = code.split('\n');
  19453. var tabbed = lines.filter(function (line) { return /^\t+/.test(line); });
  19454. var spaced = lines.filter(function (line) { return /^ {2,}/.test(line); });
  19455. if (tabbed.length === 0 && spaced.length === 0) {
  19456. return null;
  19457. }
  19458. // More lines tabbed than spaced? Assume tabs, and
  19459. // default to tabs in the case of a tie (or nothing
  19460. // to go on)
  19461. if (tabbed.length >= spaced.length) {
  19462. return '\t';
  19463. }
  19464. // Otherwise, we need to guess the multiple
  19465. var min = spaced.reduce(function (previous, current) {
  19466. var numSpaces = /^ +/.exec(current)[0].length;
  19467. return Math.min(numSpaces, previous);
  19468. }, Infinity);
  19469. return new Array(min + 1).join(' ');
  19470. }
  19471. function getRelativePath$1(from, to) {
  19472. var fromParts = from.split(/[/\\]/);
  19473. var toParts = to.split(/[/\\]/);
  19474. fromParts.pop(); // get dirname
  19475. while (fromParts[0] === toParts[0]) {
  19476. fromParts.shift();
  19477. toParts.shift();
  19478. }
  19479. if (fromParts.length) {
  19480. var i = fromParts.length;
  19481. while (i--) { fromParts[i] = '..'; }
  19482. }
  19483. return fromParts.concat(toParts).join('/');
  19484. }
  19485. var toString$1 = Object.prototype.toString;
  19486. function isObject$2(thing) {
  19487. return toString$1.call(thing) === '[object Object]';
  19488. }
  19489. function getLocator$1(source) {
  19490. var originalLines = source.split('\n');
  19491. var lineOffsets = [];
  19492. for (var i = 0, pos = 0; i < originalLines.length; i++) {
  19493. lineOffsets.push(pos);
  19494. pos += originalLines[i].length + 1;
  19495. }
  19496. return function locate(index) {
  19497. var i = 0;
  19498. var j = lineOffsets.length;
  19499. while (i < j) {
  19500. var m = (i + j) >> 1;
  19501. if (index < lineOffsets[m]) {
  19502. j = m;
  19503. } else {
  19504. i = m + 1;
  19505. }
  19506. }
  19507. var line = i - 1;
  19508. var column = index - lineOffsets[line];
  19509. return { line: line, column: column };
  19510. };
  19511. }
  19512. var Mappings$1 = function Mappings(hires) {
  19513. this.hires = hires;
  19514. this.generatedCodeLine = 0;
  19515. this.generatedCodeColumn = 0;
  19516. this.raw = [];
  19517. this.rawSegments = this.raw[this.generatedCodeLine] = [];
  19518. this.pending = null;
  19519. };
  19520. Mappings$1.prototype.addEdit = function addEdit (sourceIndex, content, loc, nameIndex) {
  19521. if (content.length) {
  19522. var segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column];
  19523. if (nameIndex >= 0) {
  19524. segment.push(nameIndex);
  19525. }
  19526. this.rawSegments.push(segment);
  19527. } else if (this.pending) {
  19528. this.rawSegments.push(this.pending);
  19529. }
  19530. this.advance(content);
  19531. this.pending = null;
  19532. };
  19533. Mappings$1.prototype.addUneditedChunk = function addUneditedChunk (sourceIndex, chunk, original, loc, sourcemapLocations) {
  19534. var originalCharIndex = chunk.start;
  19535. var first = true;
  19536. while (originalCharIndex < chunk.end) {
  19537. if (this.hires || first || sourcemapLocations.has(originalCharIndex)) {
  19538. this.rawSegments.push([this.generatedCodeColumn, sourceIndex, loc.line, loc.column]);
  19539. }
  19540. if (original[originalCharIndex] === '\n') {
  19541. loc.line += 1;
  19542. loc.column = 0;
  19543. this.generatedCodeLine += 1;
  19544. this.raw[this.generatedCodeLine] = this.rawSegments = [];
  19545. this.generatedCodeColumn = 0;
  19546. first = true;
  19547. } else {
  19548. loc.column += 1;
  19549. this.generatedCodeColumn += 1;
  19550. first = false;
  19551. }
  19552. originalCharIndex += 1;
  19553. }
  19554. this.pending = null;
  19555. };
  19556. Mappings$1.prototype.advance = function advance (str) {
  19557. if (!str) { return; }
  19558. var lines = str.split('\n');
  19559. if (lines.length > 1) {
  19560. for (var i = 0; i < lines.length - 1; i++) {
  19561. this.generatedCodeLine++;
  19562. this.raw[this.generatedCodeLine] = this.rawSegments = [];
  19563. }
  19564. this.generatedCodeColumn = 0;
  19565. }
  19566. this.generatedCodeColumn += lines[lines.length - 1].length;
  19567. };
  19568. var n$1 = '\n';
  19569. var warned$1 = {
  19570. insertLeft: false,
  19571. insertRight: false,
  19572. storeName: false
  19573. };
  19574. var MagicString$1 = function MagicString(string, options) {
  19575. if ( options === void 0 ) options = {};
  19576. var chunk = new Chunk$1(0, string.length, string);
  19577. Object.defineProperties(this, {
  19578. original: { writable: true, value: string },
  19579. outro: { writable: true, value: '' },
  19580. intro: { writable: true, value: '' },
  19581. firstChunk: { writable: true, value: chunk },
  19582. lastChunk: { writable: true, value: chunk },
  19583. lastSearchedChunk: { writable: true, value: chunk },
  19584. byStart: { writable: true, value: {} },
  19585. byEnd: { writable: true, value: {} },
  19586. filename: { writable: true, value: options.filename },
  19587. indentExclusionRanges: { writable: true, value: options.indentExclusionRanges },
  19588. sourcemapLocations: { writable: true, value: new BitSet$1() },
  19589. storedNames: { writable: true, value: {} },
  19590. indentStr: { writable: true, value: guessIndent$1(string) }
  19591. });
  19592. this.byStart[0] = chunk;
  19593. this.byEnd[string.length] = chunk;
  19594. };
  19595. MagicString$1.prototype.addSourcemapLocation = function addSourcemapLocation (char) {
  19596. this.sourcemapLocations.add(char);
  19597. };
  19598. MagicString$1.prototype.append = function append (content) {
  19599. if (typeof content !== 'string') { throw new TypeError('outro content must be a string'); }
  19600. this.outro += content;
  19601. return this;
  19602. };
  19603. MagicString$1.prototype.appendLeft = function appendLeft (index, content) {
  19604. if (typeof content !== 'string') { throw new TypeError('inserted content must be a string'); }
  19605. this._split(index);
  19606. var chunk = this.byEnd[index];
  19607. if (chunk) {
  19608. chunk.appendLeft(content);
  19609. } else {
  19610. this.intro += content;
  19611. }
  19612. return this;
  19613. };
  19614. MagicString$1.prototype.appendRight = function appendRight (index, content) {
  19615. if (typeof content !== 'string') { throw new TypeError('inserted content must be a string'); }
  19616. this._split(index);
  19617. var chunk = this.byStart[index];
  19618. if (chunk) {
  19619. chunk.appendRight(content);
  19620. } else {
  19621. this.outro += content;
  19622. }
  19623. return this;
  19624. };
  19625. MagicString$1.prototype.clone = function clone () {
  19626. var cloned = new MagicString$1(this.original, { filename: this.filename });
  19627. var originalChunk = this.firstChunk;
  19628. var clonedChunk = (cloned.firstChunk = cloned.lastSearchedChunk = originalChunk.clone());
  19629. while (originalChunk) {
  19630. cloned.byStart[clonedChunk.start] = clonedChunk;
  19631. cloned.byEnd[clonedChunk.end] = clonedChunk;
  19632. var nextOriginalChunk = originalChunk.next;
  19633. var nextClonedChunk = nextOriginalChunk && nextOriginalChunk.clone();
  19634. if (nextClonedChunk) {
  19635. clonedChunk.next = nextClonedChunk;
  19636. nextClonedChunk.previous = clonedChunk;
  19637. clonedChunk = nextClonedChunk;
  19638. }
  19639. originalChunk = nextOriginalChunk;
  19640. }
  19641. cloned.lastChunk = clonedChunk;
  19642. if (this.indentExclusionRanges) {
  19643. cloned.indentExclusionRanges = this.indentExclusionRanges.slice();
  19644. }
  19645. cloned.sourcemapLocations = new BitSet$1(this.sourcemapLocations);
  19646. cloned.intro = this.intro;
  19647. cloned.outro = this.outro;
  19648. return cloned;
  19649. };
  19650. MagicString$1.prototype.generateDecodedMap = function generateDecodedMap (options) {
  19651. var this$1 = this;
  19652. options = options || {};
  19653. var sourceIndex = 0;
  19654. var names = Object.keys(this.storedNames);
  19655. var mappings = new Mappings$1(options.hires);
  19656. var locate = getLocator$1(this.original);
  19657. if (this.intro) {
  19658. mappings.advance(this.intro);
  19659. }
  19660. this.firstChunk.eachNext(function (chunk) {
  19661. var loc = locate(chunk.start);
  19662. if (chunk.intro.length) { mappings.advance(chunk.intro); }
  19663. if (chunk.edited) {
  19664. mappings.addEdit(
  19665. sourceIndex,
  19666. chunk.content,
  19667. loc,
  19668. chunk.storeName ? names.indexOf(chunk.original) : -1
  19669. );
  19670. } else {
  19671. mappings.addUneditedChunk(sourceIndex, chunk, this$1.original, loc, this$1.sourcemapLocations);
  19672. }
  19673. if (chunk.outro.length) { mappings.advance(chunk.outro); }
  19674. });
  19675. return {
  19676. file: options.file ? options.file.split(/[/\\]/).pop() : null,
  19677. sources: [options.source ? getRelativePath$1(options.file || '', options.source) : null],
  19678. sourcesContent: options.includeContent ? [this.original] : [null],
  19679. names: names,
  19680. mappings: mappings.raw
  19681. };
  19682. };
  19683. MagicString$1.prototype.generateMap = function generateMap (options) {
  19684. return new SourceMap$1(this.generateDecodedMap(options));
  19685. };
  19686. MagicString$1.prototype.getIndentString = function getIndentString () {
  19687. return this.indentStr === null ? '\t' : this.indentStr;
  19688. };
  19689. MagicString$1.prototype.indent = function indent (indentStr, options) {
  19690. var pattern = /^[^\r\n]/gm;
  19691. if (isObject$2(indentStr)) {
  19692. options = indentStr;
  19693. indentStr = undefined;
  19694. }
  19695. indentStr = indentStr !== undefined ? indentStr : this.indentStr || '\t';
  19696. if (indentStr === '') { return this; } // noop
  19697. options = options || {};
  19698. // Process exclusion ranges
  19699. var isExcluded = {};
  19700. if (options.exclude) {
  19701. var exclusions =
  19702. typeof options.exclude[0] === 'number' ? [options.exclude] : options.exclude;
  19703. exclusions.forEach(function (exclusion) {
  19704. for (var i = exclusion[0]; i < exclusion[1]; i += 1) {
  19705. isExcluded[i] = true;
  19706. }
  19707. });
  19708. }
  19709. var shouldIndentNextCharacter = options.indentStart !== false;
  19710. var replacer = function (match) {
  19711. if (shouldIndentNextCharacter) { return ("" + indentStr + match); }
  19712. shouldIndentNextCharacter = true;
  19713. return match;
  19714. };
  19715. this.intro = this.intro.replace(pattern, replacer);
  19716. var charIndex = 0;
  19717. var chunk = this.firstChunk;
  19718. while (chunk) {
  19719. var end = chunk.end;
  19720. if (chunk.edited) {
  19721. if (!isExcluded[charIndex]) {
  19722. chunk.content = chunk.content.replace(pattern, replacer);
  19723. if (chunk.content.length) {
  19724. shouldIndentNextCharacter = chunk.content[chunk.content.length - 1] === '\n';
  19725. }
  19726. }
  19727. } else {
  19728. charIndex = chunk.start;
  19729. while (charIndex < end) {
  19730. if (!isExcluded[charIndex]) {
  19731. var char = this.original[charIndex];
  19732. if (char === '\n') {
  19733. shouldIndentNextCharacter = true;
  19734. } else if (char !== '\r' && shouldIndentNextCharacter) {
  19735. shouldIndentNextCharacter = false;
  19736. if (charIndex === chunk.start) {
  19737. chunk.prependRight(indentStr);
  19738. } else {
  19739. this._splitChunk(chunk, charIndex);
  19740. chunk = chunk.next;
  19741. chunk.prependRight(indentStr);
  19742. }
  19743. }
  19744. }
  19745. charIndex += 1;
  19746. }
  19747. }
  19748. charIndex = chunk.end;
  19749. chunk = chunk.next;
  19750. }
  19751. this.outro = this.outro.replace(pattern, replacer);
  19752. return this;
  19753. };
  19754. MagicString$1.prototype.insert = function insert () {
  19755. throw new Error('magicString.insert(...) is deprecated. Use prependRight(...) or appendLeft(...)');
  19756. };
  19757. MagicString$1.prototype.insertLeft = function insertLeft (index, content) {
  19758. if (!warned$1.insertLeft) {
  19759. console.warn('magicString.insertLeft(...) is deprecated. Use magicString.appendLeft(...) instead'); // eslint-disable-line no-console
  19760. warned$1.insertLeft = true;
  19761. }
  19762. return this.appendLeft(index, content);
  19763. };
  19764. MagicString$1.prototype.insertRight = function insertRight (index, content) {
  19765. if (!warned$1.insertRight) {
  19766. console.warn('magicString.insertRight(...) is deprecated. Use magicString.prependRight(...) instead'); // eslint-disable-line no-console
  19767. warned$1.insertRight = true;
  19768. }
  19769. return this.prependRight(index, content);
  19770. };
  19771. MagicString$1.prototype.move = function move (start, end, index) {
  19772. if (index >= start && index <= end) { throw new Error('Cannot move a selection inside itself'); }
  19773. this._split(start);
  19774. this._split(end);
  19775. this._split(index);
  19776. var first = this.byStart[start];
  19777. var last = this.byEnd[end];
  19778. var oldLeft = first.previous;
  19779. var oldRight = last.next;
  19780. var newRight = this.byStart[index];
  19781. if (!newRight && last === this.lastChunk) { return this; }
  19782. var newLeft = newRight ? newRight.previous : this.lastChunk;
  19783. if (oldLeft) { oldLeft.next = oldRight; }
  19784. if (oldRight) { oldRight.previous = oldLeft; }
  19785. if (newLeft) { newLeft.next = first; }
  19786. if (newRight) { newRight.previous = last; }
  19787. if (!first.previous) { this.firstChunk = last.next; }
  19788. if (!last.next) {
  19789. this.lastChunk = first.previous;
  19790. this.lastChunk.next = null;
  19791. }
  19792. first.previous = newLeft;
  19793. last.next = newRight || null;
  19794. if (!newLeft) { this.firstChunk = first; }
  19795. if (!newRight) { this.lastChunk = last; }
  19796. return this;
  19797. };
  19798. MagicString$1.prototype.overwrite = function overwrite (start, end, content, options) {
  19799. if (typeof content !== 'string') { throw new TypeError('replacement content must be a string'); }
  19800. while (start < 0) { start += this.original.length; }
  19801. while (end < 0) { end += this.original.length; }
  19802. if (end > this.original.length) { throw new Error('end is out of bounds'); }
  19803. if (start === end)
  19804. { throw new Error('Cannot overwrite a zero-length range – use appendLeft or prependRight instead'); }
  19805. this._split(start);
  19806. this._split(end);
  19807. if (options === true) {
  19808. if (!warned$1.storeName) {
  19809. console.warn('The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string'); // eslint-disable-line no-console
  19810. warned$1.storeName = true;
  19811. }
  19812. options = { storeName: true };
  19813. }
  19814. var storeName = options !== undefined ? options.storeName : false;
  19815. var contentOnly = options !== undefined ? options.contentOnly : false;
  19816. if (storeName) {
  19817. var original = this.original.slice(start, end);
  19818. this.storedNames[original] = true;
  19819. }
  19820. var first = this.byStart[start];
  19821. var last = this.byEnd[end];
  19822. if (first) {
  19823. if (end > first.end && first.next !== this.byStart[first.end]) {
  19824. throw new Error('Cannot overwrite across a split point');
  19825. }
  19826. first.edit(content, storeName, contentOnly);
  19827. if (first !== last) {
  19828. var chunk = first.next;
  19829. while (chunk !== last) {
  19830. chunk.edit('', false);
  19831. chunk = chunk.next;
  19832. }
  19833. chunk.edit('', false);
  19834. }
  19835. } else {
  19836. // must be inserting at the end
  19837. var newChunk = new Chunk$1(start, end, '').edit(content, storeName);
  19838. // TODO last chunk in the array may not be the last chunk, if it's moved...
  19839. last.next = newChunk;
  19840. newChunk.previous = last;
  19841. }
  19842. return this;
  19843. };
  19844. MagicString$1.prototype.prepend = function prepend (content) {
  19845. if (typeof content !== 'string') { throw new TypeError('outro content must be a string'); }
  19846. this.intro = content + this.intro;
  19847. return this;
  19848. };
  19849. MagicString$1.prototype.prependLeft = function prependLeft (index, content) {
  19850. if (typeof content !== 'string') { throw new TypeError('inserted content must be a string'); }
  19851. this._split(index);
  19852. var chunk = this.byEnd[index];
  19853. if (chunk) {
  19854. chunk.prependLeft(content);
  19855. } else {
  19856. this.intro = content + this.intro;
  19857. }
  19858. return this;
  19859. };
  19860. MagicString$1.prototype.prependRight = function prependRight (index, content) {
  19861. if (typeof content !== 'string') { throw new TypeError('inserted content must be a string'); }
  19862. this._split(index);
  19863. var chunk = this.byStart[index];
  19864. if (chunk) {
  19865. chunk.prependRight(content);
  19866. } else {
  19867. this.outro = content + this.outro;
  19868. }
  19869. return this;
  19870. };
  19871. MagicString$1.prototype.remove = function remove (start, end) {
  19872. while (start < 0) { start += this.original.length; }
  19873. while (end < 0) { end += this.original.length; }
  19874. if (start === end) { return this; }
  19875. if (start < 0 || end > this.original.length) { throw new Error('Character is out of bounds'); }
  19876. if (start > end) { throw new Error('end must be greater than start'); }
  19877. this._split(start);
  19878. this._split(end);
  19879. var chunk = this.byStart[start];
  19880. while (chunk) {
  19881. chunk.intro = '';
  19882. chunk.outro = '';
  19883. chunk.edit('');
  19884. chunk = end > chunk.end ? this.byStart[chunk.end] : null;
  19885. }
  19886. return this;
  19887. };
  19888. MagicString$1.prototype.lastChar = function lastChar () {
  19889. if (this.outro.length)
  19890. { return this.outro[this.outro.length - 1]; }
  19891. var chunk = this.lastChunk;
  19892. do {
  19893. if (chunk.outro.length)
  19894. { return chunk.outro[chunk.outro.length - 1]; }
  19895. if (chunk.content.length)
  19896. { return chunk.content[chunk.content.length - 1]; }
  19897. if (chunk.intro.length)
  19898. { return chunk.intro[chunk.intro.length - 1]; }
  19899. } while (chunk = chunk.previous);
  19900. if (this.intro.length)
  19901. { return this.intro[this.intro.length - 1]; }
  19902. return '';
  19903. };
  19904. MagicString$1.prototype.lastLine = function lastLine () {
  19905. var lineIndex = this.outro.lastIndexOf(n$1);
  19906. if (lineIndex !== -1)
  19907. { return this.outro.substr(lineIndex + 1); }
  19908. var lineStr = this.outro;
  19909. var chunk = this.lastChunk;
  19910. do {
  19911. if (chunk.outro.length > 0) {
  19912. lineIndex = chunk.outro.lastIndexOf(n$1);
  19913. if (lineIndex !== -1)
  19914. { return chunk.outro.substr(lineIndex + 1) + lineStr; }
  19915. lineStr = chunk.outro + lineStr;
  19916. }
  19917. if (chunk.content.length > 0) {
  19918. lineIndex = chunk.content.lastIndexOf(n$1);
  19919. if (lineIndex !== -1)
  19920. { return chunk.content.substr(lineIndex + 1) + lineStr; }
  19921. lineStr = chunk.content + lineStr;
  19922. }
  19923. if (chunk.intro.length > 0) {
  19924. lineIndex = chunk.intro.lastIndexOf(n$1);
  19925. if (lineIndex !== -1)
  19926. { return chunk.intro.substr(lineIndex + 1) + lineStr; }
  19927. lineStr = chunk.intro + lineStr;
  19928. }
  19929. } while (chunk = chunk.previous);
  19930. lineIndex = this.intro.lastIndexOf(n$1);
  19931. if (lineIndex !== -1)
  19932. { return this.intro.substr(lineIndex + 1) + lineStr; }
  19933. return this.intro + lineStr;
  19934. };
  19935. MagicString$1.prototype.slice = function slice (start, end) {
  19936. if ( start === void 0 ) start = 0;
  19937. if ( end === void 0 ) end = this.original.length;
  19938. while (start < 0) { start += this.original.length; }
  19939. while (end < 0) { end += this.original.length; }
  19940. var result = '';
  19941. // find start chunk
  19942. var chunk = this.firstChunk;
  19943. while (chunk && (chunk.start > start || chunk.end <= start)) {
  19944. // found end chunk before start
  19945. if (chunk.start < end && chunk.end >= end) {
  19946. return result;
  19947. }
  19948. chunk = chunk.next;
  19949. }
  19950. if (chunk && chunk.edited && chunk.start !== start)
  19951. { throw new Error(("Cannot use replaced character " + start + " as slice start anchor.")); }
  19952. var startChunk = chunk;
  19953. while (chunk) {
  19954. if (chunk.intro && (startChunk !== chunk || chunk.start === start)) {
  19955. result += chunk.intro;
  19956. }
  19957. var containsEnd = chunk.start < end && chunk.end >= end;
  19958. if (containsEnd && chunk.edited && chunk.end !== end)
  19959. { throw new Error(("Cannot use replaced character " + end + " as slice end anchor.")); }
  19960. var sliceStart = startChunk === chunk ? start - chunk.start : 0;
  19961. var sliceEnd = containsEnd ? chunk.content.length + end - chunk.end : chunk.content.length;
  19962. result += chunk.content.slice(sliceStart, sliceEnd);
  19963. if (chunk.outro && (!containsEnd || chunk.end === end)) {
  19964. result += chunk.outro;
  19965. }
  19966. if (containsEnd) {
  19967. break;
  19968. }
  19969. chunk = chunk.next;
  19970. }
  19971. return result;
  19972. };
  19973. // TODO deprecate this? not really very useful
  19974. MagicString$1.prototype.snip = function snip (start, end) {
  19975. var clone = this.clone();
  19976. clone.remove(0, start);
  19977. clone.remove(end, clone.original.length);
  19978. return clone;
  19979. };
  19980. MagicString$1.prototype._split = function _split (index) {
  19981. if (this.byStart[index] || this.byEnd[index]) { return; }
  19982. var chunk = this.lastSearchedChunk;
  19983. var searchForward = index > chunk.end;
  19984. while (chunk) {
  19985. if (chunk.contains(index)) { return this._splitChunk(chunk, index); }
  19986. chunk = searchForward ? this.byStart[chunk.end] : this.byEnd[chunk.start];
  19987. }
  19988. };
  19989. MagicString$1.prototype._splitChunk = function _splitChunk (chunk, index) {
  19990. if (chunk.edited && chunk.content.length) {
  19991. // zero-length edited chunks are a special case (overlapping replacements)
  19992. var loc = getLocator$1(this.original)(index);
  19993. throw new Error(
  19994. ("Cannot split a chunk that has already been edited (" + (loc.line) + ":" + (loc.column) + " – \"" + (chunk.original) + "\")")
  19995. );
  19996. }
  19997. var newChunk = chunk.split(index);
  19998. this.byEnd[index] = chunk;
  19999. this.byStart[index] = newChunk;
  20000. this.byEnd[newChunk.end] = newChunk;
  20001. if (chunk === this.lastChunk) { this.lastChunk = newChunk; }
  20002. this.lastSearchedChunk = chunk;
  20003. return true;
  20004. };
  20005. MagicString$1.prototype.toString = function toString () {
  20006. var str = this.intro;
  20007. var chunk = this.firstChunk;
  20008. while (chunk) {
  20009. str += chunk.toString();
  20010. chunk = chunk.next;
  20011. }
  20012. return str + this.outro;
  20013. };
  20014. MagicString$1.prototype.isEmpty = function isEmpty () {
  20015. var chunk = this.firstChunk;
  20016. do {
  20017. if (chunk.intro.length && chunk.intro.trim() ||
  20018. chunk.content.length && chunk.content.trim() ||
  20019. chunk.outro.length && chunk.outro.trim())
  20020. { return false; }
  20021. } while (chunk = chunk.next);
  20022. return true;
  20023. };
  20024. MagicString$1.prototype.length = function length () {
  20025. var chunk = this.firstChunk;
  20026. var length = 0;
  20027. do {
  20028. length += chunk.intro.length + chunk.content.length + chunk.outro.length;
  20029. } while (chunk = chunk.next);
  20030. return length;
  20031. };
  20032. MagicString$1.prototype.trimLines = function trimLines () {
  20033. return this.trim('[\\r\\n]');
  20034. };
  20035. MagicString$1.prototype.trim = function trim (charType) {
  20036. return this.trimStart(charType).trimEnd(charType);
  20037. };
  20038. MagicString$1.prototype.trimEndAborted = function trimEndAborted (charType) {
  20039. var rx = new RegExp((charType || '\\s') + '+$');
  20040. this.outro = this.outro.replace(rx, '');
  20041. if (this.outro.length) { return true; }
  20042. var chunk = this.lastChunk;
  20043. do {
  20044. var end = chunk.end;
  20045. var aborted = chunk.trimEnd(rx);
  20046. // if chunk was trimmed, we have a new lastChunk
  20047. if (chunk.end !== end) {
  20048. if (this.lastChunk === chunk) {
  20049. this.lastChunk = chunk.next;
  20050. }
  20051. this.byEnd[chunk.end] = chunk;
  20052. this.byStart[chunk.next.start] = chunk.next;
  20053. this.byEnd[chunk.next.end] = chunk.next;
  20054. }
  20055. if (aborted) { return true; }
  20056. chunk = chunk.previous;
  20057. } while (chunk);
  20058. return false;
  20059. };
  20060. MagicString$1.prototype.trimEnd = function trimEnd (charType) {
  20061. this.trimEndAborted(charType);
  20062. return this;
  20063. };
  20064. MagicString$1.prototype.trimStartAborted = function trimStartAborted (charType) {
  20065. var rx = new RegExp('^' + (charType || '\\s') + '+');
  20066. this.intro = this.intro.replace(rx, '');
  20067. if (this.intro.length) { return true; }
  20068. var chunk = this.firstChunk;
  20069. do {
  20070. var end = chunk.end;
  20071. var aborted = chunk.trimStart(rx);
  20072. if (chunk.end !== end) {
  20073. // special case...
  20074. if (chunk === this.lastChunk) { this.lastChunk = chunk.next; }
  20075. this.byEnd[chunk.end] = chunk;
  20076. this.byStart[chunk.next.start] = chunk.next;
  20077. this.byEnd[chunk.next.end] = chunk.next;
  20078. }
  20079. if (aborted) { return true; }
  20080. chunk = chunk.next;
  20081. } while (chunk);
  20082. return false;
  20083. };
  20084. MagicString$1.prototype.trimStart = function trimStart (charType) {
  20085. this.trimStartAborted(charType);
  20086. return this;
  20087. };
  20088. var hasOwnProp = Object.prototype.hasOwnProperty;
  20089. var Bundle$1 = function Bundle(options) {
  20090. if ( options === void 0 ) options = {};
  20091. this.intro = options.intro || '';
  20092. this.separator = options.separator !== undefined ? options.separator : '\n';
  20093. this.sources = [];
  20094. this.uniqueSources = [];
  20095. this.uniqueSourceIndexByFilename = {};
  20096. };
  20097. Bundle$1.prototype.addSource = function addSource (source) {
  20098. if (source instanceof MagicString$1) {
  20099. return this.addSource({
  20100. content: source,
  20101. filename: source.filename,
  20102. separator: this.separator
  20103. });
  20104. }
  20105. if (!isObject$2(source) || !source.content) {
  20106. throw new Error('bundle.addSource() takes an object with a `content` property, which should be an instance of MagicString, and an optional `filename`');
  20107. }
  20108. ['filename', 'indentExclusionRanges', 'separator'].forEach(function (option) {
  20109. if (!hasOwnProp.call(source, option)) { source[option] = source.content[option]; }
  20110. });
  20111. if (source.separator === undefined) {
  20112. // TODO there's a bunch of this sort of thing, needs cleaning up
  20113. source.separator = this.separator;
  20114. }
  20115. if (source.filename) {
  20116. if (!hasOwnProp.call(this.uniqueSourceIndexByFilename, source.filename)) {
  20117. this.uniqueSourceIndexByFilename[source.filename] = this.uniqueSources.length;
  20118. this.uniqueSources.push({ filename: source.filename, content: source.content.original });
  20119. } else {
  20120. var uniqueSource = this.uniqueSources[this.uniqueSourceIndexByFilename[source.filename]];
  20121. if (source.content.original !== uniqueSource.content) {
  20122. throw new Error(("Illegal source: same filename (" + (source.filename) + "), different contents"));
  20123. }
  20124. }
  20125. }
  20126. this.sources.push(source);
  20127. return this;
  20128. };
  20129. Bundle$1.prototype.append = function append (str, options) {
  20130. this.addSource({
  20131. content: new MagicString$1(str),
  20132. separator: (options && options.separator) || ''
  20133. });
  20134. return this;
  20135. };
  20136. Bundle$1.prototype.clone = function clone () {
  20137. var bundle = new Bundle$1({
  20138. intro: this.intro,
  20139. separator: this.separator
  20140. });
  20141. this.sources.forEach(function (source) {
  20142. bundle.addSource({
  20143. filename: source.filename,
  20144. content: source.content.clone(),
  20145. separator: source.separator
  20146. });
  20147. });
  20148. return bundle;
  20149. };
  20150. Bundle$1.prototype.generateDecodedMap = function generateDecodedMap (options) {
  20151. var this$1 = this;
  20152. if ( options === void 0 ) options = {};
  20153. var names = [];
  20154. this.sources.forEach(function (source) {
  20155. Object.keys(source.content.storedNames).forEach(function (name) {
  20156. if (!~names.indexOf(name)) { names.push(name); }
  20157. });
  20158. });
  20159. var mappings = new Mappings$1(options.hires);
  20160. if (this.intro) {
  20161. mappings.advance(this.intro);
  20162. }
  20163. this.sources.forEach(function (source, i) {
  20164. if (i > 0) {
  20165. mappings.advance(this$1.separator);
  20166. }
  20167. var sourceIndex = source.filename ? this$1.uniqueSourceIndexByFilename[source.filename] : -1;
  20168. var magicString = source.content;
  20169. var locate = getLocator$1(magicString.original);
  20170. if (magicString.intro) {
  20171. mappings.advance(magicString.intro);
  20172. }
  20173. magicString.firstChunk.eachNext(function (chunk) {
  20174. var loc = locate(chunk.start);
  20175. if (chunk.intro.length) { mappings.advance(chunk.intro); }
  20176. if (source.filename) {
  20177. if (chunk.edited) {
  20178. mappings.addEdit(
  20179. sourceIndex,
  20180. chunk.content,
  20181. loc,
  20182. chunk.storeName ? names.indexOf(chunk.original) : -1
  20183. );
  20184. } else {
  20185. mappings.addUneditedChunk(
  20186. sourceIndex,
  20187. chunk,
  20188. magicString.original,
  20189. loc,
  20190. magicString.sourcemapLocations
  20191. );
  20192. }
  20193. } else {
  20194. mappings.advance(chunk.content);
  20195. }
  20196. if (chunk.outro.length) { mappings.advance(chunk.outro); }
  20197. });
  20198. if (magicString.outro) {
  20199. mappings.advance(magicString.outro);
  20200. }
  20201. });
  20202. return {
  20203. file: options.file ? options.file.split(/[/\\]/).pop() : null,
  20204. sources: this.uniqueSources.map(function (source) {
  20205. return options.file ? getRelativePath$1(options.file, source.filename) : source.filename;
  20206. }),
  20207. sourcesContent: this.uniqueSources.map(function (source) {
  20208. return options.includeContent ? source.content : null;
  20209. }),
  20210. names: names,
  20211. mappings: mappings.raw
  20212. };
  20213. };
  20214. Bundle$1.prototype.generateMap = function generateMap (options) {
  20215. return new SourceMap$1(this.generateDecodedMap(options));
  20216. };
  20217. Bundle$1.prototype.getIndentString = function getIndentString () {
  20218. var indentStringCounts = {};
  20219. this.sources.forEach(function (source) {
  20220. var indentStr = source.content.indentStr;
  20221. if (indentStr === null) { return; }
  20222. if (!indentStringCounts[indentStr]) { indentStringCounts[indentStr] = 0; }
  20223. indentStringCounts[indentStr] += 1;
  20224. });
  20225. return (
  20226. Object.keys(indentStringCounts).sort(function (a, b) {
  20227. return indentStringCounts[a] - indentStringCounts[b];
  20228. })[0] || '\t'
  20229. );
  20230. };
  20231. Bundle$1.prototype.indent = function indent (indentStr) {
  20232. var this$1 = this;
  20233. if (!arguments.length) {
  20234. indentStr = this.getIndentString();
  20235. }
  20236. if (indentStr === '') { return this; } // noop
  20237. var trailingNewline = !this.intro || this.intro.slice(-1) === '\n';
  20238. this.sources.forEach(function (source, i) {
  20239. var separator = source.separator !== undefined ? source.separator : this$1.separator;
  20240. var indentStart = trailingNewline || (i > 0 && /\r?\n$/.test(separator));
  20241. source.content.indent(indentStr, {
  20242. exclude: source.indentExclusionRanges,
  20243. indentStart: indentStart //: trailingNewline || /\r?\n$/.test( separator ) //true///\r?\n/.test( separator )
  20244. });
  20245. trailingNewline = source.content.lastChar() === '\n';
  20246. });
  20247. if (this.intro) {
  20248. this.intro =
  20249. indentStr +
  20250. this.intro.replace(/^[^\n]/gm, function (match, index) {
  20251. return index > 0 ? indentStr + match : match;
  20252. });
  20253. }
  20254. return this;
  20255. };
  20256. Bundle$1.prototype.prepend = function prepend (str) {
  20257. this.intro = str + this.intro;
  20258. return this;
  20259. };
  20260. Bundle$1.prototype.toString = function toString () {
  20261. var this$1 = this;
  20262. var body = this.sources
  20263. .map(function (source, i) {
  20264. var separator = source.separator !== undefined ? source.separator : this$1.separator;
  20265. var str = (i > 0 ? separator : '') + source.content.toString();
  20266. return str;
  20267. })
  20268. .join('');
  20269. return this.intro + body;
  20270. };
  20271. Bundle$1.prototype.isEmpty = function isEmpty () {
  20272. if (this.intro.length && this.intro.trim())
  20273. { return false; }
  20274. if (this.sources.some(function (source) { return !source.content.isEmpty(); }))
  20275. { return false; }
  20276. return true;
  20277. };
  20278. Bundle$1.prototype.length = function length () {
  20279. return this.sources.reduce(function (length, source) { return length + source.content.length(); }, this.intro.length);
  20280. };
  20281. Bundle$1.prototype.trimLines = function trimLines () {
  20282. return this.trim('[\\r\\n]');
  20283. };
  20284. Bundle$1.prototype.trim = function trim (charType) {
  20285. return this.trimStart(charType).trimEnd(charType);
  20286. };
  20287. Bundle$1.prototype.trimStart = function trimStart (charType) {
  20288. var rx = new RegExp('^' + (charType || '\\s') + '+');
  20289. this.intro = this.intro.replace(rx, '');
  20290. if (!this.intro) {
  20291. var source;
  20292. var i = 0;
  20293. do {
  20294. source = this.sources[i++];
  20295. if (!source) {
  20296. break;
  20297. }
  20298. } while (!source.content.trimStartAborted(charType));
  20299. }
  20300. return this;
  20301. };
  20302. Bundle$1.prototype.trimEnd = function trimEnd (charType) {
  20303. var rx = new RegExp((charType || '\\s') + '+$');
  20304. var source;
  20305. var i = this.sources.length - 1;
  20306. do {
  20307. source = this.sources[i--];
  20308. if (!source) {
  20309. this.intro = this.intro.replace(rx, '');
  20310. break;
  20311. }
  20312. } while (!source.content.trimEndAborted(charType));
  20313. return this;
  20314. };
  20315. function relative(from, to) {
  20316. const fromParts = from.split(/[/\\]/).filter(Boolean);
  20317. const toParts = to.split(/[/\\]/).filter(Boolean);
  20318. if (fromParts[0] === '.')
  20319. fromParts.shift();
  20320. if (toParts[0] === '.')
  20321. toParts.shift();
  20322. while (fromParts[0] && toParts[0] && fromParts[0] === toParts[0]) {
  20323. fromParts.shift();
  20324. toParts.shift();
  20325. }
  20326. while (toParts[0] === '..' && fromParts.length > 0) {
  20327. toParts.shift();
  20328. fromParts.pop();
  20329. }
  20330. while (fromParts.pop()) {
  20331. toParts.unshift('..');
  20332. }
  20333. return toParts.join('/');
  20334. }
  20335. const ArrowFunctionExpression$1 = 'ArrowFunctionExpression';
  20336. const BlockStatement$1 = 'BlockStatement';
  20337. const CallExpression$1 = 'CallExpression';
  20338. const ChainExpression$1 = 'ChainExpression';
  20339. const ExpressionStatement$1 = 'ExpressionStatement';
  20340. const Identifier$1 = 'Identifier';
  20341. const ImportDefaultSpecifier$1 = 'ImportDefaultSpecifier';
  20342. const ImportNamespaceSpecifier$1 = 'ImportNamespaceSpecifier';
  20343. const NewExpression$1 = 'NewExpression';
  20344. const Program$1 = 'Program';
  20345. const Property$1 = 'Property';
  20346. const ReturnStatement$1 = 'ReturnStatement';
  20347. function treeshakeNode(node, code, start, end) {
  20348. code.remove(start, end);
  20349. if (node.annotations) {
  20350. for (const annotation of node.annotations) {
  20351. if (!annotation.comment) {
  20352. continue;
  20353. }
  20354. if (annotation.comment.start < start) {
  20355. code.remove(annotation.comment.start, annotation.comment.end);
  20356. }
  20357. else {
  20358. return;
  20359. }
  20360. }
  20361. }
  20362. }
  20363. function removeAnnotations(node, code) {
  20364. if (!node.annotations && node.parent.type === ExpressionStatement$1) {
  20365. node = node.parent;
  20366. }
  20367. if (node.annotations) {
  20368. for (const annotation of node.annotations.filter((a) => a.comment)) {
  20369. code.remove(annotation.comment.start, annotation.comment.end);
  20370. }
  20371. }
  20372. }
  20373. const NO_SEMICOLON = { isNoStatement: true };
  20374. // This assumes there are only white-space and comments between start and the string we are looking for
  20375. function findFirstOccurrenceOutsideComment(code, searchString, start = 0) {
  20376. let searchPos, charCodeAfterSlash;
  20377. searchPos = code.indexOf(searchString, start);
  20378. while (true) {
  20379. start = code.indexOf('/', start);
  20380. if (start === -1 || start >= searchPos)
  20381. return searchPos;
  20382. charCodeAfterSlash = code.charCodeAt(++start);
  20383. ++start;
  20384. // With our assumption, '/' always starts a comment. Determine comment type:
  20385. start =
  20386. charCodeAfterSlash === 47 /*"/"*/
  20387. ? code.indexOf('\n', start) + 1
  20388. : code.indexOf('*/', start) + 2;
  20389. if (start > searchPos) {
  20390. searchPos = code.indexOf(searchString, start);
  20391. }
  20392. }
  20393. }
  20394. const NON_WHITESPACE = /\S/g;
  20395. function findNonWhiteSpace(code, index) {
  20396. NON_WHITESPACE.lastIndex = index;
  20397. const result = NON_WHITESPACE.exec(code);
  20398. return result.index;
  20399. }
  20400. // This assumes "code" only contains white-space and comments
  20401. // Returns position of line-comment if applicable
  20402. function findFirstLineBreakOutsideComment(code) {
  20403. let lineBreakPos, charCodeAfterSlash, start = 0;
  20404. lineBreakPos = code.indexOf('\n', start);
  20405. while (true) {
  20406. start = code.indexOf('/', start);
  20407. if (start === -1 || start > lineBreakPos)
  20408. return [lineBreakPos, lineBreakPos + 1];
  20409. // With our assumption, '/' always starts a comment. Determine comment type:
  20410. charCodeAfterSlash = code.charCodeAt(start + 1);
  20411. if (charCodeAfterSlash === 47 /*"/"*/)
  20412. return [start, lineBreakPos + 1];
  20413. start = code.indexOf('*/', start + 3) + 2;
  20414. if (start > lineBreakPos) {
  20415. lineBreakPos = code.indexOf('\n', start);
  20416. }
  20417. }
  20418. }
  20419. function renderStatementList(statements, code, start, end, options) {
  20420. let currentNode, currentNodeStart, currentNodeNeedsBoundaries, nextNodeStart;
  20421. let nextNode = statements[0];
  20422. let nextNodeNeedsBoundaries = !nextNode.included || nextNode.needsBoundaries;
  20423. if (nextNodeNeedsBoundaries) {
  20424. nextNodeStart =
  20425. start + findFirstLineBreakOutsideComment(code.original.slice(start, nextNode.start))[1];
  20426. }
  20427. for (let nextIndex = 1; nextIndex <= statements.length; nextIndex++) {
  20428. currentNode = nextNode;
  20429. currentNodeStart = nextNodeStart;
  20430. currentNodeNeedsBoundaries = nextNodeNeedsBoundaries;
  20431. nextNode = statements[nextIndex];
  20432. nextNodeNeedsBoundaries =
  20433. nextNode === undefined ? false : !nextNode.included || nextNode.needsBoundaries;
  20434. if (currentNodeNeedsBoundaries || nextNodeNeedsBoundaries) {
  20435. nextNodeStart =
  20436. currentNode.end +
  20437. findFirstLineBreakOutsideComment(code.original.slice(currentNode.end, nextNode === undefined ? end : nextNode.start))[1];
  20438. if (currentNode.included) {
  20439. currentNodeNeedsBoundaries
  20440. ? currentNode.render(code, options, {
  20441. end: nextNodeStart,
  20442. start: currentNodeStart
  20443. })
  20444. : currentNode.render(code, options);
  20445. }
  20446. else {
  20447. treeshakeNode(currentNode, code, currentNodeStart, nextNodeStart);
  20448. }
  20449. }
  20450. else {
  20451. currentNode.render(code, options);
  20452. }
  20453. }
  20454. }
  20455. // This assumes that the first character is not part of the first node
  20456. function getCommaSeparatedNodesWithBoundaries(nodes, code, start, end) {
  20457. const splitUpNodes = [];
  20458. let node, nextNode, nextNodeStart, contentEnd, char;
  20459. let separator = start - 1;
  20460. for (let nextIndex = 0; nextIndex < nodes.length; nextIndex++) {
  20461. nextNode = nodes[nextIndex];
  20462. if (node !== undefined) {
  20463. separator =
  20464. node.end +
  20465. findFirstOccurrenceOutsideComment(code.original.slice(node.end, nextNode.start), ',');
  20466. }
  20467. nextNodeStart = contentEnd =
  20468. separator +
  20469. 1 +
  20470. findFirstLineBreakOutsideComment(code.original.slice(separator + 1, nextNode.start))[1];
  20471. while (((char = code.original.charCodeAt(nextNodeStart)),
  20472. char === 32 /*" "*/ || char === 9 /*"\t"*/ || char === 10 /*"\n"*/ || char === 13) /*"\r"*/)
  20473. nextNodeStart++;
  20474. if (node !== undefined) {
  20475. splitUpNodes.push({
  20476. contentEnd,
  20477. end: nextNodeStart,
  20478. node,
  20479. separator,
  20480. start
  20481. });
  20482. }
  20483. node = nextNode;
  20484. start = nextNodeStart;
  20485. }
  20486. splitUpNodes.push({
  20487. contentEnd: end,
  20488. end,
  20489. node: node,
  20490. separator: null,
  20491. start
  20492. });
  20493. return splitUpNodes;
  20494. }
  20495. // This assumes there are only white-space and comments between start and end
  20496. function removeLineBreaks(code, start, end) {
  20497. while (true) {
  20498. const [removeStart, removeEnd] = findFirstLineBreakOutsideComment(code.original.slice(start, end));
  20499. if (removeStart === -1) {
  20500. break;
  20501. }
  20502. code.remove(start + removeStart, (start += removeEnd));
  20503. }
  20504. }
  20505. function getSystemExportStatement(exportedVariables, options) {
  20506. const _ = options.compact ? '' : ' ';
  20507. if (exportedVariables.length === 1 &&
  20508. options.exportNamesByVariable.get(exportedVariables[0]).length === 1) {
  20509. const variable = exportedVariables[0];
  20510. return `exports('${options.exportNamesByVariable.get(variable)}',${_}${variable.getName()})`;
  20511. }
  20512. else {
  20513. return `exports({${_}${exportedVariables
  20514. .map(variable => {
  20515. return options.exportNamesByVariable
  20516. .get(variable)
  20517. .map(exportName => `${exportName}:${_}${variable.getName()}`)
  20518. .join(`,${_}`);
  20519. })
  20520. .join(`,${_}`)}${_}})`;
  20521. }
  20522. }
  20523. function getSystemExportFunctionLeft(exportedVariables, setFromExpression, options) {
  20524. const _ = options.compact ? '' : ' ';
  20525. const s = options.compact ? '' : ';';
  20526. return `function${_}(v)${_}{${_}return exports({${_}${exportedVariables
  20527. .map(variable => {
  20528. return options.exportNamesByVariable
  20529. .get(variable)
  20530. .map(exportName => `${exportName}:${_}${setFromExpression ? variable.getName() : 'v'}`)
  20531. .join(`,${_}`);
  20532. })
  20533. .join(`,${_}`)}${_}}),${_}v${s}${_}}(`;
  20534. }
  20535. const chars$2 = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_$';
  20536. const base$1 = 64;
  20537. function toBase64(num) {
  20538. let outStr = '';
  20539. do {
  20540. const curDigit = num % base$1;
  20541. num = Math.floor(num / base$1);
  20542. outStr = chars$2[curDigit] + outStr;
  20543. } while (num !== 0);
  20544. return outStr;
  20545. }
  20546. const RESERVED_NAMES = {
  20547. // @ts-ignore
  20548. __proto__: null,
  20549. await: true,
  20550. break: true,
  20551. case: true,
  20552. catch: true,
  20553. class: true,
  20554. const: true,
  20555. continue: true,
  20556. debugger: true,
  20557. default: true,
  20558. delete: true,
  20559. do: true,
  20560. else: true,
  20561. enum: true,
  20562. eval: true,
  20563. export: true,
  20564. extends: true,
  20565. false: true,
  20566. finally: true,
  20567. for: true,
  20568. function: true,
  20569. if: true,
  20570. implements: true,
  20571. import: true,
  20572. in: true,
  20573. instanceof: true,
  20574. interface: true,
  20575. let: true,
  20576. new: true,
  20577. null: true,
  20578. package: true,
  20579. private: true,
  20580. protected: true,
  20581. public: true,
  20582. return: true,
  20583. static: true,
  20584. super: true,
  20585. switch: true,
  20586. this: true,
  20587. throw: true,
  20588. true: true,
  20589. try: true,
  20590. typeof: true,
  20591. undefined: true,
  20592. var: true,
  20593. void: true,
  20594. while: true,
  20595. with: true,
  20596. yield: true
  20597. };
  20598. function getSafeName(baseName, usedNames) {
  20599. let safeName = baseName;
  20600. let count = 1;
  20601. while (usedNames.has(safeName) || RESERVED_NAMES[safeName]) {
  20602. safeName = `${baseName}$${toBase64(count++)}`;
  20603. }
  20604. usedNames.add(safeName);
  20605. return safeName;
  20606. }
  20607. const NO_ARGS = [];
  20608. function getOrCreate(map, key, init) {
  20609. const existing = map.get(key);
  20610. if (existing) {
  20611. return existing;
  20612. }
  20613. const value = init();
  20614. map.set(key, value);
  20615. return value;
  20616. }
  20617. const UnknownKey = Symbol('Unknown Key');
  20618. const EMPTY_PATH = [];
  20619. const UNKNOWN_PATH = [UnknownKey];
  20620. const EntitiesKey = Symbol('Entities');
  20621. class PathTracker {
  20622. constructor() {
  20623. this.entityPaths = Object.create(null, { [EntitiesKey]: { value: new Set() } });
  20624. }
  20625. getEntities(path) {
  20626. let currentPaths = this.entityPaths;
  20627. for (const pathSegment of path) {
  20628. currentPaths = currentPaths[pathSegment] =
  20629. currentPaths[pathSegment] ||
  20630. Object.create(null, { [EntitiesKey]: { value: new Set() } });
  20631. }
  20632. return currentPaths[EntitiesKey];
  20633. }
  20634. }
  20635. const SHARED_RECURSION_TRACKER = new PathTracker();
  20636. class DiscriminatedPathTracker {
  20637. constructor() {
  20638. this.entityPaths = Object.create(null, {
  20639. [EntitiesKey]: { value: new Map() }
  20640. });
  20641. }
  20642. getEntities(path, discriminator) {
  20643. let currentPaths = this.entityPaths;
  20644. for (const pathSegment of path) {
  20645. currentPaths = currentPaths[pathSegment] =
  20646. currentPaths[pathSegment] ||
  20647. Object.create(null, { [EntitiesKey]: { value: new Map() } });
  20648. }
  20649. return getOrCreate(currentPaths[EntitiesKey], discriminator, () => new Set());
  20650. }
  20651. }
  20652. function assembleMemberDescriptions(memberDescriptions, inheritedDescriptions = null) {
  20653. return Object.create(inheritedDescriptions, memberDescriptions);
  20654. }
  20655. const UnknownValue = Symbol('Unknown Value');
  20656. const UNKNOWN_EXPRESSION = {
  20657. deoptimizePath: () => { },
  20658. getLiteralValueAtPath: () => UnknownValue,
  20659. getReturnExpressionWhenCalledAtPath: () => UNKNOWN_EXPRESSION,
  20660. hasEffectsWhenAccessedAtPath: path => path.length > 0,
  20661. hasEffectsWhenAssignedAtPath: path => path.length > 0,
  20662. hasEffectsWhenCalledAtPath: () => true,
  20663. include: () => { },
  20664. includeCallArguments(context, args) {
  20665. for (const arg of args) {
  20666. arg.include(context, false);
  20667. }
  20668. },
  20669. included: true,
  20670. toString: () => '[[UNKNOWN]]'
  20671. };
  20672. const UNDEFINED_EXPRESSION = {
  20673. deoptimizePath: () => { },
  20674. getLiteralValueAtPath: () => undefined,
  20675. getReturnExpressionWhenCalledAtPath: () => UNKNOWN_EXPRESSION,
  20676. hasEffectsWhenAccessedAtPath: path => path.length > 0,
  20677. hasEffectsWhenAssignedAtPath: path => path.length > 0,
  20678. hasEffectsWhenCalledAtPath: () => true,
  20679. include: () => { },
  20680. includeCallArguments() { },
  20681. included: true,
  20682. toString: () => 'undefined'
  20683. };
  20684. const returnsUnknown = {
  20685. value: {
  20686. callsArgs: null,
  20687. mutatesSelf: false,
  20688. returns: null,
  20689. returnsPrimitive: UNKNOWN_EXPRESSION
  20690. }
  20691. };
  20692. const mutatesSelfReturnsUnknown = {
  20693. value: { returns: null, returnsPrimitive: UNKNOWN_EXPRESSION, callsArgs: null, mutatesSelf: true }
  20694. };
  20695. const callsArgReturnsUnknown = {
  20696. value: { returns: null, returnsPrimitive: UNKNOWN_EXPRESSION, callsArgs: [0], mutatesSelf: false }
  20697. };
  20698. class UnknownArrayExpression {
  20699. constructor() {
  20700. this.included = false;
  20701. }
  20702. deoptimizePath() { }
  20703. getLiteralValueAtPath() {
  20704. return UnknownValue;
  20705. }
  20706. getReturnExpressionWhenCalledAtPath(path) {
  20707. if (path.length === 1) {
  20708. return getMemberReturnExpressionWhenCalled(arrayMembers, path[0]);
  20709. }
  20710. return UNKNOWN_EXPRESSION;
  20711. }
  20712. hasEffectsWhenAccessedAtPath(path) {
  20713. return path.length > 1;
  20714. }
  20715. hasEffectsWhenAssignedAtPath(path) {
  20716. return path.length > 1;
  20717. }
  20718. hasEffectsWhenCalledAtPath(path, callOptions, context) {
  20719. if (path.length === 1) {
  20720. return hasMemberEffectWhenCalled(arrayMembers, path[0], this.included, callOptions, context);
  20721. }
  20722. return true;
  20723. }
  20724. include() {
  20725. this.included = true;
  20726. }
  20727. includeCallArguments(context, args) {
  20728. for (const arg of args) {
  20729. arg.include(context, false);
  20730. }
  20731. }
  20732. toString() {
  20733. return '[[UNKNOWN ARRAY]]';
  20734. }
  20735. }
  20736. const returnsArray = {
  20737. value: {
  20738. callsArgs: null,
  20739. mutatesSelf: false,
  20740. returns: UnknownArrayExpression,
  20741. returnsPrimitive: null
  20742. }
  20743. };
  20744. const mutatesSelfReturnsArray = {
  20745. value: {
  20746. callsArgs: null,
  20747. mutatesSelf: true,
  20748. returns: UnknownArrayExpression,
  20749. returnsPrimitive: null
  20750. }
  20751. };
  20752. const callsArgReturnsArray = {
  20753. value: {
  20754. callsArgs: [0],
  20755. mutatesSelf: false,
  20756. returns: UnknownArrayExpression,
  20757. returnsPrimitive: null
  20758. }
  20759. };
  20760. const callsArgMutatesSelfReturnsArray = {
  20761. value: {
  20762. callsArgs: [0],
  20763. mutatesSelf: true,
  20764. returns: UnknownArrayExpression,
  20765. returnsPrimitive: null
  20766. }
  20767. };
  20768. const UNKNOWN_LITERAL_BOOLEAN = {
  20769. deoptimizePath: () => { },
  20770. getLiteralValueAtPath: () => UnknownValue,
  20771. getReturnExpressionWhenCalledAtPath: path => {
  20772. if (path.length === 1) {
  20773. return getMemberReturnExpressionWhenCalled(literalBooleanMembers, path[0]);
  20774. }
  20775. return UNKNOWN_EXPRESSION;
  20776. },
  20777. hasEffectsWhenAccessedAtPath: path => path.length > 1,
  20778. hasEffectsWhenAssignedAtPath: path => path.length > 0,
  20779. hasEffectsWhenCalledAtPath: path => {
  20780. if (path.length === 1) {
  20781. const subPath = path[0];
  20782. return typeof subPath !== 'string' || !literalBooleanMembers[subPath];
  20783. }
  20784. return true;
  20785. },
  20786. include: () => { },
  20787. includeCallArguments(context, args) {
  20788. for (const arg of args) {
  20789. arg.include(context, false);
  20790. }
  20791. },
  20792. included: true,
  20793. toString: () => '[[UNKNOWN BOOLEAN]]'
  20794. };
  20795. const returnsBoolean = {
  20796. value: {
  20797. callsArgs: null,
  20798. mutatesSelf: false,
  20799. returns: null,
  20800. returnsPrimitive: UNKNOWN_LITERAL_BOOLEAN
  20801. }
  20802. };
  20803. const callsArgReturnsBoolean = {
  20804. value: {
  20805. callsArgs: [0],
  20806. mutatesSelf: false,
  20807. returns: null,
  20808. returnsPrimitive: UNKNOWN_LITERAL_BOOLEAN
  20809. }
  20810. };
  20811. const UNKNOWN_LITERAL_NUMBER = {
  20812. deoptimizePath: () => { },
  20813. getLiteralValueAtPath: () => UnknownValue,
  20814. getReturnExpressionWhenCalledAtPath: path => {
  20815. if (path.length === 1) {
  20816. return getMemberReturnExpressionWhenCalled(literalNumberMembers, path[0]);
  20817. }
  20818. return UNKNOWN_EXPRESSION;
  20819. },
  20820. hasEffectsWhenAccessedAtPath: path => path.length > 1,
  20821. hasEffectsWhenAssignedAtPath: path => path.length > 0,
  20822. hasEffectsWhenCalledAtPath: path => {
  20823. if (path.length === 1) {
  20824. const subPath = path[0];
  20825. return typeof subPath !== 'string' || !literalNumberMembers[subPath];
  20826. }
  20827. return true;
  20828. },
  20829. include: () => { },
  20830. includeCallArguments(context, args) {
  20831. for (const arg of args) {
  20832. arg.include(context, false);
  20833. }
  20834. },
  20835. included: true,
  20836. toString: () => '[[UNKNOWN NUMBER]]'
  20837. };
  20838. const returnsNumber = {
  20839. value: {
  20840. callsArgs: null,
  20841. mutatesSelf: false,
  20842. returns: null,
  20843. returnsPrimitive: UNKNOWN_LITERAL_NUMBER
  20844. }
  20845. };
  20846. const mutatesSelfReturnsNumber = {
  20847. value: {
  20848. callsArgs: null,
  20849. mutatesSelf: true,
  20850. returns: null,
  20851. returnsPrimitive: UNKNOWN_LITERAL_NUMBER
  20852. }
  20853. };
  20854. const callsArgReturnsNumber = {
  20855. value: {
  20856. callsArgs: [0],
  20857. mutatesSelf: false,
  20858. returns: null,
  20859. returnsPrimitive: UNKNOWN_LITERAL_NUMBER
  20860. }
  20861. };
  20862. const UNKNOWN_LITERAL_STRING = {
  20863. deoptimizePath: () => { },
  20864. getLiteralValueAtPath: () => UnknownValue,
  20865. getReturnExpressionWhenCalledAtPath: path => {
  20866. if (path.length === 1) {
  20867. return getMemberReturnExpressionWhenCalled(literalStringMembers, path[0]);
  20868. }
  20869. return UNKNOWN_EXPRESSION;
  20870. },
  20871. hasEffectsWhenAccessedAtPath: path => path.length > 1,
  20872. hasEffectsWhenAssignedAtPath: path => path.length > 0,
  20873. hasEffectsWhenCalledAtPath: (path, callOptions, context) => {
  20874. if (path.length === 1) {
  20875. return hasMemberEffectWhenCalled(literalStringMembers, path[0], true, callOptions, context);
  20876. }
  20877. return true;
  20878. },
  20879. include: () => { },
  20880. includeCallArguments(context, args) {
  20881. for (const arg of args) {
  20882. arg.include(context, false);
  20883. }
  20884. },
  20885. included: true,
  20886. toString: () => '[[UNKNOWN STRING]]'
  20887. };
  20888. const returnsString = {
  20889. value: {
  20890. callsArgs: null,
  20891. mutatesSelf: false,
  20892. returns: null,
  20893. returnsPrimitive: UNKNOWN_LITERAL_STRING
  20894. }
  20895. };
  20896. class UnknownObjectExpression {
  20897. constructor() {
  20898. this.included = false;
  20899. }
  20900. deoptimizePath() { }
  20901. getLiteralValueAtPath() {
  20902. return UnknownValue;
  20903. }
  20904. getReturnExpressionWhenCalledAtPath(path) {
  20905. if (path.length === 1) {
  20906. return getMemberReturnExpressionWhenCalled(objectMembers, path[0]);
  20907. }
  20908. return UNKNOWN_EXPRESSION;
  20909. }
  20910. hasEffectsWhenAccessedAtPath(path) {
  20911. return path.length > 1;
  20912. }
  20913. hasEffectsWhenAssignedAtPath(path) {
  20914. return path.length > 1;
  20915. }
  20916. hasEffectsWhenCalledAtPath(path, callOptions, context) {
  20917. if (path.length === 1) {
  20918. return hasMemberEffectWhenCalled(objectMembers, path[0], this.included, callOptions, context);
  20919. }
  20920. return true;
  20921. }
  20922. include() {
  20923. this.included = true;
  20924. }
  20925. includeCallArguments(context, args) {
  20926. for (const arg of args) {
  20927. arg.include(context, false);
  20928. }
  20929. }
  20930. toString() {
  20931. return '[[UNKNOWN OBJECT]]';
  20932. }
  20933. }
  20934. const objectMembers = assembleMemberDescriptions({
  20935. hasOwnProperty: returnsBoolean,
  20936. isPrototypeOf: returnsBoolean,
  20937. propertyIsEnumerable: returnsBoolean,
  20938. toLocaleString: returnsString,
  20939. toString: returnsString,
  20940. valueOf: returnsUnknown
  20941. });
  20942. const arrayMembers = assembleMemberDescriptions({
  20943. concat: returnsArray,
  20944. copyWithin: mutatesSelfReturnsArray,
  20945. every: callsArgReturnsBoolean,
  20946. fill: mutatesSelfReturnsArray,
  20947. filter: callsArgReturnsArray,
  20948. find: callsArgReturnsUnknown,
  20949. findIndex: callsArgReturnsNumber,
  20950. forEach: callsArgReturnsUnknown,
  20951. includes: returnsBoolean,
  20952. indexOf: returnsNumber,
  20953. join: returnsString,
  20954. lastIndexOf: returnsNumber,
  20955. map: callsArgReturnsArray,
  20956. pop: mutatesSelfReturnsUnknown,
  20957. push: mutatesSelfReturnsNumber,
  20958. reduce: callsArgReturnsUnknown,
  20959. reduceRight: callsArgReturnsUnknown,
  20960. reverse: mutatesSelfReturnsArray,
  20961. shift: mutatesSelfReturnsUnknown,
  20962. slice: returnsArray,
  20963. some: callsArgReturnsBoolean,
  20964. sort: callsArgMutatesSelfReturnsArray,
  20965. splice: mutatesSelfReturnsArray,
  20966. unshift: mutatesSelfReturnsNumber
  20967. }, objectMembers);
  20968. const literalBooleanMembers = assembleMemberDescriptions({
  20969. valueOf: returnsBoolean
  20970. }, objectMembers);
  20971. const literalNumberMembers = assembleMemberDescriptions({
  20972. toExponential: returnsString,
  20973. toFixed: returnsString,
  20974. toLocaleString: returnsString,
  20975. toPrecision: returnsString,
  20976. valueOf: returnsNumber
  20977. }, objectMembers);
  20978. const literalStringMembers = assembleMemberDescriptions({
  20979. charAt: returnsString,
  20980. charCodeAt: returnsNumber,
  20981. codePointAt: returnsNumber,
  20982. concat: returnsString,
  20983. endsWith: returnsBoolean,
  20984. includes: returnsBoolean,
  20985. indexOf: returnsNumber,
  20986. lastIndexOf: returnsNumber,
  20987. localeCompare: returnsNumber,
  20988. match: returnsBoolean,
  20989. normalize: returnsString,
  20990. padEnd: returnsString,
  20991. padStart: returnsString,
  20992. repeat: returnsString,
  20993. replace: {
  20994. value: {
  20995. callsArgs: [1],
  20996. mutatesSelf: false,
  20997. returns: null,
  20998. returnsPrimitive: UNKNOWN_LITERAL_STRING
  20999. }
  21000. },
  21001. search: returnsNumber,
  21002. slice: returnsString,
  21003. split: returnsArray,
  21004. startsWith: returnsBoolean,
  21005. substr: returnsString,
  21006. substring: returnsString,
  21007. toLocaleLowerCase: returnsString,
  21008. toLocaleUpperCase: returnsString,
  21009. toLowerCase: returnsString,
  21010. toUpperCase: returnsString,
  21011. trim: returnsString,
  21012. valueOf: returnsString
  21013. }, objectMembers);
  21014. function getLiteralMembersForValue(value) {
  21015. switch (typeof value) {
  21016. case 'boolean':
  21017. return literalBooleanMembers;
  21018. case 'number':
  21019. return literalNumberMembers;
  21020. case 'string':
  21021. return literalStringMembers;
  21022. default:
  21023. return Object.create(null);
  21024. }
  21025. }
  21026. function hasMemberEffectWhenCalled(members, memberName, parentIncluded, callOptions, context) {
  21027. if (typeof memberName !== 'string' ||
  21028. !members[memberName] ||
  21029. (members[memberName].mutatesSelf && parentIncluded))
  21030. return true;
  21031. if (!members[memberName].callsArgs)
  21032. return false;
  21033. for (const argIndex of members[memberName].callsArgs) {
  21034. if (callOptions.args[argIndex] &&
  21035. callOptions.args[argIndex].hasEffectsWhenCalledAtPath(EMPTY_PATH, {
  21036. args: NO_ARGS,
  21037. withNew: false
  21038. }, context))
  21039. return true;
  21040. }
  21041. return false;
  21042. }
  21043. function getMemberReturnExpressionWhenCalled(members, memberName) {
  21044. if (typeof memberName !== 'string' || !members[memberName])
  21045. return UNKNOWN_EXPRESSION;
  21046. return members[memberName].returnsPrimitive !== null
  21047. ? members[memberName].returnsPrimitive
  21048. : new members[memberName].returns();
  21049. }
  21050. const BROKEN_FLOW_NONE = 0;
  21051. const BROKEN_FLOW_BREAK_CONTINUE = 1;
  21052. const BROKEN_FLOW_ERROR_RETURN_LABEL = 2;
  21053. function createInclusionContext() {
  21054. return {
  21055. brokenFlow: BROKEN_FLOW_NONE,
  21056. includedCallArguments: new Set(),
  21057. includedLabels: new Set()
  21058. };
  21059. }
  21060. function createHasEffectsContext() {
  21061. return {
  21062. accessed: new PathTracker(),
  21063. assigned: new PathTracker(),
  21064. brokenFlow: BROKEN_FLOW_NONE,
  21065. called: new DiscriminatedPathTracker(),
  21066. ignore: {
  21067. breaks: false,
  21068. continues: false,
  21069. labels: new Set(),
  21070. returnAwaitYield: false
  21071. },
  21072. includedLabels: new Set(),
  21073. instantiated: new DiscriminatedPathTracker(),
  21074. replacedVariableInits: new Map()
  21075. };
  21076. }
  21077. class Variable {
  21078. constructor(name) {
  21079. this.alwaysRendered = false;
  21080. this.included = false;
  21081. this.isId = false;
  21082. this.isReassigned = false;
  21083. this.renderBaseName = null;
  21084. this.renderName = null;
  21085. this.name = name;
  21086. }
  21087. /**
  21088. * Binds identifiers that reference this variable to this variable.
  21089. * Necessary to be able to change variable names.
  21090. */
  21091. addReference(_identifier) { }
  21092. deoptimizePath(_path) { }
  21093. getBaseVariableName() {
  21094. return this.renderBaseName || this.renderName || this.name;
  21095. }
  21096. getLiteralValueAtPath(_path, _recursionTracker, _origin) {
  21097. return UnknownValue;
  21098. }
  21099. getName() {
  21100. const name = this.renderName || this.name;
  21101. return this.renderBaseName
  21102. ? `${this.renderBaseName}${RESERVED_NAMES[name] ? `['${name}']` : `.${name}`}`
  21103. : name;
  21104. }
  21105. getReturnExpressionWhenCalledAtPath(_path, _recursionTracker, _origin) {
  21106. return UNKNOWN_EXPRESSION;
  21107. }
  21108. hasEffectsWhenAccessedAtPath(path, _context) {
  21109. return path.length > 0;
  21110. }
  21111. hasEffectsWhenAssignedAtPath(_path, _context) {
  21112. return true;
  21113. }
  21114. hasEffectsWhenCalledAtPath(_path, _callOptions, _context) {
  21115. return true;
  21116. }
  21117. /**
  21118. * Marks this variable as being part of the bundle, which is usually the case when one of
  21119. * its identifiers becomes part of the bundle. Returns true if it has not been included
  21120. * previously.
  21121. * Once a variable is included, it should take care all its declarations are included.
  21122. */
  21123. include() {
  21124. this.included = true;
  21125. }
  21126. includeCallArguments(context, args) {
  21127. for (const arg of args) {
  21128. arg.include(context, false);
  21129. }
  21130. }
  21131. markCalledFromTryStatement() { }
  21132. setRenderNames(baseName, name) {
  21133. this.renderBaseName = baseName;
  21134. this.renderName = name;
  21135. }
  21136. }
  21137. // To avoid infinite recursions
  21138. const MAX_PATH_DEPTH = 7;
  21139. class LocalVariable extends Variable {
  21140. constructor(name, declarator, init, context) {
  21141. super(name);
  21142. this.additionalInitializers = null;
  21143. this.calledFromTryStatement = false;
  21144. this.expressionsToBeDeoptimized = [];
  21145. this.declarations = declarator ? [declarator] : [];
  21146. this.init = init;
  21147. this.deoptimizationTracker = context.deoptimizationTracker;
  21148. this.module = context.module;
  21149. }
  21150. addDeclaration(identifier, init) {
  21151. this.declarations.push(identifier);
  21152. if (this.additionalInitializers === null) {
  21153. this.additionalInitializers = this.init === null ? [] : [this.init];
  21154. this.init = UNKNOWN_EXPRESSION;
  21155. this.isReassigned = true;
  21156. }
  21157. if (init !== null) {
  21158. this.additionalInitializers.push(init);
  21159. }
  21160. }
  21161. consolidateInitializers() {
  21162. if (this.additionalInitializers !== null) {
  21163. for (const initializer of this.additionalInitializers) {
  21164. initializer.deoptimizePath(UNKNOWN_PATH);
  21165. }
  21166. this.additionalInitializers = null;
  21167. }
  21168. }
  21169. deoptimizePath(path) {
  21170. if (path.length > MAX_PATH_DEPTH || this.isReassigned)
  21171. return;
  21172. const trackedEntities = this.deoptimizationTracker.getEntities(path);
  21173. if (trackedEntities.has(this))
  21174. return;
  21175. trackedEntities.add(this);
  21176. if (path.length === 0) {
  21177. if (!this.isReassigned) {
  21178. this.isReassigned = true;
  21179. const expressionsToBeDeoptimized = this.expressionsToBeDeoptimized;
  21180. this.expressionsToBeDeoptimized = [];
  21181. for (const expression of expressionsToBeDeoptimized) {
  21182. expression.deoptimizeCache();
  21183. }
  21184. if (this.init) {
  21185. this.init.deoptimizePath(UNKNOWN_PATH);
  21186. }
  21187. }
  21188. }
  21189. else if (this.init) {
  21190. this.init.deoptimizePath(path);
  21191. }
  21192. }
  21193. getLiteralValueAtPath(path, recursionTracker, origin) {
  21194. if (this.isReassigned || !this.init || path.length > MAX_PATH_DEPTH) {
  21195. return UnknownValue;
  21196. }
  21197. const trackedEntities = recursionTracker.getEntities(path);
  21198. if (trackedEntities.has(this.init)) {
  21199. return UnknownValue;
  21200. }
  21201. this.expressionsToBeDeoptimized.push(origin);
  21202. trackedEntities.add(this.init);
  21203. const value = this.init.getLiteralValueAtPath(path, recursionTracker, origin);
  21204. trackedEntities.delete(this.init);
  21205. return value;
  21206. }
  21207. getReturnExpressionWhenCalledAtPath(path, recursionTracker, origin) {
  21208. if (this.isReassigned || !this.init || path.length > MAX_PATH_DEPTH) {
  21209. return UNKNOWN_EXPRESSION;
  21210. }
  21211. const trackedEntities = recursionTracker.getEntities(path);
  21212. if (trackedEntities.has(this.init)) {
  21213. return UNKNOWN_EXPRESSION;
  21214. }
  21215. this.expressionsToBeDeoptimized.push(origin);
  21216. trackedEntities.add(this.init);
  21217. const value = this.init.getReturnExpressionWhenCalledAtPath(path, recursionTracker, origin);
  21218. trackedEntities.delete(this.init);
  21219. return value;
  21220. }
  21221. hasEffectsWhenAccessedAtPath(path, context) {
  21222. if (path.length === 0)
  21223. return false;
  21224. if (this.isReassigned || path.length > MAX_PATH_DEPTH)
  21225. return true;
  21226. const trackedExpressions = context.accessed.getEntities(path);
  21227. if (trackedExpressions.has(this))
  21228. return false;
  21229. trackedExpressions.add(this);
  21230. return (this.init && this.init.hasEffectsWhenAccessedAtPath(path, context));
  21231. }
  21232. hasEffectsWhenAssignedAtPath(path, context) {
  21233. if (this.included || path.length > MAX_PATH_DEPTH)
  21234. return true;
  21235. if (path.length === 0)
  21236. return false;
  21237. if (this.isReassigned)
  21238. return true;
  21239. const trackedExpressions = context.assigned.getEntities(path);
  21240. if (trackedExpressions.has(this))
  21241. return false;
  21242. trackedExpressions.add(this);
  21243. return (this.init && this.init.hasEffectsWhenAssignedAtPath(path, context));
  21244. }
  21245. hasEffectsWhenCalledAtPath(path, callOptions, context) {
  21246. if (path.length > MAX_PATH_DEPTH || this.isReassigned)
  21247. return true;
  21248. const trackedExpressions = (callOptions.withNew
  21249. ? context.instantiated
  21250. : context.called).getEntities(path, callOptions);
  21251. if (trackedExpressions.has(this))
  21252. return false;
  21253. trackedExpressions.add(this);
  21254. return (this.init && this.init.hasEffectsWhenCalledAtPath(path, callOptions, context));
  21255. }
  21256. include() {
  21257. if (!this.included) {
  21258. this.included = true;
  21259. for (const declaration of this.declarations) {
  21260. // If node is a default export, it can save a tree-shaking run to include the full declaration now
  21261. if (!declaration.included)
  21262. declaration.include(createInclusionContext(), false);
  21263. let node = declaration.parent;
  21264. while (!node.included) {
  21265. // We do not want to properly include parents in case they are part of a dead branch
  21266. // in which case .include() might pull in more dead code
  21267. node.included = true;
  21268. if (node.type === Program$1)
  21269. break;
  21270. node = node.parent;
  21271. }
  21272. }
  21273. }
  21274. }
  21275. includeCallArguments(context, args) {
  21276. if (this.isReassigned || (this.init && context.includedCallArguments.has(this.init))) {
  21277. for (const arg of args) {
  21278. arg.include(context, false);
  21279. }
  21280. }
  21281. else if (this.init) {
  21282. context.includedCallArguments.add(this.init);
  21283. this.init.includeCallArguments(context, args);
  21284. context.includedCallArguments.delete(this.init);
  21285. }
  21286. }
  21287. markCalledFromTryStatement() {
  21288. this.calledFromTryStatement = true;
  21289. }
  21290. }
  21291. class Scope$1$1 {
  21292. constructor() {
  21293. this.children = [];
  21294. this.variables = new Map();
  21295. }
  21296. addDeclaration(identifier, context, init, _isHoisted) {
  21297. const name = identifier.name;
  21298. let variable = this.variables.get(name);
  21299. if (variable) {
  21300. variable.addDeclaration(identifier, init);
  21301. }
  21302. else {
  21303. variable = new LocalVariable(identifier.name, identifier, init || UNDEFINED_EXPRESSION, context);
  21304. this.variables.set(name, variable);
  21305. }
  21306. return variable;
  21307. }
  21308. contains(name) {
  21309. return this.variables.has(name);
  21310. }
  21311. findVariable(_name) {
  21312. throw new Error('Internal Error: findVariable needs to be implemented by a subclass');
  21313. }
  21314. }
  21315. class ChildScope extends Scope$1$1 {
  21316. constructor(parent) {
  21317. super();
  21318. this.accessedOutsideVariables = new Map();
  21319. this.parent = parent;
  21320. parent.children.push(this);
  21321. }
  21322. addAccessedDynamicImport(importExpression) {
  21323. (this.accessedDynamicImports || (this.accessedDynamicImports = new Set())).add(importExpression);
  21324. if (this.parent instanceof ChildScope) {
  21325. this.parent.addAccessedDynamicImport(importExpression);
  21326. }
  21327. }
  21328. addAccessedGlobals(globals, accessedGlobalsByScope) {
  21329. const accessedGlobals = accessedGlobalsByScope.get(this) || new Set();
  21330. for (const name of globals) {
  21331. accessedGlobals.add(name);
  21332. }
  21333. accessedGlobalsByScope.set(this, accessedGlobals);
  21334. if (this.parent instanceof ChildScope) {
  21335. this.parent.addAccessedGlobals(globals, accessedGlobalsByScope);
  21336. }
  21337. }
  21338. addNamespaceMemberAccess(name, variable) {
  21339. this.accessedOutsideVariables.set(name, variable);
  21340. this.parent.addNamespaceMemberAccess(name, variable);
  21341. }
  21342. addReturnExpression(expression) {
  21343. this.parent instanceof ChildScope && this.parent.addReturnExpression(expression);
  21344. }
  21345. addUsedOutsideNames(usedNames, format, exportNamesByVariable, accessedGlobalsByScope) {
  21346. for (const variable of this.accessedOutsideVariables.values()) {
  21347. if (variable.included) {
  21348. usedNames.add(variable.getBaseVariableName());
  21349. if (format === 'system' && exportNamesByVariable.has(variable)) {
  21350. usedNames.add('exports');
  21351. }
  21352. }
  21353. }
  21354. const accessedGlobals = accessedGlobalsByScope.get(this);
  21355. if (accessedGlobals) {
  21356. for (const name of accessedGlobals) {
  21357. usedNames.add(name);
  21358. }
  21359. }
  21360. }
  21361. contains(name) {
  21362. return this.variables.has(name) || this.parent.contains(name);
  21363. }
  21364. deconflict(format, exportNamesByVariable, accessedGlobalsByScope) {
  21365. const usedNames = new Set();
  21366. this.addUsedOutsideNames(usedNames, format, exportNamesByVariable, accessedGlobalsByScope);
  21367. if (this.accessedDynamicImports) {
  21368. for (const importExpression of this.accessedDynamicImports) {
  21369. if (importExpression.inlineNamespace) {
  21370. usedNames.add(importExpression.inlineNamespace.getBaseVariableName());
  21371. }
  21372. }
  21373. }
  21374. for (const [name, variable] of this.variables) {
  21375. if (variable.included || variable.alwaysRendered) {
  21376. variable.setRenderNames(null, getSafeName(name, usedNames));
  21377. }
  21378. }
  21379. for (const scope of this.children) {
  21380. scope.deconflict(format, exportNamesByVariable, accessedGlobalsByScope);
  21381. }
  21382. }
  21383. findLexicalBoundary() {
  21384. return this.parent.findLexicalBoundary();
  21385. }
  21386. findVariable(name) {
  21387. const knownVariable = this.variables.get(name) || this.accessedOutsideVariables.get(name);
  21388. if (knownVariable) {
  21389. return knownVariable;
  21390. }
  21391. const variable = this.parent.findVariable(name);
  21392. this.accessedOutsideVariables.set(name, variable);
  21393. return variable;
  21394. }
  21395. }
  21396. function getLocator$2(source, options) {
  21397. if (options === void 0) { options = {}; }
  21398. var offsetLine = options.offsetLine || 0;
  21399. var offsetColumn = options.offsetColumn || 0;
  21400. var originalLines = source.split('\n');
  21401. var start = 0;
  21402. var lineRanges = originalLines.map(function (line, i) {
  21403. var end = start + line.length + 1;
  21404. var range = { start: start, end: end, line: i };
  21405. start = end;
  21406. return range;
  21407. });
  21408. var i = 0;
  21409. function rangeContains(range, index) {
  21410. return range.start <= index && index < range.end;
  21411. }
  21412. function getLocation(range, index) {
  21413. return { line: offsetLine + range.line, column: offsetColumn + index - range.start, character: index };
  21414. }
  21415. function locate(search, startIndex) {
  21416. if (typeof search === 'string') {
  21417. search = source.indexOf(search, startIndex || 0);
  21418. }
  21419. var range = lineRanges[i];
  21420. var d = search >= range.end ? 1 : -1;
  21421. while (range) {
  21422. if (rangeContains(range, search))
  21423. return getLocation(range, search);
  21424. i += d;
  21425. range = lineRanges[i];
  21426. }
  21427. }
  21428. return locate;
  21429. }
  21430. function locate(source, search, options) {
  21431. if (typeof options === 'number') {
  21432. throw new Error('locate takes a { startIndex, offsetLine, offsetColumn } object as the third argument');
  21433. }
  21434. return getLocator$2(source, options)(search, options && options.startIndex);
  21435. }
  21436. const keys = {
  21437. Literal: [],
  21438. Program: ['body']
  21439. };
  21440. function getAndCreateKeys(esTreeNode) {
  21441. keys[esTreeNode.type] = Object.keys(esTreeNode).filter(key => key !== '_rollupAnnotations' && typeof esTreeNode[key] === 'object');
  21442. return keys[esTreeNode.type];
  21443. }
  21444. const INCLUDE_PARAMETERS = 'variables';
  21445. class NodeBase {
  21446. constructor(esTreeNode, parent, parentScope) {
  21447. this.included = false;
  21448. this.esTreeNode = esTreeNode;
  21449. this.keys = keys[esTreeNode.type] || getAndCreateKeys(esTreeNode);
  21450. this.parent = parent;
  21451. this.context = parent.context;
  21452. this.createScope(parentScope);
  21453. this.parseNode(esTreeNode);
  21454. this.initialise();
  21455. this.context.magicString.addSourcemapLocation(this.start);
  21456. this.context.magicString.addSourcemapLocation(this.end);
  21457. }
  21458. addExportedVariables(_variables, _exportNamesByVariable) { }
  21459. /**
  21460. * Override this to bind assignments to variables and do any initialisations that
  21461. * require the scopes to be populated with variables.
  21462. */
  21463. bind() {
  21464. for (const key of this.keys) {
  21465. const value = this[key];
  21466. if (value === null)
  21467. continue;
  21468. if (Array.isArray(value)) {
  21469. for (const child of value) {
  21470. if (child !== null)
  21471. child.bind();
  21472. }
  21473. }
  21474. else {
  21475. value.bind();
  21476. }
  21477. }
  21478. }
  21479. /**
  21480. * Override if this node should receive a different scope than the parent scope.
  21481. */
  21482. createScope(parentScope) {
  21483. this.scope = parentScope;
  21484. }
  21485. deoptimizePath(_path) { }
  21486. getLiteralValueAtPath(_path, _recursionTracker, _origin) {
  21487. return UnknownValue;
  21488. }
  21489. getReturnExpressionWhenCalledAtPath(_path, _recursionTracker, _origin) {
  21490. return UNKNOWN_EXPRESSION;
  21491. }
  21492. hasEffects(context) {
  21493. for (const key of this.keys) {
  21494. const value = this[key];
  21495. if (value === null)
  21496. continue;
  21497. if (Array.isArray(value)) {
  21498. for (const child of value) {
  21499. if (child !== null && child.hasEffects(context))
  21500. return true;
  21501. }
  21502. }
  21503. else if (value.hasEffects(context))
  21504. return true;
  21505. }
  21506. return false;
  21507. }
  21508. hasEffectsWhenAccessedAtPath(path, _context) {
  21509. return path.length > 0;
  21510. }
  21511. hasEffectsWhenAssignedAtPath(_path, _context) {
  21512. return true;
  21513. }
  21514. hasEffectsWhenCalledAtPath(_path, _callOptions, _context) {
  21515. return true;
  21516. }
  21517. include(context, includeChildrenRecursively) {
  21518. this.included = true;
  21519. for (const key of this.keys) {
  21520. const value = this[key];
  21521. if (value === null)
  21522. continue;
  21523. if (Array.isArray(value)) {
  21524. for (const child of value) {
  21525. if (child !== null)
  21526. child.include(context, includeChildrenRecursively);
  21527. }
  21528. }
  21529. else {
  21530. value.include(context, includeChildrenRecursively);
  21531. }
  21532. }
  21533. }
  21534. includeAsSingleStatement(context, includeChildrenRecursively) {
  21535. this.include(context, includeChildrenRecursively);
  21536. }
  21537. includeCallArguments(context, args) {
  21538. for (const arg of args) {
  21539. arg.include(context, false);
  21540. }
  21541. }
  21542. /**
  21543. * Override to perform special initialisation steps after the scope is initialised
  21544. */
  21545. initialise() { }
  21546. insertSemicolon(code) {
  21547. if (code.original[this.end - 1] !== ';') {
  21548. code.appendLeft(this.end, ';');
  21549. }
  21550. }
  21551. parseNode(esTreeNode) {
  21552. for (const key of Object.keys(esTreeNode)) {
  21553. // That way, we can override this function to add custom initialisation and then call super.parseNode
  21554. if (this.hasOwnProperty(key))
  21555. continue;
  21556. const value = esTreeNode[key];
  21557. if (key === '_rollupAnnotations') {
  21558. this.annotations = value;
  21559. }
  21560. else if (typeof value !== 'object' || value === null) {
  21561. this[key] = value;
  21562. }
  21563. else if (Array.isArray(value)) {
  21564. this[key] = [];
  21565. for (const child of value) {
  21566. this[key].push(child === null
  21567. ? null
  21568. : new (this.context.nodeConstructors[child.type] ||
  21569. this.context.nodeConstructors.UnknownNode)(child, this, this.scope));
  21570. }
  21571. }
  21572. else {
  21573. this[key] = new (this.context.nodeConstructors[value.type] ||
  21574. this.context.nodeConstructors.UnknownNode)(value, this, this.scope);
  21575. }
  21576. }
  21577. }
  21578. render(code, options) {
  21579. for (const key of this.keys) {
  21580. const value = this[key];
  21581. if (value === null)
  21582. continue;
  21583. if (Array.isArray(value)) {
  21584. for (const child of value) {
  21585. if (child !== null)
  21586. child.render(code, options);
  21587. }
  21588. }
  21589. else {
  21590. value.render(code, options);
  21591. }
  21592. }
  21593. }
  21594. shouldBeIncluded(context) {
  21595. return this.included || (!context.brokenFlow && this.hasEffects(createHasEffectsContext()));
  21596. }
  21597. }
  21598. class ClassNode extends NodeBase {
  21599. createScope(parentScope) {
  21600. this.scope = new ChildScope(parentScope);
  21601. }
  21602. hasEffectsWhenAccessedAtPath(path) {
  21603. if (path.length <= 1)
  21604. return false;
  21605. return path.length > 2 || path[0] !== 'prototype';
  21606. }
  21607. hasEffectsWhenAssignedAtPath(path) {
  21608. if (path.length <= 1)
  21609. return false;
  21610. return path.length > 2 || path[0] !== 'prototype';
  21611. }
  21612. hasEffectsWhenCalledAtPath(path, callOptions, context) {
  21613. if (!callOptions.withNew)
  21614. return true;
  21615. return (this.body.hasEffectsWhenCalledAtPath(path, callOptions, context) ||
  21616. (this.superClass !== null &&
  21617. this.superClass.hasEffectsWhenCalledAtPath(path, callOptions, context)));
  21618. }
  21619. initialise() {
  21620. if (this.id !== null) {
  21621. this.id.declare('class', this);
  21622. }
  21623. }
  21624. }
  21625. class ClassDeclaration extends ClassNode {
  21626. initialise() {
  21627. super.initialise();
  21628. if (this.id !== null) {
  21629. this.id.variable.isId = true;
  21630. }
  21631. }
  21632. parseNode(esTreeNode) {
  21633. if (esTreeNode.id !== null) {
  21634. this.id = new this.context.nodeConstructors.Identifier(esTreeNode.id, this, this.scope.parent);
  21635. }
  21636. super.parseNode(esTreeNode);
  21637. }
  21638. render(code, options) {
  21639. if (options.format === 'system' &&
  21640. this.id &&
  21641. options.exportNamesByVariable.has(this.id.variable)) {
  21642. code.appendLeft(this.end, `${options.compact ? '' : ' '}${getSystemExportStatement([this.id.variable], options)};`);
  21643. }
  21644. super.render(code, options);
  21645. }
  21646. }
  21647. class ArgumentsVariable extends LocalVariable {
  21648. constructor(context) {
  21649. super('arguments', null, UNKNOWN_EXPRESSION, context);
  21650. }
  21651. hasEffectsWhenAccessedAtPath(path) {
  21652. return path.length > 1;
  21653. }
  21654. hasEffectsWhenAssignedAtPath() {
  21655. return true;
  21656. }
  21657. hasEffectsWhenCalledAtPath() {
  21658. return true;
  21659. }
  21660. }
  21661. class ThisVariable extends LocalVariable {
  21662. constructor(context) {
  21663. super('this', null, null, context);
  21664. }
  21665. getLiteralValueAtPath() {
  21666. return UnknownValue;
  21667. }
  21668. hasEffectsWhenAccessedAtPath(path, context) {
  21669. return (this.getInit(context).hasEffectsWhenAccessedAtPath(path, context) ||
  21670. super.hasEffectsWhenAccessedAtPath(path, context));
  21671. }
  21672. hasEffectsWhenAssignedAtPath(path, context) {
  21673. return (this.getInit(context).hasEffectsWhenAssignedAtPath(path, context) ||
  21674. super.hasEffectsWhenAssignedAtPath(path, context));
  21675. }
  21676. hasEffectsWhenCalledAtPath(path, callOptions, context) {
  21677. return (this.getInit(context).hasEffectsWhenCalledAtPath(path, callOptions, context) ||
  21678. super.hasEffectsWhenCalledAtPath(path, callOptions, context));
  21679. }
  21680. getInit(context) {
  21681. return context.replacedVariableInits.get(this) || UNKNOWN_EXPRESSION;
  21682. }
  21683. }
  21684. class SpreadElement extends NodeBase {
  21685. bind() {
  21686. super.bind();
  21687. // Only properties of properties of the argument could become subject to reassignment
  21688. // This will also reassign the return values of iterators
  21689. this.argument.deoptimizePath([UnknownKey, UnknownKey]);
  21690. }
  21691. }
  21692. class ParameterScope extends ChildScope {
  21693. constructor(parent, context) {
  21694. super(parent);
  21695. this.parameters = [];
  21696. this.hasRest = false;
  21697. this.context = context;
  21698. this.hoistedBodyVarScope = new ChildScope(this);
  21699. }
  21700. /**
  21701. * Adds a parameter to this scope. Parameters must be added in the correct
  21702. * order, e.g. from left to right.
  21703. */
  21704. addParameterDeclaration(identifier) {
  21705. const name = identifier.name;
  21706. let variable = this.hoistedBodyVarScope.variables.get(name);
  21707. if (variable) {
  21708. variable.addDeclaration(identifier, null);
  21709. }
  21710. else {
  21711. variable = new LocalVariable(name, identifier, UNKNOWN_EXPRESSION, this.context);
  21712. }
  21713. this.variables.set(name, variable);
  21714. return variable;
  21715. }
  21716. addParameterVariables(parameters, hasRest) {
  21717. this.parameters = parameters;
  21718. for (const parameterList of parameters) {
  21719. for (const parameter of parameterList) {
  21720. parameter.alwaysRendered = true;
  21721. }
  21722. }
  21723. this.hasRest = hasRest;
  21724. }
  21725. includeCallArguments(context, args) {
  21726. let calledFromTryStatement = false;
  21727. let argIncluded = false;
  21728. const restParam = this.hasRest && this.parameters[this.parameters.length - 1];
  21729. for (const checkedArg of args) {
  21730. if (checkedArg instanceof SpreadElement) {
  21731. for (const arg of args) {
  21732. arg.include(context, false);
  21733. }
  21734. break;
  21735. }
  21736. }
  21737. for (let index = args.length - 1; index >= 0; index--) {
  21738. const paramVars = this.parameters[index] || restParam;
  21739. const arg = args[index];
  21740. if (paramVars) {
  21741. calledFromTryStatement = false;
  21742. if (paramVars.length === 0) {
  21743. // handle empty destructuring
  21744. argIncluded = true;
  21745. }
  21746. else {
  21747. for (const variable of paramVars) {
  21748. if (variable.included) {
  21749. argIncluded = true;
  21750. }
  21751. if (variable.calledFromTryStatement) {
  21752. calledFromTryStatement = true;
  21753. }
  21754. }
  21755. }
  21756. }
  21757. if (!argIncluded && arg.shouldBeIncluded(context)) {
  21758. argIncluded = true;
  21759. }
  21760. if (argIncluded) {
  21761. arg.include(context, calledFromTryStatement);
  21762. }
  21763. }
  21764. }
  21765. }
  21766. class ReturnValueScope extends ParameterScope {
  21767. constructor() {
  21768. super(...arguments);
  21769. this.returnExpression = null;
  21770. this.returnExpressions = [];
  21771. }
  21772. addReturnExpression(expression) {
  21773. this.returnExpressions.push(expression);
  21774. }
  21775. getReturnExpression() {
  21776. if (this.returnExpression === null)
  21777. this.updateReturnExpression();
  21778. return this.returnExpression;
  21779. }
  21780. updateReturnExpression() {
  21781. if (this.returnExpressions.length === 1) {
  21782. this.returnExpression = this.returnExpressions[0];
  21783. }
  21784. else {
  21785. this.returnExpression = UNKNOWN_EXPRESSION;
  21786. for (const expression of this.returnExpressions) {
  21787. expression.deoptimizePath(UNKNOWN_PATH);
  21788. }
  21789. }
  21790. }
  21791. }
  21792. class FunctionScope extends ReturnValueScope {
  21793. constructor(parent, context) {
  21794. super(parent, context);
  21795. this.variables.set('arguments', (this.argumentsVariable = new ArgumentsVariable(context)));
  21796. this.variables.set('this', (this.thisVariable = new ThisVariable(context)));
  21797. }
  21798. findLexicalBoundary() {
  21799. return this;
  21800. }
  21801. includeCallArguments(context, args) {
  21802. super.includeCallArguments(context, args);
  21803. if (this.argumentsVariable.included) {
  21804. for (const arg of args) {
  21805. if (!arg.included) {
  21806. arg.include(context, false);
  21807. }
  21808. }
  21809. }
  21810. }
  21811. }
  21812. //@ts-check
  21813. /** @typedef { import('estree').Node} Node */
  21814. /** @typedef {Node | {
  21815. * type: 'PropertyDefinition';
  21816. * computed: boolean;
  21817. * value: Node
  21818. * }} NodeWithPropertyDefinition */
  21819. /**
  21820. *
  21821. * @param {NodeWithPropertyDefinition} node
  21822. * @param {NodeWithPropertyDefinition} parent
  21823. * @returns boolean
  21824. */
  21825. function is_reference (node, parent) {
  21826. if (node.type === 'MemberExpression') {
  21827. return !node.computed && is_reference(node.object, node);
  21828. }
  21829. if (node.type === 'Identifier') {
  21830. if (!parent) return true;
  21831. switch (parent.type) {
  21832. // disregard `bar` in `foo.bar`
  21833. case 'MemberExpression': return parent.computed || node === parent.object;
  21834. // disregard the `foo` in `class {foo(){}}` but keep it in `class {[foo](){}}`
  21835. case 'MethodDefinition': return parent.computed;
  21836. // disregard the `foo` in `class {foo=bar}` but keep it in `class {[foo]=bar}` and `class {bar=foo}`
  21837. case 'PropertyDefinition': return parent.computed || node === parent.value;
  21838. // disregard the `bar` in `{ bar: foo }`, but keep it in `{ [bar]: foo }`
  21839. case 'Property': return parent.computed || node === parent.value;
  21840. // disregard the `bar` in `export { foo as bar }` or
  21841. // the foo in `import { foo as bar }`
  21842. case 'ExportSpecifier':
  21843. case 'ImportSpecifier': return node === parent.local;
  21844. // disregard the `foo` in `foo: while (...) { ... break foo; ... continue foo;}`
  21845. case 'LabeledStatement':
  21846. case 'BreakStatement':
  21847. case 'ContinueStatement': return false;
  21848. default: return true;
  21849. }
  21850. }
  21851. return false;
  21852. }
  21853. const BLANK = Object.freeze(Object.create(null));
  21854. const EMPTY_OBJECT = Object.freeze({});
  21855. const EMPTY_ARRAY = Object.freeze([]);
  21856. const ValueProperties = Symbol('Value Properties');
  21857. const PURE = { pure: true };
  21858. const IMPURE = { pure: false };
  21859. // We use shortened variables to reduce file size here
  21860. /* OBJECT */
  21861. const O = {
  21862. // @ts-ignore
  21863. __proto__: null,
  21864. [ValueProperties]: IMPURE
  21865. };
  21866. /* PURE FUNCTION */
  21867. const PF = {
  21868. // @ts-ignore
  21869. __proto__: null,
  21870. [ValueProperties]: PURE
  21871. };
  21872. /* CONSTRUCTOR */
  21873. const C = {
  21874. // @ts-ignore
  21875. __proto__: null,
  21876. [ValueProperties]: IMPURE,
  21877. prototype: O
  21878. };
  21879. /* PURE CONSTRUCTOR */
  21880. const PC = {
  21881. // @ts-ignore
  21882. __proto__: null,
  21883. [ValueProperties]: PURE,
  21884. prototype: O
  21885. };
  21886. const ARRAY_TYPE = {
  21887. // @ts-ignore
  21888. __proto__: null,
  21889. [ValueProperties]: PURE,
  21890. from: PF,
  21891. of: PF,
  21892. prototype: O
  21893. };
  21894. const INTL_MEMBER = {
  21895. // @ts-ignore
  21896. __proto__: null,
  21897. [ValueProperties]: PURE,
  21898. supportedLocalesOf: PC
  21899. };
  21900. const knownGlobals = {
  21901. // Placeholders for global objects to avoid shape mutations
  21902. global: O,
  21903. globalThis: O,
  21904. self: O,
  21905. window: O,
  21906. // Common globals
  21907. // @ts-ignore
  21908. __proto__: null,
  21909. [ValueProperties]: IMPURE,
  21910. Array: {
  21911. // @ts-ignore
  21912. __proto__: null,
  21913. [ValueProperties]: IMPURE,
  21914. from: O,
  21915. isArray: PF,
  21916. of: PF,
  21917. prototype: O
  21918. },
  21919. ArrayBuffer: {
  21920. // @ts-ignore
  21921. __proto__: null,
  21922. [ValueProperties]: PURE,
  21923. isView: PF,
  21924. prototype: O
  21925. },
  21926. Atomics: O,
  21927. BigInt: C,
  21928. BigInt64Array: C,
  21929. BigUint64Array: C,
  21930. Boolean: PC,
  21931. // @ts-ignore
  21932. constructor: C,
  21933. DataView: PC,
  21934. Date: {
  21935. // @ts-ignore
  21936. __proto__: null,
  21937. [ValueProperties]: PURE,
  21938. now: PF,
  21939. parse: PF,
  21940. prototype: O,
  21941. UTC: PF
  21942. },
  21943. decodeURI: PF,
  21944. decodeURIComponent: PF,
  21945. encodeURI: PF,
  21946. encodeURIComponent: PF,
  21947. Error: PC,
  21948. escape: PF,
  21949. eval: O,
  21950. EvalError: PC,
  21951. Float32Array: ARRAY_TYPE,
  21952. Float64Array: ARRAY_TYPE,
  21953. Function: C,
  21954. // @ts-ignore
  21955. hasOwnProperty: O,
  21956. Infinity: O,
  21957. Int16Array: ARRAY_TYPE,
  21958. Int32Array: ARRAY_TYPE,
  21959. Int8Array: ARRAY_TYPE,
  21960. isFinite: PF,
  21961. isNaN: PF,
  21962. // @ts-ignore
  21963. isPrototypeOf: O,
  21964. JSON: O,
  21965. Map: PC,
  21966. Math: {
  21967. // @ts-ignore
  21968. __proto__: null,
  21969. [ValueProperties]: IMPURE,
  21970. abs: PF,
  21971. acos: PF,
  21972. acosh: PF,
  21973. asin: PF,
  21974. asinh: PF,
  21975. atan: PF,
  21976. atan2: PF,
  21977. atanh: PF,
  21978. cbrt: PF,
  21979. ceil: PF,
  21980. clz32: PF,
  21981. cos: PF,
  21982. cosh: PF,
  21983. exp: PF,
  21984. expm1: PF,
  21985. floor: PF,
  21986. fround: PF,
  21987. hypot: PF,
  21988. imul: PF,
  21989. log: PF,
  21990. log10: PF,
  21991. log1p: PF,
  21992. log2: PF,
  21993. max: PF,
  21994. min: PF,
  21995. pow: PF,
  21996. random: PF,
  21997. round: PF,
  21998. sign: PF,
  21999. sin: PF,
  22000. sinh: PF,
  22001. sqrt: PF,
  22002. tan: PF,
  22003. tanh: PF,
  22004. trunc: PF
  22005. },
  22006. NaN: O,
  22007. Number: {
  22008. // @ts-ignore
  22009. __proto__: null,
  22010. [ValueProperties]: PURE,
  22011. isFinite: PF,
  22012. isInteger: PF,
  22013. isNaN: PF,
  22014. isSafeInteger: PF,
  22015. parseFloat: PF,
  22016. parseInt: PF,
  22017. prototype: O
  22018. },
  22019. Object: {
  22020. // @ts-ignore
  22021. __proto__: null,
  22022. [ValueProperties]: PURE,
  22023. create: PF,
  22024. getNotifier: PF,
  22025. getOwn: PF,
  22026. getOwnPropertyDescriptor: PF,
  22027. getOwnPropertyNames: PF,
  22028. getOwnPropertySymbols: PF,
  22029. getPrototypeOf: PF,
  22030. is: PF,
  22031. isExtensible: PF,
  22032. isFrozen: PF,
  22033. isSealed: PF,
  22034. keys: PF,
  22035. prototype: O
  22036. },
  22037. parseFloat: PF,
  22038. parseInt: PF,
  22039. Promise: {
  22040. // @ts-ignore
  22041. __proto__: null,
  22042. [ValueProperties]: IMPURE,
  22043. all: PF,
  22044. prototype: O,
  22045. race: PF,
  22046. resolve: PF
  22047. },
  22048. // @ts-ignore
  22049. propertyIsEnumerable: O,
  22050. Proxy: O,
  22051. RangeError: PC,
  22052. ReferenceError: PC,
  22053. Reflect: O,
  22054. RegExp: PC,
  22055. Set: PC,
  22056. SharedArrayBuffer: C,
  22057. String: {
  22058. // @ts-ignore
  22059. __proto__: null,
  22060. [ValueProperties]: PURE,
  22061. fromCharCode: PF,
  22062. fromCodePoint: PF,
  22063. prototype: O,
  22064. raw: PF
  22065. },
  22066. Symbol: {
  22067. // @ts-ignore
  22068. __proto__: null,
  22069. [ValueProperties]: PURE,
  22070. for: PF,
  22071. keyFor: PF,
  22072. prototype: O
  22073. },
  22074. SyntaxError: PC,
  22075. // @ts-ignore
  22076. toLocaleString: O,
  22077. // @ts-ignore
  22078. toString: O,
  22079. TypeError: PC,
  22080. Uint16Array: ARRAY_TYPE,
  22081. Uint32Array: ARRAY_TYPE,
  22082. Uint8Array: ARRAY_TYPE,
  22083. Uint8ClampedArray: ARRAY_TYPE,
  22084. // Technically, this is a global, but it needs special handling
  22085. // undefined: ?,
  22086. unescape: PF,
  22087. URIError: PC,
  22088. // @ts-ignore
  22089. valueOf: O,
  22090. WeakMap: PC,
  22091. WeakSet: PC,
  22092. // Additional globals shared by Node and Browser that are not strictly part of the language
  22093. clearInterval: C,
  22094. clearTimeout: C,
  22095. console: O,
  22096. Intl: {
  22097. // @ts-ignore
  22098. __proto__: null,
  22099. [ValueProperties]: IMPURE,
  22100. Collator: INTL_MEMBER,
  22101. DateTimeFormat: INTL_MEMBER,
  22102. ListFormat: INTL_MEMBER,
  22103. NumberFormat: INTL_MEMBER,
  22104. PluralRules: INTL_MEMBER,
  22105. RelativeTimeFormat: INTL_MEMBER
  22106. },
  22107. setInterval: C,
  22108. setTimeout: C,
  22109. TextDecoder: C,
  22110. TextEncoder: C,
  22111. URL: C,
  22112. URLSearchParams: C,
  22113. // Browser specific globals
  22114. AbortController: C,
  22115. AbortSignal: C,
  22116. addEventListener: O,
  22117. alert: O,
  22118. AnalyserNode: C,
  22119. Animation: C,
  22120. AnimationEvent: C,
  22121. applicationCache: O,
  22122. ApplicationCache: C,
  22123. ApplicationCacheErrorEvent: C,
  22124. atob: O,
  22125. Attr: C,
  22126. Audio: C,
  22127. AudioBuffer: C,
  22128. AudioBufferSourceNode: C,
  22129. AudioContext: C,
  22130. AudioDestinationNode: C,
  22131. AudioListener: C,
  22132. AudioNode: C,
  22133. AudioParam: C,
  22134. AudioProcessingEvent: C,
  22135. AudioScheduledSourceNode: C,
  22136. AudioWorkletNode: C,
  22137. BarProp: C,
  22138. BaseAudioContext: C,
  22139. BatteryManager: C,
  22140. BeforeUnloadEvent: C,
  22141. BiquadFilterNode: C,
  22142. Blob: C,
  22143. BlobEvent: C,
  22144. blur: O,
  22145. BroadcastChannel: C,
  22146. btoa: O,
  22147. ByteLengthQueuingStrategy: C,
  22148. Cache: C,
  22149. caches: O,
  22150. CacheStorage: C,
  22151. cancelAnimationFrame: O,
  22152. cancelIdleCallback: O,
  22153. CanvasCaptureMediaStreamTrack: C,
  22154. CanvasGradient: C,
  22155. CanvasPattern: C,
  22156. CanvasRenderingContext2D: C,
  22157. ChannelMergerNode: C,
  22158. ChannelSplitterNode: C,
  22159. CharacterData: C,
  22160. clientInformation: O,
  22161. ClipboardEvent: C,
  22162. close: O,
  22163. closed: O,
  22164. CloseEvent: C,
  22165. Comment: C,
  22166. CompositionEvent: C,
  22167. confirm: O,
  22168. ConstantSourceNode: C,
  22169. ConvolverNode: C,
  22170. CountQueuingStrategy: C,
  22171. createImageBitmap: O,
  22172. Credential: C,
  22173. CredentialsContainer: C,
  22174. crypto: O,
  22175. Crypto: C,
  22176. CryptoKey: C,
  22177. CSS: C,
  22178. CSSConditionRule: C,
  22179. CSSFontFaceRule: C,
  22180. CSSGroupingRule: C,
  22181. CSSImportRule: C,
  22182. CSSKeyframeRule: C,
  22183. CSSKeyframesRule: C,
  22184. CSSMediaRule: C,
  22185. CSSNamespaceRule: C,
  22186. CSSPageRule: C,
  22187. CSSRule: C,
  22188. CSSRuleList: C,
  22189. CSSStyleDeclaration: C,
  22190. CSSStyleRule: C,
  22191. CSSStyleSheet: C,
  22192. CSSSupportsRule: C,
  22193. CustomElementRegistry: C,
  22194. customElements: O,
  22195. CustomEvent: C,
  22196. DataTransfer: C,
  22197. DataTransferItem: C,
  22198. DataTransferItemList: C,
  22199. defaultstatus: O,
  22200. defaultStatus: O,
  22201. DelayNode: C,
  22202. DeviceMotionEvent: C,
  22203. DeviceOrientationEvent: C,
  22204. devicePixelRatio: O,
  22205. dispatchEvent: O,
  22206. document: O,
  22207. Document: C,
  22208. DocumentFragment: C,
  22209. DocumentType: C,
  22210. DOMError: C,
  22211. DOMException: C,
  22212. DOMImplementation: C,
  22213. DOMMatrix: C,
  22214. DOMMatrixReadOnly: C,
  22215. DOMParser: C,
  22216. DOMPoint: C,
  22217. DOMPointReadOnly: C,
  22218. DOMQuad: C,
  22219. DOMRect: C,
  22220. DOMRectReadOnly: C,
  22221. DOMStringList: C,
  22222. DOMStringMap: C,
  22223. DOMTokenList: C,
  22224. DragEvent: C,
  22225. DynamicsCompressorNode: C,
  22226. Element: C,
  22227. ErrorEvent: C,
  22228. Event: C,
  22229. EventSource: C,
  22230. EventTarget: C,
  22231. external: O,
  22232. fetch: O,
  22233. File: C,
  22234. FileList: C,
  22235. FileReader: C,
  22236. find: O,
  22237. focus: O,
  22238. FocusEvent: C,
  22239. FontFace: C,
  22240. FontFaceSetLoadEvent: C,
  22241. FormData: C,
  22242. frames: O,
  22243. GainNode: C,
  22244. Gamepad: C,
  22245. GamepadButton: C,
  22246. GamepadEvent: C,
  22247. getComputedStyle: O,
  22248. getSelection: O,
  22249. HashChangeEvent: C,
  22250. Headers: C,
  22251. history: O,
  22252. History: C,
  22253. HTMLAllCollection: C,
  22254. HTMLAnchorElement: C,
  22255. HTMLAreaElement: C,
  22256. HTMLAudioElement: C,
  22257. HTMLBaseElement: C,
  22258. HTMLBodyElement: C,
  22259. HTMLBRElement: C,
  22260. HTMLButtonElement: C,
  22261. HTMLCanvasElement: C,
  22262. HTMLCollection: C,
  22263. HTMLContentElement: C,
  22264. HTMLDataElement: C,
  22265. HTMLDataListElement: C,
  22266. HTMLDetailsElement: C,
  22267. HTMLDialogElement: C,
  22268. HTMLDirectoryElement: C,
  22269. HTMLDivElement: C,
  22270. HTMLDListElement: C,
  22271. HTMLDocument: C,
  22272. HTMLElement: C,
  22273. HTMLEmbedElement: C,
  22274. HTMLFieldSetElement: C,
  22275. HTMLFontElement: C,
  22276. HTMLFormControlsCollection: C,
  22277. HTMLFormElement: C,
  22278. HTMLFrameElement: C,
  22279. HTMLFrameSetElement: C,
  22280. HTMLHeadElement: C,
  22281. HTMLHeadingElement: C,
  22282. HTMLHRElement: C,
  22283. HTMLHtmlElement: C,
  22284. HTMLIFrameElement: C,
  22285. HTMLImageElement: C,
  22286. HTMLInputElement: C,
  22287. HTMLLabelElement: C,
  22288. HTMLLegendElement: C,
  22289. HTMLLIElement: C,
  22290. HTMLLinkElement: C,
  22291. HTMLMapElement: C,
  22292. HTMLMarqueeElement: C,
  22293. HTMLMediaElement: C,
  22294. HTMLMenuElement: C,
  22295. HTMLMetaElement: C,
  22296. HTMLMeterElement: C,
  22297. HTMLModElement: C,
  22298. HTMLObjectElement: C,
  22299. HTMLOListElement: C,
  22300. HTMLOptGroupElement: C,
  22301. HTMLOptionElement: C,
  22302. HTMLOptionsCollection: C,
  22303. HTMLOutputElement: C,
  22304. HTMLParagraphElement: C,
  22305. HTMLParamElement: C,
  22306. HTMLPictureElement: C,
  22307. HTMLPreElement: C,
  22308. HTMLProgressElement: C,
  22309. HTMLQuoteElement: C,
  22310. HTMLScriptElement: C,
  22311. HTMLSelectElement: C,
  22312. HTMLShadowElement: C,
  22313. HTMLSlotElement: C,
  22314. HTMLSourceElement: C,
  22315. HTMLSpanElement: C,
  22316. HTMLStyleElement: C,
  22317. HTMLTableCaptionElement: C,
  22318. HTMLTableCellElement: C,
  22319. HTMLTableColElement: C,
  22320. HTMLTableElement: C,
  22321. HTMLTableRowElement: C,
  22322. HTMLTableSectionElement: C,
  22323. HTMLTemplateElement: C,
  22324. HTMLTextAreaElement: C,
  22325. HTMLTimeElement: C,
  22326. HTMLTitleElement: C,
  22327. HTMLTrackElement: C,
  22328. HTMLUListElement: C,
  22329. HTMLUnknownElement: C,
  22330. HTMLVideoElement: C,
  22331. IDBCursor: C,
  22332. IDBCursorWithValue: C,
  22333. IDBDatabase: C,
  22334. IDBFactory: C,
  22335. IDBIndex: C,
  22336. IDBKeyRange: C,
  22337. IDBObjectStore: C,
  22338. IDBOpenDBRequest: C,
  22339. IDBRequest: C,
  22340. IDBTransaction: C,
  22341. IDBVersionChangeEvent: C,
  22342. IdleDeadline: C,
  22343. IIRFilterNode: C,
  22344. Image: C,
  22345. ImageBitmap: C,
  22346. ImageBitmapRenderingContext: C,
  22347. ImageCapture: C,
  22348. ImageData: C,
  22349. indexedDB: O,
  22350. innerHeight: O,
  22351. innerWidth: O,
  22352. InputEvent: C,
  22353. IntersectionObserver: C,
  22354. IntersectionObserverEntry: C,
  22355. isSecureContext: O,
  22356. KeyboardEvent: C,
  22357. KeyframeEffect: C,
  22358. length: O,
  22359. localStorage: O,
  22360. location: O,
  22361. Location: C,
  22362. locationbar: O,
  22363. matchMedia: O,
  22364. MediaDeviceInfo: C,
  22365. MediaDevices: C,
  22366. MediaElementAudioSourceNode: C,
  22367. MediaEncryptedEvent: C,
  22368. MediaError: C,
  22369. MediaKeyMessageEvent: C,
  22370. MediaKeySession: C,
  22371. MediaKeyStatusMap: C,
  22372. MediaKeySystemAccess: C,
  22373. MediaList: C,
  22374. MediaQueryList: C,
  22375. MediaQueryListEvent: C,
  22376. MediaRecorder: C,
  22377. MediaSettingsRange: C,
  22378. MediaSource: C,
  22379. MediaStream: C,
  22380. MediaStreamAudioDestinationNode: C,
  22381. MediaStreamAudioSourceNode: C,
  22382. MediaStreamEvent: C,
  22383. MediaStreamTrack: C,
  22384. MediaStreamTrackEvent: C,
  22385. menubar: O,
  22386. MessageChannel: C,
  22387. MessageEvent: C,
  22388. MessagePort: C,
  22389. MIDIAccess: C,
  22390. MIDIConnectionEvent: C,
  22391. MIDIInput: C,
  22392. MIDIInputMap: C,
  22393. MIDIMessageEvent: C,
  22394. MIDIOutput: C,
  22395. MIDIOutputMap: C,
  22396. MIDIPort: C,
  22397. MimeType: C,
  22398. MimeTypeArray: C,
  22399. MouseEvent: C,
  22400. moveBy: O,
  22401. moveTo: O,
  22402. MutationEvent: C,
  22403. MutationObserver: C,
  22404. MutationRecord: C,
  22405. name: O,
  22406. NamedNodeMap: C,
  22407. NavigationPreloadManager: C,
  22408. navigator: O,
  22409. Navigator: C,
  22410. NetworkInformation: C,
  22411. Node: C,
  22412. NodeFilter: O,
  22413. NodeIterator: C,
  22414. NodeList: C,
  22415. Notification: C,
  22416. OfflineAudioCompletionEvent: C,
  22417. OfflineAudioContext: C,
  22418. offscreenBuffering: O,
  22419. OffscreenCanvas: C,
  22420. open: O,
  22421. openDatabase: O,
  22422. Option: C,
  22423. origin: O,
  22424. OscillatorNode: C,
  22425. outerHeight: O,
  22426. outerWidth: O,
  22427. PageTransitionEvent: C,
  22428. pageXOffset: O,
  22429. pageYOffset: O,
  22430. PannerNode: C,
  22431. parent: O,
  22432. Path2D: C,
  22433. PaymentAddress: C,
  22434. PaymentRequest: C,
  22435. PaymentRequestUpdateEvent: C,
  22436. PaymentResponse: C,
  22437. performance: O,
  22438. Performance: C,
  22439. PerformanceEntry: C,
  22440. PerformanceLongTaskTiming: C,
  22441. PerformanceMark: C,
  22442. PerformanceMeasure: C,
  22443. PerformanceNavigation: C,
  22444. PerformanceNavigationTiming: C,
  22445. PerformanceObserver: C,
  22446. PerformanceObserverEntryList: C,
  22447. PerformancePaintTiming: C,
  22448. PerformanceResourceTiming: C,
  22449. PerformanceTiming: C,
  22450. PeriodicWave: C,
  22451. Permissions: C,
  22452. PermissionStatus: C,
  22453. personalbar: O,
  22454. PhotoCapabilities: C,
  22455. Plugin: C,
  22456. PluginArray: C,
  22457. PointerEvent: C,
  22458. PopStateEvent: C,
  22459. postMessage: O,
  22460. Presentation: C,
  22461. PresentationAvailability: C,
  22462. PresentationConnection: C,
  22463. PresentationConnectionAvailableEvent: C,
  22464. PresentationConnectionCloseEvent: C,
  22465. PresentationConnectionList: C,
  22466. PresentationReceiver: C,
  22467. PresentationRequest: C,
  22468. print: O,
  22469. ProcessingInstruction: C,
  22470. ProgressEvent: C,
  22471. PromiseRejectionEvent: C,
  22472. prompt: O,
  22473. PushManager: C,
  22474. PushSubscription: C,
  22475. PushSubscriptionOptions: C,
  22476. queueMicrotask: O,
  22477. RadioNodeList: C,
  22478. Range: C,
  22479. ReadableStream: C,
  22480. RemotePlayback: C,
  22481. removeEventListener: O,
  22482. Request: C,
  22483. requestAnimationFrame: O,
  22484. requestIdleCallback: O,
  22485. resizeBy: O,
  22486. ResizeObserver: C,
  22487. ResizeObserverEntry: C,
  22488. resizeTo: O,
  22489. Response: C,
  22490. RTCCertificate: C,
  22491. RTCDataChannel: C,
  22492. RTCDataChannelEvent: C,
  22493. RTCDtlsTransport: C,
  22494. RTCIceCandidate: C,
  22495. RTCIceTransport: C,
  22496. RTCPeerConnection: C,
  22497. RTCPeerConnectionIceEvent: C,
  22498. RTCRtpReceiver: C,
  22499. RTCRtpSender: C,
  22500. RTCSctpTransport: C,
  22501. RTCSessionDescription: C,
  22502. RTCStatsReport: C,
  22503. RTCTrackEvent: C,
  22504. screen: O,
  22505. Screen: C,
  22506. screenLeft: O,
  22507. ScreenOrientation: C,
  22508. screenTop: O,
  22509. screenX: O,
  22510. screenY: O,
  22511. ScriptProcessorNode: C,
  22512. scroll: O,
  22513. scrollbars: O,
  22514. scrollBy: O,
  22515. scrollTo: O,
  22516. scrollX: O,
  22517. scrollY: O,
  22518. SecurityPolicyViolationEvent: C,
  22519. Selection: C,
  22520. ServiceWorker: C,
  22521. ServiceWorkerContainer: C,
  22522. ServiceWorkerRegistration: C,
  22523. sessionStorage: O,
  22524. ShadowRoot: C,
  22525. SharedWorker: C,
  22526. SourceBuffer: C,
  22527. SourceBufferList: C,
  22528. speechSynthesis: O,
  22529. SpeechSynthesisEvent: C,
  22530. SpeechSynthesisUtterance: C,
  22531. StaticRange: C,
  22532. status: O,
  22533. statusbar: O,
  22534. StereoPannerNode: C,
  22535. stop: O,
  22536. Storage: C,
  22537. StorageEvent: C,
  22538. StorageManager: C,
  22539. styleMedia: O,
  22540. StyleSheet: C,
  22541. StyleSheetList: C,
  22542. SubtleCrypto: C,
  22543. SVGAElement: C,
  22544. SVGAngle: C,
  22545. SVGAnimatedAngle: C,
  22546. SVGAnimatedBoolean: C,
  22547. SVGAnimatedEnumeration: C,
  22548. SVGAnimatedInteger: C,
  22549. SVGAnimatedLength: C,
  22550. SVGAnimatedLengthList: C,
  22551. SVGAnimatedNumber: C,
  22552. SVGAnimatedNumberList: C,
  22553. SVGAnimatedPreserveAspectRatio: C,
  22554. SVGAnimatedRect: C,
  22555. SVGAnimatedString: C,
  22556. SVGAnimatedTransformList: C,
  22557. SVGAnimateElement: C,
  22558. SVGAnimateMotionElement: C,
  22559. SVGAnimateTransformElement: C,
  22560. SVGAnimationElement: C,
  22561. SVGCircleElement: C,
  22562. SVGClipPathElement: C,
  22563. SVGComponentTransferFunctionElement: C,
  22564. SVGDefsElement: C,
  22565. SVGDescElement: C,
  22566. SVGDiscardElement: C,
  22567. SVGElement: C,
  22568. SVGEllipseElement: C,
  22569. SVGFEBlendElement: C,
  22570. SVGFEColorMatrixElement: C,
  22571. SVGFEComponentTransferElement: C,
  22572. SVGFECompositeElement: C,
  22573. SVGFEConvolveMatrixElement: C,
  22574. SVGFEDiffuseLightingElement: C,
  22575. SVGFEDisplacementMapElement: C,
  22576. SVGFEDistantLightElement: C,
  22577. SVGFEDropShadowElement: C,
  22578. SVGFEFloodElement: C,
  22579. SVGFEFuncAElement: C,
  22580. SVGFEFuncBElement: C,
  22581. SVGFEFuncGElement: C,
  22582. SVGFEFuncRElement: C,
  22583. SVGFEGaussianBlurElement: C,
  22584. SVGFEImageElement: C,
  22585. SVGFEMergeElement: C,
  22586. SVGFEMergeNodeElement: C,
  22587. SVGFEMorphologyElement: C,
  22588. SVGFEOffsetElement: C,
  22589. SVGFEPointLightElement: C,
  22590. SVGFESpecularLightingElement: C,
  22591. SVGFESpotLightElement: C,
  22592. SVGFETileElement: C,
  22593. SVGFETurbulenceElement: C,
  22594. SVGFilterElement: C,
  22595. SVGForeignObjectElement: C,
  22596. SVGGElement: C,
  22597. SVGGeometryElement: C,
  22598. SVGGradientElement: C,
  22599. SVGGraphicsElement: C,
  22600. SVGImageElement: C,
  22601. SVGLength: C,
  22602. SVGLengthList: C,
  22603. SVGLinearGradientElement: C,
  22604. SVGLineElement: C,
  22605. SVGMarkerElement: C,
  22606. SVGMaskElement: C,
  22607. SVGMatrix: C,
  22608. SVGMetadataElement: C,
  22609. SVGMPathElement: C,
  22610. SVGNumber: C,
  22611. SVGNumberList: C,
  22612. SVGPathElement: C,
  22613. SVGPatternElement: C,
  22614. SVGPoint: C,
  22615. SVGPointList: C,
  22616. SVGPolygonElement: C,
  22617. SVGPolylineElement: C,
  22618. SVGPreserveAspectRatio: C,
  22619. SVGRadialGradientElement: C,
  22620. SVGRect: C,
  22621. SVGRectElement: C,
  22622. SVGScriptElement: C,
  22623. SVGSetElement: C,
  22624. SVGStopElement: C,
  22625. SVGStringList: C,
  22626. SVGStyleElement: C,
  22627. SVGSVGElement: C,
  22628. SVGSwitchElement: C,
  22629. SVGSymbolElement: C,
  22630. SVGTextContentElement: C,
  22631. SVGTextElement: C,
  22632. SVGTextPathElement: C,
  22633. SVGTextPositioningElement: C,
  22634. SVGTitleElement: C,
  22635. SVGTransform: C,
  22636. SVGTransformList: C,
  22637. SVGTSpanElement: C,
  22638. SVGUnitTypes: C,
  22639. SVGUseElement: C,
  22640. SVGViewElement: C,
  22641. TaskAttributionTiming: C,
  22642. Text: C,
  22643. TextEvent: C,
  22644. TextMetrics: C,
  22645. TextTrack: C,
  22646. TextTrackCue: C,
  22647. TextTrackCueList: C,
  22648. TextTrackList: C,
  22649. TimeRanges: C,
  22650. toolbar: O,
  22651. top: O,
  22652. Touch: C,
  22653. TouchEvent: C,
  22654. TouchList: C,
  22655. TrackEvent: C,
  22656. TransitionEvent: C,
  22657. TreeWalker: C,
  22658. UIEvent: C,
  22659. ValidityState: C,
  22660. visualViewport: O,
  22661. VisualViewport: C,
  22662. VTTCue: C,
  22663. WaveShaperNode: C,
  22664. WebAssembly: O,
  22665. WebGL2RenderingContext: C,
  22666. WebGLActiveInfo: C,
  22667. WebGLBuffer: C,
  22668. WebGLContextEvent: C,
  22669. WebGLFramebuffer: C,
  22670. WebGLProgram: C,
  22671. WebGLQuery: C,
  22672. WebGLRenderbuffer: C,
  22673. WebGLRenderingContext: C,
  22674. WebGLSampler: C,
  22675. WebGLShader: C,
  22676. WebGLShaderPrecisionFormat: C,
  22677. WebGLSync: C,
  22678. WebGLTexture: C,
  22679. WebGLTransformFeedback: C,
  22680. WebGLUniformLocation: C,
  22681. WebGLVertexArrayObject: C,
  22682. WebSocket: C,
  22683. WheelEvent: C,
  22684. Window: C,
  22685. Worker: C,
  22686. WritableStream: C,
  22687. XMLDocument: C,
  22688. XMLHttpRequest: C,
  22689. XMLHttpRequestEventTarget: C,
  22690. XMLHttpRequestUpload: C,
  22691. XMLSerializer: C,
  22692. XPathEvaluator: C,
  22693. XPathExpression: C,
  22694. XPathResult: C,
  22695. XSLTProcessor: C
  22696. };
  22697. for (const global of ['window', 'global', 'self', 'globalThis']) {
  22698. knownGlobals[global] = knownGlobals;
  22699. }
  22700. function getGlobalAtPath(path) {
  22701. let currentGlobal = knownGlobals;
  22702. for (const pathSegment of path) {
  22703. if (typeof pathSegment !== 'string') {
  22704. return null;
  22705. }
  22706. currentGlobal = currentGlobal[pathSegment];
  22707. if (!currentGlobal) {
  22708. return null;
  22709. }
  22710. }
  22711. return currentGlobal[ValueProperties];
  22712. }
  22713. function isPureGlobal(path) {
  22714. const globalAtPath = getGlobalAtPath(path);
  22715. return globalAtPath !== null && globalAtPath.pure;
  22716. }
  22717. function isGlobalMember(path) {
  22718. if (path.length === 1) {
  22719. return path[0] === 'undefined' || getGlobalAtPath(path) !== null;
  22720. }
  22721. return getGlobalAtPath(path.slice(0, -1)) !== null;
  22722. }
  22723. class GlobalVariable extends Variable {
  22724. constructor() {
  22725. super(...arguments);
  22726. this.isReassigned = true;
  22727. }
  22728. hasEffectsWhenAccessedAtPath(path) {
  22729. return !isGlobalMember([this.name, ...path]);
  22730. }
  22731. hasEffectsWhenCalledAtPath(path) {
  22732. return !isPureGlobal([this.name, ...path]);
  22733. }
  22734. }
  22735. class Identifier extends NodeBase {
  22736. constructor() {
  22737. super(...arguments);
  22738. this.variable = null;
  22739. this.bound = false;
  22740. }
  22741. addExportedVariables(variables, exportNamesByVariable) {
  22742. if (this.variable !== null && exportNamesByVariable.has(this.variable)) {
  22743. variables.push(this.variable);
  22744. }
  22745. }
  22746. bind() {
  22747. if (this.bound)
  22748. return;
  22749. this.bound = true;
  22750. if (this.variable === null && is_reference(this, this.parent)) {
  22751. this.variable = this.scope.findVariable(this.name);
  22752. this.variable.addReference(this);
  22753. }
  22754. if (this.variable !== null &&
  22755. this.variable instanceof LocalVariable &&
  22756. this.variable.additionalInitializers !== null) {
  22757. this.variable.consolidateInitializers();
  22758. }
  22759. }
  22760. declare(kind, init) {
  22761. let variable;
  22762. switch (kind) {
  22763. case 'var':
  22764. variable = this.scope.addDeclaration(this, this.context, init, true);
  22765. break;
  22766. case 'function':
  22767. // in strict mode, functions are only hoisted within a scope but not across block scopes
  22768. variable = this.scope.addDeclaration(this, this.context, init, false);
  22769. break;
  22770. case 'let':
  22771. case 'const':
  22772. case 'class':
  22773. variable = this.scope.addDeclaration(this, this.context, init, false);
  22774. break;
  22775. case 'parameter':
  22776. variable = this.scope.addParameterDeclaration(this);
  22777. break;
  22778. /* istanbul ignore next */
  22779. default:
  22780. /* istanbul ignore next */
  22781. throw new Error(`Internal Error: Unexpected identifier kind ${kind}.`);
  22782. }
  22783. return [(this.variable = variable)];
  22784. }
  22785. deoptimizePath(path) {
  22786. if (!this.bound)
  22787. this.bind();
  22788. if (path.length === 0 && !this.scope.contains(this.name)) {
  22789. this.disallowImportReassignment();
  22790. }
  22791. this.variable.deoptimizePath(path);
  22792. }
  22793. getLiteralValueAtPath(path, recursionTracker, origin) {
  22794. if (!this.bound)
  22795. this.bind();
  22796. return this.variable.getLiteralValueAtPath(path, recursionTracker, origin);
  22797. }
  22798. getReturnExpressionWhenCalledAtPath(path, recursionTracker, origin) {
  22799. if (!this.bound)
  22800. this.bind();
  22801. return this.variable.getReturnExpressionWhenCalledAtPath(path, recursionTracker, origin);
  22802. }
  22803. hasEffects() {
  22804. return (this.context.options.treeshake.unknownGlobalSideEffects &&
  22805. this.variable instanceof GlobalVariable &&
  22806. this.variable.hasEffectsWhenAccessedAtPath(EMPTY_PATH));
  22807. }
  22808. hasEffectsWhenAccessedAtPath(path, context) {
  22809. return this.variable !== null && this.variable.hasEffectsWhenAccessedAtPath(path, context);
  22810. }
  22811. hasEffectsWhenAssignedAtPath(path, context) {
  22812. return !this.variable || this.variable.hasEffectsWhenAssignedAtPath(path, context);
  22813. }
  22814. hasEffectsWhenCalledAtPath(path, callOptions, context) {
  22815. return !this.variable || this.variable.hasEffectsWhenCalledAtPath(path, callOptions, context);
  22816. }
  22817. include() {
  22818. if (!this.included) {
  22819. this.included = true;
  22820. if (this.variable !== null) {
  22821. this.context.includeVariableInModule(this.variable);
  22822. }
  22823. }
  22824. }
  22825. includeCallArguments(context, args) {
  22826. this.variable.includeCallArguments(context, args);
  22827. }
  22828. render(code, _options, { renderedParentType, isCalleeOfRenderedParent, isShorthandProperty } = BLANK) {
  22829. if (this.variable) {
  22830. const name = this.variable.getName();
  22831. if (name !== this.name) {
  22832. code.overwrite(this.start, this.end, name, {
  22833. contentOnly: true,
  22834. storeName: true
  22835. });
  22836. if (isShorthandProperty) {
  22837. code.prependRight(this.start, `${this.name}: `);
  22838. }
  22839. }
  22840. // In strict mode, any variable named "eval" must be the actual "eval" function
  22841. if (name === 'eval' &&
  22842. renderedParentType === CallExpression$1 &&
  22843. isCalleeOfRenderedParent) {
  22844. code.appendRight(this.start, '0, ');
  22845. }
  22846. }
  22847. }
  22848. disallowImportReassignment() {
  22849. return this.context.error({
  22850. code: 'ILLEGAL_REASSIGNMENT',
  22851. message: `Illegal reassignment to import '${this.name}'`
  22852. }, this.start);
  22853. }
  22854. }
  22855. class RestElement extends NodeBase {
  22856. constructor() {
  22857. super(...arguments);
  22858. this.declarationInit = null;
  22859. }
  22860. addExportedVariables(variables, exportNamesByVariable) {
  22861. this.argument.addExportedVariables(variables, exportNamesByVariable);
  22862. }
  22863. bind() {
  22864. super.bind();
  22865. if (this.declarationInit !== null) {
  22866. this.declarationInit.deoptimizePath([UnknownKey, UnknownKey]);
  22867. }
  22868. }
  22869. declare(kind, init) {
  22870. this.declarationInit = init;
  22871. return this.argument.declare(kind, UNKNOWN_EXPRESSION);
  22872. }
  22873. deoptimizePath(path) {
  22874. path.length === 0 && this.argument.deoptimizePath(EMPTY_PATH);
  22875. }
  22876. hasEffectsWhenAssignedAtPath(path, context) {
  22877. return path.length > 0 || this.argument.hasEffectsWhenAssignedAtPath(EMPTY_PATH, context);
  22878. }
  22879. }
  22880. class FunctionNode extends NodeBase {
  22881. constructor() {
  22882. super(...arguments);
  22883. this.isPrototypeDeoptimized = false;
  22884. }
  22885. createScope(parentScope) {
  22886. this.scope = new FunctionScope(parentScope, this.context);
  22887. }
  22888. deoptimizePath(path) {
  22889. if (path.length === 1) {
  22890. if (path[0] === 'prototype') {
  22891. this.isPrototypeDeoptimized = true;
  22892. }
  22893. else if (path[0] === UnknownKey) {
  22894. this.isPrototypeDeoptimized = true;
  22895. // A reassignment of UNKNOWN_PATH is considered equivalent to having lost track
  22896. // which means the return expression needs to be reassigned as well
  22897. this.scope.getReturnExpression().deoptimizePath(UNKNOWN_PATH);
  22898. }
  22899. }
  22900. }
  22901. getReturnExpressionWhenCalledAtPath(path) {
  22902. return path.length === 0 ? this.scope.getReturnExpression() : UNKNOWN_EXPRESSION;
  22903. }
  22904. hasEffects() {
  22905. return this.id !== null && this.id.hasEffects();
  22906. }
  22907. hasEffectsWhenAccessedAtPath(path) {
  22908. if (path.length <= 1)
  22909. return false;
  22910. return path.length > 2 || path[0] !== 'prototype' || this.isPrototypeDeoptimized;
  22911. }
  22912. hasEffectsWhenAssignedAtPath(path) {
  22913. if (path.length <= 1) {
  22914. return false;
  22915. }
  22916. return path.length > 2 || path[0] !== 'prototype' || this.isPrototypeDeoptimized;
  22917. }
  22918. hasEffectsWhenCalledAtPath(path, callOptions, context) {
  22919. if (path.length > 0)
  22920. return true;
  22921. for (const param of this.params) {
  22922. if (param.hasEffects(context))
  22923. return true;
  22924. }
  22925. const thisInit = context.replacedVariableInits.get(this.scope.thisVariable);
  22926. context.replacedVariableInits.set(this.scope.thisVariable, callOptions.withNew ? new UnknownObjectExpression() : UNKNOWN_EXPRESSION);
  22927. const { brokenFlow, ignore } = context;
  22928. context.ignore = {
  22929. breaks: false,
  22930. continues: false,
  22931. labels: new Set(),
  22932. returnAwaitYield: true
  22933. };
  22934. if (this.body.hasEffects(context))
  22935. return true;
  22936. context.brokenFlow = brokenFlow;
  22937. if (thisInit) {
  22938. context.replacedVariableInits.set(this.scope.thisVariable, thisInit);
  22939. }
  22940. else {
  22941. context.replacedVariableInits.delete(this.scope.thisVariable);
  22942. }
  22943. context.ignore = ignore;
  22944. return false;
  22945. }
  22946. include(context, includeChildrenRecursively) {
  22947. this.included = true;
  22948. if (this.id)
  22949. this.id.include();
  22950. const hasArguments = this.scope.argumentsVariable.included;
  22951. for (const param of this.params) {
  22952. if (!(param instanceof Identifier) || hasArguments) {
  22953. param.include(context, includeChildrenRecursively);
  22954. }
  22955. }
  22956. const { brokenFlow } = context;
  22957. context.brokenFlow = BROKEN_FLOW_NONE;
  22958. this.body.include(context, includeChildrenRecursively);
  22959. context.brokenFlow = brokenFlow;
  22960. }
  22961. includeCallArguments(context, args) {
  22962. this.scope.includeCallArguments(context, args);
  22963. }
  22964. initialise() {
  22965. if (this.id !== null) {
  22966. this.id.declare('function', this);
  22967. }
  22968. this.scope.addParameterVariables(this.params.map(param => param.declare('parameter', UNKNOWN_EXPRESSION)), this.params[this.params.length - 1] instanceof RestElement);
  22969. this.body.addImplicitReturnExpressionToScope();
  22970. }
  22971. parseNode(esTreeNode) {
  22972. this.body = new this.context.nodeConstructors.BlockStatement(esTreeNode.body, this, this.scope.hoistedBodyVarScope);
  22973. super.parseNode(esTreeNode);
  22974. }
  22975. }
  22976. FunctionNode.prototype.preventChildBlockScope = true;
  22977. class FunctionDeclaration extends FunctionNode {
  22978. initialise() {
  22979. super.initialise();
  22980. if (this.id !== null) {
  22981. this.id.variable.isId = true;
  22982. }
  22983. }
  22984. parseNode(esTreeNode) {
  22985. if (esTreeNode.id !== null) {
  22986. this.id = new this.context.nodeConstructors.Identifier(esTreeNode.id, this, this.scope
  22987. .parent);
  22988. }
  22989. super.parseNode(esTreeNode);
  22990. }
  22991. }
  22992. // The header ends at the first non-white-space after "default"
  22993. function getDeclarationStart(code, start) {
  22994. return findNonWhiteSpace(code, findFirstOccurrenceOutsideComment(code, 'default', start) + 7);
  22995. }
  22996. function getIdInsertPosition(code, declarationKeyword, endMarker, start) {
  22997. const declarationEnd = findFirstOccurrenceOutsideComment(code, declarationKeyword, start) + declarationKeyword.length;
  22998. code = code.slice(declarationEnd, findFirstOccurrenceOutsideComment(code, endMarker, declarationEnd));
  22999. const generatorStarPos = findFirstOccurrenceOutsideComment(code, '*');
  23000. if (generatorStarPos === -1) {
  23001. return declarationEnd;
  23002. }
  23003. return declarationEnd + generatorStarPos + 1;
  23004. }
  23005. class ExportDefaultDeclaration extends NodeBase {
  23006. include(context, includeChildrenRecursively) {
  23007. super.include(context, includeChildrenRecursively);
  23008. if (includeChildrenRecursively) {
  23009. this.context.includeVariableInModule(this.variable);
  23010. }
  23011. }
  23012. initialise() {
  23013. const declaration = this.declaration;
  23014. this.declarationName =
  23015. (declaration.id && declaration.id.name) || this.declaration.name;
  23016. this.variable = this.scope.addExportDefaultDeclaration(this.declarationName || this.context.getModuleName(), this, this.context);
  23017. this.context.addExport(this);
  23018. }
  23019. render(code, options, nodeRenderOptions) {
  23020. const { start, end } = nodeRenderOptions;
  23021. const declarationStart = getDeclarationStart(code.original, this.start);
  23022. if (this.declaration instanceof FunctionDeclaration) {
  23023. this.renderNamedDeclaration(code, declarationStart, 'function', '(', this.declaration.id === null, options);
  23024. }
  23025. else if (this.declaration instanceof ClassDeclaration) {
  23026. this.renderNamedDeclaration(code, declarationStart, 'class', '{', this.declaration.id === null, options);
  23027. }
  23028. else if (this.variable.getOriginalVariable() !== this.variable) {
  23029. // Remove altogether to prevent re-declaring the same variable
  23030. treeshakeNode(this, code, start, end);
  23031. return;
  23032. }
  23033. else if (this.variable.included) {
  23034. this.renderVariableDeclaration(code, declarationStart, options);
  23035. }
  23036. else {
  23037. code.remove(this.start, declarationStart);
  23038. this.declaration.render(code, options, {
  23039. isCalleeOfRenderedParent: false,
  23040. renderedParentType: ExpressionStatement$1
  23041. });
  23042. if (code.original[this.end - 1] !== ';') {
  23043. code.appendLeft(this.end, ';');
  23044. }
  23045. return;
  23046. }
  23047. this.declaration.render(code, options);
  23048. }
  23049. renderNamedDeclaration(code, declarationStart, declarationKeyword, endMarker, needsId, options) {
  23050. const name = this.variable.getName();
  23051. // Remove `export default`
  23052. code.remove(this.start, declarationStart);
  23053. if (needsId) {
  23054. code.appendLeft(getIdInsertPosition(code.original, declarationKeyword, endMarker, declarationStart), ` ${name}`);
  23055. }
  23056. if (options.format === 'system' &&
  23057. this.declaration instanceof ClassDeclaration &&
  23058. options.exportNamesByVariable.has(this.variable)) {
  23059. code.appendLeft(this.end, ` ${getSystemExportStatement([this.variable], options)};`);
  23060. }
  23061. }
  23062. renderVariableDeclaration(code, declarationStart, options) {
  23063. const hasTrailingSemicolon = code.original.charCodeAt(this.end - 1) === 59; /*";"*/
  23064. const systemExportNames = options.format === 'system' && options.exportNamesByVariable.get(this.variable);
  23065. if (systemExportNames) {
  23066. code.overwrite(this.start, declarationStart, `${options.varOrConst} ${this.variable.getName()} = exports('${systemExportNames[0]}', `);
  23067. code.appendRight(hasTrailingSemicolon ? this.end - 1 : this.end, ')' + (hasTrailingSemicolon ? '' : ';'));
  23068. }
  23069. else {
  23070. code.overwrite(this.start, declarationStart, `${options.varOrConst} ${this.variable.getName()} = `);
  23071. if (!hasTrailingSemicolon) {
  23072. code.appendLeft(this.end, ';');
  23073. }
  23074. }
  23075. }
  23076. }
  23077. ExportDefaultDeclaration.prototype.needsBoundaries = true;
  23078. class UndefinedVariable extends Variable {
  23079. constructor() {
  23080. super('undefined');
  23081. }
  23082. getLiteralValueAtPath() {
  23083. return undefined;
  23084. }
  23085. }
  23086. class ExportDefaultVariable extends LocalVariable {
  23087. constructor(name, exportDefaultDeclaration, context) {
  23088. super(name, exportDefaultDeclaration, exportDefaultDeclaration.declaration, context);
  23089. this.hasId = false;
  23090. this.originalId = null;
  23091. this.originalVariable = null;
  23092. const declaration = exportDefaultDeclaration.declaration;
  23093. if ((declaration instanceof FunctionDeclaration || declaration instanceof ClassDeclaration) &&
  23094. declaration.id) {
  23095. this.hasId = true;
  23096. this.originalId = declaration.id;
  23097. }
  23098. else if (declaration instanceof Identifier) {
  23099. this.originalId = declaration;
  23100. }
  23101. }
  23102. addReference(identifier) {
  23103. if (!this.hasId) {
  23104. this.name = identifier.name;
  23105. }
  23106. }
  23107. getAssignedVariableName() {
  23108. return (this.originalId && this.originalId.name) || null;
  23109. }
  23110. getBaseVariableName() {
  23111. const original = this.getOriginalVariable();
  23112. if (original === this) {
  23113. return super.getBaseVariableName();
  23114. }
  23115. else {
  23116. return original.getBaseVariableName();
  23117. }
  23118. }
  23119. getDirectOriginalVariable() {
  23120. return this.originalId &&
  23121. (this.hasId ||
  23122. !(this.originalId.variable.isReassigned ||
  23123. this.originalId.variable instanceof UndefinedVariable ||
  23124. // this avoids a circular dependency
  23125. 'syntheticNamespace' in this.originalId.variable))
  23126. ? this.originalId.variable
  23127. : null;
  23128. }
  23129. getName() {
  23130. const original = this.getOriginalVariable();
  23131. if (original === this) {
  23132. return super.getName();
  23133. }
  23134. else {
  23135. return original.getName();
  23136. }
  23137. }
  23138. getOriginalVariable() {
  23139. if (this.originalVariable)
  23140. return this.originalVariable;
  23141. let original = this;
  23142. let currentVariable;
  23143. const checkedVariables = new Set();
  23144. do {
  23145. checkedVariables.add(original);
  23146. currentVariable = original;
  23147. original = currentVariable.getDirectOriginalVariable();
  23148. } while (original instanceof ExportDefaultVariable && !checkedVariables.has(original));
  23149. return (this.originalVariable = original || currentVariable);
  23150. }
  23151. }
  23152. const MISSING_EXPORT_SHIM_VARIABLE = '_missingExportShim';
  23153. class ExportShimVariable extends Variable {
  23154. constructor(module) {
  23155. super(MISSING_EXPORT_SHIM_VARIABLE);
  23156. this.module = module;
  23157. }
  23158. }
  23159. class NamespaceVariable extends Variable {
  23160. constructor(context, syntheticNamedExports) {
  23161. super(context.getModuleName());
  23162. this.memberVariables = null;
  23163. this.mergedNamespaces = [];
  23164. this.referencedEarly = false;
  23165. this.references = [];
  23166. this.context = context;
  23167. this.module = context.module;
  23168. this.syntheticNamedExports = syntheticNamedExports;
  23169. }
  23170. addReference(identifier) {
  23171. this.references.push(identifier);
  23172. this.name = identifier.name;
  23173. }
  23174. // This is only called if "UNKNOWN_PATH" is reassigned as in all other situations, either the
  23175. // build fails due to an illegal namespace reassignment or MemberExpression already forwards
  23176. // the reassignment to the right variable. This means we lost track of this variable and thus
  23177. // need to reassign all exports.
  23178. deoptimizePath() {
  23179. const memberVariables = this.getMemberVariables();
  23180. for (const key of Object.keys(memberVariables)) {
  23181. memberVariables[key].deoptimizePath(UNKNOWN_PATH);
  23182. }
  23183. }
  23184. getMemberVariables() {
  23185. if (this.memberVariables) {
  23186. return this.memberVariables;
  23187. }
  23188. const memberVariables = Object.create(null);
  23189. for (const name of this.context.getExports().concat(this.context.getReexports())) {
  23190. if (name[0] !== '*' && name !== this.module.info.syntheticNamedExports) {
  23191. memberVariables[name] = this.context.traceExport(name);
  23192. }
  23193. }
  23194. return (this.memberVariables = memberVariables);
  23195. }
  23196. include() {
  23197. this.included = true;
  23198. this.context.includeAllExports();
  23199. }
  23200. prepareNamespace(mergedNamespaces) {
  23201. this.mergedNamespaces = mergedNamespaces;
  23202. const moduleExecIndex = this.context.getModuleExecIndex();
  23203. for (const identifier of this.references) {
  23204. if (identifier.context.getModuleExecIndex() <= moduleExecIndex) {
  23205. this.referencedEarly = true;
  23206. break;
  23207. }
  23208. }
  23209. }
  23210. renderBlock(options) {
  23211. const _ = options.compact ? '' : ' ';
  23212. const n = options.compact ? '' : '\n';
  23213. const t = options.indent;
  23214. const memberVariables = this.getMemberVariables();
  23215. const members = Object.keys(memberVariables).map(name => {
  23216. const original = memberVariables[name];
  23217. if (this.referencedEarly || original.isReassigned) {
  23218. return `${t}get ${name}${_}()${_}{${_}return ${original.getName()}${options.compact ? '' : ';'}${_}}`;
  23219. }
  23220. const safeName = RESERVED_NAMES[name] ? `'${name}'` : name;
  23221. return `${t}${safeName}: ${original.getName()}`;
  23222. });
  23223. if (options.namespaceToStringTag) {
  23224. members.unshift(`${t}[Symbol.toStringTag]:${_}'Module'`);
  23225. }
  23226. const needsObjectAssign = this.mergedNamespaces.length > 0 || this.syntheticNamedExports;
  23227. if (!needsObjectAssign)
  23228. members.unshift(`${t}__proto__:${_}null`);
  23229. let output = `{${n}${members.join(`,${n}`)}${n}}`;
  23230. if (needsObjectAssign) {
  23231. const assignmentArgs = ['/*#__PURE__*/Object.create(null)'];
  23232. if (this.mergedNamespaces.length > 0) {
  23233. assignmentArgs.push(...this.mergedNamespaces.map(variable => variable.getName()));
  23234. }
  23235. if (this.syntheticNamedExports) {
  23236. assignmentArgs.push(this.module.getSyntheticNamespace().getName());
  23237. }
  23238. if (members.length > 0) {
  23239. assignmentArgs.push(output);
  23240. }
  23241. output = `/*#__PURE__*/Object.assign(${assignmentArgs.join(`,${_}`)})`;
  23242. }
  23243. if (options.freeze) {
  23244. output = `/*#__PURE__*/Object.freeze(${output})`;
  23245. }
  23246. const name = this.getName();
  23247. output = `${options.varOrConst} ${name}${_}=${_}${output};`;
  23248. if (options.format === 'system' && options.exportNamesByVariable.has(this)) {
  23249. output += `${n}${getSystemExportStatement([this], options)};`;
  23250. }
  23251. return output;
  23252. }
  23253. renderFirst() {
  23254. return this.referencedEarly;
  23255. }
  23256. }
  23257. NamespaceVariable.prototype.isNamespace = true;
  23258. class SyntheticNamedExportVariable extends Variable {
  23259. constructor(context, name, syntheticNamespace) {
  23260. super(name);
  23261. this.baseVariable = null;
  23262. this.context = context;
  23263. this.module = context.module;
  23264. this.syntheticNamespace = syntheticNamespace;
  23265. }
  23266. getBaseVariable() {
  23267. if (this.baseVariable)
  23268. return this.baseVariable;
  23269. let baseVariable = this.syntheticNamespace;
  23270. while (baseVariable instanceof ExportDefaultVariable ||
  23271. baseVariable instanceof SyntheticNamedExportVariable) {
  23272. if (baseVariable instanceof ExportDefaultVariable) {
  23273. const original = baseVariable.getOriginalVariable();
  23274. if (original === baseVariable)
  23275. break;
  23276. baseVariable = original;
  23277. }
  23278. if (baseVariable instanceof SyntheticNamedExportVariable) {
  23279. baseVariable = baseVariable.syntheticNamespace;
  23280. }
  23281. }
  23282. return (this.baseVariable = baseVariable);
  23283. }
  23284. getBaseVariableName() {
  23285. return this.syntheticNamespace.getBaseVariableName();
  23286. }
  23287. getName() {
  23288. const name = this.name;
  23289. return `${this.syntheticNamespace.getName()}${getPropertyAccess(name)}`;
  23290. }
  23291. include() {
  23292. if (!this.included) {
  23293. this.included = true;
  23294. this.context.includeVariableInModule(this.syntheticNamespace);
  23295. }
  23296. }
  23297. setRenderNames(baseName, name) {
  23298. super.setRenderNames(baseName, name);
  23299. }
  23300. }
  23301. const getPropertyAccess = (name) => {
  23302. return !RESERVED_NAMES[name] && /^(?!\d)[\w$]+$/.test(name)
  23303. ? `.${name}`
  23304. : `[${JSON.stringify(name)}]`;
  23305. };
  23306. class ExternalVariable extends Variable {
  23307. constructor(module, name) {
  23308. super(name);
  23309. this.module = module;
  23310. this.isNamespace = name === '*';
  23311. this.referenced = false;
  23312. }
  23313. addReference(identifier) {
  23314. this.referenced = true;
  23315. if (this.name === 'default' || this.name === '*') {
  23316. this.module.suggestName(identifier.name);
  23317. }
  23318. }
  23319. hasEffectsWhenAccessedAtPath(path) {
  23320. return path.length > (this.isNamespace ? 1 : 0);
  23321. }
  23322. include() {
  23323. if (!this.included) {
  23324. this.included = true;
  23325. this.module.used = true;
  23326. }
  23327. }
  23328. }
  23329. const reservedWords$1$1 = 'break case class catch const continue debugger default delete do else export extends finally for function if import in instanceof let new return super switch this throw try typeof var void while with yield enum await implements package protected static interface private public'.split(' ');
  23330. const builtins$1$1 = 'Infinity NaN undefined null true false eval uneval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Symbol Error EvalError InternalError RangeError ReferenceError SyntaxError TypeError URIError Number Math Date String RegExp Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array Map Set WeakMap WeakSet SIMD ArrayBuffer DataView JSON Promise Generator GeneratorFunction Reflect Proxy Intl'.split(' ');
  23331. const blacklisted = new Set(reservedWords$1$1.concat(builtins$1$1));
  23332. const illegalCharacters = /[^$_a-zA-Z0-9]/g;
  23333. const startsWithDigit = (str) => /\d/.test(str[0]);
  23334. function isLegal(str) {
  23335. if (startsWithDigit(str) || blacklisted.has(str)) {
  23336. return false;
  23337. }
  23338. return !illegalCharacters.test(str);
  23339. }
  23340. function makeLegal(str) {
  23341. str = str.replace(/-(\w)/g, (_, letter) => letter.toUpperCase()).replace(illegalCharacters, '_');
  23342. if (startsWithDigit(str) || blacklisted.has(str))
  23343. str = `_${str}`;
  23344. return str || '_';
  23345. }
  23346. const absolutePath = /^(?:\/|(?:[A-Za-z]:)?[\\|/])/;
  23347. const relativePath = /^\.?\.\//;
  23348. function isAbsolute(path) {
  23349. return absolutePath.test(path);
  23350. }
  23351. function isRelative(path) {
  23352. return relativePath.test(path);
  23353. }
  23354. function normalize(path) {
  23355. if (path.indexOf('\\') == -1)
  23356. return path;
  23357. return path.replace(/\\/g, '/');
  23358. }
  23359. class ExternalModule {
  23360. constructor(options, id, hasModuleSideEffects, meta) {
  23361. this.options = options;
  23362. this.id = id;
  23363. this.defaultVariableName = '';
  23364. this.dynamicImporters = [];
  23365. this.importers = [];
  23366. this.mostCommonSuggestion = 0;
  23367. this.namespaceVariableName = '';
  23368. this.reexported = false;
  23369. this.renderPath = undefined;
  23370. this.renormalizeRenderPath = false;
  23371. this.used = false;
  23372. this.variableName = '';
  23373. this.execIndex = Infinity;
  23374. this.suggestedVariableName = makeLegal(id.split(/[\\/]/).pop());
  23375. this.nameSuggestions = Object.create(null);
  23376. this.declarations = Object.create(null);
  23377. this.exportedVariables = new Map();
  23378. const module = this;
  23379. this.info = {
  23380. ast: null,
  23381. code: null,
  23382. dynamicallyImportedIds: EMPTY_ARRAY,
  23383. get dynamicImporters() {
  23384. return module.dynamicImporters.sort();
  23385. },
  23386. hasModuleSideEffects,
  23387. id,
  23388. implicitlyLoadedAfterOneOf: EMPTY_ARRAY,
  23389. implicitlyLoadedBefore: EMPTY_ARRAY,
  23390. importedIds: EMPTY_ARRAY,
  23391. get importers() {
  23392. return module.importers.sort();
  23393. },
  23394. isEntry: false,
  23395. isExternal: true,
  23396. meta,
  23397. syntheticNamedExports: false
  23398. };
  23399. }
  23400. getVariableForExportName(name) {
  23401. let declaration = this.declarations[name];
  23402. if (declaration)
  23403. return declaration;
  23404. this.declarations[name] = declaration = new ExternalVariable(this, name);
  23405. this.exportedVariables.set(declaration, name);
  23406. return declaration;
  23407. }
  23408. setRenderPath(options, inputBase) {
  23409. this.renderPath =
  23410. typeof options.paths === 'function' ? options.paths(this.id) : options.paths[this.id];
  23411. if (!this.renderPath) {
  23412. if (!isAbsolute(this.id)) {
  23413. this.renderPath = this.id;
  23414. }
  23415. else {
  23416. this.renderPath = normalize(relative$1(inputBase, this.id));
  23417. this.renormalizeRenderPath = true;
  23418. }
  23419. }
  23420. return this.renderPath;
  23421. }
  23422. suggestName(name) {
  23423. if (!this.nameSuggestions[name])
  23424. this.nameSuggestions[name] = 0;
  23425. this.nameSuggestions[name] += 1;
  23426. if (this.nameSuggestions[name] > this.mostCommonSuggestion) {
  23427. this.mostCommonSuggestion = this.nameSuggestions[name];
  23428. this.suggestedVariableName = name;
  23429. }
  23430. }
  23431. warnUnusedImports() {
  23432. const unused = Object.keys(this.declarations).filter(name => {
  23433. if (name === '*')
  23434. return false;
  23435. const declaration = this.declarations[name];
  23436. return !declaration.included && !this.reexported && !declaration.referenced;
  23437. });
  23438. if (unused.length === 0)
  23439. return;
  23440. const names = unused.length === 1
  23441. ? `'${unused[0]}' is`
  23442. : `${unused
  23443. .slice(0, -1)
  23444. .map(name => `'${name}'`)
  23445. .join(', ')} and '${unused.slice(-1)}' are`;
  23446. this.options.onwarn({
  23447. code: 'UNUSED_EXTERNAL_IMPORT',
  23448. message: `${names} imported from external module '${this.id}' but never used`,
  23449. names: unused,
  23450. source: this.id
  23451. });
  23452. }
  23453. }
  23454. function removeJsExtension(name) {
  23455. return name.endsWith('.js') ? name.slice(0, -3) : name;
  23456. }
  23457. function getCompleteAmdId(options, chunkId) {
  23458. if (!options.autoId) {
  23459. return options.id || '';
  23460. }
  23461. else {
  23462. return `${options.basePath ? options.basePath + '/' : ''}${removeJsExtension(chunkId)}`;
  23463. }
  23464. }
  23465. const INTEROP_DEFAULT_VARIABLE = '_interopDefault';
  23466. const INTEROP_DEFAULT_LEGACY_VARIABLE = '_interopDefaultLegacy';
  23467. const INTEROP_NAMESPACE_VARIABLE = '_interopNamespace';
  23468. const INTEROP_NAMESPACE_DEFAULT_VARIABLE = '_interopNamespaceDefault';
  23469. const INTEROP_NAMESPACE_DEFAULT_ONLY_VARIABLE = '_interopNamespaceDefaultOnly';
  23470. const defaultInteropHelpersByInteropType = {
  23471. auto: INTEROP_DEFAULT_VARIABLE,
  23472. default: null,
  23473. defaultOnly: null,
  23474. esModule: null,
  23475. false: null,
  23476. true: INTEROP_DEFAULT_LEGACY_VARIABLE
  23477. };
  23478. function isDefaultAProperty(interopType, externalLiveBindings) {
  23479. return (interopType === 'esModule' ||
  23480. (externalLiveBindings && (interopType === 'auto' || interopType === 'true')));
  23481. }
  23482. const namespaceInteropHelpersByInteropType = {
  23483. auto: INTEROP_NAMESPACE_VARIABLE,
  23484. default: INTEROP_NAMESPACE_DEFAULT_VARIABLE,
  23485. defaultOnly: INTEROP_NAMESPACE_DEFAULT_ONLY_VARIABLE,
  23486. esModule: null,
  23487. false: null,
  23488. true: INTEROP_NAMESPACE_VARIABLE
  23489. };
  23490. function canDefaultBeTakenFromNamespace(interopType, externalLiveBindings) {
  23491. return (isDefaultAProperty(interopType, externalLiveBindings) &&
  23492. defaultInteropHelpersByInteropType[interopType] === INTEROP_DEFAULT_VARIABLE);
  23493. }
  23494. function getDefaultOnlyHelper() {
  23495. return INTEROP_NAMESPACE_DEFAULT_ONLY_VARIABLE;
  23496. }
  23497. function getHelpersBlock(usedHelpers, accessedGlobals, _, n, s, t, liveBindings, freeze, namespaceToStringTag) {
  23498. return HELPER_NAMES.map(variable => usedHelpers.has(variable) || accessedGlobals.has(variable)
  23499. ? HELPER_GENERATORS[variable](_, n, s, t, liveBindings, freeze, namespaceToStringTag, usedHelpers)
  23500. : '').join('');
  23501. }
  23502. const HELPER_GENERATORS = {
  23503. [INTEROP_DEFAULT_VARIABLE]: (_, n, s, _t, liveBindings) => `function ${INTEROP_DEFAULT_VARIABLE}${_}(e)${_}{${_}return ` +
  23504. `e${_}&&${_}e.__esModule${_}?${_}` +
  23505. `${liveBindings ? getDefaultLiveBinding(_) : getDefaultStatic(_)}${s}${_}}${n}${n}`,
  23506. [INTEROP_DEFAULT_LEGACY_VARIABLE]: (_, n, s, _t, liveBindings) => `function ${INTEROP_DEFAULT_LEGACY_VARIABLE}${_}(e)${_}{${_}return ` +
  23507. `e${_}&&${_}typeof e${_}===${_}'object'${_}&&${_}'default'${_}in e${_}?${_}` +
  23508. `${liveBindings ? getDefaultLiveBinding(_) : getDefaultStatic(_)}${s}${_}}${n}${n}`,
  23509. [INTEROP_NAMESPACE_VARIABLE]: (_, n, s, t, liveBindings, freeze, namespaceToStringTag, usedHelpers) => `function ${INTEROP_NAMESPACE_VARIABLE}(e)${_}{${n}` +
  23510. (usedHelpers.has(INTEROP_NAMESPACE_DEFAULT_VARIABLE)
  23511. ? `${t}return e${_}&&${_}e.__esModule${_}?${_}e${_}:${_}${INTEROP_NAMESPACE_DEFAULT_VARIABLE}(e)${s}${n}`
  23512. : `${t}if${_}(e${_}&&${_}e.__esModule)${_}return e;${n}` +
  23513. createNamespaceObject(_, n, t, t, liveBindings, freeze, namespaceToStringTag)) +
  23514. `}${n}${n}`,
  23515. [INTEROP_NAMESPACE_DEFAULT_VARIABLE]: (_, n, _s, t, liveBindings, freeze, namespaceToStringTag) => `function ${INTEROP_NAMESPACE_DEFAULT_VARIABLE}(e)${_}{${n}` +
  23516. createNamespaceObject(_, n, t, t, liveBindings, freeze, namespaceToStringTag) +
  23517. `}${n}${n}`,
  23518. [INTEROP_NAMESPACE_DEFAULT_ONLY_VARIABLE]: (_, n, _s, t, _liveBindings, freeze, namespaceToStringTag) => `function ${INTEROP_NAMESPACE_DEFAULT_ONLY_VARIABLE}(e)${_}{${n}` +
  23519. `${t}return ${getFrozen(`{__proto__: null,${namespaceToStringTag ? `${_}[Symbol.toStringTag]:${_}'Module',` : ''}${_}'default':${_}e}`, freeze)};${n}` +
  23520. `}${n}${n}`
  23521. };
  23522. function getDefaultLiveBinding(_) {
  23523. return `e${_}:${_}{${_}'default':${_}e${_}}`;
  23524. }
  23525. function getDefaultStatic(_) {
  23526. return `e['default']${_}:${_}e`;
  23527. }
  23528. function createNamespaceObject(_, n, t, i, liveBindings, freeze, namespaceToStringTag) {
  23529. return (`${i}var n${_}=${_}${namespaceToStringTag
  23530. ? `{__proto__:${_}null,${_}[Symbol.toStringTag]:${_}'Module'}`
  23531. : 'Object.create(null)'};${n}` +
  23532. `${i}if${_}(e)${_}{${n}` +
  23533. `${i}${t}Object.keys(e).forEach(function${_}(k)${_}{${n}` +
  23534. (liveBindings ? copyPropertyLiveBinding : copyPropertyStatic)(_, n, t, i + t + t) +
  23535. `${i}${t}});${n}` +
  23536. `${i}}${n}` +
  23537. `${i}n['default']${_}=${_}e;${n}` +
  23538. `${i}return ${getFrozen('n', freeze)};${n}`);
  23539. }
  23540. function copyPropertyLiveBinding(_, n, t, i) {
  23541. return (`${i}if${_}(k${_}!==${_}'default')${_}{${n}` +
  23542. `${i}${t}var d${_}=${_}Object.getOwnPropertyDescriptor(e,${_}k);${n}` +
  23543. `${i}${t}Object.defineProperty(n,${_}k,${_}d.get${_}?${_}d${_}:${_}{${n}` +
  23544. `${i}${t}${t}enumerable:${_}true,${n}` +
  23545. `${i}${t}${t}get:${_}function${_}()${_}{${n}` +
  23546. `${i}${t}${t}${t}return e[k];${n}` +
  23547. `${i}${t}${t}}${n}` +
  23548. `${i}${t}});${n}` +
  23549. `${i}}${n}`);
  23550. }
  23551. function copyPropertyStatic(_, n, _t, i) {
  23552. return `${i}n[k]${_}=${_}e[k];${n}`;
  23553. }
  23554. function getFrozen(fragment, freeze) {
  23555. return freeze ? `Object.freeze(${fragment})` : fragment;
  23556. }
  23557. const HELPER_NAMES = Object.keys(HELPER_GENERATORS);
  23558. function getExportBlock$1(exports, dependencies, namedExportsMode, interop, compact, t, externalLiveBindings, mechanism = 'return ') {
  23559. const _ = compact ? '' : ' ';
  23560. const n = compact ? '' : '\n';
  23561. if (!namedExportsMode) {
  23562. return `${n}${n}${mechanism}${getSingleDefaultExport(exports, dependencies, interop, externalLiveBindings)};`;
  23563. }
  23564. let exportBlock = '';
  23565. for (const { defaultVariableName, id, isChunk, name, namedExportsMode: depNamedExportsMode, namespaceVariableName, reexports } of dependencies) {
  23566. if (reexports && namedExportsMode) {
  23567. for (const specifier of reexports) {
  23568. if (specifier.reexported !== '*') {
  23569. const importName = getReexportedImportName(name, specifier.imported, depNamedExportsMode, isChunk, defaultVariableName, namespaceVariableName, interop, id, externalLiveBindings);
  23570. if (exportBlock)
  23571. exportBlock += n;
  23572. exportBlock +=
  23573. specifier.imported !== '*' && specifier.needsLiveBinding
  23574. ? `Object.defineProperty(exports,${_}'${specifier.reexported}',${_}{${n}` +
  23575. `${t}enumerable:${_}true,${n}` +
  23576. `${t}get:${_}function${_}()${_}{${n}` +
  23577. `${t}${t}return ${importName};${n}${t}}${n}});`
  23578. : `exports.${specifier.reexported}${_}=${_}${importName};`;
  23579. }
  23580. }
  23581. }
  23582. }
  23583. for (const chunkExport of exports) {
  23584. const lhs = `exports.${chunkExport.exported}`;
  23585. const rhs = chunkExport.local;
  23586. if (lhs !== rhs) {
  23587. if (exportBlock)
  23588. exportBlock += n;
  23589. exportBlock += `${lhs}${_}=${_}${rhs};`;
  23590. }
  23591. }
  23592. for (const { name, reexports } of dependencies) {
  23593. if (reexports && namedExportsMode) {
  23594. for (const specifier of reexports) {
  23595. if (specifier.reexported === '*') {
  23596. if (exportBlock)
  23597. exportBlock += n;
  23598. if (specifier.needsLiveBinding) {
  23599. exportBlock +=
  23600. `Object.keys(${name}).forEach(function${_}(k)${_}{${n}` +
  23601. `${t}if${_}(k${_}!==${_}'default'${_}&&${_}!exports.hasOwnProperty(k))${_}Object.defineProperty(exports,${_}k,${_}{${n}` +
  23602. `${t}${t}enumerable:${_}true,${n}` +
  23603. `${t}${t}get:${_}function${_}()${_}{${n}` +
  23604. `${t}${t}${t}return ${name}[k];${n}` +
  23605. `${t}${t}}${n}${t}});${n}});`;
  23606. }
  23607. else {
  23608. exportBlock +=
  23609. `Object.keys(${name}).forEach(function${_}(k)${_}{${n}` +
  23610. `${t}if${_}(k${_}!==${_}'default'${_}&&${_}!exports.hasOwnProperty(k))${_}exports[k]${_}=${_}${name}[k];${n}});`;
  23611. }
  23612. }
  23613. }
  23614. }
  23615. }
  23616. if (exportBlock) {
  23617. return `${n}${n}${exportBlock}`;
  23618. }
  23619. return '';
  23620. }
  23621. function getSingleDefaultExport(exports, dependencies, interop, externalLiveBindings) {
  23622. if (exports.length > 0) {
  23623. return exports[0].local;
  23624. }
  23625. else {
  23626. for (const { defaultVariableName, id, isChunk, name, namedExportsMode: depNamedExportsMode, namespaceVariableName, reexports } of dependencies) {
  23627. if (reexports) {
  23628. return getReexportedImportName(name, reexports[0].imported, depNamedExportsMode, isChunk, defaultVariableName, namespaceVariableName, interop, id, externalLiveBindings);
  23629. }
  23630. }
  23631. }
  23632. }
  23633. function getReexportedImportName(moduleVariableName, imported, depNamedExportsMode, isChunk, defaultVariableName, namespaceVariableName, interop, moduleId, externalLiveBindings) {
  23634. if (imported === 'default') {
  23635. if (!isChunk) {
  23636. const moduleInterop = String(interop(moduleId));
  23637. const variableName = defaultInteropHelpersByInteropType[moduleInterop]
  23638. ? defaultVariableName
  23639. : moduleVariableName;
  23640. return isDefaultAProperty(moduleInterop, externalLiveBindings)
  23641. ? `${variableName}['default']`
  23642. : variableName;
  23643. }
  23644. return depNamedExportsMode ? `${moduleVariableName}['default']` : moduleVariableName;
  23645. }
  23646. if (imported === '*') {
  23647. return (isChunk
  23648. ? !depNamedExportsMode
  23649. : namespaceInteropHelpersByInteropType[String(interop(moduleId))])
  23650. ? namespaceVariableName
  23651. : moduleVariableName;
  23652. }
  23653. return `${moduleVariableName}.${imported}`;
  23654. }
  23655. function getEsModuleExport(_) {
  23656. return `Object.defineProperty(exports,${_}'__esModule',${_}{${_}value:${_}true${_}});`;
  23657. }
  23658. function getNamespaceToStringExport(_) {
  23659. return `exports[Symbol.toStringTag]${_}=${_}'Module';`;
  23660. }
  23661. function getNamespaceMarkers(hasNamedExports, addEsModule, addNamespaceToStringTag, _, n) {
  23662. let namespaceMarkers = '';
  23663. if (hasNamedExports) {
  23664. if (addEsModule) {
  23665. namespaceMarkers += getEsModuleExport(_);
  23666. }
  23667. if (addNamespaceToStringTag) {
  23668. if (namespaceMarkers) {
  23669. namespaceMarkers += n;
  23670. }
  23671. namespaceMarkers += getNamespaceToStringExport(_);
  23672. }
  23673. }
  23674. return namespaceMarkers;
  23675. }
  23676. function getInteropBlock(dependencies, varOrConst, interop, externalLiveBindings, freeze, namespaceToStringTag, accessedGlobals, _, n, s, t) {
  23677. const neededInteropHelpers = new Set();
  23678. const interopStatements = [];
  23679. const addInteropStatement = (helperVariableName, helper, dependencyVariableName) => {
  23680. neededInteropHelpers.add(helper);
  23681. interopStatements.push(`${varOrConst} ${helperVariableName}${_}=${_}/*#__PURE__*/${helper}(${dependencyVariableName});`);
  23682. };
  23683. for (const { defaultVariableName, imports, id, isChunk, name, namedExportsMode, namespaceVariableName, reexports } of dependencies) {
  23684. if (isChunk) {
  23685. for (const { imported, reexported } of [
  23686. ...(imports || []),
  23687. ...(reexports || [])
  23688. ]) {
  23689. if (imported === '*' && reexported !== '*') {
  23690. if (!namedExportsMode) {
  23691. addInteropStatement(namespaceVariableName, getDefaultOnlyHelper(), name);
  23692. }
  23693. break;
  23694. }
  23695. }
  23696. }
  23697. else {
  23698. const moduleInterop = String(interop(id));
  23699. let hasDefault = false;
  23700. let hasNamespace = false;
  23701. for (const { imported, reexported } of [
  23702. ...(imports || []),
  23703. ...(reexports || [])
  23704. ]) {
  23705. let helper;
  23706. let variableName;
  23707. if (imported === 'default') {
  23708. if (!hasDefault) {
  23709. hasDefault = true;
  23710. if (defaultVariableName !== namespaceVariableName) {
  23711. variableName = defaultVariableName;
  23712. helper = defaultInteropHelpersByInteropType[moduleInterop];
  23713. }
  23714. }
  23715. }
  23716. else if (imported === '*' && reexported !== '*') {
  23717. if (!hasNamespace) {
  23718. hasNamespace = true;
  23719. helper = namespaceInteropHelpersByInteropType[moduleInterop];
  23720. variableName = namespaceVariableName;
  23721. }
  23722. }
  23723. if (helper) {
  23724. addInteropStatement(variableName, helper, name);
  23725. }
  23726. }
  23727. }
  23728. }
  23729. return `${getHelpersBlock(neededInteropHelpers, accessedGlobals, _, n, s, t, externalLiveBindings, freeze, namespaceToStringTag)}${interopStatements.length > 0 ? `${interopStatements.join(n)}${n}${n}` : ''}`;
  23730. }
  23731. // AMD resolution will only respect the AMD baseUrl if the .js extension is omitted.
  23732. // The assumption is that this makes sense for all relative ids:
  23733. // https://requirejs.org/docs/api.html#jsfiles
  23734. function removeExtensionFromRelativeAmdId(id) {
  23735. return id[0] === '.' ? removeJsExtension(id) : id;
  23736. }
  23737. const builtins$6 = {
  23738. assert: true,
  23739. buffer: true,
  23740. console: true,
  23741. constants: true,
  23742. domain: true,
  23743. events: true,
  23744. http: true,
  23745. https: true,
  23746. os: true,
  23747. path: true,
  23748. process: true,
  23749. punycode: true,
  23750. querystring: true,
  23751. stream: true,
  23752. string_decoder: true,
  23753. timers: true,
  23754. tty: true,
  23755. url: true,
  23756. util: true,
  23757. vm: true,
  23758. zlib: true
  23759. };
  23760. function warnOnBuiltins(warn, dependencies) {
  23761. const externalBuiltins = dependencies.map(({ id }) => id).filter(id => id in builtins$6);
  23762. if (!externalBuiltins.length)
  23763. return;
  23764. const detail = externalBuiltins.length === 1
  23765. ? `module ('${externalBuiltins[0]}')`
  23766. : `modules (${externalBuiltins
  23767. .slice(0, -1)
  23768. .map(name => `'${name}'`)
  23769. .join(', ')} and '${externalBuiltins.slice(-1)}')`;
  23770. warn({
  23771. code: 'MISSING_NODE_BUILTINS',
  23772. message: `Creating a browser bundle that depends on Node.js built-in ${detail}. You might need to include https://github.com/ionic-team/rollup-plugin-node-polyfills`,
  23773. modules: externalBuiltins
  23774. });
  23775. }
  23776. function amd(magicString, { accessedGlobals, dependencies, exports, hasExports, id, indentString: t, intro, isEntryFacade, isModuleFacade, namedExportsMode, outro, varOrConst, warn }, { amd, compact, esModule, externalLiveBindings, freeze, interop, namespaceToStringTag, strict }) {
  23777. warnOnBuiltins(warn, dependencies);
  23778. const deps = dependencies.map(m => `'${removeExtensionFromRelativeAmdId(m.id)}'`);
  23779. const args = dependencies.map(m => m.name);
  23780. const n = compact ? '' : '\n';
  23781. const s = compact ? '' : ';';
  23782. const _ = compact ? '' : ' ';
  23783. if (namedExportsMode && hasExports) {
  23784. args.unshift(`exports`);
  23785. deps.unshift(`'exports'`);
  23786. }
  23787. if (accessedGlobals.has('require')) {
  23788. args.unshift('require');
  23789. deps.unshift(`'require'`);
  23790. }
  23791. if (accessedGlobals.has('module')) {
  23792. args.unshift('module');
  23793. deps.unshift(`'module'`);
  23794. }
  23795. const completeAmdId = getCompleteAmdId(amd, id);
  23796. const params = (completeAmdId ? `'${completeAmdId}',${_}` : ``) +
  23797. (deps.length ? `[${deps.join(`,${_}`)}],${_}` : ``);
  23798. const useStrict = strict ? `${_}'use strict';` : '';
  23799. magicString.prepend(`${intro}${getInteropBlock(dependencies, varOrConst, interop, externalLiveBindings, freeze, namespaceToStringTag, accessedGlobals, _, n, s, t)}`);
  23800. const exportBlock = getExportBlock$1(exports, dependencies, namedExportsMode, interop, compact, t, externalLiveBindings);
  23801. let namespaceMarkers = getNamespaceMarkers(namedExportsMode && hasExports, isEntryFacade && esModule, isModuleFacade && namespaceToStringTag, _, n);
  23802. if (namespaceMarkers) {
  23803. namespaceMarkers = n + n + namespaceMarkers;
  23804. }
  23805. magicString.append(`${exportBlock}${namespaceMarkers}${outro}`);
  23806. return magicString
  23807. .indent(t)
  23808. .prepend(`${amd.define}(${params}function${_}(${args.join(`,${_}`)})${_}{${useStrict}${n}${n}`)
  23809. .append(`${n}${n}});`);
  23810. }
  23811. function cjs$1(magicString, { accessedGlobals, dependencies, exports, hasExports, indentString: t, intro, isEntryFacade, isModuleFacade, namedExportsMode, outro, varOrConst }, { compact, esModule, externalLiveBindings, freeze, interop, namespaceToStringTag, strict }) {
  23812. const n = compact ? '' : '\n';
  23813. const s = compact ? '' : ';';
  23814. const _ = compact ? '' : ' ';
  23815. const useStrict = strict ? `'use strict';${n}${n}` : '';
  23816. let namespaceMarkers = getNamespaceMarkers(namedExportsMode && hasExports, isEntryFacade && esModule, isModuleFacade && namespaceToStringTag, _, n);
  23817. if (namespaceMarkers) {
  23818. namespaceMarkers += n + n;
  23819. }
  23820. const importBlock = getImportBlock$1(dependencies, compact, varOrConst, n, _);
  23821. const interopBlock = getInteropBlock(dependencies, varOrConst, interop, externalLiveBindings, freeze, namespaceToStringTag, accessedGlobals, _, n, s, t);
  23822. magicString.prepend(`${useStrict}${intro}${namespaceMarkers}${importBlock}${interopBlock}`);
  23823. const exportBlock = getExportBlock$1(exports, dependencies, namedExportsMode, interop, compact, t, externalLiveBindings, `module.exports${_}=${_}`);
  23824. return magicString.append(`${exportBlock}${outro}`);
  23825. }
  23826. function getImportBlock$1(dependencies, compact, varOrConst, n, _) {
  23827. let importBlock = '';
  23828. let definingVariable = false;
  23829. for (const { id, name, reexports, imports } of dependencies) {
  23830. if (!reexports && !imports) {
  23831. if (importBlock) {
  23832. importBlock += !compact || definingVariable ? `;${n}` : ',';
  23833. }
  23834. definingVariable = false;
  23835. importBlock += `require('${id}')`;
  23836. }
  23837. else {
  23838. importBlock +=
  23839. compact && definingVariable ? ',' : `${importBlock ? `;${n}` : ''}${varOrConst} `;
  23840. definingVariable = true;
  23841. importBlock += `${name}${_}=${_}require('${id}')`;
  23842. }
  23843. }
  23844. if (importBlock) {
  23845. return `${importBlock};${n}${n}`;
  23846. }
  23847. return '';
  23848. }
  23849. function es(magicString, { intro, outro, dependencies, exports, varOrConst }, { compact }) {
  23850. const _ = compact ? '' : ' ';
  23851. const n = compact ? '' : '\n';
  23852. const importBlock = getImportBlock(dependencies, _);
  23853. if (importBlock.length > 0)
  23854. intro += importBlock.join(n) + n + n;
  23855. if (intro)
  23856. magicString.prepend(intro);
  23857. const exportBlock = getExportBlock(exports, _, varOrConst);
  23858. if (exportBlock.length)
  23859. magicString.append(n + n + exportBlock.join(n).trim());
  23860. if (outro)
  23861. magicString.append(outro);
  23862. return magicString.trim();
  23863. }
  23864. function getImportBlock(dependencies, _) {
  23865. const importBlock = [];
  23866. for (const { id, reexports, imports, name } of dependencies) {
  23867. if (!reexports && !imports) {
  23868. importBlock.push(`import${_}'${id}';`);
  23869. continue;
  23870. }
  23871. if (imports) {
  23872. let defaultImport = null;
  23873. let starImport = null;
  23874. const importedNames = [];
  23875. for (const specifier of imports) {
  23876. if (specifier.imported === 'default') {
  23877. defaultImport = specifier;
  23878. }
  23879. else if (specifier.imported === '*') {
  23880. starImport = specifier;
  23881. }
  23882. else {
  23883. importedNames.push(specifier);
  23884. }
  23885. }
  23886. if (starImport) {
  23887. importBlock.push(`import${_}*${_}as ${starImport.local} from${_}'${id}';`);
  23888. }
  23889. if (defaultImport && importedNames.length === 0) {
  23890. importBlock.push(`import ${defaultImport.local} from${_}'${id}';`);
  23891. }
  23892. else if (importedNames.length > 0) {
  23893. importBlock.push(`import ${defaultImport ? `${defaultImport.local},${_}` : ''}{${_}${importedNames
  23894. .map(specifier => {
  23895. if (specifier.imported === specifier.local) {
  23896. return specifier.imported;
  23897. }
  23898. else {
  23899. return `${specifier.imported} as ${specifier.local}`;
  23900. }
  23901. })
  23902. .join(`,${_}`)}${_}}${_}from${_}'${id}';`);
  23903. }
  23904. }
  23905. if (reexports) {
  23906. let starExport = null;
  23907. const namespaceReexports = [];
  23908. const namedReexports = [];
  23909. for (const specifier of reexports) {
  23910. if (specifier.reexported === '*') {
  23911. starExport = specifier;
  23912. }
  23913. else if (specifier.imported === '*') {
  23914. namespaceReexports.push(specifier);
  23915. }
  23916. else {
  23917. namedReexports.push(specifier);
  23918. }
  23919. }
  23920. if (starExport) {
  23921. importBlock.push(`export${_}*${_}from${_}'${id}';`);
  23922. }
  23923. if (namespaceReexports.length > 0) {
  23924. if (!imports ||
  23925. !imports.some(specifier => specifier.imported === '*' && specifier.local === name)) {
  23926. importBlock.push(`import${_}*${_}as ${name} from${_}'${id}';`);
  23927. }
  23928. for (const specifier of namespaceReexports) {
  23929. importBlock.push(`export${_}{${_}${name === specifier.reexported ? name : `${name} as ${specifier.reexported}`} };`);
  23930. }
  23931. }
  23932. if (namedReexports.length > 0) {
  23933. importBlock.push(`export${_}{${_}${namedReexports
  23934. .map(specifier => {
  23935. if (specifier.imported === specifier.reexported) {
  23936. return specifier.imported;
  23937. }
  23938. else {
  23939. return `${specifier.imported} as ${specifier.reexported}`;
  23940. }
  23941. })
  23942. .join(`,${_}`)}${_}}${_}from${_}'${id}';`);
  23943. }
  23944. }
  23945. }
  23946. return importBlock;
  23947. }
  23948. function getExportBlock(exports, _, varOrConst) {
  23949. const exportBlock = [];
  23950. const exportDeclaration = [];
  23951. for (const specifier of exports) {
  23952. if (specifier.exported === 'default') {
  23953. exportBlock.push(`export default ${specifier.local};`);
  23954. }
  23955. else {
  23956. if (specifier.expression) {
  23957. exportBlock.push(`${varOrConst} ${specifier.local}${_}=${_}${specifier.expression};`);
  23958. }
  23959. exportDeclaration.push(specifier.exported === specifier.local
  23960. ? specifier.local
  23961. : `${specifier.local} as ${specifier.exported}`);
  23962. }
  23963. }
  23964. if (exportDeclaration.length) {
  23965. exportBlock.push(`export${_}{${_}${exportDeclaration.join(`,${_}`)}${_}};`);
  23966. }
  23967. return exportBlock;
  23968. }
  23969. function spaces(i) {
  23970. let result = '';
  23971. while (i--)
  23972. result += ' ';
  23973. return result;
  23974. }
  23975. function tabsToSpaces(str) {
  23976. return str.replace(/^\t+/, match => match.split('\t').join(' '));
  23977. }
  23978. function getCodeFrame(source, line, column) {
  23979. let lines = source.split('\n');
  23980. const frameStart = Math.max(0, line - 3);
  23981. let frameEnd = Math.min(line + 2, lines.length);
  23982. lines = lines.slice(frameStart, frameEnd);
  23983. while (!/\S/.test(lines[lines.length - 1])) {
  23984. lines.pop();
  23985. frameEnd -= 1;
  23986. }
  23987. const digits = String(frameEnd).length;
  23988. return lines
  23989. .map((str, i) => {
  23990. const isErrorLine = frameStart + i + 1 === line;
  23991. let lineNum = String(i + frameStart + 1);
  23992. while (lineNum.length < digits)
  23993. lineNum = ` ${lineNum}`;
  23994. if (isErrorLine) {
  23995. const indicator = spaces(digits + 2 + tabsToSpaces(str.slice(0, column)).length) + '^';
  23996. return `${lineNum}: ${tabsToSpaces(str)}\n${indicator}`;
  23997. }
  23998. return `${lineNum}: ${tabsToSpaces(str)}`;
  23999. })
  24000. .join('\n');
  24001. }
  24002. function sanitizeFileName(name) {
  24003. const match = /^[a-z]:/i.exec(name);
  24004. const driveLetter = match ? match[0] : "";
  24005. // A `:` is only allowed as part of a windows drive letter (ex: C:\foo)
  24006. // Otherwise, avoid them because they can refer to NTFS alternate data streams.
  24007. return driveLetter + name.substr(driveLetter.length).replace(/[\0?*:]/g, '_');
  24008. }
  24009. function getAliasName(id) {
  24010. const base = basename(id);
  24011. return base.substr(0, base.length - extname$1(id).length);
  24012. }
  24013. function relativeId(id) {
  24014. if (!isAbsolute(id))
  24015. return id;
  24016. return relative$1(resolve$1(), id);
  24017. }
  24018. function isPlainPathFragment(name) {
  24019. // not starting with "/", "./", "../"
  24020. return (name[0] !== '/' &&
  24021. !(name[0] === '.' && (name[1] === '/' || name[1] === '.')) &&
  24022. sanitizeFileName(name) === name &&
  24023. !isAbsolute(name));
  24024. }
  24025. function error(base) {
  24026. if (!(base instanceof Error))
  24027. base = Object.assign(new Error(base.message), base);
  24028. throw base;
  24029. }
  24030. function augmentCodeLocation(props, pos, source, id) {
  24031. if (typeof pos === 'object') {
  24032. const { line, column } = pos;
  24033. props.loc = { file: id, line, column };
  24034. }
  24035. else {
  24036. props.pos = pos;
  24037. const { line, column } = locate(source, pos, { offsetLine: 1 });
  24038. props.loc = { file: id, line, column };
  24039. }
  24040. if (props.frame === undefined) {
  24041. const { line, column } = props.loc;
  24042. props.frame = getCodeFrame(source, line, column);
  24043. }
  24044. }
  24045. var Errors;
  24046. (function (Errors) {
  24047. Errors["ALREADY_CLOSED"] = "ALREADY_CLOSED";
  24048. Errors["ASSET_NOT_FINALISED"] = "ASSET_NOT_FINALISED";
  24049. Errors["ASSET_NOT_FOUND"] = "ASSET_NOT_FOUND";
  24050. Errors["ASSET_SOURCE_ALREADY_SET"] = "ASSET_SOURCE_ALREADY_SET";
  24051. Errors["ASSET_SOURCE_MISSING"] = "ASSET_SOURCE_MISSING";
  24052. Errors["BAD_LOADER"] = "BAD_LOADER";
  24053. Errors["CANNOT_EMIT_FROM_OPTIONS_HOOK"] = "CANNOT_EMIT_FROM_OPTIONS_HOOK";
  24054. Errors["CHUNK_NOT_GENERATED"] = "CHUNK_NOT_GENERATED";
  24055. Errors["CHUNK_INVALID"] = "CHUNK_INVALID";
  24056. Errors["CIRCULAR_REEXPORT"] = "CIRCULAR_REEXPORT";
  24057. Errors["CYCLIC_CROSS_CHUNK_REEXPORT"] = "CYCLIC_CROSS_CHUNK_REEXPORT";
  24058. Errors["DEPRECATED_FEATURE"] = "DEPRECATED_FEATURE";
  24059. Errors["EXTERNAL_SYNTHETIC_EXPORTS"] = "EXTERNAL_SYNTHETIC_EXPORTS";
  24060. Errors["FILE_NAME_CONFLICT"] = "FILE_NAME_CONFLICT";
  24061. Errors["FILE_NOT_FOUND"] = "FILE_NOT_FOUND";
  24062. Errors["INPUT_HOOK_IN_OUTPUT_PLUGIN"] = "INPUT_HOOK_IN_OUTPUT_PLUGIN";
  24063. Errors["INVALID_CHUNK"] = "INVALID_CHUNK";
  24064. Errors["INVALID_EXPORT_OPTION"] = "INVALID_EXPORT_OPTION";
  24065. Errors["INVALID_EXTERNAL_ID"] = "INVALID_EXTERNAL_ID";
  24066. Errors["INVALID_OPTION"] = "INVALID_OPTION";
  24067. Errors["INVALID_PLUGIN_HOOK"] = "INVALID_PLUGIN_HOOK";
  24068. Errors["INVALID_ROLLUP_PHASE"] = "INVALID_ROLLUP_PHASE";
  24069. Errors["MISSING_EXPORT"] = "MISSING_EXPORT";
  24070. Errors["MISSING_IMPLICIT_DEPENDANT"] = "MISSING_IMPLICIT_DEPENDANT";
  24071. Errors["MIXED_EXPORTS"] = "MIXED_EXPORTS";
  24072. Errors["NAMESPACE_CONFLICT"] = "NAMESPACE_CONFLICT";
  24073. Errors["NO_TRANSFORM_MAP_OR_AST_WITHOUT_CODE"] = "NO_TRANSFORM_MAP_OR_AST_WITHOUT_CODE";
  24074. Errors["PLUGIN_ERROR"] = "PLUGIN_ERROR";
  24075. Errors["PREFER_NAMED_EXPORTS"] = "PREFER_NAMED_EXPORTS";
  24076. Errors["SYNTHETIC_NAMED_EXPORTS_NEED_NAMESPACE_EXPORT"] = "SYNTHETIC_NAMED_EXPORTS_NEED_NAMESPACE_EXPORT";
  24077. Errors["UNEXPECTED_NAMED_IMPORT"] = "UNEXPECTED_NAMED_IMPORT";
  24078. Errors["UNRESOLVED_ENTRY"] = "UNRESOLVED_ENTRY";
  24079. Errors["UNRESOLVED_IMPORT"] = "UNRESOLVED_IMPORT";
  24080. Errors["VALIDATION_ERROR"] = "VALIDATION_ERROR";
  24081. })(Errors || (Errors = {}));
  24082. function errAssetNotFinalisedForFileName(name) {
  24083. return {
  24084. code: Errors.ASSET_NOT_FINALISED,
  24085. message: `Plugin error - Unable to get file name for asset "${name}". Ensure that the source is set and that generate is called first.`
  24086. };
  24087. }
  24088. function errCannotEmitFromOptionsHook() {
  24089. return {
  24090. code: Errors.CANNOT_EMIT_FROM_OPTIONS_HOOK,
  24091. message: `Cannot emit files or set asset sources in the "outputOptions" hook, use the "renderStart" hook instead.`
  24092. };
  24093. }
  24094. function errChunkNotGeneratedForFileName(name) {
  24095. return {
  24096. code: Errors.CHUNK_NOT_GENERATED,
  24097. message: `Plugin error - Unable to get file name for chunk "${name}". Ensure that generate is called first.`
  24098. };
  24099. }
  24100. function errChunkInvalid({ fileName, code }, exception) {
  24101. const errorProps = {
  24102. code: Errors.CHUNK_INVALID,
  24103. message: `Chunk "${fileName}" is not valid JavaScript: ${exception.message}.`
  24104. };
  24105. augmentCodeLocation(errorProps, exception.loc, code, fileName);
  24106. return errorProps;
  24107. }
  24108. function errCircularReexport(exportName, importedModule) {
  24109. return {
  24110. code: Errors.CIRCULAR_REEXPORT,
  24111. id: importedModule,
  24112. message: `"${exportName}" cannot be exported from ${relativeId(importedModule)} as it is a reexport that references itself.`
  24113. };
  24114. }
  24115. function errCyclicCrossChunkReexport(exportName, exporter, reexporter, importer) {
  24116. return {
  24117. code: Errors.CYCLIC_CROSS_CHUNK_REEXPORT,
  24118. exporter,
  24119. importer,
  24120. message: `Export "${exportName}" of module ${relativeId(exporter)} was reexported through module ${relativeId(reexporter)} while both modules are dependencies of each other and will end up in different chunks by current Rollup settings. This scenario is not well supported at the moment as it will produce a circular dependency between chunks and will likely lead to broken execution order.\nEither change the import in ${relativeId(importer)} to point directly to the exporting module or do not use "preserveModules" to ensure these modules end up in the same chunk.`,
  24121. reexporter
  24122. };
  24123. }
  24124. function errAssetReferenceIdNotFoundForSetSource(assetReferenceId) {
  24125. return {
  24126. code: Errors.ASSET_NOT_FOUND,
  24127. message: `Plugin error - Unable to set the source for unknown asset "${assetReferenceId}".`
  24128. };
  24129. }
  24130. function errAssetSourceAlreadySet(name) {
  24131. return {
  24132. code: Errors.ASSET_SOURCE_ALREADY_SET,
  24133. message: `Unable to set the source for asset "${name}", source already set.`
  24134. };
  24135. }
  24136. function errNoAssetSourceSet(assetName) {
  24137. return {
  24138. code: Errors.ASSET_SOURCE_MISSING,
  24139. message: `Plugin error creating asset "${assetName}" - no asset source set.`
  24140. };
  24141. }
  24142. function errBadLoader(id) {
  24143. return {
  24144. code: Errors.BAD_LOADER,
  24145. message: `Error loading ${relativeId(id)}: plugin load hook should return a string, a { code, map } object, or nothing/null`
  24146. };
  24147. }
  24148. function errDeprecation(deprecation) {
  24149. return {
  24150. code: Errors.DEPRECATED_FEATURE,
  24151. ...(typeof deprecation === 'string' ? { message: deprecation } : deprecation)
  24152. };
  24153. }
  24154. function errFileReferenceIdNotFoundForFilename(assetReferenceId) {
  24155. return {
  24156. code: Errors.FILE_NOT_FOUND,
  24157. message: `Plugin error - Unable to get file name for unknown file "${assetReferenceId}".`
  24158. };
  24159. }
  24160. function errFileNameConflict(fileName) {
  24161. return {
  24162. code: Errors.FILE_NAME_CONFLICT,
  24163. message: `The emitted file "${fileName}" overwrites a previously emitted file of the same name.`
  24164. };
  24165. }
  24166. function errInputHookInOutputPlugin(pluginName, hookName) {
  24167. return {
  24168. code: Errors.INPUT_HOOK_IN_OUTPUT_PLUGIN,
  24169. message: `The "${hookName}" hook used by the output plugin ${pluginName} is a build time hook and will not be run for that plugin. Either this plugin cannot be used as an output plugin, or it should have an option to configure it as an output plugin.`
  24170. };
  24171. }
  24172. function errCannotAssignModuleToChunk(moduleId, assignToAlias, currentAlias) {
  24173. return {
  24174. code: Errors.INVALID_CHUNK,
  24175. message: `Cannot assign ${relativeId(moduleId)} to the "${assignToAlias}" chunk as it is already in the "${currentAlias}" chunk.`
  24176. };
  24177. }
  24178. function errInvalidExportOptionValue(optionValue) {
  24179. return {
  24180. code: Errors.INVALID_EXPORT_OPTION,
  24181. message: `"output.exports" must be "default", "named", "none", "auto", or left unspecified (defaults to "auto"), received "${optionValue}"`,
  24182. url: `https://rollupjs.org/guide/en/#outputexports`
  24183. };
  24184. }
  24185. function errIncompatibleExportOptionValue(optionValue, keys, entryModule) {
  24186. return {
  24187. code: 'INVALID_EXPORT_OPTION',
  24188. message: `"${optionValue}" was specified for "output.exports", but entry module "${relativeId(entryModule)}" has the following exports: ${keys.join(', ')}`
  24189. };
  24190. }
  24191. function errInternalIdCannotBeExternal(source, importer) {
  24192. return {
  24193. code: Errors.INVALID_EXTERNAL_ID,
  24194. message: `'${source}' is imported as an external by ${relativeId(importer)}, but is already an existing non-external module id.`
  24195. };
  24196. }
  24197. function errInvalidOption(option, explanation) {
  24198. return {
  24199. code: Errors.INVALID_OPTION,
  24200. message: `Invalid value for option "${option}" - ${explanation}.`
  24201. };
  24202. }
  24203. function errInvalidRollupPhaseForAddWatchFile() {
  24204. return {
  24205. code: Errors.INVALID_ROLLUP_PHASE,
  24206. message: `Cannot call addWatchFile after the build has finished.`
  24207. };
  24208. }
  24209. function errInvalidRollupPhaseForChunkEmission() {
  24210. return {
  24211. code: Errors.INVALID_ROLLUP_PHASE,
  24212. message: `Cannot emit chunks after module loading has finished.`
  24213. };
  24214. }
  24215. function errMissingExport(exportName, importingModule, importedModule) {
  24216. return {
  24217. code: Errors.MISSING_EXPORT,
  24218. message: `'${exportName}' is not exported by ${relativeId(importedModule)}, imported by ${relativeId(importingModule)}`,
  24219. url: `https://rollupjs.org/guide/en/#error-name-is-not-exported-by-module`
  24220. };
  24221. }
  24222. function errImplicitDependantCannotBeExternal(unresolvedId, implicitlyLoadedBefore) {
  24223. return {
  24224. code: Errors.MISSING_IMPLICIT_DEPENDANT,
  24225. message: `Module "${relativeId(unresolvedId)}" that should be implicitly loaded before "${relativeId(implicitlyLoadedBefore)}" cannot be external.`
  24226. };
  24227. }
  24228. function errUnresolvedImplicitDependant(unresolvedId, implicitlyLoadedBefore) {
  24229. return {
  24230. code: Errors.MISSING_IMPLICIT_DEPENDANT,
  24231. message: `Module "${relativeId(unresolvedId)}" that should be implicitly loaded before "${relativeId(implicitlyLoadedBefore)}" could not be resolved.`
  24232. };
  24233. }
  24234. function errImplicitDependantIsNotIncluded(module) {
  24235. const implicitDependencies = Array.from(module.implicitlyLoadedBefore, dependency => relativeId(dependency.id)).sort();
  24236. return {
  24237. code: Errors.MISSING_IMPLICIT_DEPENDANT,
  24238. message: `Module "${relativeId(module.id)}" that should be implicitly loaded before "${implicitDependencies.length === 1
  24239. ? implicitDependencies[0]
  24240. : `${implicitDependencies.slice(0, -1).join('", "')}" and "${implicitDependencies.slice(-1)[0]}`}" is not included in the module graph. Either it was not imported by an included module or only via a tree-shaken dynamic import, or no imported bindings were used and it had otherwise no side-effects.`
  24241. };
  24242. }
  24243. function errMixedExport(facadeModuleId, name) {
  24244. return {
  24245. code: Errors.MIXED_EXPORTS,
  24246. id: facadeModuleId,
  24247. message: `Entry module "${relativeId(facadeModuleId)}" is using named and default exports together. Consumers of your bundle will have to use \`${name || 'chunk'}["default"]\` to access the default export, which may not be what you want. Use \`output.exports: "named"\` to disable this warning`,
  24248. url: `https://rollupjs.org/guide/en/#outputexports`
  24249. };
  24250. }
  24251. function errNamespaceConflict(name, reexportingModule, additionalExportAllModule) {
  24252. return {
  24253. code: Errors.NAMESPACE_CONFLICT,
  24254. message: `Conflicting namespaces: ${relativeId(reexportingModule.id)} re-exports '${name}' from both ${relativeId(reexportingModule.exportsAll[name])} and ${relativeId(additionalExportAllModule.exportsAll[name])} (will be ignored)`,
  24255. name,
  24256. reexporter: reexportingModule.id,
  24257. sources: [reexportingModule.exportsAll[name], additionalExportAllModule.exportsAll[name]]
  24258. };
  24259. }
  24260. function errNoTransformMapOrAstWithoutCode(pluginName) {
  24261. return {
  24262. code: Errors.NO_TRANSFORM_MAP_OR_AST_WITHOUT_CODE,
  24263. message: `The plugin "${pluginName}" returned a "map" or "ast" without returning ` +
  24264. 'a "code". This will be ignored.'
  24265. };
  24266. }
  24267. function errPreferNamedExports(facadeModuleId) {
  24268. const file = relativeId(facadeModuleId);
  24269. return {
  24270. code: Errors.PREFER_NAMED_EXPORTS,
  24271. id: facadeModuleId,
  24272. message: `Entry module "${file}" is implicitly using "default" export mode, which means for CommonJS output that its default export is assigned to "module.exports". For many tools, such CommonJS output will not be interchangeable with the original ES module. If this is intended, explicitly set "output.exports" to either "auto" or "default", otherwise you might want to consider changing the signature of "${file}" to use named exports only.`,
  24273. url: `https://rollupjs.org/guide/en/#outputexports`
  24274. };
  24275. }
  24276. function errSyntheticNamedExportsNeedNamespaceExport(id, syntheticNamedExportsOption) {
  24277. return {
  24278. code: Errors.SYNTHETIC_NAMED_EXPORTS_NEED_NAMESPACE_EXPORT,
  24279. id,
  24280. message: `Module "${relativeId(id)}" that is marked with 'syntheticNamedExports: ${JSON.stringify(syntheticNamedExportsOption)}' needs ${typeof syntheticNamedExportsOption === 'string' && syntheticNamedExportsOption !== 'default'
  24281. ? `an export named "${syntheticNamedExportsOption}"`
  24282. : 'a default export'} that does not reexport an unresolved named export of the same module.`
  24283. };
  24284. }
  24285. function errUnexpectedNamedImport(id, imported, isReexport) {
  24286. const importType = isReexport ? 'reexport' : 'import';
  24287. return {
  24288. code: Errors.UNEXPECTED_NAMED_IMPORT,
  24289. id,
  24290. message: `The named export "${imported}" was ${importType}ed from the external module ${relativeId(id)} even though its interop type is "defaultOnly". Either remove or change this ${importType} or change the value of the "output.interop" option.`,
  24291. url: 'https://rollupjs.org/guide/en/#outputinterop'
  24292. };
  24293. }
  24294. function errUnexpectedNamespaceReexport(id) {
  24295. return {
  24296. code: Errors.UNEXPECTED_NAMED_IMPORT,
  24297. id,
  24298. message: `There was a namespace "*" reexport from the external module ${relativeId(id)} even though its interop type is "defaultOnly". This will be ignored as namespace reexports only reexport named exports. If this is not intended, either remove or change this reexport or change the value of the "output.interop" option.`,
  24299. url: 'https://rollupjs.org/guide/en/#outputinterop'
  24300. };
  24301. }
  24302. function errEntryCannotBeExternal(unresolvedId) {
  24303. return {
  24304. code: Errors.UNRESOLVED_ENTRY,
  24305. message: `Entry module cannot be external (${relativeId(unresolvedId)}).`
  24306. };
  24307. }
  24308. function errUnresolvedEntry(unresolvedId) {
  24309. return {
  24310. code: Errors.UNRESOLVED_ENTRY,
  24311. message: `Could not resolve entry module (${relativeId(unresolvedId)}).`
  24312. };
  24313. }
  24314. function errUnresolvedImport(source, importer) {
  24315. return {
  24316. code: Errors.UNRESOLVED_IMPORT,
  24317. message: `Could not resolve '${source}' from ${relativeId(importer)}`
  24318. };
  24319. }
  24320. function errUnresolvedImportTreatedAsExternal(source, importer) {
  24321. return {
  24322. code: Errors.UNRESOLVED_IMPORT,
  24323. importer: relativeId(importer),
  24324. message: `'${source}' is imported by ${relativeId(importer)}, but could not be resolved – treating it as an external dependency`,
  24325. source,
  24326. url: 'https://rollupjs.org/guide/en/#warning-treating-module-as-external-dependency'
  24327. };
  24328. }
  24329. function errExternalSyntheticExports(source, importer) {
  24330. return {
  24331. code: Errors.EXTERNAL_SYNTHETIC_EXPORTS,
  24332. importer: relativeId(importer),
  24333. message: `External '${source}' can not have 'syntheticNamedExports' enabled.`,
  24334. source
  24335. };
  24336. }
  24337. function errFailedValidation(message) {
  24338. return {
  24339. code: Errors.VALIDATION_ERROR,
  24340. message
  24341. };
  24342. }
  24343. function errAlreadyClosed() {
  24344. return {
  24345. code: Errors.ALREADY_CLOSED,
  24346. message: 'Bundle is already closed, no more calls to "generate" or "write" are allowed.'
  24347. };
  24348. }
  24349. function warnDeprecation(deprecation, activeDeprecation, options) {
  24350. warnDeprecationWithOptions(deprecation, activeDeprecation, options.onwarn, options.strictDeprecations);
  24351. }
  24352. function warnDeprecationWithOptions(deprecation, activeDeprecation, warn, strictDeprecations) {
  24353. if (activeDeprecation || strictDeprecations) {
  24354. const warning = errDeprecation(deprecation);
  24355. if (strictDeprecations) {
  24356. return error(warning);
  24357. }
  24358. warn(warning);
  24359. }
  24360. }
  24361. // Generate strings which dereference dotted properties, but use array notation `['prop-deref']`
  24362. // if the property name isn't trivial
  24363. const shouldUseDot = /^[a-zA-Z$_][a-zA-Z0-9$_]*$/;
  24364. function property(prop) {
  24365. return shouldUseDot.test(prop) ? `.${prop}` : `['${prop}']`;
  24366. }
  24367. function keypath(keypath) {
  24368. return keypath
  24369. .split('.')
  24370. .map(property)
  24371. .join('');
  24372. }
  24373. function setupNamespace(name, root, globals, compact) {
  24374. const _ = compact ? '' : ' ';
  24375. const parts = name.split('.');
  24376. parts[0] = (typeof globals === 'function' ? globals(parts[0]) : globals[parts[0]]) || parts[0];
  24377. parts.pop();
  24378. let acc = root;
  24379. return (parts
  24380. .map(part => ((acc += property(part)), `${acc}${_}=${_}${acc}${_}||${_}{}${compact ? '' : ';'}`))
  24381. .join(compact ? ',' : '\n') + (compact && parts.length ? ';' : '\n'));
  24382. }
  24383. function assignToDeepVariable(deepName, root, globals, compact, assignment) {
  24384. const _ = compact ? '' : ' ';
  24385. const parts = deepName.split('.');
  24386. parts[0] = (typeof globals === 'function' ? globals(parts[0]) : globals[parts[0]]) || parts[0];
  24387. const last = parts.pop();
  24388. let acc = root;
  24389. let deepAssignment = parts
  24390. .map(part => ((acc += property(part)), `${acc}${_}=${_}${acc}${_}||${_}{}`))
  24391. .concat(`${acc}${property(last)}`)
  24392. .join(`,${_}`)
  24393. .concat(`${_}=${_}${assignment}`);
  24394. if (parts.length > 0) {
  24395. deepAssignment = `(${deepAssignment})`;
  24396. }
  24397. return deepAssignment;
  24398. }
  24399. function trimEmptyImports(dependencies) {
  24400. let i = dependencies.length;
  24401. while (i--) {
  24402. const { imports, reexports } = dependencies[i];
  24403. if (imports || reexports) {
  24404. return dependencies.slice(0, i + 1);
  24405. }
  24406. }
  24407. return [];
  24408. }
  24409. const thisProp = (name) => `this${keypath(name)}`;
  24410. function iife(magicString, { accessedGlobals, dependencies, exports, hasExports, indentString: t, intro, namedExportsMode, outro, varOrConst, warn }, { compact, esModule, extend, freeze, externalLiveBindings, globals, interop, name, namespaceToStringTag, strict }) {
  24411. const _ = compact ? '' : ' ';
  24412. const s = compact ? '' : ';';
  24413. const n = compact ? '' : '\n';
  24414. const isNamespaced = name && name.indexOf('.') !== -1;
  24415. const useVariableAssignment = !extend && !isNamespaced;
  24416. if (name && useVariableAssignment && !isLegal(name)) {
  24417. return error({
  24418. code: 'ILLEGAL_IDENTIFIER_AS_NAME',
  24419. message: `Given name "${name}" is not a legal JS identifier. If you need this, you can try "output.extend: true".`
  24420. });
  24421. }
  24422. warnOnBuiltins(warn, dependencies);
  24423. const external = trimEmptyImports(dependencies);
  24424. const deps = external.map(dep => dep.globalName || 'null');
  24425. const args = external.map(m => m.name);
  24426. if (hasExports && !name) {
  24427. warn({
  24428. code: 'MISSING_NAME_OPTION_FOR_IIFE_EXPORT',
  24429. message: `If you do not supply "output.name", you may not be able to access the exports of an IIFE bundle.`
  24430. });
  24431. }
  24432. if (namedExportsMode && hasExports) {
  24433. if (extend) {
  24434. deps.unshift(`${thisProp(name)}${_}=${_}${thisProp(name)}${_}||${_}{}`);
  24435. args.unshift('exports');
  24436. }
  24437. else {
  24438. deps.unshift('{}');
  24439. args.unshift('exports');
  24440. }
  24441. }
  24442. const useStrict = strict ? `${t}'use strict';${n}` : '';
  24443. const interopBlock = getInteropBlock(dependencies, varOrConst, interop, externalLiveBindings, freeze, namespaceToStringTag, accessedGlobals, _, n, s, t);
  24444. magicString.prepend(`${intro}${interopBlock}`);
  24445. let wrapperIntro = `(function${_}(${args.join(`,${_}`)})${_}{${n}${useStrict}${n}`;
  24446. if (hasExports) {
  24447. if (name && !(extend && namedExportsMode)) {
  24448. wrapperIntro =
  24449. (useVariableAssignment ? `${varOrConst} ${name}` : thisProp(name)) +
  24450. `${_}=${_}${wrapperIntro}`;
  24451. }
  24452. if (isNamespaced) {
  24453. wrapperIntro = setupNamespace(name, 'this', globals, compact) + wrapperIntro;
  24454. }
  24455. }
  24456. let wrapperOutro = `${n}${n}}(${deps.join(`,${_}`)}));`;
  24457. if (hasExports && !extend && namedExportsMode) {
  24458. wrapperOutro = `${n}${n}${t}return exports;${wrapperOutro}`;
  24459. }
  24460. const exportBlock = getExportBlock$1(exports, dependencies, namedExportsMode, interop, compact, t, externalLiveBindings);
  24461. let namespaceMarkers = getNamespaceMarkers(namedExportsMode && hasExports, esModule, namespaceToStringTag, _, n);
  24462. if (namespaceMarkers) {
  24463. namespaceMarkers = n + n + namespaceMarkers;
  24464. }
  24465. magicString.append(`${exportBlock}${namespaceMarkers}${outro}`);
  24466. return magicString.indent(t).prepend(wrapperIntro).append(wrapperOutro);
  24467. }
  24468. function getStarExcludes({ dependencies, exports }) {
  24469. const starExcludes = new Set(exports.map(expt => expt.exported));
  24470. if (!starExcludes.has('default'))
  24471. starExcludes.add('default');
  24472. // also include reexport names
  24473. for (const { reexports } of dependencies) {
  24474. if (reexports) {
  24475. for (const reexport of reexports) {
  24476. if (reexport.imported !== '*' && !starExcludes.has(reexport.reexported))
  24477. starExcludes.add(reexport.reexported);
  24478. }
  24479. }
  24480. }
  24481. return starExcludes;
  24482. }
  24483. const getStarExcludesBlock = (starExcludes, varOrConst, _, t, n) => starExcludes
  24484. ? `${n}${t}${varOrConst} _starExcludes${_}=${_}{${_}${[...starExcludes]
  24485. .map(prop => `${prop}:${_}1`)
  24486. .join(`,${_}`)}${_}};`
  24487. : '';
  24488. const getImportBindingsBlock = (importBindings, _, t, n) => (importBindings.length ? `${n}${t}var ${importBindings.join(`,${_}`)};` : '');
  24489. function getExportsBlock(exports, _, t, n) {
  24490. if (exports.length === 0) {
  24491. return '';
  24492. }
  24493. if (exports.length === 1) {
  24494. return `${t}${t}${t}exports('${exports[0].name}',${_}${exports[0].value});${n}${n}`;
  24495. }
  24496. return (`${t}${t}${t}exports({${n}` +
  24497. exports.map(({ name, value }) => `${t}${t}${t}${t}${name}:${_}${value}`).join(`,${n}`) +
  24498. `${n}${t}${t}${t}});${n}${n}`);
  24499. }
  24500. const getHoistedExportsBlock = (exports, _, t, n) => getExportsBlock(exports
  24501. .filter(expt => expt.hoisted || expt.uninitialized)
  24502. .map(expt => ({ name: expt.exported, value: expt.uninitialized ? 'void 0' : expt.local })), _, t, n);
  24503. const getMissingExportsBlock = (exports, _, t, n) => getExportsBlock(exports
  24504. .filter(expt => expt.local === MISSING_EXPORT_SHIM_VARIABLE)
  24505. .map(expt => ({ name: expt.exported, value: MISSING_EXPORT_SHIM_VARIABLE })), _, t, n);
  24506. const getSyntheticExportsBlock = (exports, _, t, n) => getExportsBlock(exports
  24507. .filter(expt => expt.expression)
  24508. .map(expt => ({ name: expt.exported, value: expt.local })), _, t, n);
  24509. function system(magicString, { accessedGlobals, dependencies, exports, hasExports, indentString: t, intro, outro, usesTopLevelAwait, varOrConst }, options) {
  24510. const n = options.compact ? '' : '\n';
  24511. const _ = options.compact ? '' : ' ';
  24512. const dependencyIds = dependencies.map(m => `'${m.id}'`);
  24513. const importBindings = [];
  24514. let starExcludes;
  24515. const setters = [];
  24516. for (const { imports, reexports } of dependencies) {
  24517. const setter = [];
  24518. if (imports) {
  24519. for (const specifier of imports) {
  24520. importBindings.push(specifier.local);
  24521. if (specifier.imported === '*') {
  24522. setter.push(`${specifier.local}${_}=${_}module;`);
  24523. }
  24524. else {
  24525. setter.push(`${specifier.local}${_}=${_}module.${specifier.imported};`);
  24526. }
  24527. }
  24528. }
  24529. if (reexports) {
  24530. let createdSetter = false;
  24531. // bulk-reexport form
  24532. if (reexports.length > 1 ||
  24533. (reexports.length === 1 &&
  24534. (reexports[0].reexported === '*' || reexports[0].imported === '*'))) {
  24535. // star reexports
  24536. for (const specifier of reexports) {
  24537. if (specifier.reexported !== '*')
  24538. continue;
  24539. // need own exports list for deduping in star export case
  24540. if (!starExcludes) {
  24541. starExcludes = getStarExcludes({ dependencies, exports });
  24542. }
  24543. if (!createdSetter) {
  24544. setter.push(`${varOrConst} _setter${_}=${_}{};`);
  24545. createdSetter = true;
  24546. }
  24547. setter.push(`for${_}(var _$p${_}in${_}module)${_}{`);
  24548. setter.push(`${t}if${_}(!_starExcludes[_$p])${_}_setter[_$p]${_}=${_}module[_$p];`);
  24549. setter.push('}');
  24550. }
  24551. // star import reexport
  24552. for (const specifier of reexports) {
  24553. if (specifier.imported !== '*' || specifier.reexported === '*')
  24554. continue;
  24555. setter.push(`exports('${specifier.reexported}',${_}module);`);
  24556. }
  24557. // reexports
  24558. for (const specifier of reexports) {
  24559. if (specifier.reexported === '*' || specifier.imported === '*')
  24560. continue;
  24561. if (!createdSetter) {
  24562. setter.push(`${varOrConst} _setter${_}=${_}{};`);
  24563. createdSetter = true;
  24564. }
  24565. setter.push(`_setter.${specifier.reexported}${_}=${_}module.${specifier.imported};`);
  24566. }
  24567. if (createdSetter) {
  24568. setter.push('exports(_setter);');
  24569. }
  24570. }
  24571. else {
  24572. // single reexport
  24573. for (const specifier of reexports) {
  24574. setter.push(`exports('${specifier.reexported}',${_}module.${specifier.imported});`);
  24575. }
  24576. }
  24577. }
  24578. setters.push(setter.join(`${n}${t}${t}${t}`));
  24579. }
  24580. const registeredName = options.name ? `'${options.name}',${_}` : '';
  24581. const wrapperParams = accessedGlobals.has('module')
  24582. ? `exports,${_}module`
  24583. : hasExports
  24584. ? 'exports'
  24585. : '';
  24586. let wrapperStart = `System.register(${registeredName}[` +
  24587. dependencyIds.join(`,${_}`) +
  24588. `],${_}function${_}(${wrapperParams})${_}{${n}${t}${options.strict ? "'use strict';" : ''}` +
  24589. getStarExcludesBlock(starExcludes, varOrConst, _, t, n) +
  24590. getImportBindingsBlock(importBindings, _, t, n) +
  24591. `${n}${t}return${_}{${setters.length
  24592. ? `${n}${t}${t}setters:${_}[${setters
  24593. .map(s => s
  24594. ? `function${_}(module)${_}{${n}${t}${t}${t}${s}${n}${t}${t}}`
  24595. : options.systemNullSetters
  24596. ? `null`
  24597. : `function${_}()${_}{}`)
  24598. .join(`,${_}`)}],`
  24599. : ''}${n}`;
  24600. wrapperStart +=
  24601. `${t}${t}execute:${_}${usesTopLevelAwait ? `async${_}` : ''}function${_}()${_}{${n}${n}` +
  24602. getHoistedExportsBlock(exports, _, t, n);
  24603. const wrapperEnd = `${n}${n}` +
  24604. getSyntheticExportsBlock(exports, _, t, n) +
  24605. getMissingExportsBlock(exports, _, t, n) +
  24606. `${t}${t}}${n}${t}}${options.compact ? '' : ';'}${n}});`;
  24607. if (intro)
  24608. magicString.prepend(intro);
  24609. if (outro)
  24610. magicString.append(outro);
  24611. return magicString.indent(`${t}${t}${t}`).append(wrapperEnd).prepend(wrapperStart);
  24612. }
  24613. function globalProp(name, globalVar) {
  24614. if (!name)
  24615. return 'null';
  24616. return `${globalVar}${keypath(name)}`;
  24617. }
  24618. function safeAccess(name, globalVar, _) {
  24619. const parts = name.split('.');
  24620. let acc = globalVar;
  24621. return parts.map(part => (acc += property(part))).join(`${_}&&${_}`);
  24622. }
  24623. function umd(magicString, { accessedGlobals, dependencies, exports, hasExports, id, indentString: t, intro, namedExportsMode, outro, varOrConst, warn }, { amd, compact, esModule, extend, externalLiveBindings, freeze, interop, name, namespaceToStringTag, globals, noConflict, strict }) {
  24624. const _ = compact ? '' : ' ';
  24625. const n = compact ? '' : '\n';
  24626. const s = compact ? '' : ';';
  24627. const factoryVar = compact ? 'f' : 'factory';
  24628. const globalVar = compact ? 'g' : 'global';
  24629. if (hasExports && !name) {
  24630. return error({
  24631. code: 'MISSING_NAME_OPTION_FOR_IIFE_EXPORT',
  24632. message: 'You must supply "output.name" for UMD bundles that have exports so that the exports are accessible in environments without a module loader.'
  24633. });
  24634. }
  24635. warnOnBuiltins(warn, dependencies);
  24636. const amdDeps = dependencies.map(m => `'${removeExtensionFromRelativeAmdId(m.id)}'`);
  24637. const cjsDeps = dependencies.map(m => `require('${m.id}')`);
  24638. const trimmedImports = trimEmptyImports(dependencies);
  24639. const globalDeps = trimmedImports.map(module => globalProp(module.globalName, globalVar));
  24640. const factoryArgs = trimmedImports.map(m => m.name);
  24641. if (namedExportsMode && (hasExports || noConflict)) {
  24642. amdDeps.unshift(`'exports'`);
  24643. cjsDeps.unshift(`exports`);
  24644. globalDeps.unshift(assignToDeepVariable(name, globalVar, globals, compact, `${extend ? `${globalProp(name, globalVar)}${_}||${_}` : ''}{}`));
  24645. factoryArgs.unshift('exports');
  24646. }
  24647. const completeAmdId = getCompleteAmdId(amd, id);
  24648. const amdParams = (completeAmdId ? `'${completeAmdId}',${_}` : ``) +
  24649. (amdDeps.length ? `[${amdDeps.join(`,${_}`)}],${_}` : ``);
  24650. const define = amd.define;
  24651. const cjsExport = !namedExportsMode && hasExports ? `module.exports${_}=${_}` : ``;
  24652. const useStrict = strict ? `${_}'use strict';${n}` : ``;
  24653. let iifeExport;
  24654. if (noConflict) {
  24655. const noConflictExportsVar = compact ? 'e' : 'exports';
  24656. let factory;
  24657. if (!namedExportsMode && hasExports) {
  24658. factory = `var ${noConflictExportsVar}${_}=${_}${assignToDeepVariable(name, globalVar, globals, compact, `${factoryVar}(${globalDeps.join(`,${_}`)})`)};`;
  24659. }
  24660. else {
  24661. const module = globalDeps.shift();
  24662. factory =
  24663. `var ${noConflictExportsVar}${_}=${_}${module};${n}` +
  24664. `${t}${t}${factoryVar}(${[noConflictExportsVar].concat(globalDeps).join(`,${_}`)});`;
  24665. }
  24666. iifeExport =
  24667. `(function${_}()${_}{${n}` +
  24668. `${t}${t}var current${_}=${_}${safeAccess(name, globalVar, _)};${n}` +
  24669. `${t}${t}${factory}${n}` +
  24670. `${t}${t}${noConflictExportsVar}.noConflict${_}=${_}function${_}()${_}{${_}` +
  24671. `${globalProp(name, globalVar)}${_}=${_}current;${_}return ${noConflictExportsVar}${compact ? '' : '; '}};${n}` +
  24672. `${t}}())`;
  24673. }
  24674. else {
  24675. iifeExport = `${factoryVar}(${globalDeps.join(`,${_}`)})`;
  24676. if (!namedExportsMode && hasExports) {
  24677. iifeExport = assignToDeepVariable(name, globalVar, globals, compact, iifeExport);
  24678. }
  24679. }
  24680. const iifeNeedsGlobal = hasExports || (noConflict && namedExportsMode) || globalDeps.length > 0;
  24681. const globalParam = iifeNeedsGlobal ? `${globalVar},${_}` : '';
  24682. const globalArg = iifeNeedsGlobal ? `this,${_}` : '';
  24683. const iifeStart = iifeNeedsGlobal
  24684. ? `(${globalVar}${_}=${_}typeof globalThis${_}!==${_}'undefined'${_}?${_}globalThis${_}:${_}${globalVar}${_}||${_}self,${_}`
  24685. : '';
  24686. const iifeEnd = iifeNeedsGlobal ? ')' : '';
  24687. const cjsIntro = iifeNeedsGlobal
  24688. ? `${t}typeof exports${_}===${_}'object'${_}&&${_}typeof module${_}!==${_}'undefined'${_}?` +
  24689. `${_}${cjsExport}${factoryVar}(${cjsDeps.join(`,${_}`)})${_}:${n}`
  24690. : '';
  24691. // factory function should be wrapped by parentheses to avoid lazy parsing
  24692. const wrapperIntro = `(function${_}(${globalParam}${factoryVar})${_}{${n}` +
  24693. cjsIntro +
  24694. `${t}typeof ${define}${_}===${_}'function'${_}&&${_}${define}.amd${_}?${_}${define}(${amdParams}${factoryVar})${_}:${n}` +
  24695. `${t}${iifeStart}${iifeExport}${iifeEnd};${n}` +
  24696. `}(${globalArg}(function${_}(${factoryArgs.join(', ')})${_}{${useStrict}${n}`;
  24697. const wrapperOutro = n + n + '})));';
  24698. magicString.prepend(`${intro}${getInteropBlock(dependencies, varOrConst, interop, externalLiveBindings, freeze, namespaceToStringTag, accessedGlobals, _, n, s, t)}`);
  24699. const exportBlock = getExportBlock$1(exports, dependencies, namedExportsMode, interop, compact, t, externalLiveBindings);
  24700. let namespaceMarkers = getNamespaceMarkers(namedExportsMode && hasExports, esModule, namespaceToStringTag, _, n);
  24701. if (namespaceMarkers) {
  24702. namespaceMarkers = n + n + namespaceMarkers;
  24703. }
  24704. magicString.append(`${exportBlock}${namespaceMarkers}${outro}`);
  24705. return magicString.trim().indent(t).append(wrapperOutro).prepend(wrapperIntro);
  24706. }
  24707. var finalisers = { system, amd, cjs: cjs$1, es, iife, umd };
  24708. const extractors$2 = {
  24709. ArrayPattern(names, param) {
  24710. for (const element of param.elements) {
  24711. if (element)
  24712. extractors$2[element.type](names, element);
  24713. }
  24714. },
  24715. AssignmentPattern(names, param) {
  24716. extractors$2[param.left.type](names, param.left);
  24717. },
  24718. Identifier(names, param) {
  24719. names.push(param.name);
  24720. },
  24721. MemberExpression() { },
  24722. ObjectPattern(names, param) {
  24723. for (const prop of param.properties) {
  24724. if (prop.type === 'RestElement') {
  24725. extractors$2.RestElement(names, prop);
  24726. }
  24727. else {
  24728. extractors$2[prop.value.type](names, prop.value);
  24729. }
  24730. }
  24731. },
  24732. RestElement(names, param) {
  24733. extractors$2[param.argument.type](names, param.argument);
  24734. }
  24735. };
  24736. const extractAssignedNames$2 = function extractAssignedNames(param) {
  24737. const names = [];
  24738. extractors$2[param.type](names, param);
  24739. return names;
  24740. };
  24741. class ExportAllDeclaration extends NodeBase {
  24742. hasEffects() {
  24743. return false;
  24744. }
  24745. initialise() {
  24746. this.context.addExport(this);
  24747. }
  24748. render(code, _options, nodeRenderOptions) {
  24749. code.remove(nodeRenderOptions.start, nodeRenderOptions.end);
  24750. }
  24751. }
  24752. ExportAllDeclaration.prototype.needsBoundaries = true;
  24753. class ArrayExpression extends NodeBase {
  24754. bind() {
  24755. super.bind();
  24756. for (const element of this.elements) {
  24757. if (element !== null)
  24758. element.deoptimizePath(UNKNOWN_PATH);
  24759. }
  24760. }
  24761. getReturnExpressionWhenCalledAtPath(path) {
  24762. if (path.length !== 1)
  24763. return UNKNOWN_EXPRESSION;
  24764. return getMemberReturnExpressionWhenCalled(arrayMembers, path[0]);
  24765. }
  24766. hasEffectsWhenAccessedAtPath(path) {
  24767. return path.length > 1;
  24768. }
  24769. hasEffectsWhenCalledAtPath(path, callOptions, context) {
  24770. if (path.length === 1) {
  24771. return hasMemberEffectWhenCalled(arrayMembers, path[0], this.included, callOptions, context);
  24772. }
  24773. return true;
  24774. }
  24775. }
  24776. class ArrayPattern extends NodeBase {
  24777. addExportedVariables(variables, exportNamesByVariable) {
  24778. for (const element of this.elements) {
  24779. if (element !== null) {
  24780. element.addExportedVariables(variables, exportNamesByVariable);
  24781. }
  24782. }
  24783. }
  24784. declare(kind) {
  24785. const variables = [];
  24786. for (const element of this.elements) {
  24787. if (element !== null) {
  24788. variables.push(...element.declare(kind, UNKNOWN_EXPRESSION));
  24789. }
  24790. }
  24791. return variables;
  24792. }
  24793. deoptimizePath(path) {
  24794. if (path.length === 0) {
  24795. for (const element of this.elements) {
  24796. if (element !== null) {
  24797. element.deoptimizePath(path);
  24798. }
  24799. }
  24800. }
  24801. }
  24802. hasEffectsWhenAssignedAtPath(path, context) {
  24803. if (path.length > 0)
  24804. return true;
  24805. for (const element of this.elements) {
  24806. if (element !== null && element.hasEffectsWhenAssignedAtPath(EMPTY_PATH, context))
  24807. return true;
  24808. }
  24809. return false;
  24810. }
  24811. }
  24812. class BlockScope extends ChildScope {
  24813. addDeclaration(identifier, context, init, isHoisted) {
  24814. if (isHoisted) {
  24815. return this.parent.addDeclaration(identifier, context, UNKNOWN_EXPRESSION, isHoisted);
  24816. }
  24817. else {
  24818. return super.addDeclaration(identifier, context, init, false);
  24819. }
  24820. }
  24821. }
  24822. class ExpressionStatement extends NodeBase {
  24823. initialise() {
  24824. if (this.directive &&
  24825. this.directive !== 'use strict' &&
  24826. this.parent.type === Program$1) {
  24827. this.context.warn(
  24828. // This is necessary, because either way (deleting or not) can lead to errors.
  24829. {
  24830. code: 'MODULE_LEVEL_DIRECTIVE',
  24831. message: `Module level directives cause errors when bundled, '${this.directive}' was ignored.`
  24832. }, this.start);
  24833. }
  24834. }
  24835. render(code, options) {
  24836. super.render(code, options);
  24837. if (this.included)
  24838. this.insertSemicolon(code);
  24839. }
  24840. shouldBeIncluded(context) {
  24841. if (this.directive && this.directive !== 'use strict')
  24842. return this.parent.type !== Program$1;
  24843. return super.shouldBeIncluded(context);
  24844. }
  24845. }
  24846. class BlockStatement extends NodeBase {
  24847. constructor() {
  24848. super(...arguments);
  24849. this.directlyIncluded = false;
  24850. }
  24851. addImplicitReturnExpressionToScope() {
  24852. const lastStatement = this.body[this.body.length - 1];
  24853. if (!lastStatement || lastStatement.type !== ReturnStatement$1) {
  24854. this.scope.addReturnExpression(UNKNOWN_EXPRESSION);
  24855. }
  24856. }
  24857. createScope(parentScope) {
  24858. this.scope = this.parent.preventChildBlockScope
  24859. ? parentScope
  24860. : new BlockScope(parentScope);
  24861. }
  24862. hasEffects(context) {
  24863. if (this.deoptimizeBody)
  24864. return true;
  24865. for (const node of this.body) {
  24866. if (node.hasEffects(context))
  24867. return true;
  24868. if (context.brokenFlow)
  24869. break;
  24870. }
  24871. return false;
  24872. }
  24873. include(context, includeChildrenRecursively) {
  24874. if (!this.deoptimizeBody || !this.directlyIncluded) {
  24875. this.included = true;
  24876. this.directlyIncluded = true;
  24877. if (this.deoptimizeBody)
  24878. includeChildrenRecursively = true;
  24879. for (const node of this.body) {
  24880. if (includeChildrenRecursively || node.shouldBeIncluded(context))
  24881. node.include(context, includeChildrenRecursively);
  24882. }
  24883. }
  24884. }
  24885. initialise() {
  24886. const firstBodyStatement = this.body[0];
  24887. this.deoptimizeBody =
  24888. firstBodyStatement instanceof ExpressionStatement &&
  24889. firstBodyStatement.directive === 'use asm';
  24890. }
  24891. render(code, options) {
  24892. if (this.body.length) {
  24893. renderStatementList(this.body, code, this.start + 1, this.end - 1, options);
  24894. }
  24895. else {
  24896. super.render(code, options);
  24897. }
  24898. }
  24899. }
  24900. class ArrowFunctionExpression extends NodeBase {
  24901. createScope(parentScope) {
  24902. this.scope = new ReturnValueScope(parentScope, this.context);
  24903. }
  24904. deoptimizePath(path) {
  24905. // A reassignment of UNKNOWN_PATH is considered equivalent to having lost track
  24906. // which means the return expression needs to be reassigned
  24907. if (path.length === 1 && path[0] === UnknownKey) {
  24908. this.scope.getReturnExpression().deoptimizePath(UNKNOWN_PATH);
  24909. }
  24910. }
  24911. getReturnExpressionWhenCalledAtPath(path) {
  24912. return path.length === 0 ? this.scope.getReturnExpression() : UNKNOWN_EXPRESSION;
  24913. }
  24914. hasEffects() {
  24915. return false;
  24916. }
  24917. hasEffectsWhenAccessedAtPath(path) {
  24918. return path.length > 1;
  24919. }
  24920. hasEffectsWhenAssignedAtPath(path) {
  24921. return path.length > 1;
  24922. }
  24923. hasEffectsWhenCalledAtPath(path, _callOptions, context) {
  24924. if (path.length > 0)
  24925. return true;
  24926. for (const param of this.params) {
  24927. if (param.hasEffects(context))
  24928. return true;
  24929. }
  24930. const { ignore, brokenFlow } = context;
  24931. context.ignore = {
  24932. breaks: false,
  24933. continues: false,
  24934. labels: new Set(),
  24935. returnAwaitYield: true
  24936. };
  24937. if (this.body.hasEffects(context))
  24938. return true;
  24939. context.ignore = ignore;
  24940. context.brokenFlow = brokenFlow;
  24941. return false;
  24942. }
  24943. include(context, includeChildrenRecursively) {
  24944. this.included = true;
  24945. for (const param of this.params) {
  24946. if (!(param instanceof Identifier)) {
  24947. param.include(context, includeChildrenRecursively);
  24948. }
  24949. }
  24950. const { brokenFlow } = context;
  24951. context.brokenFlow = BROKEN_FLOW_NONE;
  24952. this.body.include(context, includeChildrenRecursively);
  24953. context.brokenFlow = brokenFlow;
  24954. }
  24955. includeCallArguments(context, args) {
  24956. this.scope.includeCallArguments(context, args);
  24957. }
  24958. initialise() {
  24959. this.scope.addParameterVariables(this.params.map(param => param.declare('parameter', UNKNOWN_EXPRESSION)), this.params[this.params.length - 1] instanceof RestElement);
  24960. if (this.body instanceof BlockStatement) {
  24961. this.body.addImplicitReturnExpressionToScope();
  24962. }
  24963. else {
  24964. this.scope.addReturnExpression(this.body);
  24965. }
  24966. }
  24967. parseNode(esTreeNode) {
  24968. if (esTreeNode.body.type === BlockStatement$1) {
  24969. this.body = new this.context.nodeConstructors.BlockStatement(esTreeNode.body, this, this.scope.hoistedBodyVarScope);
  24970. }
  24971. super.parseNode(esTreeNode);
  24972. }
  24973. }
  24974. ArrowFunctionExpression.prototype.preventChildBlockScope = true;
  24975. class AssignmentExpression extends NodeBase {
  24976. constructor() {
  24977. super(...arguments);
  24978. this.deoptimized = false;
  24979. }
  24980. hasEffects(context) {
  24981. if (!this.deoptimized)
  24982. this.applyDeoptimizations();
  24983. return (this.right.hasEffects(context) ||
  24984. this.left.hasEffects(context) ||
  24985. this.left.hasEffectsWhenAssignedAtPath(EMPTY_PATH, context));
  24986. }
  24987. hasEffectsWhenAccessedAtPath(path, context) {
  24988. return path.length > 0 && this.right.hasEffectsWhenAccessedAtPath(path, context);
  24989. }
  24990. include(context, includeChildrenRecursively) {
  24991. if (!this.deoptimized)
  24992. this.applyDeoptimizations();
  24993. this.included = true;
  24994. let hasEffectsContext;
  24995. if (includeChildrenRecursively ||
  24996. this.operator !== '=' ||
  24997. this.left.included ||
  24998. ((hasEffectsContext = createHasEffectsContext()),
  24999. this.left.hasEffects(hasEffectsContext) ||
  25000. this.left.hasEffectsWhenAssignedAtPath(EMPTY_PATH, hasEffectsContext))) {
  25001. this.left.include(context, includeChildrenRecursively);
  25002. }
  25003. this.right.include(context, includeChildrenRecursively);
  25004. }
  25005. render(code, options, { preventASI, renderedParentType } = BLANK) {
  25006. if (this.left.included) {
  25007. this.left.render(code, options);
  25008. this.right.render(code, options);
  25009. }
  25010. else {
  25011. const inclusionStart = findNonWhiteSpace(code.original, findFirstOccurrenceOutsideComment(code.original, '=', this.left.end) + 1);
  25012. code.remove(this.start, inclusionStart);
  25013. if (preventASI) {
  25014. removeLineBreaks(code, inclusionStart, this.right.start);
  25015. }
  25016. this.right.render(code, options, {
  25017. renderedParentType: renderedParentType || this.parent.type
  25018. });
  25019. }
  25020. if (options.format === 'system') {
  25021. const exportNames = this.left.variable && options.exportNamesByVariable.get(this.left.variable);
  25022. if (this.left.type === 'Identifier' && exportNames) {
  25023. const _ = options.compact ? '' : ' ';
  25024. const operatorPos = findFirstOccurrenceOutsideComment(code.original, this.operator, this.left.end);
  25025. const operation = this.operator.length > 1 ? `${exportNames[0]}${_}${this.operator.slice(0, -1)}${_}` : '';
  25026. code.overwrite(operatorPos, findNonWhiteSpace(code.original, operatorPos + this.operator.length), `=${_}${exportNames.length === 1
  25027. ? `exports('${exportNames[0]}',${_}`
  25028. : getSystemExportFunctionLeft([this.left.variable], false, options)}${operation}`);
  25029. code.appendLeft(this.right.end, ')');
  25030. }
  25031. else {
  25032. const systemPatternExports = [];
  25033. this.left.addExportedVariables(systemPatternExports, options.exportNamesByVariable);
  25034. if (systemPatternExports.length > 0) {
  25035. code.prependRight(this.start, `(${getSystemExportFunctionLeft(systemPatternExports, true, options)}`);
  25036. code.appendLeft(this.end, '))');
  25037. }
  25038. }
  25039. }
  25040. }
  25041. applyDeoptimizations() {
  25042. this.deoptimized = true;
  25043. this.left.deoptimizePath(EMPTY_PATH);
  25044. this.right.deoptimizePath(UNKNOWN_PATH);
  25045. }
  25046. }
  25047. class AssignmentPattern extends NodeBase {
  25048. addExportedVariables(variables, exportNamesByVariable) {
  25049. this.left.addExportedVariables(variables, exportNamesByVariable);
  25050. }
  25051. bind() {
  25052. super.bind();
  25053. this.left.deoptimizePath(EMPTY_PATH);
  25054. this.right.deoptimizePath(UNKNOWN_PATH);
  25055. }
  25056. declare(kind, init) {
  25057. return this.left.declare(kind, init);
  25058. }
  25059. deoptimizePath(path) {
  25060. path.length === 0 && this.left.deoptimizePath(path);
  25061. }
  25062. hasEffectsWhenAssignedAtPath(path, context) {
  25063. return path.length > 0 || this.left.hasEffectsWhenAssignedAtPath(EMPTY_PATH, context);
  25064. }
  25065. render(code, options, { isShorthandProperty } = BLANK) {
  25066. this.left.render(code, options, { isShorthandProperty });
  25067. this.right.render(code, options);
  25068. }
  25069. }
  25070. class AwaitExpression extends NodeBase {
  25071. hasEffects(context) {
  25072. return !context.ignore.returnAwaitYield || this.argument.hasEffects(context);
  25073. }
  25074. include(context, includeChildrenRecursively) {
  25075. if (!this.included) {
  25076. this.included = true;
  25077. checkTopLevelAwait: if (!this.context.usesTopLevelAwait) {
  25078. let parent = this.parent;
  25079. do {
  25080. if (parent instanceof FunctionNode || parent instanceof ArrowFunctionExpression)
  25081. break checkTopLevelAwait;
  25082. } while ((parent = parent.parent));
  25083. this.context.usesTopLevelAwait = true;
  25084. }
  25085. }
  25086. this.argument.include(context, includeChildrenRecursively);
  25087. }
  25088. }
  25089. const binaryOperators = {
  25090. '!=': (left, right) => left != right,
  25091. '!==': (left, right) => left !== right,
  25092. '%': (left, right) => left % right,
  25093. '&': (left, right) => left & right,
  25094. '*': (left, right) => left * right,
  25095. // At the moment, "**" will be transpiled to Math.pow
  25096. '**': (left, right) => left ** right,
  25097. '+': (left, right) => left + right,
  25098. '-': (left, right) => left - right,
  25099. '/': (left, right) => left / right,
  25100. '<': (left, right) => left < right,
  25101. '<<': (left, right) => left << right,
  25102. '<=': (left, right) => left <= right,
  25103. '==': (left, right) => left == right,
  25104. '===': (left, right) => left === right,
  25105. '>': (left, right) => left > right,
  25106. '>=': (left, right) => left >= right,
  25107. '>>': (left, right) => left >> right,
  25108. '>>>': (left, right) => left >>> right,
  25109. '^': (left, right) => left ^ right,
  25110. in: () => UnknownValue,
  25111. instanceof: () => UnknownValue,
  25112. '|': (left, right) => left | right
  25113. };
  25114. class BinaryExpression extends NodeBase {
  25115. deoptimizeCache() { }
  25116. getLiteralValueAtPath(path, recursionTracker, origin) {
  25117. if (path.length > 0)
  25118. return UnknownValue;
  25119. const leftValue = this.left.getLiteralValueAtPath(EMPTY_PATH, recursionTracker, origin);
  25120. if (leftValue === UnknownValue)
  25121. return UnknownValue;
  25122. const rightValue = this.right.getLiteralValueAtPath(EMPTY_PATH, recursionTracker, origin);
  25123. if (rightValue === UnknownValue)
  25124. return UnknownValue;
  25125. const operatorFn = binaryOperators[this.operator];
  25126. if (!operatorFn)
  25127. return UnknownValue;
  25128. return operatorFn(leftValue, rightValue);
  25129. }
  25130. hasEffects(context) {
  25131. // support some implicit type coercion runtime errors
  25132. if (this.operator === '+' &&
  25133. this.parent instanceof ExpressionStatement &&
  25134. this.left.getLiteralValueAtPath(EMPTY_PATH, SHARED_RECURSION_TRACKER, this) === '')
  25135. return true;
  25136. return super.hasEffects(context);
  25137. }
  25138. hasEffectsWhenAccessedAtPath(path) {
  25139. return path.length > 1;
  25140. }
  25141. }
  25142. class BreakStatement extends NodeBase {
  25143. hasEffects(context) {
  25144. if (this.label) {
  25145. if (!context.ignore.labels.has(this.label.name))
  25146. return true;
  25147. context.includedLabels.add(this.label.name);
  25148. context.brokenFlow = BROKEN_FLOW_ERROR_RETURN_LABEL;
  25149. }
  25150. else {
  25151. if (!context.ignore.breaks)
  25152. return true;
  25153. context.brokenFlow = BROKEN_FLOW_BREAK_CONTINUE;
  25154. }
  25155. return false;
  25156. }
  25157. include(context) {
  25158. this.included = true;
  25159. if (this.label) {
  25160. this.label.include();
  25161. context.includedLabels.add(this.label.name);
  25162. }
  25163. context.brokenFlow = this.label ? BROKEN_FLOW_ERROR_RETURN_LABEL : BROKEN_FLOW_BREAK_CONTINUE;
  25164. }
  25165. }
  25166. class Literal extends NodeBase {
  25167. getLiteralValueAtPath(path) {
  25168. if (path.length > 0 ||
  25169. // unknown literals can also be null but do not start with an "n"
  25170. (this.value === null && this.context.code.charCodeAt(this.start) !== 110) ||
  25171. typeof this.value === 'bigint' ||
  25172. // to support shims for regular expressions
  25173. this.context.code.charCodeAt(this.start) === 47) {
  25174. return UnknownValue;
  25175. }
  25176. return this.value;
  25177. }
  25178. getReturnExpressionWhenCalledAtPath(path) {
  25179. if (path.length !== 1)
  25180. return UNKNOWN_EXPRESSION;
  25181. return getMemberReturnExpressionWhenCalled(this.members, path[0]);
  25182. }
  25183. hasEffectsWhenAccessedAtPath(path) {
  25184. if (this.value === null) {
  25185. return path.length > 0;
  25186. }
  25187. return path.length > 1;
  25188. }
  25189. hasEffectsWhenAssignedAtPath(path) {
  25190. return path.length > 0;
  25191. }
  25192. hasEffectsWhenCalledAtPath(path, callOptions, context) {
  25193. if (path.length === 1) {
  25194. return hasMemberEffectWhenCalled(this.members, path[0], this.included, callOptions, context);
  25195. }
  25196. return true;
  25197. }
  25198. initialise() {
  25199. this.members = getLiteralMembersForValue(this.value);
  25200. }
  25201. parseNode(esTreeNode) {
  25202. this.value = esTreeNode.value;
  25203. this.regex = esTreeNode.regex;
  25204. super.parseNode(esTreeNode);
  25205. }
  25206. render(code) {
  25207. if (typeof this.value === 'string') {
  25208. code.indentExclusionRanges.push([this.start + 1, this.end - 1]);
  25209. }
  25210. }
  25211. }
  25212. function getResolvablePropertyKey(memberExpression) {
  25213. return memberExpression.computed
  25214. ? getResolvableComputedPropertyKey(memberExpression.property)
  25215. : memberExpression.property.name;
  25216. }
  25217. function getResolvableComputedPropertyKey(propertyKey) {
  25218. if (propertyKey instanceof Literal) {
  25219. return String(propertyKey.value);
  25220. }
  25221. return null;
  25222. }
  25223. function getPathIfNotComputed(memberExpression) {
  25224. const nextPathKey = memberExpression.propertyKey;
  25225. const object = memberExpression.object;
  25226. if (typeof nextPathKey === 'string') {
  25227. if (object instanceof Identifier) {
  25228. return [
  25229. { key: object.name, pos: object.start },
  25230. { key: nextPathKey, pos: memberExpression.property.start }
  25231. ];
  25232. }
  25233. if (object instanceof MemberExpression) {
  25234. const parentPath = getPathIfNotComputed(object);
  25235. return (parentPath && [...parentPath, { key: nextPathKey, pos: memberExpression.property.start }]);
  25236. }
  25237. }
  25238. return null;
  25239. }
  25240. function getStringFromPath(path) {
  25241. let pathString = path[0].key;
  25242. for (let index = 1; index < path.length; index++) {
  25243. pathString += '.' + path[index].key;
  25244. }
  25245. return pathString;
  25246. }
  25247. class MemberExpression extends NodeBase {
  25248. constructor() {
  25249. super(...arguments);
  25250. this.variable = null;
  25251. this.bound = false;
  25252. this.expressionsToBeDeoptimized = [];
  25253. this.replacement = null;
  25254. this.wasPathDeoptimizedWhileOptimized = false;
  25255. }
  25256. bind() {
  25257. if (this.bound)
  25258. return;
  25259. this.bound = true;
  25260. const path = getPathIfNotComputed(this);
  25261. const baseVariable = path && this.scope.findVariable(path[0].key);
  25262. if (baseVariable && baseVariable.isNamespace) {
  25263. const resolvedVariable = this.resolveNamespaceVariables(baseVariable, path.slice(1));
  25264. if (!resolvedVariable) {
  25265. super.bind();
  25266. }
  25267. else if (typeof resolvedVariable === 'string') {
  25268. this.replacement = resolvedVariable;
  25269. }
  25270. else {
  25271. this.variable = resolvedVariable;
  25272. this.scope.addNamespaceMemberAccess(getStringFromPath(path), resolvedVariable);
  25273. }
  25274. }
  25275. else {
  25276. super.bind();
  25277. // ensure the propertyKey is set for the tree-shaking passes
  25278. this.getPropertyKey();
  25279. }
  25280. }
  25281. deoptimizeCache() {
  25282. const expressionsToBeDeoptimized = this.expressionsToBeDeoptimized;
  25283. this.expressionsToBeDeoptimized = [];
  25284. this.propertyKey = UnknownKey;
  25285. if (this.wasPathDeoptimizedWhileOptimized) {
  25286. this.object.deoptimizePath(UNKNOWN_PATH);
  25287. }
  25288. for (const expression of expressionsToBeDeoptimized) {
  25289. expression.deoptimizeCache();
  25290. }
  25291. }
  25292. deoptimizePath(path) {
  25293. if (!this.bound)
  25294. this.bind();
  25295. if (path.length === 0)
  25296. this.disallowNamespaceReassignment();
  25297. if (this.variable) {
  25298. this.variable.deoptimizePath(path);
  25299. }
  25300. else {
  25301. const propertyKey = this.getPropertyKey();
  25302. if (propertyKey === UnknownKey) {
  25303. this.object.deoptimizePath(UNKNOWN_PATH);
  25304. }
  25305. else {
  25306. this.wasPathDeoptimizedWhileOptimized = true;
  25307. this.object.deoptimizePath([propertyKey, ...path]);
  25308. }
  25309. }
  25310. }
  25311. getLiteralValueAtPath(path, recursionTracker, origin) {
  25312. if (!this.bound)
  25313. this.bind();
  25314. if (this.variable !== null) {
  25315. return this.variable.getLiteralValueAtPath(path, recursionTracker, origin);
  25316. }
  25317. this.expressionsToBeDeoptimized.push(origin);
  25318. return this.object.getLiteralValueAtPath([this.getPropertyKey(), ...path], recursionTracker, origin);
  25319. }
  25320. getReturnExpressionWhenCalledAtPath(path, recursionTracker, origin) {
  25321. if (!this.bound)
  25322. this.bind();
  25323. if (this.variable !== null) {
  25324. return this.variable.getReturnExpressionWhenCalledAtPath(path, recursionTracker, origin);
  25325. }
  25326. this.expressionsToBeDeoptimized.push(origin);
  25327. return this.object.getReturnExpressionWhenCalledAtPath([this.getPropertyKey(), ...path], recursionTracker, origin);
  25328. }
  25329. hasEffects(context) {
  25330. const propertyReadSideEffects = this.context.options.treeshake
  25331. .propertyReadSideEffects;
  25332. return (propertyReadSideEffects === 'always' ||
  25333. this.property.hasEffects(context) ||
  25334. this.object.hasEffects(context) ||
  25335. (propertyReadSideEffects &&
  25336. this.object.hasEffectsWhenAccessedAtPath([this.propertyKey], context)));
  25337. }
  25338. hasEffectsWhenAccessedAtPath(path, context) {
  25339. if (path.length === 0)
  25340. return false;
  25341. if (this.variable !== null) {
  25342. return this.variable.hasEffectsWhenAccessedAtPath(path, context);
  25343. }
  25344. return this.object.hasEffectsWhenAccessedAtPath([this.propertyKey, ...path], context);
  25345. }
  25346. hasEffectsWhenAssignedAtPath(path, context) {
  25347. if (this.variable !== null) {
  25348. return this.variable.hasEffectsWhenAssignedAtPath(path, context);
  25349. }
  25350. return this.object.hasEffectsWhenAssignedAtPath([this.propertyKey, ...path], context);
  25351. }
  25352. hasEffectsWhenCalledAtPath(path, callOptions, context) {
  25353. if (this.variable !== null) {
  25354. return this.variable.hasEffectsWhenCalledAtPath(path, callOptions, context);
  25355. }
  25356. return this.object.hasEffectsWhenCalledAtPath([this.propertyKey, ...path], callOptions, context);
  25357. }
  25358. include(context, includeChildrenRecursively) {
  25359. if (!this.included) {
  25360. this.included = true;
  25361. if (this.variable !== null) {
  25362. this.context.includeVariableInModule(this.variable);
  25363. }
  25364. }
  25365. this.object.include(context, includeChildrenRecursively);
  25366. this.property.include(context, includeChildrenRecursively);
  25367. }
  25368. includeCallArguments(context, args) {
  25369. if (this.variable) {
  25370. this.variable.includeCallArguments(context, args);
  25371. }
  25372. else {
  25373. super.includeCallArguments(context, args);
  25374. }
  25375. }
  25376. initialise() {
  25377. this.propertyKey = getResolvablePropertyKey(this);
  25378. }
  25379. render(code, options, { renderedParentType, isCalleeOfRenderedParent, renderedSurroundingElement } = BLANK) {
  25380. const isCalleeOfDifferentParent = renderedParentType === CallExpression$1 && isCalleeOfRenderedParent;
  25381. if (this.variable || this.replacement) {
  25382. let replacement = this.variable ? this.variable.getName() : this.replacement;
  25383. if (isCalleeOfDifferentParent)
  25384. replacement = '0, ' + replacement;
  25385. code.overwrite(this.start, this.end, replacement, {
  25386. contentOnly: true,
  25387. storeName: true
  25388. });
  25389. }
  25390. else {
  25391. if (isCalleeOfDifferentParent) {
  25392. code.appendRight(this.start, '0, ');
  25393. }
  25394. const surroundingElement = renderedParentType || renderedSurroundingElement;
  25395. this.object.render(code, options, surroundingElement ? { renderedSurroundingElement: surroundingElement } : BLANK);
  25396. this.property.render(code, options);
  25397. }
  25398. }
  25399. disallowNamespaceReassignment() {
  25400. if (this.object instanceof Identifier) {
  25401. const variable = this.scope.findVariable(this.object.name);
  25402. if (variable.isNamespace) {
  25403. if (this.variable) {
  25404. this.context.includeVariableInModule(this.variable);
  25405. }
  25406. this.context.warn({
  25407. code: 'ILLEGAL_NAMESPACE_REASSIGNMENT',
  25408. message: `Illegal reassignment to import '${this.object.name}'`
  25409. }, this.start);
  25410. }
  25411. }
  25412. }
  25413. getPropertyKey() {
  25414. if (this.propertyKey === null) {
  25415. this.propertyKey = UnknownKey;
  25416. const value = this.property.getLiteralValueAtPath(EMPTY_PATH, SHARED_RECURSION_TRACKER, this);
  25417. return (this.propertyKey = value === UnknownValue ? UnknownKey : String(value));
  25418. }
  25419. return this.propertyKey;
  25420. }
  25421. resolveNamespaceVariables(baseVariable, path) {
  25422. if (path.length === 0)
  25423. return baseVariable;
  25424. if (!baseVariable.isNamespace || baseVariable instanceof ExternalVariable)
  25425. return null;
  25426. const exportName = path[0].key;
  25427. const variable = baseVariable.context.traceExport(exportName);
  25428. if (!variable) {
  25429. const fileName = baseVariable.context.fileName;
  25430. this.context.warn({
  25431. code: 'MISSING_EXPORT',
  25432. exporter: relativeId(fileName),
  25433. importer: relativeId(this.context.fileName),
  25434. message: `'${exportName}' is not exported by '${relativeId(fileName)}'`,
  25435. missing: exportName,
  25436. url: `https://rollupjs.org/guide/en/#error-name-is-not-exported-by-module`
  25437. }, path[0].pos);
  25438. return 'undefined';
  25439. }
  25440. return this.resolveNamespaceVariables(variable, path.slice(1));
  25441. }
  25442. }
  25443. class CallExpression extends NodeBase {
  25444. constructor() {
  25445. super(...arguments);
  25446. this.expressionsToBeDeoptimized = [];
  25447. this.returnExpression = null;
  25448. this.wasPathDeoptmizedWhileOptimized = false;
  25449. }
  25450. bind() {
  25451. super.bind();
  25452. if (this.callee instanceof Identifier) {
  25453. const variable = this.scope.findVariable(this.callee.name);
  25454. if (variable.isNamespace) {
  25455. this.context.warn({
  25456. code: 'CANNOT_CALL_NAMESPACE',
  25457. message: `Cannot call a namespace ('${this.callee.name}')`
  25458. }, this.start);
  25459. }
  25460. if (this.callee.name === 'eval') {
  25461. this.context.warn({
  25462. code: 'EVAL',
  25463. message: `Use of eval is strongly discouraged, as it poses security risks and may cause issues with minification`,
  25464. url: 'https://rollupjs.org/guide/en/#avoiding-eval'
  25465. }, this.start);
  25466. }
  25467. }
  25468. // ensure the returnExpression is set for the tree-shaking passes
  25469. this.getReturnExpression(SHARED_RECURSION_TRACKER);
  25470. // This deoptimizes "this" for non-namespace calls until we have a better solution
  25471. if (this.callee instanceof MemberExpression && !this.callee.variable) {
  25472. this.callee.object.deoptimizePath(UNKNOWN_PATH);
  25473. }
  25474. for (const argument of this.arguments) {
  25475. // This will make sure all properties of parameters behave as "unknown"
  25476. argument.deoptimizePath(UNKNOWN_PATH);
  25477. }
  25478. }
  25479. deoptimizeCache() {
  25480. if (this.returnExpression !== UNKNOWN_EXPRESSION) {
  25481. this.returnExpression = null;
  25482. const returnExpression = this.getReturnExpression(SHARED_RECURSION_TRACKER);
  25483. const expressionsToBeDeoptimized = this.expressionsToBeDeoptimized;
  25484. if (returnExpression !== UNKNOWN_EXPRESSION) {
  25485. // We need to replace here because is possible new expressions are added
  25486. // while we are deoptimizing the old ones
  25487. this.expressionsToBeDeoptimized = [];
  25488. if (this.wasPathDeoptmizedWhileOptimized) {
  25489. returnExpression.deoptimizePath(UNKNOWN_PATH);
  25490. this.wasPathDeoptmizedWhileOptimized = false;
  25491. }
  25492. }
  25493. for (const expression of expressionsToBeDeoptimized) {
  25494. expression.deoptimizeCache();
  25495. }
  25496. }
  25497. }
  25498. deoptimizePath(path) {
  25499. if (path.length === 0)
  25500. return;
  25501. const trackedEntities = this.context.deoptimizationTracker.getEntities(path);
  25502. if (trackedEntities.has(this))
  25503. return;
  25504. trackedEntities.add(this);
  25505. const returnExpression = this.getReturnExpression(SHARED_RECURSION_TRACKER);
  25506. if (returnExpression !== UNKNOWN_EXPRESSION) {
  25507. this.wasPathDeoptmizedWhileOptimized = true;
  25508. returnExpression.deoptimizePath(path);
  25509. }
  25510. }
  25511. getLiteralValueAtPath(path, recursionTracker, origin) {
  25512. const returnExpression = this.getReturnExpression(recursionTracker);
  25513. if (returnExpression === UNKNOWN_EXPRESSION) {
  25514. return UnknownValue;
  25515. }
  25516. const trackedEntities = recursionTracker.getEntities(path);
  25517. if (trackedEntities.has(returnExpression)) {
  25518. return UnknownValue;
  25519. }
  25520. this.expressionsToBeDeoptimized.push(origin);
  25521. trackedEntities.add(returnExpression);
  25522. const value = returnExpression.getLiteralValueAtPath(path, recursionTracker, origin);
  25523. trackedEntities.delete(returnExpression);
  25524. return value;
  25525. }
  25526. getReturnExpressionWhenCalledAtPath(path, recursionTracker, origin) {
  25527. const returnExpression = this.getReturnExpression(recursionTracker);
  25528. if (this.returnExpression === UNKNOWN_EXPRESSION) {
  25529. return UNKNOWN_EXPRESSION;
  25530. }
  25531. const trackedEntities = recursionTracker.getEntities(path);
  25532. if (trackedEntities.has(returnExpression)) {
  25533. return UNKNOWN_EXPRESSION;
  25534. }
  25535. this.expressionsToBeDeoptimized.push(origin);
  25536. trackedEntities.add(returnExpression);
  25537. const value = returnExpression.getReturnExpressionWhenCalledAtPath(path, recursionTracker, origin);
  25538. trackedEntities.delete(returnExpression);
  25539. return value;
  25540. }
  25541. hasEffects(context) {
  25542. var _a;
  25543. for (const argument of this.arguments) {
  25544. if (argument.hasEffects(context))
  25545. return true;
  25546. }
  25547. if (this.context.options.treeshake.annotations && ((_a = this.annotations) === null || _a === void 0 ? void 0 : _a.some((a) => a.pure)))
  25548. return false;
  25549. return (this.callee.hasEffects(context) ||
  25550. this.callee.hasEffectsWhenCalledAtPath(EMPTY_PATH, this.callOptions, context));
  25551. }
  25552. hasEffectsWhenAccessedAtPath(path, context) {
  25553. if (path.length === 0)
  25554. return false;
  25555. const trackedExpressions = context.accessed.getEntities(path);
  25556. if (trackedExpressions.has(this))
  25557. return false;
  25558. trackedExpressions.add(this);
  25559. return this.returnExpression.hasEffectsWhenAccessedAtPath(path, context);
  25560. }
  25561. hasEffectsWhenAssignedAtPath(path, context) {
  25562. if (path.length === 0)
  25563. return true;
  25564. const trackedExpressions = context.assigned.getEntities(path);
  25565. if (trackedExpressions.has(this))
  25566. return false;
  25567. trackedExpressions.add(this);
  25568. return this.returnExpression.hasEffectsWhenAssignedAtPath(path, context);
  25569. }
  25570. hasEffectsWhenCalledAtPath(path, callOptions, context) {
  25571. const trackedExpressions = (callOptions.withNew
  25572. ? context.instantiated
  25573. : context.called).getEntities(path, callOptions);
  25574. if (trackedExpressions.has(this))
  25575. return false;
  25576. trackedExpressions.add(this);
  25577. return this.returnExpression.hasEffectsWhenCalledAtPath(path, callOptions, context);
  25578. }
  25579. include(context, includeChildrenRecursively) {
  25580. if (includeChildrenRecursively) {
  25581. super.include(context, includeChildrenRecursively);
  25582. if (includeChildrenRecursively === INCLUDE_PARAMETERS &&
  25583. this.callee instanceof Identifier &&
  25584. this.callee.variable) {
  25585. this.callee.variable.markCalledFromTryStatement();
  25586. }
  25587. }
  25588. else {
  25589. this.included = true;
  25590. this.callee.include(context, false);
  25591. }
  25592. this.callee.includeCallArguments(context, this.arguments);
  25593. if (!this.returnExpression.included) {
  25594. this.returnExpression.include(context, false);
  25595. }
  25596. }
  25597. initialise() {
  25598. this.callOptions = {
  25599. args: this.arguments,
  25600. withNew: false
  25601. };
  25602. }
  25603. render(code, options, { renderedParentType, renderedSurroundingElement } = BLANK) {
  25604. const surroundingELement = renderedParentType || renderedSurroundingElement;
  25605. this.callee.render(code, options, surroundingELement ? { renderedSurroundingElement: surroundingELement } : BLANK);
  25606. if (this.arguments.length > 0) {
  25607. if (this.arguments[this.arguments.length - 1].included) {
  25608. for (const arg of this.arguments) {
  25609. arg.render(code, options);
  25610. }
  25611. }
  25612. else {
  25613. let lastIncludedIndex = this.arguments.length - 2;
  25614. while (lastIncludedIndex >= 0 && !this.arguments[lastIncludedIndex].included) {
  25615. lastIncludedIndex--;
  25616. }
  25617. if (lastIncludedIndex >= 0) {
  25618. for (let index = 0; index <= lastIncludedIndex; index++) {
  25619. this.arguments[index].render(code, options);
  25620. }
  25621. code.remove(findFirstOccurrenceOutsideComment(code.original, ',', this.arguments[lastIncludedIndex].end), this.end - 1);
  25622. }
  25623. else {
  25624. code.remove(findFirstOccurrenceOutsideComment(code.original, '(', this.callee.end) + 1, this.end - 1);
  25625. }
  25626. }
  25627. }
  25628. }
  25629. getReturnExpression(recursionTracker) {
  25630. if (this.returnExpression === null) {
  25631. this.returnExpression = UNKNOWN_EXPRESSION;
  25632. return (this.returnExpression = this.callee.getReturnExpressionWhenCalledAtPath(EMPTY_PATH, recursionTracker, this));
  25633. }
  25634. return this.returnExpression;
  25635. }
  25636. }
  25637. class CatchScope extends ParameterScope {
  25638. addDeclaration(identifier, context, init, isHoisted) {
  25639. if (isHoisted) {
  25640. return this.parent.addDeclaration(identifier, context, init, isHoisted);
  25641. }
  25642. else {
  25643. return super.addDeclaration(identifier, context, init, false);
  25644. }
  25645. }
  25646. }
  25647. class CatchClause extends NodeBase {
  25648. createScope(parentScope) {
  25649. this.scope = new CatchScope(parentScope, this.context);
  25650. }
  25651. initialise() {
  25652. if (this.param) {
  25653. this.param.declare('parameter', UNKNOWN_EXPRESSION);
  25654. }
  25655. }
  25656. parseNode(esTreeNode) {
  25657. this.body = new this.context.nodeConstructors.BlockStatement(esTreeNode.body, this, this.scope);
  25658. super.parseNode(esTreeNode);
  25659. }
  25660. }
  25661. CatchClause.prototype.preventChildBlockScope = true;
  25662. class ChainExpression extends NodeBase {
  25663. }
  25664. class ClassBodyScope extends ChildScope {
  25665. findLexicalBoundary() {
  25666. return this;
  25667. }
  25668. }
  25669. class MethodDefinition extends NodeBase {
  25670. hasEffects(context) {
  25671. return this.key.hasEffects(context);
  25672. }
  25673. hasEffectsWhenCalledAtPath(path, callOptions, context) {
  25674. return (path.length > 0 || this.value.hasEffectsWhenCalledAtPath(EMPTY_PATH, callOptions, context));
  25675. }
  25676. }
  25677. class ClassBody extends NodeBase {
  25678. createScope(parentScope) {
  25679. this.scope = new ClassBodyScope(parentScope);
  25680. }
  25681. hasEffectsWhenCalledAtPath(path, callOptions, context) {
  25682. if (path.length > 0)
  25683. return true;
  25684. return (this.classConstructor !== null &&
  25685. this.classConstructor.hasEffectsWhenCalledAtPath(EMPTY_PATH, callOptions, context));
  25686. }
  25687. initialise() {
  25688. for (const method of this.body) {
  25689. if (method instanceof MethodDefinition && method.kind === 'constructor') {
  25690. this.classConstructor = method;
  25691. return;
  25692. }
  25693. }
  25694. this.classConstructor = null;
  25695. }
  25696. }
  25697. class ClassExpression extends ClassNode {
  25698. render(code, options, { renderedParentType, renderedSurroundingElement } = BLANK) {
  25699. super.render(code, options);
  25700. const surroundingElement = renderedParentType || renderedSurroundingElement;
  25701. if (surroundingElement === ExpressionStatement$1) {
  25702. code.appendRight(this.start, '(');
  25703. code.prependLeft(this.end, ')');
  25704. }
  25705. }
  25706. }
  25707. class MultiExpression {
  25708. constructor(expressions) {
  25709. this.included = false;
  25710. this.expressions = expressions;
  25711. }
  25712. deoptimizePath(path) {
  25713. for (const expression of this.expressions) {
  25714. expression.deoptimizePath(path);
  25715. }
  25716. }
  25717. getLiteralValueAtPath() {
  25718. return UnknownValue;
  25719. }
  25720. getReturnExpressionWhenCalledAtPath(path, recursionTracker, origin) {
  25721. return new MultiExpression(this.expressions.map(expression => expression.getReturnExpressionWhenCalledAtPath(path, recursionTracker, origin)));
  25722. }
  25723. hasEffectsWhenAccessedAtPath(path, context) {
  25724. for (const expression of this.expressions) {
  25725. if (expression.hasEffectsWhenAccessedAtPath(path, context))
  25726. return true;
  25727. }
  25728. return false;
  25729. }
  25730. hasEffectsWhenAssignedAtPath(path, context) {
  25731. for (const expression of this.expressions) {
  25732. if (expression.hasEffectsWhenAssignedAtPath(path, context))
  25733. return true;
  25734. }
  25735. return false;
  25736. }
  25737. hasEffectsWhenCalledAtPath(path, callOptions, context) {
  25738. for (const expression of this.expressions) {
  25739. if (expression.hasEffectsWhenCalledAtPath(path, callOptions, context))
  25740. return true;
  25741. }
  25742. return false;
  25743. }
  25744. include(context, includeChildrenRecursively) {
  25745. // This is only relevant to include values that do not have an AST representation,
  25746. // such as UnknownArrayExpression. Thus we only need to include them once.
  25747. for (const expression of this.expressions) {
  25748. if (!expression.included) {
  25749. expression.include(context, includeChildrenRecursively);
  25750. }
  25751. }
  25752. }
  25753. includeCallArguments() { }
  25754. }
  25755. class ConditionalExpression extends NodeBase {
  25756. constructor() {
  25757. super(...arguments);
  25758. this.expressionsToBeDeoptimized = [];
  25759. this.isBranchResolutionAnalysed = false;
  25760. this.usedBranch = null;
  25761. this.wasPathDeoptimizedWhileOptimized = false;
  25762. }
  25763. bind() {
  25764. super.bind();
  25765. // ensure the usedBranch is set for the tree-shaking passes
  25766. this.getUsedBranch();
  25767. }
  25768. deoptimizeCache() {
  25769. if (this.usedBranch !== null) {
  25770. const unusedBranch = this.usedBranch === this.consequent ? this.alternate : this.consequent;
  25771. this.usedBranch = null;
  25772. const expressionsToBeDeoptimized = this.expressionsToBeDeoptimized;
  25773. this.expressionsToBeDeoptimized = [];
  25774. if (this.wasPathDeoptimizedWhileOptimized) {
  25775. unusedBranch.deoptimizePath(UNKNOWN_PATH);
  25776. }
  25777. for (const expression of expressionsToBeDeoptimized) {
  25778. expression.deoptimizeCache();
  25779. }
  25780. }
  25781. }
  25782. deoptimizePath(path) {
  25783. if (path.length > 0) {
  25784. const usedBranch = this.getUsedBranch();
  25785. if (usedBranch === null) {
  25786. this.consequent.deoptimizePath(path);
  25787. this.alternate.deoptimizePath(path);
  25788. }
  25789. else {
  25790. this.wasPathDeoptimizedWhileOptimized = true;
  25791. usedBranch.deoptimizePath(path);
  25792. }
  25793. }
  25794. }
  25795. getLiteralValueAtPath(path, recursionTracker, origin) {
  25796. const usedBranch = this.getUsedBranch();
  25797. if (usedBranch === null)
  25798. return UnknownValue;
  25799. this.expressionsToBeDeoptimized.push(origin);
  25800. return usedBranch.getLiteralValueAtPath(path, recursionTracker, origin);
  25801. }
  25802. getReturnExpressionWhenCalledAtPath(path, recursionTracker, origin) {
  25803. const usedBranch = this.getUsedBranch();
  25804. if (usedBranch === null)
  25805. return new MultiExpression([
  25806. this.consequent.getReturnExpressionWhenCalledAtPath(path, recursionTracker, origin),
  25807. this.alternate.getReturnExpressionWhenCalledAtPath(path, recursionTracker, origin)
  25808. ]);
  25809. this.expressionsToBeDeoptimized.push(origin);
  25810. return usedBranch.getReturnExpressionWhenCalledAtPath(path, recursionTracker, origin);
  25811. }
  25812. hasEffects(context) {
  25813. if (this.test.hasEffects(context))
  25814. return true;
  25815. if (this.usedBranch === null) {
  25816. return this.consequent.hasEffects(context) || this.alternate.hasEffects(context);
  25817. }
  25818. return this.usedBranch.hasEffects(context);
  25819. }
  25820. hasEffectsWhenAccessedAtPath(path, context) {
  25821. if (path.length === 0)
  25822. return false;
  25823. if (this.usedBranch === null) {
  25824. return (this.consequent.hasEffectsWhenAccessedAtPath(path, context) ||
  25825. this.alternate.hasEffectsWhenAccessedAtPath(path, context));
  25826. }
  25827. return this.usedBranch.hasEffectsWhenAccessedAtPath(path, context);
  25828. }
  25829. hasEffectsWhenAssignedAtPath(path, context) {
  25830. if (path.length === 0)
  25831. return true;
  25832. if (this.usedBranch === null) {
  25833. return (this.consequent.hasEffectsWhenAssignedAtPath(path, context) ||
  25834. this.alternate.hasEffectsWhenAssignedAtPath(path, context));
  25835. }
  25836. return this.usedBranch.hasEffectsWhenAssignedAtPath(path, context);
  25837. }
  25838. hasEffectsWhenCalledAtPath(path, callOptions, context) {
  25839. if (this.usedBranch === null) {
  25840. return (this.consequent.hasEffectsWhenCalledAtPath(path, callOptions, context) ||
  25841. this.alternate.hasEffectsWhenCalledAtPath(path, callOptions, context));
  25842. }
  25843. return this.usedBranch.hasEffectsWhenCalledAtPath(path, callOptions, context);
  25844. }
  25845. include(context, includeChildrenRecursively) {
  25846. this.included = true;
  25847. if (includeChildrenRecursively ||
  25848. this.test.shouldBeIncluded(context) ||
  25849. this.usedBranch === null) {
  25850. this.test.include(context, includeChildrenRecursively);
  25851. this.consequent.include(context, includeChildrenRecursively);
  25852. this.alternate.include(context, includeChildrenRecursively);
  25853. }
  25854. else {
  25855. this.usedBranch.include(context, includeChildrenRecursively);
  25856. }
  25857. }
  25858. includeCallArguments(context, args) {
  25859. if (this.usedBranch === null) {
  25860. this.consequent.includeCallArguments(context, args);
  25861. this.alternate.includeCallArguments(context, args);
  25862. }
  25863. else {
  25864. this.usedBranch.includeCallArguments(context, args);
  25865. }
  25866. }
  25867. render(code, options, { renderedParentType, isCalleeOfRenderedParent, preventASI } = BLANK) {
  25868. if (!this.test.included) {
  25869. const colonPos = findFirstOccurrenceOutsideComment(code.original, ':', this.consequent.end);
  25870. const inclusionStart = findNonWhiteSpace(code.original, (this.consequent.included
  25871. ? findFirstOccurrenceOutsideComment(code.original, '?', this.test.end)
  25872. : colonPos) + 1);
  25873. if (preventASI) {
  25874. removeLineBreaks(code, inclusionStart, this.usedBranch.start);
  25875. }
  25876. code.remove(this.start, inclusionStart);
  25877. if (this.consequent.included) {
  25878. code.remove(colonPos, this.end);
  25879. }
  25880. removeAnnotations(this, code);
  25881. this.usedBranch.render(code, options, {
  25882. isCalleeOfRenderedParent: renderedParentType
  25883. ? isCalleeOfRenderedParent
  25884. : this.parent.callee === this,
  25885. preventASI: true,
  25886. renderedParentType: renderedParentType || this.parent.type
  25887. });
  25888. }
  25889. else {
  25890. super.render(code, options);
  25891. }
  25892. }
  25893. getUsedBranch() {
  25894. if (this.isBranchResolutionAnalysed) {
  25895. return this.usedBranch;
  25896. }
  25897. this.isBranchResolutionAnalysed = true;
  25898. const testValue = this.test.getLiteralValueAtPath(EMPTY_PATH, SHARED_RECURSION_TRACKER, this);
  25899. return testValue === UnknownValue
  25900. ? null
  25901. : (this.usedBranch = testValue ? this.consequent : this.alternate);
  25902. }
  25903. }
  25904. class ContinueStatement extends NodeBase {
  25905. hasEffects(context) {
  25906. if (this.label) {
  25907. if (!context.ignore.labels.has(this.label.name))
  25908. return true;
  25909. context.includedLabels.add(this.label.name);
  25910. context.brokenFlow = BROKEN_FLOW_ERROR_RETURN_LABEL;
  25911. }
  25912. else {
  25913. if (!context.ignore.continues)
  25914. return true;
  25915. context.brokenFlow = BROKEN_FLOW_BREAK_CONTINUE;
  25916. }
  25917. return false;
  25918. }
  25919. include(context) {
  25920. this.included = true;
  25921. if (this.label) {
  25922. this.label.include();
  25923. context.includedLabels.add(this.label.name);
  25924. }
  25925. context.brokenFlow = this.label ? BROKEN_FLOW_ERROR_RETURN_LABEL : BROKEN_FLOW_BREAK_CONTINUE;
  25926. }
  25927. }
  25928. class DoWhileStatement extends NodeBase {
  25929. hasEffects(context) {
  25930. if (this.test.hasEffects(context))
  25931. return true;
  25932. const { brokenFlow, ignore: { breaks, continues } } = context;
  25933. context.ignore.breaks = true;
  25934. context.ignore.continues = true;
  25935. if (this.body.hasEffects(context))
  25936. return true;
  25937. context.ignore.breaks = breaks;
  25938. context.ignore.continues = continues;
  25939. context.brokenFlow = brokenFlow;
  25940. return false;
  25941. }
  25942. include(context, includeChildrenRecursively) {
  25943. this.included = true;
  25944. this.test.include(context, includeChildrenRecursively);
  25945. const { brokenFlow } = context;
  25946. this.body.includeAsSingleStatement(context, includeChildrenRecursively);
  25947. context.brokenFlow = brokenFlow;
  25948. }
  25949. }
  25950. class EmptyStatement extends NodeBase {
  25951. hasEffects() {
  25952. return false;
  25953. }
  25954. }
  25955. class ExportNamedDeclaration extends NodeBase {
  25956. bind() {
  25957. // Do not bind specifiers
  25958. if (this.declaration !== null)
  25959. this.declaration.bind();
  25960. }
  25961. hasEffects(context) {
  25962. return this.declaration !== null && this.declaration.hasEffects(context);
  25963. }
  25964. initialise() {
  25965. this.context.addExport(this);
  25966. }
  25967. render(code, options, nodeRenderOptions) {
  25968. const { start, end } = nodeRenderOptions;
  25969. if (this.declaration === null) {
  25970. code.remove(start, end);
  25971. }
  25972. else {
  25973. code.remove(this.start, this.declaration.start);
  25974. this.declaration.render(code, options, { start, end });
  25975. }
  25976. }
  25977. }
  25978. ExportNamedDeclaration.prototype.needsBoundaries = true;
  25979. class ExportSpecifier extends NodeBase {
  25980. }
  25981. class ForInStatement extends NodeBase {
  25982. bind() {
  25983. this.left.bind();
  25984. this.left.deoptimizePath(EMPTY_PATH);
  25985. this.right.bind();
  25986. this.body.bind();
  25987. }
  25988. createScope(parentScope) {
  25989. this.scope = new BlockScope(parentScope);
  25990. }
  25991. hasEffects(context) {
  25992. if ((this.left &&
  25993. (this.left.hasEffects(context) ||
  25994. this.left.hasEffectsWhenAssignedAtPath(EMPTY_PATH, context))) ||
  25995. (this.right && this.right.hasEffects(context)))
  25996. return true;
  25997. const { brokenFlow, ignore: { breaks, continues } } = context;
  25998. context.ignore.breaks = true;
  25999. context.ignore.continues = true;
  26000. if (this.body.hasEffects(context))
  26001. return true;
  26002. context.ignore.breaks = breaks;
  26003. context.ignore.continues = continues;
  26004. context.brokenFlow = brokenFlow;
  26005. return false;
  26006. }
  26007. include(context, includeChildrenRecursively) {
  26008. this.included = true;
  26009. this.left.include(context, includeChildrenRecursively || true);
  26010. this.left.deoptimizePath(EMPTY_PATH);
  26011. this.right.include(context, includeChildrenRecursively);
  26012. const { brokenFlow } = context;
  26013. this.body.includeAsSingleStatement(context, includeChildrenRecursively);
  26014. context.brokenFlow = brokenFlow;
  26015. }
  26016. render(code, options) {
  26017. this.left.render(code, options, NO_SEMICOLON);
  26018. this.right.render(code, options, NO_SEMICOLON);
  26019. // handle no space between "in" and the right side
  26020. if (code.original.charCodeAt(this.right.start - 1) === 110 /* n */) {
  26021. code.prependLeft(this.right.start, ' ');
  26022. }
  26023. this.body.render(code, options);
  26024. }
  26025. }
  26026. class ForOfStatement extends NodeBase {
  26027. bind() {
  26028. this.left.bind();
  26029. this.left.deoptimizePath(EMPTY_PATH);
  26030. this.right.bind();
  26031. this.body.bind();
  26032. }
  26033. createScope(parentScope) {
  26034. this.scope = new BlockScope(parentScope);
  26035. }
  26036. hasEffects() {
  26037. // Placeholder until proper Symbol.Iterator support
  26038. return true;
  26039. }
  26040. include(context, includeChildrenRecursively) {
  26041. this.included = true;
  26042. this.left.include(context, includeChildrenRecursively || true);
  26043. this.left.deoptimizePath(EMPTY_PATH);
  26044. this.right.include(context, includeChildrenRecursively);
  26045. const { brokenFlow } = context;
  26046. this.body.includeAsSingleStatement(context, includeChildrenRecursively);
  26047. context.brokenFlow = brokenFlow;
  26048. }
  26049. render(code, options) {
  26050. this.left.render(code, options, NO_SEMICOLON);
  26051. this.right.render(code, options, NO_SEMICOLON);
  26052. // handle no space between "of" and the right side
  26053. if (code.original.charCodeAt(this.right.start - 1) === 102 /* f */) {
  26054. code.prependLeft(this.right.start, ' ');
  26055. }
  26056. this.body.render(code, options);
  26057. }
  26058. }
  26059. class ForStatement extends NodeBase {
  26060. createScope(parentScope) {
  26061. this.scope = new BlockScope(parentScope);
  26062. }
  26063. hasEffects(context) {
  26064. if ((this.init && this.init.hasEffects(context)) ||
  26065. (this.test && this.test.hasEffects(context)) ||
  26066. (this.update && this.update.hasEffects(context)))
  26067. return true;
  26068. const { brokenFlow, ignore: { breaks, continues } } = context;
  26069. context.ignore.breaks = true;
  26070. context.ignore.continues = true;
  26071. if (this.body.hasEffects(context))
  26072. return true;
  26073. context.ignore.breaks = breaks;
  26074. context.ignore.continues = continues;
  26075. context.brokenFlow = brokenFlow;
  26076. return false;
  26077. }
  26078. include(context, includeChildrenRecursively) {
  26079. this.included = true;
  26080. if (this.init)
  26081. this.init.includeAsSingleStatement(context, includeChildrenRecursively);
  26082. if (this.test)
  26083. this.test.include(context, includeChildrenRecursively);
  26084. const { brokenFlow } = context;
  26085. if (this.update)
  26086. this.update.include(context, includeChildrenRecursively);
  26087. this.body.includeAsSingleStatement(context, includeChildrenRecursively);
  26088. context.brokenFlow = brokenFlow;
  26089. }
  26090. render(code, options) {
  26091. if (this.init)
  26092. this.init.render(code, options, NO_SEMICOLON);
  26093. if (this.test)
  26094. this.test.render(code, options, NO_SEMICOLON);
  26095. if (this.update)
  26096. this.update.render(code, options, NO_SEMICOLON);
  26097. this.body.render(code, options);
  26098. }
  26099. }
  26100. class FunctionExpression extends FunctionNode {
  26101. render(code, options, { renderedParentType, renderedSurroundingElement } = BLANK) {
  26102. super.render(code, options);
  26103. const surroundingElement = renderedParentType || renderedSurroundingElement;
  26104. if (surroundingElement === ExpressionStatement$1) {
  26105. code.appendRight(this.start, '(');
  26106. code.prependLeft(this.end, ')');
  26107. }
  26108. }
  26109. }
  26110. class TrackingScope extends BlockScope {
  26111. constructor() {
  26112. super(...arguments);
  26113. this.hoistedDeclarations = [];
  26114. }
  26115. addDeclaration(identifier, context, init, isHoisted) {
  26116. this.hoistedDeclarations.push(identifier);
  26117. return this.parent.addDeclaration(identifier, context, init, isHoisted);
  26118. }
  26119. }
  26120. const unset = Symbol('unset');
  26121. class IfStatement extends NodeBase {
  26122. constructor() {
  26123. super(...arguments);
  26124. this.testValue = unset;
  26125. }
  26126. deoptimizeCache() {
  26127. this.testValue = UnknownValue;
  26128. }
  26129. hasEffects(context) {
  26130. if (this.test.hasEffects(context)) {
  26131. return true;
  26132. }
  26133. const testValue = this.getTestValue();
  26134. if (testValue === UnknownValue) {
  26135. const { brokenFlow } = context;
  26136. if (this.consequent.hasEffects(context))
  26137. return true;
  26138. const consequentBrokenFlow = context.brokenFlow;
  26139. context.brokenFlow = brokenFlow;
  26140. if (this.alternate === null)
  26141. return false;
  26142. if (this.alternate.hasEffects(context))
  26143. return true;
  26144. context.brokenFlow =
  26145. context.brokenFlow < consequentBrokenFlow ? context.brokenFlow : consequentBrokenFlow;
  26146. return false;
  26147. }
  26148. return testValue
  26149. ? this.consequent.hasEffects(context)
  26150. : this.alternate !== null && this.alternate.hasEffects(context);
  26151. }
  26152. include(context, includeChildrenRecursively) {
  26153. this.included = true;
  26154. if (includeChildrenRecursively) {
  26155. this.includeRecursively(includeChildrenRecursively, context);
  26156. }
  26157. else {
  26158. const testValue = this.getTestValue();
  26159. if (testValue === UnknownValue) {
  26160. this.includeUnknownTest(context);
  26161. }
  26162. else {
  26163. this.includeKnownTest(context, testValue);
  26164. }
  26165. }
  26166. }
  26167. parseNode(esTreeNode) {
  26168. this.consequentScope = new TrackingScope(this.scope);
  26169. this.consequent = new (this.context.nodeConstructors[esTreeNode.consequent.type] ||
  26170. this.context.nodeConstructors.UnknownNode)(esTreeNode.consequent, this, this.consequentScope);
  26171. if (esTreeNode.alternate) {
  26172. this.alternateScope = new TrackingScope(this.scope);
  26173. this.alternate = new (this.context.nodeConstructors[esTreeNode.alternate.type] ||
  26174. this.context.nodeConstructors.UnknownNode)(esTreeNode.alternate, this, this.alternateScope);
  26175. }
  26176. super.parseNode(esTreeNode);
  26177. }
  26178. render(code, options) {
  26179. // Note that unknown test values are always included
  26180. const testValue = this.getTestValue();
  26181. const hoistedDeclarations = [];
  26182. const includesIfElse = this.test.included;
  26183. const noTreeshake = !this.context.options.treeshake;
  26184. if (includesIfElse) {
  26185. this.test.render(code, options);
  26186. }
  26187. else {
  26188. removeAnnotations(this, code);
  26189. code.remove(this.start, this.consequent.start);
  26190. }
  26191. if (this.consequent.included && (noTreeshake || testValue === UnknownValue || testValue)) {
  26192. this.consequent.render(code, options);
  26193. }
  26194. else {
  26195. code.overwrite(this.consequent.start, this.consequent.end, includesIfElse ? ';' : '');
  26196. hoistedDeclarations.push(...this.consequentScope.hoistedDeclarations);
  26197. }
  26198. if (this.alternate) {
  26199. if (this.alternate.included && (noTreeshake || testValue === UnknownValue || !testValue)) {
  26200. if (includesIfElse) {
  26201. if (code.original.charCodeAt(this.alternate.start - 1) === 101) {
  26202. code.prependLeft(this.alternate.start, ' ');
  26203. }
  26204. }
  26205. else {
  26206. code.remove(this.consequent.end, this.alternate.start);
  26207. }
  26208. this.alternate.render(code, options);
  26209. }
  26210. else {
  26211. if (includesIfElse && this.shouldKeepAlternateBranch()) {
  26212. code.overwrite(this.alternate.start, this.end, ';');
  26213. }
  26214. else {
  26215. code.remove(this.consequent.end, this.end);
  26216. }
  26217. hoistedDeclarations.push(...this.alternateScope.hoistedDeclarations);
  26218. }
  26219. }
  26220. this.renderHoistedDeclarations(hoistedDeclarations, code);
  26221. }
  26222. getTestValue() {
  26223. if (this.testValue === unset) {
  26224. return (this.testValue = this.test.getLiteralValueAtPath(EMPTY_PATH, SHARED_RECURSION_TRACKER, this));
  26225. }
  26226. return this.testValue;
  26227. }
  26228. includeKnownTest(context, testValue) {
  26229. if (this.test.shouldBeIncluded(context)) {
  26230. this.test.include(context, false);
  26231. }
  26232. if (testValue && this.consequent.shouldBeIncluded(context)) {
  26233. this.consequent.includeAsSingleStatement(context, false);
  26234. }
  26235. if (this.alternate !== null && !testValue && this.alternate.shouldBeIncluded(context)) {
  26236. this.alternate.includeAsSingleStatement(context, false);
  26237. }
  26238. }
  26239. includeRecursively(includeChildrenRecursively, context) {
  26240. this.test.include(context, includeChildrenRecursively);
  26241. this.consequent.include(context, includeChildrenRecursively);
  26242. if (this.alternate !== null) {
  26243. this.alternate.include(context, includeChildrenRecursively);
  26244. }
  26245. }
  26246. includeUnknownTest(context) {
  26247. this.test.include(context, false);
  26248. const { brokenFlow } = context;
  26249. let consequentBrokenFlow = BROKEN_FLOW_NONE;
  26250. if (this.consequent.shouldBeIncluded(context)) {
  26251. this.consequent.includeAsSingleStatement(context, false);
  26252. consequentBrokenFlow = context.brokenFlow;
  26253. context.brokenFlow = brokenFlow;
  26254. }
  26255. if (this.alternate !== null && this.alternate.shouldBeIncluded(context)) {
  26256. this.alternate.includeAsSingleStatement(context, false);
  26257. context.brokenFlow =
  26258. context.brokenFlow < consequentBrokenFlow ? context.brokenFlow : consequentBrokenFlow;
  26259. }
  26260. }
  26261. renderHoistedDeclarations(hoistedDeclarations, code) {
  26262. const hoistedVars = [
  26263. ...new Set(hoistedDeclarations.map(identifier => {
  26264. const variable = identifier.variable;
  26265. return variable.included ? variable.getName() : '';
  26266. }))
  26267. ]
  26268. .filter(Boolean)
  26269. .join(', ');
  26270. if (hoistedVars) {
  26271. const parentType = this.parent.type;
  26272. const needsBraces = parentType !== Program$1 && parentType !== BlockStatement$1;
  26273. code.prependRight(this.start, `${needsBraces ? '{ ' : ''}var ${hoistedVars}; `);
  26274. if (needsBraces) {
  26275. code.appendLeft(this.end, ` }`);
  26276. }
  26277. }
  26278. }
  26279. shouldKeepAlternateBranch() {
  26280. let currentParent = this.parent;
  26281. do {
  26282. if (currentParent instanceof IfStatement && currentParent.alternate) {
  26283. return true;
  26284. }
  26285. if (currentParent instanceof BlockStatement) {
  26286. return false;
  26287. }
  26288. currentParent = currentParent.parent;
  26289. } while (currentParent);
  26290. return false;
  26291. }
  26292. }
  26293. class ImportDeclaration extends NodeBase {
  26294. bind() { }
  26295. hasEffects() {
  26296. return false;
  26297. }
  26298. initialise() {
  26299. this.context.addImport(this);
  26300. }
  26301. render(code, _options, nodeRenderOptions) {
  26302. code.remove(nodeRenderOptions.start, nodeRenderOptions.end);
  26303. }
  26304. }
  26305. ImportDeclaration.prototype.needsBoundaries = true;
  26306. class ImportDefaultSpecifier extends NodeBase {
  26307. }
  26308. class ImportExpression extends NodeBase {
  26309. constructor() {
  26310. super(...arguments);
  26311. this.inlineNamespace = null;
  26312. this.mechanism = null;
  26313. this.resolution = null;
  26314. }
  26315. hasEffects() {
  26316. return true;
  26317. }
  26318. include(context, includeChildrenRecursively) {
  26319. if (!this.included) {
  26320. this.included = true;
  26321. this.context.includeDynamicImport(this);
  26322. this.scope.addAccessedDynamicImport(this);
  26323. }
  26324. this.source.include(context, includeChildrenRecursively);
  26325. }
  26326. initialise() {
  26327. this.context.addDynamicImport(this);
  26328. }
  26329. render(code, options) {
  26330. if (this.inlineNamespace) {
  26331. const _ = options.compact ? '' : ' ';
  26332. const s = options.compact ? '' : ';';
  26333. code.overwrite(this.start, this.end, `Promise.resolve().then(function${_}()${_}{${_}return ${this.inlineNamespace.getName()}${s}${_}})`);
  26334. return;
  26335. }
  26336. if (this.mechanism) {
  26337. code.overwrite(this.start, findFirstOccurrenceOutsideComment(code.original, '(', this.start + 6) + 1, this.mechanism.left);
  26338. code.overwrite(this.end - 1, this.end, this.mechanism.right);
  26339. }
  26340. this.source.render(code, options);
  26341. }
  26342. renderFinalResolution(code, resolution, namespaceExportName, options) {
  26343. code.overwrite(this.source.start, this.source.end, resolution);
  26344. if (namespaceExportName) {
  26345. const _ = options.compact ? '' : ' ';
  26346. const s = options.compact ? '' : ';';
  26347. code.prependLeft(this.end, `.then(function${_}(n)${_}{${_}return n.${namespaceExportName}${s}${_}})`);
  26348. }
  26349. }
  26350. setExternalResolution(exportMode, resolution, options, pluginDriver, accessedGlobalsByScope) {
  26351. this.resolution = resolution;
  26352. const accessedGlobals = [...(accessedImportGlobals[options.format] || [])];
  26353. let helper;
  26354. ({ helper, mechanism: this.mechanism } = this.getDynamicImportMechanismAndHelper(resolution, exportMode, options, pluginDriver));
  26355. if (helper) {
  26356. accessedGlobals.push(helper);
  26357. }
  26358. if (accessedGlobals.length > 0) {
  26359. this.scope.addAccessedGlobals(accessedGlobals, accessedGlobalsByScope);
  26360. }
  26361. }
  26362. setInternalResolution(inlineNamespace) {
  26363. this.inlineNamespace = inlineNamespace;
  26364. }
  26365. getDynamicImportMechanismAndHelper(resolution, exportMode, options, pluginDriver) {
  26366. const mechanism = pluginDriver.hookFirstSync('renderDynamicImport', [
  26367. {
  26368. customResolution: typeof this.resolution === 'string' ? this.resolution : null,
  26369. format: options.format,
  26370. moduleId: this.context.module.id,
  26371. targetModuleId: this.resolution && typeof this.resolution !== 'string' ? this.resolution.id : null
  26372. }
  26373. ]);
  26374. if (mechanism) {
  26375. return { helper: null, mechanism };
  26376. }
  26377. switch (options.format) {
  26378. case 'cjs': {
  26379. const _ = options.compact ? '' : ' ';
  26380. const s = options.compact ? '' : ';';
  26381. const leftStart = `Promise.resolve().then(function${_}()${_}{${_}return`;
  26382. const helper = this.getInteropHelper(resolution, exportMode, options.interop);
  26383. return {
  26384. helper,
  26385. mechanism: helper
  26386. ? {
  26387. left: `${leftStart} /*#__PURE__*/${helper}(require(`,
  26388. right: `))${s}${_}})`
  26389. }
  26390. : {
  26391. left: `${leftStart} require(`,
  26392. right: `)${s}${_}})`
  26393. }
  26394. };
  26395. }
  26396. case 'amd': {
  26397. const _ = options.compact ? '' : ' ';
  26398. const resolve = options.compact ? 'c' : 'resolve';
  26399. const reject = options.compact ? 'e' : 'reject';
  26400. const helper = this.getInteropHelper(resolution, exportMode, options.interop);
  26401. const resolveNamespace = helper
  26402. ? `function${_}(m)${_}{${_}${resolve}(/*#__PURE__*/${helper}(m));${_}}`
  26403. : resolve;
  26404. return {
  26405. helper,
  26406. mechanism: {
  26407. left: `new Promise(function${_}(${resolve},${_}${reject})${_}{${_}require([`,
  26408. right: `],${_}${resolveNamespace},${_}${reject})${_}})`
  26409. }
  26410. };
  26411. }
  26412. case 'system':
  26413. return {
  26414. helper: null,
  26415. mechanism: {
  26416. left: 'module.import(',
  26417. right: ')'
  26418. }
  26419. };
  26420. case 'es':
  26421. if (options.dynamicImportFunction) {
  26422. return {
  26423. helper: null,
  26424. mechanism: {
  26425. left: `${options.dynamicImportFunction}(`,
  26426. right: ')'
  26427. }
  26428. };
  26429. }
  26430. }
  26431. return { helper: null, mechanism: null };
  26432. }
  26433. getInteropHelper(resolution, exportMode, interop) {
  26434. return exportMode === 'external'
  26435. ? namespaceInteropHelpersByInteropType[String(interop(resolution instanceof ExternalModule ? resolution.id : null))]
  26436. : exportMode === 'default'
  26437. ? getDefaultOnlyHelper()
  26438. : null;
  26439. }
  26440. }
  26441. const accessedImportGlobals = {
  26442. amd: ['require'],
  26443. cjs: ['require'],
  26444. system: ['module']
  26445. };
  26446. class ImportNamespaceSpecifier extends NodeBase {
  26447. }
  26448. class ImportSpecifier extends NodeBase {
  26449. }
  26450. class LabeledStatement extends NodeBase {
  26451. hasEffects(context) {
  26452. const brokenFlow = context.brokenFlow;
  26453. context.ignore.labels.add(this.label.name);
  26454. if (this.body.hasEffects(context))
  26455. return true;
  26456. context.ignore.labels.delete(this.label.name);
  26457. if (context.includedLabels.has(this.label.name)) {
  26458. context.includedLabels.delete(this.label.name);
  26459. context.brokenFlow = brokenFlow;
  26460. }
  26461. return false;
  26462. }
  26463. include(context, includeChildrenRecursively) {
  26464. this.included = true;
  26465. const brokenFlow = context.brokenFlow;
  26466. this.body.include(context, includeChildrenRecursively);
  26467. if (includeChildrenRecursively || context.includedLabels.has(this.label.name)) {
  26468. this.label.include();
  26469. context.includedLabels.delete(this.label.name);
  26470. context.brokenFlow = brokenFlow;
  26471. }
  26472. }
  26473. render(code, options) {
  26474. if (this.label.included) {
  26475. this.label.render(code, options);
  26476. }
  26477. else {
  26478. code.remove(this.start, findNonWhiteSpace(code.original, findFirstOccurrenceOutsideComment(code.original, ':', this.label.end) + 1));
  26479. }
  26480. this.body.render(code, options);
  26481. }
  26482. }
  26483. class LogicalExpression extends NodeBase {
  26484. constructor() {
  26485. super(...arguments);
  26486. // We collect deoptimization information if usedBranch !== null
  26487. this.expressionsToBeDeoptimized = [];
  26488. this.isBranchResolutionAnalysed = false;
  26489. this.unusedBranch = null;
  26490. this.usedBranch = null;
  26491. this.wasPathDeoptimizedWhileOptimized = false;
  26492. }
  26493. bind() {
  26494. super.bind();
  26495. // ensure the usedBranch is set for the tree-shaking passes
  26496. this.getUsedBranch();
  26497. }
  26498. deoptimizeCache() {
  26499. if (this.usedBranch !== null) {
  26500. this.usedBranch = null;
  26501. const expressionsToBeDeoptimized = this.expressionsToBeDeoptimized;
  26502. this.expressionsToBeDeoptimized = [];
  26503. if (this.wasPathDeoptimizedWhileOptimized) {
  26504. this.unusedBranch.deoptimizePath(UNKNOWN_PATH);
  26505. }
  26506. for (const expression of expressionsToBeDeoptimized) {
  26507. expression.deoptimizeCache();
  26508. }
  26509. }
  26510. }
  26511. deoptimizePath(path) {
  26512. const usedBranch = this.getUsedBranch();
  26513. if (usedBranch === null) {
  26514. this.left.deoptimizePath(path);
  26515. this.right.deoptimizePath(path);
  26516. }
  26517. else {
  26518. this.wasPathDeoptimizedWhileOptimized = true;
  26519. usedBranch.deoptimizePath(path);
  26520. }
  26521. }
  26522. getLiteralValueAtPath(path, recursionTracker, origin) {
  26523. const usedBranch = this.getUsedBranch();
  26524. if (usedBranch === null)
  26525. return UnknownValue;
  26526. this.expressionsToBeDeoptimized.push(origin);
  26527. return usedBranch.getLiteralValueAtPath(path, recursionTracker, origin);
  26528. }
  26529. getReturnExpressionWhenCalledAtPath(path, recursionTracker, origin) {
  26530. const usedBranch = this.getUsedBranch();
  26531. if (usedBranch === null)
  26532. return new MultiExpression([
  26533. this.left.getReturnExpressionWhenCalledAtPath(path, recursionTracker, origin),
  26534. this.right.getReturnExpressionWhenCalledAtPath(path, recursionTracker, origin)
  26535. ]);
  26536. this.expressionsToBeDeoptimized.push(origin);
  26537. return usedBranch.getReturnExpressionWhenCalledAtPath(path, recursionTracker, origin);
  26538. }
  26539. hasEffects(context) {
  26540. if (this.left.hasEffects(context)) {
  26541. return true;
  26542. }
  26543. if (this.usedBranch !== this.left) {
  26544. return this.right.hasEffects(context);
  26545. }
  26546. return false;
  26547. }
  26548. hasEffectsWhenAccessedAtPath(path, context) {
  26549. if (path.length === 0)
  26550. return false;
  26551. if (this.usedBranch === null) {
  26552. return (this.left.hasEffectsWhenAccessedAtPath(path, context) ||
  26553. this.right.hasEffectsWhenAccessedAtPath(path, context));
  26554. }
  26555. return this.usedBranch.hasEffectsWhenAccessedAtPath(path, context);
  26556. }
  26557. hasEffectsWhenAssignedAtPath(path, context) {
  26558. if (path.length === 0)
  26559. return true;
  26560. if (this.usedBranch === null) {
  26561. return (this.left.hasEffectsWhenAssignedAtPath(path, context) ||
  26562. this.right.hasEffectsWhenAssignedAtPath(path, context));
  26563. }
  26564. return this.usedBranch.hasEffectsWhenAssignedAtPath(path, context);
  26565. }
  26566. hasEffectsWhenCalledAtPath(path, callOptions, context) {
  26567. if (this.usedBranch === null) {
  26568. return (this.left.hasEffectsWhenCalledAtPath(path, callOptions, context) ||
  26569. this.right.hasEffectsWhenCalledAtPath(path, callOptions, context));
  26570. }
  26571. return this.usedBranch.hasEffectsWhenCalledAtPath(path, callOptions, context);
  26572. }
  26573. include(context, includeChildrenRecursively) {
  26574. this.included = true;
  26575. if (includeChildrenRecursively ||
  26576. (this.usedBranch === this.right && this.left.shouldBeIncluded(context)) ||
  26577. this.usedBranch === null) {
  26578. this.left.include(context, includeChildrenRecursively);
  26579. this.right.include(context, includeChildrenRecursively);
  26580. }
  26581. else {
  26582. this.usedBranch.include(context, includeChildrenRecursively);
  26583. }
  26584. }
  26585. render(code, options, { renderedParentType, isCalleeOfRenderedParent, preventASI } = BLANK) {
  26586. if (!this.left.included || !this.right.included) {
  26587. const operatorPos = findFirstOccurrenceOutsideComment(code.original, this.operator, this.left.end);
  26588. if (this.right.included) {
  26589. const removePos = findNonWhiteSpace(code.original, operatorPos + 2);
  26590. code.remove(this.start, removePos);
  26591. if (preventASI) {
  26592. removeLineBreaks(code, removePos, this.right.start);
  26593. }
  26594. }
  26595. else {
  26596. code.remove(operatorPos, this.end);
  26597. }
  26598. removeAnnotations(this, code);
  26599. this.usedBranch.render(code, options, {
  26600. isCalleeOfRenderedParent: renderedParentType
  26601. ? isCalleeOfRenderedParent
  26602. : this.parent.callee === this,
  26603. preventASI,
  26604. renderedParentType: renderedParentType || this.parent.type
  26605. });
  26606. }
  26607. else {
  26608. this.left.render(code, options, { preventASI });
  26609. this.right.render(code, options);
  26610. }
  26611. }
  26612. getUsedBranch() {
  26613. if (!this.isBranchResolutionAnalysed) {
  26614. this.isBranchResolutionAnalysed = true;
  26615. const leftValue = this.left.getLiteralValueAtPath(EMPTY_PATH, SHARED_RECURSION_TRACKER, this);
  26616. if (leftValue === UnknownValue) {
  26617. return null;
  26618. }
  26619. else {
  26620. if ((this.operator === '||' && leftValue) ||
  26621. (this.operator === '&&' && !leftValue) ||
  26622. (this.operator === '??' && leftValue != null)) {
  26623. this.usedBranch = this.left;
  26624. this.unusedBranch = this.right;
  26625. }
  26626. else {
  26627. this.usedBranch = this.right;
  26628. this.unusedBranch = this.left;
  26629. }
  26630. }
  26631. }
  26632. return this.usedBranch;
  26633. }
  26634. }
  26635. const ASSET_PREFIX = 'ROLLUP_ASSET_URL_';
  26636. const CHUNK_PREFIX = 'ROLLUP_CHUNK_URL_';
  26637. const FILE_PREFIX = 'ROLLUP_FILE_URL_';
  26638. class MetaProperty extends NodeBase {
  26639. addAccessedGlobals(format, accessedGlobalsByScope) {
  26640. const metaProperty = this.metaProperty;
  26641. const accessedGlobals = (metaProperty &&
  26642. (metaProperty.startsWith(FILE_PREFIX) ||
  26643. metaProperty.startsWith(ASSET_PREFIX) ||
  26644. metaProperty.startsWith(CHUNK_PREFIX))
  26645. ? accessedFileUrlGlobals
  26646. : accessedMetaUrlGlobals)[format];
  26647. if (accessedGlobals.length > 0) {
  26648. this.scope.addAccessedGlobals(accessedGlobals, accessedGlobalsByScope);
  26649. }
  26650. }
  26651. getReferencedFileName(outputPluginDriver) {
  26652. const metaProperty = this.metaProperty;
  26653. if (metaProperty && metaProperty.startsWith(FILE_PREFIX)) {
  26654. return outputPluginDriver.getFileName(metaProperty.substr(FILE_PREFIX.length));
  26655. }
  26656. return null;
  26657. }
  26658. hasEffects() {
  26659. return false;
  26660. }
  26661. hasEffectsWhenAccessedAtPath(path) {
  26662. return path.length > 1;
  26663. }
  26664. include() {
  26665. if (!this.included) {
  26666. this.included = true;
  26667. if (this.meta.name === 'import') {
  26668. this.context.addImportMeta(this);
  26669. const parent = this.parent;
  26670. this.metaProperty =
  26671. parent instanceof MemberExpression && typeof parent.propertyKey === 'string'
  26672. ? parent.propertyKey
  26673. : null;
  26674. }
  26675. }
  26676. }
  26677. renderFinalMechanism(code, chunkId, format, outputPluginDriver) {
  26678. var _a;
  26679. const parent = this.parent;
  26680. const metaProperty = this.metaProperty;
  26681. if (metaProperty &&
  26682. (metaProperty.startsWith(FILE_PREFIX) ||
  26683. metaProperty.startsWith(ASSET_PREFIX) ||
  26684. metaProperty.startsWith(CHUNK_PREFIX))) {
  26685. let referenceId = null;
  26686. let assetReferenceId = null;
  26687. let chunkReferenceId = null;
  26688. let fileName;
  26689. if (metaProperty.startsWith(FILE_PREFIX)) {
  26690. referenceId = metaProperty.substr(FILE_PREFIX.length);
  26691. fileName = outputPluginDriver.getFileName(referenceId);
  26692. }
  26693. else if (metaProperty.startsWith(ASSET_PREFIX)) {
  26694. warnDeprecation(`Using the "${ASSET_PREFIX}" prefix to reference files is deprecated. Use the "${FILE_PREFIX}" prefix instead.`, true, this.context.options);
  26695. assetReferenceId = metaProperty.substr(ASSET_PREFIX.length);
  26696. fileName = outputPluginDriver.getFileName(assetReferenceId);
  26697. }
  26698. else {
  26699. warnDeprecation(`Using the "${CHUNK_PREFIX}" prefix to reference files is deprecated. Use the "${FILE_PREFIX}" prefix instead.`, true, this.context.options);
  26700. chunkReferenceId = metaProperty.substr(CHUNK_PREFIX.length);
  26701. fileName = outputPluginDriver.getFileName(chunkReferenceId);
  26702. }
  26703. const relativePath = normalize(relative$1(dirname(chunkId), fileName));
  26704. let replacement;
  26705. if (assetReferenceId !== null) {
  26706. replacement = outputPluginDriver.hookFirstSync('resolveAssetUrl', [
  26707. {
  26708. assetFileName: fileName,
  26709. chunkId,
  26710. format,
  26711. moduleId: this.context.module.id,
  26712. relativeAssetPath: relativePath
  26713. }
  26714. ]);
  26715. }
  26716. if (!replacement) {
  26717. replacement =
  26718. outputPluginDriver.hookFirstSync('resolveFileUrl', [
  26719. {
  26720. assetReferenceId,
  26721. chunkId,
  26722. chunkReferenceId,
  26723. fileName,
  26724. format,
  26725. moduleId: this.context.module.id,
  26726. referenceId: referenceId || assetReferenceId || chunkReferenceId,
  26727. relativePath
  26728. }
  26729. ]) || relativeUrlMechanisms[format](relativePath);
  26730. }
  26731. code.overwrite(parent.start, parent.end, replacement, { contentOnly: true });
  26732. return;
  26733. }
  26734. const replacement = outputPluginDriver.hookFirstSync('resolveImportMeta', [
  26735. metaProperty,
  26736. {
  26737. chunkId,
  26738. format,
  26739. moduleId: this.context.module.id
  26740. }
  26741. ]) || ((_a = importMetaMechanisms[format]) === null || _a === void 0 ? void 0 : _a.call(importMetaMechanisms, metaProperty, chunkId));
  26742. if (typeof replacement === 'string') {
  26743. if (parent instanceof MemberExpression) {
  26744. code.overwrite(parent.start, parent.end, replacement, { contentOnly: true });
  26745. }
  26746. else {
  26747. code.overwrite(this.start, this.end, replacement, { contentOnly: true });
  26748. }
  26749. }
  26750. }
  26751. }
  26752. const accessedMetaUrlGlobals = {
  26753. amd: ['document', 'module', 'URL'],
  26754. cjs: ['document', 'require', 'URL'],
  26755. es: [],
  26756. iife: ['document', 'URL'],
  26757. system: ['module'],
  26758. umd: ['document', 'require', 'URL']
  26759. };
  26760. const accessedFileUrlGlobals = {
  26761. amd: ['document', 'require', 'URL'],
  26762. cjs: ['document', 'require', 'URL'],
  26763. es: [],
  26764. iife: ['document', 'URL'],
  26765. system: ['module', 'URL'],
  26766. umd: ['document', 'require', 'URL']
  26767. };
  26768. const getResolveUrl = (path, URL = 'URL') => `new ${URL}(${path}).href`;
  26769. const getRelativeUrlFromDocument = (relativePath) => getResolveUrl(`'${relativePath}', document.currentScript && document.currentScript.src || document.baseURI`);
  26770. const getGenericImportMetaMechanism = (getUrl) => (prop, chunkId) => {
  26771. const urlMechanism = getUrl(chunkId);
  26772. return prop === null ? `({ url: ${urlMechanism} })` : prop === 'url' ? urlMechanism : 'undefined';
  26773. };
  26774. const getUrlFromDocument = (chunkId) => `(document.currentScript && document.currentScript.src || new URL('${chunkId}', document.baseURI).href)`;
  26775. const relativeUrlMechanisms = {
  26776. amd: relativePath => {
  26777. if (relativePath[0] !== '.')
  26778. relativePath = './' + relativePath;
  26779. return getResolveUrl(`require.toUrl('${relativePath}'), document.baseURI`);
  26780. },
  26781. cjs: relativePath => `(typeof document === 'undefined' ? ${getResolveUrl(`'file:' + __dirname + '/${relativePath}'`, `(require('u' + 'rl').URL)`)} : ${getRelativeUrlFromDocument(relativePath)})`,
  26782. es: relativePath => getResolveUrl(`'${relativePath}', import.meta.url`),
  26783. iife: relativePath => getRelativeUrlFromDocument(relativePath),
  26784. system: relativePath => getResolveUrl(`'${relativePath}', module.meta.url`),
  26785. umd: relativePath => `(typeof document === 'undefined' ? ${getResolveUrl(`'file:' + __dirname + '/${relativePath}'`, `(require('u' + 'rl').URL)`)} : ${getRelativeUrlFromDocument(relativePath)})`
  26786. };
  26787. const importMetaMechanisms = {
  26788. amd: getGenericImportMetaMechanism(() => getResolveUrl(`module.uri, document.baseURI`)),
  26789. cjs: getGenericImportMetaMechanism(chunkId => `(typeof document === 'undefined' ? ${getResolveUrl(`'file:' + __filename`, `(require('u' + 'rl').URL)`)} : ${getUrlFromDocument(chunkId)})`),
  26790. iife: getGenericImportMetaMechanism(chunkId => getUrlFromDocument(chunkId)),
  26791. system: prop => (prop === null ? `module.meta` : `module.meta.${prop}`),
  26792. umd: getGenericImportMetaMechanism(chunkId => `(typeof document === 'undefined' ? ${getResolveUrl(`'file:' + __filename`, `(require('u' + 'rl').URL)`)} : ${getUrlFromDocument(chunkId)})`)
  26793. };
  26794. class NewExpression extends NodeBase {
  26795. bind() {
  26796. super.bind();
  26797. for (const argument of this.arguments) {
  26798. // This will make sure all properties of parameters behave as "unknown"
  26799. argument.deoptimizePath(UNKNOWN_PATH);
  26800. }
  26801. }
  26802. hasEffects(context) {
  26803. var _a;
  26804. for (const argument of this.arguments) {
  26805. if (argument.hasEffects(context))
  26806. return true;
  26807. }
  26808. if (this.context.options.treeshake.annotations && ((_a = this.annotations) === null || _a === void 0 ? void 0 : _a.some((a) => a.pure)))
  26809. return false;
  26810. return (this.callee.hasEffects(context) ||
  26811. this.callee.hasEffectsWhenCalledAtPath(EMPTY_PATH, this.callOptions, context));
  26812. }
  26813. hasEffectsWhenAccessedAtPath(path) {
  26814. return path.length > 1;
  26815. }
  26816. initialise() {
  26817. this.callOptions = {
  26818. args: this.arguments,
  26819. withNew: true
  26820. };
  26821. }
  26822. }
  26823. class ObjectExpression extends NodeBase {
  26824. constructor() {
  26825. super(...arguments);
  26826. this.deoptimizedPaths = new Set();
  26827. // We collect deoptimization information if we can resolve a computed property access
  26828. this.expressionsToBeDeoptimized = new Map();
  26829. this.hasUnknownDeoptimizedProperty = false;
  26830. this.propertyMap = null;
  26831. this.unmatchablePropertiesRead = [];
  26832. this.unmatchablePropertiesWrite = [];
  26833. }
  26834. bind() {
  26835. super.bind();
  26836. // ensure the propertyMap is set for the tree-shaking passes
  26837. this.getPropertyMap();
  26838. }
  26839. // We could also track this per-property but this would quickly become much more complex
  26840. deoptimizeCache() {
  26841. if (!this.hasUnknownDeoptimizedProperty)
  26842. this.deoptimizeAllProperties();
  26843. }
  26844. deoptimizePath(path) {
  26845. if (this.hasUnknownDeoptimizedProperty)
  26846. return;
  26847. const propertyMap = this.getPropertyMap();
  26848. const key = path[0];
  26849. if (path.length === 1) {
  26850. if (typeof key !== 'string') {
  26851. this.deoptimizeAllProperties();
  26852. return;
  26853. }
  26854. if (!this.deoptimizedPaths.has(key)) {
  26855. this.deoptimizedPaths.add(key);
  26856. // we only deoptimizeCache exact matches as in all other cases,
  26857. // we do not return a literal value or return expression
  26858. const expressionsToBeDeoptimized = this.expressionsToBeDeoptimized.get(key);
  26859. if (expressionsToBeDeoptimized) {
  26860. for (const expression of expressionsToBeDeoptimized) {
  26861. expression.deoptimizeCache();
  26862. }
  26863. }
  26864. }
  26865. }
  26866. const subPath = path.length === 1 ? UNKNOWN_PATH : path.slice(1);
  26867. for (const property of typeof key === 'string'
  26868. ? propertyMap[key]
  26869. ? propertyMap[key].propertiesRead
  26870. : []
  26871. : this.properties) {
  26872. property.deoptimizePath(subPath);
  26873. }
  26874. }
  26875. getLiteralValueAtPath(path, recursionTracker, origin) {
  26876. const propertyMap = this.getPropertyMap();
  26877. const key = path[0];
  26878. if (path.length === 0 ||
  26879. this.hasUnknownDeoptimizedProperty ||
  26880. typeof key !== 'string' ||
  26881. this.deoptimizedPaths.has(key)) {
  26882. return UnknownValue;
  26883. }
  26884. if (path.length === 1 &&
  26885. !propertyMap[key] &&
  26886. !objectMembers[key] &&
  26887. this.unmatchablePropertiesRead.length === 0) {
  26888. getOrCreate(this.expressionsToBeDeoptimized, key, () => []).push(origin);
  26889. return undefined;
  26890. }
  26891. if (!propertyMap[key] ||
  26892. propertyMap[key].exactMatchRead === null ||
  26893. propertyMap[key].propertiesRead.length > 1) {
  26894. return UnknownValue;
  26895. }
  26896. getOrCreate(this.expressionsToBeDeoptimized, key, () => []).push(origin);
  26897. return propertyMap[key].exactMatchRead.getLiteralValueAtPath(path.slice(1), recursionTracker, origin);
  26898. }
  26899. getReturnExpressionWhenCalledAtPath(path, recursionTracker, origin) {
  26900. const propertyMap = this.getPropertyMap();
  26901. const key = path[0];
  26902. if (path.length === 0 ||
  26903. this.hasUnknownDeoptimizedProperty ||
  26904. typeof key !== 'string' ||
  26905. this.deoptimizedPaths.has(key)) {
  26906. return UNKNOWN_EXPRESSION;
  26907. }
  26908. if (path.length === 1 &&
  26909. objectMembers[key] &&
  26910. this.unmatchablePropertiesRead.length === 0 &&
  26911. (!propertyMap[key] || propertyMap[key].exactMatchRead === null)) {
  26912. return getMemberReturnExpressionWhenCalled(objectMembers, key);
  26913. }
  26914. if (!propertyMap[key] ||
  26915. propertyMap[key].exactMatchRead === null ||
  26916. propertyMap[key].propertiesRead.length > 1) {
  26917. return UNKNOWN_EXPRESSION;
  26918. }
  26919. getOrCreate(this.expressionsToBeDeoptimized, key, () => []).push(origin);
  26920. return propertyMap[key].exactMatchRead.getReturnExpressionWhenCalledAtPath(path.slice(1), recursionTracker, origin);
  26921. }
  26922. hasEffectsWhenAccessedAtPath(path, context) {
  26923. if (path.length === 0)
  26924. return false;
  26925. const key = path[0];
  26926. const propertyMap = this.propertyMap;
  26927. if (path.length > 1 &&
  26928. (this.hasUnknownDeoptimizedProperty ||
  26929. typeof key !== 'string' ||
  26930. this.deoptimizedPaths.has(key) ||
  26931. !propertyMap[key] ||
  26932. propertyMap[key].exactMatchRead === null))
  26933. return true;
  26934. const subPath = path.slice(1);
  26935. for (const property of typeof key !== 'string'
  26936. ? this.properties
  26937. : propertyMap[key]
  26938. ? propertyMap[key].propertiesRead
  26939. : []) {
  26940. if (property.hasEffectsWhenAccessedAtPath(subPath, context))
  26941. return true;
  26942. }
  26943. return false;
  26944. }
  26945. hasEffectsWhenAssignedAtPath(path, context) {
  26946. const key = path[0];
  26947. const propertyMap = this.propertyMap;
  26948. if (path.length > 1 &&
  26949. (this.hasUnknownDeoptimizedProperty ||
  26950. this.deoptimizedPaths.has(key) ||
  26951. !propertyMap[key] ||
  26952. propertyMap[key].exactMatchRead === null)) {
  26953. return true;
  26954. }
  26955. const subPath = path.slice(1);
  26956. for (const property of typeof key !== 'string'
  26957. ? this.properties
  26958. : path.length > 1
  26959. ? propertyMap[key].propertiesRead
  26960. : propertyMap[key]
  26961. ? propertyMap[key].propertiesWrite
  26962. : []) {
  26963. if (property.hasEffectsWhenAssignedAtPath(subPath, context))
  26964. return true;
  26965. }
  26966. return false;
  26967. }
  26968. hasEffectsWhenCalledAtPath(path, callOptions, context) {
  26969. const key = path[0];
  26970. if (typeof key !== 'string' ||
  26971. this.hasUnknownDeoptimizedProperty ||
  26972. this.deoptimizedPaths.has(key) ||
  26973. (this.propertyMap[key]
  26974. ? !this.propertyMap[key].exactMatchRead
  26975. : path.length > 1 || !objectMembers[key])) {
  26976. return true;
  26977. }
  26978. const subPath = path.slice(1);
  26979. if (this.propertyMap[key]) {
  26980. for (const property of this.propertyMap[key].propertiesRead) {
  26981. if (property.hasEffectsWhenCalledAtPath(subPath, callOptions, context))
  26982. return true;
  26983. }
  26984. }
  26985. if (path.length === 1 && objectMembers[key])
  26986. return hasMemberEffectWhenCalled(objectMembers, key, this.included, callOptions, context);
  26987. return false;
  26988. }
  26989. render(code, options, { renderedParentType, renderedSurroundingElement } = BLANK) {
  26990. super.render(code, options);
  26991. const surroundingElement = renderedParentType || renderedSurroundingElement;
  26992. if (surroundingElement === ExpressionStatement$1 ||
  26993. surroundingElement === ArrowFunctionExpression$1) {
  26994. code.appendRight(this.start, '(');
  26995. code.prependLeft(this.end, ')');
  26996. }
  26997. }
  26998. deoptimizeAllProperties() {
  26999. this.hasUnknownDeoptimizedProperty = true;
  27000. for (const property of this.properties) {
  27001. property.deoptimizePath(UNKNOWN_PATH);
  27002. }
  27003. for (const expressionsToBeDeoptimized of this.expressionsToBeDeoptimized.values()) {
  27004. for (const expression of expressionsToBeDeoptimized) {
  27005. expression.deoptimizeCache();
  27006. }
  27007. }
  27008. }
  27009. getPropertyMap() {
  27010. if (this.propertyMap !== null) {
  27011. return this.propertyMap;
  27012. }
  27013. const propertyMap = (this.propertyMap = Object.create(null));
  27014. for (let index = this.properties.length - 1; index >= 0; index--) {
  27015. const property = this.properties[index];
  27016. if (property instanceof SpreadElement) {
  27017. this.unmatchablePropertiesRead.push(property);
  27018. continue;
  27019. }
  27020. const isWrite = property.kind !== 'get';
  27021. const isRead = property.kind !== 'set';
  27022. let key;
  27023. if (property.computed) {
  27024. const keyValue = property.key.getLiteralValueAtPath(EMPTY_PATH, SHARED_RECURSION_TRACKER, this);
  27025. if (keyValue === UnknownValue) {
  27026. if (isRead) {
  27027. this.unmatchablePropertiesRead.push(property);
  27028. }
  27029. else {
  27030. this.unmatchablePropertiesWrite.push(property);
  27031. }
  27032. continue;
  27033. }
  27034. key = String(keyValue);
  27035. }
  27036. else if (property.key instanceof Identifier) {
  27037. key = property.key.name;
  27038. }
  27039. else {
  27040. key = String(property.key.value);
  27041. }
  27042. const propertyMapProperty = propertyMap[key];
  27043. if (!propertyMapProperty) {
  27044. propertyMap[key] = {
  27045. exactMatchRead: isRead ? property : null,
  27046. exactMatchWrite: isWrite ? property : null,
  27047. propertiesRead: isRead ? [property, ...this.unmatchablePropertiesRead] : [],
  27048. propertiesWrite: isWrite && !isRead ? [property, ...this.unmatchablePropertiesWrite] : []
  27049. };
  27050. continue;
  27051. }
  27052. if (isRead && propertyMapProperty.exactMatchRead === null) {
  27053. propertyMapProperty.exactMatchRead = property;
  27054. propertyMapProperty.propertiesRead.push(property, ...this.unmatchablePropertiesRead);
  27055. }
  27056. if (isWrite && !isRead && propertyMapProperty.exactMatchWrite === null) {
  27057. propertyMapProperty.exactMatchWrite = property;
  27058. propertyMapProperty.propertiesWrite.push(property, ...this.unmatchablePropertiesWrite);
  27059. }
  27060. }
  27061. return propertyMap;
  27062. }
  27063. }
  27064. class ObjectPattern extends NodeBase {
  27065. addExportedVariables(variables, exportNamesByVariable) {
  27066. for (const property of this.properties) {
  27067. if (property.type === Property$1) {
  27068. property.value.addExportedVariables(variables, exportNamesByVariable);
  27069. }
  27070. else {
  27071. property.argument.addExportedVariables(variables, exportNamesByVariable);
  27072. }
  27073. }
  27074. }
  27075. declare(kind, init) {
  27076. const variables = [];
  27077. for (const property of this.properties) {
  27078. variables.push(...property.declare(kind, init));
  27079. }
  27080. return variables;
  27081. }
  27082. deoptimizePath(path) {
  27083. if (path.length === 0) {
  27084. for (const property of this.properties) {
  27085. property.deoptimizePath(path);
  27086. }
  27087. }
  27088. }
  27089. hasEffectsWhenAssignedAtPath(path, context) {
  27090. if (path.length > 0)
  27091. return true;
  27092. for (const property of this.properties) {
  27093. if (property.hasEffectsWhenAssignedAtPath(EMPTY_PATH, context))
  27094. return true;
  27095. }
  27096. return false;
  27097. }
  27098. }
  27099. class PrivateIdentifier extends NodeBase {
  27100. }
  27101. class Program extends NodeBase {
  27102. constructor() {
  27103. super(...arguments);
  27104. this.hasCachedEffect = false;
  27105. }
  27106. hasEffects(context) {
  27107. // We are caching here to later more efficiently identify side-effect-free modules
  27108. if (this.hasCachedEffect)
  27109. return true;
  27110. for (const node of this.body) {
  27111. if (node.hasEffects(context)) {
  27112. return (this.hasCachedEffect = true);
  27113. }
  27114. }
  27115. return false;
  27116. }
  27117. include(context, includeChildrenRecursively) {
  27118. this.included = true;
  27119. for (const node of this.body) {
  27120. if (includeChildrenRecursively || node.shouldBeIncluded(context)) {
  27121. node.include(context, includeChildrenRecursively);
  27122. }
  27123. }
  27124. }
  27125. render(code, options) {
  27126. if (this.body.length) {
  27127. renderStatementList(this.body, code, this.start, this.end, options);
  27128. }
  27129. else {
  27130. super.render(code, options);
  27131. }
  27132. }
  27133. }
  27134. class Property extends NodeBase {
  27135. constructor() {
  27136. super(...arguments);
  27137. this.declarationInit = null;
  27138. this.returnExpression = null;
  27139. }
  27140. bind() {
  27141. super.bind();
  27142. if (this.kind === 'get') {
  27143. // ensure the returnExpression is set for the tree-shaking passes
  27144. this.getReturnExpression();
  27145. }
  27146. if (this.declarationInit !== null) {
  27147. this.declarationInit.deoptimizePath([UnknownKey, UnknownKey]);
  27148. }
  27149. }
  27150. declare(kind, init) {
  27151. this.declarationInit = init;
  27152. return this.value.declare(kind, UNKNOWN_EXPRESSION);
  27153. }
  27154. // As getter properties directly receive their values from function expressions that always
  27155. // have a fixed return value, there is no known situation where a getter is deoptimized.
  27156. deoptimizeCache() { }
  27157. deoptimizePath(path) {
  27158. if (this.kind === 'get') {
  27159. this.getReturnExpression().deoptimizePath(path);
  27160. }
  27161. else {
  27162. this.value.deoptimizePath(path);
  27163. }
  27164. }
  27165. getLiteralValueAtPath(path, recursionTracker, origin) {
  27166. if (this.kind === 'get') {
  27167. return this.getReturnExpression().getLiteralValueAtPath(path, recursionTracker, origin);
  27168. }
  27169. return this.value.getLiteralValueAtPath(path, recursionTracker, origin);
  27170. }
  27171. getReturnExpressionWhenCalledAtPath(path, recursionTracker, origin) {
  27172. if (this.kind === 'get') {
  27173. return this.getReturnExpression().getReturnExpressionWhenCalledAtPath(path, recursionTracker, origin);
  27174. }
  27175. return this.value.getReturnExpressionWhenCalledAtPath(path, recursionTracker, origin);
  27176. }
  27177. hasEffects(context) {
  27178. const propertyReadSideEffects = this.context.options.treeshake.propertyReadSideEffects;
  27179. return this.parent.type === 'ObjectPattern' && propertyReadSideEffects === 'always' ||
  27180. this.key.hasEffects(context) ||
  27181. this.value.hasEffects(context);
  27182. }
  27183. hasEffectsWhenAccessedAtPath(path, context) {
  27184. if (this.kind === 'get') {
  27185. const trackedExpressions = context.accessed.getEntities(path);
  27186. if (trackedExpressions.has(this))
  27187. return false;
  27188. trackedExpressions.add(this);
  27189. return (this.value.hasEffectsWhenCalledAtPath(EMPTY_PATH, this.accessorCallOptions, context) ||
  27190. (path.length > 0 && this.returnExpression.hasEffectsWhenAccessedAtPath(path, context)));
  27191. }
  27192. return this.value.hasEffectsWhenAccessedAtPath(path, context);
  27193. }
  27194. hasEffectsWhenAssignedAtPath(path, context) {
  27195. if (this.kind === 'get') {
  27196. const trackedExpressions = context.assigned.getEntities(path);
  27197. if (trackedExpressions.has(this))
  27198. return false;
  27199. trackedExpressions.add(this);
  27200. return this.returnExpression.hasEffectsWhenAssignedAtPath(path, context);
  27201. }
  27202. if (this.kind === 'set') {
  27203. const trackedExpressions = context.assigned.getEntities(path);
  27204. if (trackedExpressions.has(this))
  27205. return false;
  27206. trackedExpressions.add(this);
  27207. return this.value.hasEffectsWhenCalledAtPath(EMPTY_PATH, this.accessorCallOptions, context);
  27208. }
  27209. return this.value.hasEffectsWhenAssignedAtPath(path, context);
  27210. }
  27211. hasEffectsWhenCalledAtPath(path, callOptions, context) {
  27212. if (this.kind === 'get') {
  27213. const trackedExpressions = (callOptions.withNew
  27214. ? context.instantiated
  27215. : context.called).getEntities(path, callOptions);
  27216. if (trackedExpressions.has(this))
  27217. return false;
  27218. trackedExpressions.add(this);
  27219. return this.returnExpression.hasEffectsWhenCalledAtPath(path, callOptions, context);
  27220. }
  27221. return this.value.hasEffectsWhenCalledAtPath(path, callOptions, context);
  27222. }
  27223. initialise() {
  27224. this.accessorCallOptions = {
  27225. args: NO_ARGS,
  27226. withNew: false
  27227. };
  27228. }
  27229. render(code, options) {
  27230. if (!this.shorthand) {
  27231. this.key.render(code, options);
  27232. }
  27233. this.value.render(code, options, { isShorthandProperty: this.shorthand });
  27234. }
  27235. getReturnExpression() {
  27236. if (this.returnExpression === null) {
  27237. this.returnExpression = UNKNOWN_EXPRESSION;
  27238. return (this.returnExpression = this.value.getReturnExpressionWhenCalledAtPath(EMPTY_PATH, SHARED_RECURSION_TRACKER, this));
  27239. }
  27240. return this.returnExpression;
  27241. }
  27242. }
  27243. class PropertyDefinition extends NodeBase {
  27244. hasEffects(context) {
  27245. return (this.key.hasEffects(context) ||
  27246. (this.static && this.value !== null && this.value.hasEffects(context)));
  27247. }
  27248. }
  27249. class ReturnStatement extends NodeBase {
  27250. hasEffects(context) {
  27251. if (!context.ignore.returnAwaitYield ||
  27252. (this.argument !== null && this.argument.hasEffects(context)))
  27253. return true;
  27254. context.brokenFlow = BROKEN_FLOW_ERROR_RETURN_LABEL;
  27255. return false;
  27256. }
  27257. include(context, includeChildrenRecursively) {
  27258. this.included = true;
  27259. if (this.argument) {
  27260. this.argument.include(context, includeChildrenRecursively);
  27261. }
  27262. context.brokenFlow = BROKEN_FLOW_ERROR_RETURN_LABEL;
  27263. }
  27264. initialise() {
  27265. this.scope.addReturnExpression(this.argument || UNKNOWN_EXPRESSION);
  27266. }
  27267. render(code, options) {
  27268. if (this.argument) {
  27269. this.argument.render(code, options, { preventASI: true });
  27270. if (this.argument.start === this.start + 6 /* 'return'.length */) {
  27271. code.prependLeft(this.start + 6, ' ');
  27272. }
  27273. }
  27274. }
  27275. }
  27276. class SequenceExpression extends NodeBase {
  27277. deoptimizePath(path) {
  27278. if (path.length > 0)
  27279. this.expressions[this.expressions.length - 1].deoptimizePath(path);
  27280. }
  27281. getLiteralValueAtPath(path, recursionTracker, origin) {
  27282. return this.expressions[this.expressions.length - 1].getLiteralValueAtPath(path, recursionTracker, origin);
  27283. }
  27284. hasEffects(context) {
  27285. for (const expression of this.expressions) {
  27286. if (expression.hasEffects(context))
  27287. return true;
  27288. }
  27289. return false;
  27290. }
  27291. hasEffectsWhenAccessedAtPath(path, context) {
  27292. return (path.length > 0 &&
  27293. this.expressions[this.expressions.length - 1].hasEffectsWhenAccessedAtPath(path, context));
  27294. }
  27295. hasEffectsWhenAssignedAtPath(path, context) {
  27296. return (path.length === 0 ||
  27297. this.expressions[this.expressions.length - 1].hasEffectsWhenAssignedAtPath(path, context));
  27298. }
  27299. hasEffectsWhenCalledAtPath(path, callOptions, context) {
  27300. return this.expressions[this.expressions.length - 1].hasEffectsWhenCalledAtPath(path, callOptions, context);
  27301. }
  27302. include(context, includeChildrenRecursively) {
  27303. this.included = true;
  27304. for (let i = 0; i < this.expressions.length - 1; i++) {
  27305. const node = this.expressions[i];
  27306. if (includeChildrenRecursively || node.shouldBeIncluded(context))
  27307. node.include(context, includeChildrenRecursively);
  27308. }
  27309. this.expressions[this.expressions.length - 1].include(context, includeChildrenRecursively);
  27310. }
  27311. render(code, options, { renderedParentType, isCalleeOfRenderedParent, preventASI } = BLANK) {
  27312. let includedNodes = 0;
  27313. for (const { node, start, end } of getCommaSeparatedNodesWithBoundaries(this.expressions, code, this.start, this.end)) {
  27314. if (!node.included) {
  27315. treeshakeNode(node, code, start, end);
  27316. continue;
  27317. }
  27318. includedNodes++;
  27319. if (includedNodes === 1 && preventASI) {
  27320. removeLineBreaks(code, start, node.start);
  27321. }
  27322. if (node === this.expressions[this.expressions.length - 1] && includedNodes === 1) {
  27323. node.render(code, options, {
  27324. isCalleeOfRenderedParent: renderedParentType
  27325. ? isCalleeOfRenderedParent
  27326. : this.parent.callee === this,
  27327. renderedParentType: renderedParentType || this.parent.type
  27328. });
  27329. }
  27330. else {
  27331. node.render(code, options);
  27332. }
  27333. }
  27334. }
  27335. }
  27336. class Super extends NodeBase {
  27337. }
  27338. class SwitchCase extends NodeBase {
  27339. hasEffects(context) {
  27340. if (this.test && this.test.hasEffects(context))
  27341. return true;
  27342. for (const node of this.consequent) {
  27343. if (context.brokenFlow)
  27344. break;
  27345. if (node.hasEffects(context))
  27346. return true;
  27347. }
  27348. return false;
  27349. }
  27350. include(context, includeChildrenRecursively) {
  27351. this.included = true;
  27352. if (this.test)
  27353. this.test.include(context, includeChildrenRecursively);
  27354. for (const node of this.consequent) {
  27355. if (includeChildrenRecursively || node.shouldBeIncluded(context))
  27356. node.include(context, includeChildrenRecursively);
  27357. }
  27358. }
  27359. render(code, options, nodeRenderOptions) {
  27360. if (this.consequent.length) {
  27361. this.test && this.test.render(code, options);
  27362. const testEnd = this.test
  27363. ? this.test.end
  27364. : findFirstOccurrenceOutsideComment(code.original, 'default', this.start) + 7;
  27365. const consequentStart = findFirstOccurrenceOutsideComment(code.original, ':', testEnd) + 1;
  27366. renderStatementList(this.consequent, code, consequentStart, nodeRenderOptions.end, options);
  27367. }
  27368. else {
  27369. super.render(code, options);
  27370. }
  27371. }
  27372. }
  27373. SwitchCase.prototype.needsBoundaries = true;
  27374. class SwitchStatement extends NodeBase {
  27375. createScope(parentScope) {
  27376. this.scope = new BlockScope(parentScope);
  27377. }
  27378. hasEffects(context) {
  27379. if (this.discriminant.hasEffects(context))
  27380. return true;
  27381. const { brokenFlow, ignore: { breaks } } = context;
  27382. let minBrokenFlow = Infinity;
  27383. context.ignore.breaks = true;
  27384. for (const switchCase of this.cases) {
  27385. if (switchCase.hasEffects(context))
  27386. return true;
  27387. minBrokenFlow = context.brokenFlow < minBrokenFlow ? context.brokenFlow : minBrokenFlow;
  27388. context.brokenFlow = brokenFlow;
  27389. }
  27390. if (this.defaultCase !== null && !(minBrokenFlow === BROKEN_FLOW_BREAK_CONTINUE)) {
  27391. context.brokenFlow = minBrokenFlow;
  27392. }
  27393. context.ignore.breaks = breaks;
  27394. return false;
  27395. }
  27396. include(context, includeChildrenRecursively) {
  27397. this.included = true;
  27398. this.discriminant.include(context, includeChildrenRecursively);
  27399. const { brokenFlow } = context;
  27400. let minBrokenFlow = Infinity;
  27401. let isCaseIncluded = includeChildrenRecursively ||
  27402. (this.defaultCase !== null && this.defaultCase < this.cases.length - 1);
  27403. for (let caseIndex = this.cases.length - 1; caseIndex >= 0; caseIndex--) {
  27404. const switchCase = this.cases[caseIndex];
  27405. if (switchCase.included) {
  27406. isCaseIncluded = true;
  27407. }
  27408. if (!isCaseIncluded) {
  27409. const hasEffectsContext = createHasEffectsContext();
  27410. hasEffectsContext.ignore.breaks = true;
  27411. isCaseIncluded = switchCase.hasEffects(hasEffectsContext);
  27412. }
  27413. if (isCaseIncluded) {
  27414. switchCase.include(context, includeChildrenRecursively);
  27415. minBrokenFlow = minBrokenFlow < context.brokenFlow ? minBrokenFlow : context.brokenFlow;
  27416. context.brokenFlow = brokenFlow;
  27417. }
  27418. else {
  27419. minBrokenFlow = brokenFlow;
  27420. }
  27421. }
  27422. if (isCaseIncluded &&
  27423. this.defaultCase !== null &&
  27424. !(minBrokenFlow === BROKEN_FLOW_BREAK_CONTINUE)) {
  27425. context.brokenFlow = minBrokenFlow;
  27426. }
  27427. }
  27428. initialise() {
  27429. for (let caseIndex = 0; caseIndex < this.cases.length; caseIndex++) {
  27430. if (this.cases[caseIndex].test === null) {
  27431. this.defaultCase = caseIndex;
  27432. return;
  27433. }
  27434. }
  27435. this.defaultCase = null;
  27436. }
  27437. render(code, options) {
  27438. this.discriminant.render(code, options);
  27439. if (this.cases.length > 0) {
  27440. renderStatementList(this.cases, code, this.cases[0].start, this.end - 1, options);
  27441. }
  27442. }
  27443. }
  27444. class TaggedTemplateExpression extends NodeBase {
  27445. bind() {
  27446. super.bind();
  27447. if (this.tag.type === Identifier$1) {
  27448. const name = this.tag.name;
  27449. const variable = this.scope.findVariable(name);
  27450. if (variable.isNamespace) {
  27451. this.context.warn({
  27452. code: 'CANNOT_CALL_NAMESPACE',
  27453. message: `Cannot call a namespace ('${name}')`,
  27454. }, this.start);
  27455. }
  27456. if (name === 'eval') {
  27457. this.context.warn({
  27458. code: 'EVAL',
  27459. message: `Use of eval is strongly discouraged, as it poses security risks and may cause issues with minification`,
  27460. url: 'https://rollupjs.org/guide/en/#avoiding-eval',
  27461. }, this.start);
  27462. }
  27463. }
  27464. }
  27465. hasEffects(context) {
  27466. return (super.hasEffects(context) ||
  27467. this.tag.hasEffectsWhenCalledAtPath(EMPTY_PATH, this.callOptions, context));
  27468. }
  27469. initialise() {
  27470. this.callOptions = {
  27471. args: NO_ARGS,
  27472. withNew: false,
  27473. };
  27474. }
  27475. }
  27476. class TemplateElement extends NodeBase {
  27477. bind() { }
  27478. hasEffects() {
  27479. return false;
  27480. }
  27481. include() {
  27482. this.included = true;
  27483. }
  27484. parseNode(esTreeNode) {
  27485. this.value = esTreeNode.value;
  27486. super.parseNode(esTreeNode);
  27487. }
  27488. render() { }
  27489. }
  27490. class TemplateLiteral extends NodeBase {
  27491. getLiteralValueAtPath(path) {
  27492. if (path.length > 0 || this.quasis.length !== 1) {
  27493. return UnknownValue;
  27494. }
  27495. return this.quasis[0].value.cooked;
  27496. }
  27497. render(code, options) {
  27498. code.indentExclusionRanges.push([this.start, this.end]);
  27499. super.render(code, options);
  27500. }
  27501. }
  27502. class ModuleScope extends ChildScope {
  27503. constructor(parent, context) {
  27504. super(parent);
  27505. this.context = context;
  27506. this.variables.set('this', new LocalVariable('this', null, UNDEFINED_EXPRESSION, context));
  27507. }
  27508. addExportDefaultDeclaration(name, exportDefaultDeclaration, context) {
  27509. const variable = new ExportDefaultVariable(name, exportDefaultDeclaration, context);
  27510. this.variables.set('default', variable);
  27511. return variable;
  27512. }
  27513. addNamespaceMemberAccess() { }
  27514. deconflict(format, exportNamesByVariable, accessedGlobalsByScope) {
  27515. // all module level variables are already deconflicted when deconflicting the chunk
  27516. for (const scope of this.children)
  27517. scope.deconflict(format, exportNamesByVariable, accessedGlobalsByScope);
  27518. }
  27519. findLexicalBoundary() {
  27520. return this;
  27521. }
  27522. findVariable(name) {
  27523. const knownVariable = this.variables.get(name) || this.accessedOutsideVariables.get(name);
  27524. if (knownVariable) {
  27525. return knownVariable;
  27526. }
  27527. const variable = this.context.traceVariable(name) || this.parent.findVariable(name);
  27528. if (variable instanceof GlobalVariable) {
  27529. this.accessedOutsideVariables.set(name, variable);
  27530. }
  27531. return variable;
  27532. }
  27533. }
  27534. class ThisExpression extends NodeBase {
  27535. bind() {
  27536. super.bind();
  27537. this.variable = this.scope.findVariable('this');
  27538. }
  27539. hasEffectsWhenAccessedAtPath(path, context) {
  27540. return path.length > 0 && this.variable.hasEffectsWhenAccessedAtPath(path, context);
  27541. }
  27542. hasEffectsWhenAssignedAtPath(path, context) {
  27543. return this.variable.hasEffectsWhenAssignedAtPath(path, context);
  27544. }
  27545. initialise() {
  27546. this.alias =
  27547. this.scope.findLexicalBoundary() instanceof ModuleScope ? this.context.moduleContext : null;
  27548. if (this.alias === 'undefined') {
  27549. this.context.warn({
  27550. code: 'THIS_IS_UNDEFINED',
  27551. message: `The 'this' keyword is equivalent to 'undefined' at the top level of an ES module, and has been rewritten`,
  27552. url: `https://rollupjs.org/guide/en/#error-this-is-undefined`
  27553. }, this.start);
  27554. }
  27555. }
  27556. render(code) {
  27557. if (this.alias !== null) {
  27558. code.overwrite(this.start, this.end, this.alias, {
  27559. contentOnly: false,
  27560. storeName: true
  27561. });
  27562. }
  27563. }
  27564. }
  27565. class ThrowStatement extends NodeBase {
  27566. hasEffects() {
  27567. return true;
  27568. }
  27569. include(context, includeChildrenRecursively) {
  27570. this.included = true;
  27571. this.argument.include(context, includeChildrenRecursively);
  27572. context.brokenFlow = BROKEN_FLOW_ERROR_RETURN_LABEL;
  27573. }
  27574. render(code, options) {
  27575. this.argument.render(code, options, { preventASI: true });
  27576. if (this.argument.start === this.start + 5 /* 'throw'.length */) {
  27577. code.prependLeft(this.start + 5, ' ');
  27578. }
  27579. }
  27580. }
  27581. class TryStatement extends NodeBase {
  27582. constructor() {
  27583. super(...arguments);
  27584. this.directlyIncluded = false;
  27585. this.includedLabelsAfterBlock = null;
  27586. }
  27587. hasEffects(context) {
  27588. return ((this.context.options.treeshake.tryCatchDeoptimization
  27589. ? this.block.body.length > 0
  27590. : this.block.hasEffects(context)) ||
  27591. (this.finalizer !== null && this.finalizer.hasEffects(context)));
  27592. }
  27593. include(context, includeChildrenRecursively) {
  27594. var _a;
  27595. const tryCatchDeoptimization = (_a = this.context.options.treeshake) === null || _a === void 0 ? void 0 : _a.tryCatchDeoptimization;
  27596. const { brokenFlow } = context;
  27597. if (!this.directlyIncluded || !tryCatchDeoptimization) {
  27598. this.included = true;
  27599. this.directlyIncluded = true;
  27600. this.block.include(context, tryCatchDeoptimization ? INCLUDE_PARAMETERS : includeChildrenRecursively);
  27601. if (context.includedLabels.size > 0) {
  27602. this.includedLabelsAfterBlock = [...context.includedLabels];
  27603. }
  27604. context.brokenFlow = brokenFlow;
  27605. }
  27606. else if (this.includedLabelsAfterBlock) {
  27607. for (const label of this.includedLabelsAfterBlock) {
  27608. context.includedLabels.add(label);
  27609. }
  27610. }
  27611. if (this.handler !== null) {
  27612. this.handler.include(context, includeChildrenRecursively);
  27613. context.brokenFlow = brokenFlow;
  27614. }
  27615. if (this.finalizer !== null) {
  27616. this.finalizer.include(context, includeChildrenRecursively);
  27617. }
  27618. }
  27619. }
  27620. const unaryOperators = {
  27621. '!': value => !value,
  27622. '+': value => +value,
  27623. '-': value => -value,
  27624. delete: () => UnknownValue,
  27625. typeof: value => typeof value,
  27626. void: () => undefined,
  27627. '~': value => ~value
  27628. };
  27629. class UnaryExpression extends NodeBase {
  27630. bind() {
  27631. super.bind();
  27632. if (this.operator === 'delete') {
  27633. this.argument.deoptimizePath(EMPTY_PATH);
  27634. }
  27635. }
  27636. getLiteralValueAtPath(path, recursionTracker, origin) {
  27637. if (path.length > 0)
  27638. return UnknownValue;
  27639. const argumentValue = this.argument.getLiteralValueAtPath(EMPTY_PATH, recursionTracker, origin);
  27640. if (argumentValue === UnknownValue)
  27641. return UnknownValue;
  27642. return unaryOperators[this.operator](argumentValue);
  27643. }
  27644. hasEffects(context) {
  27645. if (this.operator === 'typeof' && this.argument instanceof Identifier)
  27646. return false;
  27647. return (this.argument.hasEffects(context) ||
  27648. (this.operator === 'delete' &&
  27649. this.argument.hasEffectsWhenAssignedAtPath(EMPTY_PATH, context)));
  27650. }
  27651. hasEffectsWhenAccessedAtPath(path) {
  27652. if (this.operator === 'void') {
  27653. return path.length > 0;
  27654. }
  27655. return path.length > 1;
  27656. }
  27657. }
  27658. class UnknownNode extends NodeBase {
  27659. hasEffects() {
  27660. return true;
  27661. }
  27662. include(context) {
  27663. super.include(context, true);
  27664. }
  27665. }
  27666. class UpdateExpression extends NodeBase {
  27667. bind() {
  27668. super.bind();
  27669. this.argument.deoptimizePath(EMPTY_PATH);
  27670. if (this.argument instanceof Identifier) {
  27671. const variable = this.scope.findVariable(this.argument.name);
  27672. variable.isReassigned = true;
  27673. }
  27674. }
  27675. hasEffects(context) {
  27676. return (this.argument.hasEffects(context) ||
  27677. this.argument.hasEffectsWhenAssignedAtPath(EMPTY_PATH, context));
  27678. }
  27679. hasEffectsWhenAccessedAtPath(path) {
  27680. return path.length > 1;
  27681. }
  27682. render(code, options) {
  27683. this.argument.render(code, options);
  27684. if (options.format === 'system') {
  27685. const variable = this.argument.variable;
  27686. const exportNames = options.exportNamesByVariable.get(variable);
  27687. if (exportNames && exportNames.length) {
  27688. const _ = options.compact ? '' : ' ';
  27689. const name = variable.getName();
  27690. if (this.prefix) {
  27691. if (exportNames.length === 1) {
  27692. code.overwrite(this.start, this.end, `exports('${exportNames[0]}',${_}${this.operator}${name})`);
  27693. }
  27694. else {
  27695. code.overwrite(this.start, this.end, `(${this.operator}${name},${_}${getSystemExportStatement([variable], options)},${_}${name})`);
  27696. }
  27697. }
  27698. else if (exportNames.length > 1) {
  27699. code.overwrite(this.start, this.end, `(${getSystemExportFunctionLeft([variable], false, options)}${this.operator}${name}))`);
  27700. }
  27701. else {
  27702. let op;
  27703. switch (this.operator) {
  27704. case '++':
  27705. op = `${name}${_}+${_}1`;
  27706. break;
  27707. case '--':
  27708. op = `${name}${_}-${_}1`;
  27709. break;
  27710. }
  27711. code.overwrite(this.start, this.end, `(exports('${exportNames[0]}',${_}${op}),${_}${name}${this.operator})`);
  27712. }
  27713. }
  27714. }
  27715. }
  27716. }
  27717. function isReassignedExportsMember(variable, exportNamesByVariable) {
  27718. return (variable.renderBaseName !== null && exportNamesByVariable.has(variable) && variable.isReassigned);
  27719. }
  27720. function areAllDeclarationsIncludedAndNotExported(declarations, exportNamesByVariable) {
  27721. for (const declarator of declarations) {
  27722. if (!declarator.id.included)
  27723. return false;
  27724. if (declarator.id.type === Identifier$1) {
  27725. if (exportNamesByVariable.has(declarator.id.variable))
  27726. return false;
  27727. }
  27728. else {
  27729. const exportedVariables = [];
  27730. declarator.id.addExportedVariables(exportedVariables, exportNamesByVariable);
  27731. if (exportedVariables.length > 0)
  27732. return false;
  27733. }
  27734. }
  27735. return true;
  27736. }
  27737. class VariableDeclaration extends NodeBase {
  27738. deoptimizePath() {
  27739. for (const declarator of this.declarations) {
  27740. declarator.deoptimizePath(EMPTY_PATH);
  27741. }
  27742. }
  27743. hasEffectsWhenAssignedAtPath() {
  27744. return false;
  27745. }
  27746. include(context, includeChildrenRecursively) {
  27747. this.included = true;
  27748. for (const declarator of this.declarations) {
  27749. if (includeChildrenRecursively || declarator.shouldBeIncluded(context))
  27750. declarator.include(context, includeChildrenRecursively);
  27751. }
  27752. }
  27753. includeAsSingleStatement(context, includeChildrenRecursively) {
  27754. this.included = true;
  27755. for (const declarator of this.declarations) {
  27756. if (includeChildrenRecursively || declarator.shouldBeIncluded(context)) {
  27757. declarator.include(context, includeChildrenRecursively);
  27758. declarator.id.include(context, includeChildrenRecursively);
  27759. }
  27760. }
  27761. }
  27762. initialise() {
  27763. for (const declarator of this.declarations) {
  27764. declarator.declareDeclarator(this.kind);
  27765. }
  27766. }
  27767. render(code, options, nodeRenderOptions = BLANK) {
  27768. if (areAllDeclarationsIncludedAndNotExported(this.declarations, options.exportNamesByVariable)) {
  27769. for (const declarator of this.declarations) {
  27770. declarator.render(code, options);
  27771. }
  27772. if (!nodeRenderOptions.isNoStatement &&
  27773. code.original.charCodeAt(this.end - 1) !== 59 /*";"*/) {
  27774. code.appendLeft(this.end, ';');
  27775. }
  27776. }
  27777. else {
  27778. this.renderReplacedDeclarations(code, options, nodeRenderOptions);
  27779. }
  27780. }
  27781. renderDeclarationEnd(code, separatorString, lastSeparatorPos, actualContentEnd, renderedContentEnd, systemPatternExports, options, isNoStatement) {
  27782. if (code.original.charCodeAt(this.end - 1) === 59 /*";"*/) {
  27783. code.remove(this.end - 1, this.end);
  27784. }
  27785. if (!isNoStatement) {
  27786. separatorString += ';';
  27787. }
  27788. if (lastSeparatorPos !== null) {
  27789. if (code.original.charCodeAt(actualContentEnd - 1) === 10 /*"\n"*/ &&
  27790. (code.original.charCodeAt(this.end) === 10 /*"\n"*/ ||
  27791. code.original.charCodeAt(this.end) === 13) /*"\r"*/) {
  27792. actualContentEnd--;
  27793. if (code.original.charCodeAt(actualContentEnd) === 13 /*"\r"*/) {
  27794. actualContentEnd--;
  27795. }
  27796. }
  27797. if (actualContentEnd === lastSeparatorPos + 1) {
  27798. code.overwrite(lastSeparatorPos, renderedContentEnd, separatorString);
  27799. }
  27800. else {
  27801. code.overwrite(lastSeparatorPos, lastSeparatorPos + 1, separatorString);
  27802. code.remove(actualContentEnd, renderedContentEnd);
  27803. }
  27804. }
  27805. else {
  27806. code.appendLeft(renderedContentEnd, separatorString);
  27807. }
  27808. if (systemPatternExports.length > 0) {
  27809. code.appendLeft(renderedContentEnd, ` ${getSystemExportStatement(systemPatternExports, options)};`);
  27810. }
  27811. }
  27812. renderReplacedDeclarations(code, options, { isNoStatement }) {
  27813. const separatedNodes = getCommaSeparatedNodesWithBoundaries(this.declarations, code, this.start + this.kind.length, this.end - (code.original.charCodeAt(this.end - 1) === 59 /*";"*/ ? 1 : 0));
  27814. let actualContentEnd, renderedContentEnd;
  27815. renderedContentEnd = findNonWhiteSpace(code.original, this.start + this.kind.length);
  27816. let lastSeparatorPos = renderedContentEnd - 1;
  27817. code.remove(this.start, lastSeparatorPos);
  27818. let isInDeclaration = false;
  27819. let hasRenderedContent = false;
  27820. let separatorString = '', leadingString, nextSeparatorString;
  27821. const systemPatternExports = [];
  27822. for (const { node, start, separator, contentEnd, end } of separatedNodes) {
  27823. if (!node.included) {
  27824. code.remove(start, end);
  27825. continue;
  27826. }
  27827. leadingString = '';
  27828. nextSeparatorString = '';
  27829. if (!node.id.included ||
  27830. (node.id instanceof Identifier &&
  27831. isReassignedExportsMember(node.id.variable, options.exportNamesByVariable))) {
  27832. if (hasRenderedContent) {
  27833. separatorString += ';';
  27834. }
  27835. isInDeclaration = false;
  27836. }
  27837. else {
  27838. if (options.format === 'system' && node.init !== null) {
  27839. if (node.id.type !== Identifier$1) {
  27840. node.id.addExportedVariables(systemPatternExports, options.exportNamesByVariable);
  27841. }
  27842. else {
  27843. const exportNames = options.exportNamesByVariable.get(node.id.variable);
  27844. if (exportNames) {
  27845. const _ = options.compact ? '' : ' ';
  27846. const operatorPos = findFirstOccurrenceOutsideComment(code.original, '=', node.id.end);
  27847. code.prependLeft(findNonWhiteSpace(code.original, operatorPos + 1), exportNames.length === 1
  27848. ? `exports('${exportNames[0]}',${_}`
  27849. : getSystemExportFunctionLeft([node.id.variable], false, options));
  27850. nextSeparatorString += ')';
  27851. }
  27852. }
  27853. }
  27854. if (isInDeclaration) {
  27855. separatorString += ',';
  27856. }
  27857. else {
  27858. if (hasRenderedContent) {
  27859. separatorString += ';';
  27860. }
  27861. leadingString += `${this.kind} `;
  27862. isInDeclaration = true;
  27863. }
  27864. }
  27865. if (renderedContentEnd === lastSeparatorPos + 1) {
  27866. code.overwrite(lastSeparatorPos, renderedContentEnd, separatorString + leadingString);
  27867. }
  27868. else {
  27869. code.overwrite(lastSeparatorPos, lastSeparatorPos + 1, separatorString);
  27870. code.appendLeft(renderedContentEnd, leadingString);
  27871. }
  27872. node.render(code, options);
  27873. actualContentEnd = contentEnd;
  27874. renderedContentEnd = end;
  27875. hasRenderedContent = true;
  27876. lastSeparatorPos = separator;
  27877. separatorString = nextSeparatorString;
  27878. }
  27879. this.renderDeclarationEnd(code, separatorString, lastSeparatorPos, actualContentEnd, renderedContentEnd, systemPatternExports, options, isNoStatement);
  27880. }
  27881. }
  27882. class VariableDeclarator extends NodeBase {
  27883. declareDeclarator(kind) {
  27884. this.id.declare(kind, this.init || UNDEFINED_EXPRESSION);
  27885. }
  27886. deoptimizePath(path) {
  27887. this.id.deoptimizePath(path);
  27888. }
  27889. hasEffects(context) {
  27890. return this.id.hasEffects(context) || (this.init !== null && this.init.hasEffects(context));
  27891. }
  27892. include(context, includeChildrenRecursively) {
  27893. this.included = true;
  27894. if (includeChildrenRecursively || this.id.shouldBeIncluded(context)) {
  27895. this.id.include(context, includeChildrenRecursively);
  27896. }
  27897. if (this.init) {
  27898. this.init.include(context, includeChildrenRecursively);
  27899. }
  27900. }
  27901. render(code, options) {
  27902. const renderId = this.id.included;
  27903. if (renderId) {
  27904. this.id.render(code, options);
  27905. }
  27906. else {
  27907. const operatorPos = findFirstOccurrenceOutsideComment(code.original, '=', this.id.end);
  27908. code.remove(this.start, findNonWhiteSpace(code.original, operatorPos + 1));
  27909. }
  27910. if (this.init) {
  27911. this.init.render(code, options, renderId ? BLANK : { renderedParentType: ExpressionStatement$1 });
  27912. }
  27913. else if (this.id instanceof Identifier &&
  27914. isReassignedExportsMember(this.id.variable, options.exportNamesByVariable)) {
  27915. const _ = options.compact ? '' : ' ';
  27916. code.appendLeft(this.end, `${_}=${_}void 0`);
  27917. }
  27918. }
  27919. }
  27920. class WhileStatement extends NodeBase {
  27921. hasEffects(context) {
  27922. if (this.test.hasEffects(context))
  27923. return true;
  27924. const { brokenFlow, ignore: { breaks, continues } } = context;
  27925. context.ignore.breaks = true;
  27926. context.ignore.continues = true;
  27927. if (this.body.hasEffects(context))
  27928. return true;
  27929. context.ignore.breaks = breaks;
  27930. context.ignore.continues = continues;
  27931. context.brokenFlow = brokenFlow;
  27932. return false;
  27933. }
  27934. include(context, includeChildrenRecursively) {
  27935. this.included = true;
  27936. this.test.include(context, includeChildrenRecursively);
  27937. const { brokenFlow } = context;
  27938. this.body.includeAsSingleStatement(context, includeChildrenRecursively);
  27939. context.brokenFlow = brokenFlow;
  27940. }
  27941. }
  27942. class YieldExpression extends NodeBase {
  27943. bind() {
  27944. super.bind();
  27945. if (this.argument !== null) {
  27946. this.argument.deoptimizePath(UNKNOWN_PATH);
  27947. }
  27948. }
  27949. hasEffects(context) {
  27950. return (!context.ignore.returnAwaitYield ||
  27951. (this.argument !== null && this.argument.hasEffects(context)));
  27952. }
  27953. render(code, options) {
  27954. if (this.argument) {
  27955. this.argument.render(code, options, { preventASI: true });
  27956. if (this.argument.start === this.start + 5 /* 'yield'.length */) {
  27957. code.prependLeft(this.start + 5, ' ');
  27958. }
  27959. }
  27960. }
  27961. }
  27962. const nodeConstructors = {
  27963. ArrayExpression,
  27964. ArrayPattern,
  27965. ArrowFunctionExpression,
  27966. AssignmentExpression,
  27967. AssignmentPattern,
  27968. AwaitExpression,
  27969. BinaryExpression,
  27970. BlockStatement,
  27971. BreakStatement,
  27972. CallExpression,
  27973. CatchClause,
  27974. ChainExpression,
  27975. ClassBody,
  27976. ClassDeclaration,
  27977. ClassExpression,
  27978. ConditionalExpression,
  27979. ContinueStatement,
  27980. DoWhileStatement,
  27981. EmptyStatement,
  27982. ExportAllDeclaration,
  27983. ExportDefaultDeclaration,
  27984. ExportNamedDeclaration,
  27985. ExportSpecifier,
  27986. ExpressionStatement,
  27987. ForInStatement,
  27988. ForOfStatement,
  27989. ForStatement,
  27990. FunctionDeclaration,
  27991. FunctionExpression,
  27992. Identifier,
  27993. IfStatement,
  27994. ImportDeclaration,
  27995. ImportDefaultSpecifier,
  27996. ImportExpression,
  27997. ImportNamespaceSpecifier,
  27998. ImportSpecifier,
  27999. LabeledStatement,
  28000. Literal,
  28001. LogicalExpression,
  28002. MemberExpression,
  28003. MetaProperty,
  28004. MethodDefinition,
  28005. NewExpression,
  28006. ObjectExpression,
  28007. ObjectPattern,
  28008. PrivateIdentifier,
  28009. Program,
  28010. Property,
  28011. PropertyDefinition,
  28012. RestElement,
  28013. ReturnStatement,
  28014. SequenceExpression,
  28015. SpreadElement,
  28016. Super,
  28017. SwitchCase,
  28018. SwitchStatement,
  28019. TaggedTemplateExpression,
  28020. TemplateElement,
  28021. TemplateLiteral,
  28022. ThisExpression,
  28023. ThrowStatement,
  28024. TryStatement,
  28025. UnaryExpression,
  28026. UnknownNode,
  28027. UpdateExpression,
  28028. VariableDeclaration,
  28029. VariableDeclarator,
  28030. WhileStatement,
  28031. YieldExpression
  28032. };
  28033. function getId(m) {
  28034. return m.id;
  28035. }
  28036. function getOriginalLocation(sourcemapChain, location) {
  28037. // This cast is guaranteed. If it were a missing Map, it wouldn't have a mappings.
  28038. const filteredSourcemapChain = sourcemapChain.filter(sourcemap => sourcemap.mappings);
  28039. while (filteredSourcemapChain.length > 0) {
  28040. const sourcemap = filteredSourcemapChain.pop();
  28041. const line = sourcemap.mappings[location.line - 1];
  28042. let locationFound = false;
  28043. if (line !== undefined) {
  28044. for (const segment of line) {
  28045. if (segment[0] >= location.column) {
  28046. if (segment.length === 1)
  28047. break;
  28048. location = {
  28049. column: segment[3],
  28050. line: segment[2] + 1,
  28051. name: segment.length === 5 ? sourcemap.names[segment[4]] : undefined,
  28052. source: sourcemap.sources[segment[1]]
  28053. };
  28054. locationFound = true;
  28055. break;
  28056. }
  28057. }
  28058. }
  28059. if (!locationFound) {
  28060. throw new Error("Can't resolve original location of error.");
  28061. }
  28062. }
  28063. return location;
  28064. }
  28065. // this looks ridiculous, but it prevents sourcemap tooling from mistaking
  28066. // this for an actual sourceMappingURL
  28067. let SOURCEMAPPING_URL = 'sourceMa';
  28068. SOURCEMAPPING_URL += 'ppingURL';
  28069. const whiteSpaceNoNewline = '[ \\f\\r\\t\\v\\u00a0\\u1680\\u2000-\\u200a\\u2028\\u2029\\u202f\\u205f\\u3000\\ufeff]';
  28070. const SOURCEMAPPING_URL_LINE_COMMENT_RE = `//#${whiteSpaceNoNewline}+${SOURCEMAPPING_URL}=.+`;
  28071. const SOURCEMAPPING_URL_BLOCK_COMMENT_RE = `/\\*#${whiteSpaceNoNewline}+${SOURCEMAPPING_URL}=.+\\*/`;
  28072. const SOURCEMAPPING_URL_COMMENT_RE = new RegExp(`(${SOURCEMAPPING_URL_LINE_COMMENT_RE})|(${SOURCEMAPPING_URL_BLOCK_COMMENT_RE})`, 'g');
  28073. const NOOP = () => { };
  28074. let getStartTime = () => [0, 0];
  28075. let getElapsedTime = () => 0;
  28076. let getMemory = () => 0;
  28077. let timers = {};
  28078. const normalizeHrTime = (time) => time[0] * 1e3 + time[1] / 1e6;
  28079. function setTimeHelpers() {
  28080. if (typeof process !== 'undefined' && typeof process.hrtime === 'function') {
  28081. getStartTime = process.hrtime.bind(process);
  28082. getElapsedTime = previous => normalizeHrTime(process.hrtime(previous));
  28083. }
  28084. else if (typeof performance !== 'undefined' && typeof performance.now === 'function') {
  28085. getStartTime = () => [performance.now(), 0];
  28086. getElapsedTime = previous => performance.now() - previous[0];
  28087. }
  28088. if (typeof process !== 'undefined' && typeof process.memoryUsage === 'function') {
  28089. getMemory = () => process.memoryUsage().heapUsed;
  28090. }
  28091. }
  28092. function getPersistedLabel(label, level) {
  28093. switch (level) {
  28094. case 1:
  28095. return `# ${label}`;
  28096. case 2:
  28097. return `## ${label}`;
  28098. case 3:
  28099. return label;
  28100. default:
  28101. return `${' '.repeat(level - 4)}- ${label}`;
  28102. }
  28103. }
  28104. function timeStartImpl(label, level = 3) {
  28105. label = getPersistedLabel(label, level);
  28106. if (!timers.hasOwnProperty(label)) {
  28107. timers[label] = {
  28108. memory: 0,
  28109. startMemory: undefined,
  28110. startTime: undefined,
  28111. time: 0,
  28112. totalMemory: 0
  28113. };
  28114. }
  28115. const currentMemory = getMemory();
  28116. timers[label].startTime = getStartTime();
  28117. timers[label].startMemory = currentMemory;
  28118. }
  28119. function timeEndImpl(label, level = 3) {
  28120. label = getPersistedLabel(label, level);
  28121. if (timers.hasOwnProperty(label)) {
  28122. const currentMemory = getMemory();
  28123. timers[label].time += getElapsedTime(timers[label].startTime);
  28124. timers[label].totalMemory = Math.max(timers[label].totalMemory, currentMemory);
  28125. timers[label].memory += currentMemory - timers[label].startMemory;
  28126. }
  28127. }
  28128. function getTimings() {
  28129. const newTimings = {};
  28130. for (const label of Object.keys(timers)) {
  28131. newTimings[label] = [timers[label].time, timers[label].memory, timers[label].totalMemory];
  28132. }
  28133. return newTimings;
  28134. }
  28135. let timeStart = NOOP, timeEnd = NOOP;
  28136. const TIMED_PLUGIN_HOOKS = {
  28137. load: true,
  28138. resolveDynamicImport: true,
  28139. resolveId: true,
  28140. transform: true
  28141. };
  28142. function getPluginWithTimers(plugin, index) {
  28143. const timedPlugin = {};
  28144. for (const hook of Object.keys(plugin)) {
  28145. if (TIMED_PLUGIN_HOOKS[hook] === true) {
  28146. let timerLabel = `plugin ${index}`;
  28147. if (plugin.name) {
  28148. timerLabel += ` (${plugin.name})`;
  28149. }
  28150. timerLabel += ` - ${hook}`;
  28151. timedPlugin[hook] = function () {
  28152. timeStart(timerLabel, 4);
  28153. let result = plugin[hook].apply(this === timedPlugin ? plugin : this, arguments);
  28154. timeEnd(timerLabel, 4);
  28155. if (result && typeof result.then === 'function') {
  28156. timeStart(`${timerLabel} (async)`, 4);
  28157. result = result.then(() => timeEnd(`${timerLabel} (async)`, 4));
  28158. }
  28159. return result;
  28160. };
  28161. }
  28162. else {
  28163. timedPlugin[hook] = plugin[hook];
  28164. }
  28165. }
  28166. return timedPlugin;
  28167. }
  28168. function initialiseTimers(inputOptions) {
  28169. if (inputOptions.perf) {
  28170. timers = {};
  28171. setTimeHelpers();
  28172. timeStart = timeStartImpl;
  28173. timeEnd = timeEndImpl;
  28174. inputOptions.plugins = inputOptions.plugins.map(getPluginWithTimers);
  28175. }
  28176. else {
  28177. timeStart = NOOP;
  28178. timeEnd = NOOP;
  28179. }
  28180. }
  28181. function markModuleAndImpureDependenciesAsExecuted(baseModule) {
  28182. baseModule.isExecuted = true;
  28183. const modules = [baseModule];
  28184. const visitedModules = new Set();
  28185. for (const module of modules) {
  28186. for (const dependency of [...module.dependencies, ...module.implicitlyLoadedBefore]) {
  28187. if (!(dependency instanceof ExternalModule) &&
  28188. !dependency.isExecuted &&
  28189. (dependency.info.hasModuleSideEffects || module.implicitlyLoadedBefore.has(dependency)) &&
  28190. !visitedModules.has(dependency.id)) {
  28191. dependency.isExecuted = true;
  28192. visitedModules.add(dependency.id);
  28193. modules.push(dependency);
  28194. }
  28195. }
  28196. }
  28197. }
  28198. const MISSING_EXPORT_SHIM_DESCRIPTION = {
  28199. identifier: null,
  28200. localName: MISSING_EXPORT_SHIM_VARIABLE
  28201. };
  28202. function findSourceMappingURLComments(ast, code) {
  28203. const ret = [];
  28204. const addCommentsPos = (start, end) => {
  28205. if (start == end) {
  28206. return;
  28207. }
  28208. let sourcemappingUrlMatch;
  28209. const interStatmentCode = code.slice(start, end);
  28210. while (sourcemappingUrlMatch = SOURCEMAPPING_URL_COMMENT_RE.exec(interStatmentCode)) {
  28211. ret.push([start + sourcemappingUrlMatch.index, start + SOURCEMAPPING_URL_COMMENT_RE.lastIndex]);
  28212. }
  28213. };
  28214. let prevStmtEnd = 0;
  28215. for (const stmt of ast.body) {
  28216. addCommentsPos(prevStmtEnd, stmt.start);
  28217. prevStmtEnd = stmt.end;
  28218. }
  28219. addCommentsPos(prevStmtEnd, code.length);
  28220. return ret;
  28221. }
  28222. function getVariableForExportNameRecursive(target, name, importerForSideEffects, isExportAllSearch, searchedNamesAndModules = new Map()) {
  28223. const searchedModules = searchedNamesAndModules.get(name);
  28224. if (searchedModules) {
  28225. if (searchedModules.has(target)) {
  28226. return isExportAllSearch ? null : error(errCircularReexport(name, target.id));
  28227. }
  28228. searchedModules.add(target);
  28229. }
  28230. else {
  28231. searchedNamesAndModules.set(name, new Set([target]));
  28232. }
  28233. return target.getVariableForExportName(name, importerForSideEffects, isExportAllSearch, searchedNamesAndModules);
  28234. }
  28235. function getAndExtendSideEffectModules(variable, module) {
  28236. const sideEffectModules = getOrCreate(module.sideEffectDependenciesByVariable, variable, () => new Set());
  28237. let currentVariable = variable;
  28238. const referencedVariables = new Set([currentVariable]);
  28239. while (true) {
  28240. const importingModule = currentVariable.module;
  28241. currentVariable =
  28242. currentVariable instanceof ExportDefaultVariable
  28243. ? currentVariable.getDirectOriginalVariable()
  28244. : currentVariable instanceof SyntheticNamedExportVariable
  28245. ? currentVariable.syntheticNamespace
  28246. : null;
  28247. if (!currentVariable || referencedVariables.has(currentVariable)) {
  28248. break;
  28249. }
  28250. referencedVariables.add(currentVariable);
  28251. sideEffectModules.add(importingModule);
  28252. const originalSideEffects = importingModule.sideEffectDependenciesByVariable.get(currentVariable);
  28253. if (originalSideEffects) {
  28254. for (const module of originalSideEffects) {
  28255. sideEffectModules.add(module);
  28256. }
  28257. }
  28258. }
  28259. return sideEffectModules;
  28260. }
  28261. class Module$1 {
  28262. constructor(graph, id, options, isEntry, hasModuleSideEffects, syntheticNamedExports, meta) {
  28263. this.graph = graph;
  28264. this.id = id;
  28265. this.options = options;
  28266. this.alternativeReexportModules = new Map();
  28267. this.ast = null;
  28268. this.chunkFileNames = new Set();
  28269. this.chunkName = null;
  28270. this.cycles = new Set();
  28271. this.dependencies = new Set();
  28272. this.dynamicDependencies = new Set();
  28273. this.dynamicImporters = [];
  28274. this.dynamicImports = [];
  28275. this.execIndex = Infinity;
  28276. this.exportAllSources = new Set();
  28277. this.exports = Object.create(null);
  28278. this.exportsAll = Object.create(null);
  28279. this.implicitlyLoadedAfter = new Set();
  28280. this.implicitlyLoadedBefore = new Set();
  28281. this.importDescriptions = Object.create(null);
  28282. this.importers = [];
  28283. this.importMetas = [];
  28284. this.imports = new Set();
  28285. this.includedDynamicImporters = [];
  28286. this.isExecuted = false;
  28287. this.isUserDefinedEntryPoint = false;
  28288. this.preserveSignature = this.options.preserveEntrySignatures;
  28289. this.reexportDescriptions = Object.create(null);
  28290. this.sideEffectDependenciesByVariable = new Map();
  28291. this.sources = new Set();
  28292. this.userChunkNames = new Set();
  28293. this.usesTopLevelAwait = false;
  28294. this.allExportNames = null;
  28295. this.exportAllModules = [];
  28296. this.exportNamesByVariable = null;
  28297. this.exportShimVariable = new ExportShimVariable(this);
  28298. this.relevantDependencies = null;
  28299. this.syntheticExports = new Map();
  28300. this.syntheticNamespace = null;
  28301. this.transformDependencies = [];
  28302. this.transitiveReexports = null;
  28303. this.excludeFromSourcemap = /\0/.test(id);
  28304. this.context = options.moduleContext(id);
  28305. const module = this;
  28306. this.info = {
  28307. ast: null,
  28308. code: null,
  28309. get dynamicallyImportedIds() {
  28310. const dynamicallyImportedIds = [];
  28311. for (const { resolution } of module.dynamicImports) {
  28312. if (resolution instanceof Module$1 || resolution instanceof ExternalModule) {
  28313. dynamicallyImportedIds.push(resolution.id);
  28314. }
  28315. }
  28316. return dynamicallyImportedIds;
  28317. },
  28318. get dynamicImporters() {
  28319. return module.dynamicImporters.sort();
  28320. },
  28321. hasModuleSideEffects,
  28322. id,
  28323. get implicitlyLoadedAfterOneOf() {
  28324. return Array.from(module.implicitlyLoadedAfter, getId);
  28325. },
  28326. get implicitlyLoadedBefore() {
  28327. return Array.from(module.implicitlyLoadedBefore, getId);
  28328. },
  28329. get importedIds() {
  28330. return Array.from(module.sources, source => module.resolvedIds[source].id);
  28331. },
  28332. get importers() {
  28333. return module.importers.sort();
  28334. },
  28335. isEntry,
  28336. isExternal: false,
  28337. meta,
  28338. syntheticNamedExports
  28339. };
  28340. }
  28341. basename() {
  28342. const base = basename(this.id);
  28343. const ext = extname$1(this.id);
  28344. return makeLegal(ext ? base.slice(0, -ext.length) : base);
  28345. }
  28346. bindReferences() {
  28347. this.ast.bind();
  28348. }
  28349. error(props, pos) {
  28350. this.addLocationToLogProps(props, pos);
  28351. return error(props);
  28352. }
  28353. getAllExportNames() {
  28354. if (this.allExportNames) {
  28355. return this.allExportNames;
  28356. }
  28357. const allExportNames = (this.allExportNames = new Set());
  28358. for (const name of Object.keys(this.exports)) {
  28359. allExportNames.add(name);
  28360. }
  28361. for (const name of Object.keys(this.reexportDescriptions)) {
  28362. allExportNames.add(name);
  28363. }
  28364. for (const module of this.exportAllModules) {
  28365. if (module instanceof ExternalModule) {
  28366. allExportNames.add(`*${module.id}`);
  28367. continue;
  28368. }
  28369. for (const name of module.getAllExportNames()) {
  28370. if (name !== 'default')
  28371. allExportNames.add(name);
  28372. }
  28373. }
  28374. return allExportNames;
  28375. }
  28376. getDependenciesToBeIncluded() {
  28377. if (this.relevantDependencies)
  28378. return this.relevantDependencies;
  28379. const relevantDependencies = new Set();
  28380. const necessaryDependencies = new Set();
  28381. const alwaysCheckedDependencies = new Set();
  28382. let dependencyVariables = this.imports.keys();
  28383. if (this.info.isEntry ||
  28384. this.includedDynamicImporters.length > 0 ||
  28385. this.namespace.included ||
  28386. this.implicitlyLoadedAfter.size > 0) {
  28387. dependencyVariables = new Set(dependencyVariables);
  28388. for (const exportName of [...this.getReexports(), ...this.getExports()]) {
  28389. dependencyVariables.add(this.getVariableForExportName(exportName));
  28390. }
  28391. }
  28392. for (let variable of dependencyVariables) {
  28393. const sideEffectDependencies = this.sideEffectDependenciesByVariable.get(variable);
  28394. if (sideEffectDependencies) {
  28395. for (const module of sideEffectDependencies) {
  28396. alwaysCheckedDependencies.add(module);
  28397. }
  28398. }
  28399. if (variable instanceof SyntheticNamedExportVariable) {
  28400. variable = variable.getBaseVariable();
  28401. }
  28402. else if (variable instanceof ExportDefaultVariable) {
  28403. variable = variable.getOriginalVariable();
  28404. }
  28405. necessaryDependencies.add(variable.module);
  28406. }
  28407. if (this.options.treeshake && this.info.hasModuleSideEffects !== 'no-treeshake') {
  28408. this.addRelevantSideEffectDependencies(relevantDependencies, necessaryDependencies, alwaysCheckedDependencies);
  28409. }
  28410. else {
  28411. for (const dependency of this.dependencies) {
  28412. relevantDependencies.add(dependency);
  28413. }
  28414. }
  28415. for (const dependency of necessaryDependencies) {
  28416. relevantDependencies.add(dependency);
  28417. }
  28418. return (this.relevantDependencies = relevantDependencies);
  28419. }
  28420. getExportNamesByVariable() {
  28421. if (this.exportNamesByVariable) {
  28422. return this.exportNamesByVariable;
  28423. }
  28424. const exportNamesByVariable = new Map();
  28425. for (const exportName of this.getAllExportNames()) {
  28426. if (exportName === this.info.syntheticNamedExports)
  28427. continue;
  28428. let tracedVariable = this.getVariableForExportName(exportName);
  28429. if (tracedVariable instanceof ExportDefaultVariable) {
  28430. tracedVariable = tracedVariable.getOriginalVariable();
  28431. }
  28432. if (!tracedVariable ||
  28433. !(tracedVariable.included || tracedVariable instanceof ExternalVariable)) {
  28434. continue;
  28435. }
  28436. const existingExportNames = exportNamesByVariable.get(tracedVariable);
  28437. if (existingExportNames) {
  28438. existingExportNames.push(exportName);
  28439. }
  28440. else {
  28441. exportNamesByVariable.set(tracedVariable, [exportName]);
  28442. }
  28443. }
  28444. return (this.exportNamesByVariable = exportNamesByVariable);
  28445. }
  28446. getExports() {
  28447. return Object.keys(this.exports);
  28448. }
  28449. getReexports() {
  28450. if (this.transitiveReexports) {
  28451. return this.transitiveReexports;
  28452. }
  28453. // to avoid infinite recursion when using circular `export * from X`
  28454. this.transitiveReexports = [];
  28455. const reexports = new Set();
  28456. for (const name in this.reexportDescriptions) {
  28457. reexports.add(name);
  28458. }
  28459. for (const module of this.exportAllModules) {
  28460. if (module instanceof ExternalModule) {
  28461. reexports.add(`*${module.id}`);
  28462. }
  28463. else {
  28464. for (const name of [...module.getReexports(), ...module.getExports()]) {
  28465. if (name !== 'default')
  28466. reexports.add(name);
  28467. }
  28468. }
  28469. }
  28470. return (this.transitiveReexports = [...reexports]);
  28471. }
  28472. getRenderedExports() {
  28473. // only direct exports are counted here, not reexports at all
  28474. const renderedExports = [];
  28475. const removedExports = [];
  28476. for (const exportName in this.exports) {
  28477. const variable = this.getVariableForExportName(exportName);
  28478. (variable && variable.included ? renderedExports : removedExports).push(exportName);
  28479. }
  28480. return { renderedExports, removedExports };
  28481. }
  28482. getSyntheticNamespace() {
  28483. if (this.syntheticNamespace === null) {
  28484. this.syntheticNamespace = undefined;
  28485. this.syntheticNamespace = this.getVariableForExportName(typeof this.info.syntheticNamedExports === 'string'
  28486. ? this.info.syntheticNamedExports
  28487. : 'default');
  28488. }
  28489. if (!this.syntheticNamespace) {
  28490. return error(errSyntheticNamedExportsNeedNamespaceExport(this.id, this.info.syntheticNamedExports));
  28491. }
  28492. return this.syntheticNamespace;
  28493. }
  28494. getVariableForExportName(name, importerForSideEffects, isExportAllSearch, searchedNamesAndModules) {
  28495. if (name[0] === '*') {
  28496. if (name.length === 1) {
  28497. // export * from './other'
  28498. return this.namespace;
  28499. }
  28500. else {
  28501. // export * from 'external'
  28502. const module = this.graph.modulesById.get(name.slice(1));
  28503. return module.getVariableForExportName('*');
  28504. }
  28505. }
  28506. // export { foo } from './other'
  28507. const reexportDeclaration = this.reexportDescriptions[name];
  28508. if (reexportDeclaration) {
  28509. const variable = getVariableForExportNameRecursive(reexportDeclaration.module, reexportDeclaration.localName, importerForSideEffects, false, searchedNamesAndModules);
  28510. if (!variable) {
  28511. return this.error(errMissingExport(reexportDeclaration.localName, this.id, reexportDeclaration.module.id), reexportDeclaration.start);
  28512. }
  28513. if (importerForSideEffects) {
  28514. setAlternativeExporterIfCyclic(variable, importerForSideEffects, this);
  28515. }
  28516. return variable;
  28517. }
  28518. const exportDeclaration = this.exports[name];
  28519. if (exportDeclaration) {
  28520. if (exportDeclaration === MISSING_EXPORT_SHIM_DESCRIPTION) {
  28521. return this.exportShimVariable;
  28522. }
  28523. const name = exportDeclaration.localName;
  28524. const variable = this.traceVariable(name, importerForSideEffects);
  28525. if (importerForSideEffects) {
  28526. getOrCreate(importerForSideEffects.sideEffectDependenciesByVariable, variable, () => new Set()).add(this);
  28527. setAlternativeExporterIfCyclic(variable, importerForSideEffects, this);
  28528. }
  28529. return variable;
  28530. }
  28531. if (name !== 'default') {
  28532. let foundSyntheticDeclaration = null;
  28533. for (const module of this.exportAllModules) {
  28534. const declaration = getVariableForExportNameRecursive(module, name, importerForSideEffects, true, searchedNamesAndModules);
  28535. if (declaration) {
  28536. if (!(declaration instanceof SyntheticNamedExportVariable)) {
  28537. return declaration;
  28538. }
  28539. if (!foundSyntheticDeclaration) {
  28540. foundSyntheticDeclaration = declaration;
  28541. }
  28542. }
  28543. }
  28544. if (foundSyntheticDeclaration) {
  28545. return foundSyntheticDeclaration;
  28546. }
  28547. }
  28548. if (this.info.syntheticNamedExports) {
  28549. let syntheticExport = this.syntheticExports.get(name);
  28550. if (!syntheticExport) {
  28551. const syntheticNamespace = this.getSyntheticNamespace();
  28552. syntheticExport = new SyntheticNamedExportVariable(this.astContext, name, syntheticNamespace);
  28553. this.syntheticExports.set(name, syntheticExport);
  28554. return syntheticExport;
  28555. }
  28556. return syntheticExport;
  28557. }
  28558. // we don't want to create shims when we are just
  28559. // probing export * modules for exports
  28560. if (!isExportAllSearch) {
  28561. if (this.options.shimMissingExports) {
  28562. this.shimMissingExport(name);
  28563. return this.exportShimVariable;
  28564. }
  28565. }
  28566. return null;
  28567. }
  28568. hasEffects() {
  28569. return (this.info.hasModuleSideEffects === 'no-treeshake' ||
  28570. (this.ast.included && this.ast.hasEffects(createHasEffectsContext())));
  28571. }
  28572. include() {
  28573. const context = createInclusionContext();
  28574. if (this.ast.shouldBeIncluded(context))
  28575. this.ast.include(context, false);
  28576. }
  28577. includeAllExports(includeNamespaceMembers) {
  28578. if (!this.isExecuted) {
  28579. this.graph.needsTreeshakingPass = true;
  28580. markModuleAndImpureDependenciesAsExecuted(this);
  28581. }
  28582. for (const exportName of this.getExports()) {
  28583. if (includeNamespaceMembers || exportName !== this.info.syntheticNamedExports) {
  28584. const variable = this.getVariableForExportName(exportName);
  28585. variable.deoptimizePath(UNKNOWN_PATH);
  28586. if (!variable.included) {
  28587. this.includeVariable(variable);
  28588. }
  28589. }
  28590. }
  28591. for (const name of this.getReexports()) {
  28592. const variable = this.getVariableForExportName(name);
  28593. variable.deoptimizePath(UNKNOWN_PATH);
  28594. if (!variable.included) {
  28595. this.includeVariable(variable);
  28596. }
  28597. if (variable instanceof ExternalVariable) {
  28598. variable.module.reexported = true;
  28599. }
  28600. }
  28601. if (includeNamespaceMembers) {
  28602. this.namespace.prepareNamespace(this.includeAndGetAdditionalMergedNamespaces());
  28603. }
  28604. }
  28605. includeAllInBundle() {
  28606. this.ast.include(createInclusionContext(), true);
  28607. }
  28608. isIncluded() {
  28609. return this.ast.included || this.namespace.included;
  28610. }
  28611. linkImports() {
  28612. this.addModulesToImportDescriptions(this.importDescriptions);
  28613. this.addModulesToImportDescriptions(this.reexportDescriptions);
  28614. for (const name in this.exports) {
  28615. if (name !== 'default' && name !== this.info.syntheticNamedExports) {
  28616. this.exportsAll[name] = this.id;
  28617. }
  28618. }
  28619. const externalExportAllModules = [];
  28620. for (const source of this.exportAllSources) {
  28621. const module = this.graph.modulesById.get(this.resolvedIds[source].id);
  28622. if (module instanceof ExternalModule) {
  28623. externalExportAllModules.push(module);
  28624. continue;
  28625. }
  28626. this.exportAllModules.push(module);
  28627. for (const name in module.exportsAll) {
  28628. if (name in this.exportsAll) {
  28629. this.options.onwarn(errNamespaceConflict(name, this, module));
  28630. }
  28631. else {
  28632. this.exportsAll[name] = module.exportsAll[name];
  28633. }
  28634. }
  28635. }
  28636. this.exportAllModules.push(...externalExportAllModules);
  28637. }
  28638. render(options) {
  28639. const magicString = this.magicString.clone();
  28640. this.ast.render(magicString, options);
  28641. this.usesTopLevelAwait = this.astContext.usesTopLevelAwait;
  28642. return magicString;
  28643. }
  28644. setSource({ alwaysRemovedCode, ast, code, customTransformCache, originalCode, originalSourcemap, resolvedIds, sourcemapChain, transformDependencies, transformFiles, ...moduleOptions }) {
  28645. this.info.code = code;
  28646. this.originalCode = originalCode;
  28647. this.originalSourcemap = originalSourcemap;
  28648. this.sourcemapChain = sourcemapChain;
  28649. if (transformFiles) {
  28650. this.transformFiles = transformFiles;
  28651. }
  28652. this.transformDependencies = transformDependencies;
  28653. this.customTransformCache = customTransformCache;
  28654. this.updateOptions(moduleOptions);
  28655. timeStart('generate ast', 3);
  28656. this.alwaysRemovedCode = alwaysRemovedCode || [];
  28657. if (!ast) {
  28658. ast = this.tryParse();
  28659. }
  28660. this.alwaysRemovedCode.push(...findSourceMappingURLComments(ast, this.info.code));
  28661. timeEnd('generate ast', 3);
  28662. this.resolvedIds = resolvedIds || Object.create(null);
  28663. // By default, `id` is the file name. Custom resolvers and loaders
  28664. // can change that, but it makes sense to use it for the source file name
  28665. const fileName = this.id;
  28666. this.magicString = new MagicString$1(code, {
  28667. filename: (this.excludeFromSourcemap ? null : fileName),
  28668. indentExclusionRanges: []
  28669. });
  28670. for (const [start, end] of this.alwaysRemovedCode) {
  28671. this.magicString.remove(start, end);
  28672. }
  28673. timeStart('analyse ast', 3);
  28674. this.astContext = {
  28675. addDynamicImport: this.addDynamicImport.bind(this),
  28676. addExport: this.addExport.bind(this),
  28677. addImport: this.addImport.bind(this),
  28678. addImportMeta: this.addImportMeta.bind(this),
  28679. code,
  28680. deoptimizationTracker: this.graph.deoptimizationTracker,
  28681. error: this.error.bind(this),
  28682. fileName,
  28683. getExports: this.getExports.bind(this),
  28684. getModuleExecIndex: () => this.execIndex,
  28685. getModuleName: this.basename.bind(this),
  28686. getReexports: this.getReexports.bind(this),
  28687. importDescriptions: this.importDescriptions,
  28688. includeAllExports: () => this.includeAllExports(true),
  28689. includeDynamicImport: this.includeDynamicImport.bind(this),
  28690. includeVariableInModule: this.includeVariableInModule.bind(this),
  28691. magicString: this.magicString,
  28692. module: this,
  28693. moduleContext: this.context,
  28694. nodeConstructors,
  28695. options: this.options,
  28696. traceExport: this.getVariableForExportName.bind(this),
  28697. traceVariable: this.traceVariable.bind(this),
  28698. usesTopLevelAwait: false,
  28699. warn: this.warn.bind(this)
  28700. };
  28701. this.scope = new ModuleScope(this.graph.scope, this.astContext);
  28702. this.namespace = new NamespaceVariable(this.astContext, this.info.syntheticNamedExports);
  28703. this.ast = new Program(ast, { type: 'Module', context: this.astContext }, this.scope);
  28704. this.info.ast = ast;
  28705. timeEnd('analyse ast', 3);
  28706. }
  28707. toJSON() {
  28708. return {
  28709. alwaysRemovedCode: this.alwaysRemovedCode,
  28710. ast: this.ast.esTreeNode,
  28711. code: this.info.code,
  28712. customTransformCache: this.customTransformCache,
  28713. dependencies: Array.from(this.dependencies, getId),
  28714. id: this.id,
  28715. meta: this.info.meta,
  28716. moduleSideEffects: this.info.hasModuleSideEffects,
  28717. originalCode: this.originalCode,
  28718. originalSourcemap: this.originalSourcemap,
  28719. resolvedIds: this.resolvedIds,
  28720. sourcemapChain: this.sourcemapChain,
  28721. syntheticNamedExports: this.info.syntheticNamedExports,
  28722. transformDependencies: this.transformDependencies,
  28723. transformFiles: this.transformFiles
  28724. };
  28725. }
  28726. traceVariable(name, importerForSideEffects) {
  28727. const localVariable = this.scope.variables.get(name);
  28728. if (localVariable) {
  28729. return localVariable;
  28730. }
  28731. if (name in this.importDescriptions) {
  28732. const importDeclaration = this.importDescriptions[name];
  28733. const otherModule = importDeclaration.module;
  28734. if (otherModule instanceof Module$1 && importDeclaration.name === '*') {
  28735. return otherModule.namespace;
  28736. }
  28737. const declaration = otherModule.getVariableForExportName(importDeclaration.name, importerForSideEffects || this);
  28738. if (!declaration) {
  28739. return this.error(errMissingExport(importDeclaration.name, this.id, otherModule.id), importDeclaration.start);
  28740. }
  28741. return declaration;
  28742. }
  28743. return null;
  28744. }
  28745. tryParse() {
  28746. try {
  28747. return this.graph.contextParse(this.info.code);
  28748. }
  28749. catch (err) {
  28750. let message = err.message.replace(/ \(\d+:\d+\)$/, '');
  28751. if (this.id.endsWith('.json')) {
  28752. message += ' (Note that you need @rollup/plugin-json to import JSON files)';
  28753. }
  28754. else if (!this.id.endsWith('.js')) {
  28755. message += ' (Note that you need plugins to import files that are not JavaScript)';
  28756. }
  28757. return this.error({
  28758. code: 'PARSE_ERROR',
  28759. message,
  28760. parserError: err
  28761. }, err.pos);
  28762. }
  28763. }
  28764. updateOptions({ meta, moduleSideEffects, syntheticNamedExports }) {
  28765. if (moduleSideEffects != null) {
  28766. this.info.hasModuleSideEffects = moduleSideEffects;
  28767. }
  28768. if (syntheticNamedExports != null) {
  28769. this.info.syntheticNamedExports = syntheticNamedExports;
  28770. }
  28771. if (meta != null) {
  28772. this.info.meta = { ...this.info.meta, ...meta };
  28773. }
  28774. }
  28775. warn(props, pos) {
  28776. this.addLocationToLogProps(props, pos);
  28777. this.options.onwarn(props);
  28778. }
  28779. addDynamicImport(node) {
  28780. let argument = node.source;
  28781. if (argument instanceof TemplateLiteral) {
  28782. if (argument.quasis.length === 1 && argument.quasis[0].value.cooked) {
  28783. argument = argument.quasis[0].value.cooked;
  28784. }
  28785. }
  28786. else if (argument instanceof Literal && typeof argument.value === 'string') {
  28787. argument = argument.value;
  28788. }
  28789. this.dynamicImports.push({ node, resolution: null, argument });
  28790. }
  28791. addExport(node) {
  28792. if (node instanceof ExportDefaultDeclaration) {
  28793. // export default foo;
  28794. this.exports.default = {
  28795. identifier: node.variable.getAssignedVariableName(),
  28796. localName: 'default'
  28797. };
  28798. }
  28799. else if (node instanceof ExportAllDeclaration) {
  28800. const source = node.source.value;
  28801. this.sources.add(source);
  28802. if (node.exported) {
  28803. // export * as name from './other'
  28804. const name = node.exported.name;
  28805. this.reexportDescriptions[name] = {
  28806. localName: '*',
  28807. module: null,
  28808. source,
  28809. start: node.start
  28810. };
  28811. }
  28812. else {
  28813. // export * from './other'
  28814. this.exportAllSources.add(source);
  28815. }
  28816. }
  28817. else if (node.source instanceof Literal) {
  28818. // export { name } from './other'
  28819. const source = node.source.value;
  28820. this.sources.add(source);
  28821. for (const specifier of node.specifiers) {
  28822. const name = specifier.exported.name;
  28823. this.reexportDescriptions[name] = {
  28824. localName: specifier.local.name,
  28825. module: null,
  28826. source,
  28827. start: specifier.start
  28828. };
  28829. }
  28830. }
  28831. else if (node.declaration) {
  28832. const declaration = node.declaration;
  28833. if (declaration instanceof VariableDeclaration) {
  28834. // export var { foo, bar } = ...
  28835. // export var foo = 1, bar = 2;
  28836. for (const declarator of declaration.declarations) {
  28837. for (const localName of extractAssignedNames$2(declarator.id)) {
  28838. this.exports[localName] = { identifier: null, localName };
  28839. }
  28840. }
  28841. }
  28842. else {
  28843. // export function foo () {}
  28844. const localName = declaration.id.name;
  28845. this.exports[localName] = { identifier: null, localName };
  28846. }
  28847. }
  28848. else {
  28849. // export { foo, bar, baz }
  28850. for (const specifier of node.specifiers) {
  28851. const localName = specifier.local.name;
  28852. const exportedName = specifier.exported.name;
  28853. this.exports[exportedName] = { identifier: null, localName };
  28854. }
  28855. }
  28856. }
  28857. addImport(node) {
  28858. const source = node.source.value;
  28859. this.sources.add(source);
  28860. for (const specifier of node.specifiers) {
  28861. const isDefault = specifier.type === ImportDefaultSpecifier$1;
  28862. const isNamespace = specifier.type === ImportNamespaceSpecifier$1;
  28863. const name = isDefault
  28864. ? 'default'
  28865. : isNamespace
  28866. ? '*'
  28867. : specifier.imported.name;
  28868. this.importDescriptions[specifier.local.name] = {
  28869. module: null,
  28870. name,
  28871. source,
  28872. start: specifier.start
  28873. };
  28874. }
  28875. }
  28876. addImportMeta(node) {
  28877. this.importMetas.push(node);
  28878. }
  28879. addLocationToLogProps(props, pos) {
  28880. props.id = this.id;
  28881. props.pos = pos;
  28882. let code = this.info.code;
  28883. let { column, line } = locate(code, pos, { offsetLine: 1 });
  28884. try {
  28885. ({ column, line } = getOriginalLocation(this.sourcemapChain, { column, line }));
  28886. code = this.originalCode;
  28887. }
  28888. catch (e) {
  28889. this.options.onwarn({
  28890. code: 'SOURCEMAP_ERROR',
  28891. id: this.id,
  28892. loc: {
  28893. column,
  28894. file: this.id,
  28895. line
  28896. },
  28897. message: `Error when using sourcemap for reporting an error: ${e.message}`,
  28898. pos
  28899. });
  28900. }
  28901. augmentCodeLocation(props, { column, line }, code, this.id);
  28902. }
  28903. addModulesToImportDescriptions(importDescription) {
  28904. for (const name of Object.keys(importDescription)) {
  28905. const specifier = importDescription[name];
  28906. const id = this.resolvedIds[specifier.source].id;
  28907. specifier.module = this.graph.modulesById.get(id);
  28908. }
  28909. }
  28910. addRelevantSideEffectDependencies(relevantDependencies, necessaryDependencies, alwaysCheckedDependencies) {
  28911. const handledDependencies = new Set();
  28912. const addSideEffectDependencies = (possibleDependencies) => {
  28913. for (const dependency of possibleDependencies) {
  28914. if (handledDependencies.has(dependency)) {
  28915. continue;
  28916. }
  28917. handledDependencies.add(dependency);
  28918. if (necessaryDependencies.has(dependency)) {
  28919. relevantDependencies.add(dependency);
  28920. continue;
  28921. }
  28922. if (!(dependency.info.hasModuleSideEffects || alwaysCheckedDependencies.has(dependency))) {
  28923. continue;
  28924. }
  28925. if (dependency instanceof ExternalModule || dependency.hasEffects()) {
  28926. relevantDependencies.add(dependency);
  28927. continue;
  28928. }
  28929. addSideEffectDependencies(dependency.dependencies);
  28930. }
  28931. };
  28932. addSideEffectDependencies(this.dependencies);
  28933. addSideEffectDependencies(alwaysCheckedDependencies);
  28934. }
  28935. includeAndGetAdditionalMergedNamespaces() {
  28936. const mergedNamespaces = [];
  28937. for (const module of this.exportAllModules) {
  28938. if (module instanceof ExternalModule) {
  28939. const externalVariable = module.getVariableForExportName('*');
  28940. externalVariable.include();
  28941. this.imports.add(externalVariable);
  28942. mergedNamespaces.push(externalVariable);
  28943. }
  28944. else if (module.info.syntheticNamedExports) {
  28945. const syntheticNamespace = module.getSyntheticNamespace();
  28946. syntheticNamespace.include();
  28947. this.imports.add(syntheticNamespace);
  28948. mergedNamespaces.push(syntheticNamespace);
  28949. }
  28950. }
  28951. return mergedNamespaces;
  28952. }
  28953. includeDynamicImport(node) {
  28954. const resolution = this.dynamicImports.find(dynamicImport => dynamicImport.node === node).resolution;
  28955. if (resolution instanceof Module$1) {
  28956. resolution.includedDynamicImporters.push(this);
  28957. resolution.includeAllExports(true);
  28958. }
  28959. }
  28960. includeVariable(variable) {
  28961. if (!variable.included) {
  28962. variable.include();
  28963. this.graph.needsTreeshakingPass = true;
  28964. const variableModule = variable.module;
  28965. if (variableModule && variableModule instanceof Module$1) {
  28966. if (!variableModule.isExecuted) {
  28967. markModuleAndImpureDependenciesAsExecuted(variableModule);
  28968. }
  28969. if (variableModule !== this) {
  28970. const sideEffectModules = getAndExtendSideEffectModules(variable, this);
  28971. for (const module of sideEffectModules) {
  28972. if (!module.isExecuted) {
  28973. markModuleAndImpureDependenciesAsExecuted(module);
  28974. }
  28975. }
  28976. }
  28977. }
  28978. }
  28979. }
  28980. includeVariableInModule(variable) {
  28981. this.includeVariable(variable);
  28982. const variableModule = variable.module;
  28983. if (variableModule && variableModule !== this) {
  28984. this.imports.add(variable);
  28985. }
  28986. }
  28987. shimMissingExport(name) {
  28988. this.options.onwarn({
  28989. code: 'SHIMMED_EXPORT',
  28990. exporter: relativeId(this.id),
  28991. exportName: name,
  28992. message: `Missing export "${name}" has been shimmed in module ${relativeId(this.id)}.`
  28993. });
  28994. this.exports[name] = MISSING_EXPORT_SHIM_DESCRIPTION;
  28995. }
  28996. }
  28997. // if there is a cyclic import in the reexport chain, we should not
  28998. // import from the original module but from the cyclic module to not
  28999. // mess up execution order.
  29000. function setAlternativeExporterIfCyclic(variable, importer, reexporter) {
  29001. if (variable.module instanceof Module$1 && variable.module !== reexporter) {
  29002. const exporterCycles = variable.module.cycles;
  29003. if (exporterCycles.size > 0) {
  29004. const importerCycles = reexporter.cycles;
  29005. for (const cycleSymbol of importerCycles) {
  29006. if (exporterCycles.has(cycleSymbol)) {
  29007. importer.alternativeReexportModules.set(variable, reexporter);
  29008. break;
  29009. }
  29010. }
  29011. }
  29012. }
  29013. }
  29014. class Source {
  29015. constructor(filename, content) {
  29016. this.isOriginal = true;
  29017. this.filename = filename;
  29018. this.content = content;
  29019. }
  29020. traceSegment(line, column, name) {
  29021. return { line, column, name, source: this };
  29022. }
  29023. }
  29024. class Link {
  29025. constructor(map, sources) {
  29026. this.sources = sources;
  29027. this.names = map.names;
  29028. this.mappings = map.mappings;
  29029. }
  29030. traceMappings() {
  29031. const sources = [];
  29032. const sourcesContent = [];
  29033. const names = [];
  29034. const mappings = [];
  29035. for (const line of this.mappings) {
  29036. const tracedLine = [];
  29037. for (const segment of line) {
  29038. if (segment.length == 1)
  29039. continue;
  29040. const source = this.sources[segment[1]];
  29041. if (!source)
  29042. continue;
  29043. const traced = source.traceSegment(segment[2], segment[3], segment.length === 5 ? this.names[segment[4]] : '');
  29044. if (traced) {
  29045. // newer sources are more likely to be used, so search backwards.
  29046. let sourceIndex = sources.lastIndexOf(traced.source.filename);
  29047. if (sourceIndex === -1) {
  29048. sourceIndex = sources.length;
  29049. sources.push(traced.source.filename);
  29050. sourcesContent[sourceIndex] = traced.source.content;
  29051. }
  29052. else if (sourcesContent[sourceIndex] == null) {
  29053. sourcesContent[sourceIndex] = traced.source.content;
  29054. }
  29055. else if (traced.source.content != null &&
  29056. sourcesContent[sourceIndex] !== traced.source.content) {
  29057. return error({
  29058. message: `Multiple conflicting contents for sourcemap source ${traced.source.filename}`
  29059. });
  29060. }
  29061. const tracedSegment = [
  29062. segment[0],
  29063. sourceIndex,
  29064. traced.line,
  29065. traced.column
  29066. ];
  29067. if (traced.name) {
  29068. let nameIndex = names.indexOf(traced.name);
  29069. if (nameIndex === -1) {
  29070. nameIndex = names.length;
  29071. names.push(traced.name);
  29072. }
  29073. tracedSegment[4] = nameIndex;
  29074. }
  29075. tracedLine.push(tracedSegment);
  29076. }
  29077. }
  29078. mappings.push(tracedLine);
  29079. }
  29080. return { sources, sourcesContent, names, mappings };
  29081. }
  29082. traceSegment(line, column, name) {
  29083. const segments = this.mappings[line];
  29084. if (!segments)
  29085. return null;
  29086. // binary search through segments for the given column
  29087. let i = 0;
  29088. let j = segments.length - 1;
  29089. while (i <= j) {
  29090. const m = (i + j) >> 1;
  29091. const segment = segments[m];
  29092. if (segment[0] === column) {
  29093. if (segment.length == 1)
  29094. return null;
  29095. const source = this.sources[segment[1]];
  29096. if (!source)
  29097. return null;
  29098. return source.traceSegment(segment[2], segment[3], segment.length === 5 ? this.names[segment[4]] : name);
  29099. }
  29100. if (segment[0] > column) {
  29101. j = m - 1;
  29102. }
  29103. else {
  29104. i = m + 1;
  29105. }
  29106. }
  29107. return null;
  29108. }
  29109. }
  29110. function getLinkMap(warn) {
  29111. return function linkMap(source, map) {
  29112. if (map.mappings) {
  29113. return new Link(map, [source]);
  29114. }
  29115. warn({
  29116. code: 'SOURCEMAP_BROKEN',
  29117. message: `Sourcemap is likely to be incorrect: a plugin (${map.plugin}) was used to transform ` +
  29118. "files, but didn't generate a sourcemap for the transformation. Consult the plugin " +
  29119. 'documentation for help',
  29120. plugin: map.plugin,
  29121. url: `https://rollupjs.org/guide/en/#warning-sourcemap-is-likely-to-be-incorrect`
  29122. });
  29123. return new Link({
  29124. mappings: [],
  29125. names: []
  29126. }, [source]);
  29127. };
  29128. }
  29129. function getCollapsedSourcemap(id, originalCode, originalSourcemap, sourcemapChain, linkMap) {
  29130. let source;
  29131. if (!originalSourcemap) {
  29132. source = new Source(id, originalCode);
  29133. }
  29134. else {
  29135. const sources = originalSourcemap.sources;
  29136. const sourcesContent = originalSourcemap.sourcesContent || [];
  29137. const directory = dirname(id) || '.';
  29138. const sourceRoot = originalSourcemap.sourceRoot || '.';
  29139. const baseSources = sources.map((source, i) => new Source(resolve$1(directory, sourceRoot, source), sourcesContent[i]));
  29140. source = new Link(originalSourcemap, baseSources);
  29141. }
  29142. return sourcemapChain.reduce(linkMap, source);
  29143. }
  29144. function collapseSourcemaps(file, map, modules, bundleSourcemapChain, excludeContent, warn) {
  29145. const linkMap = getLinkMap(warn);
  29146. const moduleSources = modules
  29147. .filter(module => !module.excludeFromSourcemap)
  29148. .map(module => getCollapsedSourcemap(module.id, module.originalCode, module.originalSourcemap, module.sourcemapChain, linkMap));
  29149. // DecodedSourceMap (from magic-string) uses a number[] instead of the more
  29150. // correct SourceMapSegment tuples. Cast it here to gain type safety.
  29151. let source = new Link(map, moduleSources);
  29152. source = bundleSourcemapChain.reduce(linkMap, source);
  29153. let { sources, sourcesContent, names, mappings } = source.traceMappings();
  29154. if (file) {
  29155. const directory = dirname(file);
  29156. sources = sources.map((source) => relative$1(directory, source));
  29157. file = basename(file);
  29158. }
  29159. sourcesContent = (excludeContent ? null : sourcesContent);
  29160. return new SourceMap$1({ file, sources, sourcesContent, names, mappings });
  29161. }
  29162. function collapseSourcemap(id, originalCode, originalSourcemap, sourcemapChain, warn) {
  29163. if (!sourcemapChain.length) {
  29164. return originalSourcemap;
  29165. }
  29166. const source = getCollapsedSourcemap(id, originalCode, originalSourcemap, sourcemapChain, getLinkMap(warn));
  29167. const map = source.traceMappings();
  29168. return { version: 3, ...map };
  29169. }
  29170. const createHash = () => createHash$1();
  29171. const DECONFLICT_IMPORTED_VARIABLES_BY_FORMAT = {
  29172. amd: deconflictImportsOther,
  29173. cjs: deconflictImportsOther,
  29174. es: deconflictImportsEsmOrSystem,
  29175. iife: deconflictImportsOther,
  29176. system: deconflictImportsEsmOrSystem,
  29177. umd: deconflictImportsOther
  29178. };
  29179. function deconflictChunk(modules, dependenciesToBeDeconflicted, imports, usedNames, format, interop, preserveModules, externalLiveBindings, chunkByModule, syntheticExports, exportNamesByVariable, accessedGlobalsByScope, includedNamespaces) {
  29180. const reversedModules = modules.slice().reverse();
  29181. for (const module of reversedModules) {
  29182. module.scope.addUsedOutsideNames(usedNames, format, exportNamesByVariable, accessedGlobalsByScope);
  29183. }
  29184. deconflictTopLevelVariables(usedNames, reversedModules, includedNamespaces);
  29185. DECONFLICT_IMPORTED_VARIABLES_BY_FORMAT[format](usedNames, imports, dependenciesToBeDeconflicted, interop, preserveModules, externalLiveBindings, chunkByModule, syntheticExports);
  29186. for (const module of reversedModules) {
  29187. module.scope.deconflict(format, exportNamesByVariable, accessedGlobalsByScope);
  29188. }
  29189. }
  29190. function deconflictImportsEsmOrSystem(usedNames, imports, dependenciesToBeDeconflicted, _interop, preserveModules, _externalLiveBindings, chunkByModule, syntheticExports) {
  29191. // This is needed for namespace reexports
  29192. for (const dependency of dependenciesToBeDeconflicted.dependencies) {
  29193. if (preserveModules || dependency instanceof ExternalModule) {
  29194. dependency.variableName = getSafeName(dependency.suggestedVariableName, usedNames);
  29195. }
  29196. }
  29197. for (const variable of imports) {
  29198. const module = variable.module;
  29199. const name = variable.name;
  29200. if (variable.isNamespace && (preserveModules || module instanceof ExternalModule)) {
  29201. variable.setRenderNames(null, (module instanceof ExternalModule ? module : chunkByModule.get(module)).variableName);
  29202. }
  29203. else if (module instanceof ExternalModule && name === 'default') {
  29204. variable.setRenderNames(null, getSafeName([...module.exportedVariables].some(([exportedVariable, exportedName]) => exportedName === '*' && exportedVariable.included)
  29205. ? module.suggestedVariableName + '__default'
  29206. : module.suggestedVariableName, usedNames));
  29207. }
  29208. else {
  29209. variable.setRenderNames(null, getSafeName(name, usedNames));
  29210. }
  29211. }
  29212. for (const variable of syntheticExports) {
  29213. variable.setRenderNames(null, getSafeName(variable.name, usedNames));
  29214. }
  29215. }
  29216. function deconflictImportsOther(usedNames, imports, { deconflictedDefault, deconflictedNamespace, dependencies }, interop, preserveModules, externalLiveBindings, chunkByModule) {
  29217. for (const chunkOrExternalModule of dependencies) {
  29218. chunkOrExternalModule.variableName = getSafeName(chunkOrExternalModule.suggestedVariableName, usedNames);
  29219. }
  29220. for (const externalModuleOrChunk of deconflictedNamespace) {
  29221. externalModuleOrChunk.namespaceVariableName = getSafeName(`${externalModuleOrChunk.suggestedVariableName}__namespace`, usedNames);
  29222. }
  29223. for (const externalModule of deconflictedDefault) {
  29224. if (deconflictedNamespace.has(externalModule) &&
  29225. canDefaultBeTakenFromNamespace(String(interop(externalModule.id)), externalLiveBindings)) {
  29226. externalModule.defaultVariableName = externalModule.namespaceVariableName;
  29227. }
  29228. else {
  29229. externalModule.defaultVariableName = getSafeName(`${externalModule.suggestedVariableName}__default`, usedNames);
  29230. }
  29231. }
  29232. for (const variable of imports) {
  29233. const module = variable.module;
  29234. if (module instanceof ExternalModule) {
  29235. const name = variable.name;
  29236. if (name === 'default') {
  29237. const moduleInterop = String(interop(module.id));
  29238. const variableName = defaultInteropHelpersByInteropType[moduleInterop]
  29239. ? module.defaultVariableName
  29240. : module.variableName;
  29241. if (isDefaultAProperty(moduleInterop, externalLiveBindings)) {
  29242. variable.setRenderNames(variableName, 'default');
  29243. }
  29244. else {
  29245. variable.setRenderNames(null, variableName);
  29246. }
  29247. }
  29248. else if (name === '*') {
  29249. variable.setRenderNames(null, namespaceInteropHelpersByInteropType[String(interop(module.id))]
  29250. ? module.namespaceVariableName
  29251. : module.variableName);
  29252. }
  29253. else {
  29254. // if the second parameter is `null`, it uses its "name" for the property name
  29255. variable.setRenderNames(module.variableName, null);
  29256. }
  29257. }
  29258. else {
  29259. const chunk = chunkByModule.get(module);
  29260. if (preserveModules && variable.isNamespace) {
  29261. variable.setRenderNames(null, chunk.exportMode === 'default' ? chunk.namespaceVariableName : chunk.variableName);
  29262. }
  29263. else if (chunk.exportMode === 'default') {
  29264. variable.setRenderNames(null, chunk.variableName);
  29265. }
  29266. else {
  29267. variable.setRenderNames(chunk.variableName, chunk.getVariableExportName(variable));
  29268. }
  29269. }
  29270. }
  29271. }
  29272. function deconflictTopLevelVariables(usedNames, modules, includedNamespaces) {
  29273. for (const module of modules) {
  29274. for (const variable of module.scope.variables.values()) {
  29275. if (variable.included &&
  29276. // this will only happen for exports in some formats
  29277. !(variable.renderBaseName ||
  29278. (variable instanceof ExportDefaultVariable && variable.getOriginalVariable() !== variable))) {
  29279. variable.setRenderNames(null, getSafeName(variable.name, usedNames));
  29280. }
  29281. }
  29282. if (includedNamespaces.has(module)) {
  29283. const namespace = module.namespace;
  29284. namespace.setRenderNames(null, getSafeName(namespace.name, usedNames));
  29285. }
  29286. }
  29287. }
  29288. const needsEscapeRegEx = /[\\'\r\n\u2028\u2029]/;
  29289. const quoteNewlineRegEx = /(['\r\n\u2028\u2029])/g;
  29290. const backSlashRegEx = /\\/g;
  29291. function escapeId(id) {
  29292. if (!id.match(needsEscapeRegEx))
  29293. return id;
  29294. return id.replace(backSlashRegEx, '\\\\').replace(quoteNewlineRegEx, '\\$1');
  29295. }
  29296. function assignExportsToMangledNames(exports, exportsByName, exportNamesByVariable) {
  29297. let nameIndex = 0;
  29298. for (const variable of exports) {
  29299. let exportName = variable.name[0];
  29300. if (exportsByName[exportName]) {
  29301. do {
  29302. exportName = toBase64(++nameIndex);
  29303. // skip past leading number identifiers
  29304. if (exportName.charCodeAt(0) === 49 /* '1' */) {
  29305. nameIndex += 9 * 64 ** (exportName.length - 1);
  29306. exportName = toBase64(nameIndex);
  29307. }
  29308. } while (RESERVED_NAMES[exportName] || exportsByName[exportName]);
  29309. }
  29310. exportsByName[exportName] = variable;
  29311. exportNamesByVariable.set(variable, [exportName]);
  29312. }
  29313. }
  29314. function assignExportsToNames(exports, exportsByName, exportNamesByVariable) {
  29315. for (const variable of exports) {
  29316. let nameIndex = 0;
  29317. let exportName = variable.name;
  29318. while (exportsByName[exportName]) {
  29319. exportName = variable.name + '$' + ++nameIndex;
  29320. }
  29321. exportsByName[exportName] = variable;
  29322. exportNamesByVariable.set(variable, [exportName]);
  29323. }
  29324. }
  29325. function getExportMode(chunk, { exports: exportMode, name, format }, unsetOptions, facadeModuleId, warn) {
  29326. const exportKeys = chunk.getExportNames();
  29327. if (exportMode === 'default') {
  29328. if (exportKeys.length !== 1 || exportKeys[0] !== 'default') {
  29329. return error(errIncompatibleExportOptionValue('default', exportKeys, facadeModuleId));
  29330. }
  29331. }
  29332. else if (exportMode === 'none' && exportKeys.length) {
  29333. return error(errIncompatibleExportOptionValue('none', exportKeys, facadeModuleId));
  29334. }
  29335. if (exportMode === 'auto') {
  29336. if (exportKeys.length === 0) {
  29337. exportMode = 'none';
  29338. }
  29339. else if (exportKeys.length === 1 && exportKeys[0] === 'default') {
  29340. if (format === 'cjs' && unsetOptions.has('exports')) {
  29341. warn(errPreferNamedExports(facadeModuleId));
  29342. }
  29343. exportMode = 'default';
  29344. }
  29345. else {
  29346. if (format !== 'es' && exportKeys.indexOf('default') !== -1) {
  29347. warn(errMixedExport(facadeModuleId, name));
  29348. }
  29349. exportMode = 'named';
  29350. }
  29351. }
  29352. return exportMode;
  29353. }
  29354. function guessIndentString(code) {
  29355. const lines = code.split('\n');
  29356. const tabbed = lines.filter(line => /^\t+/.test(line));
  29357. const spaced = lines.filter(line => /^ {2,}/.test(line));
  29358. if (tabbed.length === 0 && spaced.length === 0) {
  29359. return null;
  29360. }
  29361. // More lines tabbed than spaced? Assume tabs, and
  29362. // default to tabs in the case of a tie (or nothing
  29363. // to go on)
  29364. if (tabbed.length >= spaced.length) {
  29365. return '\t';
  29366. }
  29367. // Otherwise, we need to guess the multiple
  29368. const min = spaced.reduce((previous, current) => {
  29369. const numSpaces = /^ +/.exec(current)[0].length;
  29370. return Math.min(numSpaces, previous);
  29371. }, Infinity);
  29372. return new Array(min + 1).join(' ');
  29373. }
  29374. function getIndentString(modules, options) {
  29375. if (options.indent !== true)
  29376. return options.indent;
  29377. for (let i = 0; i < modules.length; i++) {
  29378. const indent = guessIndentString(modules[i].originalCode);
  29379. if (indent !== null)
  29380. return indent;
  29381. }
  29382. return '\t';
  29383. }
  29384. function getStaticDependencies(chunk, orderedModules, chunkByModule) {
  29385. const staticDependencyBlocks = [];
  29386. const handledDependencies = new Set();
  29387. for (let modulePos = orderedModules.length - 1; modulePos >= 0; modulePos--) {
  29388. const module = orderedModules[modulePos];
  29389. if (!handledDependencies.has(module)) {
  29390. const staticDependencies = [];
  29391. addStaticDependencies(module, staticDependencies, handledDependencies, chunk, chunkByModule);
  29392. staticDependencyBlocks.unshift(staticDependencies);
  29393. }
  29394. }
  29395. const dependencies = new Set();
  29396. for (const block of staticDependencyBlocks) {
  29397. for (const dependency of block) {
  29398. dependencies.add(dependency);
  29399. }
  29400. }
  29401. return dependencies;
  29402. }
  29403. function addStaticDependencies(module, staticDependencies, handledModules, chunk, chunkByModule) {
  29404. const dependencies = module.getDependenciesToBeIncluded();
  29405. for (const dependency of dependencies) {
  29406. if (dependency instanceof ExternalModule) {
  29407. staticDependencies.push(dependency);
  29408. continue;
  29409. }
  29410. const dependencyChunk = chunkByModule.get(dependency);
  29411. if (dependencyChunk !== chunk) {
  29412. staticDependencies.push(dependencyChunk);
  29413. continue;
  29414. }
  29415. if (!handledModules.has(dependency)) {
  29416. handledModules.add(dependency);
  29417. addStaticDependencies(dependency, staticDependencies, handledModules, chunk, chunkByModule);
  29418. }
  29419. }
  29420. }
  29421. function decodedSourcemap(map) {
  29422. if (!map)
  29423. return null;
  29424. if (typeof map === 'string') {
  29425. map = JSON.parse(map);
  29426. }
  29427. if (map.mappings === '') {
  29428. return {
  29429. mappings: [],
  29430. names: [],
  29431. sources: [],
  29432. version: 3
  29433. };
  29434. }
  29435. let mappings;
  29436. if (typeof map.mappings === 'string') {
  29437. mappings = decode(map.mappings);
  29438. }
  29439. else {
  29440. mappings = map.mappings;
  29441. }
  29442. return { ...map, mappings };
  29443. }
  29444. function renderChunk({ code, options, outputPluginDriver, renderChunk, sourcemapChain }) {
  29445. const renderChunkReducer = (code, result, plugin) => {
  29446. if (result == null)
  29447. return code;
  29448. if (typeof result === 'string')
  29449. result = {
  29450. code: result,
  29451. map: undefined
  29452. };
  29453. // strict null check allows 'null' maps to not be pushed to the chain, while 'undefined' gets the missing map warning
  29454. if (result.map !== null) {
  29455. const map = decodedSourcemap(result.map);
  29456. sourcemapChain.push(map || { missing: true, plugin: plugin.name });
  29457. }
  29458. return result.code;
  29459. };
  29460. return outputPluginDriver.hookReduceArg0('renderChunk', [code, renderChunk, options], renderChunkReducer);
  29461. }
  29462. function renderNamePattern(pattern, patternName, replacements) {
  29463. if (!isPlainPathFragment(pattern))
  29464. return error(errFailedValidation(`Invalid pattern "${pattern}" for "${patternName}", patterns can be neither absolute nor relative paths and must not contain invalid characters.`));
  29465. return pattern.replace(/\[(\w+)\]/g, (_match, type) => {
  29466. if (!replacements.hasOwnProperty(type)) {
  29467. return error(errFailedValidation(`"[${type}]" is not a valid placeholder in "${patternName}" pattern.`));
  29468. }
  29469. const replacement = replacements[type]();
  29470. if (!isPlainPathFragment(replacement))
  29471. return error(errFailedValidation(`Invalid substitution "${replacement}" for placeholder "[${type}]" in "${patternName}" pattern, can be neither absolute nor relative path.`));
  29472. return replacement;
  29473. });
  29474. }
  29475. function makeUnique(name, existingNames) {
  29476. const existingNamesLowercase = new Set(Object.keys(existingNames).map(key => key.toLowerCase()));
  29477. if (!existingNamesLowercase.has(name.toLocaleLowerCase()))
  29478. return name;
  29479. const ext = extname$1(name);
  29480. name = name.substr(0, name.length - ext.length);
  29481. let uniqueName, uniqueIndex = 1;
  29482. while (existingNamesLowercase.has((uniqueName = name + ++uniqueIndex + ext).toLowerCase()))
  29483. ;
  29484. return uniqueName;
  29485. }
  29486. const NON_ASSET_EXTENSIONS = ['.js', '.jsx', '.ts', '.tsx'];
  29487. function getGlobalName(module, globals, hasExports, warn) {
  29488. const globalName = typeof globals === 'function' ? globals(module.id) : globals[module.id];
  29489. if (globalName) {
  29490. return globalName;
  29491. }
  29492. if (hasExports) {
  29493. warn({
  29494. code: 'MISSING_GLOBAL_NAME',
  29495. guess: module.variableName,
  29496. message: `No name was provided for external module '${module.id}' in output.globals – guessing '${module.variableName}'`,
  29497. source: module.id
  29498. });
  29499. return module.variableName;
  29500. }
  29501. }
  29502. class Chunk$2 {
  29503. constructor(orderedModules, inputOptions, outputOptions, unsetOptions, pluginDriver, modulesById, chunkByModule, facadeChunkByModule, includedNamespaces, manualChunkAlias) {
  29504. this.orderedModules = orderedModules;
  29505. this.inputOptions = inputOptions;
  29506. this.outputOptions = outputOptions;
  29507. this.unsetOptions = unsetOptions;
  29508. this.pluginDriver = pluginDriver;
  29509. this.modulesById = modulesById;
  29510. this.chunkByModule = chunkByModule;
  29511. this.facadeChunkByModule = facadeChunkByModule;
  29512. this.includedNamespaces = includedNamespaces;
  29513. this.manualChunkAlias = manualChunkAlias;
  29514. this.entryModules = [];
  29515. this.exportMode = 'named';
  29516. this.facadeModule = null;
  29517. this.id = null;
  29518. this.namespaceVariableName = '';
  29519. this.variableName = '';
  29520. this.accessedGlobalsByScope = new Map();
  29521. this.dependencies = new Set();
  29522. this.dynamicDependencies = new Set();
  29523. this.dynamicEntryModules = [];
  29524. this.exportNamesByVariable = new Map();
  29525. this.exports = new Set();
  29526. this.exportsByName = Object.create(null);
  29527. this.fileName = null;
  29528. this.implicitEntryModules = [];
  29529. this.implicitlyLoadedBefore = new Set();
  29530. this.imports = new Set();
  29531. this.indentString = undefined;
  29532. this.isEmpty = true;
  29533. this.name = null;
  29534. this.needsExportsShim = false;
  29535. this.renderedDependencies = null;
  29536. this.renderedExports = null;
  29537. this.renderedHash = undefined;
  29538. this.renderedModules = Object.create(null);
  29539. this.renderedModuleSources = new Map();
  29540. this.renderedSource = null;
  29541. this.sortedExportNames = null;
  29542. this.strictFacade = false;
  29543. this.usedModules = undefined;
  29544. this.execIndex = orderedModules.length > 0 ? orderedModules[0].execIndex : Infinity;
  29545. const chunkModules = new Set(orderedModules);
  29546. for (const module of orderedModules) {
  29547. if (module.namespace.included) {
  29548. includedNamespaces.add(module);
  29549. }
  29550. if (this.isEmpty && module.isIncluded()) {
  29551. this.isEmpty = false;
  29552. }
  29553. if (module.info.isEntry || outputOptions.preserveModules) {
  29554. this.entryModules.push(module);
  29555. }
  29556. for (const importer of module.includedDynamicImporters) {
  29557. if (!chunkModules.has(importer)) {
  29558. this.dynamicEntryModules.push(module);
  29559. // Modules with synthetic exports need an artificial namespace for dynamic imports
  29560. if (module.info.syntheticNamedExports && !outputOptions.preserveModules) {
  29561. includedNamespaces.add(module);
  29562. this.exports.add(module.namespace);
  29563. }
  29564. }
  29565. }
  29566. if (module.implicitlyLoadedAfter.size > 0) {
  29567. this.implicitEntryModules.push(module);
  29568. }
  29569. }
  29570. this.suggestedVariableName = makeLegal(this.generateVariableName());
  29571. }
  29572. static generateFacade(inputOptions, outputOptions, unsetOptions, pluginDriver, modulesById, chunkByModule, facadeChunkByModule, includedNamespaces, facadedModule, facadeName) {
  29573. const chunk = new Chunk$2([], inputOptions, outputOptions, unsetOptions, pluginDriver, modulesById, chunkByModule, facadeChunkByModule, includedNamespaces, null);
  29574. chunk.assignFacadeName(facadeName, facadedModule);
  29575. if (!facadeChunkByModule.has(facadedModule)) {
  29576. facadeChunkByModule.set(facadedModule, chunk);
  29577. }
  29578. for (const dependency of facadedModule.getDependenciesToBeIncluded()) {
  29579. chunk.dependencies.add(dependency instanceof Module$1 ? chunkByModule.get(dependency) : dependency);
  29580. }
  29581. if (!chunk.dependencies.has(chunkByModule.get(facadedModule)) &&
  29582. facadedModule.info.hasModuleSideEffects &&
  29583. facadedModule.hasEffects()) {
  29584. chunk.dependencies.add(chunkByModule.get(facadedModule));
  29585. }
  29586. chunk.ensureReexportsAreAvailableForModule(facadedModule);
  29587. chunk.facadeModule = facadedModule;
  29588. chunk.strictFacade = true;
  29589. return chunk;
  29590. }
  29591. canModuleBeFacade(module, exposedVariables) {
  29592. const moduleExportNamesByVariable = module.getExportNamesByVariable();
  29593. for (const exposedVariable of this.exports) {
  29594. if (!moduleExportNamesByVariable.has(exposedVariable)) {
  29595. if (moduleExportNamesByVariable.size === 0 &&
  29596. module.isUserDefinedEntryPoint &&
  29597. module.preserveSignature === 'strict' &&
  29598. this.unsetOptions.has('preserveEntrySignatures')) {
  29599. this.inputOptions.onwarn({
  29600. code: 'EMPTY_FACADE',
  29601. id: module.id,
  29602. message: `To preserve the export signature of the entry module "${relativeId(module.id)}", an empty facade chunk was created. This often happens when creating a bundle for a web app where chunks are placed in script tags and exports are ignored. In this case it is recommended to set "preserveEntrySignatures: false" to avoid this and reduce the number of chunks. Otherwise if this is intentional, set "preserveEntrySignatures: 'strict'" explicitly to silence this warning.`,
  29603. url: 'https://rollupjs.org/guide/en/#preserveentrysignatures'
  29604. });
  29605. }
  29606. return false;
  29607. }
  29608. }
  29609. for (const exposedVariable of exposedVariables) {
  29610. if (!(moduleExportNamesByVariable.has(exposedVariable) || exposedVariable.module === module)) {
  29611. return false;
  29612. }
  29613. }
  29614. return true;
  29615. }
  29616. generateExports() {
  29617. this.sortedExportNames = null;
  29618. const remainingExports = new Set(this.exports);
  29619. if (this.facadeModule !== null &&
  29620. (this.facadeModule.preserveSignature !== false || this.strictFacade)) {
  29621. const exportNamesByVariable = this.facadeModule.getExportNamesByVariable();
  29622. for (const [variable, exportNames] of exportNamesByVariable) {
  29623. this.exportNamesByVariable.set(variable, [...exportNames]);
  29624. for (const exportName of exportNames) {
  29625. this.exportsByName[exportName] = variable;
  29626. }
  29627. remainingExports.delete(variable);
  29628. }
  29629. }
  29630. if (this.outputOptions.minifyInternalExports) {
  29631. assignExportsToMangledNames(remainingExports, this.exportsByName, this.exportNamesByVariable);
  29632. }
  29633. else {
  29634. assignExportsToNames(remainingExports, this.exportsByName, this.exportNamesByVariable);
  29635. }
  29636. if (this.outputOptions.preserveModules || (this.facadeModule && this.facadeModule.info.isEntry))
  29637. this.exportMode = getExportMode(this, this.outputOptions, this.unsetOptions, this.facadeModule.id, this.inputOptions.onwarn);
  29638. }
  29639. generateFacades() {
  29640. var _a;
  29641. const facades = [];
  29642. const entryModules = new Set([...this.entryModules, ...this.implicitEntryModules]);
  29643. const exposedVariables = new Set(this.dynamicEntryModules.map(module => module.namespace));
  29644. for (const module of entryModules) {
  29645. if (module.preserveSignature) {
  29646. for (const exportedVariable of module.getExportNamesByVariable().keys()) {
  29647. exposedVariables.add(exportedVariable);
  29648. }
  29649. }
  29650. }
  29651. for (const module of entryModules) {
  29652. const requiredFacades = Array.from(module.userChunkNames, name => ({
  29653. name
  29654. }));
  29655. if (requiredFacades.length === 0 && module.isUserDefinedEntryPoint) {
  29656. requiredFacades.push({});
  29657. }
  29658. requiredFacades.push(...Array.from(module.chunkFileNames, fileName => ({ fileName })));
  29659. if (requiredFacades.length === 0) {
  29660. requiredFacades.push({});
  29661. }
  29662. if (!this.facadeModule) {
  29663. const needsStrictFacade = module.preserveSignature === 'strict' ||
  29664. (module.preserveSignature === 'exports-only' &&
  29665. module.getExportNamesByVariable().size !== 0);
  29666. if (!needsStrictFacade ||
  29667. this.outputOptions.preserveModules ||
  29668. this.canModuleBeFacade(module, exposedVariables)) {
  29669. this.facadeModule = module;
  29670. this.facadeChunkByModule.set(module, this);
  29671. if (module.preserveSignature) {
  29672. this.strictFacade = needsStrictFacade;
  29673. }
  29674. this.assignFacadeName(requiredFacades.shift(), module);
  29675. }
  29676. }
  29677. for (const facadeName of requiredFacades) {
  29678. facades.push(Chunk$2.generateFacade(this.inputOptions, this.outputOptions, this.unsetOptions, this.pluginDriver, this.modulesById, this.chunkByModule, this.facadeChunkByModule, this.includedNamespaces, module, facadeName));
  29679. }
  29680. }
  29681. for (const module of this.dynamicEntryModules) {
  29682. if (module.info.syntheticNamedExports)
  29683. continue;
  29684. if (!this.facadeModule && this.canModuleBeFacade(module, exposedVariables)) {
  29685. this.facadeModule = module;
  29686. this.facadeChunkByModule.set(module, this);
  29687. this.strictFacade = true;
  29688. this.assignFacadeName({}, module);
  29689. }
  29690. else if (this.facadeModule === module &&
  29691. !this.strictFacade &&
  29692. this.canModuleBeFacade(module, exposedVariables)) {
  29693. this.strictFacade = true;
  29694. }
  29695. else if (!((_a = this.facadeChunkByModule.get(module)) === null || _a === void 0 ? void 0 : _a.strictFacade)) {
  29696. this.includedNamespaces.add(module);
  29697. this.exports.add(module.namespace);
  29698. }
  29699. }
  29700. return facades;
  29701. }
  29702. generateId(addons, options, existingNames, includeHash) {
  29703. if (this.fileName !== null) {
  29704. return this.fileName;
  29705. }
  29706. const [pattern, patternName] = this.facadeModule && this.facadeModule.isUserDefinedEntryPoint
  29707. ? [options.entryFileNames, 'output.entryFileNames']
  29708. : [options.chunkFileNames, 'output.chunkFileNames'];
  29709. return makeUnique(renderNamePattern(typeof pattern === 'function' ? pattern(this.getChunkInfo()) : pattern, patternName, {
  29710. format: () => options.format,
  29711. hash: () => includeHash
  29712. ? this.computeContentHashWithDependencies(addons, options, existingNames)
  29713. : '[hash]',
  29714. name: () => this.getChunkName()
  29715. }), existingNames);
  29716. }
  29717. generateIdPreserveModules(preserveModulesRelativeDir, options, existingNames, unsetOptions) {
  29718. const id = this.orderedModules[0].id;
  29719. const sanitizedId = sanitizeFileName(id);
  29720. let path;
  29721. if (isAbsolute(id)) {
  29722. const extension = extname$1(id);
  29723. const pattern = unsetOptions.has('entryFileNames')
  29724. ? NON_ASSET_EXTENSIONS.includes(extension)
  29725. ? '[name].js'
  29726. : '[name][extname].js'
  29727. : options.entryFileNames;
  29728. const currentDir = dirname(sanitizedId);
  29729. const fileName = renderNamePattern(typeof pattern === 'function' ? pattern(this.getChunkInfo()) : pattern, 'output.entryFileNames', {
  29730. ext: () => extension.substr(1),
  29731. extname: () => extension,
  29732. format: () => options.format,
  29733. name: () => this.getChunkName()
  29734. });
  29735. const currentPath = `${currentDir}/${fileName}`;
  29736. const { preserveModulesRoot } = options;
  29737. if (preserveModulesRoot && currentPath.startsWith(preserveModulesRoot)) {
  29738. path = currentPath.slice(preserveModulesRoot.length).replace(/^[\\/]/, '');
  29739. }
  29740. else {
  29741. path = relative(preserveModulesRelativeDir, currentPath);
  29742. }
  29743. }
  29744. else {
  29745. path = `_virtual/${basename(sanitizedId)}`;
  29746. }
  29747. return makeUnique(normalize(path), existingNames);
  29748. }
  29749. getChunkInfo() {
  29750. const facadeModule = this.facadeModule;
  29751. const getChunkName = this.getChunkName.bind(this);
  29752. return {
  29753. exports: this.getExportNames(),
  29754. facadeModuleId: facadeModule && facadeModule.id,
  29755. isDynamicEntry: this.dynamicEntryModules.length > 0,
  29756. isEntry: facadeModule !== null && facadeModule.info.isEntry,
  29757. isImplicitEntry: this.implicitEntryModules.length > 0,
  29758. modules: this.renderedModules,
  29759. get name() {
  29760. return getChunkName();
  29761. },
  29762. type: 'chunk'
  29763. };
  29764. }
  29765. getChunkInfoWithFileNames() {
  29766. return Object.assign(this.getChunkInfo(), {
  29767. code: undefined,
  29768. dynamicImports: Array.from(this.dynamicDependencies, getId),
  29769. fileName: this.id,
  29770. implicitlyLoadedBefore: Array.from(this.implicitlyLoadedBefore, getId),
  29771. importedBindings: this.getImportedBindingsPerDependency(),
  29772. imports: Array.from(this.dependencies, getId),
  29773. map: undefined,
  29774. referencedFiles: this.getReferencedFiles()
  29775. });
  29776. }
  29777. getChunkName() {
  29778. return this.name || (this.name = sanitizeFileName(this.getFallbackChunkName()));
  29779. }
  29780. getExportNames() {
  29781. return (this.sortedExportNames || (this.sortedExportNames = Object.keys(this.exportsByName).sort()));
  29782. }
  29783. getRenderedHash() {
  29784. if (this.renderedHash)
  29785. return this.renderedHash;
  29786. const hash = createHash();
  29787. const hashAugmentation = this.pluginDriver.hookReduceValueSync('augmentChunkHash', '', [this.getChunkInfo()], (augmentation, pluginHash) => {
  29788. if (pluginHash) {
  29789. augmentation += pluginHash;
  29790. }
  29791. return augmentation;
  29792. });
  29793. hash.update(hashAugmentation);
  29794. hash.update(this.renderedSource.toString());
  29795. hash.update(this.getExportNames()
  29796. .map(exportName => {
  29797. const variable = this.exportsByName[exportName];
  29798. return `${relativeId(variable.module.id).replace(/\\/g, '/')}:${variable.name}:${exportName}`;
  29799. })
  29800. .join(','));
  29801. return (this.renderedHash = hash.digest('hex'));
  29802. }
  29803. getVariableExportName(variable) {
  29804. if (this.outputOptions.preserveModules && variable instanceof NamespaceVariable) {
  29805. return '*';
  29806. }
  29807. return this.exportNamesByVariable.get(variable)[0];
  29808. }
  29809. link() {
  29810. this.dependencies = getStaticDependencies(this, this.orderedModules, this.chunkByModule);
  29811. for (const module of this.orderedModules) {
  29812. this.addDependenciesToChunk(module.dynamicDependencies, this.dynamicDependencies);
  29813. this.addDependenciesToChunk(module.implicitlyLoadedBefore, this.implicitlyLoadedBefore);
  29814. this.setUpChunkImportsAndExportsForModule(module);
  29815. }
  29816. }
  29817. // prerender allows chunk hashes and names to be generated before finalizing
  29818. preRender(options, inputBase) {
  29819. const magicString = new Bundle$1({ separator: options.compact ? '' : '\n\n' });
  29820. this.usedModules = [];
  29821. this.indentString = getIndentString(this.orderedModules, options);
  29822. const n = options.compact ? '' : '\n';
  29823. const _ = options.compact ? '' : ' ';
  29824. const renderOptions = {
  29825. compact: options.compact,
  29826. dynamicImportFunction: options.dynamicImportFunction,
  29827. exportNamesByVariable: this.exportNamesByVariable,
  29828. format: options.format,
  29829. freeze: options.freeze,
  29830. indent: this.indentString,
  29831. namespaceToStringTag: options.namespaceToStringTag,
  29832. outputPluginDriver: this.pluginDriver,
  29833. varOrConst: options.preferConst ? 'const' : 'var'
  29834. };
  29835. // for static and dynamic entry points, inline the execution list to avoid loading latency
  29836. if (options.hoistTransitiveImports &&
  29837. !this.outputOptions.preserveModules &&
  29838. this.facadeModule !== null) {
  29839. for (const dep of this.dependencies) {
  29840. if (dep instanceof Chunk$2)
  29841. this.inlineChunkDependencies(dep);
  29842. }
  29843. }
  29844. this.prepareDynamicImportsAndImportMetas();
  29845. this.setIdentifierRenderResolutions(options);
  29846. let hoistedSource = '';
  29847. const renderedModules = this.renderedModules;
  29848. for (const module of this.orderedModules) {
  29849. let renderedLength = 0;
  29850. if (module.isIncluded() || this.includedNamespaces.has(module)) {
  29851. const source = module.render(renderOptions).trim();
  29852. renderedLength = source.length();
  29853. if (renderedLength) {
  29854. if (options.compact && source.lastLine().indexOf('//') !== -1)
  29855. source.append('\n');
  29856. this.renderedModuleSources.set(module, source);
  29857. magicString.addSource(source);
  29858. this.usedModules.push(module);
  29859. }
  29860. const namespace = module.namespace;
  29861. if (this.includedNamespaces.has(module) && !this.outputOptions.preserveModules) {
  29862. const rendered = namespace.renderBlock(renderOptions);
  29863. if (namespace.renderFirst())
  29864. hoistedSource += n + rendered;
  29865. else
  29866. magicString.addSource(new MagicString$1(rendered));
  29867. }
  29868. }
  29869. const { renderedExports, removedExports } = module.getRenderedExports();
  29870. renderedModules[module.id] = {
  29871. originalLength: module.originalCode.length,
  29872. removedExports,
  29873. renderedExports,
  29874. renderedLength
  29875. };
  29876. }
  29877. if (hoistedSource)
  29878. magicString.prepend(hoistedSource + n + n);
  29879. if (this.needsExportsShim) {
  29880. magicString.prepend(`${n}${renderOptions.varOrConst} ${MISSING_EXPORT_SHIM_VARIABLE}${_}=${_}void 0;${n}${n}`);
  29881. }
  29882. if (options.compact) {
  29883. this.renderedSource = magicString;
  29884. }
  29885. else {
  29886. this.renderedSource = magicString.trim();
  29887. }
  29888. this.renderedHash = undefined;
  29889. if (this.isEmpty && this.getExportNames().length === 0 && this.dependencies.size === 0) {
  29890. const chunkName = this.getChunkName();
  29891. this.inputOptions.onwarn({
  29892. chunkName,
  29893. code: 'EMPTY_BUNDLE',
  29894. message: `Generated an empty chunk: "${chunkName}"`
  29895. });
  29896. }
  29897. this.setExternalRenderPaths(options, inputBase);
  29898. this.renderedDependencies = this.getChunkDependencyDeclarations(options);
  29899. this.renderedExports =
  29900. this.exportMode === 'none' ? [] : this.getChunkExportDeclarations(options.format);
  29901. }
  29902. async render(options, addons, outputChunk) {
  29903. timeStart('render format', 2);
  29904. const format = options.format;
  29905. const finalise = finalisers[format];
  29906. if (options.dynamicImportFunction && format !== 'es') {
  29907. this.inputOptions.onwarn({
  29908. code: 'INVALID_OPTION',
  29909. message: '"output.dynamicImportFunction" is ignored for formats other than "es".'
  29910. });
  29911. }
  29912. // populate ids in the rendered declarations only here
  29913. // as chunk ids known only after prerender
  29914. for (const dependency of this.dependencies) {
  29915. const renderedDependency = this.renderedDependencies.get(dependency);
  29916. if (dependency instanceof ExternalModule) {
  29917. const originalId = dependency.renderPath;
  29918. renderedDependency.id = escapeId(dependency.renormalizeRenderPath ? this.getRelativePath(originalId, false) : originalId);
  29919. }
  29920. else {
  29921. renderedDependency.namedExportsMode = dependency.exportMode !== 'default';
  29922. renderedDependency.id = escapeId(this.getRelativePath(dependency.id, false));
  29923. }
  29924. }
  29925. this.finaliseDynamicImports(options);
  29926. this.finaliseImportMetas(format);
  29927. const hasExports = this.renderedExports.length !== 0 ||
  29928. [...this.renderedDependencies.values()].some(dep => (dep.reexports && dep.reexports.length !== 0));
  29929. let usesTopLevelAwait = false;
  29930. const accessedGlobals = new Set();
  29931. for (const module of this.orderedModules) {
  29932. if (module.usesTopLevelAwait) {
  29933. usesTopLevelAwait = true;
  29934. }
  29935. const accessedGlobalVariables = this.accessedGlobalsByScope.get(module.scope);
  29936. if (accessedGlobalVariables) {
  29937. for (const name of accessedGlobalVariables) {
  29938. accessedGlobals.add(name);
  29939. }
  29940. }
  29941. }
  29942. if (usesTopLevelAwait && format !== 'es' && format !== 'system') {
  29943. return error({
  29944. code: 'INVALID_TLA_FORMAT',
  29945. message: `Module format ${format} does not support top-level await. Use the "es" or "system" output formats rather.`
  29946. });
  29947. }
  29948. /* istanbul ignore next */
  29949. if (!this.id) {
  29950. throw new Error('Internal Error: expecting chunk id');
  29951. }
  29952. const magicString = finalise(this.renderedSource, {
  29953. accessedGlobals,
  29954. dependencies: [...this.renderedDependencies.values()],
  29955. exports: this.renderedExports,
  29956. hasExports,
  29957. id: this.id,
  29958. indentString: this.indentString,
  29959. intro: addons.intro,
  29960. isEntryFacade: this.outputOptions.preserveModules ||
  29961. (this.facadeModule !== null && this.facadeModule.info.isEntry),
  29962. isModuleFacade: this.facadeModule !== null,
  29963. namedExportsMode: this.exportMode !== 'default',
  29964. outro: addons.outro,
  29965. usesTopLevelAwait,
  29966. varOrConst: options.preferConst ? 'const' : 'var',
  29967. warn: this.inputOptions.onwarn
  29968. }, options);
  29969. if (addons.banner)
  29970. magicString.prepend(addons.banner);
  29971. if (addons.footer)
  29972. magicString.append(addons.footer);
  29973. const prevCode = magicString.toString();
  29974. timeEnd('render format', 2);
  29975. let map = null;
  29976. const chunkSourcemapChain = [];
  29977. let code = await renderChunk({
  29978. code: prevCode,
  29979. options,
  29980. outputPluginDriver: this.pluginDriver,
  29981. renderChunk: outputChunk,
  29982. sourcemapChain: chunkSourcemapChain
  29983. });
  29984. if (options.sourcemap) {
  29985. timeStart('sourcemap', 2);
  29986. let file;
  29987. if (options.file)
  29988. file = resolve$1(options.sourcemapFile || options.file);
  29989. else if (options.dir)
  29990. file = resolve$1(options.dir, this.id);
  29991. else
  29992. file = resolve$1(this.id);
  29993. const decodedMap = magicString.generateDecodedMap({});
  29994. map = collapseSourcemaps(file, decodedMap, this.usedModules, chunkSourcemapChain, options.sourcemapExcludeSources, this.inputOptions.onwarn);
  29995. map.sources = map.sources
  29996. .map(sourcePath => {
  29997. const { sourcemapPathTransform } = options;
  29998. if (sourcemapPathTransform) {
  29999. const newSourcePath = sourcemapPathTransform(sourcePath, `${file}.map`);
  30000. if (typeof newSourcePath !== 'string') {
  30001. error(errFailedValidation(`sourcemapPathTransform function must return a string.`));
  30002. }
  30003. return newSourcePath;
  30004. }
  30005. return sourcePath;
  30006. })
  30007. .map(normalize);
  30008. timeEnd('sourcemap', 2);
  30009. }
  30010. if (!options.compact && code[code.length - 1] !== '\n')
  30011. code += '\n';
  30012. return { code, map };
  30013. }
  30014. addDependenciesToChunk(moduleDependencies, chunkDependencies) {
  30015. for (const module of moduleDependencies) {
  30016. if (module instanceof Module$1) {
  30017. const chunk = this.chunkByModule.get(module);
  30018. if (chunk && chunk !== this) {
  30019. chunkDependencies.add(chunk);
  30020. }
  30021. }
  30022. else {
  30023. chunkDependencies.add(module);
  30024. }
  30025. }
  30026. }
  30027. assignFacadeName({ fileName, name }, facadedModule) {
  30028. if (fileName) {
  30029. this.fileName = fileName;
  30030. }
  30031. else {
  30032. this.name = sanitizeFileName(name || facadedModule.chunkName || getAliasName(facadedModule.id));
  30033. }
  30034. }
  30035. checkCircularDependencyImport(variable, importingModule) {
  30036. const variableModule = variable.module;
  30037. if (variableModule instanceof Module$1) {
  30038. const exportChunk = this.chunkByModule.get(variableModule);
  30039. let alternativeReexportModule;
  30040. do {
  30041. alternativeReexportModule = importingModule.alternativeReexportModules.get(variable);
  30042. if (alternativeReexportModule) {
  30043. const exportingChunk = this.chunkByModule.get(alternativeReexportModule);
  30044. if (exportingChunk && exportingChunk !== exportChunk) {
  30045. this.inputOptions.onwarn(errCyclicCrossChunkReexport(variableModule.getExportNamesByVariable().get(variable)[0], variableModule.id, alternativeReexportModule.id, importingModule.id));
  30046. }
  30047. importingModule = alternativeReexportModule;
  30048. }
  30049. } while (alternativeReexportModule);
  30050. }
  30051. }
  30052. computeContentHashWithDependencies(addons, options, existingNames) {
  30053. const hash = createHash();
  30054. hash.update([addons.intro, addons.outro, addons.banner, addons.footer].map(addon => addon || '').join(':'));
  30055. hash.update(options.format);
  30056. const dependenciesForHashing = new Set([this]);
  30057. for (const current of dependenciesForHashing) {
  30058. if (current instanceof ExternalModule) {
  30059. hash.update(':' + current.renderPath);
  30060. }
  30061. else {
  30062. hash.update(current.getRenderedHash());
  30063. hash.update(current.generateId(addons, options, existingNames, false));
  30064. }
  30065. if (current instanceof ExternalModule)
  30066. continue;
  30067. for (const dependency of [...current.dependencies, ...current.dynamicDependencies]) {
  30068. dependenciesForHashing.add(dependency);
  30069. }
  30070. }
  30071. return hash.digest('hex').substr(0, 8);
  30072. }
  30073. ensureReexportsAreAvailableForModule(module) {
  30074. const map = module.getExportNamesByVariable();
  30075. for (const exportedVariable of map.keys()) {
  30076. const isSynthetic = exportedVariable instanceof SyntheticNamedExportVariable;
  30077. const importedVariable = isSynthetic
  30078. ? exportedVariable.getBaseVariable()
  30079. : exportedVariable;
  30080. if (!(importedVariable instanceof NamespaceVariable && this.outputOptions.preserveModules)) {
  30081. this.checkCircularDependencyImport(importedVariable, module);
  30082. const exportingModule = importedVariable.module;
  30083. if (exportingModule instanceof Module$1) {
  30084. const chunk = this.chunkByModule.get(exportingModule);
  30085. if (chunk && chunk !== this) {
  30086. chunk.exports.add(importedVariable);
  30087. if (isSynthetic) {
  30088. this.imports.add(importedVariable);
  30089. }
  30090. }
  30091. }
  30092. }
  30093. }
  30094. }
  30095. finaliseDynamicImports(options) {
  30096. const stripKnownJsExtensions = options.format === 'amd';
  30097. for (const [module, code] of this.renderedModuleSources) {
  30098. for (const { node, resolution } of module.dynamicImports) {
  30099. const chunk = this.chunkByModule.get(resolution);
  30100. const facadeChunk = this.facadeChunkByModule.get(resolution);
  30101. if (!resolution || !node.included || chunk === this) {
  30102. continue;
  30103. }
  30104. const renderedResolution = resolution instanceof Module$1
  30105. ? `'${this.getRelativePath((facadeChunk || chunk).id, stripKnownJsExtensions)}'`
  30106. : resolution instanceof ExternalModule
  30107. ? `'${resolution.renormalizeRenderPath
  30108. ? this.getRelativePath(resolution.renderPath, stripKnownJsExtensions)
  30109. : resolution.renderPath}'`
  30110. : resolution;
  30111. node.renderFinalResolution(code, renderedResolution, resolution instanceof Module$1 &&
  30112. !(facadeChunk === null || facadeChunk === void 0 ? void 0 : facadeChunk.strictFacade) &&
  30113. chunk.exportNamesByVariable.get(resolution.namespace)[0], options);
  30114. }
  30115. }
  30116. }
  30117. finaliseImportMetas(format) {
  30118. for (const [module, code] of this.renderedModuleSources) {
  30119. for (const importMeta of module.importMetas) {
  30120. importMeta.renderFinalMechanism(code, this.id, format, this.pluginDriver);
  30121. }
  30122. }
  30123. }
  30124. generateVariableName() {
  30125. if (this.manualChunkAlias) {
  30126. return this.manualChunkAlias;
  30127. }
  30128. const moduleForNaming = this.entryModules[0] ||
  30129. this.implicitEntryModules[0] ||
  30130. this.dynamicEntryModules[0] ||
  30131. this.orderedModules[this.orderedModules.length - 1];
  30132. if (moduleForNaming) {
  30133. return moduleForNaming.chunkName || getAliasName(moduleForNaming.id);
  30134. }
  30135. return 'chunk';
  30136. }
  30137. getChunkDependencyDeclarations(options) {
  30138. const importSpecifiers = this.getImportSpecifiers();
  30139. const reexportSpecifiers = this.getReexportSpecifiers();
  30140. const dependencyDeclaration = new Map();
  30141. for (const dep of this.dependencies) {
  30142. const imports = importSpecifiers.get(dep) || null;
  30143. const reexports = reexportSpecifiers.get(dep) || null;
  30144. const namedExportsMode = dep instanceof ExternalModule || dep.exportMode !== 'default';
  30145. dependencyDeclaration.set(dep, {
  30146. defaultVariableName: dep.defaultVariableName,
  30147. globalName: (dep instanceof ExternalModule &&
  30148. (options.format === 'umd' || options.format === 'iife') &&
  30149. getGlobalName(dep, options.globals, (imports || reexports) !== null, this.inputOptions.onwarn)),
  30150. id: undefined,
  30151. imports,
  30152. isChunk: dep instanceof Chunk$2,
  30153. name: dep.variableName,
  30154. namedExportsMode,
  30155. namespaceVariableName: dep.namespaceVariableName,
  30156. reexports
  30157. });
  30158. }
  30159. return dependencyDeclaration;
  30160. }
  30161. getChunkExportDeclarations(format) {
  30162. const exports = [];
  30163. for (const exportName of this.getExportNames()) {
  30164. if (exportName[0] === '*')
  30165. continue;
  30166. const variable = this.exportsByName[exportName];
  30167. if (!(variable instanceof SyntheticNamedExportVariable)) {
  30168. const module = variable.module;
  30169. if (module && this.chunkByModule.get(module) !== this)
  30170. continue;
  30171. }
  30172. let expression = null;
  30173. let hoisted = false;
  30174. let uninitialized = false;
  30175. let local = variable.getName();
  30176. if (variable instanceof LocalVariable) {
  30177. if (variable.init === UNDEFINED_EXPRESSION) {
  30178. uninitialized = true;
  30179. }
  30180. for (const declaration of variable.declarations) {
  30181. if (declaration.parent instanceof FunctionDeclaration ||
  30182. (declaration instanceof ExportDefaultDeclaration &&
  30183. declaration.declaration instanceof FunctionDeclaration)) {
  30184. hoisted = true;
  30185. break;
  30186. }
  30187. }
  30188. }
  30189. else if (variable instanceof SyntheticNamedExportVariable) {
  30190. expression = local;
  30191. if (format === 'es' && exportName !== 'default') {
  30192. local = variable.renderName;
  30193. }
  30194. }
  30195. exports.push({
  30196. exported: exportName,
  30197. expression,
  30198. hoisted,
  30199. local,
  30200. uninitialized
  30201. });
  30202. }
  30203. return exports;
  30204. }
  30205. getDependenciesToBeDeconflicted(addNonNamespacesAndInteropHelpers, addDependenciesWithoutBindings, interop) {
  30206. const dependencies = new Set();
  30207. const deconflictedDefault = new Set();
  30208. const deconflictedNamespace = new Set();
  30209. for (const variable of [...this.exportNamesByVariable.keys(), ...this.imports]) {
  30210. if (addNonNamespacesAndInteropHelpers || variable.isNamespace) {
  30211. const module = variable.module;
  30212. if (module instanceof ExternalModule) {
  30213. dependencies.add(module);
  30214. if (addNonNamespacesAndInteropHelpers) {
  30215. if (variable.name === 'default') {
  30216. if (defaultInteropHelpersByInteropType[String(interop(module.id))]) {
  30217. deconflictedDefault.add(module);
  30218. }
  30219. }
  30220. else if (variable.name === '*') {
  30221. if (namespaceInteropHelpersByInteropType[String(interop(module.id))]) {
  30222. deconflictedNamespace.add(module);
  30223. }
  30224. }
  30225. }
  30226. }
  30227. else {
  30228. const chunk = this.chunkByModule.get(module);
  30229. if (chunk !== this) {
  30230. dependencies.add(chunk);
  30231. if (addNonNamespacesAndInteropHelpers &&
  30232. chunk.exportMode === 'default' &&
  30233. variable.isNamespace) {
  30234. deconflictedNamespace.add(chunk);
  30235. }
  30236. }
  30237. }
  30238. }
  30239. }
  30240. if (addDependenciesWithoutBindings) {
  30241. for (const dependency of this.dependencies) {
  30242. dependencies.add(dependency);
  30243. }
  30244. }
  30245. return { deconflictedDefault, deconflictedNamespace, dependencies };
  30246. }
  30247. getFallbackChunkName() {
  30248. if (this.manualChunkAlias) {
  30249. return this.manualChunkAlias;
  30250. }
  30251. if (this.fileName) {
  30252. return getAliasName(this.fileName);
  30253. }
  30254. return getAliasName(this.orderedModules[this.orderedModules.length - 1].id);
  30255. }
  30256. getImportedBindingsPerDependency() {
  30257. const importSpecifiers = {};
  30258. for (const [dependency, declaration] of this.renderedDependencies) {
  30259. const specifiers = new Set();
  30260. if (declaration.imports) {
  30261. for (const { imported } of declaration.imports) {
  30262. specifiers.add(imported);
  30263. }
  30264. }
  30265. if (declaration.reexports) {
  30266. for (const { imported } of declaration.reexports) {
  30267. specifiers.add(imported);
  30268. }
  30269. }
  30270. importSpecifiers[dependency.id] = [...specifiers];
  30271. }
  30272. return importSpecifiers;
  30273. }
  30274. getImportSpecifiers() {
  30275. const { interop } = this.outputOptions;
  30276. const importsByDependency = new Map();
  30277. for (const variable of this.imports) {
  30278. const module = variable.module;
  30279. let dependency;
  30280. let imported;
  30281. if (module instanceof ExternalModule) {
  30282. dependency = module;
  30283. imported = variable.name;
  30284. if (imported !== 'default' && imported !== '*' && interop(module.id) === 'defaultOnly') {
  30285. return error(errUnexpectedNamedImport(module.id, imported, false));
  30286. }
  30287. }
  30288. else {
  30289. dependency = this.chunkByModule.get(module);
  30290. imported = dependency.getVariableExportName(variable);
  30291. }
  30292. getOrCreate(importsByDependency, dependency, () => []).push({
  30293. imported,
  30294. local: variable.getName()
  30295. });
  30296. }
  30297. return importsByDependency;
  30298. }
  30299. getReexportSpecifiers() {
  30300. const { externalLiveBindings, interop } = this.outputOptions;
  30301. const reexportSpecifiers = new Map();
  30302. for (let exportName of this.getExportNames()) {
  30303. let dependency;
  30304. let imported;
  30305. let needsLiveBinding = false;
  30306. if (exportName[0] === '*') {
  30307. const id = exportName.substr(1);
  30308. if (interop(id) === 'defaultOnly') {
  30309. this.inputOptions.onwarn(errUnexpectedNamespaceReexport(id));
  30310. }
  30311. needsLiveBinding = externalLiveBindings;
  30312. dependency = this.modulesById.get(id);
  30313. imported = exportName = '*';
  30314. }
  30315. else {
  30316. const variable = this.exportsByName[exportName];
  30317. if (variable instanceof SyntheticNamedExportVariable)
  30318. continue;
  30319. const module = variable.module;
  30320. if (module instanceof Module$1) {
  30321. dependency = this.chunkByModule.get(module);
  30322. if (dependency === this)
  30323. continue;
  30324. imported = dependency.getVariableExportName(variable);
  30325. needsLiveBinding = variable.isReassigned;
  30326. }
  30327. else {
  30328. dependency = module;
  30329. imported = variable.name;
  30330. if (imported !== 'default' && imported !== '*' && interop(module.id) === 'defaultOnly') {
  30331. return error(errUnexpectedNamedImport(module.id, imported, true));
  30332. }
  30333. needsLiveBinding =
  30334. externalLiveBindings &&
  30335. (imported !== 'default' || isDefaultAProperty(String(interop(module.id)), true));
  30336. }
  30337. }
  30338. getOrCreate(reexportSpecifiers, dependency, () => []).push({
  30339. imported,
  30340. needsLiveBinding,
  30341. reexported: exportName
  30342. });
  30343. }
  30344. return reexportSpecifiers;
  30345. }
  30346. getReferencedFiles() {
  30347. const referencedFiles = [];
  30348. for (const module of this.orderedModules) {
  30349. for (const meta of module.importMetas) {
  30350. const fileName = meta.getReferencedFileName(this.pluginDriver);
  30351. if (fileName) {
  30352. referencedFiles.push(fileName);
  30353. }
  30354. }
  30355. }
  30356. return referencedFiles;
  30357. }
  30358. getRelativePath(targetPath, stripJsExtension) {
  30359. let relativePath = normalize(relative(dirname(this.id), targetPath));
  30360. if (stripJsExtension && relativePath.endsWith('.js')) {
  30361. relativePath = relativePath.slice(0, -3);
  30362. }
  30363. if (relativePath === '..')
  30364. return '../../' + basename(targetPath);
  30365. if (relativePath === '')
  30366. return '../' + basename(targetPath);
  30367. return relativePath.startsWith('../') ? relativePath : './' + relativePath;
  30368. }
  30369. inlineChunkDependencies(chunk) {
  30370. for (const dep of chunk.dependencies) {
  30371. if (this.dependencies.has(dep))
  30372. continue;
  30373. this.dependencies.add(dep);
  30374. if (dep instanceof Chunk$2) {
  30375. this.inlineChunkDependencies(dep);
  30376. }
  30377. }
  30378. }
  30379. prepareDynamicImportsAndImportMetas() {
  30380. var _a;
  30381. const accessedGlobalsByScope = this.accessedGlobalsByScope;
  30382. for (const module of this.orderedModules) {
  30383. for (const { node, resolution } of module.dynamicImports) {
  30384. if (node.included) {
  30385. if (resolution instanceof Module$1) {
  30386. const chunk = this.chunkByModule.get(resolution);
  30387. if (chunk === this) {
  30388. node.setInternalResolution(resolution.namespace);
  30389. }
  30390. else {
  30391. node.setExternalResolution(((_a = this.facadeChunkByModule.get(resolution)) === null || _a === void 0 ? void 0 : _a.exportMode) || chunk.exportMode, resolution, this.outputOptions, this.pluginDriver, accessedGlobalsByScope);
  30392. }
  30393. }
  30394. else {
  30395. node.setExternalResolution('external', resolution, this.outputOptions, this.pluginDriver, accessedGlobalsByScope);
  30396. }
  30397. }
  30398. }
  30399. for (const importMeta of module.importMetas) {
  30400. importMeta.addAccessedGlobals(this.outputOptions.format, accessedGlobalsByScope);
  30401. }
  30402. }
  30403. }
  30404. setExternalRenderPaths(options, inputBase) {
  30405. for (const dependency of [...this.dependencies, ...this.dynamicDependencies]) {
  30406. if (dependency instanceof ExternalModule) {
  30407. dependency.setRenderPath(options, inputBase);
  30408. }
  30409. }
  30410. }
  30411. setIdentifierRenderResolutions({ format, interop, namespaceToStringTag }) {
  30412. const syntheticExports = new Set();
  30413. for (const exportName of this.getExportNames()) {
  30414. const exportVariable = this.exportsByName[exportName];
  30415. if (exportVariable instanceof ExportShimVariable) {
  30416. this.needsExportsShim = true;
  30417. }
  30418. if (format !== 'es' &&
  30419. format !== 'system' &&
  30420. exportVariable.isReassigned &&
  30421. !exportVariable.isId) {
  30422. exportVariable.setRenderNames('exports', exportName);
  30423. }
  30424. else if (exportVariable instanceof SyntheticNamedExportVariable) {
  30425. syntheticExports.add(exportVariable);
  30426. }
  30427. else {
  30428. exportVariable.setRenderNames(null, null);
  30429. }
  30430. }
  30431. const usedNames = new Set(['Object', 'Promise']);
  30432. if (this.needsExportsShim) {
  30433. usedNames.add(MISSING_EXPORT_SHIM_VARIABLE);
  30434. }
  30435. if (namespaceToStringTag) {
  30436. usedNames.add('Symbol');
  30437. }
  30438. switch (format) {
  30439. case 'system':
  30440. usedNames.add('module').add('exports');
  30441. break;
  30442. case 'es':
  30443. break;
  30444. case 'cjs':
  30445. usedNames.add('module').add('require').add('__filename').add('__dirname');
  30446. // fallthrough
  30447. default:
  30448. usedNames.add('exports');
  30449. for (const helper of HELPER_NAMES) {
  30450. usedNames.add(helper);
  30451. }
  30452. }
  30453. deconflictChunk(this.orderedModules, this.getDependenciesToBeDeconflicted(format !== 'es' && format !== 'system', format === 'amd' || format === 'umd' || format === 'iife', interop), this.imports, usedNames, format, interop, this.outputOptions.preserveModules, this.outputOptions.externalLiveBindings, this.chunkByModule, syntheticExports, this.exportNamesByVariable, this.accessedGlobalsByScope, this.includedNamespaces);
  30454. }
  30455. setUpChunkImportsAndExportsForModule(module) {
  30456. const moduleImports = new Set(module.imports);
  30457. // when we are not preserving modules, we need to make all namespace variables available for
  30458. // rendering the namespace object
  30459. if (!this.outputOptions.preserveModules) {
  30460. if (this.includedNamespaces.has(module)) {
  30461. const memberVariables = module.namespace.getMemberVariables();
  30462. for (const name of Object.keys(memberVariables)) {
  30463. moduleImports.add(memberVariables[name]);
  30464. }
  30465. }
  30466. }
  30467. for (let variable of moduleImports) {
  30468. if (variable instanceof ExportDefaultVariable) {
  30469. variable = variable.getOriginalVariable();
  30470. }
  30471. if (variable instanceof SyntheticNamedExportVariable) {
  30472. variable = variable.getBaseVariable();
  30473. }
  30474. const chunk = this.chunkByModule.get(variable.module);
  30475. if (chunk !== this) {
  30476. this.imports.add(variable);
  30477. if (!(variable instanceof NamespaceVariable && this.outputOptions.preserveModules) &&
  30478. variable.module instanceof Module$1) {
  30479. chunk.exports.add(variable);
  30480. this.checkCircularDependencyImport(variable, module);
  30481. }
  30482. }
  30483. }
  30484. if (this.includedNamespaces.has(module) ||
  30485. (module.info.isEntry && module.preserveSignature !== false) ||
  30486. module.includedDynamicImporters.some(importer => this.chunkByModule.get(importer) !== this)) {
  30487. this.ensureReexportsAreAvailableForModule(module);
  30488. }
  30489. for (const { node, resolution } of module.dynamicImports) {
  30490. if (node.included &&
  30491. resolution instanceof Module$1 &&
  30492. this.chunkByModule.get(resolution) === this &&
  30493. !this.includedNamespaces.has(resolution)) {
  30494. this.includedNamespaces.add(resolution);
  30495. this.ensureReexportsAreAvailableForModule(resolution);
  30496. }
  30497. }
  30498. }
  30499. }
  30500. const concatSep = (out, next) => (next ? `${out}\n${next}` : out);
  30501. const concatDblSep = (out, next) => (next ? `${out}\n\n${next}` : out);
  30502. async function createAddons(options, outputPluginDriver) {
  30503. try {
  30504. let [banner, footer, intro, outro] = await Promise.all([
  30505. outputPluginDriver.hookReduceValue('banner', options.banner(), [], concatSep),
  30506. outputPluginDriver.hookReduceValue('footer', options.footer(), [], concatSep),
  30507. outputPluginDriver.hookReduceValue('intro', options.intro(), [], concatDblSep),
  30508. outputPluginDriver.hookReduceValue('outro', options.outro(), [], concatDblSep)
  30509. ]);
  30510. if (intro)
  30511. intro += '\n\n';
  30512. if (outro)
  30513. outro = `\n\n${outro}`;
  30514. if (banner.length)
  30515. banner += '\n';
  30516. if (footer.length)
  30517. footer = '\n' + footer;
  30518. return { intro, outro, banner, footer };
  30519. }
  30520. catch (err) {
  30521. return error({
  30522. code: 'ADDON_ERROR',
  30523. message: `Could not retrieve ${err.hook}. Check configuration of plugin ${err.plugin}.
  30524. \tError Message: ${err.message}`
  30525. });
  30526. }
  30527. }
  30528. function getChunkAssignments(entryModules, manualChunkAliasByEntry) {
  30529. const chunkDefinitions = [];
  30530. const modulesInManualChunks = new Set(manualChunkAliasByEntry.keys());
  30531. const manualChunkModulesByAlias = Object.create(null);
  30532. for (const [entry, alias] of manualChunkAliasByEntry) {
  30533. const chunkModules = (manualChunkModulesByAlias[alias] =
  30534. manualChunkModulesByAlias[alias] || []);
  30535. addStaticDependenciesToManualChunk(entry, chunkModules, modulesInManualChunks);
  30536. }
  30537. for (const [alias, modules] of Object.entries(manualChunkModulesByAlias)) {
  30538. chunkDefinitions.push({ alias, modules });
  30539. }
  30540. const assignedEntryPointsByModule = new Map();
  30541. const { dependentEntryPointsByModule, dynamicEntryModules } = analyzeModuleGraph(entryModules);
  30542. const dynamicallyDependentEntryPointsByDynamicEntry = getDynamicDependentEntryPoints(dependentEntryPointsByModule, dynamicEntryModules);
  30543. const staticEntries = new Set(entryModules);
  30544. function assignEntryToStaticDependencies(entry, dynamicDependentEntryPoints) {
  30545. const modulesToHandle = new Set([entry]);
  30546. for (const module of modulesToHandle) {
  30547. const assignedEntryPoints = getOrCreate(assignedEntryPointsByModule, module, () => new Set());
  30548. if (dynamicDependentEntryPoints &&
  30549. areEntryPointsContainedOrDynamicallyDependent(dynamicDependentEntryPoints, dependentEntryPointsByModule.get(module))) {
  30550. continue;
  30551. }
  30552. else {
  30553. assignedEntryPoints.add(entry);
  30554. }
  30555. for (const dependency of module.getDependenciesToBeIncluded()) {
  30556. if (!(dependency instanceof ExternalModule || modulesInManualChunks.has(dependency))) {
  30557. modulesToHandle.add(dependency);
  30558. }
  30559. }
  30560. }
  30561. }
  30562. function areEntryPointsContainedOrDynamicallyDependent(entryPoints, containedIn) {
  30563. const entriesToCheck = new Set(entryPoints);
  30564. for (const entry of entriesToCheck) {
  30565. if (!containedIn.has(entry)) {
  30566. if (staticEntries.has(entry))
  30567. return false;
  30568. const dynamicallyDependentEntryPoints = dynamicallyDependentEntryPointsByDynamicEntry.get(entry);
  30569. for (const dependentEntry of dynamicallyDependentEntryPoints) {
  30570. entriesToCheck.add(dependentEntry);
  30571. }
  30572. }
  30573. }
  30574. return true;
  30575. }
  30576. for (const entry of entryModules) {
  30577. if (!modulesInManualChunks.has(entry)) {
  30578. assignEntryToStaticDependencies(entry, null);
  30579. }
  30580. }
  30581. for (const entry of dynamicEntryModules) {
  30582. if (!modulesInManualChunks.has(entry)) {
  30583. assignEntryToStaticDependencies(entry, dynamicallyDependentEntryPointsByDynamicEntry.get(entry));
  30584. }
  30585. }
  30586. chunkDefinitions.push(...createChunks([...entryModules, ...dynamicEntryModules], assignedEntryPointsByModule));
  30587. return chunkDefinitions;
  30588. }
  30589. function addStaticDependenciesToManualChunk(entry, manualChunkModules, modulesInManualChunks) {
  30590. const modulesToHandle = new Set([entry]);
  30591. for (const module of modulesToHandle) {
  30592. modulesInManualChunks.add(module);
  30593. manualChunkModules.push(module);
  30594. for (const dependency of module.dependencies) {
  30595. if (!(dependency instanceof ExternalModule || modulesInManualChunks.has(dependency))) {
  30596. modulesToHandle.add(dependency);
  30597. }
  30598. }
  30599. }
  30600. }
  30601. function analyzeModuleGraph(entryModules) {
  30602. const dynamicEntryModules = new Set();
  30603. const dependentEntryPointsByModule = new Map();
  30604. const entriesToHandle = new Set(entryModules);
  30605. for (const currentEntry of entriesToHandle) {
  30606. const modulesToHandle = new Set([currentEntry]);
  30607. for (const module of modulesToHandle) {
  30608. getOrCreate(dependentEntryPointsByModule, module, () => new Set()).add(currentEntry);
  30609. for (const dependency of module.getDependenciesToBeIncluded()) {
  30610. if (!(dependency instanceof ExternalModule)) {
  30611. modulesToHandle.add(dependency);
  30612. }
  30613. }
  30614. for (const { resolution } of module.dynamicImports) {
  30615. if (resolution instanceof Module$1 && resolution.includedDynamicImporters.length > 0) {
  30616. dynamicEntryModules.add(resolution);
  30617. entriesToHandle.add(resolution);
  30618. }
  30619. }
  30620. for (const dependency of module.implicitlyLoadedBefore) {
  30621. dynamicEntryModules.add(dependency);
  30622. entriesToHandle.add(dependency);
  30623. }
  30624. }
  30625. }
  30626. return { dependentEntryPointsByModule, dynamicEntryModules };
  30627. }
  30628. function getDynamicDependentEntryPoints(dependentEntryPointsByModule, dynamicEntryModules) {
  30629. const dynamicallyDependentEntryPointsByDynamicEntry = new Map();
  30630. for (const dynamicEntry of dynamicEntryModules) {
  30631. const dynamicDependentEntryPoints = getOrCreate(dynamicallyDependentEntryPointsByDynamicEntry, dynamicEntry, () => new Set());
  30632. for (const importer of [
  30633. ...dynamicEntry.includedDynamicImporters,
  30634. ...dynamicEntry.implicitlyLoadedAfter
  30635. ]) {
  30636. for (const entryPoint of dependentEntryPointsByModule.get(importer)) {
  30637. dynamicDependentEntryPoints.add(entryPoint);
  30638. }
  30639. }
  30640. }
  30641. return dynamicallyDependentEntryPointsByDynamicEntry;
  30642. }
  30643. function createChunks(allEntryPoints, assignedEntryPointsByModule) {
  30644. const chunkModules = Object.create(null);
  30645. for (const [module, assignedEntryPoints] of assignedEntryPointsByModule) {
  30646. let chunkSignature = '';
  30647. for (const entry of allEntryPoints) {
  30648. chunkSignature += assignedEntryPoints.has(entry) ? 'X' : '_';
  30649. }
  30650. const chunk = chunkModules[chunkSignature];
  30651. if (chunk) {
  30652. chunk.push(module);
  30653. }
  30654. else {
  30655. chunkModules[chunkSignature] = [module];
  30656. }
  30657. }
  30658. return Object.keys(chunkModules).map(chunkSignature => ({
  30659. alias: null,
  30660. modules: chunkModules[chunkSignature]
  30661. }));
  30662. }
  30663. // ported from https://github.com/substack/node-commondir
  30664. function commondir$1(files) {
  30665. if (files.length === 0)
  30666. return '/';
  30667. if (files.length === 1)
  30668. return dirname(files[0]);
  30669. const commonSegments = files.slice(1).reduce((commonSegments, file) => {
  30670. const pathSegements = file.split(/\/+|\\+/);
  30671. let i;
  30672. for (i = 0; commonSegments[i] === pathSegements[i] &&
  30673. i < Math.min(commonSegments.length, pathSegements.length); i++)
  30674. ;
  30675. return commonSegments.slice(0, i);
  30676. }, files[0].split(/\/+|\\+/));
  30677. // Windows correctly handles paths with forward-slashes
  30678. return commonSegments.length > 1 ? commonSegments.join('/') : '/';
  30679. }
  30680. const compareExecIndex = (unitA, unitB) => unitA.execIndex > unitB.execIndex ? 1 : -1;
  30681. function sortByExecutionOrder(units) {
  30682. units.sort(compareExecIndex);
  30683. }
  30684. function analyseModuleExecution(entryModules) {
  30685. let nextExecIndex = 0;
  30686. const cyclePaths = [];
  30687. const analysedModules = new Set();
  30688. const dynamicImports = new Set();
  30689. const parents = new Map();
  30690. const orderedModules = [];
  30691. const analyseModule = (module) => {
  30692. if (module instanceof Module$1) {
  30693. for (const dependency of module.dependencies) {
  30694. if (parents.has(dependency)) {
  30695. if (!analysedModules.has(dependency)) {
  30696. cyclePaths.push(getCyclePath(dependency, module, parents));
  30697. }
  30698. continue;
  30699. }
  30700. parents.set(dependency, module);
  30701. analyseModule(dependency);
  30702. }
  30703. for (const dependency of module.implicitlyLoadedBefore) {
  30704. dynamicImports.add(dependency);
  30705. }
  30706. for (const { resolution } of module.dynamicImports) {
  30707. if (resolution instanceof Module$1) {
  30708. dynamicImports.add(resolution);
  30709. }
  30710. }
  30711. orderedModules.push(module);
  30712. }
  30713. module.execIndex = nextExecIndex++;
  30714. analysedModules.add(module);
  30715. };
  30716. for (const curEntry of entryModules) {
  30717. if (!parents.has(curEntry)) {
  30718. parents.set(curEntry, null);
  30719. analyseModule(curEntry);
  30720. }
  30721. }
  30722. for (const curEntry of dynamicImports) {
  30723. if (!parents.has(curEntry)) {
  30724. parents.set(curEntry, null);
  30725. analyseModule(curEntry);
  30726. }
  30727. }
  30728. return { orderedModules, cyclePaths };
  30729. }
  30730. function getCyclePath(module, parent, parents) {
  30731. const cycleSymbol = Symbol(module.id);
  30732. const path = [relativeId(module.id)];
  30733. let nextModule = parent;
  30734. module.cycles.add(cycleSymbol);
  30735. while (nextModule !== module) {
  30736. nextModule.cycles.add(cycleSymbol);
  30737. path.push(relativeId(nextModule.id));
  30738. nextModule = parents.get(nextModule);
  30739. }
  30740. path.push(path[0]);
  30741. path.reverse();
  30742. return path;
  30743. }
  30744. var BuildPhase;
  30745. (function (BuildPhase) {
  30746. BuildPhase[BuildPhase["LOAD_AND_PARSE"] = 0] = "LOAD_AND_PARSE";
  30747. BuildPhase[BuildPhase["ANALYSE"] = 1] = "ANALYSE";
  30748. BuildPhase[BuildPhase["GENERATE"] = 2] = "GENERATE";
  30749. })(BuildPhase || (BuildPhase = {}));
  30750. function generateAssetFileName(name, source, output) {
  30751. const emittedName = name || 'asset';
  30752. return makeUnique(renderNamePattern(typeof output.assetFileNames === 'function'
  30753. ? output.assetFileNames({ name, source, type: 'asset' })
  30754. : output.assetFileNames, 'output.assetFileNames', {
  30755. hash() {
  30756. const hash = createHash();
  30757. hash.update(emittedName);
  30758. hash.update(':');
  30759. hash.update(source);
  30760. return hash.digest('hex').substr(0, 8);
  30761. },
  30762. ext: () => extname$1(emittedName).substr(1),
  30763. extname: () => extname$1(emittedName),
  30764. name: () => emittedName.substr(0, emittedName.length - extname$1(emittedName).length)
  30765. }), output.bundle);
  30766. }
  30767. function reserveFileNameInBundle(fileName, bundle, warn) {
  30768. if (fileName in bundle) {
  30769. warn(errFileNameConflict(fileName));
  30770. }
  30771. bundle[fileName] = FILE_PLACEHOLDER;
  30772. }
  30773. const FILE_PLACEHOLDER = {
  30774. type: 'placeholder'
  30775. };
  30776. function hasValidType(emittedFile) {
  30777. return Boolean(emittedFile &&
  30778. (emittedFile.type === 'asset' ||
  30779. emittedFile.type === 'chunk'));
  30780. }
  30781. function hasValidName(emittedFile) {
  30782. const validatedName = emittedFile.fileName || emittedFile.name;
  30783. return (!validatedName || (typeof validatedName === 'string' && isPlainPathFragment(validatedName)));
  30784. }
  30785. function getValidSource(source, emittedFile, fileReferenceId) {
  30786. if (!(typeof source === 'string' || source instanceof Uint8Array)) {
  30787. const assetName = emittedFile.fileName || emittedFile.name || fileReferenceId;
  30788. return error(errFailedValidation(`Could not set source for ${typeof assetName === 'string' ? `asset "${assetName}"` : 'unnamed asset'}, asset source needs to be a string, Uint8Array or Buffer.`));
  30789. }
  30790. return source;
  30791. }
  30792. function getAssetFileName(file, referenceId) {
  30793. if (typeof file.fileName !== 'string') {
  30794. return error(errAssetNotFinalisedForFileName(file.name || referenceId));
  30795. }
  30796. return file.fileName;
  30797. }
  30798. function getChunkFileName(file, facadeChunkByModule) {
  30799. var _a;
  30800. const fileName = file.fileName || (file.module && ((_a = facadeChunkByModule === null || facadeChunkByModule === void 0 ? void 0 : facadeChunkByModule.get(file.module)) === null || _a === void 0 ? void 0 : _a.id));
  30801. if (!fileName)
  30802. return error(errChunkNotGeneratedForFileName(file.fileName || file.name));
  30803. return fileName;
  30804. }
  30805. class FileEmitter {
  30806. constructor(graph, options, baseFileEmitter) {
  30807. this.graph = graph;
  30808. this.options = options;
  30809. this.facadeChunkByModule = null;
  30810. this.output = null;
  30811. this.assertAssetsFinalized = () => {
  30812. for (const [referenceId, emittedFile] of this.filesByReferenceId.entries()) {
  30813. if (emittedFile.type === 'asset' && typeof emittedFile.fileName !== 'string')
  30814. return error(errNoAssetSourceSet(emittedFile.name || referenceId));
  30815. }
  30816. };
  30817. this.emitFile = (emittedFile) => {
  30818. if (!hasValidType(emittedFile)) {
  30819. return error(errFailedValidation(`Emitted files must be of type "asset" or "chunk", received "${emittedFile && emittedFile.type}".`));
  30820. }
  30821. if (!hasValidName(emittedFile)) {
  30822. return error(errFailedValidation(`The "fileName" or "name" properties of emitted files must be strings that are neither absolute nor relative paths and do not contain invalid characters, received "${emittedFile.fileName || emittedFile.name}".`));
  30823. }
  30824. if (emittedFile.type === 'chunk') {
  30825. return this.emitChunk(emittedFile);
  30826. }
  30827. else {
  30828. return this.emitAsset(emittedFile);
  30829. }
  30830. };
  30831. this.getFileName = (fileReferenceId) => {
  30832. const emittedFile = this.filesByReferenceId.get(fileReferenceId);
  30833. if (!emittedFile)
  30834. return error(errFileReferenceIdNotFoundForFilename(fileReferenceId));
  30835. if (emittedFile.type === 'chunk') {
  30836. return getChunkFileName(emittedFile, this.facadeChunkByModule);
  30837. }
  30838. else {
  30839. return getAssetFileName(emittedFile, fileReferenceId);
  30840. }
  30841. };
  30842. this.setAssetSource = (referenceId, requestedSource) => {
  30843. const consumedFile = this.filesByReferenceId.get(referenceId);
  30844. if (!consumedFile)
  30845. return error(errAssetReferenceIdNotFoundForSetSource(referenceId));
  30846. if (consumedFile.type !== 'asset') {
  30847. return error(errFailedValidation(`Asset sources can only be set for emitted assets but "${referenceId}" is an emitted chunk.`));
  30848. }
  30849. if (consumedFile.source !== undefined) {
  30850. return error(errAssetSourceAlreadySet(consumedFile.name || referenceId));
  30851. }
  30852. const source = getValidSource(requestedSource, consumedFile, referenceId);
  30853. if (this.output) {
  30854. this.finalizeAsset(consumedFile, source, referenceId, this.output);
  30855. }
  30856. else {
  30857. consumedFile.source = source;
  30858. }
  30859. };
  30860. this.setOutputBundle = (outputBundle, assetFileNames, facadeChunkByModule) => {
  30861. this.output = {
  30862. assetFileNames,
  30863. bundle: outputBundle
  30864. };
  30865. this.facadeChunkByModule = facadeChunkByModule;
  30866. for (const emittedFile of this.filesByReferenceId.values()) {
  30867. if (emittedFile.fileName) {
  30868. reserveFileNameInBundle(emittedFile.fileName, this.output.bundle, this.options.onwarn);
  30869. }
  30870. }
  30871. for (const [referenceId, consumedFile] of this.filesByReferenceId.entries()) {
  30872. if (consumedFile.type === 'asset' && consumedFile.source !== undefined) {
  30873. this.finalizeAsset(consumedFile, consumedFile.source, referenceId, this.output);
  30874. }
  30875. }
  30876. };
  30877. this.filesByReferenceId = baseFileEmitter
  30878. ? new Map(baseFileEmitter.filesByReferenceId)
  30879. : new Map();
  30880. }
  30881. assignReferenceId(file, idBase) {
  30882. let referenceId;
  30883. do {
  30884. const hash = createHash();
  30885. if (referenceId) {
  30886. hash.update(referenceId);
  30887. }
  30888. else {
  30889. hash.update(idBase);
  30890. }
  30891. referenceId = hash.digest('hex').substr(0, 8);
  30892. } while (this.filesByReferenceId.has(referenceId));
  30893. this.filesByReferenceId.set(referenceId, file);
  30894. return referenceId;
  30895. }
  30896. emitAsset(emittedAsset) {
  30897. const source = typeof emittedAsset.source !== 'undefined'
  30898. ? getValidSource(emittedAsset.source, emittedAsset, null)
  30899. : undefined;
  30900. const consumedAsset = {
  30901. fileName: emittedAsset.fileName,
  30902. name: emittedAsset.name,
  30903. source,
  30904. type: 'asset'
  30905. };
  30906. const referenceId = this.assignReferenceId(consumedAsset, emittedAsset.fileName || emittedAsset.name || emittedAsset.type);
  30907. if (this.output) {
  30908. if (emittedAsset.fileName) {
  30909. reserveFileNameInBundle(emittedAsset.fileName, this.output.bundle, this.options.onwarn);
  30910. }
  30911. if (source !== undefined) {
  30912. this.finalizeAsset(consumedAsset, source, referenceId, this.output);
  30913. }
  30914. }
  30915. return referenceId;
  30916. }
  30917. emitChunk(emittedChunk) {
  30918. if (this.graph.phase > BuildPhase.LOAD_AND_PARSE) {
  30919. return error(errInvalidRollupPhaseForChunkEmission());
  30920. }
  30921. if (typeof emittedChunk.id !== 'string') {
  30922. return error(errFailedValidation(`Emitted chunks need to have a valid string id, received "${emittedChunk.id}"`));
  30923. }
  30924. const consumedChunk = {
  30925. fileName: emittedChunk.fileName,
  30926. module: null,
  30927. name: emittedChunk.name || emittedChunk.id,
  30928. type: 'chunk'
  30929. };
  30930. this.graph.moduleLoader
  30931. .emitChunk(emittedChunk)
  30932. .then(module => (consumedChunk.module = module))
  30933. .catch(() => {
  30934. // Avoid unhandled Promise rejection as the error will be thrown later
  30935. // once module loading has finished
  30936. });
  30937. return this.assignReferenceId(consumedChunk, emittedChunk.id);
  30938. }
  30939. finalizeAsset(consumedFile, source, referenceId, output) {
  30940. const fileName = consumedFile.fileName ||
  30941. findExistingAssetFileNameWithSource(output.bundle, source) ||
  30942. generateAssetFileName(consumedFile.name, source, output);
  30943. // We must not modify the original assets to avoid interaction between outputs
  30944. const assetWithFileName = { ...consumedFile, source, fileName };
  30945. this.filesByReferenceId.set(referenceId, assetWithFileName);
  30946. const options = this.options;
  30947. output.bundle[fileName] = {
  30948. fileName,
  30949. name: consumedFile.name,
  30950. get isAsset() {
  30951. warnDeprecation('Accessing "isAsset" on files in the bundle is deprecated, please use "type === \'asset\'" instead', true, options);
  30952. return true;
  30953. },
  30954. source,
  30955. type: 'asset'
  30956. };
  30957. }
  30958. }
  30959. function findExistingAssetFileNameWithSource(bundle, source) {
  30960. for (const fileName of Object.keys(bundle)) {
  30961. const outputFile = bundle[fileName];
  30962. if (outputFile.type === 'asset' && areSourcesEqual(source, outputFile.source))
  30963. return fileName;
  30964. }
  30965. return null;
  30966. }
  30967. function areSourcesEqual(sourceA, sourceB) {
  30968. if (typeof sourceA === 'string') {
  30969. return sourceA === sourceB;
  30970. }
  30971. if (typeof sourceB === 'string') {
  30972. return false;
  30973. }
  30974. if ('equals' in sourceA) {
  30975. return sourceA.equals(sourceB);
  30976. }
  30977. if (sourceA.length !== sourceB.length) {
  30978. return false;
  30979. }
  30980. for (let index = 0; index < sourceA.length; index++) {
  30981. if (sourceA[index] !== sourceB[index]) {
  30982. return false;
  30983. }
  30984. }
  30985. return true;
  30986. }
  30987. class Bundle {
  30988. constructor(outputOptions, unsetOptions, inputOptions, pluginDriver, graph) {
  30989. this.outputOptions = outputOptions;
  30990. this.unsetOptions = unsetOptions;
  30991. this.inputOptions = inputOptions;
  30992. this.pluginDriver = pluginDriver;
  30993. this.graph = graph;
  30994. this.facadeChunkByModule = new Map();
  30995. this.includedNamespaces = new Set();
  30996. }
  30997. async generate(isWrite) {
  30998. timeStart('GENERATE', 1);
  30999. const outputBundle = Object.create(null);
  31000. this.pluginDriver.setOutputBundle(outputBundle, this.outputOptions.assetFileNames, this.facadeChunkByModule);
  31001. try {
  31002. await this.pluginDriver.hookParallel('renderStart', [this.outputOptions, this.inputOptions]);
  31003. timeStart('generate chunks', 2);
  31004. const chunks = await this.generateChunks();
  31005. if (chunks.length > 1) {
  31006. validateOptionsForMultiChunkOutput(this.outputOptions, this.inputOptions.onwarn);
  31007. }
  31008. const inputBase = commondir$1(getAbsoluteEntryModulePaths(chunks));
  31009. timeEnd('generate chunks', 2);
  31010. timeStart('render modules', 2);
  31011. // We need to create addons before prerender because at the moment, there
  31012. // can be no async code between prerender and render due to internal state
  31013. const addons = await createAddons(this.outputOptions, this.pluginDriver);
  31014. this.prerenderChunks(chunks, inputBase);
  31015. timeEnd('render modules', 2);
  31016. await this.addFinalizedChunksToBundle(chunks, inputBase, addons, outputBundle);
  31017. }
  31018. catch (error) {
  31019. await this.pluginDriver.hookParallel('renderError', [error]);
  31020. throw error;
  31021. }
  31022. await this.pluginDriver.hookSeq('generateBundle', [
  31023. this.outputOptions,
  31024. outputBundle,
  31025. isWrite
  31026. ]);
  31027. this.finaliseAssets(outputBundle);
  31028. timeEnd('GENERATE', 1);
  31029. return outputBundle;
  31030. }
  31031. async addFinalizedChunksToBundle(chunks, inputBase, addons, outputBundle) {
  31032. this.assignChunkIds(chunks, inputBase, addons, outputBundle);
  31033. for (const chunk of chunks) {
  31034. outputBundle[chunk.id] = chunk.getChunkInfoWithFileNames();
  31035. }
  31036. await Promise.all(chunks.map(async (chunk) => {
  31037. const outputChunk = outputBundle[chunk.id];
  31038. Object.assign(outputChunk, await chunk.render(this.outputOptions, addons, outputChunk));
  31039. }));
  31040. }
  31041. async addManualChunks(manualChunks) {
  31042. const manualChunkAliasByEntry = new Map();
  31043. const chunkEntries = await Promise.all(Object.keys(manualChunks).map(async (alias) => ({
  31044. alias,
  31045. entries: await this.graph.moduleLoader.addAdditionalModules(manualChunks[alias])
  31046. })));
  31047. for (const { alias, entries } of chunkEntries) {
  31048. for (const entry of entries) {
  31049. addModuleToManualChunk(alias, entry, manualChunkAliasByEntry);
  31050. }
  31051. }
  31052. return manualChunkAliasByEntry;
  31053. }
  31054. assignChunkIds(chunks, inputBase, addons, bundle) {
  31055. const entryChunks = [];
  31056. const otherChunks = [];
  31057. for (const chunk of chunks) {
  31058. (chunk.facadeModule && chunk.facadeModule.isUserDefinedEntryPoint
  31059. ? entryChunks
  31060. : otherChunks).push(chunk);
  31061. }
  31062. // make sure entry chunk names take precedence with regard to deconflicting
  31063. const chunksForNaming = entryChunks.concat(otherChunks);
  31064. for (const chunk of chunksForNaming) {
  31065. if (this.outputOptions.file) {
  31066. chunk.id = basename(this.outputOptions.file);
  31067. }
  31068. else if (this.outputOptions.preserveModules) {
  31069. chunk.id = chunk.generateIdPreserveModules(inputBase, this.outputOptions, bundle, this.unsetOptions);
  31070. }
  31071. else {
  31072. chunk.id = chunk.generateId(addons, this.outputOptions, bundle, true);
  31073. }
  31074. bundle[chunk.id] = FILE_PLACEHOLDER;
  31075. }
  31076. }
  31077. assignManualChunks(getManualChunk) {
  31078. const manualChunkAliasByEntry = new Map();
  31079. const manualChunksApi = {
  31080. getModuleIds: () => this.graph.modulesById.keys(),
  31081. getModuleInfo: this.graph.getModuleInfo
  31082. };
  31083. for (const module of this.graph.modulesById.values()) {
  31084. if (module instanceof Module$1) {
  31085. const manualChunkAlias = getManualChunk(module.id, manualChunksApi);
  31086. if (typeof manualChunkAlias === 'string') {
  31087. addModuleToManualChunk(manualChunkAlias, module, manualChunkAliasByEntry);
  31088. }
  31089. }
  31090. }
  31091. return manualChunkAliasByEntry;
  31092. }
  31093. finaliseAssets(outputBundle) {
  31094. for (const key of Object.keys(outputBundle)) {
  31095. const file = outputBundle[key];
  31096. if (!file.type) {
  31097. warnDeprecation('A plugin is directly adding properties to the bundle object in the "generateBundle" hook. This is deprecated and will be removed in a future Rollup version, please use "this.emitFile" instead.', true, this.inputOptions);
  31098. file.type = 'asset';
  31099. }
  31100. if (this.outputOptions.validate && typeof file.code == 'string') {
  31101. try {
  31102. this.graph.contextParse(file.code, {
  31103. allowHashBang: true,
  31104. ecmaVersion: 'latest'
  31105. });
  31106. }
  31107. catch (exception) {
  31108. this.inputOptions.onwarn(errChunkInvalid(file, exception));
  31109. }
  31110. }
  31111. }
  31112. this.pluginDriver.finaliseAssets();
  31113. }
  31114. async generateChunks() {
  31115. const { manualChunks } = this.outputOptions;
  31116. const manualChunkAliasByEntry = typeof manualChunks === 'object'
  31117. ? await this.addManualChunks(manualChunks)
  31118. : this.assignManualChunks(manualChunks);
  31119. const chunks = [];
  31120. const chunkByModule = new Map();
  31121. for (const { alias, modules } of this.outputOptions.inlineDynamicImports
  31122. ? [{ alias: null, modules: getIncludedModules(this.graph.modulesById) }]
  31123. : this.outputOptions.preserveModules
  31124. ? getIncludedModules(this.graph.modulesById).map(module => ({
  31125. alias: null,
  31126. modules: [module]
  31127. }))
  31128. : getChunkAssignments(this.graph.entryModules, manualChunkAliasByEntry)) {
  31129. sortByExecutionOrder(modules);
  31130. const chunk = new Chunk$2(modules, this.inputOptions, this.outputOptions, this.unsetOptions, this.pluginDriver, this.graph.modulesById, chunkByModule, this.facadeChunkByModule, this.includedNamespaces, alias);
  31131. chunks.push(chunk);
  31132. for (const module of modules) {
  31133. chunkByModule.set(module, chunk);
  31134. }
  31135. }
  31136. for (const chunk of chunks) {
  31137. chunk.link();
  31138. }
  31139. const facades = [];
  31140. for (const chunk of chunks) {
  31141. facades.push(...chunk.generateFacades());
  31142. }
  31143. return [...chunks, ...facades];
  31144. }
  31145. prerenderChunks(chunks, inputBase) {
  31146. for (const chunk of chunks) {
  31147. chunk.generateExports();
  31148. }
  31149. for (const chunk of chunks) {
  31150. chunk.preRender(this.outputOptions, inputBase);
  31151. }
  31152. }
  31153. }
  31154. function getAbsoluteEntryModulePaths(chunks) {
  31155. const absoluteEntryModulePaths = [];
  31156. for (const chunk of chunks) {
  31157. for (const entryModule of chunk.entryModules) {
  31158. if (isAbsolute(entryModule.id)) {
  31159. absoluteEntryModulePaths.push(entryModule.id);
  31160. }
  31161. }
  31162. }
  31163. return absoluteEntryModulePaths;
  31164. }
  31165. function validateOptionsForMultiChunkOutput(outputOptions, onWarn) {
  31166. if (outputOptions.format === 'umd' || outputOptions.format === 'iife')
  31167. return error({
  31168. code: 'INVALID_OPTION',
  31169. message: 'UMD and IIFE output formats are not supported for code-splitting builds.'
  31170. });
  31171. if (typeof outputOptions.file === 'string')
  31172. return error({
  31173. code: 'INVALID_OPTION',
  31174. message: 'When building multiple chunks, the "output.dir" option must be used, not "output.file". ' +
  31175. 'To inline dynamic imports, set the "inlineDynamicImports" option.'
  31176. });
  31177. if (outputOptions.sourcemapFile)
  31178. return error({
  31179. code: 'INVALID_OPTION',
  31180. message: '"output.sourcemapFile" is only supported for single-file builds.'
  31181. });
  31182. if (!outputOptions.amd.autoId && outputOptions.amd.id)
  31183. onWarn({
  31184. code: 'INVALID_OPTION',
  31185. message: '"output.amd.id" is only properly supported for single-file builds. Use "output.amd.autoId" and "output.amd.basePath".'
  31186. });
  31187. }
  31188. function getIncludedModules(modulesById) {
  31189. return [...modulesById.values()].filter(module => module instanceof Module$1 &&
  31190. (module.isIncluded() || module.info.isEntry || module.includedDynamicImporters.length > 0));
  31191. }
  31192. function addModuleToManualChunk(alias, module, manualChunkAliasByEntry) {
  31193. const existingAlias = manualChunkAliasByEntry.get(module);
  31194. if (typeof existingAlias === 'string' && existingAlias !== alias) {
  31195. return error(errCannotAssignModuleToChunk(module.id, alias, existingAlias));
  31196. }
  31197. manualChunkAliasByEntry.set(module, alias);
  31198. }
  31199. // Reserved word lists for various dialects of the language
  31200. var reservedWords$5 = {
  31201. 3: "abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",
  31202. 5: "class enum extends super const export import",
  31203. 6: "enum",
  31204. strict: "implements interface let package private protected public static yield",
  31205. strictBind: "eval arguments"
  31206. };
  31207. // And the keywords
  31208. var ecma5AndLessKeywords = "break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this";
  31209. var keywords = {
  31210. 5: ecma5AndLessKeywords,
  31211. "5module": ecma5AndLessKeywords + " export import",
  31212. 6: ecma5AndLessKeywords + " const class extends export import super"
  31213. };
  31214. var keywordRelationalOperator = /^in(stanceof)?$/;
  31215. // ## Character categories
  31216. // Big ugly regular expressions that match characters in the
  31217. // whitespace, identifier, and identifier-start categories. These
  31218. // are only applied when a character is found to actually have a
  31219. // code point above 128.
  31220. // Generated by `bin/generate-identifier-regex.js`.
  31221. var nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u05d0-\u05ea\u05ef-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0860-\u086a\u08a0-\u08b4\u08b6-\u08c7\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u09fc\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0af9\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c58-\u0c5a\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d04-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e86-\u0e8a\u0e8c-\u0ea3\u0ea5\u0ea7-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1878\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c88\u1c90-\u1cba\u1cbd-\u1cbf\u1ce9-\u1cec\u1cee-\u1cf3\u1cf5\u1cf6\u1cfa\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309b-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312f\u3131-\u318e\u31a0-\u31bf\u31f0-\u31ff\u3400-\u4dbf\u4e00-\u9ffc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7bf\ua7c2-\ua7ca\ua7f5-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd\ua8fe\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab69\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc";
  31222. var nonASCIIidentifierChars = "\u200c\u200d\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u07fd\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08d3-\u08e1\u08e3-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u09fe\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0afa-\u0aff\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b55-\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c04\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0d00-\u0d03\u0d3b\u0d3c\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d81-\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0ebc\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1abf\u1ac0\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf4\u1cf7-\u1cf9\u1dc0-\u1df9\u1dfb-\u1dff\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69e\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua82c\ua880\ua881\ua8b4-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f1\ua8ff-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f";
  31223. var nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]");
  31224. var nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]");
  31225. nonASCIIidentifierStartChars = nonASCIIidentifierChars = null;
  31226. // These are a run-length and offset encoded representation of the
  31227. // >0xffff code points that are a valid part of identifiers. The
  31228. // offset starts at 0x10000, and each pair of numbers represents an
  31229. // offset to the next range, and then a size of the range. They were
  31230. // generated by bin/generate-identifier-regex.js
  31231. // eslint-disable-next-line comma-spacing
  31232. var astralIdentifierStartCodes = [0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,157,310,10,21,11,7,153,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,107,20,28,22,13,52,76,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,85,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,230,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,35,56,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,190,0,80,921,103,110,18,195,2749,1070,4050,582,8634,568,8,30,114,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8952,286,50,2,18,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,2357,44,11,6,17,0,370,43,1301,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42717,35,4148,12,221,3,5761,15,7472,3104,541,1507,4938];
  31233. // eslint-disable-next-line comma-spacing
  31234. var astralIdentifierCodes = [509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,154,10,176,2,54,14,32,9,16,3,46,10,54,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,161,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,19306,9,135,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,5319,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,262,6,10,9,419,13,1495,6,110,6,6,9,4759,9,787719,239];
  31235. // This has a complexity linear to the value of the code. The
  31236. // assumption is that looking up astral identifier characters is
  31237. // rare.
  31238. function isInAstralSet(code, set) {
  31239. var pos = 0x10000;
  31240. for (var i = 0; i < set.length; i += 2) {
  31241. pos += set[i];
  31242. if (pos > code) { return false }
  31243. pos += set[i + 1];
  31244. if (pos >= code) { return true }
  31245. }
  31246. }
  31247. // Test whether a given character code starts an identifier.
  31248. function isIdentifierStart(code, astral) {
  31249. if (code < 65) { return code === 36 }
  31250. if (code < 91) { return true }
  31251. if (code < 97) { return code === 95 }
  31252. if (code < 123) { return true }
  31253. if (code <= 0xffff) { return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code)) }
  31254. if (astral === false) { return false }
  31255. return isInAstralSet(code, astralIdentifierStartCodes)
  31256. }
  31257. // Test whether a given character is part of an identifier.
  31258. function isIdentifierChar(code, astral) {
  31259. if (code < 48) { return code === 36 }
  31260. if (code < 58) { return true }
  31261. if (code < 65) { return false }
  31262. if (code < 91) { return true }
  31263. if (code < 97) { return code === 95 }
  31264. if (code < 123) { return true }
  31265. if (code <= 0xffff) { return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code)) }
  31266. if (astral === false) { return false }
  31267. return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes)
  31268. }
  31269. // ## Token types
  31270. // The assignment of fine-grained, information-carrying type objects
  31271. // allows the tokenizer to store the information it has about a
  31272. // token in a way that is very cheap for the parser to look up.
  31273. // All token type variables start with an underscore, to make them
  31274. // easy to recognize.
  31275. // The `beforeExpr` property is used to disambiguate between regular
  31276. // expressions and divisions. It is set on all token types that can
  31277. // be followed by an expression (thus, a slash after them would be a
  31278. // regular expression).
  31279. //
  31280. // The `startsExpr` property is used to check if the token ends a
  31281. // `yield` expression. It is set on all token types that either can
  31282. // directly start an expression (like a quotation mark) or can
  31283. // continue an expression (like the body of a string).
  31284. //
  31285. // `isLoop` marks a keyword as starting a loop, which is important
  31286. // to know when parsing a label, in order to allow or disallow
  31287. // continue jumps to that label.
  31288. var TokenType = function TokenType(label, conf) {
  31289. if ( conf === void 0 ) conf = {};
  31290. this.label = label;
  31291. this.keyword = conf.keyword;
  31292. this.beforeExpr = !!conf.beforeExpr;
  31293. this.startsExpr = !!conf.startsExpr;
  31294. this.isLoop = !!conf.isLoop;
  31295. this.isAssign = !!conf.isAssign;
  31296. this.prefix = !!conf.prefix;
  31297. this.postfix = !!conf.postfix;
  31298. this.binop = conf.binop || null;
  31299. this.updateContext = null;
  31300. };
  31301. function binop(name, prec) {
  31302. return new TokenType(name, {beforeExpr: true, binop: prec})
  31303. }
  31304. var beforeExpr = {beforeExpr: true}, startsExpr = {startsExpr: true};
  31305. // Map keyword names to token types.
  31306. var keywords$1 = {};
  31307. // Succinct definitions of keyword token types
  31308. function kw(name, options) {
  31309. if ( options === void 0 ) options = {};
  31310. options.keyword = name;
  31311. return keywords$1[name] = new TokenType(name, options)
  31312. }
  31313. var types = {
  31314. num: new TokenType("num", startsExpr),
  31315. regexp: new TokenType("regexp", startsExpr),
  31316. string: new TokenType("string", startsExpr),
  31317. name: new TokenType("name", startsExpr),
  31318. eof: new TokenType("eof"),
  31319. // Punctuation token types.
  31320. bracketL: new TokenType("[", {beforeExpr: true, startsExpr: true}),
  31321. bracketR: new TokenType("]"),
  31322. braceL: new TokenType("{", {beforeExpr: true, startsExpr: true}),
  31323. braceR: new TokenType("}"),
  31324. parenL: new TokenType("(", {beforeExpr: true, startsExpr: true}),
  31325. parenR: new TokenType(")"),
  31326. comma: new TokenType(",", beforeExpr),
  31327. semi: new TokenType(";", beforeExpr),
  31328. colon: new TokenType(":", beforeExpr),
  31329. dot: new TokenType("."),
  31330. question: new TokenType("?", beforeExpr),
  31331. questionDot: new TokenType("?."),
  31332. arrow: new TokenType("=>", beforeExpr),
  31333. template: new TokenType("template"),
  31334. invalidTemplate: new TokenType("invalidTemplate"),
  31335. ellipsis: new TokenType("...", beforeExpr),
  31336. backQuote: new TokenType("`", startsExpr),
  31337. dollarBraceL: new TokenType("${", {beforeExpr: true, startsExpr: true}),
  31338. // Operators. These carry several kinds of properties to help the
  31339. // parser use them properly (the presence of these properties is
  31340. // what categorizes them as operators).
  31341. //
  31342. // `binop`, when present, specifies that this operator is a binary
  31343. // operator, and will refer to its precedence.
  31344. //
  31345. // `prefix` and `postfix` mark the operator as a prefix or postfix
  31346. // unary operator.
  31347. //
  31348. // `isAssign` marks all of `=`, `+=`, `-=` etcetera, which act as
  31349. // binary operators with a very low precedence, that should result
  31350. // in AssignmentExpression nodes.
  31351. eq: new TokenType("=", {beforeExpr: true, isAssign: true}),
  31352. assign: new TokenType("_=", {beforeExpr: true, isAssign: true}),
  31353. incDec: new TokenType("++/--", {prefix: true, postfix: true, startsExpr: true}),
  31354. prefix: new TokenType("!/~", {beforeExpr: true, prefix: true, startsExpr: true}),
  31355. logicalOR: binop("||", 1),
  31356. logicalAND: binop("&&", 2),
  31357. bitwiseOR: binop("|", 3),
  31358. bitwiseXOR: binop("^", 4),
  31359. bitwiseAND: binop("&", 5),
  31360. equality: binop("==/!=/===/!==", 6),
  31361. relational: binop("</>/<=/>=", 7),
  31362. bitShift: binop("<</>>/>>>", 8),
  31363. plusMin: new TokenType("+/-", {beforeExpr: true, binop: 9, prefix: true, startsExpr: true}),
  31364. modulo: binop("%", 10),
  31365. star: binop("*", 10),
  31366. slash: binop("/", 10),
  31367. starstar: new TokenType("**", {beforeExpr: true}),
  31368. coalesce: binop("??", 1),
  31369. // Keyword token types.
  31370. _break: kw("break"),
  31371. _case: kw("case", beforeExpr),
  31372. _catch: kw("catch"),
  31373. _continue: kw("continue"),
  31374. _debugger: kw("debugger"),
  31375. _default: kw("default", beforeExpr),
  31376. _do: kw("do", {isLoop: true, beforeExpr: true}),
  31377. _else: kw("else", beforeExpr),
  31378. _finally: kw("finally"),
  31379. _for: kw("for", {isLoop: true}),
  31380. _function: kw("function", startsExpr),
  31381. _if: kw("if"),
  31382. _return: kw("return", beforeExpr),
  31383. _switch: kw("switch"),
  31384. _throw: kw("throw", beforeExpr),
  31385. _try: kw("try"),
  31386. _var: kw("var"),
  31387. _const: kw("const"),
  31388. _while: kw("while", {isLoop: true}),
  31389. _with: kw("with"),
  31390. _new: kw("new", {beforeExpr: true, startsExpr: true}),
  31391. _this: kw("this", startsExpr),
  31392. _super: kw("super", startsExpr),
  31393. _class: kw("class", startsExpr),
  31394. _extends: kw("extends", beforeExpr),
  31395. _export: kw("export"),
  31396. _import: kw("import", startsExpr),
  31397. _null: kw("null", startsExpr),
  31398. _true: kw("true", startsExpr),
  31399. _false: kw("false", startsExpr),
  31400. _in: kw("in", {beforeExpr: true, binop: 7}),
  31401. _instanceof: kw("instanceof", {beforeExpr: true, binop: 7}),
  31402. _typeof: kw("typeof", {beforeExpr: true, prefix: true, startsExpr: true}),
  31403. _void: kw("void", {beforeExpr: true, prefix: true, startsExpr: true}),
  31404. _delete: kw("delete", {beforeExpr: true, prefix: true, startsExpr: true})
  31405. };
  31406. // Matches a whole line break (where CRLF is considered a single
  31407. // line break). Used to count lines.
  31408. var lineBreak = /\r\n?|\n|\u2028|\u2029/;
  31409. var lineBreakG = new RegExp(lineBreak.source, "g");
  31410. function isNewLine(code, ecma2019String) {
  31411. return code === 10 || code === 13 || (!ecma2019String && (code === 0x2028 || code === 0x2029))
  31412. }
  31413. var nonASCIIwhitespace = /[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/;
  31414. var skipWhiteSpace = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g;
  31415. var ref = Object.prototype;
  31416. var hasOwnProperty$1 = ref.hasOwnProperty;
  31417. var toString$2 = ref.toString;
  31418. // Checks if an object has a property.
  31419. function has(obj, propName) {
  31420. return hasOwnProperty$1.call(obj, propName)
  31421. }
  31422. var isArray$6 = Array.isArray || (function (obj) { return (
  31423. toString$2.call(obj) === "[object Array]"
  31424. ); });
  31425. function wordsRegexp(words) {
  31426. return new RegExp("^(?:" + words.replace(/ /g, "|") + ")$")
  31427. }
  31428. // These are used when `options.locations` is on, for the
  31429. // `startLoc` and `endLoc` properties.
  31430. var Position = function Position(line, col) {
  31431. this.line = line;
  31432. this.column = col;
  31433. };
  31434. Position.prototype.offset = function offset (n) {
  31435. return new Position(this.line, this.column + n)
  31436. };
  31437. var SourceLocation = function SourceLocation(p, start, end) {
  31438. this.start = start;
  31439. this.end = end;
  31440. if (p.sourceFile !== null) { this.source = p.sourceFile; }
  31441. };
  31442. // The `getLineInfo` function is mostly useful when the
  31443. // `locations` option is off (for performance reasons) and you
  31444. // want to find the line/column position for a given character
  31445. // offset. `input` should be the code string that the offset refers
  31446. // into.
  31447. function getLineInfo(input, offset) {
  31448. for (var line = 1, cur = 0;;) {
  31449. lineBreakG.lastIndex = cur;
  31450. var match = lineBreakG.exec(input);
  31451. if (match && match.index < offset) {
  31452. ++line;
  31453. cur = match.index + match[0].length;
  31454. } else {
  31455. return new Position(line, offset - cur)
  31456. }
  31457. }
  31458. }
  31459. // A second argument must be given to configure the parser process.
  31460. // These options are recognized (only `ecmaVersion` is required):
  31461. var defaultOptions = {
  31462. // `ecmaVersion` indicates the ECMAScript version to parse. Must be
  31463. // either 3, 5, 6 (or 2015), 7 (2016), 8 (2017), 9 (2018), 10
  31464. // (2019), 11 (2020), 12 (2021), or `"latest"` (the latest version
  31465. // the library supports). This influences support for strict mode,
  31466. // the set of reserved words, and support for new syntax features.
  31467. ecmaVersion: null,
  31468. // `sourceType` indicates the mode the code should be parsed in.
  31469. // Can be either `"script"` or `"module"`. This influences global
  31470. // strict mode and parsing of `import` and `export` declarations.
  31471. sourceType: "script",
  31472. // `onInsertedSemicolon` can be a callback that will be called
  31473. // when a semicolon is automatically inserted. It will be passed
  31474. // the position of the comma as an offset, and if `locations` is
  31475. // enabled, it is given the location as a `{line, column}` object
  31476. // as second argument.
  31477. onInsertedSemicolon: null,
  31478. // `onTrailingComma` is similar to `onInsertedSemicolon`, but for
  31479. // trailing commas.
  31480. onTrailingComma: null,
  31481. // By default, reserved words are only enforced if ecmaVersion >= 5.
  31482. // Set `allowReserved` to a boolean value to explicitly turn this on
  31483. // an off. When this option has the value "never", reserved words
  31484. // and keywords can also not be used as property names.
  31485. allowReserved: null,
  31486. // When enabled, a return at the top level is not considered an
  31487. // error.
  31488. allowReturnOutsideFunction: false,
  31489. // When enabled, import/export statements are not constrained to
  31490. // appearing at the top of the program.
  31491. allowImportExportEverywhere: false,
  31492. // When enabled, await identifiers are allowed to appear at the top-level scope,
  31493. // but they are still not allowed in non-async functions.
  31494. allowAwaitOutsideFunction: false,
  31495. // When enabled, hashbang directive in the beginning of file
  31496. // is allowed and treated as a line comment.
  31497. allowHashBang: false,
  31498. // When `locations` is on, `loc` properties holding objects with
  31499. // `start` and `end` properties in `{line, column}` form (with
  31500. // line being 1-based and column 0-based) will be attached to the
  31501. // nodes.
  31502. locations: false,
  31503. // A function can be passed as `onToken` option, which will
  31504. // cause Acorn to call that function with object in the same
  31505. // format as tokens returned from `tokenizer().getToken()`. Note
  31506. // that you are not allowed to call the parser from the
  31507. // callback—that will corrupt its internal state.
  31508. onToken: null,
  31509. // A function can be passed as `onComment` option, which will
  31510. // cause Acorn to call that function with `(block, text, start,
  31511. // end)` parameters whenever a comment is skipped. `block` is a
  31512. // boolean indicating whether this is a block (`/* */`) comment,
  31513. // `text` is the content of the comment, and `start` and `end` are
  31514. // character offsets that denote the start and end of the comment.
  31515. // When the `locations` option is on, two more parameters are
  31516. // passed, the full `{line, column}` locations of the start and
  31517. // end of the comments. Note that you are not allowed to call the
  31518. // parser from the callback—that will corrupt its internal state.
  31519. onComment: null,
  31520. // Nodes have their start and end characters offsets recorded in
  31521. // `start` and `end` properties (directly on the node, rather than
  31522. // the `loc` object, which holds line/column data. To also add a
  31523. // [semi-standardized][range] `range` property holding a `[start,
  31524. // end]` array with the same numbers, set the `ranges` option to
  31525. // `true`.
  31526. //
  31527. // [range]: https://bugzilla.mozilla.org/show_bug.cgi?id=745678
  31528. ranges: false,
  31529. // It is possible to parse multiple files into a single AST by
  31530. // passing the tree produced by parsing the first file as
  31531. // `program` option in subsequent parses. This will add the
  31532. // toplevel forms of the parsed file to the `Program` (top) node
  31533. // of an existing parse tree.
  31534. program: null,
  31535. // When `locations` is on, you can pass this to record the source
  31536. // file in every node's `loc` object.
  31537. sourceFile: null,
  31538. // This value, if given, is stored in every node, whether
  31539. // `locations` is on or off.
  31540. directSourceFile: null,
  31541. // When enabled, parenthesized expressions are represented by
  31542. // (non-standard) ParenthesizedExpression nodes
  31543. preserveParens: false
  31544. };
  31545. // Interpret and default an options object
  31546. var warnedAboutEcmaVersion = false;
  31547. function getOptions(opts) {
  31548. var options = {};
  31549. for (var opt in defaultOptions)
  31550. { options[opt] = opts && has(opts, opt) ? opts[opt] : defaultOptions[opt]; }
  31551. if (options.ecmaVersion === "latest") {
  31552. options.ecmaVersion = 1e8;
  31553. } else if (options.ecmaVersion == null) {
  31554. if (!warnedAboutEcmaVersion && typeof console === "object" && console.warn) {
  31555. warnedAboutEcmaVersion = true;
  31556. console.warn("Since Acorn 8.0.0, options.ecmaVersion is required.\nDefaulting to 2020, but this will stop working in the future.");
  31557. }
  31558. options.ecmaVersion = 11;
  31559. } else if (options.ecmaVersion >= 2015) {
  31560. options.ecmaVersion -= 2009;
  31561. }
  31562. if (options.allowReserved == null)
  31563. { options.allowReserved = options.ecmaVersion < 5; }
  31564. if (isArray$6(options.onToken)) {
  31565. var tokens = options.onToken;
  31566. options.onToken = function (token) { return tokens.push(token); };
  31567. }
  31568. if (isArray$6(options.onComment))
  31569. { options.onComment = pushComment(options, options.onComment); }
  31570. return options
  31571. }
  31572. function pushComment(options, array) {
  31573. return function(block, text, start, end, startLoc, endLoc) {
  31574. var comment = {
  31575. type: block ? "Block" : "Line",
  31576. value: text,
  31577. start: start,
  31578. end: end
  31579. };
  31580. if (options.locations)
  31581. { comment.loc = new SourceLocation(this, startLoc, endLoc); }
  31582. if (options.ranges)
  31583. { comment.range = [start, end]; }
  31584. array.push(comment);
  31585. }
  31586. }
  31587. // Each scope gets a bitset that may contain these flags
  31588. var
  31589. SCOPE_TOP = 1,
  31590. SCOPE_FUNCTION = 2,
  31591. SCOPE_VAR = SCOPE_TOP | SCOPE_FUNCTION,
  31592. SCOPE_ASYNC = 4,
  31593. SCOPE_GENERATOR = 8,
  31594. SCOPE_ARROW = 16,
  31595. SCOPE_SIMPLE_CATCH = 32,
  31596. SCOPE_SUPER = 64,
  31597. SCOPE_DIRECT_SUPER = 128;
  31598. function functionFlags(async, generator) {
  31599. return SCOPE_FUNCTION | (async ? SCOPE_ASYNC : 0) | (generator ? SCOPE_GENERATOR : 0)
  31600. }
  31601. // Used in checkLVal* and declareName to determine the type of a binding
  31602. var
  31603. BIND_NONE = 0, // Not a binding
  31604. BIND_VAR = 1, // Var-style binding
  31605. BIND_LEXICAL = 2, // Let- or const-style binding
  31606. BIND_FUNCTION = 3, // Function declaration
  31607. BIND_SIMPLE_CATCH = 4, // Simple (identifier pattern) catch binding
  31608. BIND_OUTSIDE = 5; // Special case for function names as bound inside the function
  31609. var Parser = function Parser(options, input, startPos) {
  31610. this.options = options = getOptions(options);
  31611. this.sourceFile = options.sourceFile;
  31612. this.keywords = wordsRegexp(keywords[options.ecmaVersion >= 6 ? 6 : options.sourceType === "module" ? "5module" : 5]);
  31613. var reserved = "";
  31614. if (options.allowReserved !== true) {
  31615. reserved = reservedWords$5[options.ecmaVersion >= 6 ? 6 : options.ecmaVersion === 5 ? 5 : 3];
  31616. if (options.sourceType === "module") { reserved += " await"; }
  31617. }
  31618. this.reservedWords = wordsRegexp(reserved);
  31619. var reservedStrict = (reserved ? reserved + " " : "") + reservedWords$5.strict;
  31620. this.reservedWordsStrict = wordsRegexp(reservedStrict);
  31621. this.reservedWordsStrictBind = wordsRegexp(reservedStrict + " " + reservedWords$5.strictBind);
  31622. this.input = String(input);
  31623. // Used to signal to callers of `readWord1` whether the word
  31624. // contained any escape sequences. This is needed because words with
  31625. // escape sequences must not be interpreted as keywords.
  31626. this.containsEsc = false;
  31627. // Set up token state
  31628. // The current position of the tokenizer in the input.
  31629. if (startPos) {
  31630. this.pos = startPos;
  31631. this.lineStart = this.input.lastIndexOf("\n", startPos - 1) + 1;
  31632. this.curLine = this.input.slice(0, this.lineStart).split(lineBreak).length;
  31633. } else {
  31634. this.pos = this.lineStart = 0;
  31635. this.curLine = 1;
  31636. }
  31637. // Properties of the current token:
  31638. // Its type
  31639. this.type = types.eof;
  31640. // For tokens that include more information than their type, the value
  31641. this.value = null;
  31642. // Its start and end offset
  31643. this.start = this.end = this.pos;
  31644. // And, if locations are used, the {line, column} object
  31645. // corresponding to those offsets
  31646. this.startLoc = this.endLoc = this.curPosition();
  31647. // Position information for the previous token
  31648. this.lastTokEndLoc = this.lastTokStartLoc = null;
  31649. this.lastTokStart = this.lastTokEnd = this.pos;
  31650. // The context stack is used to superficially track syntactic
  31651. // context to predict whether a regular expression is allowed in a
  31652. // given position.
  31653. this.context = this.initialContext();
  31654. this.exprAllowed = true;
  31655. // Figure out if it's a module code.
  31656. this.inModule = options.sourceType === "module";
  31657. this.strict = this.inModule || this.strictDirective(this.pos);
  31658. // Used to signify the start of a potential arrow function
  31659. this.potentialArrowAt = -1;
  31660. // Positions to delayed-check that yield/await does not exist in default parameters.
  31661. this.yieldPos = this.awaitPos = this.awaitIdentPos = 0;
  31662. // Labels in scope.
  31663. this.labels = [];
  31664. // Thus-far undefined exports.
  31665. this.undefinedExports = Object.create(null);
  31666. // If enabled, skip leading hashbang line.
  31667. if (this.pos === 0 && options.allowHashBang && this.input.slice(0, 2) === "#!")
  31668. { this.skipLineComment(2); }
  31669. // Scope tracking for duplicate variable names (see scope.js)
  31670. this.scopeStack = [];
  31671. this.enterScope(SCOPE_TOP);
  31672. // For RegExp validation
  31673. this.regexpState = null;
  31674. };
  31675. var prototypeAccessors = { inFunction: { configurable: true },inGenerator: { configurable: true },inAsync: { configurable: true },allowSuper: { configurable: true },allowDirectSuper: { configurable: true },treatFunctionsAsVar: { configurable: true },inNonArrowFunction: { configurable: true } };
  31676. Parser.prototype.parse = function parse () {
  31677. var node = this.options.program || this.startNode();
  31678. this.nextToken();
  31679. return this.parseTopLevel(node)
  31680. };
  31681. prototypeAccessors.inFunction.get = function () { return (this.currentVarScope().flags & SCOPE_FUNCTION) > 0 };
  31682. prototypeAccessors.inGenerator.get = function () { return (this.currentVarScope().flags & SCOPE_GENERATOR) > 0 };
  31683. prototypeAccessors.inAsync.get = function () { return (this.currentVarScope().flags & SCOPE_ASYNC) > 0 };
  31684. prototypeAccessors.allowSuper.get = function () { return (this.currentThisScope().flags & SCOPE_SUPER) > 0 };
  31685. prototypeAccessors.allowDirectSuper.get = function () { return (this.currentThisScope().flags & SCOPE_DIRECT_SUPER) > 0 };
  31686. prototypeAccessors.treatFunctionsAsVar.get = function () { return this.treatFunctionsAsVarInScope(this.currentScope()) };
  31687. prototypeAccessors.inNonArrowFunction.get = function () { return (this.currentThisScope().flags & SCOPE_FUNCTION) > 0 };
  31688. Parser.extend = function extend () {
  31689. var plugins = [], len = arguments.length;
  31690. while ( len-- ) plugins[ len ] = arguments[ len ];
  31691. var cls = this;
  31692. for (var i = 0; i < plugins.length; i++) { cls = plugins[i](cls); }
  31693. return cls
  31694. };
  31695. Parser.parse = function parse (input, options) {
  31696. return new this(options, input).parse()
  31697. };
  31698. Parser.parseExpressionAt = function parseExpressionAt (input, pos, options) {
  31699. var parser = new this(options, input, pos);
  31700. parser.nextToken();
  31701. return parser.parseExpression()
  31702. };
  31703. Parser.tokenizer = function tokenizer (input, options) {
  31704. return new this(options, input)
  31705. };
  31706. Object.defineProperties( Parser.prototype, prototypeAccessors );
  31707. var pp = Parser.prototype;
  31708. // ## Parser utilities
  31709. var literal = /^(?:'((?:\\.|[^'\\])*?)'|"((?:\\.|[^"\\])*?)")/;
  31710. pp.strictDirective = function(start) {
  31711. for (;;) {
  31712. // Try to find string literal.
  31713. skipWhiteSpace.lastIndex = start;
  31714. start += skipWhiteSpace.exec(this.input)[0].length;
  31715. var match = literal.exec(this.input.slice(start));
  31716. if (!match) { return false }
  31717. if ((match[1] || match[2]) === "use strict") {
  31718. skipWhiteSpace.lastIndex = start + match[0].length;
  31719. var spaceAfter = skipWhiteSpace.exec(this.input), end = spaceAfter.index + spaceAfter[0].length;
  31720. var next = this.input.charAt(end);
  31721. return next === ";" || next === "}" ||
  31722. (lineBreak.test(spaceAfter[0]) &&
  31723. !(/[(`.[+\-/*%<>=,?^&]/.test(next) || next === "!" && this.input.charAt(end + 1) === "="))
  31724. }
  31725. start += match[0].length;
  31726. // Skip semicolon, if any.
  31727. skipWhiteSpace.lastIndex = start;
  31728. start += skipWhiteSpace.exec(this.input)[0].length;
  31729. if (this.input[start] === ";")
  31730. { start++; }
  31731. }
  31732. };
  31733. // Predicate that tests whether the next token is of the given
  31734. // type, and if yes, consumes it as a side effect.
  31735. pp.eat = function(type) {
  31736. if (this.type === type) {
  31737. this.next();
  31738. return true
  31739. } else {
  31740. return false
  31741. }
  31742. };
  31743. // Tests whether parsed token is a contextual keyword.
  31744. pp.isContextual = function(name) {
  31745. return this.type === types.name && this.value === name && !this.containsEsc
  31746. };
  31747. // Consumes contextual keyword if possible.
  31748. pp.eatContextual = function(name) {
  31749. if (!this.isContextual(name)) { return false }
  31750. this.next();
  31751. return true
  31752. };
  31753. // Asserts that following token is given contextual keyword.
  31754. pp.expectContextual = function(name) {
  31755. if (!this.eatContextual(name)) { this.unexpected(); }
  31756. };
  31757. // Test whether a semicolon can be inserted at the current position.
  31758. pp.canInsertSemicolon = function() {
  31759. return this.type === types.eof ||
  31760. this.type === types.braceR ||
  31761. lineBreak.test(this.input.slice(this.lastTokEnd, this.start))
  31762. };
  31763. pp.insertSemicolon = function() {
  31764. if (this.canInsertSemicolon()) {
  31765. if (this.options.onInsertedSemicolon)
  31766. { this.options.onInsertedSemicolon(this.lastTokEnd, this.lastTokEndLoc); }
  31767. return true
  31768. }
  31769. };
  31770. // Consume a semicolon, or, failing that, see if we are allowed to
  31771. // pretend that there is a semicolon at this position.
  31772. pp.semicolon = function() {
  31773. if (!this.eat(types.semi) && !this.insertSemicolon()) { this.unexpected(); }
  31774. };
  31775. pp.afterTrailingComma = function(tokType, notNext) {
  31776. if (this.type === tokType) {
  31777. if (this.options.onTrailingComma)
  31778. { this.options.onTrailingComma(this.lastTokStart, this.lastTokStartLoc); }
  31779. if (!notNext)
  31780. { this.next(); }
  31781. return true
  31782. }
  31783. };
  31784. // Expect a token of a given type. If found, consume it, otherwise,
  31785. // raise an unexpected token error.
  31786. pp.expect = function(type) {
  31787. this.eat(type) || this.unexpected();
  31788. };
  31789. // Raise an unexpected token error.
  31790. pp.unexpected = function(pos) {
  31791. this.raise(pos != null ? pos : this.start, "Unexpected token");
  31792. };
  31793. function DestructuringErrors() {
  31794. this.shorthandAssign =
  31795. this.trailingComma =
  31796. this.parenthesizedAssign =
  31797. this.parenthesizedBind =
  31798. this.doubleProto =
  31799. -1;
  31800. }
  31801. pp.checkPatternErrors = function(refDestructuringErrors, isAssign) {
  31802. if (!refDestructuringErrors) { return }
  31803. if (refDestructuringErrors.trailingComma > -1)
  31804. { this.raiseRecoverable(refDestructuringErrors.trailingComma, "Comma is not permitted after the rest element"); }
  31805. var parens = isAssign ? refDestructuringErrors.parenthesizedAssign : refDestructuringErrors.parenthesizedBind;
  31806. if (parens > -1) { this.raiseRecoverable(parens, "Parenthesized pattern"); }
  31807. };
  31808. pp.checkExpressionErrors = function(refDestructuringErrors, andThrow) {
  31809. if (!refDestructuringErrors) { return false }
  31810. var shorthandAssign = refDestructuringErrors.shorthandAssign;
  31811. var doubleProto = refDestructuringErrors.doubleProto;
  31812. if (!andThrow) { return shorthandAssign >= 0 || doubleProto >= 0 }
  31813. if (shorthandAssign >= 0)
  31814. { this.raise(shorthandAssign, "Shorthand property assignments are valid only in destructuring patterns"); }
  31815. if (doubleProto >= 0)
  31816. { this.raiseRecoverable(doubleProto, "Redefinition of __proto__ property"); }
  31817. };
  31818. pp.checkYieldAwaitInDefaultParams = function() {
  31819. if (this.yieldPos && (!this.awaitPos || this.yieldPos < this.awaitPos))
  31820. { this.raise(this.yieldPos, "Yield expression cannot be a default value"); }
  31821. if (this.awaitPos)
  31822. { this.raise(this.awaitPos, "Await expression cannot be a default value"); }
  31823. };
  31824. pp.isSimpleAssignTarget = function(expr) {
  31825. if (expr.type === "ParenthesizedExpression")
  31826. { return this.isSimpleAssignTarget(expr.expression) }
  31827. return expr.type === "Identifier" || expr.type === "MemberExpression"
  31828. };
  31829. var pp$1 = Parser.prototype;
  31830. // ### Statement parsing
  31831. // Parse a program. Initializes the parser, reads any number of
  31832. // statements, and wraps them in a Program node. Optionally takes a
  31833. // `program` argument. If present, the statements will be appended
  31834. // to its body instead of creating a new node.
  31835. pp$1.parseTopLevel = function(node) {
  31836. var exports = Object.create(null);
  31837. if (!node.body) { node.body = []; }
  31838. while (this.type !== types.eof) {
  31839. var stmt = this.parseStatement(null, true, exports);
  31840. node.body.push(stmt);
  31841. }
  31842. if (this.inModule)
  31843. { for (var i = 0, list = Object.keys(this.undefinedExports); i < list.length; i += 1)
  31844. {
  31845. var name = list[i];
  31846. this.raiseRecoverable(this.undefinedExports[name].start, ("Export '" + name + "' is not defined"));
  31847. } }
  31848. this.adaptDirectivePrologue(node.body);
  31849. this.next();
  31850. node.sourceType = this.options.sourceType;
  31851. return this.finishNode(node, "Program")
  31852. };
  31853. var loopLabel = {kind: "loop"}, switchLabel = {kind: "switch"};
  31854. pp$1.isLet = function(context) {
  31855. if (this.options.ecmaVersion < 6 || !this.isContextual("let")) { return false }
  31856. skipWhiteSpace.lastIndex = this.pos;
  31857. var skip = skipWhiteSpace.exec(this.input);
  31858. var next = this.pos + skip[0].length, nextCh = this.input.charCodeAt(next);
  31859. // For ambiguous cases, determine if a LexicalDeclaration (or only a
  31860. // Statement) is allowed here. If context is not empty then only a Statement
  31861. // is allowed. However, `let [` is an explicit negative lookahead for
  31862. // ExpressionStatement, so special-case it first.
  31863. if (nextCh === 91) { return true } // '['
  31864. if (context) { return false }
  31865. if (nextCh === 123) { return true } // '{'
  31866. if (isIdentifierStart(nextCh, true)) {
  31867. var pos = next + 1;
  31868. while (isIdentifierChar(this.input.charCodeAt(pos), true)) { ++pos; }
  31869. var ident = this.input.slice(next, pos);
  31870. if (!keywordRelationalOperator.test(ident)) { return true }
  31871. }
  31872. return false
  31873. };
  31874. // check 'async [no LineTerminator here] function'
  31875. // - 'async /*foo*/ function' is OK.
  31876. // - 'async /*\n*/ function' is invalid.
  31877. pp$1.isAsyncFunction = function() {
  31878. if (this.options.ecmaVersion < 8 || !this.isContextual("async"))
  31879. { return false }
  31880. skipWhiteSpace.lastIndex = this.pos;
  31881. var skip = skipWhiteSpace.exec(this.input);
  31882. var next = this.pos + skip[0].length;
  31883. return !lineBreak.test(this.input.slice(this.pos, next)) &&
  31884. this.input.slice(next, next + 8) === "function" &&
  31885. (next + 8 === this.input.length || !isIdentifierChar(this.input.charAt(next + 8)))
  31886. };
  31887. // Parse a single statement.
  31888. //
  31889. // If expecting a statement and finding a slash operator, parse a
  31890. // regular expression literal. This is to handle cases like
  31891. // `if (foo) /blah/.exec(foo)`, where looking at the previous token
  31892. // does not help.
  31893. pp$1.parseStatement = function(context, topLevel, exports) {
  31894. var starttype = this.type, node = this.startNode(), kind;
  31895. if (this.isLet(context)) {
  31896. starttype = types._var;
  31897. kind = "let";
  31898. }
  31899. // Most types of statements are recognized by the keyword they
  31900. // start with. Many are trivial to parse, some require a bit of
  31901. // complexity.
  31902. switch (starttype) {
  31903. case types._break: case types._continue: return this.parseBreakContinueStatement(node, starttype.keyword)
  31904. case types._debugger: return this.parseDebuggerStatement(node)
  31905. case types._do: return this.parseDoStatement(node)
  31906. case types._for: return this.parseForStatement(node)
  31907. case types._function:
  31908. // Function as sole body of either an if statement or a labeled statement
  31909. // works, but not when it is part of a labeled statement that is the sole
  31910. // body of an if statement.
  31911. if ((context && (this.strict || context !== "if" && context !== "label")) && this.options.ecmaVersion >= 6) { this.unexpected(); }
  31912. return this.parseFunctionStatement(node, false, !context)
  31913. case types._class:
  31914. if (context) { this.unexpected(); }
  31915. return this.parseClass(node, true)
  31916. case types._if: return this.parseIfStatement(node)
  31917. case types._return: return this.parseReturnStatement(node)
  31918. case types._switch: return this.parseSwitchStatement(node)
  31919. case types._throw: return this.parseThrowStatement(node)
  31920. case types._try: return this.parseTryStatement(node)
  31921. case types._const: case types._var:
  31922. kind = kind || this.value;
  31923. if (context && kind !== "var") { this.unexpected(); }
  31924. return this.parseVarStatement(node, kind)
  31925. case types._while: return this.parseWhileStatement(node)
  31926. case types._with: return this.parseWithStatement(node)
  31927. case types.braceL: return this.parseBlock(true, node)
  31928. case types.semi: return this.parseEmptyStatement(node)
  31929. case types._export:
  31930. case types._import:
  31931. if (this.options.ecmaVersion > 10 && starttype === types._import) {
  31932. skipWhiteSpace.lastIndex = this.pos;
  31933. var skip = skipWhiteSpace.exec(this.input);
  31934. var next = this.pos + skip[0].length, nextCh = this.input.charCodeAt(next);
  31935. if (nextCh === 40 || nextCh === 46) // '(' or '.'
  31936. { return this.parseExpressionStatement(node, this.parseExpression()) }
  31937. }
  31938. if (!this.options.allowImportExportEverywhere) {
  31939. if (!topLevel)
  31940. { this.raise(this.start, "'import' and 'export' may only appear at the top level"); }
  31941. if (!this.inModule)
  31942. { this.raise(this.start, "'import' and 'export' may appear only with 'sourceType: module'"); }
  31943. }
  31944. return starttype === types._import ? this.parseImport(node) : this.parseExport(node, exports)
  31945. // If the statement does not start with a statement keyword or a
  31946. // brace, it's an ExpressionStatement or LabeledStatement. We
  31947. // simply start parsing an expression, and afterwards, if the
  31948. // next token is a colon and the expression was a simple
  31949. // Identifier node, we switch to interpreting it as a label.
  31950. default:
  31951. if (this.isAsyncFunction()) {
  31952. if (context) { this.unexpected(); }
  31953. this.next();
  31954. return this.parseFunctionStatement(node, true, !context)
  31955. }
  31956. var maybeName = this.value, expr = this.parseExpression();
  31957. if (starttype === types.name && expr.type === "Identifier" && this.eat(types.colon))
  31958. { return this.parseLabeledStatement(node, maybeName, expr, context) }
  31959. else { return this.parseExpressionStatement(node, expr) }
  31960. }
  31961. };
  31962. pp$1.parseBreakContinueStatement = function(node, keyword) {
  31963. var isBreak = keyword === "break";
  31964. this.next();
  31965. if (this.eat(types.semi) || this.insertSemicolon()) { node.label = null; }
  31966. else if (this.type !== types.name) { this.unexpected(); }
  31967. else {
  31968. node.label = this.parseIdent();
  31969. this.semicolon();
  31970. }
  31971. // Verify that there is an actual destination to break or
  31972. // continue to.
  31973. var i = 0;
  31974. for (; i < this.labels.length; ++i) {
  31975. var lab = this.labels[i];
  31976. if (node.label == null || lab.name === node.label.name) {
  31977. if (lab.kind != null && (isBreak || lab.kind === "loop")) { break }
  31978. if (node.label && isBreak) { break }
  31979. }
  31980. }
  31981. if (i === this.labels.length) { this.raise(node.start, "Unsyntactic " + keyword); }
  31982. return this.finishNode(node, isBreak ? "BreakStatement" : "ContinueStatement")
  31983. };
  31984. pp$1.parseDebuggerStatement = function(node) {
  31985. this.next();
  31986. this.semicolon();
  31987. return this.finishNode(node, "DebuggerStatement")
  31988. };
  31989. pp$1.parseDoStatement = function(node) {
  31990. this.next();
  31991. this.labels.push(loopLabel);
  31992. node.body = this.parseStatement("do");
  31993. this.labels.pop();
  31994. this.expect(types._while);
  31995. node.test = this.parseParenExpression();
  31996. if (this.options.ecmaVersion >= 6)
  31997. { this.eat(types.semi); }
  31998. else
  31999. { this.semicolon(); }
  32000. return this.finishNode(node, "DoWhileStatement")
  32001. };
  32002. // Disambiguating between a `for` and a `for`/`in` or `for`/`of`
  32003. // loop is non-trivial. Basically, we have to parse the init `var`
  32004. // statement or expression, disallowing the `in` operator (see
  32005. // the second parameter to `parseExpression`), and then check
  32006. // whether the next token is `in` or `of`. When there is no init
  32007. // part (semicolon immediately after the opening parenthesis), it
  32008. // is a regular `for` loop.
  32009. pp$1.parseForStatement = function(node) {
  32010. this.next();
  32011. var awaitAt = (this.options.ecmaVersion >= 9 && (this.inAsync || (!this.inFunction && this.options.allowAwaitOutsideFunction)) && this.eatContextual("await")) ? this.lastTokStart : -1;
  32012. this.labels.push(loopLabel);
  32013. this.enterScope(0);
  32014. this.expect(types.parenL);
  32015. if (this.type === types.semi) {
  32016. if (awaitAt > -1) { this.unexpected(awaitAt); }
  32017. return this.parseFor(node, null)
  32018. }
  32019. var isLet = this.isLet();
  32020. if (this.type === types._var || this.type === types._const || isLet) {
  32021. var init$1 = this.startNode(), kind = isLet ? "let" : this.value;
  32022. this.next();
  32023. this.parseVar(init$1, true, kind);
  32024. this.finishNode(init$1, "VariableDeclaration");
  32025. if ((this.type === types._in || (this.options.ecmaVersion >= 6 && this.isContextual("of"))) && init$1.declarations.length === 1) {
  32026. if (this.options.ecmaVersion >= 9) {
  32027. if (this.type === types._in) {
  32028. if (awaitAt > -1) { this.unexpected(awaitAt); }
  32029. } else { node.await = awaitAt > -1; }
  32030. }
  32031. return this.parseForIn(node, init$1)
  32032. }
  32033. if (awaitAt > -1) { this.unexpected(awaitAt); }
  32034. return this.parseFor(node, init$1)
  32035. }
  32036. var refDestructuringErrors = new DestructuringErrors;
  32037. var init = this.parseExpression(true, refDestructuringErrors);
  32038. if (this.type === types._in || (this.options.ecmaVersion >= 6 && this.isContextual("of"))) {
  32039. if (this.options.ecmaVersion >= 9) {
  32040. if (this.type === types._in) {
  32041. if (awaitAt > -1) { this.unexpected(awaitAt); }
  32042. } else { node.await = awaitAt > -1; }
  32043. }
  32044. this.toAssignable(init, false, refDestructuringErrors);
  32045. this.checkLValPattern(init);
  32046. return this.parseForIn(node, init)
  32047. } else {
  32048. this.checkExpressionErrors(refDestructuringErrors, true);
  32049. }
  32050. if (awaitAt > -1) { this.unexpected(awaitAt); }
  32051. return this.parseFor(node, init)
  32052. };
  32053. pp$1.parseFunctionStatement = function(node, isAsync, declarationPosition) {
  32054. this.next();
  32055. return this.parseFunction(node, FUNC_STATEMENT | (declarationPosition ? 0 : FUNC_HANGING_STATEMENT), false, isAsync)
  32056. };
  32057. pp$1.parseIfStatement = function(node) {
  32058. this.next();
  32059. node.test = this.parseParenExpression();
  32060. // allow function declarations in branches, but only in non-strict mode
  32061. node.consequent = this.parseStatement("if");
  32062. node.alternate = this.eat(types._else) ? this.parseStatement("if") : null;
  32063. return this.finishNode(node, "IfStatement")
  32064. };
  32065. pp$1.parseReturnStatement = function(node) {
  32066. if (!this.inFunction && !this.options.allowReturnOutsideFunction)
  32067. { this.raise(this.start, "'return' outside of function"); }
  32068. this.next();
  32069. // In `return` (and `break`/`continue`), the keywords with
  32070. // optional arguments, we eagerly look for a semicolon or the
  32071. // possibility to insert one.
  32072. if (this.eat(types.semi) || this.insertSemicolon()) { node.argument = null; }
  32073. else { node.argument = this.parseExpression(); this.semicolon(); }
  32074. return this.finishNode(node, "ReturnStatement")
  32075. };
  32076. pp$1.parseSwitchStatement = function(node) {
  32077. this.next();
  32078. node.discriminant = this.parseParenExpression();
  32079. node.cases = [];
  32080. this.expect(types.braceL);
  32081. this.labels.push(switchLabel);
  32082. this.enterScope(0);
  32083. // Statements under must be grouped (by label) in SwitchCase
  32084. // nodes. `cur` is used to keep the node that we are currently
  32085. // adding statements to.
  32086. var cur;
  32087. for (var sawDefault = false; this.type !== types.braceR;) {
  32088. if (this.type === types._case || this.type === types._default) {
  32089. var isCase = this.type === types._case;
  32090. if (cur) { this.finishNode(cur, "SwitchCase"); }
  32091. node.cases.push(cur = this.startNode());
  32092. cur.consequent = [];
  32093. this.next();
  32094. if (isCase) {
  32095. cur.test = this.parseExpression();
  32096. } else {
  32097. if (sawDefault) { this.raiseRecoverable(this.lastTokStart, "Multiple default clauses"); }
  32098. sawDefault = true;
  32099. cur.test = null;
  32100. }
  32101. this.expect(types.colon);
  32102. } else {
  32103. if (!cur) { this.unexpected(); }
  32104. cur.consequent.push(this.parseStatement(null));
  32105. }
  32106. }
  32107. this.exitScope();
  32108. if (cur) { this.finishNode(cur, "SwitchCase"); }
  32109. this.next(); // Closing brace
  32110. this.labels.pop();
  32111. return this.finishNode(node, "SwitchStatement")
  32112. };
  32113. pp$1.parseThrowStatement = function(node) {
  32114. this.next();
  32115. if (lineBreak.test(this.input.slice(this.lastTokEnd, this.start)))
  32116. { this.raise(this.lastTokEnd, "Illegal newline after throw"); }
  32117. node.argument = this.parseExpression();
  32118. this.semicolon();
  32119. return this.finishNode(node, "ThrowStatement")
  32120. };
  32121. // Reused empty array added for node fields that are always empty.
  32122. var empty = [];
  32123. pp$1.parseTryStatement = function(node) {
  32124. this.next();
  32125. node.block = this.parseBlock();
  32126. node.handler = null;
  32127. if (this.type === types._catch) {
  32128. var clause = this.startNode();
  32129. this.next();
  32130. if (this.eat(types.parenL)) {
  32131. clause.param = this.parseBindingAtom();
  32132. var simple = clause.param.type === "Identifier";
  32133. this.enterScope(simple ? SCOPE_SIMPLE_CATCH : 0);
  32134. this.checkLValPattern(clause.param, simple ? BIND_SIMPLE_CATCH : BIND_LEXICAL);
  32135. this.expect(types.parenR);
  32136. } else {
  32137. if (this.options.ecmaVersion < 10) { this.unexpected(); }
  32138. clause.param = null;
  32139. this.enterScope(0);
  32140. }
  32141. clause.body = this.parseBlock(false);
  32142. this.exitScope();
  32143. node.handler = this.finishNode(clause, "CatchClause");
  32144. }
  32145. node.finalizer = this.eat(types._finally) ? this.parseBlock() : null;
  32146. if (!node.handler && !node.finalizer)
  32147. { this.raise(node.start, "Missing catch or finally clause"); }
  32148. return this.finishNode(node, "TryStatement")
  32149. };
  32150. pp$1.parseVarStatement = function(node, kind) {
  32151. this.next();
  32152. this.parseVar(node, false, kind);
  32153. this.semicolon();
  32154. return this.finishNode(node, "VariableDeclaration")
  32155. };
  32156. pp$1.parseWhileStatement = function(node) {
  32157. this.next();
  32158. node.test = this.parseParenExpression();
  32159. this.labels.push(loopLabel);
  32160. node.body = this.parseStatement("while");
  32161. this.labels.pop();
  32162. return this.finishNode(node, "WhileStatement")
  32163. };
  32164. pp$1.parseWithStatement = function(node) {
  32165. if (this.strict) { this.raise(this.start, "'with' in strict mode"); }
  32166. this.next();
  32167. node.object = this.parseParenExpression();
  32168. node.body = this.parseStatement("with");
  32169. return this.finishNode(node, "WithStatement")
  32170. };
  32171. pp$1.parseEmptyStatement = function(node) {
  32172. this.next();
  32173. return this.finishNode(node, "EmptyStatement")
  32174. };
  32175. pp$1.parseLabeledStatement = function(node, maybeName, expr, context) {
  32176. for (var i$1 = 0, list = this.labels; i$1 < list.length; i$1 += 1)
  32177. {
  32178. var label = list[i$1];
  32179. if (label.name === maybeName)
  32180. { this.raise(expr.start, "Label '" + maybeName + "' is already declared");
  32181. } }
  32182. var kind = this.type.isLoop ? "loop" : this.type === types._switch ? "switch" : null;
  32183. for (var i = this.labels.length - 1; i >= 0; i--) {
  32184. var label$1 = this.labels[i];
  32185. if (label$1.statementStart === node.start) {
  32186. // Update information about previous labels on this node
  32187. label$1.statementStart = this.start;
  32188. label$1.kind = kind;
  32189. } else { break }
  32190. }
  32191. this.labels.push({name: maybeName, kind: kind, statementStart: this.start});
  32192. node.body = this.parseStatement(context ? context.indexOf("label") === -1 ? context + "label" : context : "label");
  32193. this.labels.pop();
  32194. node.label = expr;
  32195. return this.finishNode(node, "LabeledStatement")
  32196. };
  32197. pp$1.parseExpressionStatement = function(node, expr) {
  32198. node.expression = expr;
  32199. this.semicolon();
  32200. return this.finishNode(node, "ExpressionStatement")
  32201. };
  32202. // Parse a semicolon-enclosed block of statements, handling `"use
  32203. // strict"` declarations when `allowStrict` is true (used for
  32204. // function bodies).
  32205. pp$1.parseBlock = function(createNewLexicalScope, node, exitStrict) {
  32206. if ( createNewLexicalScope === void 0 ) createNewLexicalScope = true;
  32207. if ( node === void 0 ) node = this.startNode();
  32208. node.body = [];
  32209. this.expect(types.braceL);
  32210. if (createNewLexicalScope) { this.enterScope(0); }
  32211. while (this.type !== types.braceR) {
  32212. var stmt = this.parseStatement(null);
  32213. node.body.push(stmt);
  32214. }
  32215. if (exitStrict) { this.strict = false; }
  32216. this.next();
  32217. if (createNewLexicalScope) { this.exitScope(); }
  32218. return this.finishNode(node, "BlockStatement")
  32219. };
  32220. // Parse a regular `for` loop. The disambiguation code in
  32221. // `parseStatement` will already have parsed the init statement or
  32222. // expression.
  32223. pp$1.parseFor = function(node, init) {
  32224. node.init = init;
  32225. this.expect(types.semi);
  32226. node.test = this.type === types.semi ? null : this.parseExpression();
  32227. this.expect(types.semi);
  32228. node.update = this.type === types.parenR ? null : this.parseExpression();
  32229. this.expect(types.parenR);
  32230. node.body = this.parseStatement("for");
  32231. this.exitScope();
  32232. this.labels.pop();
  32233. return this.finishNode(node, "ForStatement")
  32234. };
  32235. // Parse a `for`/`in` and `for`/`of` loop, which are almost
  32236. // same from parser's perspective.
  32237. pp$1.parseForIn = function(node, init) {
  32238. var isForIn = this.type === types._in;
  32239. this.next();
  32240. if (
  32241. init.type === "VariableDeclaration" &&
  32242. init.declarations[0].init != null &&
  32243. (
  32244. !isForIn ||
  32245. this.options.ecmaVersion < 8 ||
  32246. this.strict ||
  32247. init.kind !== "var" ||
  32248. init.declarations[0].id.type !== "Identifier"
  32249. )
  32250. ) {
  32251. this.raise(
  32252. init.start,
  32253. ((isForIn ? "for-in" : "for-of") + " loop variable declaration may not have an initializer")
  32254. );
  32255. }
  32256. node.left = init;
  32257. node.right = isForIn ? this.parseExpression() : this.parseMaybeAssign();
  32258. this.expect(types.parenR);
  32259. node.body = this.parseStatement("for");
  32260. this.exitScope();
  32261. this.labels.pop();
  32262. return this.finishNode(node, isForIn ? "ForInStatement" : "ForOfStatement")
  32263. };
  32264. // Parse a list of variable declarations.
  32265. pp$1.parseVar = function(node, isFor, kind) {
  32266. node.declarations = [];
  32267. node.kind = kind;
  32268. for (;;) {
  32269. var decl = this.startNode();
  32270. this.parseVarId(decl, kind);
  32271. if (this.eat(types.eq)) {
  32272. decl.init = this.parseMaybeAssign(isFor);
  32273. } else if (kind === "const" && !(this.type === types._in || (this.options.ecmaVersion >= 6 && this.isContextual("of")))) {
  32274. this.unexpected();
  32275. } else if (decl.id.type !== "Identifier" && !(isFor && (this.type === types._in || this.isContextual("of")))) {
  32276. this.raise(this.lastTokEnd, "Complex binding patterns require an initialization value");
  32277. } else {
  32278. decl.init = null;
  32279. }
  32280. node.declarations.push(this.finishNode(decl, "VariableDeclarator"));
  32281. if (!this.eat(types.comma)) { break }
  32282. }
  32283. return node
  32284. };
  32285. pp$1.parseVarId = function(decl, kind) {
  32286. decl.id = this.parseBindingAtom();
  32287. this.checkLValPattern(decl.id, kind === "var" ? BIND_VAR : BIND_LEXICAL, false);
  32288. };
  32289. var FUNC_STATEMENT = 1, FUNC_HANGING_STATEMENT = 2, FUNC_NULLABLE_ID = 4;
  32290. // Parse a function declaration or literal (depending on the
  32291. // `statement & FUNC_STATEMENT`).
  32292. // Remove `allowExpressionBody` for 7.0.0, as it is only called with false
  32293. pp$1.parseFunction = function(node, statement, allowExpressionBody, isAsync) {
  32294. this.initFunction(node);
  32295. if (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !isAsync) {
  32296. if (this.type === types.star && (statement & FUNC_HANGING_STATEMENT))
  32297. { this.unexpected(); }
  32298. node.generator = this.eat(types.star);
  32299. }
  32300. if (this.options.ecmaVersion >= 8)
  32301. { node.async = !!isAsync; }
  32302. if (statement & FUNC_STATEMENT) {
  32303. node.id = (statement & FUNC_NULLABLE_ID) && this.type !== types.name ? null : this.parseIdent();
  32304. if (node.id && !(statement & FUNC_HANGING_STATEMENT))
  32305. // If it is a regular function declaration in sloppy mode, then it is
  32306. // subject to Annex B semantics (BIND_FUNCTION). Otherwise, the binding
  32307. // mode depends on properties of the current scope (see
  32308. // treatFunctionsAsVar).
  32309. { this.checkLValSimple(node.id, (this.strict || node.generator || node.async) ? this.treatFunctionsAsVar ? BIND_VAR : BIND_LEXICAL : BIND_FUNCTION); }
  32310. }
  32311. var oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos;
  32312. this.yieldPos = 0;
  32313. this.awaitPos = 0;
  32314. this.awaitIdentPos = 0;
  32315. this.enterScope(functionFlags(node.async, node.generator));
  32316. if (!(statement & FUNC_STATEMENT))
  32317. { node.id = this.type === types.name ? this.parseIdent() : null; }
  32318. this.parseFunctionParams(node);
  32319. this.parseFunctionBody(node, allowExpressionBody, false);
  32320. this.yieldPos = oldYieldPos;
  32321. this.awaitPos = oldAwaitPos;
  32322. this.awaitIdentPos = oldAwaitIdentPos;
  32323. return this.finishNode(node, (statement & FUNC_STATEMENT) ? "FunctionDeclaration" : "FunctionExpression")
  32324. };
  32325. pp$1.parseFunctionParams = function(node) {
  32326. this.expect(types.parenL);
  32327. node.params = this.parseBindingList(types.parenR, false, this.options.ecmaVersion >= 8);
  32328. this.checkYieldAwaitInDefaultParams();
  32329. };
  32330. // Parse a class declaration or literal (depending on the
  32331. // `isStatement` parameter).
  32332. pp$1.parseClass = function(node, isStatement) {
  32333. this.next();
  32334. // ecma-262 14.6 Class Definitions
  32335. // A class definition is always strict mode code.
  32336. var oldStrict = this.strict;
  32337. this.strict = true;
  32338. this.parseClassId(node, isStatement);
  32339. this.parseClassSuper(node);
  32340. var classBody = this.startNode();
  32341. var hadConstructor = false;
  32342. classBody.body = [];
  32343. this.expect(types.braceL);
  32344. while (this.type !== types.braceR) {
  32345. var element = this.parseClassElement(node.superClass !== null);
  32346. if (element) {
  32347. classBody.body.push(element);
  32348. if (element.type === "MethodDefinition" && element.kind === "constructor") {
  32349. if (hadConstructor) { this.raise(element.start, "Duplicate constructor in the same class"); }
  32350. hadConstructor = true;
  32351. }
  32352. }
  32353. }
  32354. this.strict = oldStrict;
  32355. this.next();
  32356. node.body = this.finishNode(classBody, "ClassBody");
  32357. return this.finishNode(node, isStatement ? "ClassDeclaration" : "ClassExpression")
  32358. };
  32359. pp$1.parseClassElement = function(constructorAllowsSuper) {
  32360. var this$1 = this;
  32361. if (this.eat(types.semi)) { return null }
  32362. var method = this.startNode();
  32363. var tryContextual = function (k, noLineBreak) {
  32364. if ( noLineBreak === void 0 ) noLineBreak = false;
  32365. var start = this$1.start, startLoc = this$1.startLoc;
  32366. if (!this$1.eatContextual(k)) { return false }
  32367. if (this$1.type !== types.parenL && (!noLineBreak || !this$1.canInsertSemicolon())) { return true }
  32368. if (method.key) { this$1.unexpected(); }
  32369. method.computed = false;
  32370. method.key = this$1.startNodeAt(start, startLoc);
  32371. method.key.name = k;
  32372. this$1.finishNode(method.key, "Identifier");
  32373. return false
  32374. };
  32375. method.kind = "method";
  32376. method.static = tryContextual("static");
  32377. var isGenerator = this.eat(types.star);
  32378. var isAsync = false;
  32379. if (!isGenerator) {
  32380. if (this.options.ecmaVersion >= 8 && tryContextual("async", true)) {
  32381. isAsync = true;
  32382. isGenerator = this.options.ecmaVersion >= 9 && this.eat(types.star);
  32383. } else if (tryContextual("get")) {
  32384. method.kind = "get";
  32385. } else if (tryContextual("set")) {
  32386. method.kind = "set";
  32387. }
  32388. }
  32389. if (!method.key) { this.parsePropertyName(method); }
  32390. var key = method.key;
  32391. var allowsDirectSuper = false;
  32392. if (!method.computed && !method.static && (key.type === "Identifier" && key.name === "constructor" ||
  32393. key.type === "Literal" && key.value === "constructor")) {
  32394. if (method.kind !== "method") { this.raise(key.start, "Constructor can't have get/set modifier"); }
  32395. if (isGenerator) { this.raise(key.start, "Constructor can't be a generator"); }
  32396. if (isAsync) { this.raise(key.start, "Constructor can't be an async method"); }
  32397. method.kind = "constructor";
  32398. allowsDirectSuper = constructorAllowsSuper;
  32399. } else if (method.static && key.type === "Identifier" && key.name === "prototype") {
  32400. this.raise(key.start, "Classes may not have a static property named prototype");
  32401. }
  32402. this.parseClassMethod(method, isGenerator, isAsync, allowsDirectSuper);
  32403. if (method.kind === "get" && method.value.params.length !== 0)
  32404. { this.raiseRecoverable(method.value.start, "getter should have no params"); }
  32405. if (method.kind === "set" && method.value.params.length !== 1)
  32406. { this.raiseRecoverable(method.value.start, "setter should have exactly one param"); }
  32407. if (method.kind === "set" && method.value.params[0].type === "RestElement")
  32408. { this.raiseRecoverable(method.value.params[0].start, "Setter cannot use rest params"); }
  32409. return method
  32410. };
  32411. pp$1.parseClassMethod = function(method, isGenerator, isAsync, allowsDirectSuper) {
  32412. method.value = this.parseMethod(isGenerator, isAsync, allowsDirectSuper);
  32413. return this.finishNode(method, "MethodDefinition")
  32414. };
  32415. pp$1.parseClassId = function(node, isStatement) {
  32416. if (this.type === types.name) {
  32417. node.id = this.parseIdent();
  32418. if (isStatement)
  32419. { this.checkLValSimple(node.id, BIND_LEXICAL, false); }
  32420. } else {
  32421. if (isStatement === true)
  32422. { this.unexpected(); }
  32423. node.id = null;
  32424. }
  32425. };
  32426. pp$1.parseClassSuper = function(node) {
  32427. node.superClass = this.eat(types._extends) ? this.parseExprSubscripts() : null;
  32428. };
  32429. // Parses module export declaration.
  32430. pp$1.parseExport = function(node, exports) {
  32431. this.next();
  32432. // export * from '...'
  32433. if (this.eat(types.star)) {
  32434. if (this.options.ecmaVersion >= 11) {
  32435. if (this.eatContextual("as")) {
  32436. node.exported = this.parseIdent(true);
  32437. this.checkExport(exports, node.exported.name, this.lastTokStart);
  32438. } else {
  32439. node.exported = null;
  32440. }
  32441. }
  32442. this.expectContextual("from");
  32443. if (this.type !== types.string) { this.unexpected(); }
  32444. node.source = this.parseExprAtom();
  32445. this.semicolon();
  32446. return this.finishNode(node, "ExportAllDeclaration")
  32447. }
  32448. if (this.eat(types._default)) { // export default ...
  32449. this.checkExport(exports, "default", this.lastTokStart);
  32450. var isAsync;
  32451. if (this.type === types._function || (isAsync = this.isAsyncFunction())) {
  32452. var fNode = this.startNode();
  32453. this.next();
  32454. if (isAsync) { this.next(); }
  32455. node.declaration = this.parseFunction(fNode, FUNC_STATEMENT | FUNC_NULLABLE_ID, false, isAsync);
  32456. } else if (this.type === types._class) {
  32457. var cNode = this.startNode();
  32458. node.declaration = this.parseClass(cNode, "nullableID");
  32459. } else {
  32460. node.declaration = this.parseMaybeAssign();
  32461. this.semicolon();
  32462. }
  32463. return this.finishNode(node, "ExportDefaultDeclaration")
  32464. }
  32465. // export var|const|let|function|class ...
  32466. if (this.shouldParseExportStatement()) {
  32467. node.declaration = this.parseStatement(null);
  32468. if (node.declaration.type === "VariableDeclaration")
  32469. { this.checkVariableExport(exports, node.declaration.declarations); }
  32470. else
  32471. { this.checkExport(exports, node.declaration.id.name, node.declaration.id.start); }
  32472. node.specifiers = [];
  32473. node.source = null;
  32474. } else { // export { x, y as z } [from '...']
  32475. node.declaration = null;
  32476. node.specifiers = this.parseExportSpecifiers(exports);
  32477. if (this.eatContextual("from")) {
  32478. if (this.type !== types.string) { this.unexpected(); }
  32479. node.source = this.parseExprAtom();
  32480. } else {
  32481. for (var i = 0, list = node.specifiers; i < list.length; i += 1) {
  32482. // check for keywords used as local names
  32483. var spec = list[i];
  32484. this.checkUnreserved(spec.local);
  32485. // check if export is defined
  32486. this.checkLocalExport(spec.local);
  32487. }
  32488. node.source = null;
  32489. }
  32490. this.semicolon();
  32491. }
  32492. return this.finishNode(node, "ExportNamedDeclaration")
  32493. };
  32494. pp$1.checkExport = function(exports, name, pos) {
  32495. if (!exports) { return }
  32496. if (has(exports, name))
  32497. { this.raiseRecoverable(pos, "Duplicate export '" + name + "'"); }
  32498. exports[name] = true;
  32499. };
  32500. pp$1.checkPatternExport = function(exports, pat) {
  32501. var type = pat.type;
  32502. if (type === "Identifier")
  32503. { this.checkExport(exports, pat.name, pat.start); }
  32504. else if (type === "ObjectPattern")
  32505. { for (var i = 0, list = pat.properties; i < list.length; i += 1)
  32506. {
  32507. var prop = list[i];
  32508. this.checkPatternExport(exports, prop);
  32509. } }
  32510. else if (type === "ArrayPattern")
  32511. { for (var i$1 = 0, list$1 = pat.elements; i$1 < list$1.length; i$1 += 1) {
  32512. var elt = list$1[i$1];
  32513. if (elt) { this.checkPatternExport(exports, elt); }
  32514. } }
  32515. else if (type === "Property")
  32516. { this.checkPatternExport(exports, pat.value); }
  32517. else if (type === "AssignmentPattern")
  32518. { this.checkPatternExport(exports, pat.left); }
  32519. else if (type === "RestElement")
  32520. { this.checkPatternExport(exports, pat.argument); }
  32521. else if (type === "ParenthesizedExpression")
  32522. { this.checkPatternExport(exports, pat.expression); }
  32523. };
  32524. pp$1.checkVariableExport = function(exports, decls) {
  32525. if (!exports) { return }
  32526. for (var i = 0, list = decls; i < list.length; i += 1)
  32527. {
  32528. var decl = list[i];
  32529. this.checkPatternExport(exports, decl.id);
  32530. }
  32531. };
  32532. pp$1.shouldParseExportStatement = function() {
  32533. return this.type.keyword === "var" ||
  32534. this.type.keyword === "const" ||
  32535. this.type.keyword === "class" ||
  32536. this.type.keyword === "function" ||
  32537. this.isLet() ||
  32538. this.isAsyncFunction()
  32539. };
  32540. // Parses a comma-separated list of module exports.
  32541. pp$1.parseExportSpecifiers = function(exports) {
  32542. var nodes = [], first = true;
  32543. // export { x, y as z } [from '...']
  32544. this.expect(types.braceL);
  32545. while (!this.eat(types.braceR)) {
  32546. if (!first) {
  32547. this.expect(types.comma);
  32548. if (this.afterTrailingComma(types.braceR)) { break }
  32549. } else { first = false; }
  32550. var node = this.startNode();
  32551. node.local = this.parseIdent(true);
  32552. node.exported = this.eatContextual("as") ? this.parseIdent(true) : node.local;
  32553. this.checkExport(exports, node.exported.name, node.exported.start);
  32554. nodes.push(this.finishNode(node, "ExportSpecifier"));
  32555. }
  32556. return nodes
  32557. };
  32558. // Parses import declaration.
  32559. pp$1.parseImport = function(node) {
  32560. this.next();
  32561. // import '...'
  32562. if (this.type === types.string) {
  32563. node.specifiers = empty;
  32564. node.source = this.parseExprAtom();
  32565. } else {
  32566. node.specifiers = this.parseImportSpecifiers();
  32567. this.expectContextual("from");
  32568. node.source = this.type === types.string ? this.parseExprAtom() : this.unexpected();
  32569. }
  32570. this.semicolon();
  32571. return this.finishNode(node, "ImportDeclaration")
  32572. };
  32573. // Parses a comma-separated list of module imports.
  32574. pp$1.parseImportSpecifiers = function() {
  32575. var nodes = [], first = true;
  32576. if (this.type === types.name) {
  32577. // import defaultObj, { x, y as z } from '...'
  32578. var node = this.startNode();
  32579. node.local = this.parseIdent();
  32580. this.checkLValSimple(node.local, BIND_LEXICAL);
  32581. nodes.push(this.finishNode(node, "ImportDefaultSpecifier"));
  32582. if (!this.eat(types.comma)) { return nodes }
  32583. }
  32584. if (this.type === types.star) {
  32585. var node$1 = this.startNode();
  32586. this.next();
  32587. this.expectContextual("as");
  32588. node$1.local = this.parseIdent();
  32589. this.checkLValSimple(node$1.local, BIND_LEXICAL);
  32590. nodes.push(this.finishNode(node$1, "ImportNamespaceSpecifier"));
  32591. return nodes
  32592. }
  32593. this.expect(types.braceL);
  32594. while (!this.eat(types.braceR)) {
  32595. if (!first) {
  32596. this.expect(types.comma);
  32597. if (this.afterTrailingComma(types.braceR)) { break }
  32598. } else { first = false; }
  32599. var node$2 = this.startNode();
  32600. node$2.imported = this.parseIdent(true);
  32601. if (this.eatContextual("as")) {
  32602. node$2.local = this.parseIdent();
  32603. } else {
  32604. this.checkUnreserved(node$2.imported);
  32605. node$2.local = node$2.imported;
  32606. }
  32607. this.checkLValSimple(node$2.local, BIND_LEXICAL);
  32608. nodes.push(this.finishNode(node$2, "ImportSpecifier"));
  32609. }
  32610. return nodes
  32611. };
  32612. // Set `ExpressionStatement#directive` property for directive prologues.
  32613. pp$1.adaptDirectivePrologue = function(statements) {
  32614. for (var i = 0; i < statements.length && this.isDirectiveCandidate(statements[i]); ++i) {
  32615. statements[i].directive = statements[i].expression.raw.slice(1, -1);
  32616. }
  32617. };
  32618. pp$1.isDirectiveCandidate = function(statement) {
  32619. return (
  32620. statement.type === "ExpressionStatement" &&
  32621. statement.expression.type === "Literal" &&
  32622. typeof statement.expression.value === "string" &&
  32623. // Reject parenthesized strings.
  32624. (this.input[statement.start] === "\"" || this.input[statement.start] === "'")
  32625. )
  32626. };
  32627. var pp$2 = Parser.prototype;
  32628. // Convert existing expression atom to assignable pattern
  32629. // if possible.
  32630. pp$2.toAssignable = function(node, isBinding, refDestructuringErrors) {
  32631. if (this.options.ecmaVersion >= 6 && node) {
  32632. switch (node.type) {
  32633. case "Identifier":
  32634. if (this.inAsync && node.name === "await")
  32635. { this.raise(node.start, "Cannot use 'await' as identifier inside an async function"); }
  32636. break
  32637. case "ObjectPattern":
  32638. case "ArrayPattern":
  32639. case "AssignmentPattern":
  32640. case "RestElement":
  32641. break
  32642. case "ObjectExpression":
  32643. node.type = "ObjectPattern";
  32644. if (refDestructuringErrors) { this.checkPatternErrors(refDestructuringErrors, true); }
  32645. for (var i = 0, list = node.properties; i < list.length; i += 1) {
  32646. var prop = list[i];
  32647. this.toAssignable(prop, isBinding);
  32648. // Early error:
  32649. // AssignmentRestProperty[Yield, Await] :
  32650. // `...` DestructuringAssignmentTarget[Yield, Await]
  32651. //
  32652. // It is a Syntax Error if |DestructuringAssignmentTarget| is an |ArrayLiteral| or an |ObjectLiteral|.
  32653. if (
  32654. prop.type === "RestElement" &&
  32655. (prop.argument.type === "ArrayPattern" || prop.argument.type === "ObjectPattern")
  32656. ) {
  32657. this.raise(prop.argument.start, "Unexpected token");
  32658. }
  32659. }
  32660. break
  32661. case "Property":
  32662. // AssignmentProperty has type === "Property"
  32663. if (node.kind !== "init") { this.raise(node.key.start, "Object pattern can't contain getter or setter"); }
  32664. this.toAssignable(node.value, isBinding);
  32665. break
  32666. case "ArrayExpression":
  32667. node.type = "ArrayPattern";
  32668. if (refDestructuringErrors) { this.checkPatternErrors(refDestructuringErrors, true); }
  32669. this.toAssignableList(node.elements, isBinding);
  32670. break
  32671. case "SpreadElement":
  32672. node.type = "RestElement";
  32673. this.toAssignable(node.argument, isBinding);
  32674. if (node.argument.type === "AssignmentPattern")
  32675. { this.raise(node.argument.start, "Rest elements cannot have a default value"); }
  32676. break
  32677. case "AssignmentExpression":
  32678. if (node.operator !== "=") { this.raise(node.left.end, "Only '=' operator can be used for specifying default value."); }
  32679. node.type = "AssignmentPattern";
  32680. delete node.operator;
  32681. this.toAssignable(node.left, isBinding);
  32682. break
  32683. case "ParenthesizedExpression":
  32684. this.toAssignable(node.expression, isBinding, refDestructuringErrors);
  32685. break
  32686. case "ChainExpression":
  32687. this.raiseRecoverable(node.start, "Optional chaining cannot appear in left-hand side");
  32688. break
  32689. case "MemberExpression":
  32690. if (!isBinding) { break }
  32691. default:
  32692. this.raise(node.start, "Assigning to rvalue");
  32693. }
  32694. } else if (refDestructuringErrors) { this.checkPatternErrors(refDestructuringErrors, true); }
  32695. return node
  32696. };
  32697. // Convert list of expression atoms to binding list.
  32698. pp$2.toAssignableList = function(exprList, isBinding) {
  32699. var end = exprList.length;
  32700. for (var i = 0; i < end; i++) {
  32701. var elt = exprList[i];
  32702. if (elt) { this.toAssignable(elt, isBinding); }
  32703. }
  32704. if (end) {
  32705. var last = exprList[end - 1];
  32706. if (this.options.ecmaVersion === 6 && isBinding && last && last.type === "RestElement" && last.argument.type !== "Identifier")
  32707. { this.unexpected(last.argument.start); }
  32708. }
  32709. return exprList
  32710. };
  32711. // Parses spread element.
  32712. pp$2.parseSpread = function(refDestructuringErrors) {
  32713. var node = this.startNode();
  32714. this.next();
  32715. node.argument = this.parseMaybeAssign(false, refDestructuringErrors);
  32716. return this.finishNode(node, "SpreadElement")
  32717. };
  32718. pp$2.parseRestBinding = function() {
  32719. var node = this.startNode();
  32720. this.next();
  32721. // RestElement inside of a function parameter must be an identifier
  32722. if (this.options.ecmaVersion === 6 && this.type !== types.name)
  32723. { this.unexpected(); }
  32724. node.argument = this.parseBindingAtom();
  32725. return this.finishNode(node, "RestElement")
  32726. };
  32727. // Parses lvalue (assignable) atom.
  32728. pp$2.parseBindingAtom = function() {
  32729. if (this.options.ecmaVersion >= 6) {
  32730. switch (this.type) {
  32731. case types.bracketL:
  32732. var node = this.startNode();
  32733. this.next();
  32734. node.elements = this.parseBindingList(types.bracketR, true, true);
  32735. return this.finishNode(node, "ArrayPattern")
  32736. case types.braceL:
  32737. return this.parseObj(true)
  32738. }
  32739. }
  32740. return this.parseIdent()
  32741. };
  32742. pp$2.parseBindingList = function(close, allowEmpty, allowTrailingComma) {
  32743. var elts = [], first = true;
  32744. while (!this.eat(close)) {
  32745. if (first) { first = false; }
  32746. else { this.expect(types.comma); }
  32747. if (allowEmpty && this.type === types.comma) {
  32748. elts.push(null);
  32749. } else if (allowTrailingComma && this.afterTrailingComma(close)) {
  32750. break
  32751. } else if (this.type === types.ellipsis) {
  32752. var rest = this.parseRestBinding();
  32753. this.parseBindingListItem(rest);
  32754. elts.push(rest);
  32755. if (this.type === types.comma) { this.raise(this.start, "Comma is not permitted after the rest element"); }
  32756. this.expect(close);
  32757. break
  32758. } else {
  32759. var elem = this.parseMaybeDefault(this.start, this.startLoc);
  32760. this.parseBindingListItem(elem);
  32761. elts.push(elem);
  32762. }
  32763. }
  32764. return elts
  32765. };
  32766. pp$2.parseBindingListItem = function(param) {
  32767. return param
  32768. };
  32769. // Parses assignment pattern around given atom if possible.
  32770. pp$2.parseMaybeDefault = function(startPos, startLoc, left) {
  32771. left = left || this.parseBindingAtom();
  32772. if (this.options.ecmaVersion < 6 || !this.eat(types.eq)) { return left }
  32773. var node = this.startNodeAt(startPos, startLoc);
  32774. node.left = left;
  32775. node.right = this.parseMaybeAssign();
  32776. return this.finishNode(node, "AssignmentPattern")
  32777. };
  32778. // The following three functions all verify that a node is an lvalue —
  32779. // something that can be bound, or assigned to. In order to do so, they perform
  32780. // a variety of checks:
  32781. //
  32782. // - Check that none of the bound/assigned-to identifiers are reserved words.
  32783. // - Record name declarations for bindings in the appropriate scope.
  32784. // - Check duplicate argument names, if checkClashes is set.
  32785. //
  32786. // If a complex binding pattern is encountered (e.g., object and array
  32787. // destructuring), the entire pattern is recursively checked.
  32788. //
  32789. // There are three versions of checkLVal*() appropriate for different
  32790. // circumstances:
  32791. //
  32792. // - checkLValSimple() shall be used if the syntactic construct supports
  32793. // nothing other than identifiers and member expressions. Parenthesized
  32794. // expressions are also correctly handled. This is generally appropriate for
  32795. // constructs for which the spec says
  32796. //
  32797. // > It is a Syntax Error if AssignmentTargetType of [the production] is not
  32798. // > simple.
  32799. //
  32800. // It is also appropriate for checking if an identifier is valid and not
  32801. // defined elsewhere, like import declarations or function/class identifiers.
  32802. //
  32803. // Examples where this is used include:
  32804. // a += …;
  32805. // import a from '…';
  32806. // where a is the node to be checked.
  32807. //
  32808. // - checkLValPattern() shall be used if the syntactic construct supports
  32809. // anything checkLValSimple() supports, as well as object and array
  32810. // destructuring patterns. This is generally appropriate for constructs for
  32811. // which the spec says
  32812. //
  32813. // > It is a Syntax Error if [the production] is neither an ObjectLiteral nor
  32814. // > an ArrayLiteral and AssignmentTargetType of [the production] is not
  32815. // > simple.
  32816. //
  32817. // Examples where this is used include:
  32818. // (a = …);
  32819. // const a = …;
  32820. // try { … } catch (a) { … }
  32821. // where a is the node to be checked.
  32822. //
  32823. // - checkLValInnerPattern() shall be used if the syntactic construct supports
  32824. // anything checkLValPattern() supports, as well as default assignment
  32825. // patterns, rest elements, and other constructs that may appear within an
  32826. // object or array destructuring pattern.
  32827. //
  32828. // As a special case, function parameters also use checkLValInnerPattern(),
  32829. // as they also support defaults and rest constructs.
  32830. //
  32831. // These functions deliberately support both assignment and binding constructs,
  32832. // as the logic for both is exceedingly similar. If the node is the target of
  32833. // an assignment, then bindingType should be set to BIND_NONE. Otherwise, it
  32834. // should be set to the appropriate BIND_* constant, like BIND_VAR or
  32835. // BIND_LEXICAL.
  32836. //
  32837. // If the function is called with a non-BIND_NONE bindingType, then
  32838. // additionally a checkClashes object may be specified to allow checking for
  32839. // duplicate argument names. checkClashes is ignored if the provided construct
  32840. // is an assignment (i.e., bindingType is BIND_NONE).
  32841. pp$2.checkLValSimple = function(expr, bindingType, checkClashes) {
  32842. if ( bindingType === void 0 ) bindingType = BIND_NONE;
  32843. var isBind = bindingType !== BIND_NONE;
  32844. switch (expr.type) {
  32845. case "Identifier":
  32846. if (this.strict && this.reservedWordsStrictBind.test(expr.name))
  32847. { this.raiseRecoverable(expr.start, (isBind ? "Binding " : "Assigning to ") + expr.name + " in strict mode"); }
  32848. if (isBind) {
  32849. if (bindingType === BIND_LEXICAL && expr.name === "let")
  32850. { this.raiseRecoverable(expr.start, "let is disallowed as a lexically bound name"); }
  32851. if (checkClashes) {
  32852. if (has(checkClashes, expr.name))
  32853. { this.raiseRecoverable(expr.start, "Argument name clash"); }
  32854. checkClashes[expr.name] = true;
  32855. }
  32856. if (bindingType !== BIND_OUTSIDE) { this.declareName(expr.name, bindingType, expr.start); }
  32857. }
  32858. break
  32859. case "ChainExpression":
  32860. this.raiseRecoverable(expr.start, "Optional chaining cannot appear in left-hand side");
  32861. break
  32862. case "MemberExpression":
  32863. if (isBind) { this.raiseRecoverable(expr.start, "Binding member expression"); }
  32864. break
  32865. case "ParenthesizedExpression":
  32866. if (isBind) { this.raiseRecoverable(expr.start, "Binding parenthesized expression"); }
  32867. return this.checkLValSimple(expr.expression, bindingType, checkClashes)
  32868. default:
  32869. this.raise(expr.start, (isBind ? "Binding" : "Assigning to") + " rvalue");
  32870. }
  32871. };
  32872. pp$2.checkLValPattern = function(expr, bindingType, checkClashes) {
  32873. if ( bindingType === void 0 ) bindingType = BIND_NONE;
  32874. switch (expr.type) {
  32875. case "ObjectPattern":
  32876. for (var i = 0, list = expr.properties; i < list.length; i += 1) {
  32877. var prop = list[i];
  32878. this.checkLValInnerPattern(prop, bindingType, checkClashes);
  32879. }
  32880. break
  32881. case "ArrayPattern":
  32882. for (var i$1 = 0, list$1 = expr.elements; i$1 < list$1.length; i$1 += 1) {
  32883. var elem = list$1[i$1];
  32884. if (elem) { this.checkLValInnerPattern(elem, bindingType, checkClashes); }
  32885. }
  32886. break
  32887. default:
  32888. this.checkLValSimple(expr, bindingType, checkClashes);
  32889. }
  32890. };
  32891. pp$2.checkLValInnerPattern = function(expr, bindingType, checkClashes) {
  32892. if ( bindingType === void 0 ) bindingType = BIND_NONE;
  32893. switch (expr.type) {
  32894. case "Property":
  32895. // AssignmentProperty has type === "Property"
  32896. this.checkLValInnerPattern(expr.value, bindingType, checkClashes);
  32897. break
  32898. case "AssignmentPattern":
  32899. this.checkLValPattern(expr.left, bindingType, checkClashes);
  32900. break
  32901. case "RestElement":
  32902. this.checkLValPattern(expr.argument, bindingType, checkClashes);
  32903. break
  32904. default:
  32905. this.checkLValPattern(expr, bindingType, checkClashes);
  32906. }
  32907. };
  32908. // A recursive descent parser operates by defining functions for all
  32909. var pp$3 = Parser.prototype;
  32910. // Check if property name clashes with already added.
  32911. // Object/class getters and setters are not allowed to clash —
  32912. // either with each other or with an init property — and in
  32913. // strict mode, init properties are also not allowed to be repeated.
  32914. pp$3.checkPropClash = function(prop, propHash, refDestructuringErrors) {
  32915. if (this.options.ecmaVersion >= 9 && prop.type === "SpreadElement")
  32916. { return }
  32917. if (this.options.ecmaVersion >= 6 && (prop.computed || prop.method || prop.shorthand))
  32918. { return }
  32919. var key = prop.key;
  32920. var name;
  32921. switch (key.type) {
  32922. case "Identifier": name = key.name; break
  32923. case "Literal": name = String(key.value); break
  32924. default: return
  32925. }
  32926. var kind = prop.kind;
  32927. if (this.options.ecmaVersion >= 6) {
  32928. if (name === "__proto__" && kind === "init") {
  32929. if (propHash.proto) {
  32930. if (refDestructuringErrors) {
  32931. if (refDestructuringErrors.doubleProto < 0)
  32932. { refDestructuringErrors.doubleProto = key.start; }
  32933. // Backwards-compat kludge. Can be removed in version 6.0
  32934. } else { this.raiseRecoverable(key.start, "Redefinition of __proto__ property"); }
  32935. }
  32936. propHash.proto = true;
  32937. }
  32938. return
  32939. }
  32940. name = "$" + name;
  32941. var other = propHash[name];
  32942. if (other) {
  32943. var redefinition;
  32944. if (kind === "init") {
  32945. redefinition = this.strict && other.init || other.get || other.set;
  32946. } else {
  32947. redefinition = other.init || other[kind];
  32948. }
  32949. if (redefinition)
  32950. { this.raiseRecoverable(key.start, "Redefinition of property"); }
  32951. } else {
  32952. other = propHash[name] = {
  32953. init: false,
  32954. get: false,
  32955. set: false
  32956. };
  32957. }
  32958. other[kind] = true;
  32959. };
  32960. // ### Expression parsing
  32961. // These nest, from the most general expression type at the top to
  32962. // 'atomic', nondivisible expression types at the bottom. Most of
  32963. // the functions will simply let the function(s) below them parse,
  32964. // and, *if* the syntactic construct they handle is present, wrap
  32965. // the AST node that the inner parser gave them in another node.
  32966. // Parse a full expression. The optional arguments are used to
  32967. // forbid the `in` operator (in for loops initalization expressions)
  32968. // and provide reference for storing '=' operator inside shorthand
  32969. // property assignment in contexts where both object expression
  32970. // and object pattern might appear (so it's possible to raise
  32971. // delayed syntax error at correct position).
  32972. pp$3.parseExpression = function(noIn, refDestructuringErrors) {
  32973. var startPos = this.start, startLoc = this.startLoc;
  32974. var expr = this.parseMaybeAssign(noIn, refDestructuringErrors);
  32975. if (this.type === types.comma) {
  32976. var node = this.startNodeAt(startPos, startLoc);
  32977. node.expressions = [expr];
  32978. while (this.eat(types.comma)) { node.expressions.push(this.parseMaybeAssign(noIn, refDestructuringErrors)); }
  32979. return this.finishNode(node, "SequenceExpression")
  32980. }
  32981. return expr
  32982. };
  32983. // Parse an assignment expression. This includes applications of
  32984. // operators like `+=`.
  32985. pp$3.parseMaybeAssign = function(noIn, refDestructuringErrors, afterLeftParse) {
  32986. if (this.isContextual("yield")) {
  32987. if (this.inGenerator) { return this.parseYield(noIn) }
  32988. // The tokenizer will assume an expression is allowed after
  32989. // `yield`, but this isn't that kind of yield
  32990. else { this.exprAllowed = false; }
  32991. }
  32992. var ownDestructuringErrors = false, oldParenAssign = -1, oldTrailingComma = -1;
  32993. if (refDestructuringErrors) {
  32994. oldParenAssign = refDestructuringErrors.parenthesizedAssign;
  32995. oldTrailingComma = refDestructuringErrors.trailingComma;
  32996. refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = -1;
  32997. } else {
  32998. refDestructuringErrors = new DestructuringErrors;
  32999. ownDestructuringErrors = true;
  33000. }
  33001. var startPos = this.start, startLoc = this.startLoc;
  33002. if (this.type === types.parenL || this.type === types.name)
  33003. { this.potentialArrowAt = this.start; }
  33004. var left = this.parseMaybeConditional(noIn, refDestructuringErrors);
  33005. if (afterLeftParse) { left = afterLeftParse.call(this, left, startPos, startLoc); }
  33006. if (this.type.isAssign) {
  33007. var node = this.startNodeAt(startPos, startLoc);
  33008. node.operator = this.value;
  33009. if (this.type === types.eq)
  33010. { left = this.toAssignable(left, false, refDestructuringErrors); }
  33011. if (!ownDestructuringErrors) {
  33012. refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = refDestructuringErrors.doubleProto = -1;
  33013. }
  33014. if (refDestructuringErrors.shorthandAssign >= left.start)
  33015. { refDestructuringErrors.shorthandAssign = -1; } // reset because shorthand default was used correctly
  33016. if (this.type === types.eq)
  33017. { this.checkLValPattern(left); }
  33018. else
  33019. { this.checkLValSimple(left); }
  33020. node.left = left;
  33021. this.next();
  33022. node.right = this.parseMaybeAssign(noIn);
  33023. return this.finishNode(node, "AssignmentExpression")
  33024. } else {
  33025. if (ownDestructuringErrors) { this.checkExpressionErrors(refDestructuringErrors, true); }
  33026. }
  33027. if (oldParenAssign > -1) { refDestructuringErrors.parenthesizedAssign = oldParenAssign; }
  33028. if (oldTrailingComma > -1) { refDestructuringErrors.trailingComma = oldTrailingComma; }
  33029. return left
  33030. };
  33031. // Parse a ternary conditional (`?:`) operator.
  33032. pp$3.parseMaybeConditional = function(noIn, refDestructuringErrors) {
  33033. var startPos = this.start, startLoc = this.startLoc;
  33034. var expr = this.parseExprOps(noIn, refDestructuringErrors);
  33035. if (this.checkExpressionErrors(refDestructuringErrors)) { return expr }
  33036. if (this.eat(types.question)) {
  33037. var node = this.startNodeAt(startPos, startLoc);
  33038. node.test = expr;
  33039. node.consequent = this.parseMaybeAssign();
  33040. this.expect(types.colon);
  33041. node.alternate = this.parseMaybeAssign(noIn);
  33042. return this.finishNode(node, "ConditionalExpression")
  33043. }
  33044. return expr
  33045. };
  33046. // Start the precedence parser.
  33047. pp$3.parseExprOps = function(noIn, refDestructuringErrors) {
  33048. var startPos = this.start, startLoc = this.startLoc;
  33049. var expr = this.parseMaybeUnary(refDestructuringErrors, false);
  33050. if (this.checkExpressionErrors(refDestructuringErrors)) { return expr }
  33051. return expr.start === startPos && expr.type === "ArrowFunctionExpression" ? expr : this.parseExprOp(expr, startPos, startLoc, -1, noIn)
  33052. };
  33053. // Parse binary operators with the operator precedence parsing
  33054. // algorithm. `left` is the left-hand side of the operator.
  33055. // `minPrec` provides context that allows the function to stop and
  33056. // defer further parser to one of its callers when it encounters an
  33057. // operator that has a lower precedence than the set it is parsing.
  33058. pp$3.parseExprOp = function(left, leftStartPos, leftStartLoc, minPrec, noIn) {
  33059. var prec = this.type.binop;
  33060. if (prec != null && (!noIn || this.type !== types._in)) {
  33061. if (prec > minPrec) {
  33062. var logical = this.type === types.logicalOR || this.type === types.logicalAND;
  33063. var coalesce = this.type === types.coalesce;
  33064. if (coalesce) {
  33065. // Handle the precedence of `tt.coalesce` as equal to the range of logical expressions.
  33066. // In other words, `node.right` shouldn't contain logical expressions in order to check the mixed error.
  33067. prec = types.logicalAND.binop;
  33068. }
  33069. var op = this.value;
  33070. this.next();
  33071. var startPos = this.start, startLoc = this.startLoc;
  33072. var right = this.parseExprOp(this.parseMaybeUnary(null, false), startPos, startLoc, prec, noIn);
  33073. var node = this.buildBinary(leftStartPos, leftStartLoc, left, right, op, logical || coalesce);
  33074. if ((logical && this.type === types.coalesce) || (coalesce && (this.type === types.logicalOR || this.type === types.logicalAND))) {
  33075. this.raiseRecoverable(this.start, "Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses");
  33076. }
  33077. return this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec, noIn)
  33078. }
  33079. }
  33080. return left
  33081. };
  33082. pp$3.buildBinary = function(startPos, startLoc, left, right, op, logical) {
  33083. var node = this.startNodeAt(startPos, startLoc);
  33084. node.left = left;
  33085. node.operator = op;
  33086. node.right = right;
  33087. return this.finishNode(node, logical ? "LogicalExpression" : "BinaryExpression")
  33088. };
  33089. // Parse unary operators, both prefix and postfix.
  33090. pp$3.parseMaybeUnary = function(refDestructuringErrors, sawUnary) {
  33091. var startPos = this.start, startLoc = this.startLoc, expr;
  33092. if (this.isContextual("await") && (this.inAsync || (!this.inFunction && this.options.allowAwaitOutsideFunction))) {
  33093. expr = this.parseAwait();
  33094. sawUnary = true;
  33095. } else if (this.type.prefix) {
  33096. var node = this.startNode(), update = this.type === types.incDec;
  33097. node.operator = this.value;
  33098. node.prefix = true;
  33099. this.next();
  33100. node.argument = this.parseMaybeUnary(null, true);
  33101. this.checkExpressionErrors(refDestructuringErrors, true);
  33102. if (update) { this.checkLValSimple(node.argument); }
  33103. else if (this.strict && node.operator === "delete" &&
  33104. node.argument.type === "Identifier")
  33105. { this.raiseRecoverable(node.start, "Deleting local variable in strict mode"); }
  33106. else { sawUnary = true; }
  33107. expr = this.finishNode(node, update ? "UpdateExpression" : "UnaryExpression");
  33108. } else {
  33109. expr = this.parseExprSubscripts(refDestructuringErrors);
  33110. if (this.checkExpressionErrors(refDestructuringErrors)) { return expr }
  33111. while (this.type.postfix && !this.canInsertSemicolon()) {
  33112. var node$1 = this.startNodeAt(startPos, startLoc);
  33113. node$1.operator = this.value;
  33114. node$1.prefix = false;
  33115. node$1.argument = expr;
  33116. this.checkLValSimple(expr);
  33117. this.next();
  33118. expr = this.finishNode(node$1, "UpdateExpression");
  33119. }
  33120. }
  33121. if (!sawUnary && this.eat(types.starstar))
  33122. { return this.buildBinary(startPos, startLoc, expr, this.parseMaybeUnary(null, false), "**", false) }
  33123. else
  33124. { return expr }
  33125. };
  33126. // Parse call, dot, and `[]`-subscript expressions.
  33127. pp$3.parseExprSubscripts = function(refDestructuringErrors) {
  33128. var startPos = this.start, startLoc = this.startLoc;
  33129. var expr = this.parseExprAtom(refDestructuringErrors);
  33130. if (expr.type === "ArrowFunctionExpression" && this.input.slice(this.lastTokStart, this.lastTokEnd) !== ")")
  33131. { return expr }
  33132. var result = this.parseSubscripts(expr, startPos, startLoc);
  33133. if (refDestructuringErrors && result.type === "MemberExpression") {
  33134. if (refDestructuringErrors.parenthesizedAssign >= result.start) { refDestructuringErrors.parenthesizedAssign = -1; }
  33135. if (refDestructuringErrors.parenthesizedBind >= result.start) { refDestructuringErrors.parenthesizedBind = -1; }
  33136. }
  33137. return result
  33138. };
  33139. pp$3.parseSubscripts = function(base, startPos, startLoc, noCalls) {
  33140. var maybeAsyncArrow = this.options.ecmaVersion >= 8 && base.type === "Identifier" && base.name === "async" &&
  33141. this.lastTokEnd === base.end && !this.canInsertSemicolon() && base.end - base.start === 5 &&
  33142. this.potentialArrowAt === base.start;
  33143. var optionalChained = false;
  33144. while (true) {
  33145. var element = this.parseSubscript(base, startPos, startLoc, noCalls, maybeAsyncArrow, optionalChained);
  33146. if (element.optional) { optionalChained = true; }
  33147. if (element === base || element.type === "ArrowFunctionExpression") {
  33148. if (optionalChained) {
  33149. var chainNode = this.startNodeAt(startPos, startLoc);
  33150. chainNode.expression = element;
  33151. element = this.finishNode(chainNode, "ChainExpression");
  33152. }
  33153. return element
  33154. }
  33155. base = element;
  33156. }
  33157. };
  33158. pp$3.parseSubscript = function(base, startPos, startLoc, noCalls, maybeAsyncArrow, optionalChained) {
  33159. var optionalSupported = this.options.ecmaVersion >= 11;
  33160. var optional = optionalSupported && this.eat(types.questionDot);
  33161. if (noCalls && optional) { this.raise(this.lastTokStart, "Optional chaining cannot appear in the callee of new expressions"); }
  33162. var computed = this.eat(types.bracketL);
  33163. if (computed || (optional && this.type !== types.parenL && this.type !== types.backQuote) || this.eat(types.dot)) {
  33164. var node = this.startNodeAt(startPos, startLoc);
  33165. node.object = base;
  33166. node.property = computed ? this.parseExpression() : this.parseIdent(this.options.allowReserved !== "never");
  33167. node.computed = !!computed;
  33168. if (computed) { this.expect(types.bracketR); }
  33169. if (optionalSupported) {
  33170. node.optional = optional;
  33171. }
  33172. base = this.finishNode(node, "MemberExpression");
  33173. } else if (!noCalls && this.eat(types.parenL)) {
  33174. var refDestructuringErrors = new DestructuringErrors, oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos;
  33175. this.yieldPos = 0;
  33176. this.awaitPos = 0;
  33177. this.awaitIdentPos = 0;
  33178. var exprList = this.parseExprList(types.parenR, this.options.ecmaVersion >= 8, false, refDestructuringErrors);
  33179. if (maybeAsyncArrow && !optional && !this.canInsertSemicolon() && this.eat(types.arrow)) {
  33180. this.checkPatternErrors(refDestructuringErrors, false);
  33181. this.checkYieldAwaitInDefaultParams();
  33182. if (this.awaitIdentPos > 0)
  33183. { this.raise(this.awaitIdentPos, "Cannot use 'await' as identifier inside an async function"); }
  33184. this.yieldPos = oldYieldPos;
  33185. this.awaitPos = oldAwaitPos;
  33186. this.awaitIdentPos = oldAwaitIdentPos;
  33187. return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList, true)
  33188. }
  33189. this.checkExpressionErrors(refDestructuringErrors, true);
  33190. this.yieldPos = oldYieldPos || this.yieldPos;
  33191. this.awaitPos = oldAwaitPos || this.awaitPos;
  33192. this.awaitIdentPos = oldAwaitIdentPos || this.awaitIdentPos;
  33193. var node$1 = this.startNodeAt(startPos, startLoc);
  33194. node$1.callee = base;
  33195. node$1.arguments = exprList;
  33196. if (optionalSupported) {
  33197. node$1.optional = optional;
  33198. }
  33199. base = this.finishNode(node$1, "CallExpression");
  33200. } else if (this.type === types.backQuote) {
  33201. if (optional || optionalChained) {
  33202. this.raise(this.start, "Optional chaining cannot appear in the tag of tagged template expressions");
  33203. }
  33204. var node$2 = this.startNodeAt(startPos, startLoc);
  33205. node$2.tag = base;
  33206. node$2.quasi = this.parseTemplate({isTagged: true});
  33207. base = this.finishNode(node$2, "TaggedTemplateExpression");
  33208. }
  33209. return base
  33210. };
  33211. // Parse an atomic expression — either a single token that is an
  33212. // expression, an expression started by a keyword like `function` or
  33213. // `new`, or an expression wrapped in punctuation like `()`, `[]`,
  33214. // or `{}`.
  33215. pp$3.parseExprAtom = function(refDestructuringErrors) {
  33216. // If a division operator appears in an expression position, the
  33217. // tokenizer got confused, and we force it to read a regexp instead.
  33218. if (this.type === types.slash) { this.readRegexp(); }
  33219. var node, canBeArrow = this.potentialArrowAt === this.start;
  33220. switch (this.type) {
  33221. case types._super:
  33222. if (!this.allowSuper)
  33223. { this.raise(this.start, "'super' keyword outside a method"); }
  33224. node = this.startNode();
  33225. this.next();
  33226. if (this.type === types.parenL && !this.allowDirectSuper)
  33227. { this.raise(node.start, "super() call outside constructor of a subclass"); }
  33228. // The `super` keyword can appear at below:
  33229. // SuperProperty:
  33230. // super [ Expression ]
  33231. // super . IdentifierName
  33232. // SuperCall:
  33233. // super ( Arguments )
  33234. if (this.type !== types.dot && this.type !== types.bracketL && this.type !== types.parenL)
  33235. { this.unexpected(); }
  33236. return this.finishNode(node, "Super")
  33237. case types._this:
  33238. node = this.startNode();
  33239. this.next();
  33240. return this.finishNode(node, "ThisExpression")
  33241. case types.name:
  33242. var startPos = this.start, startLoc = this.startLoc, containsEsc = this.containsEsc;
  33243. var id = this.parseIdent(false);
  33244. if (this.options.ecmaVersion >= 8 && !containsEsc && id.name === "async" && !this.canInsertSemicolon() && this.eat(types._function))
  33245. { return this.parseFunction(this.startNodeAt(startPos, startLoc), 0, false, true) }
  33246. if (canBeArrow && !this.canInsertSemicolon()) {
  33247. if (this.eat(types.arrow))
  33248. { return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], false) }
  33249. if (this.options.ecmaVersion >= 8 && id.name === "async" && this.type === types.name && !containsEsc) {
  33250. id = this.parseIdent(false);
  33251. if (this.canInsertSemicolon() || !this.eat(types.arrow))
  33252. { this.unexpected(); }
  33253. return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], true)
  33254. }
  33255. }
  33256. return id
  33257. case types.regexp:
  33258. var value = this.value;
  33259. node = this.parseLiteral(value.value);
  33260. node.regex = {pattern: value.pattern, flags: value.flags};
  33261. return node
  33262. case types.num: case types.string:
  33263. return this.parseLiteral(this.value)
  33264. case types._null: case types._true: case types._false:
  33265. node = this.startNode();
  33266. node.value = this.type === types._null ? null : this.type === types._true;
  33267. node.raw = this.type.keyword;
  33268. this.next();
  33269. return this.finishNode(node, "Literal")
  33270. case types.parenL:
  33271. var start = this.start, expr = this.parseParenAndDistinguishExpression(canBeArrow);
  33272. if (refDestructuringErrors) {
  33273. if (refDestructuringErrors.parenthesizedAssign < 0 && !this.isSimpleAssignTarget(expr))
  33274. { refDestructuringErrors.parenthesizedAssign = start; }
  33275. if (refDestructuringErrors.parenthesizedBind < 0)
  33276. { refDestructuringErrors.parenthesizedBind = start; }
  33277. }
  33278. return expr
  33279. case types.bracketL:
  33280. node = this.startNode();
  33281. this.next();
  33282. node.elements = this.parseExprList(types.bracketR, true, true, refDestructuringErrors);
  33283. return this.finishNode(node, "ArrayExpression")
  33284. case types.braceL:
  33285. return this.parseObj(false, refDestructuringErrors)
  33286. case types._function:
  33287. node = this.startNode();
  33288. this.next();
  33289. return this.parseFunction(node, 0)
  33290. case types._class:
  33291. return this.parseClass(this.startNode(), false)
  33292. case types._new:
  33293. return this.parseNew()
  33294. case types.backQuote:
  33295. return this.parseTemplate()
  33296. case types._import:
  33297. if (this.options.ecmaVersion >= 11) {
  33298. return this.parseExprImport()
  33299. } else {
  33300. return this.unexpected()
  33301. }
  33302. default:
  33303. this.unexpected();
  33304. }
  33305. };
  33306. pp$3.parseExprImport = function() {
  33307. var node = this.startNode();
  33308. // Consume `import` as an identifier for `import.meta`.
  33309. // Because `this.parseIdent(true)` doesn't check escape sequences, it needs the check of `this.containsEsc`.
  33310. if (this.containsEsc) { this.raiseRecoverable(this.start, "Escape sequence in keyword import"); }
  33311. var meta = this.parseIdent(true);
  33312. switch (this.type) {
  33313. case types.parenL:
  33314. return this.parseDynamicImport(node)
  33315. case types.dot:
  33316. node.meta = meta;
  33317. return this.parseImportMeta(node)
  33318. default:
  33319. this.unexpected();
  33320. }
  33321. };
  33322. pp$3.parseDynamicImport = function(node) {
  33323. this.next(); // skip `(`
  33324. // Parse node.source.
  33325. node.source = this.parseMaybeAssign();
  33326. // Verify ending.
  33327. if (!this.eat(types.parenR)) {
  33328. var errorPos = this.start;
  33329. if (this.eat(types.comma) && this.eat(types.parenR)) {
  33330. this.raiseRecoverable(errorPos, "Trailing comma is not allowed in import()");
  33331. } else {
  33332. this.unexpected(errorPos);
  33333. }
  33334. }
  33335. return this.finishNode(node, "ImportExpression")
  33336. };
  33337. pp$3.parseImportMeta = function(node) {
  33338. this.next(); // skip `.`
  33339. var containsEsc = this.containsEsc;
  33340. node.property = this.parseIdent(true);
  33341. if (node.property.name !== "meta")
  33342. { this.raiseRecoverable(node.property.start, "The only valid meta property for import is 'import.meta'"); }
  33343. if (containsEsc)
  33344. { this.raiseRecoverable(node.start, "'import.meta' must not contain escaped characters"); }
  33345. if (this.options.sourceType !== "module")
  33346. { this.raiseRecoverable(node.start, "Cannot use 'import.meta' outside a module"); }
  33347. return this.finishNode(node, "MetaProperty")
  33348. };
  33349. pp$3.parseLiteral = function(value) {
  33350. var node = this.startNode();
  33351. node.value = value;
  33352. node.raw = this.input.slice(this.start, this.end);
  33353. if (node.raw.charCodeAt(node.raw.length - 1) === 110) { node.bigint = node.raw.slice(0, -1).replace(/_/g, ""); }
  33354. this.next();
  33355. return this.finishNode(node, "Literal")
  33356. };
  33357. pp$3.parseParenExpression = function() {
  33358. this.expect(types.parenL);
  33359. var val = this.parseExpression();
  33360. this.expect(types.parenR);
  33361. return val
  33362. };
  33363. pp$3.parseParenAndDistinguishExpression = function(canBeArrow) {
  33364. var startPos = this.start, startLoc = this.startLoc, val, allowTrailingComma = this.options.ecmaVersion >= 8;
  33365. if (this.options.ecmaVersion >= 6) {
  33366. this.next();
  33367. var innerStartPos = this.start, innerStartLoc = this.startLoc;
  33368. var exprList = [], first = true, lastIsComma = false;
  33369. var refDestructuringErrors = new DestructuringErrors, oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, spreadStart;
  33370. this.yieldPos = 0;
  33371. this.awaitPos = 0;
  33372. // Do not save awaitIdentPos to allow checking awaits nested in parameters
  33373. while (this.type !== types.parenR) {
  33374. first ? first = false : this.expect(types.comma);
  33375. if (allowTrailingComma && this.afterTrailingComma(types.parenR, true)) {
  33376. lastIsComma = true;
  33377. break
  33378. } else if (this.type === types.ellipsis) {
  33379. spreadStart = this.start;
  33380. exprList.push(this.parseParenItem(this.parseRestBinding()));
  33381. if (this.type === types.comma) { this.raise(this.start, "Comma is not permitted after the rest element"); }
  33382. break
  33383. } else {
  33384. exprList.push(this.parseMaybeAssign(false, refDestructuringErrors, this.parseParenItem));
  33385. }
  33386. }
  33387. var innerEndPos = this.start, innerEndLoc = this.startLoc;
  33388. this.expect(types.parenR);
  33389. if (canBeArrow && !this.canInsertSemicolon() && this.eat(types.arrow)) {
  33390. this.checkPatternErrors(refDestructuringErrors, false);
  33391. this.checkYieldAwaitInDefaultParams();
  33392. this.yieldPos = oldYieldPos;
  33393. this.awaitPos = oldAwaitPos;
  33394. return this.parseParenArrowList(startPos, startLoc, exprList)
  33395. }
  33396. if (!exprList.length || lastIsComma) { this.unexpected(this.lastTokStart); }
  33397. if (spreadStart) { this.unexpected(spreadStart); }
  33398. this.checkExpressionErrors(refDestructuringErrors, true);
  33399. this.yieldPos = oldYieldPos || this.yieldPos;
  33400. this.awaitPos = oldAwaitPos || this.awaitPos;
  33401. if (exprList.length > 1) {
  33402. val = this.startNodeAt(innerStartPos, innerStartLoc);
  33403. val.expressions = exprList;
  33404. this.finishNodeAt(val, "SequenceExpression", innerEndPos, innerEndLoc);
  33405. } else {
  33406. val = exprList[0];
  33407. }
  33408. } else {
  33409. val = this.parseParenExpression();
  33410. }
  33411. if (this.options.preserveParens) {
  33412. var par = this.startNodeAt(startPos, startLoc);
  33413. par.expression = val;
  33414. return this.finishNode(par, "ParenthesizedExpression")
  33415. } else {
  33416. return val
  33417. }
  33418. };
  33419. pp$3.parseParenItem = function(item) {
  33420. return item
  33421. };
  33422. pp$3.parseParenArrowList = function(startPos, startLoc, exprList) {
  33423. return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList)
  33424. };
  33425. // New's precedence is slightly tricky. It must allow its argument to
  33426. // be a `[]` or dot subscript expression, but not a call — at least,
  33427. // not without wrapping it in parentheses. Thus, it uses the noCalls
  33428. // argument to parseSubscripts to prevent it from consuming the
  33429. // argument list.
  33430. var empty$1 = [];
  33431. pp$3.parseNew = function() {
  33432. if (this.containsEsc) { this.raiseRecoverable(this.start, "Escape sequence in keyword new"); }
  33433. var node = this.startNode();
  33434. var meta = this.parseIdent(true);
  33435. if (this.options.ecmaVersion >= 6 && this.eat(types.dot)) {
  33436. node.meta = meta;
  33437. var containsEsc = this.containsEsc;
  33438. node.property = this.parseIdent(true);
  33439. if (node.property.name !== "target")
  33440. { this.raiseRecoverable(node.property.start, "The only valid meta property for new is 'new.target'"); }
  33441. if (containsEsc)
  33442. { this.raiseRecoverable(node.start, "'new.target' must not contain escaped characters"); }
  33443. if (!this.inNonArrowFunction)
  33444. { this.raiseRecoverable(node.start, "'new.target' can only be used in functions"); }
  33445. return this.finishNode(node, "MetaProperty")
  33446. }
  33447. var startPos = this.start, startLoc = this.startLoc, isImport = this.type === types._import;
  33448. node.callee = this.parseSubscripts(this.parseExprAtom(), startPos, startLoc, true);
  33449. if (isImport && node.callee.type === "ImportExpression") {
  33450. this.raise(startPos, "Cannot use new with import()");
  33451. }
  33452. if (this.eat(types.parenL)) { node.arguments = this.parseExprList(types.parenR, this.options.ecmaVersion >= 8, false); }
  33453. else { node.arguments = empty$1; }
  33454. return this.finishNode(node, "NewExpression")
  33455. };
  33456. // Parse template expression.
  33457. pp$3.parseTemplateElement = function(ref) {
  33458. var isTagged = ref.isTagged;
  33459. var elem = this.startNode();
  33460. if (this.type === types.invalidTemplate) {
  33461. if (!isTagged) {
  33462. this.raiseRecoverable(this.start, "Bad escape sequence in untagged template literal");
  33463. }
  33464. elem.value = {
  33465. raw: this.value,
  33466. cooked: null
  33467. };
  33468. } else {
  33469. elem.value = {
  33470. raw: this.input.slice(this.start, this.end).replace(/\r\n?/g, "\n"),
  33471. cooked: this.value
  33472. };
  33473. }
  33474. this.next();
  33475. elem.tail = this.type === types.backQuote;
  33476. return this.finishNode(elem, "TemplateElement")
  33477. };
  33478. pp$3.parseTemplate = function(ref) {
  33479. if ( ref === void 0 ) ref = {};
  33480. var isTagged = ref.isTagged; if ( isTagged === void 0 ) isTagged = false;
  33481. var node = this.startNode();
  33482. this.next();
  33483. node.expressions = [];
  33484. var curElt = this.parseTemplateElement({isTagged: isTagged});
  33485. node.quasis = [curElt];
  33486. while (!curElt.tail) {
  33487. if (this.type === types.eof) { this.raise(this.pos, "Unterminated template literal"); }
  33488. this.expect(types.dollarBraceL);
  33489. node.expressions.push(this.parseExpression());
  33490. this.expect(types.braceR);
  33491. node.quasis.push(curElt = this.parseTemplateElement({isTagged: isTagged}));
  33492. }
  33493. this.next();
  33494. return this.finishNode(node, "TemplateLiteral")
  33495. };
  33496. pp$3.isAsyncProp = function(prop) {
  33497. return !prop.computed && prop.key.type === "Identifier" && prop.key.name === "async" &&
  33498. (this.type === types.name || this.type === types.num || this.type === types.string || this.type === types.bracketL || this.type.keyword || (this.options.ecmaVersion >= 9 && this.type === types.star)) &&
  33499. !lineBreak.test(this.input.slice(this.lastTokEnd, this.start))
  33500. };
  33501. // Parse an object literal or binding pattern.
  33502. pp$3.parseObj = function(isPattern, refDestructuringErrors) {
  33503. var node = this.startNode(), first = true, propHash = {};
  33504. node.properties = [];
  33505. this.next();
  33506. while (!this.eat(types.braceR)) {
  33507. if (!first) {
  33508. this.expect(types.comma);
  33509. if (this.options.ecmaVersion >= 5 && this.afterTrailingComma(types.braceR)) { break }
  33510. } else { first = false; }
  33511. var prop = this.parseProperty(isPattern, refDestructuringErrors);
  33512. if (!isPattern) { this.checkPropClash(prop, propHash, refDestructuringErrors); }
  33513. node.properties.push(prop);
  33514. }
  33515. return this.finishNode(node, isPattern ? "ObjectPattern" : "ObjectExpression")
  33516. };
  33517. pp$3.parseProperty = function(isPattern, refDestructuringErrors) {
  33518. var prop = this.startNode(), isGenerator, isAsync, startPos, startLoc;
  33519. if (this.options.ecmaVersion >= 9 && this.eat(types.ellipsis)) {
  33520. if (isPattern) {
  33521. prop.argument = this.parseIdent(false);
  33522. if (this.type === types.comma) {
  33523. this.raise(this.start, "Comma is not permitted after the rest element");
  33524. }
  33525. return this.finishNode(prop, "RestElement")
  33526. }
  33527. // To disallow parenthesized identifier via `this.toAssignable()`.
  33528. if (this.type === types.parenL && refDestructuringErrors) {
  33529. if (refDestructuringErrors.parenthesizedAssign < 0) {
  33530. refDestructuringErrors.parenthesizedAssign = this.start;
  33531. }
  33532. if (refDestructuringErrors.parenthesizedBind < 0) {
  33533. refDestructuringErrors.parenthesizedBind = this.start;
  33534. }
  33535. }
  33536. // Parse argument.
  33537. prop.argument = this.parseMaybeAssign(false, refDestructuringErrors);
  33538. // To disallow trailing comma via `this.toAssignable()`.
  33539. if (this.type === types.comma && refDestructuringErrors && refDestructuringErrors.trailingComma < 0) {
  33540. refDestructuringErrors.trailingComma = this.start;
  33541. }
  33542. // Finish
  33543. return this.finishNode(prop, "SpreadElement")
  33544. }
  33545. if (this.options.ecmaVersion >= 6) {
  33546. prop.method = false;
  33547. prop.shorthand = false;
  33548. if (isPattern || refDestructuringErrors) {
  33549. startPos = this.start;
  33550. startLoc = this.startLoc;
  33551. }
  33552. if (!isPattern)
  33553. { isGenerator = this.eat(types.star); }
  33554. }
  33555. var containsEsc = this.containsEsc;
  33556. this.parsePropertyName(prop);
  33557. if (!isPattern && !containsEsc && this.options.ecmaVersion >= 8 && !isGenerator && this.isAsyncProp(prop)) {
  33558. isAsync = true;
  33559. isGenerator = this.options.ecmaVersion >= 9 && this.eat(types.star);
  33560. this.parsePropertyName(prop, refDestructuringErrors);
  33561. } else {
  33562. isAsync = false;
  33563. }
  33564. this.parsePropertyValue(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc);
  33565. return this.finishNode(prop, "Property")
  33566. };
  33567. pp$3.parsePropertyValue = function(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc) {
  33568. if ((isGenerator || isAsync) && this.type === types.colon)
  33569. { this.unexpected(); }
  33570. if (this.eat(types.colon)) {
  33571. prop.value = isPattern ? this.parseMaybeDefault(this.start, this.startLoc) : this.parseMaybeAssign(false, refDestructuringErrors);
  33572. prop.kind = "init";
  33573. } else if (this.options.ecmaVersion >= 6 && this.type === types.parenL) {
  33574. if (isPattern) { this.unexpected(); }
  33575. prop.kind = "init";
  33576. prop.method = true;
  33577. prop.value = this.parseMethod(isGenerator, isAsync);
  33578. } else if (!isPattern && !containsEsc &&
  33579. this.options.ecmaVersion >= 5 && !prop.computed && prop.key.type === "Identifier" &&
  33580. (prop.key.name === "get" || prop.key.name === "set") &&
  33581. (this.type !== types.comma && this.type !== types.braceR && this.type !== types.eq)) {
  33582. if (isGenerator || isAsync) { this.unexpected(); }
  33583. prop.kind = prop.key.name;
  33584. this.parsePropertyName(prop);
  33585. prop.value = this.parseMethod(false);
  33586. var paramCount = prop.kind === "get" ? 0 : 1;
  33587. if (prop.value.params.length !== paramCount) {
  33588. var start = prop.value.start;
  33589. if (prop.kind === "get")
  33590. { this.raiseRecoverable(start, "getter should have no params"); }
  33591. else
  33592. { this.raiseRecoverable(start, "setter should have exactly one param"); }
  33593. } else {
  33594. if (prop.kind === "set" && prop.value.params[0].type === "RestElement")
  33595. { this.raiseRecoverable(prop.value.params[0].start, "Setter cannot use rest params"); }
  33596. }
  33597. } else if (this.options.ecmaVersion >= 6 && !prop.computed && prop.key.type === "Identifier") {
  33598. if (isGenerator || isAsync) { this.unexpected(); }
  33599. this.checkUnreserved(prop.key);
  33600. if (prop.key.name === "await" && !this.awaitIdentPos)
  33601. { this.awaitIdentPos = startPos; }
  33602. prop.kind = "init";
  33603. if (isPattern) {
  33604. prop.value = this.parseMaybeDefault(startPos, startLoc, this.copyNode(prop.key));
  33605. } else if (this.type === types.eq && refDestructuringErrors) {
  33606. if (refDestructuringErrors.shorthandAssign < 0)
  33607. { refDestructuringErrors.shorthandAssign = this.start; }
  33608. prop.value = this.parseMaybeDefault(startPos, startLoc, this.copyNode(prop.key));
  33609. } else {
  33610. prop.value = this.copyNode(prop.key);
  33611. }
  33612. prop.shorthand = true;
  33613. } else { this.unexpected(); }
  33614. };
  33615. pp$3.parsePropertyName = function(prop) {
  33616. if (this.options.ecmaVersion >= 6) {
  33617. if (this.eat(types.bracketL)) {
  33618. prop.computed = true;
  33619. prop.key = this.parseMaybeAssign();
  33620. this.expect(types.bracketR);
  33621. return prop.key
  33622. } else {
  33623. prop.computed = false;
  33624. }
  33625. }
  33626. return prop.key = this.type === types.num || this.type === types.string ? this.parseExprAtom() : this.parseIdent(this.options.allowReserved !== "never")
  33627. };
  33628. // Initialize empty function node.
  33629. pp$3.initFunction = function(node) {
  33630. node.id = null;
  33631. if (this.options.ecmaVersion >= 6) { node.generator = node.expression = false; }
  33632. if (this.options.ecmaVersion >= 8) { node.async = false; }
  33633. };
  33634. // Parse object or class method.
  33635. pp$3.parseMethod = function(isGenerator, isAsync, allowDirectSuper) {
  33636. var node = this.startNode(), oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos;
  33637. this.initFunction(node);
  33638. if (this.options.ecmaVersion >= 6)
  33639. { node.generator = isGenerator; }
  33640. if (this.options.ecmaVersion >= 8)
  33641. { node.async = !!isAsync; }
  33642. this.yieldPos = 0;
  33643. this.awaitPos = 0;
  33644. this.awaitIdentPos = 0;
  33645. this.enterScope(functionFlags(isAsync, node.generator) | SCOPE_SUPER | (allowDirectSuper ? SCOPE_DIRECT_SUPER : 0));
  33646. this.expect(types.parenL);
  33647. node.params = this.parseBindingList(types.parenR, false, this.options.ecmaVersion >= 8);
  33648. this.checkYieldAwaitInDefaultParams();
  33649. this.parseFunctionBody(node, false, true);
  33650. this.yieldPos = oldYieldPos;
  33651. this.awaitPos = oldAwaitPos;
  33652. this.awaitIdentPos = oldAwaitIdentPos;
  33653. return this.finishNode(node, "FunctionExpression")
  33654. };
  33655. // Parse arrow function expression with given parameters.
  33656. pp$3.parseArrowExpression = function(node, params, isAsync) {
  33657. var oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos;
  33658. this.enterScope(functionFlags(isAsync, false) | SCOPE_ARROW);
  33659. this.initFunction(node);
  33660. if (this.options.ecmaVersion >= 8) { node.async = !!isAsync; }
  33661. this.yieldPos = 0;
  33662. this.awaitPos = 0;
  33663. this.awaitIdentPos = 0;
  33664. node.params = this.toAssignableList(params, true);
  33665. this.parseFunctionBody(node, true, false);
  33666. this.yieldPos = oldYieldPos;
  33667. this.awaitPos = oldAwaitPos;
  33668. this.awaitIdentPos = oldAwaitIdentPos;
  33669. return this.finishNode(node, "ArrowFunctionExpression")
  33670. };
  33671. // Parse function body and check parameters.
  33672. pp$3.parseFunctionBody = function(node, isArrowFunction, isMethod) {
  33673. var isExpression = isArrowFunction && this.type !== types.braceL;
  33674. var oldStrict = this.strict, useStrict = false;
  33675. if (isExpression) {
  33676. node.body = this.parseMaybeAssign();
  33677. node.expression = true;
  33678. this.checkParams(node, false);
  33679. } else {
  33680. var nonSimple = this.options.ecmaVersion >= 7 && !this.isSimpleParamList(node.params);
  33681. if (!oldStrict || nonSimple) {
  33682. useStrict = this.strictDirective(this.end);
  33683. // If this is a strict mode function, verify that argument names
  33684. // are not repeated, and it does not try to bind the words `eval`
  33685. // or `arguments`.
  33686. if (useStrict && nonSimple)
  33687. { this.raiseRecoverable(node.start, "Illegal 'use strict' directive in function with non-simple parameter list"); }
  33688. }
  33689. // Start a new scope with regard to labels and the `inFunction`
  33690. // flag (restore them to their old value afterwards).
  33691. var oldLabels = this.labels;
  33692. this.labels = [];
  33693. if (useStrict) { this.strict = true; }
  33694. // Add the params to varDeclaredNames to ensure that an error is thrown
  33695. // if a let/const declaration in the function clashes with one of the params.
  33696. this.checkParams(node, !oldStrict && !useStrict && !isArrowFunction && !isMethod && this.isSimpleParamList(node.params));
  33697. // Ensure the function name isn't a forbidden identifier in strict mode, e.g. 'eval'
  33698. if (this.strict && node.id) { this.checkLValSimple(node.id, BIND_OUTSIDE); }
  33699. node.body = this.parseBlock(false, undefined, useStrict && !oldStrict);
  33700. node.expression = false;
  33701. this.adaptDirectivePrologue(node.body.body);
  33702. this.labels = oldLabels;
  33703. }
  33704. this.exitScope();
  33705. };
  33706. pp$3.isSimpleParamList = function(params) {
  33707. for (var i = 0, list = params; i < list.length; i += 1)
  33708. {
  33709. var param = list[i];
  33710. if (param.type !== "Identifier") { return false
  33711. } }
  33712. return true
  33713. };
  33714. // Checks function params for various disallowed patterns such as using "eval"
  33715. // or "arguments" and duplicate parameters.
  33716. pp$3.checkParams = function(node, allowDuplicates) {
  33717. var nameHash = Object.create(null);
  33718. for (var i = 0, list = node.params; i < list.length; i += 1)
  33719. {
  33720. var param = list[i];
  33721. this.checkLValInnerPattern(param, BIND_VAR, allowDuplicates ? null : nameHash);
  33722. }
  33723. };
  33724. // Parses a comma-separated list of expressions, and returns them as
  33725. // an array. `close` is the token type that ends the list, and
  33726. // `allowEmpty` can be turned on to allow subsequent commas with
  33727. // nothing in between them to be parsed as `null` (which is needed
  33728. // for array literals).
  33729. pp$3.parseExprList = function(close, allowTrailingComma, allowEmpty, refDestructuringErrors) {
  33730. var elts = [], first = true;
  33731. while (!this.eat(close)) {
  33732. if (!first) {
  33733. this.expect(types.comma);
  33734. if (allowTrailingComma && this.afterTrailingComma(close)) { break }
  33735. } else { first = false; }
  33736. var elt = (void 0);
  33737. if (allowEmpty && this.type === types.comma)
  33738. { elt = null; }
  33739. else if (this.type === types.ellipsis) {
  33740. elt = this.parseSpread(refDestructuringErrors);
  33741. if (refDestructuringErrors && this.type === types.comma && refDestructuringErrors.trailingComma < 0)
  33742. { refDestructuringErrors.trailingComma = this.start; }
  33743. } else {
  33744. elt = this.parseMaybeAssign(false, refDestructuringErrors);
  33745. }
  33746. elts.push(elt);
  33747. }
  33748. return elts
  33749. };
  33750. pp$3.checkUnreserved = function(ref) {
  33751. var start = ref.start;
  33752. var end = ref.end;
  33753. var name = ref.name;
  33754. if (this.inGenerator && name === "yield")
  33755. { this.raiseRecoverable(start, "Cannot use 'yield' as identifier inside a generator"); }
  33756. if (this.inAsync && name === "await")
  33757. { this.raiseRecoverable(start, "Cannot use 'await' as identifier inside an async function"); }
  33758. if (this.keywords.test(name))
  33759. { this.raise(start, ("Unexpected keyword '" + name + "'")); }
  33760. if (this.options.ecmaVersion < 6 &&
  33761. this.input.slice(start, end).indexOf("\\") !== -1) { return }
  33762. var re = this.strict ? this.reservedWordsStrict : this.reservedWords;
  33763. if (re.test(name)) {
  33764. if (!this.inAsync && name === "await")
  33765. { this.raiseRecoverable(start, "Cannot use keyword 'await' outside an async function"); }
  33766. this.raiseRecoverable(start, ("The keyword '" + name + "' is reserved"));
  33767. }
  33768. };
  33769. // Parse the next token as an identifier. If `liberal` is true (used
  33770. // when parsing properties), it will also convert keywords into
  33771. // identifiers.
  33772. pp$3.parseIdent = function(liberal, isBinding) {
  33773. var node = this.startNode();
  33774. if (this.type === types.name) {
  33775. node.name = this.value;
  33776. } else if (this.type.keyword) {
  33777. node.name = this.type.keyword;
  33778. // To fix https://github.com/acornjs/acorn/issues/575
  33779. // `class` and `function` keywords push new context into this.context.
  33780. // But there is no chance to pop the context if the keyword is consumed as an identifier such as a property name.
  33781. // If the previous token is a dot, this does not apply because the context-managing code already ignored the keyword
  33782. if ((node.name === "class" || node.name === "function") &&
  33783. (this.lastTokEnd !== this.lastTokStart + 1 || this.input.charCodeAt(this.lastTokStart) !== 46)) {
  33784. this.context.pop();
  33785. }
  33786. } else {
  33787. this.unexpected();
  33788. }
  33789. this.next(!!liberal);
  33790. this.finishNode(node, "Identifier");
  33791. if (!liberal) {
  33792. this.checkUnreserved(node);
  33793. if (node.name === "await" && !this.awaitIdentPos)
  33794. { this.awaitIdentPos = node.start; }
  33795. }
  33796. return node
  33797. };
  33798. // Parses yield expression inside generator.
  33799. pp$3.parseYield = function(noIn) {
  33800. if (!this.yieldPos) { this.yieldPos = this.start; }
  33801. var node = this.startNode();
  33802. this.next();
  33803. if (this.type === types.semi || this.canInsertSemicolon() || (this.type !== types.star && !this.type.startsExpr)) {
  33804. node.delegate = false;
  33805. node.argument = null;
  33806. } else {
  33807. node.delegate = this.eat(types.star);
  33808. node.argument = this.parseMaybeAssign(noIn);
  33809. }
  33810. return this.finishNode(node, "YieldExpression")
  33811. };
  33812. pp$3.parseAwait = function() {
  33813. if (!this.awaitPos) { this.awaitPos = this.start; }
  33814. var node = this.startNode();
  33815. this.next();
  33816. node.argument = this.parseMaybeUnary(null, true);
  33817. return this.finishNode(node, "AwaitExpression")
  33818. };
  33819. var pp$4 = Parser.prototype;
  33820. // This function is used to raise exceptions on parse errors. It
  33821. // takes an offset integer (into the current `input`) to indicate
  33822. // the location of the error, attaches the position to the end
  33823. // of the error message, and then raises a `SyntaxError` with that
  33824. // message.
  33825. pp$4.raise = function(pos, message) {
  33826. var loc = getLineInfo(this.input, pos);
  33827. message += " (" + loc.line + ":" + loc.column + ")";
  33828. var err = new SyntaxError(message);
  33829. err.pos = pos; err.loc = loc; err.raisedAt = this.pos;
  33830. throw err
  33831. };
  33832. pp$4.raiseRecoverable = pp$4.raise;
  33833. pp$4.curPosition = function() {
  33834. if (this.options.locations) {
  33835. return new Position(this.curLine, this.pos - this.lineStart)
  33836. }
  33837. };
  33838. var pp$5 = Parser.prototype;
  33839. var Scope$2 = function Scope(flags) {
  33840. this.flags = flags;
  33841. // A list of var-declared names in the current lexical scope
  33842. this.var = [];
  33843. // A list of lexically-declared names in the current lexical scope
  33844. this.lexical = [];
  33845. // A list of lexically-declared FunctionDeclaration names in the current lexical scope
  33846. this.functions = [];
  33847. };
  33848. // The functions in this module keep track of declared variables in the current scope in order to detect duplicate variable names.
  33849. pp$5.enterScope = function(flags) {
  33850. this.scopeStack.push(new Scope$2(flags));
  33851. };
  33852. pp$5.exitScope = function() {
  33853. this.scopeStack.pop();
  33854. };
  33855. // The spec says:
  33856. // > At the top level of a function, or script, function declarations are
  33857. // > treated like var declarations rather than like lexical declarations.
  33858. pp$5.treatFunctionsAsVarInScope = function(scope) {
  33859. return (scope.flags & SCOPE_FUNCTION) || !this.inModule && (scope.flags & SCOPE_TOP)
  33860. };
  33861. pp$5.declareName = function(name, bindingType, pos) {
  33862. var redeclared = false;
  33863. if (bindingType === BIND_LEXICAL) {
  33864. var scope = this.currentScope();
  33865. redeclared = scope.lexical.indexOf(name) > -1 || scope.functions.indexOf(name) > -1 || scope.var.indexOf(name) > -1;
  33866. scope.lexical.push(name);
  33867. if (this.inModule && (scope.flags & SCOPE_TOP))
  33868. { delete this.undefinedExports[name]; }
  33869. } else if (bindingType === BIND_SIMPLE_CATCH) {
  33870. var scope$1 = this.currentScope();
  33871. scope$1.lexical.push(name);
  33872. } else if (bindingType === BIND_FUNCTION) {
  33873. var scope$2 = this.currentScope();
  33874. if (this.treatFunctionsAsVar)
  33875. { redeclared = scope$2.lexical.indexOf(name) > -1; }
  33876. else
  33877. { redeclared = scope$2.lexical.indexOf(name) > -1 || scope$2.var.indexOf(name) > -1; }
  33878. scope$2.functions.push(name);
  33879. } else {
  33880. for (var i = this.scopeStack.length - 1; i >= 0; --i) {
  33881. var scope$3 = this.scopeStack[i];
  33882. if (scope$3.lexical.indexOf(name) > -1 && !((scope$3.flags & SCOPE_SIMPLE_CATCH) && scope$3.lexical[0] === name) ||
  33883. !this.treatFunctionsAsVarInScope(scope$3) && scope$3.functions.indexOf(name) > -1) {
  33884. redeclared = true;
  33885. break
  33886. }
  33887. scope$3.var.push(name);
  33888. if (this.inModule && (scope$3.flags & SCOPE_TOP))
  33889. { delete this.undefinedExports[name]; }
  33890. if (scope$3.flags & SCOPE_VAR) { break }
  33891. }
  33892. }
  33893. if (redeclared) { this.raiseRecoverable(pos, ("Identifier '" + name + "' has already been declared")); }
  33894. };
  33895. pp$5.checkLocalExport = function(id) {
  33896. // scope.functions must be empty as Module code is always strict.
  33897. if (this.scopeStack[0].lexical.indexOf(id.name) === -1 &&
  33898. this.scopeStack[0].var.indexOf(id.name) === -1) {
  33899. this.undefinedExports[id.name] = id;
  33900. }
  33901. };
  33902. pp$5.currentScope = function() {
  33903. return this.scopeStack[this.scopeStack.length - 1]
  33904. };
  33905. pp$5.currentVarScope = function() {
  33906. for (var i = this.scopeStack.length - 1;; i--) {
  33907. var scope = this.scopeStack[i];
  33908. if (scope.flags & SCOPE_VAR) { return scope }
  33909. }
  33910. };
  33911. // Could be useful for `this`, `new.target`, `super()`, `super.property`, and `super[property]`.
  33912. pp$5.currentThisScope = function() {
  33913. for (var i = this.scopeStack.length - 1;; i--) {
  33914. var scope = this.scopeStack[i];
  33915. if (scope.flags & SCOPE_VAR && !(scope.flags & SCOPE_ARROW)) { return scope }
  33916. }
  33917. };
  33918. var Node = function Node(parser, pos, loc) {
  33919. this.type = "";
  33920. this.start = pos;
  33921. this.end = 0;
  33922. if (parser.options.locations)
  33923. { this.loc = new SourceLocation(parser, loc); }
  33924. if (parser.options.directSourceFile)
  33925. { this.sourceFile = parser.options.directSourceFile; }
  33926. if (parser.options.ranges)
  33927. { this.range = [pos, 0]; }
  33928. };
  33929. // Start an AST node, attaching a start offset.
  33930. var pp$6 = Parser.prototype;
  33931. pp$6.startNode = function() {
  33932. return new Node(this, this.start, this.startLoc)
  33933. };
  33934. pp$6.startNodeAt = function(pos, loc) {
  33935. return new Node(this, pos, loc)
  33936. };
  33937. // Finish an AST node, adding `type` and `end` properties.
  33938. function finishNodeAt(node, type, pos, loc) {
  33939. node.type = type;
  33940. node.end = pos;
  33941. if (this.options.locations)
  33942. { node.loc.end = loc; }
  33943. if (this.options.ranges)
  33944. { node.range[1] = pos; }
  33945. return node
  33946. }
  33947. pp$6.finishNode = function(node, type) {
  33948. return finishNodeAt.call(this, node, type, this.lastTokEnd, this.lastTokEndLoc)
  33949. };
  33950. // Finish node at given position
  33951. pp$6.finishNodeAt = function(node, type, pos, loc) {
  33952. return finishNodeAt.call(this, node, type, pos, loc)
  33953. };
  33954. pp$6.copyNode = function(node) {
  33955. var newNode = new Node(this, node.start, this.startLoc);
  33956. for (var prop in node) { newNode[prop] = node[prop]; }
  33957. return newNode
  33958. };
  33959. // The algorithm used to determine whether a regexp can appear at a
  33960. var TokContext = function TokContext(token, isExpr, preserveSpace, override, generator) {
  33961. this.token = token;
  33962. this.isExpr = !!isExpr;
  33963. this.preserveSpace = !!preserveSpace;
  33964. this.override = override;
  33965. this.generator = !!generator;
  33966. };
  33967. var types$1 = {
  33968. b_stat: new TokContext("{", false),
  33969. b_expr: new TokContext("{", true),
  33970. b_tmpl: new TokContext("${", false),
  33971. p_stat: new TokContext("(", false),
  33972. p_expr: new TokContext("(", true),
  33973. q_tmpl: new TokContext("`", true, true, function (p) { return p.tryReadTemplateToken(); }),
  33974. f_stat: new TokContext("function", false),
  33975. f_expr: new TokContext("function", true),
  33976. f_expr_gen: new TokContext("function", true, false, null, true),
  33977. f_gen: new TokContext("function", false, false, null, true)
  33978. };
  33979. var pp$7 = Parser.prototype;
  33980. pp$7.initialContext = function() {
  33981. return [types$1.b_stat]
  33982. };
  33983. pp$7.braceIsBlock = function(prevType) {
  33984. var parent = this.curContext();
  33985. if (parent === types$1.f_expr || parent === types$1.f_stat)
  33986. { return true }
  33987. if (prevType === types.colon && (parent === types$1.b_stat || parent === types$1.b_expr))
  33988. { return !parent.isExpr }
  33989. // The check for `tt.name && exprAllowed` detects whether we are
  33990. // after a `yield` or `of` construct. See the `updateContext` for
  33991. // `tt.name`.
  33992. if (prevType === types._return || prevType === types.name && this.exprAllowed)
  33993. { return lineBreak.test(this.input.slice(this.lastTokEnd, this.start)) }
  33994. if (prevType === types._else || prevType === types.semi || prevType === types.eof || prevType === types.parenR || prevType === types.arrow)
  33995. { return true }
  33996. if (prevType === types.braceL)
  33997. { return parent === types$1.b_stat }
  33998. if (prevType === types._var || prevType === types._const || prevType === types.name)
  33999. { return false }
  34000. return !this.exprAllowed
  34001. };
  34002. pp$7.inGeneratorContext = function() {
  34003. for (var i = this.context.length - 1; i >= 1; i--) {
  34004. var context = this.context[i];
  34005. if (context.token === "function")
  34006. { return context.generator }
  34007. }
  34008. return false
  34009. };
  34010. pp$7.updateContext = function(prevType) {
  34011. var update, type = this.type;
  34012. if (type.keyword && prevType === types.dot)
  34013. { this.exprAllowed = false; }
  34014. else if (update = type.updateContext)
  34015. { update.call(this, prevType); }
  34016. else
  34017. { this.exprAllowed = type.beforeExpr; }
  34018. };
  34019. // Token-specific context update code
  34020. types.parenR.updateContext = types.braceR.updateContext = function() {
  34021. if (this.context.length === 1) {
  34022. this.exprAllowed = true;
  34023. return
  34024. }
  34025. var out = this.context.pop();
  34026. if (out === types$1.b_stat && this.curContext().token === "function") {
  34027. out = this.context.pop();
  34028. }
  34029. this.exprAllowed = !out.isExpr;
  34030. };
  34031. types.braceL.updateContext = function(prevType) {
  34032. this.context.push(this.braceIsBlock(prevType) ? types$1.b_stat : types$1.b_expr);
  34033. this.exprAllowed = true;
  34034. };
  34035. types.dollarBraceL.updateContext = function() {
  34036. this.context.push(types$1.b_tmpl);
  34037. this.exprAllowed = true;
  34038. };
  34039. types.parenL.updateContext = function(prevType) {
  34040. var statementParens = prevType === types._if || prevType === types._for || prevType === types._with || prevType === types._while;
  34041. this.context.push(statementParens ? types$1.p_stat : types$1.p_expr);
  34042. this.exprAllowed = true;
  34043. };
  34044. types.incDec.updateContext = function() {
  34045. // tokExprAllowed stays unchanged
  34046. };
  34047. types._function.updateContext = types._class.updateContext = function(prevType) {
  34048. if (prevType.beforeExpr && prevType !== types._else &&
  34049. !(prevType === types.semi && this.curContext() !== types$1.p_stat) &&
  34050. !(prevType === types._return && lineBreak.test(this.input.slice(this.lastTokEnd, this.start))) &&
  34051. !((prevType === types.colon || prevType === types.braceL) && this.curContext() === types$1.b_stat))
  34052. { this.context.push(types$1.f_expr); }
  34053. else
  34054. { this.context.push(types$1.f_stat); }
  34055. this.exprAllowed = false;
  34056. };
  34057. types.backQuote.updateContext = function() {
  34058. if (this.curContext() === types$1.q_tmpl)
  34059. { this.context.pop(); }
  34060. else
  34061. { this.context.push(types$1.q_tmpl); }
  34062. this.exprAllowed = false;
  34063. };
  34064. types.star.updateContext = function(prevType) {
  34065. if (prevType === types._function) {
  34066. var index = this.context.length - 1;
  34067. if (this.context[index] === types$1.f_expr)
  34068. { this.context[index] = types$1.f_expr_gen; }
  34069. else
  34070. { this.context[index] = types$1.f_gen; }
  34071. }
  34072. this.exprAllowed = true;
  34073. };
  34074. types.name.updateContext = function(prevType) {
  34075. var allowed = false;
  34076. if (this.options.ecmaVersion >= 6 && prevType !== types.dot) {
  34077. if (this.value === "of" && !this.exprAllowed ||
  34078. this.value === "yield" && this.inGeneratorContext())
  34079. { allowed = true; }
  34080. }
  34081. this.exprAllowed = allowed;
  34082. };
  34083. // This file contains Unicode properties extracted from the ECMAScript
  34084. // specification. The lists are extracted like so:
  34085. // $$('#table-binary-unicode-properties > figure > table > tbody > tr > td:nth-child(1) code').map(el => el.innerText)
  34086. // #table-binary-unicode-properties
  34087. var ecma9BinaryProperties = "ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS";
  34088. var ecma10BinaryProperties = ecma9BinaryProperties + " Extended_Pictographic";
  34089. var ecma11BinaryProperties = ecma10BinaryProperties;
  34090. var ecma12BinaryProperties = ecma11BinaryProperties + " EBase EComp EMod EPres ExtPict";
  34091. var unicodeBinaryProperties = {
  34092. 9: ecma9BinaryProperties,
  34093. 10: ecma10BinaryProperties,
  34094. 11: ecma11BinaryProperties,
  34095. 12: ecma12BinaryProperties
  34096. };
  34097. // #table-unicode-general-category-values
  34098. var unicodeGeneralCategoryValues = "Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu";
  34099. // #table-unicode-script-values
  34100. var ecma9ScriptValues = "Adlam Adlm Ahom Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb";
  34101. var ecma10ScriptValues = ecma9ScriptValues + " Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd";
  34102. var ecma11ScriptValues = ecma10ScriptValues + " Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho";
  34103. var ecma12ScriptValues = ecma11ScriptValues + " Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi";
  34104. var unicodeScriptValues = {
  34105. 9: ecma9ScriptValues,
  34106. 10: ecma10ScriptValues,
  34107. 11: ecma11ScriptValues,
  34108. 12: ecma12ScriptValues
  34109. };
  34110. var data = {};
  34111. function buildUnicodeData(ecmaVersion) {
  34112. var d = data[ecmaVersion] = {
  34113. binary: wordsRegexp(unicodeBinaryProperties[ecmaVersion] + " " + unicodeGeneralCategoryValues),
  34114. nonBinary: {
  34115. General_Category: wordsRegexp(unicodeGeneralCategoryValues),
  34116. Script: wordsRegexp(unicodeScriptValues[ecmaVersion])
  34117. }
  34118. };
  34119. d.nonBinary.Script_Extensions = d.nonBinary.Script;
  34120. d.nonBinary.gc = d.nonBinary.General_Category;
  34121. d.nonBinary.sc = d.nonBinary.Script;
  34122. d.nonBinary.scx = d.nonBinary.Script_Extensions;
  34123. }
  34124. buildUnicodeData(9);
  34125. buildUnicodeData(10);
  34126. buildUnicodeData(11);
  34127. buildUnicodeData(12);
  34128. var pp$8 = Parser.prototype;
  34129. var RegExpValidationState = function RegExpValidationState(parser) {
  34130. this.parser = parser;
  34131. this.validFlags = "gim" + (parser.options.ecmaVersion >= 6 ? "uy" : "") + (parser.options.ecmaVersion >= 9 ? "s" : "");
  34132. this.unicodeProperties = data[parser.options.ecmaVersion >= 12 ? 12 : parser.options.ecmaVersion];
  34133. this.source = "";
  34134. this.flags = "";
  34135. this.start = 0;
  34136. this.switchU = false;
  34137. this.switchN = false;
  34138. this.pos = 0;
  34139. this.lastIntValue = 0;
  34140. this.lastStringValue = "";
  34141. this.lastAssertionIsQuantifiable = false;
  34142. this.numCapturingParens = 0;
  34143. this.maxBackReference = 0;
  34144. this.groupNames = [];
  34145. this.backReferenceNames = [];
  34146. };
  34147. RegExpValidationState.prototype.reset = function reset (start, pattern, flags) {
  34148. var unicode = flags.indexOf("u") !== -1;
  34149. this.start = start | 0;
  34150. this.source = pattern + "";
  34151. this.flags = flags;
  34152. this.switchU = unicode && this.parser.options.ecmaVersion >= 6;
  34153. this.switchN = unicode && this.parser.options.ecmaVersion >= 9;
  34154. };
  34155. RegExpValidationState.prototype.raise = function raise (message) {
  34156. this.parser.raiseRecoverable(this.start, ("Invalid regular expression: /" + (this.source) + "/: " + message));
  34157. };
  34158. // If u flag is given, this returns the code point at the index (it combines a surrogate pair).
  34159. // Otherwise, this returns the code unit of the index (can be a part of a surrogate pair).
  34160. RegExpValidationState.prototype.at = function at (i, forceU) {
  34161. if ( forceU === void 0 ) forceU = false;
  34162. var s = this.source;
  34163. var l = s.length;
  34164. if (i >= l) {
  34165. return -1
  34166. }
  34167. var c = s.charCodeAt(i);
  34168. if (!(forceU || this.switchU) || c <= 0xD7FF || c >= 0xE000 || i + 1 >= l) {
  34169. return c
  34170. }
  34171. var next = s.charCodeAt(i + 1);
  34172. return next >= 0xDC00 && next <= 0xDFFF ? (c << 10) + next - 0x35FDC00 : c
  34173. };
  34174. RegExpValidationState.prototype.nextIndex = function nextIndex (i, forceU) {
  34175. if ( forceU === void 0 ) forceU = false;
  34176. var s = this.source;
  34177. var l = s.length;
  34178. if (i >= l) {
  34179. return l
  34180. }
  34181. var c = s.charCodeAt(i), next;
  34182. if (!(forceU || this.switchU) || c <= 0xD7FF || c >= 0xE000 || i + 1 >= l ||
  34183. (next = s.charCodeAt(i + 1)) < 0xDC00 || next > 0xDFFF) {
  34184. return i + 1
  34185. }
  34186. return i + 2
  34187. };
  34188. RegExpValidationState.prototype.current = function current (forceU) {
  34189. if ( forceU === void 0 ) forceU = false;
  34190. return this.at(this.pos, forceU)
  34191. };
  34192. RegExpValidationState.prototype.lookahead = function lookahead (forceU) {
  34193. if ( forceU === void 0 ) forceU = false;
  34194. return this.at(this.nextIndex(this.pos, forceU), forceU)
  34195. };
  34196. RegExpValidationState.prototype.advance = function advance (forceU) {
  34197. if ( forceU === void 0 ) forceU = false;
  34198. this.pos = this.nextIndex(this.pos, forceU);
  34199. };
  34200. RegExpValidationState.prototype.eat = function eat (ch, forceU) {
  34201. if ( forceU === void 0 ) forceU = false;
  34202. if (this.current(forceU) === ch) {
  34203. this.advance(forceU);
  34204. return true
  34205. }
  34206. return false
  34207. };
  34208. function codePointToString(ch) {
  34209. if (ch <= 0xFFFF) { return String.fromCharCode(ch) }
  34210. ch -= 0x10000;
  34211. return String.fromCharCode((ch >> 10) + 0xD800, (ch & 0x03FF) + 0xDC00)
  34212. }
  34213. /**
  34214. * Validate the flags part of a given RegExpLiteral.
  34215. *
  34216. * @param {RegExpValidationState} state The state to validate RegExp.
  34217. * @returns {void}
  34218. */
  34219. pp$8.validateRegExpFlags = function(state) {
  34220. var validFlags = state.validFlags;
  34221. var flags = state.flags;
  34222. for (var i = 0; i < flags.length; i++) {
  34223. var flag = flags.charAt(i);
  34224. if (validFlags.indexOf(flag) === -1) {
  34225. this.raise(state.start, "Invalid regular expression flag");
  34226. }
  34227. if (flags.indexOf(flag, i + 1) > -1) {
  34228. this.raise(state.start, "Duplicate regular expression flag");
  34229. }
  34230. }
  34231. };
  34232. /**
  34233. * Validate the pattern part of a given RegExpLiteral.
  34234. *
  34235. * @param {RegExpValidationState} state The state to validate RegExp.
  34236. * @returns {void}
  34237. */
  34238. pp$8.validateRegExpPattern = function(state) {
  34239. this.regexp_pattern(state);
  34240. // The goal symbol for the parse is |Pattern[~U, ~N]|. If the result of
  34241. // parsing contains a |GroupName|, reparse with the goal symbol
  34242. // |Pattern[~U, +N]| and use this result instead. Throw a *SyntaxError*
  34243. // exception if _P_ did not conform to the grammar, if any elements of _P_
  34244. // were not matched by the parse, or if any Early Error conditions exist.
  34245. if (!state.switchN && this.options.ecmaVersion >= 9 && state.groupNames.length > 0) {
  34246. state.switchN = true;
  34247. this.regexp_pattern(state);
  34248. }
  34249. };
  34250. // https://www.ecma-international.org/ecma-262/8.0/#prod-Pattern
  34251. pp$8.regexp_pattern = function(state) {
  34252. state.pos = 0;
  34253. state.lastIntValue = 0;
  34254. state.lastStringValue = "";
  34255. state.lastAssertionIsQuantifiable = false;
  34256. state.numCapturingParens = 0;
  34257. state.maxBackReference = 0;
  34258. state.groupNames.length = 0;
  34259. state.backReferenceNames.length = 0;
  34260. this.regexp_disjunction(state);
  34261. if (state.pos !== state.source.length) {
  34262. // Make the same messages as V8.
  34263. if (state.eat(0x29 /* ) */)) {
  34264. state.raise("Unmatched ')'");
  34265. }
  34266. if (state.eat(0x5D /* ] */) || state.eat(0x7D /* } */)) {
  34267. state.raise("Lone quantifier brackets");
  34268. }
  34269. }
  34270. if (state.maxBackReference > state.numCapturingParens) {
  34271. state.raise("Invalid escape");
  34272. }
  34273. for (var i = 0, list = state.backReferenceNames; i < list.length; i += 1) {
  34274. var name = list[i];
  34275. if (state.groupNames.indexOf(name) === -1) {
  34276. state.raise("Invalid named capture referenced");
  34277. }
  34278. }
  34279. };
  34280. // https://www.ecma-international.org/ecma-262/8.0/#prod-Disjunction
  34281. pp$8.regexp_disjunction = function(state) {
  34282. this.regexp_alternative(state);
  34283. while (state.eat(0x7C /* | */)) {
  34284. this.regexp_alternative(state);
  34285. }
  34286. // Make the same message as V8.
  34287. if (this.regexp_eatQuantifier(state, true)) {
  34288. state.raise("Nothing to repeat");
  34289. }
  34290. if (state.eat(0x7B /* { */)) {
  34291. state.raise("Lone quantifier brackets");
  34292. }
  34293. };
  34294. // https://www.ecma-international.org/ecma-262/8.0/#prod-Alternative
  34295. pp$8.regexp_alternative = function(state) {
  34296. while (state.pos < state.source.length && this.regexp_eatTerm(state))
  34297. { }
  34298. };
  34299. // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-Term
  34300. pp$8.regexp_eatTerm = function(state) {
  34301. if (this.regexp_eatAssertion(state)) {
  34302. // Handle `QuantifiableAssertion Quantifier` alternative.
  34303. // `state.lastAssertionIsQuantifiable` is true if the last eaten Assertion
  34304. // is a QuantifiableAssertion.
  34305. if (state.lastAssertionIsQuantifiable && this.regexp_eatQuantifier(state)) {
  34306. // Make the same message as V8.
  34307. if (state.switchU) {
  34308. state.raise("Invalid quantifier");
  34309. }
  34310. }
  34311. return true
  34312. }
  34313. if (state.switchU ? this.regexp_eatAtom(state) : this.regexp_eatExtendedAtom(state)) {
  34314. this.regexp_eatQuantifier(state);
  34315. return true
  34316. }
  34317. return false
  34318. };
  34319. // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-Assertion
  34320. pp$8.regexp_eatAssertion = function(state) {
  34321. var start = state.pos;
  34322. state.lastAssertionIsQuantifiable = false;
  34323. // ^, $
  34324. if (state.eat(0x5E /* ^ */) || state.eat(0x24 /* $ */)) {
  34325. return true
  34326. }
  34327. // \b \B
  34328. if (state.eat(0x5C /* \ */)) {
  34329. if (state.eat(0x42 /* B */) || state.eat(0x62 /* b */)) {
  34330. return true
  34331. }
  34332. state.pos = start;
  34333. }
  34334. // Lookahead / Lookbehind
  34335. if (state.eat(0x28 /* ( */) && state.eat(0x3F /* ? */)) {
  34336. var lookbehind = false;
  34337. if (this.options.ecmaVersion >= 9) {
  34338. lookbehind = state.eat(0x3C /* < */);
  34339. }
  34340. if (state.eat(0x3D /* = */) || state.eat(0x21 /* ! */)) {
  34341. this.regexp_disjunction(state);
  34342. if (!state.eat(0x29 /* ) */)) {
  34343. state.raise("Unterminated group");
  34344. }
  34345. state.lastAssertionIsQuantifiable = !lookbehind;
  34346. return true
  34347. }
  34348. }
  34349. state.pos = start;
  34350. return false
  34351. };
  34352. // https://www.ecma-international.org/ecma-262/8.0/#prod-Quantifier
  34353. pp$8.regexp_eatQuantifier = function(state, noError) {
  34354. if ( noError === void 0 ) noError = false;
  34355. if (this.regexp_eatQuantifierPrefix(state, noError)) {
  34356. state.eat(0x3F /* ? */);
  34357. return true
  34358. }
  34359. return false
  34360. };
  34361. // https://www.ecma-international.org/ecma-262/8.0/#prod-QuantifierPrefix
  34362. pp$8.regexp_eatQuantifierPrefix = function(state, noError) {
  34363. return (
  34364. state.eat(0x2A /* * */) ||
  34365. state.eat(0x2B /* + */) ||
  34366. state.eat(0x3F /* ? */) ||
  34367. this.regexp_eatBracedQuantifier(state, noError)
  34368. )
  34369. };
  34370. pp$8.regexp_eatBracedQuantifier = function(state, noError) {
  34371. var start = state.pos;
  34372. if (state.eat(0x7B /* { */)) {
  34373. var min = 0, max = -1;
  34374. if (this.regexp_eatDecimalDigits(state)) {
  34375. min = state.lastIntValue;
  34376. if (state.eat(0x2C /* , */) && this.regexp_eatDecimalDigits(state)) {
  34377. max = state.lastIntValue;
  34378. }
  34379. if (state.eat(0x7D /* } */)) {
  34380. // SyntaxError in https://www.ecma-international.org/ecma-262/8.0/#sec-term
  34381. if (max !== -1 && max < min && !noError) {
  34382. state.raise("numbers out of order in {} quantifier");
  34383. }
  34384. return true
  34385. }
  34386. }
  34387. if (state.switchU && !noError) {
  34388. state.raise("Incomplete quantifier");
  34389. }
  34390. state.pos = start;
  34391. }
  34392. return false
  34393. };
  34394. // https://www.ecma-international.org/ecma-262/8.0/#prod-Atom
  34395. pp$8.regexp_eatAtom = function(state) {
  34396. return (
  34397. this.regexp_eatPatternCharacters(state) ||
  34398. state.eat(0x2E /* . */) ||
  34399. this.regexp_eatReverseSolidusAtomEscape(state) ||
  34400. this.regexp_eatCharacterClass(state) ||
  34401. this.regexp_eatUncapturingGroup(state) ||
  34402. this.regexp_eatCapturingGroup(state)
  34403. )
  34404. };
  34405. pp$8.regexp_eatReverseSolidusAtomEscape = function(state) {
  34406. var start = state.pos;
  34407. if (state.eat(0x5C /* \ */)) {
  34408. if (this.regexp_eatAtomEscape(state)) {
  34409. return true
  34410. }
  34411. state.pos = start;
  34412. }
  34413. return false
  34414. };
  34415. pp$8.regexp_eatUncapturingGroup = function(state) {
  34416. var start = state.pos;
  34417. if (state.eat(0x28 /* ( */)) {
  34418. if (state.eat(0x3F /* ? */) && state.eat(0x3A /* : */)) {
  34419. this.regexp_disjunction(state);
  34420. if (state.eat(0x29 /* ) */)) {
  34421. return true
  34422. }
  34423. state.raise("Unterminated group");
  34424. }
  34425. state.pos = start;
  34426. }
  34427. return false
  34428. };
  34429. pp$8.regexp_eatCapturingGroup = function(state) {
  34430. if (state.eat(0x28 /* ( */)) {
  34431. if (this.options.ecmaVersion >= 9) {
  34432. this.regexp_groupSpecifier(state);
  34433. } else if (state.current() === 0x3F /* ? */) {
  34434. state.raise("Invalid group");
  34435. }
  34436. this.regexp_disjunction(state);
  34437. if (state.eat(0x29 /* ) */)) {
  34438. state.numCapturingParens += 1;
  34439. return true
  34440. }
  34441. state.raise("Unterminated group");
  34442. }
  34443. return false
  34444. };
  34445. // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ExtendedAtom
  34446. pp$8.regexp_eatExtendedAtom = function(state) {
  34447. return (
  34448. state.eat(0x2E /* . */) ||
  34449. this.regexp_eatReverseSolidusAtomEscape(state) ||
  34450. this.regexp_eatCharacterClass(state) ||
  34451. this.regexp_eatUncapturingGroup(state) ||
  34452. this.regexp_eatCapturingGroup(state) ||
  34453. this.regexp_eatInvalidBracedQuantifier(state) ||
  34454. this.regexp_eatExtendedPatternCharacter(state)
  34455. )
  34456. };
  34457. // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-InvalidBracedQuantifier
  34458. pp$8.regexp_eatInvalidBracedQuantifier = function(state) {
  34459. if (this.regexp_eatBracedQuantifier(state, true)) {
  34460. state.raise("Nothing to repeat");
  34461. }
  34462. return false
  34463. };
  34464. // https://www.ecma-international.org/ecma-262/8.0/#prod-SyntaxCharacter
  34465. pp$8.regexp_eatSyntaxCharacter = function(state) {
  34466. var ch = state.current();
  34467. if (isSyntaxCharacter(ch)) {
  34468. state.lastIntValue = ch;
  34469. state.advance();
  34470. return true
  34471. }
  34472. return false
  34473. };
  34474. function isSyntaxCharacter(ch) {
  34475. return (
  34476. ch === 0x24 /* $ */ ||
  34477. ch >= 0x28 /* ( */ && ch <= 0x2B /* + */ ||
  34478. ch === 0x2E /* . */ ||
  34479. ch === 0x3F /* ? */ ||
  34480. ch >= 0x5B /* [ */ && ch <= 0x5E /* ^ */ ||
  34481. ch >= 0x7B /* { */ && ch <= 0x7D /* } */
  34482. )
  34483. }
  34484. // https://www.ecma-international.org/ecma-262/8.0/#prod-PatternCharacter
  34485. // But eat eager.
  34486. pp$8.regexp_eatPatternCharacters = function(state) {
  34487. var start = state.pos;
  34488. var ch = 0;
  34489. while ((ch = state.current()) !== -1 && !isSyntaxCharacter(ch)) {
  34490. state.advance();
  34491. }
  34492. return state.pos !== start
  34493. };
  34494. // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ExtendedPatternCharacter
  34495. pp$8.regexp_eatExtendedPatternCharacter = function(state) {
  34496. var ch = state.current();
  34497. if (
  34498. ch !== -1 &&
  34499. ch !== 0x24 /* $ */ &&
  34500. !(ch >= 0x28 /* ( */ && ch <= 0x2B /* + */) &&
  34501. ch !== 0x2E /* . */ &&
  34502. ch !== 0x3F /* ? */ &&
  34503. ch !== 0x5B /* [ */ &&
  34504. ch !== 0x5E /* ^ */ &&
  34505. ch !== 0x7C /* | */
  34506. ) {
  34507. state.advance();
  34508. return true
  34509. }
  34510. return false
  34511. };
  34512. // GroupSpecifier ::
  34513. // [empty]
  34514. // `?` GroupName
  34515. pp$8.regexp_groupSpecifier = function(state) {
  34516. if (state.eat(0x3F /* ? */)) {
  34517. if (this.regexp_eatGroupName(state)) {
  34518. if (state.groupNames.indexOf(state.lastStringValue) !== -1) {
  34519. state.raise("Duplicate capture group name");
  34520. }
  34521. state.groupNames.push(state.lastStringValue);
  34522. return
  34523. }
  34524. state.raise("Invalid group");
  34525. }
  34526. };
  34527. // GroupName ::
  34528. // `<` RegExpIdentifierName `>`
  34529. // Note: this updates `state.lastStringValue` property with the eaten name.
  34530. pp$8.regexp_eatGroupName = function(state) {
  34531. state.lastStringValue = "";
  34532. if (state.eat(0x3C /* < */)) {
  34533. if (this.regexp_eatRegExpIdentifierName(state) && state.eat(0x3E /* > */)) {
  34534. return true
  34535. }
  34536. state.raise("Invalid capture group name");
  34537. }
  34538. return false
  34539. };
  34540. // RegExpIdentifierName ::
  34541. // RegExpIdentifierStart
  34542. // RegExpIdentifierName RegExpIdentifierPart
  34543. // Note: this updates `state.lastStringValue` property with the eaten name.
  34544. pp$8.regexp_eatRegExpIdentifierName = function(state) {
  34545. state.lastStringValue = "";
  34546. if (this.regexp_eatRegExpIdentifierStart(state)) {
  34547. state.lastStringValue += codePointToString(state.lastIntValue);
  34548. while (this.regexp_eatRegExpIdentifierPart(state)) {
  34549. state.lastStringValue += codePointToString(state.lastIntValue);
  34550. }
  34551. return true
  34552. }
  34553. return false
  34554. };
  34555. // RegExpIdentifierStart ::
  34556. // UnicodeIDStart
  34557. // `$`
  34558. // `_`
  34559. // `\` RegExpUnicodeEscapeSequence[+U]
  34560. pp$8.regexp_eatRegExpIdentifierStart = function(state) {
  34561. var start = state.pos;
  34562. var forceU = this.options.ecmaVersion >= 11;
  34563. var ch = state.current(forceU);
  34564. state.advance(forceU);
  34565. if (ch === 0x5C /* \ */ && this.regexp_eatRegExpUnicodeEscapeSequence(state, forceU)) {
  34566. ch = state.lastIntValue;
  34567. }
  34568. if (isRegExpIdentifierStart(ch)) {
  34569. state.lastIntValue = ch;
  34570. return true
  34571. }
  34572. state.pos = start;
  34573. return false
  34574. };
  34575. function isRegExpIdentifierStart(ch) {
  34576. return isIdentifierStart(ch, true) || ch === 0x24 /* $ */ || ch === 0x5F /* _ */
  34577. }
  34578. // RegExpIdentifierPart ::
  34579. // UnicodeIDContinue
  34580. // `$`
  34581. // `_`
  34582. // `\` RegExpUnicodeEscapeSequence[+U]
  34583. // <ZWNJ>
  34584. // <ZWJ>
  34585. pp$8.regexp_eatRegExpIdentifierPart = function(state) {
  34586. var start = state.pos;
  34587. var forceU = this.options.ecmaVersion >= 11;
  34588. var ch = state.current(forceU);
  34589. state.advance(forceU);
  34590. if (ch === 0x5C /* \ */ && this.regexp_eatRegExpUnicodeEscapeSequence(state, forceU)) {
  34591. ch = state.lastIntValue;
  34592. }
  34593. if (isRegExpIdentifierPart(ch)) {
  34594. state.lastIntValue = ch;
  34595. return true
  34596. }
  34597. state.pos = start;
  34598. return false
  34599. };
  34600. function isRegExpIdentifierPart(ch) {
  34601. return isIdentifierChar(ch, true) || ch === 0x24 /* $ */ || ch === 0x5F /* _ */ || ch === 0x200C /* <ZWNJ> */ || ch === 0x200D /* <ZWJ> */
  34602. }
  34603. // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-AtomEscape
  34604. pp$8.regexp_eatAtomEscape = function(state) {
  34605. if (
  34606. this.regexp_eatBackReference(state) ||
  34607. this.regexp_eatCharacterClassEscape(state) ||
  34608. this.regexp_eatCharacterEscape(state) ||
  34609. (state.switchN && this.regexp_eatKGroupName(state))
  34610. ) {
  34611. return true
  34612. }
  34613. if (state.switchU) {
  34614. // Make the same message as V8.
  34615. if (state.current() === 0x63 /* c */) {
  34616. state.raise("Invalid unicode escape");
  34617. }
  34618. state.raise("Invalid escape");
  34619. }
  34620. return false
  34621. };
  34622. pp$8.regexp_eatBackReference = function(state) {
  34623. var start = state.pos;
  34624. if (this.regexp_eatDecimalEscape(state)) {
  34625. var n = state.lastIntValue;
  34626. if (state.switchU) {
  34627. // For SyntaxError in https://www.ecma-international.org/ecma-262/8.0/#sec-atomescape
  34628. if (n > state.maxBackReference) {
  34629. state.maxBackReference = n;
  34630. }
  34631. return true
  34632. }
  34633. if (n <= state.numCapturingParens) {
  34634. return true
  34635. }
  34636. state.pos = start;
  34637. }
  34638. return false
  34639. };
  34640. pp$8.regexp_eatKGroupName = function(state) {
  34641. if (state.eat(0x6B /* k */)) {
  34642. if (this.regexp_eatGroupName(state)) {
  34643. state.backReferenceNames.push(state.lastStringValue);
  34644. return true
  34645. }
  34646. state.raise("Invalid named reference");
  34647. }
  34648. return false
  34649. };
  34650. // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-CharacterEscape
  34651. pp$8.regexp_eatCharacterEscape = function(state) {
  34652. return (
  34653. this.regexp_eatControlEscape(state) ||
  34654. this.regexp_eatCControlLetter(state) ||
  34655. this.regexp_eatZero(state) ||
  34656. this.regexp_eatHexEscapeSequence(state) ||
  34657. this.regexp_eatRegExpUnicodeEscapeSequence(state, false) ||
  34658. (!state.switchU && this.regexp_eatLegacyOctalEscapeSequence(state)) ||
  34659. this.regexp_eatIdentityEscape(state)
  34660. )
  34661. };
  34662. pp$8.regexp_eatCControlLetter = function(state) {
  34663. var start = state.pos;
  34664. if (state.eat(0x63 /* c */)) {
  34665. if (this.regexp_eatControlLetter(state)) {
  34666. return true
  34667. }
  34668. state.pos = start;
  34669. }
  34670. return false
  34671. };
  34672. pp$8.regexp_eatZero = function(state) {
  34673. if (state.current() === 0x30 /* 0 */ && !isDecimalDigit(state.lookahead())) {
  34674. state.lastIntValue = 0;
  34675. state.advance();
  34676. return true
  34677. }
  34678. return false
  34679. };
  34680. // https://www.ecma-international.org/ecma-262/8.0/#prod-ControlEscape
  34681. pp$8.regexp_eatControlEscape = function(state) {
  34682. var ch = state.current();
  34683. if (ch === 0x74 /* t */) {
  34684. state.lastIntValue = 0x09; /* \t */
  34685. state.advance();
  34686. return true
  34687. }
  34688. if (ch === 0x6E /* n */) {
  34689. state.lastIntValue = 0x0A; /* \n */
  34690. state.advance();
  34691. return true
  34692. }
  34693. if (ch === 0x76 /* v */) {
  34694. state.lastIntValue = 0x0B; /* \v */
  34695. state.advance();
  34696. return true
  34697. }
  34698. if (ch === 0x66 /* f */) {
  34699. state.lastIntValue = 0x0C; /* \f */
  34700. state.advance();
  34701. return true
  34702. }
  34703. if (ch === 0x72 /* r */) {
  34704. state.lastIntValue = 0x0D; /* \r */
  34705. state.advance();
  34706. return true
  34707. }
  34708. return false
  34709. };
  34710. // https://www.ecma-international.org/ecma-262/8.0/#prod-ControlLetter
  34711. pp$8.regexp_eatControlLetter = function(state) {
  34712. var ch = state.current();
  34713. if (isControlLetter(ch)) {
  34714. state.lastIntValue = ch % 0x20;
  34715. state.advance();
  34716. return true
  34717. }
  34718. return false
  34719. };
  34720. function isControlLetter(ch) {
  34721. return (
  34722. (ch >= 0x41 /* A */ && ch <= 0x5A /* Z */) ||
  34723. (ch >= 0x61 /* a */ && ch <= 0x7A /* z */)
  34724. )
  34725. }
  34726. // https://www.ecma-international.org/ecma-262/8.0/#prod-RegExpUnicodeEscapeSequence
  34727. pp$8.regexp_eatRegExpUnicodeEscapeSequence = function(state, forceU) {
  34728. if ( forceU === void 0 ) forceU = false;
  34729. var start = state.pos;
  34730. var switchU = forceU || state.switchU;
  34731. if (state.eat(0x75 /* u */)) {
  34732. if (this.regexp_eatFixedHexDigits(state, 4)) {
  34733. var lead = state.lastIntValue;
  34734. if (switchU && lead >= 0xD800 && lead <= 0xDBFF) {
  34735. var leadSurrogateEnd = state.pos;
  34736. if (state.eat(0x5C /* \ */) && state.eat(0x75 /* u */) && this.regexp_eatFixedHexDigits(state, 4)) {
  34737. var trail = state.lastIntValue;
  34738. if (trail >= 0xDC00 && trail <= 0xDFFF) {
  34739. state.lastIntValue = (lead - 0xD800) * 0x400 + (trail - 0xDC00) + 0x10000;
  34740. return true
  34741. }
  34742. }
  34743. state.pos = leadSurrogateEnd;
  34744. state.lastIntValue = lead;
  34745. }
  34746. return true
  34747. }
  34748. if (
  34749. switchU &&
  34750. state.eat(0x7B /* { */) &&
  34751. this.regexp_eatHexDigits(state) &&
  34752. state.eat(0x7D /* } */) &&
  34753. isValidUnicode(state.lastIntValue)
  34754. ) {
  34755. return true
  34756. }
  34757. if (switchU) {
  34758. state.raise("Invalid unicode escape");
  34759. }
  34760. state.pos = start;
  34761. }
  34762. return false
  34763. };
  34764. function isValidUnicode(ch) {
  34765. return ch >= 0 && ch <= 0x10FFFF
  34766. }
  34767. // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-IdentityEscape
  34768. pp$8.regexp_eatIdentityEscape = function(state) {
  34769. if (state.switchU) {
  34770. if (this.regexp_eatSyntaxCharacter(state)) {
  34771. return true
  34772. }
  34773. if (state.eat(0x2F /* / */)) {
  34774. state.lastIntValue = 0x2F; /* / */
  34775. return true
  34776. }
  34777. return false
  34778. }
  34779. var ch = state.current();
  34780. if (ch !== 0x63 /* c */ && (!state.switchN || ch !== 0x6B /* k */)) {
  34781. state.lastIntValue = ch;
  34782. state.advance();
  34783. return true
  34784. }
  34785. return false
  34786. };
  34787. // https://www.ecma-international.org/ecma-262/8.0/#prod-DecimalEscape
  34788. pp$8.regexp_eatDecimalEscape = function(state) {
  34789. state.lastIntValue = 0;
  34790. var ch = state.current();
  34791. if (ch >= 0x31 /* 1 */ && ch <= 0x39 /* 9 */) {
  34792. do {
  34793. state.lastIntValue = 10 * state.lastIntValue + (ch - 0x30 /* 0 */);
  34794. state.advance();
  34795. } while ((ch = state.current()) >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */)
  34796. return true
  34797. }
  34798. return false
  34799. };
  34800. // https://www.ecma-international.org/ecma-262/8.0/#prod-CharacterClassEscape
  34801. pp$8.regexp_eatCharacterClassEscape = function(state) {
  34802. var ch = state.current();
  34803. if (isCharacterClassEscape(ch)) {
  34804. state.lastIntValue = -1;
  34805. state.advance();
  34806. return true
  34807. }
  34808. if (
  34809. state.switchU &&
  34810. this.options.ecmaVersion >= 9 &&
  34811. (ch === 0x50 /* P */ || ch === 0x70 /* p */)
  34812. ) {
  34813. state.lastIntValue = -1;
  34814. state.advance();
  34815. if (
  34816. state.eat(0x7B /* { */) &&
  34817. this.regexp_eatUnicodePropertyValueExpression(state) &&
  34818. state.eat(0x7D /* } */)
  34819. ) {
  34820. return true
  34821. }
  34822. state.raise("Invalid property name");
  34823. }
  34824. return false
  34825. };
  34826. function isCharacterClassEscape(ch) {
  34827. return (
  34828. ch === 0x64 /* d */ ||
  34829. ch === 0x44 /* D */ ||
  34830. ch === 0x73 /* s */ ||
  34831. ch === 0x53 /* S */ ||
  34832. ch === 0x77 /* w */ ||
  34833. ch === 0x57 /* W */
  34834. )
  34835. }
  34836. // UnicodePropertyValueExpression ::
  34837. // UnicodePropertyName `=` UnicodePropertyValue
  34838. // LoneUnicodePropertyNameOrValue
  34839. pp$8.regexp_eatUnicodePropertyValueExpression = function(state) {
  34840. var start = state.pos;
  34841. // UnicodePropertyName `=` UnicodePropertyValue
  34842. if (this.regexp_eatUnicodePropertyName(state) && state.eat(0x3D /* = */)) {
  34843. var name = state.lastStringValue;
  34844. if (this.regexp_eatUnicodePropertyValue(state)) {
  34845. var value = state.lastStringValue;
  34846. this.regexp_validateUnicodePropertyNameAndValue(state, name, value);
  34847. return true
  34848. }
  34849. }
  34850. state.pos = start;
  34851. // LoneUnicodePropertyNameOrValue
  34852. if (this.regexp_eatLoneUnicodePropertyNameOrValue(state)) {
  34853. var nameOrValue = state.lastStringValue;
  34854. this.regexp_validateUnicodePropertyNameOrValue(state, nameOrValue);
  34855. return true
  34856. }
  34857. return false
  34858. };
  34859. pp$8.regexp_validateUnicodePropertyNameAndValue = function(state, name, value) {
  34860. if (!has(state.unicodeProperties.nonBinary, name))
  34861. { state.raise("Invalid property name"); }
  34862. if (!state.unicodeProperties.nonBinary[name].test(value))
  34863. { state.raise("Invalid property value"); }
  34864. };
  34865. pp$8.regexp_validateUnicodePropertyNameOrValue = function(state, nameOrValue) {
  34866. if (!state.unicodeProperties.binary.test(nameOrValue))
  34867. { state.raise("Invalid property name"); }
  34868. };
  34869. // UnicodePropertyName ::
  34870. // UnicodePropertyNameCharacters
  34871. pp$8.regexp_eatUnicodePropertyName = function(state) {
  34872. var ch = 0;
  34873. state.lastStringValue = "";
  34874. while (isUnicodePropertyNameCharacter(ch = state.current())) {
  34875. state.lastStringValue += codePointToString(ch);
  34876. state.advance();
  34877. }
  34878. return state.lastStringValue !== ""
  34879. };
  34880. function isUnicodePropertyNameCharacter(ch) {
  34881. return isControlLetter(ch) || ch === 0x5F /* _ */
  34882. }
  34883. // UnicodePropertyValue ::
  34884. // UnicodePropertyValueCharacters
  34885. pp$8.regexp_eatUnicodePropertyValue = function(state) {
  34886. var ch = 0;
  34887. state.lastStringValue = "";
  34888. while (isUnicodePropertyValueCharacter(ch = state.current())) {
  34889. state.lastStringValue += codePointToString(ch);
  34890. state.advance();
  34891. }
  34892. return state.lastStringValue !== ""
  34893. };
  34894. function isUnicodePropertyValueCharacter(ch) {
  34895. return isUnicodePropertyNameCharacter(ch) || isDecimalDigit(ch)
  34896. }
  34897. // LoneUnicodePropertyNameOrValue ::
  34898. // UnicodePropertyValueCharacters
  34899. pp$8.regexp_eatLoneUnicodePropertyNameOrValue = function(state) {
  34900. return this.regexp_eatUnicodePropertyValue(state)
  34901. };
  34902. // https://www.ecma-international.org/ecma-262/8.0/#prod-CharacterClass
  34903. pp$8.regexp_eatCharacterClass = function(state) {
  34904. if (state.eat(0x5B /* [ */)) {
  34905. state.eat(0x5E /* ^ */);
  34906. this.regexp_classRanges(state);
  34907. if (state.eat(0x5D /* ] */)) {
  34908. return true
  34909. }
  34910. // Unreachable since it threw "unterminated regular expression" error before.
  34911. state.raise("Unterminated character class");
  34912. }
  34913. return false
  34914. };
  34915. // https://www.ecma-international.org/ecma-262/8.0/#prod-ClassRanges
  34916. // https://www.ecma-international.org/ecma-262/8.0/#prod-NonemptyClassRanges
  34917. // https://www.ecma-international.org/ecma-262/8.0/#prod-NonemptyClassRangesNoDash
  34918. pp$8.regexp_classRanges = function(state) {
  34919. while (this.regexp_eatClassAtom(state)) {
  34920. var left = state.lastIntValue;
  34921. if (state.eat(0x2D /* - */) && this.regexp_eatClassAtom(state)) {
  34922. var right = state.lastIntValue;
  34923. if (state.switchU && (left === -1 || right === -1)) {
  34924. state.raise("Invalid character class");
  34925. }
  34926. if (left !== -1 && right !== -1 && left > right) {
  34927. state.raise("Range out of order in character class");
  34928. }
  34929. }
  34930. }
  34931. };
  34932. // https://www.ecma-international.org/ecma-262/8.0/#prod-ClassAtom
  34933. // https://www.ecma-international.org/ecma-262/8.0/#prod-ClassAtomNoDash
  34934. pp$8.regexp_eatClassAtom = function(state) {
  34935. var start = state.pos;
  34936. if (state.eat(0x5C /* \ */)) {
  34937. if (this.regexp_eatClassEscape(state)) {
  34938. return true
  34939. }
  34940. if (state.switchU) {
  34941. // Make the same message as V8.
  34942. var ch$1 = state.current();
  34943. if (ch$1 === 0x63 /* c */ || isOctalDigit(ch$1)) {
  34944. state.raise("Invalid class escape");
  34945. }
  34946. state.raise("Invalid escape");
  34947. }
  34948. state.pos = start;
  34949. }
  34950. var ch = state.current();
  34951. if (ch !== 0x5D /* ] */) {
  34952. state.lastIntValue = ch;
  34953. state.advance();
  34954. return true
  34955. }
  34956. return false
  34957. };
  34958. // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ClassEscape
  34959. pp$8.regexp_eatClassEscape = function(state) {
  34960. var start = state.pos;
  34961. if (state.eat(0x62 /* b */)) {
  34962. state.lastIntValue = 0x08; /* <BS> */
  34963. return true
  34964. }
  34965. if (state.switchU && state.eat(0x2D /* - */)) {
  34966. state.lastIntValue = 0x2D; /* - */
  34967. return true
  34968. }
  34969. if (!state.switchU && state.eat(0x63 /* c */)) {
  34970. if (this.regexp_eatClassControlLetter(state)) {
  34971. return true
  34972. }
  34973. state.pos = start;
  34974. }
  34975. return (
  34976. this.regexp_eatCharacterClassEscape(state) ||
  34977. this.regexp_eatCharacterEscape(state)
  34978. )
  34979. };
  34980. // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ClassControlLetter
  34981. pp$8.regexp_eatClassControlLetter = function(state) {
  34982. var ch = state.current();
  34983. if (isDecimalDigit(ch) || ch === 0x5F /* _ */) {
  34984. state.lastIntValue = ch % 0x20;
  34985. state.advance();
  34986. return true
  34987. }
  34988. return false
  34989. };
  34990. // https://www.ecma-international.org/ecma-262/8.0/#prod-HexEscapeSequence
  34991. pp$8.regexp_eatHexEscapeSequence = function(state) {
  34992. var start = state.pos;
  34993. if (state.eat(0x78 /* x */)) {
  34994. if (this.regexp_eatFixedHexDigits(state, 2)) {
  34995. return true
  34996. }
  34997. if (state.switchU) {
  34998. state.raise("Invalid escape");
  34999. }
  35000. state.pos = start;
  35001. }
  35002. return false
  35003. };
  35004. // https://www.ecma-international.org/ecma-262/8.0/#prod-DecimalDigits
  35005. pp$8.regexp_eatDecimalDigits = function(state) {
  35006. var start = state.pos;
  35007. var ch = 0;
  35008. state.lastIntValue = 0;
  35009. while (isDecimalDigit(ch = state.current())) {
  35010. state.lastIntValue = 10 * state.lastIntValue + (ch - 0x30 /* 0 */);
  35011. state.advance();
  35012. }
  35013. return state.pos !== start
  35014. };
  35015. function isDecimalDigit(ch) {
  35016. return ch >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */
  35017. }
  35018. // https://www.ecma-international.org/ecma-262/8.0/#prod-HexDigits
  35019. pp$8.regexp_eatHexDigits = function(state) {
  35020. var start = state.pos;
  35021. var ch = 0;
  35022. state.lastIntValue = 0;
  35023. while (isHexDigit(ch = state.current())) {
  35024. state.lastIntValue = 16 * state.lastIntValue + hexToInt(ch);
  35025. state.advance();
  35026. }
  35027. return state.pos !== start
  35028. };
  35029. function isHexDigit(ch) {
  35030. return (
  35031. (ch >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */) ||
  35032. (ch >= 0x41 /* A */ && ch <= 0x46 /* F */) ||
  35033. (ch >= 0x61 /* a */ && ch <= 0x66 /* f */)
  35034. )
  35035. }
  35036. function hexToInt(ch) {
  35037. if (ch >= 0x41 /* A */ && ch <= 0x46 /* F */) {
  35038. return 10 + (ch - 0x41 /* A */)
  35039. }
  35040. if (ch >= 0x61 /* a */ && ch <= 0x66 /* f */) {
  35041. return 10 + (ch - 0x61 /* a */)
  35042. }
  35043. return ch - 0x30 /* 0 */
  35044. }
  35045. // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-LegacyOctalEscapeSequence
  35046. // Allows only 0-377(octal) i.e. 0-255(decimal).
  35047. pp$8.regexp_eatLegacyOctalEscapeSequence = function(state) {
  35048. if (this.regexp_eatOctalDigit(state)) {
  35049. var n1 = state.lastIntValue;
  35050. if (this.regexp_eatOctalDigit(state)) {
  35051. var n2 = state.lastIntValue;
  35052. if (n1 <= 3 && this.regexp_eatOctalDigit(state)) {
  35053. state.lastIntValue = n1 * 64 + n2 * 8 + state.lastIntValue;
  35054. } else {
  35055. state.lastIntValue = n1 * 8 + n2;
  35056. }
  35057. } else {
  35058. state.lastIntValue = n1;
  35059. }
  35060. return true
  35061. }
  35062. return false
  35063. };
  35064. // https://www.ecma-international.org/ecma-262/8.0/#prod-OctalDigit
  35065. pp$8.regexp_eatOctalDigit = function(state) {
  35066. var ch = state.current();
  35067. if (isOctalDigit(ch)) {
  35068. state.lastIntValue = ch - 0x30; /* 0 */
  35069. state.advance();
  35070. return true
  35071. }
  35072. state.lastIntValue = 0;
  35073. return false
  35074. };
  35075. function isOctalDigit(ch) {
  35076. return ch >= 0x30 /* 0 */ && ch <= 0x37 /* 7 */
  35077. }
  35078. // https://www.ecma-international.org/ecma-262/8.0/#prod-Hex4Digits
  35079. // https://www.ecma-international.org/ecma-262/8.0/#prod-HexDigit
  35080. // And HexDigit HexDigit in https://www.ecma-international.org/ecma-262/8.0/#prod-HexEscapeSequence
  35081. pp$8.regexp_eatFixedHexDigits = function(state, length) {
  35082. var start = state.pos;
  35083. state.lastIntValue = 0;
  35084. for (var i = 0; i < length; ++i) {
  35085. var ch = state.current();
  35086. if (!isHexDigit(ch)) {
  35087. state.pos = start;
  35088. return false
  35089. }
  35090. state.lastIntValue = 16 * state.lastIntValue + hexToInt(ch);
  35091. state.advance();
  35092. }
  35093. return true
  35094. };
  35095. // Object type used to represent tokens. Note that normally, tokens
  35096. // simply exist as properties on the parser object. This is only
  35097. // used for the onToken callback and the external tokenizer.
  35098. var Token = function Token(p) {
  35099. this.type = p.type;
  35100. this.value = p.value;
  35101. this.start = p.start;
  35102. this.end = p.end;
  35103. if (p.options.locations)
  35104. { this.loc = new SourceLocation(p, p.startLoc, p.endLoc); }
  35105. if (p.options.ranges)
  35106. { this.range = [p.start, p.end]; }
  35107. };
  35108. // ## Tokenizer
  35109. var pp$9 = Parser.prototype;
  35110. // Move to the next token
  35111. pp$9.next = function(ignoreEscapeSequenceInKeyword) {
  35112. if (!ignoreEscapeSequenceInKeyword && this.type.keyword && this.containsEsc)
  35113. { this.raiseRecoverable(this.start, "Escape sequence in keyword " + this.type.keyword); }
  35114. if (this.options.onToken)
  35115. { this.options.onToken(new Token(this)); }
  35116. this.lastTokEnd = this.end;
  35117. this.lastTokStart = this.start;
  35118. this.lastTokEndLoc = this.endLoc;
  35119. this.lastTokStartLoc = this.startLoc;
  35120. this.nextToken();
  35121. };
  35122. pp$9.getToken = function() {
  35123. this.next();
  35124. return new Token(this)
  35125. };
  35126. // If we're in an ES6 environment, make parsers iterable
  35127. if (typeof Symbol !== "undefined")
  35128. { pp$9[Symbol.iterator] = function() {
  35129. var this$1 = this;
  35130. return {
  35131. next: function () {
  35132. var token = this$1.getToken();
  35133. return {
  35134. done: token.type === types.eof,
  35135. value: token
  35136. }
  35137. }
  35138. }
  35139. }; }
  35140. // Toggle strict mode. Re-reads the next number or string to please
  35141. // pedantic tests (`"use strict"; 010;` should fail).
  35142. pp$9.curContext = function() {
  35143. return this.context[this.context.length - 1]
  35144. };
  35145. // Read a single token, updating the parser object's token-related
  35146. // properties.
  35147. pp$9.nextToken = function() {
  35148. var curContext = this.curContext();
  35149. if (!curContext || !curContext.preserveSpace) { this.skipSpace(); }
  35150. this.start = this.pos;
  35151. if (this.options.locations) { this.startLoc = this.curPosition(); }
  35152. if (this.pos >= this.input.length) { return this.finishToken(types.eof) }
  35153. if (curContext.override) { return curContext.override(this) }
  35154. else { this.readToken(this.fullCharCodeAtPos()); }
  35155. };
  35156. pp$9.readToken = function(code) {
  35157. // Identifier or keyword. '\uXXXX' sequences are allowed in
  35158. // identifiers, so '\' also dispatches to that.
  35159. if (isIdentifierStart(code, this.options.ecmaVersion >= 6) || code === 92 /* '\' */)
  35160. { return this.readWord() }
  35161. return this.getTokenFromCode(code)
  35162. };
  35163. pp$9.fullCharCodeAtPos = function() {
  35164. var code = this.input.charCodeAt(this.pos);
  35165. if (code <= 0xd7ff || code >= 0xe000) { return code }
  35166. var next = this.input.charCodeAt(this.pos + 1);
  35167. return (code << 10) + next - 0x35fdc00
  35168. };
  35169. pp$9.skipBlockComment = function() {
  35170. var startLoc = this.options.onComment && this.curPosition();
  35171. var start = this.pos, end = this.input.indexOf("*/", this.pos += 2);
  35172. if (end === -1) { this.raise(this.pos - 2, "Unterminated comment"); }
  35173. this.pos = end + 2;
  35174. if (this.options.locations) {
  35175. lineBreakG.lastIndex = start;
  35176. var match;
  35177. while ((match = lineBreakG.exec(this.input)) && match.index < this.pos) {
  35178. ++this.curLine;
  35179. this.lineStart = match.index + match[0].length;
  35180. }
  35181. }
  35182. if (this.options.onComment)
  35183. { this.options.onComment(true, this.input.slice(start + 2, end), start, this.pos,
  35184. startLoc, this.curPosition()); }
  35185. };
  35186. pp$9.skipLineComment = function(startSkip) {
  35187. var start = this.pos;
  35188. var startLoc = this.options.onComment && this.curPosition();
  35189. var ch = this.input.charCodeAt(this.pos += startSkip);
  35190. while (this.pos < this.input.length && !isNewLine(ch)) {
  35191. ch = this.input.charCodeAt(++this.pos);
  35192. }
  35193. if (this.options.onComment)
  35194. { this.options.onComment(false, this.input.slice(start + startSkip, this.pos), start, this.pos,
  35195. startLoc, this.curPosition()); }
  35196. };
  35197. // Called at the start of the parse and after every token. Skips
  35198. // whitespace and comments, and.
  35199. pp$9.skipSpace = function() {
  35200. loop: while (this.pos < this.input.length) {
  35201. var ch = this.input.charCodeAt(this.pos);
  35202. switch (ch) {
  35203. case 32: case 160: // ' '
  35204. ++this.pos;
  35205. break
  35206. case 13:
  35207. if (this.input.charCodeAt(this.pos + 1) === 10) {
  35208. ++this.pos;
  35209. }
  35210. case 10: case 8232: case 8233:
  35211. ++this.pos;
  35212. if (this.options.locations) {
  35213. ++this.curLine;
  35214. this.lineStart = this.pos;
  35215. }
  35216. break
  35217. case 47: // '/'
  35218. switch (this.input.charCodeAt(this.pos + 1)) {
  35219. case 42: // '*'
  35220. this.skipBlockComment();
  35221. break
  35222. case 47:
  35223. this.skipLineComment(2);
  35224. break
  35225. default:
  35226. break loop
  35227. }
  35228. break
  35229. default:
  35230. if (ch > 8 && ch < 14 || ch >= 5760 && nonASCIIwhitespace.test(String.fromCharCode(ch))) {
  35231. ++this.pos;
  35232. } else {
  35233. break loop
  35234. }
  35235. }
  35236. }
  35237. };
  35238. // Called at the end of every token. Sets `end`, `val`, and
  35239. // maintains `context` and `exprAllowed`, and skips the space after
  35240. // the token, so that the next one's `start` will point at the
  35241. // right position.
  35242. pp$9.finishToken = function(type, val) {
  35243. this.end = this.pos;
  35244. if (this.options.locations) { this.endLoc = this.curPosition(); }
  35245. var prevType = this.type;
  35246. this.type = type;
  35247. this.value = val;
  35248. this.updateContext(prevType);
  35249. };
  35250. // ### Token reading
  35251. // This is the function that is called to fetch the next token. It
  35252. // is somewhat obscure, because it works in character codes rather
  35253. // than characters, and because operator parsing has been inlined
  35254. // into it.
  35255. //
  35256. // All in the name of speed.
  35257. //
  35258. pp$9.readToken_dot = function() {
  35259. var next = this.input.charCodeAt(this.pos + 1);
  35260. if (next >= 48 && next <= 57) { return this.readNumber(true) }
  35261. var next2 = this.input.charCodeAt(this.pos + 2);
  35262. if (this.options.ecmaVersion >= 6 && next === 46 && next2 === 46) { // 46 = dot '.'
  35263. this.pos += 3;
  35264. return this.finishToken(types.ellipsis)
  35265. } else {
  35266. ++this.pos;
  35267. return this.finishToken(types.dot)
  35268. }
  35269. };
  35270. pp$9.readToken_slash = function() { // '/'
  35271. var next = this.input.charCodeAt(this.pos + 1);
  35272. if (this.exprAllowed) { ++this.pos; return this.readRegexp() }
  35273. if (next === 61) { return this.finishOp(types.assign, 2) }
  35274. return this.finishOp(types.slash, 1)
  35275. };
  35276. pp$9.readToken_mult_modulo_exp = function(code) { // '%*'
  35277. var next = this.input.charCodeAt(this.pos + 1);
  35278. var size = 1;
  35279. var tokentype = code === 42 ? types.star : types.modulo;
  35280. // exponentiation operator ** and **=
  35281. if (this.options.ecmaVersion >= 7 && code === 42 && next === 42) {
  35282. ++size;
  35283. tokentype = types.starstar;
  35284. next = this.input.charCodeAt(this.pos + 2);
  35285. }
  35286. if (next === 61) { return this.finishOp(types.assign, size + 1) }
  35287. return this.finishOp(tokentype, size)
  35288. };
  35289. pp$9.readToken_pipe_amp = function(code) { // '|&'
  35290. var next = this.input.charCodeAt(this.pos + 1);
  35291. if (next === code) {
  35292. if (this.options.ecmaVersion >= 12) {
  35293. var next2 = this.input.charCodeAt(this.pos + 2);
  35294. if (next2 === 61) { return this.finishOp(types.assign, 3) }
  35295. }
  35296. return this.finishOp(code === 124 ? types.logicalOR : types.logicalAND, 2)
  35297. }
  35298. if (next === 61) { return this.finishOp(types.assign, 2) }
  35299. return this.finishOp(code === 124 ? types.bitwiseOR : types.bitwiseAND, 1)
  35300. };
  35301. pp$9.readToken_caret = function() { // '^'
  35302. var next = this.input.charCodeAt(this.pos + 1);
  35303. if (next === 61) { return this.finishOp(types.assign, 2) }
  35304. return this.finishOp(types.bitwiseXOR, 1)
  35305. };
  35306. pp$9.readToken_plus_min = function(code) { // '+-'
  35307. var next = this.input.charCodeAt(this.pos + 1);
  35308. if (next === code) {
  35309. if (next === 45 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 62 &&
  35310. (this.lastTokEnd === 0 || lineBreak.test(this.input.slice(this.lastTokEnd, this.pos)))) {
  35311. // A `-->` line comment
  35312. this.skipLineComment(3);
  35313. this.skipSpace();
  35314. return this.nextToken()
  35315. }
  35316. return this.finishOp(types.incDec, 2)
  35317. }
  35318. if (next === 61) { return this.finishOp(types.assign, 2) }
  35319. return this.finishOp(types.plusMin, 1)
  35320. };
  35321. pp$9.readToken_lt_gt = function(code) { // '<>'
  35322. var next = this.input.charCodeAt(this.pos + 1);
  35323. var size = 1;
  35324. if (next === code) {
  35325. size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2;
  35326. if (this.input.charCodeAt(this.pos + size) === 61) { return this.finishOp(types.assign, size + 1) }
  35327. return this.finishOp(types.bitShift, size)
  35328. }
  35329. if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 &&
  35330. this.input.charCodeAt(this.pos + 3) === 45) {
  35331. // `<!--`, an XML-style comment that should be interpreted as a line comment
  35332. this.skipLineComment(4);
  35333. this.skipSpace();
  35334. return this.nextToken()
  35335. }
  35336. if (next === 61) { size = 2; }
  35337. return this.finishOp(types.relational, size)
  35338. };
  35339. pp$9.readToken_eq_excl = function(code) { // '=!'
  35340. var next = this.input.charCodeAt(this.pos + 1);
  35341. if (next === 61) { return this.finishOp(types.equality, this.input.charCodeAt(this.pos + 2) === 61 ? 3 : 2) }
  35342. if (code === 61 && next === 62 && this.options.ecmaVersion >= 6) { // '=>'
  35343. this.pos += 2;
  35344. return this.finishToken(types.arrow)
  35345. }
  35346. return this.finishOp(code === 61 ? types.eq : types.prefix, 1)
  35347. };
  35348. pp$9.readToken_question = function() { // '?'
  35349. var ecmaVersion = this.options.ecmaVersion;
  35350. if (ecmaVersion >= 11) {
  35351. var next = this.input.charCodeAt(this.pos + 1);
  35352. if (next === 46) {
  35353. var next2 = this.input.charCodeAt(this.pos + 2);
  35354. if (next2 < 48 || next2 > 57) { return this.finishOp(types.questionDot, 2) }
  35355. }
  35356. if (next === 63) {
  35357. if (ecmaVersion >= 12) {
  35358. var next2$1 = this.input.charCodeAt(this.pos + 2);
  35359. if (next2$1 === 61) { return this.finishOp(types.assign, 3) }
  35360. }
  35361. return this.finishOp(types.coalesce, 2)
  35362. }
  35363. }
  35364. return this.finishOp(types.question, 1)
  35365. };
  35366. pp$9.getTokenFromCode = function(code) {
  35367. switch (code) {
  35368. // The interpretation of a dot depends on whether it is followed
  35369. // by a digit or another two dots.
  35370. case 46: // '.'
  35371. return this.readToken_dot()
  35372. // Punctuation tokens.
  35373. case 40: ++this.pos; return this.finishToken(types.parenL)
  35374. case 41: ++this.pos; return this.finishToken(types.parenR)
  35375. case 59: ++this.pos; return this.finishToken(types.semi)
  35376. case 44: ++this.pos; return this.finishToken(types.comma)
  35377. case 91: ++this.pos; return this.finishToken(types.bracketL)
  35378. case 93: ++this.pos; return this.finishToken(types.bracketR)
  35379. case 123: ++this.pos; return this.finishToken(types.braceL)
  35380. case 125: ++this.pos; return this.finishToken(types.braceR)
  35381. case 58: ++this.pos; return this.finishToken(types.colon)
  35382. case 96: // '`'
  35383. if (this.options.ecmaVersion < 6) { break }
  35384. ++this.pos;
  35385. return this.finishToken(types.backQuote)
  35386. case 48: // '0'
  35387. var next = this.input.charCodeAt(this.pos + 1);
  35388. if (next === 120 || next === 88) { return this.readRadixNumber(16) } // '0x', '0X' - hex number
  35389. if (this.options.ecmaVersion >= 6) {
  35390. if (next === 111 || next === 79) { return this.readRadixNumber(8) } // '0o', '0O' - octal number
  35391. if (next === 98 || next === 66) { return this.readRadixNumber(2) } // '0b', '0B' - binary number
  35392. }
  35393. // Anything else beginning with a digit is an integer, octal
  35394. // number, or float.
  35395. case 49: case 50: case 51: case 52: case 53: case 54: case 55: case 56: case 57: // 1-9
  35396. return this.readNumber(false)
  35397. // Quotes produce strings.
  35398. case 34: case 39: // '"', "'"
  35399. return this.readString(code)
  35400. // Operators are parsed inline in tiny state machines. '=' (61) is
  35401. // often referred to. `finishOp` simply skips the amount of
  35402. // characters it is given as second argument, and returns a token
  35403. // of the type given by its first argument.
  35404. case 47: // '/'
  35405. return this.readToken_slash()
  35406. case 37: case 42: // '%*'
  35407. return this.readToken_mult_modulo_exp(code)
  35408. case 124: case 38: // '|&'
  35409. return this.readToken_pipe_amp(code)
  35410. case 94: // '^'
  35411. return this.readToken_caret()
  35412. case 43: case 45: // '+-'
  35413. return this.readToken_plus_min(code)
  35414. case 60: case 62: // '<>'
  35415. return this.readToken_lt_gt(code)
  35416. case 61: case 33: // '=!'
  35417. return this.readToken_eq_excl(code)
  35418. case 63: // '?'
  35419. return this.readToken_question()
  35420. case 126: // '~'
  35421. return this.finishOp(types.prefix, 1)
  35422. }
  35423. this.raise(this.pos, "Unexpected character '" + codePointToString$1(code) + "'");
  35424. };
  35425. pp$9.finishOp = function(type, size) {
  35426. var str = this.input.slice(this.pos, this.pos + size);
  35427. this.pos += size;
  35428. return this.finishToken(type, str)
  35429. };
  35430. pp$9.readRegexp = function() {
  35431. var escaped, inClass, start = this.pos;
  35432. for (;;) {
  35433. if (this.pos >= this.input.length) { this.raise(start, "Unterminated regular expression"); }
  35434. var ch = this.input.charAt(this.pos);
  35435. if (lineBreak.test(ch)) { this.raise(start, "Unterminated regular expression"); }
  35436. if (!escaped) {
  35437. if (ch === "[") { inClass = true; }
  35438. else if (ch === "]" && inClass) { inClass = false; }
  35439. else if (ch === "/" && !inClass) { break }
  35440. escaped = ch === "\\";
  35441. } else { escaped = false; }
  35442. ++this.pos;
  35443. }
  35444. var pattern = this.input.slice(start, this.pos);
  35445. ++this.pos;
  35446. var flagsStart = this.pos;
  35447. var flags = this.readWord1();
  35448. if (this.containsEsc) { this.unexpected(flagsStart); }
  35449. // Validate pattern
  35450. var state = this.regexpState || (this.regexpState = new RegExpValidationState(this));
  35451. state.reset(start, pattern, flags);
  35452. this.validateRegExpFlags(state);
  35453. this.validateRegExpPattern(state);
  35454. // Create Literal#value property value.
  35455. var value = null;
  35456. try {
  35457. value = new RegExp(pattern, flags);
  35458. } catch (e) {
  35459. // ESTree requires null if it failed to instantiate RegExp object.
  35460. // https://github.com/estree/estree/blob/a27003adf4fd7bfad44de9cef372a2eacd527b1c/es5.md#regexpliteral
  35461. }
  35462. return this.finishToken(types.regexp, {pattern: pattern, flags: flags, value: value})
  35463. };
  35464. // Read an integer in the given radix. Return null if zero digits
  35465. // were read, the integer value otherwise. When `len` is given, this
  35466. // will return `null` unless the integer has exactly `len` digits.
  35467. pp$9.readInt = function(radix, len, maybeLegacyOctalNumericLiteral) {
  35468. // `len` is used for character escape sequences. In that case, disallow separators.
  35469. var allowSeparators = this.options.ecmaVersion >= 12 && len === undefined;
  35470. // `maybeLegacyOctalNumericLiteral` is true if it doesn't have prefix (0x,0o,0b)
  35471. // and isn't fraction part nor exponent part. In that case, if the first digit
  35472. // is zero then disallow separators.
  35473. var isLegacyOctalNumericLiteral = maybeLegacyOctalNumericLiteral && this.input.charCodeAt(this.pos) === 48;
  35474. var start = this.pos, total = 0, lastCode = 0;
  35475. for (var i = 0, e = len == null ? Infinity : len; i < e; ++i, ++this.pos) {
  35476. var code = this.input.charCodeAt(this.pos), val = (void 0);
  35477. if (allowSeparators && code === 95) {
  35478. if (isLegacyOctalNumericLiteral) { this.raiseRecoverable(this.pos, "Numeric separator is not allowed in legacy octal numeric literals"); }
  35479. if (lastCode === 95) { this.raiseRecoverable(this.pos, "Numeric separator must be exactly one underscore"); }
  35480. if (i === 0) { this.raiseRecoverable(this.pos, "Numeric separator is not allowed at the first of digits"); }
  35481. lastCode = code;
  35482. continue
  35483. }
  35484. if (code >= 97) { val = code - 97 + 10; } // a
  35485. else if (code >= 65) { val = code - 65 + 10; } // A
  35486. else if (code >= 48 && code <= 57) { val = code - 48; } // 0-9
  35487. else { val = Infinity; }
  35488. if (val >= radix) { break }
  35489. lastCode = code;
  35490. total = total * radix + val;
  35491. }
  35492. if (allowSeparators && lastCode === 95) { this.raiseRecoverable(this.pos - 1, "Numeric separator is not allowed at the last of digits"); }
  35493. if (this.pos === start || len != null && this.pos - start !== len) { return null }
  35494. return total
  35495. };
  35496. function stringToNumber(str, isLegacyOctalNumericLiteral) {
  35497. if (isLegacyOctalNumericLiteral) {
  35498. return parseInt(str, 8)
  35499. }
  35500. // `parseFloat(value)` stops parsing at the first numeric separator then returns a wrong value.
  35501. return parseFloat(str.replace(/_/g, ""))
  35502. }
  35503. function stringToBigInt(str) {
  35504. if (typeof BigInt !== "function") {
  35505. return null
  35506. }
  35507. // `BigInt(value)` throws syntax error if the string contains numeric separators.
  35508. return BigInt(str.replace(/_/g, ""))
  35509. }
  35510. pp$9.readRadixNumber = function(radix) {
  35511. var start = this.pos;
  35512. this.pos += 2; // 0x
  35513. var val = this.readInt(radix);
  35514. if (val == null) { this.raise(this.start + 2, "Expected number in radix " + radix); }
  35515. if (this.options.ecmaVersion >= 11 && this.input.charCodeAt(this.pos) === 110) {
  35516. val = stringToBigInt(this.input.slice(start, this.pos));
  35517. ++this.pos;
  35518. } else if (isIdentifierStart(this.fullCharCodeAtPos())) { this.raise(this.pos, "Identifier directly after number"); }
  35519. return this.finishToken(types.num, val)
  35520. };
  35521. // Read an integer, octal integer, or floating-point number.
  35522. pp$9.readNumber = function(startsWithDot) {
  35523. var start = this.pos;
  35524. if (!startsWithDot && this.readInt(10, undefined, true) === null) { this.raise(start, "Invalid number"); }
  35525. var octal = this.pos - start >= 2 && this.input.charCodeAt(start) === 48;
  35526. if (octal && this.strict) { this.raise(start, "Invalid number"); }
  35527. var next = this.input.charCodeAt(this.pos);
  35528. if (!octal && !startsWithDot && this.options.ecmaVersion >= 11 && next === 110) {
  35529. var val$1 = stringToBigInt(this.input.slice(start, this.pos));
  35530. ++this.pos;
  35531. if (isIdentifierStart(this.fullCharCodeAtPos())) { this.raise(this.pos, "Identifier directly after number"); }
  35532. return this.finishToken(types.num, val$1)
  35533. }
  35534. if (octal && /[89]/.test(this.input.slice(start, this.pos))) { octal = false; }
  35535. if (next === 46 && !octal) { // '.'
  35536. ++this.pos;
  35537. this.readInt(10);
  35538. next = this.input.charCodeAt(this.pos);
  35539. }
  35540. if ((next === 69 || next === 101) && !octal) { // 'eE'
  35541. next = this.input.charCodeAt(++this.pos);
  35542. if (next === 43 || next === 45) { ++this.pos; } // '+-'
  35543. if (this.readInt(10) === null) { this.raise(start, "Invalid number"); }
  35544. }
  35545. if (isIdentifierStart(this.fullCharCodeAtPos())) { this.raise(this.pos, "Identifier directly after number"); }
  35546. var val = stringToNumber(this.input.slice(start, this.pos), octal);
  35547. return this.finishToken(types.num, val)
  35548. };
  35549. // Read a string value, interpreting backslash-escapes.
  35550. pp$9.readCodePoint = function() {
  35551. var ch = this.input.charCodeAt(this.pos), code;
  35552. if (ch === 123) { // '{'
  35553. if (this.options.ecmaVersion < 6) { this.unexpected(); }
  35554. var codePos = ++this.pos;
  35555. code = this.readHexChar(this.input.indexOf("}", this.pos) - this.pos);
  35556. ++this.pos;
  35557. if (code > 0x10FFFF) { this.invalidStringToken(codePos, "Code point out of bounds"); }
  35558. } else {
  35559. code = this.readHexChar(4);
  35560. }
  35561. return code
  35562. };
  35563. function codePointToString$1(code) {
  35564. // UTF-16 Decoding
  35565. if (code <= 0xFFFF) { return String.fromCharCode(code) }
  35566. code -= 0x10000;
  35567. return String.fromCharCode((code >> 10) + 0xD800, (code & 1023) + 0xDC00)
  35568. }
  35569. pp$9.readString = function(quote) {
  35570. var out = "", chunkStart = ++this.pos;
  35571. for (;;) {
  35572. if (this.pos >= this.input.length) { this.raise(this.start, "Unterminated string constant"); }
  35573. var ch = this.input.charCodeAt(this.pos);
  35574. if (ch === quote) { break }
  35575. if (ch === 92) { // '\'
  35576. out += this.input.slice(chunkStart, this.pos);
  35577. out += this.readEscapedChar(false);
  35578. chunkStart = this.pos;
  35579. } else {
  35580. if (isNewLine(ch, this.options.ecmaVersion >= 10)) { this.raise(this.start, "Unterminated string constant"); }
  35581. ++this.pos;
  35582. }
  35583. }
  35584. out += this.input.slice(chunkStart, this.pos++);
  35585. return this.finishToken(types.string, out)
  35586. };
  35587. // Reads template string tokens.
  35588. var INVALID_TEMPLATE_ESCAPE_ERROR = {};
  35589. pp$9.tryReadTemplateToken = function() {
  35590. this.inTemplateElement = true;
  35591. try {
  35592. this.readTmplToken();
  35593. } catch (err) {
  35594. if (err === INVALID_TEMPLATE_ESCAPE_ERROR) {
  35595. this.readInvalidTemplateToken();
  35596. } else {
  35597. throw err
  35598. }
  35599. }
  35600. this.inTemplateElement = false;
  35601. };
  35602. pp$9.invalidStringToken = function(position, message) {
  35603. if (this.inTemplateElement && this.options.ecmaVersion >= 9) {
  35604. throw INVALID_TEMPLATE_ESCAPE_ERROR
  35605. } else {
  35606. this.raise(position, message);
  35607. }
  35608. };
  35609. pp$9.readTmplToken = function() {
  35610. var out = "", chunkStart = this.pos;
  35611. for (;;) {
  35612. if (this.pos >= this.input.length) { this.raise(this.start, "Unterminated template"); }
  35613. var ch = this.input.charCodeAt(this.pos);
  35614. if (ch === 96 || ch === 36 && this.input.charCodeAt(this.pos + 1) === 123) { // '`', '${'
  35615. if (this.pos === this.start && (this.type === types.template || this.type === types.invalidTemplate)) {
  35616. if (ch === 36) {
  35617. this.pos += 2;
  35618. return this.finishToken(types.dollarBraceL)
  35619. } else {
  35620. ++this.pos;
  35621. return this.finishToken(types.backQuote)
  35622. }
  35623. }
  35624. out += this.input.slice(chunkStart, this.pos);
  35625. return this.finishToken(types.template, out)
  35626. }
  35627. if (ch === 92) { // '\'
  35628. out += this.input.slice(chunkStart, this.pos);
  35629. out += this.readEscapedChar(true);
  35630. chunkStart = this.pos;
  35631. } else if (isNewLine(ch)) {
  35632. out += this.input.slice(chunkStart, this.pos);
  35633. ++this.pos;
  35634. switch (ch) {
  35635. case 13:
  35636. if (this.input.charCodeAt(this.pos) === 10) { ++this.pos; }
  35637. case 10:
  35638. out += "\n";
  35639. break
  35640. default:
  35641. out += String.fromCharCode(ch);
  35642. break
  35643. }
  35644. if (this.options.locations) {
  35645. ++this.curLine;
  35646. this.lineStart = this.pos;
  35647. }
  35648. chunkStart = this.pos;
  35649. } else {
  35650. ++this.pos;
  35651. }
  35652. }
  35653. };
  35654. // Reads a template token to search for the end, without validating any escape sequences
  35655. pp$9.readInvalidTemplateToken = function() {
  35656. for (; this.pos < this.input.length; this.pos++) {
  35657. switch (this.input[this.pos]) {
  35658. case "\\":
  35659. ++this.pos;
  35660. break
  35661. case "$":
  35662. if (this.input[this.pos + 1] !== "{") {
  35663. break
  35664. }
  35665. // falls through
  35666. case "`":
  35667. return this.finishToken(types.invalidTemplate, this.input.slice(this.start, this.pos))
  35668. // no default
  35669. }
  35670. }
  35671. this.raise(this.start, "Unterminated template");
  35672. };
  35673. // Used to read escaped characters
  35674. pp$9.readEscapedChar = function(inTemplate) {
  35675. var ch = this.input.charCodeAt(++this.pos);
  35676. ++this.pos;
  35677. switch (ch) {
  35678. case 110: return "\n" // 'n' -> '\n'
  35679. case 114: return "\r" // 'r' -> '\r'
  35680. case 120: return String.fromCharCode(this.readHexChar(2)) // 'x'
  35681. case 117: return codePointToString$1(this.readCodePoint()) // 'u'
  35682. case 116: return "\t" // 't' -> '\t'
  35683. case 98: return "\b" // 'b' -> '\b'
  35684. case 118: return "\u000b" // 'v' -> '\u000b'
  35685. case 102: return "\f" // 'f' -> '\f'
  35686. case 13: if (this.input.charCodeAt(this.pos) === 10) { ++this.pos; } // '\r\n'
  35687. case 10: // ' \n'
  35688. if (this.options.locations) { this.lineStart = this.pos; ++this.curLine; }
  35689. return ""
  35690. case 56:
  35691. case 57:
  35692. if (this.strict) {
  35693. this.invalidStringToken(
  35694. this.pos - 1,
  35695. "Invalid escape sequence"
  35696. );
  35697. }
  35698. if (inTemplate) {
  35699. var codePos = this.pos - 1;
  35700. this.invalidStringToken(
  35701. codePos,
  35702. "Invalid escape sequence in template string"
  35703. );
  35704. return null
  35705. }
  35706. default:
  35707. if (ch >= 48 && ch <= 55) {
  35708. var octalStr = this.input.substr(this.pos - 1, 3).match(/^[0-7]+/)[0];
  35709. var octal = parseInt(octalStr, 8);
  35710. if (octal > 255) {
  35711. octalStr = octalStr.slice(0, -1);
  35712. octal = parseInt(octalStr, 8);
  35713. }
  35714. this.pos += octalStr.length - 1;
  35715. ch = this.input.charCodeAt(this.pos);
  35716. if ((octalStr !== "0" || ch === 56 || ch === 57) && (this.strict || inTemplate)) {
  35717. this.invalidStringToken(
  35718. this.pos - 1 - octalStr.length,
  35719. inTemplate
  35720. ? "Octal literal in template string"
  35721. : "Octal literal in strict mode"
  35722. );
  35723. }
  35724. return String.fromCharCode(octal)
  35725. }
  35726. if (isNewLine(ch)) {
  35727. // Unicode new line characters after \ get removed from output in both
  35728. // template literals and strings
  35729. return ""
  35730. }
  35731. return String.fromCharCode(ch)
  35732. }
  35733. };
  35734. // Used to read character escape sequences ('\x', '\u', '\U').
  35735. pp$9.readHexChar = function(len) {
  35736. var codePos = this.pos;
  35737. var n = this.readInt(16, len);
  35738. if (n === null) { this.invalidStringToken(codePos, "Bad character escape sequence"); }
  35739. return n
  35740. };
  35741. // Read an identifier, and return it as a string. Sets `this.containsEsc`
  35742. // to whether the word contained a '\u' escape.
  35743. //
  35744. // Incrementally adds only escaped chars, adding other chunks as-is
  35745. // as a micro-optimization.
  35746. pp$9.readWord1 = function() {
  35747. this.containsEsc = false;
  35748. var word = "", first = true, chunkStart = this.pos;
  35749. var astral = this.options.ecmaVersion >= 6;
  35750. while (this.pos < this.input.length) {
  35751. var ch = this.fullCharCodeAtPos();
  35752. if (isIdentifierChar(ch, astral)) {
  35753. this.pos += ch <= 0xffff ? 1 : 2;
  35754. } else if (ch === 92) { // "\"
  35755. this.containsEsc = true;
  35756. word += this.input.slice(chunkStart, this.pos);
  35757. var escStart = this.pos;
  35758. if (this.input.charCodeAt(++this.pos) !== 117) // "u"
  35759. { this.invalidStringToken(this.pos, "Expecting Unicode escape sequence \\uXXXX"); }
  35760. ++this.pos;
  35761. var esc = this.readCodePoint();
  35762. if (!(first ? isIdentifierStart : isIdentifierChar)(esc, astral))
  35763. { this.invalidStringToken(escStart, "Invalid Unicode escape"); }
  35764. word += codePointToString$1(esc);
  35765. chunkStart = this.pos;
  35766. } else {
  35767. break
  35768. }
  35769. first = false;
  35770. }
  35771. return word + this.input.slice(chunkStart, this.pos)
  35772. };
  35773. // Read an identifier or keyword token. Will check for reserved
  35774. // words when necessary.
  35775. pp$9.readWord = function() {
  35776. var word = this.readWord1();
  35777. var type = types.name;
  35778. if (this.keywords.test(word)) {
  35779. type = keywords$1[word];
  35780. }
  35781. return this.finishToken(type, word)
  35782. };
  35783. // Acorn is a tiny, fast JavaScript parser written in JavaScript.
  35784. var version$2 = "8.0.5";
  35785. Parser.acorn = {
  35786. Parser: Parser,
  35787. version: version$2,
  35788. defaultOptions: defaultOptions,
  35789. Position: Position,
  35790. SourceLocation: SourceLocation,
  35791. getLineInfo: getLineInfo,
  35792. Node: Node,
  35793. TokenType: TokenType,
  35794. tokTypes: types,
  35795. keywordTypes: keywords$1,
  35796. TokContext: TokContext,
  35797. tokContexts: types$1,
  35798. isIdentifierChar: isIdentifierChar,
  35799. isIdentifierStart: isIdentifierStart,
  35800. Token: Token,
  35801. isNewLine: isNewLine,
  35802. lineBreak: lineBreak,
  35803. lineBreakG: lineBreakG,
  35804. nonASCIIwhitespace: nonASCIIwhitespace
  35805. };
  35806. // The main exported interface (under `self.acorn` when in the
  35807. // browser) is a `parse` function that takes a code string and
  35808. // returns an abstract syntax tree as specified by [Mozilla parser
  35809. // API][api].
  35810. //
  35811. // [api]: https://developer.mozilla.org/en-US/docs/SpiderMonkey/Parser_API
  35812. function parse$2(input, options) {
  35813. return Parser.parse(input, options)
  35814. }
  35815. // This function tries to parse a single expression at a given
  35816. // offset in a string. Useful for parsing mixed-language formats
  35817. // that embed JavaScript expressions.
  35818. function parseExpressionAt(input, pos, options) {
  35819. return Parser.parseExpressionAt(input, pos, options)
  35820. }
  35821. // Acorn is organized as a tokenizer and a recursive-descent parser.
  35822. // The `tokenizer` export provides an interface to the tokenizer.
  35823. function tokenizer(input, options) {
  35824. return Parser.tokenizer(input, options)
  35825. }
  35826. var acorn = {
  35827. __proto__: null,
  35828. Node: Node,
  35829. Parser: Parser,
  35830. Position: Position,
  35831. SourceLocation: SourceLocation,
  35832. TokContext: TokContext,
  35833. Token: Token,
  35834. TokenType: TokenType,
  35835. defaultOptions: defaultOptions,
  35836. getLineInfo: getLineInfo,
  35837. isIdentifierChar: isIdentifierChar,
  35838. isIdentifierStart: isIdentifierStart,
  35839. isNewLine: isNewLine,
  35840. keywordTypes: keywords$1,
  35841. lineBreak: lineBreak,
  35842. lineBreakG: lineBreakG,
  35843. nonASCIIwhitespace: nonASCIIwhitespace,
  35844. parse: parse$2,
  35845. parseExpressionAt: parseExpressionAt,
  35846. tokContexts: types$1,
  35847. tokTypes: types,
  35848. tokenizer: tokenizer,
  35849. version: version$2
  35850. };
  35851. class GlobalScope extends Scope$1$1 {
  35852. constructor() {
  35853. super();
  35854. this.variables.set('undefined', new UndefinedVariable());
  35855. }
  35856. findVariable(name) {
  35857. let variable = this.variables.get(name);
  35858. if (!variable) {
  35859. variable = new GlobalVariable(name);
  35860. this.variables.set(name, variable);
  35861. }
  35862. return variable;
  35863. }
  35864. }
  35865. const readFile$1 = (file) => new Promise((fulfil, reject) => readFile$2(file, 'utf-8', (err, contents) => (err ? reject(err) : fulfil(contents))));
  35866. function mkdirpath(path) {
  35867. const dir = dirname(path);
  35868. try {
  35869. readdirSync(dir);
  35870. }
  35871. catch (err) {
  35872. mkdirpath(dir);
  35873. try {
  35874. mkdirSync(dir);
  35875. }
  35876. catch (err2) {
  35877. if (err2.code !== 'EEXIST') {
  35878. throw err2;
  35879. }
  35880. }
  35881. }
  35882. }
  35883. function writeFile(dest, data) {
  35884. return new Promise((fulfil, reject) => {
  35885. mkdirpath(dest);
  35886. writeFile$1(dest, data, err => {
  35887. if (err) {
  35888. reject(err);
  35889. }
  35890. else {
  35891. fulfil();
  35892. }
  35893. });
  35894. });
  35895. }
  35896. function resolveIdViaPlugins(source, importer, pluginDriver, moduleLoaderResolveId, skip, customOptions) {
  35897. let skipped = null;
  35898. let replaceContext = null;
  35899. if (skip) {
  35900. skipped = new Set();
  35901. for (const skippedCall of skip) {
  35902. if (source === skippedCall.source && importer === skippedCall.importer) {
  35903. skipped.add(skippedCall.plugin);
  35904. }
  35905. }
  35906. replaceContext = (pluginContext, plugin) => ({
  35907. ...pluginContext,
  35908. resolve: (source, importer, { custom, skipSelf } = BLANK) => {
  35909. return moduleLoaderResolveId(source, importer, custom, skipSelf ? [...skip, { importer, plugin, source }] : skip);
  35910. }
  35911. });
  35912. }
  35913. return pluginDriver.hookFirst('resolveId', [source, importer, { custom: customOptions }], replaceContext, skipped);
  35914. }
  35915. async function resolveId$1(source, importer, preserveSymlinks, pluginDriver, moduleLoaderResolveId, skip, customOptions) {
  35916. const pluginResult = await resolveIdViaPlugins(source, importer, pluginDriver, moduleLoaderResolveId, skip, customOptions);
  35917. if (pluginResult != null)
  35918. return pluginResult;
  35919. // external modules (non-entry modules that start with neither '.' or '/')
  35920. // are skipped at this stage.
  35921. if (importer !== undefined && !isAbsolute(source) && source[0] !== '.')
  35922. return null;
  35923. // `resolve` processes paths from right to left, prepending them until an
  35924. // absolute path is created. Absolute importees therefore shortcircuit the
  35925. // resolve call and require no special handing on our part.
  35926. // See https://nodejs.org/api/path.html#path_path_resolve_paths
  35927. return addJsExtensionIfNecessary(importer ? resolve$1(dirname(importer), source) : resolve$1(source), preserveSymlinks);
  35928. }
  35929. function addJsExtensionIfNecessary(file, preserveSymlinks) {
  35930. let found = findFile(file, preserveSymlinks);
  35931. if (found)
  35932. return found;
  35933. found = findFile(file + '.mjs', preserveSymlinks);
  35934. if (found)
  35935. return found;
  35936. found = findFile(file + '.js', preserveSymlinks);
  35937. return found;
  35938. }
  35939. function findFile(file, preserveSymlinks) {
  35940. try {
  35941. const stats = lstatSync(file);
  35942. if (!preserveSymlinks && stats.isSymbolicLink())
  35943. return findFile(realpathSync$2(file), preserveSymlinks);
  35944. if ((preserveSymlinks && stats.isSymbolicLink()) || stats.isFile()) {
  35945. // check case
  35946. const name = basename(file);
  35947. const files = readdirSync(dirname(file));
  35948. if (files.indexOf(name) !== -1)
  35949. return file;
  35950. }
  35951. }
  35952. catch (_a) {
  35953. // suppress
  35954. }
  35955. }
  35956. const ANONYMOUS_PLUGIN_PREFIX = 'at position ';
  35957. const ANONYMOUS_OUTPUT_PLUGIN_PREFIX = 'at output position ';
  35958. function throwPluginError(err, plugin, { hook, id } = {}) {
  35959. if (typeof err === 'string')
  35960. err = { message: err };
  35961. if (err.code && err.code !== Errors.PLUGIN_ERROR) {
  35962. err.pluginCode = err.code;
  35963. }
  35964. err.code = Errors.PLUGIN_ERROR;
  35965. err.plugin = plugin;
  35966. if (hook) {
  35967. err.hook = hook;
  35968. }
  35969. if (id) {
  35970. err.id = id;
  35971. }
  35972. return error(err);
  35973. }
  35974. const deprecatedHooks = [
  35975. { active: true, deprecated: 'resolveAssetUrl', replacement: 'resolveFileUrl' }
  35976. ];
  35977. function warnDeprecatedHooks(plugins, options) {
  35978. for (const { active, deprecated, replacement } of deprecatedHooks) {
  35979. for (const plugin of plugins) {
  35980. if (deprecated in plugin) {
  35981. warnDeprecation({
  35982. message: `The "${deprecated}" hook used by plugin ${plugin.name} is deprecated. The "${replacement}" hook should be used instead.`,
  35983. plugin: plugin.name
  35984. }, active, options);
  35985. }
  35986. }
  35987. }
  35988. }
  35989. function createPluginCache(cache) {
  35990. return {
  35991. has(id) {
  35992. const item = cache[id];
  35993. if (!item)
  35994. return false;
  35995. item[0] = 0;
  35996. return true;
  35997. },
  35998. get(id) {
  35999. const item = cache[id];
  36000. if (!item)
  36001. return undefined;
  36002. item[0] = 0;
  36003. return item[1];
  36004. },
  36005. set(id, value) {
  36006. cache[id] = [0, value];
  36007. },
  36008. delete(id) {
  36009. return delete cache[id];
  36010. }
  36011. };
  36012. }
  36013. function getTrackedPluginCache(pluginCache, onUse) {
  36014. return {
  36015. has(id) {
  36016. onUse();
  36017. return pluginCache.has(id);
  36018. },
  36019. get(id) {
  36020. onUse();
  36021. return pluginCache.get(id);
  36022. },
  36023. set(id, value) {
  36024. onUse();
  36025. return pluginCache.set(id, value);
  36026. },
  36027. delete(id) {
  36028. onUse();
  36029. return pluginCache.delete(id);
  36030. }
  36031. };
  36032. }
  36033. const NO_CACHE = {
  36034. has() {
  36035. return false;
  36036. },
  36037. get() {
  36038. return undefined;
  36039. },
  36040. set() { },
  36041. delete() {
  36042. return false;
  36043. }
  36044. };
  36045. function uncacheablePluginError(pluginName) {
  36046. if (pluginName.startsWith(ANONYMOUS_PLUGIN_PREFIX) ||
  36047. pluginName.startsWith(ANONYMOUS_OUTPUT_PLUGIN_PREFIX)) {
  36048. return error({
  36049. code: 'ANONYMOUS_PLUGIN_CACHE',
  36050. message: 'A plugin is trying to use the Rollup cache but is not declaring a plugin name or cacheKey.'
  36051. });
  36052. }
  36053. return error({
  36054. code: 'DUPLICATE_PLUGIN_NAME',
  36055. message: `The plugin name ${pluginName} is being used twice in the same build. Plugin names must be distinct or provide a cacheKey (please post an issue to the plugin if you are a plugin user).`
  36056. });
  36057. }
  36058. function getCacheForUncacheablePlugin(pluginName) {
  36059. return {
  36060. has() {
  36061. return uncacheablePluginError(pluginName);
  36062. },
  36063. get() {
  36064. return uncacheablePluginError(pluginName);
  36065. },
  36066. set() {
  36067. return uncacheablePluginError(pluginName);
  36068. },
  36069. delete() {
  36070. return uncacheablePluginError(pluginName);
  36071. }
  36072. };
  36073. }
  36074. function transform(source, module, pluginDriver, warn) {
  36075. const id = module.id;
  36076. const sourcemapChain = [];
  36077. let originalSourcemap = source.map === null ? null : decodedSourcemap(source.map);
  36078. const originalCode = source.code;
  36079. let ast = source.ast;
  36080. const transformDependencies = [];
  36081. const emittedFiles = [];
  36082. let customTransformCache = false;
  36083. const useCustomTransformCache = () => (customTransformCache = true);
  36084. let curPlugin;
  36085. const curSource = source.code;
  36086. function transformReducer(previousCode, result, plugin) {
  36087. let code;
  36088. let map;
  36089. if (typeof result === 'string') {
  36090. code = result;
  36091. }
  36092. else if (result && typeof result === 'object') {
  36093. module.updateOptions(result);
  36094. if (result.code == null) {
  36095. if (result.map || result.ast) {
  36096. warn(errNoTransformMapOrAstWithoutCode(plugin.name));
  36097. }
  36098. return previousCode;
  36099. }
  36100. ({ code, map, ast } = result);
  36101. }
  36102. else {
  36103. return previousCode;
  36104. }
  36105. // strict null check allows 'null' maps to not be pushed to the chain,
  36106. // while 'undefined' gets the missing map warning
  36107. if (map !== null) {
  36108. sourcemapChain.push(decodedSourcemap(typeof map === 'string' ? JSON.parse(map) : map) || {
  36109. missing: true,
  36110. plugin: plugin.name
  36111. });
  36112. }
  36113. return code;
  36114. }
  36115. return pluginDriver
  36116. .hookReduceArg0('transform', [curSource, id], transformReducer, (pluginContext, plugin) => {
  36117. curPlugin = plugin;
  36118. return {
  36119. ...pluginContext,
  36120. cache: customTransformCache
  36121. ? pluginContext.cache
  36122. : getTrackedPluginCache(pluginContext.cache, useCustomTransformCache),
  36123. warn(warning, pos) {
  36124. if (typeof warning === 'string')
  36125. warning = { message: warning };
  36126. if (pos)
  36127. augmentCodeLocation(warning, pos, curSource, id);
  36128. warning.id = id;
  36129. warning.hook = 'transform';
  36130. pluginContext.warn(warning);
  36131. },
  36132. error(err, pos) {
  36133. if (typeof err === 'string')
  36134. err = { message: err };
  36135. if (pos)
  36136. augmentCodeLocation(err, pos, curSource, id);
  36137. err.id = id;
  36138. err.hook = 'transform';
  36139. return pluginContext.error(err);
  36140. },
  36141. emitAsset(name, source) {
  36142. emittedFiles.push({ type: 'asset', name, source });
  36143. return pluginContext.emitAsset(name, source);
  36144. },
  36145. emitChunk(id, options) {
  36146. emittedFiles.push({ type: 'chunk', id, name: options && options.name });
  36147. return pluginContext.emitChunk(id, options);
  36148. },
  36149. emitFile(emittedFile) {
  36150. emittedFiles.push(emittedFile);
  36151. return pluginDriver.emitFile(emittedFile);
  36152. },
  36153. addWatchFile(id) {
  36154. transformDependencies.push(id);
  36155. pluginContext.addWatchFile(id);
  36156. },
  36157. setAssetSource() {
  36158. return this.error({
  36159. code: 'INVALID_SETASSETSOURCE',
  36160. message: `setAssetSource cannot be called in transform for caching reasons. Use emitFile with a source, or call setAssetSource in another hook.`
  36161. });
  36162. },
  36163. getCombinedSourcemap() {
  36164. const combinedMap = collapseSourcemap(id, originalCode, originalSourcemap, sourcemapChain, warn);
  36165. if (!combinedMap) {
  36166. const magicString = new MagicString$1(originalCode);
  36167. return magicString.generateMap({ includeContent: true, hires: true, source: id });
  36168. }
  36169. if (originalSourcemap !== combinedMap) {
  36170. originalSourcemap = combinedMap;
  36171. sourcemapChain.length = 0;
  36172. }
  36173. return new SourceMap$1({
  36174. ...combinedMap,
  36175. file: null,
  36176. sourcesContent: combinedMap.sourcesContent
  36177. });
  36178. }
  36179. };
  36180. })
  36181. .catch(err => throwPluginError(err, curPlugin.name, { hook: 'transform', id }))
  36182. .then(code => {
  36183. if (!customTransformCache) {
  36184. // files emitted by a transform hook need to be emitted again if the hook is skipped
  36185. if (emittedFiles.length)
  36186. module.transformFiles = emittedFiles;
  36187. }
  36188. return {
  36189. ast,
  36190. code,
  36191. customTransformCache,
  36192. meta: module.info.meta,
  36193. originalCode,
  36194. originalSourcemap,
  36195. sourcemapChain,
  36196. transformDependencies
  36197. };
  36198. });
  36199. }
  36200. class ModuleLoader {
  36201. constructor(graph, modulesById, options, pluginDriver) {
  36202. this.graph = graph;
  36203. this.modulesById = modulesById;
  36204. this.options = options;
  36205. this.pluginDriver = pluginDriver;
  36206. this.implicitEntryModules = new Set();
  36207. this.indexedEntryModules = [];
  36208. this.latestLoadModulesPromise = Promise.resolve();
  36209. this.nextEntryModuleIndex = 0;
  36210. this.resolveId = async (source, importer, customOptions, skip = null) => {
  36211. return this.addDefaultsToResolvedId(this.getNormalizedResolvedIdWithoutDefaults(this.options.external(source, importer, false)
  36212. ? false
  36213. : await resolveId$1(source, importer, this.options.preserveSymlinks, this.pluginDriver, this.resolveId, skip, customOptions), importer, source));
  36214. };
  36215. this.hasModuleSideEffects = options.treeshake
  36216. ? options.treeshake.moduleSideEffects
  36217. : () => true;
  36218. }
  36219. async addAdditionalModules(unresolvedModules) {
  36220. const result = this.extendLoadModulesPromise(Promise.all(unresolvedModules.map(id => this.loadEntryModule(id, false, undefined, null))));
  36221. await this.awaitLoadModulesPromise();
  36222. return result;
  36223. }
  36224. async addEntryModules(unresolvedEntryModules, isUserDefined) {
  36225. const firstEntryModuleIndex = this.nextEntryModuleIndex;
  36226. this.nextEntryModuleIndex += unresolvedEntryModules.length;
  36227. const newEntryModules = await this.extendLoadModulesPromise(Promise.all(unresolvedEntryModules.map(({ id, importer }) => this.loadEntryModule(id, true, importer, null))).then(entryModules => {
  36228. let moduleIndex = firstEntryModuleIndex;
  36229. for (let index = 0; index < entryModules.length; index++) {
  36230. const entryModule = entryModules[index];
  36231. entryModule.isUserDefinedEntryPoint =
  36232. entryModule.isUserDefinedEntryPoint || isUserDefined;
  36233. addChunkNamesToModule(entryModule, unresolvedEntryModules[index], isUserDefined);
  36234. const existingIndexedModule = this.indexedEntryModules.find(indexedModule => indexedModule.module === entryModule);
  36235. if (!existingIndexedModule) {
  36236. this.indexedEntryModules.push({ module: entryModule, index: moduleIndex });
  36237. }
  36238. else {
  36239. existingIndexedModule.index = Math.min(existingIndexedModule.index, moduleIndex);
  36240. }
  36241. moduleIndex++;
  36242. }
  36243. this.indexedEntryModules.sort(({ index: indexA }, { index: indexB }) => indexA > indexB ? 1 : -1);
  36244. return entryModules;
  36245. }));
  36246. await this.awaitLoadModulesPromise();
  36247. return {
  36248. entryModules: this.indexedEntryModules.map(({ module }) => module),
  36249. implicitEntryModules: [...this.implicitEntryModules],
  36250. newEntryModules
  36251. };
  36252. }
  36253. async emitChunk({ fileName, id, importer, name, implicitlyLoadedAfterOneOf, preserveSignature }) {
  36254. const unresolvedModule = {
  36255. fileName: fileName || null,
  36256. id,
  36257. importer,
  36258. name: name || null
  36259. };
  36260. const module = implicitlyLoadedAfterOneOf
  36261. ? await this.addEntryWithImplicitDependants(unresolvedModule, implicitlyLoadedAfterOneOf)
  36262. : (await this.addEntryModules([unresolvedModule], false)).newEntryModules[0];
  36263. if (preserveSignature != null) {
  36264. module.preserveSignature = preserveSignature;
  36265. }
  36266. return module;
  36267. }
  36268. addDefaultsToResolvedId(resolvedId) {
  36269. var _a, _b;
  36270. if (!resolvedId) {
  36271. return null;
  36272. }
  36273. const external = resolvedId.external || false;
  36274. return {
  36275. external,
  36276. id: resolvedId.id,
  36277. meta: resolvedId.meta || EMPTY_OBJECT,
  36278. moduleSideEffects: (_a = resolvedId.moduleSideEffects) !== null && _a !== void 0 ? _a : this.hasModuleSideEffects(resolvedId.id, external),
  36279. syntheticNamedExports: (_b = resolvedId.syntheticNamedExports) !== null && _b !== void 0 ? _b : false
  36280. };
  36281. }
  36282. addEntryWithImplicitDependants(unresolvedModule, implicitlyLoadedAfter) {
  36283. return this.extendLoadModulesPromise(this.loadEntryModule(unresolvedModule.id, false, unresolvedModule.importer, null).then(async (entryModule) => {
  36284. addChunkNamesToModule(entryModule, unresolvedModule, false);
  36285. if (!entryModule.info.isEntry) {
  36286. this.implicitEntryModules.add(entryModule);
  36287. const implicitlyLoadedAfterModules = await Promise.all(implicitlyLoadedAfter.map(id => this.loadEntryModule(id, false, unresolvedModule.importer, entryModule.id)));
  36288. for (const module of implicitlyLoadedAfterModules) {
  36289. entryModule.implicitlyLoadedAfter.add(module);
  36290. }
  36291. for (const dependant of entryModule.implicitlyLoadedAfter) {
  36292. dependant.implicitlyLoadedBefore.add(entryModule);
  36293. }
  36294. }
  36295. return entryModule;
  36296. }));
  36297. }
  36298. async addModuleSource(id, importer, module) {
  36299. var _a;
  36300. timeStart('load modules', 3);
  36301. let source;
  36302. try {
  36303. source = (_a = (await this.pluginDriver.hookFirst('load', [id]))) !== null && _a !== void 0 ? _a : (await readFile$1(id));
  36304. }
  36305. catch (err) {
  36306. timeEnd('load modules', 3);
  36307. let msg = `Could not load ${id}`;
  36308. if (importer)
  36309. msg += ` (imported by ${relativeId(importer)})`;
  36310. msg += `: ${err.message}`;
  36311. err.message = msg;
  36312. throw err;
  36313. }
  36314. timeEnd('load modules', 3);
  36315. const sourceDescription = typeof source === 'string'
  36316. ? { code: source }
  36317. : typeof source === 'object' && typeof source.code === 'string'
  36318. ? source
  36319. : error(errBadLoader(id));
  36320. const cachedModule = this.graph.cachedModules.get(id);
  36321. if (cachedModule &&
  36322. !cachedModule.customTransformCache &&
  36323. cachedModule.originalCode === sourceDescription.code) {
  36324. if (cachedModule.transformFiles) {
  36325. for (const emittedFile of cachedModule.transformFiles)
  36326. this.pluginDriver.emitFile(emittedFile);
  36327. }
  36328. module.setSource(cachedModule);
  36329. }
  36330. else {
  36331. module.updateOptions(sourceDescription);
  36332. module.setSource(await transform(sourceDescription, module, this.pluginDriver, this.options.onwarn));
  36333. }
  36334. }
  36335. async awaitLoadModulesPromise() {
  36336. let startingPromise;
  36337. do {
  36338. startingPromise = this.latestLoadModulesPromise;
  36339. await startingPromise;
  36340. } while (startingPromise !== this.latestLoadModulesPromise);
  36341. }
  36342. extendLoadModulesPromise(loadNewModulesPromise) {
  36343. this.latestLoadModulesPromise = Promise.all([
  36344. loadNewModulesPromise,
  36345. this.latestLoadModulesPromise
  36346. ]);
  36347. this.latestLoadModulesPromise.catch(() => {
  36348. /* Avoid unhandled Promise rejections */
  36349. });
  36350. return loadNewModulesPromise;
  36351. }
  36352. async fetchDynamicDependencies(module) {
  36353. const dependencies = await Promise.all(module.dynamicImports.map(async (dynamicImport) => {
  36354. const resolvedId = await this.resolveDynamicImport(module, typeof dynamicImport.argument === 'string'
  36355. ? dynamicImport.argument
  36356. : dynamicImport.argument.esTreeNode, module.id);
  36357. if (resolvedId === null)
  36358. return null;
  36359. if (typeof resolvedId === 'string') {
  36360. dynamicImport.resolution = resolvedId;
  36361. return null;
  36362. }
  36363. return (dynamicImport.resolution = await this.fetchResolvedDependency(relativeId(resolvedId.id), module.id, resolvedId));
  36364. }));
  36365. for (const dependency of dependencies) {
  36366. if (dependency) {
  36367. module.dynamicDependencies.add(dependency);
  36368. dependency.dynamicImporters.push(module.id);
  36369. }
  36370. }
  36371. }
  36372. async fetchModule({ id, meta, moduleSideEffects, syntheticNamedExports }, importer, isEntry) {
  36373. const existingModule = this.modulesById.get(id);
  36374. if (existingModule instanceof Module$1) {
  36375. if (isEntry) {
  36376. existingModule.info.isEntry = true;
  36377. this.implicitEntryModules.delete(existingModule);
  36378. for (const dependant of existingModule.implicitlyLoadedAfter) {
  36379. dependant.implicitlyLoadedBefore.delete(existingModule);
  36380. }
  36381. existingModule.implicitlyLoadedAfter.clear();
  36382. }
  36383. return existingModule;
  36384. }
  36385. const module = new Module$1(this.graph, id, this.options, isEntry, moduleSideEffects, syntheticNamedExports, meta);
  36386. this.modulesById.set(id, module);
  36387. this.graph.watchFiles[id] = true;
  36388. await this.addModuleSource(id, importer, module);
  36389. await this.pluginDriver.hookParallel('moduleParsed', [module.info]);
  36390. await Promise.all([
  36391. this.fetchStaticDependencies(module),
  36392. this.fetchDynamicDependencies(module)
  36393. ]);
  36394. module.linkImports();
  36395. return module;
  36396. }
  36397. fetchResolvedDependency(source, importer, resolvedId) {
  36398. if (resolvedId.external) {
  36399. if (!this.modulesById.has(resolvedId.id)) {
  36400. this.modulesById.set(resolvedId.id, new ExternalModule(this.options, resolvedId.id, resolvedId.moduleSideEffects, resolvedId.meta));
  36401. }
  36402. const externalModule = this.modulesById.get(resolvedId.id);
  36403. if (!(externalModule instanceof ExternalModule)) {
  36404. return error(errInternalIdCannotBeExternal(source, importer));
  36405. }
  36406. return Promise.resolve(externalModule);
  36407. }
  36408. else {
  36409. return this.fetchModule(resolvedId, importer, false);
  36410. }
  36411. }
  36412. async fetchStaticDependencies(module) {
  36413. for (const dependency of await Promise.all(Array.from(module.sources, async (source) => this.fetchResolvedDependency(source, module.id, (module.resolvedIds[source] =
  36414. module.resolvedIds[source] ||
  36415. this.handleResolveId(await this.resolveId(source, module.id, EMPTY_OBJECT), source, module.id)))))) {
  36416. module.dependencies.add(dependency);
  36417. dependency.importers.push(module.id);
  36418. }
  36419. }
  36420. getNormalizedResolvedIdWithoutDefaults(resolveIdResult, importer, source) {
  36421. if (resolveIdResult) {
  36422. if (typeof resolveIdResult === 'object') {
  36423. return {
  36424. ...resolveIdResult,
  36425. external: resolveIdResult.external || this.options.external(resolveIdResult.id, importer, true)
  36426. };
  36427. }
  36428. const external = this.options.external(resolveIdResult, importer, true);
  36429. return {
  36430. external,
  36431. id: external ? normalizeRelativeExternalId(resolveIdResult, importer) : resolveIdResult
  36432. };
  36433. }
  36434. const id = normalizeRelativeExternalId(source, importer);
  36435. if (resolveIdResult !== false && !this.options.external(id, importer, true)) {
  36436. return null;
  36437. }
  36438. return {
  36439. external: true,
  36440. id
  36441. };
  36442. }
  36443. handleResolveId(resolvedId, source, importer) {
  36444. if (resolvedId === null) {
  36445. if (isRelative(source)) {
  36446. return error(errUnresolvedImport(source, importer));
  36447. }
  36448. this.options.onwarn(errUnresolvedImportTreatedAsExternal(source, importer));
  36449. return {
  36450. external: true,
  36451. id: source,
  36452. meta: EMPTY_OBJECT,
  36453. moduleSideEffects: this.hasModuleSideEffects(source, true),
  36454. syntheticNamedExports: false
  36455. };
  36456. }
  36457. else {
  36458. if (resolvedId.external && resolvedId.syntheticNamedExports) {
  36459. this.options.onwarn(errExternalSyntheticExports(source, importer));
  36460. }
  36461. }
  36462. return resolvedId;
  36463. }
  36464. async loadEntryModule(unresolvedId, isEntry, importer, implicitlyLoadedBefore) {
  36465. const resolveIdResult = await resolveId$1(unresolvedId, importer, this.options.preserveSymlinks, this.pluginDriver, this.resolveId, null, EMPTY_OBJECT);
  36466. if (resolveIdResult == null) {
  36467. return error(implicitlyLoadedBefore === null
  36468. ? errUnresolvedEntry(unresolvedId)
  36469. : errUnresolvedImplicitDependant(unresolvedId, implicitlyLoadedBefore));
  36470. }
  36471. if (resolveIdResult === false ||
  36472. (typeof resolveIdResult === 'object' && resolveIdResult.external)) {
  36473. return error(implicitlyLoadedBefore === null
  36474. ? errEntryCannotBeExternal(unresolvedId)
  36475. : errImplicitDependantCannotBeExternal(unresolvedId, implicitlyLoadedBefore));
  36476. }
  36477. return this.fetchModule(this.addDefaultsToResolvedId(typeof resolveIdResult === 'object' ? resolveIdResult : { id: resolveIdResult }), undefined, isEntry);
  36478. }
  36479. async resolveDynamicImport(module, specifier, importer) {
  36480. const resolution = await this.pluginDriver.hookFirst('resolveDynamicImport', [
  36481. specifier,
  36482. importer
  36483. ]);
  36484. if (typeof specifier !== 'string') {
  36485. if (typeof resolution === 'string') {
  36486. return resolution;
  36487. }
  36488. if (!resolution) {
  36489. return null;
  36490. }
  36491. return {
  36492. external: false,
  36493. moduleSideEffects: true,
  36494. ...resolution
  36495. };
  36496. }
  36497. if (resolution == null) {
  36498. return (module.resolvedIds[specifier] =
  36499. module.resolvedIds[specifier] ||
  36500. this.handleResolveId(await this.resolveId(specifier, module.id, EMPTY_OBJECT), specifier, module.id));
  36501. }
  36502. return this.handleResolveId(this.addDefaultsToResolvedId(this.getNormalizedResolvedIdWithoutDefaults(resolution, importer, specifier)), specifier, importer);
  36503. }
  36504. }
  36505. function normalizeRelativeExternalId(source, importer) {
  36506. return isRelative(source)
  36507. ? importer
  36508. ? resolve$1(importer, '..', source)
  36509. : resolve$1(source)
  36510. : source;
  36511. }
  36512. function addChunkNamesToModule(module, { fileName, name }, isUserDefined) {
  36513. if (fileName !== null) {
  36514. module.chunkFileNames.add(fileName);
  36515. }
  36516. else if (name !== null) {
  36517. if (module.chunkName === null) {
  36518. module.chunkName = name;
  36519. }
  36520. if (isUserDefined) {
  36521. module.userChunkNames.add(name);
  36522. }
  36523. }
  36524. }
  36525. function getDeprecatedContextHandler(handler, handlerName, newHandlerName, pluginName, activeDeprecation, options) {
  36526. let deprecationWarningShown = false;
  36527. return ((...args) => {
  36528. if (!deprecationWarningShown) {
  36529. deprecationWarningShown = true;
  36530. warnDeprecation({
  36531. message: `The "this.${handlerName}" plugin context function used by plugin ${pluginName} is deprecated. The "this.${newHandlerName}" plugin context function should be used instead.`,
  36532. plugin: pluginName
  36533. }, activeDeprecation, options);
  36534. }
  36535. return handler(...args);
  36536. });
  36537. }
  36538. function getPluginContext(plugin, pluginCache, graph, options, fileEmitter, existingPluginNames) {
  36539. let cacheable = true;
  36540. if (typeof plugin.cacheKey !== 'string') {
  36541. if (plugin.name.startsWith(ANONYMOUS_PLUGIN_PREFIX) ||
  36542. plugin.name.startsWith(ANONYMOUS_OUTPUT_PLUGIN_PREFIX) ||
  36543. existingPluginNames.has(plugin.name)) {
  36544. cacheable = false;
  36545. }
  36546. else {
  36547. existingPluginNames.add(plugin.name);
  36548. }
  36549. }
  36550. let cacheInstance;
  36551. if (!pluginCache) {
  36552. cacheInstance = NO_CACHE;
  36553. }
  36554. else if (cacheable) {
  36555. const cacheKey = plugin.cacheKey || plugin.name;
  36556. cacheInstance = createPluginCache(pluginCache[cacheKey] || (pluginCache[cacheKey] = Object.create(null)));
  36557. }
  36558. else {
  36559. cacheInstance = getCacheForUncacheablePlugin(plugin.name);
  36560. }
  36561. const context = {
  36562. addWatchFile(id) {
  36563. if (graph.phase >= BuildPhase.GENERATE) {
  36564. return this.error(errInvalidRollupPhaseForAddWatchFile());
  36565. }
  36566. graph.watchFiles[id] = true;
  36567. },
  36568. cache: cacheInstance,
  36569. emitAsset: getDeprecatedContextHandler((name, source) => fileEmitter.emitFile({ type: 'asset', name, source }), 'emitAsset', 'emitFile', plugin.name, true, options),
  36570. emitChunk: getDeprecatedContextHandler((id, options) => fileEmitter.emitFile({ type: 'chunk', id, name: options && options.name }), 'emitChunk', 'emitFile', plugin.name, true, options),
  36571. emitFile: fileEmitter.emitFile,
  36572. error(err) {
  36573. return throwPluginError(err, plugin.name);
  36574. },
  36575. getAssetFileName: getDeprecatedContextHandler(fileEmitter.getFileName, 'getAssetFileName', 'getFileName', plugin.name, true, options),
  36576. getChunkFileName: getDeprecatedContextHandler(fileEmitter.getFileName, 'getChunkFileName', 'getFileName', plugin.name, true, options),
  36577. getFileName: fileEmitter.getFileName,
  36578. getModuleIds: () => graph.modulesById.keys(),
  36579. getModuleInfo: graph.getModuleInfo,
  36580. getWatchFiles: () => Object.keys(graph.watchFiles),
  36581. isExternal: getDeprecatedContextHandler((id, parentId, isResolved = false) => options.external(id, parentId, isResolved), 'isExternal', 'resolve', plugin.name, true, options),
  36582. meta: {
  36583. rollupVersion: version$1,
  36584. watchMode: graph.watchMode
  36585. },
  36586. get moduleIds() {
  36587. function* wrappedModuleIds() {
  36588. warnDeprecation({
  36589. message: `Accessing "this.moduleIds" on the plugin context by plugin ${plugin.name} is deprecated. The "this.getModuleIds" plugin context function should be used instead.`,
  36590. plugin: plugin.name
  36591. }, false, options);
  36592. yield* moduleIds;
  36593. }
  36594. const moduleIds = graph.modulesById.keys();
  36595. return wrappedModuleIds();
  36596. },
  36597. parse: graph.contextParse.bind(graph),
  36598. resolve(source, importer, { custom, skipSelf } = BLANK) {
  36599. return graph.moduleLoader.resolveId(source, importer, custom, skipSelf ? [{ importer, plugin, source }] : null);
  36600. },
  36601. resolveId: getDeprecatedContextHandler((source, importer) => graph.moduleLoader
  36602. .resolveId(source, importer, BLANK)
  36603. .then(resolveId => resolveId && resolveId.id), 'resolveId', 'resolve', plugin.name, true, options),
  36604. setAssetSource: fileEmitter.setAssetSource,
  36605. warn(warning) {
  36606. if (typeof warning === 'string')
  36607. warning = { message: warning };
  36608. if (warning.code)
  36609. warning.pluginCode = warning.code;
  36610. warning.code = 'PLUGIN_WARNING';
  36611. warning.plugin = plugin.name;
  36612. options.onwarn(warning);
  36613. }
  36614. };
  36615. return context;
  36616. }
  36617. const inputHookNames = {
  36618. buildEnd: 1,
  36619. buildStart: 1,
  36620. closeBundle: 1,
  36621. closeWatcher: 1,
  36622. load: 1,
  36623. moduleParsed: 1,
  36624. options: 1,
  36625. resolveDynamicImport: 1,
  36626. resolveId: 1,
  36627. transform: 1,
  36628. watchChange: 1
  36629. };
  36630. const inputHooks = Object.keys(inputHookNames);
  36631. function throwInvalidHookError(hookName, pluginName) {
  36632. return error({
  36633. code: 'INVALID_PLUGIN_HOOK',
  36634. message: `Error running plugin hook ${hookName} for ${pluginName}, expected a function hook.`
  36635. });
  36636. }
  36637. class PluginDriver {
  36638. constructor(graph, options, userPlugins, pluginCache, basePluginDriver) {
  36639. this.graph = graph;
  36640. this.options = options;
  36641. this.pluginContexts = new Map();
  36642. warnDeprecatedHooks(userPlugins, options);
  36643. this.pluginCache = pluginCache;
  36644. this.fileEmitter = new FileEmitter(graph, options, basePluginDriver && basePluginDriver.fileEmitter);
  36645. this.emitFile = this.fileEmitter.emitFile;
  36646. this.getFileName = this.fileEmitter.getFileName;
  36647. this.finaliseAssets = this.fileEmitter.assertAssetsFinalized;
  36648. this.setOutputBundle = this.fileEmitter.setOutputBundle;
  36649. this.plugins = userPlugins.concat(basePluginDriver ? basePluginDriver.plugins : []);
  36650. const existingPluginNames = new Set();
  36651. for (const plugin of this.plugins) {
  36652. this.pluginContexts.set(plugin, getPluginContext(plugin, pluginCache, graph, options, this.fileEmitter, existingPluginNames));
  36653. }
  36654. if (basePluginDriver) {
  36655. for (const plugin of userPlugins) {
  36656. for (const hook of inputHooks) {
  36657. if (hook in plugin) {
  36658. options.onwarn(errInputHookInOutputPlugin(plugin.name, hook));
  36659. }
  36660. }
  36661. }
  36662. }
  36663. }
  36664. createOutputPluginDriver(plugins) {
  36665. return new PluginDriver(this.graph, this.options, plugins, this.pluginCache, this);
  36666. }
  36667. // chains, first non-null result stops and returns
  36668. hookFirst(hookName, args, replaceContext, skipped) {
  36669. let promise = Promise.resolve(undefined);
  36670. for (const plugin of this.plugins) {
  36671. if (skipped && skipped.has(plugin))
  36672. continue;
  36673. promise = promise.then(result => {
  36674. if (result != null)
  36675. return result;
  36676. return this.runHook(hookName, args, plugin, false, replaceContext);
  36677. });
  36678. }
  36679. return promise;
  36680. }
  36681. // chains synchronously, first non-null result stops and returns
  36682. hookFirstSync(hookName, args, replaceContext) {
  36683. for (const plugin of this.plugins) {
  36684. const result = this.runHookSync(hookName, args, plugin, replaceContext);
  36685. if (result != null)
  36686. return result;
  36687. }
  36688. return null;
  36689. }
  36690. // parallel, ignores returns
  36691. hookParallel(hookName, args, replaceContext) {
  36692. const promises = [];
  36693. for (const plugin of this.plugins) {
  36694. const hookPromise = this.runHook(hookName, args, plugin, false, replaceContext);
  36695. if (!hookPromise)
  36696. continue;
  36697. promises.push(hookPromise);
  36698. }
  36699. return Promise.all(promises).then(() => { });
  36700. }
  36701. // chains, reduces returned value, handling the reduced value as the first hook argument
  36702. hookReduceArg0(hookName, [arg0, ...rest], reduce, replaceContext) {
  36703. let promise = Promise.resolve(arg0);
  36704. for (const plugin of this.plugins) {
  36705. promise = promise.then(arg0 => {
  36706. const args = [arg0, ...rest];
  36707. const hookPromise = this.runHook(hookName, args, plugin, false, replaceContext);
  36708. if (!hookPromise)
  36709. return arg0;
  36710. return hookPromise.then(result => reduce.call(this.pluginContexts.get(plugin), arg0, result, plugin));
  36711. });
  36712. }
  36713. return promise;
  36714. }
  36715. // chains synchronously, reduces returned value, handling the reduced value as the first hook argument
  36716. hookReduceArg0Sync(hookName, [arg0, ...rest], reduce, replaceContext) {
  36717. for (const plugin of this.plugins) {
  36718. const args = [arg0, ...rest];
  36719. const result = this.runHookSync(hookName, args, plugin, replaceContext);
  36720. arg0 = reduce.call(this.pluginContexts.get(plugin), arg0, result, plugin);
  36721. }
  36722. return arg0;
  36723. }
  36724. // chains, reduces returned value to type T, handling the reduced value separately. permits hooks as values.
  36725. hookReduceValue(hookName, initialValue, args, reduce, replaceContext) {
  36726. let promise = Promise.resolve(initialValue);
  36727. for (const plugin of this.plugins) {
  36728. promise = promise.then(value => {
  36729. const hookPromise = this.runHook(hookName, args, plugin, true, replaceContext);
  36730. if (!hookPromise)
  36731. return value;
  36732. return hookPromise.then(result => reduce.call(this.pluginContexts.get(plugin), value, result, plugin));
  36733. });
  36734. }
  36735. return promise;
  36736. }
  36737. // chains synchronously, reduces returned value to type T, handling the reduced value separately. permits hooks as values.
  36738. hookReduceValueSync(hookName, initialValue, args, reduce, replaceContext) {
  36739. let acc = initialValue;
  36740. for (const plugin of this.plugins) {
  36741. const result = this.runHookSync(hookName, args, plugin, replaceContext);
  36742. acc = reduce.call(this.pluginContexts.get(plugin), acc, result, plugin);
  36743. }
  36744. return acc;
  36745. }
  36746. // chains, ignores returns
  36747. hookSeq(hookName, args, replaceContext) {
  36748. let promise = Promise.resolve();
  36749. for (const plugin of this.plugins) {
  36750. promise = promise.then(() => this.runHook(hookName, args, plugin, false, replaceContext));
  36751. }
  36752. return promise;
  36753. }
  36754. // chains synchronously, ignores returns
  36755. hookSeqSync(hookName, args, replaceContext) {
  36756. for (const plugin of this.plugins) {
  36757. this.runHookSync(hookName, args, plugin, replaceContext);
  36758. }
  36759. }
  36760. runHook(hookName, args, plugin, permitValues, hookContext) {
  36761. const hook = plugin[hookName];
  36762. if (!hook)
  36763. return undefined;
  36764. let context = this.pluginContexts.get(plugin);
  36765. if (hookContext) {
  36766. context = hookContext(context, plugin);
  36767. }
  36768. return Promise.resolve()
  36769. .then(() => {
  36770. // permit values allows values to be returned instead of a functional hook
  36771. if (typeof hook !== 'function') {
  36772. if (permitValues)
  36773. return hook;
  36774. return throwInvalidHookError(hookName, plugin.name);
  36775. }
  36776. return hook.apply(context, args);
  36777. })
  36778. .catch(err => throwPluginError(err, plugin.name, { hook: hookName }));
  36779. }
  36780. /**
  36781. * Run a sync plugin hook and return the result.
  36782. * @param hookName Name of the plugin hook. Must be in `PluginHooks`.
  36783. * @param args Arguments passed to the plugin hook.
  36784. * @param plugin The acutal plugin
  36785. * @param hookContext When passed, the plugin context can be overridden.
  36786. */
  36787. runHookSync(hookName, args, plugin, hookContext) {
  36788. const hook = plugin[hookName];
  36789. if (!hook)
  36790. return undefined;
  36791. let context = this.pluginContexts.get(plugin);
  36792. if (hookContext) {
  36793. context = hookContext(context, plugin);
  36794. }
  36795. try {
  36796. // permit values allows values to be returned instead of a functional hook
  36797. if (typeof hook !== 'function') {
  36798. return throwInvalidHookError(hookName, plugin.name);
  36799. }
  36800. return hook.apply(context, args);
  36801. }
  36802. catch (err) {
  36803. return throwPluginError(err, plugin.name, { hook: hookName });
  36804. }
  36805. }
  36806. }
  36807. // AST walker module for Mozilla Parser API compatible trees
  36808. function skipThrough(node, st, c) { c(node, st); }
  36809. function ignore(_node, _st, _c) {}
  36810. // Node walkers.
  36811. var base = {};
  36812. base.Program = base.BlockStatement = function (node, st, c) {
  36813. for (var i = 0, list = node.body; i < list.length; i += 1)
  36814. {
  36815. var stmt = list[i];
  36816. c(stmt, st, "Statement");
  36817. }
  36818. };
  36819. base.Statement = skipThrough;
  36820. base.EmptyStatement = ignore;
  36821. base.ExpressionStatement = base.ParenthesizedExpression = base.ChainExpression =
  36822. function (node, st, c) { return c(node.expression, st, "Expression"); };
  36823. base.IfStatement = function (node, st, c) {
  36824. c(node.test, st, "Expression");
  36825. c(node.consequent, st, "Statement");
  36826. if (node.alternate) { c(node.alternate, st, "Statement"); }
  36827. };
  36828. base.LabeledStatement = function (node, st, c) { return c(node.body, st, "Statement"); };
  36829. base.BreakStatement = base.ContinueStatement = ignore;
  36830. base.WithStatement = function (node, st, c) {
  36831. c(node.object, st, "Expression");
  36832. c(node.body, st, "Statement");
  36833. };
  36834. base.SwitchStatement = function (node, st, c) {
  36835. c(node.discriminant, st, "Expression");
  36836. for (var i$1 = 0, list$1 = node.cases; i$1 < list$1.length; i$1 += 1) {
  36837. var cs = list$1[i$1];
  36838. if (cs.test) { c(cs.test, st, "Expression"); }
  36839. for (var i = 0, list = cs.consequent; i < list.length; i += 1)
  36840. {
  36841. var cons = list[i];
  36842. c(cons, st, "Statement");
  36843. }
  36844. }
  36845. };
  36846. base.SwitchCase = function (node, st, c) {
  36847. if (node.test) { c(node.test, st, "Expression"); }
  36848. for (var i = 0, list = node.consequent; i < list.length; i += 1)
  36849. {
  36850. var cons = list[i];
  36851. c(cons, st, "Statement");
  36852. }
  36853. };
  36854. base.ReturnStatement = base.YieldExpression = base.AwaitExpression = function (node, st, c) {
  36855. if (node.argument) { c(node.argument, st, "Expression"); }
  36856. };
  36857. base.ThrowStatement = base.SpreadElement =
  36858. function (node, st, c) { return c(node.argument, st, "Expression"); };
  36859. base.TryStatement = function (node, st, c) {
  36860. c(node.block, st, "Statement");
  36861. if (node.handler) { c(node.handler, st); }
  36862. if (node.finalizer) { c(node.finalizer, st, "Statement"); }
  36863. };
  36864. base.CatchClause = function (node, st, c) {
  36865. if (node.param) { c(node.param, st, "Pattern"); }
  36866. c(node.body, st, "Statement");
  36867. };
  36868. base.WhileStatement = base.DoWhileStatement = function (node, st, c) {
  36869. c(node.test, st, "Expression");
  36870. c(node.body, st, "Statement");
  36871. };
  36872. base.ForStatement = function (node, st, c) {
  36873. if (node.init) { c(node.init, st, "ForInit"); }
  36874. if (node.test) { c(node.test, st, "Expression"); }
  36875. if (node.update) { c(node.update, st, "Expression"); }
  36876. c(node.body, st, "Statement");
  36877. };
  36878. base.ForInStatement = base.ForOfStatement = function (node, st, c) {
  36879. c(node.left, st, "ForInit");
  36880. c(node.right, st, "Expression");
  36881. c(node.body, st, "Statement");
  36882. };
  36883. base.ForInit = function (node, st, c) {
  36884. if (node.type === "VariableDeclaration") { c(node, st); }
  36885. else { c(node, st, "Expression"); }
  36886. };
  36887. base.DebuggerStatement = ignore;
  36888. base.FunctionDeclaration = function (node, st, c) { return c(node, st, "Function"); };
  36889. base.VariableDeclaration = function (node, st, c) {
  36890. for (var i = 0, list = node.declarations; i < list.length; i += 1)
  36891. {
  36892. var decl = list[i];
  36893. c(decl, st);
  36894. }
  36895. };
  36896. base.VariableDeclarator = function (node, st, c) {
  36897. c(node.id, st, "Pattern");
  36898. if (node.init) { c(node.init, st, "Expression"); }
  36899. };
  36900. base.Function = function (node, st, c) {
  36901. if (node.id) { c(node.id, st, "Pattern"); }
  36902. for (var i = 0, list = node.params; i < list.length; i += 1)
  36903. {
  36904. var param = list[i];
  36905. c(param, st, "Pattern");
  36906. }
  36907. c(node.body, st, node.expression ? "Expression" : "Statement");
  36908. };
  36909. base.Pattern = function (node, st, c) {
  36910. if (node.type === "Identifier")
  36911. { c(node, st, "VariablePattern"); }
  36912. else if (node.type === "MemberExpression")
  36913. { c(node, st, "MemberPattern"); }
  36914. else
  36915. { c(node, st); }
  36916. };
  36917. base.VariablePattern = ignore;
  36918. base.MemberPattern = skipThrough;
  36919. base.RestElement = function (node, st, c) { return c(node.argument, st, "Pattern"); };
  36920. base.ArrayPattern = function (node, st, c) {
  36921. for (var i = 0, list = node.elements; i < list.length; i += 1) {
  36922. var elt = list[i];
  36923. if (elt) { c(elt, st, "Pattern"); }
  36924. }
  36925. };
  36926. base.ObjectPattern = function (node, st, c) {
  36927. for (var i = 0, list = node.properties; i < list.length; i += 1) {
  36928. var prop = list[i];
  36929. if (prop.type === "Property") {
  36930. if (prop.computed) { c(prop.key, st, "Expression"); }
  36931. c(prop.value, st, "Pattern");
  36932. } else if (prop.type === "RestElement") {
  36933. c(prop.argument, st, "Pattern");
  36934. }
  36935. }
  36936. };
  36937. base.Expression = skipThrough;
  36938. base.ThisExpression = base.Super = base.MetaProperty = ignore;
  36939. base.ArrayExpression = function (node, st, c) {
  36940. for (var i = 0, list = node.elements; i < list.length; i += 1) {
  36941. var elt = list[i];
  36942. if (elt) { c(elt, st, "Expression"); }
  36943. }
  36944. };
  36945. base.ObjectExpression = function (node, st, c) {
  36946. for (var i = 0, list = node.properties; i < list.length; i += 1)
  36947. {
  36948. var prop = list[i];
  36949. c(prop, st);
  36950. }
  36951. };
  36952. base.FunctionExpression = base.ArrowFunctionExpression = base.FunctionDeclaration;
  36953. base.SequenceExpression = function (node, st, c) {
  36954. for (var i = 0, list = node.expressions; i < list.length; i += 1)
  36955. {
  36956. var expr = list[i];
  36957. c(expr, st, "Expression");
  36958. }
  36959. };
  36960. base.TemplateLiteral = function (node, st, c) {
  36961. for (var i = 0, list = node.quasis; i < list.length; i += 1)
  36962. {
  36963. var quasi = list[i];
  36964. c(quasi, st);
  36965. }
  36966. for (var i$1 = 0, list$1 = node.expressions; i$1 < list$1.length; i$1 += 1)
  36967. {
  36968. var expr = list$1[i$1];
  36969. c(expr, st, "Expression");
  36970. }
  36971. };
  36972. base.TemplateElement = ignore;
  36973. base.UnaryExpression = base.UpdateExpression = function (node, st, c) {
  36974. c(node.argument, st, "Expression");
  36975. };
  36976. base.BinaryExpression = base.LogicalExpression = function (node, st, c) {
  36977. c(node.left, st, "Expression");
  36978. c(node.right, st, "Expression");
  36979. };
  36980. base.AssignmentExpression = base.AssignmentPattern = function (node, st, c) {
  36981. c(node.left, st, "Pattern");
  36982. c(node.right, st, "Expression");
  36983. };
  36984. base.ConditionalExpression = function (node, st, c) {
  36985. c(node.test, st, "Expression");
  36986. c(node.consequent, st, "Expression");
  36987. c(node.alternate, st, "Expression");
  36988. };
  36989. base.NewExpression = base.CallExpression = function (node, st, c) {
  36990. c(node.callee, st, "Expression");
  36991. if (node.arguments)
  36992. { for (var i = 0, list = node.arguments; i < list.length; i += 1)
  36993. {
  36994. var arg = list[i];
  36995. c(arg, st, "Expression");
  36996. } }
  36997. };
  36998. base.MemberExpression = function (node, st, c) {
  36999. c(node.object, st, "Expression");
  37000. if (node.computed) { c(node.property, st, "Expression"); }
  37001. };
  37002. base.ExportNamedDeclaration = base.ExportDefaultDeclaration = function (node, st, c) {
  37003. if (node.declaration)
  37004. { c(node.declaration, st, node.type === "ExportNamedDeclaration" || node.declaration.id ? "Statement" : "Expression"); }
  37005. if (node.source) { c(node.source, st, "Expression"); }
  37006. };
  37007. base.ExportAllDeclaration = function (node, st, c) {
  37008. if (node.exported)
  37009. { c(node.exported, st); }
  37010. c(node.source, st, "Expression");
  37011. };
  37012. base.ImportDeclaration = function (node, st, c) {
  37013. for (var i = 0, list = node.specifiers; i < list.length; i += 1)
  37014. {
  37015. var spec = list[i];
  37016. c(spec, st);
  37017. }
  37018. c(node.source, st, "Expression");
  37019. };
  37020. base.ImportExpression = function (node, st, c) {
  37021. c(node.source, st, "Expression");
  37022. };
  37023. base.ImportSpecifier = base.ImportDefaultSpecifier = base.ImportNamespaceSpecifier = base.Identifier = base.Literal = ignore;
  37024. base.TaggedTemplateExpression = function (node, st, c) {
  37025. c(node.tag, st, "Expression");
  37026. c(node.quasi, st, "Expression");
  37027. };
  37028. base.ClassDeclaration = base.ClassExpression = function (node, st, c) { return c(node, st, "Class"); };
  37029. base.Class = function (node, st, c) {
  37030. if (node.id) { c(node.id, st, "Pattern"); }
  37031. if (node.superClass) { c(node.superClass, st, "Expression"); }
  37032. c(node.body, st);
  37033. };
  37034. base.ClassBody = function (node, st, c) {
  37035. for (var i = 0, list = node.body; i < list.length; i += 1)
  37036. {
  37037. var elt = list[i];
  37038. c(elt, st);
  37039. }
  37040. };
  37041. base.MethodDefinition = base.Property = function (node, st, c) {
  37042. if (node.computed) { c(node.key, st, "Expression"); }
  37043. c(node.value, st, "Expression");
  37044. };
  37045. // patch up acorn-walk until class-fields are officially supported
  37046. base.PropertyDefinition = function (node, st, c) {
  37047. if (node.computed) {
  37048. c(node.key, st, 'Expression');
  37049. }
  37050. if (node.value) {
  37051. c(node.value, st, 'Expression');
  37052. }
  37053. };
  37054. function handlePureAnnotationsOfNode(node, state, type = node.type) {
  37055. let commentNode = state.commentNodes[state.commentIndex];
  37056. while (commentNode && node.start >= commentNode.end) {
  37057. markPureNode(node, commentNode);
  37058. commentNode = state.commentNodes[++state.commentIndex];
  37059. }
  37060. if (commentNode && commentNode.end <= node.end) {
  37061. base[type](node, state, handlePureAnnotationsOfNode);
  37062. }
  37063. }
  37064. function markPureNode(node, comment) {
  37065. if (node._rollupAnnotations) {
  37066. node._rollupAnnotations.push({ comment });
  37067. }
  37068. else {
  37069. node._rollupAnnotations = [{ comment }];
  37070. }
  37071. while (node.type === ExpressionStatement$1 || node.type === ChainExpression$1) {
  37072. node = node.expression;
  37073. }
  37074. if (node.type === CallExpression$1 || node.type === NewExpression$1) {
  37075. if (node._rollupAnnotations) {
  37076. node._rollupAnnotations.push({ pure: true });
  37077. }
  37078. else {
  37079. node._rollupAnnotations = [{ pure: true }];
  37080. }
  37081. }
  37082. }
  37083. const pureCommentRegex = /[@#]__PURE__/;
  37084. const isPureComment = (comment) => pureCommentRegex.test(comment.value);
  37085. function markPureCallExpressions(comments, esTreeAst) {
  37086. handlePureAnnotationsOfNode(esTreeAst, {
  37087. commentIndex: 0,
  37088. commentNodes: comments.filter(isPureComment)
  37089. });
  37090. }
  37091. function normalizeEntryModules(entryModules) {
  37092. if (Array.isArray(entryModules)) {
  37093. return entryModules.map(id => ({
  37094. fileName: null,
  37095. id,
  37096. implicitlyLoadedAfter: [],
  37097. importer: undefined,
  37098. name: null
  37099. }));
  37100. }
  37101. return Object.keys(entryModules).map(name => ({
  37102. fileName: null,
  37103. id: entryModules[name],
  37104. implicitlyLoadedAfter: [],
  37105. importer: undefined,
  37106. name
  37107. }));
  37108. }
  37109. class Graph {
  37110. constructor(options, watcher) {
  37111. var _a, _b;
  37112. this.options = options;
  37113. this.entryModules = [];
  37114. this.modulesById = new Map();
  37115. this.needsTreeshakingPass = false;
  37116. this.phase = BuildPhase.LOAD_AND_PARSE;
  37117. this.watchFiles = Object.create(null);
  37118. this.watchMode = false;
  37119. this.externalModules = [];
  37120. this.implicitEntryModules = [];
  37121. this.modules = [];
  37122. this.getModuleInfo = (moduleId) => {
  37123. const foundModule = this.modulesById.get(moduleId);
  37124. if (!foundModule)
  37125. return null;
  37126. return foundModule.info;
  37127. };
  37128. this.deoptimizationTracker = new PathTracker();
  37129. this.cachedModules = new Map();
  37130. if (options.cache !== false) {
  37131. if ((_a = options.cache) === null || _a === void 0 ? void 0 : _a.modules) {
  37132. for (const module of options.cache.modules)
  37133. this.cachedModules.set(module.id, module);
  37134. }
  37135. this.pluginCache = ((_b = options.cache) === null || _b === void 0 ? void 0 : _b.plugins) || Object.create(null);
  37136. // increment access counter
  37137. for (const name in this.pluginCache) {
  37138. const cache = this.pluginCache[name];
  37139. for (const key of Object.keys(cache))
  37140. cache[key][0]++;
  37141. }
  37142. }
  37143. if (watcher) {
  37144. this.watchMode = true;
  37145. const handleChange = (...args) => this.pluginDriver.hookSeqSync('watchChange', args);
  37146. const handleClose = () => this.pluginDriver.hookSeqSync('closeWatcher', []);
  37147. watcher.on('change', handleChange);
  37148. watcher.on('close', handleClose);
  37149. watcher.once('restart', () => {
  37150. watcher.removeListener('change', handleChange);
  37151. watcher.removeListener('close', handleClose);
  37152. });
  37153. }
  37154. this.pluginDriver = new PluginDriver(this, options, options.plugins, this.pluginCache);
  37155. this.scope = new GlobalScope();
  37156. this.acornParser = Parser.extend(...options.acornInjectPlugins);
  37157. this.moduleLoader = new ModuleLoader(this, this.modulesById, this.options, this.pluginDriver);
  37158. }
  37159. async build() {
  37160. timeStart('generate module graph', 2);
  37161. await this.generateModuleGraph();
  37162. timeEnd('generate module graph', 2);
  37163. timeStart('sort modules', 2);
  37164. this.phase = BuildPhase.ANALYSE;
  37165. this.sortModules();
  37166. timeEnd('sort modules', 2);
  37167. timeStart('mark included statements', 2);
  37168. this.includeStatements();
  37169. timeEnd('mark included statements', 2);
  37170. this.phase = BuildPhase.GENERATE;
  37171. }
  37172. contextParse(code, options = {}) {
  37173. const onCommentOrig = options.onComment;
  37174. const comments = [];
  37175. if (onCommentOrig && typeof onCommentOrig == 'function') {
  37176. options.onComment = (block, text, start, end, ...args) => {
  37177. comments.push({ type: block ? "Block" : "Line", value: text, start, end });
  37178. return onCommentOrig.call(options, block, text, start, end, ...args);
  37179. };
  37180. }
  37181. else {
  37182. options.onComment = comments;
  37183. }
  37184. const ast = this.acornParser.parse(code, {
  37185. ...this.options.acorn,
  37186. ...options
  37187. });
  37188. if (typeof onCommentOrig == 'object') {
  37189. onCommentOrig.push(...comments);
  37190. }
  37191. options.onComment = onCommentOrig;
  37192. markPureCallExpressions(comments, ast);
  37193. return ast;
  37194. }
  37195. getCache() {
  37196. // handle plugin cache eviction
  37197. for (const name in this.pluginCache) {
  37198. const cache = this.pluginCache[name];
  37199. let allDeleted = true;
  37200. for (const key of Object.keys(cache)) {
  37201. if (cache[key][0] >= this.options.experimentalCacheExpiry)
  37202. delete cache[key];
  37203. else
  37204. allDeleted = false;
  37205. }
  37206. if (allDeleted)
  37207. delete this.pluginCache[name];
  37208. }
  37209. return {
  37210. modules: this.modules.map(module => module.toJSON()),
  37211. plugins: this.pluginCache
  37212. };
  37213. }
  37214. async generateModuleGraph() {
  37215. ({
  37216. entryModules: this.entryModules,
  37217. implicitEntryModules: this.implicitEntryModules
  37218. } = await this.moduleLoader.addEntryModules(normalizeEntryModules(this.options.input), true));
  37219. if (this.entryModules.length === 0) {
  37220. throw new Error('You must supply options.input to rollup');
  37221. }
  37222. for (const module of this.modulesById.values()) {
  37223. if (module instanceof Module$1) {
  37224. this.modules.push(module);
  37225. }
  37226. else {
  37227. this.externalModules.push(module);
  37228. }
  37229. }
  37230. }
  37231. includeStatements() {
  37232. for (const module of [...this.entryModules, ...this.implicitEntryModules]) {
  37233. if (module.preserveSignature !== false) {
  37234. module.includeAllExports(false);
  37235. }
  37236. else {
  37237. markModuleAndImpureDependenciesAsExecuted(module);
  37238. }
  37239. }
  37240. if (this.options.treeshake) {
  37241. let treeshakingPass = 1;
  37242. do {
  37243. timeStart(`treeshaking pass ${treeshakingPass}`, 3);
  37244. this.needsTreeshakingPass = false;
  37245. for (const module of this.modules) {
  37246. if (module.isExecuted) {
  37247. if (module.info.hasModuleSideEffects === 'no-treeshake') {
  37248. module.includeAllInBundle();
  37249. }
  37250. else {
  37251. module.include();
  37252. }
  37253. }
  37254. }
  37255. timeEnd(`treeshaking pass ${treeshakingPass++}`, 3);
  37256. } while (this.needsTreeshakingPass);
  37257. }
  37258. else {
  37259. for (const module of this.modules)
  37260. module.includeAllInBundle();
  37261. }
  37262. for (const externalModule of this.externalModules)
  37263. externalModule.warnUnusedImports();
  37264. for (const module of this.implicitEntryModules) {
  37265. for (const dependant of module.implicitlyLoadedAfter) {
  37266. if (!(dependant.info.isEntry || dependant.isIncluded())) {
  37267. error(errImplicitDependantIsNotIncluded(dependant));
  37268. }
  37269. }
  37270. }
  37271. }
  37272. sortModules() {
  37273. const { orderedModules, cyclePaths } = analyseModuleExecution(this.entryModules);
  37274. for (const cyclePath of cyclePaths) {
  37275. this.options.onwarn({
  37276. code: 'CIRCULAR_DEPENDENCY',
  37277. cycle: cyclePath,
  37278. importer: cyclePath[0],
  37279. message: `Circular dependency: ${cyclePath.join(' -> ')}`
  37280. });
  37281. }
  37282. this.modules = orderedModules;
  37283. for (const module of this.modules) {
  37284. module.bindReferences();
  37285. }
  37286. this.warnForMissingExports();
  37287. }
  37288. warnForMissingExports() {
  37289. for (const module of this.modules) {
  37290. for (const importName of Object.keys(module.importDescriptions)) {
  37291. const importDescription = module.importDescriptions[importName];
  37292. if (importDescription.name !== '*' &&
  37293. !importDescription.module.getVariableForExportName(importDescription.name)) {
  37294. module.warn({
  37295. code: 'NON_EXISTENT_EXPORT',
  37296. message: `Non-existent export '${importDescription.name}' is imported from ${relativeId(importDescription.module.id)}`,
  37297. name: importDescription.name,
  37298. source: importDescription.module.id
  37299. }, importDescription.start);
  37300. }
  37301. }
  37302. }
  37303. }
  37304. }
  37305. function ensureArray$5(items) {
  37306. if (Array.isArray(items)) {
  37307. return items.filter(Boolean);
  37308. }
  37309. if (items) {
  37310. return [items];
  37311. }
  37312. return [];
  37313. }
  37314. function getAugmentedNamespace(n) {
  37315. if (n.__esModule) return n;
  37316. var a = Object.defineProperty({}, '__esModule', {value: true});
  37317. Object.keys(n).forEach(function (k) {
  37318. var d = Object.getOwnPropertyDescriptor(n, k);
  37319. Object.defineProperty(a, k, d.get ? d : {
  37320. enumerable: true,
  37321. get: function () {
  37322. return n[k];
  37323. }
  37324. });
  37325. });
  37326. return a;
  37327. }
  37328. var require$$1 = /*@__PURE__*/getAugmentedNamespace(acorn);
  37329. const getPrototype = Object.getPrototypeOf || (o => o.__proto__);
  37330. const getAcorn$1 = Parser => {
  37331. if (Parser.acorn) return Parser.acorn
  37332. const acorn = require$$1;
  37333. if (acorn.version.indexOf("6.") != 0 && acorn.version.indexOf("6.0.") == 0 && acorn.version.indexOf("7.") != 0) {
  37334. throw new Error(`acorn-private-class-elements requires acorn@^6.1.0 or acorn@7.0.0, not ${acorn.version}`)
  37335. }
  37336. // Make sure `Parser` comes from the same acorn as we `require`d,
  37337. // otherwise the comparisons fail.
  37338. for (let cur = Parser; cur && cur !== acorn.Parser; cur = getPrototype(cur)) {
  37339. if (cur !== acorn.Parser) {
  37340. throw new Error("acorn-private-class-elements does not support mixing different acorn copies")
  37341. }
  37342. }
  37343. return acorn
  37344. };
  37345. var acornPrivateClassElements = function(Parser) {
  37346. // Only load this plugin once.
  37347. if (Parser.prototype.parsePrivateName) {
  37348. return Parser
  37349. }
  37350. const acorn = getAcorn$1(Parser);
  37351. Parser = class extends Parser {
  37352. _branch() {
  37353. this.__branch = this.__branch || new Parser({ecmaVersion: this.options.ecmaVersion}, this.input);
  37354. this.__branch.end = this.end;
  37355. this.__branch.pos = this.pos;
  37356. this.__branch.type = this.type;
  37357. this.__branch.value = this.value;
  37358. this.__branch.containsEsc = this.containsEsc;
  37359. return this.__branch
  37360. }
  37361. parsePrivateClassElementName(element) {
  37362. element.computed = false;
  37363. element.key = this.parsePrivateName();
  37364. if (element.key.name == "constructor") this.raise(element.key.start, "Classes may not have a private element named constructor");
  37365. const accept = {get: "set", set: "get"}[element.kind];
  37366. const privateBoundNames = this._privateBoundNames;
  37367. if (Object.prototype.hasOwnProperty.call(privateBoundNames, element.key.name) && privateBoundNames[element.key.name] !== accept) {
  37368. this.raise(element.start, "Duplicate private element");
  37369. }
  37370. privateBoundNames[element.key.name] = element.kind || true;
  37371. delete this._unresolvedPrivateNames[element.key.name];
  37372. return element.key
  37373. }
  37374. parsePrivateName() {
  37375. const node = this.startNode();
  37376. node.name = this.value;
  37377. this.next();
  37378. this.finishNode(node, "PrivateIdentifier");
  37379. if (this.options.allowReserved == "never") this.checkUnreserved(node);
  37380. return node
  37381. }
  37382. // Parse # token
  37383. getTokenFromCode(code) {
  37384. if (code === 35) {
  37385. ++this.pos;
  37386. const word = this.readWord1();
  37387. return this.finishToken(this.privateIdentifierToken, word)
  37388. }
  37389. return super.getTokenFromCode(code)
  37390. }
  37391. // Manage stacks and check for undeclared private names
  37392. parseClass(node, isStatement) {
  37393. const oldOuterPrivateBoundNames = this._outerPrivateBoundNames;
  37394. this._outerPrivateBoundNames = this._privateBoundNames;
  37395. this._privateBoundNames = Object.create(this._privateBoundNames || null);
  37396. const oldOuterUnresolvedPrivateNames = this._outerUnresolvedPrivateNames;
  37397. this._outerUnresolvedPrivateNames = this._unresolvedPrivateNames;
  37398. this._unresolvedPrivateNames = Object.create(null);
  37399. const _return = super.parseClass(node, isStatement);
  37400. const unresolvedPrivateNames = this._unresolvedPrivateNames;
  37401. this._privateBoundNames = this._outerPrivateBoundNames;
  37402. this._outerPrivateBoundNames = oldOuterPrivateBoundNames;
  37403. this._unresolvedPrivateNames = this._outerUnresolvedPrivateNames;
  37404. this._outerUnresolvedPrivateNames = oldOuterUnresolvedPrivateNames;
  37405. if (!this._unresolvedPrivateNames) {
  37406. const names = Object.keys(unresolvedPrivateNames);
  37407. if (names.length) {
  37408. names.sort((n1, n2) => unresolvedPrivateNames[n1] - unresolvedPrivateNames[n2]);
  37409. this.raise(unresolvedPrivateNames[names[0]], "Usage of undeclared private name");
  37410. }
  37411. } else Object.assign(this._unresolvedPrivateNames, unresolvedPrivateNames);
  37412. return _return
  37413. }
  37414. // Class heritage is evaluated with outer private environment
  37415. parseClassSuper(node) {
  37416. const privateBoundNames = this._privateBoundNames;
  37417. this._privateBoundNames = this._outerPrivateBoundNames;
  37418. const unresolvedPrivateNames = this._unresolvedPrivateNames;
  37419. this._unresolvedPrivateNames = this._outerUnresolvedPrivateNames;
  37420. const _return = super.parseClassSuper(node);
  37421. this._privateBoundNames = privateBoundNames;
  37422. this._unresolvedPrivateNames = unresolvedPrivateNames;
  37423. return _return
  37424. }
  37425. // Parse private element access
  37426. parseSubscript(base, startPos, startLoc, _noCalls, _maybeAsyncArrow, _optionalChained) {
  37427. const optionalSupported = this.options.ecmaVersion >= 11 && acorn.tokTypes.questionDot;
  37428. const branch = this._branch();
  37429. if (!(
  37430. (branch.eat(acorn.tokTypes.dot) || (optionalSupported && branch.eat(acorn.tokTypes.questionDot))) &&
  37431. branch.type == this.privateIdentifierToken
  37432. )) {
  37433. return super.parseSubscript.apply(this, arguments)
  37434. }
  37435. let optional = false;
  37436. if (!this.eat(acorn.tokTypes.dot)) {
  37437. this.expect(acorn.tokTypes.questionDot);
  37438. optional = true;
  37439. }
  37440. let node = this.startNodeAt(startPos, startLoc);
  37441. node.object = base;
  37442. node.computed = false;
  37443. if (optionalSupported) {
  37444. node.optional = optional;
  37445. }
  37446. if (this.type == this.privateIdentifierToken) {
  37447. if (base.type == "Super") {
  37448. this.raise(this.start, "Cannot access private element on super");
  37449. }
  37450. node.property = this.parsePrivateName();
  37451. if (!this._privateBoundNames || !this._privateBoundNames[node.property.name]) {
  37452. if (!this._unresolvedPrivateNames) {
  37453. this.raise(node.property.start, "Usage of undeclared private name");
  37454. }
  37455. this._unresolvedPrivateNames[node.property.name] = node.property.start;
  37456. }
  37457. } else {
  37458. node.property = this.parseIdent(true);
  37459. }
  37460. return this.finishNode(node, "MemberExpression")
  37461. }
  37462. // Prohibit delete of private class elements
  37463. parseMaybeUnary(refDestructuringErrors, sawUnary) {
  37464. const _return = super.parseMaybeUnary(refDestructuringErrors, sawUnary);
  37465. if (_return.operator == "delete") {
  37466. if (_return.argument.type == "MemberExpression" && _return.argument.property.type == "PrivateIdentifier") {
  37467. this.raise(_return.start, "Private elements may not be deleted");
  37468. }
  37469. }
  37470. return _return
  37471. }
  37472. };
  37473. Parser.prototype.privateIdentifierToken = new acorn.TokenType("privateIdentifier");
  37474. return Parser
  37475. };
  37476. const privateClassElements$1 = acornPrivateClassElements;
  37477. var acornClassFields = function(Parser) {
  37478. const acorn = Parser.acorn || require$$1;
  37479. const tt = acorn.tokTypes;
  37480. Parser = privateClassElements$1(Parser);
  37481. return class extends Parser {
  37482. _maybeParseFieldValue(field) {
  37483. if (this.eat(tt.eq)) {
  37484. const oldInFieldValue = this._inFieldValue;
  37485. this._inFieldValue = true;
  37486. if (this.type === tt.name && this.value === "await" && (this.inAsync || this.options.allowAwaitOutsideFunction)) {
  37487. field.value = this.parseAwait();
  37488. } else field.value = this.parseExpression();
  37489. this._inFieldValue = oldInFieldValue;
  37490. } else field.value = null;
  37491. }
  37492. // Parse fields
  37493. parseClassElement(_constructorAllowsSuper) {
  37494. if (this.options.ecmaVersion >= 8 && (this.type == tt.name || this.type.keyword || this.type == this.privateIdentifierToken || this.type == tt.bracketL || this.type == tt.string || this.type == tt.num)) {
  37495. const branch = this._branch();
  37496. if (branch.type == tt.bracketL) {
  37497. let count = 0;
  37498. do {
  37499. if (branch.eat(tt.bracketL)) ++count;
  37500. else if (branch.eat(tt.bracketR)) --count;
  37501. else branch.next();
  37502. } while (count > 0)
  37503. } else branch.next(true);
  37504. let isField = branch.type == tt.eq || branch.type == tt.semi;
  37505. if (!isField && branch.canInsertSemicolon()) {
  37506. isField = branch.type != tt.parenL;
  37507. }
  37508. if (isField) {
  37509. const node = this.startNode();
  37510. if (this.type == this.privateIdentifierToken) {
  37511. this.parsePrivateClassElementName(node);
  37512. } else {
  37513. this.parsePropertyName(node);
  37514. }
  37515. if ((node.key.type === "Identifier" && node.key.name === "constructor") ||
  37516. (node.key.type === "Literal" && node.key.value === "constructor")) {
  37517. this.raise(node.key.start, "Classes may not have a field called constructor");
  37518. }
  37519. this.enterScope(64 | 2 | 1); // See acorn's scopeflags.js
  37520. this._maybeParseFieldValue(node);
  37521. this.exitScope();
  37522. this.finishNode(node, "PropertyDefinition");
  37523. this.semicolon();
  37524. return node
  37525. }
  37526. }
  37527. return super.parseClassElement.apply(this, arguments)
  37528. }
  37529. // Prohibit arguments in class field initializers
  37530. parseIdent(liberal, isBinding) {
  37531. const ident = super.parseIdent(liberal, isBinding);
  37532. if (this._inFieldValue && ident.name == "arguments") this.raise(ident.start, "A class field initializer may not contain arguments");
  37533. return ident
  37534. }
  37535. }
  37536. };
  37537. const privateClassElements = acornPrivateClassElements;
  37538. var acornStaticClassFeatures = function(Parser) {
  37539. const ExtendedParser = privateClassElements(Parser);
  37540. const acorn = Parser.acorn || require$$1;
  37541. const tt = acorn.tokTypes;
  37542. return class extends ExtendedParser {
  37543. _maybeParseFieldValue(field) {
  37544. if (this.eat(tt.eq)) {
  37545. const oldInFieldValue = this._inStaticFieldScope;
  37546. this._inStaticFieldScope = this.currentThisScope();
  37547. field.value = this.parseExpression();
  37548. this._inStaticFieldScope = oldInFieldValue;
  37549. } else field.value = null;
  37550. }
  37551. // Parse fields
  37552. parseClassElement(_constructorAllowsSuper) {
  37553. if (this.options.ecmaVersion < 8 || !this.isContextual("static")) {
  37554. return super.parseClassElement.apply(this, arguments)
  37555. }
  37556. const branch = this._branch();
  37557. branch.next();
  37558. if ([tt.name, tt.bracketL, tt.string, tt.num, this.privateIdentifierToken].indexOf(branch.type) == -1 && !branch.type.keyword) {
  37559. return super.parseClassElement.apply(this, arguments)
  37560. }
  37561. if (branch.type == tt.bracketL) {
  37562. let count = 0;
  37563. do {
  37564. if (branch.eat(tt.bracketL)) ++count;
  37565. else if (branch.eat(tt.bracketR)) --count;
  37566. else branch.next();
  37567. } while (count > 0)
  37568. } else branch.next();
  37569. if (branch.type != tt.eq && !branch.canInsertSemicolon() && branch.type != tt.semi) {
  37570. return super.parseClassElement.apply(this, arguments)
  37571. }
  37572. const node = this.startNode();
  37573. node.static = this.eatContextual("static");
  37574. if (this.type == this.privateIdentifierToken) {
  37575. this.parsePrivateClassElementName(node);
  37576. } else {
  37577. this.parsePropertyName(node);
  37578. }
  37579. if ((node.key.type === "Identifier" && node.key.name === "constructor") ||
  37580. (node.key.type === "Literal" && !node.computed && node.key.value === "constructor")) {
  37581. this.raise(node.key.start, "Classes may not have a field called constructor");
  37582. }
  37583. if ((node.key.name || node.key.value) === "prototype" && !node.computed) {
  37584. this.raise(node.key.start, "Classes may not have a static property named prototype");
  37585. }
  37586. this.enterScope(64 | 2 | 1); // See acorn's scopeflags.js
  37587. this._maybeParseFieldValue(node);
  37588. this.exitScope();
  37589. this.finishNode(node, "PropertyDefinition");
  37590. this.semicolon();
  37591. return node
  37592. }
  37593. // Parse private static methods
  37594. parsePropertyName(prop) {
  37595. if (prop.static && this.type == this.privateIdentifierToken) {
  37596. this.parsePrivateClassElementName(prop);
  37597. } else {
  37598. super.parsePropertyName(prop);
  37599. }
  37600. }
  37601. // Prohibit arguments in class field initializers
  37602. parseIdent(liberal, isBinding) {
  37603. const ident = super.parseIdent(liberal, isBinding);
  37604. if (this._inStaticFieldScope && this.currentThisScope() === this._inStaticFieldScope && ident.name == "arguments") {
  37605. this.raise(ident.start, "A static class field initializer may not contain arguments");
  37606. }
  37607. return ident
  37608. }
  37609. }
  37610. };
  37611. const defaultOnWarn = warning => console.warn(warning.message || warning);
  37612. function warnUnknownOptions(passedOptions, validOptions, optionType, warn, ignoredKeys = /$./) {
  37613. const validOptionSet = new Set(validOptions);
  37614. const unknownOptions = Object.keys(passedOptions).filter(key => !(validOptionSet.has(key) || ignoredKeys.test(key)));
  37615. if (unknownOptions.length > 0) {
  37616. warn({
  37617. code: 'UNKNOWN_OPTION',
  37618. message: `Unknown ${optionType}: ${unknownOptions.join(', ')}. Allowed options: ${[
  37619. ...validOptionSet
  37620. ]
  37621. .sort()
  37622. .join(', ')}`
  37623. });
  37624. }
  37625. }
  37626. function normalizeInputOptions(config) {
  37627. var _a, _b;
  37628. // These are options that may trigger special warnings or behaviour later
  37629. // if the user did not select an explicit value
  37630. const unsetOptions = new Set();
  37631. const context = (_a = config.context) !== null && _a !== void 0 ? _a : 'undefined';
  37632. const onwarn = getOnwarn(config);
  37633. const strictDeprecations = config.strictDeprecations || false;
  37634. const options = {
  37635. acorn: getAcorn(config),
  37636. acornInjectPlugins: getAcornInjectPlugins(config),
  37637. cache: getCache(config),
  37638. context,
  37639. experimentalCacheExpiry: (_b = config.experimentalCacheExpiry) !== null && _b !== void 0 ? _b : 10,
  37640. external: getIdMatcher(config.external),
  37641. inlineDynamicImports: getInlineDynamicImports$1(config, onwarn, strictDeprecations),
  37642. input: getInput(config),
  37643. manualChunks: getManualChunks$1(config, onwarn, strictDeprecations),
  37644. moduleContext: getModuleContext(config, context),
  37645. onwarn,
  37646. perf: config.perf || false,
  37647. plugins: ensureArray$5(config.plugins),
  37648. preserveEntrySignatures: getPreserveEntrySignatures(config, unsetOptions),
  37649. preserveModules: getPreserveModules$1(config, onwarn, strictDeprecations),
  37650. preserveSymlinks: config.preserveSymlinks || false,
  37651. shimMissingExports: config.shimMissingExports || false,
  37652. strictDeprecations,
  37653. treeshake: getTreeshake(config, onwarn, strictDeprecations)
  37654. };
  37655. warnUnknownOptions(config, [...Object.keys(options), 'watch'], 'input options', options.onwarn, /^(output)$/);
  37656. return { options, unsetOptions };
  37657. }
  37658. const getOnwarn = (config) => {
  37659. return config.onwarn
  37660. ? warning => {
  37661. warning.toString = () => {
  37662. let str = '';
  37663. if (warning.plugin)
  37664. str += `(${warning.plugin} plugin) `;
  37665. if (warning.loc)
  37666. str += `${relativeId(warning.loc.file)} (${warning.loc.line}:${warning.loc.column}) `;
  37667. str += warning.message;
  37668. return str;
  37669. };
  37670. config.onwarn(warning, defaultOnWarn);
  37671. }
  37672. : defaultOnWarn;
  37673. };
  37674. const getAcorn = (config) => ({
  37675. allowAwaitOutsideFunction: true,
  37676. ecmaVersion: 'latest',
  37677. preserveParens: false,
  37678. sourceType: 'module',
  37679. ...config.acorn
  37680. });
  37681. const getAcornInjectPlugins = (config) => [
  37682. acornClassFields,
  37683. acornStaticClassFeatures,
  37684. ...ensureArray$5(config.acornInjectPlugins)
  37685. ];
  37686. const getCache = (config) => {
  37687. var _a;
  37688. return ((_a = config.cache) === null || _a === void 0 ? void 0 : _a.cache) || config.cache;
  37689. };
  37690. const getIdMatcher = (option) => {
  37691. if (option === true) {
  37692. return () => true;
  37693. }
  37694. if (typeof option === 'function') {
  37695. return (id, ...args) => (!id.startsWith('\0') && option(id, ...args)) || false;
  37696. }
  37697. if (option) {
  37698. const ids = new Set();
  37699. const matchers = [];
  37700. for (const value of ensureArray$5(option)) {
  37701. if (value instanceof RegExp) {
  37702. matchers.push(value);
  37703. }
  37704. else {
  37705. ids.add(value);
  37706. }
  37707. }
  37708. return (id, ..._args) => ids.has(id) || matchers.some(matcher => matcher.test(id));
  37709. }
  37710. return () => false;
  37711. };
  37712. const getInlineDynamicImports$1 = (config, warn, strictDeprecations) => {
  37713. const configInlineDynamicImports = config.inlineDynamicImports;
  37714. if (configInlineDynamicImports) {
  37715. warnDeprecationWithOptions('The "inlineDynamicImports" option is deprecated. Use the "output.inlineDynamicImports" option instead.', false, warn, strictDeprecations);
  37716. }
  37717. return configInlineDynamicImports;
  37718. };
  37719. const getInput = (config) => {
  37720. const configInput = config.input;
  37721. return configInput == null ? [] : typeof configInput === 'string' ? [configInput] : configInput;
  37722. };
  37723. const getManualChunks$1 = (config, warn, strictDeprecations) => {
  37724. const configManualChunks = config.manualChunks;
  37725. if (configManualChunks) {
  37726. warnDeprecationWithOptions('The "manualChunks" option is deprecated. Use the "output.manualChunks" option instead.', false, warn, strictDeprecations);
  37727. }
  37728. return configManualChunks;
  37729. };
  37730. const getModuleContext = (config, context) => {
  37731. const configModuleContext = config.moduleContext;
  37732. if (typeof configModuleContext === 'function') {
  37733. return id => { var _a; return (_a = configModuleContext(id)) !== null && _a !== void 0 ? _a : context; };
  37734. }
  37735. if (configModuleContext) {
  37736. const contextByModuleId = Object.create(null);
  37737. for (const key of Object.keys(configModuleContext)) {
  37738. contextByModuleId[resolve$1(key)] = configModuleContext[key];
  37739. }
  37740. return id => contextByModuleId[id] || context;
  37741. }
  37742. return () => context;
  37743. };
  37744. const getPreserveEntrySignatures = (config, unsetOptions) => {
  37745. const configPreserveEntrySignatures = config.preserveEntrySignatures;
  37746. if (configPreserveEntrySignatures == null) {
  37747. unsetOptions.add('preserveEntrySignatures');
  37748. }
  37749. return configPreserveEntrySignatures !== null && configPreserveEntrySignatures !== void 0 ? configPreserveEntrySignatures : 'strict';
  37750. };
  37751. const getPreserveModules$1 = (config, warn, strictDeprecations) => {
  37752. const configPreserveModules = config.preserveModules;
  37753. if (configPreserveModules) {
  37754. warnDeprecationWithOptions('The "preserveModules" option is deprecated. Use the "output.preserveModules" option instead.', false, warn, strictDeprecations);
  37755. }
  37756. return configPreserveModules;
  37757. };
  37758. const getTreeshake = (config, warn, strictDeprecations) => {
  37759. const configTreeshake = config.treeshake;
  37760. if (configTreeshake === false) {
  37761. return false;
  37762. }
  37763. if (configTreeshake && configTreeshake !== true) {
  37764. if (typeof configTreeshake.pureExternalModules !== 'undefined') {
  37765. warnDeprecationWithOptions(`The "treeshake.pureExternalModules" option is deprecated. The "treeshake.moduleSideEffects" option should be used instead. "treeshake.pureExternalModules: true" is equivalent to "treeshake.moduleSideEffects: 'no-external'"`, true, warn, strictDeprecations);
  37766. }
  37767. return {
  37768. annotations: configTreeshake.annotations !== false,
  37769. moduleSideEffects: getHasModuleSideEffects(configTreeshake.moduleSideEffects, configTreeshake.pureExternalModules, warn),
  37770. propertyReadSideEffects: configTreeshake.propertyReadSideEffects === 'always' && 'always' ||
  37771. configTreeshake.propertyReadSideEffects !== false,
  37772. tryCatchDeoptimization: configTreeshake.tryCatchDeoptimization !== false,
  37773. unknownGlobalSideEffects: configTreeshake.unknownGlobalSideEffects !== false
  37774. };
  37775. }
  37776. return {
  37777. annotations: true,
  37778. moduleSideEffects: () => true,
  37779. propertyReadSideEffects: true,
  37780. tryCatchDeoptimization: true,
  37781. unknownGlobalSideEffects: true
  37782. };
  37783. };
  37784. const getHasModuleSideEffects = (moduleSideEffectsOption, pureExternalModules, warn) => {
  37785. if (typeof moduleSideEffectsOption === 'boolean') {
  37786. return () => moduleSideEffectsOption;
  37787. }
  37788. if (moduleSideEffectsOption === 'no-external') {
  37789. return (_id, external) => !external;
  37790. }
  37791. if (typeof moduleSideEffectsOption === 'function') {
  37792. return (id, external) => !id.startsWith('\0') ? moduleSideEffectsOption(id, external) !== false : true;
  37793. }
  37794. if (Array.isArray(moduleSideEffectsOption)) {
  37795. const ids = new Set(moduleSideEffectsOption);
  37796. return id => ids.has(id);
  37797. }
  37798. if (moduleSideEffectsOption) {
  37799. warn(errInvalidOption('treeshake.moduleSideEffects', 'please use one of false, "no-external", a function or an array'));
  37800. }
  37801. const isPureExternalModule = getIdMatcher(pureExternalModules);
  37802. return (id, external) => !(external && isPureExternalModule(id));
  37803. };
  37804. function normalizeOutputOptions(config, inputOptions, unsetInputOptions) {
  37805. var _a, _b, _c, _d, _e, _f, _g;
  37806. // These are options that may trigger special warnings or behaviour later
  37807. // if the user did not select an explicit value
  37808. const unsetOptions = new Set(unsetInputOptions);
  37809. const compact = config.compact || false;
  37810. const format = getFormat(config);
  37811. const inlineDynamicImports = getInlineDynamicImports(config, inputOptions);
  37812. const preserveModules = getPreserveModules(config, inlineDynamicImports, inputOptions);
  37813. const file = getFile(config, preserveModules, inputOptions);
  37814. const outputOptions = {
  37815. amd: getAmd(config),
  37816. assetFileNames: (_a = config.assetFileNames) !== null && _a !== void 0 ? _a : 'assets/[name]-[hash][extname]',
  37817. banner: getAddon(config, 'banner'),
  37818. chunkFileNames: (_b = config.chunkFileNames) !== null && _b !== void 0 ? _b : '[name]-[hash].js',
  37819. compact,
  37820. dir: getDir(config, file),
  37821. dynamicImportFunction: getDynamicImportFunction(config, inputOptions),
  37822. entryFileNames: getEntryFileNames(config, unsetOptions),
  37823. esModule: (_c = config.esModule) !== null && _c !== void 0 ? _c : true,
  37824. exports: getExports(config, unsetOptions),
  37825. extend: config.extend || false,
  37826. externalLiveBindings: (_d = config.externalLiveBindings) !== null && _d !== void 0 ? _d : true,
  37827. file,
  37828. footer: getAddon(config, 'footer'),
  37829. format,
  37830. freeze: (_e = config.freeze) !== null && _e !== void 0 ? _e : true,
  37831. globals: config.globals || {},
  37832. hoistTransitiveImports: (_f = config.hoistTransitiveImports) !== null && _f !== void 0 ? _f : true,
  37833. indent: getIndent(config, compact),
  37834. inlineDynamicImports,
  37835. interop: getInterop(config, inputOptions),
  37836. intro: getAddon(config, 'intro'),
  37837. manualChunks: getManualChunks(config, inlineDynamicImports, preserveModules, inputOptions),
  37838. minifyInternalExports: getMinifyInternalExports(config, format, compact),
  37839. name: config.name,
  37840. namespaceToStringTag: config.namespaceToStringTag || false,
  37841. noConflict: config.noConflict || false,
  37842. outro: getAddon(config, 'outro'),
  37843. paths: config.paths || {},
  37844. plugins: ensureArray$5(config.plugins),
  37845. preferConst: config.preferConst || false,
  37846. preserveModules,
  37847. preserveModulesRoot: getPreserveModulesRoot(config),
  37848. sourcemap: config.sourcemap || false,
  37849. sourcemapExcludeSources: config.sourcemapExcludeSources || false,
  37850. sourcemapFile: config.sourcemapFile,
  37851. sourcemapPathTransform: config.sourcemapPathTransform,
  37852. strict: (_g = config.strict) !== null && _g !== void 0 ? _g : true,
  37853. systemNullSetters: config.systemNullSetters || false,
  37854. validate: config.validate || false
  37855. };
  37856. warnUnknownOptions(config, Object.keys(outputOptions), 'output options', inputOptions.onwarn);
  37857. return { options: outputOptions, unsetOptions };
  37858. }
  37859. const getFile = (config, preserveModules, inputOptions) => {
  37860. const file = config.file;
  37861. if (typeof file === 'string') {
  37862. if (preserveModules) {
  37863. return error({
  37864. code: 'INVALID_OPTION',
  37865. message: 'You must set "output.dir" instead of "output.file" when using the "output.preserveModules" option.'
  37866. });
  37867. }
  37868. if (!Array.isArray(inputOptions.input))
  37869. return error({
  37870. code: 'INVALID_OPTION',
  37871. message: 'You must set "output.dir" instead of "output.file" when providing named inputs.'
  37872. });
  37873. }
  37874. return file;
  37875. };
  37876. const getFormat = (config) => {
  37877. const configFormat = config.format;
  37878. switch (configFormat) {
  37879. case undefined:
  37880. case 'es':
  37881. case 'esm':
  37882. case 'module':
  37883. return 'es';
  37884. case 'cjs':
  37885. case 'commonjs':
  37886. return 'cjs';
  37887. case 'system':
  37888. case 'systemjs':
  37889. return 'system';
  37890. case 'amd':
  37891. case 'iife':
  37892. case 'umd':
  37893. return configFormat;
  37894. default:
  37895. return error({
  37896. message: `You must specify "output.format", which can be one of "amd", "cjs", "system", "es", "iife" or "umd".`,
  37897. url: `https://rollupjs.org/guide/en/#outputformat`
  37898. });
  37899. }
  37900. };
  37901. const getInlineDynamicImports = (config, inputOptions) => {
  37902. var _a;
  37903. const inlineDynamicImports = ((_a = config.inlineDynamicImports) !== null && _a !== void 0 ? _a : inputOptions.inlineDynamicImports) ||
  37904. false;
  37905. const { input } = inputOptions;
  37906. if (inlineDynamicImports && (Array.isArray(input) ? input : Object.keys(input)).length > 1) {
  37907. return error({
  37908. code: 'INVALID_OPTION',
  37909. message: 'Multiple inputs are not supported for "output.inlineDynamicImports".'
  37910. });
  37911. }
  37912. return inlineDynamicImports;
  37913. };
  37914. const getPreserveModules = (config, inlineDynamicImports, inputOptions) => {
  37915. var _a;
  37916. const preserveModules = ((_a = config.preserveModules) !== null && _a !== void 0 ? _a : inputOptions.preserveModules) || false;
  37917. if (preserveModules) {
  37918. if (inlineDynamicImports) {
  37919. return error({
  37920. code: 'INVALID_OPTION',
  37921. message: `The "output.inlineDynamicImports" option is not supported for "output.preserveModules".`
  37922. });
  37923. }
  37924. if (inputOptions.preserveEntrySignatures === false) {
  37925. return error({
  37926. code: 'INVALID_OPTION',
  37927. message: 'Setting "preserveEntrySignatures" to "false" is not supported for "output.preserveModules".'
  37928. });
  37929. }
  37930. }
  37931. return preserveModules;
  37932. };
  37933. const getPreserveModulesRoot = (config) => {
  37934. const preserveModulesRoot = config.preserveModulesRoot;
  37935. if (preserveModulesRoot === null || preserveModulesRoot === undefined) {
  37936. return undefined;
  37937. }
  37938. return resolve$1(preserveModulesRoot);
  37939. };
  37940. const getAmd = (config) => {
  37941. const collection = {
  37942. autoId: false,
  37943. basePath: '',
  37944. define: 'define',
  37945. ...config.amd
  37946. };
  37947. if ((collection.autoId || collection.basePath) && collection.id) {
  37948. return error({
  37949. code: 'INVALID_OPTION',
  37950. message: '"output.amd.autoId"/"output.amd.basePath" and "output.amd.id" cannot be used together.'
  37951. });
  37952. }
  37953. if (collection.basePath && !collection.autoId) {
  37954. return error({
  37955. code: 'INVALID_OPTION',
  37956. message: '"output.amd.basePath" only works with "output.amd.autoId".'
  37957. });
  37958. }
  37959. let normalized;
  37960. if (collection.autoId) {
  37961. normalized = {
  37962. autoId: true,
  37963. basePath: collection.basePath,
  37964. define: collection.define
  37965. };
  37966. }
  37967. else {
  37968. normalized = {
  37969. autoId: false,
  37970. define: collection.define,
  37971. id: collection.id
  37972. };
  37973. }
  37974. return normalized;
  37975. };
  37976. const getAddon = (config, name) => {
  37977. const configAddon = config[name];
  37978. if (typeof configAddon === 'function') {
  37979. return configAddon;
  37980. }
  37981. return () => configAddon || '';
  37982. };
  37983. const getDir = (config, file) => {
  37984. const dir = config.dir;
  37985. if (typeof dir === 'string' && typeof file === 'string') {
  37986. return error({
  37987. code: 'INVALID_OPTION',
  37988. message: 'You must set either "output.file" for a single-file build or "output.dir" when generating multiple chunks.'
  37989. });
  37990. }
  37991. return dir;
  37992. };
  37993. const getDynamicImportFunction = (config, inputOptions) => {
  37994. const configDynamicImportFunction = config.dynamicImportFunction;
  37995. if (configDynamicImportFunction) {
  37996. warnDeprecation(`The "output.dynamicImportFunction" option is deprecated. Use the "renderDynamicImport" plugin hook instead.`, false, inputOptions);
  37997. }
  37998. return configDynamicImportFunction;
  37999. };
  38000. const getEntryFileNames = (config, unsetOptions) => {
  38001. const configEntryFileNames = config.entryFileNames;
  38002. if (configEntryFileNames == null) {
  38003. unsetOptions.add('entryFileNames');
  38004. }
  38005. return configEntryFileNames !== null && configEntryFileNames !== void 0 ? configEntryFileNames : '[name].js';
  38006. };
  38007. function getExports(config, unsetOptions) {
  38008. const configExports = config.exports;
  38009. if (configExports == null) {
  38010. unsetOptions.add('exports');
  38011. }
  38012. else if (!['default', 'named', 'none', 'auto'].includes(configExports)) {
  38013. return error(errInvalidExportOptionValue(configExports));
  38014. }
  38015. return configExports || 'auto';
  38016. }
  38017. const getIndent = (config, compact) => {
  38018. if (compact) {
  38019. return '';
  38020. }
  38021. const configIndent = config.indent;
  38022. return configIndent === false ? '' : configIndent !== null && configIndent !== void 0 ? configIndent : true;
  38023. };
  38024. const ALLOWED_INTEROP_TYPES = new Set(['auto', 'esModule', 'default', 'defaultOnly', true, false]);
  38025. const getInterop = (config, inputOptions) => {
  38026. const configInterop = config.interop;
  38027. const validatedInteropTypes = new Set();
  38028. const validateInterop = (interop) => {
  38029. if (!validatedInteropTypes.has(interop)) {
  38030. validatedInteropTypes.add(interop);
  38031. if (!ALLOWED_INTEROP_TYPES.has(interop)) {
  38032. return error({
  38033. code: 'INVALID_OPTION',
  38034. message: `The value ${JSON.stringify(interop)} is not supported for "output.interop". Use one of ${Array.from(ALLOWED_INTEROP_TYPES.values(), value => JSON.stringify(value)).join(', ')} instead.`,
  38035. url: 'https://rollupjs.org/guide/en/#outputinterop'
  38036. });
  38037. }
  38038. if (typeof interop === 'boolean') {
  38039. warnDeprecation({
  38040. message: `The boolean value "${interop}" for the "output.interop" option is deprecated. Use ${interop ? '"auto"' : '"esModule", "default" or "defaultOnly"'} instead.`,
  38041. url: 'https://rollupjs.org/guide/en/#outputinterop'
  38042. }, false, inputOptions);
  38043. }
  38044. }
  38045. return interop;
  38046. };
  38047. if (typeof configInterop === 'function') {
  38048. const interopPerId = Object.create(null);
  38049. let defaultInterop = null;
  38050. return id => id === null
  38051. ? defaultInterop || validateInterop((defaultInterop = configInterop(id)))
  38052. : id in interopPerId
  38053. ? interopPerId[id]
  38054. : validateInterop((interopPerId[id] = configInterop(id)));
  38055. }
  38056. return configInterop === undefined ? () => true : () => validateInterop(configInterop);
  38057. };
  38058. const getManualChunks = (config, inlineDynamicImports, preserveModules, inputOptions) => {
  38059. const configManualChunks = config.manualChunks || inputOptions.manualChunks;
  38060. if (configManualChunks) {
  38061. if (inlineDynamicImports) {
  38062. return error({
  38063. code: 'INVALID_OPTION',
  38064. message: 'The "output.manualChunks" option is not supported for "output.inlineDynamicImports".'
  38065. });
  38066. }
  38067. if (preserveModules) {
  38068. return error({
  38069. code: 'INVALID_OPTION',
  38070. message: 'The "output.manualChunks" option is not supported for "output.preserveModules".'
  38071. });
  38072. }
  38073. }
  38074. return configManualChunks || {};
  38075. };
  38076. const getMinifyInternalExports = (config, format, compact) => { var _a; return (_a = config.minifyInternalExports) !== null && _a !== void 0 ? _a : (compact || format === 'es' || format === 'system'); };
  38077. function rollup(rawInputOptions) {
  38078. return rollupInternal(rawInputOptions, null);
  38079. }
  38080. async function rollupInternal(rawInputOptions, watcher) {
  38081. const { options: inputOptions, unsetOptions: unsetInputOptions } = await getInputOptions(rawInputOptions, watcher !== null);
  38082. initialiseTimers(inputOptions);
  38083. const graph = new Graph(inputOptions, watcher);
  38084. // remove the cache option from the memory after graph creation (cache is not used anymore)
  38085. const useCache = rawInputOptions.cache !== false;
  38086. delete inputOptions.cache;
  38087. delete rawInputOptions.cache;
  38088. timeStart('BUILD', 1);
  38089. try {
  38090. await graph.pluginDriver.hookParallel('buildStart', [inputOptions]);
  38091. await graph.build();
  38092. }
  38093. catch (err) {
  38094. const watchFiles = Object.keys(graph.watchFiles);
  38095. if (watchFiles.length > 0) {
  38096. err.watchFiles = watchFiles;
  38097. }
  38098. await graph.pluginDriver.hookParallel('buildEnd', [err]);
  38099. await graph.pluginDriver.hookParallel('closeBundle', []);
  38100. throw err;
  38101. }
  38102. await graph.pluginDriver.hookParallel('buildEnd', []);
  38103. timeEnd('BUILD', 1);
  38104. const result = {
  38105. cache: useCache ? graph.getCache() : undefined,
  38106. closed: false,
  38107. async close() {
  38108. if (result.closed)
  38109. return;
  38110. result.closed = true;
  38111. await graph.pluginDriver.hookParallel('closeBundle', []);
  38112. },
  38113. async generate(rawOutputOptions) {
  38114. if (result.closed)
  38115. return error(errAlreadyClosed());
  38116. return handleGenerateWrite(false, inputOptions, unsetInputOptions, rawOutputOptions, graph);
  38117. },
  38118. watchFiles: Object.keys(graph.watchFiles),
  38119. async write(rawOutputOptions) {
  38120. if (result.closed)
  38121. return error(errAlreadyClosed());
  38122. return handleGenerateWrite(true, inputOptions, unsetInputOptions, rawOutputOptions, graph);
  38123. }
  38124. };
  38125. if (inputOptions.perf)
  38126. result.getTimings = getTimings;
  38127. return result;
  38128. }
  38129. async function getInputOptions(rawInputOptions, watchMode) {
  38130. if (!rawInputOptions) {
  38131. throw new Error('You must supply an options object to rollup');
  38132. }
  38133. const rawPlugins = ensureArray$5(rawInputOptions.plugins);
  38134. const { options, unsetOptions } = normalizeInputOptions(await rawPlugins.reduce(applyOptionHook(watchMode), Promise.resolve(rawInputOptions)));
  38135. normalizePlugins(options.plugins, ANONYMOUS_PLUGIN_PREFIX);
  38136. return { options, unsetOptions };
  38137. }
  38138. function applyOptionHook(watchMode) {
  38139. return async (inputOptions, plugin) => {
  38140. if (plugin.options)
  38141. return (plugin.options.call({ meta: { rollupVersion: version$1, watchMode } }, await inputOptions) || inputOptions);
  38142. return inputOptions;
  38143. };
  38144. }
  38145. function normalizePlugins(plugins, anonymousPrefix) {
  38146. for (let pluginIndex = 0; pluginIndex < plugins.length; pluginIndex++) {
  38147. const plugin = plugins[pluginIndex];
  38148. if (!plugin.name) {
  38149. plugin.name = `${anonymousPrefix}${pluginIndex + 1}`;
  38150. }
  38151. }
  38152. }
  38153. async function handleGenerateWrite(isWrite, inputOptions, unsetInputOptions, rawOutputOptions, graph) {
  38154. const { options: outputOptions, outputPluginDriver, unsetOptions } = getOutputOptionsAndPluginDriver(rawOutputOptions, graph.pluginDriver, inputOptions, unsetInputOptions);
  38155. const bundle = new Bundle(outputOptions, unsetOptions, inputOptions, outputPluginDriver, graph);
  38156. const generated = await bundle.generate(isWrite);
  38157. if (isWrite) {
  38158. if (!outputOptions.dir && !outputOptions.file) {
  38159. return error({
  38160. code: 'MISSING_OPTION',
  38161. message: 'You must specify "output.file" or "output.dir" for the build.'
  38162. });
  38163. }
  38164. await Promise.all(Object.keys(generated).map(chunkId => writeOutputFile(generated[chunkId], outputOptions)));
  38165. await outputPluginDriver.hookParallel('writeBundle', [outputOptions, generated]);
  38166. }
  38167. return createOutput(generated);
  38168. }
  38169. function getOutputOptionsAndPluginDriver(rawOutputOptions, inputPluginDriver, inputOptions, unsetInputOptions) {
  38170. if (!rawOutputOptions) {
  38171. throw new Error('You must supply an options object');
  38172. }
  38173. const rawPlugins = ensureArray$5(rawOutputOptions.plugins);
  38174. normalizePlugins(rawPlugins, ANONYMOUS_OUTPUT_PLUGIN_PREFIX);
  38175. const outputPluginDriver = inputPluginDriver.createOutputPluginDriver(rawPlugins);
  38176. return {
  38177. ...getOutputOptions(inputOptions, unsetInputOptions, rawOutputOptions, outputPluginDriver),
  38178. outputPluginDriver
  38179. };
  38180. }
  38181. function getOutputOptions(inputOptions, unsetInputOptions, rawOutputOptions, outputPluginDriver) {
  38182. return normalizeOutputOptions(outputPluginDriver.hookReduceArg0Sync('outputOptions', [rawOutputOptions.output || rawOutputOptions], (outputOptions, result) => result || outputOptions, pluginContext => {
  38183. const emitError = () => pluginContext.error(errCannotEmitFromOptionsHook());
  38184. return {
  38185. ...pluginContext,
  38186. emitFile: emitError,
  38187. setAssetSource: emitError
  38188. };
  38189. }), inputOptions, unsetInputOptions);
  38190. }
  38191. function createOutput(outputBundle) {
  38192. return {
  38193. output: Object.keys(outputBundle)
  38194. .map(fileName => outputBundle[fileName])
  38195. .filter(outputFile => Object.keys(outputFile).length > 0).sort((outputFileA, outputFileB) => {
  38196. const fileTypeA = getSortingFileType(outputFileA);
  38197. const fileTypeB = getSortingFileType(outputFileB);
  38198. if (fileTypeA === fileTypeB)
  38199. return 0;
  38200. return fileTypeA < fileTypeB ? -1 : 1;
  38201. })
  38202. };
  38203. }
  38204. var SortingFileType;
  38205. (function (SortingFileType) {
  38206. SortingFileType[SortingFileType["ENTRY_CHUNK"] = 0] = "ENTRY_CHUNK";
  38207. SortingFileType[SortingFileType["SECONDARY_CHUNK"] = 1] = "SECONDARY_CHUNK";
  38208. SortingFileType[SortingFileType["ASSET"] = 2] = "ASSET";
  38209. })(SortingFileType || (SortingFileType = {}));
  38210. function getSortingFileType(file) {
  38211. if (file.type === 'asset') {
  38212. return SortingFileType.ASSET;
  38213. }
  38214. if (file.isEntry) {
  38215. return SortingFileType.ENTRY_CHUNK;
  38216. }
  38217. return SortingFileType.SECONDARY_CHUNK;
  38218. }
  38219. function writeOutputFile(outputFile, outputOptions) {
  38220. const fileName = resolve$1(outputOptions.dir || dirname(outputOptions.file), outputFile.fileName);
  38221. let writeSourceMapPromise;
  38222. let source;
  38223. if (outputFile.type === 'asset') {
  38224. source = outputFile.source;
  38225. }
  38226. else {
  38227. source = outputFile.code;
  38228. if (outputOptions.sourcemap && outputFile.map) {
  38229. let url;
  38230. if (outputOptions.sourcemap === 'inline') {
  38231. url = outputFile.map.toUrl();
  38232. }
  38233. else {
  38234. url = `${basename(outputFile.fileName)}.map`;
  38235. writeSourceMapPromise = writeFile(`${fileName}.map`, outputFile.map.toString());
  38236. }
  38237. if (outputOptions.sourcemap !== 'hidden') {
  38238. source += `//# ${SOURCEMAPPING_URL}=${url}\n`;
  38239. }
  38240. }
  38241. }
  38242. return Promise.all([writeFile(fileName, source), writeSourceMapPromise]);
  38243. }
  38244. const devNodeModuleResolveId = async (config, inMemoryFs, resolvedId, importee) => {
  38245. if (!shouldCheckDevModule(resolvedId, importee)) {
  38246. return resolvedId;
  38247. }
  38248. const resolvedPath = resolvedId.id;
  38249. const pkgPath = getPackageJsonPath(resolvedPath, importee);
  38250. if (!pkgPath) {
  38251. return resolvedId;
  38252. }
  38253. const pkgJsonStr = await inMemoryFs.readFile(pkgPath);
  38254. if (!pkgJsonStr) {
  38255. return resolvedId;
  38256. }
  38257. let pkgJsonData;
  38258. try {
  38259. pkgJsonData = JSON.parse(pkgJsonStr);
  38260. }
  38261. catch (e) { }
  38262. if (!pkgJsonData || !pkgJsonData.version) {
  38263. return resolvedId;
  38264. }
  38265. resolvedId.id = serializeDevNodeModuleUrl(config, pkgJsonData.name, pkgJsonData.version, resolvedPath);
  38266. resolvedId.external = true;
  38267. return resolvedId;
  38268. };
  38269. const getPackageJsonPath = (resolvedPath, importee) => {
  38270. let currentPath = resolvedPath;
  38271. for (let i = 0; i < 10; i++) {
  38272. currentPath = dirname(currentPath);
  38273. const aBasename = basename(currentPath);
  38274. const upDir = dirname(currentPath);
  38275. const bBasename = basename(upDir);
  38276. if (aBasename === importee && bBasename === 'node_modules') {
  38277. return join(currentPath, 'package.json');
  38278. }
  38279. }
  38280. return null;
  38281. };
  38282. const compilerRequest = async (config, compilerCtx, data) => {
  38283. const results = {
  38284. path: data.path,
  38285. nodeModuleId: null,
  38286. nodeModuleVersion: null,
  38287. nodeResolvedPath: null,
  38288. cachePath: null,
  38289. cacheHit: false,
  38290. content: '',
  38291. status: 404,
  38292. };
  38293. try {
  38294. const parsedUrl = parseDevModuleUrl(config, data.path);
  38295. Object.assign(results, parsedUrl);
  38296. if (parsedUrl.nodeModuleId) {
  38297. if (!parsedUrl.nodeModuleVersion) {
  38298. results.content = `/* invalid module version */`;
  38299. results.status = 400;
  38300. return results;
  38301. }
  38302. if (!parsedUrl.nodeResolvedPath) {
  38303. results.content = `/* invalid resolved path */`;
  38304. results.status = 400;
  38305. return results;
  38306. }
  38307. const useCache = await useDevModuleCache(config, parsedUrl.nodeResolvedPath);
  38308. let cachePath = null;
  38309. if (useCache) {
  38310. cachePath = getDevModuleCachePath(config, parsedUrl);
  38311. const cachedContent = await config.sys.readFile(cachePath);
  38312. if (typeof cachedContent === 'string') {
  38313. results.content = cachedContent;
  38314. results.cachePath = cachePath;
  38315. results.cacheHit = true;
  38316. results.status = 200;
  38317. return results;
  38318. }
  38319. }
  38320. await bundleDevModule(config, compilerCtx, parsedUrl, results);
  38321. if (results.status === 200 && useCache) {
  38322. results.cachePath = cachePath;
  38323. writeCachedFile(config, results);
  38324. }
  38325. }
  38326. else {
  38327. results.content = `/* invalid dev module */`;
  38328. results.status = 400;
  38329. return results;
  38330. }
  38331. }
  38332. catch (e) {
  38333. if (e) {
  38334. if (e instanceof Error && e.stack) {
  38335. results.content = `/*\n${e.stack}\n*/`;
  38336. }
  38337. else {
  38338. results.content = `/*\n${e}\n*/`;
  38339. }
  38340. }
  38341. results.status = 500;
  38342. }
  38343. return results;
  38344. };
  38345. const bundleDevModule = async (config, compilerCtx, parsedUrl, results) => {
  38346. const buildCtx = new BuildContext(config, compilerCtx);
  38347. try {
  38348. const inputOpts = getRollupOptions(config, compilerCtx, buildCtx, {
  38349. id: parsedUrl.nodeModuleId,
  38350. platform: 'client',
  38351. inputs: {
  38352. index: parsedUrl.nodeResolvedPath,
  38353. },
  38354. });
  38355. const rollupBuild = await rollup(inputOpts);
  38356. const outputOpts = {
  38357. banner: generatePreamble(config),
  38358. format: 'es',
  38359. };
  38360. if (parsedUrl.nodeModuleId) {
  38361. const commentPath = relative$1(config.rootDir, parsedUrl.nodeResolvedPath);
  38362. outputOpts.intro = `/**\n * Dev Node Module: ${parsedUrl.nodeModuleId}, v${parsedUrl.nodeModuleVersion}\n * Entry: ${commentPath}\n * DEVELOPMENT PURPOSES ONLY!!\n */`;
  38363. inputOpts.input = parsedUrl.nodeResolvedPath;
  38364. }
  38365. const r = await rollupBuild.generate(outputOpts);
  38366. if (buildCtx.hasError) {
  38367. results.status = 500;
  38368. results.content = `console.error(${JSON.stringify(buildCtx.diagnostics)})`;
  38369. }
  38370. else if (r && r.output && r.output.length > 0) {
  38371. results.content = r.output[0].code;
  38372. results.status = 200;
  38373. }
  38374. }
  38375. catch (e) {
  38376. results.status = 500;
  38377. const errorMsg = e instanceof Error ? e.stack : e + '';
  38378. results.content = `console.error(${JSON.stringify(errorMsg)})`;
  38379. }
  38380. };
  38381. const useDevModuleCache = async (config, p) => {
  38382. if (config.enableCache) {
  38383. for (let i = 0; i < 10; i++) {
  38384. const n = basename(p);
  38385. if (n === 'node_modules') {
  38386. return true;
  38387. }
  38388. const isSymbolicLink = await config.sys.isSymbolicLink(p);
  38389. if (isSymbolicLink) {
  38390. return false;
  38391. }
  38392. p = dirname(p);
  38393. }
  38394. }
  38395. return false;
  38396. };
  38397. const writeCachedFile = async (config, results) => {
  38398. try {
  38399. await config.sys.createDir(config.cacheDir);
  38400. config.sys.writeFile(results.cachePath, results.content);
  38401. }
  38402. catch (e) {
  38403. console.error(e);
  38404. }
  38405. };
  38406. const serializeDevNodeModuleUrl = (config, moduleId, moduleVersion, resolvedPath) => {
  38407. resolvedPath = relative$1(config.rootDir, resolvedPath);
  38408. let id = `/${DEV_MODULE_DIR}/`;
  38409. id += encodeURIComponent(moduleId) + '@';
  38410. id += encodeURIComponent(moduleVersion) + '.js';
  38411. id += '?p=' + encodeURIComponent(resolvedPath);
  38412. return id;
  38413. };
  38414. const parseDevModuleUrl = (config, u) => {
  38415. const parsedUrl = {
  38416. nodeModuleId: null,
  38417. nodeModuleVersion: null,
  38418. nodeResolvedPath: null,
  38419. };
  38420. if (u && u.includes(DEV_MODULE_DIR) && u.endsWith('.js')) {
  38421. const url = new URL(u, 'https://stenciljs.com');
  38422. let reqPath = basename(url.pathname);
  38423. reqPath = reqPath.substring(0, reqPath.length - 3);
  38424. let splt = reqPath.split('@');
  38425. if (splt.length === 2) {
  38426. parsedUrl.nodeModuleId = decodeURIComponent(splt[0]);
  38427. parsedUrl.nodeModuleVersion = decodeURIComponent(splt[1]);
  38428. parsedUrl.nodeResolvedPath = url.searchParams.get('p');
  38429. if (parsedUrl.nodeResolvedPath) {
  38430. parsedUrl.nodeResolvedPath = decodeURIComponent(parsedUrl.nodeResolvedPath);
  38431. parsedUrl.nodeResolvedPath = join(config.rootDir, parsedUrl.nodeResolvedPath);
  38432. }
  38433. }
  38434. }
  38435. return parsedUrl;
  38436. };
  38437. const getDevModuleCachePath = (config, parsedUrl) => {
  38438. return join(config.cacheDir, `dev_module_${parsedUrl.nodeModuleId}_${parsedUrl.nodeModuleVersion}_${DEV_MODULE_CACHE_BUSTER}.log`);
  38439. };
  38440. const DEV_MODULE_CACHE_BUSTER = 0;
  38441. const DEV_MODULE_DIR = `~dev-module`;
  38442. const shouldCheckDevModule = (resolvedId, importee) => resolvedId &&
  38443. importee &&
  38444. resolvedId.id &&
  38445. resolvedId.id.includes('node_modules') &&
  38446. (resolvedId.id.endsWith('.js') || resolvedId.id.endsWith('.mjs')) &&
  38447. !resolvedId.external &&
  38448. !importee.startsWith('.') &&
  38449. !importee.startsWith('/');
  38450. const extFormatPlugin = (config) => {
  38451. return {
  38452. name: 'extFormatPlugin',
  38453. transform(code, importPath) {
  38454. if (/\0/.test(importPath)) {
  38455. return null;
  38456. }
  38457. const { ext, filePath, format } = normalizeFsPathQuery(importPath);
  38458. // ?format= param takes precedence before file extension
  38459. switch (format) {
  38460. case 'url':
  38461. return { code: formatUrl(config, this, code, filePath, ext), map: null };
  38462. case 'text':
  38463. return { code: formatText(code, filePath), map: null };
  38464. }
  38465. // didn't provide a ?format= param
  38466. // check if it's a known extension we should format
  38467. if (FORMAT_TEXT_EXTS.includes(ext)) {
  38468. return { code: formatText(code, filePath), map: null };
  38469. }
  38470. if (FORMAT_URL_MIME[ext]) {
  38471. return { code: formatUrl(config, this, code, filePath, ext), map: null };
  38472. }
  38473. return null;
  38474. },
  38475. };
  38476. };
  38477. const FORMAT_TEXT_EXTS = ['txt', 'frag', 'vert'];
  38478. const FORMAT_URL_MIME = {
  38479. svg: 'image/svg+xml',
  38480. };
  38481. const DATAURL_MAX_IMAGE_SIZE = 4 * 1024; // 4KiB
  38482. const formatText = (code, filePath) => {
  38483. const varName = createJsVarName(basename(filePath));
  38484. return `const ${varName} = ${JSON.stringify(code)};export default ${varName};`;
  38485. };
  38486. const formatUrl = (config, pluginCtx, code, filePath, ext) => {
  38487. const mime = FORMAT_URL_MIME[ext];
  38488. if (!mime) {
  38489. pluginCtx.warn(`Unsupported url format for "${ext}" extension.`);
  38490. return formatText('', filePath);
  38491. }
  38492. const varName = createJsVarName(basename(filePath));
  38493. const base64 = config.sys.encodeToBase64(code);
  38494. if (config.devMode && base64.length > DATAURL_MAX_IMAGE_SIZE) {
  38495. pluginCtx.warn(`Importing large files will bloat your bundle size, please use external assets instead.`);
  38496. }
  38497. return `const ${varName} = 'data:${mime};base64,${base64}';export default ${varName};`;
  38498. };
  38499. const extTransformsPlugin = (config, compilerCtx, buildCtx, bundleOpts) => {
  38500. return {
  38501. name: 'extTransformsPlugin',
  38502. async transform(_, id) {
  38503. if (/\0/.test(id)) {
  38504. return null;
  38505. }
  38506. const { data } = parseImportPath(id);
  38507. if (data != null) {
  38508. let cmp;
  38509. const filePath = normalizeFsPath(id);
  38510. const code = await compilerCtx.fs.readFile(filePath);
  38511. if (typeof code !== 'string') {
  38512. return null;
  38513. }
  38514. const pluginTransforms = await runPluginTransformsEsmImports(config, compilerCtx, buildCtx, code, filePath);
  38515. const commentOriginalSelector = bundleOpts.platform === 'hydrate' && data.encapsulation === 'shadow';
  38516. if (data.tag) {
  38517. cmp = buildCtx.components.find((c) => c.tagName === data.tag);
  38518. const moduleFile = cmp && compilerCtx.moduleMap.get(cmp.sourceFilePath);
  38519. if (moduleFile) {
  38520. const collectionDirs = config.outputTargets.filter(isOutputTargetDistCollection);
  38521. const relPath = relative$1(config.srcDir, pluginTransforms.id);
  38522. await Promise.all(collectionDirs.map(async (outputTarget) => {
  38523. const collectionPath = join(outputTarget.collectionDir, relPath);
  38524. await compilerCtx.fs.writeFile(collectionPath, pluginTransforms.code);
  38525. }));
  38526. }
  38527. }
  38528. const cssTransformResults = await compilerCtx.worker.transformCssToEsm({
  38529. file: pluginTransforms.id,
  38530. input: pluginTransforms.code,
  38531. tag: data.tag,
  38532. encapsulation: data.encapsulation,
  38533. mode: data.mode,
  38534. commentOriginalSelector,
  38535. sourceMap: config.sourceMap,
  38536. minify: config.minifyCss,
  38537. autoprefixer: config.autoprefixCss,
  38538. docs: config.buildDocs,
  38539. });
  38540. // Set style docs
  38541. if (cmp) {
  38542. cmp.styleDocs = cssTransformResults.styleDocs;
  38543. }
  38544. // Track dependencies
  38545. for (const dep of pluginTransforms.dependencies) {
  38546. this.addWatchFile(dep);
  38547. compilerCtx.addWatchFile(dep);
  38548. }
  38549. buildCtx.diagnostics.push(...pluginTransforms.diagnostics);
  38550. buildCtx.diagnostics.push(...cssTransformResults.diagnostics);
  38551. const didError = hasError(cssTransformResults.diagnostics) || hasError(pluginTransforms.diagnostics);
  38552. if (didError) {
  38553. this.error('Plugin CSS transform error');
  38554. }
  38555. const hasUpdatedStyle = buildCtx.stylesUpdated.some((s) => {
  38556. return s.styleTag === data.tag && s.styleMode === data.mode && s.styleText === cssTransformResults.styleText;
  38557. });
  38558. if (!hasUpdatedStyle) {
  38559. buildCtx.stylesUpdated.push({
  38560. styleTag: data.tag,
  38561. styleMode: data.mode,
  38562. styleText: cssTransformResults.styleText,
  38563. });
  38564. }
  38565. return {
  38566. code: cssTransformResults.output,
  38567. map: cssTransformResults.map,
  38568. moduleSideEffects: false,
  38569. };
  38570. }
  38571. return null;
  38572. },
  38573. };
  38574. };
  38575. const fileLoadPlugin = (fs) => {
  38576. return {
  38577. name: 'fileLoadPlugin',
  38578. load(id) {
  38579. const fsFilePath = normalizeFsPath(id);
  38580. if (id.endsWith('.d.ts')) {
  38581. return '';
  38582. }
  38583. return fs.readFile(fsFilePath);
  38584. },
  38585. };
  38586. };
  38587. const lazyComponentPlugin = (buildCtx) => {
  38588. const entrys = new Map();
  38589. const plugin = {
  38590. name: 'lazyComponentPlugin',
  38591. resolveId(importee) {
  38592. const entryModule = buildCtx.entryModules.find((entryModule) => entryModule.entryKey === importee);
  38593. if (entryModule) {
  38594. entrys.set(importee, entryModule);
  38595. return importee;
  38596. }
  38597. return null;
  38598. },
  38599. load(id) {
  38600. const entryModule = entrys.get(id);
  38601. if (entryModule) {
  38602. return entryModule.cmps.map(createComponentExport).join('\n');
  38603. }
  38604. return null;
  38605. },
  38606. };
  38607. return plugin;
  38608. };
  38609. const createComponentExport = (cmp) => {
  38610. const originalClassName = cmp.componentClassName;
  38611. const underscoredClassName = cmp.tagName.replace(/-/g, '_');
  38612. const filePath = normalizePath$1(cmp.sourceFilePath);
  38613. return `export { ${originalClassName} as ${underscoredClassName} } from '${filePath}';`;
  38614. };
  38615. /**
  38616. * Rollup plugin that aids in resolving the entry points (1 or more files) for a Stencil project. For example, a project
  38617. * using the `dist-custom-elements` output target may have a single 'entry point' for each file containing a component.
  38618. * Each of those files will be independently resolved and loaded by this plugin for further processing by Rollup later
  38619. * in the bundling process.
  38620. * @param entries the Stencil project files to process. It should be noted that the keys in this object may not
  38621. * necessarily be an absolute or relative path to a file, but may be a Rollup Virtual Module (which begin with \0).
  38622. * @returns the rollup plugin that loads and process a Stencil project's entry points
  38623. */
  38624. const loaderPlugin = (entries = {}) => {
  38625. return {
  38626. name: 'stencilLoaderPlugin',
  38627. /**
  38628. * A rollup build hook for resolving the imports of individual Stencil project files. This hook only resolves
  38629. * modules that are contained in the plugin's `entries` argument. [Source](https://rollupjs.org/guide/en/#resolveid)
  38630. * @param id the importee to resolve
  38631. * @returns a string that resolves an import to some id, null otherwise
  38632. */
  38633. resolveId(id) {
  38634. if (id in entries) {
  38635. return {
  38636. id,
  38637. };
  38638. }
  38639. return null;
  38640. },
  38641. /**
  38642. * A rollup build hook for loading individual Stencil project files [Source](https://rollupjs.org/guide/en/#load)
  38643. * @param id the path of the module to load. It should be noted that the keys in this object may not necessarily
  38644. * be an absolute or relative path to a file, but may be a Rollup Virtual Module.
  38645. * @returns the module matched, null otherwise
  38646. */
  38647. load(id) {
  38648. if (id in entries) {
  38649. return entries[id];
  38650. }
  38651. return null;
  38652. },
  38653. };
  38654. };
  38655. const pluginHelper = (config, builtCtx, platform) => {
  38656. return {
  38657. name: 'pluginHelper',
  38658. resolveId(importee, importer) {
  38659. if (/\0/.test(importee)) {
  38660. // ignore IDs with null character, these belong to other plugins
  38661. return null;
  38662. }
  38663. if (importee.endsWith('/')) {
  38664. importee = importee.slice(0, -1);
  38665. }
  38666. if (builtIns.has(importee)) {
  38667. let fromMsg = '';
  38668. if (importer) {
  38669. fromMsg = ` from ${relative$1(config.rootDir, importer)}`;
  38670. }
  38671. const diagnostic = buildError(builtCtx.diagnostics);
  38672. diagnostic.header = `Node Polyfills Required`;
  38673. diagnostic.messageText = `For the import "${importee}" to be bundled${fromMsg}, ensure the "rollup-plugin-node-polyfills" plugin is installed and added to the stencil config plugins (${platform}). Please see the bundling docs for more information.
  38674. Further information: https://stenciljs.com/docs/module-bundling`;
  38675. }
  38676. return null;
  38677. },
  38678. };
  38679. };
  38680. const builtIns = new Set([
  38681. 'child_process',
  38682. 'cluster',
  38683. 'dgram',
  38684. 'dns',
  38685. 'module',
  38686. 'net',
  38687. 'readline',
  38688. 'repl',
  38689. 'tls',
  38690. 'assert',
  38691. 'console',
  38692. 'constants',
  38693. 'domain',
  38694. 'events',
  38695. 'path',
  38696. 'punycode',
  38697. 'querystring',
  38698. '_stream_duplex',
  38699. '_stream_passthrough',
  38700. '_stream_readable',
  38701. '_stream_writable',
  38702. '_stream_transform',
  38703. 'string_decoder',
  38704. 'sys',
  38705. 'tty',
  38706. 'crypto',
  38707. 'fs',
  38708. 'Buffer',
  38709. 'buffer',
  38710. 'global',
  38711. 'http',
  38712. 'https',
  38713. 'os',
  38714. 'process',
  38715. 'stream',
  38716. 'timers',
  38717. 'url',
  38718. 'util',
  38719. 'vm',
  38720. 'zlib',
  38721. ]);
  38722. const getModule = (compilerCtx, filePath) => compilerCtx.moduleMap.get(normalizePath$1(filePath));
  38723. const createModule = (staticSourceFile, // this is NOT the original
  38724. staticSourceFileText, emitFilepath) => ({
  38725. sourceFilePath: normalizePath$1(staticSourceFile.fileName),
  38726. jsFilePath: emitFilepath,
  38727. staticSourceFile,
  38728. staticSourceFileText,
  38729. cmps: [],
  38730. coreRuntimeApis: [],
  38731. collectionName: null,
  38732. dtsFilePath: null,
  38733. excludeFromCollection: false,
  38734. externalImports: [],
  38735. hasVdomAttribute: false,
  38736. hasVdomClass: false,
  38737. hasVdomFunctional: false,
  38738. hasVdomKey: false,
  38739. hasVdomListener: false,
  38740. hasVdomPropOrAttr: false,
  38741. hasVdomRef: false,
  38742. hasVdomRender: false,
  38743. hasVdomStyle: false,
  38744. hasVdomText: false,
  38745. hasVdomXlink: false,
  38746. htmlAttrNames: [],
  38747. htmlParts: [],
  38748. htmlTagNames: [],
  38749. isCollectionDependency: false,
  38750. isLegacy: false,
  38751. localImports: [],
  38752. originalCollectionComponentPath: null,
  38753. originalImports: [],
  38754. potentialCmpRefs: [],
  38755. sourceMapPath: null,
  38756. sourceMapFileText: null,
  38757. });
  38758. const fetchModuleSync = (sys, inMemoryFs, pkgVersions, url, filePath) => {
  38759. if (skipFilePathFetch(filePath)) {
  38760. return undefined;
  38761. }
  38762. const content = fetchUrlSync(url);
  38763. if (isString$1(content)) {
  38764. writeFetchSuccessSync(sys, inMemoryFs, url, filePath, content, pkgVersions);
  38765. }
  38766. return content;
  38767. };
  38768. const fetchUrlSync = (url) => {
  38769. if (known404Urls.has(url) || skipUrlFetch(url)) {
  38770. return undefined;
  38771. }
  38772. try {
  38773. const xhr = new XMLHttpRequest();
  38774. xhr.open('GET', url, false);
  38775. xhr.send(null);
  38776. if (xhr.status >= 200 && xhr.status <= 299) {
  38777. return xhr.responseText;
  38778. }
  38779. }
  38780. catch (e) { }
  38781. known404Urls.add(url);
  38782. return undefined;
  38783. };
  38784. const patchTsSystemFileSystem = (config, stencilSys, inMemoryFs, tsSys) => {
  38785. const realpath = (path) => {
  38786. const rp = stencilSys.realpathSync(path);
  38787. if (isString$1(rp)) {
  38788. return rp;
  38789. }
  38790. return path;
  38791. };
  38792. const getAccessibleFileSystemEntries = (path) => {
  38793. try {
  38794. const entries = stencilSys.readDirSync(path || '.').sort();
  38795. const files = [];
  38796. const directories = [];
  38797. for (const absPath of entries) {
  38798. // This is necessary because on some file system node fails to exclude
  38799. // "." and "..". See https://github.com/nodejs/node/issues/4002
  38800. const stat = inMemoryFs.statSync(absPath);
  38801. if (!stat) {
  38802. continue;
  38803. }
  38804. const entry = basename(absPath);
  38805. if (stat.isFile) {
  38806. files.push(entry);
  38807. }
  38808. else if (stat.isDirectory) {
  38809. directories.push(entry);
  38810. }
  38811. }
  38812. return { files, directories };
  38813. }
  38814. catch (e) {
  38815. return { files: [], directories: [] };
  38816. }
  38817. };
  38818. tsSys.createDirectory = (p) => {
  38819. stencilSys.createDirSync(p, { recursive: true });
  38820. };
  38821. tsSys.directoryExists = (p) => {
  38822. const s = inMemoryFs.statSync(p);
  38823. return s.isDirectory;
  38824. };
  38825. tsSys.exit = stencilSys.exit;
  38826. tsSys.fileExists = (p) => {
  38827. let filePath = p;
  38828. if (isRemoteUrl(p)) {
  38829. filePath = getTypescriptPathFromUrl(config, tsSys.getExecutingFilePath(), p);
  38830. }
  38831. const s = inMemoryFs.statSync(filePath);
  38832. return !!(s && s.isFile);
  38833. };
  38834. tsSys.getCurrentDirectory = stencilSys.getCurrentDirectory;
  38835. tsSys.getExecutingFilePath = stencilSys.getCompilerExecutingPath;
  38836. tsSys.getDirectories = (p) => {
  38837. const items = stencilSys.readDirSync(p);
  38838. return items.filter((itemPath) => {
  38839. const s = inMemoryFs.statSync(itemPath);
  38840. return !!(s && s.exists && s.isDirectory);
  38841. });
  38842. };
  38843. tsSys.readDirectory = (path, extensions, exclude, include, depth) => {
  38844. const cwd = stencilSys.getCurrentDirectory();
  38845. // TODO(STENCIL-344): Replace `matchFiles` with a function that is publicly exposed
  38846. return t.matchFiles(path, extensions, exclude, include, IS_CASE_SENSITIVE_FILE_NAMES, cwd, depth, getAccessibleFileSystemEntries, realpath);
  38847. };
  38848. tsSys.readFile = (p) => {
  38849. let filePath = p;
  38850. const isUrl = isRemoteUrl(p);
  38851. if (isUrl) {
  38852. filePath = getTypescriptPathFromUrl(config, tsSys.getExecutingFilePath(), p);
  38853. }
  38854. let content = inMemoryFs.readFileSync(filePath, { useCache: isUrl });
  38855. if (typeof content !== 'string' && isUrl) {
  38856. if (IS_WEB_WORKER_ENV) {
  38857. content = fetchUrlSync(p);
  38858. if (typeof content === 'string') {
  38859. inMemoryFs.writeFile(filePath, content);
  38860. }
  38861. }
  38862. else {
  38863. config.logger.error(`ts.sys can only request http resources from within a web worker: ${p}`);
  38864. }
  38865. }
  38866. return content;
  38867. };
  38868. tsSys.writeFile = (p, data) => inMemoryFs.writeFile(p, data);
  38869. return tsSys;
  38870. };
  38871. const patchTsSystemWatch = (stencilSys, tsSys) => {
  38872. tsSys.watchDirectory = (p, cb, recursive) => {
  38873. const watcher = stencilSys.watchDirectory(p, (filePath) => {
  38874. cb(filePath);
  38875. }, recursive);
  38876. return {
  38877. close() {
  38878. watcher.close();
  38879. },
  38880. };
  38881. };
  38882. tsSys.watchFile = (p, cb) => {
  38883. const watcher = stencilSys.watchFile(p, (filePath, eventKind) => {
  38884. if (eventKind === 'fileAdd') {
  38885. cb(filePath, t.FileWatcherEventKind.Created);
  38886. }
  38887. else if (eventKind === 'fileUpdate') {
  38888. cb(filePath, t.FileWatcherEventKind.Changed);
  38889. }
  38890. else if (eventKind === 'fileDelete') {
  38891. cb(filePath, t.FileWatcherEventKind.Deleted);
  38892. }
  38893. });
  38894. return {
  38895. close() {
  38896. watcher.close();
  38897. },
  38898. };
  38899. };
  38900. };
  38901. const patchTypescript = (config, inMemoryFs) => {
  38902. if (!t.__patched) {
  38903. if (config.sys) {
  38904. patchTsSystemFileSystem(config, config.sys, inMemoryFs, t.sys);
  38905. patchTsSystemWatch(config.sys, t.sys);
  38906. }
  38907. patchTypeScriptResolveModule(config, inMemoryFs);
  38908. patchTypeScriptGetParsedCommandLineOfConfigFile();
  38909. t.__patched = true;
  38910. }
  38911. };
  38912. const patchTypeScriptSysMinimum = () => {
  38913. if (!t.sys) {
  38914. // patches just the bare minimum
  38915. // if ts.sys already exists then it must be node ts.sys
  38916. // otherwise we're browser
  38917. // will be updated later on with the stencil sys
  38918. t.sys = {
  38919. args: [],
  38920. createDirectory: noop$1,
  38921. directoryExists: () => false,
  38922. exit: noop$1,
  38923. fileExists: () => false,
  38924. getCurrentDirectory,
  38925. getDirectories: () => [],
  38926. getExecutingFilePath: () => './',
  38927. readDirectory: () => [],
  38928. readFile: noop$1,
  38929. newLine: '\n',
  38930. resolvePath: resolve$1,
  38931. useCaseSensitiveFileNames: false,
  38932. write: noop$1,
  38933. writeFile: noop$1,
  38934. };
  38935. }
  38936. };
  38937. patchTypeScriptSysMinimum();
  38938. const getTypescriptPathFromUrl = (config, tsExecutingUrl, url) => {
  38939. const tsBaseUrl = new URL('..', tsExecutingUrl).href;
  38940. if (url.startsWith(tsBaseUrl)) {
  38941. const tsFilePath = url.replace(tsBaseUrl, '/');
  38942. const tsNodePath = config.sys.getLocalModulePath({
  38943. rootDir: config.rootDir,
  38944. moduleId: '@stencil/core',
  38945. path: tsFilePath,
  38946. });
  38947. return normalizePath$1(tsNodePath);
  38948. }
  38949. return url;
  38950. };
  38951. const patchTypeScriptGetParsedCommandLineOfConfigFile = () => {
  38952. const orgGetParsedCommandLineOfConfigFile = t.getParsedCommandLineOfConfigFile;
  38953. t.getParsedCommandLineOfConfigFile = (configFileName, optionsToExtend, host, extendedConfigCache) => {
  38954. const results = orgGetParsedCommandLineOfConfigFile(configFileName, optionsToExtend, host, extendedConfigCache);
  38955. // manually filter out any .spec or .e2e files
  38956. results.fileNames = results.fileNames.filter((f) => {
  38957. // filter e2e tests
  38958. if (f.includes('.e2e.') || f.includes('/e2e.')) {
  38959. return false;
  38960. }
  38961. // filter spec tests
  38962. if (f.includes('.spec.') || f.includes('/spec.')) {
  38963. return false;
  38964. }
  38965. return true;
  38966. });
  38967. return results;
  38968. };
  38969. };
  38970. const resolveRemoteModuleIdSync = (config, inMemoryFs, opts) => {
  38971. const packageJson = resolveRemotePackageJsonSync(config, inMemoryFs, opts.moduleId);
  38972. if (packageJson) {
  38973. const resolveModuleSyncOpts = {
  38974. ...opts,
  38975. exts: ['.js', '.mjs'],
  38976. };
  38977. const resolvedUrl = resolveModuleIdSync(config.sys, inMemoryFs, resolveModuleSyncOpts);
  38978. if (typeof resolvedUrl === 'string') {
  38979. return {
  38980. resolvedUrl,
  38981. packageJson,
  38982. };
  38983. }
  38984. }
  38985. return null;
  38986. };
  38987. const resolveRemotePackageJsonSync = (config, inMemoryFs, moduleId) => {
  38988. if (inMemoryFs) {
  38989. const filePath = normalizePath$1(config.sys.getLocalModulePath({ rootDir: config.rootDir, moduleId, path: 'package.json' }));
  38990. let pkgJson = inMemoryFs.readFileSync(filePath);
  38991. if (!isString$1(pkgJson) && IS_WEB_WORKER_ENV) {
  38992. const url = config.sys.getRemoteModuleUrl({ moduleId, path: 'package.json' });
  38993. pkgJson = fetchModuleSync(config.sys, inMemoryFs, packageVersions, url, filePath);
  38994. }
  38995. if (typeof pkgJson === 'string') {
  38996. try {
  38997. return JSON.parse(pkgJson);
  38998. }
  38999. catch (e) { }
  39000. }
  39001. }
  39002. return null;
  39003. };
  39004. const resolveModuleIdSync = (sys, inMemoryFs, opts) => {
  39005. if (inMemoryFs) {
  39006. const resolverOpts = createCustomResolverSync(sys, inMemoryFs, opts.exts);
  39007. resolverOpts.basedir = dirname(opts.containingFile);
  39008. resolverOpts.packageFilter = opts.packageFilter;
  39009. const resolvedModule = resolve.sync(opts.moduleId, resolverOpts);
  39010. return resolvedModule;
  39011. }
  39012. return null;
  39013. };
  39014. const createCustomResolverSync = (sys, inMemoryFs, exts) => {
  39015. return {
  39016. isFile(filePath) {
  39017. const fsFilePath = normalizeFsPath(filePath);
  39018. const stat = inMemoryFs.statSync(fsFilePath);
  39019. if (stat.isFile) {
  39020. return true;
  39021. }
  39022. if (shouldFetchModule(fsFilePath)) {
  39023. const endsWithExt = exts.some((ext) => fsFilePath.endsWith(ext));
  39024. if (!endsWithExt) {
  39025. return false;
  39026. }
  39027. const url = getNodeModuleFetchUrl(sys, packageVersions, fsFilePath);
  39028. const content = fetchModuleSync(sys, inMemoryFs, packageVersions, url, fsFilePath);
  39029. return typeof content === 'string';
  39030. }
  39031. return false;
  39032. },
  39033. isDirectory(dirPath) {
  39034. const fsDirPath = normalizeFsPath(dirPath);
  39035. const stat = inMemoryFs.statSync(fsDirPath);
  39036. if (stat.isDirectory) {
  39037. return true;
  39038. }
  39039. if (shouldFetchModule(fsDirPath)) {
  39040. if (basename(fsDirPath) === 'node_modules') {
  39041. // just the /node_modules directory
  39042. inMemoryFs.sys.createDirSync(fsDirPath);
  39043. inMemoryFs.clearFileCache(fsDirPath);
  39044. return true;
  39045. }
  39046. if (isCommonDirModuleFile(fsDirPath)) {
  39047. // don't bother seeing if it's a directory if it has a common file extension
  39048. return false;
  39049. }
  39050. const checkFileExists = (fileName) => {
  39051. const url = getCommonDirUrl(sys, packageVersions, fsDirPath, fileName);
  39052. const filePath = getCommonDirName(fsDirPath, fileName);
  39053. const content = fetchModuleSync(sys, inMemoryFs, packageVersions, url, filePath);
  39054. return isString$1(content);
  39055. };
  39056. return COMMON_DIR_FILENAMES.some(checkFileExists);
  39057. }
  39058. return false;
  39059. },
  39060. readFileSync(p) {
  39061. const data = inMemoryFs.readFileSync(p);
  39062. if (isString$1(data)) {
  39063. return data;
  39064. }
  39065. throw new Error(`file not found: ${p}`);
  39066. },
  39067. realpathSync(p) {
  39068. const fsFilePath = normalizeFsPath(p);
  39069. try {
  39070. return sys.realpathSync(fsFilePath);
  39071. }
  39072. catch (realpathErr) {
  39073. if (isErrnoException(realpathErr)) {
  39074. if (realpathErr.code !== 'ENOENT') {
  39075. throw realpathErr;
  39076. }
  39077. }
  39078. }
  39079. return fsFilePath;
  39080. },
  39081. extensions: exts,
  39082. };
  39083. };
  39084. /**
  39085. * Type guard to determine if an Error is an instance of `ErrnoException`. For the purposes of this type guard, we
  39086. * must ensure that the `code` field is present. This type guard was written with the `ErrnoException` definition from
  39087. * https://github.com/DefinitelyTyped/DefinitelyTyped/blob/d121716ed123957f6a86f8985eb013fcaddab345/types/node/globals.d.ts#L183-L188
  39088. * in mind.
  39089. * @param err the entity to check the type of
  39090. * @return true if the provided value is an instance of `ErrnoException`, `false` otherwise
  39091. */
  39092. function isErrnoException(err) {
  39093. return err instanceof Error && err.hasOwnProperty('code');
  39094. }
  39095. const patchTypeScriptResolveModule = (config, inMemoryFs) => {
  39096. let compilerExe;
  39097. if (config.sys) {
  39098. compilerExe = config.sys.getCompilerExecutingPath();
  39099. }
  39100. else if (IS_BROWSER_ENV) {
  39101. compilerExe = location.href;
  39102. }
  39103. if (shouldPatchRemoteTypeScript(compilerExe)) {
  39104. const resolveModuleName = (t.__resolveModuleName = t.resolveModuleName);
  39105. t.resolveModuleName = (moduleName, containingFile, compilerOptions, host, cache, redirectedReference) => {
  39106. const resolvedModule = patchedTsResolveModule(config, inMemoryFs, moduleName, containingFile);
  39107. if (resolvedModule) {
  39108. return resolvedModule;
  39109. }
  39110. return resolveModuleName(moduleName, containingFile, compilerOptions, host, cache, redirectedReference);
  39111. };
  39112. }
  39113. };
  39114. const tsResolveModuleName = (config, compilerCtx, moduleName, containingFile) => {
  39115. const resolveModuleName = t.__resolveModuleName || t.resolveModuleName;
  39116. if (moduleName && resolveModuleName && config.tsCompilerOptions) {
  39117. const host = patchTsSystemFileSystem(config, config.sys, compilerCtx.fs, t.sys);
  39118. const compilerOptions = { ...config.tsCompilerOptions };
  39119. compilerOptions.resolveJsonModule = true;
  39120. return resolveModuleName(moduleName, containingFile, compilerOptions, host);
  39121. }
  39122. return null;
  39123. };
  39124. const tsResolveModuleNamePackageJsonPath = (config, compilerCtx, moduleName, containingFile) => {
  39125. try {
  39126. const resolvedModule = tsResolveModuleName(config, compilerCtx, moduleName, containingFile);
  39127. if (resolvedModule && resolvedModule.resolvedModule && resolvedModule.resolvedModule.resolvedFileName) {
  39128. const rootDir = resolve$1('/');
  39129. let resolvedFileName = resolvedModule.resolvedModule.resolvedFileName;
  39130. for (let i = 0; i < 30; i++) {
  39131. if (rootDir === resolvedFileName) {
  39132. return null;
  39133. }
  39134. resolvedFileName = dirname(resolvedFileName);
  39135. const pkgJsonPath = join(resolvedFileName, 'package.json');
  39136. const exists = config.sys.accessSync(pkgJsonPath);
  39137. if (exists) {
  39138. return normalizePath$1(pkgJsonPath);
  39139. }
  39140. }
  39141. }
  39142. }
  39143. catch (e) {
  39144. config.logger.error(e);
  39145. }
  39146. return null;
  39147. };
  39148. const patchedTsResolveModule = (config, inMemoryFs, moduleName, containingFile) => {
  39149. if (isLocalModule(moduleName)) {
  39150. const containingDir = dirname(containingFile);
  39151. let resolvedFileName = join(containingDir, moduleName);
  39152. resolvedFileName = normalizePath$1(ensureExtension(resolvedFileName, containingFile));
  39153. if (isAbsolute$1(resolvedFileName) && !inMemoryFs.accessSync(resolvedFileName)) {
  39154. return null;
  39155. }
  39156. if (!isAbsolute$1(resolvedFileName) && !resolvedFileName.startsWith('.') && !resolvedFileName.startsWith('/')) {
  39157. resolvedFileName = './' + resolvedFileName;
  39158. }
  39159. const rtn = {
  39160. resolvedModule: {
  39161. extension: getTsResolveExtension(resolvedFileName),
  39162. resolvedFileName,
  39163. packageId: {
  39164. name: moduleName,
  39165. subModuleName: '',
  39166. version: version$3,
  39167. },
  39168. },
  39169. };
  39170. rtn.failedLookupLocations = [];
  39171. return rtn;
  39172. }
  39173. // node module id
  39174. return tsResolveNodeModule(config, inMemoryFs, moduleName, containingFile);
  39175. };
  39176. const tsResolveNodeModule = (config, inMemoryFs, moduleId, containingFile) => {
  39177. if (isStencilCoreImport(moduleId)) {
  39178. const rtn = {
  39179. resolvedModule: {
  39180. extension: t.Extension.Dts,
  39181. resolvedFileName: normalizePath$1(config.sys.getLocalModulePath({
  39182. rootDir: config.rootDir,
  39183. moduleId: '@stencil/core',
  39184. path: 'internal/index.d.ts',
  39185. })),
  39186. packageId: {
  39187. name: moduleId,
  39188. subModuleName: '',
  39189. version: version$3,
  39190. },
  39191. },
  39192. };
  39193. rtn.failedLookupLocations = [];
  39194. return rtn;
  39195. }
  39196. const resolved = resolveRemoteModuleIdSync(config, inMemoryFs, {
  39197. moduleId,
  39198. containingFile,
  39199. });
  39200. if (resolved) {
  39201. const rtn = {
  39202. resolvedModule: {
  39203. extension: t.Extension.Js,
  39204. resolvedFileName: resolved.resolvedUrl,
  39205. packageId: {
  39206. name: moduleId,
  39207. subModuleName: '',
  39208. version: resolved.packageJson.version,
  39209. },
  39210. },
  39211. };
  39212. rtn.failedLookupLocations = [];
  39213. return rtn;
  39214. }
  39215. return null;
  39216. };
  39217. const ensureExtension = (fileName, containingFile) => {
  39218. if (!basename(fileName).includes('.') && isString$1(containingFile)) {
  39219. containingFile = containingFile.toLowerCase();
  39220. if (isJsFile(containingFile)) {
  39221. fileName += '.js';
  39222. }
  39223. else if (isDtsFile(containingFile)) {
  39224. fileName += '.d.ts';
  39225. }
  39226. else if (isTsxFile(containingFile)) {
  39227. fileName += '.tsx';
  39228. }
  39229. else if (isTsFile(containingFile)) {
  39230. fileName += '.ts';
  39231. }
  39232. else if (isJsxFile(containingFile)) {
  39233. fileName += '.jsx';
  39234. }
  39235. }
  39236. return fileName;
  39237. };
  39238. const getTsResolveExtension = (p) => {
  39239. if (isDtsFile(p)) {
  39240. return t.Extension.Dts;
  39241. }
  39242. if (isTsxFile(p)) {
  39243. return t.Extension.Tsx;
  39244. }
  39245. if (isJsFile(p)) {
  39246. return t.Extension.Js;
  39247. }
  39248. if (isJsxFile(p)) {
  39249. return t.Extension.Jsx;
  39250. }
  39251. if (isJsonFile(p)) {
  39252. return t.Extension.Json;
  39253. }
  39254. return t.Extension.Ts;
  39255. };
  39256. const shouldPatchRemoteTypeScript = (compilerExe) => !IS_NODE_ENV && isRemoteUrl(compilerExe);
  39257. /**
  39258. * Rollup plugin that aids in resolving the TypeScript files and performing the transpilation step.
  39259. * @param compilerCtx the current compiler context
  39260. * @param bundleOpts Rollup bundling options to apply during TypeScript compilation
  39261. * @param config the Stencil configuration for the project
  39262. * @returns the rollup plugin for handling TypeScript files.
  39263. */
  39264. const typescriptPlugin = (compilerCtx, bundleOpts, config) => {
  39265. return {
  39266. name: `${bundleOpts.id}TypescriptPlugin`,
  39267. /**
  39268. * A rollup build hook for loading TypeScript files and their associated source maps (if they exist).
  39269. * [Source](https://rollupjs.org/guide/en/#load)
  39270. * @param id the path of the file to load
  39271. * @returns the module matched (with its sourcemap if it exists), null otherwise
  39272. */
  39273. load(id) {
  39274. if (isAbsolute$1(id)) {
  39275. const fsFilePath = normalizeFsPath(id);
  39276. const module = getModule(compilerCtx, fsFilePath);
  39277. if (module) {
  39278. if (!module.sourceMapFileText) {
  39279. return { code: module.staticSourceFileText, map: null };
  39280. }
  39281. const sourceMap = JSON.parse(module.sourceMapFileText);
  39282. sourceMap.sources = sourceMap.sources.map((src) => basename(src));
  39283. return { code: module.staticSourceFileText, map: sourceMap };
  39284. }
  39285. }
  39286. return null;
  39287. },
  39288. /**
  39289. * Performs TypeScript compilation/transpilation, including applying any transformations against the Abstract Syntax
  39290. * Tree (AST) specific to stencil
  39291. * @param _code the code to modify, unused
  39292. * @param id module's identifier
  39293. * @returns the transpiled code, with its associated sourcemap. null otherwise
  39294. */
  39295. transform(_code, id) {
  39296. if (isAbsolute$1(id)) {
  39297. const fsFilePath = normalizeFsPath(id);
  39298. const mod = getModule(compilerCtx, fsFilePath);
  39299. if (mod && mod.cmps.length > 0) {
  39300. const tsResult = t.transpileModule(mod.staticSourceFileText, {
  39301. compilerOptions: config.tsCompilerOptions,
  39302. fileName: mod.sourceFilePath,
  39303. transformers: { before: bundleOpts.customTransformers },
  39304. });
  39305. const sourceMap = tsResult.sourceMapText ? JSON.parse(tsResult.sourceMapText) : null;
  39306. return { code: tsResult.outputText, map: sourceMap };
  39307. }
  39308. }
  39309. return null;
  39310. },
  39311. };
  39312. };
  39313. const resolveIdWithTypeScript = (config, compilerCtx) => {
  39314. return {
  39315. name: `resolveIdWithTypeScript`,
  39316. async resolveId(importee, importer) {
  39317. if (/\0/.test(importee) || !isString$1(importer)) {
  39318. return null;
  39319. }
  39320. const tsResolved = tsResolveModuleName(config, compilerCtx, importee, importer);
  39321. if (tsResolved && tsResolved.resolvedModule) {
  39322. // this is probably a .d.ts file for whatever reason in how TS resolves this
  39323. // use this resolved file as the "importer"
  39324. const tsResolvedPath = tsResolved.resolvedModule.resolvedFileName;
  39325. if (isString$1(tsResolvedPath) && !tsResolvedPath.endsWith('.d.ts')) {
  39326. return tsResolvedPath;
  39327. }
  39328. }
  39329. return null;
  39330. },
  39331. };
  39332. };
  39333. /**
  39334. * Node builtin modules as of v14.5.0
  39335. */
  39336. const NODE_BUILTINS = [
  39337. '_http_agent',
  39338. '_http_client',
  39339. '_http_common',
  39340. '_http_incoming',
  39341. '_http_outgoing',
  39342. '_http_server',
  39343. '_stream_duplex',
  39344. '_stream_passthrough',
  39345. '_stream_readable',
  39346. '_stream_transform',
  39347. '_stream_wrap',
  39348. '_stream_writable',
  39349. '_tls_common',
  39350. '_tls_wrap',
  39351. 'assert',
  39352. 'async_hooks',
  39353. 'buffer',
  39354. 'child_process',
  39355. 'cluster',
  39356. 'console',
  39357. 'constants',
  39358. 'crypto',
  39359. 'dgram',
  39360. 'dns',
  39361. 'domain',
  39362. 'events',
  39363. 'fs',
  39364. 'fs/promises',
  39365. 'http',
  39366. 'http2',
  39367. 'https',
  39368. 'inspector',
  39369. 'module',
  39370. 'net',
  39371. 'os',
  39372. 'path',
  39373. 'perf_hooks',
  39374. 'process',
  39375. 'punycode',
  39376. 'querystring',
  39377. 'readline',
  39378. 'repl',
  39379. 'stream',
  39380. 'string_decoder',
  39381. 'sys',
  39382. 'timers',
  39383. 'tls',
  39384. 'trace_events',
  39385. 'tty',
  39386. 'url',
  39387. 'util',
  39388. 'v8',
  39389. 'vm',
  39390. 'worker_threads',
  39391. 'zlib',
  39392. ];
  39393. class Module {
  39394. static get builtinModules() {
  39395. return NODE_BUILTINS;
  39396. }
  39397. }
  39398. // Rollup 2.42.3
  39399. var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
  39400. function createCommonjsModule(fn, basedir, module) {
  39401. return module = {
  39402. path: basedir,
  39403. exports: {},
  39404. require: function (path, base) {
  39405. return commonjsRequire();
  39406. }
  39407. }, fn(module, module.exports), module.exports;
  39408. }
  39409. function commonjsRequire () {
  39410. throw new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs');
  39411. }
  39412. const WIN_SLASH = '\\\\/';
  39413. const WIN_NO_SLASH = `[^${WIN_SLASH}]`;
  39414. /**
  39415. * Posix glob regex
  39416. */
  39417. const DOT_LITERAL = '\\.';
  39418. const PLUS_LITERAL = '\\+';
  39419. const QMARK_LITERAL = '\\?';
  39420. const SLASH_LITERAL = '\\/';
  39421. const ONE_CHAR = '(?=.)';
  39422. const QMARK = '[^/]';
  39423. const END_ANCHOR = `(?:${SLASH_LITERAL}|$)`;
  39424. const START_ANCHOR = `(?:^|${SLASH_LITERAL})`;
  39425. const DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`;
  39426. const NO_DOT = `(?!${DOT_LITERAL})`;
  39427. const NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`;
  39428. const NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`;
  39429. const NO_DOTS_SLASH = `(?!${DOTS_SLASH})`;
  39430. const QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`;
  39431. const STAR = `${QMARK}*?`;
  39432. const POSIX_CHARS = {
  39433. DOT_LITERAL,
  39434. PLUS_LITERAL,
  39435. QMARK_LITERAL,
  39436. SLASH_LITERAL,
  39437. ONE_CHAR,
  39438. QMARK,
  39439. END_ANCHOR,
  39440. DOTS_SLASH,
  39441. NO_DOT,
  39442. NO_DOTS,
  39443. NO_DOT_SLASH,
  39444. NO_DOTS_SLASH,
  39445. QMARK_NO_DOT,
  39446. STAR,
  39447. START_ANCHOR
  39448. };
  39449. /**
  39450. * Windows glob regex
  39451. */
  39452. const WINDOWS_CHARS = {
  39453. ...POSIX_CHARS,
  39454. SLASH_LITERAL: `[${WIN_SLASH}]`,
  39455. QMARK: WIN_NO_SLASH,
  39456. STAR: `${WIN_NO_SLASH}*?`,
  39457. DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`,
  39458. NO_DOT: `(?!${DOT_LITERAL})`,
  39459. NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
  39460. NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`,
  39461. NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
  39462. QMARK_NO_DOT: `[^.${WIN_SLASH}]`,
  39463. START_ANCHOR: `(?:^|[${WIN_SLASH}])`,
  39464. END_ANCHOR: `(?:[${WIN_SLASH}]|$)`
  39465. };
  39466. /**
  39467. * POSIX Bracket Regex
  39468. */
  39469. const POSIX_REGEX_SOURCE$1 = {
  39470. alnum: 'a-zA-Z0-9',
  39471. alpha: 'a-zA-Z',
  39472. ascii: '\\x00-\\x7F',
  39473. blank: ' \\t',
  39474. cntrl: '\\x00-\\x1F\\x7F',
  39475. digit: '0-9',
  39476. graph: '\\x21-\\x7E',
  39477. lower: 'a-z',
  39478. print: '\\x20-\\x7E ',
  39479. punct: '\\-!"#$%&\'()\\*+,./:;<=>?@[\\]^_`{|}~',
  39480. space: ' \\t\\r\\n\\v\\f',
  39481. upper: 'A-Z',
  39482. word: 'A-Za-z0-9_',
  39483. xdigit: 'A-Fa-f0-9'
  39484. };
  39485. var constants = {
  39486. MAX_LENGTH: 1024 * 64,
  39487. POSIX_REGEX_SOURCE: POSIX_REGEX_SOURCE$1,
  39488. // regular expressions
  39489. REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g,
  39490. REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/,
  39491. REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/,
  39492. REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g,
  39493. REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g,
  39494. REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g,
  39495. // Replace globs with equivalent patterns to reduce parsing time.
  39496. REPLACEMENTS: {
  39497. '***': '*',
  39498. '**/**': '**',
  39499. '**/**/**': '**'
  39500. },
  39501. // Digits
  39502. CHAR_0: 48, /* 0 */
  39503. CHAR_9: 57, /* 9 */
  39504. // Alphabet chars.
  39505. CHAR_UPPERCASE_A: 65, /* A */
  39506. CHAR_LOWERCASE_A: 97, /* a */
  39507. CHAR_UPPERCASE_Z: 90, /* Z */
  39508. CHAR_LOWERCASE_Z: 122, /* z */
  39509. CHAR_LEFT_PARENTHESES: 40, /* ( */
  39510. CHAR_RIGHT_PARENTHESES: 41, /* ) */
  39511. CHAR_ASTERISK: 42, /* * */
  39512. // Non-alphabetic chars.
  39513. CHAR_AMPERSAND: 38, /* & */
  39514. CHAR_AT: 64, /* @ */
  39515. CHAR_BACKWARD_SLASH: 92, /* \ */
  39516. CHAR_CARRIAGE_RETURN: 13, /* \r */
  39517. CHAR_CIRCUMFLEX_ACCENT: 94, /* ^ */
  39518. CHAR_COLON: 58, /* : */
  39519. CHAR_COMMA: 44, /* , */
  39520. CHAR_DOT: 46, /* . */
  39521. CHAR_DOUBLE_QUOTE: 34, /* " */
  39522. CHAR_EQUAL: 61, /* = */
  39523. CHAR_EXCLAMATION_MARK: 33, /* ! */
  39524. CHAR_FORM_FEED: 12, /* \f */
  39525. CHAR_FORWARD_SLASH: 47, /* / */
  39526. CHAR_GRAVE_ACCENT: 96, /* ` */
  39527. CHAR_HASH: 35, /* # */
  39528. CHAR_HYPHEN_MINUS: 45, /* - */
  39529. CHAR_LEFT_ANGLE_BRACKET: 60, /* < */
  39530. CHAR_LEFT_CURLY_BRACE: 123, /* { */
  39531. CHAR_LEFT_SQUARE_BRACKET: 91, /* [ */
  39532. CHAR_LINE_FEED: 10, /* \n */
  39533. CHAR_NO_BREAK_SPACE: 160, /* \u00A0 */
  39534. CHAR_PERCENT: 37, /* % */
  39535. CHAR_PLUS: 43, /* + */
  39536. CHAR_QUESTION_MARK: 63, /* ? */
  39537. CHAR_RIGHT_ANGLE_BRACKET: 62, /* > */
  39538. CHAR_RIGHT_CURLY_BRACE: 125, /* } */
  39539. CHAR_RIGHT_SQUARE_BRACKET: 93, /* ] */
  39540. CHAR_SEMICOLON: 59, /* ; */
  39541. CHAR_SINGLE_QUOTE: 39, /* ' */
  39542. CHAR_SPACE: 32, /* */
  39543. CHAR_TAB: 9, /* \t */
  39544. CHAR_UNDERSCORE: 95, /* _ */
  39545. CHAR_VERTICAL_LINE: 124, /* | */
  39546. CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279, /* \uFEFF */
  39547. SEP: path$5.sep,
  39548. /**
  39549. * Create EXTGLOB_CHARS
  39550. */
  39551. extglobChars(chars) {
  39552. return {
  39553. '!': { type: 'negate', open: '(?:(?!(?:', close: `))${chars.STAR})` },
  39554. '?': { type: 'qmark', open: '(?:', close: ')?' },
  39555. '+': { type: 'plus', open: '(?:', close: ')+' },
  39556. '*': { type: 'star', open: '(?:', close: ')*' },
  39557. '@': { type: 'at', open: '(?:', close: ')' }
  39558. };
  39559. },
  39560. /**
  39561. * Create GLOB_CHARS
  39562. */
  39563. globChars(win32) {
  39564. return win32 === true ? WINDOWS_CHARS : POSIX_CHARS;
  39565. }
  39566. };
  39567. var utils = createCommonjsModule(function (module, exports) {
  39568. const win32 = process.platform === 'win32';
  39569. const {
  39570. REGEX_BACKSLASH,
  39571. REGEX_REMOVE_BACKSLASH,
  39572. REGEX_SPECIAL_CHARS,
  39573. REGEX_SPECIAL_CHARS_GLOBAL
  39574. } = constants;
  39575. exports.isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val);
  39576. exports.hasRegexChars = str => REGEX_SPECIAL_CHARS.test(str);
  39577. exports.isRegexChar = str => str.length === 1 && exports.hasRegexChars(str);
  39578. exports.escapeRegex = str => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, '\\$1');
  39579. exports.toPosixSlashes = str => str.replace(REGEX_BACKSLASH, '/');
  39580. exports.removeBackslashes = str => {
  39581. return str.replace(REGEX_REMOVE_BACKSLASH, match => {
  39582. return match === '\\' ? '' : match;
  39583. });
  39584. };
  39585. exports.supportsLookbehinds = () => {
  39586. const segs = process.version.slice(1).split('.').map(Number);
  39587. if (segs.length === 3 && segs[0] >= 9 || (segs[0] === 8 && segs[1] >= 10)) {
  39588. return true;
  39589. }
  39590. return false;
  39591. };
  39592. exports.isWindows = options => {
  39593. if (options && typeof options.windows === 'boolean') {
  39594. return options.windows;
  39595. }
  39596. return win32 === true || path$5.sep === '\\';
  39597. };
  39598. exports.escapeLast = (input, char, lastIdx) => {
  39599. const idx = input.lastIndexOf(char, lastIdx);
  39600. if (idx === -1) return input;
  39601. if (input[idx - 1] === '\\') return exports.escapeLast(input, char, idx - 1);
  39602. return `${input.slice(0, idx)}\\${input.slice(idx)}`;
  39603. };
  39604. exports.removePrefix = (input, state = {}) => {
  39605. let output = input;
  39606. if (output.startsWith('./')) {
  39607. output = output.slice(2);
  39608. state.prefix = './';
  39609. }
  39610. return output;
  39611. };
  39612. exports.wrapOutput = (input, state = {}, options = {}) => {
  39613. const prepend = options.contains ? '' : '^';
  39614. const append = options.contains ? '' : '$';
  39615. let output = `${prepend}(?:${input})${append}`;
  39616. if (state.negated === true) {
  39617. output = `(?:^(?!${output}).*$)`;
  39618. }
  39619. return output;
  39620. };
  39621. });
  39622. const {
  39623. CHAR_ASTERISK, /* * */
  39624. CHAR_AT, /* @ */
  39625. CHAR_BACKWARD_SLASH, /* \ */
  39626. CHAR_COMMA, /* , */
  39627. CHAR_DOT, /* . */
  39628. CHAR_EXCLAMATION_MARK, /* ! */
  39629. CHAR_FORWARD_SLASH, /* / */
  39630. CHAR_LEFT_CURLY_BRACE, /* { */
  39631. CHAR_LEFT_PARENTHESES, /* ( */
  39632. CHAR_LEFT_SQUARE_BRACKET, /* [ */
  39633. CHAR_PLUS, /* + */
  39634. CHAR_QUESTION_MARK, /* ? */
  39635. CHAR_RIGHT_CURLY_BRACE, /* } */
  39636. CHAR_RIGHT_PARENTHESES, /* ) */
  39637. CHAR_RIGHT_SQUARE_BRACKET /* ] */
  39638. } = constants;
  39639. const isPathSeparator = code => {
  39640. return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;
  39641. };
  39642. const depth = token => {
  39643. if (token.isPrefix !== true) {
  39644. token.depth = token.isGlobstar ? Infinity : 1;
  39645. }
  39646. };
  39647. /**
  39648. * Quickly scans a glob pattern and returns an object with a handful of
  39649. * useful properties, like `isGlob`, `path` (the leading non-glob, if it exists),
  39650. * `glob` (the actual pattern), `negated` (true if the path starts with `!` but not
  39651. * with `!(`) and `negatedExtglob` (true if the path starts with `!(`).
  39652. *
  39653. * ```js
  39654. * const pm = require('picomatch');
  39655. * console.log(pm.scan('foo/bar/*.js'));
  39656. * { isGlob: true, input: 'foo/bar/*.js', base: 'foo/bar', glob: '*.js' }
  39657. * ```
  39658. * @param {String} `str`
  39659. * @param {Object} `options`
  39660. * @return {Object} Returns an object with tokens and regex source string.
  39661. * @api public
  39662. */
  39663. const scan = (input, options) => {
  39664. const opts = options || {};
  39665. const length = input.length - 1;
  39666. const scanToEnd = opts.parts === true || opts.scanToEnd === true;
  39667. const slashes = [];
  39668. const tokens = [];
  39669. const parts = [];
  39670. let str = input;
  39671. let index = -1;
  39672. let start = 0;
  39673. let lastIndex = 0;
  39674. let isBrace = false;
  39675. let isBracket = false;
  39676. let isGlob = false;
  39677. let isExtglob = false;
  39678. let isGlobstar = false;
  39679. let braceEscaped = false;
  39680. let backslashes = false;
  39681. let negated = false;
  39682. let negatedExtglob = false;
  39683. let finished = false;
  39684. let braces = 0;
  39685. let prev;
  39686. let code;
  39687. let token = { value: '', depth: 0, isGlob: false };
  39688. const eos = () => index >= length;
  39689. const peek = () => str.charCodeAt(index + 1);
  39690. const advance = () => {
  39691. prev = code;
  39692. return str.charCodeAt(++index);
  39693. };
  39694. while (index < length) {
  39695. code = advance();
  39696. let next;
  39697. if (code === CHAR_BACKWARD_SLASH) {
  39698. backslashes = token.backslashes = true;
  39699. code = advance();
  39700. if (code === CHAR_LEFT_CURLY_BRACE) {
  39701. braceEscaped = true;
  39702. }
  39703. continue;
  39704. }
  39705. if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) {
  39706. braces++;
  39707. while (eos() !== true && (code = advance())) {
  39708. if (code === CHAR_BACKWARD_SLASH) {
  39709. backslashes = token.backslashes = true;
  39710. advance();
  39711. continue;
  39712. }
  39713. if (code === CHAR_LEFT_CURLY_BRACE) {
  39714. braces++;
  39715. continue;
  39716. }
  39717. if (braceEscaped !== true && code === CHAR_DOT && (code = advance()) === CHAR_DOT) {
  39718. isBrace = token.isBrace = true;
  39719. isGlob = token.isGlob = true;
  39720. finished = true;
  39721. if (scanToEnd === true) {
  39722. continue;
  39723. }
  39724. break;
  39725. }
  39726. if (braceEscaped !== true && code === CHAR_COMMA) {
  39727. isBrace = token.isBrace = true;
  39728. isGlob = token.isGlob = true;
  39729. finished = true;
  39730. if (scanToEnd === true) {
  39731. continue;
  39732. }
  39733. break;
  39734. }
  39735. if (code === CHAR_RIGHT_CURLY_BRACE) {
  39736. braces--;
  39737. if (braces === 0) {
  39738. braceEscaped = false;
  39739. isBrace = token.isBrace = true;
  39740. finished = true;
  39741. break;
  39742. }
  39743. }
  39744. }
  39745. if (scanToEnd === true) {
  39746. continue;
  39747. }
  39748. break;
  39749. }
  39750. if (code === CHAR_FORWARD_SLASH) {
  39751. slashes.push(index);
  39752. tokens.push(token);
  39753. token = { value: '', depth: 0, isGlob: false };
  39754. if (finished === true) continue;
  39755. if (prev === CHAR_DOT && index === (start + 1)) {
  39756. start += 2;
  39757. continue;
  39758. }
  39759. lastIndex = index + 1;
  39760. continue;
  39761. }
  39762. if (opts.noext !== true) {
  39763. const isExtglobChar = code === CHAR_PLUS
  39764. || code === CHAR_AT
  39765. || code === CHAR_ASTERISK
  39766. || code === CHAR_QUESTION_MARK
  39767. || code === CHAR_EXCLAMATION_MARK;
  39768. if (isExtglobChar === true && peek() === CHAR_LEFT_PARENTHESES) {
  39769. isGlob = token.isGlob = true;
  39770. isExtglob = token.isExtglob = true;
  39771. finished = true;
  39772. if (code === CHAR_EXCLAMATION_MARK && index === start) {
  39773. negatedExtglob = true;
  39774. }
  39775. if (scanToEnd === true) {
  39776. while (eos() !== true && (code = advance())) {
  39777. if (code === CHAR_BACKWARD_SLASH) {
  39778. backslashes = token.backslashes = true;
  39779. code = advance();
  39780. continue;
  39781. }
  39782. if (code === CHAR_RIGHT_PARENTHESES) {
  39783. isGlob = token.isGlob = true;
  39784. finished = true;
  39785. break;
  39786. }
  39787. }
  39788. continue;
  39789. }
  39790. break;
  39791. }
  39792. }
  39793. if (code === CHAR_ASTERISK) {
  39794. if (prev === CHAR_ASTERISK) isGlobstar = token.isGlobstar = true;
  39795. isGlob = token.isGlob = true;
  39796. finished = true;
  39797. if (scanToEnd === true) {
  39798. continue;
  39799. }
  39800. break;
  39801. }
  39802. if (code === CHAR_QUESTION_MARK) {
  39803. isGlob = token.isGlob = true;
  39804. finished = true;
  39805. if (scanToEnd === true) {
  39806. continue;
  39807. }
  39808. break;
  39809. }
  39810. if (code === CHAR_LEFT_SQUARE_BRACKET) {
  39811. while (eos() !== true && (next = advance())) {
  39812. if (next === CHAR_BACKWARD_SLASH) {
  39813. backslashes = token.backslashes = true;
  39814. advance();
  39815. continue;
  39816. }
  39817. if (next === CHAR_RIGHT_SQUARE_BRACKET) {
  39818. isBracket = token.isBracket = true;
  39819. isGlob = token.isGlob = true;
  39820. finished = true;
  39821. break;
  39822. }
  39823. }
  39824. if (scanToEnd === true) {
  39825. continue;
  39826. }
  39827. break;
  39828. }
  39829. if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) {
  39830. negated = token.negated = true;
  39831. start++;
  39832. continue;
  39833. }
  39834. if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) {
  39835. isGlob = token.isGlob = true;
  39836. if (scanToEnd === true) {
  39837. while (eos() !== true && (code = advance())) {
  39838. if (code === CHAR_LEFT_PARENTHESES) {
  39839. backslashes = token.backslashes = true;
  39840. code = advance();
  39841. continue;
  39842. }
  39843. if (code === CHAR_RIGHT_PARENTHESES) {
  39844. finished = true;
  39845. break;
  39846. }
  39847. }
  39848. continue;
  39849. }
  39850. break;
  39851. }
  39852. if (isGlob === true) {
  39853. finished = true;
  39854. if (scanToEnd === true) {
  39855. continue;
  39856. }
  39857. break;
  39858. }
  39859. }
  39860. if (opts.noext === true) {
  39861. isExtglob = false;
  39862. isGlob = false;
  39863. }
  39864. let base = str;
  39865. let prefix = '';
  39866. let glob = '';
  39867. if (start > 0) {
  39868. prefix = str.slice(0, start);
  39869. str = str.slice(start);
  39870. lastIndex -= start;
  39871. }
  39872. if (base && isGlob === true && lastIndex > 0) {
  39873. base = str.slice(0, lastIndex);
  39874. glob = str.slice(lastIndex);
  39875. } else if (isGlob === true) {
  39876. base = '';
  39877. glob = str;
  39878. } else {
  39879. base = str;
  39880. }
  39881. if (base && base !== '' && base !== '/' && base !== str) {
  39882. if (isPathSeparator(base.charCodeAt(base.length - 1))) {
  39883. base = base.slice(0, -1);
  39884. }
  39885. }
  39886. if (opts.unescape === true) {
  39887. if (glob) glob = utils.removeBackslashes(glob);
  39888. if (base && backslashes === true) {
  39889. base = utils.removeBackslashes(base);
  39890. }
  39891. }
  39892. const state = {
  39893. prefix,
  39894. input,
  39895. start,
  39896. base,
  39897. glob,
  39898. isBrace,
  39899. isBracket,
  39900. isGlob,
  39901. isExtglob,
  39902. isGlobstar,
  39903. negated,
  39904. negatedExtglob
  39905. };
  39906. if (opts.tokens === true) {
  39907. state.maxDepth = 0;
  39908. if (!isPathSeparator(code)) {
  39909. tokens.push(token);
  39910. }
  39911. state.tokens = tokens;
  39912. }
  39913. if (opts.parts === true || opts.tokens === true) {
  39914. let prevIndex;
  39915. for (let idx = 0; idx < slashes.length; idx++) {
  39916. const n = prevIndex ? prevIndex + 1 : start;
  39917. const i = slashes[idx];
  39918. const value = input.slice(n, i);
  39919. if (opts.tokens) {
  39920. if (idx === 0 && start !== 0) {
  39921. tokens[idx].isPrefix = true;
  39922. tokens[idx].value = prefix;
  39923. } else {
  39924. tokens[idx].value = value;
  39925. }
  39926. depth(tokens[idx]);
  39927. state.maxDepth += tokens[idx].depth;
  39928. }
  39929. if (idx !== 0 || value !== '') {
  39930. parts.push(value);
  39931. }
  39932. prevIndex = i;
  39933. }
  39934. if (prevIndex && prevIndex + 1 < input.length) {
  39935. const value = input.slice(prevIndex + 1);
  39936. parts.push(value);
  39937. if (opts.tokens) {
  39938. tokens[tokens.length - 1].value = value;
  39939. depth(tokens[tokens.length - 1]);
  39940. state.maxDepth += tokens[tokens.length - 1].depth;
  39941. }
  39942. }
  39943. state.slashes = slashes;
  39944. state.parts = parts;
  39945. }
  39946. return state;
  39947. };
  39948. var scan_1 = scan;
  39949. /**
  39950. * Constants
  39951. */
  39952. const {
  39953. MAX_LENGTH,
  39954. POSIX_REGEX_SOURCE,
  39955. REGEX_NON_SPECIAL_CHARS,
  39956. REGEX_SPECIAL_CHARS_BACKREF,
  39957. REPLACEMENTS
  39958. } = constants;
  39959. /**
  39960. * Helpers
  39961. */
  39962. const expandRange = (args, options) => {
  39963. if (typeof options.expandRange === 'function') {
  39964. return options.expandRange(...args, options);
  39965. }
  39966. args.sort();
  39967. const value = `[${args.join('-')}]`;
  39968. try {
  39969. /* eslint-disable-next-line no-new */
  39970. new RegExp(value);
  39971. } catch (ex) {
  39972. return args.map(v => utils.escapeRegex(v)).join('..');
  39973. }
  39974. return value;
  39975. };
  39976. /**
  39977. * Create the message for a syntax error
  39978. */
  39979. const syntaxError = (type, char) => {
  39980. return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`;
  39981. };
  39982. /**
  39983. * Parse the given input string.
  39984. * @param {String} input
  39985. * @param {Object} options
  39986. * @return {Object}
  39987. */
  39988. const parse$1 = (input, options) => {
  39989. if (typeof input !== 'string') {
  39990. throw new TypeError('Expected a string');
  39991. }
  39992. input = REPLACEMENTS[input] || input;
  39993. const opts = { ...options };
  39994. const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
  39995. let len = input.length;
  39996. if (len > max) {
  39997. throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
  39998. }
  39999. const bos = { type: 'bos', value: '', output: opts.prepend || '' };
  40000. const tokens = [bos];
  40001. const capture = opts.capture ? '' : '?:';
  40002. const win32 = utils.isWindows(options);
  40003. // create constants based on platform, for windows or posix
  40004. const PLATFORM_CHARS = constants.globChars(win32);
  40005. const EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS);
  40006. const {
  40007. DOT_LITERAL,
  40008. PLUS_LITERAL,
  40009. SLASH_LITERAL,
  40010. ONE_CHAR,
  40011. DOTS_SLASH,
  40012. NO_DOT,
  40013. NO_DOT_SLASH,
  40014. NO_DOTS_SLASH,
  40015. QMARK,
  40016. QMARK_NO_DOT,
  40017. STAR,
  40018. START_ANCHOR
  40019. } = PLATFORM_CHARS;
  40020. const globstar = opts => {
  40021. return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
  40022. };
  40023. const nodot = opts.dot ? '' : NO_DOT;
  40024. const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT;
  40025. let star = opts.bash === true ? globstar(opts) : STAR;
  40026. if (opts.capture) {
  40027. star = `(${star})`;
  40028. }
  40029. // minimatch options support
  40030. if (typeof opts.noext === 'boolean') {
  40031. opts.noextglob = opts.noext;
  40032. }
  40033. const state = {
  40034. input,
  40035. index: -1,
  40036. start: 0,
  40037. dot: opts.dot === true,
  40038. consumed: '',
  40039. output: '',
  40040. prefix: '',
  40041. backtrack: false,
  40042. negated: false,
  40043. brackets: 0,
  40044. braces: 0,
  40045. parens: 0,
  40046. quotes: 0,
  40047. globstar: false,
  40048. tokens
  40049. };
  40050. input = utils.removePrefix(input, state);
  40051. len = input.length;
  40052. const extglobs = [];
  40053. const braces = [];
  40054. const stack = [];
  40055. let prev = bos;
  40056. let value;
  40057. /**
  40058. * Tokenizing helpers
  40059. */
  40060. const eos = () => state.index === len - 1;
  40061. const peek = state.peek = (n = 1) => input[state.index + n];
  40062. const advance = state.advance = () => input[++state.index] || '';
  40063. const remaining = () => input.slice(state.index + 1);
  40064. const consume = (value = '', num = 0) => {
  40065. state.consumed += value;
  40066. state.index += num;
  40067. };
  40068. const append = token => {
  40069. state.output += token.output != null ? token.output : token.value;
  40070. consume(token.value);
  40071. };
  40072. const negate = () => {
  40073. let count = 1;
  40074. while (peek() === '!' && (peek(2) !== '(' || peek(3) === '?')) {
  40075. advance();
  40076. state.start++;
  40077. count++;
  40078. }
  40079. if (count % 2 === 0) {
  40080. return false;
  40081. }
  40082. state.negated = true;
  40083. state.start++;
  40084. return true;
  40085. };
  40086. const increment = type => {
  40087. state[type]++;
  40088. stack.push(type);
  40089. };
  40090. const decrement = type => {
  40091. state[type]--;
  40092. stack.pop();
  40093. };
  40094. /**
  40095. * Push tokens onto the tokens array. This helper speeds up
  40096. * tokenizing by 1) helping us avoid backtracking as much as possible,
  40097. * and 2) helping us avoid creating extra tokens when consecutive
  40098. * characters are plain text. This improves performance and simplifies
  40099. * lookbehinds.
  40100. */
  40101. const push = tok => {
  40102. if (prev.type === 'globstar') {
  40103. const isBrace = state.braces > 0 && (tok.type === 'comma' || tok.type === 'brace');
  40104. const isExtglob = tok.extglob === true || (extglobs.length && (tok.type === 'pipe' || tok.type === 'paren'));
  40105. if (tok.type !== 'slash' && tok.type !== 'paren' && !isBrace && !isExtglob) {
  40106. state.output = state.output.slice(0, -prev.output.length);
  40107. prev.type = 'star';
  40108. prev.value = '*';
  40109. prev.output = star;
  40110. state.output += prev.output;
  40111. }
  40112. }
  40113. if (extglobs.length && tok.type !== 'paren') {
  40114. extglobs[extglobs.length - 1].inner += tok.value;
  40115. }
  40116. if (tok.value || tok.output) append(tok);
  40117. if (prev && prev.type === 'text' && tok.type === 'text') {
  40118. prev.value += tok.value;
  40119. prev.output = (prev.output || '') + tok.value;
  40120. return;
  40121. }
  40122. tok.prev = prev;
  40123. tokens.push(tok);
  40124. prev = tok;
  40125. };
  40126. const extglobOpen = (type, value) => {
  40127. const token = { ...EXTGLOB_CHARS[value], conditions: 1, inner: '' };
  40128. token.prev = prev;
  40129. token.parens = state.parens;
  40130. token.output = state.output;
  40131. const output = (opts.capture ? '(' : '') + token.open;
  40132. increment('parens');
  40133. push({ type, value, output: state.output ? '' : ONE_CHAR });
  40134. push({ type: 'paren', extglob: true, value: advance(), output });
  40135. extglobs.push(token);
  40136. };
  40137. const extglobClose = token => {
  40138. let output = token.close + (opts.capture ? ')' : '');
  40139. let rest;
  40140. if (token.type === 'negate') {
  40141. let extglobStar = star;
  40142. if (token.inner && token.inner.length > 1 && token.inner.includes('/')) {
  40143. extglobStar = globstar(opts);
  40144. }
  40145. if (extglobStar !== star || eos() || /^\)+$/.test(remaining())) {
  40146. output = token.close = `)$))${extglobStar}`;
  40147. }
  40148. if (token.inner.includes('*') && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) {
  40149. output = token.close = `)${rest})${extglobStar})`;
  40150. }
  40151. if (token.prev.type === 'bos') {
  40152. state.negatedExtglob = true;
  40153. }
  40154. }
  40155. push({ type: 'paren', extglob: true, value, output });
  40156. decrement('parens');
  40157. };
  40158. /**
  40159. * Fast paths
  40160. */
  40161. if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) {
  40162. let backslashes = false;
  40163. let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => {
  40164. if (first === '\\') {
  40165. backslashes = true;
  40166. return m;
  40167. }
  40168. if (first === '?') {
  40169. if (esc) {
  40170. return esc + first + (rest ? QMARK.repeat(rest.length) : '');
  40171. }
  40172. if (index === 0) {
  40173. return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : '');
  40174. }
  40175. return QMARK.repeat(chars.length);
  40176. }
  40177. if (first === '.') {
  40178. return DOT_LITERAL.repeat(chars.length);
  40179. }
  40180. if (first === '*') {
  40181. if (esc) {
  40182. return esc + first + (rest ? star : '');
  40183. }
  40184. return star;
  40185. }
  40186. return esc ? m : `\\${m}`;
  40187. });
  40188. if (backslashes === true) {
  40189. if (opts.unescape === true) {
  40190. output = output.replace(/\\/g, '');
  40191. } else {
  40192. output = output.replace(/\\+/g, m => {
  40193. return m.length % 2 === 0 ? '\\\\' : (m ? '\\' : '');
  40194. });
  40195. }
  40196. }
  40197. if (output === input && opts.contains === true) {
  40198. state.output = input;
  40199. return state;
  40200. }
  40201. state.output = utils.wrapOutput(output, state, options);
  40202. return state;
  40203. }
  40204. /**
  40205. * Tokenize input until we reach end-of-string
  40206. */
  40207. while (!eos()) {
  40208. value = advance();
  40209. if (value === '\u0000') {
  40210. continue;
  40211. }
  40212. /**
  40213. * Escaped characters
  40214. */
  40215. if (value === '\\') {
  40216. const next = peek();
  40217. if (next === '/' && opts.bash !== true) {
  40218. continue;
  40219. }
  40220. if (next === '.' || next === ';') {
  40221. continue;
  40222. }
  40223. if (!next) {
  40224. value += '\\';
  40225. push({ type: 'text', value });
  40226. continue;
  40227. }
  40228. // collapse slashes to reduce potential for exploits
  40229. const match = /^\\+/.exec(remaining());
  40230. let slashes = 0;
  40231. if (match && match[0].length > 2) {
  40232. slashes = match[0].length;
  40233. state.index += slashes;
  40234. if (slashes % 2 !== 0) {
  40235. value += '\\';
  40236. }
  40237. }
  40238. if (opts.unescape === true) {
  40239. value = advance();
  40240. } else {
  40241. value += advance();
  40242. }
  40243. if (state.brackets === 0) {
  40244. push({ type: 'text', value });
  40245. continue;
  40246. }
  40247. }
  40248. /**
  40249. * If we're inside a regex character class, continue
  40250. * until we reach the closing bracket.
  40251. */
  40252. if (state.brackets > 0 && (value !== ']' || prev.value === '[' || prev.value === '[^')) {
  40253. if (opts.posix !== false && value === ':') {
  40254. const inner = prev.value.slice(1);
  40255. if (inner.includes('[')) {
  40256. prev.posix = true;
  40257. if (inner.includes(':')) {
  40258. const idx = prev.value.lastIndexOf('[');
  40259. const pre = prev.value.slice(0, idx);
  40260. const rest = prev.value.slice(idx + 2);
  40261. const posix = POSIX_REGEX_SOURCE[rest];
  40262. if (posix) {
  40263. prev.value = pre + posix;
  40264. state.backtrack = true;
  40265. advance();
  40266. if (!bos.output && tokens.indexOf(prev) === 1) {
  40267. bos.output = ONE_CHAR;
  40268. }
  40269. continue;
  40270. }
  40271. }
  40272. }
  40273. }
  40274. if ((value === '[' && peek() !== ':') || (value === '-' && peek() === ']')) {
  40275. value = `\\${value}`;
  40276. }
  40277. if (value === ']' && (prev.value === '[' || prev.value === '[^')) {
  40278. value = `\\${value}`;
  40279. }
  40280. if (opts.posix === true && value === '!' && prev.value === '[') {
  40281. value = '^';
  40282. }
  40283. prev.value += value;
  40284. append({ value });
  40285. continue;
  40286. }
  40287. /**
  40288. * If we're inside a quoted string, continue
  40289. * until we reach the closing double quote.
  40290. */
  40291. if (state.quotes === 1 && value !== '"') {
  40292. value = utils.escapeRegex(value);
  40293. prev.value += value;
  40294. append({ value });
  40295. continue;
  40296. }
  40297. /**
  40298. * Double quotes
  40299. */
  40300. if (value === '"') {
  40301. state.quotes = state.quotes === 1 ? 0 : 1;
  40302. if (opts.keepQuotes === true) {
  40303. push({ type: 'text', value });
  40304. }
  40305. continue;
  40306. }
  40307. /**
  40308. * Parentheses
  40309. */
  40310. if (value === '(') {
  40311. increment('parens');
  40312. push({ type: 'paren', value });
  40313. continue;
  40314. }
  40315. if (value === ')') {
  40316. if (state.parens === 0 && opts.strictBrackets === true) {
  40317. throw new SyntaxError(syntaxError('opening', '('));
  40318. }
  40319. const extglob = extglobs[extglobs.length - 1];
  40320. if (extglob && state.parens === extglob.parens + 1) {
  40321. extglobClose(extglobs.pop());
  40322. continue;
  40323. }
  40324. push({ type: 'paren', value, output: state.parens ? ')' : '\\)' });
  40325. decrement('parens');
  40326. continue;
  40327. }
  40328. /**
  40329. * Square brackets
  40330. */
  40331. if (value === '[') {
  40332. if (opts.nobracket === true || !remaining().includes(']')) {
  40333. if (opts.nobracket !== true && opts.strictBrackets === true) {
  40334. throw new SyntaxError(syntaxError('closing', ']'));
  40335. }
  40336. value = `\\${value}`;
  40337. } else {
  40338. increment('brackets');
  40339. }
  40340. push({ type: 'bracket', value });
  40341. continue;
  40342. }
  40343. if (value === ']') {
  40344. if (opts.nobracket === true || (prev && prev.type === 'bracket' && prev.value.length === 1)) {
  40345. push({ type: 'text', value, output: `\\${value}` });
  40346. continue;
  40347. }
  40348. if (state.brackets === 0) {
  40349. if (opts.strictBrackets === true) {
  40350. throw new SyntaxError(syntaxError('opening', '['));
  40351. }
  40352. push({ type: 'text', value, output: `\\${value}` });
  40353. continue;
  40354. }
  40355. decrement('brackets');
  40356. const prevValue = prev.value.slice(1);
  40357. if (prev.posix !== true && prevValue[0] === '^' && !prevValue.includes('/')) {
  40358. value = `/${value}`;
  40359. }
  40360. prev.value += value;
  40361. append({ value });
  40362. // when literal brackets are explicitly disabled
  40363. // assume we should match with a regex character class
  40364. if (opts.literalBrackets === false || utils.hasRegexChars(prevValue)) {
  40365. continue;
  40366. }
  40367. const escaped = utils.escapeRegex(prev.value);
  40368. state.output = state.output.slice(0, -prev.value.length);
  40369. // when literal brackets are explicitly enabled
  40370. // assume we should escape the brackets to match literal characters
  40371. if (opts.literalBrackets === true) {
  40372. state.output += escaped;
  40373. prev.value = escaped;
  40374. continue;
  40375. }
  40376. // when the user specifies nothing, try to match both
  40377. prev.value = `(${capture}${escaped}|${prev.value})`;
  40378. state.output += prev.value;
  40379. continue;
  40380. }
  40381. /**
  40382. * Braces
  40383. */
  40384. if (value === '{' && opts.nobrace !== true) {
  40385. increment('braces');
  40386. const open = {
  40387. type: 'brace',
  40388. value,
  40389. output: '(',
  40390. outputIndex: state.output.length,
  40391. tokensIndex: state.tokens.length
  40392. };
  40393. braces.push(open);
  40394. push(open);
  40395. continue;
  40396. }
  40397. if (value === '}') {
  40398. const brace = braces[braces.length - 1];
  40399. if (opts.nobrace === true || !brace) {
  40400. push({ type: 'text', value, output: value });
  40401. continue;
  40402. }
  40403. let output = ')';
  40404. if (brace.dots === true) {
  40405. const arr = tokens.slice();
  40406. const range = [];
  40407. for (let i = arr.length - 1; i >= 0; i--) {
  40408. tokens.pop();
  40409. if (arr[i].type === 'brace') {
  40410. break;
  40411. }
  40412. if (arr[i].type !== 'dots') {
  40413. range.unshift(arr[i].value);
  40414. }
  40415. }
  40416. output = expandRange(range, opts);
  40417. state.backtrack = true;
  40418. }
  40419. if (brace.comma !== true && brace.dots !== true) {
  40420. const out = state.output.slice(0, brace.outputIndex);
  40421. const toks = state.tokens.slice(brace.tokensIndex);
  40422. brace.value = brace.output = '\\{';
  40423. value = output = '\\}';
  40424. state.output = out;
  40425. for (const t of toks) {
  40426. state.output += (t.output || t.value);
  40427. }
  40428. }
  40429. push({ type: 'brace', value, output });
  40430. decrement('braces');
  40431. braces.pop();
  40432. continue;
  40433. }
  40434. /**
  40435. * Pipes
  40436. */
  40437. if (value === '|') {
  40438. if (extglobs.length > 0) {
  40439. extglobs[extglobs.length - 1].conditions++;
  40440. }
  40441. push({ type: 'text', value });
  40442. continue;
  40443. }
  40444. /**
  40445. * Commas
  40446. */
  40447. if (value === ',') {
  40448. let output = value;
  40449. const brace = braces[braces.length - 1];
  40450. if (brace && stack[stack.length - 1] === 'braces') {
  40451. brace.comma = true;
  40452. output = '|';
  40453. }
  40454. push({ type: 'comma', value, output });
  40455. continue;
  40456. }
  40457. /**
  40458. * Slashes
  40459. */
  40460. if (value === '/') {
  40461. // if the beginning of the glob is "./", advance the start
  40462. // to the current index, and don't add the "./" characters
  40463. // to the state. This greatly simplifies lookbehinds when
  40464. // checking for BOS characters like "!" and "." (not "./")
  40465. if (prev.type === 'dot' && state.index === state.start + 1) {
  40466. state.start = state.index + 1;
  40467. state.consumed = '';
  40468. state.output = '';
  40469. tokens.pop();
  40470. prev = bos; // reset "prev" to the first token
  40471. continue;
  40472. }
  40473. push({ type: 'slash', value, output: SLASH_LITERAL });
  40474. continue;
  40475. }
  40476. /**
  40477. * Dots
  40478. */
  40479. if (value === '.') {
  40480. if (state.braces > 0 && prev.type === 'dot') {
  40481. if (prev.value === '.') prev.output = DOT_LITERAL;
  40482. const brace = braces[braces.length - 1];
  40483. prev.type = 'dots';
  40484. prev.output += value;
  40485. prev.value += value;
  40486. brace.dots = true;
  40487. continue;
  40488. }
  40489. if ((state.braces + state.parens) === 0 && prev.type !== 'bos' && prev.type !== 'slash') {
  40490. push({ type: 'text', value, output: DOT_LITERAL });
  40491. continue;
  40492. }
  40493. push({ type: 'dot', value, output: DOT_LITERAL });
  40494. continue;
  40495. }
  40496. /**
  40497. * Question marks
  40498. */
  40499. if (value === '?') {
  40500. const isGroup = prev && prev.value === '(';
  40501. if (!isGroup && opts.noextglob !== true && peek() === '(' && peek(2) !== '?') {
  40502. extglobOpen('qmark', value);
  40503. continue;
  40504. }
  40505. if (prev && prev.type === 'paren') {
  40506. const next = peek();
  40507. let output = value;
  40508. if (next === '<' && !utils.supportsLookbehinds()) {
  40509. throw new Error('Node.js v10 or higher is required for regex lookbehinds');
  40510. }
  40511. if ((prev.value === '(' && !/[!=<:]/.test(next)) || (next === '<' && !/<([!=]|\w+>)/.test(remaining()))) {
  40512. output = `\\${value}`;
  40513. }
  40514. push({ type: 'text', value, output });
  40515. continue;
  40516. }
  40517. if (opts.dot !== true && (prev.type === 'slash' || prev.type === 'bos')) {
  40518. push({ type: 'qmark', value, output: QMARK_NO_DOT });
  40519. continue;
  40520. }
  40521. push({ type: 'qmark', value, output: QMARK });
  40522. continue;
  40523. }
  40524. /**
  40525. * Exclamation
  40526. */
  40527. if (value === '!') {
  40528. if (opts.noextglob !== true && peek() === '(') {
  40529. if (peek(2) !== '?' || !/[!=<:]/.test(peek(3))) {
  40530. extglobOpen('negate', value);
  40531. continue;
  40532. }
  40533. }
  40534. if (opts.nonegate !== true && state.index === 0) {
  40535. negate();
  40536. continue;
  40537. }
  40538. }
  40539. /**
  40540. * Plus
  40541. */
  40542. if (value === '+') {
  40543. if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') {
  40544. extglobOpen('plus', value);
  40545. continue;
  40546. }
  40547. if ((prev && prev.value === '(') || opts.regex === false) {
  40548. push({ type: 'plus', value, output: PLUS_LITERAL });
  40549. continue;
  40550. }
  40551. if ((prev && (prev.type === 'bracket' || prev.type === 'paren' || prev.type === 'brace')) || state.parens > 0) {
  40552. push({ type: 'plus', value });
  40553. continue;
  40554. }
  40555. push({ type: 'plus', value: PLUS_LITERAL });
  40556. continue;
  40557. }
  40558. /**
  40559. * Plain text
  40560. */
  40561. if (value === '@') {
  40562. if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') {
  40563. push({ type: 'at', extglob: true, value, output: '' });
  40564. continue;
  40565. }
  40566. push({ type: 'text', value });
  40567. continue;
  40568. }
  40569. /**
  40570. * Plain text
  40571. */
  40572. if (value !== '*') {
  40573. if (value === '$' || value === '^') {
  40574. value = `\\${value}`;
  40575. }
  40576. const match = REGEX_NON_SPECIAL_CHARS.exec(remaining());
  40577. if (match) {
  40578. value += match[0];
  40579. state.index += match[0].length;
  40580. }
  40581. push({ type: 'text', value });
  40582. continue;
  40583. }
  40584. /**
  40585. * Stars
  40586. */
  40587. if (prev && (prev.type === 'globstar' || prev.star === true)) {
  40588. prev.type = 'star';
  40589. prev.star = true;
  40590. prev.value += value;
  40591. prev.output = star;
  40592. state.backtrack = true;
  40593. state.globstar = true;
  40594. consume(value);
  40595. continue;
  40596. }
  40597. let rest = remaining();
  40598. if (opts.noextglob !== true && /^\([^?]/.test(rest)) {
  40599. extglobOpen('star', value);
  40600. continue;
  40601. }
  40602. if (prev.type === 'star') {
  40603. if (opts.noglobstar === true) {
  40604. consume(value);
  40605. continue;
  40606. }
  40607. const prior = prev.prev;
  40608. const before = prior.prev;
  40609. const isStart = prior.type === 'slash' || prior.type === 'bos';
  40610. const afterStar = before && (before.type === 'star' || before.type === 'globstar');
  40611. if (opts.bash === true && (!isStart || (rest[0] && rest[0] !== '/'))) {
  40612. push({ type: 'star', value, output: '' });
  40613. continue;
  40614. }
  40615. const isBrace = state.braces > 0 && (prior.type === 'comma' || prior.type === 'brace');
  40616. const isExtglob = extglobs.length && (prior.type === 'pipe' || prior.type === 'paren');
  40617. if (!isStart && prior.type !== 'paren' && !isBrace && !isExtglob) {
  40618. push({ type: 'star', value, output: '' });
  40619. continue;
  40620. }
  40621. // strip consecutive `/**/`
  40622. while (rest.slice(0, 3) === '/**') {
  40623. const after = input[state.index + 4];
  40624. if (after && after !== '/') {
  40625. break;
  40626. }
  40627. rest = rest.slice(3);
  40628. consume('/**', 3);
  40629. }
  40630. if (prior.type === 'bos' && eos()) {
  40631. prev.type = 'globstar';
  40632. prev.value += value;
  40633. prev.output = globstar(opts);
  40634. state.output = prev.output;
  40635. state.globstar = true;
  40636. consume(value);
  40637. continue;
  40638. }
  40639. if (prior.type === 'slash' && prior.prev.type !== 'bos' && !afterStar && eos()) {
  40640. state.output = state.output.slice(0, -(prior.output + prev.output).length);
  40641. prior.output = `(?:${prior.output}`;
  40642. prev.type = 'globstar';
  40643. prev.output = globstar(opts) + (opts.strictSlashes ? ')' : '|$)');
  40644. prev.value += value;
  40645. state.globstar = true;
  40646. state.output += prior.output + prev.output;
  40647. consume(value);
  40648. continue;
  40649. }
  40650. if (prior.type === 'slash' && prior.prev.type !== 'bos' && rest[0] === '/') {
  40651. const end = rest[1] !== void 0 ? '|$' : '';
  40652. state.output = state.output.slice(0, -(prior.output + prev.output).length);
  40653. prior.output = `(?:${prior.output}`;
  40654. prev.type = 'globstar';
  40655. prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`;
  40656. prev.value += value;
  40657. state.output += prior.output + prev.output;
  40658. state.globstar = true;
  40659. consume(value + advance());
  40660. push({ type: 'slash', value: '/', output: '' });
  40661. continue;
  40662. }
  40663. if (prior.type === 'bos' && rest[0] === '/') {
  40664. prev.type = 'globstar';
  40665. prev.value += value;
  40666. prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`;
  40667. state.output = prev.output;
  40668. state.globstar = true;
  40669. consume(value + advance());
  40670. push({ type: 'slash', value: '/', output: '' });
  40671. continue;
  40672. }
  40673. // remove single star from output
  40674. state.output = state.output.slice(0, -prev.output.length);
  40675. // reset previous token to globstar
  40676. prev.type = 'globstar';
  40677. prev.output = globstar(opts);
  40678. prev.value += value;
  40679. // reset output with globstar
  40680. state.output += prev.output;
  40681. state.globstar = true;
  40682. consume(value);
  40683. continue;
  40684. }
  40685. const token = { type: 'star', value, output: star };
  40686. if (opts.bash === true) {
  40687. token.output = '.*?';
  40688. if (prev.type === 'bos' || prev.type === 'slash') {
  40689. token.output = nodot + token.output;
  40690. }
  40691. push(token);
  40692. continue;
  40693. }
  40694. if (prev && (prev.type === 'bracket' || prev.type === 'paren') && opts.regex === true) {
  40695. token.output = value;
  40696. push(token);
  40697. continue;
  40698. }
  40699. if (state.index === state.start || prev.type === 'slash' || prev.type === 'dot') {
  40700. if (prev.type === 'dot') {
  40701. state.output += NO_DOT_SLASH;
  40702. prev.output += NO_DOT_SLASH;
  40703. } else if (opts.dot === true) {
  40704. state.output += NO_DOTS_SLASH;
  40705. prev.output += NO_DOTS_SLASH;
  40706. } else {
  40707. state.output += nodot;
  40708. prev.output += nodot;
  40709. }
  40710. if (peek() !== '*') {
  40711. state.output += ONE_CHAR;
  40712. prev.output += ONE_CHAR;
  40713. }
  40714. }
  40715. push(token);
  40716. }
  40717. while (state.brackets > 0) {
  40718. if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ']'));
  40719. state.output = utils.escapeLast(state.output, '[');
  40720. decrement('brackets');
  40721. }
  40722. while (state.parens > 0) {
  40723. if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ')'));
  40724. state.output = utils.escapeLast(state.output, '(');
  40725. decrement('parens');
  40726. }
  40727. while (state.braces > 0) {
  40728. if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', '}'));
  40729. state.output = utils.escapeLast(state.output, '{');
  40730. decrement('braces');
  40731. }
  40732. if (opts.strictSlashes !== true && (prev.type === 'star' || prev.type === 'bracket')) {
  40733. push({ type: 'maybe_slash', value: '', output: `${SLASH_LITERAL}?` });
  40734. }
  40735. // rebuild the output if we had to backtrack at any point
  40736. if (state.backtrack === true) {
  40737. state.output = '';
  40738. for (const token of state.tokens) {
  40739. state.output += token.output != null ? token.output : token.value;
  40740. if (token.suffix) {
  40741. state.output += token.suffix;
  40742. }
  40743. }
  40744. }
  40745. return state;
  40746. };
  40747. /**
  40748. * Fast paths for creating regular expressions for common glob patterns.
  40749. * This can significantly speed up processing and has very little downside
  40750. * impact when none of the fast paths match.
  40751. */
  40752. parse$1.fastpaths = (input, options) => {
  40753. const opts = { ...options };
  40754. const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
  40755. const len = input.length;
  40756. if (len > max) {
  40757. throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
  40758. }
  40759. input = REPLACEMENTS[input] || input;
  40760. const win32 = utils.isWindows(options);
  40761. // create constants based on platform, for windows or posix
  40762. const {
  40763. DOT_LITERAL,
  40764. SLASH_LITERAL,
  40765. ONE_CHAR,
  40766. DOTS_SLASH,
  40767. NO_DOT,
  40768. NO_DOTS,
  40769. NO_DOTS_SLASH,
  40770. STAR,
  40771. START_ANCHOR
  40772. } = constants.globChars(win32);
  40773. const nodot = opts.dot ? NO_DOTS : NO_DOT;
  40774. const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT;
  40775. const capture = opts.capture ? '' : '?:';
  40776. const state = { negated: false, prefix: '' };
  40777. let star = opts.bash === true ? '.*?' : STAR;
  40778. if (opts.capture) {
  40779. star = `(${star})`;
  40780. }
  40781. const globstar = opts => {
  40782. if (opts.noglobstar === true) return star;
  40783. return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
  40784. };
  40785. const create = str => {
  40786. switch (str) {
  40787. case '*':
  40788. return `${nodot}${ONE_CHAR}${star}`;
  40789. case '.*':
  40790. return `${DOT_LITERAL}${ONE_CHAR}${star}`;
  40791. case '*.*':
  40792. return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
  40793. case '*/*':
  40794. return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`;
  40795. case '**':
  40796. return nodot + globstar(opts);
  40797. case '**/*':
  40798. return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`;
  40799. case '**/*.*':
  40800. return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
  40801. case '**/.*':
  40802. return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`;
  40803. default: {
  40804. const match = /^(.*?)\.(\w+)$/.exec(str);
  40805. if (!match) return;
  40806. const source = create(match[1]);
  40807. if (!source) return;
  40808. return source + DOT_LITERAL + match[2];
  40809. }
  40810. }
  40811. };
  40812. const output = utils.removePrefix(input, state);
  40813. let source = create(output);
  40814. if (source && opts.strictSlashes !== true) {
  40815. source += `${SLASH_LITERAL}?`;
  40816. }
  40817. return source;
  40818. };
  40819. var parse_1 = parse$1;
  40820. const isObject$1 = val => val && typeof val === 'object' && !Array.isArray(val);
  40821. /**
  40822. * Creates a matcher function from one or more glob patterns. The
  40823. * returned function takes a string to match as its first argument,
  40824. * and returns true if the string is a match. The returned matcher
  40825. * function also takes a boolean as the second argument that, when true,
  40826. * returns an object with additional information.
  40827. *
  40828. * ```js
  40829. * const picomatch = require('picomatch');
  40830. * // picomatch(glob[, options]);
  40831. *
  40832. * const isMatch = picomatch('*.!(*a)');
  40833. * console.log(isMatch('a.a')); //=> false
  40834. * console.log(isMatch('a.b')); //=> true
  40835. * ```
  40836. * @name picomatch
  40837. * @param {String|Array} `globs` One or more glob patterns.
  40838. * @param {Object=} `options`
  40839. * @return {Function=} Returns a matcher function.
  40840. * @api public
  40841. */
  40842. const picomatch$1 = (glob, options, returnState = false) => {
  40843. if (Array.isArray(glob)) {
  40844. const fns = glob.map(input => picomatch$1(input, options, returnState));
  40845. const arrayMatcher = str => {
  40846. for (const isMatch of fns) {
  40847. const state = isMatch(str);
  40848. if (state) return state;
  40849. }
  40850. return false;
  40851. };
  40852. return arrayMatcher;
  40853. }
  40854. const isState = isObject$1(glob) && glob.tokens && glob.input;
  40855. if (glob === '' || (typeof glob !== 'string' && !isState)) {
  40856. throw new TypeError('Expected pattern to be a non-empty string');
  40857. }
  40858. const opts = options || {};
  40859. const posix = utils.isWindows(options);
  40860. const regex = isState
  40861. ? picomatch$1.compileRe(glob, options)
  40862. : picomatch$1.makeRe(glob, options, false, true);
  40863. const state = regex.state;
  40864. delete regex.state;
  40865. let isIgnored = () => false;
  40866. if (opts.ignore) {
  40867. const ignoreOpts = { ...options, ignore: null, onMatch: null, onResult: null };
  40868. isIgnored = picomatch$1(opts.ignore, ignoreOpts, returnState);
  40869. }
  40870. const matcher = (input, returnObject = false) => {
  40871. const { isMatch, match, output } = picomatch$1.test(input, regex, options, { glob, posix });
  40872. const result = { glob, state, regex, posix, input, output, match, isMatch };
  40873. if (typeof opts.onResult === 'function') {
  40874. opts.onResult(result);
  40875. }
  40876. if (isMatch === false) {
  40877. result.isMatch = false;
  40878. return returnObject ? result : false;
  40879. }
  40880. if (isIgnored(input)) {
  40881. if (typeof opts.onIgnore === 'function') {
  40882. opts.onIgnore(result);
  40883. }
  40884. result.isMatch = false;
  40885. return returnObject ? result : false;
  40886. }
  40887. if (typeof opts.onMatch === 'function') {
  40888. opts.onMatch(result);
  40889. }
  40890. return returnObject ? result : true;
  40891. };
  40892. if (returnState) {
  40893. matcher.state = state;
  40894. }
  40895. return matcher;
  40896. };
  40897. /**
  40898. * Test `input` with the given `regex`. This is used by the main
  40899. * `picomatch()` function to test the input string.
  40900. *
  40901. * ```js
  40902. * const picomatch = require('picomatch');
  40903. * // picomatch.test(input, regex[, options]);
  40904. *
  40905. * console.log(picomatch.test('foo/bar', /^(?:([^/]*?)\/([^/]*?))$/));
  40906. * // { isMatch: true, match: [ 'foo/', 'foo', 'bar' ], output: 'foo/bar' }
  40907. * ```
  40908. * @param {String} `input` String to test.
  40909. * @param {RegExp} `regex`
  40910. * @return {Object} Returns an object with matching info.
  40911. * @api public
  40912. */
  40913. picomatch$1.test = (input, regex, options, { glob, posix } = {}) => {
  40914. if (typeof input !== 'string') {
  40915. throw new TypeError('Expected input to be a string');
  40916. }
  40917. if (input === '') {
  40918. return { isMatch: false, output: '' };
  40919. }
  40920. const opts = options || {};
  40921. const format = opts.format || (posix ? utils.toPosixSlashes : null);
  40922. let match = input === glob;
  40923. let output = (match && format) ? format(input) : input;
  40924. if (match === false) {
  40925. output = format ? format(input) : input;
  40926. match = output === glob;
  40927. }
  40928. if (match === false || opts.capture === true) {
  40929. if (opts.matchBase === true || opts.basename === true) {
  40930. match = picomatch$1.matchBase(input, regex, options, posix);
  40931. } else {
  40932. match = regex.exec(output);
  40933. }
  40934. }
  40935. return { isMatch: Boolean(match), match, output };
  40936. };
  40937. /**
  40938. * Match the basename of a filepath.
  40939. *
  40940. * ```js
  40941. * const picomatch = require('picomatch');
  40942. * // picomatch.matchBase(input, glob[, options]);
  40943. * console.log(picomatch.matchBase('foo/bar.js', '*.js'); // true
  40944. * ```
  40945. * @param {String} `input` String to test.
  40946. * @param {RegExp|String} `glob` Glob pattern or regex created by [.makeRe](#makeRe).
  40947. * @return {Boolean}
  40948. * @api public
  40949. */
  40950. picomatch$1.matchBase = (input, glob, options, posix = utils.isWindows(options)) => {
  40951. const regex = glob instanceof RegExp ? glob : picomatch$1.makeRe(glob, options);
  40952. return regex.test(path$5.basename(input));
  40953. };
  40954. /**
  40955. * Returns true if **any** of the given glob `patterns` match the specified `string`.
  40956. *
  40957. * ```js
  40958. * const picomatch = require('picomatch');
  40959. * // picomatch.isMatch(string, patterns[, options]);
  40960. *
  40961. * console.log(picomatch.isMatch('a.a', ['b.*', '*.a'])); //=> true
  40962. * console.log(picomatch.isMatch('a.a', 'b.*')); //=> false
  40963. * ```
  40964. * @param {String|Array} str The string to test.
  40965. * @param {String|Array} patterns One or more glob patterns to use for matching.
  40966. * @param {Object} [options] See available [options](#options).
  40967. * @return {Boolean} Returns true if any patterns match `str`
  40968. * @api public
  40969. */
  40970. picomatch$1.isMatch = (str, patterns, options) => picomatch$1(patterns, options)(str);
  40971. /**
  40972. * Parse a glob pattern to create the source string for a regular
  40973. * expression.
  40974. *
  40975. * ```js
  40976. * const picomatch = require('picomatch');
  40977. * const result = picomatch.parse(pattern[, options]);
  40978. * ```
  40979. * @param {String} `pattern`
  40980. * @param {Object} `options`
  40981. * @return {Object} Returns an object with useful properties and output to be used as a regex source string.
  40982. * @api public
  40983. */
  40984. picomatch$1.parse = (pattern, options) => {
  40985. if (Array.isArray(pattern)) return pattern.map(p => picomatch$1.parse(p, options));
  40986. return parse_1(pattern, { ...options, fastpaths: false });
  40987. };
  40988. /**
  40989. * Scan a glob pattern to separate the pattern into segments.
  40990. *
  40991. * ```js
  40992. * const picomatch = require('picomatch');
  40993. * // picomatch.scan(input[, options]);
  40994. *
  40995. * const result = picomatch.scan('!./foo/*.js');
  40996. * console.log(result);
  40997. * { prefix: '!./',
  40998. * input: '!./foo/*.js',
  40999. * start: 3,
  41000. * base: 'foo',
  41001. * glob: '*.js',
  41002. * isBrace: false,
  41003. * isBracket: false,
  41004. * isGlob: true,
  41005. * isExtglob: false,
  41006. * isGlobstar: false,
  41007. * negated: true }
  41008. * ```
  41009. * @param {String} `input` Glob pattern to scan.
  41010. * @param {Object} `options`
  41011. * @return {Object} Returns an object with
  41012. * @api public
  41013. */
  41014. picomatch$1.scan = (input, options) => scan_1(input, options);
  41015. /**
  41016. * Compile a regular expression from the `state` object returned by the
  41017. * [parse()](#parse) method.
  41018. *
  41019. * @param {Object} `state`
  41020. * @param {Object} `options`
  41021. * @param {Boolean} `returnOutput` Intended for implementors, this argument allows you to return the raw output from the parser.
  41022. * @param {Boolean} `returnState` Adds the state to a `state` property on the returned regex. Useful for implementors and debugging.
  41023. * @return {RegExp}
  41024. * @api public
  41025. */
  41026. picomatch$1.compileRe = (state, options, returnOutput = false, returnState = false) => {
  41027. if (returnOutput === true) {
  41028. return state.output;
  41029. }
  41030. const opts = options || {};
  41031. const prepend = opts.contains ? '' : '^';
  41032. const append = opts.contains ? '' : '$';
  41033. let source = `${prepend}(?:${state.output})${append}`;
  41034. if (state && state.negated === true) {
  41035. source = `^(?!${source}).*$`;
  41036. }
  41037. const regex = picomatch$1.toRegex(source, options);
  41038. if (returnState === true) {
  41039. regex.state = state;
  41040. }
  41041. return regex;
  41042. };
  41043. /**
  41044. * Create a regular expression from a parsed glob pattern.
  41045. *
  41046. * ```js
  41047. * const picomatch = require('picomatch');
  41048. * const state = picomatch.parse('*.js');
  41049. * // picomatch.compileRe(state[, options]);
  41050. *
  41051. * console.log(picomatch.compileRe(state));
  41052. * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/
  41053. * ```
  41054. * @param {String} `state` The object returned from the `.parse` method.
  41055. * @param {Object} `options`
  41056. * @param {Boolean} `returnOutput` Implementors may use this argument to return the compiled output, instead of a regular expression. This is not exposed on the options to prevent end-users from mutating the result.
  41057. * @param {Boolean} `returnState` Implementors may use this argument to return the state from the parsed glob with the returned regular expression.
  41058. * @return {RegExp} Returns a regex created from the given pattern.
  41059. * @api public
  41060. */
  41061. picomatch$1.makeRe = (input, options = {}, returnOutput = false, returnState = false) => {
  41062. if (!input || typeof input !== 'string') {
  41063. throw new TypeError('Expected a non-empty string');
  41064. }
  41065. let parsed = { negated: false, fastpaths: true };
  41066. if (options.fastpaths !== false && (input[0] === '.' || input[0] === '*')) {
  41067. parsed.output = parse_1.fastpaths(input, options);
  41068. }
  41069. if (!parsed.output) {
  41070. parsed = parse_1(input, options);
  41071. }
  41072. return picomatch$1.compileRe(parsed, options, returnOutput, returnState);
  41073. };
  41074. /**
  41075. * Create a regular expression from the given regex source string.
  41076. *
  41077. * ```js
  41078. * const picomatch = require('picomatch');
  41079. * // picomatch.toRegex(source[, options]);
  41080. *
  41081. * const { output } = picomatch.parse('*.js');
  41082. * console.log(picomatch.toRegex(output));
  41083. * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/
  41084. * ```
  41085. * @param {String} `source` Regular expression source string.
  41086. * @param {Object} `options`
  41087. * @return {RegExp}
  41088. * @api public
  41089. */
  41090. picomatch$1.toRegex = (source, options) => {
  41091. try {
  41092. const opts = options || {};
  41093. return new RegExp(source, opts.flags || (opts.nocase ? 'i' : ''));
  41094. } catch (err) {
  41095. if (options && options.debug === true) throw err;
  41096. return /$^/;
  41097. }
  41098. };
  41099. /**
  41100. * Picomatch constants.
  41101. * @return {Object}
  41102. */
  41103. picomatch$1.constants = constants;
  41104. /**
  41105. * Expose "picomatch"
  41106. */
  41107. var picomatch_1 = picomatch$1;
  41108. var picomatch = picomatch_1;
  41109. function walk$2(ast, { enter, leave }) {
  41110. return visit(ast, null, enter, leave);
  41111. }
  41112. let should_skip = false;
  41113. let should_remove = false;
  41114. let replacement = null;
  41115. const context = {
  41116. skip: () => should_skip = true,
  41117. remove: () => should_remove = true,
  41118. replace: (node) => replacement = node
  41119. };
  41120. function replace$1(parent, prop, index, node) {
  41121. if (parent) {
  41122. if (index !== null) {
  41123. parent[prop][index] = node;
  41124. } else {
  41125. parent[prop] = node;
  41126. }
  41127. }
  41128. }
  41129. function remove(parent, prop, index) {
  41130. if (parent) {
  41131. if (index !== null) {
  41132. parent[prop].splice(index, 1);
  41133. } else {
  41134. delete parent[prop];
  41135. }
  41136. }
  41137. }
  41138. function visit(
  41139. node,
  41140. parent,
  41141. enter,
  41142. leave,
  41143. prop,
  41144. index
  41145. ) {
  41146. if (node) {
  41147. if (enter) {
  41148. const _should_skip = should_skip;
  41149. const _should_remove = should_remove;
  41150. const _replacement = replacement;
  41151. should_skip = false;
  41152. should_remove = false;
  41153. replacement = null;
  41154. enter.call(context, node, parent, prop, index);
  41155. if (replacement) {
  41156. node = replacement;
  41157. replace$1(parent, prop, index, node);
  41158. }
  41159. if (should_remove) {
  41160. remove(parent, prop, index);
  41161. }
  41162. const skipped = should_skip;
  41163. const removed = should_remove;
  41164. should_skip = _should_skip;
  41165. should_remove = _should_remove;
  41166. replacement = _replacement;
  41167. if (skipped) return node;
  41168. if (removed) return null;
  41169. }
  41170. for (const key in node) {
  41171. const value = (node )[key];
  41172. if (typeof value !== 'object') {
  41173. continue;
  41174. }
  41175. else if (Array.isArray(value)) {
  41176. for (let j = 0, k = 0; j < value.length; j += 1, k += 1) {
  41177. if (value[j] !== null && typeof value[j].type === 'string') {
  41178. if (!visit(value[j], node, enter, leave, key, k)) {
  41179. // removed
  41180. j--;
  41181. }
  41182. }
  41183. }
  41184. }
  41185. else if (value !== null && typeof value.type === 'string') {
  41186. visit(value, node, enter, leave, key, null);
  41187. }
  41188. }
  41189. if (leave) {
  41190. const _replacement = replacement;
  41191. const _should_remove = should_remove;
  41192. replacement = null;
  41193. should_remove = false;
  41194. leave.call(context, node, parent, prop, index);
  41195. if (replacement) {
  41196. node = replacement;
  41197. replace$1(parent, prop, index, node);
  41198. }
  41199. if (should_remove) {
  41200. remove(parent, prop, index);
  41201. }
  41202. const removed = should_remove;
  41203. replacement = _replacement;
  41204. should_remove = _should_remove;
  41205. if (removed) return null;
  41206. }
  41207. }
  41208. return node;
  41209. }
  41210. const extractors$1 = {
  41211. ArrayPattern(names, param) {
  41212. for (const element of param.elements) {
  41213. if (element)
  41214. extractors$1[element.type](names, element);
  41215. }
  41216. },
  41217. AssignmentPattern(names, param) {
  41218. extractors$1[param.left.type](names, param.left);
  41219. },
  41220. Identifier(names, param) {
  41221. names.push(param.name);
  41222. },
  41223. MemberExpression() { },
  41224. ObjectPattern(names, param) {
  41225. for (const prop of param.properties) {
  41226. // @ts-ignore Typescript reports that this is not a valid type
  41227. if (prop.type === 'RestElement') {
  41228. extractors$1.RestElement(names, prop);
  41229. }
  41230. else {
  41231. extractors$1[prop.value.type](names, prop.value);
  41232. }
  41233. }
  41234. },
  41235. RestElement(names, param) {
  41236. extractors$1[param.argument.type](names, param.argument);
  41237. }
  41238. };
  41239. const extractAssignedNames$1 = function extractAssignedNames(param) {
  41240. const names = [];
  41241. extractors$1[param.type](names, param);
  41242. return names;
  41243. };
  41244. const blockDeclarations$1 = {
  41245. const: true,
  41246. let: true
  41247. };
  41248. class Scope$1 {
  41249. constructor(options = {}) {
  41250. this.parent = options.parent;
  41251. this.isBlockScope = !!options.block;
  41252. this.declarations = Object.create(null);
  41253. if (options.params) {
  41254. options.params.forEach((param) => {
  41255. extractAssignedNames$1(param).forEach((name) => {
  41256. this.declarations[name] = true;
  41257. });
  41258. });
  41259. }
  41260. }
  41261. addDeclaration(node, isBlockDeclaration, isVar) {
  41262. if (!isBlockDeclaration && this.isBlockScope) {
  41263. // it's a `var` or function node, and this
  41264. // is a block scope, so we need to go up
  41265. this.parent.addDeclaration(node, isBlockDeclaration, isVar);
  41266. }
  41267. else if (node.id) {
  41268. extractAssignedNames$1(node.id).forEach((name) => {
  41269. this.declarations[name] = true;
  41270. });
  41271. }
  41272. }
  41273. contains(name) {
  41274. return this.declarations[name] || (this.parent ? this.parent.contains(name) : false);
  41275. }
  41276. }
  41277. const attachScopes$1 = function attachScopes(ast, propertyName = 'scope') {
  41278. let scope = new Scope$1();
  41279. walk$2(ast, {
  41280. enter(n, parent) {
  41281. const node = n;
  41282. // function foo () {...}
  41283. // class Foo {...}
  41284. if (/(Function|Class)Declaration/.test(node.type)) {
  41285. scope.addDeclaration(node, false, false);
  41286. }
  41287. // var foo = 1
  41288. if (node.type === 'VariableDeclaration') {
  41289. const { kind } = node;
  41290. const isBlockDeclaration = blockDeclarations$1[kind];
  41291. // don't add const/let declarations in the body of a for loop #113
  41292. const parentType = parent ? parent.type : '';
  41293. if (!(isBlockDeclaration && /ForOfStatement/.test(parentType))) {
  41294. node.declarations.forEach((declaration) => {
  41295. scope.addDeclaration(declaration, isBlockDeclaration, true);
  41296. });
  41297. }
  41298. }
  41299. let newScope;
  41300. // create new function scope
  41301. if (/Function/.test(node.type)) {
  41302. const func = node;
  41303. newScope = new Scope$1({
  41304. parent: scope,
  41305. block: false,
  41306. params: func.params
  41307. });
  41308. // named function expressions - the name is considered
  41309. // part of the function's scope
  41310. if (func.type === 'FunctionExpression' && func.id) {
  41311. newScope.addDeclaration(func, false, false);
  41312. }
  41313. }
  41314. // create new block scope
  41315. if (node.type === 'BlockStatement' && !/Function/.test(parent.type)) {
  41316. newScope = new Scope$1({
  41317. parent: scope,
  41318. block: true
  41319. });
  41320. }
  41321. // catch clause has its own block scope
  41322. if (node.type === 'CatchClause') {
  41323. newScope = new Scope$1({
  41324. parent: scope,
  41325. params: node.param ? [node.param] : [],
  41326. block: true
  41327. });
  41328. }
  41329. if (newScope) {
  41330. Object.defineProperty(node, propertyName, {
  41331. value: newScope,
  41332. configurable: true
  41333. });
  41334. scope = newScope;
  41335. }
  41336. },
  41337. leave(n) {
  41338. const node = n;
  41339. if (node[propertyName])
  41340. scope = scope.parent;
  41341. }
  41342. });
  41343. return scope;
  41344. };
  41345. // Helper since Typescript can't detect readonly arrays with Array.isArray
  41346. function isArray$5(arg) {
  41347. return Array.isArray(arg);
  41348. }
  41349. function ensureArray$4(thing) {
  41350. if (isArray$5(thing))
  41351. return thing;
  41352. if (thing == null)
  41353. return [];
  41354. return [thing];
  41355. }
  41356. function getMatcherString$4(id, resolutionBase) {
  41357. if (resolutionBase === false) {
  41358. return id;
  41359. }
  41360. // resolve('') is valid and will default to process.cwd()
  41361. const basePath = resolve$1(resolutionBase || '')
  41362. .split(sep)
  41363. .join('/')
  41364. // escape all possible (posix + win) path characters that might interfere with regex
  41365. .replace(/[-^$*+?.()|[\]{}]/g, '\\$&');
  41366. // Note that we use posix.join because:
  41367. // 1. the basePath has been normalized to use /
  41368. // 2. the incoming glob (id) matcher, also uses /
  41369. // otherwise Node will force backslash (\) on windows
  41370. return posix$1.join(basePath, id);
  41371. }
  41372. const createFilter$4 = function createFilter(include, exclude, options) {
  41373. const resolutionBase = options && options.resolve;
  41374. const getMatcher = (id) => id instanceof RegExp
  41375. ? id
  41376. : {
  41377. test: (what) => {
  41378. // this refactor is a tad overly verbose but makes for easy debugging
  41379. const pattern = getMatcherString$4(id, resolutionBase);
  41380. const fn = picomatch(pattern, { dot: true });
  41381. const result = fn(what);
  41382. return result;
  41383. }
  41384. };
  41385. const includeMatchers = ensureArray$4(include).map(getMatcher);
  41386. const excludeMatchers = ensureArray$4(exclude).map(getMatcher);
  41387. return function result(id) {
  41388. if (typeof id !== 'string')
  41389. return false;
  41390. if (/\0/.test(id))
  41391. return false;
  41392. const pathId = id.split(sep).join('/');
  41393. for (let i = 0; i < excludeMatchers.length; ++i) {
  41394. const matcher = excludeMatchers[i];
  41395. if (matcher.test(pathId))
  41396. return false;
  41397. }
  41398. for (let i = 0; i < includeMatchers.length; ++i) {
  41399. const matcher = includeMatchers[i];
  41400. if (matcher.test(pathId))
  41401. return true;
  41402. }
  41403. return !includeMatchers.length;
  41404. };
  41405. };
  41406. const reservedWords$4 = 'break case class catch const continue debugger default delete do else export extends finally for function if import in instanceof let new return super switch this throw try typeof var void while with yield enum await implements package protected static interface private public';
  41407. const builtins$5 = 'arguments Infinity NaN undefined null true false eval uneval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Symbol Error EvalError InternalError RangeError ReferenceError SyntaxError TypeError URIError Number Math Date String RegExp Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array Map Set WeakMap WeakSet SIMD ArrayBuffer DataView JSON Promise Generator GeneratorFunction Reflect Proxy Intl';
  41408. const forbiddenIdentifiers$4 = new Set(`${reservedWords$4} ${builtins$5}`.split(' '));
  41409. forbiddenIdentifiers$4.add('');
  41410. const makeLegalIdentifier$2 = function makeLegalIdentifier(str) {
  41411. let identifier = str
  41412. .replace(/-(\w)/g, (_, letter) => letter.toUpperCase())
  41413. .replace(/[^$_a-zA-Z0-9]/g, '_');
  41414. if (/\d/.test(identifier[0]) || forbiddenIdentifiers$4.has(identifier)) {
  41415. identifier = `_${identifier}`;
  41416. }
  41417. return identifier || '_';
  41418. };
  41419. var commondir = function (basedir, relfiles) {
  41420. if (relfiles) {
  41421. var files = relfiles.map(function (r) {
  41422. return path$5.resolve(basedir, r);
  41423. });
  41424. }
  41425. else {
  41426. var files = basedir;
  41427. }
  41428. var res = files.slice(1).reduce(function (ps, file) {
  41429. if (!file.match(/^([A-Za-z]:)?\/|\\/)) {
  41430. throw new Error('relative path without a basedir');
  41431. }
  41432. var xs = file.split(/\/+|\\+/);
  41433. for (
  41434. var i = 0;
  41435. ps[i] === xs[i] && i < Math.min(ps.length, xs.length);
  41436. i++
  41437. );
  41438. return ps.slice(0, i);
  41439. }, files[0].split(/\/+|\\+/));
  41440. // Windows correctly handles paths with forward-slashes
  41441. return res.length > 1 ? res.join('/') : '/'
  41442. };
  41443. // @ts-check
  41444. /** @typedef { import('estree').BaseNode} BaseNode */
  41445. /** @typedef {{
  41446. skip: () => void;
  41447. remove: () => void;
  41448. replace: (node: BaseNode) => void;
  41449. }} WalkerContext */
  41450. class WalkerBase$1 {
  41451. constructor() {
  41452. /** @type {boolean} */
  41453. this.should_skip = false;
  41454. /** @type {boolean} */
  41455. this.should_remove = false;
  41456. /** @type {BaseNode | null} */
  41457. this.replacement = null;
  41458. /** @type {WalkerContext} */
  41459. this.context = {
  41460. skip: () => (this.should_skip = true),
  41461. remove: () => (this.should_remove = true),
  41462. replace: (node) => (this.replacement = node)
  41463. };
  41464. }
  41465. /**
  41466. *
  41467. * @param {any} parent
  41468. * @param {string} prop
  41469. * @param {number} index
  41470. * @param {BaseNode} node
  41471. */
  41472. replace(parent, prop, index, node) {
  41473. if (parent) {
  41474. if (index !== null) {
  41475. parent[prop][index] = node;
  41476. } else {
  41477. parent[prop] = node;
  41478. }
  41479. }
  41480. }
  41481. /**
  41482. *
  41483. * @param {any} parent
  41484. * @param {string} prop
  41485. * @param {number} index
  41486. */
  41487. remove(parent, prop, index) {
  41488. if (parent) {
  41489. if (index !== null) {
  41490. parent[prop].splice(index, 1);
  41491. } else {
  41492. delete parent[prop];
  41493. }
  41494. }
  41495. }
  41496. }
  41497. // @ts-check
  41498. /** @typedef { import('estree').BaseNode} BaseNode */
  41499. /** @typedef { import('./walker.js').WalkerContext} WalkerContext */
  41500. /** @typedef {(
  41501. * this: WalkerContext,
  41502. * node: BaseNode,
  41503. * parent: BaseNode,
  41504. * key: string,
  41505. * index: number
  41506. * ) => void} SyncHandler */
  41507. class SyncWalker extends WalkerBase$1 {
  41508. /**
  41509. *
  41510. * @param {SyncHandler} enter
  41511. * @param {SyncHandler} leave
  41512. */
  41513. constructor(enter, leave) {
  41514. super();
  41515. /** @type {SyncHandler} */
  41516. this.enter = enter;
  41517. /** @type {SyncHandler} */
  41518. this.leave = leave;
  41519. }
  41520. /**
  41521. *
  41522. * @param {BaseNode} node
  41523. * @param {BaseNode} parent
  41524. * @param {string} [prop]
  41525. * @param {number} [index]
  41526. * @returns {BaseNode}
  41527. */
  41528. visit(node, parent, prop, index) {
  41529. if (node) {
  41530. if (this.enter) {
  41531. const _should_skip = this.should_skip;
  41532. const _should_remove = this.should_remove;
  41533. const _replacement = this.replacement;
  41534. this.should_skip = false;
  41535. this.should_remove = false;
  41536. this.replacement = null;
  41537. this.enter.call(this.context, node, parent, prop, index);
  41538. if (this.replacement) {
  41539. node = this.replacement;
  41540. this.replace(parent, prop, index, node);
  41541. }
  41542. if (this.should_remove) {
  41543. this.remove(parent, prop, index);
  41544. }
  41545. const skipped = this.should_skip;
  41546. const removed = this.should_remove;
  41547. this.should_skip = _should_skip;
  41548. this.should_remove = _should_remove;
  41549. this.replacement = _replacement;
  41550. if (skipped) return node;
  41551. if (removed) return null;
  41552. }
  41553. for (const key in node) {
  41554. const value = node[key];
  41555. if (typeof value !== "object") {
  41556. continue;
  41557. } else if (Array.isArray(value)) {
  41558. for (let i = 0; i < value.length; i += 1) {
  41559. if (value[i] !== null && typeof value[i].type === 'string') {
  41560. if (!this.visit(value[i], node, key, i)) {
  41561. // removed
  41562. i--;
  41563. }
  41564. }
  41565. }
  41566. } else if (value !== null && typeof value.type === "string") {
  41567. this.visit(value, node, key, null);
  41568. }
  41569. }
  41570. if (this.leave) {
  41571. const _replacement = this.replacement;
  41572. const _should_remove = this.should_remove;
  41573. this.replacement = null;
  41574. this.should_remove = false;
  41575. this.leave.call(this.context, node, parent, prop, index);
  41576. if (this.replacement) {
  41577. node = this.replacement;
  41578. this.replace(parent, prop, index, node);
  41579. }
  41580. if (this.should_remove) {
  41581. this.remove(parent, prop, index);
  41582. }
  41583. const removed = this.should_remove;
  41584. this.replacement = _replacement;
  41585. this.should_remove = _should_remove;
  41586. if (removed) return null;
  41587. }
  41588. }
  41589. return node;
  41590. }
  41591. }
  41592. // @ts-check
  41593. /** @typedef { import('estree').BaseNode} BaseNode */
  41594. /** @typedef { import('./sync.js').SyncHandler} SyncHandler */
  41595. /** @typedef { import('./async.js').AsyncHandler} AsyncHandler */
  41596. /**
  41597. *
  41598. * @param {BaseNode} ast
  41599. * @param {{
  41600. * enter?: SyncHandler
  41601. * leave?: SyncHandler
  41602. * }} walker
  41603. * @returns {BaseNode}
  41604. */
  41605. function walk$1(ast, { enter, leave }) {
  41606. const instance = new SyncWalker(enter, leave);
  41607. return instance.visit(ast, null);
  41608. }
  41609. var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
  41610. function encode(decoded) {
  41611. var sourceFileIndex = 0; // second field
  41612. var sourceCodeLine = 0; // third field
  41613. var sourceCodeColumn = 0; // fourth field
  41614. var nameIndex = 0; // fifth field
  41615. var mappings = '';
  41616. for (var i = 0; i < decoded.length; i++) {
  41617. var line = decoded[i];
  41618. if (i > 0)
  41619. mappings += ';';
  41620. if (line.length === 0)
  41621. continue;
  41622. var generatedCodeColumn = 0; // first field
  41623. var lineMappings = [];
  41624. for (var _i = 0, line_1 = line; _i < line_1.length; _i++) {
  41625. var segment = line_1[_i];
  41626. var segmentMappings = encodeInteger(segment[0] - generatedCodeColumn);
  41627. generatedCodeColumn = segment[0];
  41628. if (segment.length > 1) {
  41629. segmentMappings +=
  41630. encodeInteger(segment[1] - sourceFileIndex) +
  41631. encodeInteger(segment[2] - sourceCodeLine) +
  41632. encodeInteger(segment[3] - sourceCodeColumn);
  41633. sourceFileIndex = segment[1];
  41634. sourceCodeLine = segment[2];
  41635. sourceCodeColumn = segment[3];
  41636. }
  41637. if (segment.length === 5) {
  41638. segmentMappings += encodeInteger(segment[4] - nameIndex);
  41639. nameIndex = segment[4];
  41640. }
  41641. lineMappings.push(segmentMappings);
  41642. }
  41643. mappings += lineMappings.join(',');
  41644. }
  41645. return mappings;
  41646. }
  41647. function encodeInteger(num) {
  41648. var result = '';
  41649. num = num < 0 ? (-num << 1) | 1 : num << 1;
  41650. do {
  41651. var clamped = num & 31;
  41652. num >>>= 5;
  41653. if (num > 0) {
  41654. clamped |= 32;
  41655. }
  41656. result += chars[clamped];
  41657. } while (num > 0);
  41658. return result;
  41659. }
  41660. var BitSet = function BitSet(arg) {
  41661. this.bits = arg instanceof BitSet ? arg.bits.slice() : [];
  41662. };
  41663. BitSet.prototype.add = function add (n) {
  41664. this.bits[n >> 5] |= 1 << (n & 31);
  41665. };
  41666. BitSet.prototype.has = function has (n) {
  41667. return !!(this.bits[n >> 5] & (1 << (n & 31)));
  41668. };
  41669. var Chunk = function Chunk(start, end, content) {
  41670. this.start = start;
  41671. this.end = end;
  41672. this.original = content;
  41673. this.intro = '';
  41674. this.outro = '';
  41675. this.content = content;
  41676. this.storeName = false;
  41677. this.edited = false;
  41678. // we make these non-enumerable, for sanity while debugging
  41679. Object.defineProperties(this, {
  41680. previous: { writable: true, value: null },
  41681. next: { writable: true, value: null }
  41682. });
  41683. };
  41684. Chunk.prototype.appendLeft = function appendLeft (content) {
  41685. this.outro += content;
  41686. };
  41687. Chunk.prototype.appendRight = function appendRight (content) {
  41688. this.intro = this.intro + content;
  41689. };
  41690. Chunk.prototype.clone = function clone () {
  41691. var chunk = new Chunk(this.start, this.end, this.original);
  41692. chunk.intro = this.intro;
  41693. chunk.outro = this.outro;
  41694. chunk.content = this.content;
  41695. chunk.storeName = this.storeName;
  41696. chunk.edited = this.edited;
  41697. return chunk;
  41698. };
  41699. Chunk.prototype.contains = function contains (index) {
  41700. return this.start < index && index < this.end;
  41701. };
  41702. Chunk.prototype.eachNext = function eachNext (fn) {
  41703. var chunk = this;
  41704. while (chunk) {
  41705. fn(chunk);
  41706. chunk = chunk.next;
  41707. }
  41708. };
  41709. Chunk.prototype.eachPrevious = function eachPrevious (fn) {
  41710. var chunk = this;
  41711. while (chunk) {
  41712. fn(chunk);
  41713. chunk = chunk.previous;
  41714. }
  41715. };
  41716. Chunk.prototype.edit = function edit (content, storeName, contentOnly) {
  41717. this.content = content;
  41718. if (!contentOnly) {
  41719. this.intro = '';
  41720. this.outro = '';
  41721. }
  41722. this.storeName = storeName;
  41723. this.edited = true;
  41724. return this;
  41725. };
  41726. Chunk.prototype.prependLeft = function prependLeft (content) {
  41727. this.outro = content + this.outro;
  41728. };
  41729. Chunk.prototype.prependRight = function prependRight (content) {
  41730. this.intro = content + this.intro;
  41731. };
  41732. Chunk.prototype.split = function split (index) {
  41733. var sliceIndex = index - this.start;
  41734. var originalBefore = this.original.slice(0, sliceIndex);
  41735. var originalAfter = this.original.slice(sliceIndex);
  41736. this.original = originalBefore;
  41737. var newChunk = new Chunk(index, this.end, originalAfter);
  41738. newChunk.outro = this.outro;
  41739. this.outro = '';
  41740. this.end = index;
  41741. if (this.edited) {
  41742. // TODO is this block necessary?...
  41743. newChunk.edit('', false);
  41744. this.content = '';
  41745. } else {
  41746. this.content = originalBefore;
  41747. }
  41748. newChunk.next = this.next;
  41749. if (newChunk.next) { newChunk.next.previous = newChunk; }
  41750. newChunk.previous = this;
  41751. this.next = newChunk;
  41752. return newChunk;
  41753. };
  41754. Chunk.prototype.toString = function toString () {
  41755. return this.intro + this.content + this.outro;
  41756. };
  41757. Chunk.prototype.trimEnd = function trimEnd (rx) {
  41758. this.outro = this.outro.replace(rx, '');
  41759. if (this.outro.length) { return true; }
  41760. var trimmed = this.content.replace(rx, '');
  41761. if (trimmed.length) {
  41762. if (trimmed !== this.content) {
  41763. this.split(this.start + trimmed.length).edit('', undefined, true);
  41764. }
  41765. return true;
  41766. } else {
  41767. this.edit('', undefined, true);
  41768. this.intro = this.intro.replace(rx, '');
  41769. if (this.intro.length) { return true; }
  41770. }
  41771. };
  41772. Chunk.prototype.trimStart = function trimStart (rx) {
  41773. this.intro = this.intro.replace(rx, '');
  41774. if (this.intro.length) { return true; }
  41775. var trimmed = this.content.replace(rx, '');
  41776. if (trimmed.length) {
  41777. if (trimmed !== this.content) {
  41778. this.split(this.end - trimmed.length);
  41779. this.edit('', undefined, true);
  41780. }
  41781. return true;
  41782. } else {
  41783. this.edit('', undefined, true);
  41784. this.outro = this.outro.replace(rx, '');
  41785. if (this.outro.length) { return true; }
  41786. }
  41787. };
  41788. var btoa$1 = function () {
  41789. throw new Error('Unsupported environment: `window.btoa` or `Buffer` should be supported.');
  41790. };
  41791. if (typeof window !== 'undefined' && typeof window.btoa === 'function') {
  41792. btoa$1 = function (str) { return window.btoa(unescape(encodeURIComponent(str))); };
  41793. } else if (typeof Buffer === 'function') {
  41794. btoa$1 = function (str) { return Buffer.from(str, 'utf-8').toString('base64'); };
  41795. }
  41796. var SourceMap = function SourceMap(properties) {
  41797. this.version = 3;
  41798. this.file = properties.file;
  41799. this.sources = properties.sources;
  41800. this.sourcesContent = properties.sourcesContent;
  41801. this.names = properties.names;
  41802. this.mappings = encode(properties.mappings);
  41803. };
  41804. SourceMap.prototype.toString = function toString () {
  41805. return JSON.stringify(this);
  41806. };
  41807. SourceMap.prototype.toUrl = function toUrl () {
  41808. return 'data:application/json;charset=utf-8;base64,' + btoa$1(this.toString());
  41809. };
  41810. function guessIndent(code) {
  41811. var lines = code.split('\n');
  41812. var tabbed = lines.filter(function (line) { return /^\t+/.test(line); });
  41813. var spaced = lines.filter(function (line) { return /^ {2,}/.test(line); });
  41814. if (tabbed.length === 0 && spaced.length === 0) {
  41815. return null;
  41816. }
  41817. // More lines tabbed than spaced? Assume tabs, and
  41818. // default to tabs in the case of a tie (or nothing
  41819. // to go on)
  41820. if (tabbed.length >= spaced.length) {
  41821. return '\t';
  41822. }
  41823. // Otherwise, we need to guess the multiple
  41824. var min = spaced.reduce(function (previous, current) {
  41825. var numSpaces = /^ +/.exec(current)[0].length;
  41826. return Math.min(numSpaces, previous);
  41827. }, Infinity);
  41828. return new Array(min + 1).join(' ');
  41829. }
  41830. function getRelativePath(from, to) {
  41831. var fromParts = from.split(/[/\\]/);
  41832. var toParts = to.split(/[/\\]/);
  41833. fromParts.pop(); // get dirname
  41834. while (fromParts[0] === toParts[0]) {
  41835. fromParts.shift();
  41836. toParts.shift();
  41837. }
  41838. if (fromParts.length) {
  41839. var i = fromParts.length;
  41840. while (i--) { fromParts[i] = '..'; }
  41841. }
  41842. return fromParts.concat(toParts).join('/');
  41843. }
  41844. var toString = Object.prototype.toString;
  41845. function isObject(thing) {
  41846. return toString.call(thing) === '[object Object]';
  41847. }
  41848. function getLocator(source) {
  41849. var originalLines = source.split('\n');
  41850. var lineOffsets = [];
  41851. for (var i = 0, pos = 0; i < originalLines.length; i++) {
  41852. lineOffsets.push(pos);
  41853. pos += originalLines[i].length + 1;
  41854. }
  41855. return function locate(index) {
  41856. var i = 0;
  41857. var j = lineOffsets.length;
  41858. while (i < j) {
  41859. var m = (i + j) >> 1;
  41860. if (index < lineOffsets[m]) {
  41861. j = m;
  41862. } else {
  41863. i = m + 1;
  41864. }
  41865. }
  41866. var line = i - 1;
  41867. var column = index - lineOffsets[line];
  41868. return { line: line, column: column };
  41869. };
  41870. }
  41871. var Mappings = function Mappings(hires) {
  41872. this.hires = hires;
  41873. this.generatedCodeLine = 0;
  41874. this.generatedCodeColumn = 0;
  41875. this.raw = [];
  41876. this.rawSegments = this.raw[this.generatedCodeLine] = [];
  41877. this.pending = null;
  41878. };
  41879. Mappings.prototype.addEdit = function addEdit (sourceIndex, content, loc, nameIndex) {
  41880. if (content.length) {
  41881. var segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column];
  41882. if (nameIndex >= 0) {
  41883. segment.push(nameIndex);
  41884. }
  41885. this.rawSegments.push(segment);
  41886. } else if (this.pending) {
  41887. this.rawSegments.push(this.pending);
  41888. }
  41889. this.advance(content);
  41890. this.pending = null;
  41891. };
  41892. Mappings.prototype.addUneditedChunk = function addUneditedChunk (sourceIndex, chunk, original, loc, sourcemapLocations) {
  41893. var originalCharIndex = chunk.start;
  41894. var first = true;
  41895. while (originalCharIndex < chunk.end) {
  41896. if (this.hires || first || sourcemapLocations.has(originalCharIndex)) {
  41897. this.rawSegments.push([this.generatedCodeColumn, sourceIndex, loc.line, loc.column]);
  41898. }
  41899. if (original[originalCharIndex] === '\n') {
  41900. loc.line += 1;
  41901. loc.column = 0;
  41902. this.generatedCodeLine += 1;
  41903. this.raw[this.generatedCodeLine] = this.rawSegments = [];
  41904. this.generatedCodeColumn = 0;
  41905. first = true;
  41906. } else {
  41907. loc.column += 1;
  41908. this.generatedCodeColumn += 1;
  41909. first = false;
  41910. }
  41911. originalCharIndex += 1;
  41912. }
  41913. this.pending = null;
  41914. };
  41915. Mappings.prototype.advance = function advance (str) {
  41916. if (!str) { return; }
  41917. var lines = str.split('\n');
  41918. if (lines.length > 1) {
  41919. for (var i = 0; i < lines.length - 1; i++) {
  41920. this.generatedCodeLine++;
  41921. this.raw[this.generatedCodeLine] = this.rawSegments = [];
  41922. }
  41923. this.generatedCodeColumn = 0;
  41924. }
  41925. this.generatedCodeColumn += lines[lines.length - 1].length;
  41926. };
  41927. var n = '\n';
  41928. var warned = {
  41929. insertLeft: false,
  41930. insertRight: false,
  41931. storeName: false
  41932. };
  41933. var MagicString = function MagicString(string, options) {
  41934. if ( options === void 0 ) options = {};
  41935. var chunk = new Chunk(0, string.length, string);
  41936. Object.defineProperties(this, {
  41937. original: { writable: true, value: string },
  41938. outro: { writable: true, value: '' },
  41939. intro: { writable: true, value: '' },
  41940. firstChunk: { writable: true, value: chunk },
  41941. lastChunk: { writable: true, value: chunk },
  41942. lastSearchedChunk: { writable: true, value: chunk },
  41943. byStart: { writable: true, value: {} },
  41944. byEnd: { writable: true, value: {} },
  41945. filename: { writable: true, value: options.filename },
  41946. indentExclusionRanges: { writable: true, value: options.indentExclusionRanges },
  41947. sourcemapLocations: { writable: true, value: new BitSet() },
  41948. storedNames: { writable: true, value: {} },
  41949. indentStr: { writable: true, value: guessIndent(string) }
  41950. });
  41951. this.byStart[0] = chunk;
  41952. this.byEnd[string.length] = chunk;
  41953. };
  41954. MagicString.prototype.addSourcemapLocation = function addSourcemapLocation (char) {
  41955. this.sourcemapLocations.add(char);
  41956. };
  41957. MagicString.prototype.append = function append (content) {
  41958. if (typeof content !== 'string') { throw new TypeError('outro content must be a string'); }
  41959. this.outro += content;
  41960. return this;
  41961. };
  41962. MagicString.prototype.appendLeft = function appendLeft (index, content) {
  41963. if (typeof content !== 'string') { throw new TypeError('inserted content must be a string'); }
  41964. this._split(index);
  41965. var chunk = this.byEnd[index];
  41966. if (chunk) {
  41967. chunk.appendLeft(content);
  41968. } else {
  41969. this.intro += content;
  41970. }
  41971. return this;
  41972. };
  41973. MagicString.prototype.appendRight = function appendRight (index, content) {
  41974. if (typeof content !== 'string') { throw new TypeError('inserted content must be a string'); }
  41975. this._split(index);
  41976. var chunk = this.byStart[index];
  41977. if (chunk) {
  41978. chunk.appendRight(content);
  41979. } else {
  41980. this.outro += content;
  41981. }
  41982. return this;
  41983. };
  41984. MagicString.prototype.clone = function clone () {
  41985. var cloned = new MagicString(this.original, { filename: this.filename });
  41986. var originalChunk = this.firstChunk;
  41987. var clonedChunk = (cloned.firstChunk = cloned.lastSearchedChunk = originalChunk.clone());
  41988. while (originalChunk) {
  41989. cloned.byStart[clonedChunk.start] = clonedChunk;
  41990. cloned.byEnd[clonedChunk.end] = clonedChunk;
  41991. var nextOriginalChunk = originalChunk.next;
  41992. var nextClonedChunk = nextOriginalChunk && nextOriginalChunk.clone();
  41993. if (nextClonedChunk) {
  41994. clonedChunk.next = nextClonedChunk;
  41995. nextClonedChunk.previous = clonedChunk;
  41996. clonedChunk = nextClonedChunk;
  41997. }
  41998. originalChunk = nextOriginalChunk;
  41999. }
  42000. cloned.lastChunk = clonedChunk;
  42001. if (this.indentExclusionRanges) {
  42002. cloned.indentExclusionRanges = this.indentExclusionRanges.slice();
  42003. }
  42004. cloned.sourcemapLocations = new BitSet(this.sourcemapLocations);
  42005. cloned.intro = this.intro;
  42006. cloned.outro = this.outro;
  42007. return cloned;
  42008. };
  42009. MagicString.prototype.generateDecodedMap = function generateDecodedMap (options) {
  42010. var this$1 = this;
  42011. options = options || {};
  42012. var sourceIndex = 0;
  42013. var names = Object.keys(this.storedNames);
  42014. var mappings = new Mappings(options.hires);
  42015. var locate = getLocator(this.original);
  42016. if (this.intro) {
  42017. mappings.advance(this.intro);
  42018. }
  42019. this.firstChunk.eachNext(function (chunk) {
  42020. var loc = locate(chunk.start);
  42021. if (chunk.intro.length) { mappings.advance(chunk.intro); }
  42022. if (chunk.edited) {
  42023. mappings.addEdit(
  42024. sourceIndex,
  42025. chunk.content,
  42026. loc,
  42027. chunk.storeName ? names.indexOf(chunk.original) : -1
  42028. );
  42029. } else {
  42030. mappings.addUneditedChunk(sourceIndex, chunk, this$1.original, loc, this$1.sourcemapLocations);
  42031. }
  42032. if (chunk.outro.length) { mappings.advance(chunk.outro); }
  42033. });
  42034. return {
  42035. file: options.file ? options.file.split(/[/\\]/).pop() : null,
  42036. sources: [options.source ? getRelativePath(options.file || '', options.source) : null],
  42037. sourcesContent: options.includeContent ? [this.original] : [null],
  42038. names: names,
  42039. mappings: mappings.raw
  42040. };
  42041. };
  42042. MagicString.prototype.generateMap = function generateMap (options) {
  42043. return new SourceMap(this.generateDecodedMap(options));
  42044. };
  42045. MagicString.prototype.getIndentString = function getIndentString () {
  42046. return this.indentStr === null ? '\t' : this.indentStr;
  42047. };
  42048. MagicString.prototype.indent = function indent (indentStr, options) {
  42049. var pattern = /^[^\r\n]/gm;
  42050. if (isObject(indentStr)) {
  42051. options = indentStr;
  42052. indentStr = undefined;
  42053. }
  42054. indentStr = indentStr !== undefined ? indentStr : this.indentStr || '\t';
  42055. if (indentStr === '') { return this; } // noop
  42056. options = options || {};
  42057. // Process exclusion ranges
  42058. var isExcluded = {};
  42059. if (options.exclude) {
  42060. var exclusions =
  42061. typeof options.exclude[0] === 'number' ? [options.exclude] : options.exclude;
  42062. exclusions.forEach(function (exclusion) {
  42063. for (var i = exclusion[0]; i < exclusion[1]; i += 1) {
  42064. isExcluded[i] = true;
  42065. }
  42066. });
  42067. }
  42068. var shouldIndentNextCharacter = options.indentStart !== false;
  42069. var replacer = function (match) {
  42070. if (shouldIndentNextCharacter) { return ("" + indentStr + match); }
  42071. shouldIndentNextCharacter = true;
  42072. return match;
  42073. };
  42074. this.intro = this.intro.replace(pattern, replacer);
  42075. var charIndex = 0;
  42076. var chunk = this.firstChunk;
  42077. while (chunk) {
  42078. var end = chunk.end;
  42079. if (chunk.edited) {
  42080. if (!isExcluded[charIndex]) {
  42081. chunk.content = chunk.content.replace(pattern, replacer);
  42082. if (chunk.content.length) {
  42083. shouldIndentNextCharacter = chunk.content[chunk.content.length - 1] === '\n';
  42084. }
  42085. }
  42086. } else {
  42087. charIndex = chunk.start;
  42088. while (charIndex < end) {
  42089. if (!isExcluded[charIndex]) {
  42090. var char = this.original[charIndex];
  42091. if (char === '\n') {
  42092. shouldIndentNextCharacter = true;
  42093. } else if (char !== '\r' && shouldIndentNextCharacter) {
  42094. shouldIndentNextCharacter = false;
  42095. if (charIndex === chunk.start) {
  42096. chunk.prependRight(indentStr);
  42097. } else {
  42098. this._splitChunk(chunk, charIndex);
  42099. chunk = chunk.next;
  42100. chunk.prependRight(indentStr);
  42101. }
  42102. }
  42103. }
  42104. charIndex += 1;
  42105. }
  42106. }
  42107. charIndex = chunk.end;
  42108. chunk = chunk.next;
  42109. }
  42110. this.outro = this.outro.replace(pattern, replacer);
  42111. return this;
  42112. };
  42113. MagicString.prototype.insert = function insert () {
  42114. throw new Error('magicString.insert(...) is deprecated. Use prependRight(...) or appendLeft(...)');
  42115. };
  42116. MagicString.prototype.insertLeft = function insertLeft (index, content) {
  42117. if (!warned.insertLeft) {
  42118. console.warn('magicString.insertLeft(...) is deprecated. Use magicString.appendLeft(...) instead'); // eslint-disable-line no-console
  42119. warned.insertLeft = true;
  42120. }
  42121. return this.appendLeft(index, content);
  42122. };
  42123. MagicString.prototype.insertRight = function insertRight (index, content) {
  42124. if (!warned.insertRight) {
  42125. console.warn('magicString.insertRight(...) is deprecated. Use magicString.prependRight(...) instead'); // eslint-disable-line no-console
  42126. warned.insertRight = true;
  42127. }
  42128. return this.prependRight(index, content);
  42129. };
  42130. MagicString.prototype.move = function move (start, end, index) {
  42131. if (index >= start && index <= end) { throw new Error('Cannot move a selection inside itself'); }
  42132. this._split(start);
  42133. this._split(end);
  42134. this._split(index);
  42135. var first = this.byStart[start];
  42136. var last = this.byEnd[end];
  42137. var oldLeft = first.previous;
  42138. var oldRight = last.next;
  42139. var newRight = this.byStart[index];
  42140. if (!newRight && last === this.lastChunk) { return this; }
  42141. var newLeft = newRight ? newRight.previous : this.lastChunk;
  42142. if (oldLeft) { oldLeft.next = oldRight; }
  42143. if (oldRight) { oldRight.previous = oldLeft; }
  42144. if (newLeft) { newLeft.next = first; }
  42145. if (newRight) { newRight.previous = last; }
  42146. if (!first.previous) { this.firstChunk = last.next; }
  42147. if (!last.next) {
  42148. this.lastChunk = first.previous;
  42149. this.lastChunk.next = null;
  42150. }
  42151. first.previous = newLeft;
  42152. last.next = newRight || null;
  42153. if (!newLeft) { this.firstChunk = first; }
  42154. if (!newRight) { this.lastChunk = last; }
  42155. return this;
  42156. };
  42157. MagicString.prototype.overwrite = function overwrite (start, end, content, options) {
  42158. if (typeof content !== 'string') { throw new TypeError('replacement content must be a string'); }
  42159. while (start < 0) { start += this.original.length; }
  42160. while (end < 0) { end += this.original.length; }
  42161. if (end > this.original.length) { throw new Error('end is out of bounds'); }
  42162. if (start === end)
  42163. { throw new Error('Cannot overwrite a zero-length range – use appendLeft or prependRight instead'); }
  42164. this._split(start);
  42165. this._split(end);
  42166. if (options === true) {
  42167. if (!warned.storeName) {
  42168. console.warn('The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string'); // eslint-disable-line no-console
  42169. warned.storeName = true;
  42170. }
  42171. options = { storeName: true };
  42172. }
  42173. var storeName = options !== undefined ? options.storeName : false;
  42174. var contentOnly = options !== undefined ? options.contentOnly : false;
  42175. if (storeName) {
  42176. var original = this.original.slice(start, end);
  42177. this.storedNames[original] = true;
  42178. }
  42179. var first = this.byStart[start];
  42180. var last = this.byEnd[end];
  42181. if (first) {
  42182. if (end > first.end && first.next !== this.byStart[first.end]) {
  42183. throw new Error('Cannot overwrite across a split point');
  42184. }
  42185. first.edit(content, storeName, contentOnly);
  42186. if (first !== last) {
  42187. var chunk = first.next;
  42188. while (chunk !== last) {
  42189. chunk.edit('', false);
  42190. chunk = chunk.next;
  42191. }
  42192. chunk.edit('', false);
  42193. }
  42194. } else {
  42195. // must be inserting at the end
  42196. var newChunk = new Chunk(start, end, '').edit(content, storeName);
  42197. // TODO last chunk in the array may not be the last chunk, if it's moved...
  42198. last.next = newChunk;
  42199. newChunk.previous = last;
  42200. }
  42201. return this;
  42202. };
  42203. MagicString.prototype.prepend = function prepend (content) {
  42204. if (typeof content !== 'string') { throw new TypeError('outro content must be a string'); }
  42205. this.intro = content + this.intro;
  42206. return this;
  42207. };
  42208. MagicString.prototype.prependLeft = function prependLeft (index, content) {
  42209. if (typeof content !== 'string') { throw new TypeError('inserted content must be a string'); }
  42210. this._split(index);
  42211. var chunk = this.byEnd[index];
  42212. if (chunk) {
  42213. chunk.prependLeft(content);
  42214. } else {
  42215. this.intro = content + this.intro;
  42216. }
  42217. return this;
  42218. };
  42219. MagicString.prototype.prependRight = function prependRight (index, content) {
  42220. if (typeof content !== 'string') { throw new TypeError('inserted content must be a string'); }
  42221. this._split(index);
  42222. var chunk = this.byStart[index];
  42223. if (chunk) {
  42224. chunk.prependRight(content);
  42225. } else {
  42226. this.outro = content + this.outro;
  42227. }
  42228. return this;
  42229. };
  42230. MagicString.prototype.remove = function remove (start, end) {
  42231. while (start < 0) { start += this.original.length; }
  42232. while (end < 0) { end += this.original.length; }
  42233. if (start === end) { return this; }
  42234. if (start < 0 || end > this.original.length) { throw new Error('Character is out of bounds'); }
  42235. if (start > end) { throw new Error('end must be greater than start'); }
  42236. this._split(start);
  42237. this._split(end);
  42238. var chunk = this.byStart[start];
  42239. while (chunk) {
  42240. chunk.intro = '';
  42241. chunk.outro = '';
  42242. chunk.edit('');
  42243. chunk = end > chunk.end ? this.byStart[chunk.end] : null;
  42244. }
  42245. return this;
  42246. };
  42247. MagicString.prototype.lastChar = function lastChar () {
  42248. if (this.outro.length)
  42249. { return this.outro[this.outro.length - 1]; }
  42250. var chunk = this.lastChunk;
  42251. do {
  42252. if (chunk.outro.length)
  42253. { return chunk.outro[chunk.outro.length - 1]; }
  42254. if (chunk.content.length)
  42255. { return chunk.content[chunk.content.length - 1]; }
  42256. if (chunk.intro.length)
  42257. { return chunk.intro[chunk.intro.length - 1]; }
  42258. } while (chunk = chunk.previous);
  42259. if (this.intro.length)
  42260. { return this.intro[this.intro.length - 1]; }
  42261. return '';
  42262. };
  42263. MagicString.prototype.lastLine = function lastLine () {
  42264. var lineIndex = this.outro.lastIndexOf(n);
  42265. if (lineIndex !== -1)
  42266. { return this.outro.substr(lineIndex + 1); }
  42267. var lineStr = this.outro;
  42268. var chunk = this.lastChunk;
  42269. do {
  42270. if (chunk.outro.length > 0) {
  42271. lineIndex = chunk.outro.lastIndexOf(n);
  42272. if (lineIndex !== -1)
  42273. { return chunk.outro.substr(lineIndex + 1) + lineStr; }
  42274. lineStr = chunk.outro + lineStr;
  42275. }
  42276. if (chunk.content.length > 0) {
  42277. lineIndex = chunk.content.lastIndexOf(n);
  42278. if (lineIndex !== -1)
  42279. { return chunk.content.substr(lineIndex + 1) + lineStr; }
  42280. lineStr = chunk.content + lineStr;
  42281. }
  42282. if (chunk.intro.length > 0) {
  42283. lineIndex = chunk.intro.lastIndexOf(n);
  42284. if (lineIndex !== -1)
  42285. { return chunk.intro.substr(lineIndex + 1) + lineStr; }
  42286. lineStr = chunk.intro + lineStr;
  42287. }
  42288. } while (chunk = chunk.previous);
  42289. lineIndex = this.intro.lastIndexOf(n);
  42290. if (lineIndex !== -1)
  42291. { return this.intro.substr(lineIndex + 1) + lineStr; }
  42292. return this.intro + lineStr;
  42293. };
  42294. MagicString.prototype.slice = function slice (start, end) {
  42295. if ( start === void 0 ) start = 0;
  42296. if ( end === void 0 ) end = this.original.length;
  42297. while (start < 0) { start += this.original.length; }
  42298. while (end < 0) { end += this.original.length; }
  42299. var result = '';
  42300. // find start chunk
  42301. var chunk = this.firstChunk;
  42302. while (chunk && (chunk.start > start || chunk.end <= start)) {
  42303. // found end chunk before start
  42304. if (chunk.start < end && chunk.end >= end) {
  42305. return result;
  42306. }
  42307. chunk = chunk.next;
  42308. }
  42309. if (chunk && chunk.edited && chunk.start !== start)
  42310. { throw new Error(("Cannot use replaced character " + start + " as slice start anchor.")); }
  42311. var startChunk = chunk;
  42312. while (chunk) {
  42313. if (chunk.intro && (startChunk !== chunk || chunk.start === start)) {
  42314. result += chunk.intro;
  42315. }
  42316. var containsEnd = chunk.start < end && chunk.end >= end;
  42317. if (containsEnd && chunk.edited && chunk.end !== end)
  42318. { throw new Error(("Cannot use replaced character " + end + " as slice end anchor.")); }
  42319. var sliceStart = startChunk === chunk ? start - chunk.start : 0;
  42320. var sliceEnd = containsEnd ? chunk.content.length + end - chunk.end : chunk.content.length;
  42321. result += chunk.content.slice(sliceStart, sliceEnd);
  42322. if (chunk.outro && (!containsEnd || chunk.end === end)) {
  42323. result += chunk.outro;
  42324. }
  42325. if (containsEnd) {
  42326. break;
  42327. }
  42328. chunk = chunk.next;
  42329. }
  42330. return result;
  42331. };
  42332. // TODO deprecate this? not really very useful
  42333. MagicString.prototype.snip = function snip (start, end) {
  42334. var clone = this.clone();
  42335. clone.remove(0, start);
  42336. clone.remove(end, clone.original.length);
  42337. return clone;
  42338. };
  42339. MagicString.prototype._split = function _split (index) {
  42340. if (this.byStart[index] || this.byEnd[index]) { return; }
  42341. var chunk = this.lastSearchedChunk;
  42342. var searchForward = index > chunk.end;
  42343. while (chunk) {
  42344. if (chunk.contains(index)) { return this._splitChunk(chunk, index); }
  42345. chunk = searchForward ? this.byStart[chunk.end] : this.byEnd[chunk.start];
  42346. }
  42347. };
  42348. MagicString.prototype._splitChunk = function _splitChunk (chunk, index) {
  42349. if (chunk.edited && chunk.content.length) {
  42350. // zero-length edited chunks are a special case (overlapping replacements)
  42351. var loc = getLocator(this.original)(index);
  42352. throw new Error(
  42353. ("Cannot split a chunk that has already been edited (" + (loc.line) + ":" + (loc.column) + " – \"" + (chunk.original) + "\")")
  42354. );
  42355. }
  42356. var newChunk = chunk.split(index);
  42357. this.byEnd[index] = chunk;
  42358. this.byStart[index] = newChunk;
  42359. this.byEnd[newChunk.end] = newChunk;
  42360. if (chunk === this.lastChunk) { this.lastChunk = newChunk; }
  42361. this.lastSearchedChunk = chunk;
  42362. return true;
  42363. };
  42364. MagicString.prototype.toString = function toString () {
  42365. var str = this.intro;
  42366. var chunk = this.firstChunk;
  42367. while (chunk) {
  42368. str += chunk.toString();
  42369. chunk = chunk.next;
  42370. }
  42371. return str + this.outro;
  42372. };
  42373. MagicString.prototype.isEmpty = function isEmpty () {
  42374. var chunk = this.firstChunk;
  42375. do {
  42376. if (chunk.intro.length && chunk.intro.trim() ||
  42377. chunk.content.length && chunk.content.trim() ||
  42378. chunk.outro.length && chunk.outro.trim())
  42379. { return false; }
  42380. } while (chunk = chunk.next);
  42381. return true;
  42382. };
  42383. MagicString.prototype.length = function length () {
  42384. var chunk = this.firstChunk;
  42385. var length = 0;
  42386. do {
  42387. length += chunk.intro.length + chunk.content.length + chunk.outro.length;
  42388. } while (chunk = chunk.next);
  42389. return length;
  42390. };
  42391. MagicString.prototype.trimLines = function trimLines () {
  42392. return this.trim('[\\r\\n]');
  42393. };
  42394. MagicString.prototype.trim = function trim (charType) {
  42395. return this.trimStart(charType).trimEnd(charType);
  42396. };
  42397. MagicString.prototype.trimEndAborted = function trimEndAborted (charType) {
  42398. var rx = new RegExp((charType || '\\s') + '+$');
  42399. this.outro = this.outro.replace(rx, '');
  42400. if (this.outro.length) { return true; }
  42401. var chunk = this.lastChunk;
  42402. do {
  42403. var end = chunk.end;
  42404. var aborted = chunk.trimEnd(rx);
  42405. // if chunk was trimmed, we have a new lastChunk
  42406. if (chunk.end !== end) {
  42407. if (this.lastChunk === chunk) {
  42408. this.lastChunk = chunk.next;
  42409. }
  42410. this.byEnd[chunk.end] = chunk;
  42411. this.byStart[chunk.next.start] = chunk.next;
  42412. this.byEnd[chunk.next.end] = chunk.next;
  42413. }
  42414. if (aborted) { return true; }
  42415. chunk = chunk.previous;
  42416. } while (chunk);
  42417. return false;
  42418. };
  42419. MagicString.prototype.trimEnd = function trimEnd (charType) {
  42420. this.trimEndAborted(charType);
  42421. return this;
  42422. };
  42423. MagicString.prototype.trimStartAborted = function trimStartAborted (charType) {
  42424. var rx = new RegExp('^' + (charType || '\\s') + '+');
  42425. this.intro = this.intro.replace(rx, '');
  42426. if (this.intro.length) { return true; }
  42427. var chunk = this.firstChunk;
  42428. do {
  42429. var end = chunk.end;
  42430. var aborted = chunk.trimStart(rx);
  42431. if (chunk.end !== end) {
  42432. // special case...
  42433. if (chunk === this.lastChunk) { this.lastChunk = chunk.next; }
  42434. this.byEnd[chunk.end] = chunk;
  42435. this.byStart[chunk.next.start] = chunk.next;
  42436. this.byEnd[chunk.next.end] = chunk.next;
  42437. }
  42438. if (aborted) { return true; }
  42439. chunk = chunk.next;
  42440. } while (chunk);
  42441. return false;
  42442. };
  42443. MagicString.prototype.trimStart = function trimStart (charType) {
  42444. this.trimStartAborted(charType);
  42445. return this;
  42446. };
  42447. function isReference(node, parent) {
  42448. if (node.type === 'MemberExpression') {
  42449. return !node.computed && isReference(node.object, node);
  42450. }
  42451. if (node.type === 'Identifier') {
  42452. if (!parent)
  42453. return true;
  42454. switch (parent.type) {
  42455. // disregard `bar` in `foo.bar`
  42456. case 'MemberExpression': return parent.computed || node === parent.object;
  42457. // disregard the `foo` in `class {foo(){}}` but keep it in `class {[foo](){}}`
  42458. case 'MethodDefinition': return parent.computed;
  42459. // disregard the `foo` in `class {foo=bar}` but keep it in `class {[foo]=bar}` and `class {bar=foo}`
  42460. case 'FieldDefinition': return parent.computed || node === parent.value;
  42461. // disregard the `bar` in `{ bar: foo }`, but keep it in `{ [bar]: foo }`
  42462. case 'Property': return parent.computed || node === parent.value;
  42463. // disregard the `bar` in `export { foo as bar }` or
  42464. // the foo in `import { foo as bar }`
  42465. case 'ExportSpecifier':
  42466. case 'ImportSpecifier': return node === parent.local;
  42467. // disregard the `foo` in `foo: while (...) { ... break foo; ... continue foo;}`
  42468. case 'LabeledStatement':
  42469. case 'BreakStatement':
  42470. case 'ContinueStatement': return false;
  42471. default: return true;
  42472. }
  42473. }
  42474. return false;
  42475. }
  42476. // Copyright Joyent, Inc. and other Node contributors.
  42477. //
  42478. // Permission is hereby granted, free of charge, to any person obtaining a
  42479. // copy of this software and associated documentation files (the
  42480. // "Software"), to deal in the Software without restriction, including
  42481. // without limitation the rights to use, copy, modify, merge, publish,
  42482. // distribute, sublicense, and/or sell copies of the Software, and to permit
  42483. // persons to whom the Software is furnished to do so, subject to the
  42484. // following conditions:
  42485. //
  42486. // The above copyright notice and this permission notice shall be included
  42487. // in all copies or substantial portions of the Software.
  42488. //
  42489. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  42490. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  42491. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  42492. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  42493. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  42494. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  42495. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  42496. var isWindows = process.platform === 'win32';
  42497. function rethrow() {
  42498. // Only enable in debug mode. A backtrace uses ~1000 bytes of heap space and
  42499. // is fairly slow to generate.
  42500. var callback;
  42501. callback = missingCallback;
  42502. return callback;
  42503. function missingCallback(err) {
  42504. if (err) {
  42505. if (process.throwDeprecation)
  42506. throw err; // Forgot a callback but don't know where? Use NODE_DEBUG=fs
  42507. else if (!process.noDeprecation) {
  42508. var msg = 'fs: missing callback ' + (err.stack || err.message);
  42509. if (process.traceDeprecation)
  42510. console.trace(msg);
  42511. else
  42512. console.error(msg);
  42513. }
  42514. }
  42515. }
  42516. }
  42517. function maybeCallback(cb) {
  42518. return typeof cb === 'function' ? cb : rethrow();
  42519. }
  42520. // Regexp that finds the next partion of a (partial) path
  42521. // result is [base_with_slash, base], e.g. ['somedir/', 'somedir']
  42522. if (isWindows) {
  42523. var nextPartRe = /(.*?)(?:[\/\\]+|$)/g;
  42524. } else {
  42525. var nextPartRe = /(.*?)(?:[\/]+|$)/g;
  42526. }
  42527. // Regex to find the device root, including trailing slash. E.g. 'c:\\'.
  42528. if (isWindows) {
  42529. var splitRootRe = /^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/;
  42530. } else {
  42531. var splitRootRe = /^[\/]*/;
  42532. }
  42533. var realpathSync$1 = function realpathSync(p, cache) {
  42534. // make p is absolute
  42535. p = path$5.resolve(p);
  42536. if (cache && Object.prototype.hasOwnProperty.call(cache, p)) {
  42537. return cache[p];
  42538. }
  42539. var original = p,
  42540. seenLinks = {},
  42541. knownHard = {};
  42542. // current character position in p
  42543. var pos;
  42544. // the partial path so far, including a trailing slash if any
  42545. var current;
  42546. // the partial path without a trailing slash (except when pointing at a root)
  42547. var base;
  42548. // the partial path scanned in the previous round, with slash
  42549. var previous;
  42550. start();
  42551. function start() {
  42552. // Skip over roots
  42553. var m = splitRootRe.exec(p);
  42554. pos = m[0].length;
  42555. current = m[0];
  42556. base = m[0];
  42557. previous = '';
  42558. // On windows, check that the root exists. On unix there is no need.
  42559. if (isWindows && !knownHard[base]) {
  42560. fs$3.lstatSync(base);
  42561. knownHard[base] = true;
  42562. }
  42563. }
  42564. // walk down the path, swapping out linked pathparts for their real
  42565. // values
  42566. // NB: p.length changes.
  42567. while (pos < p.length) {
  42568. // find the next part
  42569. nextPartRe.lastIndex = pos;
  42570. var result = nextPartRe.exec(p);
  42571. previous = current;
  42572. current += result[0];
  42573. base = previous + result[1];
  42574. pos = nextPartRe.lastIndex;
  42575. // continue if not a symlink
  42576. if (knownHard[base] || (cache && cache[base] === base)) {
  42577. continue;
  42578. }
  42579. var resolvedLink;
  42580. if (cache && Object.prototype.hasOwnProperty.call(cache, base)) {
  42581. // some known symbolic link. no need to stat again.
  42582. resolvedLink = cache[base];
  42583. } else {
  42584. var stat = fs$3.lstatSync(base);
  42585. if (!stat.isSymbolicLink()) {
  42586. knownHard[base] = true;
  42587. if (cache) cache[base] = base;
  42588. continue;
  42589. }
  42590. // read the link if it wasn't read before
  42591. // dev/ino always return 0 on windows, so skip the check.
  42592. var linkTarget = null;
  42593. if (!isWindows) {
  42594. var id = stat.dev.toString(32) + ':' + stat.ino.toString(32);
  42595. if (seenLinks.hasOwnProperty(id)) {
  42596. linkTarget = seenLinks[id];
  42597. }
  42598. }
  42599. if (linkTarget === null) {
  42600. fs$3.statSync(base);
  42601. linkTarget = fs$3.readlinkSync(base);
  42602. }
  42603. resolvedLink = path$5.resolve(previous, linkTarget);
  42604. // track this, if given a cache.
  42605. if (cache) cache[base] = resolvedLink;
  42606. if (!isWindows) seenLinks[id] = linkTarget;
  42607. }
  42608. // resolve the link, then start over
  42609. p = path$5.resolve(resolvedLink, p.slice(pos));
  42610. start();
  42611. }
  42612. if (cache) cache[original] = p;
  42613. return p;
  42614. };
  42615. var realpath$2 = function realpath(p, cache, cb) {
  42616. if (typeof cb !== 'function') {
  42617. cb = maybeCallback(cache);
  42618. cache = null;
  42619. }
  42620. // make p is absolute
  42621. p = path$5.resolve(p);
  42622. if (cache && Object.prototype.hasOwnProperty.call(cache, p)) {
  42623. return process.nextTick(cb.bind(null, null, cache[p]));
  42624. }
  42625. var original = p,
  42626. seenLinks = {},
  42627. knownHard = {};
  42628. // current character position in p
  42629. var pos;
  42630. // the partial path so far, including a trailing slash if any
  42631. var current;
  42632. // the partial path without a trailing slash (except when pointing at a root)
  42633. var base;
  42634. // the partial path scanned in the previous round, with slash
  42635. var previous;
  42636. start();
  42637. function start() {
  42638. // Skip over roots
  42639. var m = splitRootRe.exec(p);
  42640. pos = m[0].length;
  42641. current = m[0];
  42642. base = m[0];
  42643. previous = '';
  42644. // On windows, check that the root exists. On unix there is no need.
  42645. if (isWindows && !knownHard[base]) {
  42646. fs$3.lstat(base, function(err) {
  42647. if (err) return cb(err);
  42648. knownHard[base] = true;
  42649. LOOP();
  42650. });
  42651. } else {
  42652. process.nextTick(LOOP);
  42653. }
  42654. }
  42655. // walk down the path, swapping out linked pathparts for their real
  42656. // values
  42657. function LOOP() {
  42658. // stop if scanned past end of path
  42659. if (pos >= p.length) {
  42660. if (cache) cache[original] = p;
  42661. return cb(null, p);
  42662. }
  42663. // find the next part
  42664. nextPartRe.lastIndex = pos;
  42665. var result = nextPartRe.exec(p);
  42666. previous = current;
  42667. current += result[0];
  42668. base = previous + result[1];
  42669. pos = nextPartRe.lastIndex;
  42670. // continue if not a symlink
  42671. if (knownHard[base] || (cache && cache[base] === base)) {
  42672. return process.nextTick(LOOP);
  42673. }
  42674. if (cache && Object.prototype.hasOwnProperty.call(cache, base)) {
  42675. // known symbolic link. no need to stat again.
  42676. return gotResolvedLink(cache[base]);
  42677. }
  42678. return fs$3.lstat(base, gotStat);
  42679. }
  42680. function gotStat(err, stat) {
  42681. if (err) return cb(err);
  42682. // if not a symlink, skip to the next path part
  42683. if (!stat.isSymbolicLink()) {
  42684. knownHard[base] = true;
  42685. if (cache) cache[base] = base;
  42686. return process.nextTick(LOOP);
  42687. }
  42688. // stat & read the link if not read before
  42689. // call gotTarget as soon as the link target is known
  42690. // dev/ino always return 0 on windows, so skip the check.
  42691. if (!isWindows) {
  42692. var id = stat.dev.toString(32) + ':' + stat.ino.toString(32);
  42693. if (seenLinks.hasOwnProperty(id)) {
  42694. return gotTarget(null, seenLinks[id], base);
  42695. }
  42696. }
  42697. fs$3.stat(base, function(err) {
  42698. if (err) return cb(err);
  42699. fs$3.readlink(base, function(err, target) {
  42700. if (!isWindows) seenLinks[id] = target;
  42701. gotTarget(err, target);
  42702. });
  42703. });
  42704. }
  42705. function gotTarget(err, target, base) {
  42706. if (err) return cb(err);
  42707. var resolvedLink = path$5.resolve(previous, target);
  42708. if (cache) cache[base] = resolvedLink;
  42709. gotResolvedLink(resolvedLink);
  42710. }
  42711. function gotResolvedLink(resolvedLink) {
  42712. // resolve the link, then start over
  42713. p = path$5.resolve(resolvedLink, p.slice(pos));
  42714. start();
  42715. }
  42716. };
  42717. var old = {
  42718. realpathSync: realpathSync$1,
  42719. realpath: realpath$2
  42720. };
  42721. var fs_realpath = realpath$1;
  42722. realpath$1.realpath = realpath$1;
  42723. realpath$1.sync = realpathSync;
  42724. realpath$1.realpathSync = realpathSync;
  42725. realpath$1.monkeypatch = monkeypatch;
  42726. realpath$1.unmonkeypatch = unmonkeypatch;
  42727. var origRealpath = fs$3.realpath;
  42728. var origRealpathSync = fs$3.realpathSync;
  42729. var version = process.version;
  42730. var ok = /^v[0-5]\./.test(version);
  42731. function newError (er) {
  42732. return er && er.syscall === 'realpath' && (
  42733. er.code === 'ELOOP' ||
  42734. er.code === 'ENOMEM' ||
  42735. er.code === 'ENAMETOOLONG'
  42736. )
  42737. }
  42738. function realpath$1 (p, cache, cb) {
  42739. if (ok) {
  42740. return origRealpath(p, cache, cb)
  42741. }
  42742. if (typeof cache === 'function') {
  42743. cb = cache;
  42744. cache = null;
  42745. }
  42746. origRealpath(p, cache, function (er, result) {
  42747. if (newError(er)) {
  42748. old.realpath(p, cache, cb);
  42749. } else {
  42750. cb(er, result);
  42751. }
  42752. });
  42753. }
  42754. function realpathSync (p, cache) {
  42755. if (ok) {
  42756. return origRealpathSync(p, cache)
  42757. }
  42758. try {
  42759. return origRealpathSync(p, cache)
  42760. } catch (er) {
  42761. if (newError(er)) {
  42762. return old.realpathSync(p, cache)
  42763. } else {
  42764. throw er
  42765. }
  42766. }
  42767. }
  42768. function monkeypatch () {
  42769. fs$3.realpath = realpath$1;
  42770. fs$3.realpathSync = realpathSync;
  42771. }
  42772. function unmonkeypatch () {
  42773. fs$3.realpath = origRealpath;
  42774. fs$3.realpathSync = origRealpathSync;
  42775. }
  42776. var concatMap = function (xs, fn) {
  42777. var res = [];
  42778. for (var i = 0; i < xs.length; i++) {
  42779. var x = fn(xs[i], i);
  42780. if (isArray$4(x)) res.push.apply(res, x);
  42781. else res.push(x);
  42782. }
  42783. return res;
  42784. };
  42785. var isArray$4 = Array.isArray || function (xs) {
  42786. return Object.prototype.toString.call(xs) === '[object Array]';
  42787. };
  42788. var balancedMatch = balanced;
  42789. function balanced(a, b, str) {
  42790. if (a instanceof RegExp) a = maybeMatch(a, str);
  42791. if (b instanceof RegExp) b = maybeMatch(b, str);
  42792. var r = range(a, b, str);
  42793. return r && {
  42794. start: r[0],
  42795. end: r[1],
  42796. pre: str.slice(0, r[0]),
  42797. body: str.slice(r[0] + a.length, r[1]),
  42798. post: str.slice(r[1] + b.length)
  42799. };
  42800. }
  42801. function maybeMatch(reg, str) {
  42802. var m = str.match(reg);
  42803. return m ? m[0] : null;
  42804. }
  42805. balanced.range = range;
  42806. function range(a, b, str) {
  42807. var begs, beg, left, right, result;
  42808. var ai = str.indexOf(a);
  42809. var bi = str.indexOf(b, ai + 1);
  42810. var i = ai;
  42811. if (ai >= 0 && bi > 0) {
  42812. begs = [];
  42813. left = str.length;
  42814. while (i >= 0 && !result) {
  42815. if (i == ai) {
  42816. begs.push(i);
  42817. ai = str.indexOf(a, i + 1);
  42818. } else if (begs.length == 1) {
  42819. result = [ begs.pop(), bi ];
  42820. } else {
  42821. beg = begs.pop();
  42822. if (beg < left) {
  42823. left = beg;
  42824. right = bi;
  42825. }
  42826. bi = str.indexOf(b, i + 1);
  42827. }
  42828. i = ai < bi && ai >= 0 ? ai : bi;
  42829. }
  42830. if (begs.length) {
  42831. result = [ left, right ];
  42832. }
  42833. }
  42834. return result;
  42835. }
  42836. var braceExpansion = expandTop;
  42837. var escSlash = '\0SLASH'+Math.random()+'\0';
  42838. var escOpen = '\0OPEN'+Math.random()+'\0';
  42839. var escClose = '\0CLOSE'+Math.random()+'\0';
  42840. var escComma = '\0COMMA'+Math.random()+'\0';
  42841. var escPeriod = '\0PERIOD'+Math.random()+'\0';
  42842. function numeric(str) {
  42843. return parseInt(str, 10) == str
  42844. ? parseInt(str, 10)
  42845. : str.charCodeAt(0);
  42846. }
  42847. function escapeBraces(str) {
  42848. return str.split('\\\\').join(escSlash)
  42849. .split('\\{').join(escOpen)
  42850. .split('\\}').join(escClose)
  42851. .split('\\,').join(escComma)
  42852. .split('\\.').join(escPeriod);
  42853. }
  42854. function unescapeBraces(str) {
  42855. return str.split(escSlash).join('\\')
  42856. .split(escOpen).join('{')
  42857. .split(escClose).join('}')
  42858. .split(escComma).join(',')
  42859. .split(escPeriod).join('.');
  42860. }
  42861. // Basically just str.split(","), but handling cases
  42862. // where we have nested braced sections, which should be
  42863. // treated as individual members, like {a,{b,c},d}
  42864. function parseCommaParts(str) {
  42865. if (!str)
  42866. return [''];
  42867. var parts = [];
  42868. var m = balancedMatch('{', '}', str);
  42869. if (!m)
  42870. return str.split(',');
  42871. var pre = m.pre;
  42872. var body = m.body;
  42873. var post = m.post;
  42874. var p = pre.split(',');
  42875. p[p.length-1] += '{' + body + '}';
  42876. var postParts = parseCommaParts(post);
  42877. if (post.length) {
  42878. p[p.length-1] += postParts.shift();
  42879. p.push.apply(p, postParts);
  42880. }
  42881. parts.push.apply(parts, p);
  42882. return parts;
  42883. }
  42884. function expandTop(str) {
  42885. if (!str)
  42886. return [];
  42887. // I don't know why Bash 4.3 does this, but it does.
  42888. // Anything starting with {} will have the first two bytes preserved
  42889. // but *only* at the top level, so {},a}b will not expand to anything,
  42890. // but a{},b}c will be expanded to [a}c,abc].
  42891. // One could argue that this is a bug in Bash, but since the goal of
  42892. // this module is to match Bash's rules, we escape a leading {}
  42893. if (str.substr(0, 2) === '{}') {
  42894. str = '\\{\\}' + str.substr(2);
  42895. }
  42896. return expand(escapeBraces(str), true).map(unescapeBraces);
  42897. }
  42898. function embrace(str) {
  42899. return '{' + str + '}';
  42900. }
  42901. function isPadded(el) {
  42902. return /^-?0\d/.test(el);
  42903. }
  42904. function lte(i, y) {
  42905. return i <= y;
  42906. }
  42907. function gte(i, y) {
  42908. return i >= y;
  42909. }
  42910. function expand(str, isTop) {
  42911. var expansions = [];
  42912. var m = balancedMatch('{', '}', str);
  42913. if (!m || /\$$/.test(m.pre)) return [str];
  42914. var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
  42915. var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
  42916. var isSequence = isNumericSequence || isAlphaSequence;
  42917. var isOptions = m.body.indexOf(',') >= 0;
  42918. if (!isSequence && !isOptions) {
  42919. // {a},b}
  42920. if (m.post.match(/,.*\}/)) {
  42921. str = m.pre + '{' + m.body + escClose + m.post;
  42922. return expand(str);
  42923. }
  42924. return [str];
  42925. }
  42926. var n;
  42927. if (isSequence) {
  42928. n = m.body.split(/\.\./);
  42929. } else {
  42930. n = parseCommaParts(m.body);
  42931. if (n.length === 1) {
  42932. // x{{a,b}}y ==> x{a}y x{b}y
  42933. n = expand(n[0], false).map(embrace);
  42934. if (n.length === 1) {
  42935. var post = m.post.length
  42936. ? expand(m.post, false)
  42937. : [''];
  42938. return post.map(function(p) {
  42939. return m.pre + n[0] + p;
  42940. });
  42941. }
  42942. }
  42943. }
  42944. // at this point, n is the parts, and we know it's not a comma set
  42945. // with a single entry.
  42946. // no need to expand pre, since it is guaranteed to be free of brace-sets
  42947. var pre = m.pre;
  42948. var post = m.post.length
  42949. ? expand(m.post, false)
  42950. : [''];
  42951. var N;
  42952. if (isSequence) {
  42953. var x = numeric(n[0]);
  42954. var y = numeric(n[1]);
  42955. var width = Math.max(n[0].length, n[1].length);
  42956. var incr = n.length == 3
  42957. ? Math.abs(numeric(n[2]))
  42958. : 1;
  42959. var test = lte;
  42960. var reverse = y < x;
  42961. if (reverse) {
  42962. incr *= -1;
  42963. test = gte;
  42964. }
  42965. var pad = n.some(isPadded);
  42966. N = [];
  42967. for (var i = x; test(i, y); i += incr) {
  42968. var c;
  42969. if (isAlphaSequence) {
  42970. c = String.fromCharCode(i);
  42971. if (c === '\\')
  42972. c = '';
  42973. } else {
  42974. c = String(i);
  42975. if (pad) {
  42976. var need = width - c.length;
  42977. if (need > 0) {
  42978. var z = new Array(need + 1).join('0');
  42979. if (i < 0)
  42980. c = '-' + z + c.slice(1);
  42981. else
  42982. c = z + c;
  42983. }
  42984. }
  42985. }
  42986. N.push(c);
  42987. }
  42988. } else {
  42989. N = concatMap(n, function(el) { return expand(el, false) });
  42990. }
  42991. for (var j = 0; j < N.length; j++) {
  42992. for (var k = 0; k < post.length; k++) {
  42993. var expansion = pre + N[j] + post[k];
  42994. if (!isTop || isSequence || expansion)
  42995. expansions.push(expansion);
  42996. }
  42997. }
  42998. return expansions;
  42999. }
  43000. var minimatch_1 = minimatch;
  43001. minimatch.Minimatch = Minimatch$1;
  43002. var path = { sep: '/' };
  43003. try {
  43004. path = path$5;
  43005. } catch (er) {}
  43006. var GLOBSTAR = minimatch.GLOBSTAR = Minimatch$1.GLOBSTAR = {};
  43007. var plTypes = {
  43008. '!': { open: '(?:(?!(?:', close: '))[^/]*?)'},
  43009. '?': { open: '(?:', close: ')?' },
  43010. '+': { open: '(?:', close: ')+' },
  43011. '*': { open: '(?:', close: ')*' },
  43012. '@': { open: '(?:', close: ')' }
  43013. };
  43014. // any single thing other than /
  43015. // don't need to escape / when using new RegExp()
  43016. var qmark = '[^/]';
  43017. // * => any number of characters
  43018. var star = qmark + '*?';
  43019. // ** when dots are allowed. Anything goes, except .. and .
  43020. // not (^ or / followed by one or two dots followed by $ or /),
  43021. // followed by anything, any number of times.
  43022. var twoStarDot = '(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?';
  43023. // not a ^ or / followed by a dot,
  43024. // followed by anything, any number of times.
  43025. var twoStarNoDot = '(?:(?!(?:\\\/|^)\\.).)*?';
  43026. // characters that need to be escaped in RegExp.
  43027. var reSpecials = charSet('().*{}+?[]^$\\!');
  43028. // "abc" -> { a:true, b:true, c:true }
  43029. function charSet (s) {
  43030. return s.split('').reduce(function (set, c) {
  43031. set[c] = true;
  43032. return set
  43033. }, {})
  43034. }
  43035. // normalizes slashes.
  43036. var slashSplit = /\/+/;
  43037. minimatch.filter = filter;
  43038. function filter (pattern, options) {
  43039. options = options || {};
  43040. return function (p, i, list) {
  43041. return minimatch(p, pattern, options)
  43042. }
  43043. }
  43044. function ext (a, b) {
  43045. a = a || {};
  43046. b = b || {};
  43047. var t = {};
  43048. Object.keys(b).forEach(function (k) {
  43049. t[k] = b[k];
  43050. });
  43051. Object.keys(a).forEach(function (k) {
  43052. t[k] = a[k];
  43053. });
  43054. return t
  43055. }
  43056. minimatch.defaults = function (def) {
  43057. if (!def || !Object.keys(def).length) return minimatch
  43058. var orig = minimatch;
  43059. var m = function minimatch (p, pattern, options) {
  43060. return orig.minimatch(p, pattern, ext(def, options))
  43061. };
  43062. m.Minimatch = function Minimatch (pattern, options) {
  43063. return new orig.Minimatch(pattern, ext(def, options))
  43064. };
  43065. return m
  43066. };
  43067. Minimatch$1.defaults = function (def) {
  43068. if (!def || !Object.keys(def).length) return Minimatch$1
  43069. return minimatch.defaults(def).Minimatch
  43070. };
  43071. function minimatch (p, pattern, options) {
  43072. if (typeof pattern !== 'string') {
  43073. throw new TypeError('glob pattern string required')
  43074. }
  43075. if (!options) options = {};
  43076. // shortcut: comments match nothing.
  43077. if (!options.nocomment && pattern.charAt(0) === '#') {
  43078. return false
  43079. }
  43080. // "" only matches ""
  43081. if (pattern.trim() === '') return p === ''
  43082. return new Minimatch$1(pattern, options).match(p)
  43083. }
  43084. function Minimatch$1 (pattern, options) {
  43085. if (!(this instanceof Minimatch$1)) {
  43086. return new Minimatch$1(pattern, options)
  43087. }
  43088. if (typeof pattern !== 'string') {
  43089. throw new TypeError('glob pattern string required')
  43090. }
  43091. if (!options) options = {};
  43092. pattern = pattern.trim();
  43093. // windows support: need to use /, not \
  43094. if (path.sep !== '/') {
  43095. pattern = pattern.split(path.sep).join('/');
  43096. }
  43097. this.options = options;
  43098. this.set = [];
  43099. this.pattern = pattern;
  43100. this.regexp = null;
  43101. this.negate = false;
  43102. this.comment = false;
  43103. this.empty = false;
  43104. // make the set of regexps etc.
  43105. this.make();
  43106. }
  43107. Minimatch$1.prototype.debug = function () {};
  43108. Minimatch$1.prototype.make = make;
  43109. function make () {
  43110. // don't do it more than once.
  43111. if (this._made) return
  43112. var pattern = this.pattern;
  43113. var options = this.options;
  43114. // empty patterns and comments match nothing.
  43115. if (!options.nocomment && pattern.charAt(0) === '#') {
  43116. this.comment = true;
  43117. return
  43118. }
  43119. if (!pattern) {
  43120. this.empty = true;
  43121. return
  43122. }
  43123. // step 1: figure out negation, etc.
  43124. this.parseNegate();
  43125. // step 2: expand braces
  43126. var set = this.globSet = this.braceExpand();
  43127. if (options.debug) this.debug = console.error;
  43128. this.debug(this.pattern, set);
  43129. // step 3: now we have a set, so turn each one into a series of path-portion
  43130. // matching patterns.
  43131. // These will be regexps, except in the case of "**", which is
  43132. // set to the GLOBSTAR object for globstar behavior,
  43133. // and will not contain any / characters
  43134. set = this.globParts = set.map(function (s) {
  43135. return s.split(slashSplit)
  43136. });
  43137. this.debug(this.pattern, set);
  43138. // glob --> regexps
  43139. set = set.map(function (s, si, set) {
  43140. return s.map(this.parse, this)
  43141. }, this);
  43142. this.debug(this.pattern, set);
  43143. // filter out everything that didn't compile properly.
  43144. set = set.filter(function (s) {
  43145. return s.indexOf(false) === -1
  43146. });
  43147. this.debug(this.pattern, set);
  43148. this.set = set;
  43149. }
  43150. Minimatch$1.prototype.parseNegate = parseNegate;
  43151. function parseNegate () {
  43152. var pattern = this.pattern;
  43153. var negate = false;
  43154. var options = this.options;
  43155. var negateOffset = 0;
  43156. if (options.nonegate) return
  43157. for (var i = 0, l = pattern.length
  43158. ; i < l && pattern.charAt(i) === '!'
  43159. ; i++) {
  43160. negate = !negate;
  43161. negateOffset++;
  43162. }
  43163. if (negateOffset) this.pattern = pattern.substr(negateOffset);
  43164. this.negate = negate;
  43165. }
  43166. // Brace expansion:
  43167. // a{b,c}d -> abd acd
  43168. // a{b,}c -> abc ac
  43169. // a{0..3}d -> a0d a1d a2d a3d
  43170. // a{b,c{d,e}f}g -> abg acdfg acefg
  43171. // a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg
  43172. //
  43173. // Invalid sets are not expanded.
  43174. // a{2..}b -> a{2..}b
  43175. // a{b}c -> a{b}c
  43176. minimatch.braceExpand = function (pattern, options) {
  43177. return braceExpand(pattern, options)
  43178. };
  43179. Minimatch$1.prototype.braceExpand = braceExpand;
  43180. function braceExpand (pattern, options) {
  43181. if (!options) {
  43182. if (this instanceof Minimatch$1) {
  43183. options = this.options;
  43184. } else {
  43185. options = {};
  43186. }
  43187. }
  43188. pattern = typeof pattern === 'undefined'
  43189. ? this.pattern : pattern;
  43190. if (typeof pattern === 'undefined') {
  43191. throw new TypeError('undefined pattern')
  43192. }
  43193. if (options.nobrace ||
  43194. !pattern.match(/\{.*\}/)) {
  43195. // shortcut. no need to expand.
  43196. return [pattern]
  43197. }
  43198. return braceExpansion(pattern)
  43199. }
  43200. // parse a component of the expanded set.
  43201. // At this point, no pattern may contain "/" in it
  43202. // so we're going to return a 2d array, where each entry is the full
  43203. // pattern, split on '/', and then turned into a regular expression.
  43204. // A regexp is made at the end which joins each array with an
  43205. // escaped /, and another full one which joins each regexp with |.
  43206. //
  43207. // Following the lead of Bash 4.1, note that "**" only has special meaning
  43208. // when it is the *only* thing in a path portion. Otherwise, any series
  43209. // of * is equivalent to a single *. Globstar behavior is enabled by
  43210. // default, and can be disabled by setting options.noglobstar.
  43211. Minimatch$1.prototype.parse = parse;
  43212. var SUBPARSE = {};
  43213. function parse (pattern, isSub) {
  43214. if (pattern.length > 1024 * 64) {
  43215. throw new TypeError('pattern is too long')
  43216. }
  43217. var options = this.options;
  43218. // shortcuts
  43219. if (!options.noglobstar && pattern === '**') return GLOBSTAR
  43220. if (pattern === '') return ''
  43221. var re = '';
  43222. var hasMagic = !!options.nocase;
  43223. var escaping = false;
  43224. // ? => one single character
  43225. var patternListStack = [];
  43226. var negativeLists = [];
  43227. var stateChar;
  43228. var inClass = false;
  43229. var reClassStart = -1;
  43230. var classStart = -1;
  43231. // . and .. never match anything that doesn't start with .,
  43232. // even when options.dot is set.
  43233. var patternStart = pattern.charAt(0) === '.' ? '' // anything
  43234. // not (start or / followed by . or .. followed by / or end)
  43235. : options.dot ? '(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))'
  43236. : '(?!\\.)';
  43237. var self = this;
  43238. function clearStateChar () {
  43239. if (stateChar) {
  43240. // we had some state-tracking character
  43241. // that wasn't consumed by this pass.
  43242. switch (stateChar) {
  43243. case '*':
  43244. re += star;
  43245. hasMagic = true;
  43246. break
  43247. case '?':
  43248. re += qmark;
  43249. hasMagic = true;
  43250. break
  43251. default:
  43252. re += '\\' + stateChar;
  43253. break
  43254. }
  43255. self.debug('clearStateChar %j %j', stateChar, re);
  43256. stateChar = false;
  43257. }
  43258. }
  43259. for (var i = 0, len = pattern.length, c
  43260. ; (i < len) && (c = pattern.charAt(i))
  43261. ; i++) {
  43262. this.debug('%s\t%s %s %j', pattern, i, re, c);
  43263. // skip over any that are escaped.
  43264. if (escaping && reSpecials[c]) {
  43265. re += '\\' + c;
  43266. escaping = false;
  43267. continue
  43268. }
  43269. switch (c) {
  43270. case '/':
  43271. // completely not allowed, even escaped.
  43272. // Should already be path-split by now.
  43273. return false
  43274. case '\\':
  43275. clearStateChar();
  43276. escaping = true;
  43277. continue
  43278. // the various stateChar values
  43279. // for the "extglob" stuff.
  43280. case '?':
  43281. case '*':
  43282. case '+':
  43283. case '@':
  43284. case '!':
  43285. this.debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c);
  43286. // all of those are literals inside a class, except that
  43287. // the glob [!a] means [^a] in regexp
  43288. if (inClass) {
  43289. this.debug(' in class');
  43290. if (c === '!' && i === classStart + 1) c = '^';
  43291. re += c;
  43292. continue
  43293. }
  43294. // if we already have a stateChar, then it means
  43295. // that there was something like ** or +? in there.
  43296. // Handle the stateChar, then proceed with this one.
  43297. self.debug('call clearStateChar %j', stateChar);
  43298. clearStateChar();
  43299. stateChar = c;
  43300. // if extglob is disabled, then +(asdf|foo) isn't a thing.
  43301. // just clear the statechar *now*, rather than even diving into
  43302. // the patternList stuff.
  43303. if (options.noext) clearStateChar();
  43304. continue
  43305. case '(':
  43306. if (inClass) {
  43307. re += '(';
  43308. continue
  43309. }
  43310. if (!stateChar) {
  43311. re += '\\(';
  43312. continue
  43313. }
  43314. patternListStack.push({
  43315. type: stateChar,
  43316. start: i - 1,
  43317. reStart: re.length,
  43318. open: plTypes[stateChar].open,
  43319. close: plTypes[stateChar].close
  43320. });
  43321. // negation is (?:(?!js)[^/]*)
  43322. re += stateChar === '!' ? '(?:(?!(?:' : '(?:';
  43323. this.debug('plType %j %j', stateChar, re);
  43324. stateChar = false;
  43325. continue
  43326. case ')':
  43327. if (inClass || !patternListStack.length) {
  43328. re += '\\)';
  43329. continue
  43330. }
  43331. clearStateChar();
  43332. hasMagic = true;
  43333. var pl = patternListStack.pop();
  43334. // negation is (?:(?!js)[^/]*)
  43335. // The others are (?:<pattern>)<type>
  43336. re += pl.close;
  43337. if (pl.type === '!') {
  43338. negativeLists.push(pl);
  43339. }
  43340. pl.reEnd = re.length;
  43341. continue
  43342. case '|':
  43343. if (inClass || !patternListStack.length || escaping) {
  43344. re += '\\|';
  43345. escaping = false;
  43346. continue
  43347. }
  43348. clearStateChar();
  43349. re += '|';
  43350. continue
  43351. // these are mostly the same in regexp and glob
  43352. case '[':
  43353. // swallow any state-tracking char before the [
  43354. clearStateChar();
  43355. if (inClass) {
  43356. re += '\\' + c;
  43357. continue
  43358. }
  43359. inClass = true;
  43360. classStart = i;
  43361. reClassStart = re.length;
  43362. re += c;
  43363. continue
  43364. case ']':
  43365. // a right bracket shall lose its special
  43366. // meaning and represent itself in
  43367. // a bracket expression if it occurs
  43368. // first in the list. -- POSIX.2 2.8.3.2
  43369. if (i === classStart + 1 || !inClass) {
  43370. re += '\\' + c;
  43371. escaping = false;
  43372. continue
  43373. }
  43374. // handle the case where we left a class open.
  43375. // "[z-a]" is valid, equivalent to "\[z-a\]"
  43376. if (inClass) {
  43377. // split where the last [ was, make sure we don't have
  43378. // an invalid re. if so, re-walk the contents of the
  43379. // would-be class to re-translate any characters that
  43380. // were passed through as-is
  43381. // TODO: It would probably be faster to determine this
  43382. // without a try/catch and a new RegExp, but it's tricky
  43383. // to do safely. For now, this is safe and works.
  43384. var cs = pattern.substring(classStart + 1, i);
  43385. try {
  43386. RegExp('[' + cs + ']');
  43387. } catch (er) {
  43388. // not a valid class!
  43389. var sp = this.parse(cs, SUBPARSE);
  43390. re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]';
  43391. hasMagic = hasMagic || sp[1];
  43392. inClass = false;
  43393. continue
  43394. }
  43395. }
  43396. // finish up the class.
  43397. hasMagic = true;
  43398. inClass = false;
  43399. re += c;
  43400. continue
  43401. default:
  43402. // swallow any state char that wasn't consumed
  43403. clearStateChar();
  43404. if (escaping) {
  43405. // no need
  43406. escaping = false;
  43407. } else if (reSpecials[c]
  43408. && !(c === '^' && inClass)) {
  43409. re += '\\';
  43410. }
  43411. re += c;
  43412. } // switch
  43413. } // for
  43414. // handle the case where we left a class open.
  43415. // "[abc" is valid, equivalent to "\[abc"
  43416. if (inClass) {
  43417. // split where the last [ was, and escape it
  43418. // this is a huge pita. We now have to re-walk
  43419. // the contents of the would-be class to re-translate
  43420. // any characters that were passed through as-is
  43421. cs = pattern.substr(classStart + 1);
  43422. sp = this.parse(cs, SUBPARSE);
  43423. re = re.substr(0, reClassStart) + '\\[' + sp[0];
  43424. hasMagic = hasMagic || sp[1];
  43425. }
  43426. // handle the case where we had a +( thing at the *end*
  43427. // of the pattern.
  43428. // each pattern list stack adds 3 chars, and we need to go through
  43429. // and escape any | chars that were passed through as-is for the regexp.
  43430. // Go through and escape them, taking care not to double-escape any
  43431. // | chars that were already escaped.
  43432. for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) {
  43433. var tail = re.slice(pl.reStart + pl.open.length);
  43434. this.debug('setting tail', re, pl);
  43435. // maybe some even number of \, then maybe 1 \, followed by a |
  43436. tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, function (_, $1, $2) {
  43437. if (!$2) {
  43438. // the | isn't already escaped, so escape it.
  43439. $2 = '\\';
  43440. }
  43441. // need to escape all those slashes *again*, without escaping the
  43442. // one that we need for escaping the | character. As it works out,
  43443. // escaping an even number of slashes can be done by simply repeating
  43444. // it exactly after itself. That's why this trick works.
  43445. //
  43446. // I am sorry that you have to see this.
  43447. return $1 + $1 + $2 + '|'
  43448. });
  43449. this.debug('tail=%j\n %s', tail, tail, pl, re);
  43450. var t = pl.type === '*' ? star
  43451. : pl.type === '?' ? qmark
  43452. : '\\' + pl.type;
  43453. hasMagic = true;
  43454. re = re.slice(0, pl.reStart) + t + '\\(' + tail;
  43455. }
  43456. // handle trailing things that only matter at the very end.
  43457. clearStateChar();
  43458. if (escaping) {
  43459. // trailing \\
  43460. re += '\\\\';
  43461. }
  43462. // only need to apply the nodot start if the re starts with
  43463. // something that could conceivably capture a dot
  43464. var addPatternStart = false;
  43465. switch (re.charAt(0)) {
  43466. case '.':
  43467. case '[':
  43468. case '(': addPatternStart = true;
  43469. }
  43470. // Hack to work around lack of negative lookbehind in JS
  43471. // A pattern like: *.!(x).!(y|z) needs to ensure that a name
  43472. // like 'a.xyz.yz' doesn't match. So, the first negative
  43473. // lookahead, has to look ALL the way ahead, to the end of
  43474. // the pattern.
  43475. for (var n = negativeLists.length - 1; n > -1; n--) {
  43476. var nl = negativeLists[n];
  43477. var nlBefore = re.slice(0, nl.reStart);
  43478. var nlFirst = re.slice(nl.reStart, nl.reEnd - 8);
  43479. var nlLast = re.slice(nl.reEnd - 8, nl.reEnd);
  43480. var nlAfter = re.slice(nl.reEnd);
  43481. nlLast += nlAfter;
  43482. // Handle nested stuff like *(*.js|!(*.json)), where open parens
  43483. // mean that we should *not* include the ) in the bit that is considered
  43484. // "after" the negated section.
  43485. var openParensBefore = nlBefore.split('(').length - 1;
  43486. var cleanAfter = nlAfter;
  43487. for (i = 0; i < openParensBefore; i++) {
  43488. cleanAfter = cleanAfter.replace(/\)[+*?]?/, '');
  43489. }
  43490. nlAfter = cleanAfter;
  43491. var dollar = '';
  43492. if (nlAfter === '' && isSub !== SUBPARSE) {
  43493. dollar = '$';
  43494. }
  43495. var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast;
  43496. re = newRe;
  43497. }
  43498. // if the re is not "" at this point, then we need to make sure
  43499. // it doesn't match against an empty path part.
  43500. // Otherwise a/* will match a/, which it should not.
  43501. if (re !== '' && hasMagic) {
  43502. re = '(?=.)' + re;
  43503. }
  43504. if (addPatternStart) {
  43505. re = patternStart + re;
  43506. }
  43507. // parsing just a piece of a larger pattern.
  43508. if (isSub === SUBPARSE) {
  43509. return [re, hasMagic]
  43510. }
  43511. // skip the regexp for non-magical patterns
  43512. // unescape anything in it, though, so that it'll be
  43513. // an exact match against a file etc.
  43514. if (!hasMagic) {
  43515. return globUnescape(pattern)
  43516. }
  43517. var flags = options.nocase ? 'i' : '';
  43518. try {
  43519. var regExp = new RegExp('^' + re + '$', flags);
  43520. } catch (er) {
  43521. // If it was an invalid regular expression, then it can't match
  43522. // anything. This trick looks for a character after the end of
  43523. // the string, which is of course impossible, except in multi-line
  43524. // mode, but it's not a /m regex.
  43525. return new RegExp('$.')
  43526. }
  43527. regExp._glob = pattern;
  43528. regExp._src = re;
  43529. return regExp
  43530. }
  43531. minimatch.makeRe = function (pattern, options) {
  43532. return new Minimatch$1(pattern, options || {}).makeRe()
  43533. };
  43534. Minimatch$1.prototype.makeRe = makeRe;
  43535. function makeRe () {
  43536. if (this.regexp || this.regexp === false) return this.regexp
  43537. // at this point, this.set is a 2d array of partial
  43538. // pattern strings, or "**".
  43539. //
  43540. // It's better to use .match(). This function shouldn't
  43541. // be used, really, but it's pretty convenient sometimes,
  43542. // when you just want to work with a regex.
  43543. var set = this.set;
  43544. if (!set.length) {
  43545. this.regexp = false;
  43546. return this.regexp
  43547. }
  43548. var options = this.options;
  43549. var twoStar = options.noglobstar ? star
  43550. : options.dot ? twoStarDot
  43551. : twoStarNoDot;
  43552. var flags = options.nocase ? 'i' : '';
  43553. var re = set.map(function (pattern) {
  43554. return pattern.map(function (p) {
  43555. return (p === GLOBSTAR) ? twoStar
  43556. : (typeof p === 'string') ? regExpEscape(p)
  43557. : p._src
  43558. }).join('\\\/')
  43559. }).join('|');
  43560. // must match entire pattern
  43561. // ending in a * or ** will make it less strict.
  43562. re = '^(?:' + re + ')$';
  43563. // can match anything, as long as it's not this.
  43564. if (this.negate) re = '^(?!' + re + ').*$';
  43565. try {
  43566. this.regexp = new RegExp(re, flags);
  43567. } catch (ex) {
  43568. this.regexp = false;
  43569. }
  43570. return this.regexp
  43571. }
  43572. minimatch.match = function (list, pattern, options) {
  43573. options = options || {};
  43574. var mm = new Minimatch$1(pattern, options);
  43575. list = list.filter(function (f) {
  43576. return mm.match(f)
  43577. });
  43578. if (mm.options.nonull && !list.length) {
  43579. list.push(pattern);
  43580. }
  43581. return list
  43582. };
  43583. Minimatch$1.prototype.match = match;
  43584. function match (f, partial) {
  43585. this.debug('match', f, this.pattern);
  43586. // short-circuit in the case of busted things.
  43587. // comments, etc.
  43588. if (this.comment) return false
  43589. if (this.empty) return f === ''
  43590. if (f === '/' && partial) return true
  43591. var options = this.options;
  43592. // windows: need to use /, not \
  43593. if (path.sep !== '/') {
  43594. f = f.split(path.sep).join('/');
  43595. }
  43596. // treat the test path as a set of pathparts.
  43597. f = f.split(slashSplit);
  43598. this.debug(this.pattern, 'split', f);
  43599. // just ONE of the pattern sets in this.set needs to match
  43600. // in order for it to be valid. If negating, then just one
  43601. // match means that we have failed.
  43602. // Either way, return on the first hit.
  43603. var set = this.set;
  43604. this.debug(this.pattern, 'set', set);
  43605. // Find the basename of the path by looking for the last non-empty segment
  43606. var filename;
  43607. var i;
  43608. for (i = f.length - 1; i >= 0; i--) {
  43609. filename = f[i];
  43610. if (filename) break
  43611. }
  43612. for (i = 0; i < set.length; i++) {
  43613. var pattern = set[i];
  43614. var file = f;
  43615. if (options.matchBase && pattern.length === 1) {
  43616. file = [filename];
  43617. }
  43618. var hit = this.matchOne(file, pattern, partial);
  43619. if (hit) {
  43620. if (options.flipNegate) return true
  43621. return !this.negate
  43622. }
  43623. }
  43624. // didn't get any hits. this is success if it's a negative
  43625. // pattern, failure otherwise.
  43626. if (options.flipNegate) return false
  43627. return this.negate
  43628. }
  43629. // set partial to true to test if, for example,
  43630. // "/a/b" matches the start of "/*/b/*/d"
  43631. // Partial means, if you run out of file before you run
  43632. // out of pattern, then that's fine, as long as all
  43633. // the parts match.
  43634. Minimatch$1.prototype.matchOne = function (file, pattern, partial) {
  43635. var options = this.options;
  43636. this.debug('matchOne',
  43637. { 'this': this, file: file, pattern: pattern });
  43638. this.debug('matchOne', file.length, pattern.length);
  43639. for (var fi = 0,
  43640. pi = 0,
  43641. fl = file.length,
  43642. pl = pattern.length
  43643. ; (fi < fl) && (pi < pl)
  43644. ; fi++, pi++) {
  43645. this.debug('matchOne loop');
  43646. var p = pattern[pi];
  43647. var f = file[fi];
  43648. this.debug(pattern, p, f);
  43649. // should be impossible.
  43650. // some invalid regexp stuff in the set.
  43651. if (p === false) return false
  43652. if (p === GLOBSTAR) {
  43653. this.debug('GLOBSTAR', [pattern, p, f]);
  43654. // "**"
  43655. // a/**/b/**/c would match the following:
  43656. // a/b/x/y/z/c
  43657. // a/x/y/z/b/c
  43658. // a/b/x/b/x/c
  43659. // a/b/c
  43660. // To do this, take the rest of the pattern after
  43661. // the **, and see if it would match the file remainder.
  43662. // If so, return success.
  43663. // If not, the ** "swallows" a segment, and try again.
  43664. // This is recursively awful.
  43665. //
  43666. // a/**/b/**/c matching a/b/x/y/z/c
  43667. // - a matches a
  43668. // - doublestar
  43669. // - matchOne(b/x/y/z/c, b/**/c)
  43670. // - b matches b
  43671. // - doublestar
  43672. // - matchOne(x/y/z/c, c) -> no
  43673. // - matchOne(y/z/c, c) -> no
  43674. // - matchOne(z/c, c) -> no
  43675. // - matchOne(c, c) yes, hit
  43676. var fr = fi;
  43677. var pr = pi + 1;
  43678. if (pr === pl) {
  43679. this.debug('** at the end');
  43680. // a ** at the end will just swallow the rest.
  43681. // We have found a match.
  43682. // however, it will not swallow /.x, unless
  43683. // options.dot is set.
  43684. // . and .. are *never* matched by **, for explosively
  43685. // exponential reasons.
  43686. for (; fi < fl; fi++) {
  43687. if (file[fi] === '.' || file[fi] === '..' ||
  43688. (!options.dot && file[fi].charAt(0) === '.')) return false
  43689. }
  43690. return true
  43691. }
  43692. // ok, let's see if we can swallow whatever we can.
  43693. while (fr < fl) {
  43694. var swallowee = file[fr];
  43695. this.debug('\nglobstar while', file, fr, pattern, pr, swallowee);
  43696. // XXX remove this slice. Just pass the start index.
  43697. if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
  43698. this.debug('globstar found match!', fr, fl, swallowee);
  43699. // found a match.
  43700. return true
  43701. } else {
  43702. // can't swallow "." or ".." ever.
  43703. // can only swallow ".foo" when explicitly asked.
  43704. if (swallowee === '.' || swallowee === '..' ||
  43705. (!options.dot && swallowee.charAt(0) === '.')) {
  43706. this.debug('dot detected!', file, fr, pattern, pr);
  43707. break
  43708. }
  43709. // ** swallows a segment, and continue.
  43710. this.debug('globstar swallow a segment, and continue');
  43711. fr++;
  43712. }
  43713. }
  43714. // no match was found.
  43715. // However, in partial mode, we can't say this is necessarily over.
  43716. // If there's more *pattern* left, then
  43717. if (partial) {
  43718. // ran out of file
  43719. this.debug('\n>>> no match, partial?', file, fr, pattern, pr);
  43720. if (fr === fl) return true
  43721. }
  43722. return false
  43723. }
  43724. // something other than **
  43725. // non-magic patterns just have to match exactly
  43726. // patterns with magic have been turned into regexps.
  43727. var hit;
  43728. if (typeof p === 'string') {
  43729. if (options.nocase) {
  43730. hit = f.toLowerCase() === p.toLowerCase();
  43731. } else {
  43732. hit = f === p;
  43733. }
  43734. this.debug('string match', p, f, hit);
  43735. } else {
  43736. hit = f.match(p);
  43737. this.debug('pattern match', p, f, hit);
  43738. }
  43739. if (!hit) return false
  43740. }
  43741. // Note: ending in / means that we'll get a final ""
  43742. // at the end of the pattern. This can only match a
  43743. // corresponding "" at the end of the file.
  43744. // If the file ends in /, then it can only match a
  43745. // a pattern that ends in /, unless the pattern just
  43746. // doesn't have any more for it. But, a/b/ should *not*
  43747. // match "a/b/*", even though "" matches against the
  43748. // [^/]*? pattern, except in partial mode, where it might
  43749. // simply not be reached yet.
  43750. // However, a/b/ should still satisfy a/*
  43751. // now either we fell off the end of the pattern, or we're done.
  43752. if (fi === fl && pi === pl) {
  43753. // ran out of pattern and filename at the same time.
  43754. // an exact hit!
  43755. return true
  43756. } else if (fi === fl) {
  43757. // ran out of file, but still had pattern left.
  43758. // this is ok if we're doing the match as part of
  43759. // a glob fs traversal.
  43760. return partial
  43761. } else if (pi === pl) {
  43762. // ran out of pattern, still have file left.
  43763. // this is only acceptable if we're on the very last
  43764. // empty segment of a file with a trailing slash.
  43765. // a/* should match a/b/
  43766. var emptyFileEnd = (fi === fl - 1) && (file[fi] === '');
  43767. return emptyFileEnd
  43768. }
  43769. // should be unreachable.
  43770. throw new Error('wtf?')
  43771. };
  43772. // replace stuff like \* with *
  43773. function globUnescape (s) {
  43774. return s.replace(/\\(.)/g, '$1')
  43775. }
  43776. function regExpEscape (s) {
  43777. return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&')
  43778. }
  43779. var inherits_browser = createCommonjsModule(function (module) {
  43780. if (typeof Object.create === 'function') {
  43781. // implementation from standard node.js 'util' module
  43782. module.exports = function inherits(ctor, superCtor) {
  43783. if (superCtor) {
  43784. ctor.super_ = superCtor;
  43785. ctor.prototype = Object.create(superCtor.prototype, {
  43786. constructor: {
  43787. value: ctor,
  43788. enumerable: false,
  43789. writable: true,
  43790. configurable: true
  43791. }
  43792. });
  43793. }
  43794. };
  43795. } else {
  43796. // old school shim for old browsers
  43797. module.exports = function inherits(ctor, superCtor) {
  43798. if (superCtor) {
  43799. ctor.super_ = superCtor;
  43800. var TempCtor = function () {};
  43801. TempCtor.prototype = superCtor.prototype;
  43802. ctor.prototype = new TempCtor();
  43803. ctor.prototype.constructor = ctor;
  43804. }
  43805. };
  43806. }
  43807. });
  43808. var inherits$1 = createCommonjsModule(function (module) {
  43809. try {
  43810. var util = require$$0$1;
  43811. /* istanbul ignore next */
  43812. if (typeof util.inherits !== 'function') throw '';
  43813. module.exports = util.inherits;
  43814. } catch (e) {
  43815. /* istanbul ignore next */
  43816. module.exports = inherits_browser;
  43817. }
  43818. });
  43819. // Copyright Joyent, Inc. and other Node contributors.
  43820. var R = typeof Reflect === 'object' ? Reflect : null;
  43821. var ReflectApply = R && typeof R.apply === 'function'
  43822. ? R.apply
  43823. : function ReflectApply(target, receiver, args) {
  43824. return Function.prototype.apply.call(target, receiver, args);
  43825. };
  43826. var ReflectOwnKeys;
  43827. if (R && typeof R.ownKeys === 'function') {
  43828. ReflectOwnKeys = R.ownKeys;
  43829. } else if (Object.getOwnPropertySymbols) {
  43830. ReflectOwnKeys = function ReflectOwnKeys(target) {
  43831. return Object.getOwnPropertyNames(target)
  43832. .concat(Object.getOwnPropertySymbols(target));
  43833. };
  43834. } else {
  43835. ReflectOwnKeys = function ReflectOwnKeys(target) {
  43836. return Object.getOwnPropertyNames(target);
  43837. };
  43838. }
  43839. function ProcessEmitWarning(warning) {
  43840. if (console && console.warn) console.warn(warning);
  43841. }
  43842. var NumberIsNaN = Number.isNaN || function NumberIsNaN(value) {
  43843. return value !== value;
  43844. };
  43845. function EventEmitter() {
  43846. EventEmitter.init.call(this);
  43847. }
  43848. var events = EventEmitter;
  43849. var once_1$1 = once$1;
  43850. // Backwards-compat with node 0.10.x
  43851. EventEmitter.EventEmitter = EventEmitter;
  43852. EventEmitter.prototype._events = undefined;
  43853. EventEmitter.prototype._eventsCount = 0;
  43854. EventEmitter.prototype._maxListeners = undefined;
  43855. // By default EventEmitters will print a warning if more than 10 listeners are
  43856. // added to it. This is a useful default which helps finding memory leaks.
  43857. var defaultMaxListeners = 10;
  43858. function checkListener(listener) {
  43859. if (typeof listener !== 'function') {
  43860. throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof listener);
  43861. }
  43862. }
  43863. Object.defineProperty(EventEmitter, 'defaultMaxListeners', {
  43864. enumerable: true,
  43865. get: function() {
  43866. return defaultMaxListeners;
  43867. },
  43868. set: function(arg) {
  43869. if (typeof arg !== 'number' || arg < 0 || NumberIsNaN(arg)) {
  43870. throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + arg + '.');
  43871. }
  43872. defaultMaxListeners = arg;
  43873. }
  43874. });
  43875. EventEmitter.init = function() {
  43876. if (this._events === undefined ||
  43877. this._events === Object.getPrototypeOf(this)._events) {
  43878. this._events = Object.create(null);
  43879. this._eventsCount = 0;
  43880. }
  43881. this._maxListeners = this._maxListeners || undefined;
  43882. };
  43883. // Obviously not all Emitters should be limited to 10. This function allows
  43884. // that to be increased. Set to zero for unlimited.
  43885. EventEmitter.prototype.setMaxListeners = function setMaxListeners(n) {
  43886. if (typeof n !== 'number' || n < 0 || NumberIsNaN(n)) {
  43887. throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + n + '.');
  43888. }
  43889. this._maxListeners = n;
  43890. return this;
  43891. };
  43892. function _getMaxListeners(that) {
  43893. if (that._maxListeners === undefined)
  43894. return EventEmitter.defaultMaxListeners;
  43895. return that._maxListeners;
  43896. }
  43897. EventEmitter.prototype.getMaxListeners = function getMaxListeners() {
  43898. return _getMaxListeners(this);
  43899. };
  43900. EventEmitter.prototype.emit = function emit(type) {
  43901. var args = [];
  43902. for (var i = 1; i < arguments.length; i++) args.push(arguments[i]);
  43903. var doError = (type === 'error');
  43904. var events = this._events;
  43905. if (events !== undefined)
  43906. doError = (doError && events.error === undefined);
  43907. else if (!doError)
  43908. return false;
  43909. // If there is no 'error' event listener then throw.
  43910. if (doError) {
  43911. var er;
  43912. if (args.length > 0)
  43913. er = args[0];
  43914. if (er instanceof Error) {
  43915. // Note: The comments on the `throw` lines are intentional, they show
  43916. // up in Node's output if this results in an unhandled exception.
  43917. throw er; // Unhandled 'error' event
  43918. }
  43919. // At least give some kind of context to the user
  43920. var err = new Error('Unhandled error.' + (er ? ' (' + er.message + ')' : ''));
  43921. err.context = er;
  43922. throw err; // Unhandled 'error' event
  43923. }
  43924. var handler = events[type];
  43925. if (handler === undefined)
  43926. return false;
  43927. if (typeof handler === 'function') {
  43928. ReflectApply(handler, this, args);
  43929. } else {
  43930. var len = handler.length;
  43931. var listeners = arrayClone(handler, len);
  43932. for (var i = 0; i < len; ++i)
  43933. ReflectApply(listeners[i], this, args);
  43934. }
  43935. return true;
  43936. };
  43937. function _addListener(target, type, listener, prepend) {
  43938. var m;
  43939. var events;
  43940. var existing;
  43941. checkListener(listener);
  43942. events = target._events;
  43943. if (events === undefined) {
  43944. events = target._events = Object.create(null);
  43945. target._eventsCount = 0;
  43946. } else {
  43947. // To avoid recursion in the case that type === "newListener"! Before
  43948. // adding it to the listeners, first emit "newListener".
  43949. if (events.newListener !== undefined) {
  43950. target.emit('newListener', type,
  43951. listener.listener ? listener.listener : listener);
  43952. // Re-assign `events` because a newListener handler could have caused the
  43953. // this._events to be assigned to a new object
  43954. events = target._events;
  43955. }
  43956. existing = events[type];
  43957. }
  43958. if (existing === undefined) {
  43959. // Optimize the case of one listener. Don't need the extra array object.
  43960. existing = events[type] = listener;
  43961. ++target._eventsCount;
  43962. } else {
  43963. if (typeof existing === 'function') {
  43964. // Adding the second element, need to change to array.
  43965. existing = events[type] =
  43966. prepend ? [listener, existing] : [existing, listener];
  43967. // If we've already got an array, just append.
  43968. } else if (prepend) {
  43969. existing.unshift(listener);
  43970. } else {
  43971. existing.push(listener);
  43972. }
  43973. // Check for listener leak
  43974. m = _getMaxListeners(target);
  43975. if (m > 0 && existing.length > m && !existing.warned) {
  43976. existing.warned = true;
  43977. // No error code for this since it is a Warning
  43978. // eslint-disable-next-line no-restricted-syntax
  43979. var w = new Error('Possible EventEmitter memory leak detected. ' +
  43980. existing.length + ' ' + String(type) + ' listeners ' +
  43981. 'added. Use emitter.setMaxListeners() to ' +
  43982. 'increase limit');
  43983. w.name = 'MaxListenersExceededWarning';
  43984. w.emitter = target;
  43985. w.type = type;
  43986. w.count = existing.length;
  43987. ProcessEmitWarning(w);
  43988. }
  43989. }
  43990. return target;
  43991. }
  43992. EventEmitter.prototype.addListener = function addListener(type, listener) {
  43993. return _addListener(this, type, listener, false);
  43994. };
  43995. EventEmitter.prototype.on = EventEmitter.prototype.addListener;
  43996. EventEmitter.prototype.prependListener =
  43997. function prependListener(type, listener) {
  43998. return _addListener(this, type, listener, true);
  43999. };
  44000. function onceWrapper() {
  44001. if (!this.fired) {
  44002. this.target.removeListener(this.type, this.wrapFn);
  44003. this.fired = true;
  44004. if (arguments.length === 0)
  44005. return this.listener.call(this.target);
  44006. return this.listener.apply(this.target, arguments);
  44007. }
  44008. }
  44009. function _onceWrap(target, type, listener) {
  44010. var state = { fired: false, wrapFn: undefined, target: target, type: type, listener: listener };
  44011. var wrapped = onceWrapper.bind(state);
  44012. wrapped.listener = listener;
  44013. state.wrapFn = wrapped;
  44014. return wrapped;
  44015. }
  44016. EventEmitter.prototype.once = function once(type, listener) {
  44017. checkListener(listener);
  44018. this.on(type, _onceWrap(this, type, listener));
  44019. return this;
  44020. };
  44021. EventEmitter.prototype.prependOnceListener =
  44022. function prependOnceListener(type, listener) {
  44023. checkListener(listener);
  44024. this.prependListener(type, _onceWrap(this, type, listener));
  44025. return this;
  44026. };
  44027. // Emits a 'removeListener' event if and only if the listener was removed.
  44028. EventEmitter.prototype.removeListener =
  44029. function removeListener(type, listener) {
  44030. var list, events, position, i, originalListener;
  44031. checkListener(listener);
  44032. events = this._events;
  44033. if (events === undefined)
  44034. return this;
  44035. list = events[type];
  44036. if (list === undefined)
  44037. return this;
  44038. if (list === listener || list.listener === listener) {
  44039. if (--this._eventsCount === 0)
  44040. this._events = Object.create(null);
  44041. else {
  44042. delete events[type];
  44043. if (events.removeListener)
  44044. this.emit('removeListener', type, list.listener || listener);
  44045. }
  44046. } else if (typeof list !== 'function') {
  44047. position = -1;
  44048. for (i = list.length - 1; i >= 0; i--) {
  44049. if (list[i] === listener || list[i].listener === listener) {
  44050. originalListener = list[i].listener;
  44051. position = i;
  44052. break;
  44053. }
  44054. }
  44055. if (position < 0)
  44056. return this;
  44057. if (position === 0)
  44058. list.shift();
  44059. else {
  44060. spliceOne(list, position);
  44061. }
  44062. if (list.length === 1)
  44063. events[type] = list[0];
  44064. if (events.removeListener !== undefined)
  44065. this.emit('removeListener', type, originalListener || listener);
  44066. }
  44067. return this;
  44068. };
  44069. EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
  44070. EventEmitter.prototype.removeAllListeners =
  44071. function removeAllListeners(type) {
  44072. var listeners, events, i;
  44073. events = this._events;
  44074. if (events === undefined)
  44075. return this;
  44076. // not listening for removeListener, no need to emit
  44077. if (events.removeListener === undefined) {
  44078. if (arguments.length === 0) {
  44079. this._events = Object.create(null);
  44080. this._eventsCount = 0;
  44081. } else if (events[type] !== undefined) {
  44082. if (--this._eventsCount === 0)
  44083. this._events = Object.create(null);
  44084. else
  44085. delete events[type];
  44086. }
  44087. return this;
  44088. }
  44089. // emit removeListener for all listeners on all events
  44090. if (arguments.length === 0) {
  44091. var keys = Object.keys(events);
  44092. var key;
  44093. for (i = 0; i < keys.length; ++i) {
  44094. key = keys[i];
  44095. if (key === 'removeListener') continue;
  44096. this.removeAllListeners(key);
  44097. }
  44098. this.removeAllListeners('removeListener');
  44099. this._events = Object.create(null);
  44100. this._eventsCount = 0;
  44101. return this;
  44102. }
  44103. listeners = events[type];
  44104. if (typeof listeners === 'function') {
  44105. this.removeListener(type, listeners);
  44106. } else if (listeners !== undefined) {
  44107. // LIFO order
  44108. for (i = listeners.length - 1; i >= 0; i--) {
  44109. this.removeListener(type, listeners[i]);
  44110. }
  44111. }
  44112. return this;
  44113. };
  44114. function _listeners(target, type, unwrap) {
  44115. var events = target._events;
  44116. if (events === undefined)
  44117. return [];
  44118. var evlistener = events[type];
  44119. if (evlistener === undefined)
  44120. return [];
  44121. if (typeof evlistener === 'function')
  44122. return unwrap ? [evlistener.listener || evlistener] : [evlistener];
  44123. return unwrap ?
  44124. unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length);
  44125. }
  44126. EventEmitter.prototype.listeners = function listeners(type) {
  44127. return _listeners(this, type, true);
  44128. };
  44129. EventEmitter.prototype.rawListeners = function rawListeners(type) {
  44130. return _listeners(this, type, false);
  44131. };
  44132. EventEmitter.listenerCount = function(emitter, type) {
  44133. if (typeof emitter.listenerCount === 'function') {
  44134. return emitter.listenerCount(type);
  44135. } else {
  44136. return listenerCount.call(emitter, type);
  44137. }
  44138. };
  44139. EventEmitter.prototype.listenerCount = listenerCount;
  44140. function listenerCount(type) {
  44141. var events = this._events;
  44142. if (events !== undefined) {
  44143. var evlistener = events[type];
  44144. if (typeof evlistener === 'function') {
  44145. return 1;
  44146. } else if (evlistener !== undefined) {
  44147. return evlistener.length;
  44148. }
  44149. }
  44150. return 0;
  44151. }
  44152. EventEmitter.prototype.eventNames = function eventNames() {
  44153. return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : [];
  44154. };
  44155. function arrayClone(arr, n) {
  44156. var copy = new Array(n);
  44157. for (var i = 0; i < n; ++i)
  44158. copy[i] = arr[i];
  44159. return copy;
  44160. }
  44161. function spliceOne(list, index) {
  44162. for (; index + 1 < list.length; index++)
  44163. list[index] = list[index + 1];
  44164. list.pop();
  44165. }
  44166. function unwrapListeners(arr) {
  44167. var ret = new Array(arr.length);
  44168. for (var i = 0; i < ret.length; ++i) {
  44169. ret[i] = arr[i].listener || arr[i];
  44170. }
  44171. return ret;
  44172. }
  44173. function once$1(emitter, name) {
  44174. return new Promise(function (resolve, reject) {
  44175. function errorListener(err) {
  44176. emitter.removeListener(name, resolver);
  44177. reject(err);
  44178. }
  44179. function resolver() {
  44180. if (typeof emitter.removeListener === 'function') {
  44181. emitter.removeListener('error', errorListener);
  44182. }
  44183. resolve([].slice.call(arguments));
  44184. }
  44185. eventTargetAgnosticAddListener(emitter, name, resolver, { once: true });
  44186. if (name !== 'error') {
  44187. addErrorHandlerIfEventEmitter(emitter, errorListener, { once: true });
  44188. }
  44189. });
  44190. }
  44191. function addErrorHandlerIfEventEmitter(emitter, handler, flags) {
  44192. if (typeof emitter.on === 'function') {
  44193. eventTargetAgnosticAddListener(emitter, 'error', handler, flags);
  44194. }
  44195. }
  44196. function eventTargetAgnosticAddListener(emitter, name, listener, flags) {
  44197. if (typeof emitter.on === 'function') {
  44198. if (flags.once) {
  44199. emitter.once(name, listener);
  44200. } else {
  44201. emitter.on(name, listener);
  44202. }
  44203. } else if (typeof emitter.addEventListener === 'function') {
  44204. // EventTarget does not have `error` event semantics like Node
  44205. // EventEmitters, we do not listen for `error` events here.
  44206. emitter.addEventListener(name, function wrapListener(arg) {
  44207. // IE does not have builtin `{ once: true }` support so we
  44208. // have to do it manually.
  44209. if (flags.once) {
  44210. emitter.removeEventListener(name, wrapListener);
  44211. }
  44212. listener(arg);
  44213. });
  44214. } else {
  44215. throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof emitter);
  44216. }
  44217. }
  44218. events.once = once_1$1;
  44219. /*
  44220. object-assign
  44221. (c) Sindre Sorhus
  44222. @license MIT
  44223. */
  44224. /* eslint-disable no-unused-vars */
  44225. var getOwnPropertySymbols = Object.getOwnPropertySymbols;
  44226. var hasOwnProperty = Object.prototype.hasOwnProperty;
  44227. var propIsEnumerable = Object.prototype.propertyIsEnumerable;
  44228. function toObject(val) {
  44229. if (val === null || val === undefined) {
  44230. throw new TypeError('Object.assign cannot be called with null or undefined');
  44231. }
  44232. return Object(val);
  44233. }
  44234. function shouldUseNative() {
  44235. try {
  44236. if (!Object.assign) {
  44237. return false;
  44238. }
  44239. // Detect buggy property enumeration order in older V8 versions.
  44240. // https://bugs.chromium.org/p/v8/issues/detail?id=4118
  44241. var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
  44242. test1[5] = 'de';
  44243. if (Object.getOwnPropertyNames(test1)[0] === '5') {
  44244. return false;
  44245. }
  44246. // https://bugs.chromium.org/p/v8/issues/detail?id=3056
  44247. var test2 = {};
  44248. for (var i = 0; i < 10; i++) {
  44249. test2['_' + String.fromCharCode(i)] = i;
  44250. }
  44251. var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
  44252. return test2[n];
  44253. });
  44254. if (order2.join('') !== '0123456789') {
  44255. return false;
  44256. }
  44257. // https://bugs.chromium.org/p/v8/issues/detail?id=3056
  44258. var test3 = {};
  44259. 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
  44260. test3[letter] = letter;
  44261. });
  44262. if (Object.keys(Object.assign({}, test3)).join('') !==
  44263. 'abcdefghijklmnopqrst') {
  44264. return false;
  44265. }
  44266. return true;
  44267. } catch (err) {
  44268. // We don't expect any of the above to throw, but better to be safe.
  44269. return false;
  44270. }
  44271. }
  44272. var objectAssign = shouldUseNative() ? Object.assign : function (target, source) {
  44273. var from;
  44274. var to = toObject(target);
  44275. var symbols;
  44276. for (var s = 1; s < arguments.length; s++) {
  44277. from = Object(arguments[s]);
  44278. for (var key in from) {
  44279. if (hasOwnProperty.call(from, key)) {
  44280. to[key] = from[key];
  44281. }
  44282. }
  44283. if (getOwnPropertySymbols) {
  44284. symbols = getOwnPropertySymbols(from);
  44285. for (var i = 0; i < symbols.length; i++) {
  44286. if (propIsEnumerable.call(from, symbols[i])) {
  44287. to[symbols[i]] = from[symbols[i]];
  44288. }
  44289. }
  44290. }
  44291. }
  44292. return to;
  44293. };
  44294. var isBuffer = function isBuffer(arg) {
  44295. return arg instanceof Buffer;
  44296. };
  44297. var inherits = require$$0$1.inherits;
  44298. var util = createCommonjsModule(function (module, exports) {
  44299. // Copyright Joyent, Inc. and other Node contributors.
  44300. //
  44301. // Permission is hereby granted, free of charge, to any person obtaining a
  44302. // copy of this software and associated documentation files (the
  44303. // "Software"), to deal in the Software without restriction, including
  44304. // without limitation the rights to use, copy, modify, merge, publish,
  44305. // distribute, sublicense, and/or sell copies of the Software, and to permit
  44306. // persons to whom the Software is furnished to do so, subject to the
  44307. // following conditions:
  44308. //
  44309. // The above copyright notice and this permission notice shall be included
  44310. // in all copies or substantial portions of the Software.
  44311. //
  44312. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  44313. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  44314. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  44315. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  44316. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  44317. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  44318. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  44319. var formatRegExp = /%[sdj%]/g;
  44320. exports.format = function(f) {
  44321. if (!isString(f)) {
  44322. var objects = [];
  44323. for (var i = 0; i < arguments.length; i++) {
  44324. objects.push(inspect(arguments[i]));
  44325. }
  44326. return objects.join(' ');
  44327. }
  44328. var i = 1;
  44329. var args = arguments;
  44330. var len = args.length;
  44331. var str = String(f).replace(formatRegExp, function(x) {
  44332. if (x === '%%') return '%';
  44333. if (i >= len) return x;
  44334. switch (x) {
  44335. case '%s': return String(args[i++]);
  44336. case '%d': return Number(args[i++]);
  44337. case '%j':
  44338. try {
  44339. return JSON.stringify(args[i++]);
  44340. } catch (_) {
  44341. return '[Circular]';
  44342. }
  44343. default:
  44344. return x;
  44345. }
  44346. });
  44347. for (var x = args[i]; i < len; x = args[++i]) {
  44348. if (isNull(x) || !isObject(x)) {
  44349. str += ' ' + x;
  44350. } else {
  44351. str += ' ' + inspect(x);
  44352. }
  44353. }
  44354. return str;
  44355. };
  44356. // Mark that a method should not be used.
  44357. // Returns a modified function which warns once by default.
  44358. // If --no-deprecation is set, then it is a no-op.
  44359. exports.deprecate = function(fn, msg) {
  44360. // Allow for deprecating things in the process of starting up.
  44361. if (isUndefined(commonjsGlobal.process)) {
  44362. return function() {
  44363. return exports.deprecate(fn, msg).apply(this, arguments);
  44364. };
  44365. }
  44366. if (process.noDeprecation === true) {
  44367. return fn;
  44368. }
  44369. var warned = false;
  44370. function deprecated() {
  44371. if (!warned) {
  44372. if (process.throwDeprecation) {
  44373. throw new Error(msg);
  44374. } else if (process.traceDeprecation) {
  44375. console.trace(msg);
  44376. } else {
  44377. console.error(msg);
  44378. }
  44379. warned = true;
  44380. }
  44381. return fn.apply(this, arguments);
  44382. }
  44383. return deprecated;
  44384. };
  44385. var debugs = {};
  44386. var debugEnviron;
  44387. exports.debuglog = function(set) {
  44388. if (isUndefined(debugEnviron))
  44389. debugEnviron = '';
  44390. set = set.toUpperCase();
  44391. if (!debugs[set]) {
  44392. if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) {
  44393. var pid = process.pid;
  44394. debugs[set] = function() {
  44395. var msg = exports.format.apply(exports, arguments);
  44396. console.error('%s %d: %s', set, pid, msg);
  44397. };
  44398. } else {
  44399. debugs[set] = function() {};
  44400. }
  44401. }
  44402. return debugs[set];
  44403. };
  44404. /**
  44405. * Echos the value of a value. Trys to print the value out
  44406. * in the best way possible given the different types.
  44407. *
  44408. * @param {Object} obj The object to print out.
  44409. * @param {Object} opts Optional options object that alters the output.
  44410. */
  44411. /* legacy: obj, showHidden, depth, colors*/
  44412. function inspect(obj, opts) {
  44413. // default options
  44414. var ctx = {
  44415. seen: [],
  44416. stylize: stylizeNoColor
  44417. };
  44418. // legacy...
  44419. if (arguments.length >= 3) ctx.depth = arguments[2];
  44420. if (arguments.length >= 4) ctx.colors = arguments[3];
  44421. if (isBoolean(opts)) {
  44422. // legacy...
  44423. ctx.showHidden = opts;
  44424. } else if (opts) {
  44425. // got an "options" object
  44426. exports._extend(ctx, opts);
  44427. }
  44428. // set default options
  44429. if (isUndefined(ctx.showHidden)) ctx.showHidden = false;
  44430. if (isUndefined(ctx.depth)) ctx.depth = 2;
  44431. if (isUndefined(ctx.colors)) ctx.colors = false;
  44432. if (isUndefined(ctx.customInspect)) ctx.customInspect = true;
  44433. if (ctx.colors) ctx.stylize = stylizeWithColor;
  44434. return formatValue(ctx, obj, ctx.depth);
  44435. }
  44436. exports.inspect = inspect;
  44437. // http://en.wikipedia.org/wiki/ANSI_escape_code#graphics
  44438. inspect.colors = {
  44439. 'bold' : [1, 22],
  44440. 'italic' : [3, 23],
  44441. 'underline' : [4, 24],
  44442. 'inverse' : [7, 27],
  44443. 'white' : [37, 39],
  44444. 'grey' : [90, 39],
  44445. 'black' : [30, 39],
  44446. 'blue' : [34, 39],
  44447. 'cyan' : [36, 39],
  44448. 'green' : [32, 39],
  44449. 'magenta' : [35, 39],
  44450. 'red' : [31, 39],
  44451. 'yellow' : [33, 39]
  44452. };
  44453. // Don't use 'blue' not visible on cmd.exe
  44454. inspect.styles = {
  44455. 'special': 'cyan',
  44456. 'number': 'yellow',
  44457. 'boolean': 'yellow',
  44458. 'undefined': 'grey',
  44459. 'null': 'bold',
  44460. 'string': 'green',
  44461. 'date': 'magenta',
  44462. // "name": intentionally not styling
  44463. 'regexp': 'red'
  44464. };
  44465. function stylizeWithColor(str, styleType) {
  44466. var style = inspect.styles[styleType];
  44467. if (style) {
  44468. return '\u001b[' + inspect.colors[style][0] + 'm' + str +
  44469. '\u001b[' + inspect.colors[style][1] + 'm';
  44470. } else {
  44471. return str;
  44472. }
  44473. }
  44474. function stylizeNoColor(str, styleType) {
  44475. return str;
  44476. }
  44477. function arrayToHash(array) {
  44478. var hash = {};
  44479. array.forEach(function(val, idx) {
  44480. hash[val] = true;
  44481. });
  44482. return hash;
  44483. }
  44484. function formatValue(ctx, value, recurseTimes) {
  44485. // Provide a hook for user-specified inspect functions.
  44486. // Check that value is an object with an inspect function on it
  44487. if (ctx.customInspect &&
  44488. value &&
  44489. isFunction(value.inspect) &&
  44490. // Filter out the util module, it's inspect function is special
  44491. value.inspect !== exports.inspect &&
  44492. // Also filter out any prototype objects using the circular check.
  44493. !(value.constructor && value.constructor.prototype === value)) {
  44494. var ret = value.inspect(recurseTimes, ctx);
  44495. if (!isString(ret)) {
  44496. ret = formatValue(ctx, ret, recurseTimes);
  44497. }
  44498. return ret;
  44499. }
  44500. // Primitive types cannot have properties
  44501. var primitive = formatPrimitive(ctx, value);
  44502. if (primitive) {
  44503. return primitive;
  44504. }
  44505. // Look up the keys of the object.
  44506. var keys = Object.keys(value);
  44507. var visibleKeys = arrayToHash(keys);
  44508. if (ctx.showHidden) {
  44509. keys = Object.getOwnPropertyNames(value);
  44510. }
  44511. // IE doesn't make error fields non-enumerable
  44512. // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx
  44513. if (isError(value)
  44514. && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) {
  44515. return formatError(value);
  44516. }
  44517. // Some type of object without properties can be shortcutted.
  44518. if (keys.length === 0) {
  44519. if (isFunction(value)) {
  44520. var name = value.name ? ': ' + value.name : '';
  44521. return ctx.stylize('[Function' + name + ']', 'special');
  44522. }
  44523. if (isRegExp(value)) {
  44524. return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
  44525. }
  44526. if (isDate(value)) {
  44527. return ctx.stylize(Date.prototype.toString.call(value), 'date');
  44528. }
  44529. if (isError(value)) {
  44530. return formatError(value);
  44531. }
  44532. }
  44533. var base = '', array = false, braces = ['{', '}'];
  44534. // Make Array say that they are Array
  44535. if (isArray(value)) {
  44536. array = true;
  44537. braces = ['[', ']'];
  44538. }
  44539. // Make functions say that they are functions
  44540. if (isFunction(value)) {
  44541. var n = value.name ? ': ' + value.name : '';
  44542. base = ' [Function' + n + ']';
  44543. }
  44544. // Make RegExps say that they are RegExps
  44545. if (isRegExp(value)) {
  44546. base = ' ' + RegExp.prototype.toString.call(value);
  44547. }
  44548. // Make dates with properties first say the date
  44549. if (isDate(value)) {
  44550. base = ' ' + Date.prototype.toUTCString.call(value);
  44551. }
  44552. // Make error with message first say the error
  44553. if (isError(value)) {
  44554. base = ' ' + formatError(value);
  44555. }
  44556. if (keys.length === 0 && (!array || value.length == 0)) {
  44557. return braces[0] + base + braces[1];
  44558. }
  44559. if (recurseTimes < 0) {
  44560. if (isRegExp(value)) {
  44561. return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
  44562. } else {
  44563. return ctx.stylize('[Object]', 'special');
  44564. }
  44565. }
  44566. ctx.seen.push(value);
  44567. var output;
  44568. if (array) {
  44569. output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);
  44570. } else {
  44571. output = keys.map(function(key) {
  44572. return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);
  44573. });
  44574. }
  44575. ctx.seen.pop();
  44576. return reduceToSingleString(output, base, braces);
  44577. }
  44578. function formatPrimitive(ctx, value) {
  44579. if (isUndefined(value))
  44580. return ctx.stylize('undefined', 'undefined');
  44581. if (isString(value)) {
  44582. var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '')
  44583. .replace(/'/g, "\\'")
  44584. .replace(/\\"/g, '"') + '\'';
  44585. return ctx.stylize(simple, 'string');
  44586. }
  44587. if (isNumber(value))
  44588. return ctx.stylize('' + value, 'number');
  44589. if (isBoolean(value))
  44590. return ctx.stylize('' + value, 'boolean');
  44591. // For some reason typeof null is "object", so special case here.
  44592. if (isNull(value))
  44593. return ctx.stylize('null', 'null');
  44594. }
  44595. function formatError(value) {
  44596. return '[' + Error.prototype.toString.call(value) + ']';
  44597. }
  44598. function formatArray(ctx, value, recurseTimes, visibleKeys, keys) {
  44599. var output = [];
  44600. for (var i = 0, l = value.length; i < l; ++i) {
  44601. if (hasOwnProperty(value, String(i))) {
  44602. output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
  44603. String(i), true));
  44604. } else {
  44605. output.push('');
  44606. }
  44607. }
  44608. keys.forEach(function(key) {
  44609. if (!key.match(/^\d+$/)) {
  44610. output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
  44611. key, true));
  44612. }
  44613. });
  44614. return output;
  44615. }
  44616. function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {
  44617. var name, str, desc;
  44618. desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] };
  44619. if (desc.get) {
  44620. if (desc.set) {
  44621. str = ctx.stylize('[Getter/Setter]', 'special');
  44622. } else {
  44623. str = ctx.stylize('[Getter]', 'special');
  44624. }
  44625. } else {
  44626. if (desc.set) {
  44627. str = ctx.stylize('[Setter]', 'special');
  44628. }
  44629. }
  44630. if (!hasOwnProperty(visibleKeys, key)) {
  44631. name = '[' + key + ']';
  44632. }
  44633. if (!str) {
  44634. if (ctx.seen.indexOf(desc.value) < 0) {
  44635. if (isNull(recurseTimes)) {
  44636. str = formatValue(ctx, desc.value, null);
  44637. } else {
  44638. str = formatValue(ctx, desc.value, recurseTimes - 1);
  44639. }
  44640. if (str.indexOf('\n') > -1) {
  44641. if (array) {
  44642. str = str.split('\n').map(function(line) {
  44643. return ' ' + line;
  44644. }).join('\n').substr(2);
  44645. } else {
  44646. str = '\n' + str.split('\n').map(function(line) {
  44647. return ' ' + line;
  44648. }).join('\n');
  44649. }
  44650. }
  44651. } else {
  44652. str = ctx.stylize('[Circular]', 'special');
  44653. }
  44654. }
  44655. if (isUndefined(name)) {
  44656. if (array && key.match(/^\d+$/)) {
  44657. return str;
  44658. }
  44659. name = JSON.stringify('' + key);
  44660. if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) {
  44661. name = name.substr(1, name.length - 2);
  44662. name = ctx.stylize(name, 'name');
  44663. } else {
  44664. name = name.replace(/'/g, "\\'")
  44665. .replace(/\\"/g, '"')
  44666. .replace(/(^"|"$)/g, "'");
  44667. name = ctx.stylize(name, 'string');
  44668. }
  44669. }
  44670. return name + ': ' + str;
  44671. }
  44672. function reduceToSingleString(output, base, braces) {
  44673. var length = output.reduce(function(prev, cur) {
  44674. if (cur.indexOf('\n') >= 0) ;
  44675. return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1;
  44676. }, 0);
  44677. if (length > 60) {
  44678. return braces[0] +
  44679. (base === '' ? '' : base + '\n ') +
  44680. ' ' +
  44681. output.join(',\n ') +
  44682. ' ' +
  44683. braces[1];
  44684. }
  44685. return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];
  44686. }
  44687. // NOTE: These type checking functions intentionally don't use `instanceof`
  44688. // because it is fragile and can be easily faked with `Object.create()`.
  44689. function isArray(ar) {
  44690. return Array.isArray(ar);
  44691. }
  44692. exports.isArray = isArray;
  44693. function isBoolean(arg) {
  44694. return typeof arg === 'boolean';
  44695. }
  44696. exports.isBoolean = isBoolean;
  44697. function isNull(arg) {
  44698. return arg === null;
  44699. }
  44700. exports.isNull = isNull;
  44701. function isNullOrUndefined(arg) {
  44702. return arg == null;
  44703. }
  44704. exports.isNullOrUndefined = isNullOrUndefined;
  44705. function isNumber(arg) {
  44706. return typeof arg === 'number';
  44707. }
  44708. exports.isNumber = isNumber;
  44709. function isString(arg) {
  44710. return typeof arg === 'string';
  44711. }
  44712. exports.isString = isString;
  44713. function isSymbol(arg) {
  44714. return typeof arg === 'symbol';
  44715. }
  44716. exports.isSymbol = isSymbol;
  44717. function isUndefined(arg) {
  44718. return arg === void 0;
  44719. }
  44720. exports.isUndefined = isUndefined;
  44721. function isRegExp(re) {
  44722. return isObject(re) && objectToString(re) === '[object RegExp]';
  44723. }
  44724. exports.isRegExp = isRegExp;
  44725. function isObject(arg) {
  44726. return typeof arg === 'object' && arg !== null;
  44727. }
  44728. exports.isObject = isObject;
  44729. function isDate(d) {
  44730. return isObject(d) && objectToString(d) === '[object Date]';
  44731. }
  44732. exports.isDate = isDate;
  44733. function isError(e) {
  44734. return isObject(e) &&
  44735. (objectToString(e) === '[object Error]' || e instanceof Error);
  44736. }
  44737. exports.isError = isError;
  44738. function isFunction(arg) {
  44739. return typeof arg === 'function';
  44740. }
  44741. exports.isFunction = isFunction;
  44742. function isPrimitive(arg) {
  44743. return arg === null ||
  44744. typeof arg === 'boolean' ||
  44745. typeof arg === 'number' ||
  44746. typeof arg === 'string' ||
  44747. typeof arg === 'symbol' || // ES6 symbol
  44748. typeof arg === 'undefined';
  44749. }
  44750. exports.isPrimitive = isPrimitive;
  44751. exports.isBuffer = isBuffer;
  44752. function objectToString(o) {
  44753. return Object.prototype.toString.call(o);
  44754. }
  44755. function pad(n) {
  44756. return n < 10 ? '0' + n.toString(10) : n.toString(10);
  44757. }
  44758. var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep',
  44759. 'Oct', 'Nov', 'Dec'];
  44760. // 26 Feb 16:19:34
  44761. function timestamp() {
  44762. var d = new Date();
  44763. var time = [pad(d.getHours()),
  44764. pad(d.getMinutes()),
  44765. pad(d.getSeconds())].join(':');
  44766. return [d.getDate(), months[d.getMonth()], time].join(' ');
  44767. }
  44768. // log is just a thin wrapper to console.log that prepends a timestamp
  44769. exports.log = function() {
  44770. console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments));
  44771. };
  44772. /**
  44773. * Inherit the prototype methods from one constructor into another.
  44774. *
  44775. * The Function.prototype.inherits from lang.js rewritten as a standalone
  44776. * function (not on Function.prototype). NOTE: If this file is to be loaded
  44777. * during bootstrapping this function needs to be rewritten using some native
  44778. * functions as prototype setup using normal JavaScript does not work as
  44779. * expected during bootstrapping (see mirror.js in r114903).
  44780. *
  44781. * @param {function} ctor Constructor function which needs to inherit the
  44782. * prototype.
  44783. * @param {function} superCtor Constructor function to inherit prototype from.
  44784. */
  44785. exports.inherits = inherits;
  44786. exports._extend = function(origin, add) {
  44787. // Don't do anything if add isn't an object
  44788. if (!add || !isObject(add)) return origin;
  44789. var keys = Object.keys(add);
  44790. var i = keys.length;
  44791. while (i--) {
  44792. origin[keys[i]] = add[keys[i]];
  44793. }
  44794. return origin;
  44795. };
  44796. function hasOwnProperty(obj, prop) {
  44797. return Object.prototype.hasOwnProperty.call(obj, prop);
  44798. }
  44799. });
  44800. var assert_1 = createCommonjsModule(function (module) {
  44801. // compare and isBuffer taken from https://github.com/feross/buffer/blob/680e9e5e488f22aac27599a57dc844a6315928dd/index.js
  44802. // original notice:
  44803. /*!
  44804. * The buffer module from node.js, for the browser.
  44805. *
  44806. * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
  44807. * @license MIT
  44808. */
  44809. function compare(a, b) {
  44810. if (a === b) {
  44811. return 0;
  44812. }
  44813. var x = a.length;
  44814. var y = b.length;
  44815. for (var i = 0, len = Math.min(x, y); i < len; ++i) {
  44816. if (a[i] !== b[i]) {
  44817. x = a[i];
  44818. y = b[i];
  44819. break;
  44820. }
  44821. }
  44822. if (x < y) {
  44823. return -1;
  44824. }
  44825. if (y < x) {
  44826. return 1;
  44827. }
  44828. return 0;
  44829. }
  44830. function isBuffer(b) {
  44831. if (commonjsGlobal.Buffer && typeof commonjsGlobal.Buffer.isBuffer === 'function') {
  44832. return commonjsGlobal.Buffer.isBuffer(b);
  44833. }
  44834. return !!(b != null && b._isBuffer);
  44835. }
  44836. // based on node assert, original notice:
  44837. // NB: The URL to the CommonJS spec is kept just for tradition.
  44838. // node-assert has evolved a lot since then, both in API and behavior.
  44839. // http://wiki.commonjs.org/wiki/Unit_Testing/1.0
  44840. //
  44841. // THIS IS NOT TESTED NOR LIKELY TO WORK OUTSIDE V8!
  44842. //
  44843. // Originally from narwhal.js (http://narwhaljs.org)
  44844. // Copyright (c) 2009 Thomas Robinson <280north.com>
  44845. //
  44846. // Permission is hereby granted, free of charge, to any person obtaining a copy
  44847. // of this software and associated documentation files (the 'Software'), to
  44848. // deal in the Software without restriction, including without limitation the
  44849. // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  44850. // sell copies of the Software, and to permit persons to whom the Software is
  44851. // furnished to do so, subject to the following conditions:
  44852. //
  44853. // The above copyright notice and this permission notice shall be included in
  44854. // all copies or substantial portions of the Software.
  44855. //
  44856. // THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  44857. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  44858. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  44859. // AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
  44860. // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  44861. // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  44862. var hasOwn = Object.prototype.hasOwnProperty;
  44863. var pSlice = Array.prototype.slice;
  44864. var functionsHaveNames = (function () {
  44865. return function foo() {}.name === 'foo';
  44866. }());
  44867. function pToString (obj) {
  44868. return Object.prototype.toString.call(obj);
  44869. }
  44870. function isView(arrbuf) {
  44871. if (isBuffer(arrbuf)) {
  44872. return false;
  44873. }
  44874. if (typeof commonjsGlobal.ArrayBuffer !== 'function') {
  44875. return false;
  44876. }
  44877. if (typeof ArrayBuffer.isView === 'function') {
  44878. return ArrayBuffer.isView(arrbuf);
  44879. }
  44880. if (!arrbuf) {
  44881. return false;
  44882. }
  44883. if (arrbuf instanceof DataView) {
  44884. return true;
  44885. }
  44886. if (arrbuf.buffer && arrbuf.buffer instanceof ArrayBuffer) {
  44887. return true;
  44888. }
  44889. return false;
  44890. }
  44891. // 1. The assert module provides functions that throw
  44892. // AssertionError's when particular conditions are not met. The
  44893. // assert module must conform to the following interface.
  44894. var assert = module.exports = ok;
  44895. // 2. The AssertionError is defined in assert.
  44896. // new assert.AssertionError({ message: message,
  44897. // actual: actual,
  44898. // expected: expected })
  44899. var regex = /\s*function\s+([^\(\s]*)\s*/;
  44900. // based on https://github.com/ljharb/function.prototype.name/blob/adeeeec8bfcc6068b187d7d9fb3d5bb1d3a30899/implementation.js
  44901. function getName(func) {
  44902. if (!util.isFunction(func)) {
  44903. return;
  44904. }
  44905. if (functionsHaveNames) {
  44906. return func.name;
  44907. }
  44908. var str = func.toString();
  44909. var match = str.match(regex);
  44910. return match && match[1];
  44911. }
  44912. assert.AssertionError = function AssertionError(options) {
  44913. this.name = 'AssertionError';
  44914. this.actual = options.actual;
  44915. this.expected = options.expected;
  44916. this.operator = options.operator;
  44917. if (options.message) {
  44918. this.message = options.message;
  44919. this.generatedMessage = false;
  44920. } else {
  44921. this.message = getMessage(this);
  44922. this.generatedMessage = true;
  44923. }
  44924. var stackStartFunction = options.stackStartFunction || fail;
  44925. if (Error.captureStackTrace) {
  44926. Error.captureStackTrace(this, stackStartFunction);
  44927. } else {
  44928. // non v8 browsers so we can have a stacktrace
  44929. var err = new Error();
  44930. if (err.stack) {
  44931. var out = err.stack;
  44932. // try to strip useless frames
  44933. var fn_name = getName(stackStartFunction);
  44934. var idx = out.indexOf('\n' + fn_name);
  44935. if (idx >= 0) {
  44936. // once we have located the function frame
  44937. // we need to strip out everything before it (and its line)
  44938. var next_line = out.indexOf('\n', idx + 1);
  44939. out = out.substring(next_line + 1);
  44940. }
  44941. this.stack = out;
  44942. }
  44943. }
  44944. };
  44945. // assert.AssertionError instanceof Error
  44946. util.inherits(assert.AssertionError, Error);
  44947. function truncate(s, n) {
  44948. if (typeof s === 'string') {
  44949. return s.length < n ? s : s.slice(0, n);
  44950. } else {
  44951. return s;
  44952. }
  44953. }
  44954. function inspect(something) {
  44955. if (functionsHaveNames || !util.isFunction(something)) {
  44956. return util.inspect(something);
  44957. }
  44958. var rawname = getName(something);
  44959. var name = rawname ? ': ' + rawname : '';
  44960. return '[Function' + name + ']';
  44961. }
  44962. function getMessage(self) {
  44963. return truncate(inspect(self.actual), 128) + ' ' +
  44964. self.operator + ' ' +
  44965. truncate(inspect(self.expected), 128);
  44966. }
  44967. // At present only the three keys mentioned above are used and
  44968. // understood by the spec. Implementations or sub modules can pass
  44969. // other keys to the AssertionError's constructor - they will be
  44970. // ignored.
  44971. // 3. All of the following functions must throw an AssertionError
  44972. // when a corresponding condition is not met, with a message that
  44973. // may be undefined if not provided. All assertion methods provide
  44974. // both the actual and expected values to the assertion error for
  44975. // display purposes.
  44976. function fail(actual, expected, message, operator, stackStartFunction) {
  44977. throw new assert.AssertionError({
  44978. message: message,
  44979. actual: actual,
  44980. expected: expected,
  44981. operator: operator,
  44982. stackStartFunction: stackStartFunction
  44983. });
  44984. }
  44985. // EXTENSION! allows for well behaved errors defined elsewhere.
  44986. assert.fail = fail;
  44987. // 4. Pure assertion tests whether a value is truthy, as determined
  44988. // by !!guard.
  44989. // assert.ok(guard, message_opt);
  44990. // This statement is equivalent to assert.equal(true, !!guard,
  44991. // message_opt);. To test strictly for the value true, use
  44992. // assert.strictEqual(true, guard, message_opt);.
  44993. function ok(value, message) {
  44994. if (!value) fail(value, true, message, '==', assert.ok);
  44995. }
  44996. assert.ok = ok;
  44997. // 5. The equality assertion tests shallow, coercive equality with
  44998. // ==.
  44999. // assert.equal(actual, expected, message_opt);
  45000. assert.equal = function equal(actual, expected, message) {
  45001. if (actual != expected) fail(actual, expected, message, '==', assert.equal);
  45002. };
  45003. // 6. The non-equality assertion tests for whether two objects are not equal
  45004. // with != assert.notEqual(actual, expected, message_opt);
  45005. assert.notEqual = function notEqual(actual, expected, message) {
  45006. if (actual == expected) {
  45007. fail(actual, expected, message, '!=', assert.notEqual);
  45008. }
  45009. };
  45010. // 7. The equivalence assertion tests a deep equality relation.
  45011. // assert.deepEqual(actual, expected, message_opt);
  45012. assert.deepEqual = function deepEqual(actual, expected, message) {
  45013. if (!_deepEqual(actual, expected, false)) {
  45014. fail(actual, expected, message, 'deepEqual', assert.deepEqual);
  45015. }
  45016. };
  45017. assert.deepStrictEqual = function deepStrictEqual(actual, expected, message) {
  45018. if (!_deepEqual(actual, expected, true)) {
  45019. fail(actual, expected, message, 'deepStrictEqual', assert.deepStrictEqual);
  45020. }
  45021. };
  45022. function _deepEqual(actual, expected, strict, memos) {
  45023. // 7.1. All identical values are equivalent, as determined by ===.
  45024. if (actual === expected) {
  45025. return true;
  45026. } else if (isBuffer(actual) && isBuffer(expected)) {
  45027. return compare(actual, expected) === 0;
  45028. // 7.2. If the expected value is a Date object, the actual value is
  45029. // equivalent if it is also a Date object that refers to the same time.
  45030. } else if (util.isDate(actual) && util.isDate(expected)) {
  45031. return actual.getTime() === expected.getTime();
  45032. // 7.3 If the expected value is a RegExp object, the actual value is
  45033. // equivalent if it is also a RegExp object with the same source and
  45034. // properties (`global`, `multiline`, `lastIndex`, `ignoreCase`).
  45035. } else if (util.isRegExp(actual) && util.isRegExp(expected)) {
  45036. return actual.source === expected.source &&
  45037. actual.global === expected.global &&
  45038. actual.multiline === expected.multiline &&
  45039. actual.lastIndex === expected.lastIndex &&
  45040. actual.ignoreCase === expected.ignoreCase;
  45041. // 7.4. Other pairs that do not both pass typeof value == 'object',
  45042. // equivalence is determined by ==.
  45043. } else if ((actual === null || typeof actual !== 'object') &&
  45044. (expected === null || typeof expected !== 'object')) {
  45045. return strict ? actual === expected : actual == expected;
  45046. // If both values are instances of typed arrays, wrap their underlying
  45047. // ArrayBuffers in a Buffer each to increase performance
  45048. // This optimization requires the arrays to have the same type as checked by
  45049. // Object.prototype.toString (aka pToString). Never perform binary
  45050. // comparisons for Float*Arrays, though, since e.g. +0 === -0 but their
  45051. // bit patterns are not identical.
  45052. } else if (isView(actual) && isView(expected) &&
  45053. pToString(actual) === pToString(expected) &&
  45054. !(actual instanceof Float32Array ||
  45055. actual instanceof Float64Array)) {
  45056. return compare(new Uint8Array(actual.buffer),
  45057. new Uint8Array(expected.buffer)) === 0;
  45058. // 7.5 For all other Object pairs, including Array objects, equivalence is
  45059. // determined by having the same number of owned properties (as verified
  45060. // with Object.prototype.hasOwnProperty.call), the same set of keys
  45061. // (although not necessarily the same order), equivalent values for every
  45062. // corresponding key, and an identical 'prototype' property. Note: this
  45063. // accounts for both named and indexed properties on Arrays.
  45064. } else if (isBuffer(actual) !== isBuffer(expected)) {
  45065. return false;
  45066. } else {
  45067. memos = memos || {actual: [], expected: []};
  45068. var actualIndex = memos.actual.indexOf(actual);
  45069. if (actualIndex !== -1) {
  45070. if (actualIndex === memos.expected.indexOf(expected)) {
  45071. return true;
  45072. }
  45073. }
  45074. memos.actual.push(actual);
  45075. memos.expected.push(expected);
  45076. return objEquiv(actual, expected, strict, memos);
  45077. }
  45078. }
  45079. function isArguments(object) {
  45080. return Object.prototype.toString.call(object) == '[object Arguments]';
  45081. }
  45082. function objEquiv(a, b, strict, actualVisitedObjects) {
  45083. if (a === null || a === undefined || b === null || b === undefined)
  45084. return false;
  45085. // if one is a primitive, the other must be same
  45086. if (util.isPrimitive(a) || util.isPrimitive(b))
  45087. return a === b;
  45088. if (strict && Object.getPrototypeOf(a) !== Object.getPrototypeOf(b))
  45089. return false;
  45090. var aIsArgs = isArguments(a);
  45091. var bIsArgs = isArguments(b);
  45092. if ((aIsArgs && !bIsArgs) || (!aIsArgs && bIsArgs))
  45093. return false;
  45094. if (aIsArgs) {
  45095. a = pSlice.call(a);
  45096. b = pSlice.call(b);
  45097. return _deepEqual(a, b, strict);
  45098. }
  45099. var ka = objectKeys(a);
  45100. var kb = objectKeys(b);
  45101. var key, i;
  45102. // having the same number of owned properties (keys incorporates
  45103. // hasOwnProperty)
  45104. if (ka.length !== kb.length)
  45105. return false;
  45106. //the same set of keys (although not necessarily the same order),
  45107. ka.sort();
  45108. kb.sort();
  45109. //~~~cheap key test
  45110. for (i = ka.length - 1; i >= 0; i--) {
  45111. if (ka[i] !== kb[i])
  45112. return false;
  45113. }
  45114. //equivalent values for every corresponding key, and
  45115. //~~~possibly expensive deep test
  45116. for (i = ka.length - 1; i >= 0; i--) {
  45117. key = ka[i];
  45118. if (!_deepEqual(a[key], b[key], strict, actualVisitedObjects))
  45119. return false;
  45120. }
  45121. return true;
  45122. }
  45123. // 8. The non-equivalence assertion tests for any deep inequality.
  45124. // assert.notDeepEqual(actual, expected, message_opt);
  45125. assert.notDeepEqual = function notDeepEqual(actual, expected, message) {
  45126. if (_deepEqual(actual, expected, false)) {
  45127. fail(actual, expected, message, 'notDeepEqual', assert.notDeepEqual);
  45128. }
  45129. };
  45130. assert.notDeepStrictEqual = notDeepStrictEqual;
  45131. function notDeepStrictEqual(actual, expected, message) {
  45132. if (_deepEqual(actual, expected, true)) {
  45133. fail(actual, expected, message, 'notDeepStrictEqual', notDeepStrictEqual);
  45134. }
  45135. }
  45136. // 9. The strict equality assertion tests strict equality, as determined by ===.
  45137. // assert.strictEqual(actual, expected, message_opt);
  45138. assert.strictEqual = function strictEqual(actual, expected, message) {
  45139. if (actual !== expected) {
  45140. fail(actual, expected, message, '===', assert.strictEqual);
  45141. }
  45142. };
  45143. // 10. The strict non-equality assertion tests for strict inequality, as
  45144. // determined by !==. assert.notStrictEqual(actual, expected, message_opt);
  45145. assert.notStrictEqual = function notStrictEqual(actual, expected, message) {
  45146. if (actual === expected) {
  45147. fail(actual, expected, message, '!==', assert.notStrictEqual);
  45148. }
  45149. };
  45150. function expectedException(actual, expected) {
  45151. if (!actual || !expected) {
  45152. return false;
  45153. }
  45154. if (Object.prototype.toString.call(expected) == '[object RegExp]') {
  45155. return expected.test(actual);
  45156. }
  45157. try {
  45158. if (actual instanceof expected) {
  45159. return true;
  45160. }
  45161. } catch (e) {
  45162. // Ignore. The instanceof check doesn't work for arrow functions.
  45163. }
  45164. if (Error.isPrototypeOf(expected)) {
  45165. return false;
  45166. }
  45167. return expected.call({}, actual) === true;
  45168. }
  45169. function _tryBlock(block) {
  45170. var error;
  45171. try {
  45172. block();
  45173. } catch (e) {
  45174. error = e;
  45175. }
  45176. return error;
  45177. }
  45178. function _throws(shouldThrow, block, expected, message) {
  45179. var actual;
  45180. if (typeof block !== 'function') {
  45181. throw new TypeError('"block" argument must be a function');
  45182. }
  45183. if (typeof expected === 'string') {
  45184. message = expected;
  45185. expected = null;
  45186. }
  45187. actual = _tryBlock(block);
  45188. message = (expected && expected.name ? ' (' + expected.name + ').' : '.') +
  45189. (message ? ' ' + message : '.');
  45190. if (shouldThrow && !actual) {
  45191. fail(actual, expected, 'Missing expected exception' + message);
  45192. }
  45193. var userProvidedMessage = typeof message === 'string';
  45194. var isUnwantedException = !shouldThrow && util.isError(actual);
  45195. var isUnexpectedException = !shouldThrow && actual && !expected;
  45196. if ((isUnwantedException &&
  45197. userProvidedMessage &&
  45198. expectedException(actual, expected)) ||
  45199. isUnexpectedException) {
  45200. fail(actual, expected, 'Got unwanted exception' + message);
  45201. }
  45202. if ((shouldThrow && actual && expected &&
  45203. !expectedException(actual, expected)) || (!shouldThrow && actual)) {
  45204. throw actual;
  45205. }
  45206. }
  45207. // 11. Expected to throw an error:
  45208. // assert.throws(block, Error_opt, message_opt);
  45209. assert.throws = function(block, /*optional*/error, /*optional*/message) {
  45210. _throws(true, block, error, message);
  45211. };
  45212. // EXTENSION! This is annoying to write outside this module.
  45213. assert.doesNotThrow = function(block, /*optional*/error, /*optional*/message) {
  45214. _throws(false, block, error, message);
  45215. };
  45216. assert.ifError = function(err) { if (err) throw err; };
  45217. // Expose a strict only variant of assert
  45218. function strict(value, message) {
  45219. if (!value) fail(value, true, message, '==', strict);
  45220. }
  45221. assert.strict = objectAssign(strict, assert, {
  45222. equal: assert.strictEqual,
  45223. deepEqual: assert.deepStrictEqual,
  45224. notEqual: assert.notStrictEqual,
  45225. notDeepEqual: assert.notDeepStrictEqual
  45226. });
  45227. assert.strict.strict = assert.strict;
  45228. var objectKeys = Object.keys || function (obj) {
  45229. var keys = [];
  45230. for (var key in obj) {
  45231. if (hasOwn.call(obj, key)) keys.push(key);
  45232. }
  45233. return keys;
  45234. };
  45235. });
  45236. function posix(path) {
  45237. return path.charAt(0) === '/';
  45238. }
  45239. function win32(path) {
  45240. // https://github.com/nodejs/node/blob/b3fcc245fb25539909ef1d5eaa01dbf92e168633/lib/path.js#L56
  45241. var splitDeviceRe = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/;
  45242. var result = splitDeviceRe.exec(path);
  45243. var device = result[1] || '';
  45244. var isUnc = Boolean(device && device.charAt(1) !== ':');
  45245. // UNC paths are always absolute
  45246. return Boolean(result[2] || isUnc);
  45247. }
  45248. var pathIsAbsolute = process.platform === 'win32' ? win32 : posix;
  45249. var posix_1 = posix;
  45250. var win32_1 = win32;
  45251. pathIsAbsolute.posix = posix_1;
  45252. pathIsAbsolute.win32 = win32_1;
  45253. var alphasort_1 = alphasort;
  45254. var alphasorti_1 = alphasorti;
  45255. var setopts_1 = setopts$2;
  45256. var ownProp_1 = ownProp$2;
  45257. var makeAbs_1 = makeAbs;
  45258. var finish_1 = finish;
  45259. var mark_1 = mark;
  45260. var isIgnored_1 = isIgnored$2;
  45261. var childrenIgnored_1 = childrenIgnored$2;
  45262. function ownProp$2 (obj, field) {
  45263. return Object.prototype.hasOwnProperty.call(obj, field)
  45264. }
  45265. var Minimatch = minimatch_1.Minimatch;
  45266. function alphasorti (a, b) {
  45267. return a.toLowerCase().localeCompare(b.toLowerCase())
  45268. }
  45269. function alphasort (a, b) {
  45270. return a.localeCompare(b)
  45271. }
  45272. function setupIgnores (self, options) {
  45273. self.ignore = options.ignore || [];
  45274. if (!Array.isArray(self.ignore))
  45275. self.ignore = [self.ignore];
  45276. if (self.ignore.length) {
  45277. self.ignore = self.ignore.map(ignoreMap);
  45278. }
  45279. }
  45280. // ignore patterns are always in dot:true mode.
  45281. function ignoreMap (pattern) {
  45282. var gmatcher = null;
  45283. if (pattern.slice(-3) === '/**') {
  45284. var gpattern = pattern.replace(/(\/\*\*)+$/, '');
  45285. gmatcher = new Minimatch(gpattern, { dot: true });
  45286. }
  45287. return {
  45288. matcher: new Minimatch(pattern, { dot: true }),
  45289. gmatcher: gmatcher
  45290. }
  45291. }
  45292. function setopts$2 (self, pattern, options) {
  45293. if (!options)
  45294. options = {};
  45295. // base-matching: just use globstar for that.
  45296. if (options.matchBase && -1 === pattern.indexOf("/")) {
  45297. if (options.noglobstar) {
  45298. throw new Error("base matching requires globstar")
  45299. }
  45300. pattern = "**/" + pattern;
  45301. }
  45302. self.silent = !!options.silent;
  45303. self.pattern = pattern;
  45304. self.strict = options.strict !== false;
  45305. self.realpath = !!options.realpath;
  45306. self.realpathCache = options.realpathCache || Object.create(null);
  45307. self.follow = !!options.follow;
  45308. self.dot = !!options.dot;
  45309. self.mark = !!options.mark;
  45310. self.nodir = !!options.nodir;
  45311. if (self.nodir)
  45312. self.mark = true;
  45313. self.sync = !!options.sync;
  45314. self.nounique = !!options.nounique;
  45315. self.nonull = !!options.nonull;
  45316. self.nosort = !!options.nosort;
  45317. self.nocase = !!options.nocase;
  45318. self.stat = !!options.stat;
  45319. self.noprocess = !!options.noprocess;
  45320. self.absolute = !!options.absolute;
  45321. self.maxLength = options.maxLength || Infinity;
  45322. self.cache = options.cache || Object.create(null);
  45323. self.statCache = options.statCache || Object.create(null);
  45324. self.symlinks = options.symlinks || Object.create(null);
  45325. setupIgnores(self, options);
  45326. self.changedCwd = false;
  45327. var cwd = process.cwd();
  45328. if (!ownProp$2(options, "cwd"))
  45329. self.cwd = cwd;
  45330. else {
  45331. self.cwd = path$5.resolve(options.cwd);
  45332. self.changedCwd = self.cwd !== cwd;
  45333. }
  45334. self.root = options.root || path$5.resolve(self.cwd, "/");
  45335. self.root = path$5.resolve(self.root);
  45336. if (process.platform === "win32")
  45337. self.root = self.root.replace(/\\/g, "/");
  45338. // TODO: is an absolute `cwd` supposed to be resolved against `root`?
  45339. // e.g. { cwd: '/test', root: __dirname } === path.join(__dirname, '/test')
  45340. self.cwdAbs = pathIsAbsolute(self.cwd) ? self.cwd : makeAbs(self, self.cwd);
  45341. if (process.platform === "win32")
  45342. self.cwdAbs = self.cwdAbs.replace(/\\/g, "/");
  45343. self.nomount = !!options.nomount;
  45344. // disable comments and negation in Minimatch.
  45345. // Note that they are not supported in Glob itself anyway.
  45346. options.nonegate = true;
  45347. options.nocomment = true;
  45348. self.minimatch = new Minimatch(pattern, options);
  45349. self.options = self.minimatch.options;
  45350. }
  45351. function finish (self) {
  45352. var nou = self.nounique;
  45353. var all = nou ? [] : Object.create(null);
  45354. for (var i = 0, l = self.matches.length; i < l; i ++) {
  45355. var matches = self.matches[i];
  45356. if (!matches || Object.keys(matches).length === 0) {
  45357. if (self.nonull) {
  45358. // do like the shell, and spit out the literal glob
  45359. var literal = self.minimatch.globSet[i];
  45360. if (nou)
  45361. all.push(literal);
  45362. else
  45363. all[literal] = true;
  45364. }
  45365. } else {
  45366. // had matches
  45367. var m = Object.keys(matches);
  45368. if (nou)
  45369. all.push.apply(all, m);
  45370. else
  45371. m.forEach(function (m) {
  45372. all[m] = true;
  45373. });
  45374. }
  45375. }
  45376. if (!nou)
  45377. all = Object.keys(all);
  45378. if (!self.nosort)
  45379. all = all.sort(self.nocase ? alphasorti : alphasort);
  45380. // at *some* point we statted all of these
  45381. if (self.mark) {
  45382. for (var i = 0; i < all.length; i++) {
  45383. all[i] = self._mark(all[i]);
  45384. }
  45385. if (self.nodir) {
  45386. all = all.filter(function (e) {
  45387. var notDir = !(/\/$/.test(e));
  45388. var c = self.cache[e] || self.cache[makeAbs(self, e)];
  45389. if (notDir && c)
  45390. notDir = c !== 'DIR' && !Array.isArray(c);
  45391. return notDir
  45392. });
  45393. }
  45394. }
  45395. if (self.ignore.length)
  45396. all = all.filter(function(m) {
  45397. return !isIgnored$2(self, m)
  45398. });
  45399. self.found = all;
  45400. }
  45401. function mark (self, p) {
  45402. var abs = makeAbs(self, p);
  45403. var c = self.cache[abs];
  45404. var m = p;
  45405. if (c) {
  45406. var isDir = c === 'DIR' || Array.isArray(c);
  45407. var slash = p.slice(-1) === '/';
  45408. if (isDir && !slash)
  45409. m += '/';
  45410. else if (!isDir && slash)
  45411. m = m.slice(0, -1);
  45412. if (m !== p) {
  45413. var mabs = makeAbs(self, m);
  45414. self.statCache[mabs] = self.statCache[abs];
  45415. self.cache[mabs] = self.cache[abs];
  45416. }
  45417. }
  45418. return m
  45419. }
  45420. // lotta situps...
  45421. function makeAbs (self, f) {
  45422. var abs = f;
  45423. if (f.charAt(0) === '/') {
  45424. abs = path$5.join(self.root, f);
  45425. } else if (pathIsAbsolute(f) || f === '') {
  45426. abs = f;
  45427. } else if (self.changedCwd) {
  45428. abs = path$5.resolve(self.cwd, f);
  45429. } else {
  45430. abs = path$5.resolve(f);
  45431. }
  45432. if (process.platform === 'win32')
  45433. abs = abs.replace(/\\/g, '/');
  45434. return abs
  45435. }
  45436. // Return true, if pattern ends with globstar '**', for the accompanying parent directory.
  45437. // Ex:- If node_modules/** is the pattern, add 'node_modules' to ignore list along with it's contents
  45438. function isIgnored$2 (self, path) {
  45439. if (!self.ignore.length)
  45440. return false
  45441. return self.ignore.some(function(item) {
  45442. return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))
  45443. })
  45444. }
  45445. function childrenIgnored$2 (self, path) {
  45446. if (!self.ignore.length)
  45447. return false
  45448. return self.ignore.some(function(item) {
  45449. return !!(item.gmatcher && item.gmatcher.match(path))
  45450. })
  45451. }
  45452. var common = {
  45453. alphasort: alphasort_1,
  45454. alphasorti: alphasorti_1,
  45455. setopts: setopts_1,
  45456. ownProp: ownProp_1,
  45457. makeAbs: makeAbs_1,
  45458. finish: finish_1,
  45459. mark: mark_1,
  45460. isIgnored: isIgnored_1,
  45461. childrenIgnored: childrenIgnored_1
  45462. };
  45463. var sync = globSync;
  45464. globSync.GlobSync = GlobSync$1;
  45465. var setopts$1 = common.setopts;
  45466. var ownProp$1 = common.ownProp;
  45467. var childrenIgnored$1 = common.childrenIgnored;
  45468. var isIgnored$1 = common.isIgnored;
  45469. function globSync (pattern, options) {
  45470. if (typeof options === 'function' || arguments.length === 3)
  45471. throw new TypeError('callback provided to sync glob\n'+
  45472. 'See: https://github.com/isaacs/node-glob/issues/167')
  45473. return new GlobSync$1(pattern, options).found
  45474. }
  45475. function GlobSync$1 (pattern, options) {
  45476. if (!pattern)
  45477. throw new Error('must provide pattern')
  45478. if (typeof options === 'function' || arguments.length === 3)
  45479. throw new TypeError('callback provided to sync glob\n'+
  45480. 'See: https://github.com/isaacs/node-glob/issues/167')
  45481. if (!(this instanceof GlobSync$1))
  45482. return new GlobSync$1(pattern, options)
  45483. setopts$1(this, pattern, options);
  45484. if (this.noprocess)
  45485. return this
  45486. var n = this.minimatch.set.length;
  45487. this.matches = new Array(n);
  45488. for (var i = 0; i < n; i ++) {
  45489. this._process(this.minimatch.set[i], i, false);
  45490. }
  45491. this._finish();
  45492. }
  45493. GlobSync$1.prototype._finish = function () {
  45494. assert_1(this instanceof GlobSync$1);
  45495. if (this.realpath) {
  45496. var self = this;
  45497. this.matches.forEach(function (matchset, index) {
  45498. var set = self.matches[index] = Object.create(null);
  45499. for (var p in matchset) {
  45500. try {
  45501. p = self._makeAbs(p);
  45502. var real = fs_realpath.realpathSync(p, self.realpathCache);
  45503. set[real] = true;
  45504. } catch (er) {
  45505. if (er.syscall === 'stat')
  45506. set[self._makeAbs(p)] = true;
  45507. else
  45508. throw er
  45509. }
  45510. }
  45511. });
  45512. }
  45513. common.finish(this);
  45514. };
  45515. GlobSync$1.prototype._process = function (pattern, index, inGlobStar) {
  45516. assert_1(this instanceof GlobSync$1);
  45517. // Get the first [n] parts of pattern that are all strings.
  45518. var n = 0;
  45519. while (typeof pattern[n] === 'string') {
  45520. n ++;
  45521. }
  45522. // now n is the index of the first one that is *not* a string.
  45523. // See if there's anything else
  45524. var prefix;
  45525. switch (n) {
  45526. // if not, then this is rather simple
  45527. case pattern.length:
  45528. this._processSimple(pattern.join('/'), index);
  45529. return
  45530. case 0:
  45531. // pattern *starts* with some non-trivial item.
  45532. // going to readdir(cwd), but not include the prefix in matches.
  45533. prefix = null;
  45534. break
  45535. default:
  45536. // pattern has some string bits in the front.
  45537. // whatever it starts with, whether that's 'absolute' like /foo/bar,
  45538. // or 'relative' like '../baz'
  45539. prefix = pattern.slice(0, n).join('/');
  45540. break
  45541. }
  45542. var remain = pattern.slice(n);
  45543. // get the list of entries.
  45544. var read;
  45545. if (prefix === null)
  45546. read = '.';
  45547. else if (pathIsAbsolute(prefix) || pathIsAbsolute(pattern.join('/'))) {
  45548. if (!prefix || !pathIsAbsolute(prefix))
  45549. prefix = '/' + prefix;
  45550. read = prefix;
  45551. } else
  45552. read = prefix;
  45553. var abs = this._makeAbs(read);
  45554. //if ignored, skip processing
  45555. if (childrenIgnored$1(this, read))
  45556. return
  45557. var isGlobStar = remain[0] === minimatch_1.GLOBSTAR;
  45558. if (isGlobStar)
  45559. this._processGlobStar(prefix, read, abs, remain, index, inGlobStar);
  45560. else
  45561. this._processReaddir(prefix, read, abs, remain, index, inGlobStar);
  45562. };
  45563. GlobSync$1.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar) {
  45564. var entries = this._readdir(abs, inGlobStar);
  45565. // if the abs isn't a dir, then nothing can match!
  45566. if (!entries)
  45567. return
  45568. // It will only match dot entries if it starts with a dot, or if
  45569. // dot is set. Stuff like @(.foo|.bar) isn't allowed.
  45570. var pn = remain[0];
  45571. var negate = !!this.minimatch.negate;
  45572. var rawGlob = pn._glob;
  45573. var dotOk = this.dot || rawGlob.charAt(0) === '.';
  45574. var matchedEntries = [];
  45575. for (var i = 0; i < entries.length; i++) {
  45576. var e = entries[i];
  45577. if (e.charAt(0) !== '.' || dotOk) {
  45578. var m;
  45579. if (negate && !prefix) {
  45580. m = !e.match(pn);
  45581. } else {
  45582. m = e.match(pn);
  45583. }
  45584. if (m)
  45585. matchedEntries.push(e);
  45586. }
  45587. }
  45588. var len = matchedEntries.length;
  45589. // If there are no matched entries, then nothing matches.
  45590. if (len === 0)
  45591. return
  45592. // if this is the last remaining pattern bit, then no need for
  45593. // an additional stat *unless* the user has specified mark or
  45594. // stat explicitly. We know they exist, since readdir returned
  45595. // them.
  45596. if (remain.length === 1 && !this.mark && !this.stat) {
  45597. if (!this.matches[index])
  45598. this.matches[index] = Object.create(null);
  45599. for (var i = 0; i < len; i ++) {
  45600. var e = matchedEntries[i];
  45601. if (prefix) {
  45602. if (prefix.slice(-1) !== '/')
  45603. e = prefix + '/' + e;
  45604. else
  45605. e = prefix + e;
  45606. }
  45607. if (e.charAt(0) === '/' && !this.nomount) {
  45608. e = path$5.join(this.root, e);
  45609. }
  45610. this._emitMatch(index, e);
  45611. }
  45612. // This was the last one, and no stats were needed
  45613. return
  45614. }
  45615. // now test all matched entries as stand-ins for that part
  45616. // of the pattern.
  45617. remain.shift();
  45618. for (var i = 0; i < len; i ++) {
  45619. var e = matchedEntries[i];
  45620. var newPattern;
  45621. if (prefix)
  45622. newPattern = [prefix, e];
  45623. else
  45624. newPattern = [e];
  45625. this._process(newPattern.concat(remain), index, inGlobStar);
  45626. }
  45627. };
  45628. GlobSync$1.prototype._emitMatch = function (index, e) {
  45629. if (isIgnored$1(this, e))
  45630. return
  45631. var abs = this._makeAbs(e);
  45632. if (this.mark)
  45633. e = this._mark(e);
  45634. if (this.absolute) {
  45635. e = abs;
  45636. }
  45637. if (this.matches[index][e])
  45638. return
  45639. if (this.nodir) {
  45640. var c = this.cache[abs];
  45641. if (c === 'DIR' || Array.isArray(c))
  45642. return
  45643. }
  45644. this.matches[index][e] = true;
  45645. if (this.stat)
  45646. this._stat(e);
  45647. };
  45648. GlobSync$1.prototype._readdirInGlobStar = function (abs) {
  45649. // follow all symlinked directories forever
  45650. // just proceed as if this is a non-globstar situation
  45651. if (this.follow)
  45652. return this._readdir(abs, false)
  45653. var entries;
  45654. var lstat;
  45655. try {
  45656. lstat = fs$3.lstatSync(abs);
  45657. } catch (er) {
  45658. if (er.code === 'ENOENT') {
  45659. // lstat failed, doesn't exist
  45660. return null
  45661. }
  45662. }
  45663. var isSym = lstat && lstat.isSymbolicLink();
  45664. this.symlinks[abs] = isSym;
  45665. // If it's not a symlink or a dir, then it's definitely a regular file.
  45666. // don't bother doing a readdir in that case.
  45667. if (!isSym && lstat && !lstat.isDirectory())
  45668. this.cache[abs] = 'FILE';
  45669. else
  45670. entries = this._readdir(abs, false);
  45671. return entries
  45672. };
  45673. GlobSync$1.prototype._readdir = function (abs, inGlobStar) {
  45674. if (inGlobStar && !ownProp$1(this.symlinks, abs))
  45675. return this._readdirInGlobStar(abs)
  45676. if (ownProp$1(this.cache, abs)) {
  45677. var c = this.cache[abs];
  45678. if (!c || c === 'FILE')
  45679. return null
  45680. if (Array.isArray(c))
  45681. return c
  45682. }
  45683. try {
  45684. return this._readdirEntries(abs, fs$3.readdirSync(abs))
  45685. } catch (er) {
  45686. this._readdirError(abs, er);
  45687. return null
  45688. }
  45689. };
  45690. GlobSync$1.prototype._readdirEntries = function (abs, entries) {
  45691. // if we haven't asked to stat everything, then just
  45692. // assume that everything in there exists, so we can avoid
  45693. // having to stat it a second time.
  45694. if (!this.mark && !this.stat) {
  45695. for (var i = 0; i < entries.length; i ++) {
  45696. var e = entries[i];
  45697. if (abs === '/')
  45698. e = abs + e;
  45699. else
  45700. e = abs + '/' + e;
  45701. this.cache[e] = true;
  45702. }
  45703. }
  45704. this.cache[abs] = entries;
  45705. // mark and cache dir-ness
  45706. return entries
  45707. };
  45708. GlobSync$1.prototype._readdirError = function (f, er) {
  45709. // handle errors, and cache the information
  45710. switch (er.code) {
  45711. case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205
  45712. case 'ENOTDIR': // totally normal. means it *does* exist.
  45713. var abs = this._makeAbs(f);
  45714. this.cache[abs] = 'FILE';
  45715. if (abs === this.cwdAbs) {
  45716. var error = new Error(er.code + ' invalid cwd ' + this.cwd);
  45717. error.path = this.cwd;
  45718. error.code = er.code;
  45719. throw error
  45720. }
  45721. break
  45722. case 'ENOENT': // not terribly unusual
  45723. case 'ELOOP':
  45724. case 'ENAMETOOLONG':
  45725. case 'UNKNOWN':
  45726. this.cache[this._makeAbs(f)] = false;
  45727. break
  45728. default: // some unusual error. Treat as failure.
  45729. this.cache[this._makeAbs(f)] = false;
  45730. if (this.strict)
  45731. throw er
  45732. if (!this.silent)
  45733. console.error('glob error', er);
  45734. break
  45735. }
  45736. };
  45737. GlobSync$1.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar) {
  45738. var entries = this._readdir(abs, inGlobStar);
  45739. // no entries means not a dir, so it can never have matches
  45740. // foo.txt/** doesn't match foo.txt
  45741. if (!entries)
  45742. return
  45743. // test without the globstar, and with every child both below
  45744. // and replacing the globstar.
  45745. var remainWithoutGlobStar = remain.slice(1);
  45746. var gspref = prefix ? [ prefix ] : [];
  45747. var noGlobStar = gspref.concat(remainWithoutGlobStar);
  45748. // the noGlobStar pattern exits the inGlobStar state
  45749. this._process(noGlobStar, index, false);
  45750. var len = entries.length;
  45751. var isSym = this.symlinks[abs];
  45752. // If it's a symlink, and we're in a globstar, then stop
  45753. if (isSym && inGlobStar)
  45754. return
  45755. for (var i = 0; i < len; i++) {
  45756. var e = entries[i];
  45757. if (e.charAt(0) === '.' && !this.dot)
  45758. continue
  45759. // these two cases enter the inGlobStar state
  45760. var instead = gspref.concat(entries[i], remainWithoutGlobStar);
  45761. this._process(instead, index, true);
  45762. var below = gspref.concat(entries[i], remain);
  45763. this._process(below, index, true);
  45764. }
  45765. };
  45766. GlobSync$1.prototype._processSimple = function (prefix, index) {
  45767. // XXX review this. Shouldn't it be doing the mounting etc
  45768. // before doing stat? kinda weird?
  45769. var exists = this._stat(prefix);
  45770. if (!this.matches[index])
  45771. this.matches[index] = Object.create(null);
  45772. // If it doesn't exist, then just mark the lack of results
  45773. if (!exists)
  45774. return
  45775. if (prefix && pathIsAbsolute(prefix) && !this.nomount) {
  45776. var trail = /[\/\\]$/.test(prefix);
  45777. if (prefix.charAt(0) === '/') {
  45778. prefix = path$5.join(this.root, prefix);
  45779. } else {
  45780. prefix = path$5.resolve(this.root, prefix);
  45781. if (trail)
  45782. prefix += '/';
  45783. }
  45784. }
  45785. if (process.platform === 'win32')
  45786. prefix = prefix.replace(/\\/g, '/');
  45787. // Mark this as a match
  45788. this._emitMatch(index, prefix);
  45789. };
  45790. // Returns either 'DIR', 'FILE', or false
  45791. GlobSync$1.prototype._stat = function (f) {
  45792. var abs = this._makeAbs(f);
  45793. var needDir = f.slice(-1) === '/';
  45794. if (f.length > this.maxLength)
  45795. return false
  45796. if (!this.stat && ownProp$1(this.cache, abs)) {
  45797. var c = this.cache[abs];
  45798. if (Array.isArray(c))
  45799. c = 'DIR';
  45800. // It exists, but maybe not how we need it
  45801. if (!needDir || c === 'DIR')
  45802. return c
  45803. if (needDir && c === 'FILE')
  45804. return false
  45805. // otherwise we have to stat, because maybe c=true
  45806. // if we know it exists, but not what it is.
  45807. }
  45808. var stat = this.statCache[abs];
  45809. if (!stat) {
  45810. var lstat;
  45811. try {
  45812. lstat = fs$3.lstatSync(abs);
  45813. } catch (er) {
  45814. if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) {
  45815. this.statCache[abs] = false;
  45816. return false
  45817. }
  45818. }
  45819. if (lstat && lstat.isSymbolicLink()) {
  45820. try {
  45821. stat = fs$3.statSync(abs);
  45822. } catch (er) {
  45823. stat = lstat;
  45824. }
  45825. } else {
  45826. stat = lstat;
  45827. }
  45828. }
  45829. this.statCache[abs] = stat;
  45830. var c = true;
  45831. if (stat)
  45832. c = stat.isDirectory() ? 'DIR' : 'FILE';
  45833. this.cache[abs] = this.cache[abs] || c;
  45834. if (needDir && c === 'FILE')
  45835. return false
  45836. return c
  45837. };
  45838. GlobSync$1.prototype._mark = function (p) {
  45839. return common.mark(this, p)
  45840. };
  45841. GlobSync$1.prototype._makeAbs = function (f) {
  45842. return common.makeAbs(this, f)
  45843. };
  45844. // Returns a wrapper function that returns a wrapped callback
  45845. // The wrapper function should do some stuff, and return a
  45846. // presumably different callback function.
  45847. // This makes sure that own properties are retained, so that
  45848. // decorations and such are not lost along the way.
  45849. var wrappy_1 = wrappy;
  45850. function wrappy (fn, cb) {
  45851. if (fn && cb) return wrappy(fn)(cb)
  45852. if (typeof fn !== 'function')
  45853. throw new TypeError('need wrapper function')
  45854. Object.keys(fn).forEach(function (k) {
  45855. wrapper[k] = fn[k];
  45856. });
  45857. return wrapper
  45858. function wrapper() {
  45859. var args = new Array(arguments.length);
  45860. for (var i = 0; i < args.length; i++) {
  45861. args[i] = arguments[i];
  45862. }
  45863. var ret = fn.apply(this, args);
  45864. var cb = args[args.length-1];
  45865. if (typeof ret === 'function' && ret !== cb) {
  45866. Object.keys(cb).forEach(function (k) {
  45867. ret[k] = cb[k];
  45868. });
  45869. }
  45870. return ret
  45871. }
  45872. }
  45873. var once_1 = wrappy_1(once);
  45874. var strict = wrappy_1(onceStrict);
  45875. once.proto = once(function () {
  45876. Object.defineProperty(Function.prototype, 'once', {
  45877. value: function () {
  45878. return once(this)
  45879. },
  45880. configurable: true
  45881. });
  45882. Object.defineProperty(Function.prototype, 'onceStrict', {
  45883. value: function () {
  45884. return onceStrict(this)
  45885. },
  45886. configurable: true
  45887. });
  45888. });
  45889. function once (fn) {
  45890. var f = function () {
  45891. if (f.called) return f.value
  45892. f.called = true;
  45893. return f.value = fn.apply(this, arguments)
  45894. };
  45895. f.called = false;
  45896. return f
  45897. }
  45898. function onceStrict (fn) {
  45899. var f = function () {
  45900. if (f.called)
  45901. throw new Error(f.onceError)
  45902. f.called = true;
  45903. return f.value = fn.apply(this, arguments)
  45904. };
  45905. var name = fn.name || 'Function wrapped with `once`';
  45906. f.onceError = name + " shouldn't be called more than once";
  45907. f.called = false;
  45908. return f
  45909. }
  45910. once_1.strict = strict;
  45911. var reqs = Object.create(null);
  45912. var inflight_1 = wrappy_1(inflight);
  45913. function inflight (key, cb) {
  45914. if (reqs[key]) {
  45915. reqs[key].push(cb);
  45916. return null
  45917. } else {
  45918. reqs[key] = [cb];
  45919. return makeres(key)
  45920. }
  45921. }
  45922. function makeres (key) {
  45923. return once_1(function RES () {
  45924. var cbs = reqs[key];
  45925. var len = cbs.length;
  45926. var args = slice(arguments);
  45927. // XXX It's somewhat ambiguous whether a new callback added in this
  45928. // pass should be queued for later execution if something in the
  45929. // list of callbacks throws, or if it should just be discarded.
  45930. // However, it's such an edge case that it hardly matters, and either
  45931. // choice is likely as surprising as the other.
  45932. // As it happens, we do go ahead and schedule it for later execution.
  45933. try {
  45934. for (var i = 0; i < len; i++) {
  45935. cbs[i].apply(null, args);
  45936. }
  45937. } finally {
  45938. if (cbs.length > len) {
  45939. // added more in the interim.
  45940. // de-zalgo, just in case, but don't call again.
  45941. cbs.splice(0, len);
  45942. process.nextTick(function () {
  45943. RES.apply(null, args);
  45944. });
  45945. } else {
  45946. delete reqs[key];
  45947. }
  45948. }
  45949. })
  45950. }
  45951. function slice (args) {
  45952. var length = args.length;
  45953. var array = [];
  45954. for (var i = 0; i < length; i++) array[i] = args[i];
  45955. return array
  45956. }
  45957. // Approach:
  45958. //
  45959. // 1. Get the minimatch set
  45960. // 2. For each pattern in the set, PROCESS(pattern, false)
  45961. // 3. Store matches per-set, then uniq them
  45962. //
  45963. // PROCESS(pattern, inGlobStar)
  45964. // Get the first [n] items from pattern that are all strings
  45965. // Join these together. This is PREFIX.
  45966. // If there is no more remaining, then stat(PREFIX) and
  45967. // add to matches if it succeeds. END.
  45968. //
  45969. // If inGlobStar and PREFIX is symlink and points to dir
  45970. // set ENTRIES = []
  45971. // else readdir(PREFIX) as ENTRIES
  45972. // If fail, END
  45973. //
  45974. // with ENTRIES
  45975. // If pattern[n] is GLOBSTAR
  45976. // // handle the case where the globstar match is empty
  45977. // // by pruning it out, and testing the resulting pattern
  45978. // PROCESS(pattern[0..n] + pattern[n+1 .. $], false)
  45979. // // handle other cases.
  45980. // for ENTRY in ENTRIES (not dotfiles)
  45981. // // attach globstar + tail onto the entry
  45982. // // Mark that this entry is a globstar match
  45983. // PROCESS(pattern[0..n] + ENTRY + pattern[n .. $], true)
  45984. //
  45985. // else // not globstar
  45986. // for ENTRY in ENTRIES (not dotfiles, unless pattern[n] is dot)
  45987. // Test ENTRY against pattern[n]
  45988. // If fails, continue
  45989. // If passes, PROCESS(pattern[0..n] + item + pattern[n+1 .. $])
  45990. //
  45991. // Caveat:
  45992. // Cache all stats and readdirs results to minimize syscall. Since all
  45993. // we ever care about is existence and directory-ness, we can just keep
  45994. // `true` for files, and [children,...] for directories, or `false` for
  45995. // things that don't exist.
  45996. var glob_1 = glob;
  45997. var EE = events.EventEmitter;
  45998. var setopts = common.setopts;
  45999. var ownProp = common.ownProp;
  46000. var childrenIgnored = common.childrenIgnored;
  46001. var isIgnored = common.isIgnored;
  46002. function glob (pattern, options, cb) {
  46003. if (typeof options === 'function') cb = options, options = {};
  46004. if (!options) options = {};
  46005. if (options.sync) {
  46006. if (cb)
  46007. throw new TypeError('callback provided to sync glob')
  46008. return sync(pattern, options)
  46009. }
  46010. return new Glob(pattern, options, cb)
  46011. }
  46012. glob.sync = sync;
  46013. var GlobSync = glob.GlobSync = sync.GlobSync;
  46014. // old api surface
  46015. glob.glob = glob;
  46016. function extend (origin, add) {
  46017. if (add === null || typeof add !== 'object') {
  46018. return origin
  46019. }
  46020. var keys = Object.keys(add);
  46021. var i = keys.length;
  46022. while (i--) {
  46023. origin[keys[i]] = add[keys[i]];
  46024. }
  46025. return origin
  46026. }
  46027. glob.hasMagic = function (pattern, options_) {
  46028. var options = extend({}, options_);
  46029. options.noprocess = true;
  46030. var g = new Glob(pattern, options);
  46031. var set = g.minimatch.set;
  46032. if (!pattern)
  46033. return false
  46034. if (set.length > 1)
  46035. return true
  46036. for (var j = 0; j < set[0].length; j++) {
  46037. if (typeof set[0][j] !== 'string')
  46038. return true
  46039. }
  46040. return false
  46041. };
  46042. glob.Glob = Glob;
  46043. inherits$1(Glob, EE);
  46044. function Glob (pattern, options, cb) {
  46045. if (typeof options === 'function') {
  46046. cb = options;
  46047. options = null;
  46048. }
  46049. if (options && options.sync) {
  46050. if (cb)
  46051. throw new TypeError('callback provided to sync glob')
  46052. return new GlobSync(pattern, options)
  46053. }
  46054. if (!(this instanceof Glob))
  46055. return new Glob(pattern, options, cb)
  46056. setopts(this, pattern, options);
  46057. this._didRealPath = false;
  46058. // process each pattern in the minimatch set
  46059. var n = this.minimatch.set.length;
  46060. // The matches are stored as {<filename>: true,...} so that
  46061. // duplicates are automagically pruned.
  46062. // Later, we do an Object.keys() on these.
  46063. // Keep them as a list so we can fill in when nonull is set.
  46064. this.matches = new Array(n);
  46065. if (typeof cb === 'function') {
  46066. cb = once_1(cb);
  46067. this.on('error', cb);
  46068. this.on('end', function (matches) {
  46069. cb(null, matches);
  46070. });
  46071. }
  46072. var self = this;
  46073. this._processing = 0;
  46074. this._emitQueue = [];
  46075. this._processQueue = [];
  46076. this.paused = false;
  46077. if (this.noprocess)
  46078. return this
  46079. if (n === 0)
  46080. return done()
  46081. var sync = true;
  46082. for (var i = 0; i < n; i ++) {
  46083. this._process(this.minimatch.set[i], i, false, done);
  46084. }
  46085. sync = false;
  46086. function done () {
  46087. --self._processing;
  46088. if (self._processing <= 0) {
  46089. if (sync) {
  46090. process.nextTick(function () {
  46091. self._finish();
  46092. });
  46093. } else {
  46094. self._finish();
  46095. }
  46096. }
  46097. }
  46098. }
  46099. Glob.prototype._finish = function () {
  46100. assert_1(this instanceof Glob);
  46101. if (this.aborted)
  46102. return
  46103. if (this.realpath && !this._didRealpath)
  46104. return this._realpath()
  46105. common.finish(this);
  46106. this.emit('end', this.found);
  46107. };
  46108. Glob.prototype._realpath = function () {
  46109. if (this._didRealpath)
  46110. return
  46111. this._didRealpath = true;
  46112. var n = this.matches.length;
  46113. if (n === 0)
  46114. return this._finish()
  46115. var self = this;
  46116. for (var i = 0; i < this.matches.length; i++)
  46117. this._realpathSet(i, next);
  46118. function next () {
  46119. if (--n === 0)
  46120. self._finish();
  46121. }
  46122. };
  46123. Glob.prototype._realpathSet = function (index, cb) {
  46124. var matchset = this.matches[index];
  46125. if (!matchset)
  46126. return cb()
  46127. var found = Object.keys(matchset);
  46128. var self = this;
  46129. var n = found.length;
  46130. if (n === 0)
  46131. return cb()
  46132. var set = this.matches[index] = Object.create(null);
  46133. found.forEach(function (p, i) {
  46134. // If there's a problem with the stat, then it means that
  46135. // one or more of the links in the realpath couldn't be
  46136. // resolved. just return the abs value in that case.
  46137. p = self._makeAbs(p);
  46138. fs_realpath.realpath(p, self.realpathCache, function (er, real) {
  46139. if (!er)
  46140. set[real] = true;
  46141. else if (er.syscall === 'stat')
  46142. set[p] = true;
  46143. else
  46144. self.emit('error', er); // srsly wtf right here
  46145. if (--n === 0) {
  46146. self.matches[index] = set;
  46147. cb();
  46148. }
  46149. });
  46150. });
  46151. };
  46152. Glob.prototype._mark = function (p) {
  46153. return common.mark(this, p)
  46154. };
  46155. Glob.prototype._makeAbs = function (f) {
  46156. return common.makeAbs(this, f)
  46157. };
  46158. Glob.prototype.abort = function () {
  46159. this.aborted = true;
  46160. this.emit('abort');
  46161. };
  46162. Glob.prototype.pause = function () {
  46163. if (!this.paused) {
  46164. this.paused = true;
  46165. this.emit('pause');
  46166. }
  46167. };
  46168. Glob.prototype.resume = function () {
  46169. if (this.paused) {
  46170. this.emit('resume');
  46171. this.paused = false;
  46172. if (this._emitQueue.length) {
  46173. var eq = this._emitQueue.slice(0);
  46174. this._emitQueue.length = 0;
  46175. for (var i = 0; i < eq.length; i ++) {
  46176. var e = eq[i];
  46177. this._emitMatch(e[0], e[1]);
  46178. }
  46179. }
  46180. if (this._processQueue.length) {
  46181. var pq = this._processQueue.slice(0);
  46182. this._processQueue.length = 0;
  46183. for (var i = 0; i < pq.length; i ++) {
  46184. var p = pq[i];
  46185. this._processing--;
  46186. this._process(p[0], p[1], p[2], p[3]);
  46187. }
  46188. }
  46189. }
  46190. };
  46191. Glob.prototype._process = function (pattern, index, inGlobStar, cb) {
  46192. assert_1(this instanceof Glob);
  46193. assert_1(typeof cb === 'function');
  46194. if (this.aborted)
  46195. return
  46196. this._processing++;
  46197. if (this.paused) {
  46198. this._processQueue.push([pattern, index, inGlobStar, cb]);
  46199. return
  46200. }
  46201. //console.error('PROCESS %d', this._processing, pattern)
  46202. // Get the first [n] parts of pattern that are all strings.
  46203. var n = 0;
  46204. while (typeof pattern[n] === 'string') {
  46205. n ++;
  46206. }
  46207. // now n is the index of the first one that is *not* a string.
  46208. // see if there's anything else
  46209. var prefix;
  46210. switch (n) {
  46211. // if not, then this is rather simple
  46212. case pattern.length:
  46213. this._processSimple(pattern.join('/'), index, cb);
  46214. return
  46215. case 0:
  46216. // pattern *starts* with some non-trivial item.
  46217. // going to readdir(cwd), but not include the prefix in matches.
  46218. prefix = null;
  46219. break
  46220. default:
  46221. // pattern has some string bits in the front.
  46222. // whatever it starts with, whether that's 'absolute' like /foo/bar,
  46223. // or 'relative' like '../baz'
  46224. prefix = pattern.slice(0, n).join('/');
  46225. break
  46226. }
  46227. var remain = pattern.slice(n);
  46228. // get the list of entries.
  46229. var read;
  46230. if (prefix === null)
  46231. read = '.';
  46232. else if (pathIsAbsolute(prefix) || pathIsAbsolute(pattern.join('/'))) {
  46233. if (!prefix || !pathIsAbsolute(prefix))
  46234. prefix = '/' + prefix;
  46235. read = prefix;
  46236. } else
  46237. read = prefix;
  46238. var abs = this._makeAbs(read);
  46239. //if ignored, skip _processing
  46240. if (childrenIgnored(this, read))
  46241. return cb()
  46242. var isGlobStar = remain[0] === minimatch_1.GLOBSTAR;
  46243. if (isGlobStar)
  46244. this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb);
  46245. else
  46246. this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb);
  46247. };
  46248. Glob.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar, cb) {
  46249. var self = this;
  46250. this._readdir(abs, inGlobStar, function (er, entries) {
  46251. return self._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb)
  46252. });
  46253. };
  46254. Glob.prototype._processReaddir2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) {
  46255. // if the abs isn't a dir, then nothing can match!
  46256. if (!entries)
  46257. return cb()
  46258. // It will only match dot entries if it starts with a dot, or if
  46259. // dot is set. Stuff like @(.foo|.bar) isn't allowed.
  46260. var pn = remain[0];
  46261. var negate = !!this.minimatch.negate;
  46262. var rawGlob = pn._glob;
  46263. var dotOk = this.dot || rawGlob.charAt(0) === '.';
  46264. var matchedEntries = [];
  46265. for (var i = 0; i < entries.length; i++) {
  46266. var e = entries[i];
  46267. if (e.charAt(0) !== '.' || dotOk) {
  46268. var m;
  46269. if (negate && !prefix) {
  46270. m = !e.match(pn);
  46271. } else {
  46272. m = e.match(pn);
  46273. }
  46274. if (m)
  46275. matchedEntries.push(e);
  46276. }
  46277. }
  46278. //console.error('prd2', prefix, entries, remain[0]._glob, matchedEntries)
  46279. var len = matchedEntries.length;
  46280. // If there are no matched entries, then nothing matches.
  46281. if (len === 0)
  46282. return cb()
  46283. // if this is the last remaining pattern bit, then no need for
  46284. // an additional stat *unless* the user has specified mark or
  46285. // stat explicitly. We know they exist, since readdir returned
  46286. // them.
  46287. if (remain.length === 1 && !this.mark && !this.stat) {
  46288. if (!this.matches[index])
  46289. this.matches[index] = Object.create(null);
  46290. for (var i = 0; i < len; i ++) {
  46291. var e = matchedEntries[i];
  46292. if (prefix) {
  46293. if (prefix !== '/')
  46294. e = prefix + '/' + e;
  46295. else
  46296. e = prefix + e;
  46297. }
  46298. if (e.charAt(0) === '/' && !this.nomount) {
  46299. e = path$5.join(this.root, e);
  46300. }
  46301. this._emitMatch(index, e);
  46302. }
  46303. // This was the last one, and no stats were needed
  46304. return cb()
  46305. }
  46306. // now test all matched entries as stand-ins for that part
  46307. // of the pattern.
  46308. remain.shift();
  46309. for (var i = 0; i < len; i ++) {
  46310. var e = matchedEntries[i];
  46311. if (prefix) {
  46312. if (prefix !== '/')
  46313. e = prefix + '/' + e;
  46314. else
  46315. e = prefix + e;
  46316. }
  46317. this._process([e].concat(remain), index, inGlobStar, cb);
  46318. }
  46319. cb();
  46320. };
  46321. Glob.prototype._emitMatch = function (index, e) {
  46322. if (this.aborted)
  46323. return
  46324. if (isIgnored(this, e))
  46325. return
  46326. if (this.paused) {
  46327. this._emitQueue.push([index, e]);
  46328. return
  46329. }
  46330. var abs = pathIsAbsolute(e) ? e : this._makeAbs(e);
  46331. if (this.mark)
  46332. e = this._mark(e);
  46333. if (this.absolute)
  46334. e = abs;
  46335. if (this.matches[index][e])
  46336. return
  46337. if (this.nodir) {
  46338. var c = this.cache[abs];
  46339. if (c === 'DIR' || Array.isArray(c))
  46340. return
  46341. }
  46342. this.matches[index][e] = true;
  46343. var st = this.statCache[abs];
  46344. if (st)
  46345. this.emit('stat', e, st);
  46346. this.emit('match', e);
  46347. };
  46348. Glob.prototype._readdirInGlobStar = function (abs, cb) {
  46349. if (this.aborted)
  46350. return
  46351. // follow all symlinked directories forever
  46352. // just proceed as if this is a non-globstar situation
  46353. if (this.follow)
  46354. return this._readdir(abs, false, cb)
  46355. var lstatkey = 'lstat\0' + abs;
  46356. var self = this;
  46357. var lstatcb = inflight_1(lstatkey, lstatcb_);
  46358. if (lstatcb)
  46359. fs$3.lstat(abs, lstatcb);
  46360. function lstatcb_ (er, lstat) {
  46361. if (er && er.code === 'ENOENT')
  46362. return cb()
  46363. var isSym = lstat && lstat.isSymbolicLink();
  46364. self.symlinks[abs] = isSym;
  46365. // If it's not a symlink or a dir, then it's definitely a regular file.
  46366. // don't bother doing a readdir in that case.
  46367. if (!isSym && lstat && !lstat.isDirectory()) {
  46368. self.cache[abs] = 'FILE';
  46369. cb();
  46370. } else
  46371. self._readdir(abs, false, cb);
  46372. }
  46373. };
  46374. Glob.prototype._readdir = function (abs, inGlobStar, cb) {
  46375. if (this.aborted)
  46376. return
  46377. cb = inflight_1('readdir\0'+abs+'\0'+inGlobStar, cb);
  46378. if (!cb)
  46379. return
  46380. //console.error('RD %j %j', +inGlobStar, abs)
  46381. if (inGlobStar && !ownProp(this.symlinks, abs))
  46382. return this._readdirInGlobStar(abs, cb)
  46383. if (ownProp(this.cache, abs)) {
  46384. var c = this.cache[abs];
  46385. if (!c || c === 'FILE')
  46386. return cb()
  46387. if (Array.isArray(c))
  46388. return cb(null, c)
  46389. }
  46390. fs$3.readdir(abs, readdirCb(this, abs, cb));
  46391. };
  46392. function readdirCb (self, abs, cb) {
  46393. return function (er, entries) {
  46394. if (er)
  46395. self._readdirError(abs, er, cb);
  46396. else
  46397. self._readdirEntries(abs, entries, cb);
  46398. }
  46399. }
  46400. Glob.prototype._readdirEntries = function (abs, entries, cb) {
  46401. if (this.aborted)
  46402. return
  46403. // if we haven't asked to stat everything, then just
  46404. // assume that everything in there exists, so we can avoid
  46405. // having to stat it a second time.
  46406. if (!this.mark && !this.stat) {
  46407. for (var i = 0; i < entries.length; i ++) {
  46408. var e = entries[i];
  46409. if (abs === '/')
  46410. e = abs + e;
  46411. else
  46412. e = abs + '/' + e;
  46413. this.cache[e] = true;
  46414. }
  46415. }
  46416. this.cache[abs] = entries;
  46417. return cb(null, entries)
  46418. };
  46419. Glob.prototype._readdirError = function (f, er, cb) {
  46420. if (this.aborted)
  46421. return
  46422. // handle errors, and cache the information
  46423. switch (er.code) {
  46424. case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205
  46425. case 'ENOTDIR': // totally normal. means it *does* exist.
  46426. var abs = this._makeAbs(f);
  46427. this.cache[abs] = 'FILE';
  46428. if (abs === this.cwdAbs) {
  46429. var error = new Error(er.code + ' invalid cwd ' + this.cwd);
  46430. error.path = this.cwd;
  46431. error.code = er.code;
  46432. this.emit('error', error);
  46433. this.abort();
  46434. }
  46435. break
  46436. case 'ENOENT': // not terribly unusual
  46437. case 'ELOOP':
  46438. case 'ENAMETOOLONG':
  46439. case 'UNKNOWN':
  46440. this.cache[this._makeAbs(f)] = false;
  46441. break
  46442. default: // some unusual error. Treat as failure.
  46443. this.cache[this._makeAbs(f)] = false;
  46444. if (this.strict) {
  46445. this.emit('error', er);
  46446. // If the error is handled, then we abort
  46447. // if not, we threw out of here
  46448. this.abort();
  46449. }
  46450. if (!this.silent)
  46451. console.error('glob error', er);
  46452. break
  46453. }
  46454. return cb()
  46455. };
  46456. Glob.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar, cb) {
  46457. var self = this;
  46458. this._readdir(abs, inGlobStar, function (er, entries) {
  46459. self._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb);
  46460. });
  46461. };
  46462. Glob.prototype._processGlobStar2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) {
  46463. //console.error('pgs2', prefix, remain[0], entries)
  46464. // no entries means not a dir, so it can never have matches
  46465. // foo.txt/** doesn't match foo.txt
  46466. if (!entries)
  46467. return cb()
  46468. // test without the globstar, and with every child both below
  46469. // and replacing the globstar.
  46470. var remainWithoutGlobStar = remain.slice(1);
  46471. var gspref = prefix ? [ prefix ] : [];
  46472. var noGlobStar = gspref.concat(remainWithoutGlobStar);
  46473. // the noGlobStar pattern exits the inGlobStar state
  46474. this._process(noGlobStar, index, false, cb);
  46475. var isSym = this.symlinks[abs];
  46476. var len = entries.length;
  46477. // If it's a symlink, and we're in a globstar, then stop
  46478. if (isSym && inGlobStar)
  46479. return cb()
  46480. for (var i = 0; i < len; i++) {
  46481. var e = entries[i];
  46482. if (e.charAt(0) === '.' && !this.dot)
  46483. continue
  46484. // these two cases enter the inGlobStar state
  46485. var instead = gspref.concat(entries[i], remainWithoutGlobStar);
  46486. this._process(instead, index, true, cb);
  46487. var below = gspref.concat(entries[i], remain);
  46488. this._process(below, index, true, cb);
  46489. }
  46490. cb();
  46491. };
  46492. Glob.prototype._processSimple = function (prefix, index, cb) {
  46493. // XXX review this. Shouldn't it be doing the mounting etc
  46494. // before doing stat? kinda weird?
  46495. var self = this;
  46496. this._stat(prefix, function (er, exists) {
  46497. self._processSimple2(prefix, index, er, exists, cb);
  46498. });
  46499. };
  46500. Glob.prototype._processSimple2 = function (prefix, index, er, exists, cb) {
  46501. //console.error('ps2', prefix, exists)
  46502. if (!this.matches[index])
  46503. this.matches[index] = Object.create(null);
  46504. // If it doesn't exist, then just mark the lack of results
  46505. if (!exists)
  46506. return cb()
  46507. if (prefix && pathIsAbsolute(prefix) && !this.nomount) {
  46508. var trail = /[\/\\]$/.test(prefix);
  46509. if (prefix.charAt(0) === '/') {
  46510. prefix = path$5.join(this.root, prefix);
  46511. } else {
  46512. prefix = path$5.resolve(this.root, prefix);
  46513. if (trail)
  46514. prefix += '/';
  46515. }
  46516. }
  46517. if (process.platform === 'win32')
  46518. prefix = prefix.replace(/\\/g, '/');
  46519. // Mark this as a match
  46520. this._emitMatch(index, prefix);
  46521. cb();
  46522. };
  46523. // Returns either 'DIR', 'FILE', or false
  46524. Glob.prototype._stat = function (f, cb) {
  46525. var abs = this._makeAbs(f);
  46526. var needDir = f.slice(-1) === '/';
  46527. if (f.length > this.maxLength)
  46528. return cb()
  46529. if (!this.stat && ownProp(this.cache, abs)) {
  46530. var c = this.cache[abs];
  46531. if (Array.isArray(c))
  46532. c = 'DIR';
  46533. // It exists, but maybe not how we need it
  46534. if (!needDir || c === 'DIR')
  46535. return cb(null, c)
  46536. if (needDir && c === 'FILE')
  46537. return cb()
  46538. // otherwise we have to stat, because maybe c=true
  46539. // if we know it exists, but not what it is.
  46540. }
  46541. var stat = this.statCache[abs];
  46542. if (stat !== undefined) {
  46543. if (stat === false)
  46544. return cb(null, stat)
  46545. else {
  46546. var type = stat.isDirectory() ? 'DIR' : 'FILE';
  46547. if (needDir && type === 'FILE')
  46548. return cb()
  46549. else
  46550. return cb(null, type, stat)
  46551. }
  46552. }
  46553. var self = this;
  46554. var statcb = inflight_1('stat\0' + abs, lstatcb_);
  46555. if (statcb)
  46556. fs$3.lstat(abs, statcb);
  46557. function lstatcb_ (er, lstat) {
  46558. if (lstat && lstat.isSymbolicLink()) {
  46559. // If it's a symlink, then treat it as the target, unless
  46560. // the target does not exist, then treat it as a file.
  46561. return fs$3.stat(abs, function (er, stat) {
  46562. if (er)
  46563. self._stat2(f, abs, null, lstat, cb);
  46564. else
  46565. self._stat2(f, abs, er, stat, cb);
  46566. })
  46567. } else {
  46568. self._stat2(f, abs, er, lstat, cb);
  46569. }
  46570. }
  46571. };
  46572. Glob.prototype._stat2 = function (f, abs, er, stat, cb) {
  46573. if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) {
  46574. this.statCache[abs] = false;
  46575. return cb()
  46576. }
  46577. var needDir = f.slice(-1) === '/';
  46578. this.statCache[abs] = stat;
  46579. if (abs.slice(-1) === '/' && stat && !stat.isDirectory())
  46580. return cb(null, false, stat)
  46581. var c = true;
  46582. if (stat)
  46583. c = stat.isDirectory() ? 'DIR' : 'FILE';
  46584. this.cache[abs] = this.cache[abs] || c;
  46585. if (needDir && c === 'FILE')
  46586. return cb()
  46587. return cb(null, c, stat)
  46588. };
  46589. var peerDependencies = {
  46590. rollup: "^2.22.0"
  46591. };
  46592. const PROXY_SUFFIX = '?commonjs-proxy';
  46593. const getProxyId = (id) => `\0${id}${PROXY_SUFFIX}`;
  46594. const getIdFromProxyId = (proxyId) => proxyId.slice(1, -PROXY_SUFFIX.length);
  46595. const EXTERNAL_SUFFIX = '?commonjs-external';
  46596. const getExternalProxyId = (id) => `\0${id}${EXTERNAL_SUFFIX}`;
  46597. const getIdFromExternalProxyId = (proxyId) => proxyId.slice(1, -EXTERNAL_SUFFIX.length);
  46598. const VIRTUAL_PATH_BASE = '/$$rollup_base$$';
  46599. const getVirtualPathForDynamicRequirePath = (path, commonDir) => {
  46600. if (path.startsWith(commonDir)) return VIRTUAL_PATH_BASE + path.slice(commonDir.length);
  46601. return path;
  46602. };
  46603. const DYNAMIC_REGISTER_PREFIX = '\0commonjs-dynamic-register:';
  46604. const DYNAMIC_JSON_PREFIX = '\0commonjs-dynamic-json:';
  46605. const DYNAMIC_PACKAGES_ID = '\0commonjs-dynamic-packages';
  46606. const HELPERS_ID = '\0commonjsHelpers.js';
  46607. // `x['default']` is used instead of `x.default` for backward compatibility with ES3 browsers.
  46608. // Minifiers like uglify will usually transpile it back if compatibility with ES3 is not enabled.
  46609. // This will no longer be necessary once Rollup switches to ES6 output, likely
  46610. // in Rollup 3
  46611. // The "hasOwnProperty" call in "getDefaultExportFromCjs" is technically not
  46612. // needed, but for consumers that use Rollup's old interop pattern, it will fix
  46613. // rollup/rollup-plugin-commonjs#224
  46614. // We should remove it once Rollup core and this plugin are updated to not use
  46615. // this pattern any more
  46616. const HELPERS = `
  46617. export var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
  46618. export function getDefaultExportFromCjs (x) {
  46619. return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
  46620. }
  46621. export function createCommonjsModule(fn, basedir, module) {
  46622. return module = {
  46623. path: basedir,
  46624. exports: {},
  46625. require: function (path, base) {
  46626. return commonjsRequire(path, (base === undefined || base === null) ? module.path : base);
  46627. }
  46628. }, fn(module, module.exports), module.exports;
  46629. }
  46630. export function getDefaultExportFromNamespaceIfPresent (n) {
  46631. return n && Object.prototype.hasOwnProperty.call(n, 'default') ? n['default'] : n;
  46632. }
  46633. export function getDefaultExportFromNamespaceIfNotNamed (n) {
  46634. return n && Object.prototype.hasOwnProperty.call(n, 'default') && Object.keys(n).length === 1 ? n['default'] : n;
  46635. }
  46636. export function getAugmentedNamespace(n) {
  46637. if (n.__esModule) return n;
  46638. var a = Object.defineProperty({}, '__esModule', {value: true});
  46639. Object.keys(n).forEach(function (k) {
  46640. var d = Object.getOwnPropertyDescriptor(n, k);
  46641. Object.defineProperty(a, k, d.get ? d : {
  46642. enumerable: true,
  46643. get: function () {
  46644. return n[k];
  46645. }
  46646. });
  46647. });
  46648. return a;
  46649. }
  46650. `;
  46651. const HELPER_NON_DYNAMIC = `
  46652. export function commonjsRequire () {
  46653. throw new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs');
  46654. }
  46655. `;
  46656. const HELPERS_DYNAMIC = `
  46657. export function commonjsRegister (path, loader) {
  46658. DYNAMIC_REQUIRE_LOADERS[path] = loader;
  46659. }
  46660. const DYNAMIC_REQUIRE_LOADERS = Object.create(null);
  46661. const DYNAMIC_REQUIRE_CACHE = Object.create(null);
  46662. const DEFAULT_PARENT_MODULE = {
  46663. id: '<' + 'rollup>', exports: {}, parent: undefined, filename: null, loaded: false, children: [], paths: []
  46664. };
  46665. const CHECKED_EXTENSIONS = ['', '.js', '.json'];
  46666. function normalize (path) {
  46667. path = path.replace(/\\\\/g, '/');
  46668. const parts = path.split('/');
  46669. const slashed = parts[0] === '';
  46670. for (let i = 1; i < parts.length; i++) {
  46671. if (parts[i] === '.' || parts[i] === '') {
  46672. parts.splice(i--, 1);
  46673. }
  46674. }
  46675. for (let i = 1; i < parts.length; i++) {
  46676. if (parts[i] !== '..') continue;
  46677. if (i > 0 && parts[i - 1] !== '..' && parts[i - 1] !== '.') {
  46678. parts.splice(--i, 2);
  46679. i--;
  46680. }
  46681. }
  46682. path = parts.join('/');
  46683. if (slashed && path[0] !== '/')
  46684. path = '/' + path;
  46685. else if (path.length === 0)
  46686. path = '.';
  46687. return path;
  46688. }
  46689. function join () {
  46690. if (arguments.length === 0)
  46691. return '.';
  46692. let joined;
  46693. for (let i = 0; i < arguments.length; ++i) {
  46694. let arg = arguments[i];
  46695. if (arg.length > 0) {
  46696. if (joined === undefined)
  46697. joined = arg;
  46698. else
  46699. joined += '/' + arg;
  46700. }
  46701. }
  46702. if (joined === undefined)
  46703. return '.';
  46704. return joined;
  46705. }
  46706. function isPossibleNodeModulesPath (modulePath) {
  46707. let c0 = modulePath[0];
  46708. if (c0 === '/' || c0 === '\\\\') return false;
  46709. let c1 = modulePath[1], c2 = modulePath[2];
  46710. if ((c0 === '.' && (!c1 || c1 === '/' || c1 === '\\\\')) ||
  46711. (c0 === '.' && c1 === '.' && (!c2 || c2 === '/' || c2 === '\\\\'))) return false;
  46712. if (c1 === ':' && (c2 === '/' || c2 === '\\\\'))
  46713. return false;
  46714. return true;
  46715. }
  46716. function dirname (path) {
  46717. if (path.length === 0)
  46718. return '.';
  46719. let i = path.length - 1;
  46720. while (i > 0) {
  46721. const c = path.charCodeAt(i);
  46722. if ((c === 47 || c === 92) && i !== path.length - 1)
  46723. break;
  46724. i--;
  46725. }
  46726. if (i > 0)
  46727. return path.substr(0, i);
  46728. if (path.chartCodeAt(0) === 47 || path.chartCodeAt(0) === 92)
  46729. return path.charAt(0);
  46730. return '.';
  46731. }
  46732. export function commonjsRequire (path, originalModuleDir) {
  46733. const shouldTryNodeModules = isPossibleNodeModulesPath(path);
  46734. path = normalize(path);
  46735. let relPath;
  46736. while (true) {
  46737. if (!shouldTryNodeModules) {
  46738. relPath = originalModuleDir ? normalize(originalModuleDir + '/' + path) : path;
  46739. } else if (originalModuleDir) {
  46740. relPath = normalize(originalModuleDir + '/node_modules/' + path);
  46741. } else {
  46742. relPath = normalize(join('node_modules', path));
  46743. }
  46744. for (let extensionIndex = 0; extensionIndex < CHECKED_EXTENSIONS.length; extensionIndex++) {
  46745. const resolvedPath = relPath + CHECKED_EXTENSIONS[extensionIndex];
  46746. let cachedModule = DYNAMIC_REQUIRE_CACHE[resolvedPath];
  46747. if (cachedModule) return cachedModule.exports;
  46748. const loader = DYNAMIC_REQUIRE_LOADERS[resolvedPath];
  46749. if (loader) {
  46750. DYNAMIC_REQUIRE_CACHE[resolvedPath] = cachedModule = {
  46751. id: resolvedPath,
  46752. filename: resolvedPath,
  46753. path: dirname(resolvedPath),
  46754. exports: {},
  46755. parent: DEFAULT_PARENT_MODULE,
  46756. loaded: false,
  46757. children: [],
  46758. paths: [],
  46759. require: function (path, base) {
  46760. return commonjsRequire(path, (base === undefined || base === null) ? cachedModule.path : base);
  46761. }
  46762. };
  46763. try {
  46764. loader.call(commonjsGlobal, cachedModule, cachedModule.exports);
  46765. } catch (error) {
  46766. delete DYNAMIC_REQUIRE_CACHE[resolvedPath];
  46767. throw error;
  46768. }
  46769. cachedModule.loaded = true;
  46770. return cachedModule.exports;
  46771. };
  46772. }
  46773. if (!shouldTryNodeModules) break;
  46774. const nextDir = normalize(originalModuleDir + '/..');
  46775. if (nextDir === originalModuleDir) break;
  46776. originalModuleDir = nextDir;
  46777. }
  46778. return require(path);
  46779. }
  46780. commonjsRequire.cache = DYNAMIC_REQUIRE_CACHE;
  46781. `;
  46782. function getHelpersModule(isDynamicRequireModulesEnabled) {
  46783. return `${HELPERS}${isDynamicRequireModulesEnabled ? HELPERS_DYNAMIC : HELPER_NON_DYNAMIC}`;
  46784. }
  46785. /* eslint-disable no-undefined */
  46786. const operators = {
  46787. '==': (x) => equals(x.left, x.right, false),
  46788. '!=': (x) => not(operators['=='](x)),
  46789. '===': (x) => equals(x.left, x.right, true),
  46790. '!==': (x) => not(operators['==='](x)),
  46791. '!': (x) => isFalsy(x.argument),
  46792. '&&': (x) => isTruthy(x.left) && isTruthy(x.right),
  46793. '||': (x) => isTruthy(x.left) || isTruthy(x.right)
  46794. };
  46795. function flatten(node) {
  46796. const parts = [];
  46797. while (node.type === 'MemberExpression') {
  46798. if (node.computed) return null;
  46799. parts.unshift(node.property.name);
  46800. // eslint-disable-next-line no-param-reassign
  46801. node = node.object;
  46802. }
  46803. if (node.type !== 'Identifier') return null;
  46804. const { name } = node;
  46805. parts.unshift(name);
  46806. return { name, keypath: parts.join('.') };
  46807. }
  46808. function isTruthy(node) {
  46809. if (node.type === 'Literal') return !!node.value;
  46810. if (node.type === 'ParenthesizedExpression') return isTruthy(node.expression);
  46811. if (node.operator in operators) return operators[node.operator](node);
  46812. return undefined;
  46813. }
  46814. function isFalsy(node) {
  46815. return not(isTruthy(node));
  46816. }
  46817. function not(value) {
  46818. return value === undefined ? value : !value;
  46819. }
  46820. function equals(a, b, strict) {
  46821. if (a.type !== b.type) return undefined;
  46822. // eslint-disable-next-line eqeqeq
  46823. if (a.type === 'Literal') return strict ? a.value === b.value : a.value == b.value;
  46824. return undefined;
  46825. }
  46826. /* eslint-disable import/prefer-default-export */
  46827. function getName(id) {
  46828. const name = makeLegalIdentifier$2(basename(id, extname$1(id)));
  46829. if (name !== 'index') {
  46830. return name;
  46831. }
  46832. const segments = dirname(id).split(sep);
  46833. return makeLegalIdentifier$2(segments[segments.length - 1]);
  46834. }
  46835. /* eslint-disable no-param-reassign, no-shadow, no-underscore-dangle, no-continue */
  46836. const reserved = 'process location abstract arguments boolean break byte case catch char class const continue debugger default delete do double else enum eval export extends false final finally float for from function goto if implements import in instanceof int interface let long native new null package private protected public return short static super switch synchronized this throw throws transient true try typeof var void volatile while with yield'.split(
  46837. ' '
  46838. );
  46839. const blacklist = { __esModule: true };
  46840. reserved.forEach((word) => (blacklist[word] = true));
  46841. const exportsPattern = /^(?:module\.)?exports(?:\.([a-zA-Z_$][a-zA-Z_$0-9]*))?$/;
  46842. const firstpassGlobal = /\b(?:require|module|exports|global)\b/;
  46843. const firstpassNoGlobal = /\b(?:require|module|exports)\b/;
  46844. const functionType = /^(?:FunctionDeclaration|FunctionExpression|ArrowFunctionExpression)$/;
  46845. function deconflict(scope, globals, identifier) {
  46846. let i = 1;
  46847. let deconflicted = makeLegalIdentifier$2(identifier);
  46848. while (scope.contains(deconflicted) || globals.has(deconflicted) || deconflicted in blacklist) {
  46849. deconflicted = `${identifier}_${i}`;
  46850. i += 1;
  46851. }
  46852. scope.declarations[deconflicted] = true;
  46853. return deconflicted;
  46854. }
  46855. function tryParse(parse, code, id) {
  46856. try {
  46857. return parse(code, { allowReturnOutsideFunction: true });
  46858. } catch (err) {
  46859. err.message += ` in ${id}`;
  46860. throw err;
  46861. }
  46862. }
  46863. function normalizePathSlashes(path) {
  46864. return path.replace(/\\/g, '/');
  46865. }
  46866. function hasCjsKeywords(code, ignoreGlobal) {
  46867. const firstpass = ignoreGlobal ? firstpassNoGlobal : firstpassGlobal;
  46868. return firstpass.test(code);
  46869. }
  46870. function checkEsModule(parse, code, id) {
  46871. const ast = tryParse(parse, code, id);
  46872. let isEsModule = false;
  46873. let hasDefaultExport = false;
  46874. let hasNamedExports = false;
  46875. for (const node of ast.body) {
  46876. if (node.type === 'ExportDefaultDeclaration') {
  46877. isEsModule = true;
  46878. hasDefaultExport = true;
  46879. } else if (node.type === 'ExportNamedDeclaration') {
  46880. isEsModule = true;
  46881. if (node.declaration) {
  46882. hasNamedExports = true;
  46883. } else {
  46884. for (const specifier of node.specifiers) {
  46885. if (specifier.exported.name === 'default') {
  46886. hasDefaultExport = true;
  46887. } else {
  46888. hasNamedExports = true;
  46889. }
  46890. }
  46891. }
  46892. } else if (node.type === 'ExportAllDeclaration') {
  46893. isEsModule = true;
  46894. if (node.exported && node.exported.name === 'default') {
  46895. hasDefaultExport = true;
  46896. } else {
  46897. hasNamedExports = true;
  46898. }
  46899. } else if (node.type === 'ImportDeclaration') {
  46900. isEsModule = true;
  46901. }
  46902. }
  46903. return { isEsModule, hasDefaultExport, hasNamedExports, ast };
  46904. }
  46905. function getDefinePropertyCallName(node, targetName) {
  46906. if (node.type !== 'CallExpression') return;
  46907. const {
  46908. callee: { object, property }
  46909. } = node;
  46910. if (!object || object.type !== 'Identifier' || object.name !== 'Object') return;
  46911. if (!property || property.type !== 'Identifier' || property.name !== 'defineProperty') return;
  46912. if (node.arguments.length !== 3) return;
  46913. const [target, val] = node.arguments;
  46914. if (target.type !== 'Identifier' || target.name !== targetName) return;
  46915. // eslint-disable-next-line consistent-return
  46916. return val.value;
  46917. }
  46918. function transformCommonjs(
  46919. parse,
  46920. code,
  46921. id,
  46922. isEsModule,
  46923. ignoreGlobal,
  46924. ignoreRequire,
  46925. sourceMap,
  46926. isDynamicRequireModulesEnabled,
  46927. dynamicRequireModuleSet,
  46928. commonDir,
  46929. astCache
  46930. ) {
  46931. const ast = astCache || tryParse(parse, code, id);
  46932. const magicString = new MagicString(code);
  46933. const required = {};
  46934. // Because objects have no guaranteed ordering, yet we need it,
  46935. // we need to keep track of the order in a array
  46936. const sources = [];
  46937. let uid = 0;
  46938. let scope = attachScopes$1(ast, 'scope');
  46939. const uses = { module: false, exports: false, global: false, require: false };
  46940. let lexicalDepth = 0;
  46941. let programDepth = 0;
  46942. const globals = new Set();
  46943. // TODO technically wrong since globals isn't populated yet, but ¯\_(ツ)_/¯
  46944. const HELPERS_NAME = deconflict(scope, globals, 'commonjsHelpers');
  46945. // TODO handle transpiled modules
  46946. let shouldWrap = /__esModule/.test(code);
  46947. let usesCommonjsHelpers = false;
  46948. function isRequireStatement(node) {
  46949. if (!node) return false;
  46950. if (node.type !== 'CallExpression') return false;
  46951. // Weird case of `require()` or `module.require()` without arguments
  46952. if (node.arguments.length === 0) return false;
  46953. return isRequireIdentifier(node.callee);
  46954. }
  46955. function isRequireIdentifier(node) {
  46956. if (!node) return false;
  46957. if (node.type === 'Identifier' && node.name === 'require' /* `require` */) {
  46958. // `require` is hidden by a variable in local scope
  46959. if (scope.contains('require')) return false;
  46960. return true;
  46961. } else if (node.type === 'MemberExpression' /* `[something].[something]` */) {
  46962. // `module.[something]`
  46963. if (node.object.type !== 'Identifier' || node.object.name !== 'module') return false;
  46964. // `module` is hidden by a variable in local scope
  46965. if (scope.contains('module')) return false;
  46966. // `module.require(...)`
  46967. if (node.property.type !== 'Identifier' || node.property.name !== 'require') return false;
  46968. return true;
  46969. }
  46970. return false;
  46971. }
  46972. function hasDynamicArguments(node) {
  46973. return (
  46974. node.arguments.length > 1 ||
  46975. (node.arguments[0].type !== 'Literal' &&
  46976. (node.arguments[0].type !== 'TemplateLiteral' || node.arguments[0].expressions.length > 0))
  46977. );
  46978. }
  46979. function isStaticRequireStatement(node) {
  46980. if (!isRequireStatement(node)) return false;
  46981. return !hasDynamicArguments(node);
  46982. }
  46983. function isNodeRequireStatement(parent) {
  46984. const reservedMethod = ['resolve', 'cache', 'main'];
  46985. return !!(parent && parent.property && reservedMethod.indexOf(parent.property.name) > -1);
  46986. }
  46987. function isIgnoredRequireStatement(requiredNode) {
  46988. return ignoreRequire(requiredNode.arguments[0].value);
  46989. }
  46990. function getRequireStringArg(node) {
  46991. return node.arguments[0].type === 'Literal'
  46992. ? node.arguments[0].value
  46993. : node.arguments[0].quasis[0].value.cooked;
  46994. }
  46995. function getRequired(node, name) {
  46996. let sourceId = getRequireStringArg(node);
  46997. const isDynamicRegister = sourceId.startsWith(DYNAMIC_REGISTER_PREFIX);
  46998. if (isDynamicRegister) {
  46999. sourceId = sourceId.substr(DYNAMIC_REGISTER_PREFIX.length);
  47000. }
  47001. const existing = required[sourceId];
  47002. // eslint-disable-next-line no-undefined
  47003. if (existing === undefined) {
  47004. const isDynamic = hasDynamicModuleForPath(sourceId);
  47005. if (!name) {
  47006. do {
  47007. name = `require$$${uid}`;
  47008. uid += 1;
  47009. } while (scope.contains(name));
  47010. }
  47011. if (isDynamicRegister && sourceId.endsWith('.json')) {
  47012. sourceId = DYNAMIC_JSON_PREFIX + sourceId;
  47013. }
  47014. if (isDynamicRegister || !isDynamic || sourceId.endsWith('.json')) {
  47015. sources.push([sourceId, !isDynamicRegister]);
  47016. }
  47017. required[sourceId] = { source: sourceId, name, importsDefault: false, isDynamic };
  47018. }
  47019. return required[sourceId];
  47020. }
  47021. function hasDynamicModuleForPath(source) {
  47022. if (!/[/\\]/.test(source)) {
  47023. try {
  47024. const resolvedPath = normalizePathSlashes(
  47025. resolve.sync(source, { basedir: dirname(id) })
  47026. );
  47027. if (dynamicRequireModuleSet.has(resolvedPath)) {
  47028. return true;
  47029. }
  47030. } catch (ex) {
  47031. // Probably a node.js internal module
  47032. return false;
  47033. }
  47034. return false;
  47035. }
  47036. for (const attemptExt of ['', '.js', '.json']) {
  47037. const resolvedPath = normalizePathSlashes(resolve$1(dirname(id), source + attemptExt));
  47038. if (dynamicRequireModuleSet.has(resolvedPath)) {
  47039. return true;
  47040. }
  47041. }
  47042. return false;
  47043. }
  47044. function shouldUseSimulatedRequire(required) {
  47045. return (
  47046. hasDynamicModuleForPath(required.source) &&
  47047. // We only do `commonjsRequire` for json if it's the `commonjsRegister` call.
  47048. (required.source.startsWith(DYNAMIC_REGISTER_PREFIX) || !required.source.endsWith('.json'))
  47049. );
  47050. }
  47051. // do a first pass, see which names are assigned to. This is necessary to prevent
  47052. // illegally replacing `var foo = require('foo')` with `import foo from 'foo'`,
  47053. // where `foo` is later reassigned. (This happens in the wild. CommonJS, sigh)
  47054. const assignedTo = new Set();
  47055. walk$1(ast, {
  47056. enter(node) {
  47057. if (node.type !== 'AssignmentExpression') return;
  47058. if (node.left.type === 'MemberExpression') return;
  47059. extractAssignedNames$1(node.left).forEach((name) => {
  47060. assignedTo.add(name);
  47061. });
  47062. }
  47063. });
  47064. walk$1(ast, {
  47065. enter(node, parent) {
  47066. if (sourceMap) {
  47067. magicString.addSourcemapLocation(node.start);
  47068. magicString.addSourcemapLocation(node.end);
  47069. }
  47070. // skip dead branches
  47071. if (parent && (parent.type === 'IfStatement' || parent.type === 'ConditionalExpression')) {
  47072. if (node === parent.consequent && isFalsy(parent.test)) {
  47073. this.skip();
  47074. return;
  47075. }
  47076. if (node === parent.alternate && isTruthy(parent.test)) {
  47077. this.skip();
  47078. return;
  47079. }
  47080. }
  47081. if (node._skip) {
  47082. this.skip();
  47083. return;
  47084. }
  47085. programDepth += 1;
  47086. if (node.scope) ({ scope } = node);
  47087. if (functionType.test(node.type)) lexicalDepth += 1;
  47088. // if toplevel return, we need to wrap it
  47089. if (node.type === 'ReturnStatement' && lexicalDepth === 0) {
  47090. shouldWrap = true;
  47091. }
  47092. // rewrite `this` as `commonjsHelpers.commonjsGlobal`
  47093. if (node.type === 'ThisExpression' && lexicalDepth === 0) {
  47094. uses.global = true;
  47095. if (!ignoreGlobal) {
  47096. magicString.overwrite(node.start, node.end, `${HELPERS_NAME}.commonjsGlobal`, {
  47097. storeName: true
  47098. });
  47099. usesCommonjsHelpers = true;
  47100. }
  47101. return;
  47102. }
  47103. // rewrite `typeof module`, `typeof module.exports` and `typeof exports` (https://github.com/rollup/rollup-plugin-commonjs/issues/151)
  47104. if (node.type === 'UnaryExpression' && node.operator === 'typeof') {
  47105. const flattened = flatten(node.argument);
  47106. if (!flattened) return;
  47107. if (scope.contains(flattened.name)) return;
  47108. if (
  47109. flattened.keypath === 'module.exports' ||
  47110. flattened.keypath === 'module' ||
  47111. flattened.keypath === 'exports'
  47112. ) {
  47113. magicString.overwrite(node.start, node.end, `'object'`, { storeName: false });
  47114. }
  47115. }
  47116. // rewrite `require` (if not already handled) `global` and `define`, and handle free references to
  47117. // `module` and `exports` as these mean we need to wrap the module in commonjsHelpers.createCommonjsModule
  47118. if (node.type === 'Identifier') {
  47119. if (isReference(node, parent) && !scope.contains(node.name)) {
  47120. if (node.name in uses) {
  47121. if (isRequireIdentifier(node)) {
  47122. if (isNodeRequireStatement(parent)) {
  47123. return;
  47124. }
  47125. if (!isDynamicRequireModulesEnabled && isStaticRequireStatement(parent)) {
  47126. return;
  47127. }
  47128. if (isDynamicRequireModulesEnabled && isRequireStatement(parent)) {
  47129. magicString.appendLeft(
  47130. parent.end - 1,
  47131. `,${JSON.stringify(
  47132. dirname(id) === '.'
  47133. ? null /* default behavior */
  47134. : getVirtualPathForDynamicRequirePath(
  47135. normalizePathSlashes(dirname(id)),
  47136. commonDir
  47137. )
  47138. )}`
  47139. );
  47140. }
  47141. magicString.overwrite(node.start, node.end, `${HELPERS_NAME}.commonjsRequire`, {
  47142. storeName: true
  47143. });
  47144. usesCommonjsHelpers = true;
  47145. }
  47146. uses[node.name] = true;
  47147. if (node.name === 'global' && !ignoreGlobal) {
  47148. magicString.overwrite(node.start, node.end, `${HELPERS_NAME}.commonjsGlobal`, {
  47149. storeName: true
  47150. });
  47151. usesCommonjsHelpers = true;
  47152. }
  47153. // if module or exports are used outside the context of an assignment
  47154. // expression, we need to wrap the module
  47155. if (node.name === 'module' || node.name === 'exports') {
  47156. shouldWrap = true;
  47157. }
  47158. }
  47159. if (node.name === 'define') {
  47160. magicString.overwrite(node.start, node.end, 'undefined', { storeName: true });
  47161. }
  47162. globals.add(node.name);
  47163. }
  47164. return;
  47165. }
  47166. // Is this an assignment to exports or module.exports?
  47167. if (node.type === 'AssignmentExpression') {
  47168. if (node.left.type !== 'MemberExpression') return;
  47169. const flattened = flatten(node.left);
  47170. if (!flattened) return;
  47171. if (scope.contains(flattened.name)) return;
  47172. const match = exportsPattern.exec(flattened.keypath);
  47173. if (!match || flattened.keypath === 'exports') return;
  47174. uses[flattened.name] = true;
  47175. // we're dealing with `module.exports = ...` or `[module.]exports.foo = ...` –
  47176. // if this isn't top-level, we'll need to wrap the module
  47177. if (programDepth > 3) shouldWrap = true;
  47178. node.left._skip = true;
  47179. if (flattened.keypath === 'module.exports' && node.right.type === 'ObjectExpression') {
  47180. node.right.properties.forEach((prop) => {
  47181. if (prop.computed || !('key' in prop) || prop.key.type !== 'Identifier') return;
  47182. const { name } = prop.key;
  47183. if (name === makeLegalIdentifier$2(name)) ;
  47184. });
  47185. return;
  47186. }
  47187. return;
  47188. }
  47189. const name = getDefinePropertyCallName(node, 'exports');
  47190. if (name && name === makeLegalIdentifier$2(name)) ;
  47191. // if this is `var x = require('x')`, we can do `import x from 'x'`
  47192. if (
  47193. node.type === 'VariableDeclarator' &&
  47194. node.id.type === 'Identifier' &&
  47195. isStaticRequireStatement(node.init) &&
  47196. !isIgnoredRequireStatement(node.init)
  47197. ) {
  47198. // for now, only do this for top-level requires. maybe fix this in future
  47199. if (scope.parent) return;
  47200. // edge case — CJS allows you to assign to imports. ES doesn't
  47201. if (assignedTo.has(node.id.name)) return;
  47202. const required = getRequired(node.init, node.id.name);
  47203. required.importsDefault = true;
  47204. if (required.name === node.id.name && !required.isDynamic) {
  47205. node._shouldRemove = true;
  47206. }
  47207. }
  47208. if (!isStaticRequireStatement(node) || isIgnoredRequireStatement(node)) {
  47209. return;
  47210. }
  47211. const required = getRequired(node);
  47212. if (parent.type === 'ExpressionStatement') {
  47213. // is a bare import, e.g. `require('foo');`
  47214. magicString.remove(parent.start, parent.end);
  47215. } else {
  47216. required.importsDefault = true;
  47217. if (shouldUseSimulatedRequire(required)) {
  47218. magicString.overwrite(
  47219. node.start,
  47220. node.end,
  47221. `${HELPERS_NAME}.commonjsRequire(${JSON.stringify(
  47222. getVirtualPathForDynamicRequirePath(normalizePathSlashes(required.source), commonDir)
  47223. )}, ${JSON.stringify(
  47224. dirname(id) === '.'
  47225. ? null /* default behavior */
  47226. : getVirtualPathForDynamicRequirePath(normalizePathSlashes(dirname(id)), commonDir)
  47227. )})`
  47228. );
  47229. usesCommonjsHelpers = true;
  47230. } else {
  47231. magicString.overwrite(node.start, node.end, required.name);
  47232. }
  47233. }
  47234. node.callee._skip = true;
  47235. },
  47236. leave(node) {
  47237. programDepth -= 1;
  47238. if (node.scope) scope = scope.parent;
  47239. if (functionType.test(node.type)) lexicalDepth -= 1;
  47240. if (node.type === 'VariableDeclaration') {
  47241. let keepDeclaration = false;
  47242. let c = node.declarations[0].start;
  47243. for (let i = 0; i < node.declarations.length; i += 1) {
  47244. const declarator = node.declarations[i];
  47245. if (declarator._shouldRemove) {
  47246. magicString.remove(c, declarator.end);
  47247. } else {
  47248. if (!keepDeclaration) {
  47249. magicString.remove(c, declarator.start);
  47250. keepDeclaration = true;
  47251. }
  47252. c = declarator.end;
  47253. }
  47254. }
  47255. if (!keepDeclaration) {
  47256. magicString.remove(node.start, node.end);
  47257. }
  47258. }
  47259. }
  47260. });
  47261. if (
  47262. !sources.length &&
  47263. !uses.module &&
  47264. !uses.exports &&
  47265. !uses.require &&
  47266. (ignoreGlobal || !uses.global)
  47267. ) {
  47268. // not a CommonJS module
  47269. return null;
  47270. }
  47271. // If `isEsModule` is on, it means it has ES6 import/export statements,
  47272. // which just can't be wrapped in a function.
  47273. if (isEsModule) shouldWrap = false;
  47274. usesCommonjsHelpers = usesCommonjsHelpers || shouldWrap;
  47275. const importBlock = `${(usesCommonjsHelpers
  47276. ? [`import * as ${HELPERS_NAME} from '${HELPERS_ID}';`]
  47277. : []
  47278. )
  47279. .concat(
  47280. sources.map(
  47281. ([source]) =>
  47282. // import the actual module before the proxy, so that we know
  47283. // what kind of proxy to build
  47284. `import '${source}';`
  47285. ),
  47286. sources
  47287. .filter(([, importProxy]) => importProxy)
  47288. .map(([source]) => {
  47289. const { name, importsDefault } = required[source];
  47290. return `import ${importsDefault ? `${name} from ` : ``}'${
  47291. source.startsWith('\0') ? source : getProxyId(source)
  47292. }';`;
  47293. })
  47294. )
  47295. .join('\n')}\n\n`;
  47296. const namedExportDeclarations = [];
  47297. let wrapperStart = '';
  47298. let wrapperEnd = '';
  47299. const moduleName = deconflict(scope, globals, getName(id));
  47300. if (!isEsModule) {
  47301. const exportModuleExports = {
  47302. str: `export { ${moduleName} as __moduleExports };`,
  47303. name: '__moduleExports'
  47304. };
  47305. namedExportDeclarations.push(exportModuleExports);
  47306. }
  47307. const defaultExportPropertyAssignments = [];
  47308. let hasDefaultExport = false;
  47309. if (shouldWrap) {
  47310. const args = `module${uses.exports ? ', exports' : ''}`;
  47311. wrapperStart = `var ${moduleName} = ${HELPERS_NAME}.createCommonjsModule(function (${args}) {\n`;
  47312. wrapperEnd = `\n}`;
  47313. if (isDynamicRequireModulesEnabled) {
  47314. wrapperEnd += `, ${JSON.stringify(
  47315. getVirtualPathForDynamicRequirePath(normalizePathSlashes(dirname(id)), commonDir)
  47316. )}`;
  47317. }
  47318. wrapperEnd += `);`;
  47319. } else {
  47320. const names = [];
  47321. for (const node of ast.body) {
  47322. if (node.type === 'ExpressionStatement' && node.expression.type === 'AssignmentExpression') {
  47323. const { left } = node.expression;
  47324. const flattened = flatten(left);
  47325. if (!flattened) {
  47326. continue;
  47327. }
  47328. const match = exportsPattern.exec(flattened.keypath);
  47329. if (!match) {
  47330. continue;
  47331. }
  47332. if (flattened.keypath === 'module.exports') {
  47333. hasDefaultExport = true;
  47334. magicString.overwrite(left.start, left.end, `var ${moduleName}`);
  47335. } else {
  47336. const [, name] = match;
  47337. const deconflicted = deconflict(scope, globals, name);
  47338. names.push({ name, deconflicted });
  47339. magicString.overwrite(node.start, left.end, `var ${deconflicted}`);
  47340. const declaration =
  47341. name === deconflicted
  47342. ? `export { ${name} };`
  47343. : `export { ${deconflicted} as ${name} };`;
  47344. if (name !== 'default') {
  47345. namedExportDeclarations.push({
  47346. str: declaration,
  47347. name
  47348. });
  47349. }
  47350. defaultExportPropertyAssignments.push(`${moduleName}.${name} = ${deconflicted};`);
  47351. }
  47352. }
  47353. }
  47354. if (!(isEsModule || hasDefaultExport)) {
  47355. wrapperEnd = `\n\nvar ${moduleName} = {\n${names
  47356. .map(({ name, deconflicted }) => `\t${name}: ${deconflicted}`)
  47357. .join(',\n')}\n};`;
  47358. }
  47359. }
  47360. magicString
  47361. .trim()
  47362. .prepend(importBlock + wrapperStart)
  47363. .trim()
  47364. .append(wrapperEnd);
  47365. const defaultExport =
  47366. code.indexOf('__esModule') >= 0
  47367. ? `export default /*@__PURE__*/${HELPERS_NAME}.getDefaultExportFromCjs(${moduleName});`
  47368. : `export default ${moduleName};`;
  47369. const named = namedExportDeclarations
  47370. .filter((x) => x.name !== 'default' || !hasDefaultExport)
  47371. .map((x) => x.str);
  47372. magicString.append(
  47373. `\n\n${(isEsModule ? [] : [defaultExport])
  47374. .concat(named)
  47375. .concat(hasDefaultExport ? defaultExportPropertyAssignments : [])
  47376. .join('\n')}`
  47377. );
  47378. code = magicString.toString();
  47379. const map = sourceMap ? magicString.generateMap() : null;
  47380. return { code, map, syntheticNamedExports: isEsModule ? false : '__moduleExports' };
  47381. }
  47382. function getDynamicPackagesModule(dynamicRequireModuleDirPaths, commonDir) {
  47383. let code = `const commonjsRegister = require('${HELPERS_ID}?commonjsRegister');`;
  47384. for (const dir of dynamicRequireModuleDirPaths) {
  47385. let entryPoint = 'index.js';
  47386. try {
  47387. if (existsSync(join(dir, 'package.json'))) {
  47388. entryPoint =
  47389. JSON.parse(readFileSync(join(dir, 'package.json'), { encoding: 'utf8' })).main ||
  47390. entryPoint;
  47391. }
  47392. } catch (ignored) {
  47393. // ignored
  47394. }
  47395. code += `\ncommonjsRegister(${JSON.stringify(
  47396. getVirtualPathForDynamicRequirePath(dir, commonDir)
  47397. )}, function (module, exports) {
  47398. module.exports = require(${JSON.stringify(normalizePathSlashes(join(dir, entryPoint)))});
  47399. });`;
  47400. }
  47401. return code;
  47402. }
  47403. function getDynamicPackagesEntryIntro(
  47404. id,
  47405. dynamicRequireModuleDirPaths,
  47406. dynamicRequireModuleSet
  47407. ) {
  47408. try {
  47409. const code = readFileSync(id, { encoding: 'utf8' });
  47410. let dynamicImports = Array.from(
  47411. dynamicRequireModuleSet,
  47412. (dynamicId) => `require(${JSON.stringify(DYNAMIC_REGISTER_PREFIX + dynamicId)});`
  47413. ).join('\n');
  47414. if (dynamicRequireModuleDirPaths.length) {
  47415. dynamicImports += `require(${JSON.stringify(
  47416. DYNAMIC_REGISTER_PREFIX + DYNAMIC_PACKAGES_ID
  47417. )});`;
  47418. }
  47419. return `${dynamicImports}\n${code}`;
  47420. } catch (ex) {
  47421. this.warn(`Failed to read file ${id}, dynamic modules might not work correctly`);
  47422. return null;
  47423. }
  47424. }
  47425. function getDynamicRequirePaths(patterns) {
  47426. const dynamicRequireModuleSet = new Set();
  47427. for (const pattern of !patterns || Array.isArray(patterns) ? patterns || [] : [patterns]) {
  47428. const isNegated = pattern.startsWith('!');
  47429. const modifySet = Set.prototype[isNegated ? 'delete' : 'add'].bind(dynamicRequireModuleSet);
  47430. for (const path of glob_1.sync(isNegated ? pattern.substr(1) : pattern)) {
  47431. modifySet(normalizePathSlashes(resolve$1(path)));
  47432. }
  47433. }
  47434. const dynamicRequireModuleDirPaths = Array.from(dynamicRequireModuleSet.values()).filter(
  47435. (path) => {
  47436. try {
  47437. if (statSync(path).isDirectory()) return true;
  47438. } catch (ignored) {
  47439. // Nothing to do here
  47440. }
  47441. return false;
  47442. }
  47443. );
  47444. return { dynamicRequireModuleSet, dynamicRequireModuleDirPaths };
  47445. }
  47446. /* eslint-disable no-undefined */
  47447. const isCjsPromises = new Map();
  47448. function getIsCjsPromise(id) {
  47449. let isCjsPromise = isCjsPromises.get(id);
  47450. if (isCjsPromise) return isCjsPromise.promise;
  47451. const promise = new Promise((resolve) => {
  47452. isCjsPromise = {
  47453. resolve,
  47454. promise: undefined
  47455. };
  47456. isCjsPromises.set(id, isCjsPromise);
  47457. });
  47458. isCjsPromise.promise = promise;
  47459. return promise;
  47460. }
  47461. function setIsCjsPromise(id, resolution) {
  47462. const isCjsPromise = isCjsPromises.get(id);
  47463. if (isCjsPromise) {
  47464. if (isCjsPromise.resolve) {
  47465. isCjsPromise.resolve(resolution);
  47466. isCjsPromise.resolve = undefined;
  47467. }
  47468. } else {
  47469. isCjsPromises.set(id, { promise: Promise.resolve(resolution), resolve: undefined });
  47470. }
  47471. }
  47472. // e.g. id === "commonjsHelpers?commonjsRegister"
  47473. function getSpecificHelperProxy(id) {
  47474. return `export {${id.split('?')[1]} as default} from '${HELPERS_ID}';`;
  47475. }
  47476. function getUnknownRequireProxy(id, requireReturnsDefault) {
  47477. if (requireReturnsDefault === true || id.endsWith('.json')) {
  47478. return `export {default} from ${JSON.stringify(id)};`;
  47479. }
  47480. const name = getName(id);
  47481. const exported =
  47482. requireReturnsDefault === 'auto'
  47483. ? `import {getDefaultExportFromNamespaceIfNotNamed} from "${HELPERS_ID}"; export default /*@__PURE__*/getDefaultExportFromNamespaceIfNotNamed(${name});`
  47484. : requireReturnsDefault === 'preferred'
  47485. ? `import {getDefaultExportFromNamespaceIfPresent} from "${HELPERS_ID}"; export default /*@__PURE__*/getDefaultExportFromNamespaceIfPresent(${name});`
  47486. : !requireReturnsDefault
  47487. ? `import {getAugmentedNamespace} from "${HELPERS_ID}"; export default /*@__PURE__*/getAugmentedNamespace(${name});`
  47488. : `export default ${name};`;
  47489. return `import * as ${name} from ${JSON.stringify(id)}; ${exported}`;
  47490. }
  47491. function getDynamicJsonProxy(id, commonDir) {
  47492. const normalizedPath = normalizePathSlashes(id.slice(DYNAMIC_JSON_PREFIX.length));
  47493. return `const commonjsRegister = require('${HELPERS_ID}?commonjsRegister');\ncommonjsRegister(${JSON.stringify(
  47494. getVirtualPathForDynamicRequirePath(normalizedPath, commonDir)
  47495. )}, function (module, exports) {
  47496. module.exports = require(${JSON.stringify(normalizedPath)});
  47497. });`;
  47498. }
  47499. function getDynamicRequireProxy(normalizedPath, commonDir) {
  47500. return `const commonjsRegister = require('${HELPERS_ID}?commonjsRegister');\ncommonjsRegister(${JSON.stringify(
  47501. getVirtualPathForDynamicRequirePath(normalizedPath, commonDir)
  47502. )}, function (module, exports) {
  47503. ${readFileSync(normalizedPath, { encoding: 'utf8' })}
  47504. });`;
  47505. }
  47506. async function getStaticRequireProxy(
  47507. id,
  47508. requireReturnsDefault,
  47509. esModulesWithDefaultExport,
  47510. esModulesWithNamedExports
  47511. ) {
  47512. const name = getName(id);
  47513. const isCjs = await getIsCjsPromise(id);
  47514. if (isCjs) {
  47515. return `import { __moduleExports } from ${JSON.stringify(id)}; export default __moduleExports;`;
  47516. } else if (isCjs === null) {
  47517. return getUnknownRequireProxy(id, requireReturnsDefault);
  47518. } else if (!requireReturnsDefault) {
  47519. return `import {getAugmentedNamespace} from "${HELPERS_ID}"; import * as ${name} from ${JSON.stringify(
  47520. id
  47521. )}; export default /*@__PURE__*/getAugmentedNamespace(${name});`;
  47522. } else if (
  47523. requireReturnsDefault !== true &&
  47524. (requireReturnsDefault === 'namespace' ||
  47525. !esModulesWithDefaultExport.has(id) ||
  47526. (requireReturnsDefault === 'auto' && esModulesWithNamedExports.has(id)))
  47527. ) {
  47528. return `import * as ${name} from ${JSON.stringify(id)}; export default ${name};`;
  47529. }
  47530. return `export {default} from ${JSON.stringify(id)};`;
  47531. }
  47532. /* eslint-disable no-param-reassign, no-undefined */
  47533. function getCandidatesForExtension(resolved, extension) {
  47534. return [resolved + extension, `${resolved}${sep}index${extension}`];
  47535. }
  47536. function getCandidates(resolved, extensions) {
  47537. return extensions.reduce(
  47538. (paths, extension) => paths.concat(getCandidatesForExtension(resolved, extension)),
  47539. [resolved]
  47540. );
  47541. }
  47542. function getResolveId(extensions) {
  47543. function resolveExtensions(importee, importer) {
  47544. // not our problem
  47545. if (importee[0] !== '.' || !importer) return undefined;
  47546. const resolved = resolve$1(dirname(importer), importee);
  47547. const candidates = getCandidates(resolved, extensions);
  47548. for (let i = 0; i < candidates.length; i += 1) {
  47549. try {
  47550. const stats = statSync(candidates[i]);
  47551. if (stats.isFile()) return { id: candidates[i] };
  47552. } catch (err) {
  47553. /* noop */
  47554. }
  47555. }
  47556. return undefined;
  47557. }
  47558. function resolveId(importee, importer) {
  47559. const isProxyModule = importee.endsWith(PROXY_SUFFIX);
  47560. if (isProxyModule) {
  47561. importee = getIdFromProxyId(importee);
  47562. }
  47563. if (importee.startsWith('\0')) {
  47564. if (
  47565. importee.startsWith(HELPERS_ID) ||
  47566. importee === DYNAMIC_PACKAGES_ID ||
  47567. importee.startsWith(DYNAMIC_JSON_PREFIX)
  47568. ) {
  47569. return importee;
  47570. }
  47571. if (!isProxyModule) {
  47572. return null;
  47573. }
  47574. }
  47575. if (importer && importer.endsWith(PROXY_SUFFIX)) {
  47576. importer = getIdFromProxyId(importer);
  47577. }
  47578. return this.resolve(importee, importer, { skipSelf: true }).then((resolved) => {
  47579. if (!resolved) {
  47580. resolved = resolveExtensions(importee, importer);
  47581. }
  47582. if (isProxyModule) {
  47583. if (!resolved) {
  47584. return { id: getExternalProxyId(importee), external: false };
  47585. }
  47586. resolved.id = (resolved.external ? getExternalProxyId : getProxyId)(resolved.id);
  47587. resolved.external = false;
  47588. return resolved;
  47589. }
  47590. return resolved;
  47591. });
  47592. }
  47593. return resolveId;
  47594. }
  47595. function commonjs(options = {}) {
  47596. const extensions = options.extensions || ['.js'];
  47597. const filter = createFilter$4(options.include, options.exclude);
  47598. const {
  47599. ignoreGlobal,
  47600. requireReturnsDefault: requireReturnsDefaultOption,
  47601. esmExternals
  47602. } = options;
  47603. const getRequireReturnsDefault =
  47604. typeof requireReturnsDefaultOption === 'function'
  47605. ? requireReturnsDefaultOption
  47606. : () => requireReturnsDefaultOption;
  47607. let esmExternalIds;
  47608. const isEsmExternal =
  47609. typeof esmExternals === 'function'
  47610. ? esmExternals
  47611. : Array.isArray(esmExternals)
  47612. ? ((esmExternalIds = new Set(esmExternals)), (id) => esmExternalIds.has(id))
  47613. : () => esmExternals;
  47614. const { dynamicRequireModuleSet, dynamicRequireModuleDirPaths } = getDynamicRequirePaths(
  47615. options.dynamicRequireTargets
  47616. );
  47617. const isDynamicRequireModulesEnabled = dynamicRequireModuleSet.size > 0;
  47618. const commonDir = isDynamicRequireModulesEnabled
  47619. ? commondir(null, Array.from(dynamicRequireModuleSet).concat(process.cwd()))
  47620. : null;
  47621. const esModulesWithDefaultExport = new Set();
  47622. const esModulesWithNamedExports = new Set();
  47623. const ignoreRequire =
  47624. typeof options.ignore === 'function'
  47625. ? options.ignore
  47626. : Array.isArray(options.ignore)
  47627. ? (id) => options.ignore.includes(id)
  47628. : () => false;
  47629. const resolveId = getResolveId(extensions);
  47630. const sourceMap = options.sourceMap !== false;
  47631. function transformAndCheckExports(code, id) {
  47632. const { isEsModule, hasDefaultExport, hasNamedExports, ast } = checkEsModule(
  47633. this.parse,
  47634. code,
  47635. id
  47636. );
  47637. if (hasDefaultExport) {
  47638. esModulesWithDefaultExport.add(id);
  47639. }
  47640. if (hasNamedExports) {
  47641. esModulesWithNamedExports.add(id);
  47642. }
  47643. if (
  47644. !dynamicRequireModuleSet.has(normalizePathSlashes(id)) &&
  47645. (!hasCjsKeywords(code, ignoreGlobal) || (isEsModule && !options.transformMixedEsModules))
  47646. ) {
  47647. setIsCjsPromise(id, false);
  47648. return null;
  47649. }
  47650. const transformed = transformCommonjs(
  47651. this.parse,
  47652. code,
  47653. id,
  47654. isEsModule,
  47655. ignoreGlobal || isEsModule,
  47656. ignoreRequire,
  47657. sourceMap,
  47658. isDynamicRequireModulesEnabled,
  47659. dynamicRequireModuleSet,
  47660. commonDir,
  47661. ast
  47662. );
  47663. setIsCjsPromise(id, isEsModule ? false : Boolean(transformed));
  47664. return transformed;
  47665. }
  47666. return {
  47667. name: 'commonjs',
  47668. buildStart() {
  47669. if (options.namedExports != null) {
  47670. this.warn(
  47671. 'The namedExports option from "@rollup/plugin-commonjs" is deprecated. Named exports are now handled automatically.'
  47672. );
  47673. }
  47674. const [major, minor] = this.meta.rollupVersion.split('.').map(Number);
  47675. const minVersion = peerDependencies.rollup.slice(2);
  47676. const [minMajor, minMinor] = minVersion.split('.').map(Number);
  47677. if (major < minMajor || (major === minMajor && minor < minMinor)) {
  47678. this.error(
  47679. `Insufficient Rollup version: "@rollup/plugin-commonjs" requires at least rollup@${minVersion} but found rollup@${this.meta.rollupVersion}.`
  47680. );
  47681. }
  47682. },
  47683. resolveId,
  47684. load(id) {
  47685. if (id === HELPERS_ID) {
  47686. return getHelpersModule(isDynamicRequireModulesEnabled);
  47687. }
  47688. if (id.startsWith(HELPERS_ID)) {
  47689. return getSpecificHelperProxy(id);
  47690. }
  47691. if (id.endsWith(EXTERNAL_SUFFIX)) {
  47692. const actualId = getIdFromExternalProxyId(id);
  47693. return getUnknownRequireProxy(
  47694. actualId,
  47695. isEsmExternal(actualId) ? getRequireReturnsDefault(actualId) : true
  47696. );
  47697. }
  47698. if (id === DYNAMIC_PACKAGES_ID) {
  47699. return getDynamicPackagesModule(dynamicRequireModuleDirPaths, commonDir);
  47700. }
  47701. if (id.startsWith(DYNAMIC_JSON_PREFIX)) {
  47702. return getDynamicJsonProxy(id, commonDir);
  47703. }
  47704. const normalizedPath = normalizePathSlashes(id);
  47705. if (dynamicRequireModuleSet.has(normalizedPath) && !normalizedPath.endsWith('.json')) {
  47706. return getDynamicRequireProxy(normalizedPath, commonDir);
  47707. }
  47708. if (id.endsWith(PROXY_SUFFIX)) {
  47709. const actualId = getIdFromProxyId(id);
  47710. return getStaticRequireProxy(
  47711. actualId,
  47712. getRequireReturnsDefault(actualId),
  47713. esModulesWithDefaultExport,
  47714. esModulesWithNamedExports
  47715. );
  47716. }
  47717. if (isDynamicRequireModulesEnabled && this.getModuleInfo(id).isEntry) {
  47718. return getDynamicPackagesEntryIntro(
  47719. id,
  47720. dynamicRequireModuleDirPaths,
  47721. dynamicRequireModuleSet
  47722. );
  47723. }
  47724. return null;
  47725. },
  47726. transform(code, id) {
  47727. const extName = extname$1(id);
  47728. if (
  47729. extName !== '.cjs' &&
  47730. id !== DYNAMIC_PACKAGES_ID &&
  47731. !id.startsWith(DYNAMIC_JSON_PREFIX) &&
  47732. (!filter(id) || !extensions.includes(extName))
  47733. ) {
  47734. setIsCjsPromise(id, null);
  47735. return null;
  47736. }
  47737. let transformed;
  47738. try {
  47739. transformed = transformAndCheckExports.call(this, code, id);
  47740. } catch (err) {
  47741. transformed = null;
  47742. setIsCjsPromise(id, false);
  47743. this.error(err, err.loc);
  47744. }
  47745. return transformed;
  47746. }
  47747. };
  47748. }
  47749. // Helper since Typescript can't detect readonly arrays with Array.isArray
  47750. function isArray$3(arg) {
  47751. return Array.isArray(arg);
  47752. }
  47753. function ensureArray$3(thing) {
  47754. if (isArray$3(thing))
  47755. return thing;
  47756. if (thing == null)
  47757. return [];
  47758. return [thing];
  47759. }
  47760. function getMatcherString$3(id, resolutionBase) {
  47761. if (resolutionBase === false) {
  47762. return id;
  47763. }
  47764. // resolve('') is valid and will default to process.cwd()
  47765. const basePath = resolve$1(resolutionBase || '')
  47766. .split(sep)
  47767. .join('/')
  47768. // escape all possible (posix + win) path characters that might interfere with regex
  47769. .replace(/[-^$*+?.()|[\]{}]/g, '\\$&');
  47770. // Note that we use posix.join because:
  47771. // 1. the basePath has been normalized to use /
  47772. // 2. the incoming glob (id) matcher, also uses /
  47773. // otherwise Node will force backslash (\) on windows
  47774. return posix$1.join(basePath, id);
  47775. }
  47776. const createFilter$3 = function createFilter(include, exclude, options) {
  47777. const resolutionBase = options && options.resolve;
  47778. const getMatcher = (id) => id instanceof RegExp
  47779. ? id
  47780. : {
  47781. test: (what) => {
  47782. // this refactor is a tad overly verbose but makes for easy debugging
  47783. const pattern = getMatcherString$3(id, resolutionBase);
  47784. const fn = picomatch(pattern, { dot: true });
  47785. const result = fn(what);
  47786. return result;
  47787. }
  47788. };
  47789. const includeMatchers = ensureArray$3(include).map(getMatcher);
  47790. const excludeMatchers = ensureArray$3(exclude).map(getMatcher);
  47791. return function result(id) {
  47792. if (typeof id !== 'string')
  47793. return false;
  47794. if (/\0/.test(id))
  47795. return false;
  47796. const pathId = id.split(sep).join('/');
  47797. for (let i = 0; i < excludeMatchers.length; ++i) {
  47798. const matcher = excludeMatchers[i];
  47799. if (matcher.test(pathId))
  47800. return false;
  47801. }
  47802. for (let i = 0; i < includeMatchers.length; ++i) {
  47803. const matcher = includeMatchers[i];
  47804. if (matcher.test(pathId))
  47805. return true;
  47806. }
  47807. return !includeMatchers.length;
  47808. };
  47809. };
  47810. const reservedWords$3 = 'break case class catch const continue debugger default delete do else export extends finally for function if import in instanceof let new return super switch this throw try typeof var void while with yield enum await implements package protected static interface private public';
  47811. const builtins$4 = 'arguments Infinity NaN undefined null true false eval uneval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Symbol Error EvalError InternalError RangeError ReferenceError SyntaxError TypeError URIError Number Math Date String RegExp Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array Map Set WeakMap WeakSet SIMD ArrayBuffer DataView JSON Promise Generator GeneratorFunction Reflect Proxy Intl';
  47812. const forbiddenIdentifiers$3 = new Set(`${reservedWords$3} ${builtins$4}`.split(' '));
  47813. forbiddenIdentifiers$3.add('');
  47814. const makeLegalIdentifier$1 = function makeLegalIdentifier(str) {
  47815. let identifier = str
  47816. .replace(/-(\w)/g, (_, letter) => letter.toUpperCase())
  47817. .replace(/[^$_a-zA-Z0-9]/g, '_');
  47818. if (/\d/.test(identifier[0]) || forbiddenIdentifiers$3.has(identifier)) {
  47819. identifier = `_${identifier}`;
  47820. }
  47821. return identifier || '_';
  47822. };
  47823. function stringify$1(obj) {
  47824. return (JSON.stringify(obj) || 'undefined').replace(/[\u2028\u2029]/g, (char) => `\\u${`000${char.charCodeAt(0).toString(16)}`.slice(-4)}`);
  47825. }
  47826. function serializeArray$1(arr, indent, baseIndent) {
  47827. let output = '[';
  47828. const separator = indent ? `\n${baseIndent}${indent}` : '';
  47829. for (let i = 0; i < arr.length; i++) {
  47830. const key = arr[i];
  47831. output += `${i > 0 ? ',' : ''}${separator}${serialize$1(key, indent, baseIndent + indent)}`;
  47832. }
  47833. return `${output}${indent ? `\n${baseIndent}` : ''}]`;
  47834. }
  47835. function serializeObject$1(obj, indent, baseIndent) {
  47836. let output = '{';
  47837. const separator = indent ? `\n${baseIndent}${indent}` : '';
  47838. const entries = Object.entries(obj);
  47839. for (let i = 0; i < entries.length; i++) {
  47840. const [key, value] = entries[i];
  47841. const stringKey = makeLegalIdentifier$1(key) === key ? key : stringify$1(key);
  47842. output += `${i > 0 ? ',' : ''}${separator}${stringKey}:${indent ? ' ' : ''}${serialize$1(value, indent, baseIndent + indent)}`;
  47843. }
  47844. return `${output}${indent ? `\n${baseIndent}` : ''}}`;
  47845. }
  47846. function serialize$1(obj, indent, baseIndent) {
  47847. if (obj === Infinity)
  47848. return 'Infinity';
  47849. if (obj === -Infinity)
  47850. return '-Infinity';
  47851. if (obj === 0 && 1 / obj === -Infinity)
  47852. return '-0';
  47853. if (obj instanceof Date)
  47854. return `new Date(${obj.getTime()})`;
  47855. if (obj instanceof RegExp)
  47856. return obj.toString();
  47857. if (obj !== obj)
  47858. return 'NaN'; // eslint-disable-line no-self-compare
  47859. if (Array.isArray(obj))
  47860. return serializeArray$1(obj, indent, baseIndent);
  47861. if (obj === null)
  47862. return 'null';
  47863. if (typeof obj === 'object')
  47864. return serializeObject$1(obj, indent, baseIndent);
  47865. return stringify$1(obj);
  47866. }
  47867. const dataToEsm$1 = function dataToEsm(data, options = {}) {
  47868. const t = options.compact ? '' : 'indent' in options ? options.indent : '\t';
  47869. const _ = options.compact ? '' : ' ';
  47870. const n = options.compact ? '' : '\n';
  47871. const declarationType = options.preferConst ? 'const' : 'var';
  47872. if (options.namedExports === false ||
  47873. typeof data !== 'object' ||
  47874. Array.isArray(data) ||
  47875. data instanceof Date ||
  47876. data instanceof RegExp ||
  47877. data === null) {
  47878. const code = serialize$1(data, options.compact ? null : t, '');
  47879. const magic = _ || (/^[{[\-\/]/.test(code) ? '' : ' '); // eslint-disable-line no-useless-escape
  47880. return `export default${magic}${code};`;
  47881. }
  47882. let namedExportCode = '';
  47883. const defaultExportRows = [];
  47884. for (const [key, value] of Object.entries(data)) {
  47885. if (key === makeLegalIdentifier$1(key)) {
  47886. if (options.objectShorthand)
  47887. defaultExportRows.push(key);
  47888. else
  47889. defaultExportRows.push(`${key}:${_}${key}`);
  47890. namedExportCode += `export ${declarationType} ${key}${_}=${_}${serialize$1(value, options.compact ? null : t, '')};${n}`;
  47891. }
  47892. else {
  47893. defaultExportRows.push(`${stringify$1(key)}:${_}${serialize$1(value, options.compact ? null : t, '')}`);
  47894. }
  47895. }
  47896. return `${namedExportCode}export default${_}{${n}${t}${defaultExportRows.join(`,${n}${t}`)}${n}};${n}`;
  47897. };
  47898. function json(options) {
  47899. if ( options === void 0 ) options = {};
  47900. var filter = createFilter$3(options.include, options.exclude);
  47901. var indent = 'indent' in options ? options.indent : '\t';
  47902. return {
  47903. name: 'json',
  47904. // eslint-disable-next-line no-shadow
  47905. transform: function transform(json, id) {
  47906. if (id.slice(-5) !== '.json' || !filter(id)) { return null; }
  47907. try {
  47908. var parsed = JSON.parse(json);
  47909. return {
  47910. code: dataToEsm$1(parsed, {
  47911. preferConst: options.preferConst,
  47912. compact: options.compact,
  47913. namedExports: options.namedExports,
  47914. indent: indent
  47915. }),
  47916. map: { mappings: '' }
  47917. };
  47918. } catch (err) {
  47919. var message = 'Could not parse JSON file';
  47920. var position = parseInt(/[\d]/.exec(err.message)[0], 10);
  47921. this.warn({ message: message, id: id, position: position });
  47922. return null;
  47923. }
  47924. }
  47925. };
  47926. }
  47927. const {builtinModules} = Module;
  47928. const ignoreList = [
  47929. 'sys'
  47930. ];
  47931. // eslint-disable-next-line node/no-deprecated-api
  47932. var builtinModules_1 = (builtinModules)
  47933. .filter(x => !/^_|^(internal|v8|node-inspect)\/|\//.test(x) && !ignoreList.includes(x))
  47934. .sort();
  47935. var isMergeableObject = function isMergeableObject(value) {
  47936. return isNonNullObject(value)
  47937. && !isSpecial(value)
  47938. };
  47939. function isNonNullObject(value) {
  47940. return !!value && typeof value === 'object'
  47941. }
  47942. function isSpecial(value) {
  47943. var stringValue = Object.prototype.toString.call(value);
  47944. return stringValue === '[object RegExp]'
  47945. || stringValue === '[object Date]'
  47946. || isReactElement(value)
  47947. }
  47948. // see https://github.com/facebook/react/blob/b5ac963fb791d1298e7f396236383bc955f916c1/src/isomorphic/classic/element/ReactElement.js#L21-L25
  47949. var canUseSymbol = typeof Symbol === 'function' && Symbol.for;
  47950. var REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for('react.element') : 0xeac7;
  47951. function isReactElement(value) {
  47952. return value.$$typeof === REACT_ELEMENT_TYPE
  47953. }
  47954. function emptyTarget(val) {
  47955. return Array.isArray(val) ? [] : {}
  47956. }
  47957. function cloneUnlessOtherwiseSpecified(value, options) {
  47958. return (options.clone !== false && options.isMergeableObject(value))
  47959. ? deepmerge(emptyTarget(value), value, options)
  47960. : value
  47961. }
  47962. function defaultArrayMerge(target, source, options) {
  47963. return target.concat(source).map(function(element) {
  47964. return cloneUnlessOtherwiseSpecified(element, options)
  47965. })
  47966. }
  47967. function getMergeFunction(key, options) {
  47968. if (!options.customMerge) {
  47969. return deepmerge
  47970. }
  47971. var customMerge = options.customMerge(key);
  47972. return typeof customMerge === 'function' ? customMerge : deepmerge
  47973. }
  47974. function getEnumerableOwnPropertySymbols(target) {
  47975. return Object.getOwnPropertySymbols
  47976. ? Object.getOwnPropertySymbols(target).filter(function(symbol) {
  47977. return target.propertyIsEnumerable(symbol)
  47978. })
  47979. : []
  47980. }
  47981. function getKeys(target) {
  47982. return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target))
  47983. }
  47984. function propertyIsOnObject(object, property) {
  47985. try {
  47986. return property in object
  47987. } catch(_) {
  47988. return false
  47989. }
  47990. }
  47991. // Protects from prototype poisoning and unexpected merging up the prototype chain.
  47992. function propertyIsUnsafe(target, key) {
  47993. return propertyIsOnObject(target, key) // Properties are safe to merge if they don't exist in the target yet,
  47994. && !(Object.hasOwnProperty.call(target, key) // unsafe if they exist up the prototype chain,
  47995. && Object.propertyIsEnumerable.call(target, key)) // and also unsafe if they're nonenumerable.
  47996. }
  47997. function mergeObject(target, source, options) {
  47998. var destination = {};
  47999. if (options.isMergeableObject(target)) {
  48000. getKeys(target).forEach(function(key) {
  48001. destination[key] = cloneUnlessOtherwiseSpecified(target[key], options);
  48002. });
  48003. }
  48004. getKeys(source).forEach(function(key) {
  48005. if (propertyIsUnsafe(target, key)) {
  48006. return
  48007. }
  48008. if (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) {
  48009. destination[key] = getMergeFunction(key, options)(target[key], source[key], options);
  48010. } else {
  48011. destination[key] = cloneUnlessOtherwiseSpecified(source[key], options);
  48012. }
  48013. });
  48014. return destination
  48015. }
  48016. function deepmerge(target, source, options) {
  48017. options = options || {};
  48018. options.arrayMerge = options.arrayMerge || defaultArrayMerge;
  48019. options.isMergeableObject = options.isMergeableObject || isMergeableObject;
  48020. // cloneUnlessOtherwiseSpecified is added to `options` so that custom arrayMerge()
  48021. // implementations can use it. The caller may not replace it.
  48022. options.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified;
  48023. var sourceIsArray = Array.isArray(source);
  48024. var targetIsArray = Array.isArray(target);
  48025. var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;
  48026. if (!sourceAndTargetTypesMatch) {
  48027. return cloneUnlessOtherwiseSpecified(source, options)
  48028. } else if (sourceIsArray) {
  48029. return options.arrayMerge(target, source, options)
  48030. } else {
  48031. return mergeObject(target, source, options)
  48032. }
  48033. }
  48034. deepmerge.all = function deepmergeAll(array, options) {
  48035. if (!Array.isArray(array)) {
  48036. throw new Error('first argument should be an array')
  48037. }
  48038. return array.reduce(function(prev, next) {
  48039. return deepmerge(prev, next, options)
  48040. }, {})
  48041. };
  48042. var deepmerge_1 = deepmerge;
  48043. var cjs = deepmerge_1;
  48044. // no idea what these regular expressions do,
  48045. // but i extracted it from https://github.com/yahoo/js-module-formats/blob/master/index.js#L18
  48046. var ES6ImportExportRegExp = /(?:^\s*|[}{\(\);,\n]\s*)(import\s+['"]|(import|module)\s+[^"'\(\)\n;]+\s+from\s+['"]|export\s+(\*|\{|default|function|var|const|let|[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*))/;
  48047. var ES6AliasRegExp = /(?:^\s*|[}{\(\);,\n]\s*)(export\s*\*\s*from\s*(?:'([^']+)'|"([^"]+)"))/;
  48048. var isModule = function (sauce) {
  48049. return ES6ImportExportRegExp.test(sauce)
  48050. || ES6AliasRegExp.test(sauce);
  48051. };
  48052. // Helper since Typescript can't detect readonly arrays with Array.isArray
  48053. function isArray$2(arg) {
  48054. return Array.isArray(arg);
  48055. }
  48056. function ensureArray$2(thing) {
  48057. if (isArray$2(thing))
  48058. return thing;
  48059. if (thing == null)
  48060. return [];
  48061. return [thing];
  48062. }
  48063. function getMatcherString$2(id, resolutionBase) {
  48064. if (resolutionBase === false) {
  48065. return id;
  48066. }
  48067. // resolve('') is valid and will default to process.cwd()
  48068. const basePath = resolve$1(resolutionBase || '')
  48069. .split(sep)
  48070. .join('/')
  48071. // escape all possible (posix + win) path characters that might interfere with regex
  48072. .replace(/[-^$*+?.()|[\]{}]/g, '\\$&');
  48073. // Note that we use posix.join because:
  48074. // 1. the basePath has been normalized to use /
  48075. // 2. the incoming glob (id) matcher, also uses /
  48076. // otherwise Node will force backslash (\) on windows
  48077. return posix$1.join(basePath, id);
  48078. }
  48079. const createFilter$2 = function createFilter(include, exclude, options) {
  48080. const resolutionBase = options && options.resolve;
  48081. const getMatcher = (id) => id instanceof RegExp
  48082. ? id
  48083. : {
  48084. test: (what) => {
  48085. // this refactor is a tad overly verbose but makes for easy debugging
  48086. const pattern = getMatcherString$2(id, resolutionBase);
  48087. const fn = picomatch(pattern, { dot: true });
  48088. const result = fn(what);
  48089. return result;
  48090. }
  48091. };
  48092. const includeMatchers = ensureArray$2(include).map(getMatcher);
  48093. const excludeMatchers = ensureArray$2(exclude).map(getMatcher);
  48094. return function result(id) {
  48095. if (typeof id !== 'string')
  48096. return false;
  48097. if (/\0/.test(id))
  48098. return false;
  48099. const pathId = id.split(sep).join('/');
  48100. for (let i = 0; i < excludeMatchers.length; ++i) {
  48101. const matcher = excludeMatchers[i];
  48102. if (matcher.test(pathId))
  48103. return false;
  48104. }
  48105. for (let i = 0; i < includeMatchers.length; ++i) {
  48106. const matcher = includeMatchers[i];
  48107. if (matcher.test(pathId))
  48108. return true;
  48109. }
  48110. return !includeMatchers.length;
  48111. };
  48112. };
  48113. const reservedWords$2 = 'break case class catch const continue debugger default delete do else export extends finally for function if import in instanceof let new return super switch this throw try typeof var void while with yield enum await implements package protected static interface private public';
  48114. const builtins$3 = 'arguments Infinity NaN undefined null true false eval uneval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Symbol Error EvalError InternalError RangeError ReferenceError SyntaxError TypeError URIError Number Math Date String RegExp Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array Map Set WeakMap WeakSet SIMD ArrayBuffer DataView JSON Promise Generator GeneratorFunction Reflect Proxy Intl';
  48115. const forbiddenIdentifiers$2 = new Set(`${reservedWords$2} ${builtins$3}`.split(' '));
  48116. forbiddenIdentifiers$2.add('');
  48117. const exists = promisify(fs$3.exists);
  48118. const readFile = promisify(fs$3.readFile);
  48119. const realpath = promisify(fs$3.realpath);
  48120. const stat = promisify(fs$3.stat);
  48121. const onError = (error) => {
  48122. if (error.code === 'ENOENT') {
  48123. return false;
  48124. }
  48125. throw error;
  48126. };
  48127. const makeCache = (fn) => {
  48128. const cache = new Map();
  48129. const wrapped = async (param, done) => {
  48130. if (cache.has(param) === false) {
  48131. cache.set(
  48132. param,
  48133. fn(param).catch((err) => {
  48134. cache.delete(param);
  48135. throw err;
  48136. })
  48137. );
  48138. }
  48139. try {
  48140. const result = cache.get(param);
  48141. const value = await result;
  48142. return done(null, value);
  48143. } catch (error) {
  48144. return done(error);
  48145. }
  48146. };
  48147. wrapped.clear = () => cache.clear();
  48148. return wrapped;
  48149. };
  48150. const isDirCached = makeCache(async (file) => {
  48151. try {
  48152. const stats = await stat(file);
  48153. return stats.isDirectory();
  48154. } catch (error) {
  48155. return onError(error);
  48156. }
  48157. });
  48158. const isFileCached = makeCache(async (file) => {
  48159. try {
  48160. const stats = await stat(file);
  48161. return stats.isFile();
  48162. } catch (error) {
  48163. return onError(error);
  48164. }
  48165. });
  48166. const readCachedFile = makeCache(readFile);
  48167. const resolveId = promisify(resolve);
  48168. // returns the imported package name for bare module imports
  48169. function getPackageName(id) {
  48170. if (id.startsWith('.') || id.startsWith('/')) {
  48171. return null;
  48172. }
  48173. const split = id.split('/');
  48174. // @my-scope/my-package/foo.js -> @my-scope/my-package
  48175. // @my-scope/my-package -> @my-scope/my-package
  48176. if (split[0][0] === '@') {
  48177. return `${split[0]}/${split[1]}`;
  48178. }
  48179. // my-package/foo.js -> my-package
  48180. // my-package -> my-package
  48181. return split[0];
  48182. }
  48183. function getMainFields(options) {
  48184. let mainFields;
  48185. if (options.mainFields) {
  48186. ({ mainFields } = options);
  48187. } else {
  48188. mainFields = ['module', 'main'];
  48189. }
  48190. if (options.browser && mainFields.indexOf('browser') === -1) {
  48191. return ['browser'].concat(mainFields);
  48192. }
  48193. if (!mainFields.length) {
  48194. throw new Error('Please ensure at least one `mainFields` value is specified');
  48195. }
  48196. return mainFields;
  48197. }
  48198. function getPackageInfo(options) {
  48199. const { cache, extensions, pkg, mainFields, preserveSymlinks, useBrowserOverrides } = options;
  48200. let { pkgPath } = options;
  48201. if (cache.has(pkgPath)) {
  48202. return cache.get(pkgPath);
  48203. }
  48204. // browserify/resolve doesn't realpath paths returned in its packageFilter callback
  48205. if (!preserveSymlinks) {
  48206. pkgPath = realpathSync$2(pkgPath);
  48207. }
  48208. const pkgRoot = dirname(pkgPath);
  48209. const packageInfo = {
  48210. // copy as we are about to munge the `main` field of `pkg`.
  48211. packageJson: Object.assign({}, pkg),
  48212. // path to package.json file
  48213. packageJsonPath: pkgPath,
  48214. // directory containing the package.json
  48215. root: pkgRoot,
  48216. // which main field was used during resolution of this module (main, module, or browser)
  48217. resolvedMainField: 'main',
  48218. // whether the browser map was used to resolve the entry point to this module
  48219. browserMappedMain: false,
  48220. // the entry point of the module with respect to the selected main field and any
  48221. // relevant browser mappings.
  48222. resolvedEntryPoint: ''
  48223. };
  48224. let overriddenMain = false;
  48225. for (let i = 0; i < mainFields.length; i++) {
  48226. const field = mainFields[i];
  48227. if (typeof pkg[field] === 'string') {
  48228. pkg.main = pkg[field];
  48229. packageInfo.resolvedMainField = field;
  48230. overriddenMain = true;
  48231. break;
  48232. }
  48233. }
  48234. const internalPackageInfo = {
  48235. cachedPkg: pkg,
  48236. hasModuleSideEffects: () => null,
  48237. hasPackageEntry: overriddenMain !== false || mainFields.indexOf('main') !== -1,
  48238. packageBrowserField:
  48239. useBrowserOverrides &&
  48240. typeof pkg.browser === 'object' &&
  48241. Object.keys(pkg.browser).reduce((browser, key) => {
  48242. let resolved = pkg.browser[key];
  48243. if (resolved && resolved[0] === '.') {
  48244. resolved = resolve$1(pkgRoot, resolved);
  48245. }
  48246. /* eslint-disable no-param-reassign */
  48247. browser[key] = resolved;
  48248. if (key[0] === '.') {
  48249. const absoluteKey = resolve$1(pkgRoot, key);
  48250. browser[absoluteKey] = resolved;
  48251. if (!extname$1(key)) {
  48252. extensions.reduce((subBrowser, ext) => {
  48253. subBrowser[absoluteKey + ext] = subBrowser[key];
  48254. return subBrowser;
  48255. }, browser);
  48256. }
  48257. }
  48258. return browser;
  48259. }, {}),
  48260. packageInfo
  48261. };
  48262. const browserMap = internalPackageInfo.packageBrowserField;
  48263. if (
  48264. useBrowserOverrides &&
  48265. typeof pkg.browser === 'object' &&
  48266. // eslint-disable-next-line no-prototype-builtins
  48267. browserMap.hasOwnProperty(pkg.main)
  48268. ) {
  48269. packageInfo.resolvedEntryPoint = browserMap[pkg.main];
  48270. packageInfo.browserMappedMain = true;
  48271. } else {
  48272. // index.node is technically a valid default entrypoint as well...
  48273. packageInfo.resolvedEntryPoint = resolve$1(pkgRoot, pkg.main || 'index.js');
  48274. packageInfo.browserMappedMain = false;
  48275. }
  48276. const packageSideEffects = pkg.sideEffects;
  48277. if (typeof packageSideEffects === 'boolean') {
  48278. internalPackageInfo.hasModuleSideEffects = () => packageSideEffects;
  48279. } else if (Array.isArray(packageSideEffects)) {
  48280. internalPackageInfo.hasModuleSideEffects = createFilter$2(packageSideEffects, null, {
  48281. resolve: pkgRoot
  48282. });
  48283. }
  48284. cache.set(pkgPath, internalPackageInfo);
  48285. return internalPackageInfo;
  48286. }
  48287. function normalizeInput(input) {
  48288. if (Array.isArray(input)) {
  48289. return input;
  48290. } else if (typeof input === 'object') {
  48291. return Object.values(input);
  48292. }
  48293. // otherwise it's a string
  48294. return [input];
  48295. }
  48296. // Resolve module specifiers in order. Promise resolves to the first module that resolves
  48297. // successfully, or the error that resulted from the last attempted module resolution.
  48298. function resolveImportSpecifiers(importSpecifierList, resolveOptions) {
  48299. let promise = Promise.resolve();
  48300. for (let i = 0; i < importSpecifierList.length; i++) {
  48301. promise = promise.then((value) => {
  48302. // if we've already resolved to something, just return it.
  48303. if (value) {
  48304. return value;
  48305. }
  48306. return resolveId(importSpecifierList[i], resolveOptions).then((result) => {
  48307. if (!resolveOptions.preserveSymlinks) {
  48308. result = realpathSync$2(result);
  48309. }
  48310. return result;
  48311. });
  48312. });
  48313. if (i < importSpecifierList.length - 1) {
  48314. // swallow MODULE_NOT_FOUND errors from all but the last resolution
  48315. promise = promise.catch((error) => {
  48316. if (error.code !== 'MODULE_NOT_FOUND') {
  48317. throw error;
  48318. }
  48319. });
  48320. }
  48321. }
  48322. return promise;
  48323. }
  48324. /* eslint-disable no-param-reassign, no-shadow, no-undefined */
  48325. const builtins$2 = new Set(builtinModules_1);
  48326. const ES6_BROWSER_EMPTY = '\0node-resolve:empty.js';
  48327. const nullFn = () => null;
  48328. const deepFreeze = (object) => {
  48329. Object.freeze(object);
  48330. for (const value of Object.values(object)) {
  48331. if (typeof value === 'object' && !Object.isFrozen(value)) {
  48332. deepFreeze(value);
  48333. }
  48334. }
  48335. return object;
  48336. };
  48337. const defaults = {
  48338. customResolveOptions: {},
  48339. dedupe: [],
  48340. // It's important that .mjs is listed before .js so that Rollup will interpret npm modules
  48341. // which deploy both ESM .mjs and CommonJS .js files as ESM.
  48342. extensions: ['.mjs', '.js', '.json', '.node'],
  48343. resolveOnly: []
  48344. };
  48345. deepFreeze(cjs({}, defaults));
  48346. function nodeResolve(opts = {}) {
  48347. const options = Object.assign({}, defaults, opts);
  48348. const { customResolveOptions, extensions, jail } = options;
  48349. const warnings = [];
  48350. const packageInfoCache = new Map();
  48351. const idToPackageInfo = new Map();
  48352. const mainFields = getMainFields(options);
  48353. const useBrowserOverrides = mainFields.indexOf('browser') !== -1;
  48354. const isPreferBuiltinsSet = options.preferBuiltins === true || options.preferBuiltins === false;
  48355. const preferBuiltins = isPreferBuiltinsSet ? options.preferBuiltins : true;
  48356. const rootDir = options.rootDir || process.cwd();
  48357. let { dedupe } = options;
  48358. let rollupOptions;
  48359. if (options.only) {
  48360. warnings.push('node-resolve: The `only` options is deprecated, please use `resolveOnly`');
  48361. options.resolveOnly = options.only;
  48362. }
  48363. if (typeof dedupe !== 'function') {
  48364. dedupe = (importee) =>
  48365. options.dedupe.includes(importee) || options.dedupe.includes(getPackageName(importee));
  48366. }
  48367. const resolveOnly = options.resolveOnly.map((pattern) => {
  48368. if (pattern instanceof RegExp) {
  48369. return pattern;
  48370. }
  48371. const normalized = pattern.replace(/[\\^$*+?.()|[\]{}]/g, '\\$&');
  48372. return new RegExp(`^${normalized}$`);
  48373. });
  48374. const browserMapCache = new Map();
  48375. let preserveSymlinks;
  48376. return {
  48377. name: 'node-resolve',
  48378. buildStart(options) {
  48379. rollupOptions = options;
  48380. for (const warning of warnings) {
  48381. this.warn(warning);
  48382. }
  48383. ({ preserveSymlinks } = options);
  48384. },
  48385. generateBundle() {
  48386. readCachedFile.clear();
  48387. isFileCached.clear();
  48388. isDirCached.clear();
  48389. },
  48390. async resolveId(importee, importer) {
  48391. if (importee === ES6_BROWSER_EMPTY) {
  48392. return importee;
  48393. }
  48394. // ignore IDs with null character, these belong to other plugins
  48395. if (/\0/.test(importee)) return null;
  48396. // strip hash and query params from import
  48397. const [withoutHash, hash] = importee.split('#');
  48398. const [importPath, params] = withoutHash.split('?');
  48399. const importSuffix = `${params ? `?${params}` : ''}${hash ? `#${hash}` : ''}`;
  48400. importee = importPath;
  48401. const basedir = !importer || dedupe(importee) ? rootDir : dirname(importer);
  48402. // https://github.com/defunctzombie/package-browser-field-spec
  48403. const browser = browserMapCache.get(importer);
  48404. if (useBrowserOverrides && browser) {
  48405. const resolvedImportee = resolve$1(basedir, importee);
  48406. if (browser[importee] === false || browser[resolvedImportee] === false) {
  48407. return ES6_BROWSER_EMPTY;
  48408. }
  48409. const browserImportee =
  48410. browser[importee] ||
  48411. browser[resolvedImportee] ||
  48412. browser[`${resolvedImportee}.js`] ||
  48413. browser[`${resolvedImportee}.json`];
  48414. if (browserImportee) {
  48415. importee = browserImportee;
  48416. }
  48417. }
  48418. const parts = importee.split(/[/\\]/);
  48419. let id = parts.shift();
  48420. let isRelativeImport = false;
  48421. if (id[0] === '@' && parts.length > 0) {
  48422. // scoped packages
  48423. id += `/${parts.shift()}`;
  48424. } else if (id[0] === '.') {
  48425. // an import relative to the parent dir of the importer
  48426. id = resolve$1(basedir, importee);
  48427. isRelativeImport = true;
  48428. }
  48429. if (
  48430. !isRelativeImport &&
  48431. resolveOnly.length &&
  48432. !resolveOnly.some((pattern) => pattern.test(id))
  48433. ) {
  48434. if (normalizeInput(rollupOptions.input).includes(importee)) {
  48435. return null;
  48436. }
  48437. return false;
  48438. }
  48439. let hasModuleSideEffects = nullFn;
  48440. let hasPackageEntry = true;
  48441. let packageBrowserField = false;
  48442. let packageInfo;
  48443. const filter = (pkg, pkgPath) => {
  48444. const info = getPackageInfo({
  48445. cache: packageInfoCache,
  48446. extensions,
  48447. pkg,
  48448. pkgPath,
  48449. mainFields,
  48450. preserveSymlinks,
  48451. useBrowserOverrides
  48452. });
  48453. ({ packageInfo, hasModuleSideEffects, hasPackageEntry, packageBrowserField } = info);
  48454. return info.cachedPkg;
  48455. };
  48456. let resolveOptions = {
  48457. basedir,
  48458. packageFilter: filter,
  48459. readFile: readCachedFile,
  48460. isFile: isFileCached,
  48461. isDirectory: isDirCached,
  48462. extensions
  48463. };
  48464. if (preserveSymlinks !== undefined) {
  48465. resolveOptions.preserveSymlinks = preserveSymlinks;
  48466. }
  48467. const importSpecifierList = [];
  48468. if (importer === undefined && !importee[0].match(/^\.?\.?\//)) {
  48469. // For module graph roots (i.e. when importer is undefined), we
  48470. // need to handle 'path fragments` like `foo/bar` that are commonly
  48471. // found in rollup config files. If importee doesn't look like a
  48472. // relative or absolute path, we make it relative and attempt to
  48473. // resolve it. If we don't find anything, we try resolving it as we
  48474. // got it.
  48475. importSpecifierList.push(`./${importee}`);
  48476. }
  48477. const importeeIsBuiltin = builtins$2.has(importee);
  48478. if (importeeIsBuiltin && (!preferBuiltins || !isPreferBuiltinsSet)) {
  48479. // The `resolve` library will not resolve packages with the same
  48480. // name as a node built-in module. If we're resolving something
  48481. // that's a builtin, and we don't prefer to find built-ins, we
  48482. // first try to look up a local module with that name. If we don't
  48483. // find anything, we resolve the builtin which just returns back
  48484. // the built-in's name.
  48485. importSpecifierList.push(`${importee}/`);
  48486. }
  48487. // TypeScript files may import '.js' to refer to either '.ts' or '.tsx'
  48488. if (importer && importee.endsWith('.js')) {
  48489. for (const ext of ['.ts', '.tsx']) {
  48490. if (importer.endsWith(ext) && extensions.includes(ext)) {
  48491. importSpecifierList.push(importee.replace(/.js$/, ext));
  48492. }
  48493. }
  48494. }
  48495. importSpecifierList.push(importee);
  48496. resolveOptions = Object.assign(resolveOptions, customResolveOptions);
  48497. try {
  48498. let resolved = await resolveImportSpecifiers(importSpecifierList, resolveOptions);
  48499. if (resolved && packageBrowserField) {
  48500. if (Object.prototype.hasOwnProperty.call(packageBrowserField, resolved)) {
  48501. if (!packageBrowserField[resolved]) {
  48502. browserMapCache.set(resolved, packageBrowserField);
  48503. return ES6_BROWSER_EMPTY;
  48504. }
  48505. resolved = packageBrowserField[resolved];
  48506. }
  48507. browserMapCache.set(resolved, packageBrowserField);
  48508. }
  48509. if (hasPackageEntry && !preserveSymlinks && resolved) {
  48510. const fileExists = await exists(resolved);
  48511. if (fileExists) {
  48512. resolved = await realpath(resolved);
  48513. }
  48514. }
  48515. idToPackageInfo.set(resolved, packageInfo);
  48516. if (hasPackageEntry) {
  48517. if (builtins$2.has(resolved) && preferBuiltins && isPreferBuiltinsSet) {
  48518. return null;
  48519. } else if (importeeIsBuiltin && preferBuiltins) {
  48520. if (!isPreferBuiltinsSet) {
  48521. this.warn(
  48522. `preferring built-in module '${importee}' over local alternative at '${resolved}', pass 'preferBuiltins: false' to disable this behavior or 'preferBuiltins: true' to disable this warning`
  48523. );
  48524. }
  48525. return null;
  48526. } else if (jail && resolved.indexOf(normalize$1(jail.trim(sep))) !== 0) {
  48527. return null;
  48528. }
  48529. }
  48530. if (resolved && options.modulesOnly) {
  48531. const code = await readFile(resolved, 'utf-8');
  48532. if (isModule(code)) {
  48533. return {
  48534. id: `${resolved}${importSuffix}`,
  48535. moduleSideEffects: hasModuleSideEffects(resolved)
  48536. };
  48537. }
  48538. return null;
  48539. }
  48540. const result = {
  48541. id: `${resolved}${importSuffix}`,
  48542. moduleSideEffects: hasModuleSideEffects(resolved)
  48543. };
  48544. return result;
  48545. } catch (error) {
  48546. return null;
  48547. }
  48548. },
  48549. load(importee) {
  48550. if (importee === ES6_BROWSER_EMPTY) {
  48551. return 'export default {};';
  48552. }
  48553. return null;
  48554. },
  48555. getPackageInfoForId(id) {
  48556. return idToPackageInfo.get(id);
  48557. }
  48558. };
  48559. }
  48560. const addExtension = function addExtension(filename, ext = '.js') {
  48561. let result = `${filename}`;
  48562. if (!extname$1(filename))
  48563. result += ext;
  48564. return result;
  48565. };
  48566. class WalkerBase {constructor() { WalkerBase.prototype.__init.call(this);WalkerBase.prototype.__init2.call(this);WalkerBase.prototype.__init3.call(this);WalkerBase.prototype.__init4.call(this); }
  48567. __init() {this.should_skip = false;}
  48568. __init2() {this.should_remove = false;}
  48569. __init3() {this.replacement = null;}
  48570. __init4() {this.context = {
  48571. skip: () => (this.should_skip = true),
  48572. remove: () => (this.should_remove = true),
  48573. replace: (node) => (this.replacement = node)
  48574. };}
  48575. replace(parent, prop, index, node) {
  48576. if (parent) {
  48577. if (index !== null) {
  48578. parent[prop][index] = node;
  48579. } else {
  48580. parent[prop] = node;
  48581. }
  48582. }
  48583. }
  48584. remove(parent, prop, index) {
  48585. if (parent) {
  48586. if (index !== null) {
  48587. parent[prop].splice(index, 1);
  48588. } else {
  48589. delete parent[prop];
  48590. }
  48591. }
  48592. }
  48593. }
  48594. class SyncWalkerClass extends WalkerBase {
  48595. constructor(walker) {
  48596. super();
  48597. this.enter = walker.enter;
  48598. this.leave = walker.leave;
  48599. }
  48600. visit(
  48601. node,
  48602. parent,
  48603. enter,
  48604. leave,
  48605. prop,
  48606. index
  48607. ) {
  48608. if (node) {
  48609. if (enter) {
  48610. const _should_skip = this.should_skip;
  48611. const _should_remove = this.should_remove;
  48612. const _replacement = this.replacement;
  48613. this.should_skip = false;
  48614. this.should_remove = false;
  48615. this.replacement = null;
  48616. enter.call(this.context, node, parent, prop, index);
  48617. if (this.replacement) {
  48618. node = this.replacement;
  48619. this.replace(parent, prop, index, node);
  48620. }
  48621. if (this.should_remove) {
  48622. this.remove(parent, prop, index);
  48623. }
  48624. const skipped = this.should_skip;
  48625. const removed = this.should_remove;
  48626. this.should_skip = _should_skip;
  48627. this.should_remove = _should_remove;
  48628. this.replacement = _replacement;
  48629. if (skipped) return node;
  48630. if (removed) return null;
  48631. }
  48632. for (const key in node) {
  48633. const value = (node )[key];
  48634. if (typeof value !== "object") {
  48635. continue;
  48636. } else if (Array.isArray(value)) {
  48637. for (let i = 0; i < value.length; i += 1) {
  48638. if (value[i] !== null && typeof value[i].type === 'string') {
  48639. if (!this.visit(value[i], node, enter, leave, key, i)) {
  48640. // removed
  48641. i--;
  48642. }
  48643. }
  48644. }
  48645. } else if (value !== null && typeof value.type === "string") {
  48646. this.visit(value, node, enter, leave, key, null);
  48647. }
  48648. }
  48649. if (leave) {
  48650. const _replacement = this.replacement;
  48651. const _should_remove = this.should_remove;
  48652. this.replacement = null;
  48653. this.should_remove = false;
  48654. leave.call(this.context, node, parent, prop, index);
  48655. if (this.replacement) {
  48656. node = this.replacement;
  48657. this.replace(parent, prop, index, node);
  48658. }
  48659. if (this.should_remove) {
  48660. this.remove(parent, prop, index);
  48661. }
  48662. const removed = this.should_remove;
  48663. this.replacement = _replacement;
  48664. this.should_remove = _should_remove;
  48665. if (removed) return null;
  48666. }
  48667. }
  48668. return node;
  48669. }
  48670. }
  48671. function walk(ast, walker) {
  48672. const instance = new SyncWalkerClass(walker);
  48673. return instance.visit(ast, null, walker.enter, walker.leave);
  48674. }
  48675. const extractors = {
  48676. ArrayPattern(names, param) {
  48677. for (const element of param.elements) {
  48678. if (element)
  48679. extractors[element.type](names, element);
  48680. }
  48681. },
  48682. AssignmentPattern(names, param) {
  48683. extractors[param.left.type](names, param.left);
  48684. },
  48685. Identifier(names, param) {
  48686. names.push(param.name);
  48687. },
  48688. MemberExpression() { },
  48689. ObjectPattern(names, param) {
  48690. for (const prop of param.properties) {
  48691. // @ts-ignore Typescript reports that this is not a valid type
  48692. if (prop.type === 'RestElement') {
  48693. extractors.RestElement(names, prop);
  48694. }
  48695. else {
  48696. extractors[prop.value.type](names, prop.value);
  48697. }
  48698. }
  48699. },
  48700. RestElement(names, param) {
  48701. extractors[param.argument.type](names, param.argument);
  48702. }
  48703. };
  48704. const extractAssignedNames = function extractAssignedNames(param) {
  48705. const names = [];
  48706. extractors[param.type](names, param);
  48707. return names;
  48708. };
  48709. const blockDeclarations = {
  48710. const: true,
  48711. let: true
  48712. };
  48713. class Scope {
  48714. constructor(options = {}) {
  48715. this.parent = options.parent;
  48716. this.isBlockScope = !!options.block;
  48717. this.declarations = Object.create(null);
  48718. if (options.params) {
  48719. options.params.forEach((param) => {
  48720. extractAssignedNames(param).forEach((name) => {
  48721. this.declarations[name] = true;
  48722. });
  48723. });
  48724. }
  48725. }
  48726. addDeclaration(node, isBlockDeclaration, isVar) {
  48727. if (!isBlockDeclaration && this.isBlockScope) {
  48728. // it's a `var` or function node, and this
  48729. // is a block scope, so we need to go up
  48730. this.parent.addDeclaration(node, isBlockDeclaration, isVar);
  48731. }
  48732. else if (node.id) {
  48733. extractAssignedNames(node.id).forEach((name) => {
  48734. this.declarations[name] = true;
  48735. });
  48736. }
  48737. }
  48738. contains(name) {
  48739. return this.declarations[name] || (this.parent ? this.parent.contains(name) : false);
  48740. }
  48741. }
  48742. const attachScopes = function attachScopes(ast, propertyName = 'scope') {
  48743. let scope = new Scope();
  48744. walk(ast, {
  48745. enter(n, parent) {
  48746. const node = n;
  48747. // function foo () {...}
  48748. // class Foo {...}
  48749. if (/(Function|Class)Declaration/.test(node.type)) {
  48750. scope.addDeclaration(node, false, false);
  48751. }
  48752. // var foo = 1
  48753. if (node.type === 'VariableDeclaration') {
  48754. const { kind } = node;
  48755. const isBlockDeclaration = blockDeclarations[kind];
  48756. node.declarations.forEach((declaration) => {
  48757. scope.addDeclaration(declaration, isBlockDeclaration, true);
  48758. });
  48759. }
  48760. let newScope;
  48761. // create new function scope
  48762. if (/Function/.test(node.type)) {
  48763. const func = node;
  48764. newScope = new Scope({
  48765. parent: scope,
  48766. block: false,
  48767. params: func.params
  48768. });
  48769. // named function expressions - the name is considered
  48770. // part of the function's scope
  48771. if (func.type === 'FunctionExpression' && func.id) {
  48772. newScope.addDeclaration(func, false, false);
  48773. }
  48774. }
  48775. // create new for scope
  48776. if (/For(In|Of)?Statement/.test(node.type)) {
  48777. newScope = new Scope({
  48778. parent: scope,
  48779. block: true
  48780. });
  48781. }
  48782. // create new block scope
  48783. if (node.type === 'BlockStatement' && !/Function/.test(parent.type)) {
  48784. newScope = new Scope({
  48785. parent: scope,
  48786. block: true
  48787. });
  48788. }
  48789. // catch clause has its own block scope
  48790. if (node.type === 'CatchClause') {
  48791. newScope = new Scope({
  48792. parent: scope,
  48793. params: node.param ? [node.param] : [],
  48794. block: true
  48795. });
  48796. }
  48797. if (newScope) {
  48798. Object.defineProperty(node, propertyName, {
  48799. value: newScope,
  48800. configurable: true
  48801. });
  48802. scope = newScope;
  48803. }
  48804. },
  48805. leave(n) {
  48806. const node = n;
  48807. if (node[propertyName])
  48808. scope = scope.parent;
  48809. }
  48810. });
  48811. return scope;
  48812. };
  48813. // Helper since Typescript can't detect readonly arrays with Array.isArray
  48814. function isArray$1(arg) {
  48815. return Array.isArray(arg);
  48816. }
  48817. function ensureArray$1(thing) {
  48818. if (isArray$1(thing))
  48819. return thing;
  48820. if (thing == null)
  48821. return [];
  48822. return [thing];
  48823. }
  48824. const normalizePath = function (filename) {
  48825. return filename.split(win32$1.sep).join(posix$1.sep);
  48826. };
  48827. function getMatcherString$1(id, resolutionBase) {
  48828. if (resolutionBase === false || isAbsolute$1(id) || id.startsWith('*')) {
  48829. return id;
  48830. }
  48831. // resolve('') is valid and will default to process.cwd()
  48832. const basePath = normalizePath(resolve$1(resolutionBase || ''))
  48833. // escape all possible (posix + win) path characters that might interfere with regex
  48834. .replace(/[-^$*+?.()|[\]{}]/g, '\\$&');
  48835. // Note that we use posix.join because:
  48836. // 1. the basePath has been normalized to use /
  48837. // 2. the incoming glob (id) matcher, also uses /
  48838. // otherwise Node will force backslash (\) on windows
  48839. return posix$1.join(basePath, id);
  48840. }
  48841. const createFilter$1 = function createFilter(include, exclude, options) {
  48842. const resolutionBase = options && options.resolve;
  48843. const getMatcher = (id) => id instanceof RegExp
  48844. ? id
  48845. : {
  48846. test: (what) => {
  48847. // this refactor is a tad overly verbose but makes for easy debugging
  48848. const pattern = getMatcherString$1(id, resolutionBase);
  48849. const fn = picomatch(pattern, { dot: true });
  48850. const result = fn(what);
  48851. return result;
  48852. }
  48853. };
  48854. const includeMatchers = ensureArray$1(include).map(getMatcher);
  48855. const excludeMatchers = ensureArray$1(exclude).map(getMatcher);
  48856. return function result(id) {
  48857. if (typeof id !== 'string')
  48858. return false;
  48859. if (/\0/.test(id))
  48860. return false;
  48861. const pathId = normalizePath(id);
  48862. for (let i = 0; i < excludeMatchers.length; ++i) {
  48863. const matcher = excludeMatchers[i];
  48864. if (matcher.test(pathId))
  48865. return false;
  48866. }
  48867. for (let i = 0; i < includeMatchers.length; ++i) {
  48868. const matcher = includeMatchers[i];
  48869. if (matcher.test(pathId))
  48870. return true;
  48871. }
  48872. return !includeMatchers.length;
  48873. };
  48874. };
  48875. const reservedWords$1 = 'break case class catch const continue debugger default delete do else export extends finally for function if import in instanceof let new return super switch this throw try typeof var void while with yield enum await implements package protected static interface private public';
  48876. const builtins$1 = 'arguments Infinity NaN undefined null true false eval uneval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Symbol Error EvalError InternalError RangeError ReferenceError SyntaxError TypeError URIError Number Math Date String RegExp Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array Map Set WeakMap WeakSet SIMD ArrayBuffer DataView JSON Promise Generator GeneratorFunction Reflect Proxy Intl';
  48877. const forbiddenIdentifiers$1 = new Set(`${reservedWords$1} ${builtins$1}`.split(' '));
  48878. forbiddenIdentifiers$1.add('');
  48879. const makeLegalIdentifier = function makeLegalIdentifier(str) {
  48880. let identifier = str
  48881. .replace(/-(\w)/g, (_, letter) => letter.toUpperCase())
  48882. .replace(/[^$_a-zA-Z0-9]/g, '_');
  48883. if (/\d/.test(identifier[0]) || forbiddenIdentifiers$1.has(identifier)) {
  48884. identifier = `_${identifier}`;
  48885. }
  48886. return identifier || '_';
  48887. };
  48888. function stringify(obj) {
  48889. return (JSON.stringify(obj) || 'undefined').replace(/[\u2028\u2029]/g, (char) => `\\u${`000${char.charCodeAt(0).toString(16)}`.slice(-4)}`);
  48890. }
  48891. function serializeArray(arr, indent, baseIndent) {
  48892. let output = '[';
  48893. const separator = indent ? `\n${baseIndent}${indent}` : '';
  48894. for (let i = 0; i < arr.length; i++) {
  48895. const key = arr[i];
  48896. output += `${i > 0 ? ',' : ''}${separator}${serialize(key, indent, baseIndent + indent)}`;
  48897. }
  48898. return `${output}${indent ? `\n${baseIndent}` : ''}]`;
  48899. }
  48900. function serializeObject(obj, indent, baseIndent) {
  48901. let output = '{';
  48902. const separator = indent ? `\n${baseIndent}${indent}` : '';
  48903. const entries = Object.entries(obj);
  48904. for (let i = 0; i < entries.length; i++) {
  48905. const [key, value] = entries[i];
  48906. const stringKey = makeLegalIdentifier(key) === key ? key : stringify(key);
  48907. output += `${i > 0 ? ',' : ''}${separator}${stringKey}:${indent ? ' ' : ''}${serialize(value, indent, baseIndent + indent)}`;
  48908. }
  48909. return `${output}${indent ? `\n${baseIndent}` : ''}}`;
  48910. }
  48911. function serialize(obj, indent, baseIndent) {
  48912. if (obj === Infinity)
  48913. return 'Infinity';
  48914. if (obj === -Infinity)
  48915. return '-Infinity';
  48916. if (obj === 0 && 1 / obj === -Infinity)
  48917. return '-0';
  48918. if (obj instanceof Date)
  48919. return `new Date(${obj.getTime()})`;
  48920. if (obj instanceof RegExp)
  48921. return obj.toString();
  48922. if (obj !== obj)
  48923. return 'NaN'; // eslint-disable-line no-self-compare
  48924. if (Array.isArray(obj))
  48925. return serializeArray(obj, indent, baseIndent);
  48926. if (obj === null)
  48927. return 'null';
  48928. if (typeof obj === 'object')
  48929. return serializeObject(obj, indent, baseIndent);
  48930. return stringify(obj);
  48931. }
  48932. const dataToEsm = function dataToEsm(data, options = {}) {
  48933. const t = options.compact ? '' : 'indent' in options ? options.indent : '\t';
  48934. const _ = options.compact ? '' : ' ';
  48935. const n = options.compact ? '' : '\n';
  48936. const declarationType = options.preferConst ? 'const' : 'var';
  48937. if (options.namedExports === false ||
  48938. typeof data !== 'object' ||
  48939. Array.isArray(data) ||
  48940. data instanceof Date ||
  48941. data instanceof RegExp ||
  48942. data === null) {
  48943. const code = serialize(data, options.compact ? null : t, '');
  48944. const magic = _ || (/^[{[\-\/]/.test(code) ? '' : ' '); // eslint-disable-line no-useless-escape
  48945. return `export default${magic}${code};`;
  48946. }
  48947. let namedExportCode = '';
  48948. const defaultExportRows = [];
  48949. for (const [key, value] of Object.entries(data)) {
  48950. if (key === makeLegalIdentifier(key)) {
  48951. if (options.objectShorthand)
  48952. defaultExportRows.push(key);
  48953. else
  48954. defaultExportRows.push(`${key}:${_}${key}`);
  48955. namedExportCode += `export ${declarationType} ${key}${_}=${_}${serialize(value, options.compact ? null : t, '')};${n}`;
  48956. }
  48957. else {
  48958. defaultExportRows.push(`${stringify(key)}:${_}${serialize(value, options.compact ? null : t, '')}`);
  48959. }
  48960. }
  48961. return `${namedExportCode}export default${_}{${n}${t}${defaultExportRows.join(`,${n}${t}`)}${n}};${n}`;
  48962. };
  48963. // TODO: remove this in next major
  48964. var index = {
  48965. addExtension,
  48966. attachScopes,
  48967. createFilter: createFilter$1,
  48968. dataToEsm,
  48969. extractAssignedNames,
  48970. makeLegalIdentifier,
  48971. normalizePath
  48972. };
  48973. // Helper since Typescript can't detect readonly arrays with Array.isArray
  48974. function isArray(arg) {
  48975. return Array.isArray(arg);
  48976. }
  48977. function ensureArray(thing) {
  48978. if (isArray(thing))
  48979. return thing;
  48980. if (thing == null)
  48981. return [];
  48982. return [thing];
  48983. }
  48984. function getMatcherString(id, resolutionBase) {
  48985. if (resolutionBase === false) {
  48986. return id;
  48987. }
  48988. // resolve('') is valid and will default to process.cwd()
  48989. const basePath = resolve$1(resolutionBase || '')
  48990. .split(sep)
  48991. .join('/')
  48992. // escape all possible (posix + win) path characters that might interfere with regex
  48993. .replace(/[-^$*+?.()|[\]{}]/g, '\\$&');
  48994. // Note that we use posix.join because:
  48995. // 1. the basePath has been normalized to use /
  48996. // 2. the incoming glob (id) matcher, also uses /
  48997. // otherwise Node will force backslash (\) on windows
  48998. return posix$1.join(basePath, id);
  48999. }
  49000. const createFilter = function createFilter(include, exclude, options) {
  49001. const resolutionBase = options && options.resolve;
  49002. const getMatcher = (id) => id instanceof RegExp
  49003. ? id
  49004. : {
  49005. test: (what) => {
  49006. // this refactor is a tad overly verbose but makes for easy debugging
  49007. const pattern = getMatcherString(id, resolutionBase);
  49008. const fn = picomatch(pattern, { dot: true });
  49009. const result = fn(what);
  49010. return result;
  49011. }
  49012. };
  49013. const includeMatchers = ensureArray(include).map(getMatcher);
  49014. const excludeMatchers = ensureArray(exclude).map(getMatcher);
  49015. return function result(id) {
  49016. if (typeof id !== 'string')
  49017. return false;
  49018. if (/\0/.test(id))
  49019. return false;
  49020. const pathId = id.split(sep).join('/');
  49021. for (let i = 0; i < excludeMatchers.length; ++i) {
  49022. const matcher = excludeMatchers[i];
  49023. if (matcher.test(pathId))
  49024. return false;
  49025. }
  49026. for (let i = 0; i < includeMatchers.length; ++i) {
  49027. const matcher = includeMatchers[i];
  49028. if (matcher.test(pathId))
  49029. return true;
  49030. }
  49031. return !includeMatchers.length;
  49032. };
  49033. };
  49034. const reservedWords = 'break case class catch const continue debugger default delete do else export extends finally for function if import in instanceof let new return super switch this throw try typeof var void while with yield enum await implements package protected static interface private public';
  49035. const builtins = 'arguments Infinity NaN undefined null true false eval uneval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Symbol Error EvalError InternalError RangeError ReferenceError SyntaxError TypeError URIError Number Math Date String RegExp Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array Map Set WeakMap WeakSet SIMD ArrayBuffer DataView JSON Promise Generator GeneratorFunction Reflect Proxy Intl';
  49036. const forbiddenIdentifiers = new Set(`${reservedWords} ${builtins}`.split(' '));
  49037. forbiddenIdentifiers.add('');
  49038. function escape(str) {
  49039. return str.replace(/[-[\]/{}()*+?.\\^$|]/g, '\\$&');
  49040. }
  49041. function ensureFunction(functionOrValue) {
  49042. if (typeof functionOrValue === 'function') { return functionOrValue; }
  49043. return function () { return functionOrValue; };
  49044. }
  49045. function longest(a, b) {
  49046. return b.length - a.length;
  49047. }
  49048. function getReplacements(options) {
  49049. if (options.values) {
  49050. return Object.assign({}, options.values);
  49051. }
  49052. var values = Object.assign({}, options);
  49053. delete values.delimiters;
  49054. delete values.include;
  49055. delete values.exclude;
  49056. delete values.sourcemap;
  49057. delete values.sourceMap;
  49058. return values;
  49059. }
  49060. function mapToFunctions(object) {
  49061. return Object.keys(object).reduce(function (fns, key) {
  49062. var functions = Object.assign({}, fns);
  49063. functions[key] = ensureFunction(object[key]);
  49064. return functions;
  49065. }, {});
  49066. }
  49067. function replace(options) {
  49068. if ( options === void 0 ) options = {};
  49069. var filter = createFilter(options.include, options.exclude);
  49070. var delimiters = options.delimiters;
  49071. var functionValues = mapToFunctions(getReplacements(options));
  49072. var keys = Object.keys(functionValues)
  49073. .sort(longest)
  49074. .map(escape);
  49075. var pattern = delimiters
  49076. ? new RegExp(((escape(delimiters[0])) + "(" + (keys.join('|')) + ")" + (escape(delimiters[1]))), 'g')
  49077. : new RegExp(("\\b(" + (keys.join('|')) + ")\\b"), 'g');
  49078. return {
  49079. name: 'replace',
  49080. renderChunk: function renderChunk(code, chunk) {
  49081. var id = chunk.fileName;
  49082. if (!keys.length) { return null; }
  49083. if (!filter(id)) { return null; }
  49084. return executeReplacement(code, id);
  49085. },
  49086. transform: function transform(code, id) {
  49087. if (!keys.length) { return null; }
  49088. if (!filter(id)) { return null; }
  49089. return executeReplacement(code, id);
  49090. }
  49091. };
  49092. function executeReplacement(code, id) {
  49093. var magicString = new MagicString(code);
  49094. if (!codeHasReplacements(code, id, magicString)) {
  49095. return null;
  49096. }
  49097. var result = { code: magicString.toString() };
  49098. if (isSourceMapEnabled()) {
  49099. result.map = magicString.generateMap({ hires: true });
  49100. }
  49101. return result;
  49102. }
  49103. function codeHasReplacements(code, id, magicString) {
  49104. var result = false;
  49105. var match;
  49106. // eslint-disable-next-line no-cond-assign
  49107. while ((match = pattern.exec(code))) {
  49108. result = true;
  49109. var start = match.index;
  49110. var end = start + match[0].length;
  49111. var replacement = String(functionValues[match[1]](id));
  49112. magicString.overwrite(start, end, replacement);
  49113. }
  49114. return result;
  49115. }
  49116. function isSourceMapEnabled() {
  49117. return options.sourceMap !== false && options.sourcemap !== false;
  49118. }
  49119. }
  49120. const serverPlugin = (config, platform) => {
  49121. const isHydrateBundle = platform === 'hydrate';
  49122. const serverVarid = `@removed-server-code`;
  49123. const isServerOnlyModule = (id) => {
  49124. if (isString$1(id)) {
  49125. id = normalizeFsPath(id);
  49126. return id.includes('.server/') || id.endsWith('.server');
  49127. }
  49128. return false;
  49129. };
  49130. const externals = isHydrateBundle
  49131. ? config.outputTargets.filter(isOutputTargetHydrate).flatMap((o) => o.external)
  49132. : [];
  49133. return {
  49134. name: 'serverPlugin',
  49135. resolveId(id, importer) {
  49136. if (id === serverVarid) {
  49137. return id;
  49138. }
  49139. if (isHydrateBundle) {
  49140. if (externals.includes(id)) {
  49141. // don't attempt to bundle node builtins for the hydrate bundle
  49142. return {
  49143. id,
  49144. external: true,
  49145. };
  49146. }
  49147. if (isServerOnlyModule(importer) && !id.startsWith('.') && !isAbsolute$1(id)) {
  49148. // do not bundle if the importer is a server-only module
  49149. // and the module it is importing is a node module
  49150. return {
  49151. id,
  49152. external: true,
  49153. };
  49154. }
  49155. }
  49156. else {
  49157. if (isServerOnlyModule(id)) {
  49158. // any path that has .server in it shouldn't actually
  49159. // be bundled in the web build, only the hydrate build
  49160. return serverVarid;
  49161. }
  49162. }
  49163. return null;
  49164. },
  49165. load(id) {
  49166. if (id === serverVarid) {
  49167. return {
  49168. code: 'export default {};',
  49169. syntheticNamedExports: true,
  49170. };
  49171. }
  49172. return null;
  49173. },
  49174. };
  49175. };
  49176. const userIndexPlugin = (config, compilerCtx) => {
  49177. return {
  49178. name: 'userIndexPlugin',
  49179. async resolveId(importee) {
  49180. if (importee === USER_INDEX_ENTRY_ID) {
  49181. const usersIndexJsPath = join(config.srcDir, 'index.ts');
  49182. const hasUserIndex = await compilerCtx.fs.access(usersIndexJsPath);
  49183. if (hasUserIndex) {
  49184. return usersIndexJsPath;
  49185. }
  49186. return importee;
  49187. }
  49188. return null;
  49189. },
  49190. async load(id) {
  49191. if (id === USER_INDEX_ENTRY_ID) {
  49192. return `//! Autogenerated index`;
  49193. }
  49194. return null;
  49195. },
  49196. };
  49197. };
  49198. const workerPlugin = (config, compilerCtx, buildCtx, platform, inlineWorkers) => {
  49199. if (platform === 'worker' || platform === 'hydrate') {
  49200. return {
  49201. name: 'workerPlugin',
  49202. transform(_, id) {
  49203. if (id.endsWith('?worker') || id.endsWith('?worker-inline')) {
  49204. return getMockedWorkerMain();
  49205. }
  49206. return null;
  49207. },
  49208. };
  49209. }
  49210. const workersMap = new Map();
  49211. return {
  49212. name: 'workerPlugin',
  49213. buildStart() {
  49214. workersMap.clear();
  49215. },
  49216. resolveId(id) {
  49217. if (id === WORKER_HELPER_ID) {
  49218. return {
  49219. id,
  49220. moduleSideEffects: false,
  49221. };
  49222. }
  49223. return null;
  49224. },
  49225. load(id) {
  49226. if (id === WORKER_HELPER_ID) {
  49227. return WORKER_HELPERS;
  49228. }
  49229. return null;
  49230. },
  49231. async transform(_, id) {
  49232. if (/\0/.test(id)) {
  49233. return null;
  49234. }
  49235. // Canonical worker path
  49236. if (id.endsWith('?worker')) {
  49237. const workerEntryPath = normalizeFsPath(id);
  49238. const workerName = getWorkerName(workerEntryPath);
  49239. const { code, dependencies, workerMsgId } = await getWorker(config, compilerCtx, buildCtx, this, workersMap, workerEntryPath);
  49240. const referenceId = this.emitFile({
  49241. type: 'asset',
  49242. source: code,
  49243. name: workerName + '.js',
  49244. });
  49245. dependencies.forEach((id) => this.addWatchFile(id));
  49246. return {
  49247. code: getWorkerMain(referenceId, workerName, workerMsgId),
  49248. moduleSideEffects: false,
  49249. };
  49250. }
  49251. else if (id.endsWith('?worker-inline')) {
  49252. const workerEntryPath = normalizeFsPath(id);
  49253. const workerName = getWorkerName(workerEntryPath);
  49254. const { code, dependencies, workerMsgId } = await getWorker(config, compilerCtx, buildCtx, this, workersMap, workerEntryPath);
  49255. const referenceId = this.emitFile({
  49256. type: 'asset',
  49257. source: code,
  49258. name: workerName + '.js',
  49259. });
  49260. dependencies.forEach((id) => this.addWatchFile(id));
  49261. return {
  49262. code: getInlineWorker(referenceId, workerName, workerMsgId),
  49263. moduleSideEffects: false,
  49264. };
  49265. }
  49266. // Proxy worker path
  49267. const workerEntryPath = getWorkerEntryPath(id);
  49268. if (workerEntryPath != null) {
  49269. const worker = await getWorker(config, compilerCtx, buildCtx, this, workersMap, workerEntryPath);
  49270. if (worker) {
  49271. if (inlineWorkers) {
  49272. return {
  49273. code: getInlineWorkerProxy(workerEntryPath, worker.workerMsgId, worker.exports),
  49274. moduleSideEffects: false,
  49275. };
  49276. }
  49277. else {
  49278. return {
  49279. code: getWorkerProxy(workerEntryPath, worker.exports),
  49280. moduleSideEffects: false,
  49281. };
  49282. }
  49283. }
  49284. }
  49285. return null;
  49286. },
  49287. };
  49288. };
  49289. const getWorkerEntryPath = (id) => {
  49290. if (WORKER_SUFFIX.some((p) => id.endsWith(p))) {
  49291. return normalizeFsPath(id);
  49292. }
  49293. return null;
  49294. };
  49295. const getWorker = async (config, compilerCtx, buildCtx, ctx, workersMap, workerEntryPath) => {
  49296. let worker = workersMap.get(workerEntryPath);
  49297. if (!worker) {
  49298. worker = await buildWorker(config, compilerCtx, buildCtx, ctx, workerEntryPath);
  49299. workersMap.set(workerEntryPath, worker);
  49300. }
  49301. return worker;
  49302. };
  49303. const getWorkerName = (id) => {
  49304. const parts = id.split('/').filter((i) => !i.includes('index'));
  49305. id = parts[parts.length - 1];
  49306. return id.replace('.tsx', '').replace('.ts', '');
  49307. };
  49308. const buildWorker = async (config, compilerCtx, buildCtx, ctx, workerEntryPath) => {
  49309. const workerName = getWorkerName(workerEntryPath);
  49310. const workerMsgId = `stencil.${workerName}`;
  49311. const build = await bundleOutput(config, compilerCtx, buildCtx, {
  49312. platform: 'worker',
  49313. id: workerName,
  49314. inputs: {
  49315. [workerName]: workerEntryPath,
  49316. },
  49317. inlineDynamicImports: true,
  49318. });
  49319. if (build) {
  49320. // Generate commonjs output so we can intercept exports at runtime
  49321. const output = await build.generate({
  49322. format: 'commonjs',
  49323. banner: `${generatePreamble(config)}\n(()=>{\n`,
  49324. footer: '})();',
  49325. intro: getWorkerIntro(workerMsgId, config.devMode),
  49326. esModule: false,
  49327. preferConst: true,
  49328. externalLiveBindings: false,
  49329. });
  49330. const entryPoint = output.output[0];
  49331. if (entryPoint.imports.length > 0) {
  49332. ctx.error('Workers should not have any external imports: ' + JSON.stringify(entryPoint.imports));
  49333. }
  49334. // Optimize code
  49335. let code = entryPoint.code;
  49336. const results = await optimizeModule(config, compilerCtx, {
  49337. input: code,
  49338. sourceTarget: config.buildEs5 ? 'es5' : 'es2017',
  49339. isCore: false,
  49340. minify: config.minifyJs,
  49341. inlineHelpers: true,
  49342. });
  49343. buildCtx.diagnostics.push(...results.diagnostics);
  49344. if (!hasError(results.diagnostics)) {
  49345. code = results.output;
  49346. }
  49347. return {
  49348. code,
  49349. exports: entryPoint.exports,
  49350. workerMsgId,
  49351. dependencies: Object.keys(entryPoint.modules).filter((id) => !/\0/.test(id) && id !== workerEntryPath),
  49352. };
  49353. }
  49354. return null;
  49355. };
  49356. const WORKER_SUFFIX = ['.worker.ts', '.worker.tsx', '.worker/index.ts', '.worker/index.tsx'];
  49357. const WORKER_HELPER_ID = '@worker-helper';
  49358. const GET_TRANSFERABLES = `
  49359. const isInstanceOf = (value, className) => {
  49360. const C = globalThis[className];
  49361. return C != null && value instanceof C;
  49362. }
  49363. const getTransferables = (value) => {
  49364. if (value != null) {
  49365. if (
  49366. isInstanceOf(value, "ArrayBuffer") ||
  49367. isInstanceOf(value, "MessagePort") ||
  49368. isInstanceOf(value, "ImageBitmap") ||
  49369. isInstanceOf(value, "OffscreenCanvas")
  49370. ) {
  49371. return [value];
  49372. }
  49373. if (typeof value === "object") {
  49374. if (value.constructor === Object) {
  49375. value = Object.values(value);
  49376. }
  49377. if (Array.isArray(value)) {
  49378. return value.flatMap(getTransferables);
  49379. }
  49380. return getTransferables(value.buffer);
  49381. }
  49382. }
  49383. return [];
  49384. };`;
  49385. const getWorkerIntro = (workerMsgId, isDev) => `
  49386. ${GET_TRANSFERABLES}
  49387. const exports = {};
  49388. const workerMsgId = '${workerMsgId}';
  49389. const workerMsgCallbackId = workerMsgId + '.cb';
  49390. addEventListener('message', async ({data}) => {
  49391. if (data && data[0] === workerMsgId) {
  49392. let id = data[1];
  49393. let method = data[2];
  49394. let args = data[3];
  49395. let i = 0;
  49396. let argsLen = args.length;
  49397. let value;
  49398. let err;
  49399. try {
  49400. for (; i < argsLen; i++) {
  49401. if (Array.isArray(args[i]) && args[i][0] === workerMsgCallbackId) {
  49402. const callbackId = args[i][1];
  49403. args[i] = (...cbArgs) => {
  49404. postMessage(
  49405. [workerMsgCallbackId, callbackId, cbArgs]
  49406. );
  49407. };
  49408. }
  49409. }
  49410. ${isDev
  49411. ? `
  49412. value = exports[method](...args);
  49413. if (!value || !value.then) {
  49414. throw new Error('The exported method "' + method + '" does not return a Promise, make sure it is an "async" function');
  49415. }
  49416. value = await value;
  49417. `
  49418. : `
  49419. value = await exports[method](...args);`}
  49420. } catch (e) {
  49421. value = null;
  49422. if (e instanceof Error) {
  49423. err = {
  49424. isError: true,
  49425. value: {
  49426. message: e.message,
  49427. name: e.name,
  49428. stack: e.stack,
  49429. }
  49430. };
  49431. } else {
  49432. err = {
  49433. isError: false,
  49434. value: e
  49435. };
  49436. }
  49437. value = undefined;
  49438. }
  49439. const transferables = getTransferables(value);
  49440. ${isDev ? `if (transferables.length > 0) console.debug('Transfering', transferables);` : ''}
  49441. postMessage(
  49442. [workerMsgId, id, value, err],
  49443. transferables
  49444. );
  49445. }
  49446. });
  49447. `;
  49448. const WORKER_HELPERS = `
  49449. import { consoleError } from '${STENCIL_INTERNAL_ID}';
  49450. ${GET_TRANSFERABLES}
  49451. let pendingIds = 0;
  49452. let callbackIds = 0;
  49453. const pending = new Map();
  49454. const callbacks = new Map();
  49455. export const createWorker = (workerPath, workerName, workerMsgId) => {
  49456. const worker = new Worker(workerPath, {name:workerName});
  49457. worker.addEventListener('message', ({data}) => {
  49458. if (data) {
  49459. const workerMsg = data[0];
  49460. const id = data[1];
  49461. const value = data[2];
  49462. if (workerMsg === workerMsgId) {
  49463. const err = data[3];
  49464. const [resolve, reject, callbackIds] = pending.get(id);
  49465. pending.delete(id);
  49466. if (err) {
  49467. const errObj = (err.isError)
  49468. ? Object.assign(new Error(err.value.message), err.value)
  49469. : err.value;
  49470. consoleError(errObj);
  49471. reject(errObj);
  49472. } else {
  49473. if (callbackIds) {
  49474. callbackIds.forEach(id => callbacks.delete(id));
  49475. }
  49476. resolve(value);
  49477. }
  49478. } else if (workerMsg === workerMsgId + '.cb') {
  49479. try {
  49480. callbacks.get(id)(...value);
  49481. } catch (e) {
  49482. consoleError(e);
  49483. }
  49484. }
  49485. }
  49486. });
  49487. return worker;
  49488. };
  49489. export const createWorkerProxy = (worker, workerMsgId, exportedMethod) => (
  49490. (...args) => new Promise((resolve, reject) => {
  49491. let pendingId = pendingIds++;
  49492. let i = 0;
  49493. let argLen = args.length;
  49494. let mainData = [resolve, reject];
  49495. pending.set(pendingId, mainData);
  49496. for (; i < argLen; i++) {
  49497. if (typeof args[i] === 'function') {
  49498. const callbackId = callbackIds++;
  49499. callbacks.set(callbackId, args[i]);
  49500. args[i] = [workerMsgId + '.cb', callbackId];
  49501. (mainData[2] = mainData[2] || []).push(callbackId);
  49502. }
  49503. }
  49504. const postMessage = (w) => (
  49505. w.postMessage(
  49506. [workerMsgId, pendingId, exportedMethod, args],
  49507. getTransferables(args)
  49508. )
  49509. );
  49510. if (worker.then) {
  49511. worker.then(postMessage);
  49512. } else {
  49513. postMessage(worker);
  49514. }
  49515. })
  49516. );
  49517. `;
  49518. const getWorkerMain = (referenceId, workerName, workerMsgId) => {
  49519. return `
  49520. import { createWorker } from '${WORKER_HELPER_ID}';
  49521. export const workerName = '${workerName}';
  49522. export const workerMsgId = '${workerMsgId}';
  49523. export const workerPath = /*@__PURE__*/import.meta.ROLLUP_FILE_URL_${referenceId};
  49524. export const worker = /*@__PURE__*/createWorker(workerPath, workerName, workerMsgId);
  49525. `;
  49526. };
  49527. const getInlineWorker = (referenceId, workerName, workerMsgId) => {
  49528. return `
  49529. import { createWorker } from '${WORKER_HELPER_ID}';
  49530. export const workerName = '${workerName}';
  49531. export const workerMsgId = '${workerMsgId}';
  49532. export const workerPath = /*@__PURE__*/import.meta.ROLLUP_FILE_URL_${referenceId};
  49533. const blob = new Blob(['importScripts("' + workerPath + '")'], { type: 'text/javascript' });
  49534. const url = URL.createObjectURL(blob);
  49535. export const worker = /*@__PURE__*/createWorker(url, workerName, workerMsgId);
  49536. URL.revokeObjectURL(url);
  49537. `;
  49538. };
  49539. const getMockedWorkerMain = () => {
  49540. // for the hydrate build the workers won't actually work
  49541. // however, we still need to make the {worker} export
  49542. // kick-in otherwise bundling chokes
  49543. return `
  49544. export const workerName = 'mocked-worker';
  49545. export const workerMsgId = workerName;
  49546. export const workerPath = workerName;
  49547. export const worker = { name: workerName };
  49548. `;
  49549. };
  49550. const getWorkerProxy = (workerEntryPath, exportedMethods) => {
  49551. return `
  49552. import { createWorkerProxy } from '${WORKER_HELPER_ID}';
  49553. import { worker, workerName, workerMsgId } from '${workerEntryPath}?worker';
  49554. ${exportedMethods
  49555. .map((exportedMethod) => {
  49556. return `export const ${exportedMethod} = /*@__PURE__*/createWorkerProxy(worker, workerMsgId, '${exportedMethod}');`;
  49557. })
  49558. .join('\n')}
  49559. `;
  49560. };
  49561. const getInlineWorkerProxy = (workerEntryPath, workerMsgId, exportedMethods) => {
  49562. return `
  49563. import { createWorkerProxy } from '${WORKER_HELPER_ID}';
  49564. const workerPromise = import('${workerEntryPath}?worker-inline').then(m => m.worker);
  49565. ${exportedMethods
  49566. .map((exportedMethod) => {
  49567. return `export const ${exportedMethod} = /*@__PURE__*/createWorkerProxy(workerPromise, '${workerMsgId}', '${exportedMethod}');`;
  49568. })
  49569. .join('\n')}
  49570. `;
  49571. };
  49572. const bundleOutput = async (config, compilerCtx, buildCtx, bundleOpts) => {
  49573. try {
  49574. const rollupOptions = getRollupOptions(config, compilerCtx, buildCtx, bundleOpts);
  49575. const rollupBuild = await rollup(rollupOptions);
  49576. compilerCtx.rollupCache.set(bundleOpts.id, rollupBuild.cache);
  49577. return rollupBuild;
  49578. }
  49579. catch (e) {
  49580. if (!buildCtx.hasError) {
  49581. // TODO(STENCIL-353): Implement a type guard that balances using our own copy of Rollup types (which are
  49582. // breakable) and type safety (so that the error variable may be something other than `any`)
  49583. loadRollupDiagnostics(config, compilerCtx, buildCtx, e);
  49584. }
  49585. }
  49586. return undefined;
  49587. };
  49588. /**
  49589. * Build the rollup options that will be used to transpile, minify, and otherwise transform a Stencil project
  49590. * @param config the Stencil configuration for the project
  49591. * @param compilerCtx the current compiler context
  49592. * @param buildCtx a context object containing information about the current build
  49593. * @param bundleOpts Rollup bundling options to apply to the base configuration setup by this function
  49594. * @returns the rollup options to be used
  49595. */
  49596. const getRollupOptions = (config, compilerCtx, buildCtx, bundleOpts) => {
  49597. var _a;
  49598. const customResolveOptions = createCustomResolverAsync(config.sys, compilerCtx.fs, [
  49599. '.tsx',
  49600. '.ts',
  49601. '.js',
  49602. '.mjs',
  49603. '.json',
  49604. '.d.ts',
  49605. ]);
  49606. const nodeResolvePlugin = nodeResolve({
  49607. mainFields: ['collection:main', 'jsnext:main', 'es2017', 'es2015', 'module', 'main'],
  49608. customResolveOptions,
  49609. browser: true,
  49610. rootDir: config.rootDir,
  49611. ...config.nodeResolve,
  49612. });
  49613. const orgNodeResolveId = nodeResolvePlugin.resolveId;
  49614. const orgNodeResolveId2 = (nodeResolvePlugin.resolveId = async function (importee, importer) {
  49615. const [realImportee, query] = importee.split('?');
  49616. const resolved = await orgNodeResolveId.call(nodeResolvePlugin, realImportee, importer);
  49617. if (resolved) {
  49618. if (isString$1(resolved)) {
  49619. return query ? resolved + '?' + query : resolved;
  49620. }
  49621. return {
  49622. ...resolved,
  49623. id: query ? resolved.id + '?' + query : resolved.id,
  49624. };
  49625. }
  49626. return resolved;
  49627. });
  49628. if (config.devServer && config.devServer.experimentalDevModules) {
  49629. nodeResolvePlugin.resolveId = async function (importee, importer) {
  49630. const resolvedId = await orgNodeResolveId2.call(nodeResolvePlugin, importee, importer);
  49631. return devNodeModuleResolveId(config, compilerCtx.fs, resolvedId, importee);
  49632. };
  49633. }
  49634. const beforePlugins = config.rollupPlugins.before || [];
  49635. const afterPlugins = config.rollupPlugins.after || [];
  49636. const rollupOptions = {
  49637. input: bundleOpts.inputs,
  49638. plugins: [
  49639. coreResolvePlugin(config, compilerCtx, bundleOpts.platform, bundleOpts.externalRuntime),
  49640. appDataPlugin(config, compilerCtx, buildCtx, bundleOpts.conditionals, bundleOpts.platform),
  49641. lazyComponentPlugin(buildCtx),
  49642. loaderPlugin(bundleOpts.loader),
  49643. userIndexPlugin(config, compilerCtx),
  49644. typescriptPlugin(compilerCtx, bundleOpts, config),
  49645. extFormatPlugin(config),
  49646. extTransformsPlugin(config, compilerCtx, buildCtx, bundleOpts),
  49647. workerPlugin(config, compilerCtx, buildCtx, bundleOpts.platform, !!bundleOpts.inlineWorkers),
  49648. serverPlugin(config, bundleOpts.platform),
  49649. ...beforePlugins,
  49650. nodeResolvePlugin,
  49651. resolveIdWithTypeScript(config, compilerCtx),
  49652. commonjs({
  49653. include: /node_modules/,
  49654. sourceMap: config.sourceMap,
  49655. transformMixedEsModules: false,
  49656. ...config.commonjs,
  49657. }),
  49658. ...afterPlugins,
  49659. pluginHelper(config, buildCtx, bundleOpts.platform),
  49660. json({
  49661. preferConst: true,
  49662. }),
  49663. replace({
  49664. 'process.env.NODE_ENV': config.devMode ? '"development"' : '"production"',
  49665. }),
  49666. fileLoadPlugin(compilerCtx.fs),
  49667. ],
  49668. treeshake: getTreeshakeOption(config, bundleOpts),
  49669. inlineDynamicImports: bundleOpts.inlineDynamicImports,
  49670. preserveEntrySignatures: (_a = bundleOpts.preserveEntrySignatures) !== null && _a !== void 0 ? _a : 'strict',
  49671. onwarn: createOnWarnFn(buildCtx.diagnostics),
  49672. cache: compilerCtx.rollupCache.get(bundleOpts.id),
  49673. };
  49674. return rollupOptions;
  49675. };
  49676. const getTreeshakeOption = (config, bundleOpts) => {
  49677. if (bundleOpts.platform === 'hydrate') {
  49678. return {
  49679. propertyReadSideEffects: false,
  49680. tryCatchDeoptimization: false,
  49681. };
  49682. }
  49683. const treeshake = !config.devMode && config.rollupConfig.inputOptions.treeshake !== false
  49684. ? {
  49685. propertyReadSideEffects: false,
  49686. tryCatchDeoptimization: false,
  49687. }
  49688. : false;
  49689. return treeshake;
  49690. };
  49691. const getBuildFeatures = (cmps) => {
  49692. const slot = cmps.some((c) => c.htmlTagNames.includes('slot'));
  49693. const shadowDom = cmps.some((c) => c.encapsulation === 'shadow');
  49694. const slotRelocation = cmps.some((c) => c.encapsulation !== 'shadow' && c.htmlTagNames.includes('slot'));
  49695. const f = {
  49696. allRenderFn: cmps.every((c) => c.hasRenderFn),
  49697. cmpDidLoad: cmps.some((c) => c.hasComponentDidLoadFn),
  49698. cmpShouldUpdate: cmps.some((c) => c.hasComponentShouldUpdateFn),
  49699. cmpDidUnload: cmps.some((c) => c.hasComponentDidUnloadFn),
  49700. cmpDidUpdate: cmps.some((c) => c.hasComponentDidUpdateFn),
  49701. cmpDidRender: cmps.some((c) => c.hasComponentDidRenderFn),
  49702. cmpWillLoad: cmps.some((c) => c.hasComponentWillLoadFn),
  49703. cmpWillUpdate: cmps.some((c) => c.hasComponentWillUpdateFn),
  49704. cmpWillRender: cmps.some((c) => c.hasComponentWillRenderFn),
  49705. connectedCallback: cmps.some((c) => c.hasConnectedCallbackFn),
  49706. disconnectedCallback: cmps.some((c) => c.hasDisconnectedCallbackFn),
  49707. element: cmps.some((c) => c.hasElement),
  49708. event: cmps.some((c) => c.hasEvent),
  49709. hasRenderFn: cmps.some((c) => c.hasRenderFn),
  49710. lifecycle: cmps.some((c) => c.hasLifecycle),
  49711. asyncLoading: false,
  49712. hostListener: cmps.some((c) => c.hasListener),
  49713. hostListenerTargetWindow: cmps.some((c) => c.hasListenerTargetWindow),
  49714. hostListenerTargetDocument: cmps.some((c) => c.hasListenerTargetDocument),
  49715. hostListenerTargetBody: cmps.some((c) => c.hasListenerTargetBody),
  49716. hostListenerTargetParent: cmps.some((c) => c.hasListenerTargetParent),
  49717. hostListenerTarget: cmps.some((c) => c.hasListenerTarget),
  49718. member: cmps.some((c) => c.hasMember),
  49719. method: cmps.some((c) => c.hasMethod),
  49720. mode: cmps.some((c) => c.hasMode),
  49721. observeAttribute: cmps.some((c) => c.hasAttribute),
  49722. prop: cmps.some((c) => c.hasProp),
  49723. propBoolean: cmps.some((c) => c.hasPropBoolean),
  49724. propNumber: cmps.some((c) => c.hasPropNumber),
  49725. propString: cmps.some((c) => c.hasPropString),
  49726. propMutable: cmps.some((c) => c.hasPropMutable),
  49727. reflect: cmps.some((c) => c.hasReflect),
  49728. scoped: cmps.some((c) => c.encapsulation === 'scoped'),
  49729. shadowDom,
  49730. shadowDelegatesFocus: shadowDom && cmps.some((c) => c.shadowDelegatesFocus),
  49731. slot,
  49732. slotRelocation,
  49733. state: cmps.some((c) => c.hasState),
  49734. style: cmps.some((c) => c.hasStyle),
  49735. svg: cmps.some((c) => c.htmlTagNames.includes('svg')),
  49736. updatable: cmps.some((c) => c.isUpdateable),
  49737. vdomAttribute: cmps.some((c) => c.hasVdomAttribute),
  49738. vdomXlink: cmps.some((c) => c.hasVdomXlink),
  49739. vdomClass: cmps.some((c) => c.hasVdomClass),
  49740. vdomFunctional: cmps.some((c) => c.hasVdomFunctional),
  49741. vdomKey: cmps.some((c) => c.hasVdomKey),
  49742. vdomListener: cmps.some((c) => c.hasVdomListener),
  49743. vdomPropOrAttr: cmps.some((c) => c.hasVdomPropOrAttr),
  49744. vdomRef: cmps.some((c) => c.hasVdomRef),
  49745. vdomRender: cmps.some((c) => c.hasVdomRender),
  49746. vdomStyle: cmps.some((c) => c.hasVdomStyle),
  49747. vdomText: cmps.some((c) => c.hasVdomText),
  49748. watchCallback: cmps.some((c) => c.hasWatchCallback),
  49749. taskQueue: true,
  49750. };
  49751. f.asyncLoading = f.cmpWillUpdate || f.cmpWillLoad || f.cmpWillRender;
  49752. f.vdomAttribute = f.vdomAttribute || f.reflect;
  49753. f.vdomPropOrAttr = f.vdomPropOrAttr || f.reflect;
  49754. return f;
  49755. };
  49756. const updateComponentBuildConditionals = (moduleMap, cmps) => {
  49757. cmps.forEach((cmp) => {
  49758. const importedModules = getModuleImports(moduleMap, cmp.sourceFilePath, []);
  49759. importedModules.forEach((importedModule) => {
  49760. // if the component already has a boolean true value it'll keep it
  49761. // otherwise we get the boolean value from the imported module
  49762. cmp.hasVdomAttribute = cmp.hasVdomAttribute || importedModule.hasVdomAttribute;
  49763. cmp.hasVdomPropOrAttr = cmp.hasVdomPropOrAttr || importedModule.hasVdomPropOrAttr;
  49764. cmp.hasVdomXlink = cmp.hasVdomXlink || importedModule.hasVdomXlink;
  49765. cmp.hasVdomClass = cmp.hasVdomClass || importedModule.hasVdomClass;
  49766. cmp.hasVdomFunctional = cmp.hasVdomFunctional || importedModule.hasVdomFunctional;
  49767. cmp.hasVdomKey = cmp.hasVdomKey || importedModule.hasVdomKey;
  49768. cmp.hasVdomListener = cmp.hasVdomListener || importedModule.hasVdomListener;
  49769. cmp.hasVdomRef = cmp.hasVdomRef || importedModule.hasVdomRef;
  49770. cmp.hasVdomRender = cmp.hasVdomRender || importedModule.hasVdomRender;
  49771. cmp.hasVdomStyle = cmp.hasVdomStyle || importedModule.hasVdomStyle;
  49772. cmp.hasVdomText = cmp.hasVdomText || importedModule.hasVdomText;
  49773. cmp.htmlAttrNames.push(...importedModule.htmlAttrNames);
  49774. cmp.htmlTagNames.push(...importedModule.htmlTagNames);
  49775. cmp.potentialCmpRefs.push(...importedModule.potentialCmpRefs);
  49776. });
  49777. cmp.htmlAttrNames = unique(cmp.htmlAttrNames);
  49778. cmp.htmlTagNames = unique(cmp.htmlTagNames);
  49779. cmp.potentialCmpRefs = unique(cmp.potentialCmpRefs);
  49780. });
  49781. };
  49782. const getModuleImports = (moduleMap, filePath, importedModules) => {
  49783. let moduleFile = moduleMap.get(filePath);
  49784. if (moduleFile == null) {
  49785. moduleFile = moduleMap.get(filePath + '.tsx');
  49786. if (moduleFile == null) {
  49787. moduleFile = moduleMap.get(filePath + '.ts');
  49788. if (moduleFile == null) {
  49789. moduleFile = moduleMap.get(filePath + '.js');
  49790. }
  49791. }
  49792. }
  49793. if (moduleFile != null && !importedModules.some((m) => m.sourceFilePath === moduleFile.sourceFilePath)) {
  49794. importedModules.push(moduleFile);
  49795. moduleFile.localImports.forEach((localImport) => {
  49796. getModuleImports(moduleMap, localImport, importedModules);
  49797. });
  49798. }
  49799. return importedModules;
  49800. };
  49801. const updateBuildConditionals = (config, b) => {
  49802. b.isDebug = config.logLevel === 'debug';
  49803. b.isDev = !!config.devMode;
  49804. b.isTesting = !!config._isTesting;
  49805. b.devTools = b.isDev && !config._isTesting;
  49806. b.profile = !!config.profile;
  49807. b.hotModuleReplacement = !!(config.devMode &&
  49808. config.devServer &&
  49809. config.devServer.reloadStrategy === 'hmr' &&
  49810. !config._isTesting);
  49811. b.updatable = b.updatable || b.hydrateClientSide || b.hotModuleReplacement;
  49812. b.member = b.member || b.updatable || b.mode || b.lifecycle;
  49813. b.constructableCSS = !b.hotModuleReplacement || !!config._isTesting;
  49814. b.asyncLoading = !!(b.asyncLoading || b.lazyLoad || b.taskQueue || b.initializeNextTick);
  49815. b.cssAnnotations = true;
  49816. b.appendChildSlotFix = config.extras.appendChildSlotFix;
  49817. b.slotChildNodesFix = config.extras.slotChildNodesFix;
  49818. b.cloneNodeFix = config.extras.cloneNodeFix;
  49819. b.dynamicImportShim = config.extras.dynamicImportShim;
  49820. b.lifecycleDOMEvents = !!(b.isDebug || config._isTesting || config.extras.lifecycleDOMEvents);
  49821. b.safari10 = config.extras.safari10;
  49822. b.scopedSlotTextContentFix = !!config.extras.scopedSlotTextContentFix;
  49823. b.scriptDataOpts = config.extras.scriptDataOpts;
  49824. b.shadowDomShim = config.extras.shadowDomShim;
  49825. b.attachStyles = true;
  49826. b.invisiblePrehydration = typeof config.invisiblePrehydration === 'undefined' ? true : config.invisiblePrehydration;
  49827. if (b.shadowDomShim) {
  49828. b.slotRelocation = b.slot;
  49829. }
  49830. if (config.hydratedFlag) {
  49831. b.hydratedAttribute = config.hydratedFlag.selector === 'attribute';
  49832. b.hydratedClass = config.hydratedFlag.selector === 'class';
  49833. }
  49834. else {
  49835. b.hydratedAttribute = false;
  49836. b.hydratedClass = false;
  49837. }
  49838. };
  49839. const getCustomElementsBuildConditionals = (config, cmps) => {
  49840. // because custom elements bundling does not customize the build conditionals by default
  49841. // then the default in "import { BUILD, NAMESPACE } from '@stencil/core/internal/app-data'"
  49842. // needs to have the static build conditionals set for the custom elements build
  49843. const build = getBuildFeatures(cmps);
  49844. build.lazyLoad = false;
  49845. build.hydrateClientSide = false;
  49846. build.hydrateServerSide = false;
  49847. build.asyncQueue = config.taskQueue === 'congestionAsync';
  49848. build.taskQueue = config.taskQueue !== 'immediate';
  49849. updateBuildConditionals(config, build);
  49850. build.devTools = false;
  49851. return build;
  49852. };
  49853. const CLASS_DECORATORS_TO_REMOVE = new Set(['Component']);
  49854. const MEMBER_DECORATORS_TO_REMOVE = new Set([
  49855. 'Element',
  49856. 'Event',
  49857. 'Listen',
  49858. 'Method',
  49859. 'Prop',
  49860. 'PropDidChange',
  49861. 'PropWillChange',
  49862. 'State',
  49863. 'Watch',
  49864. ]);
  49865. /**
  49866. * Determine if a class member is private or not
  49867. * @param member the class member to evaluate
  49868. * @returns `true` if the member has the `private` or `protected` modifier attached to it. `false` otherwise
  49869. */
  49870. const isMemberPrivate = (member) => {
  49871. if (member.modifiers &&
  49872. member.modifiers.some((m) => m.kind === t.SyntaxKind.PrivateKeyword || m.kind === t.SyntaxKind.ProtectedKeyword)) {
  49873. return true;
  49874. }
  49875. return false;
  49876. };
  49877. const convertValueToLiteral = (val, refs = null) => {
  49878. if (refs == null) {
  49879. refs = new WeakSet();
  49880. }
  49881. if (val === String) {
  49882. return t.createIdentifier('String');
  49883. }
  49884. if (val === Number) {
  49885. return t.createIdentifier('Number');
  49886. }
  49887. if (val === Boolean) {
  49888. return t.createIdentifier('Boolean');
  49889. }
  49890. if (val === undefined) {
  49891. return t.createIdentifier('undefined');
  49892. }
  49893. if (val === null) {
  49894. return t.createIdentifier('null');
  49895. }
  49896. if (Array.isArray(val)) {
  49897. return arrayToArrayLiteral(val, refs);
  49898. }
  49899. if (typeof val === 'object') {
  49900. if (val.__identifier && val.__escapedText) {
  49901. return t.createIdentifier(val.__escapedText);
  49902. }
  49903. return objectToObjectLiteral(val, refs);
  49904. }
  49905. return t.createLiteral(val);
  49906. };
  49907. const arrayToArrayLiteral = (list, refs) => {
  49908. const newList = list.map((l) => {
  49909. return convertValueToLiteral(l, refs);
  49910. });
  49911. return t.createArrayLiteral(newList);
  49912. };
  49913. const objectToObjectLiteral = (obj, refs) => {
  49914. if (refs.has(obj)) {
  49915. return t.createIdentifier('undefined');
  49916. }
  49917. refs.add(obj);
  49918. const newProperties = Object.keys(obj).map((key) => {
  49919. const prop = t.createPropertyAssignment(t.createLiteral(key), convertValueToLiteral(obj[key], refs));
  49920. return prop;
  49921. });
  49922. return t.createObjectLiteral(newProperties, true);
  49923. };
  49924. const createStaticGetter = (propName, returnExpression) => {
  49925. return t.createGetAccessor(undefined, [t.createToken(t.SyntaxKind.StaticKeyword)], propName, undefined, undefined, t.createBlock([t.createReturn(returnExpression)]));
  49926. };
  49927. const getStaticValue = (staticMembers, staticName) => {
  49928. const staticMember = staticMembers.find((member) => member.name.escapedText === staticName);
  49929. if (!staticMember || !staticMember.body || !staticMember.body.statements) {
  49930. return null;
  49931. }
  49932. const rtnStatement = staticMember.body.statements.find((s) => s.kind === t.SyntaxKind.ReturnStatement);
  49933. if (!rtnStatement || !rtnStatement.expression) {
  49934. return null;
  49935. }
  49936. const expKind = rtnStatement.expression.kind;
  49937. if (expKind === t.SyntaxKind.StringLiteral) {
  49938. return rtnStatement.expression.text;
  49939. }
  49940. if (expKind === t.SyntaxKind.NoSubstitutionTemplateLiteral) {
  49941. return rtnStatement.expression.text;
  49942. }
  49943. if (expKind === t.SyntaxKind.TrueKeyword) {
  49944. return true;
  49945. }
  49946. if (expKind === t.SyntaxKind.FalseKeyword) {
  49947. return false;
  49948. }
  49949. if (expKind === t.SyntaxKind.ObjectLiteralExpression) {
  49950. return objectLiteralToObjectMap(rtnStatement.expression);
  49951. }
  49952. if (expKind === t.SyntaxKind.ArrayLiteralExpression &&
  49953. rtnStatement.expression.elements) {
  49954. return arrayLiteralToArray(rtnStatement.expression);
  49955. }
  49956. if (expKind === t.SyntaxKind.Identifier) {
  49957. const identifier = rtnStatement.expression;
  49958. if (typeof identifier.escapedText === 'string') {
  49959. return getIdentifierValue(identifier.escapedText);
  49960. }
  49961. if (identifier.escapedText) {
  49962. const obj = {};
  49963. Object.keys(identifier.escapedText).forEach((key) => {
  49964. obj[key] = getIdentifierValue(identifier.escapedText[key]);
  49965. });
  49966. return obj;
  49967. }
  49968. }
  49969. return null;
  49970. };
  49971. const arrayLiteralToArray = (arr) => {
  49972. return arr.elements.map((element) => {
  49973. let val;
  49974. switch (element.kind) {
  49975. case t.SyntaxKind.ObjectLiteralExpression:
  49976. val = objectLiteralToObjectMap(element);
  49977. break;
  49978. case t.SyntaxKind.StringLiteral:
  49979. val = element.text;
  49980. break;
  49981. case t.SyntaxKind.TrueKeyword:
  49982. val = true;
  49983. break;
  49984. case t.SyntaxKind.FalseKeyword:
  49985. val = false;
  49986. break;
  49987. case t.SyntaxKind.Identifier:
  49988. const escapedText = element.escapedText;
  49989. if (escapedText === 'String') {
  49990. val = String;
  49991. }
  49992. else if (escapedText === 'Number') {
  49993. val = Number;
  49994. }
  49995. else if (escapedText === 'Boolean') {
  49996. val = Boolean;
  49997. }
  49998. break;
  49999. case t.SyntaxKind.PropertyAccessExpression:
  50000. default:
  50001. val = element;
  50002. }
  50003. return val;
  50004. });
  50005. };
  50006. const objectLiteralToObjectMap = (objectLiteral) => {
  50007. const properties = objectLiteral.properties;
  50008. const final = {};
  50009. for (const propAssignment of properties) {
  50010. const propName = getTextOfPropertyName(propAssignment.name);
  50011. let val;
  50012. if (t.isShorthandPropertyAssignment(propAssignment)) {
  50013. val = getIdentifierValue(propName);
  50014. }
  50015. else if (t.isPropertyAssignment(propAssignment)) {
  50016. switch (propAssignment.initializer.kind) {
  50017. case t.SyntaxKind.ArrayLiteralExpression:
  50018. val = arrayLiteralToArray(propAssignment.initializer);
  50019. break;
  50020. case t.SyntaxKind.ObjectLiteralExpression:
  50021. val = objectLiteralToObjectMap(propAssignment.initializer);
  50022. break;
  50023. case t.SyntaxKind.StringLiteral:
  50024. val = propAssignment.initializer.text;
  50025. break;
  50026. case t.SyntaxKind.NoSubstitutionTemplateLiteral:
  50027. val = propAssignment.initializer.text;
  50028. break;
  50029. case t.SyntaxKind.TrueKeyword:
  50030. val = true;
  50031. break;
  50032. case t.SyntaxKind.FalseKeyword:
  50033. val = false;
  50034. break;
  50035. case t.SyntaxKind.Identifier:
  50036. const escapedText = propAssignment.initializer.escapedText;
  50037. if (escapedText === 'String') {
  50038. val = String;
  50039. }
  50040. else if (escapedText === 'Number') {
  50041. val = Number;
  50042. }
  50043. else if (escapedText === 'Boolean') {
  50044. val = Boolean;
  50045. }
  50046. else if (escapedText === 'undefined') {
  50047. val = undefined;
  50048. }
  50049. else if (escapedText === 'null') {
  50050. val = null;
  50051. }
  50052. else {
  50053. val = getIdentifierValue(propAssignment.initializer.escapedText);
  50054. }
  50055. break;
  50056. case t.SyntaxKind.PropertyAccessExpression:
  50057. default:
  50058. val = propAssignment.initializer;
  50059. }
  50060. }
  50061. final[propName] = val;
  50062. }
  50063. return final;
  50064. };
  50065. const getIdentifierValue = (escapedText) => {
  50066. const identifier = {
  50067. __identifier: true,
  50068. __escapedText: escapedText,
  50069. };
  50070. return identifier;
  50071. };
  50072. const getTextOfPropertyName = (propName) => {
  50073. switch (propName.kind) {
  50074. case t.SyntaxKind.Identifier:
  50075. return propName.text;
  50076. case t.SyntaxKind.StringLiteral:
  50077. case t.SyntaxKind.NumericLiteral:
  50078. return propName.text;
  50079. case t.SyntaxKind.ComputedPropertyName:
  50080. const expression = propName.expression;
  50081. if (t.isStringLiteral(expression) || t.isNumericLiteral(expression)) {
  50082. return propName.expression.text;
  50083. }
  50084. }
  50085. return undefined;
  50086. };
  50087. /**
  50088. * Generate a series of type references for a given AST node
  50089. * @param baseNode the AST node to pull type references from
  50090. * @param sourceFile the source file in which the provided `baseNode` exists
  50091. * @returns the generated series of type references
  50092. */
  50093. const getAttributeTypeInfo = (baseNode, sourceFile) => {
  50094. const allReferences = {};
  50095. getAllTypeReferences(baseNode).forEach((typeName) => {
  50096. allReferences[typeName] = getTypeReferenceLocation(typeName, sourceFile);
  50097. });
  50098. return allReferences;
  50099. };
  50100. /**
  50101. * Get the text-based name from a TypeScript `EntityName`, which is an identifier of some form
  50102. * @param entity a TypeScript `EntityName` to retrieve the name of an entity from
  50103. * @returns the entity's name
  50104. */
  50105. const getEntityName = (entity) => {
  50106. if (t.isIdentifier(entity)) {
  50107. return entity.escapedText.toString();
  50108. }
  50109. else {
  50110. // We have qualified name - e.g. const x: Foo.Bar.Baz;
  50111. // Recurse until we find the 'base' of the qualified name
  50112. return getEntityName(entity.left);
  50113. }
  50114. };
  50115. /**
  50116. * Recursively walks the provided AST to collect all TypeScript type references that are found
  50117. * @param node the node to walk to retrieve type information
  50118. * @returns the collected type references
  50119. */
  50120. const getAllTypeReferences = (node) => {
  50121. const referencedTypes = [];
  50122. const visit = (node) => {
  50123. /**
  50124. * A type reference node will refer to some type T.
  50125. * e.g: In `const foo: Bar = {...}` the reference node will contain semantic information about `Bar`.
  50126. * In TypeScript, types that are also keywords (e.g. `number` in `const foo: number`) are not `TypeReferenceNode`s.
  50127. */
  50128. if (t.isTypeReferenceNode(node)) {
  50129. referencedTypes.push(getEntityName(node.typeName));
  50130. if (node.typeArguments) {
  50131. // a type may contain types itself (e.g. generics - Foo<Bar>)
  50132. node.typeArguments
  50133. .filter((typeArg) => t.isTypeReferenceNode(typeArg))
  50134. .forEach((typeRef) => {
  50135. const typeName = typeRef.typeName;
  50136. if (typeName && typeName.escapedText) {
  50137. referencedTypes.push(typeName.escapedText.toString());
  50138. }
  50139. });
  50140. }
  50141. }
  50142. return t.forEachChild(node, visit);
  50143. };
  50144. visit(node);
  50145. return referencedTypes;
  50146. };
  50147. const validateReferences = (diagnostics, references, node) => {
  50148. Object.keys(references).forEach((refName) => {
  50149. const ref = references[refName];
  50150. if (ref.path === '@stencil/core' && MEMBER_DECORATORS_TO_REMOVE.has(refName)) {
  50151. const err = buildError(diagnostics);
  50152. augmentDiagnosticWithNode(err, node);
  50153. }
  50154. });
  50155. };
  50156. /**
  50157. * Determine where a TypeScript type reference originates from. This is accomplished by interrogating the AST node in
  50158. * which the type's name appears
  50159. *
  50160. * A type may originate:
  50161. * - from the same file where it is used (a type is declared in some file, `foo.ts`, and later used in the same file)
  50162. * - from another file (I.E. it is imported and should have an import statement somewhere in the file)
  50163. * - from a global context
  50164. * - etc.
  50165. *
  50166. * The type may be declared using the `type` or `interface` keywords.
  50167. *
  50168. * @param typeName the name of the type to find the origination of
  50169. * @param tsNode the TypeScript AST node being searched for the provided `typeName`
  50170. * @returns the context stating where the type originates from
  50171. */
  50172. const getTypeReferenceLocation = (typeName, tsNode) => {
  50173. const sourceFileObj = tsNode.getSourceFile();
  50174. // Loop through all top level imports to find any reference to the type for 'import' reference location
  50175. const importTypeDeclaration = sourceFileObj.statements.find((st) => {
  50176. const statement = t.isImportDeclaration(st) &&
  50177. st.importClause &&
  50178. t.isImportClause(st.importClause) &&
  50179. st.importClause.namedBindings &&
  50180. t.isNamedImports(st.importClause.namedBindings) &&
  50181. Array.isArray(st.importClause.namedBindings.elements) &&
  50182. st.importClause.namedBindings.elements.find((nbe) => nbe.name.getText() === typeName);
  50183. if (!statement) {
  50184. return false;
  50185. }
  50186. return true;
  50187. });
  50188. if (importTypeDeclaration) {
  50189. const localImportPath = importTypeDeclaration.moduleSpecifier.text;
  50190. return {
  50191. location: 'import',
  50192. path: localImportPath,
  50193. };
  50194. }
  50195. // Loop through all top level exports to find if any reference to the type for 'local' reference location
  50196. const isExported = sourceFileObj.statements.some((st) => {
  50197. // Is the interface defined in the file and exported
  50198. const isInterfaceDeclarationExported = t.isInterfaceDeclaration(st) &&
  50199. st.name.getText() === typeName &&
  50200. Array.isArray(st.modifiers) &&
  50201. st.modifiers.some((mod) => mod.kind === t.SyntaxKind.ExportKeyword);
  50202. const isTypeAliasDeclarationExported = t.isTypeAliasDeclaration(st) &&
  50203. st.name.getText() === typeName &&
  50204. Array.isArray(st.modifiers) &&
  50205. st.modifiers.some((mod) => mod.kind === t.SyntaxKind.ExportKeyword);
  50206. // Is the interface exported through a named export
  50207. const isTypeInExportDeclaration = t.isExportDeclaration(st) &&
  50208. t.isNamedExports(st.exportClause) &&
  50209. st.exportClause.elements.some((nee) => nee.name.getText() === typeName);
  50210. return isInterfaceDeclarationExported || isTypeAliasDeclarationExported || isTypeInExportDeclaration;
  50211. });
  50212. if (isExported) {
  50213. return {
  50214. location: 'local',
  50215. };
  50216. }
  50217. // This is most likely a global type, if it is a local that is not exported then typescript will inform the dev
  50218. return {
  50219. location: 'global',
  50220. };
  50221. };
  50222. const resolveType = (checker, type) => {
  50223. const set = new Set();
  50224. parseDocsType(checker, type, set);
  50225. // normalize booleans
  50226. const hasTrue = set.delete('true');
  50227. const hasFalse = set.delete('false');
  50228. if (hasTrue || hasFalse) {
  50229. set.add('boolean');
  50230. }
  50231. let parts = Array.from(set.keys()).sort();
  50232. // TODO(STENCIL-366): Get this section of code under tests that directly exercises this behavior
  50233. if (parts.length > 1) {
  50234. parts = parts.map((p) => (p.indexOf('=>') >= 0 ? `(${p})` : p));
  50235. }
  50236. if (parts.length > 20) {
  50237. return typeToString(checker, type);
  50238. }
  50239. else {
  50240. return parts.join(' | ');
  50241. }
  50242. };
  50243. /**
  50244. * Formats a TypeScript `Type` entity as a string
  50245. * @param checker a reference to the TypeScript type checker
  50246. * @param type a TypeScript `Type` entity to format
  50247. * @returns the formatted string
  50248. */
  50249. const typeToString = (checker, type) => {
  50250. const TYPE_FORMAT_FLAGS = t.TypeFormatFlags.NoTruncation | t.TypeFormatFlags.InTypeAlias | t.TypeFormatFlags.InElementType;
  50251. return checker.typeToString(type, undefined, TYPE_FORMAT_FLAGS);
  50252. };
  50253. const parseDocsType = (checker, type, parts) => {
  50254. if (type.isUnion()) {
  50255. type.types.forEach((t) => {
  50256. parseDocsType(checker, t, parts);
  50257. });
  50258. }
  50259. else {
  50260. const text = typeToString(checker, type);
  50261. parts.add(text);
  50262. }
  50263. };
  50264. const getModuleFromSourceFile = (compilerCtx, tsSourceFile) => {
  50265. const sourceFilePath = normalizePath$1(tsSourceFile.fileName);
  50266. const moduleFile = compilerCtx.moduleMap.get(sourceFilePath);
  50267. if (moduleFile != null) {
  50268. return moduleFile;
  50269. }
  50270. const moduleFiles = Array.from(compilerCtx.moduleMap.values());
  50271. return moduleFiles.find((m) => m.jsFilePath === sourceFilePath);
  50272. };
  50273. const getComponentMeta = (compilerCtx, tsSourceFile, node) => {
  50274. const meta = compilerCtx.nodeMap.get(node);
  50275. if (meta) {
  50276. return meta;
  50277. }
  50278. const moduleFile = getModuleFromSourceFile(compilerCtx, tsSourceFile);
  50279. if (moduleFile != null && node.members != null) {
  50280. const staticMembers = node.members.filter(isStaticGetter);
  50281. const tagName = getComponentTagName(staticMembers);
  50282. if (typeof tagName === 'string') {
  50283. return moduleFile.cmps.find((cmp) => cmp.tagName === tagName);
  50284. }
  50285. }
  50286. return undefined;
  50287. };
  50288. const getComponentTagName = (staticMembers) => {
  50289. if (staticMembers.length > 0) {
  50290. const tagName = getStaticValue(staticMembers, 'is');
  50291. if (typeof tagName === 'string' && tagName.includes('-')) {
  50292. return tagName;
  50293. }
  50294. }
  50295. return null;
  50296. };
  50297. const isStaticGetter = (member) => {
  50298. return (member.kind === t.SyntaxKind.GetAccessor &&
  50299. member.modifiers &&
  50300. member.modifiers.some(({ kind }) => kind === t.SyntaxKind.StaticKeyword));
  50301. };
  50302. /**
  50303. * Create a serialized representation of a TypeScript `Symbol` entity to expose the Symbol's text and attached JSDoc.
  50304. * Note that the `Symbol` being serialized is not the same as the JavaScript primitive 'symbol'.
  50305. * @param checker a reference to the TypeScript type checker
  50306. * @param symbol the `Symbol` to serialize
  50307. * @returns the serialized `Symbol` data
  50308. */
  50309. const serializeSymbol = (checker, symbol) => {
  50310. if (!checker || !symbol) {
  50311. return {
  50312. tags: [],
  50313. text: '',
  50314. };
  50315. }
  50316. return {
  50317. tags: mapJSDocTagInfo(symbol.getJsDocTags()),
  50318. text: t.displayPartsToString(symbol.getDocumentationComment(checker)),
  50319. };
  50320. };
  50321. /**
  50322. * Maps a TypeScript 4.3+ JSDocTagInfo to a flattened Stencil CompilerJsDocTagInfo.
  50323. * @param tags A readonly array of JSDocTagInfo objects.
  50324. * @returns An array of CompilerJsDocTagInfo objects.
  50325. */
  50326. const mapJSDocTagInfo = (tags) => {
  50327. // The text following a tag is split semantically by TS 4.3+, e.g. '@param foo the first parameter' ->
  50328. // [{text: 'foo', kind: 'parameterName'}, {text: ' ', kind: 'space'}, {text: 'the first parameter', kind: 'text'}], so
  50329. // we join the elements to reconstruct the text.
  50330. return tags.map((tag) => { var _a; return ({ ...tag, text: (_a = tag.text) === null || _a === void 0 ? void 0 : _a.map((part) => part.text).join('') }); });
  50331. };
  50332. const isInternal = (jsDocs) => {
  50333. return jsDocs && jsDocs.tags.some((s) => s.name === 'internal');
  50334. };
  50335. const isMethod = (member, methodName) => {
  50336. return t.isMethodDeclaration(member) && member.name && member.name.escapedText === methodName;
  50337. };
  50338. const createImportStatement = (importFnNames, importPath) => {
  50339. // ESM Imports
  50340. // import { importNames } from 'importPath';
  50341. const importSpecifiers = importFnNames.map((importKey) => {
  50342. const splt = importKey.split(' as ');
  50343. let importAs = importKey;
  50344. let importFnName = importKey;
  50345. if (splt.length > 1) {
  50346. importAs = splt[1];
  50347. importFnName = splt[0];
  50348. }
  50349. return t.factory.createImportSpecifier(false, typeof importFnName === 'string' && importFnName !== importAs
  50350. ? t.factory.createIdentifier(importFnName)
  50351. : undefined, t.factory.createIdentifier(importAs));
  50352. });
  50353. return t.createImportDeclaration(undefined, undefined, t.createImportClause(undefined, t.createNamedImports(importSpecifiers)), t.createLiteral(importPath));
  50354. };
  50355. const createRequireStatement = (importFnNames, importPath) => {
  50356. // CommonJS require()
  50357. // const { a, b, c } = require(importPath);
  50358. const importBinding = t.createObjectBindingPattern(importFnNames.map((importKey) => {
  50359. const splt = importKey.split(' as ');
  50360. let importAs = importKey;
  50361. let importFnName = importKey;
  50362. if (splt.length > 1) {
  50363. importAs = splt[1];
  50364. importFnName = splt[0];
  50365. }
  50366. return t.createBindingElement(undefined, importFnName, importAs);
  50367. }));
  50368. return t.createVariableStatement(undefined, t.createVariableDeclarationList([
  50369. t.createVariableDeclaration(importBinding, undefined, t.createCall(t.createIdentifier('require'), [], [t.createLiteral(importPath)])),
  50370. ], t.NodeFlags.Const));
  50371. };
  50372. const addImports = (transformOpts, tsSourceFile, importFnNames, importPath) => {
  50373. if (importFnNames.length === 0) {
  50374. return tsSourceFile;
  50375. }
  50376. if (transformOpts.module === 'cjs') {
  50377. // CommonJS require()
  50378. const newRequire = createRequireStatement(importFnNames, importPath);
  50379. const statements = tsSourceFile.statements.slice();
  50380. statements.splice(2, 0, newRequire);
  50381. return t.updateSourceFileNode(tsSourceFile, statements);
  50382. }
  50383. // ESM Imports
  50384. const newImport = createImportStatement(importFnNames, importPath);
  50385. const statements = tsSourceFile.statements.slice();
  50386. statements.unshift(newImport);
  50387. return t.updateSourceFileNode(tsSourceFile, statements);
  50388. };
  50389. const ATTACH_SHADOW = '__stencil_attachShadow';
  50390. const CREATE_EVENT = '__stencil_createEvent';
  50391. const DEFINE_CUSTOM_ELEMENT = '__stencil_defineCustomElement';
  50392. const GET_CONNECT = '__stencil_getConnect';
  50393. const GET_CONTEXT = '__stencil_getContext';
  50394. const GET_ELEMENT = '__stencil_getElement';
  50395. const HOST = '__stencil_Host';
  50396. const HTML_ELEMENT = 'HTMLElement';
  50397. const PROXY_CUSTOM_ELEMENT = '__stencil_proxyCustomElement';
  50398. const REGISTER_INSTANCE = '__stencil_registerInstance';
  50399. const REGISTER_HOST = '__stencil_registerHost';
  50400. const H = '__stencil_h';
  50401. const RUNTIME_APIS = {
  50402. attachShadow: `attachShadow as ${ATTACH_SHADOW}`,
  50403. createEvent: `createEvent as ${CREATE_EVENT}`,
  50404. defineCustomElement: `defineCustomElement as ${DEFINE_CUSTOM_ELEMENT}`,
  50405. getConnect: `getConnect as ${GET_CONNECT}`,
  50406. getContext: `getContext as ${GET_CONTEXT}`,
  50407. getElement: `getElement as ${GET_ELEMENT}`,
  50408. h: `h as ${H}`,
  50409. legacyH: `h`,
  50410. Host: `Host as ${HOST}`,
  50411. HTMLElement: HTML_ELEMENT,
  50412. proxyCustomElement: `proxyCustomElement as ${PROXY_CUSTOM_ELEMENT}`,
  50413. registerHost: `registerHost as ${REGISTER_HOST}`,
  50414. registerInstance: `registerInstance as ${REGISTER_INSTANCE}`,
  50415. };
  50416. const addCoreRuntimeApi = (moduleFile, coreRuntimeApi) => {
  50417. if (!moduleFile.coreRuntimeApis.includes(coreRuntimeApi)) {
  50418. moduleFile.coreRuntimeApis.push(coreRuntimeApi);
  50419. }
  50420. };
  50421. const addLegacyApis = (moduleFile) => {
  50422. addCoreRuntimeApi(moduleFile, RUNTIME_APIS.legacyH);
  50423. };
  50424. const addModuleMetadataProxies = (tsSourceFile, moduleFile) => {
  50425. const statements = tsSourceFile.statements.slice();
  50426. addCoreRuntimeApi(moduleFile, RUNTIME_APIS.proxyCustomElement);
  50427. statements.push(...moduleFile.cmps.map(addComponentMetadataProxy));
  50428. return t.updateSourceFileNode(tsSourceFile, statements);
  50429. };
  50430. const addComponentMetadataProxy = (compilerMeta) => {
  50431. return t.createStatement(createComponentMetadataProxy(compilerMeta));
  50432. };
  50433. /**
  50434. * Create a call expression for wrapping a component in a proxy. This call expression takes a form:
  50435. * ```ts
  50436. * PROXY_CUSTOM_ELEMENT(ComponentClassName, Metadata);
  50437. * ```
  50438. * where
  50439. * - `PROXY_CUSTOM_ELEMENT` is a Stencil internal identifier that will be replaced with the name of the actual function
  50440. * name at compile name
  50441. * - `ComponentClassName` is the name Stencil component's class
  50442. * - `Metadata` is the compiler metadata associated with the Stencil component
  50443. *
  50444. * @param compilerMeta compiler metadata associated with the component to be wrapped in a proxy
  50445. * @returns the generated call expression
  50446. */
  50447. const createComponentMetadataProxy = (compilerMeta) => {
  50448. const compactMeta = formatComponentRuntimeMeta(compilerMeta, true);
  50449. const literalCmpClassName = t.factory.createIdentifier(compilerMeta.componentClassName);
  50450. const literalMeta = convertValueToLiteral(compactMeta);
  50451. return t.factory.createCallExpression(t.factory.createIdentifier(PROXY_CUSTOM_ELEMENT), [], [literalCmpClassName, literalMeta]);
  50452. };
  50453. /**
  50454. * Create a call expression for wrapping a component represented as an anonymous class in a proxy. This call expression
  50455. * takes a form:
  50456. * ```ts
  50457. * PROXY_CUSTOM_ELEMENT(Clazz, Metadata);
  50458. * ```
  50459. * where
  50460. * - `PROXY_CUSTOM_ELEMENT` is a Stencil internal identifier that will be replaced with the name of the actual function
  50461. * name at compile name
  50462. * - `Clazz` is an anonymous class to be proxied
  50463. * - `Metadata` is the compiler metadata associated with the Stencil component
  50464. *
  50465. * @param compilerMeta compiler metadata associated with the component to be wrapped in a proxy
  50466. * @param clazz the anonymous class to proxy
  50467. * @returns the generated call expression
  50468. */
  50469. const createAnonymousClassMetadataProxy = (compilerMeta, clazz) => {
  50470. const compactMeta = formatComponentRuntimeMeta(compilerMeta, true);
  50471. const literalMeta = convertValueToLiteral(compactMeta);
  50472. return t.factory.createCallExpression(t.factory.createIdentifier(PROXY_CUSTOM_ELEMENT), [], [clazz, literalMeta]);
  50473. };
  50474. const defineCustomElement = (tsSourceFile, moduleFile, transformOpts) => {
  50475. let statements = tsSourceFile.statements.slice();
  50476. statements.push(...moduleFile.cmps.map((cmp) => {
  50477. return addDefineCustomElement(moduleFile, cmp);
  50478. }));
  50479. if (transformOpts.module === 'cjs') {
  50480. // remove commonjs exports keyword from component classes
  50481. statements = removeComponentCjsExport(statements, moduleFile);
  50482. }
  50483. return t.updateSourceFileNode(tsSourceFile, statements);
  50484. };
  50485. const addDefineCustomElement = (moduleFile, compilerMeta) => {
  50486. if (compilerMeta.isPlain) {
  50487. // add customElements.define('cmp-a', CmpClass);
  50488. return t.createStatement(t.createCall(t.createPropertyAccess(t.createIdentifier('customElements'), t.createIdentifier('define')), [], [t.createLiteral(compilerMeta.tagName), t.createIdentifier(compilerMeta.componentClassName)]));
  50489. }
  50490. addCoreRuntimeApi(moduleFile, RUNTIME_APIS.defineCustomElement);
  50491. const compactMeta = formatComponentRuntimeMeta(compilerMeta, true);
  50492. const liternalCmpClassName = t.createIdentifier(compilerMeta.componentClassName);
  50493. const liternalMeta = convertValueToLiteral(compactMeta);
  50494. return t.createStatement(t.createCall(t.createIdentifier(DEFINE_CUSTOM_ELEMENT), [], [liternalCmpClassName, liternalMeta]));
  50495. };
  50496. const removeComponentCjsExport = (statements, moduleFile) => {
  50497. const cmpClassNames = new Set(moduleFile.cmps.map((cmp) => cmp.componentClassName));
  50498. return statements.filter((s) => {
  50499. if (s.kind === t.SyntaxKind.ExpressionStatement) {
  50500. const exp = s.expression;
  50501. if (exp && exp.kind === t.SyntaxKind.BinaryExpression) {
  50502. const left = exp.left;
  50503. if (left && left.kind === t.SyntaxKind.PropertyAccessExpression) {
  50504. if (left.expression && left.expression.kind === t.SyntaxKind.Identifier) {
  50505. const leftText = left.expression;
  50506. if (leftText.text === 'exports') {
  50507. const right = exp.right;
  50508. if (right && cmpClassNames.has(right.text)) {
  50509. return false;
  50510. }
  50511. }
  50512. }
  50513. }
  50514. }
  50515. }
  50516. return true;
  50517. });
  50518. };
  50519. const addNativeComponentMeta = (classMembers, cmp) => {
  50520. classMembers.push(createStaticGetter('is', convertValueToLiteral(cmp.tagName)));
  50521. };
  50522. const addNativeConnectedCallback = (classMembers, cmp) => {
  50523. // function call to stencil's exported connectedCallback(elm, plt)
  50524. // TODO: fast path
  50525. if (cmp.isPlain && cmp.hasRenderFn) {
  50526. const fnCall = t.createExpressionStatement(t.createAssignment(t.createPropertyAccess(t.createThis(), 'textContent'), t.createCall(t.createPropertyAccess(t.createThis(), 'render'), undefined, undefined)));
  50527. const connectedCallback = classMembers.find((classMember) => {
  50528. return t.isMethodDeclaration(classMember) && classMember.name.escapedText === 'connectedCallback';
  50529. });
  50530. if (connectedCallback != null) {
  50531. // class already has a connectedCallback(), so update it
  50532. const callbackMethod = t.createMethod(undefined, undefined, undefined, 'connectedCallback', undefined, undefined, undefined, undefined, t.createBlock([fnCall, ...connectedCallback.body.statements], true));
  50533. const index = classMembers.indexOf(connectedCallback);
  50534. classMembers[index] = callbackMethod;
  50535. }
  50536. else {
  50537. // class doesn't have a connectedCallback(), so add it
  50538. const callbackMethod = t.createMethod(undefined, undefined, undefined, 'connectedCallback', undefined, undefined, undefined, undefined, t.createBlock([fnCall], true));
  50539. classMembers.push(callbackMethod);
  50540. }
  50541. }
  50542. };
  50543. const addNativeElementGetter = (classMembers, cmp) => {
  50544. // @Element() element;
  50545. // is transformed into:
  50546. // get element() { return this; }
  50547. if (cmp.elementRef) {
  50548. classMembers.push(t.createGetAccessor(undefined, undefined, cmp.elementRef, [], undefined, t.createBlock([t.createReturn(t.createThis())])));
  50549. }
  50550. };
  50551. const addNativeStaticStyle = (classMembers, cmp) => {
  50552. if (Array.isArray(cmp.styles) && cmp.styles.length > 0) {
  50553. if (cmp.styles.length > 1 || (cmp.styles.length === 1 && cmp.styles[0].modeName !== DEFAULT_STYLE_MODE)) {
  50554. // multiple style modes
  50555. addMultipleModeStyleGetter(classMembers, cmp, cmp.styles);
  50556. }
  50557. else {
  50558. // single style
  50559. addSingleStyleGetter(classMembers, cmp, cmp.styles[0]);
  50560. }
  50561. }
  50562. };
  50563. const addMultipleModeStyleGetter = (classMembers, cmp, styles) => {
  50564. const styleModes = [];
  50565. styles.forEach((style) => {
  50566. if (typeof style.styleStr === 'string') {
  50567. // inline the style string
  50568. // static get style() { return { "ios": "string" }; }
  50569. const styleLiteral = createStyleLiteral$1(cmp, style);
  50570. const propStr = t.createPropertyAssignment(style.modeName, styleLiteral);
  50571. styleModes.push(propStr);
  50572. }
  50573. else if (typeof style.styleIdentifier === 'string') {
  50574. // direct import already written in the source code
  50575. // import myTagIosStyle from './import-path.css';
  50576. // static get style() { return { "ios": myTagIosStyle }; }
  50577. const styleIdentifier = t.createIdentifier(style.styleIdentifier);
  50578. const propIdentifier = t.createPropertyAssignment(style.modeName, styleIdentifier);
  50579. styleModes.push(propIdentifier);
  50580. }
  50581. else if (Array.isArray(style.externalStyles) && style.externalStyles.length > 0) {
  50582. // import generated from @Component() styleUrls option
  50583. // import myTagIosStyle from './import-path.css';
  50584. // static get style() { return { "ios": myTagIosStyle }; }
  50585. const styleUrlIdentifier = createStyleIdentifierFromUrl$1(cmp, style);
  50586. const propUrlIdentifier = t.createPropertyAssignment(style.modeName, styleUrlIdentifier);
  50587. styleModes.push(propUrlIdentifier);
  50588. }
  50589. });
  50590. const styleObj = t.createObjectLiteral(styleModes, true);
  50591. classMembers.push(createStaticGetter('style', styleObj));
  50592. };
  50593. const addSingleStyleGetter = (classMembers, cmp, style) => {
  50594. if (typeof style.styleStr === 'string') {
  50595. // inline the style string
  50596. // static get style() { return "string"; }
  50597. const styleLiteral = createStyleLiteral$1(cmp, style);
  50598. classMembers.push(createStaticGetter('style', styleLiteral));
  50599. }
  50600. else if (typeof style.styleIdentifier === 'string') {
  50601. // direct import already written in the source code
  50602. // import myTagStyle from './import-path.css';
  50603. // static get style() { return myTagStyle; }
  50604. const styleIdentifier = t.createIdentifier(style.styleIdentifier);
  50605. classMembers.push(createStaticGetter('style', styleIdentifier));
  50606. }
  50607. else if (Array.isArray(style.externalStyles) && style.externalStyles.length > 0) {
  50608. // import generated from @Component() styleUrls option
  50609. // import myTagStyle from './import-path.css';
  50610. // static get style() { return myTagStyle; }
  50611. const styleUrlIdentifier = createStyleIdentifierFromUrl$1(cmp, style);
  50612. classMembers.push(createStaticGetter('style', styleUrlIdentifier));
  50613. }
  50614. };
  50615. const createStyleLiteral$1 = (cmp, style) => {
  50616. if (cmp.encapsulation === 'scoped') {
  50617. // scope the css first
  50618. const scopeId = getScopeId(cmp.tagName, style.modeName);
  50619. return t.createStringLiteral(scopeCss(style.styleStr, scopeId, false));
  50620. }
  50621. return t.createStringLiteral(style.styleStr);
  50622. };
  50623. const createStyleIdentifierFromUrl$1 = (cmp, style) => {
  50624. style.styleIdentifier = dashToPascalCase$1(cmp.tagName);
  50625. style.styleIdentifier = style.styleIdentifier.charAt(0).toLowerCase() + style.styleIdentifier.substring(1);
  50626. if (style.modeName !== DEFAULT_STYLE_MODE) {
  50627. style.styleIdentifier += dashToPascalCase$1(style.modeName);
  50628. }
  50629. style.styleIdentifier += 'Style';
  50630. style.externalStyles = [style.externalStyles[0]];
  50631. return t.createIdentifier(style.styleIdentifier);
  50632. };
  50633. const addWatchers = (classMembers, cmp) => {
  50634. if (cmp.watchers.length > 0) {
  50635. const watcherObj = {};
  50636. cmp.watchers.forEach(({ propName, methodName }) => {
  50637. watcherObj[propName] = watcherObj[propName] || [];
  50638. watcherObj[propName].push(methodName);
  50639. });
  50640. classMembers.push(createStaticGetter('watchers', convertValueToLiteral(watcherObj)));
  50641. }
  50642. };
  50643. const removeStaticMetaProperties = (classNode) => {
  50644. if (classNode.members == null) {
  50645. return [];
  50646. }
  50647. return classNode.members.filter((classMember) => {
  50648. if (classMember.modifiers) {
  50649. if (classMember.modifiers.some((m) => m.kind === t.SyntaxKind.StaticKeyword)) {
  50650. const memberName = classMember.name.escapedText;
  50651. if (REMOVE_STATIC_GETTERS.has(memberName)) {
  50652. return false;
  50653. }
  50654. }
  50655. }
  50656. return true;
  50657. });
  50658. };
  50659. const REMOVE_STATIC_GETTERS = new Set([
  50660. 'is',
  50661. 'properties',
  50662. 'encapsulation',
  50663. 'elementRef',
  50664. 'events',
  50665. 'listeners',
  50666. 'methods',
  50667. 'states',
  50668. 'originalStyleUrls',
  50669. 'styleMode',
  50670. 'style',
  50671. 'styles',
  50672. 'styleUrl',
  50673. 'watchers',
  50674. 'styleUrls',
  50675. 'contextProps',
  50676. 'connectProps',
  50677. ]);
  50678. const transformHostData = (classElements, moduleFile) => {
  50679. const hasHostData = classElements.some((e) => t.isMethodDeclaration(e) && e.name.escapedText === 'hostData');
  50680. if (hasHostData) {
  50681. const renderIndex = classElements.findIndex((e) => t.isMethodDeclaration(e) && e.name.escapedText === 'render');
  50682. if (renderIndex >= 0) {
  50683. const renderMethod = classElements[renderIndex];
  50684. classElements[renderIndex] = t.updateMethod(renderMethod, renderMethod.decorators, renderMethod.modifiers, renderMethod.asteriskToken, t.createIdentifier(INTERNAL_RENDER), renderMethod.questionToken, renderMethod.typeParameters, renderMethod.parameters, renderMethod.type, renderMethod.body);
  50685. }
  50686. classElements.push(syntheticRender(moduleFile, renderIndex >= 0));
  50687. }
  50688. };
  50689. const syntheticRender = (moduleFile, hasRender) => {
  50690. addCoreRuntimeApi(moduleFile, RUNTIME_APIS.Host);
  50691. addCoreRuntimeApi(moduleFile, RUNTIME_APIS.h);
  50692. const hArguments = [
  50693. // __stencil_Host
  50694. t.createIdentifier(HOST),
  50695. // this.hostData()
  50696. t.createCall(t.createPropertyAccess(t.createThis(), 'hostData'), undefined, undefined),
  50697. ];
  50698. if (hasRender) {
  50699. hArguments.push(
  50700. // this.render()
  50701. t.createCall(t.createPropertyAccess(t.createThis(), INTERNAL_RENDER), undefined, undefined));
  50702. }
  50703. /**
  50704. * render() {
  50705. * return h(arguments);
  50706. * }
  50707. */
  50708. return t.createMethod(undefined, undefined, undefined, 'render', undefined, undefined, undefined, undefined, t.createBlock([t.createReturn(t.createCall(t.createIdentifier(H), undefined, hArguments))]));
  50709. };
  50710. const INTERNAL_RENDER = '__stencil_render';
  50711. const updateComponentClass = (transformOpts, classNode, heritageClauses, members) => {
  50712. let classModifiers = Array.isArray(classNode.modifiers) ? classNode.modifiers.slice() : [];
  50713. if (transformOpts.module === 'cjs') {
  50714. // CommonJS, leave component class as is
  50715. if (transformOpts.componentExport === 'customelement') {
  50716. // remove export from class
  50717. classModifiers = classModifiers.filter((m) => {
  50718. return m.kind !== t.SyntaxKind.ExportKeyword;
  50719. });
  50720. }
  50721. return t.updateClassDeclaration(classNode, classNode.decorators, classModifiers, classNode.name, classNode.typeParameters, heritageClauses, members);
  50722. }
  50723. // ESM with export
  50724. return createConstClass(transformOpts, classNode, heritageClauses, members);
  50725. };
  50726. const createConstClass = (transformOpts, classNode, heritageClauses, members) => {
  50727. const className = classNode.name;
  50728. const classModifiers = (Array.isArray(classNode.modifiers) ? classNode.modifiers : []).filter((m) => {
  50729. // remove the export
  50730. return m.kind !== t.SyntaxKind.ExportKeyword;
  50731. });
  50732. const constModifiers = [];
  50733. if (transformOpts.componentExport !== 'customelement') {
  50734. constModifiers.push(t.createModifier(t.SyntaxKind.ExportKeyword));
  50735. }
  50736. return t.createVariableStatement(constModifiers, t.createVariableDeclarationList([
  50737. t.createVariableDeclaration(className, undefined, t.createClassExpression(classModifiers, undefined, classNode.typeParameters, heritageClauses, members)),
  50738. ], t.NodeFlags.Const));
  50739. };
  50740. const addCreateEvents = (moduleFile, cmp) => {
  50741. return cmp.events.map((ev) => {
  50742. addCoreRuntimeApi(moduleFile, RUNTIME_APIS.createEvent);
  50743. return t.createStatement(t.createAssignment(t.createPropertyAccess(t.createThis(), t.createIdentifier(ev.method)), t.createCall(t.createIdentifier(CREATE_EVENT), undefined, [
  50744. t.createThis(),
  50745. t.createLiteral(ev.name),
  50746. t.createLiteral(computeFlags(ev)),
  50747. ])));
  50748. });
  50749. };
  50750. const computeFlags = (eventMeta) => {
  50751. let flags = 0;
  50752. if (eventMeta.bubbles) {
  50753. flags |= 4 /* Bubbles */;
  50754. }
  50755. if (eventMeta.composed) {
  50756. flags |= 2 /* Composed */;
  50757. }
  50758. if (eventMeta.cancelable) {
  50759. flags |= 1 /* Cancellable */;
  50760. }
  50761. return flags;
  50762. };
  50763. const addLegacyProps = (moduleFile, cmp) => {
  50764. if (cmp.legacyConnect.length > 0) {
  50765. addCoreRuntimeApi(moduleFile, RUNTIME_APIS.getConnect);
  50766. }
  50767. if (cmp.legacyContext.length > 0) {
  50768. addCoreRuntimeApi(moduleFile, RUNTIME_APIS.getContext);
  50769. }
  50770. return [
  50771. ...cmp.legacyConnect.map((c) => getStatement(c.name, GET_CONNECT, c.connect)),
  50772. ...cmp.legacyContext.map((c) => getStatement(c.name, GET_CONTEXT, c.context)),
  50773. ];
  50774. };
  50775. const getStatement = (propName, method, arg) => {
  50776. return t.createExpressionStatement(t.createAssignment(t.createPropertyAccess(t.createThis(), propName), t.createCall(t.createIdentifier(method), undefined, [t.createThis(), t.createLiteral(arg)])));
  50777. };
  50778. const updateNativeConstructor = (classMembers, moduleFile, cmp, ensureSuper) => {
  50779. if (cmp.isPlain) {
  50780. return;
  50781. }
  50782. const cstrMethodIndex = classMembers.findIndex((m) => m.kind === t.SyntaxKind.Constructor);
  50783. if (cstrMethodIndex >= 0) {
  50784. // add to the existing constructor()
  50785. const cstrMethod = classMembers[cstrMethodIndex];
  50786. let statements = [
  50787. ...nativeInit(moduleFile, cmp),
  50788. ...addCreateEvents(moduleFile, cmp),
  50789. ...cstrMethod.body.statements,
  50790. ...addLegacyProps(moduleFile, cmp),
  50791. ];
  50792. if (ensureSuper) {
  50793. const hasSuper = cstrMethod.body.statements.some((s) => s.kind === t.SyntaxKind.SuperKeyword);
  50794. if (!hasSuper) {
  50795. statements = [createNativeConstructorSuper(), ...statements];
  50796. }
  50797. }
  50798. classMembers[cstrMethodIndex] = t.updateConstructor(cstrMethod, cstrMethod.decorators, cstrMethod.modifiers, cstrMethod.parameters, t.updateBlock(cstrMethod.body, statements));
  50799. }
  50800. else {
  50801. // create a constructor()
  50802. let statements = [
  50803. ...nativeInit(moduleFile, cmp),
  50804. ...addCreateEvents(moduleFile, cmp),
  50805. ...addLegacyProps(moduleFile, cmp),
  50806. ];
  50807. if (ensureSuper) {
  50808. statements = [createNativeConstructorSuper(), ...statements];
  50809. }
  50810. const cstrMethod = t.createConstructor(undefined, undefined, undefined, t.createBlock(statements, true));
  50811. classMembers.unshift(cstrMethod);
  50812. }
  50813. };
  50814. /**
  50815. * Generates a series of expression statements used to help initialize a Stencil component
  50816. * @param moduleFile the Stencil module that will be instantiated
  50817. * @param cmp the component's metadata
  50818. * @returns the generated expression statements
  50819. */
  50820. const nativeInit = (moduleFile, cmp) => {
  50821. const initStatements = [nativeRegisterHostStatement()];
  50822. if (cmp.encapsulation === 'shadow') {
  50823. initStatements.push(nativeAttachShadowStatement(moduleFile));
  50824. }
  50825. return initStatements;
  50826. };
  50827. const nativeRegisterHostStatement = () => {
  50828. return t.createStatement(t.createCall(t.createPropertyAccess(t.createThis(), t.createIdentifier('__registerHost')), undefined, undefined));
  50829. };
  50830. /**
  50831. * Generates an expression statement for attaching a shadow DOM tree to an element.
  50832. * @param moduleFile the Stencil module that will use the generated expression statement
  50833. * @returns the generated expression statement
  50834. */
  50835. const nativeAttachShadowStatement = (moduleFile) => {
  50836. addCoreRuntimeApi(moduleFile, RUNTIME_APIS.attachShadow);
  50837. // Create an expression statement, `this.__attachShadow();`
  50838. return t.factory.createExpressionStatement(t.factory.createCallExpression(t.factory.createPropertyAccessExpression(t.factory.createThis(), t.factory.createIdentifier('__attachShadow')), undefined, undefined));
  50839. };
  50840. const createNativeConstructorSuper = () => {
  50841. return t.createExpressionStatement(t.createCall(t.createIdentifier('super'), undefined, undefined));
  50842. };
  50843. const updateNativeComponentClass = (transformOpts, classNode, moduleFile, cmp) => {
  50844. const heritageClauses = updateNativeHostComponentHeritageClauses(classNode, moduleFile);
  50845. const members = updateNativeHostComponentMembers(transformOpts, classNode, moduleFile, cmp);
  50846. return updateComponentClass(transformOpts, classNode, heritageClauses, members);
  50847. };
  50848. const updateNativeHostComponentHeritageClauses = (classNode, moduleFile) => {
  50849. if (classNode.heritageClauses != null && classNode.heritageClauses.length > 0) {
  50850. return classNode.heritageClauses;
  50851. }
  50852. if (moduleFile.cmps.length >= 1) {
  50853. addCoreRuntimeApi(moduleFile, RUNTIME_APIS.HTMLElement);
  50854. }
  50855. const heritageClause = t.factory.createHeritageClause(t.SyntaxKind.ExtendsKeyword, [
  50856. t.factory.createExpressionWithTypeArguments(t.factory.createIdentifier(HTML_ELEMENT), []),
  50857. ]);
  50858. return [heritageClause];
  50859. };
  50860. const updateNativeHostComponentMembers = (transformOpts, classNode, moduleFile, cmp) => {
  50861. const classMembers = removeStaticMetaProperties(classNode);
  50862. updateNativeConstructor(classMembers, moduleFile, cmp, true);
  50863. addNativeConnectedCallback(classMembers, cmp);
  50864. addNativeElementGetter(classMembers, cmp);
  50865. addWatchers(classMembers, cmp);
  50866. if (cmp.isPlain) {
  50867. addNativeComponentMeta(classMembers, cmp);
  50868. }
  50869. if (transformOpts.style === 'static') {
  50870. addNativeStaticStyle(classMembers, cmp);
  50871. }
  50872. transformHostData(classMembers, moduleFile);
  50873. return classMembers;
  50874. };
  50875. const updateStyleImports = (transformOpts, tsSourceFile, moduleFile) => {
  50876. // add style imports built from @Component() styleUrl option
  50877. if (transformOpts.module === 'cjs') {
  50878. return updateCjsStyleRequires(transformOpts, tsSourceFile, moduleFile);
  50879. }
  50880. return updateEsmStyleImports(transformOpts, tsSourceFile, moduleFile);
  50881. };
  50882. const updateEsmStyleImports = (transformOpts, tsSourceFile, moduleFile) => {
  50883. const styleImports = [];
  50884. let statements = tsSourceFile.statements.slice();
  50885. let updateSourceFile = false;
  50886. moduleFile.cmps.forEach((cmp) => {
  50887. cmp.styles.forEach((style) => {
  50888. if (typeof style.styleIdentifier === 'string') {
  50889. updateSourceFile = true;
  50890. if (style.externalStyles.length > 0) {
  50891. // add style imports built from @Component() styleUrl option
  50892. styleImports.push(createEsmStyleImport(transformOpts, tsSourceFile, cmp, style));
  50893. }
  50894. else {
  50895. // update existing esm import of a style identifier
  50896. statements = updateEsmStyleImportPath(transformOpts, tsSourceFile, statements, cmp, style);
  50897. }
  50898. }
  50899. });
  50900. });
  50901. if (updateSourceFile) {
  50902. let lastImportIndex = -1;
  50903. for (let i = 0; i < statements.length; i++) {
  50904. if (t.isImportDeclaration(statements[i])) {
  50905. lastImportIndex = i;
  50906. }
  50907. }
  50908. statements.splice(lastImportIndex + 1, 0, ...styleImports);
  50909. return t.updateSourceFileNode(tsSourceFile, statements);
  50910. }
  50911. return tsSourceFile;
  50912. };
  50913. const updateEsmStyleImportPath = (transformOpts, tsSourceFile, statements, cmp, style) => {
  50914. for (let i = 0; i < statements.length; i++) {
  50915. const n = statements[i];
  50916. if (t.isImportDeclaration(n) && n.importClause && n.moduleSpecifier && t.isStringLiteral(n.moduleSpecifier)) {
  50917. if (n.importClause.name && n.importClause.name.escapedText === style.styleIdentifier) {
  50918. const orgImportPath = n.moduleSpecifier.text;
  50919. const importPath = getStyleImportPath(transformOpts, tsSourceFile, cmp, style, orgImportPath);
  50920. statements[i] = t.factory.updateImportDeclaration(n, n.decorators, n.modifiers, n.importClause, t.factory.createStringLiteral(importPath), undefined);
  50921. break;
  50922. }
  50923. }
  50924. }
  50925. return statements;
  50926. };
  50927. const createEsmStyleImport = (transformOpts, tsSourceFile, cmp, style) => {
  50928. const importName = t.createIdentifier(style.styleIdentifier);
  50929. const importPath = getStyleImportPath(transformOpts, tsSourceFile, cmp, style, style.externalStyles[0].absolutePath);
  50930. return t.createImportDeclaration(undefined, undefined, t.createImportClause(importName, undefined), t.createLiteral(importPath));
  50931. };
  50932. const updateCjsStyleRequires = (transformOpts, tsSourceFile, moduleFile) => {
  50933. const styleRequires = [];
  50934. moduleFile.cmps.forEach((cmp) => {
  50935. cmp.styles.forEach((style) => {
  50936. if (typeof style.styleIdentifier === 'string' && style.externalStyles.length > 0) {
  50937. // add style imports built from @Component() styleUrl option
  50938. styleRequires.push(createCjsStyleRequire(transformOpts, tsSourceFile, cmp, style));
  50939. }
  50940. });
  50941. });
  50942. if (styleRequires.length > 0) {
  50943. return t.updateSourceFileNode(tsSourceFile, [...styleRequires, ...tsSourceFile.statements]);
  50944. }
  50945. return tsSourceFile;
  50946. };
  50947. const createCjsStyleRequire = (transformOpts, tsSourceFile, cmp, style) => {
  50948. const importName = t.createIdentifier(style.styleIdentifier);
  50949. const importPath = getStyleImportPath(transformOpts, tsSourceFile, cmp, style, style.externalStyles[0].absolutePath);
  50950. return t.createVariableStatement(undefined, t.createVariableDeclarationList([
  50951. t.createVariableDeclaration(importName, undefined, t.createCall(t.createIdentifier('require'), [], [t.createLiteral(importPath)])),
  50952. ], t.NodeFlags.Const));
  50953. };
  50954. const getStyleImportPath = (transformOpts, tsSourceFile, cmp, style, importPath) => {
  50955. const importData = {
  50956. importeePath: importPath,
  50957. importerPath: tsSourceFile.fileName,
  50958. tag: cmp.tagName,
  50959. encapsulation: cmp.encapsulation,
  50960. mode: style.modeName,
  50961. };
  50962. return serializeImportPath(importData, transformOpts.styleImportData);
  50963. };
  50964. const nativeComponentTransform = (compilerCtx, transformOpts) => {
  50965. return (transformCtx) => {
  50966. return (tsSourceFile) => {
  50967. const moduleFile = getModuleFromSourceFile(compilerCtx, tsSourceFile);
  50968. const visitNode = (node) => {
  50969. if (t.isClassDeclaration(node)) {
  50970. const cmp = getComponentMeta(compilerCtx, tsSourceFile, node);
  50971. if (cmp != null) {
  50972. return updateNativeComponentClass(transformOpts, node, moduleFile, cmp);
  50973. }
  50974. }
  50975. return t.visitEachChild(node, visitNode, transformCtx);
  50976. };
  50977. tsSourceFile = t.visitEachChild(tsSourceFile, visitNode, transformCtx);
  50978. if (moduleFile.cmps.length > 0) {
  50979. if (transformOpts.componentExport === 'customelement') {
  50980. // define custom element, will have no export
  50981. tsSourceFile = defineCustomElement(tsSourceFile, moduleFile, transformOpts);
  50982. }
  50983. else if (transformOpts.proxy === 'defineproperty') {
  50984. // exporting as a module, but also add the component proxy fn
  50985. tsSourceFile = addModuleMetadataProxies(tsSourceFile, moduleFile);
  50986. }
  50987. tsSourceFile = updateStyleImports(transformOpts, tsSourceFile, moduleFile);
  50988. }
  50989. if (moduleFile.isLegacy) {
  50990. addLegacyApis(moduleFile);
  50991. }
  50992. tsSourceFile = addImports(transformOpts, tsSourceFile, moduleFile.coreRuntimeApis, transformOpts.coreImportPath);
  50993. return tsSourceFile;
  50994. };
  50995. };
  50996. };
  50997. /**
  50998. * Import and define components along with any component dependents within the `dist-custom-elements` output.
  50999. * Adds `defineCustomElement()` function for all components.
  51000. * @param compilerCtx - current compiler context
  51001. * @param components - all current components within the stencil buildCtx
  51002. * @param outputTarget - the output target being compiled
  51003. * @returns a TS AST transformer factory function
  51004. */
  51005. const addDefineCustomElementFunctions = (compilerCtx, components, outputTarget) => {
  51006. return () => {
  51007. return (tsSourceFile) => {
  51008. const moduleFile = getModuleFromSourceFile(compilerCtx, tsSourceFile);
  51009. const newStatements = [];
  51010. const caseStatements = [];
  51011. const tagNames = [];
  51012. if (moduleFile.cmps.length) {
  51013. const principalComponent = moduleFile.cmps[0];
  51014. tagNames.push(principalComponent.tagName);
  51015. // define the current component - `customElements.define(tagName, MyProxiedComponent);`
  51016. const customElementsDefineCallExpression = t.factory.createCallExpression(t.factory.createPropertyAccessExpression(t.factory.createIdentifier('customElements'), 'define'), undefined, [t.factory.createIdentifier('tagName'), t.factory.createIdentifier(principalComponent.componentClassName)]);
  51017. // create a `case` block that defines the current component. We'll add them to our switch statement later.
  51018. caseStatements.push(createCustomElementsDefineCase(principalComponent.tagName, customElementsDefineCallExpression));
  51019. setupComponentDependencies(moduleFile, components, newStatements, caseStatements, tagNames);
  51020. addDefineCustomElementFunction(tagNames, newStatements, caseStatements);
  51021. if (outputTarget.autoDefineCustomElements) {
  51022. const conditionalDefineCustomElementCall = createAutoDefinitionExpression(principalComponent.componentClassName);
  51023. newStatements.push(conditionalDefineCustomElementCall);
  51024. }
  51025. }
  51026. tsSourceFile = t.factory.updateSourceFile(tsSourceFile, [...tsSourceFile.statements, ...newStatements]);
  51027. return tsSourceFile;
  51028. };
  51029. };
  51030. };
  51031. /**
  51032. * Adds dependent component import statements and sets up and case blocks
  51033. * @param moduleFile current components' module
  51034. * @param components all current components within the stencil buildCtx
  51035. * @param newStatements new top level statement array to add to that will get added to the AST
  51036. * @param caseStatements an array of case statement blocks to add to. Will get added to `defineCustomElement` later
  51037. * @param tagNames array of all related component tag-names to add to
  51038. */
  51039. const setupComponentDependencies = (moduleFile, components, newStatements, caseStatements, tagNames) => {
  51040. moduleFile.cmps.forEach((cmp) => {
  51041. cmp.dependencies.forEach((dCmp) => {
  51042. const foundDep = components.find((dComp) => dComp.tagName === dCmp);
  51043. const exportName = dashToPascalCase$1(foundDep.tagName);
  51044. const importAs = `$${exportName}DefineCustomElement`;
  51045. tagNames.push(foundDep.tagName);
  51046. // Will add `import { defineCustomElement as $ComponentDefineCustomElement } from 'my-nested-component.tsx';`
  51047. newStatements.push(createImportStatement([`defineCustomElement as ${importAs}`], foundDep.sourceFilePath));
  51048. // define a dependent component by recursively calling their own `defineCustomElement()`
  51049. const callExpression = t.factory.createCallExpression(t.factory.createIdentifier(importAs), undefined, []);
  51050. // `case` blocks that define the dependent components. We'll add them to our switch statement later.
  51051. caseStatements.push(createCustomElementsDefineCase(foundDep.tagName, callExpression));
  51052. });
  51053. });
  51054. };
  51055. /**
  51056. * Creates a case block which will be used to define components. e.g.
  51057. * ``` javascript
  51058. * case "my-component":
  51059. * if (!customElements.get(tagName)) {
  51060. * customElements.define(tagName, MyProxiedComponent);
  51061. * // OR for dependent components
  51062. * defineCustomElement(tagName);
  51063. * }
  51064. * break;
  51065. * } });
  51066. ```
  51067. * @param tagName the components' tagName saved within stencil.
  51068. * @param actionExpression the actual expression to call to define the customElement
  51069. * @returns ts AST CaseClause
  51070. */
  51071. const createCustomElementsDefineCase = (tagName, actionExpression) => {
  51072. return t.factory.createCaseClause(t.factory.createStringLiteral(tagName), [
  51073. t.factory.createIfStatement(t.factory.createPrefixUnaryExpression(t.SyntaxKind.ExclamationToken, t.factory.createCallExpression(t.factory.createPropertyAccessExpression(t.factory.createIdentifier('customElements'), 'get'), undefined, [t.factory.createIdentifier('tagName')])), t.factory.createBlock([t.factory.createExpressionStatement(actionExpression)])),
  51074. t.factory.createBreakStatement(),
  51075. ]);
  51076. };
  51077. /**
  51078. * Add the main `defineCustomElement` function e.g.
  51079. * ```javascript
  51080. * function defineCustomElement() {
  51081. * if (typeof customElements === 'undefined') {
  51082. * return;
  51083. * }
  51084. * const components = ['my-component'];
  51085. * components.forEach(tagName => {
  51086. * switch (tagName) {
  51087. * case "my-component":
  51088. * if (!customElements.get(tagName)) {
  51089. * customElements.define(tagName, MyProxiedComponent);
  51090. * // OR for dependent components
  51091. * defineCustomElement(tagName);
  51092. * }
  51093. * break;
  51094. * }
  51095. * });
  51096. * }
  51097. ```
  51098. * @param tagNames all components that will be defined
  51099. * @param newStatements new top level statement array that will get added to the AST
  51100. * @param caseStatements an array of case statement blocks. Will get added to `defineCustomElement` later
  51101. */
  51102. const addDefineCustomElementFunction = (tagNames, newStatements, caseStatements) => {
  51103. const newExpression = t.factory.createFunctionDeclaration(undefined, [t.factory.createModifier(t.SyntaxKind.ExportKeyword)], undefined, t.factory.createIdentifier('defineCustomElement'), undefined, undefined, undefined, t.factory.createBlock([
  51104. t.factory.createIfStatement(t.factory.createStrictEquality(t.factory.createTypeOfExpression(t.factory.createIdentifier('customElements')), t.factory.createStringLiteral('undefined')), t.factory.createBlock([t.factory.createReturnStatement()])),
  51105. t.factory.createVariableStatement(undefined, t.factory.createVariableDeclarationList([
  51106. t.factory.createVariableDeclaration('components', undefined, undefined, t.factory.createArrayLiteralExpression(tagNames.map((tagName) => t.factory.createStringLiteral(tagName)))),
  51107. ], t.NodeFlags.Const)),
  51108. t.factory.createExpressionStatement(t.factory.createCallExpression(t.factory.createPropertyAccessExpression(t.factory.createIdentifier('components'), 'forEach'), undefined, [
  51109. t.factory.createArrowFunction(undefined, undefined, [
  51110. t.factory.createParameterDeclaration(undefined, undefined, undefined, t.factory.createIdentifier('tagName'), undefined, undefined),
  51111. ], undefined, t.factory.createToken(t.SyntaxKind.EqualsGreaterThanToken), t.factory.createBlock([
  51112. t.factory.createSwitchStatement(t.factory.createIdentifier('tagName'), t.factory.createCaseBlock(caseStatements)),
  51113. ])),
  51114. ])),
  51115. ], true));
  51116. newStatements.push(newExpression);
  51117. };
  51118. /**
  51119. * Create a call to `defineCustomElement` for the principle web component.
  51120. * ```typescript
  51121. * defineCustomElement(MyPrincipalComponent);
  51122. * ```
  51123. * @returns the expression statement described above
  51124. */
  51125. function createAutoDefinitionExpression(componentName) {
  51126. return t.factory.createExpressionStatement(t.factory.createCallExpression(t.factory.createIdentifier('defineCustomElement'), undefined, [
  51127. t.factory.createIdentifier(componentName),
  51128. ]));
  51129. }
  51130. /**
  51131. * Proxy custom elements for the `dist-custom-elements` output target. This function searches for a Stencil component's
  51132. * class initializer (found on the righthand side of the '=' operator):
  51133. *
  51134. * ```ts
  51135. * const MyComponent = class extends HTMLElement { // Implementation omitted }
  51136. * ```
  51137. *
  51138. * and wraps the initializer into a `proxyCustomElement` call:
  51139. *
  51140. * ```ts
  51141. * const MyComponent = proxyCustomElement(class extends HTMLElement { // Implementation omitted }, componentMetadata);
  51142. * ```
  51143. *
  51144. * This is to work around an issue where treeshaking does not work for webpack users, whose details are captured in full
  51145. * in [this issue on the webpack GitHub repo](https://github.com/webpack/webpack/issues/14963).
  51146. *
  51147. * @param compilerCtx current compiler context
  51148. * @param transformOpts transpilation options for the current build
  51149. * @returns a TypeScript AST transformer factory function that performs the above described transformation
  51150. */
  51151. const proxyCustomElement = (compilerCtx, transformOpts) => {
  51152. return () => {
  51153. return (tsSourceFile) => {
  51154. const moduleFile = getModuleFromSourceFile(compilerCtx, tsSourceFile);
  51155. if (!moduleFile.cmps.length) {
  51156. return tsSourceFile;
  51157. }
  51158. const principalComponent = moduleFile.cmps[0];
  51159. for (let [stmtIndex, stmt] of tsSourceFile.statements.entries()) {
  51160. if (t.isVariableStatement(stmt)) {
  51161. for (let [declarationIndex, declaration] of stmt.declarationList.declarations.entries()) {
  51162. if (declaration.name.getText() !== principalComponent.componentClassName) {
  51163. continue;
  51164. }
  51165. // wrap the Stencil component's class declaration in a component proxy
  51166. const proxyCreationCall = createAnonymousClassMetadataProxy(principalComponent, declaration.initializer);
  51167. t.addSyntheticLeadingComment(proxyCreationCall, t.SyntaxKind.MultiLineCommentTrivia, '@__PURE__', false);
  51168. // update the component's variable declaration to use the new initializer
  51169. const proxiedComponentDeclaration = t.factory.updateVariableDeclaration(declaration, declaration.name, declaration.exclamationToken, declaration.type, proxyCreationCall);
  51170. // update the declaration list that contains the updated variable declaration
  51171. const updatedDeclarationList = t.factory.updateVariableDeclarationList(stmt.declarationList, [
  51172. ...stmt.declarationList.declarations.slice(0, declarationIndex),
  51173. proxiedComponentDeclaration,
  51174. ...stmt.declarationList.declarations.slice(declarationIndex + 1),
  51175. ]);
  51176. // update the variable statement containing the updated declaration list
  51177. const updatedVariableStatement = t.factory.updateVariableStatement(stmt, [t.factory.createModifier(t.SyntaxKind.ExportKeyword)], updatedDeclarationList);
  51178. // update the source file's statements to use the new variable statement
  51179. tsSourceFile = t.factory.updateSourceFile(tsSourceFile, [
  51180. ...tsSourceFile.statements.slice(0, stmtIndex),
  51181. updatedVariableStatement,
  51182. ...tsSourceFile.statements.slice(stmtIndex + 1),
  51183. ]);
  51184. // finally, ensure that the proxyCustomElement function is imported
  51185. tsSourceFile = addImports(transformOpts, tsSourceFile, [RUNTIME_APIS.proxyCustomElement], transformOpts.coreImportPath);
  51186. return tsSourceFile;
  51187. }
  51188. }
  51189. }
  51190. return tsSourceFile;
  51191. };
  51192. };
  51193. };
  51194. const updateStencilCoreImports = (updatedCoreImportPath) => {
  51195. return () => {
  51196. return (tsSourceFile) => {
  51197. if (STENCIL_CORE_ID === updatedCoreImportPath) {
  51198. return tsSourceFile;
  51199. }
  51200. let madeChanges = false;
  51201. const newStatements = [];
  51202. tsSourceFile.statements.forEach((s) => {
  51203. if (t.isImportDeclaration(s)) {
  51204. if (s.moduleSpecifier != null && t.isStringLiteral(s.moduleSpecifier)) {
  51205. if (s.moduleSpecifier.text === STENCIL_CORE_ID) {
  51206. if (s.importClause &&
  51207. s.importClause.namedBindings &&
  51208. s.importClause.namedBindings.kind === t.SyntaxKind.NamedImports) {
  51209. const origImports = s.importClause.namedBindings.elements;
  51210. const keepImports = origImports.map((e) => e.getText()).filter((name) => KEEP_IMPORTS.has(name));
  51211. if (keepImports.length > 0) {
  51212. const newImport = t.factory.updateImportDeclaration(s, undefined, undefined, t.factory.createImportClause(false, undefined, t.factory.createNamedImports(keepImports.map((name) => t.factory.createImportSpecifier(false, undefined, t.factory.createIdentifier(name))))), t.factory.createStringLiteral(updatedCoreImportPath), undefined);
  51213. newStatements.push(newImport);
  51214. }
  51215. }
  51216. madeChanges = true;
  51217. return;
  51218. }
  51219. }
  51220. }
  51221. newStatements.push(s);
  51222. });
  51223. if (madeChanges) {
  51224. return t.updateSourceFileNode(tsSourceFile, newStatements, tsSourceFile.isDeclarationFile, tsSourceFile.referencedFiles, tsSourceFile.typeReferenceDirectives, tsSourceFile.hasNoDefaultLib, tsSourceFile.libReferenceDirectives);
  51225. }
  51226. return tsSourceFile;
  51227. };
  51228. };
  51229. };
  51230. const KEEP_IMPORTS = new Set([
  51231. 'h',
  51232. 'setMode',
  51233. 'getMode',
  51234. 'setPlatformHelpers',
  51235. 'Build',
  51236. 'Env',
  51237. 'Host',
  51238. 'Fragment',
  51239. 'getAssetPath',
  51240. 'writeTask',
  51241. 'readTask',
  51242. 'getElement',
  51243. 'forceUpdate',
  51244. 'getRenderingRef',
  51245. 'forceModeUpdate',
  51246. 'setErrorHandler',
  51247. ]);
  51248. const outputCustomElements = async (config, compilerCtx, buildCtx) => {
  51249. if (!config.buildDist) {
  51250. return;
  51251. }
  51252. const outputTargets = config.outputTargets.filter(isOutputTargetDistCustomElements);
  51253. if (outputTargets.length === 0) {
  51254. return;
  51255. }
  51256. const bundlingEventMessage = 'generate custom elements';
  51257. const timespan = buildCtx.createTimeSpan(`${bundlingEventMessage} started`);
  51258. await Promise.all(outputTargets.map((o) => bundleCustomElements$1(config, compilerCtx, buildCtx, o)));
  51259. timespan.finish(`${bundlingEventMessage} finished`);
  51260. };
  51261. const bundleCustomElements$1 = async (config, compilerCtx, buildCtx, outputTarget) => {
  51262. try {
  51263. const bundleOpts = {
  51264. id: 'customElements',
  51265. platform: 'client',
  51266. conditionals: getCustomElementsBuildConditionals(config, buildCtx.components),
  51267. customTransformers: getCustomElementCustomTransformer(config, compilerCtx, buildCtx.components, outputTarget),
  51268. externalRuntime: !!outputTarget.externalRuntime,
  51269. inlineWorkers: true,
  51270. inputs: {
  51271. index: '\0core',
  51272. },
  51273. loader: {
  51274. '\0core': generateEntryPoint$1(outputTarget),
  51275. },
  51276. inlineDynamicImports: outputTarget.inlineDynamicImports,
  51277. preserveEntrySignatures: 'allow-extension',
  51278. };
  51279. addCustomElementInputs(buildCtx, bundleOpts);
  51280. const build = await bundleOutput(config, compilerCtx, buildCtx, bundleOpts);
  51281. if (build) {
  51282. const rollupOutput = await build.generate({
  51283. banner: generatePreamble(config),
  51284. format: 'esm',
  51285. sourcemap: config.sourceMap,
  51286. chunkFileNames: outputTarget.externalRuntime || !config.hashFileNames ? '[name].js' : 'p-[hash].js',
  51287. entryFileNames: '[name].js',
  51288. hoistTransitiveImports: false,
  51289. preferConst: true,
  51290. });
  51291. const minify = outputTarget.externalRuntime || outputTarget.minify !== true ? false : config.minifyJs;
  51292. const files = rollupOutput.output.map(async (bundle) => {
  51293. if (bundle.type === 'chunk') {
  51294. let code = bundle.code;
  51295. let sourceMap = rollupToStencilSourceMap(bundle.map);
  51296. const optimizeResults = await optimizeModule(config, compilerCtx, {
  51297. input: code,
  51298. isCore: bundle.isEntry,
  51299. minify,
  51300. sourceMap,
  51301. });
  51302. buildCtx.diagnostics.push(...optimizeResults.diagnostics);
  51303. if (!hasError(optimizeResults.diagnostics) && typeof optimizeResults.output === 'string') {
  51304. code = optimizeResults.output;
  51305. sourceMap = optimizeResults.sourceMap;
  51306. }
  51307. if (sourceMap) {
  51308. code = code + getSourceMappingUrlForEndOfFile(bundle.fileName);
  51309. await compilerCtx.fs.writeFile(join(outputTarget.dir, bundle.fileName + '.map'), JSON.stringify(sourceMap), {
  51310. outputTargetType: outputTarget.type,
  51311. });
  51312. }
  51313. await compilerCtx.fs.writeFile(join(outputTarget.dir, bundle.fileName), code, {
  51314. outputTargetType: outputTarget.type,
  51315. });
  51316. }
  51317. });
  51318. await Promise.all(files);
  51319. }
  51320. }
  51321. catch (e) {
  51322. catchError(buildCtx.diagnostics, e);
  51323. }
  51324. };
  51325. /**
  51326. * Create the virtual modules/input modules for the `dist-custom-elements` output target.
  51327. * @param buildCtx the context for the current build
  51328. * @param bundleOpts the bundle options to store the virtual modules under. acts as an output parameter
  51329. */
  51330. const addCustomElementInputs = (buildCtx, bundleOpts) => {
  51331. const components = buildCtx.components;
  51332. components.forEach((cmp) => {
  51333. const exp = [];
  51334. const exportName = dashToPascalCase$1(cmp.tagName);
  51335. const importName = cmp.componentClassName;
  51336. const importAs = `$Cmp${exportName}`;
  51337. const coreKey = `\0${exportName}`;
  51338. if (cmp.isPlain) {
  51339. exp.push(`export { ${importName} as ${exportName} } from '${cmp.sourceFilePath}';`);
  51340. }
  51341. else {
  51342. // the `importName` may collide with the `exportName`, alias it just in case it does with `importAs`
  51343. exp.push(`import { ${importName} as ${importAs}, defineCustomElement as cmpDefCustomEle } from '${cmp.sourceFilePath}';`);
  51344. exp.push(`export const ${exportName} = ${importAs};`);
  51345. exp.push(`export const defineCustomElement = cmpDefCustomEle;`);
  51346. }
  51347. bundleOpts.inputs[cmp.tagName] = coreKey;
  51348. bundleOpts.loader[coreKey] = exp.join('\n');
  51349. });
  51350. };
  51351. /**
  51352. * Generate the entrypoint (`index.ts` file) contents for the `dist-custom-elements` output target
  51353. * @param outputTarget the output target's configuration
  51354. * @returns the stringified contents to be placed in the entrypoint
  51355. */
  51356. const generateEntryPoint$1 = (outputTarget) => {
  51357. const imp = [];
  51358. imp.push(`export { setAssetPath, setPlatformOptions } from '${STENCIL_INTERNAL_CLIENT_ID}';`, `export * from '${USER_INDEX_ENTRY_ID}';`);
  51359. if (outputTarget.includeGlobalScripts !== false) {
  51360. imp.push(`import { globalScripts } from '${STENCIL_APP_GLOBALS_ID}';`, `globalScripts();`);
  51361. }
  51362. return imp.join('\n') + '\n';
  51363. };
  51364. /**
  51365. * Get the series of custom transformers that will be applied to a Stencil project's source code during the TypeScript
  51366. * transpilation process
  51367. * @param config the configuration for the Stencil project
  51368. * @param compilerCtx the current compiler context
  51369. * @param components the components that will be compiled as a part of the current build
  51370. * @param outputTarget the output target configuration
  51371. * @returns a list of transformers to use in the transpilation process
  51372. */
  51373. const getCustomElementCustomTransformer = (config, compilerCtx, components, outputTarget) => {
  51374. const transformOpts = {
  51375. coreImportPath: STENCIL_INTERNAL_CLIENT_ID,
  51376. componentExport: null,
  51377. componentMetadata: null,
  51378. currentDirectory: config.sys.getCurrentDirectory(),
  51379. proxy: null,
  51380. style: 'static',
  51381. styleImportData: 'queryparams',
  51382. };
  51383. return [
  51384. addDefineCustomElementFunctions(compilerCtx, components, outputTarget),
  51385. updateStencilCoreImports(transformOpts.coreImportPath),
  51386. nativeComponentTransform(compilerCtx, transformOpts),
  51387. proxyCustomElement(compilerCtx, transformOpts),
  51388. removeCollectionImports(compilerCtx),
  51389. ];
  51390. };
  51391. const outputCustomElementsBundle = async (config, compilerCtx, buildCtx) => {
  51392. if (!config.buildDist) {
  51393. return;
  51394. }
  51395. const outputTargets = config.outputTargets.filter(isOutputTargetDistCustomElementsBundle);
  51396. if (outputTargets.length === 0) {
  51397. return;
  51398. }
  51399. const bundlingEventMessage = `generate custom elements bundle${config.sourceMap ? ' + source maps' : ''}`;
  51400. const timespan = buildCtx.createTimeSpan(`${bundlingEventMessage} started`);
  51401. await Promise.all(outputTargets.map((o) => bundleCustomElements(config, compilerCtx, buildCtx, o)));
  51402. timespan.finish(`${bundlingEventMessage} finished`);
  51403. };
  51404. const bundleCustomElements = async (config, compilerCtx, buildCtx, outputTarget) => {
  51405. try {
  51406. const bundleOpts = {
  51407. id: 'customElementsBundle',
  51408. platform: 'client',
  51409. conditionals: getCustomElementsBuildConditionals(config, buildCtx.components),
  51410. customTransformers: getCustomElementBundleCustomTransformer(config, compilerCtx),
  51411. externalRuntime: !!outputTarget.externalRuntime,
  51412. inlineWorkers: true,
  51413. inputs: {
  51414. index: '\0core',
  51415. },
  51416. loader: {
  51417. '\0core': generateEntryPoint(outputTarget, buildCtx),
  51418. },
  51419. inlineDynamicImports: outputTarget.inlineDynamicImports,
  51420. preserveEntrySignatures: 'allow-extension',
  51421. };
  51422. const build = await bundleOutput(config, compilerCtx, buildCtx, bundleOpts);
  51423. if (build) {
  51424. const rollupOutput = await build.generate({
  51425. banner: generatePreamble(config),
  51426. format: 'esm',
  51427. sourcemap: config.sourceMap,
  51428. chunkFileNames: outputTarget.externalRuntime || !config.hashFileNames ? '[name].js' : 'p-[hash].js',
  51429. entryFileNames: '[name].js',
  51430. hoistTransitiveImports: false,
  51431. preferConst: true,
  51432. });
  51433. const minify = outputTarget.externalRuntime || outputTarget.minify !== true ? false : config.minifyJs;
  51434. const files = rollupOutput.output.map(async (bundle) => {
  51435. if (bundle.type === 'chunk') {
  51436. let code = bundle.code;
  51437. let sourceMap = rollupToStencilSourceMap(bundle.map);
  51438. const optimizeResults = await optimizeModule(config, compilerCtx, {
  51439. input: code,
  51440. isCore: bundle.isEntry,
  51441. minify,
  51442. sourceMap,
  51443. });
  51444. buildCtx.diagnostics.push(...optimizeResults.diagnostics);
  51445. if (!hasError(optimizeResults.diagnostics) && typeof optimizeResults.output === 'string') {
  51446. code = optimizeResults.output;
  51447. sourceMap = optimizeResults.sourceMap;
  51448. }
  51449. if (sourceMap) {
  51450. code = code + getSourceMappingUrlForEndOfFile(bundle.fileName);
  51451. await compilerCtx.fs.writeFile(join(outputTarget.dir, bundle.fileName + '.map'), JSON.stringify(sourceMap), {
  51452. outputTargetType: outputTarget.type,
  51453. });
  51454. }
  51455. await compilerCtx.fs.writeFile(join(outputTarget.dir, bundle.fileName), code, {
  51456. outputTargetType: outputTarget.type,
  51457. });
  51458. }
  51459. });
  51460. await Promise.all(files);
  51461. }
  51462. }
  51463. catch (e) {
  51464. catchError(buildCtx.diagnostics, e);
  51465. }
  51466. };
  51467. const generateEntryPoint = (outputTarget, buildCtx) => {
  51468. const imp = [];
  51469. const exp = [];
  51470. const exportNames = [];
  51471. imp.push(`import { proxyCustomElement } from '${STENCIL_INTERNAL_CLIENT_ID}';`, `export { setAssetPath, setPlatformOptions } from '${STENCIL_INTERNAL_CLIENT_ID}';`, `export * from '${USER_INDEX_ENTRY_ID}';`);
  51472. if (outputTarget.includeGlobalScripts !== false) {
  51473. imp.push(`import { globalScripts } from '${STENCIL_APP_GLOBALS_ID}';`, `globalScripts();`);
  51474. }
  51475. buildCtx.components.forEach((cmp) => {
  51476. const exportName = dashToPascalCase$1(cmp.tagName);
  51477. const importName = cmp.componentClassName;
  51478. const importAs = `$Cmp${exportName}`;
  51479. if (cmp.isPlain) {
  51480. exp.push(`export { ${importName} as ${exportName} } from '${cmp.sourceFilePath}';`);
  51481. }
  51482. else {
  51483. const meta = stringifyRuntimeData(formatComponentRuntimeMeta(cmp, false));
  51484. imp.push(`import { ${importName} as ${importAs} } from '${cmp.sourceFilePath}';`);
  51485. exp.push(`export const ${exportName} = /*@__PURE__*/proxyCustomElement(${importAs}, ${meta});`);
  51486. }
  51487. exportNames.push(exportName);
  51488. });
  51489. exp.push(`export const defineCustomElements = (opts) => {`);
  51490. exp.push(` if (typeof customElements !== 'undefined') {`);
  51491. exp.push(` [`);
  51492. exp.push(` ${exportNames.join(',\n ')}`);
  51493. exp.push(` ].forEach(cmp => {`);
  51494. exp.push(` if (!customElements.get(cmp.is)) {`);
  51495. exp.push(` customElements.define(cmp.is, cmp, opts);`);
  51496. exp.push(` }`);
  51497. exp.push(` });`);
  51498. exp.push(` }`);
  51499. exp.push(`};`);
  51500. return [...imp, ...exp].join('\n') + '\n';
  51501. };
  51502. const getCustomElementBundleCustomTransformer = (config, compilerCtx) => {
  51503. const transformOpts = {
  51504. coreImportPath: STENCIL_INTERNAL_CLIENT_ID,
  51505. componentExport: null,
  51506. componentMetadata: null,
  51507. currentDirectory: config.sys.getCurrentDirectory(),
  51508. proxy: null,
  51509. style: 'static',
  51510. styleImportData: 'queryparams',
  51511. };
  51512. return [
  51513. updateStencilCoreImports(transformOpts.coreImportPath),
  51514. nativeComponentTransform(compilerCtx, transformOpts),
  51515. removeCollectionImports(compilerCtx),
  51516. ];
  51517. };
  51518. const AUTO_GENERATE_COMMENT = `<!-- Auto Generated Below -->`;
  51519. const NOTE = `*Built with [StencilJS](https://stenciljs.com/)*`;
  51520. const generateDocData = async (config, compilerCtx, buildCtx) => {
  51521. return {
  51522. timestamp: getBuildTimestamp(),
  51523. compiler: {
  51524. name: '@stencil/core',
  51525. version: version$3,
  51526. typescriptVersion,
  51527. },
  51528. components: await getDocsComponents(config, compilerCtx, buildCtx),
  51529. };
  51530. };
  51531. const getDocsComponents = async (config, compilerCtx, buildCtx) => {
  51532. const results = await Promise.all(buildCtx.moduleFiles.map(async (moduleFile) => {
  51533. const filePath = moduleFile.sourceFilePath;
  51534. const dirPath = normalizePath$1(dirname(filePath));
  51535. const readmePath = normalizePath$1(join(dirPath, 'readme.md'));
  51536. const usagesDir = normalizePath$1(join(dirPath, 'usage'));
  51537. const readme = await getUserReadmeContent(compilerCtx, readmePath);
  51538. const usage = await generateUsages(compilerCtx, usagesDir);
  51539. return moduleFile.cmps
  51540. .filter((cmp) => !cmp.internal && !cmp.isCollectionDependency)
  51541. .map((cmp) => ({
  51542. dirPath,
  51543. filePath: relative$1(config.rootDir, filePath),
  51544. fileName: basename(filePath),
  51545. readmePath,
  51546. usagesDir,
  51547. tag: cmp.tagName,
  51548. readme,
  51549. usage,
  51550. docs: generateDocs(readme, cmp.docs),
  51551. docsTags: cmp.docs.tags,
  51552. encapsulation: getDocsEncapsulation(cmp),
  51553. dependents: cmp.directDependents,
  51554. dependencies: cmp.directDependencies,
  51555. dependencyGraph: buildDocsDepGraph(cmp, buildCtx.components),
  51556. deprecation: getDocsDeprecationText(cmp.docs.tags),
  51557. props: getDocsProperties(cmp),
  51558. methods: getDocsMethods(cmp.methods),
  51559. events: getDocsEvents(cmp.events),
  51560. styles: getDocsStyles(cmp),
  51561. slots: getDocsSlots(cmp.docs.tags),
  51562. parts: getDocsParts(cmp.htmlParts, cmp.docs.tags),
  51563. listeners: getDocsListeners(cmp.listeners),
  51564. }));
  51565. }));
  51566. return sortBy(flatOne(results), (cmp) => cmp.tag);
  51567. };
  51568. const buildDocsDepGraph = (cmp, cmps) => {
  51569. const dependencies = {};
  51570. function walk(tagName) {
  51571. if (!dependencies[tagName]) {
  51572. const cmp = cmps.find((c) => c.tagName === tagName);
  51573. const deps = cmp.directDependencies;
  51574. if (deps.length > 0) {
  51575. dependencies[tagName] = deps;
  51576. deps.forEach(walk);
  51577. }
  51578. }
  51579. }
  51580. walk(cmp.tagName);
  51581. // load dependents
  51582. cmp.directDependents.forEach((tagName) => {
  51583. if (dependencies[tagName] && !dependencies[tagName].includes(cmp.tagName)) {
  51584. dependencies[tagName].push(cmp.tagName);
  51585. }
  51586. else {
  51587. dependencies[tagName] = [cmp.tagName];
  51588. }
  51589. });
  51590. return dependencies;
  51591. };
  51592. const getDocsEncapsulation = (cmp) => {
  51593. if (cmp.encapsulation === 'shadow') {
  51594. return 'shadow';
  51595. }
  51596. else if (cmp.encapsulation === 'scoped') {
  51597. return 'scoped';
  51598. }
  51599. else {
  51600. return 'none';
  51601. }
  51602. };
  51603. const getDocsProperties = (cmpMeta) => {
  51604. return sortBy([...getRealProperties(cmpMeta.properties), ...getVirtualProperties(cmpMeta.virtualProperties)], (p) => p.name);
  51605. };
  51606. const getRealProperties = (properties) => {
  51607. return properties
  51608. .filter((member) => !member.internal)
  51609. .map((member) => ({
  51610. name: member.name,
  51611. type: member.complexType.resolved,
  51612. mutable: member.mutable,
  51613. attr: member.attribute,
  51614. reflectToAttr: !!member.reflect,
  51615. docs: member.docs.text,
  51616. docsTags: member.docs.tags,
  51617. default: member.defaultValue,
  51618. deprecation: getDocsDeprecationText(member.docs.tags),
  51619. values: parseTypeIntoValues(member.complexType.resolved),
  51620. optional: member.optional,
  51621. required: member.required,
  51622. }));
  51623. };
  51624. const getVirtualProperties = (virtualProps) => {
  51625. return virtualProps.map((member) => ({
  51626. name: member.name,
  51627. type: member.type,
  51628. mutable: false,
  51629. attr: member.name,
  51630. reflectToAttr: false,
  51631. docs: member.docs,
  51632. docsTags: [],
  51633. default: undefined,
  51634. deprecation: undefined,
  51635. values: parseTypeIntoValues(member.type),
  51636. optional: true,
  51637. required: false,
  51638. }));
  51639. };
  51640. const parseTypeIntoValues = (type) => {
  51641. if (typeof type === 'string') {
  51642. const unions = type.split('|').map((u) => u.trim());
  51643. const parsedUnions = [];
  51644. unions.forEach((u) => {
  51645. if (u === 'true') {
  51646. parsedUnions.push({
  51647. value: 'true',
  51648. type: 'boolean',
  51649. });
  51650. return;
  51651. }
  51652. if (u === 'false') {
  51653. parsedUnions.push({
  51654. value: 'false',
  51655. type: 'boolean',
  51656. });
  51657. return;
  51658. }
  51659. if (!Number.isNaN(parseFloat(u))) {
  51660. // union is a number
  51661. parsedUnions.push({
  51662. value: u,
  51663. type: 'number',
  51664. });
  51665. return;
  51666. }
  51667. if (/^("|').+("|')$/gm.test(u)) {
  51668. // ionic is a string
  51669. parsedUnions.push({
  51670. value: u.slice(1, -1),
  51671. type: 'string',
  51672. });
  51673. return;
  51674. }
  51675. parsedUnions.push({
  51676. type: u,
  51677. });
  51678. });
  51679. return parsedUnions;
  51680. }
  51681. return [];
  51682. };
  51683. const getDocsMethods = (methods) => {
  51684. return sortBy(methods, (member) => member.name)
  51685. .filter((member) => !member.internal)
  51686. .map((member) => ({
  51687. name: member.name,
  51688. returns: {
  51689. type: member.complexType.return,
  51690. docs: member.docs.tags
  51691. .filter((t) => t.name === 'return' || t.name === 'returns')
  51692. .map((t) => t.text)
  51693. .join('\n'),
  51694. },
  51695. signature: `${member.name}${member.complexType.signature}`,
  51696. parameters: [],
  51697. docs: member.docs.text,
  51698. docsTags: member.docs.tags,
  51699. deprecation: getDocsDeprecationText(member.docs.tags),
  51700. }));
  51701. };
  51702. const getDocsEvents = (events) => {
  51703. return sortBy(events, (eventMeta) => eventMeta.name.toLowerCase())
  51704. .filter((eventMeta) => !eventMeta.internal)
  51705. .map((eventMeta) => ({
  51706. event: eventMeta.name,
  51707. detail: eventMeta.complexType.resolved,
  51708. bubbles: eventMeta.bubbles,
  51709. cancelable: eventMeta.cancelable,
  51710. composed: eventMeta.composed,
  51711. docs: eventMeta.docs.text,
  51712. docsTags: eventMeta.docs.tags,
  51713. deprecation: getDocsDeprecationText(eventMeta.docs.tags),
  51714. }));
  51715. };
  51716. const getDocsStyles = (cmpMeta) => {
  51717. if (!cmpMeta.styleDocs) {
  51718. return [];
  51719. }
  51720. return sortBy(cmpMeta.styleDocs, (o) => o.name.toLowerCase()).map((styleDoc) => {
  51721. return {
  51722. name: styleDoc.name,
  51723. annotation: styleDoc.annotation || '',
  51724. docs: styleDoc.docs || '',
  51725. };
  51726. });
  51727. };
  51728. const getDocsListeners = (listeners) => {
  51729. return listeners.map((listener) => ({
  51730. event: listener.name,
  51731. target: listener.target,
  51732. capture: listener.capture,
  51733. passive: listener.passive,
  51734. }));
  51735. };
  51736. const getDocsDeprecationText = (tags) => {
  51737. const deprecation = tags.find((t) => t.name === 'deprecated');
  51738. if (deprecation) {
  51739. return deprecation.text || '';
  51740. }
  51741. return undefined;
  51742. };
  51743. const getDocsSlots = (tags) => {
  51744. return sortBy(getNameText('slot', tags).map(([name, docs]) => ({ name, docs })), (a) => a.name);
  51745. };
  51746. const getDocsParts = (vdom, tags) => {
  51747. const docsParts = getNameText('part', tags).map(([name, docs]) => ({ name, docs }));
  51748. const vdomParts = vdom.map((name) => ({ name, docs: '' }));
  51749. return sortBy(unique([...docsParts, ...vdomParts], (p) => p.name), (p) => p.name);
  51750. };
  51751. const getNameText = (name, tags) => {
  51752. return tags
  51753. .filter((tag) => tag.name === name && tag.text)
  51754. .map(({ text }) => {
  51755. const [namePart, ...rest] = (' ' + text).split(' - ');
  51756. return [namePart.trim(), rest.join(' - ').trim()];
  51757. });
  51758. };
  51759. const getUserReadmeContent = async (compilerCtx, readmePath) => {
  51760. try {
  51761. const existingContent = await compilerCtx.fs.readFile(readmePath);
  51762. const userContentIndex = existingContent.indexOf(AUTO_GENERATE_COMMENT) - 1;
  51763. if (userContentIndex >= 0) {
  51764. return existingContent.substring(0, userContentIndex);
  51765. }
  51766. }
  51767. catch (e) { }
  51768. return undefined;
  51769. };
  51770. const generateDocs = (readme, jsdoc) => {
  51771. const docs = jsdoc.text;
  51772. if (docs !== '' || !readme) {
  51773. return docs;
  51774. }
  51775. let isContent = false;
  51776. const lines = readme.split('\n');
  51777. const contentLines = [];
  51778. for (const line of lines) {
  51779. const isHeader = line.startsWith('#');
  51780. if (isHeader && isContent) {
  51781. break;
  51782. }
  51783. if (!isHeader && !isContent) {
  51784. isContent = true;
  51785. }
  51786. if (isContent) {
  51787. contentLines.push(line);
  51788. }
  51789. }
  51790. return contentLines.join('\n').trim();
  51791. };
  51792. const generateUsages = async (compilerCtx, usagesDir) => {
  51793. const rtn = {};
  51794. try {
  51795. const usageFilePaths = await compilerCtx.fs.readdir(usagesDir);
  51796. const usages = {};
  51797. await Promise.all(usageFilePaths.map(async (f) => {
  51798. if (!f.isFile) {
  51799. return;
  51800. }
  51801. const fileName = basename(f.relPath);
  51802. if (!fileName.toLowerCase().endsWith('.md')) {
  51803. return;
  51804. }
  51805. const parts = fileName.split('.');
  51806. parts.pop();
  51807. const key = parts.join('.');
  51808. usages[key] = await compilerCtx.fs.readFile(f.absPath);
  51809. }));
  51810. Object.keys(usages)
  51811. .sort()
  51812. .forEach((key) => {
  51813. rtn[key] = usages[key];
  51814. });
  51815. }
  51816. catch (e) { }
  51817. return rtn;
  51818. };
  51819. const generateCustomDocs = async (config, docsData, outputTargets) => {
  51820. const customOutputTargets = outputTargets.filter(isOutputTargetDocsCustom);
  51821. if (customOutputTargets.length === 0) {
  51822. return;
  51823. }
  51824. await Promise.all(customOutputTargets.map(async (customOutput) => {
  51825. try {
  51826. await customOutput.generator(docsData, config);
  51827. }
  51828. catch (e) {
  51829. config.logger.error(`uncaught custom docs error: ${e}`);
  51830. }
  51831. }));
  51832. };
  51833. const generateJsonDocs = async (config, compilerCtx, docsData, outputTargets) => {
  51834. const jsonOutputTargets = outputTargets.filter(isOutputTargetDocsJson);
  51835. if (jsonOutputTargets.length === 0) {
  51836. return;
  51837. }
  51838. const docsDtsPath = join(config.sys.getCompilerExecutingPath(), '..', '..', 'internal', 'stencil-public-docs.d.ts');
  51839. const docsDts = await compilerCtx.fs.readFile(docsDtsPath);
  51840. const typesContent = `
  51841. /**
  51842. * This is an autogenerated file created by the Stencil compiler.
  51843. * DO NOT MODIFY IT MANUALLY
  51844. */
  51845. ${docsDts}
  51846. declare const _default: JsonDocs;
  51847. export default _default;
  51848. `;
  51849. const json = {
  51850. ...docsData,
  51851. components: docsData.components.map((cmp) => ({
  51852. filePath: cmp.filePath,
  51853. encapsulation: cmp.encapsulation,
  51854. tag: cmp.tag,
  51855. readme: cmp.readme,
  51856. docs: cmp.docs,
  51857. docsTags: cmp.docsTags,
  51858. usage: cmp.usage,
  51859. props: cmp.props,
  51860. methods: cmp.methods,
  51861. events: cmp.events,
  51862. listeners: cmp.listeners,
  51863. styles: cmp.styles,
  51864. slots: cmp.slots,
  51865. parts: cmp.parts,
  51866. dependents: cmp.dependents,
  51867. dependencies: cmp.dependencies,
  51868. dependencyGraph: cmp.dependencyGraph,
  51869. deprecation: cmp.deprecation,
  51870. })),
  51871. };
  51872. const jsonContent = JSON.stringify(json, null, 2);
  51873. await Promise.all(jsonOutputTargets.map((jsonOutput) => {
  51874. return writeDocsOutput(compilerCtx, jsonOutput, jsonContent, typesContent);
  51875. }));
  51876. };
  51877. const writeDocsOutput = async (compilerCtx, jsonOutput, jsonContent, typesContent) => {
  51878. return Promise.all([
  51879. compilerCtx.fs.writeFile(jsonOutput.file, jsonContent),
  51880. jsonOutput.typesFile ? compilerCtx.fs.writeFile(jsonOutput.typesFile, typesContent) : Promise.resolve(),
  51881. ]);
  51882. };
  51883. class MarkdownTable {
  51884. constructor() {
  51885. this.rows = [];
  51886. }
  51887. addHeader(data) {
  51888. this.addRow(data, true);
  51889. }
  51890. addRow(data, isHeader = false) {
  51891. const colData = [];
  51892. data.forEach((text) => {
  51893. const col = {
  51894. text: escapeMarkdownTableColumn(text),
  51895. width: text.length,
  51896. };
  51897. colData.push(col);
  51898. });
  51899. this.rows.push({
  51900. columns: colData,
  51901. isHeader: isHeader,
  51902. });
  51903. }
  51904. toMarkdown() {
  51905. return createTable(this.rows);
  51906. }
  51907. }
  51908. const escapeMarkdownTableColumn = (text) => {
  51909. text = text.replace(/\r?\n/g, ' ');
  51910. text = text.replace(/\|/g, '\\|');
  51911. return text;
  51912. };
  51913. const createTable = (rows) => {
  51914. const content = [];
  51915. if (rows.length === 0) {
  51916. return content;
  51917. }
  51918. normalizeColumCount(rows);
  51919. normalizeColumnWidth(rows);
  51920. const th = rows.find((r) => r.isHeader);
  51921. if (th) {
  51922. const headerRow = createRow(th);
  51923. content.push(headerRow);
  51924. content.push(createBorder(th));
  51925. }
  51926. const tds = rows.filter((r) => !r.isHeader);
  51927. tds.forEach((td) => {
  51928. content.push(createRow(td));
  51929. });
  51930. return content;
  51931. };
  51932. const createBorder = (th) => {
  51933. const border = {
  51934. columns: [],
  51935. isHeader: false,
  51936. };
  51937. th.columns.forEach((c) => {
  51938. const borderCol = {
  51939. text: '',
  51940. width: c.width,
  51941. };
  51942. while (borderCol.text.length < borderCol.width) {
  51943. borderCol.text += '-';
  51944. }
  51945. border.columns.push(borderCol);
  51946. });
  51947. return createRow(border);
  51948. };
  51949. const createRow = (row) => {
  51950. const content = ['| '];
  51951. row.columns.forEach((c) => {
  51952. content.push(c.text);
  51953. content.push(' | ');
  51954. });
  51955. return content.join('').trim();
  51956. };
  51957. const normalizeColumCount = (rows) => {
  51958. let columnCount = 0;
  51959. rows.forEach((r) => {
  51960. if (r.columns.length > columnCount) {
  51961. columnCount = r.columns.length;
  51962. }
  51963. });
  51964. rows.forEach((r) => {
  51965. while (r.columns.length < columnCount) {
  51966. r.columns.push({
  51967. text: ``,
  51968. width: 0,
  51969. });
  51970. }
  51971. });
  51972. };
  51973. const normalizeColumnWidth = (rows) => {
  51974. const columnCount = rows[0].columns.length;
  51975. for (let columnIndex = 0; columnIndex < columnCount; columnIndex++) {
  51976. let longestText = 0;
  51977. rows.forEach((r) => {
  51978. const col = r.columns[columnIndex];
  51979. if (col.text.length > longestText) {
  51980. longestText = col.text.length;
  51981. }
  51982. });
  51983. rows.forEach((r) => {
  51984. const col = r.columns[columnIndex];
  51985. col.width = longestText;
  51986. while (col.text.length < longestText) {
  51987. col.text += ' ';
  51988. }
  51989. });
  51990. }
  51991. };
  51992. const propsToMarkdown = (props) => {
  51993. const content = [];
  51994. if (props.length === 0) {
  51995. return content;
  51996. }
  51997. content.push(`## Properties`);
  51998. content.push(``);
  51999. const table = new MarkdownTable();
  52000. table.addHeader(['Property', 'Attribute', 'Description', 'Type', 'Default']);
  52001. props.forEach((prop) => {
  52002. table.addRow([
  52003. getPropertyField(prop),
  52004. getAttributeField(prop),
  52005. getDocsField$2(prop),
  52006. `\`${prop.type}\``,
  52007. `\`${prop.default}\``,
  52008. ]);
  52009. });
  52010. content.push(...table.toMarkdown());
  52011. content.push(``);
  52012. content.push(``);
  52013. return content;
  52014. };
  52015. const getPropertyField = (prop) => {
  52016. return `\`${prop.name}\`${prop.required ? ' _(required)_' : ''}`;
  52017. };
  52018. const getAttributeField = (prop) => {
  52019. return prop.attr ? `\`${prop.attr}\`` : '--';
  52020. };
  52021. const getDocsField$2 = (prop) => {
  52022. return `${prop.deprecation !== undefined
  52023. ? `<span style="color:red">**[DEPRECATED]**</span> ${prop.deprecation}<br/><br/>`
  52024. : ''}${prop.docs}`;
  52025. };
  52026. const eventsToMarkdown = (events) => {
  52027. const content = [];
  52028. if (events.length === 0) {
  52029. return content;
  52030. }
  52031. content.push(`## Events`);
  52032. content.push(``);
  52033. const table = new MarkdownTable();
  52034. table.addHeader(['Event', 'Description', 'Type']);
  52035. events.forEach((ev) => {
  52036. table.addRow([`\`${ev.event}\``, getDocsField$1(ev), `\`CustomEvent<${ev.detail}>\``]);
  52037. });
  52038. content.push(...table.toMarkdown());
  52039. content.push(``);
  52040. content.push(``);
  52041. return content;
  52042. };
  52043. const getDocsField$1 = (prop) => {
  52044. return `${prop.deprecation !== undefined
  52045. ? `<span style="color:red">**[DEPRECATED]**</span> ${prop.deprecation}<br/><br/>`
  52046. : ''}${prop.docs}`;
  52047. };
  52048. const methodsToMarkdown = (methods) => {
  52049. const content = [];
  52050. if (methods.length === 0) {
  52051. return content;
  52052. }
  52053. content.push(`## Methods`);
  52054. content.push(``);
  52055. methods.forEach((method) => {
  52056. content.push(`### \`${method.signature}\``);
  52057. content.push(``);
  52058. content.push(getDocsField(method));
  52059. content.push(``);
  52060. if (method.parameters.length > 0) {
  52061. const parmsTable = new MarkdownTable();
  52062. parmsTable.addHeader(['Name', 'Type', 'Description']);
  52063. method.parameters.forEach(({ name, type, docs }) => {
  52064. parmsTable.addRow(['`' + name + '`', '`' + type + '`', docs]);
  52065. });
  52066. content.push(`#### Parameters`);
  52067. content.push(``);
  52068. content.push(...parmsTable.toMarkdown());
  52069. content.push(``);
  52070. }
  52071. if (method.returns) {
  52072. content.push(`#### Returns`);
  52073. content.push(``);
  52074. content.push(`Type: \`${method.returns.type}\``);
  52075. content.push(``);
  52076. content.push(method.returns.docs);
  52077. content.push(``);
  52078. }
  52079. });
  52080. content.push(``);
  52081. return content;
  52082. };
  52083. const getDocsField = (prop) => {
  52084. return `${prop.deprecation !== undefined
  52085. ? `<span style="color:red">**[DEPRECATED]**</span> ${prop.deprecation}<br/><br/>`
  52086. : ''}${prop.docs}`;
  52087. };
  52088. const usageToMarkdown = (usages) => {
  52089. const content = [];
  52090. const merged = mergeUsages(usages);
  52091. if (merged.length === 0) {
  52092. return content;
  52093. }
  52094. content.push(`## Usage`);
  52095. merged.forEach(({ name, text }) => {
  52096. content.push('');
  52097. content.push(`### ${toTitleCase(name)}`);
  52098. content.push('');
  52099. content.push(text);
  52100. content.push('');
  52101. }),
  52102. content.push('');
  52103. content.push('');
  52104. return content;
  52105. };
  52106. const mergeUsages = (usages) => {
  52107. const keys = Object.keys(usages);
  52108. const map = new Map();
  52109. keys.forEach((key) => {
  52110. const usage = usages[key].trim();
  52111. const array = map.get(usage) || [];
  52112. array.push(key);
  52113. map.set(usage, array);
  52114. });
  52115. const merged = [];
  52116. map.forEach((value, key) => {
  52117. merged.push({
  52118. name: value.join(' / '),
  52119. text: key,
  52120. });
  52121. });
  52122. return merged;
  52123. };
  52124. const stylesToMarkdown = (styles) => {
  52125. const content = [];
  52126. if (styles.length === 0) {
  52127. return content;
  52128. }
  52129. content.push(`## CSS Custom Properties`);
  52130. content.push(``);
  52131. const table = new MarkdownTable();
  52132. table.addHeader(['Name', 'Description']);
  52133. styles.forEach((style) => {
  52134. table.addRow([`\`${style.name}\``, style.docs]);
  52135. });
  52136. content.push(...table.toMarkdown());
  52137. content.push(``);
  52138. content.push(``);
  52139. return content;
  52140. };
  52141. const slotsToMarkdown = (slots) => {
  52142. const content = [];
  52143. if (slots.length === 0) {
  52144. return content;
  52145. }
  52146. content.push(`## Slots`);
  52147. content.push(``);
  52148. const table = new MarkdownTable();
  52149. table.addHeader(['Slot', 'Description']);
  52150. slots.forEach((style) => {
  52151. table.addRow([style.name === '' ? '' : `\`"${style.name}"\``, style.docs]);
  52152. });
  52153. content.push(...table.toMarkdown());
  52154. content.push(``);
  52155. content.push(``);
  52156. return content;
  52157. };
  52158. const partsToMarkdown = (parts) => {
  52159. const content = [];
  52160. if (parts.length === 0) {
  52161. return content;
  52162. }
  52163. content.push(`## Shadow Parts`);
  52164. content.push(``);
  52165. const table = new MarkdownTable();
  52166. table.addHeader(['Part', 'Description']);
  52167. parts.forEach((style) => {
  52168. table.addRow([style.name === '' ? '' : `\`"${style.name}"\``, style.docs]);
  52169. });
  52170. content.push(...table.toMarkdown());
  52171. content.push(``);
  52172. content.push(``);
  52173. return content;
  52174. };
  52175. const depsToMarkdown = (cmp, cmps) => {
  52176. const content = [];
  52177. const deps = Object.entries(cmp.dependencyGraph);
  52178. if (deps.length === 0) {
  52179. return content;
  52180. }
  52181. content.push(`## Dependencies`);
  52182. content.push(``);
  52183. if (cmp.dependents.length > 0) {
  52184. const usedBy = cmp.dependents.map((tag) => ' - ' + getCmpLink(cmp, tag, cmps));
  52185. content.push(`### Used by`);
  52186. content.push(``);
  52187. content.push(...usedBy);
  52188. content.push(``);
  52189. }
  52190. if (cmp.dependencies.length > 0) {
  52191. const dependsOn = cmp.dependencies.map((tag) => '- ' + getCmpLink(cmp, tag, cmps));
  52192. content.push(`### Depends on`);
  52193. content.push(``);
  52194. content.push(...dependsOn);
  52195. content.push(``);
  52196. }
  52197. content.push(`### Graph`);
  52198. content.push('```mermaid');
  52199. content.push('graph TD;');
  52200. deps.forEach(([key, deps]) => {
  52201. deps.forEach((dep) => {
  52202. content.push(` ${key} --> ${dep}`);
  52203. });
  52204. });
  52205. content.push(` style ${cmp.tag} fill:#f9f,stroke:#333,stroke-width:4px`);
  52206. content.push('```');
  52207. content.push(``);
  52208. return content;
  52209. };
  52210. const getCmpLink = (from, to, cmps) => {
  52211. const destCmp = cmps.find((c) => c.tag === to);
  52212. if (destCmp) {
  52213. const cmpRelPath = normalizePath$1(relative$1(from.dirPath, destCmp.dirPath));
  52214. return `[${to}](${cmpRelPath})`;
  52215. }
  52216. return to;
  52217. };
  52218. const generateReadme = async (config, compilerCtx, readmeOutputs, docsData, cmps) => {
  52219. const isUpdate = !!docsData.readme;
  52220. const userContent = isUpdate ? docsData.readme : getDefaultReadme(docsData);
  52221. await Promise.all(readmeOutputs.map(async (readmeOutput) => {
  52222. if (readmeOutput.dir) {
  52223. const readmeContent = generateMarkdown(userContent, docsData, cmps, readmeOutput);
  52224. const relPath = relative$1(config.srcDir, docsData.readmePath);
  52225. const absPath = join(readmeOutput.dir, relPath);
  52226. const results = await compilerCtx.fs.writeFile(absPath, readmeContent);
  52227. if (results.changedContent) {
  52228. if (isUpdate) {
  52229. config.logger.info(`updated readme docs: ${docsData.tag}`);
  52230. }
  52231. else {
  52232. config.logger.info(`created readme docs: ${docsData.tag}`);
  52233. }
  52234. }
  52235. }
  52236. }));
  52237. };
  52238. const generateMarkdown = (userContent, cmp, cmps, readmeOutput) => {
  52239. //If the readmeOutput.dependencies is true or undefined the dependencies will be generated.
  52240. const dependencies = readmeOutput.dependencies !== false ? depsToMarkdown(cmp, cmps) : [];
  52241. return [
  52242. userContent,
  52243. AUTO_GENERATE_COMMENT,
  52244. '',
  52245. '',
  52246. ...getDocsDeprecation(cmp),
  52247. ...usageToMarkdown(cmp.usage),
  52248. ...propsToMarkdown(cmp.props),
  52249. ...eventsToMarkdown(cmp.events),
  52250. ...methodsToMarkdown(cmp.methods),
  52251. ...slotsToMarkdown(cmp.slots),
  52252. ...partsToMarkdown(cmp.parts),
  52253. ...stylesToMarkdown(cmp.styles),
  52254. ...dependencies,
  52255. `----------------------------------------------`,
  52256. '',
  52257. readmeOutput.footer,
  52258. '',
  52259. ].join('\n');
  52260. };
  52261. const getDocsDeprecation = (cmp) => {
  52262. if (cmp.deprecation !== undefined) {
  52263. return [`> **[DEPRECATED]** ${cmp.deprecation}`, ''];
  52264. }
  52265. return [];
  52266. };
  52267. const getDefaultReadme = (docsData) => {
  52268. return [`# ${docsData.tag}`, '', '', ''].join('\n');
  52269. };
  52270. const generateReadmeDocs = async (config, compilerCtx, docsData, outputTargets) => {
  52271. const readmeOutputTargets = outputTargets.filter(isOutputTargetDocsReadme);
  52272. if (readmeOutputTargets.length === 0) {
  52273. return;
  52274. }
  52275. const strictCheck = readmeOutputTargets.some((o) => o.strict);
  52276. if (strictCheck) {
  52277. strickCheckDocs(config, docsData);
  52278. }
  52279. await Promise.all(docsData.components.map((cmpData) => {
  52280. return generateReadme(config, compilerCtx, readmeOutputTargets, cmpData, docsData.components);
  52281. }));
  52282. };
  52283. const strickCheckDocs = (config, docsData) => {
  52284. docsData.components.forEach((component) => {
  52285. component.props.forEach((prop) => {
  52286. if (!prop.docs && prop.deprecation === undefined) {
  52287. config.logger.warn(`Property "${prop.name}" of "${component.tag}" is not documented. ${component.filePath}`);
  52288. }
  52289. });
  52290. component.methods.forEach((method) => {
  52291. if (!method.docs && method.deprecation === undefined) {
  52292. config.logger.warn(`Method "${method.name}" of "${component.tag}" is not documented. ${component.filePath}`);
  52293. }
  52294. });
  52295. component.events.forEach((ev) => {
  52296. if (!ev.docs && ev.deprecation === undefined) {
  52297. config.logger.warn(`Event "${ev.event}" of "${component.tag}" is not documented. ${component.filePath}`);
  52298. }
  52299. });
  52300. component.parts.forEach((ev) => {
  52301. if (ev.docs === '') {
  52302. config.logger.warn(`Part "${ev.name}" of "${component.tag}" is not documented. ${component.filePath}`);
  52303. }
  52304. });
  52305. });
  52306. };
  52307. const generateVscodeDocs = async (compilerCtx, docsData, outputTargets) => {
  52308. const vsCodeOutputTargets = outputTargets.filter(isOutputTargetDocsVscode);
  52309. if (vsCodeOutputTargets.length === 0) {
  52310. return;
  52311. }
  52312. await Promise.all(vsCodeOutputTargets.map(async (outputTarget) => {
  52313. const json = {
  52314. version: 1.1,
  52315. tags: docsData.components.map((cmp) => ({
  52316. name: cmp.tag,
  52317. description: {
  52318. kind: 'markdown',
  52319. value: cmp.docs,
  52320. },
  52321. attributes: cmp.props.filter((p) => p.attr).map(serializeAttribute),
  52322. references: getReferences(cmp, outputTarget.sourceCodeBaseUrl),
  52323. })),
  52324. };
  52325. const jsonContent = JSON.stringify(json, null, 2);
  52326. await compilerCtx.fs.writeFile(outputTarget.file, jsonContent);
  52327. }));
  52328. };
  52329. const getReferences = (cmp, repoBaseUrl) => {
  52330. const references = getNameText('reference', cmp.docsTags).map(([name, url]) => ({ name, url }));
  52331. if (repoBaseUrl) {
  52332. references.push({
  52333. name: 'Source code',
  52334. url: join(repoBaseUrl, cmp.filePath),
  52335. });
  52336. }
  52337. if (references.length > 0) {
  52338. return references;
  52339. }
  52340. return undefined;
  52341. };
  52342. const serializeAttribute = (prop) => {
  52343. const attribute = {
  52344. name: prop.attr,
  52345. description: prop.docs,
  52346. };
  52347. const values = prop.values
  52348. .filter(({ type, value }) => type === 'string' && value !== undefined)
  52349. .map(({ value }) => ({ name: value }));
  52350. if (values.length > 0) {
  52351. attribute.values = values;
  52352. }
  52353. return attribute;
  52354. };
  52355. const outputCustom = async (config, compilerCtx, buildCtx, docs, outputTargets) => {
  52356. const customOutputTargets = outputTargets.filter(isOutputTargetCustom);
  52357. if (customOutputTargets.length === 0) {
  52358. return;
  52359. }
  52360. await Promise.all(customOutputTargets.map(async (o) => {
  52361. const timespan = buildCtx.createTimeSpan(`generating ${o.name} started`);
  52362. try {
  52363. await o.generator(config, compilerCtx, buildCtx, docs);
  52364. }
  52365. catch (e) {
  52366. catchError(buildCtx.diagnostics, e);
  52367. }
  52368. timespan.finish(`generate ${o.name} finished`);
  52369. }));
  52370. };
  52371. const outputDocs = async (config, compilerCtx, buildCtx) => {
  52372. if (!config.buildDocs) {
  52373. return;
  52374. }
  52375. const docsOutputTargets = config.outputTargets.filter((o) => isOutputTargetCustom(o) ||
  52376. isOutputTargetDocsReadme(o) ||
  52377. isOutputTargetDocsJson(o) ||
  52378. isOutputTargetDocsCustom(o) ||
  52379. isOutputTargetDocsVscode(o));
  52380. if (docsOutputTargets.length === 0) {
  52381. return;
  52382. }
  52383. // ensure all the styles are built first, which parses all the css docs
  52384. await buildCtx.stylesPromise;
  52385. const docsData = await generateDocData(config, compilerCtx, buildCtx);
  52386. await Promise.all([
  52387. generateReadmeDocs(config, compilerCtx, docsData, docsOutputTargets),
  52388. generateJsonDocs(config, compilerCtx, docsData, docsOutputTargets),
  52389. generateVscodeDocs(compilerCtx, docsData, docsOutputTargets),
  52390. generateCustomDocs(config, docsData, docsOutputTargets),
  52391. outputCustom(config, compilerCtx, buildCtx, docsData, docsOutputTargets),
  52392. ]);
  52393. };
  52394. const getHydrateBuildConditionals$1 = (cmps) => {
  52395. const build = getBuildFeatures(cmps);
  52396. build.slotRelocation = true;
  52397. build.lazyLoad = true;
  52398. build.hydrateServerSide = true;
  52399. build.cssVarShim = false;
  52400. build.hydrateClientSide = true;
  52401. build.isDebug = false;
  52402. build.isDev = false;
  52403. build.isTesting = false;
  52404. build.devTools = false;
  52405. build.lifecycleDOMEvents = false;
  52406. build.profile = false;
  52407. build.hotModuleReplacement = false;
  52408. build.updatable = true;
  52409. build.member = true;
  52410. build.constructableCSS = false;
  52411. build.asyncLoading = true;
  52412. build.appendChildSlotFix = false;
  52413. build.slotChildNodesFix = false;
  52414. build.cloneNodeFix = false;
  52415. build.cssAnnotations = true;
  52416. build.shadowDomShim = true;
  52417. build.safari10 = false;
  52418. build.hydratedAttribute = false;
  52419. build.hydratedClass = true;
  52420. build.scriptDataOpts = false;
  52421. build.dynamicImportShim = false;
  52422. build.attachStyles = true;
  52423. return build;
  52424. };
  52425. const addLazyElementGetter = (classMembers, moduleFile, cmp) => {
  52426. // @Element() element;
  52427. // is transformed into:
  52428. // get element() { return __stencil_getElement(this); }
  52429. if (cmp.elementRef) {
  52430. addCoreRuntimeApi(moduleFile, RUNTIME_APIS.getElement);
  52431. classMembers.push(t.createGetAccessor(undefined, undefined, cmp.elementRef, [], undefined, t.createBlock([t.createReturn(t.createCall(t.createIdentifier(GET_ELEMENT), undefined, [t.createThis()]))])));
  52432. }
  52433. };
  52434. /**
  52435. * Adds static "style" getter within the class
  52436. * const MyComponent = class {
  52437. * static get style() { return "styles"; }
  52438. * }
  52439. */
  52440. const addStaticStyleGetterWithinClass = (classMembers, cmp, commentOriginalSelector) => {
  52441. const styleLiteral = getStyleLiteral(cmp, commentOriginalSelector);
  52442. if (styleLiteral) {
  52443. classMembers.push(createStaticGetter('style', styleLiteral));
  52444. }
  52445. };
  52446. /**
  52447. * Adds static "style" property to the class variable.
  52448. * const MyComponent = class {}
  52449. * MyComponent.style = "styles";
  52450. */
  52451. const addStaticStylePropertyToClass = (styleStatements, cmp, commentOriginalSelector) => {
  52452. const styleLiteral = getStyleLiteral(cmp, commentOriginalSelector);
  52453. if (styleLiteral) {
  52454. const statement = t.createStatement(t.createAssignment(t.createPropertyAccess(t.createIdentifier(cmp.componentClassName), 'style'), styleLiteral));
  52455. styleStatements.push(statement);
  52456. }
  52457. };
  52458. const getStyleLiteral = (cmp, commentOriginalSelector) => {
  52459. if (Array.isArray(cmp.styles) && cmp.styles.length > 0) {
  52460. if (cmp.styles.length > 1 || (cmp.styles.length === 1 && cmp.styles[0].modeName !== DEFAULT_STYLE_MODE)) {
  52461. // multiple style modes
  52462. return getMultipleModeStyle(cmp, cmp.styles, commentOriginalSelector);
  52463. }
  52464. else {
  52465. // single style
  52466. return getSingleStyle(cmp, cmp.styles[0], commentOriginalSelector);
  52467. }
  52468. }
  52469. return null;
  52470. };
  52471. const getMultipleModeStyle = (cmp, styles, commentOriginalSelector) => {
  52472. const styleModes = [];
  52473. styles.forEach((style) => {
  52474. if (typeof style.styleStr === 'string') {
  52475. // inline the style string
  52476. // static get style() { return { ios: "string" }; }
  52477. const styleLiteral = createStyleLiteral(cmp, style, commentOriginalSelector);
  52478. const propStr = createPropertyAssignment(style.modeName, styleLiteral);
  52479. styleModes.push(propStr);
  52480. }
  52481. else if (typeof style.styleIdentifier === 'string') {
  52482. // direct import already written in the source code
  52483. // import myTagIosStyle from './import-path.css';
  52484. // static get style() { return { ios: myTagIosStyle }; }
  52485. const styleIdentifier = t.createIdentifier(style.styleIdentifier);
  52486. const propIdentifier = createPropertyAssignment(style.modeName, styleIdentifier);
  52487. styleModes.push(propIdentifier);
  52488. }
  52489. else if (Array.isArray(style.externalStyles) && style.externalStyles.length > 0) {
  52490. // import generated from @Component() styleUrls option
  52491. // import myTagIosStyle from './import-path.css';
  52492. // static get style() { return { ios: myTagIosStyle }; }
  52493. const styleUrlIdentifier = createStyleIdentifierFromUrl(cmp, style);
  52494. const propUrlIdentifier = createPropertyAssignment(style.modeName, styleUrlIdentifier);
  52495. styleModes.push(propUrlIdentifier);
  52496. }
  52497. });
  52498. return t.createObjectLiteral(styleModes, true);
  52499. };
  52500. const createPropertyAssignment = (mode, initializer) => {
  52501. const node = t.createPropertyAssignment(mode, initializer);
  52502. return node;
  52503. };
  52504. const getSingleStyle = (cmp, style, commentOriginalSelector) => {
  52505. if (typeof style.styleStr === 'string') {
  52506. // inline the style string
  52507. // static get style() { return "string"; }
  52508. return createStyleLiteral(cmp, style, commentOriginalSelector);
  52509. }
  52510. if (typeof style.styleIdentifier === 'string') {
  52511. // direct import already written in the source code
  52512. // import myTagStyle from './import-path.css';
  52513. // static get style() { return myTagStyle; }
  52514. return t.createIdentifier(style.styleIdentifier);
  52515. }
  52516. if (Array.isArray(style.externalStyles) && style.externalStyles.length > 0) {
  52517. // import generated from @Component() styleUrls option
  52518. // import myTagStyle from './import-path.css';
  52519. // static get style() { return myTagStyle; }
  52520. return createStyleIdentifierFromUrl(cmp, style);
  52521. }
  52522. return null;
  52523. };
  52524. const createStyleLiteral = (cmp, style, commentOriginalSelector) => {
  52525. if (cmp.encapsulation === 'scoped' || (commentOriginalSelector && cmp.encapsulation === 'shadow')) {
  52526. // scope the css first
  52527. const scopeId = getScopeId(cmp.tagName, style.modeName);
  52528. return t.createStringLiteral(scopeCss(style.styleStr, scopeId, commentOriginalSelector));
  52529. }
  52530. return t.createStringLiteral(style.styleStr);
  52531. };
  52532. const createStyleIdentifierFromUrl = (cmp, style) => {
  52533. style.styleIdentifier = dashToPascalCase$1(cmp.tagName);
  52534. style.styleIdentifier = style.styleIdentifier.charAt(0).toLowerCase() + style.styleIdentifier.substring(1);
  52535. if (style.modeName !== DEFAULT_STYLE_MODE) {
  52536. style.styleIdentifier += dashToPascalCase$1(style.modeName);
  52537. }
  52538. style.styleIdentifier += 'Style';
  52539. style.externalStyles = [style.externalStyles[0]];
  52540. return t.createIdentifier(style.styleIdentifier);
  52541. };
  52542. const addHydrateRuntimeCmpMeta = (classMembers, cmp) => {
  52543. const compactMeta = formatComponentRuntimeMeta(cmp, true);
  52544. const cmpMeta = {
  52545. $flags$: compactMeta[0],
  52546. $tagName$: compactMeta[1],
  52547. $members$: compactMeta[2],
  52548. $listeners$: compactMeta[3],
  52549. $lazyBundleId$: fakeBundleIds(),
  52550. $attrsToReflect$: getHydrateAttrsToReflect(cmp),
  52551. };
  52552. // We always need shadow-dom shim in hydrate runtime
  52553. if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
  52554. cmpMeta.$flags$ |= 8 /* needsShadowDomShim */;
  52555. }
  52556. const staticMember = createStaticGetter('cmpMeta', convertValueToLiteral(cmpMeta));
  52557. const commentOriginalSelector = cmp.encapsulation === 'shadow';
  52558. addStaticStyleGetterWithinClass(classMembers, cmp, commentOriginalSelector);
  52559. classMembers.push(staticMember);
  52560. };
  52561. const fakeBundleIds = (_cmp) => {
  52562. return '-';
  52563. };
  52564. const getHydrateAttrsToReflect = (cmp) => {
  52565. return cmp.properties.reduce((attrs, prop) => {
  52566. if (prop.reflect) {
  52567. attrs.push([prop.name, prop.attribute]);
  52568. }
  52569. return attrs;
  52570. }, []);
  52571. };
  52572. const updateLazyComponentConstructor = (classMembers, moduleFile, cmp) => {
  52573. const cstrMethodArgs = [t.createParameter(undefined, undefined, undefined, t.createIdentifier(HOST_REF_ARG))];
  52574. const cstrMethodIndex = classMembers.findIndex((m) => m.kind === t.SyntaxKind.Constructor);
  52575. if (cstrMethodIndex >= 0) {
  52576. // add to the existing constructor()
  52577. const cstrMethod = classMembers[cstrMethodIndex];
  52578. const body = t.updateBlock(cstrMethod.body, [
  52579. registerInstanceStatement(moduleFile),
  52580. ...addCreateEvents(moduleFile, cmp),
  52581. ...cstrMethod.body.statements,
  52582. ...addLegacyProps(moduleFile, cmp),
  52583. ]);
  52584. classMembers[cstrMethodIndex] = t.updateConstructor(cstrMethod, cstrMethod.decorators, cstrMethod.modifiers, cstrMethodArgs, body);
  52585. }
  52586. else {
  52587. // create a constructor()
  52588. const cstrMethod = t.createConstructor(undefined, undefined, cstrMethodArgs, t.createBlock([
  52589. registerInstanceStatement(moduleFile),
  52590. ...addCreateEvents(moduleFile, cmp),
  52591. ...addLegacyProps(moduleFile, cmp),
  52592. ], true));
  52593. classMembers.unshift(cstrMethod);
  52594. }
  52595. };
  52596. const registerInstanceStatement = (moduleFile) => {
  52597. addCoreRuntimeApi(moduleFile, RUNTIME_APIS.registerInstance);
  52598. return t.createStatement(t.createCall(t.createIdentifier(REGISTER_INSTANCE), undefined, [
  52599. t.createThis(),
  52600. t.createIdentifier(HOST_REF_ARG),
  52601. ]));
  52602. };
  52603. const HOST_REF_ARG = 'hostRef';
  52604. const updateHydrateComponentClass = (classNode, moduleFile, cmp) => {
  52605. return t.updateClassDeclaration(classNode, classNode.decorators, classNode.modifiers, classNode.name, classNode.typeParameters, classNode.heritageClauses, updateHydrateHostComponentMembers(classNode, moduleFile, cmp));
  52606. };
  52607. const updateHydrateHostComponentMembers = (classNode, moduleFile, cmp) => {
  52608. const classMembers = removeStaticMetaProperties(classNode);
  52609. updateLazyComponentConstructor(classMembers, moduleFile, cmp);
  52610. addLazyElementGetter(classMembers, moduleFile, cmp);
  52611. addWatchers(classMembers, cmp);
  52612. addHydrateRuntimeCmpMeta(classMembers, cmp);
  52613. transformHostData(classMembers, moduleFile);
  52614. return classMembers;
  52615. };
  52616. const hydrateComponentTransform = (compilerCtx, transformOpts) => {
  52617. return (transformCtx) => {
  52618. return (tsSourceFile) => {
  52619. const moduleFile = getModuleFromSourceFile(compilerCtx, tsSourceFile);
  52620. const visitNode = (node) => {
  52621. if (t.isClassDeclaration(node)) {
  52622. const cmp = getComponentMeta(compilerCtx, tsSourceFile, node);
  52623. if (cmp != null) {
  52624. return updateHydrateComponentClass(node, moduleFile, cmp);
  52625. }
  52626. }
  52627. return t.visitEachChild(node, visitNode, transformCtx);
  52628. };
  52629. tsSourceFile = t.visitEachChild(tsSourceFile, visitNode, transformCtx);
  52630. if (moduleFile.cmps.length > 0) {
  52631. tsSourceFile = updateStyleImports(transformOpts, tsSourceFile, moduleFile);
  52632. }
  52633. if (moduleFile.isLegacy) {
  52634. addLegacyApis(moduleFile);
  52635. }
  52636. tsSourceFile = addImports(transformOpts, tsSourceFile, moduleFile.coreRuntimeApis, transformOpts.coreImportPath);
  52637. return tsSourceFile;
  52638. };
  52639. };
  52640. };
  52641. const bundleHydrateFactory = async (config, compilerCtx, buildCtx, _build, appFactoryEntryCode) => {
  52642. try {
  52643. const bundleOpts = {
  52644. id: 'hydrate',
  52645. platform: 'hydrate',
  52646. conditionals: getHydrateBuildConditionals$1(buildCtx.components),
  52647. customTransformers: getHydrateCustomTransformer(config, compilerCtx),
  52648. inlineDynamicImports: true,
  52649. inputs: {
  52650. '@app-factory-entry': '@app-factory-entry',
  52651. },
  52652. loader: {
  52653. '@app-factory-entry': appFactoryEntryCode,
  52654. },
  52655. };
  52656. const rollupBuild = await bundleOutput(config, compilerCtx, buildCtx, bundleOpts);
  52657. return rollupBuild;
  52658. }
  52659. catch (e) {
  52660. if (!buildCtx.hasError) {
  52661. // TODO(STENCIL-353): Implement a type guard that balances using our own copy of Rollup types (which are
  52662. // breakable) and type safety (so that the error variable may be something other than `any`)
  52663. loadRollupDiagnostics(config, compilerCtx, buildCtx, e);
  52664. }
  52665. }
  52666. return undefined;
  52667. };
  52668. const getHydrateCustomTransformer = (config, compilerCtx) => {
  52669. const transformOpts = {
  52670. coreImportPath: STENCIL_INTERNAL_HYDRATE_ID,
  52671. componentExport: null,
  52672. componentMetadata: null,
  52673. currentDirectory: config.sys.getCurrentDirectory(),
  52674. proxy: null,
  52675. style: 'static',
  52676. styleImportData: 'queryparams',
  52677. };
  52678. return [
  52679. updateStencilCoreImports(transformOpts.coreImportPath),
  52680. hydrateComponentTransform(compilerCtx, transformOpts),
  52681. removeCollectionImports(compilerCtx),
  52682. ];
  52683. };
  52684. const HYDRATE_APP_CLOSURE_START = `/*hydrateAppClosure start*/`;
  52685. const HYDRATE_FACTORY_INTRO = `
  52686. export function hydrateFactory($stencilWindow, $stencilHydrateOpts, $stencilHydrateResults, $stencilAfterHydrate, $stencilHydrateResolve) {
  52687. var globalThis = $stencilWindow;
  52688. var self = $stencilWindow;
  52689. var top = $stencilWindow;
  52690. var parent = $stencilWindow;
  52691. var addEventListener = $stencilWindow.addEventListener.bind($stencilWindow);
  52692. var alert = $stencilWindow.alert.bind($stencilWindow);
  52693. var blur = $stencilWindow.blur.bind($stencilWindow);
  52694. var cancelAnimationFrame = $stencilWindow.cancelAnimationFrame.bind($stencilWindow);
  52695. var cancelIdleCallback = $stencilWindow.cancelIdleCallback.bind($stencilWindow);
  52696. var clearInterval = $stencilWindow.clearInterval.bind($stencilWindow);
  52697. var clearTimeout = $stencilWindow.clearTimeout.bind($stencilWindow);
  52698. var close = () => {};
  52699. var confirm = $stencilWindow.confirm.bind($stencilWindow);
  52700. var dispatchEvent = $stencilWindow.dispatchEvent.bind($stencilWindow);
  52701. var focus = $stencilWindow.focus.bind($stencilWindow);
  52702. var getComputedStyle = $stencilWindow.getComputedStyle.bind($stencilWindow);
  52703. var matchMedia = $stencilWindow.matchMedia.bind($stencilWindow);
  52704. var open = $stencilWindow.open.bind($stencilWindow);
  52705. var prompt = $stencilWindow.prompt.bind($stencilWindow);
  52706. var removeEventListener = $stencilWindow.removeEventListener.bind($stencilWindow);
  52707. var requestAnimationFrame = $stencilWindow.requestAnimationFrame.bind($stencilWindow);
  52708. var requestIdleCallback = $stencilWindow.requestIdleCallback.bind($stencilWindow);
  52709. var setInterval = $stencilWindow.setInterval.bind($stencilWindow);
  52710. var setTimeout = $stencilWindow.setTimeout.bind($stencilWindow);
  52711. var CharacterData = $stencilWindow.CharacterData;
  52712. var CSS = $stencilWindow.CSS;
  52713. var CustomEvent = $stencilWindow.CustomEvent;
  52714. var Document = $stencilWindow.Document;
  52715. var DocumentFragment = $stencilWindow.DocumentFragment;
  52716. var DocumentType = $stencilWindow.DocumentType;
  52717. var DOMTokenList = $stencilWindow.DOMTokenList;
  52718. var Element = $stencilWindow.Element;
  52719. var Event = $stencilWindow.Event;
  52720. var HTMLAnchorElement = $stencilWindow.HTMLAnchorElement;
  52721. var HTMLBaseElement = $stencilWindow.HTMLBaseElement;
  52722. var HTMLButtonElement = $stencilWindow.HTMLButtonElement;
  52723. var HTMLCanvasElement = $stencilWindow.HTMLCanvasElement;
  52724. var HTMLElement = $stencilWindow.HTMLElement;
  52725. var HTMLFormElement = $stencilWindow.HTMLFormElement;
  52726. var HTMLImageElement = $stencilWindow.HTMLImageElement;
  52727. var HTMLInputElement = $stencilWindow.HTMLInputElement;
  52728. var HTMLLinkElement = $stencilWindow.HTMLLinkElement;
  52729. var HTMLMetaElement = $stencilWindow.HTMLMetaElement;
  52730. var HTMLScriptElement = $stencilWindow.HTMLScriptElement;
  52731. var HTMLStyleElement = $stencilWindow.HTMLStyleElement;
  52732. var HTMLTemplateElement = $stencilWindow.HTMLTemplateElement;
  52733. var HTMLTitleElement = $stencilWindow.HTMLTitleElement;
  52734. var IntersectionObserver = $stencilWindow.IntersectionObserver;
  52735. var KeyboardEvent = $stencilWindow.KeyboardEvent;
  52736. var MouseEvent = $stencilWindow.MouseEvent;
  52737. var Node = $stencilWindow.Node;
  52738. var NodeList = $stencilWindow.NodeList;
  52739. var URL = $stencilWindow.URL;
  52740. var console = $stencilWindow.console;
  52741. var customElements = $stencilWindow.customElements;
  52742. var history = $stencilWindow.history;
  52743. var localStorage = $stencilWindow.localStorage;
  52744. var location = $stencilWindow.location;
  52745. var navigator = $stencilWindow.navigator;
  52746. var performance = $stencilWindow.performance;
  52747. var sessionStorage = $stencilWindow.sessionStorage;
  52748. var devicePixelRatio = $stencilWindow.devicePixelRatio;
  52749. var innerHeight = $stencilWindow.innerHeight;
  52750. var innerWidth = $stencilWindow.innerWidth;
  52751. var origin = $stencilWindow.origin;
  52752. var pageXOffset = $stencilWindow.pageXOffset;
  52753. var pageYOffset = $stencilWindow.pageYOffset;
  52754. var screen = $stencilWindow.screen;
  52755. var screenLeft = $stencilWindow.screenLeft;
  52756. var screenTop = $stencilWindow.screenTop;
  52757. var screenX = $stencilWindow.screenX;
  52758. var screenY = $stencilWindow.screenY;
  52759. var scrollX = $stencilWindow.scrollX;
  52760. var scrollY = $stencilWindow.scrollY;
  52761. var exports = {};
  52762. var fetch, FetchError, Headers, Request, Response;
  52763. if (typeof $stencilWindow.fetch === 'function') {
  52764. fetch = $stencilWindow.fetch;
  52765. } else {
  52766. fetch = $stencilWindow.fetch = function() { throw new Error('fetch() is not implemented'); };
  52767. }
  52768. if (typeof $stencilWindow.FetchError === 'function') {
  52769. FetchError = $stencilWindow.FetchError;
  52770. } else {
  52771. FetchError = $stencilWindow.FetchError = class FetchError { constructor() { throw new Error('FetchError is not implemented'); } };
  52772. }
  52773. if (typeof $stencilWindow.Headers === 'function') {
  52774. Headers = $stencilWindow.Headers;
  52775. } else {
  52776. Headers = $stencilWindow.Headers = class Headers { constructor() { throw new Error('Headers is not implemented'); } };
  52777. }
  52778. if (typeof $stencilWindow.Request === 'function') {
  52779. Request = $stencilWindow.Request;
  52780. } else {
  52781. Request = $stencilWindow.Request = class Request { constructor() { throw new Error('Request is not implemented'); } };
  52782. }
  52783. if (typeof $stencilWindow.Response === 'function') {
  52784. Response = $stencilWindow.Response;
  52785. } else {
  52786. Response = $stencilWindow.Response = class Response { constructor() { throw new Error('Response is not implemented'); } };
  52787. }
  52788. function hydrateAppClosure($stencilWindow) {
  52789. const window = $stencilWindow;
  52790. const document = $stencilWindow.document;
  52791. ${HYDRATE_APP_CLOSURE_START}
  52792. `;
  52793. const HYDRATE_FACTORY_OUTRO = `
  52794. /*hydrateAppClosure end*/
  52795. hydrateApp(window, $stencilHydrateOpts, $stencilHydrateResults, $stencilAfterHydrate, $stencilHydrateResolve);
  52796. }
  52797. hydrateAppClosure($stencilWindow);
  52798. }
  52799. `;
  52800. const updateToHydrateComponents = async (cmps) => {
  52801. const hydrateCmps = await Promise.all(cmps.map(updateToHydrateComponent));
  52802. return sortBy(hydrateCmps, (c) => c.cmp.componentClassName);
  52803. };
  52804. const updateToHydrateComponent = async (cmp) => {
  52805. const cmpData = {
  52806. filePath: cmp.sourceFilePath,
  52807. exportLine: ``,
  52808. cmp: cmp,
  52809. uniqueComponentClassName: ``,
  52810. importLine: ``,
  52811. };
  52812. const pascalCasedClassName = dashToPascalCase$1(toTitleCase(cmp.tagName));
  52813. if (cmp.componentClassName !== pascalCasedClassName) {
  52814. cmpData.uniqueComponentClassName = pascalCasedClassName;
  52815. cmpData.importLine = `import { ${cmp.componentClassName} as ${cmpData.uniqueComponentClassName} } from '${cmpData.filePath}';`;
  52816. }
  52817. else {
  52818. cmpData.uniqueComponentClassName = cmp.componentClassName;
  52819. cmpData.importLine = `import { ${cmpData.uniqueComponentClassName} } from '${cmpData.filePath}';`;
  52820. }
  52821. return cmpData;
  52822. };
  52823. const relocateHydrateContextConst = (config, compilerCtx, code) => {
  52824. // for whatever reason, const Context = {};
  52825. // is not hoisted to the correct location when bundled,
  52826. // so manually doing it here
  52827. // /*hydrate context start*/export const Context = {};/*hydrate context end*/
  52828. const globalScripts = getGlobalScriptData(config, compilerCtx);
  52829. if (globalScripts.length > 0) {
  52830. const startCode = code.indexOf('/*hydrate context start*/');
  52831. if (startCode > -1) {
  52832. const endCode = code.indexOf('/*hydrate context end*/') + '/*hydrate context end*/'.length;
  52833. const hydrateContextCode = code.substring(startCode, endCode);
  52834. code = code.replace(hydrateContextCode, '');
  52835. return code.replace(HYDRATE_APP_CLOSURE_START, HYDRATE_APP_CLOSURE_START + '\n ' + hydrateContextCode);
  52836. }
  52837. }
  52838. return code;
  52839. };
  52840. const writeHydrateOutputs = (config, compilerCtx, buildCtx, outputTargets, rollupOutput) => {
  52841. return Promise.all(outputTargets.map((outputTarget) => {
  52842. return writeHydrateOutput(config, compilerCtx, buildCtx, outputTarget, rollupOutput);
  52843. }));
  52844. };
  52845. const writeHydrateOutput = async (config, compilerCtx, buildCtx, outputTarget, rollupOutput) => {
  52846. const hydratePackageName = await getHydratePackageName(config, compilerCtx);
  52847. const hydrateAppDirPath = outputTarget.dir;
  52848. const hydrateCoreIndexPath = join(hydrateAppDirPath, 'index.js');
  52849. const hydrateCoreIndexDtsFilePath = join(hydrateAppDirPath, 'index.d.ts');
  52850. const pkgJsonPath = join(hydrateAppDirPath, 'package.json');
  52851. const pkgJsonCode = getHydratePackageJson(config, hydrateCoreIndexPath, hydrateCoreIndexDtsFilePath, hydratePackageName);
  52852. await Promise.all([
  52853. copyHydrateRunnerDts(config, compilerCtx, hydrateAppDirPath),
  52854. compilerCtx.fs.writeFile(pkgJsonPath, pkgJsonCode),
  52855. ]);
  52856. // always remember a path to the hydrate app that the prerendering may need later on
  52857. buildCtx.hydrateAppFilePath = hydrateCoreIndexPath;
  52858. await Promise.all(rollupOutput.output.map(async (output) => {
  52859. if (output.type === 'chunk') {
  52860. output.code = relocateHydrateContextConst(config, compilerCtx, output.code);
  52861. const filePath = join(hydrateAppDirPath, output.fileName);
  52862. await compilerCtx.fs.writeFile(filePath, output.code, { immediateWrite: true });
  52863. }
  52864. }));
  52865. };
  52866. const getHydratePackageJson = (config, hydrateAppFilePath, hydrateDtsFilePath, hydratePackageName) => {
  52867. const pkg = {
  52868. name: hydratePackageName,
  52869. description: `${config.namespace} component hydration app.`,
  52870. main: basename(hydrateAppFilePath),
  52871. types: basename(hydrateDtsFilePath),
  52872. };
  52873. return JSON.stringify(pkg, null, 2);
  52874. };
  52875. const getHydratePackageName = async (config, compilerCtx) => {
  52876. try {
  52877. const rootPkgFilePath = join(config.rootDir, 'package.json');
  52878. const pkgStr = await compilerCtx.fs.readFile(rootPkgFilePath);
  52879. const pkgData = JSON.parse(pkgStr);
  52880. return `${pkgData.name}/hydrate`;
  52881. }
  52882. catch (e) { }
  52883. return `${config.fsNamespace}/hydrate`;
  52884. };
  52885. const copyHydrateRunnerDts = async (config, compilerCtx, hydrateAppDirPath) => {
  52886. const packageDir = join(config.sys.getCompilerExecutingPath(), '..', '..');
  52887. const srcHydrateDir = join(packageDir, 'internal', 'hydrate', 'runner.d.ts');
  52888. const runnerDtsDestPath = join(hydrateAppDirPath, 'index.d.ts');
  52889. await compilerCtx.fs.copyFile(srcHydrateDir, runnerDtsDestPath);
  52890. };
  52891. const generateHydrateApp = async (config, compilerCtx, buildCtx, outputTargets) => {
  52892. try {
  52893. const packageDir = join(config.sys.getCompilerExecutingPath(), '..', '..');
  52894. const input = join(packageDir, 'internal', 'hydrate', 'runner.js');
  52895. const mockDoc = join(packageDir, 'mock-doc', 'index.js');
  52896. const rollupOptions = {
  52897. ...config.rollupConfig.inputOptions,
  52898. input,
  52899. inlineDynamicImports: true,
  52900. plugins: [
  52901. {
  52902. name: 'hydrateAppPlugin',
  52903. resolveId(id) {
  52904. if (id === STENCIL_HYDRATE_FACTORY_ID) {
  52905. return id;
  52906. }
  52907. if (id === STENCIL_MOCK_DOC_ID) {
  52908. return mockDoc;
  52909. }
  52910. return null;
  52911. },
  52912. load(id) {
  52913. if (id === STENCIL_HYDRATE_FACTORY_ID) {
  52914. return generateHydrateFactory(config, compilerCtx, buildCtx);
  52915. }
  52916. return null;
  52917. },
  52918. },
  52919. ],
  52920. treeshake: false,
  52921. onwarn: createOnWarnFn(buildCtx.diagnostics),
  52922. };
  52923. const rollupAppBuild = await rollup(rollupOptions);
  52924. const rollupOutput = await rollupAppBuild.generate({
  52925. banner: generatePreamble(config),
  52926. format: 'cjs',
  52927. file: 'index.js',
  52928. });
  52929. await writeHydrateOutputs(config, compilerCtx, buildCtx, outputTargets, rollupOutput);
  52930. }
  52931. catch (e) {
  52932. if (!buildCtx.hasError) {
  52933. // TODO(STENCIL-353): Implement a type guard that balances using our own copy of Rollup types (which are
  52934. // breakable) and type safety (so that the error variable may be something other than `any`)
  52935. loadRollupDiagnostics(config, compilerCtx, buildCtx, e);
  52936. }
  52937. }
  52938. };
  52939. const generateHydrateFactory = async (config, compilerCtx, buildCtx) => {
  52940. if (!buildCtx.hasError) {
  52941. try {
  52942. const cmps = buildCtx.components;
  52943. const build = getHydrateBuildConditionals(config, cmps);
  52944. const appFactoryEntryCode = await generateHydrateFactoryEntry(buildCtx);
  52945. const rollupFactoryBuild = await bundleHydrateFactory(config, compilerCtx, buildCtx, build, appFactoryEntryCode);
  52946. if (rollupFactoryBuild != null) {
  52947. const rollupOutput = await rollupFactoryBuild.generate({
  52948. format: 'cjs',
  52949. esModule: false,
  52950. strict: false,
  52951. intro: HYDRATE_FACTORY_INTRO,
  52952. outro: HYDRATE_FACTORY_OUTRO,
  52953. preferConst: false,
  52954. });
  52955. if (!buildCtx.hasError && rollupOutput != null && Array.isArray(rollupOutput.output)) {
  52956. return rollupOutput.output[0].code;
  52957. }
  52958. }
  52959. }
  52960. catch (e) {
  52961. catchError(buildCtx.diagnostics, e);
  52962. }
  52963. }
  52964. return '';
  52965. };
  52966. const generateHydrateFactoryEntry = async (buildCtx) => {
  52967. const cmps = buildCtx.components;
  52968. const hydrateCmps = await updateToHydrateComponents(cmps);
  52969. const s = new MagicString$2('');
  52970. s.append(`import { hydrateApp, registerComponents, styles } from '${STENCIL_INTERNAL_HYDRATE_ID}';\n`);
  52971. hydrateCmps.forEach((cmpData) => s.append(cmpData.importLine + '\n'));
  52972. s.append(`registerComponents([\n`);
  52973. hydrateCmps.forEach((cmpData) => {
  52974. s.append(` ${cmpData.uniqueComponentClassName},\n`);
  52975. });
  52976. s.append(`]);\n`);
  52977. s.append(`export { hydrateApp }\n`);
  52978. return s.toString();
  52979. };
  52980. const getHydrateBuildConditionals = (config, cmps) => {
  52981. const build = getBuildFeatures(cmps);
  52982. build.lazyLoad = true;
  52983. build.hydrateClientSide = false;
  52984. build.hydrateServerSide = true;
  52985. updateBuildConditionals(config, build);
  52986. build.lifecycleDOMEvents = false;
  52987. build.devTools = false;
  52988. build.hotModuleReplacement = false;
  52989. build.cloneNodeFix = false;
  52990. build.appendChildSlotFix = false;
  52991. build.slotChildNodesFix = false;
  52992. build.safari10 = false;
  52993. build.shadowDomShim = false;
  52994. return build;
  52995. };
  52996. const outputHydrateScript = async (config, compilerCtx, buildCtx) => {
  52997. const hydrateOutputTargets = config.outputTargets.filter(isOutputTargetHydrate);
  52998. if (hydrateOutputTargets.length > 0) {
  52999. const timespan = buildCtx.createTimeSpan(`generate hydrate app started`);
  53000. await generateHydrateApp(config, compilerCtx, buildCtx, hydrateOutputTargets);
  53001. timespan.finish(`generate hydrate app finished`);
  53002. }
  53003. };
  53004. const getLazyBuildConditionals = (config, cmps) => {
  53005. const build = getBuildFeatures(cmps);
  53006. build.lazyLoad = true;
  53007. build.hydrateServerSide = false;
  53008. build.cssVarShim = config.extras.cssVarsShim;
  53009. build.transformTagName = config.extras.tagNameTransform;
  53010. build.asyncQueue = config.taskQueue === 'congestionAsync';
  53011. build.taskQueue = config.taskQueue !== 'immediate';
  53012. build.initializeNextTick = config.extras.initializeNextTick;
  53013. const hasHydrateOutputTargets = config.outputTargets.some(isOutputTargetHydrate);
  53014. build.hydrateClientSide = hasHydrateOutputTargets;
  53015. updateBuildConditionals(config, build);
  53016. return build;
  53017. };
  53018. const updateLazyComponentClass = (transformOpts, styleStatements, classNode, moduleFile, cmp) => {
  53019. const members = updateLazyComponentMembers(transformOpts, styleStatements, classNode, moduleFile, cmp);
  53020. return updateComponentClass(transformOpts, classNode, classNode.heritageClauses, members);
  53021. };
  53022. const updateLazyComponentMembers = (transformOpts, styleStatements, classNode, moduleFile, cmp) => {
  53023. const classMembers = removeStaticMetaProperties(classNode);
  53024. updateLazyComponentConstructor(classMembers, moduleFile, cmp);
  53025. addLazyElementGetter(classMembers, moduleFile, cmp);
  53026. addWatchers(classMembers, cmp);
  53027. transformHostData(classMembers, moduleFile);
  53028. if (transformOpts.style === 'static') {
  53029. addStaticStylePropertyToClass(styleStatements, cmp, false);
  53030. }
  53031. return classMembers;
  53032. };
  53033. const lazyComponentTransform = (compilerCtx, transformOpts) => {
  53034. return (transformCtx) => {
  53035. return (tsSourceFile) => {
  53036. const styleStatements = [];
  53037. const moduleFile = getModuleFromSourceFile(compilerCtx, tsSourceFile);
  53038. const visitNode = (node) => {
  53039. if (t.isClassDeclaration(node)) {
  53040. const cmp = getComponentMeta(compilerCtx, tsSourceFile, node);
  53041. if (cmp != null) {
  53042. return updateLazyComponentClass(transformOpts, styleStatements, node, moduleFile, cmp);
  53043. }
  53044. }
  53045. return t.visitEachChild(node, visitNode, transformCtx);
  53046. };
  53047. tsSourceFile = t.visitEachChild(tsSourceFile, visitNode, transformCtx);
  53048. if (moduleFile.cmps.length > 0) {
  53049. tsSourceFile = updateStyleImports(transformOpts, tsSourceFile, moduleFile);
  53050. }
  53051. if (moduleFile.isLegacy) {
  53052. addLegacyApis(moduleFile);
  53053. }
  53054. tsSourceFile = addImports(transformOpts, tsSourceFile, moduleFile.coreRuntimeApis, transformOpts.coreImportPath);
  53055. if (styleStatements.length > 0) {
  53056. tsSourceFile = t.updateSourceFileNode(tsSourceFile, [...tsSourceFile.statements, ...styleStatements]);
  53057. }
  53058. return tsSourceFile;
  53059. };
  53060. };
  53061. };
  53062. const generateRollupOutput = async (build, options, config, entryModules) => {
  53063. if (build == null) {
  53064. return null;
  53065. }
  53066. const { output } = await build.generate(options);
  53067. return output.map((chunk) => {
  53068. if (chunk.type === 'chunk') {
  53069. const isCore = Object.keys(chunk.modules).some((m) => m.includes('@stencil/core'));
  53070. return {
  53071. type: 'chunk',
  53072. fileName: chunk.fileName,
  53073. map: chunk.map,
  53074. code: chunk.code,
  53075. moduleFormat: options.format,
  53076. entryKey: chunk.name,
  53077. imports: chunk.imports,
  53078. isEntry: !!chunk.isEntry,
  53079. isComponent: !!chunk.isEntry && entryModules.some((m) => m.entryKey === chunk.name),
  53080. isBrowserLoader: chunk.isEntry && chunk.name === config.fsNamespace,
  53081. isIndex: chunk.isEntry && chunk.name === 'index',
  53082. isCore,
  53083. };
  53084. }
  53085. else {
  53086. return {
  53087. type: 'asset',
  53088. fileName: chunk.fileName,
  53089. content: chunk.source,
  53090. };
  53091. }
  53092. });
  53093. };
  53094. const writeLazyModule = async (config, compilerCtx, outputTargetType, destinations, entryModule, shouldHash, code, sourceMap, sufix) => {
  53095. // code = replaceStylePlaceholders(entryModule.cmps, modeName, code);
  53096. const bundleId = await getBundleId(config, entryModule.entryKey, shouldHash, code, sufix);
  53097. const fileName = `${bundleId}.entry.js`;
  53098. if (sourceMap) {
  53099. code = code + getSourceMappingUrlForEndOfFile(fileName);
  53100. }
  53101. await Promise.all(destinations.map((dst) => {
  53102. compilerCtx.fs.writeFile(join(dst, fileName), code, { outputTargetType });
  53103. if (!!sourceMap) {
  53104. compilerCtx.fs.writeFile(join(dst, fileName) + '.map', JSON.stringify(sourceMap), { outputTargetType });
  53105. }
  53106. }));
  53107. return {
  53108. bundleId,
  53109. fileName,
  53110. code,
  53111. };
  53112. };
  53113. const getBundleId = async (config, entryKey, shouldHash, code, sufix) => {
  53114. if (shouldHash) {
  53115. const hash = await config.sys.generateContentHash(code, config.hashedFileNameLength);
  53116. return `p-${hash}${sufix}`;
  53117. }
  53118. const components = entryKey.split('.');
  53119. let bundleId = components[0];
  53120. if (components.length > 2) {
  53121. bundleId = `${bundleId}_${components.length - 1}`;
  53122. }
  53123. return bundleId + sufix;
  53124. };
  53125. const generateLazyModules = async (config, compilerCtx, buildCtx, outputTargetType, destinations, results, sourceTarget, isBrowserBuild, sufix) => {
  53126. if (!Array.isArray(destinations) || destinations.length === 0) {
  53127. return [];
  53128. }
  53129. const shouldMinify = config.minifyJs && isBrowserBuild;
  53130. const rollupResults = results.filter((r) => r.type === 'chunk');
  53131. const entryComponentsResults = rollupResults.filter((rollupResult) => rollupResult.isComponent);
  53132. const chunkResults = rollupResults.filter((rollupResult) => !rollupResult.isComponent && !rollupResult.isEntry);
  53133. const [bundleModules] = await Promise.all([
  53134. Promise.all(entryComponentsResults.map((rollupResult) => {
  53135. return generateLazyEntryModule(config, compilerCtx, buildCtx, rollupResult, outputTargetType, destinations, sourceTarget, shouldMinify, isBrowserBuild, sufix);
  53136. })),
  53137. Promise.all(chunkResults.map((rollupResult) => {
  53138. return writeLazyChunk(config, compilerCtx, buildCtx, rollupResult, outputTargetType, destinations, sourceTarget, shouldMinify, isBrowserBuild);
  53139. })),
  53140. ]);
  53141. const lazyRuntimeData = formatLazyBundlesRuntimeMeta(bundleModules);
  53142. const entryResults = rollupResults.filter((rollupResult) => !rollupResult.isComponent && rollupResult.isEntry);
  53143. await Promise.all(entryResults.map((rollupResult) => {
  53144. return writeLazyEntry(config, compilerCtx, buildCtx, rollupResult, outputTargetType, destinations, lazyRuntimeData, sourceTarget, shouldMinify, isBrowserBuild);
  53145. }));
  53146. await Promise.all(results
  53147. .filter((r) => r.type === 'asset')
  53148. .map((r) => {
  53149. return Promise.all(destinations.map((dest) => {
  53150. return compilerCtx.fs.writeFile(join(dest, r.fileName), r.content);
  53151. }));
  53152. }));
  53153. return bundleModules;
  53154. };
  53155. const generateLazyEntryModule = async (config, compilerCtx, buildCtx, rollupResult, outputTargetType, destinations, sourceTarget, shouldMinify, isBrowserBuild, sufix) => {
  53156. const entryModule = buildCtx.entryModules.find((entryModule) => entryModule.entryKey === rollupResult.entryKey);
  53157. const shouldHash = config.hashFileNames && isBrowserBuild;
  53158. const { code, sourceMap } = await convertChunk(config, compilerCtx, buildCtx, sourceTarget, shouldMinify, false, isBrowserBuild, rollupResult.code, rollupResult.map);
  53159. const output = await writeLazyModule(config, compilerCtx, outputTargetType, destinations, entryModule, shouldHash, code, sourceMap, sufix);
  53160. return {
  53161. rollupResult,
  53162. entryKey: rollupResult.entryKey,
  53163. cmps: entryModule.cmps,
  53164. output,
  53165. };
  53166. };
  53167. const writeLazyChunk = async (config, compilerCtx, buildCtx, rollupResult, outputTargetType, destinations, sourceTarget, shouldMinify, isBrowserBuild) => {
  53168. const { code, sourceMap } = await convertChunk(config, compilerCtx, buildCtx, sourceTarget, shouldMinify, rollupResult.isCore, isBrowserBuild, rollupResult.code, rollupResult.map);
  53169. await Promise.all(destinations.map((dst) => {
  53170. const filePath = join(dst, rollupResult.fileName);
  53171. let fileCode = code;
  53172. if (rollupResult.map) {
  53173. fileCode = code + getSourceMappingUrlForEndOfFile(rollupResult.fileName);
  53174. compilerCtx.fs.writeFile(filePath + '.map', JSON.stringify(sourceMap), { outputTargetType });
  53175. }
  53176. compilerCtx.fs.writeFile(filePath, fileCode, { outputTargetType });
  53177. }));
  53178. };
  53179. const writeLazyEntry = async (config, compilerCtx, buildCtx, rollupResult, outputTargetType, destinations, lazyRuntimeData, sourceTarget, shouldMinify, isBrowserBuild) => {
  53180. if (isBrowserBuild && ['loader'].includes(rollupResult.entryKey)) {
  53181. return;
  53182. }
  53183. let inputCode = rollupResult.code.replace(`[/*!__STENCIL_LAZY_DATA__*/]`, `${lazyRuntimeData}`);
  53184. const { code, sourceMap } = await convertChunk(config, compilerCtx, buildCtx, sourceTarget, shouldMinify, false, isBrowserBuild, inputCode, rollupResult.map);
  53185. await Promise.all(destinations.map((dst) => {
  53186. const filePath = join(dst, rollupResult.fileName);
  53187. let fileCode = code;
  53188. if (sourceMap) {
  53189. fileCode = code + getSourceMappingUrlForEndOfFile(rollupResult.fileName);
  53190. compilerCtx.fs.writeFile(filePath + '.map', JSON.stringify(sourceMap), { outputTargetType });
  53191. }
  53192. return compilerCtx.fs.writeFile(filePath, fileCode, { outputTargetType });
  53193. }));
  53194. };
  53195. const formatLazyBundlesRuntimeMeta = (bundleModules) => {
  53196. const sortedBundles = bundleModules.slice().sort(sortBundleModules);
  53197. const lazyBundles = sortedBundles.map(formatLazyRuntimeBundle);
  53198. return stringifyRuntimeData(lazyBundles);
  53199. };
  53200. const formatLazyRuntimeBundle = (bundleModule) => {
  53201. let bundleId = bundleModule.output.bundleId;
  53202. const bundleCmps = bundleModule.cmps.slice().sort(sortBundleComponents);
  53203. return [bundleId, bundleCmps.map((cmp) => formatComponentRuntimeMeta(cmp, true))];
  53204. };
  53205. const sortBundleModules = (a, b) => {
  53206. const aDependents = a.cmps.reduce((dependents, cmp) => {
  53207. dependents.push(...cmp.dependents);
  53208. return dependents;
  53209. }, []);
  53210. const bDependents = b.cmps.reduce((dependents, cmp) => {
  53211. dependents.push(...cmp.dependents);
  53212. return dependents;
  53213. }, []);
  53214. if (a.cmps.some((cmp) => bDependents.includes(cmp.tagName)))
  53215. return 1;
  53216. if (b.cmps.some((cmp) => aDependents.includes(cmp.tagName)))
  53217. return -1;
  53218. const aDependencies = a.cmps.reduce((dependencies, cmp) => {
  53219. dependencies.push(...cmp.dependencies);
  53220. return dependencies;
  53221. }, []);
  53222. const bDependencies = b.cmps.reduce((dependencies, cmp) => {
  53223. dependencies.push(...cmp.dependencies);
  53224. return dependencies;
  53225. }, []);
  53226. if (a.cmps.some((cmp) => bDependencies.includes(cmp.tagName)))
  53227. return -1;
  53228. if (b.cmps.some((cmp) => aDependencies.includes(cmp.tagName)))
  53229. return 1;
  53230. if (aDependents.length < bDependents.length)
  53231. return -1;
  53232. if (aDependents.length > bDependents.length)
  53233. return 1;
  53234. if (aDependencies.length > bDependencies.length)
  53235. return -1;
  53236. if (aDependencies.length < bDependencies.length)
  53237. return 1;
  53238. const aTags = a.cmps.map((cmp) => cmp.tagName);
  53239. const bTags = b.cmps.map((cmp) => cmp.tagName);
  53240. if (aTags.length > bTags.length)
  53241. return -1;
  53242. if (aTags.length < bTags.length)
  53243. return 1;
  53244. const aTagsStr = aTags.sort().join('.');
  53245. const bTagsStr = bTags.sort().join('.');
  53246. if (aTagsStr < bTagsStr)
  53247. return -1;
  53248. if (aTagsStr > bTagsStr)
  53249. return 1;
  53250. return 0;
  53251. };
  53252. const sortBundleComponents = (a, b) => {
  53253. // <cmp-a>
  53254. // <cmp-b>
  53255. // <cmp-c></cmp-c>
  53256. // </cmp-b>
  53257. // </cmp-a>
  53258. // cmp-c is a dependency of cmp-a and cmp-b
  53259. // cmp-c is a directDependency of cmp-b
  53260. // cmp-a is a dependant of cmp-b and cmp-c
  53261. // cmp-a is a directDependant of cmp-b
  53262. if (a.directDependents.includes(b.tagName))
  53263. return 1;
  53264. if (b.directDependents.includes(a.tagName))
  53265. return -1;
  53266. if (a.directDependencies.includes(b.tagName))
  53267. return 1;
  53268. if (b.directDependencies.includes(a.tagName))
  53269. return -1;
  53270. if (a.dependents.includes(b.tagName))
  53271. return 1;
  53272. if (b.dependents.includes(a.tagName))
  53273. return -1;
  53274. if (a.dependencies.includes(b.tagName))
  53275. return 1;
  53276. if (b.dependencies.includes(a.tagName))
  53277. return -1;
  53278. if (a.dependents.length < b.dependents.length)
  53279. return -1;
  53280. if (a.dependents.length > b.dependents.length)
  53281. return 1;
  53282. if (a.dependencies.length > b.dependencies.length)
  53283. return -1;
  53284. if (a.dependencies.length < b.dependencies.length)
  53285. return 1;
  53286. if (a.tagName < b.tagName)
  53287. return -1;
  53288. if (a.tagName > b.tagName)
  53289. return 1;
  53290. return 0;
  53291. };
  53292. const convertChunk = async (config, compilerCtx, buildCtx, sourceTarget, shouldMinify, isCore, isBrowserBuild, code, rollupSrcMap) => {
  53293. let sourceMap = rollupToStencilSourceMap(rollupSrcMap);
  53294. const inlineHelpers = isBrowserBuild || !hasDependency(buildCtx, 'tslib');
  53295. const optimizeResults = await optimizeModule(config, compilerCtx, {
  53296. input: code,
  53297. sourceMap: sourceMap,
  53298. isCore,
  53299. sourceTarget,
  53300. inlineHelpers,
  53301. minify: shouldMinify,
  53302. });
  53303. buildCtx.diagnostics.push(...optimizeResults.diagnostics);
  53304. if (typeof optimizeResults.output === 'string') {
  53305. code = optimizeResults.output;
  53306. sourceMap = optimizeResults.sourceMap;
  53307. }
  53308. return { code, sourceMap };
  53309. };
  53310. const generateCjs = async (config, compilerCtx, buildCtx, rollupBuild, outputTargets) => {
  53311. const cjsOutputs = outputTargets.filter((o) => !!o.cjsDir);
  53312. if (cjsOutputs.length > 0) {
  53313. const outputTargetType = cjsOutputs[0].type;
  53314. const esmOpts = {
  53315. banner: generatePreamble(config),
  53316. format: 'cjs',
  53317. entryFileNames: '[name].cjs.js',
  53318. assetFileNames: '[name]-[hash][extname]',
  53319. preferConst: true,
  53320. sourcemap: config.sourceMap,
  53321. };
  53322. const results = await generateRollupOutput(rollupBuild, esmOpts, config, buildCtx.entryModules);
  53323. if (results != null) {
  53324. const destinations = cjsOutputs.map((o) => o.cjsDir);
  53325. buildCtx.commonJsComponentBundle = await generateLazyModules(config, compilerCtx, buildCtx, outputTargetType, destinations, results, 'es2017', false, '.cjs');
  53326. await generateShortcuts$1(compilerCtx, results, cjsOutputs);
  53327. }
  53328. }
  53329. return { name: 'cjs', buildCtx };
  53330. };
  53331. const generateShortcuts$1 = (compilerCtx, rollupResult, outputTargets) => {
  53332. const indexFilename = rollupResult.find((r) => r.type === 'chunk' && r.isIndex).fileName;
  53333. return Promise.all(outputTargets.map(async (o) => {
  53334. if (o.cjsIndexFile) {
  53335. const entryPointPath = join(o.cjsDir, indexFilename);
  53336. const relativePath = relativeImport(o.cjsIndexFile, entryPointPath);
  53337. const shortcutContent = `module.exports = require('${relativePath}');\n`;
  53338. await compilerCtx.fs.writeFile(o.cjsIndexFile, shortcutContent, { outputTargetType: o.type });
  53339. }
  53340. }));
  53341. };
  53342. const generateEsmBrowser = async (config, compilerCtx, buildCtx, rollupBuild, outputTargets) => {
  53343. const esmOutputs = outputTargets.filter((o) => !!o.esmDir && !!o.isBrowserBuild);
  53344. if (esmOutputs.length) {
  53345. const outputTargetType = esmOutputs[0].type;
  53346. const esmOpts = {
  53347. banner: generatePreamble(config),
  53348. format: 'es',
  53349. entryFileNames: '[name].esm.js',
  53350. chunkFileNames: config.hashFileNames ? 'p-[hash].js' : '[name]-[hash].js',
  53351. assetFileNames: config.hashFileNames ? 'p-[hash][extname]' : '[name]-[hash][extname]',
  53352. preferConst: true,
  53353. sourcemap: config.sourceMap,
  53354. };
  53355. if (config.extras.dynamicImportShim) {
  53356. // for Edge 16-18
  53357. esmOpts.dynamicImportFunction = getDynamicImportFunction$1(config.fsNamespace);
  53358. }
  53359. const output = await generateRollupOutput(rollupBuild, esmOpts, config, buildCtx.entryModules);
  53360. if (output != null) {
  53361. const es2017destinations = esmOutputs.map((o) => o.esmDir);
  53362. buildCtx.esmBrowserComponentBundle = await generateLazyModules(config, compilerCtx, buildCtx, outputTargetType, es2017destinations, output, 'es2017', true, '');
  53363. }
  53364. }
  53365. return { name: 'esm-browser', buildCtx };
  53366. };
  53367. const generateEsm = async (config, compilerCtx, buildCtx, rollupBuild, outputTargets) => {
  53368. const esmEs5Outputs = config.buildEs5 ? outputTargets.filter((o) => !!o.esmEs5Dir && !o.isBrowserBuild) : [];
  53369. const esmOutputs = outputTargets.filter((o) => !!o.esmDir && !o.isBrowserBuild);
  53370. if (esmOutputs.length + esmEs5Outputs.length > 0) {
  53371. const esmOpts = {
  53372. banner: generatePreamble(config),
  53373. format: 'es',
  53374. entryFileNames: '[name].js',
  53375. assetFileNames: '[name]-[hash][extname]',
  53376. preferConst: true,
  53377. sourcemap: config.sourceMap,
  53378. };
  53379. const outputTargetType = esmOutputs[0].type;
  53380. const output = await generateRollupOutput(rollupBuild, esmOpts, config, buildCtx.entryModules);
  53381. if (output != null) {
  53382. const es2017destinations = esmOutputs.map((o) => o.esmDir);
  53383. buildCtx.esmComponentBundle = await generateLazyModules(config, compilerCtx, buildCtx, outputTargetType, es2017destinations, output, 'es2017', false, '');
  53384. const es5destinations = esmEs5Outputs.map((o) => o.esmEs5Dir);
  53385. buildCtx.es5ComponentBundle = await generateLazyModules(config, compilerCtx, buildCtx, outputTargetType, es5destinations, output, 'es5', false, '');
  53386. await copyPolyfills(config, compilerCtx, esmOutputs);
  53387. await generateShortcuts(config, compilerCtx, outputTargets, output);
  53388. }
  53389. }
  53390. return { name: 'esm', buildCtx };
  53391. };
  53392. const copyPolyfills = async (config, compilerCtx, outputTargets) => {
  53393. const destinations = outputTargets.filter((o) => o.polyfills).map((o) => o.esmDir);
  53394. if (destinations.length === 0) {
  53395. return;
  53396. }
  53397. const src = join(config.sys.getCompilerExecutingPath(), '..', '..', 'internal', 'client', 'polyfills');
  53398. const files = await compilerCtx.fs.readdir(src);
  53399. await Promise.all(destinations.map((dest) => {
  53400. return Promise.all(files.map((f) => {
  53401. return compilerCtx.fs.copyFile(f.absPath, join(dest, 'polyfills', f.relPath));
  53402. }));
  53403. }));
  53404. };
  53405. const generateShortcuts = (config, compilerCtx, outputTargets, rollupResult) => {
  53406. const indexFilename = rollupResult.find((r) => r.type === 'chunk' && r.isIndex).fileName;
  53407. return Promise.all(outputTargets.map(async (o) => {
  53408. if (o.esmDir && o.esmIndexFile) {
  53409. const entryPointPath = config.buildEs5 && o.esmEs5Dir ? join(o.esmEs5Dir, indexFilename) : join(o.esmDir, indexFilename);
  53410. const relativePath = relativeImport(o.esmIndexFile, entryPointPath);
  53411. const shortcutContent = `export * from '${relativePath}';`;
  53412. await compilerCtx.fs.writeFile(o.esmIndexFile, shortcutContent, { outputTargetType: o.type });
  53413. }
  53414. }));
  53415. };
  53416. const getClientPolyfill = async (config, compilerCtx, polyfillFile) => {
  53417. const polyfillFilePath = join(config.sys.getCompilerExecutingPath(), '..', '..', 'internal', 'client', 'polyfills', polyfillFile);
  53418. return compilerCtx.fs.readFile(polyfillFilePath);
  53419. };
  53420. const getAppBrowserCorePolyfills = async (config, compilerCtx) => {
  53421. // read all the polyfill content, in this particular order
  53422. const polyfills = INLINE_POLYFILLS.slice();
  53423. if (config.extras.cssVarsShim) {
  53424. polyfills.push(INLINE_CSS_SHIM);
  53425. }
  53426. const results = await Promise.all(polyfills.map((polyfillFile) => getClientPolyfill(config, compilerCtx, polyfillFile)));
  53427. // concat the polyfills
  53428. return results.join('\n').trim();
  53429. };
  53430. // order of the polyfills matters!! test test test
  53431. // actual source of the polyfills are found in /src/client/polyfills/
  53432. const INLINE_POLYFILLS = ['core-js.js', 'dom.js', 'es5-html-element.js', 'system.js'];
  53433. const INLINE_CSS_SHIM = 'css-shim.js';
  53434. const generateSystem = async (config, compilerCtx, buildCtx, rollupBuild, outputTargets) => {
  53435. const systemOutputs = outputTargets.filter((o) => !!o.systemDir);
  53436. if (systemOutputs.length > 0) {
  53437. const esmOpts = {
  53438. banner: generatePreamble(config),
  53439. format: 'system',
  53440. entryFileNames: config.hashFileNames ? 'p-[hash].system.js' : '[name].system.js',
  53441. chunkFileNames: config.hashFileNames ? 'p-[hash].system.js' : '[name]-[hash].system.js',
  53442. assetFileNames: config.hashFileNames ? 'p-[hash][extname]' : '[name]-[hash][extname]',
  53443. preferConst: true,
  53444. sourcemap: config.sourceMap,
  53445. };
  53446. const results = await generateRollupOutput(rollupBuild, esmOpts, config, buildCtx.entryModules);
  53447. if (results != null) {
  53448. const destinations = systemOutputs.map((o) => o.esmDir);
  53449. buildCtx.systemComponentBundle = await generateLazyModules(config, compilerCtx, buildCtx, outputTargets[0].type, destinations, results, 'es5', true, '.system');
  53450. await generateSystemLoaders(config, compilerCtx, results, systemOutputs);
  53451. }
  53452. }
  53453. return { name: 'system', buildCtx };
  53454. };
  53455. const generateSystemLoaders = (config, compilerCtx, rollupResult, systemOutputs) => {
  53456. const loaderFilename = rollupResult.find((r) => r.type === 'chunk' && r.isBrowserLoader).fileName;
  53457. return Promise.all(systemOutputs.map((o) => writeSystemLoader(config, compilerCtx, loaderFilename, o)));
  53458. };
  53459. const writeSystemLoader = async (config, compilerCtx, loaderFilename, outputTarget) => {
  53460. if (outputTarget.systemLoaderFile) {
  53461. const entryPointPath = join(outputTarget.systemDir, loaderFilename);
  53462. const relativePath = relativeImport(outputTarget.systemLoaderFile, entryPointPath);
  53463. const loaderContent = await getSystemLoader(config, compilerCtx, relativePath, outputTarget.polyfills);
  53464. await compilerCtx.fs.writeFile(outputTarget.systemLoaderFile, loaderContent, {
  53465. outputTargetType: outputTarget.type,
  53466. });
  53467. }
  53468. };
  53469. const getSystemLoader = async (config, compilerCtx, corePath, includePolyfills) => {
  53470. const polyfills = includePolyfills
  53471. ? await getAppBrowserCorePolyfills(config, compilerCtx)
  53472. : '/* polyfills excluded */';
  53473. return `
  53474. 'use strict';
  53475. (function () {
  53476. var currentScript = document.currentScript;
  53477. // Safari 10 support type="module" but still download and executes the nomodule script
  53478. if (!currentScript || !currentScript.hasAttribute('nomodule') || !('onbeforeload' in currentScript)) {
  53479. ${polyfills}
  53480. // Figure out currentScript (for IE11, since it does not support currentScript)
  53481. var regex = /\\/${config.fsNamespace}(\\.esm)?\\.js($|\\?|#)/;
  53482. var scriptElm = currentScript || Array.from(document.querySelectorAll('script')).find(function(s) {
  53483. return regex.test(s.src) || s.getAttribute('data-stencil-namespace') === "${config.fsNamespace}";
  53484. });
  53485. var resourcesUrl = scriptElm ? scriptElm.getAttribute('data-resources-url') || scriptElm.src : '';
  53486. var start = function() {
  53487. var url = new URL('${corePath}', new URL(resourcesUrl, window.location.origin));
  53488. System.import(url.href);
  53489. };
  53490. if (window.__cssshim) {
  53491. window.__cssshim.i().then(start);
  53492. } else {
  53493. start();
  53494. }
  53495. // Note: using .call(window) here because the self-executing function needs
  53496. // to be scoped to the window object for the ES6Promise polyfill to work
  53497. }
  53498. }).call(window);
  53499. `;
  53500. };
  53501. const generateModuleGraph = (cmps, bundleModules) => {
  53502. const cmpMap = new Map();
  53503. cmps.forEach((cmp) => {
  53504. const bundle = bundleModules.find((b) => b.cmps.includes(cmp));
  53505. if (bundle) {
  53506. // add default case for no mode
  53507. cmpMap.set(getScopeId(cmp.tagName), bundle.rollupResult.imports);
  53508. }
  53509. });
  53510. return cmpMap;
  53511. };
  53512. /**
  53513. * Scan the provided `doc` for any known Stencil components
  53514. * @param doc the Document to scan
  53515. * @param cmps the compiler metadata of known Stencil components
  53516. * @returns a list of all tags that were identified as known Stencil components
  53517. */
  53518. const getUsedComponents = (doc, cmps) => {
  53519. const tags = new Set(cmps.map((cmp) => cmp.tagName.toUpperCase()));
  53520. const found = [];
  53521. const searchComponents = (el) => {
  53522. if (tags.has(el.tagName)) {
  53523. found.push(el.tagName.toLowerCase());
  53524. }
  53525. for (let i = 0; i < el.childElementCount; i++) {
  53526. searchComponents(el.children[i]);
  53527. }
  53528. };
  53529. searchComponents(doc.documentElement);
  53530. return found;
  53531. };
  53532. /**
  53533. * Retrieve the component bundle groupings to be used when generating output
  53534. * @param config the Stencil configuration used for the build
  53535. * @param buildCtx the current build context
  53536. * @param cmps the components that have been registered & defined for the current build
  53537. * @returns the component bundling data
  53538. */
  53539. function getDefaultBundles(config, buildCtx, cmps) {
  53540. // get all of the user defined bundles in the Stencil config file
  53541. const userConfigEntryPoints = getUserConfigBundles(config, buildCtx, cmps);
  53542. if (userConfigEntryPoints.length > 0) {
  53543. // prefer user defined entry points over anything else Stencil may derive
  53544. return userConfigEntryPoints;
  53545. }
  53546. let entryPointsHints = config.entryComponentsHint;
  53547. if (!entryPointsHints && buildCtx.indexDoc) {
  53548. // attempt to scan an HTML file for known Stencil components
  53549. entryPointsHints = getUsedComponents(buildCtx.indexDoc, cmps);
  53550. }
  53551. if (!entryPointsHints) {
  53552. return [];
  53553. }
  53554. const mainBundle = unique([
  53555. ...entryPointsHints,
  53556. ...flatOne(entryPointsHints.map(resolveTag).map((cmp) => cmp.dependencies)),
  53557. ]).map(resolveTag);
  53558. function resolveTag(tag) {
  53559. return cmps.find((cmp) => cmp.tagName === tag);
  53560. }
  53561. return [mainBundle];
  53562. }
  53563. /**
  53564. * Retrieve and validate the `bundles` field on a project's Stencil configuration file
  53565. * @param config the configuration file with a `bundles` field to inspect
  53566. * @param buildCtx the current build context
  53567. * @param cmps the components that have been registered & defined for the current build
  53568. * @returns a three dimensional array with the compiler metadata for each component used
  53569. */
  53570. function getUserConfigBundles(config, buildCtx, cmps) {
  53571. const definedTags = new Set();
  53572. const entryTags = config.bundles.map((b) => {
  53573. return b.components
  53574. .map((tag) => {
  53575. const tagError = validateComponentTag(tag);
  53576. if (tagError) {
  53577. const err = buildError(buildCtx.diagnostics);
  53578. err.header = `Stencil Config`;
  53579. err.messageText = tagError;
  53580. }
  53581. const component = cmps.find((cmp) => cmp.tagName === tag);
  53582. if (!component) {
  53583. const warn = buildWarn(buildCtx.diagnostics);
  53584. warn.header = `Stencil Config`;
  53585. warn.messageText = `Component tag "${tag}" is defined in a bundle but no matching component was found within this app or its collections.`;
  53586. }
  53587. if (definedTags.has(tag)) {
  53588. const warn = buildWarn(buildCtx.diagnostics);
  53589. warn.header = `Stencil Config`;
  53590. warn.messageText = `Component tag "${tag}" has been defined multiple times in the "bundles" config.`;
  53591. }
  53592. definedTags.add(tag);
  53593. return component;
  53594. })
  53595. .sort();
  53596. });
  53597. return entryTags;
  53598. }
  53599. /**
  53600. * Generate a list of all component tags that will be used by the output
  53601. * @param config the Stencil configuration used for the build
  53602. * @param defaultBundles metadata of the assumed components being used/bundled
  53603. * @param allCmps all known components
  53604. * @returns a set of all component tags that are used
  53605. */
  53606. function computeUsedComponents(config, defaultBundles, allCmps) {
  53607. if (!config.excludeUnusedDependencies) {
  53608. // the user/config has specified that Stencil should use all the dependencies it's found, return the set of all
  53609. // known tags
  53610. return new Set(allCmps.map((c) => c.tagName));
  53611. }
  53612. const usedComponents = new Set();
  53613. // All components
  53614. defaultBundles.forEach((entry) => {
  53615. entry.forEach((cmp) => usedComponents.add(cmp.tagName));
  53616. });
  53617. allCmps.forEach((cmp) => {
  53618. if (!cmp.isCollectionDependency) {
  53619. usedComponents.add(cmp.tagName);
  53620. }
  53621. });
  53622. allCmps.forEach((cmp) => {
  53623. if (cmp.isCollectionDependency) {
  53624. if (cmp.dependents.some((dep) => usedComponents.has(dep))) {
  53625. usedComponents.add(cmp.tagName);
  53626. }
  53627. }
  53628. });
  53629. return usedComponents;
  53630. }
  53631. /**
  53632. * Generate the bundles that will be used during the bundling process
  53633. * @param config the Stencil configuration used for the build
  53634. * @param buildCtx the current build context
  53635. * @returns the bundles to be used during the bundling process
  53636. */
  53637. function generateComponentBundles(config, buildCtx) {
  53638. const cmps = sortBy(buildCtx.components, (cmp) => cmp.dependents.length);
  53639. const defaultBundles = getDefaultBundles(config, buildCtx, cmps);
  53640. const usedComponents = computeUsedComponents(config, defaultBundles, cmps);
  53641. if (config.devMode) {
  53642. return cmps
  53643. .filter((c) => usedComponents.has(c.tagName))
  53644. .map((cmp) => [cmp]);
  53645. }
  53646. // Visit components that are already in one of the default bundlers
  53647. const alreadyBundled = new Set();
  53648. defaultBundles.forEach((entry) => {
  53649. entry.forEach((cmp) => alreadyBundled.add(cmp));
  53650. });
  53651. const bundlers = cmps
  53652. .filter((cmp) => usedComponents.has(cmp.tagName) && !alreadyBundled.has(cmp))
  53653. .map((c) => [c]);
  53654. return [...defaultBundles, ...optimizeBundlers(bundlers, 0.6)].filter((b) => b.length > 0);
  53655. }
  53656. /**
  53657. * Calculate and reorganize bundles based on a calculated similarity score between bundle entries
  53658. * @param bundles the bundles to reorganize
  53659. * @param threshold a numeric value used to determine whether or not bundles should be reorganized
  53660. * @returns the reorganized bundles
  53661. */
  53662. function optimizeBundlers(bundles, threshold) {
  53663. /**
  53664. * build a mapping of component tag names in each `bundles` entry to the index where that entry occurs in `bundles`:
  53665. * ```ts
  53666. * bundles = [
  53667. * [
  53668. * {
  53669. * tagName: 'my-foo', ...<other_fields>,
  53670. * },
  53671. * ],
  53672. * [
  53673. * {
  53674. * tagName: 'my-bar', ...<other_fields>,
  53675. * },
  53676. * {
  53677. * tagName: 'my-baz', ...<other_fields>,
  53678. * },
  53679. * ],
  53680. * ];
  53681. * // yields
  53682. * {
  53683. * 'my-foo': 0,
  53684. * 'my-bar': 1,
  53685. * 'my-baz': 1,
  53686. * }
  53687. * ```
  53688. * note that in the event of a component being found >1 time, store the index of the last entry in which it's found
  53689. */
  53690. const cmpIndexMap = new Map();
  53691. bundles.forEach((entry, index) => {
  53692. entry.forEach((cmp) => {
  53693. cmpIndexMap.set(cmp.tagName, index);
  53694. });
  53695. });
  53696. // build a record of components
  53697. const matrix = bundles.map((entry) => {
  53698. const vector = new Uint8Array(bundles.length);
  53699. entry.forEach((cmp) => {
  53700. // for each dependent of a component, check to see if the dependent has been seen already when the `cmpIndexMap`
  53701. // was originally built. If so, mark it with a '1'
  53702. cmp.dependents.forEach((tag) => {
  53703. const index = cmpIndexMap.get(tag);
  53704. if (index !== undefined) {
  53705. vector[index] = 1;
  53706. }
  53707. });
  53708. });
  53709. entry.forEach((cmp) => {
  53710. // for each entry, check to see if the component has been seen already when the `cmpIndexMap` was originally
  53711. // built. If so, mark it with a '0', potentially overriding a previously set value on the vector.
  53712. const index = cmpIndexMap.get(cmp.tagName);
  53713. if (index !== undefined) {
  53714. vector[index] = 0;
  53715. }
  53716. });
  53717. return vector;
  53718. });
  53719. // resolve similar components
  53720. const newBundles = [];
  53721. const visited = new Uint8Array(bundles.length);
  53722. for (let i = 0; i < matrix.length; i++) {
  53723. // check if bundle is visited (0 means it's not)
  53724. if (visited[i] === 0) {
  53725. const bundle = [...bundles[i]];
  53726. visited[i] = 1;
  53727. for (let j = i + 1; j < matrix.length; j++) {
  53728. if (visited[j] === 0 && computeScore(matrix[i], matrix[j]) >= threshold) {
  53729. bundle.push(...bundles[j]);
  53730. visited[j] = 1;
  53731. }
  53732. }
  53733. newBundles.push(bundle);
  53734. }
  53735. }
  53736. return newBundles;
  53737. }
  53738. /**
  53739. * Computes a 'score' between two arrays, that is defined as the number of times that the value at a given index is the
  53740. * same in both arrays divided by the number of times the value in either array is high at the given index.
  53741. * @param m0 the first array to calculate sameness with
  53742. * @param m1 the second array to calculate sameness with
  53743. * @returns the calculated score
  53744. */
  53745. function computeScore(m0, m1) {
  53746. let total = 0;
  53747. let match = 0;
  53748. for (let i = 0; i < m0.length; i++) {
  53749. if (m0[i] === 1 || m1[i] === 1) {
  53750. total++;
  53751. if (m0[i] === m1[i]) {
  53752. match++;
  53753. }
  53754. }
  53755. }
  53756. return match / total;
  53757. }
  53758. const outputLazy = async (config, compilerCtx, buildCtx) => {
  53759. const outputTargets = config.outputTargets.filter(isOutputTargetDistLazy);
  53760. if (outputTargets.length === 0) {
  53761. return;
  53762. }
  53763. const bundleEventMessage = `generate lazy${config.sourceMap ? ' + source maps' : ''}`;
  53764. const timespan = buildCtx.createTimeSpan(`${bundleEventMessage} started`);
  53765. try {
  53766. const bundleOpts = {
  53767. id: 'lazy',
  53768. platform: 'client',
  53769. conditionals: getLazyBuildConditionals(config, buildCtx.components),
  53770. customTransformers: getLazyCustomTransformer(config, compilerCtx),
  53771. inlineWorkers: config.outputTargets.some(isOutputTargetDist),
  53772. inputs: {
  53773. [config.fsNamespace]: LAZY_BROWSER_ENTRY_ID,
  53774. loader: LAZY_EXTERNAL_ENTRY_ID,
  53775. index: USER_INDEX_ENTRY_ID,
  53776. },
  53777. loader: {
  53778. [LAZY_EXTERNAL_ENTRY_ID]: getLazyEntry(false),
  53779. [LAZY_BROWSER_ENTRY_ID]: getLazyEntry(true),
  53780. },
  53781. };
  53782. // we've got the compiler context filled with app modules and collection dependency modules
  53783. // figure out how all these components should be connected
  53784. generateEntryModules(config, buildCtx);
  53785. buildCtx.entryModules.forEach((entryModule) => {
  53786. bundleOpts.inputs[entryModule.entryKey] = entryModule.entryKey;
  53787. });
  53788. const rollupBuild = await bundleOutput(config, compilerCtx, buildCtx, bundleOpts);
  53789. if (rollupBuild != null) {
  53790. const results = await Promise.all([
  53791. generateEsmBrowser(config, compilerCtx, buildCtx, rollupBuild, outputTargets),
  53792. generateEsm(config, compilerCtx, buildCtx, rollupBuild, outputTargets),
  53793. generateSystem(config, compilerCtx, buildCtx, rollupBuild, outputTargets),
  53794. generateCjs(config, compilerCtx, buildCtx, rollupBuild, outputTargets),
  53795. ]);
  53796. results.forEach((result) => {
  53797. if (result.name === 'cjs') {
  53798. buildCtx.commonJsComponentBundle = result.buildCtx.commonJsComponentBundle;
  53799. }
  53800. else if (result.name === 'system') {
  53801. buildCtx.systemComponentBundle = result.buildCtx.systemComponentBundle;
  53802. }
  53803. else if (result.name === 'esm') {
  53804. buildCtx.esmComponentBundle = result.buildCtx.esmComponentBundle;
  53805. buildCtx.es5ComponentBundle = result.buildCtx.es5ComponentBundle;
  53806. }
  53807. else if (result.name === 'esm-browser') {
  53808. buildCtx.esmBrowserComponentBundle = result.buildCtx.esmBrowserComponentBundle;
  53809. buildCtx.buildResults = result.buildCtx.buildResults;
  53810. buildCtx.components = result.buildCtx.components;
  53811. }
  53812. });
  53813. if (buildCtx.esmBrowserComponentBundle != null) {
  53814. buildCtx.componentGraph = generateModuleGraph(buildCtx.components, buildCtx.esmBrowserComponentBundle);
  53815. }
  53816. }
  53817. }
  53818. catch (e) {
  53819. catchError(buildCtx.diagnostics, e);
  53820. }
  53821. timespan.finish(`${bundleEventMessage} finished`);
  53822. };
  53823. const getLazyCustomTransformer = (config, compilerCtx) => {
  53824. const transformOpts = {
  53825. coreImportPath: STENCIL_CORE_ID,
  53826. componentExport: 'lazy',
  53827. componentMetadata: null,
  53828. currentDirectory: config.sys.getCurrentDirectory(),
  53829. proxy: null,
  53830. style: 'static',
  53831. styleImportData: 'queryparams',
  53832. };
  53833. return [
  53834. updateStencilCoreImports(transformOpts.coreImportPath),
  53835. lazyComponentTransform(compilerCtx, transformOpts),
  53836. removeCollectionImports(compilerCtx),
  53837. ];
  53838. };
  53839. /**
  53840. * Generate entry modules to be used by the build process by determining how modules and components are connected
  53841. * @param config the Stencil configuration file that was provided as a part of the build step
  53842. * @param buildCtx the current build context
  53843. */
  53844. function generateEntryModules(config, buildCtx) {
  53845. // figure out how modules and components connect
  53846. try {
  53847. const bundles = generateComponentBundles(config, buildCtx);
  53848. buildCtx.entryModules = bundles.map(createEntryModule);
  53849. }
  53850. catch (e) {
  53851. catchError(buildCtx.diagnostics, e);
  53852. }
  53853. buildCtx.debug(`generateEntryModules, ${buildCtx.entryModules.length} entryModules`);
  53854. }
  53855. /**
  53856. * Generates an entry module to be used during the bundling process
  53857. * @param cmps the component metadata to create a single entry module from
  53858. * @returns the entry module generated
  53859. */
  53860. function createEntryModule(cmps) {
  53861. // generate a unique entry key based on the components within this entry module
  53862. cmps = sortBy(cmps, (c) => c.tagName);
  53863. const entryKey = cmps.map((c) => c.tagName).join('.') + '.entry';
  53864. return {
  53865. cmps,
  53866. entryKey,
  53867. };
  53868. }
  53869. const getLazyEntry = (isBrowser) => {
  53870. const s = new MagicString$2(``);
  53871. s.append(`import { bootstrapLazy } from '${STENCIL_CORE_ID}';\n`);
  53872. if (isBrowser) {
  53873. s.append(`import { patchBrowser } from '${STENCIL_INTERNAL_CLIENT_PATCH_BROWSER_ID}';\n`);
  53874. s.append(`import { globalScripts } from '${STENCIL_APP_GLOBALS_ID}';\n`);
  53875. s.append(`patchBrowser().then(options => {\n`);
  53876. s.append(` globalScripts();\n`);
  53877. s.append(` return bootstrapLazy([/*!__STENCIL_LAZY_DATA__*/], options);\n`);
  53878. s.append(`});\n`);
  53879. }
  53880. else {
  53881. s.append(`import { patchEsm } from '${STENCIL_INTERNAL_CLIENT_PATCH_ESM_ID}';\n`);
  53882. s.append(`import { globalScripts } from '${STENCIL_APP_GLOBALS_ID}';\n`);
  53883. s.append(`export const defineCustomElements = (win, options) => {\n`);
  53884. s.append(` if (typeof window === 'undefined') return Promise.resolve();\n`);
  53885. s.append(` return patchEsm().then(() => {\n`);
  53886. s.append(` globalScripts();\n`);
  53887. s.append(` return bootstrapLazy([/*!__STENCIL_LAZY_DATA__*/], options);\n`);
  53888. s.append(` });\n`);
  53889. s.append(`};\n`);
  53890. }
  53891. return s.toString();
  53892. };
  53893. const outputLazyLoader = async (config, compilerCtx) => {
  53894. const outputTargets = config.outputTargets.filter(isOutputTargetDistLazyLoader);
  53895. if (outputTargets.length === 0) {
  53896. return;
  53897. }
  53898. await Promise.all(outputTargets.map((o) => generateLoader(config, compilerCtx, o)));
  53899. };
  53900. const generateLoader = async (config, compilerCtx, outputTarget) => {
  53901. const loaderPath = outputTarget.dir;
  53902. const es2017Dir = outputTarget.esmDir;
  53903. const es5Dir = outputTarget.esmEs5Dir || es2017Dir;
  53904. const cjsDir = outputTarget.cjsDir;
  53905. if (!loaderPath || !es2017Dir || !cjsDir) {
  53906. return;
  53907. }
  53908. const es5HtmlElement = await getClientPolyfill(config, compilerCtx, 'es5-html-element.js');
  53909. const packageJsonContent = JSON.stringify({
  53910. name: config.fsNamespace + '-loader',
  53911. typings: './index.d.ts',
  53912. module: './index.js',
  53913. main: './index.cjs.js',
  53914. 'jsnext:main': './index.es2017.js',
  53915. es2015: './index.es2017.js',
  53916. es2017: './index.es2017.js',
  53917. unpkg: './cdn.js',
  53918. }, null, 2);
  53919. const es5EntryPoint = join(es5Dir, 'loader.js');
  53920. const es2017EntryPoint = join(es2017Dir, 'loader.js');
  53921. const polyfillsEntryPoint = join(es2017Dir, 'polyfills/index.js');
  53922. const cjsEntryPoint = join(cjsDir, 'loader.cjs.js');
  53923. const polyfillsExport = `export * from '${normalizePath$1(relative$1(loaderPath, polyfillsEntryPoint))}';`;
  53924. const indexContent = `${generatePreamble(config)}
  53925. ${es5HtmlElement}
  53926. ${polyfillsExport}
  53927. export * from '${normalizePath$1(relative$1(loaderPath, es5EntryPoint))}';
  53928. `;
  53929. const indexES2017Content = `${generatePreamble(config)}
  53930. ${polyfillsExport}
  53931. export * from '${normalizePath$1(relative$1(loaderPath, es2017EntryPoint))}';
  53932. `;
  53933. const indexCjsContent = `${generatePreamble(config)}
  53934. module.exports = require('${normalizePath$1(relative$1(loaderPath, cjsEntryPoint))}');
  53935. module.exports.applyPolyfills = function() { return Promise.resolve() };
  53936. `;
  53937. const indexDtsPath = join(loaderPath, 'index.d.ts');
  53938. await Promise.all([
  53939. compilerCtx.fs.writeFile(join(loaderPath, 'package.json'), packageJsonContent),
  53940. compilerCtx.fs.writeFile(join(loaderPath, 'index.d.ts'), generateIndexDts(indexDtsPath, outputTarget.componentDts)),
  53941. compilerCtx.fs.writeFile(join(loaderPath, 'index.js'), indexContent),
  53942. compilerCtx.fs.writeFile(join(loaderPath, 'index.cjs.js'), indexCjsContent),
  53943. compilerCtx.fs.writeFile(join(loaderPath, 'cdn.js'), indexCjsContent),
  53944. compilerCtx.fs.writeFile(join(loaderPath, 'index.es2017.js'), indexES2017Content),
  53945. ]);
  53946. };
  53947. const generateIndexDts = (indexDtsPath, componentsDtsPath) => {
  53948. return `export * from '${relativeImport(indexDtsPath, componentsDtsPath, '.d.ts')}';
  53949. export interface CustomElementsDefineOptions {
  53950. exclude?: string[];
  53951. resourcesUrl?: string;
  53952. syncQueue?: boolean;
  53953. jmp?: (c: Function) => any;
  53954. raf?: (c: FrameRequestCallback) => number;
  53955. ael?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
  53956. rel?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
  53957. }
  53958. export declare function defineCustomElements(win?: Window, opts?: CustomElementsDefineOptions): Promise<void>;
  53959. export declare function applyPolyfills(): Promise<void>;
  53960. `;
  53961. };
  53962. const addScriptDataAttribute = (config, doc, outputTarget) => {
  53963. const resourcesUrl = getAbsoluteBuildDir(outputTarget);
  53964. const entryEsmFilename = `${config.fsNamespace}.esm.js`;
  53965. const entryNoModuleFilename = `${config.fsNamespace}.js`;
  53966. const expectedEsmSrc = join(resourcesUrl, entryEsmFilename);
  53967. const expectedNoModuleSrc = join(resourcesUrl, entryNoModuleFilename);
  53968. const scripts = Array.from(doc.querySelectorAll('script'));
  53969. const scriptEsm = scripts.find((s) => s.getAttribute('src') === expectedEsmSrc);
  53970. const scriptNomodule = scripts.find((s) => s.getAttribute('src') === expectedNoModuleSrc);
  53971. if (scriptEsm) {
  53972. scriptEsm.setAttribute('data-stencil', '');
  53973. }
  53974. if (scriptNomodule) {
  53975. scriptNomodule.setAttribute('data-stencil', '');
  53976. }
  53977. };
  53978. const generateEs5DisabledMessage = async (config, compilerCtx, outputTarget) => {
  53979. // not doing an es5 right now
  53980. // but it's possible during development the user
  53981. // tests on a browser that doesn't support es2017
  53982. const fileName = `${config.fsNamespace}.js`;
  53983. const filePath = join(outputTarget.buildDir, fileName);
  53984. await compilerCtx.fs.writeFile(filePath, getDisabledMessageScript(config));
  53985. return fileName;
  53986. };
  53987. const getDisabledMessageScript = (config) => {
  53988. const style = `
  53989. <style>
  53990. body {
  53991. display: block !important;
  53992. font-family: sans-serif;
  53993. padding: 20px;
  53994. line-height:22px;
  53995. }
  53996. h1 {
  53997. font-size: 18px;
  53998. }
  53999. h2 {
  54000. font-size: 14px;
  54001. margin-top: 40px;
  54002. }
  54003. </style>
  54004. `;
  54005. const htmlLegacy = `
  54006. ${style}
  54007. <h1>This Stencil app is disabled for this browser.</h1>
  54008. <h2>Developers:</h2>
  54009. <ul>
  54010. <li>ES5 builds are disabled <strong>during development</strong> to take advantage of 2x faster build times.</li>
  54011. <li>Please see the example below or our <a href="https://stenciljs.com/docs/stencil-config" target="_blank" rel="noopener noreferrer">config docs</a> if you would like to develop on a browser that does not fully support ES2017 and custom elements.</li>
  54012. <li>Note that as of Stencil v2, ES5 builds and polyfills are <strong>disabled</strong> during production builds. You can enable these <a href="https://stenciljs.com/docs/config#buildes5" target="_blank" rel="noopener noreferrer">in your stencil.config.ts file</a>.</li>
  54013. <li>When testing browsers it is recommended to always test in production mode, and ES5 builds should always be enabled during production builds.</li>
  54014. <li><em>This is only an experiment and if it slows down app development then we will revert this and enable ES5 builds during dev.</em></li>
  54015. </ul>
  54016. <h2>Enabling ES5 builds during development:</h2>
  54017. <pre>
  54018. <code>npm run dev --es5</code>
  54019. </pre>
  54020. <p>For stencil-component-starter, use:</p>
  54021. <pre>
  54022. <code>npm start --es5</code>
  54023. </pre>
  54024. <h2>Enabling full production builds during development:</h2>
  54025. <pre>
  54026. <code>npm run dev --prod</code>
  54027. </pre>
  54028. <p>For stencil-component-starter, use:</p>
  54029. <pre>
  54030. <code>npm start --prod</code>
  54031. </pre>
  54032. <h2>Current Browser's Support:</h2>
  54033. <ul>
  54034. <li><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import">ES Module Imports</a>: <span id="es-modules-test"></span></li>
  54035. <li><a href="http://2ality.com/2017/01/import-operator.html">ES Dynamic Imports</a>: <span id="es-dynamic-modules-test"></span></li>
  54036. <li><a href="https://developer.mozilla.org/en-US/docs/Web/API/Window/customElements">Custom Elements</a>: <span id="custom-elements-test"></span></li>
  54037. <li><a href="https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_shadow_DOM">Shadow DOM</a>: <span id="shadow-dom-test"></span></li>
  54038. <li><a href="https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API">fetch</a>: <span id="fetch-test"></span></li>
  54039. <li><a href="https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_variables">CSS Variables</a>: <span id="css-variables-test"></span></li>
  54040. </ul>
  54041. <h2>Current Browser:</h2>
  54042. <pre>
  54043. <code id="current-browser-output"></code>
  54044. </pre>
  54045. `;
  54046. const htmlUpdate = `
  54047. ${style}
  54048. <h1>Update src/index.html</h1>
  54049. <p>Stencil recently changed how scripts are loaded in order to improve performance.</p>
  54050. <h2>BEFORE:</h2>
  54051. <p>Previously, a single script was included that handled loading the correct JavaScript based on browser support.</p>
  54052. <pre>
  54053. <code>${escapeHtml(`<script src="/build/${config.fsNamespace}.js"></script>
  54054. `)}</code>
  54055. </pre>
  54056. <h2 style="margin-top:0">AFTER:</h2>
  54057. <p>The index.html should now include two scripts using the modern ES Module script pattern.
  54058. Note that only one file will actually be requested and loaded based on the browser's native support for ES Modules.
  54059. For more info, please see <a href="https://developers.google.com/web/fundamentals/primers/modules#browser" target="_blank" rel="noopener noreferrer">Using JavaScript modules on the web</a>.
  54060. </p>
  54061. <pre>
  54062. <code>${escapeHtml(`<script`)} <span style="background:yellow">type="module"</span> src="/build/${config.fsNamespace}<span style="background:yellow">.esm</span>.js"${escapeHtml(`></script>`)}
  54063. ${escapeHtml(`<script`)} <span style="background:yellow">nomodule</span> ${escapeHtml(`src="/build/${config.fsNamespace}.js"></script>`)}</code>
  54064. </pre>
  54065. `;
  54066. return `${generatePreamble(config)}
  54067. (function() {
  54068. function checkSupport() {
  54069. if (!document.body) {
  54070. setTimeout(checkSupport);
  54071. return;
  54072. }
  54073. function supportsDynamicImports() {
  54074. try {
  54075. new Function('import("")');
  54076. return true;
  54077. } catch (e) {}
  54078. return false;
  54079. }
  54080. var supportsEsModules = !!('noModule' in document.createElement('script'));
  54081. if (!supportsEsModules) {
  54082. document.body.innerHTML = '${inlineHTML(htmlLegacy)}';
  54083. document.getElementById('current-browser-output').textContent = window.navigator.userAgent;
  54084. document.getElementById('es-modules-test').textContent = supportsEsModules;
  54085. document.getElementById('es-dynamic-modules-test').textContent = supportsDynamicImports();
  54086. document.getElementById('shadow-dom-test').textContent = !!(document.head.attachShadow);
  54087. document.getElementById('custom-elements-test').textContent = !!(window.customElements);
  54088. document.getElementById('css-variables-test').textContent = !!(window.CSS && window.CSS.supports && window.CSS.supports('color', 'var(--c)'));
  54089. document.getElementById('fetch-test').textContent = !!(window.fetch);
  54090. } else {
  54091. document.body.innerHTML = '${inlineHTML(htmlUpdate)}';
  54092. }
  54093. }
  54094. setTimeout(checkSupport);
  54095. })();`;
  54096. };
  54097. const inlineHTML = (html) => {
  54098. return html.replace(/\n/g, '\\n').replace(/\'/g, `\\'`).trim();
  54099. };
  54100. const generateHashedCopy = async (config, compilerCtx, path) => {
  54101. try {
  54102. const content = await compilerCtx.fs.readFile(path);
  54103. const hash = await config.sys.generateContentHash(content, config.hashedFileNameLength);
  54104. const hashedFileName = `p-${hash}${extname$1(path)}`;
  54105. await compilerCtx.fs.writeFile(join(dirname(path), hashedFileName), content);
  54106. return hashedFileName;
  54107. }
  54108. catch (e) { }
  54109. return undefined;
  54110. };
  54111. const generateServiceWorker = async (config, buildCtx, workbox, outputTarget) => {
  54112. const serviceWorker = await getServiceWorker(outputTarget);
  54113. if (serviceWorker.unregister) {
  54114. await config.sys.writeFile(serviceWorker.swDest, SELF_UNREGISTER_SW);
  54115. }
  54116. else if (serviceWorker.swSrc) {
  54117. return Promise.all([copyLib(buildCtx, outputTarget, workbox), injectManifest(buildCtx, serviceWorker, workbox)]);
  54118. }
  54119. else {
  54120. return generateSW(buildCtx, serviceWorker, workbox);
  54121. }
  54122. };
  54123. const copyLib = async (buildCtx, outputTarget, workbox) => {
  54124. const timeSpan = buildCtx.createTimeSpan(`copy service worker library started`, true);
  54125. try {
  54126. await workbox.copyWorkboxLibraries(outputTarget.appDir);
  54127. }
  54128. catch (e) {
  54129. const d = buildWarn(buildCtx.diagnostics);
  54130. d.messageText = 'Service worker library already exists';
  54131. }
  54132. timeSpan.finish(`copy service worker library finished`);
  54133. };
  54134. const generateSW = async (buildCtx, serviceWorker, workbox) => {
  54135. const timeSpan = buildCtx.createTimeSpan(`generate service worker started`);
  54136. try {
  54137. await workbox.generateSW(serviceWorker);
  54138. timeSpan.finish(`generate service worker finished`);
  54139. }
  54140. catch (e) {
  54141. catchError(buildCtx.diagnostics, e);
  54142. }
  54143. };
  54144. const injectManifest = async (buildCtx, serviceWorker, workbox) => {
  54145. const timeSpan = buildCtx.createTimeSpan(`inject manifest into service worker started`);
  54146. try {
  54147. await workbox.injectManifest(serviceWorker);
  54148. timeSpan.finish('inject manifest into service worker finished');
  54149. }
  54150. catch (e) {
  54151. catchError(buildCtx.diagnostics, e);
  54152. }
  54153. };
  54154. const hasServiceWorkerChanges = (config, buildCtx) => {
  54155. if (config.devMode && !config.flags.serviceWorker) {
  54156. return false;
  54157. }
  54158. const wwwServiceOutputs = config.outputTargets
  54159. .filter(isOutputTargetWww)
  54160. .filter((o) => o.serviceWorker && o.serviceWorker.swSrc);
  54161. return wwwServiceOutputs.some((outputTarget) => {
  54162. return buildCtx.filesChanged.some((fileChanged) => {
  54163. if (outputTarget.serviceWorker) {
  54164. return basename(fileChanged).toLowerCase() === basename(outputTarget.serviceWorker.swSrc).toLowerCase();
  54165. }
  54166. return false;
  54167. });
  54168. });
  54169. };
  54170. const getServiceWorker = async (outputTarget) => {
  54171. if (!outputTarget.serviceWorker) {
  54172. return undefined;
  54173. }
  54174. const serviceWorker = {
  54175. ...outputTarget.serviceWorker,
  54176. };
  54177. if (serviceWorker.unregister !== true) {
  54178. delete serviceWorker.unregister;
  54179. }
  54180. return serviceWorker;
  54181. };
  54182. const INDEX_ORG = 'index-org.html';
  54183. const getRegisterSW = (swUrl) => {
  54184. return `
  54185. if ('serviceWorker' in navigator && location.protocol !== 'file:') {
  54186. window.addEventListener('load', function() {
  54187. navigator.serviceWorker.register('${swUrl}')
  54188. .then(function(reg) {
  54189. reg.onupdatefound = function() {
  54190. var installingWorker = reg.installing;
  54191. installingWorker.onstatechange = function() {
  54192. if (installingWorker.state === 'installed') {
  54193. window.dispatchEvent(new Event('swUpdate'))
  54194. }
  54195. }
  54196. }
  54197. })
  54198. .catch(function(err) { console.error('service worker error', err) });
  54199. });
  54200. }`;
  54201. };
  54202. const UNREGISTER_SW = `
  54203. if ('serviceWorker' in navigator && location.protocol !== 'file:') {
  54204. // auto-unregister service worker during dev mode
  54205. navigator.serviceWorker.getRegistration().then(function(registration) {
  54206. if (registration) {
  54207. registration.unregister().then(function() { location.reload(true) });
  54208. }
  54209. });
  54210. }
  54211. `;
  54212. const SELF_UNREGISTER_SW = `
  54213. self.addEventListener('install', function(e) {
  54214. self.skipWaiting();
  54215. });
  54216. self.addEventListener('activate', function(e) {
  54217. self.registration.unregister()
  54218. .then(function() {
  54219. return self.clients.matchAll();
  54220. })
  54221. .then(function(clients) {
  54222. clients.forEach(client => client.navigate(client.url))
  54223. });
  54224. });
  54225. `;
  54226. const inlineStyleSheets = (compilerCtx, doc, maxSize, outputTarget) => {
  54227. const globalLinks = Array.from(doc.querySelectorAll('link[rel=stylesheet]'));
  54228. return Promise.all(globalLinks.map(async (link) => {
  54229. const href = link.getAttribute('href');
  54230. if (typeof href !== 'string' || !href.startsWith('/') || link.getAttribute('media') !== null) {
  54231. return;
  54232. }
  54233. try {
  54234. const fsPath = join(outputTarget.dir, href);
  54235. const styles = await compilerCtx.fs.readFile(fsPath);
  54236. if (styles.length > maxSize) {
  54237. return;
  54238. }
  54239. // insert inline <style>
  54240. const inlinedStyles = doc.createElement('style');
  54241. inlinedStyles.innerHTML = styles;
  54242. link.parentNode.insertBefore(inlinedStyles, link);
  54243. link.remove();
  54244. }
  54245. catch (e) { }
  54246. }));
  54247. };
  54248. const optimizeEsmImport = async (config, compilerCtx, doc, outputTarget) => {
  54249. const resourcesUrl = getAbsoluteBuildDir(outputTarget);
  54250. const entryFilename = `${config.fsNamespace}.esm.js`;
  54251. const expectedSrc = join(resourcesUrl, entryFilename);
  54252. const script = Array.from(doc.querySelectorAll('script')).find((s) => s.getAttribute('type') === 'module' && !s.hasAttribute('crossorigin') && s.getAttribute('src') === expectedSrc);
  54253. if (!script) {
  54254. return false;
  54255. }
  54256. script.setAttribute('data-resources-url', resourcesUrl);
  54257. script.setAttribute('data-stencil-namespace', config.fsNamespace);
  54258. const entryPath = join(outputTarget.buildDir, entryFilename);
  54259. const content = await compilerCtx.fs.readFile(entryPath);
  54260. if (isString$1(content)) {
  54261. // If the script is too big, instead of inlining, we hash the file and change
  54262. // the <script> to the new location
  54263. if (config.allowInlineScripts && content.length < MAX_JS_INLINE_SIZE) {
  54264. // Let's try to inline, we have to fix all the relative paths of the imports
  54265. const results = updateImportPaths(content, resourcesUrl);
  54266. if (results.orgImportPaths.length > 0) {
  54267. // insert inline script
  54268. script.removeAttribute('src');
  54269. script.innerHTML = results.code;
  54270. }
  54271. }
  54272. else {
  54273. const hashedFile = await generateHashedCopy(config, compilerCtx, entryPath);
  54274. if (hashedFile) {
  54275. const hashedPath = join(resourcesUrl, hashedFile);
  54276. script.setAttribute('src', hashedPath);
  54277. injectModulePreloads(doc, [hashedPath]);
  54278. }
  54279. }
  54280. return true;
  54281. }
  54282. return false;
  54283. };
  54284. const updateImportPaths = (code, newDir) => {
  54285. const orgImportPaths = [];
  54286. const tsSourceFile = t.createSourceFile('module.ts', code, t.ScriptTarget.Latest);
  54287. t.transform(tsSourceFile, [readImportPaths(orgImportPaths)]);
  54288. orgImportPaths.forEach((orgImportPath) => {
  54289. const newPath = replacePathDir(orgImportPath, newDir);
  54290. if (newPath) {
  54291. code = code.replace(`"${orgImportPath}"`, `"${newPath}"`);
  54292. code = code.replace(`'${orgImportPath}'`, `'${newPath}'`);
  54293. }
  54294. });
  54295. return {
  54296. code,
  54297. orgImportPaths,
  54298. };
  54299. };
  54300. const replacePathDir = (orgImportPath, newDir) => {
  54301. if (orgImportPath.startsWith('./') && (orgImportPath.endsWith('.js') || orgImportPath.endsWith('.mjs'))) {
  54302. return newDir + orgImportPath.substring(2);
  54303. }
  54304. return null;
  54305. };
  54306. const readImportPaths = (orgImportPaths) => {
  54307. return () => {
  54308. return (tsSourceFile) => {
  54309. const importStatements = tsSourceFile.statements
  54310. .filter(t.isImportDeclaration)
  54311. .filter((s) => s.moduleSpecifier != null)
  54312. .filter((s) => t.isStringLiteral(s.moduleSpecifier) && s.moduleSpecifier.text);
  54313. importStatements.forEach((s) => {
  54314. if (t.isStringLiteral(s.moduleSpecifier)) {
  54315. orgImportPaths.push(s.moduleSpecifier.text);
  54316. }
  54317. });
  54318. return tsSourceFile;
  54319. };
  54320. };
  54321. };
  54322. // https://twitter.com/addyosmani/status/1143938175926095872
  54323. const MAX_JS_INLINE_SIZE = 1 * 1024;
  54324. const updateGlobalStylesLink = (config, doc, globalScriptFilename, outputTarget) => {
  54325. if (!globalScriptFilename) {
  54326. return;
  54327. }
  54328. const buildDir = getAbsoluteBuildDir(outputTarget);
  54329. const originalPath = join(buildDir, config.fsNamespace + '.css');
  54330. const newPath = join(buildDir, globalScriptFilename);
  54331. if (originalPath === newPath) {
  54332. return;
  54333. }
  54334. const replacer = new RegExp(escapeRegExp(originalPath) + '$');
  54335. Array.from(doc.querySelectorAll('link')).forEach((link) => {
  54336. const href = link.getAttribute('href');
  54337. if (href) {
  54338. const newHref = href.replace(replacer, newPath);
  54339. if (newHref !== href) {
  54340. link.setAttribute('href', newHref);
  54341. }
  54342. }
  54343. });
  54344. };
  54345. const escapeRegExp = (text) => text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
  54346. const generateServiceWorkerUrl = (outputTarget, serviceWorker) => {
  54347. let swUrl = normalizePath$1(relative$1(outputTarget.appDir, serviceWorker.swDest));
  54348. if (swUrl.charAt(0) !== '/') {
  54349. swUrl = '/' + swUrl;
  54350. }
  54351. const baseUrl = new URL(outputTarget.baseUrl, 'http://config.stenciljs.com');
  54352. let basePath = baseUrl.pathname;
  54353. if (!basePath.endsWith('/')) {
  54354. basePath += '/';
  54355. }
  54356. swUrl = basePath + swUrl.substring(1);
  54357. return swUrl;
  54358. };
  54359. const updateIndexHtmlServiceWorker = async (config, buildCtx, doc, outputTarget) => {
  54360. const serviceWorker = outputTarget.serviceWorker;
  54361. if (serviceWorker !== false) {
  54362. if ((serviceWorker && serviceWorker.unregister) || (!serviceWorker && config.devMode)) {
  54363. injectUnregisterServiceWorker(doc);
  54364. }
  54365. else if (serviceWorker) {
  54366. await injectRegisterServiceWorker(buildCtx, outputTarget, doc);
  54367. }
  54368. }
  54369. };
  54370. const injectRegisterServiceWorker = async (buildCtx, outputTarget, doc) => {
  54371. const swUrl = generateServiceWorkerUrl(outputTarget, outputTarget.serviceWorker);
  54372. const serviceWorker = getRegisterSwScript(doc, buildCtx, swUrl);
  54373. doc.body.appendChild(serviceWorker);
  54374. };
  54375. const injectUnregisterServiceWorker = (doc) => {
  54376. const script = doc.createElement('script');
  54377. script.innerHTML = UNREGISTER_SW;
  54378. doc.body.appendChild(script);
  54379. };
  54380. const getRegisterSwScript = (doc, buildCtx, swUrl) => {
  54381. const script = doc.createElement('script');
  54382. script.setAttribute('data-build', `${buildCtx.timestamp}`);
  54383. script.innerHTML = getRegisterSW(swUrl);
  54384. return script;
  54385. };
  54386. const outputWww = async (config, compilerCtx, buildCtx) => {
  54387. const outputTargets = config.outputTargets.filter(isOutputTargetWww);
  54388. if (outputTargets.length === 0) {
  54389. return;
  54390. }
  54391. const timespan = buildCtx.createTimeSpan(`generate www started`, true);
  54392. const criticalBundles = getCriticalPath(buildCtx);
  54393. await Promise.all(outputTargets.map((outputTarget) => generateWww(config, compilerCtx, buildCtx, criticalBundles, outputTarget)));
  54394. timespan.finish(`generate www finished`);
  54395. };
  54396. const getCriticalPath = (buildCtx) => {
  54397. const componentGraph = buildCtx.componentGraph;
  54398. if (!buildCtx.indexDoc || !componentGraph) {
  54399. return [];
  54400. }
  54401. return unique(flatOne(getUsedComponents(buildCtx.indexDoc, buildCtx.components)
  54402. .map((tagName) => getScopeId(tagName))
  54403. .map((scopeId) => buildCtx.componentGraph.get(scopeId) || []))).sort();
  54404. };
  54405. const generateWww = async (config, compilerCtx, buildCtx, criticalPath, outputTarget) => {
  54406. if (!config.buildEs5) {
  54407. await generateEs5DisabledMessage(config, compilerCtx, outputTarget);
  54408. }
  54409. // Copy global styles into the build directory
  54410. // Process
  54411. if (buildCtx.indexDoc && outputTarget.indexHtml) {
  54412. await generateIndexHtml(config, compilerCtx, buildCtx, criticalPath, outputTarget);
  54413. }
  54414. await generateHostConfig(compilerCtx, outputTarget);
  54415. };
  54416. const generateHostConfig = (compilerCtx, outputTarget) => {
  54417. const buildDir = getAbsoluteBuildDir(outputTarget);
  54418. const hostConfigPath = join(outputTarget.appDir, 'host.config.json');
  54419. const hostConfigContent = JSON.stringify({
  54420. hosting: {
  54421. headers: [
  54422. {
  54423. source: join(buildDir, '/p-*'),
  54424. headers: [
  54425. {
  54426. key: 'Cache-Control',
  54427. value: 'max-age=31556952, s-maxage=31556952, immutable',
  54428. },
  54429. ],
  54430. },
  54431. ],
  54432. },
  54433. }, null, ' ');
  54434. return compilerCtx.fs.writeFile(hostConfigPath, hostConfigContent, { outputTargetType: outputTarget.type });
  54435. };
  54436. const generateIndexHtml = async (config, compilerCtx, buildCtx, criticalPath, outputTarget) => {
  54437. if (compilerCtx.hasSuccessfulBuild && !buildCtx.hasHtmlChanges) {
  54438. // no need to rebuild index.html if there were no app file changes
  54439. return;
  54440. }
  54441. // get the source index html content
  54442. try {
  54443. const doc = cloneDocument(buildCtx.indexDoc);
  54444. addScriptDataAttribute(config, doc, outputTarget);
  54445. // validateHtml(config, buildCtx, doc);
  54446. await updateIndexHtmlServiceWorker(config, buildCtx, doc, outputTarget);
  54447. if (!config.watch && !config.devMode) {
  54448. const globalStylesFilename = await generateHashedCopy(config, compilerCtx, join(outputTarget.buildDir, `${config.fsNamespace}.css`));
  54449. const scriptFound = await optimizeEsmImport(config, compilerCtx, doc, outputTarget);
  54450. await inlineStyleSheets(compilerCtx, doc, MAX_CSS_INLINE_SIZE, outputTarget);
  54451. updateGlobalStylesLink(config, doc, globalStylesFilename, outputTarget);
  54452. if (scriptFound) {
  54453. optimizeCriticalPath(doc, criticalPath, outputTarget);
  54454. }
  54455. }
  54456. const indexContent = serializeNodeToHtml(doc);
  54457. await compilerCtx.fs.writeFile(outputTarget.indexHtml, indexContent, { outputTargetType: outputTarget.type });
  54458. if (outputTarget.serviceWorker && config.flags.prerender) {
  54459. await compilerCtx.fs.writeFile(join(outputTarget.appDir, INDEX_ORG), indexContent, {
  54460. outputTargetType: outputTarget.type,
  54461. });
  54462. }
  54463. buildCtx.debug(`generateIndexHtml, write: ${relative$1(config.rootDir, outputTarget.indexHtml)}`);
  54464. }
  54465. catch (e) {
  54466. catchError(buildCtx.diagnostics, e);
  54467. }
  54468. };
  54469. const MAX_CSS_INLINE_SIZE = 3 * 1024;
  54470. const outputCollection = async (config, compilerCtx, buildCtx, changedModuleFiles) => {
  54471. const outputTargets = config.outputTargets.filter(isOutputTargetDistCollection);
  54472. if (outputTargets.length === 0) {
  54473. return;
  54474. }
  54475. const bundlingEventMessage = `generate collections${config.sourceMap ? ' + source maps' : ''}`;
  54476. const timespan = buildCtx.createTimeSpan(`${bundlingEventMessage} started`, true);
  54477. try {
  54478. await Promise.all(changedModuleFiles.map(async (mod) => {
  54479. let code = mod.staticSourceFileText;
  54480. if (config.preamble) {
  54481. code = `${generatePreamble(config)}\n${code}`;
  54482. }
  54483. const mapCode = mod.sourceMapFileText;
  54484. await Promise.all(outputTargets.map(async (o) => {
  54485. const relPath = relative$1(config.srcDir, mod.jsFilePath);
  54486. const filePath = join(o.collectionDir, relPath);
  54487. await compilerCtx.fs.writeFile(filePath, code, { outputTargetType: o.type });
  54488. if (mod.sourceMapPath) {
  54489. const relativeSourceMapPath = relative$1(config.srcDir, mod.sourceMapPath);
  54490. const sourceMapOutputFilePath = join(o.collectionDir, relativeSourceMapPath);
  54491. await compilerCtx.fs.writeFile(sourceMapOutputFilePath, mapCode, { outputTargetType: o.type });
  54492. }
  54493. }));
  54494. }));
  54495. await writeCollectionManifests(config, compilerCtx, buildCtx, outputTargets);
  54496. }
  54497. catch (e) {
  54498. catchError(buildCtx.diagnostics, e);
  54499. }
  54500. timespan.finish(`${bundlingEventMessage} finished`);
  54501. };
  54502. const writeCollectionManifests = async (config, compilerCtx, buildCtx, outputTargets) => {
  54503. const collectionData = JSON.stringify(serializeCollectionManifest(config, compilerCtx, buildCtx), null, 2);
  54504. return Promise.all(outputTargets.map((o) => writeCollectionManifest(compilerCtx, collectionData, o)));
  54505. };
  54506. // this maps the json data to our internal data structure
  54507. // apping is so that the internal data structure "could"
  54508. // change, but the external user data will always use the same api
  54509. // over the top lame mapping functions is basically so we can loosly
  54510. // couple core component meta data between specific versions of the compiler
  54511. const writeCollectionManifest = async (compilerCtx, collectionData, outputTarget) => {
  54512. // get the absolute path to the directory where the collection will be saved
  54513. const collectionDir = normalizePath$1(outputTarget.collectionDir);
  54514. // create an absolute file path to the actual collection json file
  54515. const collectionFilePath = normalizePath$1(join(collectionDir, COLLECTION_MANIFEST_FILE_NAME));
  54516. // don't bother serializing/writing the collection if we're not creating a distribution
  54517. await compilerCtx.fs.writeFile(collectionFilePath, collectionData);
  54518. };
  54519. const serializeCollectionManifest = (config, compilerCtx, buildCtx) => {
  54520. // create the single collection we're going to fill up with data
  54521. const collectionManifest = {
  54522. entries: buildCtx.moduleFiles
  54523. .filter((mod) => !mod.isCollectionDependency && mod.cmps.length > 0)
  54524. .map((mod) => relative$1(config.srcDir, mod.jsFilePath)),
  54525. compiler: {
  54526. name: '@stencil/core',
  54527. version: version$3,
  54528. typescriptVersion,
  54529. },
  54530. collections: serializeCollectionDependencies(compilerCtx),
  54531. bundles: config.bundles.map((b) => ({
  54532. components: b.components.slice().sort(),
  54533. })),
  54534. };
  54535. if (config.globalScript) {
  54536. const mod = compilerCtx.moduleMap.get(normalizePath$1(config.globalScript));
  54537. if (mod) {
  54538. collectionManifest.global = relative$1(config.srcDir, mod.jsFilePath);
  54539. }
  54540. }
  54541. return collectionManifest;
  54542. };
  54543. const serializeCollectionDependencies = (compilerCtx) => {
  54544. const collectionDeps = compilerCtx.collections.map((c) => ({
  54545. name: c.collectionName,
  54546. tags: flatOne(c.moduleFiles.map((m) => m.cmps))
  54547. .map((cmp) => cmp.tagName)
  54548. .sort(),
  54549. }));
  54550. return sortBy(collectionDeps, (item) => item.name);
  54551. };
  54552. /**
  54553. * Update a type declaration file's import declarations using the module `@stencil/core`
  54554. * @param typesDir the directory where type declaration files are expected to exist
  54555. * @param dtsFilePath the path of the type declaration file being updated, used to derive the correct import declaration
  54556. * module
  54557. * @param dtsContent the content of a type declaration file to update
  54558. * @returns the updated type declaration file contents
  54559. */
  54560. const updateStencilTypesImports = (typesDir, dtsFilePath, dtsContent) => {
  54561. const dir = dirname(dtsFilePath);
  54562. // determine the relative path between the directory of the .d.ts file and the types directory. this value may result
  54563. // in '.' if they are the same
  54564. const relPath = relative$1(dir, typesDir);
  54565. let coreDtsPath = join(relPath, CORE_FILENAME);
  54566. if (!coreDtsPath.startsWith('.')) {
  54567. coreDtsPath = `./${coreDtsPath}`;
  54568. }
  54569. coreDtsPath = normalizePath$1(coreDtsPath);
  54570. if (dtsContent.includes('@stencil/core')) {
  54571. dtsContent = dtsContent.replace(/(from\s*(:?'|"))@stencil\/core\/internal('|")/g, `$1${coreDtsPath}$2`);
  54572. dtsContent = dtsContent.replace(/(from\s*(:?'|"))@stencil\/core('|")/g, `$1${coreDtsPath}$2`);
  54573. }
  54574. return dtsContent;
  54575. };
  54576. /**
  54577. * Writes Stencil core typings file to disk for a dist-* output target
  54578. * @param config the Stencil configuration associated with the project being compiled
  54579. * @param compilerCtx the current compiler context
  54580. * @returns the results of writing one or more type declaration files to disk
  54581. */
  54582. const copyStencilCoreDts = async (config, compilerCtx) => {
  54583. const typesOutputTargets = config.outputTargets.filter(isOutputTargetDistTypes).filter((o) => o.typesDir);
  54584. const srcStencilDtsPath = join(config.sys.getCompilerExecutingPath(), '..', '..', 'internal', CORE_DTS);
  54585. const srcStencilCoreDts = await compilerCtx.fs.readFile(srcStencilDtsPath);
  54586. return Promise.all(typesOutputTargets.map((o) => {
  54587. const coreDtsFilePath = join(o.typesDir, CORE_DTS);
  54588. return compilerCtx.fs.writeFile(coreDtsFilePath, srcStencilCoreDts, { outputTargetType: o.type });
  54589. }));
  54590. };
  54591. const CORE_FILENAME = `stencil-public-runtime`;
  54592. const CORE_DTS = `${CORE_FILENAME}.d.ts`;
  54593. const COMPONENTS_DTS_HEADER = `/* eslint-disable */
  54594. /* tslint:disable */
  54595. /**
  54596. * This is an autogenerated file created by the Stencil compiler.
  54597. * It contains typing information for all components that exist in this project.
  54598. */`;
  54599. const sortImportNames = (a, b) => {
  54600. const aName = a.localName.toLowerCase();
  54601. const bName = b.localName.toLowerCase();
  54602. if (aName < bName)
  54603. return -1;
  54604. if (aName > bName)
  54605. return 1;
  54606. if (a.localName < b.localName)
  54607. return -1;
  54608. if (a.localName > b.localName)
  54609. return 1;
  54610. return 0;
  54611. };
  54612. /**
  54613. * Generates the individual event types for all @Event() decorated events in a component
  54614. * @param cmpMeta component runtime metadata for a single component
  54615. * @returns the generated type metadata
  54616. */
  54617. const generateEventTypes = (cmpMeta) => {
  54618. return cmpMeta.events.map((cmpEvent) => {
  54619. const name = `on${toTitleCase(cmpEvent.name)}`;
  54620. const type = cmpEvent.complexType.original
  54621. ? `(event: CustomEvent<${cmpEvent.complexType.original}>) => void`
  54622. : `CustomEvent`;
  54623. return {
  54624. name,
  54625. type,
  54626. optional: false,
  54627. required: false,
  54628. internal: cmpEvent.internal,
  54629. jsdoc: getTextDocs(cmpEvent.docs),
  54630. };
  54631. });
  54632. };
  54633. /**
  54634. * Generates the individual event types for all @Method() decorated events in a component
  54635. * @param cmpMeta component runtime metadata for a single component
  54636. * @returns the generated type metadata
  54637. */
  54638. const generateMethodTypes = (cmpMeta) => {
  54639. return cmpMeta.methods.map((cmpMethod) => ({
  54640. name: cmpMethod.name,
  54641. type: cmpMethod.complexType.signature,
  54642. optional: false,
  54643. required: false,
  54644. internal: cmpMethod.internal,
  54645. jsdoc: getTextDocs(cmpMethod.docs),
  54646. }));
  54647. };
  54648. /**
  54649. * Generates the individual event types for all @Prop() decorated events in a component
  54650. * @param cmpMeta component runtime metadata for a single component
  54651. * @returns the generated type metadata
  54652. */
  54653. const generatePropTypes = (cmpMeta) => {
  54654. return [
  54655. ...cmpMeta.properties.map((cmpProp) => ({
  54656. name: cmpProp.name,
  54657. type: cmpProp.complexType.original,
  54658. optional: cmpProp.optional,
  54659. required: cmpProp.required,
  54660. internal: cmpProp.internal,
  54661. jsdoc: getTextDocs(cmpProp.docs),
  54662. })),
  54663. ...cmpMeta.virtualProperties.map((cmpProp) => ({
  54664. name: cmpProp.name,
  54665. type: cmpProp.type,
  54666. optional: true,
  54667. required: false,
  54668. jsdoc: cmpProp.docs,
  54669. internal: false,
  54670. })),
  54671. ];
  54672. };
  54673. /**
  54674. * Generate a string based on the types that are defined within a component
  54675. * @param cmp the metadata for the component that a type definition string is generated for
  54676. * @param areTypesInternal `true` if types being generated are for a project's internal purposes, `false` otherwise
  54677. * @returns the generated types string alongside additional metadata
  54678. */
  54679. const generateComponentTypes = (cmp, areTypesInternal) => {
  54680. const tagName = cmp.tagName.toLowerCase();
  54681. const tagNameAsPascal = dashToPascalCase$1(tagName);
  54682. const htmlElementName = `HTML${tagNameAsPascal}Element`;
  54683. const propAttributes = generatePropTypes(cmp);
  54684. const methodAttributes = generateMethodTypes(cmp);
  54685. const eventAttributes = generateEventTypes(cmp);
  54686. const componentAttributes = attributesToMultiLineString([...propAttributes, ...methodAttributes], false, areTypesInternal);
  54687. const isDep = cmp.isCollectionDependency;
  54688. const jsxAttributes = attributesToMultiLineString([...propAttributes, ...eventAttributes], true, areTypesInternal);
  54689. const element = [
  54690. ` interface ${htmlElementName} extends Components.${tagNameAsPascal}, HTMLStencilElement {`,
  54691. ` }`,
  54692. ` var ${htmlElementName}: {`,
  54693. ` prototype: ${htmlElementName};`,
  54694. ` new (): ${htmlElementName};`,
  54695. ` };`,
  54696. ];
  54697. return {
  54698. isDep,
  54699. tagName,
  54700. tagNameAsPascal,
  54701. htmlElementName,
  54702. component: ` interface ${tagNameAsPascal} {\n${componentAttributes} }`,
  54703. jsx: ` interface ${tagNameAsPascal} {\n${jsxAttributes} }`,
  54704. element: element.join(`\n`),
  54705. };
  54706. };
  54707. const attributesToMultiLineString = (attributes, jsxAttributes, internal) => {
  54708. const attributesStr = sortBy(attributes, (a) => a.name)
  54709. .filter((type) => {
  54710. if (jsxAttributes && !internal && type.internal) {
  54711. return false;
  54712. }
  54713. return true;
  54714. })
  54715. .reduce((fullList, type) => {
  54716. if (type.jsdoc) {
  54717. fullList.push(` /**`);
  54718. fullList.push(...type.jsdoc.split('\n').map((line) => ' * ' + line));
  54719. fullList.push(` */`);
  54720. }
  54721. const optional = jsxAttributes ? !type.required : type.optional;
  54722. fullList.push(` "${type.name}"${optional ? '?' : ''}: ${type.type};`);
  54723. return fullList;
  54724. }, [])
  54725. .join(`\n`);
  54726. return attributesStr !== '' ? `${attributesStr}\n` : '';
  54727. };
  54728. /**
  54729. * Find all referenced types by a component and add them to the `importDataObj` parameter
  54730. * @param importDataObj key/value of type import file, each value is an array of imported types
  54731. * @param allTypes an output parameter containing a map of seen types and the number of times the type has been seen
  54732. * @param cmp the metadata associated with the component whose types are being inspected
  54733. * @param filePath the path of the component file
  54734. * @returns the updated import data
  54735. */
  54736. const updateReferenceTypeImports = (importDataObj, allTypes, cmp, filePath) => {
  54737. const updateImportReferences = updateImportReferenceFactory(allTypes, filePath);
  54738. return [...cmp.properties, ...cmp.events, ...cmp.methods]
  54739. .filter((cmpProp) => cmpProp.complexType && cmpProp.complexType.references)
  54740. .reduce((obj, cmpProp) => {
  54741. return updateImportReferences(obj, cmpProp.complexType.references);
  54742. }, importDataObj);
  54743. };
  54744. const updateImportReferenceFactory = (allTypes, filePath) => {
  54745. function getIncrementTypeName(name) {
  54746. const counter = allTypes.get(name);
  54747. if (counter === undefined) {
  54748. allTypes.set(name, 1);
  54749. return name;
  54750. }
  54751. allTypes.set(name, counter + 1);
  54752. return `${name}${counter}`;
  54753. }
  54754. return (obj, typeReferences) => {
  54755. Object.keys(typeReferences)
  54756. .map((typeName) => {
  54757. return [typeName, typeReferences[typeName]];
  54758. })
  54759. .forEach(([typeName, type]) => {
  54760. let importFileLocation;
  54761. // If global then there is no import statement needed
  54762. if (type.location === 'global') {
  54763. return;
  54764. // If local then import location is the current file
  54765. }
  54766. else if (type.location === 'local') {
  54767. importFileLocation = filePath;
  54768. }
  54769. else if (type.location === 'import') {
  54770. importFileLocation = type.path;
  54771. }
  54772. // If this is a relative path make it absolute
  54773. if (importFileLocation.startsWith('.')) {
  54774. importFileLocation = resolve$1(dirname(filePath), importFileLocation);
  54775. }
  54776. obj[importFileLocation] = obj[importFileLocation] || [];
  54777. // If this file already has a reference to this type move on
  54778. if (obj[importFileLocation].find((df) => df.localName === typeName)) {
  54779. return;
  54780. }
  54781. const newTypeName = getIncrementTypeName(typeName);
  54782. obj[importFileLocation].push({
  54783. localName: typeName,
  54784. importName: newTypeName,
  54785. });
  54786. });
  54787. return obj;
  54788. };
  54789. };
  54790. /**
  54791. * Generates and writes a `components.d.ts` file to disk. This file may be written to the `src` directory of a project,
  54792. * or be written to a directory that is meant to be distributed (e.g. the output directory of `dist-custom-elements`).
  54793. * @param config the Stencil configuration associated with the project being compiled
  54794. * @param compilerCtx the current compiler context
  54795. * @param buildCtx the context associated with the current build
  54796. * @param destination the relative directory in the filesystem to write the type declaration file to
  54797. * @returns `true` if the type declaration file written to disk has changed, `false` otherwise
  54798. */
  54799. const generateAppTypes = async (config, compilerCtx, buildCtx, destination) => {
  54800. // only gather components that are still root ts files we've found and have component metadata
  54801. // the compilerCtx cache may still have files that may have been deleted/renamed
  54802. const timespan = buildCtx.createTimeSpan(`generated app types started`, true);
  54803. const areTypesInternal = destination === 'src';
  54804. // Generate d.ts files for component types
  54805. let componentTypesFileContent = generateComponentTypesFile(config, buildCtx, areTypesInternal);
  54806. // immediately write the components.d.ts file to disk and put it into fs memory
  54807. let componentsDtsFilePath = getComponentsDtsSrcFilePath(config);
  54808. if (!areTypesInternal) {
  54809. componentsDtsFilePath = resolve$1(destination, GENERATED_DTS$1);
  54810. componentTypesFileContent = updateStencilTypesImports(destination, componentsDtsFilePath, componentTypesFileContent);
  54811. }
  54812. const writeResults = await compilerCtx.fs.writeFile(componentsDtsFilePath, componentTypesFileContent, {
  54813. immediateWrite: true,
  54814. });
  54815. const hasComponentsDtsChanged = writeResults.changedContent;
  54816. const componentsDtsRelFileName = relative$1(config.rootDir, componentsDtsFilePath);
  54817. if (hasComponentsDtsChanged) {
  54818. config.logger.debug(`generateAppTypes: ${componentsDtsRelFileName} has changed`);
  54819. }
  54820. timespan.finish(`generated app types finished: ${componentsDtsRelFileName}`);
  54821. return hasComponentsDtsChanged;
  54822. };
  54823. /**
  54824. * Generates a `component.d.ts` file's contents, which contains the typings for all components in a Stencil project
  54825. * @param config the Stencil configuration associated with the project being compiled
  54826. * @param buildCtx the context associated with the current build
  54827. * @param areTypesInternal determines if non-exported type definitions are being generated or not
  54828. * @returns the contents of the `components.d.ts` file
  54829. */
  54830. const generateComponentTypesFile = (config, buildCtx, areTypesInternal) => {
  54831. let typeImportData = {};
  54832. const c = [];
  54833. const allTypes = new Map();
  54834. const components = buildCtx.components.filter((m) => !m.isCollectionDependency);
  54835. const modules = components.map((cmp) => {
  54836. typeImportData = updateReferenceTypeImports(typeImportData, allTypes, cmp, cmp.sourceFilePath);
  54837. return generateComponentTypes(cmp, areTypesInternal);
  54838. });
  54839. c.push(COMPONENTS_DTS_HEADER);
  54840. c.push(`import { HTMLStencilElement, JSXBase } from "@stencil/core/internal";`);
  54841. c.push(...Object.keys(typeImportData).map((filePath) => {
  54842. const typeData = typeImportData[filePath];
  54843. let importFilePath;
  54844. if (isAbsolute$1(filePath)) {
  54845. importFilePath = normalizePath$1('./' + relative$1(config.srcDir, filePath)).replace(/\.(tsx|ts)$/, '');
  54846. }
  54847. else {
  54848. importFilePath = filePath;
  54849. }
  54850. return `import { ${typeData
  54851. .sort(sortImportNames)
  54852. .map((td) => {
  54853. if (td.localName === td.importName) {
  54854. return `${td.importName}`;
  54855. }
  54856. else {
  54857. return `${td.localName} as ${td.importName}`;
  54858. }
  54859. })
  54860. .join(`, `)} } from "${importFilePath}";`;
  54861. }));
  54862. c.push(`export namespace Components {\n${modules.map((m) => `${m.component}`).join('\n')}\n}`);
  54863. c.push(`declare global {`);
  54864. c.push(...modules.map((m) => m.element));
  54865. c.push(` interface HTMLElementTagNameMap {`);
  54866. c.push(...modules.map((m) => ` "${m.tagName}": ${m.htmlElementName};`));
  54867. c.push(` }`);
  54868. c.push(`}`);
  54869. c.push(`declare namespace LocalJSX {`);
  54870. c.push(...modules.map((m) => ` ${m.jsx}`));
  54871. c.push(` interface IntrinsicElements {`);
  54872. c.push(...modules.map((m) => ` "${m.tagName}": ${m.tagNameAsPascal};`));
  54873. c.push(` }`);
  54874. c.push(`}`);
  54875. c.push(`export { LocalJSX as JSX };`);
  54876. c.push(`declare module "@stencil/core" {`);
  54877. c.push(` export namespace JSX {`);
  54878. c.push(` interface IntrinsicElements {`);
  54879. c.push(...modules.map((m) => ` "${m.tagName}": LocalJSX.${m.tagNameAsPascal} & JSXBase.HTMLAttributes<${m.htmlElementName}>;`));
  54880. c.push(` }`);
  54881. c.push(` }`);
  54882. c.push(`}`);
  54883. return c.join(`\n`) + `\n`;
  54884. };
  54885. const generateCustomElementsBundleTypes = async (config, compilerCtx, buildCtx, distDtsFilePath) => {
  54886. const outputTargets = config.outputTargets.filter(isOutputTargetDistCustomElementsBundle);
  54887. await Promise.all(outputTargets.map((outputTarget) => generateCustomElementsTypesOutput$1(config, compilerCtx, buildCtx, distDtsFilePath, outputTarget)));
  54888. };
  54889. const generateCustomElementsTypesOutput$1 = async (config, compilerCtx, buildCtx, distDtsFilePath, outputTarget) => {
  54890. const customElementsDtsPath = join(outputTarget.dir, 'index.d.ts');
  54891. const componentsDtsRelPath = relDts$1(outputTarget.dir, distDtsFilePath);
  54892. const components = buildCtx.components.filter((m) => !m.isCollectionDependency);
  54893. const code = [
  54894. `/* ${config.namespace} custom elements bundle */`,
  54895. ``,
  54896. `import type { Components, JSX } from "${componentsDtsRelPath}";`,
  54897. ``,
  54898. ...components.map(generateCustomElementType$1),
  54899. `/**`,
  54900. ` * Utility to define all custom elements within this package using the tag name provided in the component's source. `,
  54901. ` * When defining each custom element, it will also check it's safe to define by:`,
  54902. ` *`,
  54903. ` * 1. Ensuring the "customElements" registry is available in the global context (window).`,
  54904. ` * 2. The component tag name is not already defined.`,
  54905. ` *`,
  54906. ` * Use the standard [customElements.define()](https://developer.mozilla.org/en-US/docs/Web/API/CustomElementRegistry/define) `,
  54907. ` * method instead to define custom elements individually, or to provide a different tag name.`,
  54908. ` */`,
  54909. `export declare const defineCustomElements: (opts?: any) => void;`,
  54910. ``,
  54911. `/**`,
  54912. ` * Used to manually set the base path where assets can be found.`,
  54913. ` * If the script is used as "module", it's recommended to use "import.meta.url",`,
  54914. ` * such as "setAssetPath(import.meta.url)". Other options include`,
  54915. ` * "setAssetPath(document.currentScript.src)", or using a bundler's replace plugin to`,
  54916. ` * dynamically set the path at build time, such as "setAssetPath(process.env.ASSET_PATH)".`,
  54917. ` * But do note that this configuration depends on how your script is bundled, or lack of`,
  54918. ` * bunding, and where your assets can be loaded from. Additionally custom bundling`,
  54919. ` * will have to ensure the static assets are copied to its build directory.`,
  54920. ` */`,
  54921. `export declare const setAssetPath: (path: string) => void;`,
  54922. ``,
  54923. `export interface SetPlatformOptions {`,
  54924. ` raf?: (c: FrameRequestCallback) => number;`,
  54925. ` ael?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;`,
  54926. ` rel?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;`,
  54927. ` ce?: (eventName: string, opts?: any) => CustomEvent;`,
  54928. `}`,
  54929. `export declare const setPlatformOptions: (opts: SetPlatformOptions) => void;`,
  54930. ``,
  54931. `export type { Components, JSX };`,
  54932. ``,
  54933. ];
  54934. const usersIndexJsPath = join(config.srcDir, 'index.ts');
  54935. const hasUserIndex = await compilerCtx.fs.access(usersIndexJsPath);
  54936. if (hasUserIndex) {
  54937. const userIndexRelPath = normalizePath$1(dirname(componentsDtsRelPath));
  54938. code.push(`export * from '${userIndexRelPath}';`);
  54939. }
  54940. else {
  54941. code.push(`export * from '${componentsDtsRelPath}';`);
  54942. }
  54943. await compilerCtx.fs.writeFile(customElementsDtsPath, code.join('\n') + `\n`, {
  54944. outputTargetType: outputTarget.type,
  54945. });
  54946. };
  54947. const generateCustomElementType$1 = (cmp) => {
  54948. const tagNameAsPascal = dashToPascalCase$1(cmp.tagName);
  54949. const o = [
  54950. `interface ${tagNameAsPascal} extends Components.${tagNameAsPascal}, HTMLElement {}`,
  54951. `export const ${tagNameAsPascal}: {`,
  54952. ` prototype: ${tagNameAsPascal};`,
  54953. ` new (): ${tagNameAsPascal};`,
  54954. `};`,
  54955. ``,
  54956. ];
  54957. return o.join('\n');
  54958. };
  54959. const relDts$1 = (fromPath, dtsPath) => {
  54960. dtsPath = relative$1(fromPath, dtsPath);
  54961. if (!dtsPath.startsWith('.')) {
  54962. dtsPath = '.' + dtsPath;
  54963. }
  54964. return normalizePath$1(dtsPath.replace('.d.ts', ''));
  54965. };
  54966. /**
  54967. * Entrypoint for generating types for one or more `dist-custom-elements` output targets defined in a Stencil project's
  54968. * configuration
  54969. * @param config the Stencil configuration associated with the project being compiled
  54970. * @param compilerCtx the current compiler context
  54971. * @param buildCtx the context associated with the current build
  54972. * @param distDtsFilePath the path to a type declaration file (.d.ts) that is being generated for the output target.
  54973. * This path is not necessarily the `components.d.ts` file that is found in the root of a project's `src` directory.
  54974. */
  54975. const generateCustomElementsTypes = async (config, compilerCtx, buildCtx, distDtsFilePath) => {
  54976. const outputTargets = config.outputTargets.filter(isOutputTargetDistCustomElements);
  54977. await Promise.all(outputTargets.map((outputTarget) => generateCustomElementsTypesOutput(config, compilerCtx, buildCtx, distDtsFilePath, outputTarget)));
  54978. };
  54979. /**
  54980. * Generates types for a single `dist-custom-elements` output target definition in a Stencil project's configuration
  54981. * @param config the Stencil configuration associated with the project being compiled
  54982. * @param compilerCtx the current compiler context
  54983. * @param buildCtx the context associated with the current build
  54984. * @param distDtsFilePath the path to a type declaration file (.d.ts) that is being generated for the output target.
  54985. * This path is not necessarily the `components.d.ts` file that is found in the root of a project's `src` directory.
  54986. * @param outputTarget the output target for which types are being currently generated
  54987. */
  54988. const generateCustomElementsTypesOutput = async (config, compilerCtx, buildCtx, distDtsFilePath, outputTarget) => {
  54989. const customElementsDtsPath = join(outputTarget.dir, 'index.d.ts');
  54990. const componentsDtsRelPath = relDts(outputTarget.dir, distDtsFilePath);
  54991. const code = [
  54992. `/* ${config.namespace} custom elements */`,
  54993. ``,
  54994. `import type { Components, JSX } from "${componentsDtsRelPath}";`,
  54995. ``,
  54996. `/**`,
  54997. ` * Used to manually set the base path where assets can be found.`,
  54998. ` * If the script is used as "module", it's recommended to use "import.meta.url",`,
  54999. ` * such as "setAssetPath(import.meta.url)". Other options include`,
  55000. ` * "setAssetPath(document.currentScript.src)", or using a bundler's replace plugin to`,
  55001. ` * dynamically set the path at build time, such as "setAssetPath(process.env.ASSET_PATH)".`,
  55002. ` * But do note that this configuration depends on how your script is bundled, or lack of`,
  55003. ` * bundling, and where your assets can be loaded from. Additionally custom bundling`,
  55004. ` * will have to ensure the static assets are copied to its build directory.`,
  55005. ` */`,
  55006. `export declare const setAssetPath: (path: string) => void;`,
  55007. ``,
  55008. `export interface SetPlatformOptions {`,
  55009. ` raf?: (c: FrameRequestCallback) => number;`,
  55010. ` ael?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;`,
  55011. ` rel?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;`,
  55012. `}`,
  55013. `export declare const setPlatformOptions: (opts: SetPlatformOptions) => void;`,
  55014. ``,
  55015. `export type { Components, JSX };`,
  55016. ``,
  55017. ];
  55018. const usersIndexJsPath = join(config.srcDir, 'index.ts');
  55019. const hasUserIndex = await compilerCtx.fs.access(usersIndexJsPath);
  55020. if (hasUserIndex) {
  55021. const userIndexRelPath = normalizePath$1(dirname(componentsDtsRelPath));
  55022. code.push(`export * from '${userIndexRelPath}';`);
  55023. }
  55024. else {
  55025. code.push(`export * from '${componentsDtsRelPath}';`);
  55026. }
  55027. await compilerCtx.fs.writeFile(customElementsDtsPath, code.join('\n') + `\n`, {
  55028. outputTargetType: outputTarget.type,
  55029. });
  55030. const components = buildCtx.components.filter((m) => !m.isCollectionDependency);
  55031. await Promise.all(components.map(async (cmp) => {
  55032. const dtsCode = generateCustomElementType(componentsDtsRelPath, cmp);
  55033. const fileName = `${cmp.tagName}.d.ts`;
  55034. const filePath = join(outputTarget.dir, fileName);
  55035. await compilerCtx.fs.writeFile(filePath, dtsCode, { outputTargetType: outputTarget.type });
  55036. }));
  55037. };
  55038. /**
  55039. * Generate a type declaration file for a specific Stencil component
  55040. * @param componentsDtsRelPath the path to a root type declaration file from which commonly used entities can be
  55041. * referenced from in the newly generated file
  55042. * @param cmp the component to generate the type declaration file for
  55043. * @returns the contents of the type declaration file for the provided `cmp`
  55044. */
  55045. const generateCustomElementType = (componentsDtsRelPath, cmp) => {
  55046. const tagNameAsPascal = dashToPascalCase$1(cmp.tagName);
  55047. const o = [
  55048. `import type { Components, JSX } from "${componentsDtsRelPath}";`,
  55049. ``,
  55050. `interface ${tagNameAsPascal} extends Components.${tagNameAsPascal}, HTMLElement {}`,
  55051. `export const ${tagNameAsPascal}: {`,
  55052. ` prototype: ${tagNameAsPascal};`,
  55053. ` new (): ${tagNameAsPascal};`,
  55054. `};`,
  55055. `/**`,
  55056. ` * Used to define this component and all nested components recursively.`,
  55057. ` */`,
  55058. `export const defineCustomElement: () => void;`,
  55059. ``,
  55060. ];
  55061. return o.join('\n');
  55062. };
  55063. /**
  55064. * Determines the relative path between two provided paths. If a type declaration file extension is present on
  55065. * `dtsPath`, it will be removed from the computed relative path.
  55066. * @param fromPath the path from which to start at
  55067. * @param dtsPath the destination path
  55068. * @returns the relative path from the provided `fromPath` to the `dtsPath`
  55069. */
  55070. const relDts = (fromPath, dtsPath) => {
  55071. dtsPath = relative$1(fromPath, dtsPath);
  55072. if (!dtsPath.startsWith('.')) {
  55073. dtsPath = '.' + dtsPath;
  55074. }
  55075. return normalizePath$1(dtsPath.replace('.d.ts', ''));
  55076. };
  55077. /**
  55078. * For a single output target, generate types, then copy the Stencil core type declaration file
  55079. * @param config the Stencil configuration associated with the project being compiled
  55080. * @param compilerCtx the current compiler context
  55081. * @param buildCtx the context associated with the current build
  55082. * @param outputTarget the output target to generate types for
  55083. */
  55084. const generateTypes = async (config, compilerCtx, buildCtx, outputTarget) => {
  55085. if (!buildCtx.hasError) {
  55086. await generateTypesOutput(config, compilerCtx, buildCtx, outputTarget);
  55087. await copyStencilCoreDts(config, compilerCtx);
  55088. }
  55089. };
  55090. /**
  55091. * Generate type definition files and write them to a dist directory
  55092. * @param config the Stencil configuration associated with the project being compiled
  55093. * @param compilerCtx the current compiler context
  55094. * @param buildCtx the context associated with the current build
  55095. * @param outputTarget the output target to generate types for
  55096. */
  55097. const generateTypesOutput = async (config, compilerCtx, buildCtx, outputTarget) => {
  55098. // get all type declaration files in a project's src/ directory
  55099. const srcDirItems = await compilerCtx.fs.readdir(config.srcDir, { recursive: false });
  55100. const srcDtsFiles = srcDirItems.filter((srcItem) => srcItem.isFile && isDtsFile$1(srcItem.absPath));
  55101. // Copy .d.ts files from src to dist
  55102. // In addition, all references to @stencil/core are replaced
  55103. let distDtsFilePath;
  55104. await Promise.all(srcDtsFiles.map(async (srcDtsFile) => {
  55105. const relPath = relative$1(config.srcDir, srcDtsFile.absPath);
  55106. const distPath = join(outputTarget.typesDir, relPath);
  55107. const originalDtsContent = await compilerCtx.fs.readFile(srcDtsFile.absPath);
  55108. const distDtsContent = updateStencilTypesImports(outputTarget.typesDir, distPath, originalDtsContent);
  55109. await compilerCtx.fs.writeFile(distPath, distDtsContent);
  55110. distDtsFilePath = distPath;
  55111. }));
  55112. const distPath = outputTarget.typesDir;
  55113. await generateAppTypes(config, compilerCtx, buildCtx, distPath);
  55114. if (distDtsFilePath) {
  55115. await generateCustomElementsTypes(config, compilerCtx, buildCtx, distDtsFilePath);
  55116. await generateCustomElementsBundleTypes(config, compilerCtx, buildCtx, distDtsFilePath);
  55117. }
  55118. };
  55119. /**
  55120. * Entrypoint for generating types for all output targets
  55121. * @param config the Stencil configuration associated with the project being compiled
  55122. * @param compilerCtx the current compiler context
  55123. * @param buildCtx the context associated with the current build
  55124. */
  55125. const outputTypes = async (config, compilerCtx, buildCtx) => {
  55126. const outputTargets = config.outputTargets.filter(isOutputTargetDistTypes);
  55127. if (outputTargets.length === 0) {
  55128. return;
  55129. }
  55130. const timespan = buildCtx.createTimeSpan(`generate types started`, true);
  55131. await Promise.all(outputTargets.map((outputsTarget) => generateTypes(config, compilerCtx, buildCtx, outputsTarget)));
  55132. timespan.finish(`generate types finished`);
  55133. };
  55134. const generateOutputTargets = async (config, compilerCtx, buildCtx) => {
  55135. const timeSpan = buildCtx.createTimeSpan('generate outputs started', true);
  55136. const changedModuleFiles = Array.from(compilerCtx.changedModules)
  55137. .map((filename) => compilerCtx.moduleMap.get(filename))
  55138. .filter((mod) => mod && !mod.isCollectionDependency);
  55139. compilerCtx.changedModules.clear();
  55140. invalidateRollupCaches(compilerCtx);
  55141. await Promise.all([
  55142. outputAngular(config, compilerCtx, buildCtx),
  55143. outputCopy(config, compilerCtx, buildCtx),
  55144. outputCollection(config, compilerCtx, buildCtx, changedModuleFiles),
  55145. outputCustomElements(config, compilerCtx, buildCtx),
  55146. outputCustomElementsBundle(config, compilerCtx, buildCtx),
  55147. outputHydrateScript(config, compilerCtx, buildCtx),
  55148. outputLazyLoader(config, compilerCtx),
  55149. outputLazy(config, compilerCtx, buildCtx),
  55150. outputWww(config, compilerCtx, buildCtx),
  55151. ]);
  55152. // must run after all the other outputs
  55153. // since it validates files were created
  55154. await outputDocs(config, compilerCtx, buildCtx);
  55155. await outputTypes(config, compilerCtx, buildCtx);
  55156. timeSpan.finish('generate outputs finished');
  55157. };
  55158. const invalidateRollupCaches = (compilerCtx) => {
  55159. const invalidatedIds = compilerCtx.changedFiles;
  55160. compilerCtx.rollupCache.forEach((cache) => {
  55161. cache.modules.forEach((mod) => {
  55162. if (mod.transformDependencies.some((id) => invalidatedIds.has(id))) {
  55163. mod.originalCode = null;
  55164. }
  55165. });
  55166. });
  55167. };
  55168. const getDeclarationParameters = (decorator) => {
  55169. if (!t.isCallExpression(decorator.expression)) {
  55170. return [];
  55171. }
  55172. return decorator.expression.arguments.map(getDeclarationParameter);
  55173. };
  55174. const getDeclarationParameter = (arg) => {
  55175. if (t.isObjectLiteralExpression(arg)) {
  55176. return objectLiteralToObjectMap(arg);
  55177. }
  55178. else if (t.isStringLiteral(arg)) {
  55179. return arg.text;
  55180. }
  55181. throw new Error(`invalid decorator argument: ${arg.getText()}`);
  55182. };
  55183. /**
  55184. * Returns a function that checks if a decorator:
  55185. * - is a call expression. these are decorators that are immediately followed by open/close parenthesis with optional
  55186. * arg(s), e.g. `@Prop()`
  55187. * - the name of the decorator matches the provided `propName`
  55188. *
  55189. * @param propName the name of the decorator to match against
  55190. * @returns true if the conditions above are both true, false otherwise
  55191. */
  55192. const isDecoratorNamed = (propName) => {
  55193. return (dec) => {
  55194. return t.isCallExpression(dec.expression) && dec.expression.expression.getText() === propName;
  55195. };
  55196. };
  55197. const styleToStatic = (newMembers, componentOptions) => {
  55198. const defaultModeStyles = [];
  55199. if (componentOptions.styleUrls) {
  55200. if (Array.isArray(componentOptions.styleUrls)) {
  55201. defaultModeStyles.push(...normalizeStyleUrl(componentOptions.styleUrls));
  55202. }
  55203. else {
  55204. defaultModeStyles.push(...normalizeStyleUrl(componentOptions.styleUrls[DEFAULT_STYLE_MODE]));
  55205. }
  55206. }
  55207. if (componentOptions.styleUrl) {
  55208. defaultModeStyles.push(...normalizeStyleUrl(componentOptions.styleUrl));
  55209. }
  55210. let styleUrls = {};
  55211. if (componentOptions.styleUrls && !Array.isArray(componentOptions.styleUrls)) {
  55212. styleUrls = normalizeStyleUrls(componentOptions.styleUrls);
  55213. }
  55214. if (defaultModeStyles.length > 0) {
  55215. styleUrls[DEFAULT_STYLE_MODE] = defaultModeStyles;
  55216. }
  55217. if (Object.keys(styleUrls).length > 0) {
  55218. const originalStyleUrls = convertValueToLiteral(styleUrls);
  55219. newMembers.push(createStaticGetter('originalStyleUrls', originalStyleUrls));
  55220. const norlizedStyleExt = normalizeExtension(styleUrls);
  55221. const normalizedStyleExp = convertValueToLiteral(norlizedStyleExt);
  55222. newMembers.push(createStaticGetter('styleUrls', normalizedStyleExp));
  55223. }
  55224. if (typeof componentOptions.styles === 'string') {
  55225. const styles = componentOptions.styles.trim();
  55226. if (styles.length > 0) {
  55227. // @Component({
  55228. // styles: ":host {...}"
  55229. // })
  55230. newMembers.push(createStaticGetter('styles', t.createLiteral(styles)));
  55231. }
  55232. }
  55233. else if (componentOptions.styles) {
  55234. const convertIdentifier = componentOptions.styles;
  55235. if (convertIdentifier.__identifier) {
  55236. // import styles from './styles.css';
  55237. // @Component({
  55238. // styles
  55239. // })
  55240. const stylesIdentifier = convertIdentifier.__escapedText;
  55241. newMembers.push(createStaticGetter('styles', t.createIdentifier(stylesIdentifier)));
  55242. }
  55243. else if (typeof convertIdentifier === 'object') {
  55244. // import ios from './ios.css';
  55245. // import md from './md.css';
  55246. // @Component({
  55247. // styles: {
  55248. // ios
  55249. // md
  55250. // }
  55251. // })
  55252. if (Object.keys(convertIdentifier).length > 0) {
  55253. newMembers.push(createStaticGetter('styles', convertValueToLiteral(convertIdentifier)));
  55254. }
  55255. }
  55256. }
  55257. };
  55258. const normalizeExtension = (styleUrls) => {
  55259. const compilerStyleUrls = {};
  55260. Object.keys(styleUrls).forEach((key) => {
  55261. compilerStyleUrls[key] = styleUrls[key].map((s) => useCss(s));
  55262. });
  55263. return compilerStyleUrls;
  55264. };
  55265. const useCss = (stylePath) => {
  55266. const sourceFileDir = dirname(stylePath);
  55267. const sourceFileExt = extname$1(stylePath);
  55268. const sourceFileName = basename(stylePath, sourceFileExt);
  55269. return join(sourceFileDir, sourceFileName + '.css');
  55270. };
  55271. const normalizeStyleUrls = (styleUrls) => {
  55272. const compilerStyleUrls = {};
  55273. Object.keys(styleUrls).forEach((key) => {
  55274. compilerStyleUrls[key] = normalizeStyleUrl(styleUrls[key]);
  55275. });
  55276. return compilerStyleUrls;
  55277. };
  55278. const normalizeStyleUrl = (style) => {
  55279. if (Array.isArray(style)) {
  55280. return style;
  55281. }
  55282. if (style) {
  55283. return [style];
  55284. }
  55285. return [];
  55286. };
  55287. const componentDecoratorToStatic = (config, typeChecker, diagnostics, cmpNode, newMembers, componentDecorator) => {
  55288. const [componentOptions] = getDeclarationParameters(componentDecorator);
  55289. if (!componentOptions) {
  55290. return;
  55291. }
  55292. if (!validateComponent(config, diagnostics, typeChecker, componentOptions, cmpNode, componentDecorator)) {
  55293. return;
  55294. }
  55295. newMembers.push(createStaticGetter('is', convertValueToLiteral(componentOptions.tag.trim())));
  55296. if (componentOptions.shadow) {
  55297. newMembers.push(createStaticGetter('encapsulation', convertValueToLiteral('shadow')));
  55298. if (typeof componentOptions.shadow !== 'boolean') {
  55299. if (componentOptions.shadow.delegatesFocus === true) {
  55300. newMembers.push(createStaticGetter('delegatesFocus', convertValueToLiteral(true)));
  55301. }
  55302. }
  55303. }
  55304. else if (componentOptions.scoped) {
  55305. newMembers.push(createStaticGetter('encapsulation', convertValueToLiteral('scoped')));
  55306. }
  55307. styleToStatic(newMembers, componentOptions);
  55308. const assetsDirs = componentOptions.assetsDirs || [];
  55309. if (isString$1(componentOptions.assetsDir)) {
  55310. assetsDirs.push(componentOptions.assetsDir);
  55311. const warn = buildWarn(diagnostics);
  55312. warn.messageText = `@Component option "assetsDir" should be renamed to "assetsDirs" and the value should be an array of strings.`;
  55313. augmentDiagnosticWithNode(warn, componentDecorator);
  55314. }
  55315. if (assetsDirs.length > 0) {
  55316. newMembers.push(createStaticGetter('assetsDirs', convertValueToLiteral(assetsDirs)));
  55317. }
  55318. };
  55319. const validateComponent = (config, diagnostics, typeChecker, componentOptions, cmpNode, componentDecorator) => {
  55320. const extendNode = cmpNode.heritageClauses && cmpNode.heritageClauses.find((c) => c.token === t.SyntaxKind.ExtendsKeyword);
  55321. if (extendNode) {
  55322. const err = buildError(diagnostics);
  55323. err.messageText = `Classes decorated with @Component can not extend from a base class.
  55324. Stencil needs to be able to switch between different base classes in order to implement the different output targets such as: lazy and raw web components.`;
  55325. augmentDiagnosticWithNode(err, extendNode);
  55326. return false;
  55327. }
  55328. if (componentOptions.shadow && componentOptions.scoped) {
  55329. const err = buildError(diagnostics);
  55330. err.messageText = `Components cannot be "scoped" and "shadow" at the same time, they are mutually exclusive configurations.`;
  55331. augmentDiagnosticWithNode(err, findTagNode('scoped', componentDecorator));
  55332. return false;
  55333. }
  55334. const constructor = cmpNode.members.find(t.isConstructorDeclaration);
  55335. if (constructor && constructor.parameters.length > 0) {
  55336. const err = buildError(diagnostics);
  55337. err.messageText = `Classes decorated with @Component can not have a "constructor" that takes arguments.
  55338. All data required by a component must be passed by using class properties decorated with @Prop()`;
  55339. augmentDiagnosticWithNode(err, constructor.parameters[0]);
  55340. return false;
  55341. }
  55342. // check if class has more than one decorator
  55343. const otherDecorator = cmpNode.decorators && cmpNode.decorators.find((d) => d !== componentDecorator);
  55344. if (otherDecorator) {
  55345. const err = buildError(diagnostics);
  55346. err.messageText = `Classes decorated with @Component can not be decorated with more decorators.
  55347. Stencil performs extensive static analysis on top of your components in order to generate the necessary metadata, runtime decorators at the components level make this task very hard.`;
  55348. augmentDiagnosticWithNode(err, otherDecorator);
  55349. return false;
  55350. }
  55351. const tag = componentOptions.tag;
  55352. if (typeof tag !== 'string' || tag.trim().length === 0) {
  55353. const err = buildError(diagnostics);
  55354. err.messageText = `tag missing in component decorator`;
  55355. augmentDiagnosticWithNode(err, componentDecorator);
  55356. return false;
  55357. }
  55358. const tagError = validateComponentTag(tag);
  55359. if (tagError) {
  55360. const err = buildError(diagnostics);
  55361. err.messageText = `${tagError}. Please refer to https://html.spec.whatwg.org/multipage/custom-elements.html#valid-custom-element-name for more info.`;
  55362. augmentDiagnosticWithNode(err, findTagNode('tag', componentDecorator));
  55363. return false;
  55364. }
  55365. if (!config._isTesting) {
  55366. const nonTypeExports = typeChecker
  55367. .getExportsOfModule(typeChecker.getSymbolAtLocation(cmpNode.getSourceFile()))
  55368. .filter((symbol) => (symbol.flags & (t.SymbolFlags.Interface | t.SymbolFlags.TypeAlias)) === 0)
  55369. .filter((symbol) => symbol.name !== cmpNode.name.text);
  55370. nonTypeExports.forEach((symbol) => {
  55371. const err = buildError(diagnostics);
  55372. err.messageText = `To allow efficient bundling, modules using @Component() can only have a single export which is the component class itself.
  55373. Any other exports should be moved to a separate file.
  55374. For further information check out: https://stenciljs.com/docs/module-bundling`;
  55375. const errorNode = symbol.valueDeclaration ? symbol.valueDeclaration : symbol.declarations[0];
  55376. augmentDiagnosticWithNode(err, errorNode);
  55377. });
  55378. if (nonTypeExports.length > 0) {
  55379. return false;
  55380. }
  55381. }
  55382. return true;
  55383. };
  55384. const findTagNode = (propName, node) => {
  55385. if (t.isDecorator(node) && t.isCallExpression(node.expression)) {
  55386. const arg = node.expression.arguments[0];
  55387. if (t.isObjectLiteralExpression(arg)) {
  55388. arg.properties.forEach((p) => {
  55389. if (t.isPropertyAssignment(p)) {
  55390. if (p.name.getText() === propName) {
  55391. node = p.initializer;
  55392. }
  55393. }
  55394. });
  55395. }
  55396. }
  55397. return node;
  55398. };
  55399. const elementDecoratorsToStatic = (diagnostics, decoratedMembers, typeChecker, newMembers) => {
  55400. const elementRefs = decoratedMembers
  55401. .filter(t.isPropertyDeclaration)
  55402. .map((prop) => parseElementDecorator(diagnostics, typeChecker, prop))
  55403. .filter((element) => !!element);
  55404. if (elementRefs.length > 0) {
  55405. newMembers.push(createStaticGetter('elementRef', t.createLiteral(elementRefs[0])));
  55406. if (elementRefs.length > 1) {
  55407. const error = buildError(diagnostics);
  55408. error.messageText = `It's not valid to add more than one Element() decorator`;
  55409. }
  55410. }
  55411. };
  55412. const parseElementDecorator = (_diagnostics, _typeChecker, prop) => {
  55413. const elementDecorator = prop.decorators && prop.decorators.find(isDecoratorNamed('Element'));
  55414. if (elementDecorator == null) {
  55415. return null;
  55416. }
  55417. return prop.name.getText();
  55418. };
  55419. const eventDecoratorsToStatic = (diagnostics, decoratedProps, typeChecker, newMembers) => {
  55420. const events = decoratedProps
  55421. .filter(t.isPropertyDeclaration)
  55422. .map((prop) => parseEventDecorator(diagnostics, typeChecker, prop))
  55423. .filter((ev) => !!ev);
  55424. if (events.length > 0) {
  55425. newMembers.push(createStaticGetter('events', convertValueToLiteral(events)));
  55426. }
  55427. };
  55428. const parseEventDecorator = (diagnostics, typeChecker, prop) => {
  55429. const eventDecorator = prop.decorators.find(isDecoratorNamed('Event'));
  55430. if (eventDecorator == null) {
  55431. return null;
  55432. }
  55433. const memberName = prop.name.getText();
  55434. if (!memberName) {
  55435. return null;
  55436. }
  55437. const [eventOpts] = getDeclarationParameters(eventDecorator);
  55438. const symbol = typeChecker.getSymbolAtLocation(prop.name);
  55439. const eventName = getEventName(eventOpts, memberName);
  55440. validateEventName(diagnostics, prop.name, eventName);
  55441. const eventMeta = {
  55442. method: memberName,
  55443. name: eventName,
  55444. bubbles: eventOpts && typeof eventOpts.bubbles === 'boolean' ? eventOpts.bubbles : true,
  55445. cancelable: eventOpts && typeof eventOpts.cancelable === 'boolean' ? eventOpts.cancelable : true,
  55446. composed: eventOpts && typeof eventOpts.composed === 'boolean' ? eventOpts.composed : true,
  55447. docs: serializeSymbol(typeChecker, symbol),
  55448. complexType: getComplexType$1(typeChecker, prop),
  55449. };
  55450. validateReferences(diagnostics, eventMeta.complexType.references, prop.type);
  55451. return eventMeta;
  55452. };
  55453. const getEventName = (eventOptions, memberName) => {
  55454. if (eventOptions && typeof eventOptions.eventName === 'string' && eventOptions.eventName.trim().length > 0) {
  55455. // always use the event name if given
  55456. return eventOptions.eventName.trim();
  55457. }
  55458. return memberName;
  55459. };
  55460. const getComplexType$1 = (typeChecker, node) => {
  55461. const sourceFile = node.getSourceFile();
  55462. const eventType = node.type ? getEventType(node.type) : null;
  55463. return {
  55464. original: eventType ? eventType.getText() : 'any',
  55465. resolved: eventType ? resolveType(typeChecker, typeChecker.getTypeFromTypeNode(eventType)) : 'any',
  55466. references: eventType ? getAttributeTypeInfo(eventType, sourceFile) : {},
  55467. };
  55468. };
  55469. const getEventType = (type) => {
  55470. if (t.isTypeReferenceNode(type) &&
  55471. t.isIdentifier(type.typeName) &&
  55472. type.typeName.text === 'EventEmitter' &&
  55473. type.typeArguments &&
  55474. type.typeArguments.length > 0) {
  55475. return type.typeArguments[0];
  55476. }
  55477. return null;
  55478. };
  55479. const validateEventName = (diagnostics, node, eventName) => {
  55480. if (/^[A-Z]/.test(eventName)) {
  55481. const diagnostic = buildWarn(diagnostics);
  55482. diagnostic.messageText = [
  55483. `In order to be compatible with all event listeners on elements, the event name `,
  55484. `cannot start with a capital letter. `,
  55485. `Please lowercase the first character for the event to best work with all listeners.`,
  55486. ].join('');
  55487. augmentDiagnosticWithNode(diagnostic, node);
  55488. return;
  55489. }
  55490. if (/^on[A-Z]/.test(eventName)) {
  55491. const warn = buildWarn(diagnostics);
  55492. const suggestedEventName = eventName[2].toLowerCase() + eventName.slice(3);
  55493. warn.messageText = `Events decorated with @Event() should describe the actual DOM event name, not the handler. In other words "${eventName}" would be better named as "${suggestedEventName}".`;
  55494. augmentDiagnosticWithNode(warn, node);
  55495. return;
  55496. }
  55497. if (DOM_EVENT_NAMES.has(eventName.toLowerCase())) {
  55498. const diagnostic = buildWarn(diagnostics);
  55499. diagnostic.messageText = `The event name conflicts with the "${eventName}" native DOM event name.`;
  55500. augmentDiagnosticWithNode(diagnostic, node);
  55501. return;
  55502. }
  55503. };
  55504. const DOM_EVENT_NAMES = new Set([
  55505. 'CheckboxStateChange',
  55506. 'DOMContentLoaded',
  55507. 'DOMMenuItemActive',
  55508. 'DOMMenuItemInactive',
  55509. 'DOMMouseScroll',
  55510. 'MSManipulationStateChanged',
  55511. 'MSPointerHover',
  55512. 'MozAudioAvailable',
  55513. 'MozGamepadButtonDown',
  55514. 'MozGamepadButtonUp',
  55515. 'MozMousePixelScroll',
  55516. 'MozOrientation',
  55517. 'MozScrolledAreaChanged',
  55518. 'RadioStateChange',
  55519. 'SVGAbort',
  55520. 'SVGError',
  55521. 'SVGLoad',
  55522. 'SVGResize',
  55523. 'SVGScroll',
  55524. 'SVGUnload',
  55525. 'SVGZoom',
  55526. 'abort',
  55527. 'afterprint',
  55528. 'afterscriptexecute',
  55529. 'alerting',
  55530. 'animationcancel',
  55531. 'animationend',
  55532. 'animationiteration',
  55533. 'animationstart',
  55534. 'appinstalled',
  55535. 'audioend',
  55536. 'audioprocess',
  55537. 'audiostart',
  55538. 'auxclick',
  55539. 'beforeinstallprompt',
  55540. 'beforeprint',
  55541. 'beforescriptexecute',
  55542. 'beforeunload',
  55543. 'beginEvent',
  55544. 'blur',
  55545. 'boundary',
  55546. 'broadcast',
  55547. 'busy',
  55548. 'callschanged',
  55549. 'canplay',
  55550. 'canplaythrough',
  55551. 'cardstatechange',
  55552. 'cfstatechange',
  55553. 'change',
  55554. 'chargingchange',
  55555. 'chargingtimechange',
  55556. 'checking',
  55557. 'click',
  55558. 'command',
  55559. 'commandupdate',
  55560. 'compassneedscalibration',
  55561. 'complete',
  55562. 'compositionend',
  55563. 'compositionstart',
  55564. 'compositionupdate',
  55565. 'connected',
  55566. 'connecting',
  55567. 'connectionInfoUpdate',
  55568. 'contextmenu',
  55569. 'copy',
  55570. 'cut',
  55571. 'datachange',
  55572. 'dataerror',
  55573. 'dblclick',
  55574. 'delivered',
  55575. 'devicechange',
  55576. 'devicemotion',
  55577. 'deviceorientation',
  55578. 'dialing',
  55579. 'disabled',
  55580. 'dischargingtimechange',
  55581. 'disconnected',
  55582. 'disconnecting',
  55583. 'downloading',
  55584. 'drag',
  55585. 'dragend',
  55586. 'dragenter',
  55587. 'dragleave',
  55588. 'dragover',
  55589. 'dragstart',
  55590. 'drop',
  55591. 'durationchange',
  55592. 'emptied',
  55593. 'enabled',
  55594. 'end',
  55595. 'endEvent',
  55596. 'ended',
  55597. 'error',
  55598. 'focus',
  55599. 'focusin',
  55600. 'focusout',
  55601. 'fullscreenchange',
  55602. 'fullscreenerror',
  55603. 'gamepadconnected',
  55604. 'gamepaddisconnected',
  55605. 'gotpointercapture',
  55606. 'hashchange',
  55607. 'held',
  55608. 'holding',
  55609. 'icccardlockerror',
  55610. 'iccinfochange',
  55611. 'incoming',
  55612. 'input',
  55613. 'invalid',
  55614. 'keydown',
  55615. 'keypress',
  55616. 'keyup',
  55617. 'languagechange',
  55618. 'levelchange',
  55619. 'load',
  55620. 'loadeddata',
  55621. 'loadedmetadata',
  55622. 'loadend',
  55623. 'loadstart',
  55624. 'localized',
  55625. 'lostpointercapture',
  55626. 'mark',
  55627. 'message',
  55628. 'messageerror',
  55629. 'mousedown',
  55630. 'mouseenter',
  55631. 'mouseleave',
  55632. 'mousemove',
  55633. 'mouseout',
  55634. 'mouseover',
  55635. 'mouseup',
  55636. 'mousewheel',
  55637. 'mozbrowseractivitydone',
  55638. 'mozbrowserasyncscroll',
  55639. 'mozbrowseraudioplaybackchange',
  55640. 'mozbrowsercaretstatechanged',
  55641. 'mozbrowserclose',
  55642. 'mozbrowsercontextmenu',
  55643. 'mozbrowserdocumentfirstpaint',
  55644. 'mozbrowsererror',
  55645. 'mozbrowserfindchange',
  55646. 'mozbrowserfirstpaint',
  55647. 'mozbrowsericonchange',
  55648. 'mozbrowserloadend',
  55649. 'mozbrowserloadstart',
  55650. 'mozbrowserlocationchange',
  55651. 'mozbrowsermanifestchange',
  55652. 'mozbrowsermetachange',
  55653. 'mozbrowseropensearch',
  55654. 'mozbrowseropentab',
  55655. 'mozbrowseropenwindow',
  55656. 'mozbrowserresize',
  55657. 'mozbrowserscroll',
  55658. 'mozbrowserscrollareachanged',
  55659. 'mozbrowserscrollviewchange',
  55660. 'mozbrowsersecuritychange',
  55661. 'mozbrowserselectionstatechanged',
  55662. 'mozbrowsershowmodalprompt',
  55663. 'mozbrowsertitlechange',
  55664. 'mozbrowserusernameandpasswordrequired',
  55665. 'mozbrowservisibilitychange',
  55666. 'moztimechange',
  55667. 'msContentZoom',
  55668. 'nomatch',
  55669. 'notificationclick',
  55670. 'noupdate',
  55671. 'obsolete',
  55672. 'offline',
  55673. 'online',
  55674. 'orientationchange',
  55675. 'overflow',
  55676. 'pagehide',
  55677. 'pageshow',
  55678. 'paste',
  55679. 'pause',
  55680. 'play',
  55681. 'playing',
  55682. 'pointercancel',
  55683. 'pointerdown',
  55684. 'pointerenter',
  55685. 'pointerleave',
  55686. 'pointerlockchange',
  55687. 'pointerlockerror',
  55688. 'pointermove',
  55689. 'pointerout',
  55690. 'pointerover',
  55691. 'pointerup',
  55692. 'popstate',
  55693. 'popuphidden',
  55694. 'popuphiding',
  55695. 'popupshowing',
  55696. 'popupshown',
  55697. 'progress',
  55698. 'push',
  55699. 'pushsubscriptionchange',
  55700. 'ratechange',
  55701. 'readystatechange',
  55702. 'received',
  55703. 'repeatEvent',
  55704. 'reset',
  55705. 'resize',
  55706. 'resourcetimingbufferfull',
  55707. 'result',
  55708. 'resume',
  55709. 'resuming',
  55710. 'scroll',
  55711. 'seeked',
  55712. 'seeking',
  55713. 'select',
  55714. 'selectionchange',
  55715. 'selectstart',
  55716. 'sent',
  55717. 'show',
  55718. 'slotchange',
  55719. 'smartcard-insert',
  55720. 'smartcard-remove',
  55721. 'soundend',
  55722. 'soundstart',
  55723. 'speechend',
  55724. 'speechstart',
  55725. 'stalled',
  55726. 'start',
  55727. 'statechange',
  55728. 'statuschange',
  55729. 'stkcommand',
  55730. 'stksessionend',
  55731. 'storage',
  55732. 'submit',
  55733. 'suspend',
  55734. 'timeout',
  55735. 'timeupdate',
  55736. 'touchcancel',
  55737. 'touchend',
  55738. 'touchenter',
  55739. 'touchleave',
  55740. 'touchmove',
  55741. 'touchstart',
  55742. 'transitioncancel',
  55743. 'transitionend',
  55744. 'transitionrun',
  55745. 'transitionstart',
  55746. 'underflow',
  55747. 'unload',
  55748. 'updateready',
  55749. 'userproximity',
  55750. 'ussdreceived',
  55751. 'visibilitychange',
  55752. 'voicechange',
  55753. 'voiceschanged',
  55754. 'volumechange',
  55755. 'vrdisplayactivate',
  55756. 'vrdisplayblur',
  55757. 'vrdisplayconnect',
  55758. 'vrdisplaydeactivate',
  55759. 'vrdisplaydisconnect',
  55760. 'vrdisplayfocus',
  55761. 'vrdisplaypresentchange',
  55762. 'waiting',
  55763. 'wheel',
  55764. ].map((e) => e.toLowerCase()));
  55765. const listenDecoratorsToStatic = (diagnostics, decoratedMembers, newMembers) => {
  55766. const listeners = decoratedMembers
  55767. .filter(t.isMethodDeclaration)
  55768. .map((method) => parseListenDecorators(diagnostics, method));
  55769. const flatListeners = flatOne(listeners);
  55770. if (flatListeners.length > 0) {
  55771. newMembers.push(createStaticGetter('listeners', convertValueToLiteral(flatListeners)));
  55772. }
  55773. };
  55774. const parseListenDecorators = (diagnostics, method) => {
  55775. const listenDecorators = method.decorators.filter(isDecoratorNamed('Listen'));
  55776. if (listenDecorators.length === 0) {
  55777. return [];
  55778. }
  55779. return listenDecorators.map((listenDecorator) => {
  55780. const methodName = method.name.getText();
  55781. const [listenText, listenOptions] = getDeclarationParameters(listenDecorator);
  55782. const eventNames = listenText.split(',');
  55783. if (eventNames.length > 1) {
  55784. const err = buildError(diagnostics);
  55785. err.messageText = 'Please use multiple @Listen() decorators instead of comma-separated names.';
  55786. augmentDiagnosticWithNode(err, listenDecorator);
  55787. }
  55788. const listener = parseListener(eventNames[0], listenOptions, methodName);
  55789. if (listener.target === 'parent') {
  55790. const err = buildError(diagnostics);
  55791. err.messageText =
  55792. 'The "parent" target is no longer available as of Stencil 2. Please use "window", "document" or "body" instead.';
  55793. augmentDiagnosticWithNode(err, listenDecorator);
  55794. }
  55795. return listener;
  55796. });
  55797. };
  55798. const parseListener = (eventName, opts = {}, methodName) => {
  55799. const rawEventName = eventName.trim();
  55800. const listener = {
  55801. name: rawEventName,
  55802. method: methodName,
  55803. target: opts.target,
  55804. capture: typeof opts.capture === 'boolean' ? opts.capture : false,
  55805. passive: typeof opts.passive === 'boolean'
  55806. ? opts.passive
  55807. : // if the event name is kown to be a passive event then set it to true
  55808. PASSIVE_TRUE_DEFAULTS.has(rawEventName.toLowerCase()),
  55809. };
  55810. return listener;
  55811. };
  55812. const PASSIVE_TRUE_DEFAULTS = new Set([
  55813. 'dragstart',
  55814. 'drag',
  55815. 'dragend',
  55816. 'dragenter',
  55817. 'dragover',
  55818. 'dragleave',
  55819. 'drop',
  55820. 'mouseenter',
  55821. 'mouseover',
  55822. 'mousemove',
  55823. 'mousedown',
  55824. 'mouseup',
  55825. 'mouseleave',
  55826. 'mouseout',
  55827. 'mousewheel',
  55828. 'pointerover',
  55829. 'pointerenter',
  55830. 'pointerdown',
  55831. 'pointermove',
  55832. 'pointerup',
  55833. 'pointercancel',
  55834. 'pointerout',
  55835. 'pointerleave',
  55836. 'resize',
  55837. 'scroll',
  55838. 'touchstart',
  55839. 'touchmove',
  55840. 'touchend',
  55841. 'touchenter',
  55842. 'touchleave',
  55843. 'touchcancel',
  55844. 'wheel',
  55845. ]);
  55846. /**
  55847. * Determine if a public class member collides with a reserved name for HTML elements, nodes, or JSX
  55848. * @param diagnostics a collection of compiler diagnostics. If a naming collision is found, a diagnostic detected must
  55849. * be added to this collection
  55850. * @param memberName the name of the class member to check for collision
  55851. * @param decorator the decorator associated with the class member, used in providing richer error diagnostics
  55852. * @param memberType a string representing the class member's type. e.g. 'prop'. Used in providing richer error
  55853. * diagnostics
  55854. * @param node the TypeScript AST node at which the class member is defined
  55855. */
  55856. const validatePublicName = (diagnostics, memberName, decorator, memberType, node) => {
  55857. if (RESERVED_PUBLIC_MEMBERS.has(memberName.toLowerCase())) {
  55858. const warn = buildWarn(diagnostics);
  55859. warn.messageText = [
  55860. `The ${decorator} name "${memberName}" is a reserved public name. `,
  55861. `Please rename the "${memberName}" ${memberType} so it does not conflict with an existing standardized prototype member. `,
  55862. `Reusing ${memberType} names that are already defined on the element's prototype may cause `,
  55863. `unexpected runtime errors or user-interface issues on various browsers, so it's best to avoid them entirely.`,
  55864. ].join('');
  55865. augmentDiagnosticWithNode(warn, node);
  55866. return;
  55867. }
  55868. };
  55869. const HTML_ELEMENT_KEYS = [
  55870. 'title',
  55871. 'lang',
  55872. 'translate',
  55873. 'dir',
  55874. // 'dataset',
  55875. // 'hidden',
  55876. 'tabIndex',
  55877. 'accessKey',
  55878. 'draggable',
  55879. // 'spellcheck',
  55880. // 'autocapitalize',
  55881. 'contentEditable',
  55882. 'isContentEditable',
  55883. // 'inputMode',
  55884. 'offsetParent',
  55885. 'offsetTop',
  55886. 'offsetLeft',
  55887. 'offsetWidth',
  55888. 'offsetHeight',
  55889. 'style',
  55890. 'innerText',
  55891. 'outerText',
  55892. 'oncopy',
  55893. 'oncut',
  55894. 'onpaste',
  55895. 'onabort',
  55896. 'onblur',
  55897. 'oncancel',
  55898. 'oncanplay',
  55899. 'oncanplaythrough',
  55900. 'onchange',
  55901. 'onclick',
  55902. 'onclose',
  55903. 'oncontextmenu',
  55904. 'oncuechange',
  55905. 'ondblclick',
  55906. 'ondrag',
  55907. 'ondragend',
  55908. 'ondragenter',
  55909. 'ondragleave',
  55910. 'ondragover',
  55911. 'ondragstart',
  55912. 'ondrop',
  55913. 'ondurationchange',
  55914. 'onemptied',
  55915. 'onended',
  55916. 'onerror',
  55917. 'onfocus',
  55918. 'onfocusin',
  55919. 'onfocusout',
  55920. 'oninput',
  55921. 'oninvalid',
  55922. 'onkeydown',
  55923. 'onkeypress',
  55924. 'onkeyup',
  55925. 'onload',
  55926. 'onloadeddata',
  55927. 'onloadedmetadata',
  55928. 'onloadstart',
  55929. 'onmousedown',
  55930. 'onmouseenter',
  55931. 'onmouseleave',
  55932. 'onmousemove',
  55933. 'onmouseout',
  55934. 'onmouseover',
  55935. 'onmouseup',
  55936. 'onmousewheel',
  55937. 'onpause',
  55938. 'onplay',
  55939. 'onplaying',
  55940. 'onprogress',
  55941. 'onratechange',
  55942. 'onreset',
  55943. 'onresize',
  55944. 'onscroll',
  55945. 'onseeked',
  55946. 'onseeking',
  55947. 'onselect',
  55948. 'onstalled',
  55949. 'onsubmit',
  55950. 'onsuspend',
  55951. 'ontimeupdate',
  55952. 'ontoggle',
  55953. 'onvolumechange',
  55954. 'onwaiting',
  55955. 'onwheel',
  55956. 'onauxclick',
  55957. 'ongotpointercapture',
  55958. 'onlostpointercapture',
  55959. 'onpointerdown',
  55960. 'onpointermove',
  55961. 'onpointerup',
  55962. 'onpointercancel',
  55963. 'onpointerover',
  55964. 'onpointerout',
  55965. 'onpointerenter',
  55966. 'onpointerleave',
  55967. 'onselectstart',
  55968. 'onselectionchange',
  55969. 'nonce',
  55970. 'click',
  55971. 'focus',
  55972. 'blur',
  55973. ];
  55974. const ELEMENT_KEYS = [
  55975. 'namespaceURI',
  55976. 'prefix',
  55977. 'localName',
  55978. 'tagName',
  55979. 'id',
  55980. 'className',
  55981. 'classList',
  55982. 'slot',
  55983. 'attributes',
  55984. 'shadowRoot',
  55985. 'assignedSlot',
  55986. 'innerHTML',
  55987. 'outerHTML',
  55988. 'scrollTop',
  55989. 'scrollLeft',
  55990. 'scrollWidth',
  55991. 'scrollHeight',
  55992. 'clientTop',
  55993. 'clientLeft',
  55994. 'clientWidth',
  55995. 'clientHeight',
  55996. 'attributeStyleMap',
  55997. 'onbeforecopy',
  55998. 'onbeforecut',
  55999. 'onbeforepaste',
  56000. 'onsearch',
  56001. 'previousElementSibling',
  56002. 'nextElementSibling',
  56003. 'children',
  56004. 'firstElementChild',
  56005. 'lastElementChild',
  56006. 'childElementCount',
  56007. 'onfullscreenchange',
  56008. 'onfullscreenerror',
  56009. 'onwebkitfullscreenchange',
  56010. 'onwebkitfullscreenerror',
  56011. 'setPointerCapture',
  56012. 'releasePointerCapture',
  56013. 'hasPointerCapture',
  56014. 'hasAttributes',
  56015. 'getAttributeNames',
  56016. 'getAttribute',
  56017. 'getAttributeNS',
  56018. 'setAttribute',
  56019. 'setAttributeNS',
  56020. 'removeAttribute',
  56021. 'removeAttributeNS',
  56022. 'hasAttribute',
  56023. 'hasAttributeNS',
  56024. 'toggleAttribute',
  56025. 'getAttributeNode',
  56026. 'getAttributeNodeNS',
  56027. 'setAttributeNode',
  56028. 'setAttributeNodeNS',
  56029. 'removeAttributeNode',
  56030. 'closest',
  56031. 'matches',
  56032. 'webkitMatchesSelector',
  56033. 'attachShadow',
  56034. 'getElementsByTagName',
  56035. 'getElementsByTagNameNS',
  56036. 'getElementsByClassName',
  56037. 'insertAdjacentElement',
  56038. 'insertAdjacentText',
  56039. 'insertAdjacentHTML',
  56040. 'requestPointerLock',
  56041. 'getClientRects',
  56042. 'getBoundingClientRect',
  56043. 'scrollIntoView',
  56044. 'scroll',
  56045. 'scrollTo',
  56046. 'scrollBy',
  56047. 'scrollIntoViewIfNeeded',
  56048. 'animate',
  56049. 'computedStyleMap',
  56050. 'before',
  56051. 'after',
  56052. 'replaceWith',
  56053. 'remove',
  56054. 'prepend',
  56055. 'append',
  56056. 'querySelector',
  56057. 'querySelectorAll',
  56058. 'requestFullscreen',
  56059. 'webkitRequestFullScreen',
  56060. 'webkitRequestFullscreen',
  56061. 'part',
  56062. 'createShadowRoot',
  56063. 'getDestinationInsertionPoints',
  56064. ];
  56065. const NODE_KEYS = [
  56066. 'ELEMENT_NODE',
  56067. 'ATTRIBUTE_NODE',
  56068. 'TEXT_NODE',
  56069. 'CDATA_SECTION_NODE',
  56070. 'ENTITY_REFERENCE_NODE',
  56071. 'ENTITY_NODE',
  56072. 'PROCESSING_INSTRUCTION_NODE',
  56073. 'COMMENT_NODE',
  56074. 'DOCUMENT_NODE',
  56075. 'DOCUMENT_TYPE_NODE',
  56076. 'DOCUMENT_FRAGMENT_NODE',
  56077. 'NOTATION_NODE',
  56078. 'DOCUMENT_POSITION_DISCONNECTED',
  56079. 'DOCUMENT_POSITION_PRECEDING',
  56080. 'DOCUMENT_POSITION_FOLLOWING',
  56081. 'DOCUMENT_POSITION_CONTAINS',
  56082. 'DOCUMENT_POSITION_CONTAINED_BY',
  56083. 'DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC',
  56084. 'nodeType',
  56085. 'nodeName',
  56086. 'baseURI',
  56087. 'isConnected',
  56088. 'ownerDocument',
  56089. 'parentNode',
  56090. 'parentElement',
  56091. 'childNodes',
  56092. 'firstChild',
  56093. 'lastChild',
  56094. 'previousSibling',
  56095. 'nextSibling',
  56096. 'nodeValue',
  56097. 'textContent',
  56098. 'hasChildNodes',
  56099. 'getRootNode',
  56100. 'normalize',
  56101. 'cloneNode',
  56102. 'isEqualNode',
  56103. 'isSameNode',
  56104. 'compareDocumentPosition',
  56105. 'contains',
  56106. 'lookupPrefix',
  56107. 'lookupNamespaceURI',
  56108. 'isDefaultNamespace',
  56109. 'insertBefore',
  56110. 'appendChild',
  56111. 'replaceChild',
  56112. 'removeChild',
  56113. ];
  56114. const JSX_KEYS = ['ref', 'key'];
  56115. const ALL_KEYS = [...HTML_ELEMENT_KEYS, ...ELEMENT_KEYS, ...NODE_KEYS, ...JSX_KEYS].map((p) => p.toLowerCase());
  56116. const RESERVED_PUBLIC_MEMBERS = new Set(ALL_KEYS);
  56117. const methodDecoratorsToStatic = (config, diagnostics, cmpNode, decoratedProps, typeChecker, newMembers) => {
  56118. const tsSourceFile = cmpNode.getSourceFile();
  56119. const methods = decoratedProps
  56120. .filter(t.isMethodDeclaration)
  56121. .map((method) => parseMethodDecorator(config, diagnostics, tsSourceFile, typeChecker, method))
  56122. .filter((method) => !!method);
  56123. if (methods.length > 0) {
  56124. newMembers.push(createStaticGetter('methods', t.createObjectLiteral(methods, true)));
  56125. }
  56126. };
  56127. const parseMethodDecorator = (config, diagnostics, tsSourceFile, typeChecker, method) => {
  56128. const methodDecorator = method.decorators.find(isDecoratorNamed('Method'));
  56129. if (methodDecorator == null) {
  56130. return null;
  56131. }
  56132. const methodName = method.name.getText();
  56133. const flags = t.TypeFormatFlags.WriteArrowStyleSignature | t.TypeFormatFlags.NoTruncation;
  56134. const signature = typeChecker.getSignatureFromDeclaration(method);
  56135. const returnType = typeChecker.getReturnTypeOfSignature(signature);
  56136. const returnTypeNode = typeChecker.typeToTypeNode(returnType, method, t.NodeBuilderFlags.NoTruncation | t.NodeBuilderFlags.NoTypeReduction);
  56137. let returnString = typeToString(typeChecker, returnType);
  56138. let signatureString = typeChecker.signatureToString(signature, method, flags, t.SignatureKind.Call);
  56139. if (!config._isTesting) {
  56140. if (returnString === 'void') {
  56141. const warn = buildWarn(diagnostics);
  56142. warn.header = '@Method requires async';
  56143. warn.messageText = `External @Method() ${methodName}() must return a Promise.\n\n Consider prefixing the method with async, such as @Method() async ${methodName}().`;
  56144. augmentDiagnosticWithNode(warn, method.name);
  56145. returnString = 'Promise<void>';
  56146. signatureString = signatureString.replace(/=> void$/, '=> Promise<void>');
  56147. }
  56148. else if (!isTypePromise(returnString)) {
  56149. const err = buildError(diagnostics);
  56150. err.header = '@Method requires async';
  56151. err.messageText = `External @Method() ${methodName}() must return a Promise.\n\n Consider prefixing the method with async, such as @Method() async ${methodName}().`;
  56152. augmentDiagnosticWithNode(err, method.name);
  56153. }
  56154. }
  56155. if (isMemberPrivate(method)) {
  56156. const err = buildError(diagnostics);
  56157. err.messageText =
  56158. 'Methods decorated with the @Method() decorator cannot be "private" nor "protected". More info: https://stenciljs.com/docs/methods';
  56159. augmentDiagnosticWithNode(err, method.modifiers[0]);
  56160. }
  56161. // Validate if the method name does not conflict with existing public names
  56162. validatePublicName(diagnostics, methodName, '@Method()', 'method', method.name);
  56163. const methodMeta = {
  56164. complexType: {
  56165. signature: signatureString,
  56166. parameters: signature.parameters.map((symbol) => serializeSymbol(typeChecker, symbol)),
  56167. references: {
  56168. ...getAttributeTypeInfo(returnTypeNode, tsSourceFile),
  56169. ...getAttributeTypeInfo(method, tsSourceFile),
  56170. },
  56171. return: returnString,
  56172. },
  56173. docs: {
  56174. text: t.displayPartsToString(signature.getDocumentationComment(typeChecker)),
  56175. tags: mapJSDocTagInfo(signature.getJsDocTags()),
  56176. },
  56177. };
  56178. validateReferences(diagnostics, methodMeta.complexType.references, method.type || method.name);
  56179. const staticProp = t.createPropertyAssignment(t.createLiteral(methodName), convertValueToLiteral(methodMeta));
  56180. return staticProp;
  56181. };
  56182. const isTypePromise = (typeStr) => {
  56183. return /^Promise<.+>$/.test(typeStr);
  56184. };
  56185. const validateMethods = (diagnostics, members) => {
  56186. members.filter(t.isMethodDeclaration).map((method) => {
  56187. if (method.name.getText() === 'componentDidUnload') {
  56188. const err = buildError(diagnostics);
  56189. err.header = `Replace "componentDidUnload()" with "disconnectedCallback()"`;
  56190. err.messageText = `The "componentDidUnload()" method was removed in Stencil 2. Please use the "disconnectedCallback()" method instead.`;
  56191. augmentDiagnosticWithNode(err, method.name);
  56192. }
  56193. });
  56194. };
  56195. /**
  56196. * Parse a collection of class members decorated with `@Prop()`
  56197. * @param diagnostics a collection of compiler diagnostics. During the parsing process, any errors detected must be
  56198. * added to this collection
  56199. * @param decoratedProps a collection of class elements that may or may not my class members decorated with `@Prop`.
  56200. * Only those decorated with `@Prop()` will be parsed.
  56201. * @param typeChecker a reference to the TypeScript type checker
  56202. * @param watchable a collection of class members that can be watched for changes using Stencil's `@Watch` decorator
  56203. * @param newMembers a collection that parsed `@Prop` annotated class members should be pushed to as a side effect of
  56204. * calling this function
  56205. */
  56206. const propDecoratorsToStatic = (diagnostics, decoratedProps, typeChecker, watchable, newMembers) => {
  56207. const properties = decoratedProps
  56208. .filter(t.isPropertyDeclaration)
  56209. .map((prop) => parsePropDecorator(diagnostics, typeChecker, prop, watchable))
  56210. .filter((prop) => prop != null);
  56211. if (properties.length > 0) {
  56212. newMembers.push(createStaticGetter('properties', t.createObjectLiteral(properties, true)));
  56213. }
  56214. };
  56215. /**
  56216. * Parse a single `@Prop` decorator annotated class member
  56217. * @param diagnostics a collection of compiler diagnostics. During the parsing process, any errors detected must be
  56218. * added to this collection
  56219. * @param typeChecker a reference to the TypeScript type checker
  56220. * @param prop the TypeScript `PropertyDeclaration` to parse
  56221. * @param watchable a collection of class members that can be watched for changes using Stencil's `@Watch` decorator
  56222. * @returns a property assignment expression to be added to the Stencil component's class
  56223. */
  56224. const parsePropDecorator = (diagnostics, typeChecker, prop, watchable) => {
  56225. const propDecorator = prop.decorators.find(isDecoratorNamed('Prop'));
  56226. if (propDecorator == null) {
  56227. return null;
  56228. }
  56229. const decoratorParams = getDeclarationParameters(propDecorator);
  56230. const propOptions = decoratorParams[0] || {};
  56231. const propName = prop.name.getText();
  56232. if (isMemberPrivate(prop)) {
  56233. const err = buildError(diagnostics);
  56234. err.messageText =
  56235. 'Properties decorated with the @Prop() decorator cannot be "private" nor "protected". More info: https://stenciljs.com/docs/properties';
  56236. augmentDiagnosticWithNode(err, prop.modifiers[0]);
  56237. }
  56238. if (/^on(-|[A-Z])/.test(propName)) {
  56239. const warn = buildWarn(diagnostics);
  56240. warn.messageText = `The @Prop() name "${propName}" looks like an event. Please use the "@Event()" decorator to expose events instead, not properties or methods.`;
  56241. augmentDiagnosticWithNode(warn, prop.name);
  56242. }
  56243. else {
  56244. validatePublicName(diagnostics, propName, '@Prop()', 'prop', prop.name);
  56245. }
  56246. const symbol = typeChecker.getSymbolAtLocation(prop.name);
  56247. const type = typeChecker.getTypeAtLocation(prop);
  56248. const typeStr = propTypeFromTSType(type);
  56249. const propMeta = {
  56250. type: typeStr,
  56251. mutable: !!propOptions.mutable,
  56252. complexType: getComplexType(typeChecker, prop, type),
  56253. required: prop.exclamationToken !== undefined && propName !== 'mode',
  56254. optional: prop.questionToken !== undefined,
  56255. docs: serializeSymbol(typeChecker, symbol),
  56256. };
  56257. validateReferences(diagnostics, propMeta.complexType.references, prop.type);
  56258. // prop can have an attribute if type is NOT "unknown"
  56259. if (typeStr !== 'unknown') {
  56260. propMeta.attribute = getAttributeName(propName, propOptions);
  56261. propMeta.reflect = getReflect(diagnostics, propDecorator, propOptions);
  56262. }
  56263. // extract default value
  56264. const initializer = prop.initializer;
  56265. if (initializer) {
  56266. propMeta.defaultValue = initializer.getText();
  56267. }
  56268. const staticProp = t.createPropertyAssignment(t.createLiteral(propName), convertValueToLiteral(propMeta));
  56269. watchable.add(propName);
  56270. return staticProp;
  56271. };
  56272. /**
  56273. * Format the attribute name provided as an argument to `@Prop({attribute: ''}`
  56274. * @param propName the prop's name, used as a fallback value
  56275. * @param propOptions the options passed in to the `@Prop` call expression
  56276. * @returns the formatted attribute name
  56277. */
  56278. const getAttributeName = (propName, propOptions) => {
  56279. if (propOptions.attribute === null) {
  56280. return undefined;
  56281. }
  56282. if (typeof propOptions.attribute === 'string' && propOptions.attribute.trim().length > 0) {
  56283. return propOptions.attribute.trim().toLowerCase();
  56284. }
  56285. return toDashCase(propName);
  56286. };
  56287. /**
  56288. * Determines if the 'reflect' property should be applied to the class member decorated with `@Prop`
  56289. * @param diagnostics a collection of compiler diagnostics. Any errors detected with setting 'reflect' must be added to
  56290. * this collection
  56291. * @param propDecorator the AST containing the Prop decorator
  56292. * @param propOptions the options passed in to the `@Prop` call expression
  56293. * @returns `true` if the prop should be reflected in the DOM, `false` otherwise
  56294. */
  56295. const getReflect = (diagnostics, propDecorator, propOptions) => {
  56296. if (typeof propOptions.reflect === 'boolean') {
  56297. return propOptions.reflect;
  56298. }
  56299. if (typeof propOptions.reflectToAttr === 'boolean') {
  56300. const err = buildError(diagnostics);
  56301. err.header = `Rename "reflectToAttr" to "reflect"`;
  56302. err.messageText = `@Prop option "reflectToAttr" should be renamed to "reflect".`;
  56303. augmentDiagnosticWithNode(err, propDecorator);
  56304. return propOptions.reflectToAttr;
  56305. }
  56306. return false;
  56307. };
  56308. const getComplexType = (typeChecker, node, type) => {
  56309. const nodeType = node.type;
  56310. return {
  56311. original: nodeType ? nodeType.getText() : typeToString(typeChecker, type),
  56312. resolved: resolveType(typeChecker, type),
  56313. references: getAttributeTypeInfo(node, node.getSourceFile()),
  56314. };
  56315. };
  56316. /**
  56317. * Derives a Stencil-permitted prop type from the TypeScript compiler's output. This function may narrow the type of a
  56318. * prop, as the types that can be returned from the TypeScript compiler may be more complex than what Stencil can/should
  56319. * handle for props.
  56320. * @param type the prop type to narrow
  56321. * @returns a valid Stencil prop type
  56322. */
  56323. const propTypeFromTSType = (type) => {
  56324. const isAnyType = checkType(type, isAny);
  56325. if (isAnyType) {
  56326. return 'any';
  56327. }
  56328. const isStr = checkType(type, isString);
  56329. const isNu = checkType(type, isNumber);
  56330. const isBool = checkType(type, isBoolean);
  56331. // if type is more than a primitive type at the same time, we mark it as any
  56332. if (Number(isStr) + Number(isNu) + Number(isBool) > 1) {
  56333. return 'any';
  56334. }
  56335. // at this point we know the prop's type is NOT the mix of primitive types
  56336. if (isStr) {
  56337. return 'string';
  56338. }
  56339. if (isNu) {
  56340. return 'number';
  56341. }
  56342. if (isBool) {
  56343. return 'boolean';
  56344. }
  56345. return 'unknown';
  56346. };
  56347. /**
  56348. * Determines if a TypeScript compiler given `Type` is of a particular type according to the provided `check` parameter.
  56349. * Union types (e.g. `boolean | number | string`) will be evaluated one type at a time.
  56350. * @param type the TypeScript `Type` entity to evaluate
  56351. * @param check a function that takes a TypeScript `Type` as its only argument and returns `true` if the `Type` conforms
  56352. * to a particular type
  56353. * @returns the result of the `check` argument. The result of `check` is `true` for one or more types in a union type,
  56354. * return `true`.
  56355. */
  56356. const checkType = (type, check) => {
  56357. if (type.flags & t.TypeFlags.Union) {
  56358. // if the type is a union, check each type in the union
  56359. const union = type;
  56360. if (union.types.some((type) => checkType(type, check))) {
  56361. return true;
  56362. }
  56363. }
  56364. return check(type);
  56365. };
  56366. /**
  56367. * Determine if a TypeScript compiler `Type` is a boolean
  56368. * @param t the `Type` to evaluate
  56369. * @returns `true` if the `Type` has any boolean-similar flags, `false` otherwise
  56370. */
  56371. const isBoolean = (t$1) => {
  56372. if (t$1) {
  56373. return !!(t$1.flags & (t.TypeFlags.Boolean | t.TypeFlags.BooleanLike));
  56374. }
  56375. return false;
  56376. };
  56377. /**
  56378. * Determine if a TypeScript compiler `Type` is a number
  56379. * @param t the `Type` to evaluate
  56380. * @returns `true` if the `Type` has any number-similar flags, `false` otherwise
  56381. */
  56382. const isNumber = (t$1) => {
  56383. if (t$1) {
  56384. return !!(t$1.flags & (t.TypeFlags.Number | t.TypeFlags.NumberLike | t.TypeFlags.NumberLiteral));
  56385. }
  56386. return false;
  56387. };
  56388. /**
  56389. * Determine if a TypeScript compiler `Type` is a string
  56390. * @param t the `Type` to evaluate
  56391. * @returns `true` if the `Type` has any string-similar flags, `false` otherwise
  56392. */
  56393. const isString = (t$1) => {
  56394. if (t$1) {
  56395. return !!(t$1.flags & (t.TypeFlags.String | t.TypeFlags.StringLike | t.TypeFlags.StringLiteral));
  56396. }
  56397. return false;
  56398. };
  56399. /**
  56400. * Determine if a TypeScript compiler `Type` is of type any
  56401. * @param t the `Type` to evaluate
  56402. * @returns `true` if the `Type` has the `Any` flag set on it, `false` otherwise
  56403. */
  56404. const isAny = (t$1) => {
  56405. if (t$1) {
  56406. return !!(t$1.flags & t.TypeFlags.Any);
  56407. }
  56408. return false;
  56409. };
  56410. const stateDecoratorsToStatic = (decoratedProps, watchable, newMembers) => {
  56411. const states = decoratedProps
  56412. .filter(t.isPropertyDeclaration)
  56413. .map((prop) => stateDecoratorToStatic(prop, watchable))
  56414. .filter((state) => !!state);
  56415. if (states.length > 0) {
  56416. newMembers.push(createStaticGetter('states', t.createObjectLiteral(states, true)));
  56417. }
  56418. };
  56419. const stateDecoratorToStatic = (prop, watchable) => {
  56420. const stateDecorator = prop.decorators.find(isDecoratorNamed('State'));
  56421. if (stateDecorator == null) {
  56422. return null;
  56423. }
  56424. const stateName = prop.name.getText();
  56425. watchable.add(stateName);
  56426. return t.createPropertyAssignment(t.createLiteral(stateName), t.createObjectLiteral([], true));
  56427. };
  56428. const watchDecoratorsToStatic = (config, diagnostics, decoratedProps, watchable, newMembers) => {
  56429. const watchers = decoratedProps
  56430. .filter(t.isMethodDeclaration)
  56431. .map((method) => parseWatchDecorator(config, diagnostics, watchable, method));
  56432. const flatWatchers = flatOne(watchers);
  56433. if (flatWatchers.length > 0) {
  56434. newMembers.push(createStaticGetter('watchers', convertValueToLiteral(flatWatchers)));
  56435. }
  56436. };
  56437. const parseWatchDecorator = (config, diagnostics, watchable, method) => {
  56438. const methodName = method.name.getText();
  56439. return method.decorators.filter(isDecoratorNamed('Watch')).map((decorator) => {
  56440. const [propName] = getDeclarationParameters(decorator);
  56441. if (!watchable.has(propName)) {
  56442. const diagnostic = config.devMode ? buildWarn(diagnostics) : buildError(diagnostics);
  56443. diagnostic.messageText = `@Watch('${propName}') is trying to watch for changes in a property that does not exist.
  56444. Make sure only properties decorated with @State() or @Prop() are watched.`;
  56445. augmentDiagnosticWithNode(diagnostic, decorator);
  56446. }
  56447. return {
  56448. propName,
  56449. methodName,
  56450. };
  56451. });
  56452. };
  56453. const convertDecoratorsToStatic = (config, diagnostics, typeChecker) => {
  56454. return (transformCtx) => {
  56455. const visit = (node) => {
  56456. if (t.isClassDeclaration(node)) {
  56457. return visitClassDeclaration(config, diagnostics, typeChecker, node);
  56458. }
  56459. return t.visitEachChild(node, visit, transformCtx);
  56460. };
  56461. return (tsSourceFile) => {
  56462. return t.visitEachChild(tsSourceFile, visit, transformCtx);
  56463. };
  56464. };
  56465. };
  56466. const visitClassDeclaration = (config, diagnostics, typeChecker, classNode) => {
  56467. if (!classNode.decorators) {
  56468. return classNode;
  56469. }
  56470. const componentDecorator = classNode.decorators.find(isDecoratorNamed('Component'));
  56471. if (!componentDecorator) {
  56472. return classNode;
  56473. }
  56474. const classMembers = classNode.members;
  56475. const decoratedMembers = classMembers.filter((member) => Array.isArray(member.decorators) && member.decorators.length > 0);
  56476. const newMembers = removeStencilDecorators(Array.from(classMembers));
  56477. // parser component decorator (Component)
  56478. componentDecoratorToStatic(config, typeChecker, diagnostics, classNode, newMembers, componentDecorator);
  56479. // stores a reference to fields that should be watched for changes
  56480. const watchable = new Set();
  56481. // parse member decorators (Prop, State, Listen, Event, Method, Element and Watch)
  56482. if (decoratedMembers.length > 0) {
  56483. propDecoratorsToStatic(diagnostics, decoratedMembers, typeChecker, watchable, newMembers);
  56484. stateDecoratorsToStatic(decoratedMembers, watchable, newMembers);
  56485. eventDecoratorsToStatic(diagnostics, decoratedMembers, typeChecker, newMembers);
  56486. methodDecoratorsToStatic(config, diagnostics, classNode, decoratedMembers, typeChecker, newMembers);
  56487. elementDecoratorsToStatic(diagnostics, decoratedMembers, typeChecker, newMembers);
  56488. watchDecoratorsToStatic(config, diagnostics, decoratedMembers, watchable, newMembers);
  56489. listenDecoratorsToStatic(diagnostics, decoratedMembers, newMembers);
  56490. }
  56491. validateMethods(diagnostics, classMembers);
  56492. return t.updateClassDeclaration(classNode, removeDecorators(classNode, CLASS_DECORATORS_TO_REMOVE), classNode.modifiers, classNode.name, classNode.typeParameters, classNode.heritageClauses, newMembers);
  56493. };
  56494. const removeStencilDecorators = (classMembers) => {
  56495. return classMembers.map((m) => {
  56496. const currentDecorators = m.decorators;
  56497. const newDecorators = removeDecorators(m, MEMBER_DECORATORS_TO_REMOVE);
  56498. if (currentDecorators !== newDecorators) {
  56499. if (t.isMethodDeclaration(m)) {
  56500. return t.updateMethod(m, newDecorators, m.modifiers, m.asteriskToken, m.name, m.questionToken, m.typeParameters, m.parameters, m.type, m.body);
  56501. }
  56502. else if (t.isPropertyDeclaration(m)) {
  56503. return t.updateProperty(m, newDecorators, m.modifiers, m.name, m.questionToken, m.type, m.initializer);
  56504. }
  56505. else {
  56506. console.log('unknown class node');
  56507. }
  56508. }
  56509. return m;
  56510. });
  56511. };
  56512. const removeDecorators = (node, decoratorNames) => {
  56513. if (node.decorators) {
  56514. const updatedDecoratorList = node.decorators.filter((dec) => {
  56515. const name = t.isCallExpression(dec.expression) &&
  56516. t.isIdentifier(dec.expression.expression) &&
  56517. dec.expression.expression.text;
  56518. return !decoratorNames.has(name);
  56519. });
  56520. if (updatedDecoratorList.length === 0) {
  56521. return undefined;
  56522. }
  56523. else if (updatedDecoratorList.length !== node.decorators.length) {
  56524. return t.createNodeArray(updatedDecoratorList);
  56525. }
  56526. }
  56527. return node.decorators;
  56528. };
  56529. function resolveComponentDependencies(cmps) {
  56530. computeDependencies(cmps);
  56531. computeDependents(cmps);
  56532. }
  56533. function computeDependencies(cmps) {
  56534. const visited = new Set();
  56535. cmps.forEach((cmp) => {
  56536. resolveTransitiveDependencies(cmp, cmps, visited);
  56537. cmp.dependencies = unique(cmp.dependencies).sort();
  56538. });
  56539. }
  56540. function computeDependents(cmps) {
  56541. cmps.forEach((cmp) => {
  56542. resolveTransitiveDependents(cmp, cmps);
  56543. });
  56544. }
  56545. function resolveTransitiveDependencies(cmp, cmps, visited) {
  56546. if (visited.has(cmp)) {
  56547. return cmp.dependencies;
  56548. }
  56549. visited.add(cmp);
  56550. const dependencies = unique(cmp.potentialCmpRefs.filter((tagName) => cmps.some((c) => c.tagName === tagName)));
  56551. cmp.dependencies = cmp.directDependencies = dependencies;
  56552. const transitiveDeps = flatOne(dependencies
  56553. .map((tagName) => cmps.find((c) => c.tagName === tagName))
  56554. .map((c) => resolveTransitiveDependencies(c, cmps, visited)));
  56555. return (cmp.dependencies = [...dependencies, ...transitiveDeps]);
  56556. }
  56557. function resolveTransitiveDependents(cmp, cmps) {
  56558. cmp.dependents = cmps
  56559. .filter((c) => c.dependencies.includes(cmp.tagName))
  56560. .map((c) => c.tagName)
  56561. .sort();
  56562. cmp.directDependents = cmps
  56563. .filter((c) => c.directDependencies.includes(cmp.tagName))
  56564. .map((c) => c.tagName)
  56565. .sort();
  56566. }
  56567. const gatherVdomMeta = (m, args) => {
  56568. m.hasVdomRender = true;
  56569. // Parse vdom tag
  56570. const hTag = args[0];
  56571. if (!t.isStringLiteral(hTag) && (!t.isIdentifier(hTag) || hTag.text !== 'Host')) {
  56572. m.hasVdomFunctional = true;
  56573. }
  56574. // Parse attributes
  56575. if (args.length > 1) {
  56576. const objectLiteral = args[1];
  56577. if (t.isCallExpression(objectLiteral) || t.isIdentifier(objectLiteral)) {
  56578. m.hasVdomAttribute = true;
  56579. m.hasVdomClass = true;
  56580. m.hasVdomKey = true;
  56581. m.hasVdomListener = true;
  56582. m.hasVdomPropOrAttr = true;
  56583. m.hasVdomRef = true;
  56584. m.hasVdomStyle = true;
  56585. m.hasVdomXlink = true;
  56586. }
  56587. else if (t.isObjectLiteralExpression(objectLiteral)) {
  56588. objectLiteral.properties.forEach((prop) => {
  56589. m.hasVdomAttribute = true;
  56590. if (t.isSpreadAssignment(prop) || t.isComputedPropertyName(prop.name)) {
  56591. m.hasVdomClass = true;
  56592. m.hasVdomKey = true;
  56593. m.hasVdomListener = true;
  56594. m.hasVdomPropOrAttr = true;
  56595. m.hasVdomRef = true;
  56596. m.hasVdomStyle = true;
  56597. m.hasVdomXlink = true;
  56598. }
  56599. else if (prop.name && prop.name.text && prop.name.text.length > 0) {
  56600. const attrName = prop.name.text;
  56601. if (attrName === 'key') {
  56602. m.hasVdomKey = true;
  56603. }
  56604. else if (attrName === 'ref') {
  56605. m.hasVdomRef = true;
  56606. }
  56607. else if (attrName === 'class' || attrName === 'className') {
  56608. m.hasVdomClass = true;
  56609. }
  56610. else if (attrName === 'style') {
  56611. m.hasVdomStyle = true;
  56612. }
  56613. else if (/^on(-|[A-Z])/.test(attrName)) {
  56614. m.hasVdomListener = true;
  56615. }
  56616. else if (attrName.startsWith('xlink')) {
  56617. m.hasVdomXlink = true;
  56618. m.hasVdomPropOrAttr = true;
  56619. }
  56620. else {
  56621. m.hasVdomPropOrAttr = true;
  56622. }
  56623. if (attrName === 'part' && t.isPropertyAssignment(prop) && t.isStringLiteral(prop.initializer)) {
  56624. m.htmlParts.push(...prop.initializer.text
  56625. .toLowerCase()
  56626. .split(' ')
  56627. .filter((part) => part.length > 0));
  56628. }
  56629. m.htmlAttrNames.push(attrName);
  56630. }
  56631. });
  56632. }
  56633. }
  56634. // Parse children
  56635. if (!m.hasVdomText) {
  56636. for (let i = 2; i < args.length; i++) {
  56637. const arg = args[i];
  56638. if (!t.isCallExpression(arg) || !t.isIdentifier(arg.expression) || arg.expression.text !== 'h') {
  56639. m.hasVdomText = true;
  56640. break;
  56641. }
  56642. }
  56643. }
  56644. };
  56645. const parseCallExpression = (m, node) => {
  56646. if (node.arguments != null && node.arguments.length > 0) {
  56647. if (t.isIdentifier(node.expression)) {
  56648. // h('tag')
  56649. visitCallExpressionArgs(m, node.expression, node.arguments);
  56650. }
  56651. else if (t.isPropertyAccessExpression(node.expression)) {
  56652. // document.createElement('tag')
  56653. const n = node.expression.name;
  56654. if (t.isIdentifier(n) && n) {
  56655. visitCallExpressionArgs(m, n, node.arguments);
  56656. }
  56657. }
  56658. }
  56659. };
  56660. const visitCallExpressionArgs = (m, callExpressionName, args) => {
  56661. const fnName = callExpressionName.escapedText;
  56662. if (fnName === 'h' || fnName === H || fnName === 'createElement') {
  56663. visitCallExpressionArg(m, args[0]);
  56664. if (fnName === 'h' || fnName === H) {
  56665. gatherVdomMeta(m, args);
  56666. }
  56667. }
  56668. else if (args.length > 1 && fnName === 'createElementNS') {
  56669. visitCallExpressionArg(m, args[1]);
  56670. }
  56671. else if (fnName === 'require' && args.length > 0 && m.originalImports) {
  56672. const arg = args[0];
  56673. if (t.isStringLiteral(arg)) {
  56674. if (!m.originalImports.includes(arg.text)) {
  56675. m.originalImports.push(arg.text);
  56676. }
  56677. }
  56678. }
  56679. };
  56680. const visitCallExpressionArg = (m, arg) => {
  56681. if (t.isStringLiteral(arg)) {
  56682. let tag = arg.text;
  56683. if (typeof tag === 'string') {
  56684. tag = tag.toLowerCase();
  56685. m.htmlTagNames.push(tag);
  56686. if (tag.includes('-')) {
  56687. m.potentialCmpRefs.push(tag);
  56688. }
  56689. }
  56690. }
  56691. };
  56692. const parseCollectionComponents = (config, compilerCtx, buildCtx, collectionDir, collectionManifest, collection) => {
  56693. if (collectionManifest.entries) {
  56694. collectionManifest.entries.forEach((entryPath) => {
  56695. const componentPath = join(collectionDir, entryPath);
  56696. transpileCollectionModule(config, compilerCtx, buildCtx, collection, componentPath);
  56697. });
  56698. }
  56699. };
  56700. const transpileCollectionModule = (config, compilerCtx, buildCtx, collection, inputFileName) => {
  56701. const sourceText = compilerCtx.fs.readFileSync(inputFileName);
  56702. const sourceFile = t.createSourceFile(inputFileName, sourceText, t.ScriptTarget.ES2017, true, t.ScriptKind.JS);
  56703. return updateModule(config, compilerCtx, buildCtx, sourceFile, sourceText, inputFileName, undefined, collection);
  56704. };
  56705. const parseCollectionManifest = (config, compilerCtx, buildCtx, collectionName, collectionDir, collectionJsonStr) => {
  56706. const collectionManifest = JSON.parse(collectionJsonStr);
  56707. const compilerVersion = collectionManifest.compiler || {};
  56708. const collection = {
  56709. collectionName: collectionName,
  56710. moduleId: collectionName,
  56711. moduleFiles: [],
  56712. dependencies: parseCollectionDependencies(collectionManifest),
  56713. compiler: {
  56714. name: compilerVersion.name || '',
  56715. version: compilerVersion.version || '',
  56716. typescriptVersion: compilerVersion.typescriptVersion || '',
  56717. },
  56718. bundles: parseBundles(collectionManifest),
  56719. };
  56720. parseGlobal(config, compilerCtx, buildCtx, collectionDir, collectionManifest, collection);
  56721. parseCollectionComponents(config, compilerCtx, buildCtx, collectionDir, collectionManifest, collection);
  56722. return collection;
  56723. };
  56724. const parseCollectionDependencies = (collectionManifest) => {
  56725. return (collectionManifest.collections || []).map((c) => c.name);
  56726. };
  56727. const parseGlobal = (config, compilerCtx, buildCtx, collectionDir, collectionManifest, collection) => {
  56728. if (typeof collectionManifest.global !== 'string') {
  56729. return;
  56730. }
  56731. const sourceFilePath = normalizePath$1(join(collectionDir, collectionManifest.global));
  56732. const globalModule = transpileCollectionModule(config, compilerCtx, buildCtx, collection, sourceFilePath);
  56733. collection.global = globalModule;
  56734. };
  56735. const parseBundles = (collectionManifest) => {
  56736. if (invalidArrayData(collectionManifest.bundles)) {
  56737. return [];
  56738. }
  56739. return collectionManifest.bundles.map((b) => {
  56740. return {
  56741. components: b.components.slice().sort(),
  56742. };
  56743. });
  56744. };
  56745. const invalidArrayData = (arr) => {
  56746. return !arr || !Array.isArray(arr) || arr.length === 0;
  56747. };
  56748. const parseCollection = (config, compilerCtx, buildCtx, moduleId, pkgJsonFilePath, pkgData) => {
  56749. // note this MUST be synchronous because this is used during transpile
  56750. const collectionName = pkgData.name;
  56751. let collection = compilerCtx.collections.find((c) => c.collectionName === collectionName);
  56752. if (collection != null) {
  56753. // we've already cached the collection, no need for another resolve/readFile/parse
  56754. // thought being that /node_modules/ isn't changing between watch builds
  56755. return collection;
  56756. }
  56757. // get the root directory of the dependency
  56758. const collectionPackageRootDir = dirname(pkgJsonFilePath);
  56759. // figure out the full path to the collection collection file
  56760. const collectionFilePath = join(collectionPackageRootDir, pkgData.collection);
  56761. const relPath = relative$1(config.rootDir, collectionFilePath);
  56762. config.logger.debug(`load collection: ${collectionName}, ${relPath}`);
  56763. // we haven't cached the collection yet, let's read this file
  56764. // sync on purpose :(
  56765. const collectionJsonStr = compilerCtx.fs.readFileSync(collectionFilePath);
  56766. if (!collectionJsonStr) {
  56767. return null;
  56768. }
  56769. // get the directory where the collection collection file is sitting
  56770. const collectionDir = normalizePath$1(dirname(collectionFilePath));
  56771. // parse the json string into our collection data
  56772. collection = parseCollectionManifest(config, compilerCtx, buildCtx, collectionName, collectionDir, collectionJsonStr);
  56773. collection.moduleId = moduleId;
  56774. if (pkgData.module && pkgData.module !== pkgData.main) {
  56775. collection.hasExports = true;
  56776. }
  56777. // remember the source of this collection node_module
  56778. collection.moduleDir = collectionPackageRootDir;
  56779. // cache it for later yo
  56780. compilerCtx.collections.push(collection);
  56781. return collection;
  56782. };
  56783. const addExternalImport = (config, compilerCtx, buildCtx, moduleFile, containingFile, moduleId, resolveCollections) => {
  56784. if (!moduleFile.externalImports.includes(moduleId)) {
  56785. moduleFile.externalImports.push(moduleId);
  56786. moduleFile.externalImports.sort();
  56787. }
  56788. if (!resolveCollections || compilerCtx.resolvedCollections.has(moduleId)) {
  56789. // we've already handled this collection moduleId before
  56790. return;
  56791. }
  56792. let pkgJsonFilePath = tsResolveModuleNamePackageJsonPath(config, compilerCtx, moduleId, containingFile);
  56793. // cache that we've already parsed this
  56794. compilerCtx.resolvedCollections.add(moduleId);
  56795. if (pkgJsonFilePath == null) {
  56796. return;
  56797. }
  56798. const realPkgJsonFilePath = config.sys.realpathSync(pkgJsonFilePath);
  56799. if (realPkgJsonFilePath.path) {
  56800. pkgJsonFilePath = realPkgJsonFilePath.path;
  56801. }
  56802. if (pkgJsonFilePath === config.packageJsonFilePath) {
  56803. // same package silly!
  56804. return;
  56805. }
  56806. // open up and parse the package.json
  56807. // sync on purpose :(
  56808. const pkgJsonStr = compilerCtx.fs.readFileSync(pkgJsonFilePath);
  56809. if (pkgJsonStr == null) {
  56810. return;
  56811. }
  56812. const parsedPkgJson = parsePackageJson(pkgJsonStr, pkgJsonFilePath);
  56813. if (parsedPkgJson.diagnostic) {
  56814. buildCtx.diagnostics.push(parsedPkgJson.diagnostic);
  56815. return;
  56816. }
  56817. if (!isString$1(parsedPkgJson.data.collection) || !parsedPkgJson.data.collection.endsWith('.json')) {
  56818. // this import is not a stencil collection
  56819. return;
  56820. }
  56821. if (!isString$1(parsedPkgJson.data.types) || !parsedPkgJson.data.types.endsWith('.d.ts')) {
  56822. // this import should have types
  56823. return;
  56824. }
  56825. // this import is a stencil collection
  56826. // let's parse it and gather all the module data about it
  56827. // internally it'll cached collection data if we've already done this
  56828. const collection = parseCollection(config, compilerCtx, buildCtx, moduleId, parsedPkgJson.filePath, parsedPkgJson.data);
  56829. if (!collection) {
  56830. return;
  56831. }
  56832. // check if we already added this collection to the build context
  56833. const alreadyHasCollection = buildCtx.collections.some((c) => {
  56834. return c.collectionName === collection.collectionName;
  56835. });
  56836. if (alreadyHasCollection) {
  56837. // we already have this collection in our build context
  56838. return;
  56839. }
  56840. // let's add the collection to the build context
  56841. buildCtx.collections.push(collection);
  56842. if (Array.isArray(collection.dependencies)) {
  56843. // this collection has more collections
  56844. // let's keep digging down and discover all of them
  56845. collection.dependencies.forEach((dependencyModuleId) => {
  56846. const resolveFromDir = dirname(pkgJsonFilePath);
  56847. addExternalImport(config, compilerCtx, buildCtx, moduleFile, resolveFromDir, dependencyModuleId, resolveCollections);
  56848. });
  56849. }
  56850. };
  56851. const parseModuleImport = (config, compilerCtx, buildCtx, moduleFile, dirPath, importNode, resolveCollections) => {
  56852. if (importNode.moduleSpecifier && t.isStringLiteral(importNode.moduleSpecifier)) {
  56853. let importPath = importNode.moduleSpecifier.text;
  56854. if (!moduleFile.originalImports.includes(importPath)) {
  56855. moduleFile.originalImports.push(importPath);
  56856. }
  56857. if (isAbsolute$1(importPath)) {
  56858. // absolute import
  56859. importPath = normalizePath$1(importPath);
  56860. moduleFile.localImports.push(importPath);
  56861. }
  56862. else if (importPath.startsWith('.')) {
  56863. // relative import
  56864. importPath = normalizePath$1(resolve$1(dirPath, importPath));
  56865. moduleFile.localImports.push(importPath);
  56866. }
  56867. else {
  56868. // node resolve side effect import
  56869. addExternalImport(config, compilerCtx, buildCtx, moduleFile, moduleFile.sourceFilePath, importPath, resolveCollections);
  56870. }
  56871. }
  56872. };
  56873. const addComponentMetaStatic = (cmpNode, cmpMeta) => {
  56874. const publicCompilerMeta = getPublicCompilerMeta(cmpMeta);
  56875. const cmpMetaStaticProp = createStaticGetter('COMPILER_META', convertValueToLiteral(publicCompilerMeta));
  56876. const classMembers = [...cmpNode.members, cmpMetaStaticProp];
  56877. return t.updateClassDeclaration(cmpNode, cmpNode.decorators, cmpNode.modifiers, cmpNode.name, cmpNode.typeParameters, cmpNode.heritageClauses, classMembers);
  56878. };
  56879. const getPublicCompilerMeta = (cmpMeta) => {
  56880. const publicCompilerMeta = Object.assign({}, cmpMeta);
  56881. // no need to copy all compiler meta data
  56882. delete publicCompilerMeta.assetsDirs;
  56883. delete publicCompilerMeta.dependencies;
  56884. delete publicCompilerMeta.excludeFromCollection;
  56885. delete publicCompilerMeta.isCollectionDependency;
  56886. delete publicCompilerMeta.docs;
  56887. delete publicCompilerMeta.jsFilePath;
  56888. delete publicCompilerMeta.potentialCmpRefs;
  56889. delete publicCompilerMeta.styleDocs;
  56890. delete publicCompilerMeta.sourceFilePath;
  56891. return publicCompilerMeta;
  56892. };
  56893. const parseStaticMethods = (staticMembers) => {
  56894. const parsedMethods = getStaticValue(staticMembers, 'methods');
  56895. if (!parsedMethods) {
  56896. return [];
  56897. }
  56898. const methodNames = Object.keys(parsedMethods);
  56899. if (methodNames.length === 0) {
  56900. return [];
  56901. }
  56902. return methodNames.map((methodName) => {
  56903. return {
  56904. name: methodName,
  56905. docs: parsedMethods[methodName].docs,
  56906. complexType: parsedMethods[methodName].complexType,
  56907. internal: isInternal(parsedMethods[methodName].docs),
  56908. };
  56909. });
  56910. };
  56911. const parseStaticListeners = (staticMembers) => {
  56912. const parsedListeners = getStaticValue(staticMembers, 'listeners');
  56913. if (!parsedListeners || parsedListeners.length === 0) {
  56914. return [];
  56915. }
  56916. return parsedListeners.map((parsedListener) => {
  56917. return {
  56918. name: parsedListener.name,
  56919. method: parsedListener.method,
  56920. capture: !!parsedListener.capture,
  56921. passive: !!parsedListener.passive,
  56922. target: parsedListener.target,
  56923. };
  56924. });
  56925. };
  56926. const parseClassMethods = (cmpNode, cmpMeta) => {
  56927. const classMembers = cmpNode.members;
  56928. if (!classMembers || classMembers.length === 0) {
  56929. return;
  56930. }
  56931. const classMethods = classMembers.filter((m) => t.isMethodDeclaration(m));
  56932. if (classMethods.length === 0) {
  56933. return;
  56934. }
  56935. const hasHostData = classMethods.some((m) => isMethod(m, 'hostData'));
  56936. cmpMeta.hasAttributeChangedCallbackFn = classMethods.some((m) => isMethod(m, 'attributeChangedCallback'));
  56937. cmpMeta.hasConnectedCallbackFn = classMethods.some((m) => isMethod(m, 'connectedCallback'));
  56938. cmpMeta.hasDisconnectedCallbackFn = classMethods.some((m) => isMethod(m, 'disconnectedCallback'));
  56939. cmpMeta.hasComponentWillLoadFn = classMethods.some((m) => isMethod(m, 'componentWillLoad'));
  56940. cmpMeta.hasComponentWillUpdateFn = classMethods.some((m) => isMethod(m, 'componentWillUpdate'));
  56941. cmpMeta.hasComponentWillRenderFn = classMethods.some((m) => isMethod(m, 'componentWillRender'));
  56942. cmpMeta.hasComponentDidRenderFn = classMethods.some((m) => isMethod(m, 'componentDidRender'));
  56943. cmpMeta.hasComponentDidLoadFn = classMethods.some((m) => isMethod(m, 'componentDidLoad'));
  56944. cmpMeta.hasComponentShouldUpdateFn = classMethods.some((m) => isMethod(m, 'componentShouldUpdate'));
  56945. cmpMeta.hasComponentDidUpdateFn = classMethods.some((m) => isMethod(m, 'componentDidUpdate'));
  56946. cmpMeta.hasComponentDidUnloadFn = classMethods.some((m) => isMethod(m, 'componentDidUnload'));
  56947. cmpMeta.hasLifecycle =
  56948. cmpMeta.hasComponentWillLoadFn ||
  56949. cmpMeta.hasComponentDidLoadFn ||
  56950. cmpMeta.hasComponentWillUpdateFn ||
  56951. cmpMeta.hasComponentDidUpdateFn;
  56952. cmpMeta.hasRenderFn = classMethods.some((m) => isMethod(m, 'render')) || hasHostData;
  56953. cmpMeta.hasVdomRender = cmpMeta.hasVdomRender || hasHostData;
  56954. };
  56955. const parseStaticElementRef = (staticMembers) => {
  56956. const parsedElementRef = getStaticValue(staticMembers, 'elementRef');
  56957. if (typeof parsedElementRef === 'string') {
  56958. return parsedElementRef;
  56959. }
  56960. return null;
  56961. };
  56962. const parseStaticEncapsulation = (staticMembers) => {
  56963. let encapsulation = getStaticValue(staticMembers, 'encapsulation');
  56964. if (typeof encapsulation === 'string') {
  56965. encapsulation = encapsulation.toLowerCase().trim();
  56966. if (encapsulation === 'shadow' || encapsulation === 'scoped') {
  56967. return encapsulation;
  56968. }
  56969. }
  56970. return 'none';
  56971. };
  56972. const parseStaticShadowDelegatesFocus = (encapsulation, staticMembers) => {
  56973. if (encapsulation === 'shadow') {
  56974. const delegatesFocus = getStaticValue(staticMembers, 'delegatesFocus');
  56975. return !!delegatesFocus;
  56976. }
  56977. return null;
  56978. };
  56979. const parseStaticEvents = (staticMembers) => {
  56980. const parsedEvents = getStaticValue(staticMembers, 'events');
  56981. if (!parsedEvents || parsedEvents.length === 0) {
  56982. return [];
  56983. }
  56984. return parsedEvents.map((parsedEvent) => {
  56985. return {
  56986. name: parsedEvent.name,
  56987. method: parsedEvent.method,
  56988. bubbles: parsedEvent.bubbles,
  56989. cancelable: parsedEvent.cancelable,
  56990. composed: parsedEvent.composed,
  56991. docs: parsedEvent.docs,
  56992. complexType: parsedEvent.complexType,
  56993. internal: isInternal(parsedEvent.docs),
  56994. };
  56995. });
  56996. };
  56997. const parseStaticProps = (staticMembers) => {
  56998. const parsedProps = getStaticValue(staticMembers, 'properties');
  56999. if (!parsedProps) {
  57000. return [];
  57001. }
  57002. const propNames = Object.keys(parsedProps);
  57003. if (propNames.length === 0) {
  57004. return [];
  57005. }
  57006. return propNames.map((propName) => {
  57007. const val = parsedProps[propName];
  57008. return {
  57009. name: propName,
  57010. type: val.type,
  57011. attribute: val.attribute ? val.attribute.toLowerCase() : undefined,
  57012. reflect: typeof val.reflect === 'boolean' ? val.reflect : false,
  57013. mutable: !!val.mutable,
  57014. required: !!val.required,
  57015. optional: !!val.optional,
  57016. defaultValue: val.defaultValue,
  57017. complexType: val.complexType,
  57018. docs: val.docs,
  57019. internal: isInternal(val.docs),
  57020. };
  57021. });
  57022. };
  57023. const parseStaticStates = (staticMembers) => {
  57024. const parsedStates = getStaticValue(staticMembers, 'states');
  57025. if (!parsedStates) {
  57026. return [];
  57027. }
  57028. const stateNames = Object.keys(parsedStates);
  57029. if (stateNames.length === 0) {
  57030. return [];
  57031. }
  57032. return stateNames.map((stateName) => {
  57033. return {
  57034. name: stateName,
  57035. };
  57036. });
  57037. };
  57038. const parseStaticWatchers = (staticMembers) => {
  57039. const parsedWatchers = getStaticValue(staticMembers, 'watchers');
  57040. if (!parsedWatchers || parsedWatchers.length === 0) {
  57041. return [];
  57042. }
  57043. return parsedWatchers.map((parsedWatch) => {
  57044. return {
  57045. propName: parsedWatch.propName,
  57046. methodName: parsedWatch.methodName,
  57047. };
  57048. });
  57049. };
  57050. const normalizeStyles = (tagName, componentFilePath, styles) => {
  57051. styles.forEach((style) => {
  57052. if (style.modeName === DEFAULT_STYLE_MODE) {
  57053. style.styleId = tagName.toUpperCase();
  57054. }
  57055. else {
  57056. style.styleId = `${tagName.toUpperCase()}#${style.modeName}`;
  57057. }
  57058. if (Array.isArray(style.externalStyles)) {
  57059. style.externalStyles.forEach((externalStyle) => {
  57060. normalizeExternalStyle(componentFilePath, externalStyle);
  57061. });
  57062. }
  57063. });
  57064. };
  57065. const normalizeExternalStyle = (componentFilePath, externalStyle) => {
  57066. if (typeof externalStyle.originalComponentPath !== 'string' ||
  57067. externalStyle.originalComponentPath.trim().length === 0) {
  57068. return;
  57069. }
  57070. // get the absolute path of the directory which the component is sitting in
  57071. const componentDir = dirname(componentFilePath);
  57072. if (isAbsolute$1(externalStyle.originalComponentPath)) {
  57073. // this path is absolute already!
  57074. // add to our list of style absolute paths
  57075. externalStyle.absolutePath = normalizePath$1(externalStyle.originalComponentPath);
  57076. // if this is an absolute path already, let's convert it to be relative
  57077. externalStyle.relativePath = normalizePath$1(relative$1(componentDir, externalStyle.originalComponentPath));
  57078. }
  57079. else {
  57080. // this path is relative to the component
  57081. // add to our list of style relative paths
  57082. externalStyle.relativePath = normalizePath$1(externalStyle.originalComponentPath);
  57083. // create the absolute path to the style file
  57084. externalStyle.absolutePath = normalizePath$1(join(componentDir, externalStyle.originalComponentPath));
  57085. }
  57086. };
  57087. const parseStaticStyles = (compilerCtx, tagName, componentFilePath, isCollectionDependency, staticMembers) => {
  57088. const styles = [];
  57089. const styleUrlsProp = isCollectionDependency ? 'styleUrls' : 'originalStyleUrls';
  57090. const parsedStyleUrls = getStaticValue(staticMembers, styleUrlsProp);
  57091. let parsedStyle = getStaticValue(staticMembers, 'styles');
  57092. if (parsedStyle) {
  57093. if (typeof parsedStyle === 'string') {
  57094. // styles: 'div { padding: 10px }'
  57095. parsedStyle = parsedStyle.trim();
  57096. if (parsedStyle.length > 0) {
  57097. styles.push({
  57098. modeName: DEFAULT_STYLE_MODE,
  57099. styleId: null,
  57100. styleStr: parsedStyle,
  57101. styleIdentifier: null,
  57102. externalStyles: [],
  57103. });
  57104. compilerCtx.styleModeNames.add(DEFAULT_STYLE_MODE);
  57105. }
  57106. }
  57107. else if (parsedStyle.__identifier) {
  57108. styles.push(parseStyleIdentifier(parsedStyle, DEFAULT_STYLE_MODE));
  57109. compilerCtx.styleModeNames.add(DEFAULT_STYLE_MODE);
  57110. }
  57111. else if (typeof parsedStyle === 'object') {
  57112. Object.keys(parsedStyle).forEach((modeName) => {
  57113. const parsedStyleMode = parsedStyle[modeName];
  57114. if (typeof parsedStyleMode === 'string') {
  57115. styles.push({
  57116. modeName: modeName,
  57117. styleId: null,
  57118. styleStr: parsedStyleMode,
  57119. styleIdentifier: null,
  57120. externalStyles: [],
  57121. });
  57122. }
  57123. else {
  57124. styles.push(parseStyleIdentifier(parsedStyleMode, modeName));
  57125. }
  57126. compilerCtx.styleModeNames.add(modeName);
  57127. });
  57128. }
  57129. }
  57130. if (parsedStyleUrls && typeof parsedStyleUrls === 'object') {
  57131. Object.keys(parsedStyleUrls).forEach((modeName) => {
  57132. const externalStyles = [];
  57133. const styleObj = parsedStyleUrls[modeName];
  57134. styleObj.forEach((styleUrl) => {
  57135. if (typeof styleUrl === 'string' && styleUrl.trim().length > 0) {
  57136. externalStyles.push({
  57137. absolutePath: null,
  57138. relativePath: null,
  57139. originalComponentPath: styleUrl.trim(),
  57140. });
  57141. }
  57142. });
  57143. if (externalStyles.length > 0) {
  57144. const style = {
  57145. modeName: modeName,
  57146. styleId: null,
  57147. styleStr: null,
  57148. styleIdentifier: null,
  57149. externalStyles: externalStyles,
  57150. };
  57151. styles.push(style);
  57152. compilerCtx.styleModeNames.add(modeName);
  57153. }
  57154. });
  57155. }
  57156. normalizeStyles(tagName, componentFilePath, styles);
  57157. return sortBy(styles, (s) => s.modeName);
  57158. };
  57159. const parseStyleIdentifier = (parsedStyle, modeName) => {
  57160. const style = {
  57161. modeName: modeName,
  57162. styleId: null,
  57163. styleStr: null,
  57164. styleIdentifier: parsedStyle.__escapedText,
  57165. externalStyles: [],
  57166. };
  57167. return style;
  57168. };
  57169. const parseStringLiteral = (m, node) => {
  57170. if (typeof node.text === 'string' && node.text.includes('</')) {
  57171. if (node.text.includes('<slot')) {
  57172. m.htmlTagNames.push('slot');
  57173. }
  57174. if (node.text.includes('<svg')) {
  57175. m.htmlTagNames.push('svg');
  57176. }
  57177. }
  57178. };
  57179. const setComponentBuildConditionals = (cmpMeta) => {
  57180. if (cmpMeta.properties.length > 0) {
  57181. cmpMeta.hasProp = true;
  57182. cmpMeta.hasPropMutable = cmpMeta.properties.some((p) => p.mutable);
  57183. cmpMeta.hasReflect = cmpMeta.properties.some((p) => p.reflect);
  57184. cmpMeta.hasAttribute = cmpMeta.properties.some((p) => typeof p.attribute === 'string');
  57185. cmpMeta.hasPropBoolean = cmpMeta.properties.some((p) => p.type === 'boolean');
  57186. cmpMeta.hasPropNumber = cmpMeta.properties.some((p) => p.type === 'number');
  57187. cmpMeta.hasPropString = cmpMeta.properties.some((p) => p.type === 'string');
  57188. }
  57189. if (cmpMeta.states.length > 0) {
  57190. cmpMeta.hasState = true;
  57191. }
  57192. if (cmpMeta.watchers.length > 0) {
  57193. cmpMeta.hasWatchCallback = true;
  57194. }
  57195. if (cmpMeta.methods.length > 0) {
  57196. cmpMeta.hasMethod = true;
  57197. }
  57198. if (cmpMeta.events.length > 0) {
  57199. cmpMeta.hasEvent = true;
  57200. }
  57201. if (cmpMeta.listeners.length > 0) {
  57202. cmpMeta.hasListener = true;
  57203. cmpMeta.hasListenerTargetWindow = cmpMeta.listeners.some((l) => l.target === 'window');
  57204. cmpMeta.hasListenerTargetDocument = cmpMeta.listeners.some((l) => l.target === 'document');
  57205. cmpMeta.hasListenerTargetBody = cmpMeta.listeners.some((l) => l.target === 'body');
  57206. cmpMeta.hasListenerTargetParent = cmpMeta.listeners.some((l) => l.target === 'parent');
  57207. cmpMeta.hasListenerTarget = cmpMeta.listeners.some((l) => !!l.target);
  57208. }
  57209. cmpMeta.hasMember = cmpMeta.hasProp || cmpMeta.hasState || cmpMeta.hasElement || cmpMeta.hasMethod;
  57210. cmpMeta.isUpdateable = cmpMeta.hasProp || cmpMeta.hasState;
  57211. if (cmpMeta.styles.length > 0) {
  57212. cmpMeta.hasStyle = true;
  57213. cmpMeta.hasMode = cmpMeta.styles.some((s) => s.modeName !== DEFAULT_STYLE_MODE);
  57214. }
  57215. cmpMeta.hasLifecycle =
  57216. cmpMeta.hasComponentWillLoadFn ||
  57217. cmpMeta.hasComponentDidLoadFn ||
  57218. cmpMeta.hasComponentShouldUpdateFn ||
  57219. cmpMeta.hasComponentWillUpdateFn ||
  57220. cmpMeta.hasComponentDidUpdateFn ||
  57221. cmpMeta.hasComponentWillRenderFn ||
  57222. cmpMeta.hasComponentDidRenderFn;
  57223. cmpMeta.isPlain =
  57224. !cmpMeta.hasMember && !cmpMeta.hasStyle && !cmpMeta.hasLifecycle && !cmpMeta.hasListener && !cmpMeta.hasVdomRender;
  57225. };
  57226. const parseStaticComponentMeta = (compilerCtx, typeChecker, cmpNode, moduleFile, nodeMap, transformOpts) => {
  57227. if (cmpNode.members == null) {
  57228. return cmpNode;
  57229. }
  57230. const staticMembers = cmpNode.members.filter(isStaticGetter);
  57231. const tagName = getComponentTagName(staticMembers);
  57232. if (tagName == null) {
  57233. return cmpNode;
  57234. }
  57235. const symbol = typeChecker ? typeChecker.getSymbolAtLocation(cmpNode.name) : undefined;
  57236. const docs = serializeSymbol(typeChecker, symbol);
  57237. const isCollectionDependency = moduleFile.isCollectionDependency;
  57238. const encapsulation = parseStaticEncapsulation(staticMembers);
  57239. const cmp = {
  57240. tagName: tagName,
  57241. excludeFromCollection: moduleFile.excludeFromCollection,
  57242. isCollectionDependency,
  57243. componentClassName: cmpNode.name ? cmpNode.name.text : '',
  57244. elementRef: parseStaticElementRef(staticMembers),
  57245. encapsulation,
  57246. shadowDelegatesFocus: parseStaticShadowDelegatesFocus(encapsulation, staticMembers),
  57247. properties: parseStaticProps(staticMembers),
  57248. virtualProperties: parseVirtualProps(docs),
  57249. states: parseStaticStates(staticMembers),
  57250. methods: parseStaticMethods(staticMembers),
  57251. listeners: parseStaticListeners(staticMembers),
  57252. events: parseStaticEvents(staticMembers),
  57253. watchers: parseStaticWatchers(staticMembers),
  57254. styles: parseStaticStyles(compilerCtx, tagName, moduleFile.sourceFilePath, isCollectionDependency, staticMembers),
  57255. legacyConnect: getStaticValue(staticMembers, 'connectProps') || [],
  57256. legacyContext: getStaticValue(staticMembers, 'contextProps') || [],
  57257. internal: isInternal(docs),
  57258. assetsDirs: parseAssetsDirs(staticMembers, moduleFile.jsFilePath),
  57259. styleDocs: [],
  57260. docs,
  57261. jsFilePath: moduleFile.jsFilePath,
  57262. sourceFilePath: moduleFile.sourceFilePath,
  57263. sourceMapPath: moduleFile.sourceMapPath,
  57264. hasAttributeChangedCallbackFn: false,
  57265. hasComponentWillLoadFn: false,
  57266. hasComponentDidLoadFn: false,
  57267. hasComponentShouldUpdateFn: false,
  57268. hasComponentWillUpdateFn: false,
  57269. hasComponentDidUpdateFn: false,
  57270. hasComponentWillRenderFn: false,
  57271. hasComponentDidRenderFn: false,
  57272. hasComponentDidUnloadFn: false,
  57273. hasConnectedCallbackFn: false,
  57274. hasDisconnectedCallbackFn: false,
  57275. hasElement: false,
  57276. hasEvent: false,
  57277. hasLifecycle: false,
  57278. hasListener: false,
  57279. hasListenerTarget: false,
  57280. hasListenerTargetWindow: false,
  57281. hasListenerTargetDocument: false,
  57282. hasListenerTargetBody: false,
  57283. hasListenerTargetParent: false,
  57284. hasMember: false,
  57285. hasMethod: false,
  57286. hasMode: false,
  57287. hasAttribute: false,
  57288. hasProp: false,
  57289. hasPropNumber: false,
  57290. hasPropBoolean: false,
  57291. hasPropString: false,
  57292. hasPropMutable: false,
  57293. hasReflect: false,
  57294. hasRenderFn: false,
  57295. hasState: false,
  57296. hasStyle: false,
  57297. hasVdomAttribute: false,
  57298. hasVdomXlink: false,
  57299. hasVdomClass: false,
  57300. hasVdomFunctional: false,
  57301. hasVdomKey: false,
  57302. hasVdomListener: false,
  57303. hasVdomPropOrAttr: false,
  57304. hasVdomRef: false,
  57305. hasVdomRender: false,
  57306. hasVdomStyle: false,
  57307. hasVdomText: false,
  57308. hasWatchCallback: false,
  57309. isPlain: false,
  57310. htmlAttrNames: [],
  57311. htmlTagNames: [],
  57312. htmlParts: [],
  57313. isUpdateable: false,
  57314. potentialCmpRefs: [],
  57315. };
  57316. const visitComponentChildNode = (node) => {
  57317. if (t.isCallExpression(node)) {
  57318. parseCallExpression(cmp, node);
  57319. }
  57320. else if (t.isStringLiteral(node)) {
  57321. parseStringLiteral(cmp, node);
  57322. }
  57323. node.forEachChild(visitComponentChildNode);
  57324. };
  57325. visitComponentChildNode(cmpNode);
  57326. parseClassMethods(cmpNode, cmp);
  57327. cmp.legacyConnect.forEach(({ connect }) => {
  57328. cmp.htmlTagNames.push(connect);
  57329. if (connect.includes('-')) {
  57330. cmp.potentialCmpRefs.push(connect);
  57331. }
  57332. });
  57333. cmp.htmlAttrNames = unique(cmp.htmlAttrNames);
  57334. cmp.htmlTagNames = unique(cmp.htmlTagNames);
  57335. cmp.potentialCmpRefs = unique(cmp.potentialCmpRefs);
  57336. setComponentBuildConditionals(cmp);
  57337. if (transformOpts && transformOpts.componentMetadata === 'compilerstatic') {
  57338. cmpNode = addComponentMetaStatic(cmpNode, cmp);
  57339. }
  57340. // add to module map
  57341. moduleFile.cmps.push(cmp);
  57342. // add to node map
  57343. nodeMap.set(cmpNode, cmp);
  57344. return cmpNode;
  57345. };
  57346. const parseVirtualProps = (docs) => {
  57347. return docs.tags
  57348. .filter(({ name }) => name === 'virtualProp')
  57349. .map(parseVirtualProp)
  57350. .filter((prop) => !!prop);
  57351. };
  57352. const parseVirtualProp = (tag) => {
  57353. const results = /^\s*(?:\{([^}]+)\}\s+)?(\w+)\s+-\s+(.*)$/.exec(tag.text);
  57354. if (!results) {
  57355. return undefined;
  57356. }
  57357. const [, type, name, docs] = results;
  57358. return {
  57359. type: type == null ? 'any' : type.trim(),
  57360. name: name.trim(),
  57361. docs: docs.trim(),
  57362. };
  57363. };
  57364. const parseAssetsDirs = (staticMembers, componentFilePath) => {
  57365. const dirs = getStaticValue(staticMembers, 'assetsDirs') || [];
  57366. const componentDir = normalizePath$1(dirname(componentFilePath));
  57367. return dirs.map((dir) => {
  57368. // get the relative path from the component file to the assets directory
  57369. dir = normalizePath$1(dir.trim());
  57370. let absolutePath = dir;
  57371. let cmpRelativePath = dir;
  57372. if (isAbsolute$1(dir)) {
  57373. // if this is an absolute path already, let's convert it to be relative
  57374. cmpRelativePath = relative$1(componentDir, dir);
  57375. }
  57376. else {
  57377. // create the absolute path to the asset dir
  57378. absolutePath = join(componentDir, dir);
  57379. }
  57380. return {
  57381. absolutePath,
  57382. cmpRelativePath,
  57383. originalComponentPath: dir,
  57384. };
  57385. });
  57386. };
  57387. const updateModule = (config, compilerCtx, buildCtx, tsSourceFile, sourceFileText, emitFilePath, typeChecker, collection) => {
  57388. const sourceFilePath = normalizePath$1(tsSourceFile.fileName);
  57389. const prevModuleFile = getModule(compilerCtx, sourceFilePath);
  57390. if (prevModuleFile && prevModuleFile.staticSourceFileText === sourceFileText) {
  57391. return prevModuleFile;
  57392. }
  57393. const srcDirPath = dirname(sourceFilePath);
  57394. const emitFileName = basename(emitFilePath);
  57395. emitFilePath = normalizePath$1(join(srcDirPath, emitFileName));
  57396. const moduleFile = createModule(tsSourceFile, sourceFileText, emitFilePath);
  57397. if (emitFilePath.endsWith('.js.map')) {
  57398. moduleFile.sourceMapPath = emitFilePath;
  57399. moduleFile.sourceMapFileText = sourceFileText;
  57400. }
  57401. else if (prevModuleFile && prevModuleFile.sourceMapPath) {
  57402. moduleFile.sourceMapPath = prevModuleFile.sourceMapPath;
  57403. moduleFile.sourceMapFileText = prevModuleFile.sourceMapFileText;
  57404. }
  57405. const moduleFileKey = normalizePath$1(moduleFile.sourceFilePath);
  57406. compilerCtx.moduleMap.set(moduleFileKey, moduleFile);
  57407. compilerCtx.changedModules.add(moduleFile.sourceFilePath);
  57408. const visitNode = (node) => {
  57409. if (t.isClassDeclaration(node)) {
  57410. parseStaticComponentMeta(compilerCtx, typeChecker, node, moduleFile, compilerCtx.nodeMap);
  57411. return;
  57412. }
  57413. else if (t.isImportDeclaration(node)) {
  57414. parseModuleImport(config, compilerCtx, buildCtx, moduleFile, srcDirPath, node, true);
  57415. return;
  57416. }
  57417. else if (t.isCallExpression(node)) {
  57418. parseCallExpression(moduleFile, node);
  57419. }
  57420. else if (t.isStringLiteral(node)) {
  57421. parseStringLiteral(moduleFile, node);
  57422. }
  57423. node.forEachChild(visitNode);
  57424. };
  57425. if (collection != null) {
  57426. moduleFile.isCollectionDependency = true;
  57427. moduleFile.collectionName = collection.collectionName;
  57428. collection.moduleFiles.push(moduleFile);
  57429. }
  57430. visitNode(tsSourceFile);
  57431. // TODO: workaround around const enums
  57432. // find better way
  57433. if (moduleFile.cmps.length > 0) {
  57434. moduleFile.staticSourceFile = t.createSourceFile(sourceFilePath, sourceFileText, tsSourceFile.languageVersion, true, t.ScriptKind.JS);
  57435. }
  57436. return moduleFile;
  57437. };
  57438. const validateTranspiledComponents = (config, buildCtx) => {
  57439. for (const cmp of buildCtx.components) {
  57440. validateUniqueTagNames(config, buildCtx, cmp);
  57441. }
  57442. };
  57443. const validateUniqueTagNames = (config, buildCtx, cmp) => {
  57444. const tagName = cmp.tagName;
  57445. const cmpsWithTagName = buildCtx.components.filter((c) => c.tagName === tagName);
  57446. if (cmpsWithTagName.length > 1) {
  57447. const err = buildError(buildCtx.diagnostics);
  57448. err.header = `Component Tag Name "${tagName}" Must Be Unique`;
  57449. err.messageText = `Please update the components so "${tagName}" is only used once: ${cmpsWithTagName
  57450. .map((c) => relative$1(config.rootDir, c.sourceFilePath))
  57451. .join(' ')}`;
  57452. }
  57453. };
  57454. const runTsProgram = async (config, compilerCtx, buildCtx, tsBuilder) => {
  57455. const tsSyntactic = loadTypeScriptDiagnostics(tsBuilder.getSyntacticDiagnostics());
  57456. const tsGlobal = loadTypeScriptDiagnostics(tsBuilder.getGlobalDiagnostics());
  57457. const tsOptions = loadTypeScriptDiagnostics(tsBuilder.getOptionsDiagnostics());
  57458. buildCtx.diagnostics.push(...tsSyntactic);
  57459. buildCtx.diagnostics.push(...tsGlobal);
  57460. buildCtx.diagnostics.push(...tsOptions);
  57461. if (buildCtx.hasError) {
  57462. return false;
  57463. }
  57464. const tsProgram = tsBuilder.getProgram();
  57465. const tsTypeChecker = tsProgram.getTypeChecker();
  57466. const typesOutputTarget = config.outputTargets.filter(isOutputTargetDistTypes);
  57467. const emittedDts = [];
  57468. const emitCallback = (emitFilePath, data, _w, _e, tsSourceFiles) => {
  57469. if (emitFilePath.endsWith('.js') || emitFilePath.endsWith('js.map')) {
  57470. updateModule(config, compilerCtx, buildCtx, tsSourceFiles[0], data, emitFilePath, tsTypeChecker, null);
  57471. }
  57472. else if (emitFilePath.endsWith('.d.ts')) {
  57473. const srcDtsPath = normalizePath$1(tsSourceFiles[0].fileName);
  57474. const relativeEmitFilepath = getRelativeDts(config, srcDtsPath, emitFilePath);
  57475. emittedDts.push(srcDtsPath);
  57476. typesOutputTarget.forEach((o) => {
  57477. const distPath = join(o.typesDir, relativeEmitFilepath);
  57478. data = updateStencilTypesImports(o.typesDir, distPath, data);
  57479. compilerCtx.fs.writeFile(distPath, data);
  57480. });
  57481. }
  57482. };
  57483. // Emit files that changed
  57484. tsBuilder.emit(undefined, emitCallback, undefined, false, {
  57485. before: [convertDecoratorsToStatic(config, buildCtx.diagnostics, tsTypeChecker)],
  57486. });
  57487. const changedmodules = Array.from(compilerCtx.changedModules.keys());
  57488. buildCtx.debug('Transpiled modules: ' + JSON.stringify(changedmodules, null, '\n'));
  57489. // Finalize components metadata
  57490. buildCtx.moduleFiles = Array.from(compilerCtx.moduleMap.values());
  57491. buildCtx.components = getComponentsFromModules(buildCtx.moduleFiles);
  57492. updateComponentBuildConditionals(compilerCtx.moduleMap, buildCtx.components);
  57493. resolveComponentDependencies(buildCtx.components);
  57494. validateTranspiledComponents(config, buildCtx);
  57495. if (buildCtx.hasError) {
  57496. return false;
  57497. }
  57498. // create the components.d.ts file and write to disk
  57499. const hasTypesChanged = await generateAppTypes(config, compilerCtx, buildCtx, 'src');
  57500. if (hasTypesChanged) {
  57501. return true;
  57502. }
  57503. if (typesOutputTarget.length > 0) {
  57504. // copy src dts files that do not get emitted by the compiler
  57505. // but we still want to ship them in the dist directory
  57506. const srcRootDtsFiles = tsProgram
  57507. .getRootFileNames()
  57508. .filter((f) => f.endsWith('.d.ts') && !f.endsWith('components.d.ts'))
  57509. .map(normalizePath$1)
  57510. .filter((f) => !emittedDts.includes(f))
  57511. .map((srcRootDtsFilePath) => {
  57512. const relativeEmitFilepath = relative$1(config.srcDir, srcRootDtsFilePath);
  57513. return Promise.all(typesOutputTarget.map(async (o) => {
  57514. const distPath = join(o.typesDir, relativeEmitFilepath);
  57515. let dtsContent = await compilerCtx.fs.readFile(srcRootDtsFilePath);
  57516. dtsContent = updateStencilTypesImports(o.typesDir, distPath, dtsContent);
  57517. await compilerCtx.fs.writeFile(distPath, dtsContent);
  57518. }));
  57519. });
  57520. await Promise.all(srcRootDtsFiles);
  57521. }
  57522. if (config.validateTypes) {
  57523. const tsSemantic = loadTypeScriptDiagnostics(tsBuilder.getSemanticDiagnostics());
  57524. if (config.devMode) {
  57525. tsSemantic.forEach((semanticDiagnostic) => {
  57526. // Unused variable errors become warnings in dev mode
  57527. if (semanticDiagnostic.code === '6133' || semanticDiagnostic.code === '6192') {
  57528. semanticDiagnostic.level = 'warn';
  57529. }
  57530. });
  57531. }
  57532. buildCtx.diagnostics.push(...tsSemantic);
  57533. }
  57534. return false;
  57535. };
  57536. const getRelativeDts = (config, srcPath, emitDtsPath) => {
  57537. const parts = [];
  57538. for (let i = 0; i < 30; i++) {
  57539. if (config.srcDir === srcPath) {
  57540. break;
  57541. }
  57542. const b = basename(emitDtsPath);
  57543. parts.push(b);
  57544. emitDtsPath = join(emitDtsPath, '..');
  57545. srcPath = normalizePath$1(join(srcPath, '..'));
  57546. }
  57547. return join.apply(null, parts.reverse());
  57548. };
  57549. const outputServiceWorkers = async (config, buildCtx) => {
  57550. const wwwServiceOutputs = config.outputTargets
  57551. .filter(isOutputTargetWww)
  57552. .filter((o) => typeof o.indexHtml === 'string' && !!o.serviceWorker);
  57553. if (wwwServiceOutputs.length === 0 || config.sys.lazyRequire == null) {
  57554. return;
  57555. }
  57556. // let's make sure they have what we need from workbox installed
  57557. const diagnostics = await config.sys.lazyRequire.ensure(config.rootDir, ['workbox-build']);
  57558. if (diagnostics.length > 0) {
  57559. buildCtx.diagnostics.push(...diagnostics);
  57560. }
  57561. else {
  57562. // we've ensure workbox is installed, so let's require it now
  57563. const workbox = config.sys.lazyRequire.require(config.rootDir, 'workbox-build');
  57564. await Promise.all(wwwServiceOutputs.map((outputTarget) => generateServiceWorker(config, buildCtx, workbox, outputTarget)));
  57565. }
  57566. };
  57567. const validateBuildPackageJson = async (config, compilerCtx, buildCtx) => {
  57568. if (config.watch) {
  57569. return;
  57570. }
  57571. if (buildCtx.packageJson == null) {
  57572. return;
  57573. }
  57574. const outputTargets = config.outputTargets.filter(isOutputTargetDistCollection);
  57575. const typesOutputTargets = config.outputTargets.filter(isOutputTargetDistTypes);
  57576. await Promise.all([
  57577. ...outputTargets.map((outputsTarget) => {
  57578. return validatePackageJsonOutput(config, compilerCtx, buildCtx, outputsTarget);
  57579. }),
  57580. ...typesOutputTargets.map((outputTarget) => {
  57581. return validateTypes(config, compilerCtx, buildCtx, outputTarget);
  57582. }),
  57583. ]);
  57584. };
  57585. const validatePackageJsonOutput = async (config, compilerCtx, buildCtx, outputTarget) => {
  57586. await Promise.all([
  57587. validatePackageFiles(config, compilerCtx, buildCtx, outputTarget),
  57588. validateMain(config, compilerCtx, buildCtx, outputTarget),
  57589. validateModule(config, compilerCtx, buildCtx, outputTarget),
  57590. validateCollection$1(config, compilerCtx, buildCtx, outputTarget),
  57591. validateBrowser(config, compilerCtx, buildCtx),
  57592. ]);
  57593. };
  57594. const validatePackageFiles = async (config, compilerCtx, buildCtx, outputTarget) => {
  57595. if (!config.devMode && Array.isArray(buildCtx.packageJson.files)) {
  57596. const actualDistDir = normalizePath$1(relative$1(config.rootDir, outputTarget.dir));
  57597. const validPaths = [`${actualDistDir}`, `${actualDistDir}/`, `./${actualDistDir}`, `./${actualDistDir}/`];
  57598. const containsDistDir = buildCtx.packageJson.files.some((userPath) => validPaths.some((validPath) => normalizePath$1(userPath) === validPath));
  57599. if (!containsDistDir) {
  57600. const msg = `package.json "files" array must contain the distribution directory "${actualDistDir}/" when generating a distribution.`;
  57601. packageJsonWarn(config, compilerCtx, buildCtx, msg, `"files"`);
  57602. return;
  57603. }
  57604. await Promise.all(buildCtx.packageJson.files.map(async (pkgFile) => {
  57605. if (!isGlob(pkgFile)) {
  57606. const packageJsonDir = dirname(config.packageJsonFilePath);
  57607. const absPath = join(packageJsonDir, pkgFile);
  57608. const hasAccess = await compilerCtx.fs.access(absPath);
  57609. if (!hasAccess) {
  57610. const msg = `Unable to find "${pkgFile}" within the package.json "files" array.`;
  57611. packageJsonError(config, compilerCtx, buildCtx, msg, `"${pkgFile}"`);
  57612. }
  57613. }
  57614. }));
  57615. }
  57616. };
  57617. const validateMain = (config, compilerCtx, buildCtx, outputTarget) => {
  57618. const mainAbs = join(outputTarget.dir, 'index.cjs.js');
  57619. const mainRel = relative$1(config.rootDir, mainAbs);
  57620. if (!isString$1(buildCtx.packageJson.main) || buildCtx.packageJson.main === '') {
  57621. const msg = `package.json "main" property is required when generating a distribution. It's recommended to set the "main" property to: ${mainRel}`;
  57622. packageJsonWarn(config, compilerCtx, buildCtx, msg, `"main"`);
  57623. }
  57624. else if (normalizePath$1(buildCtx.packageJson.main) !== normalizePath$1(mainRel)) {
  57625. const msg = `package.json "main" property is set to "${buildCtx.packageJson.main}". It's recommended to set the "main" property to: ${mainRel}`;
  57626. packageJsonWarn(config, compilerCtx, buildCtx, msg, `"main"`);
  57627. }
  57628. };
  57629. const validateModule = (config, compilerCtx, buildCtx, outputTarget) => {
  57630. const customElementsOutput = config.outputTargets.find(isOutputTargetDistCustomElementsBundle);
  57631. const currentModule = buildCtx.packageJson.module;
  57632. const distAbs = join(outputTarget.dir, 'index.js');
  57633. const distRel = relative$1(config.rootDir, distAbs);
  57634. let recommendedRelPath = distRel;
  57635. if (customElementsOutput) {
  57636. const customElementsAbs = join(customElementsOutput.dir, 'index.js');
  57637. recommendedRelPath = relative$1(config.rootDir, customElementsAbs);
  57638. }
  57639. if (!isString$1(currentModule)) {
  57640. const msg = `package.json "module" property is required when generating a distribution. It's recommended to set the "module" property to: ${recommendedRelPath}`;
  57641. packageJsonWarn(config, compilerCtx, buildCtx, msg, `"module"`);
  57642. }
  57643. else if (normalizePath$1(currentModule) !== normalizePath$1(recommendedRelPath) &&
  57644. normalizePath$1(currentModule) !== normalizePath$1(distRel)) {
  57645. const msg = `package.json "module" property is set to "${currentModule}". It's recommended to set the "module" property to: ${recommendedRelPath}`;
  57646. packageJsonWarn(config, compilerCtx, buildCtx, msg, `"module"`);
  57647. }
  57648. };
  57649. const validateTypes = async (config, compilerCtx, buildCtx, outputTarget) => {
  57650. const typesAbs = getComponentsDtsTypesFilePath(outputTarget);
  57651. const recommendedPath = relative$1(config.rootDir, typesAbs);
  57652. if (!isString$1(buildCtx.packageJson.types) || buildCtx.packageJson.types === '') {
  57653. const msg = `package.json "types" property is required when generating a distribution. It's recommended to set the "types" property to: ${recommendedPath}`;
  57654. packageJsonWarn(config, compilerCtx, buildCtx, msg, `"types"`);
  57655. }
  57656. else if (!buildCtx.packageJson.types.endsWith('.d.ts')) {
  57657. const msg = `package.json "types" file must have a ".d.ts" extension: ${buildCtx.packageJson.types}`;
  57658. packageJsonWarn(config, compilerCtx, buildCtx, msg, `"types"`);
  57659. }
  57660. else {
  57661. const typesFile = join(config.rootDir, buildCtx.packageJson.types);
  57662. const typesFileExists = await compilerCtx.fs.access(typesFile);
  57663. if (!typesFileExists) {
  57664. let msg = `package.json "types" property is set to "${buildCtx.packageJson.types}" but cannot be found.`;
  57665. if (normalizePath$1(buildCtx.packageJson.types) !== normalizePath$1(recommendedPath)) {
  57666. msg += ` It's recommended to set the "types" property to: ${recommendedPath}`;
  57667. }
  57668. packageJsonError(config, compilerCtx, buildCtx, msg, `"types"`);
  57669. }
  57670. }
  57671. };
  57672. const validateCollection$1 = (config, compilerCtx, buildCtx, outputTarget) => {
  57673. if (outputTarget.collectionDir) {
  57674. const collectionRel = join(relative$1(config.rootDir, outputTarget.collectionDir), COLLECTION_MANIFEST_FILE_NAME);
  57675. if (!buildCtx.packageJson.collection || normalizePath$1(buildCtx.packageJson.collection) !== collectionRel) {
  57676. const msg = `package.json "collection" property is required when generating a distribution and must be set to: ${collectionRel}`;
  57677. packageJsonWarn(config, compilerCtx, buildCtx, msg, `"collection"`);
  57678. }
  57679. }
  57680. };
  57681. const validateBrowser = (config, compilerCtx, buildCtx) => {
  57682. if (isString$1(buildCtx.packageJson.browser)) {
  57683. const msg = `package.json "browser" property is set to "${buildCtx.packageJson.browser}". However, for maximum compatibility with all bundlers it's recommended to not set the "browser" property and instead ensure both "module" and "main" properties are set.`;
  57684. packageJsonWarn(config, compilerCtx, buildCtx, msg, `"browser"`);
  57685. }
  57686. };
  57687. const packageJsonError = (config, compilerCtx, buildCtx, msg, warnKey) => {
  57688. const err = buildJsonFileError(compilerCtx, buildCtx.diagnostics, config.packageJsonFilePath, msg, warnKey);
  57689. err.header = `Package Json`;
  57690. return err;
  57691. };
  57692. const packageJsonWarn = (config, compilerCtx, buildCtx, msg, warnKey) => {
  57693. const warn = buildJsonFileError(compilerCtx, buildCtx.diagnostics, config.packageJsonFilePath, msg, warnKey);
  57694. warn.header = `Package Json`;
  57695. warn.level = 'warn';
  57696. return warn;
  57697. };
  57698. const validateManifestJson = (config, compilerCtx, buildCtx) => {
  57699. if (config.devMode) {
  57700. return null;
  57701. }
  57702. const outputTargets = config.outputTargets.filter(isOutputTargetWww);
  57703. return Promise.all(outputTargets.map(async (outputsTarget) => {
  57704. const manifestFilePath = join(outputsTarget.dir, 'manifest.json');
  57705. try {
  57706. const manifestContent = await compilerCtx.fs.readFile(manifestFilePath);
  57707. if (manifestContent) {
  57708. try {
  57709. const manifestData = JSON.parse(manifestContent);
  57710. await validateManifestJsonData(compilerCtx, buildCtx, manifestFilePath, manifestData);
  57711. }
  57712. catch (e) {
  57713. const err = buildError(buildCtx.diagnostics);
  57714. err.header = `Invalid manifest.json: ${e}`;
  57715. err.absFilePath = manifestFilePath;
  57716. }
  57717. }
  57718. }
  57719. catch (e) { }
  57720. }));
  57721. };
  57722. const validateManifestJsonData = async (compilerCtx, buildCtx, manifestFilePath, manifestData) => {
  57723. if (Array.isArray(manifestData.icons)) {
  57724. await Promise.all(manifestData.icons.map((manifestIcon) => {
  57725. return validateManifestJsonIcon(compilerCtx, buildCtx, manifestFilePath, manifestIcon);
  57726. }));
  57727. }
  57728. };
  57729. const validateManifestJsonIcon = async (compilerCtx, buildCtx, manifestFilePath, manifestIcon) => {
  57730. let iconSrc = manifestIcon.src;
  57731. if (typeof iconSrc !== 'string') {
  57732. const msg = `Manifest icon missing "src"`;
  57733. buildJsonFileError(compilerCtx, buildCtx.diagnostics, manifestFilePath, msg, `"icons"`);
  57734. return;
  57735. }
  57736. if (iconSrc.startsWith('/')) {
  57737. iconSrc = iconSrc.slice(1);
  57738. }
  57739. const manifestDir = dirname(manifestFilePath);
  57740. const iconPath = join(manifestDir, iconSrc);
  57741. const hasAccess = await compilerCtx.fs.access(iconPath);
  57742. if (!hasAccess) {
  57743. const msg = `Unable to find manifest icon "${manifestIcon.src}"`;
  57744. buildJsonFileError(compilerCtx, buildCtx.diagnostics, manifestFilePath, msg, `"${manifestIcon.src}"`);
  57745. }
  57746. };
  57747. const validateBuildFiles = (config, compilerCtx, buildCtx) => {
  57748. if (buildCtx.hasError) {
  57749. return null;
  57750. }
  57751. return Promise.all([
  57752. validateBuildPackageJson(config, compilerCtx, buildCtx),
  57753. validateManifestJson(config, compilerCtx, buildCtx),
  57754. ]);
  57755. };
  57756. const writeBuild = async (config, compilerCtx, buildCtx) => {
  57757. const timeSpan = buildCtx.createTimeSpan(`writeBuildFiles started`, true);
  57758. let totalFilesWrote = 0;
  57759. try {
  57760. // commit all the writeFiles, mkdirs, rmdirs and unlinks to disk
  57761. const commitResults = await compilerCtx.fs.commit();
  57762. // get the results from the write to disk commit
  57763. buildCtx.filesWritten = commitResults.filesWritten;
  57764. buildCtx.filesDeleted = commitResults.filesDeleted;
  57765. buildCtx.dirsDeleted = commitResults.dirsDeleted;
  57766. buildCtx.dirsAdded = commitResults.dirsAdded;
  57767. totalFilesWrote = commitResults.filesWritten.length;
  57768. // successful write
  57769. // kick off writing the cached file stuff
  57770. // await compilerCtx.cache.commit();
  57771. buildCtx.debug(`in-memory-fs: ${compilerCtx.fs.getMemoryStats()}`);
  57772. // buildCtx.debug(`cache: ${compilerCtx.cache.getMemoryStats()}`);
  57773. await outputServiceWorkers(config, buildCtx), await validateBuildFiles(config, compilerCtx, buildCtx);
  57774. }
  57775. catch (e) {
  57776. catchError(buildCtx.diagnostics, e);
  57777. }
  57778. timeSpan.finish(`writeBuildFiles finished, files wrote: ${totalFilesWrote}`);
  57779. };
  57780. const build = async (config, compilerCtx, buildCtx, tsBuilder) => {
  57781. try {
  57782. // reset process.cwd() for 3rd-party plugins
  57783. process.chdir(config.rootDir);
  57784. // empty the directories on the first build
  57785. await emptyOutputTargets(config, compilerCtx, buildCtx);
  57786. if (buildCtx.hasError)
  57787. return buildAbort(buildCtx);
  57788. if (config.srcIndexHtml) {
  57789. const indexSrcHtml = await compilerCtx.fs.readFile(config.srcIndexHtml);
  57790. if (isString$1(indexSrcHtml)) {
  57791. buildCtx.indexDoc = createDocument(indexSrcHtml);
  57792. }
  57793. }
  57794. await readPackageJson(config, compilerCtx, buildCtx);
  57795. if (buildCtx.hasError)
  57796. return buildAbort(buildCtx);
  57797. // run typescript program
  57798. const tsTimeSpan = buildCtx.createTimeSpan('transpile started');
  57799. const componentDtsChanged = await runTsProgram(config, compilerCtx, buildCtx, tsBuilder);
  57800. tsTimeSpan.finish('transpile finished');
  57801. if (buildCtx.hasError)
  57802. return buildAbort(buildCtx);
  57803. if (config.watch && componentDtsChanged) {
  57804. // silent abort for watch mode only
  57805. return null;
  57806. }
  57807. // preprocess and generate styles before any outputTarget starts
  57808. buildCtx.stylesPromise = generateGlobalStyles(config, compilerCtx, buildCtx);
  57809. if (buildCtx.hasError)
  57810. return buildAbort(buildCtx);
  57811. // create outputs
  57812. await generateOutputTargets(config, compilerCtx, buildCtx);
  57813. if (buildCtx.hasError)
  57814. return buildAbort(buildCtx);
  57815. // write outputs
  57816. await buildCtx.stylesPromise;
  57817. await writeBuild(config, compilerCtx, buildCtx);
  57818. }
  57819. catch (e) {
  57820. // ¯\_(ツ)_/¯
  57821. catchError(buildCtx.diagnostics, e);
  57822. }
  57823. // TODO
  57824. // clear changed files
  57825. compilerCtx.changedFiles.clear();
  57826. // return what we've learned today
  57827. return buildFinish(buildCtx);
  57828. };
  57829. const getTsOptionsToExtend = (config) => {
  57830. const tsOptions = {
  57831. experimentalDecorators: true,
  57832. declaration: config.outputTargets.some(isOutputTargetDistTypes),
  57833. module: t.ModuleKind.ESNext,
  57834. moduleResolution: t.ModuleResolutionKind.NodeJs,
  57835. noEmitOnError: false,
  57836. outDir: config.cacheDir || config.sys.tmpDirSync(),
  57837. sourceMap: config.sourceMap,
  57838. inlineSources: config.sourceMap,
  57839. };
  57840. return tsOptions;
  57841. };
  57842. const createTsBuildProgram = async (config, buildCallback) => {
  57843. let isRunning = false;
  57844. let timeoutId;
  57845. const optionsToExtend = getTsOptionsToExtend(config);
  57846. const tsWatchSys = {
  57847. ...t.sys,
  57848. watchFile(path, callback) {
  57849. if (path.endsWith(`/${GENERATED_DTS$1}`)) {
  57850. return t.sys.watchFile(path, callback);
  57851. }
  57852. return {
  57853. close() { },
  57854. };
  57855. },
  57856. watchDirectory() {
  57857. return {
  57858. close() { },
  57859. };
  57860. },
  57861. setTimeout(callback, time) {
  57862. timeoutId = setInterval(() => {
  57863. if (!isRunning) {
  57864. callback();
  57865. clearInterval(timeoutId);
  57866. }
  57867. }, config.sys.watchTimeout || time);
  57868. return timeoutId;
  57869. },
  57870. clearTimeout(id) {
  57871. return clearInterval(id);
  57872. },
  57873. };
  57874. config.sys.addDestory(() => tsWatchSys.clearTimeout(timeoutId));
  57875. const tsWatchHost = t.createWatchCompilerHost(config.tsconfig, optionsToExtend, tsWatchSys, t.createEmitAndSemanticDiagnosticsBuilderProgram, (reportDiagnostic) => {
  57876. config.logger.debug('watch reportDiagnostic:' + reportDiagnostic.messageText);
  57877. }, (reportWatchStatus) => {
  57878. config.logger.debug(reportWatchStatus.messageText);
  57879. });
  57880. tsWatchHost.afterProgramCreate = async (tsBuilder) => {
  57881. isRunning = true;
  57882. await buildCallback(tsBuilder);
  57883. isRunning = false;
  57884. };
  57885. return t.createWatchProgram(tsWatchHost);
  57886. };
  57887. const createFullBuild = async (config, compilerCtx) => {
  57888. return new Promise((resolve) => {
  57889. let tsWatchProgram = null;
  57890. compilerCtx.events.on('fileUpdate', (p) => {
  57891. config.logger.debug(`fileUpdate: ${p}`);
  57892. compilerCtx.fs.clearFileCache(p);
  57893. });
  57894. const onBuild = async (tsBuilder) => {
  57895. const buildCtx = new BuildContext(config, compilerCtx);
  57896. buildCtx.isRebuild = false;
  57897. buildCtx.requiresFullBuild = true;
  57898. buildCtx.start();
  57899. const result = await build(config, compilerCtx, buildCtx, tsBuilder);
  57900. if (result !== null) {
  57901. if (tsWatchProgram) {
  57902. tsWatchProgram.close();
  57903. tsWatchProgram = null;
  57904. }
  57905. resolve(result);
  57906. }
  57907. };
  57908. createTsBuildProgram(config, onBuild).then((program) => {
  57909. tsWatchProgram = program;
  57910. });
  57911. });
  57912. };
  57913. const createInMemoryFs = (sys) => {
  57914. const items = new Map();
  57915. const outputTargetTypes = new Map();
  57916. const accessData = async (filePath) => {
  57917. const item = getItem(filePath);
  57918. if (typeof item.exists === 'boolean') {
  57919. return {
  57920. exists: item.exists,
  57921. isDirectory: item.isDirectory,
  57922. isFile: item.isFile,
  57923. };
  57924. }
  57925. const data = {
  57926. exists: false,
  57927. isDirectory: false,
  57928. isFile: false,
  57929. };
  57930. const s = await stat(filePath);
  57931. if (s) {
  57932. item.exists = s.exists;
  57933. item.isDirectory = s.isDirectory;
  57934. item.isFile = s.isFile;
  57935. data.exists = item.exists;
  57936. data.isDirectory = item.isDirectory;
  57937. data.isFile = item.isFile;
  57938. }
  57939. else {
  57940. item.exists = false;
  57941. }
  57942. return data;
  57943. };
  57944. const access = async (filePath) => {
  57945. const data = await accessData(filePath);
  57946. return data.exists;
  57947. };
  57948. /**
  57949. * Synchronous!!! Do not use!!!
  57950. * (Only typescript transpiling is allowed to use)
  57951. * @param filePath
  57952. */
  57953. const accessSync = (filePath) => {
  57954. const item = getItem(filePath);
  57955. if (typeof item.exists !== 'boolean') {
  57956. const s = statSync(filePath);
  57957. item.exists = s.exists;
  57958. item.isDirectory = s.isDirectory;
  57959. item.isFile = s.isFile;
  57960. }
  57961. return item.exists;
  57962. };
  57963. const copyFile = async (src, dest) => {
  57964. const item = getItem(src);
  57965. item.queueCopyFileToDest = dest;
  57966. };
  57967. const emptyDirs = async (dirs) => {
  57968. dirs = dirs
  57969. .filter(isString$1)
  57970. .map(normalizePath$1)
  57971. .reduce((dirs, dir) => {
  57972. if (!dirs.includes(dir)) {
  57973. dirs.push(dir);
  57974. }
  57975. return dirs;
  57976. }, []);
  57977. const allFsItems = await Promise.all(dirs.map((dir) => readdir(dir, { recursive: true })));
  57978. const reducedItems = [];
  57979. for (const fsItems of allFsItems) {
  57980. for (const f of fsItems) {
  57981. if (!reducedItems.includes(f.absPath)) {
  57982. reducedItems.push(f.absPath);
  57983. }
  57984. }
  57985. }
  57986. reducedItems.sort((a, b) => {
  57987. const partsA = a.split('/').length;
  57988. const partsB = b.split('/').length;
  57989. if (partsA < partsB)
  57990. return 1;
  57991. if (partsA > partsB)
  57992. return -1;
  57993. return 0;
  57994. });
  57995. await Promise.all(reducedItems.map(removeItem));
  57996. dirs.forEach((dir) => {
  57997. const item = getItem(dir);
  57998. item.isFile = false;
  57999. item.isDirectory = true;
  58000. item.queueWriteToDisk = true;
  58001. item.queueDeleteFromDisk = false;
  58002. });
  58003. };
  58004. const readdir = async (dirPath, opts = {}) => {
  58005. dirPath = normalizePath$1(dirPath);
  58006. const collectedPaths = [];
  58007. if (opts.inMemoryOnly === true) {
  58008. let inMemoryDir = dirPath;
  58009. if (!inMemoryDir.endsWith('/')) {
  58010. inMemoryDir += '/';
  58011. }
  58012. const inMemoryDirs = dirPath.split('/');
  58013. items.forEach((d, filePath) => {
  58014. if (!filePath.startsWith(dirPath)) {
  58015. return;
  58016. }
  58017. const parts = filePath.split('/');
  58018. if (parts.length === inMemoryDirs.length + 1 || (opts.recursive && parts.length > inMemoryDirs.length)) {
  58019. if (d.exists) {
  58020. const item = {
  58021. absPath: filePath,
  58022. relPath: parts[inMemoryDirs.length],
  58023. isDirectory: d.isDirectory,
  58024. isFile: d.isFile,
  58025. };
  58026. if (!shouldExcludeFromReaddir(opts, item)) {
  58027. collectedPaths.push(item);
  58028. }
  58029. }
  58030. }
  58031. });
  58032. }
  58033. else {
  58034. // always a disk read
  58035. await readDirectory(dirPath, dirPath, opts, collectedPaths);
  58036. }
  58037. return collectedPaths.sort((a, b) => {
  58038. if (a.absPath < b.absPath)
  58039. return -1;
  58040. if (a.absPath > b.absPath)
  58041. return 1;
  58042. return 0;
  58043. });
  58044. };
  58045. const readDirectory = async (initPath, dirPath, opts, collectedPaths) => {
  58046. // used internally only so we could easily recursively drill down
  58047. // loop through this directory and sub directories
  58048. // always a disk read!!removeDir
  58049. const dirItems = await sys.readDir(dirPath);
  58050. if (dirItems.length > 0) {
  58051. // cache some facts about this path
  58052. const item = getItem(dirPath);
  58053. item.exists = true;
  58054. item.isFile = false;
  58055. item.isDirectory = true;
  58056. await Promise.all(dirItems.map(async (dirItem) => {
  58057. // let's loop through each of the files we've found so far
  58058. // create an absolute path of the item inside of this directory
  58059. const absPath = normalizePath$1(dirItem);
  58060. const relPath = normalizePath$1(relative$1(initPath, absPath));
  58061. // get the fs stats for the item, could be either a file or directory
  58062. const stats = await stat(absPath);
  58063. const childItem = {
  58064. absPath: absPath,
  58065. relPath: relPath,
  58066. isDirectory: stats.isDirectory,
  58067. isFile: stats.isFile,
  58068. };
  58069. if (shouldExcludeFromReaddir(opts, childItem)) {
  58070. return;
  58071. }
  58072. collectedPaths.push(childItem);
  58073. if (opts.recursive === true && stats.isDirectory === true) {
  58074. // looks like it's yet another directory
  58075. // let's keep drilling down
  58076. await readDirectory(initPath, absPath, opts, collectedPaths);
  58077. }
  58078. }));
  58079. }
  58080. };
  58081. const shouldExcludeFromReaddir = (opts, item) => {
  58082. if (item.isDirectory) {
  58083. if (Array.isArray(opts.excludeDirNames)) {
  58084. const base = basename(item.absPath);
  58085. if (opts.excludeDirNames.some((dir) => base === dir)) {
  58086. return true;
  58087. }
  58088. }
  58089. }
  58090. else {
  58091. if (Array.isArray(opts.excludeExtensions)) {
  58092. const p = item.relPath.toLowerCase();
  58093. if (opts.excludeExtensions.some((ext) => p.endsWith(ext))) {
  58094. return true;
  58095. }
  58096. }
  58097. }
  58098. return false;
  58099. };
  58100. const readFile = async (filePath, opts) => {
  58101. if (opts == null || opts.useCache === true || opts.useCache === undefined) {
  58102. const item = getItem(filePath);
  58103. if (item.exists && typeof item.fileText === 'string') {
  58104. return item.fileText;
  58105. }
  58106. }
  58107. const fileText = await sys.readFile(filePath);
  58108. const item = getItem(filePath);
  58109. if (typeof fileText === 'string') {
  58110. if (fileText.length < MAX_TEXT_CACHE) {
  58111. item.exists = true;
  58112. item.isFile = true;
  58113. item.isDirectory = false;
  58114. item.fileText = fileText;
  58115. }
  58116. }
  58117. else {
  58118. item.exists = false;
  58119. }
  58120. return fileText;
  58121. };
  58122. /**
  58123. * Synchronous!!! Do not use!!!
  58124. * (Only typescript transpiling is allowed to use)
  58125. * @param filePath
  58126. */
  58127. const readFileSync = (filePath, opts) => {
  58128. if (opts == null || opts.useCache === true || opts.useCache === undefined) {
  58129. const item = getItem(filePath);
  58130. if (item.exists && typeof item.fileText === 'string') {
  58131. return item.fileText;
  58132. }
  58133. }
  58134. const fileText = sys.readFileSync(filePath);
  58135. const item = getItem(filePath);
  58136. if (typeof fileText === 'string') {
  58137. if (fileText.length < MAX_TEXT_CACHE) {
  58138. item.exists = true;
  58139. item.isFile = true;
  58140. item.isDirectory = false;
  58141. item.fileText = fileText;
  58142. }
  58143. }
  58144. else {
  58145. item.exists = false;
  58146. }
  58147. return fileText;
  58148. };
  58149. const remove = async (itemPath) => {
  58150. const stats = await stat(itemPath);
  58151. if (stats.isDirectory === true) {
  58152. await removeDir(itemPath);
  58153. }
  58154. else if (stats.isFile === true) {
  58155. await removeItem(itemPath);
  58156. }
  58157. };
  58158. const removeDir = async (dirPath) => {
  58159. const item = getItem(dirPath);
  58160. item.isFile = false;
  58161. item.isDirectory = true;
  58162. if (!item.queueWriteToDisk) {
  58163. item.queueDeleteFromDisk = true;
  58164. }
  58165. try {
  58166. const dirItems = await readdir(dirPath, { recursive: true });
  58167. await Promise.all(dirItems.map((item) => {
  58168. if (item.relPath.endsWith('.gitkeep')) {
  58169. return null;
  58170. }
  58171. return removeItem(item.absPath);
  58172. }));
  58173. }
  58174. catch (e) {
  58175. // do not throw error if the directory never existed
  58176. }
  58177. };
  58178. const removeItem = async (filePath) => {
  58179. const item = getItem(filePath);
  58180. if (!item.queueWriteToDisk) {
  58181. item.queueDeleteFromDisk = true;
  58182. }
  58183. };
  58184. const stat = async (itemPath) => {
  58185. const item = getItem(itemPath);
  58186. if (typeof item.isDirectory !== 'boolean' || typeof item.isFile !== 'boolean') {
  58187. const stat = await sys.stat(itemPath);
  58188. if (!stat.error) {
  58189. item.exists = true;
  58190. if (stat.isFile) {
  58191. item.isFile = true;
  58192. item.isDirectory = false;
  58193. item.size = stat.size;
  58194. }
  58195. else if (stat.isDirectory) {
  58196. item.isFile = false;
  58197. item.isDirectory = true;
  58198. item.size = stat.size;
  58199. }
  58200. else {
  58201. item.isFile = false;
  58202. item.isDirectory = false;
  58203. item.size = null;
  58204. }
  58205. }
  58206. else {
  58207. item.exists = false;
  58208. }
  58209. }
  58210. return {
  58211. exists: !!item.exists,
  58212. isFile: !!item.isFile,
  58213. isDirectory: !!item.isDirectory,
  58214. size: typeof item.size === 'number' ? item.size : 0,
  58215. };
  58216. };
  58217. /**
  58218. * Synchronous!!! Do not use!!!
  58219. * Always returns an object, does not throw errors.
  58220. * (Only typescript transpiling is allowed to use)
  58221. * @param itemPath
  58222. */
  58223. const statSync = (itemPath) => {
  58224. const item = getItem(itemPath);
  58225. if (typeof item.isDirectory !== 'boolean' || typeof item.isFile !== 'boolean') {
  58226. const stat = sys.statSync(itemPath);
  58227. if (!stat.error) {
  58228. item.exists = true;
  58229. if (stat.isFile) {
  58230. item.isFile = true;
  58231. item.isDirectory = false;
  58232. item.size = stat.size;
  58233. }
  58234. else if (stat.isDirectory) {
  58235. item.isFile = false;
  58236. item.isDirectory = true;
  58237. item.size = stat.size;
  58238. }
  58239. else {
  58240. item.isFile = false;
  58241. item.isDirectory = false;
  58242. item.size = null;
  58243. }
  58244. }
  58245. else {
  58246. item.exists = false;
  58247. }
  58248. }
  58249. return {
  58250. exists: !!item.exists,
  58251. isFile: !!item.isFile,
  58252. isDirectory: !!item.isDirectory,
  58253. };
  58254. };
  58255. const writeFile = async (filePath, content, opts) => {
  58256. if (typeof filePath !== 'string') {
  58257. throw new Error(`writeFile, invalid filePath: ${filePath}`);
  58258. }
  58259. if (typeof content !== 'string') {
  58260. throw new Error(`writeFile, invalid content: ${filePath}`);
  58261. }
  58262. const results = {
  58263. ignored: false,
  58264. changedContent: false,
  58265. queuedWrite: false,
  58266. };
  58267. if (shouldIgnore(filePath) === true) {
  58268. results.ignored = true;
  58269. return results;
  58270. }
  58271. const item = getItem(filePath);
  58272. item.exists = true;
  58273. item.isFile = true;
  58274. item.isDirectory = false;
  58275. item.queueDeleteFromDisk = false;
  58276. if (typeof item.fileText === 'string') {
  58277. // compare strings but replace Windows CR to rule out any
  58278. // insignificant new line differences
  58279. results.changedContent = item.fileText.replace(/\r/g, '') !== content.replace(/\r/g, '');
  58280. }
  58281. else {
  58282. results.changedContent = true;
  58283. }
  58284. item.fileText = content;
  58285. results.queuedWrite = false;
  58286. if (opts != null) {
  58287. if (typeof opts.outputTargetType === 'string') {
  58288. outputTargetTypes.set(filePath, opts.outputTargetType);
  58289. }
  58290. if (opts.useCache === false) {
  58291. item.useCache = false;
  58292. }
  58293. }
  58294. if (opts != null && opts.inMemoryOnly === true) {
  58295. // we don't want to actually write this to disk
  58296. // just keep it in memory
  58297. if (item.queueWriteToDisk) {
  58298. // we already queued this file to write to disk
  58299. // in that case we still need to do it
  58300. results.queuedWrite = true;
  58301. }
  58302. else {
  58303. // we only want this in memory and
  58304. // it wasn't already queued to be written
  58305. item.queueWriteToDisk = false;
  58306. }
  58307. // ensure in-memory directories are created
  58308. await ensureDir(filePath, true);
  58309. }
  58310. else if (opts != null && opts.immediateWrite === true) {
  58311. // if this is an immediate write then write the file
  58312. // now and do not add it to the queue
  58313. if (results.changedContent || opts.useCache !== true) {
  58314. // writing the file to disk is a big deal and kicks off fs watchers
  58315. // so let's just double check that the file is actually different first
  58316. const existingFile = await sys.readFile(filePath);
  58317. if (typeof existingFile === 'string') {
  58318. results.changedContent = item.fileText.replace(/\r/g, '') !== existingFile.replace(/\r/g, '');
  58319. }
  58320. if (results.changedContent) {
  58321. await ensureDir(filePath, false);
  58322. await sys.writeFile(filePath, item.fileText);
  58323. }
  58324. }
  58325. }
  58326. else {
  58327. // we want to write this to disk (eventually)
  58328. // but only if the content is different
  58329. // from our existing cached content
  58330. if (!item.queueWriteToDisk && results.changedContent === true) {
  58331. // not already queued to be written
  58332. // and the content is different
  58333. item.queueWriteToDisk = true;
  58334. results.queuedWrite = true;
  58335. }
  58336. }
  58337. return results;
  58338. };
  58339. const writeFiles = (files, opts) => {
  58340. const writes = [];
  58341. if (isIterable(files)) {
  58342. files.forEach((content, filePath) => {
  58343. writes.push(writeFile(filePath, content, opts));
  58344. });
  58345. }
  58346. else {
  58347. Object.keys(files).map((filePath) => {
  58348. writes.push(writeFile(filePath, files[filePath], opts));
  58349. });
  58350. }
  58351. return Promise.all(writes);
  58352. };
  58353. const commit = async () => {
  58354. const instructions = getCommitInstructions(items);
  58355. // ensure directories we need exist
  58356. const dirsAdded = await commitEnsureDirs(instructions.dirsToEnsure, false);
  58357. // write all queued the files
  58358. const filesWritten = await commitWriteFiles(instructions.filesToWrite);
  58359. // write all queued the files to copy
  58360. const filesCopied = await commitCopyFiles(instructions.filesToCopy);
  58361. // remove all the queued files to be deleted
  58362. const filesDeleted = await commitDeleteFiles(instructions.filesToDelete);
  58363. // remove all the queued dirs to be deleted
  58364. const dirsDeleted = await commitDeleteDirs(instructions.dirsToDelete);
  58365. instructions.filesToDelete.forEach(clearFileCache);
  58366. instructions.dirsToDelete.forEach(clearDirCache);
  58367. // return only the files that were
  58368. return {
  58369. filesCopied,
  58370. filesWritten,
  58371. filesDeleted,
  58372. dirsDeleted,
  58373. dirsAdded,
  58374. };
  58375. };
  58376. const ensureDir = async (p, inMemoryOnly) => {
  58377. const allDirs = [];
  58378. while (true) {
  58379. p = dirname(p);
  58380. if (typeof p === 'string' &&
  58381. p.length > 0 &&
  58382. p !== '/' &&
  58383. p.endsWith(':/') === false &&
  58384. p.endsWith(':\\') === false) {
  58385. allDirs.push(p);
  58386. }
  58387. else {
  58388. break;
  58389. }
  58390. }
  58391. allDirs.reverse();
  58392. await commitEnsureDirs(allDirs, inMemoryOnly);
  58393. };
  58394. const commitEnsureDirs = async (dirsToEnsure, inMemoryOnly) => {
  58395. const dirsAdded = [];
  58396. for (const dirPath of dirsToEnsure) {
  58397. const item = getItem(dirPath);
  58398. if (item.exists === true && item.isDirectory === true) {
  58399. // already cached that this path is indeed an existing directory
  58400. continue;
  58401. }
  58402. try {
  58403. // cache that we know this is a directory on disk
  58404. item.exists = true;
  58405. item.isDirectory = true;
  58406. item.isFile = false;
  58407. if (!inMemoryOnly) {
  58408. await sys.createDir(dirPath);
  58409. }
  58410. dirsAdded.push(dirPath);
  58411. }
  58412. catch (e) { }
  58413. }
  58414. return dirsAdded;
  58415. };
  58416. const commitCopyFiles = (filesToCopy) => {
  58417. const copiedFiles = Promise.all(filesToCopy.map(async (data) => {
  58418. const src = data[0];
  58419. const dest = data[1];
  58420. await sys.copyFile(src, dest);
  58421. return [src, dest];
  58422. }));
  58423. return copiedFiles;
  58424. };
  58425. const commitWriteFiles = (filesToWrite) => {
  58426. const writtenFiles = Promise.all(filesToWrite.map(async (filePath) => {
  58427. if (typeof filePath !== 'string') {
  58428. throw new Error(`unable to writeFile without filePath`);
  58429. }
  58430. return commitWriteFile(filePath);
  58431. }));
  58432. return writtenFiles;
  58433. };
  58434. const commitWriteFile = async (filePath) => {
  58435. const item = getItem(filePath);
  58436. if (item.fileText == null) {
  58437. throw new Error(`unable to find item fileText to write: ${filePath}`);
  58438. }
  58439. await sys.writeFile(filePath, item.fileText);
  58440. if (item.useCache === false) {
  58441. clearFileCache(filePath);
  58442. }
  58443. return filePath;
  58444. };
  58445. const commitDeleteFiles = async (filesToDelete) => {
  58446. const deletedFiles = await Promise.all(filesToDelete.map(async (filePath) => {
  58447. if (typeof filePath !== 'string') {
  58448. throw new Error(`unable to unlink without filePath`);
  58449. }
  58450. await sys.removeFile(filePath);
  58451. return filePath;
  58452. }));
  58453. return deletedFiles;
  58454. };
  58455. const commitDeleteDirs = async (dirsToDelete) => {
  58456. const dirsDeleted = [];
  58457. for (const dirPath of dirsToDelete) {
  58458. await sys.removeDir(dirPath);
  58459. dirsDeleted.push(dirPath);
  58460. }
  58461. return dirsDeleted;
  58462. };
  58463. const clearDirCache = (dirPath) => {
  58464. dirPath = normalizePath$1(dirPath);
  58465. items.forEach((_, f) => {
  58466. const filePath = relative$1(dirPath, f).split('/')[0];
  58467. if (!filePath.startsWith('.') && !filePath.startsWith('/')) {
  58468. clearFileCache(f);
  58469. }
  58470. });
  58471. };
  58472. const clearFileCache = (filePath) => {
  58473. filePath = normalizePath$1(filePath);
  58474. const item = items.get(filePath);
  58475. if (item != null && !item.queueWriteToDisk) {
  58476. items.delete(filePath);
  58477. }
  58478. };
  58479. const cancelDeleteFilesFromDisk = (filePaths) => {
  58480. for (const filePath of filePaths) {
  58481. const item = getItem(filePath);
  58482. if (item.isFile === true && item.queueDeleteFromDisk === true) {
  58483. item.queueDeleteFromDisk = false;
  58484. }
  58485. }
  58486. };
  58487. const cancelDeleteDirectoriesFromDisk = (dirPaths) => {
  58488. for (const dirPath of dirPaths) {
  58489. const item = getItem(dirPath);
  58490. if (item.queueDeleteFromDisk === true) {
  58491. item.queueDeleteFromDisk = false;
  58492. }
  58493. }
  58494. };
  58495. const getItem = (itemPath) => {
  58496. itemPath = normalizePath$1(itemPath);
  58497. let item = items.get(itemPath);
  58498. if (item != null) {
  58499. return item;
  58500. }
  58501. items.set(itemPath, (item = {
  58502. exists: null,
  58503. fileText: null,
  58504. size: null,
  58505. mtimeMs: null,
  58506. isDirectory: null,
  58507. isFile: null,
  58508. queueCopyFileToDest: null,
  58509. queueDeleteFromDisk: null,
  58510. queueWriteToDisk: null,
  58511. useCache: null,
  58512. }));
  58513. return item;
  58514. };
  58515. const clearCache = () => items.clear();
  58516. const keys = () => Array.from(items.keys()).sort();
  58517. const getMemoryStats = () => `data length: ${items.size}`;
  58518. const getBuildOutputs = () => {
  58519. const outputs = [];
  58520. outputTargetTypes.forEach((outputTargetType, filePath) => {
  58521. const output = outputs.find((o) => o.type === outputTargetType);
  58522. if (output) {
  58523. output.files.push(filePath);
  58524. }
  58525. else {
  58526. outputs.push({
  58527. type: outputTargetType,
  58528. files: [filePath],
  58529. });
  58530. }
  58531. });
  58532. outputs.forEach((o) => o.files.sort());
  58533. return outputs.sort((a, b) => {
  58534. if (a.type < b.type)
  58535. return -1;
  58536. if (a.type > b.type)
  58537. return 1;
  58538. return 0;
  58539. });
  58540. };
  58541. // only cache if it's less than 5MB-ish (using .length as a rough guess)
  58542. // why 5MB? idk, seems like a good number for source text
  58543. // it's pretty darn large to cover almost ALL legitimate source files
  58544. // and anything larger is probably a REALLY large file and a rare case
  58545. // which we don't need to eat up memory for
  58546. const MAX_TEXT_CACHE = 5242880;
  58547. const fs = {
  58548. access,
  58549. accessSync,
  58550. accessData,
  58551. cancelDeleteDirectoriesFromDisk,
  58552. cancelDeleteFilesFromDisk,
  58553. clearCache,
  58554. clearDirCache,
  58555. clearFileCache,
  58556. commit,
  58557. copyFile,
  58558. emptyDirs,
  58559. getBuildOutputs,
  58560. getItem,
  58561. getMemoryStats,
  58562. keys,
  58563. readFile,
  58564. readFileSync,
  58565. readdir,
  58566. remove,
  58567. stat,
  58568. statSync,
  58569. sys,
  58570. writeFile,
  58571. writeFiles,
  58572. };
  58573. return fs;
  58574. };
  58575. const getCommitInstructions = (items) => {
  58576. const instructions = {
  58577. filesToDelete: [],
  58578. filesToWrite: [],
  58579. filesToCopy: [],
  58580. dirsToDelete: [],
  58581. dirsToEnsure: [],
  58582. };
  58583. items.forEach((item, itemPath) => {
  58584. if (item.queueWriteToDisk === true) {
  58585. if (item.isFile === true) {
  58586. instructions.filesToWrite.push(itemPath);
  58587. const dir = normalizePath$1(dirname(itemPath));
  58588. if (!instructions.dirsToEnsure.includes(dir)) {
  58589. instructions.dirsToEnsure.push(dir);
  58590. }
  58591. const dirDeleteIndex = instructions.dirsToDelete.indexOf(dir);
  58592. if (dirDeleteIndex > -1) {
  58593. instructions.dirsToDelete.splice(dirDeleteIndex, 1);
  58594. }
  58595. const fileDeleteIndex = instructions.filesToDelete.indexOf(itemPath);
  58596. if (fileDeleteIndex > -1) {
  58597. instructions.filesToDelete.splice(fileDeleteIndex, 1);
  58598. }
  58599. }
  58600. else if (item.isDirectory === true) {
  58601. if (!instructions.dirsToEnsure.includes(itemPath)) {
  58602. instructions.dirsToEnsure.push(itemPath);
  58603. }
  58604. const dirDeleteIndex = instructions.dirsToDelete.indexOf(itemPath);
  58605. if (dirDeleteIndex > -1) {
  58606. instructions.dirsToDelete.splice(dirDeleteIndex, 1);
  58607. }
  58608. }
  58609. }
  58610. else if (item.queueDeleteFromDisk === true) {
  58611. if (item.isDirectory && !instructions.dirsToEnsure.includes(itemPath)) {
  58612. instructions.dirsToDelete.push(itemPath);
  58613. }
  58614. else if (item.isFile && !instructions.filesToWrite.includes(itemPath)) {
  58615. instructions.filesToDelete.push(itemPath);
  58616. }
  58617. }
  58618. else if (typeof item.queueCopyFileToDest === 'string') {
  58619. const src = itemPath;
  58620. const dest = item.queueCopyFileToDest;
  58621. instructions.filesToCopy.push([src, dest]);
  58622. const dir = normalizePath$1(dirname(dest));
  58623. if (!instructions.dirsToEnsure.includes(dir)) {
  58624. instructions.dirsToEnsure.push(dir);
  58625. }
  58626. const dirDeleteIndex = instructions.dirsToDelete.indexOf(dir);
  58627. if (dirDeleteIndex > -1) {
  58628. instructions.dirsToDelete.splice(dirDeleteIndex, 1);
  58629. }
  58630. const fileDeleteIndex = instructions.filesToDelete.indexOf(dest);
  58631. if (fileDeleteIndex > -1) {
  58632. instructions.filesToDelete.splice(fileDeleteIndex, 1);
  58633. }
  58634. }
  58635. item.queueDeleteFromDisk = false;
  58636. item.queueWriteToDisk = false;
  58637. });
  58638. // add all the ancestor directories for each directory too
  58639. for (let i = 0, ilen = instructions.dirsToEnsure.length; i < ilen; i++) {
  58640. const segments = instructions.dirsToEnsure[i].split('/');
  58641. for (let j = 2; j < segments.length; j++) {
  58642. const dir = segments.slice(0, j).join('/');
  58643. if (instructions.dirsToEnsure.includes(dir) === false) {
  58644. instructions.dirsToEnsure.push(dir);
  58645. }
  58646. }
  58647. }
  58648. // sort directories so shortest paths are ensured first
  58649. instructions.dirsToEnsure.sort((a, b) => {
  58650. const segmentsA = a.split('/').length;
  58651. const segmentsB = b.split('/').length;
  58652. if (segmentsA < segmentsB)
  58653. return -1;
  58654. if (segmentsA > segmentsB)
  58655. return 1;
  58656. if (a.length < b.length)
  58657. return -1;
  58658. if (a.length > b.length)
  58659. return 1;
  58660. return 0;
  58661. });
  58662. // sort directories so longest paths are removed first
  58663. instructions.dirsToDelete.sort((a, b) => {
  58664. const segmentsA = a.split('/').length;
  58665. const segmentsB = b.split('/').length;
  58666. if (segmentsA < segmentsB)
  58667. return 1;
  58668. if (segmentsA > segmentsB)
  58669. return -1;
  58670. if (a.length < b.length)
  58671. return 1;
  58672. if (a.length > b.length)
  58673. return -1;
  58674. return 0;
  58675. });
  58676. for (const dirToEnsure of instructions.dirsToEnsure) {
  58677. const i = instructions.dirsToDelete.indexOf(dirToEnsure);
  58678. if (i > -1) {
  58679. instructions.dirsToDelete.splice(i, 1);
  58680. }
  58681. }
  58682. instructions.dirsToDelete = instructions.dirsToDelete.filter((dir) => {
  58683. if (dir === '/' || dir.endsWith(':/') === true) {
  58684. return false;
  58685. }
  58686. return true;
  58687. });
  58688. instructions.dirsToEnsure = instructions.dirsToEnsure.filter((dir) => {
  58689. const item = items.get(dir);
  58690. if (item != null && item.exists === true && item.isDirectory === true) {
  58691. return false;
  58692. }
  58693. if (dir === '/' || dir.endsWith(':/')) {
  58694. return false;
  58695. }
  58696. return true;
  58697. });
  58698. return instructions;
  58699. };
  58700. const shouldIgnore = (filePath) => {
  58701. filePath = filePath.trim().toLowerCase();
  58702. return IGNORE.some((ignoreFile) => filePath.endsWith(ignoreFile));
  58703. };
  58704. const IGNORE = ['.ds_store', '.gitignore', 'desktop.ini', 'thumbs.db'];
  58705. const createWorkerMainContext = (workerCtrl) => ({
  58706. optimizeCss: workerCtrl.handler('optimizeCss'),
  58707. prepareModule: workerCtrl.handler('prepareModule'),
  58708. prerenderWorker: workerCtrl.handler('prerenderWorker'),
  58709. transformCssToEsm: workerCtrl.handler('transformCssToEsm'),
  58710. });
  58711. const createSysWorker = (config) => {
  58712. if (isFunction(config.sys.createWorkerController) &&
  58713. config.maxConcurrentWorkers > 0 &&
  58714. config.sys.hardwareConcurrency > 1) {
  58715. const workerCtrl = config.sys.createWorkerController(config.maxConcurrentWorkers);
  58716. config.sys.addDestory(() => workerCtrl.destroy());
  58717. config.logger.debug(`create workers, maxWorkers: ${workerCtrl.maxWorkers}`);
  58718. return createWorkerMainContext(workerCtrl);
  58719. }
  58720. config.logger.debug(`no workers, maxConcurrentWorkers: ${config.maxConcurrentWorkers}, hardwareConcurrency: ${config.sys.hardwareConcurrency}`);
  58721. return createWorkerContext(config.sys);
  58722. };
  58723. const createTsWatchProgram = async (config, buildCallback) => {
  58724. let isRunning = false;
  58725. let lastTsBuilder;
  58726. let timeoutId;
  58727. let rebuildTimer;
  58728. const optionsToExtend = getTsOptionsToExtend(config);
  58729. const tsWatchSys = {
  58730. ...t.sys,
  58731. setTimeout(callback, time) {
  58732. clearInterval(rebuildTimer);
  58733. const t = (timeoutId = setInterval(() => {
  58734. if (!isRunning) {
  58735. callback();
  58736. clearInterval(t);
  58737. timeoutId = rebuildTimer = null;
  58738. }
  58739. }, config.sys.watchTimeout || time));
  58740. return t;
  58741. },
  58742. clearTimeout(id) {
  58743. return clearInterval(id);
  58744. },
  58745. };
  58746. config.sys.addDestory(() => tsWatchSys.clearTimeout(timeoutId));
  58747. const tsWatchHost = t.createWatchCompilerHost(config.tsconfig, optionsToExtend, tsWatchSys, t.createEmitAndSemanticDiagnosticsBuilderProgram, (reportDiagnostic) => {
  58748. config.logger.debug('watch reportDiagnostic:' + reportDiagnostic.messageText);
  58749. }, (reportWatchStatus) => {
  58750. config.logger.debug(reportWatchStatus.messageText);
  58751. });
  58752. tsWatchHost.afterProgramCreate = async (tsBuilder) => {
  58753. lastTsBuilder = tsBuilder;
  58754. isRunning = true;
  58755. await buildCallback(tsBuilder);
  58756. isRunning = false;
  58757. };
  58758. return {
  58759. program: t.createWatchProgram(tsWatchHost),
  58760. rebuild: () => {
  58761. if (lastTsBuilder && !timeoutId) {
  58762. rebuildTimer = tsWatchSys.setTimeout(() => tsWatchHost.afterProgramCreate(lastTsBuilder), 300);
  58763. }
  58764. },
  58765. };
  58766. };
  58767. const filesChanged = (buildCtx) => {
  58768. // files changed include updated, added and deleted
  58769. return unique([...buildCtx.filesUpdated, ...buildCtx.filesAdded, ...buildCtx.filesDeleted]).sort();
  58770. };
  58771. const scriptsAdded = (buildCtx) => {
  58772. // collect all the scripts that were added
  58773. return buildCtx.filesAdded
  58774. .filter((f) => {
  58775. return SCRIPT_EXT.some((ext) => f.endsWith(ext.toLowerCase()));
  58776. })
  58777. .map((f) => basename(f));
  58778. };
  58779. const scriptsDeleted = (buildCtx) => {
  58780. // collect all the scripts that were deleted
  58781. return buildCtx.filesDeleted
  58782. .filter((f) => {
  58783. return SCRIPT_EXT.some((ext) => f.endsWith(ext.toLowerCase()));
  58784. })
  58785. .map((f) => basename(f));
  58786. };
  58787. const hasScriptChanges = (buildCtx) => {
  58788. return buildCtx.filesChanged.some((f) => {
  58789. const ext = getExt(f);
  58790. return SCRIPT_EXT.includes(ext);
  58791. });
  58792. };
  58793. const hasStyleChanges = (buildCtx) => {
  58794. return buildCtx.filesChanged.some((f) => {
  58795. const ext = getExt(f);
  58796. return STYLE_EXT.includes(ext);
  58797. });
  58798. };
  58799. const getExt = (filePath) => filePath.split('.').pop().toLowerCase();
  58800. const SCRIPT_EXT = ['ts', 'tsx', 'js', 'jsx'];
  58801. const STYLE_EXT = ['css', 'scss', 'sass', 'pcss', 'styl', 'stylus', 'less'];
  58802. const hasHtmlChanges = (config, buildCtx) => {
  58803. const anyHtmlChanged = buildCtx.filesChanged.some((f) => f.toLowerCase().endsWith('.html'));
  58804. if (anyHtmlChanged) {
  58805. // any *.html in any directory that changes counts and rebuilds
  58806. return true;
  58807. }
  58808. const srcIndexHtmlChanged = buildCtx.filesChanged.some((fileChanged) => {
  58809. // the src index index.html file has changed
  58810. // this file name could be something other than index.html
  58811. return fileChanged === config.srcIndexHtml;
  58812. });
  58813. return srcIndexHtmlChanged;
  58814. };
  58815. const isWatchIgnorePath = (config, path) => {
  58816. if (isString$1(path)) {
  58817. const isWatchIgnore = config.watchIgnoredRegex.some((reg) => reg.test(path));
  58818. if (isWatchIgnore) {
  58819. return true;
  58820. }
  58821. const outputTargets = config.outputTargets;
  58822. const ignoreFiles = [
  58823. ...outputTargets.filter(isOutputTargetDocsJson).map((o) => o.file),
  58824. ...outputTargets.filter(isOutputTargetDocsJson).map((o) => o.typesFile),
  58825. ...outputTargets.filter(isOutputTargetStats).map((o) => o.file),
  58826. ...outputTargets.filter(isOutputTargetDocsVscode).map((o) => o.file),
  58827. ];
  58828. if (ignoreFiles.includes(path)) {
  58829. return true;
  58830. }
  58831. }
  58832. return false;
  58833. };
  58834. const createWatchBuild = async (config, compilerCtx) => {
  58835. let isRebuild = false;
  58836. let tsWatchProgram;
  58837. let closeResolver;
  58838. const watchWaiter = new Promise((resolve) => (closeResolver = resolve));
  58839. const dirsAdded = new Set();
  58840. const dirsDeleted = new Set();
  58841. const filesAdded = new Set();
  58842. const filesUpdated = new Set();
  58843. const filesDeleted = new Set();
  58844. const onBuild = async (tsBuilder) => {
  58845. const buildCtx = new BuildContext(config, compilerCtx);
  58846. buildCtx.isRebuild = isRebuild;
  58847. buildCtx.requiresFullBuild = !isRebuild;
  58848. buildCtx.dirsAdded = Array.from(dirsAdded.keys()).sort();
  58849. buildCtx.dirsDeleted = Array.from(dirsDeleted.keys()).sort();
  58850. buildCtx.filesAdded = Array.from(filesAdded.keys()).sort();
  58851. buildCtx.filesUpdated = Array.from(filesUpdated.keys()).sort();
  58852. buildCtx.filesDeleted = Array.from(filesDeleted.keys()).sort();
  58853. buildCtx.filesChanged = filesChanged(buildCtx);
  58854. buildCtx.scriptsAdded = scriptsAdded(buildCtx);
  58855. buildCtx.scriptsDeleted = scriptsDeleted(buildCtx);
  58856. buildCtx.hasScriptChanges = hasScriptChanges(buildCtx);
  58857. buildCtx.hasStyleChanges = hasStyleChanges(buildCtx);
  58858. buildCtx.hasHtmlChanges = hasHtmlChanges(config, buildCtx);
  58859. buildCtx.hasServiceWorkerChanges = hasServiceWorkerChanges(config, buildCtx);
  58860. dirsAdded.clear();
  58861. dirsDeleted.clear();
  58862. filesAdded.clear();
  58863. filesUpdated.clear();
  58864. filesDeleted.clear();
  58865. emitFsChange(compilerCtx, buildCtx);
  58866. buildCtx.start();
  58867. const result = await build(config, compilerCtx, buildCtx, tsBuilder);
  58868. if (result && !result.hasError) {
  58869. isRebuild = true;
  58870. }
  58871. };
  58872. const start = async () => {
  58873. const srcRead = watchSrcDirectory(config, compilerCtx);
  58874. const otherRead = watchRootFiles(config, compilerCtx);
  58875. await srcRead;
  58876. await otherRead;
  58877. tsWatchProgram = await createTsWatchProgram(config, onBuild);
  58878. return watchWaiter;
  58879. };
  58880. const watchingDirs = new Map();
  58881. const watchingFiles = new Map();
  58882. const onFsChange = (p, eventKind) => {
  58883. if (tsWatchProgram && !isWatchIgnorePath(config, p)) {
  58884. updateCompilerCtxCache(config, compilerCtx, p, eventKind);
  58885. switch (eventKind) {
  58886. case 'dirAdd':
  58887. dirsAdded.add(p);
  58888. break;
  58889. case 'dirDelete':
  58890. dirsDeleted.add(p);
  58891. break;
  58892. case 'fileAdd':
  58893. filesAdded.add(p);
  58894. break;
  58895. case 'fileUpdate':
  58896. filesUpdated.add(p);
  58897. break;
  58898. case 'fileDelete':
  58899. filesDeleted.add(p);
  58900. break;
  58901. }
  58902. config.logger.debug(`onFsChange ${eventKind}: ${p}`);
  58903. tsWatchProgram.rebuild();
  58904. }
  58905. };
  58906. const onDirChange = (p, eventKind) => {
  58907. if (eventKind != null) {
  58908. onFsChange(p, eventKind);
  58909. }
  58910. };
  58911. const close = async () => {
  58912. watchingDirs.forEach((w) => w.close());
  58913. watchingFiles.forEach((w) => w.close());
  58914. watchingDirs.clear();
  58915. watchingFiles.clear();
  58916. if (tsWatchProgram) {
  58917. tsWatchProgram.program.close();
  58918. tsWatchProgram = null;
  58919. }
  58920. const watcherCloseResults = {
  58921. exitCode: 0,
  58922. };
  58923. closeResolver(watcherCloseResults);
  58924. return watcherCloseResults;
  58925. };
  58926. const request = async (data) => compilerRequest(config, compilerCtx, data);
  58927. compilerCtx.addWatchFile = (filePath) => {
  58928. if (isString$1(filePath) && !watchingFiles.has(filePath) && !isWatchIgnorePath(config, filePath)) {
  58929. watchingFiles.set(filePath, config.sys.watchFile(filePath, onFsChange));
  58930. }
  58931. };
  58932. compilerCtx.addWatchDir = (dirPath, recursive) => {
  58933. if (isString$1(dirPath) && !watchingDirs.has(dirPath) && !isWatchIgnorePath(config, dirPath)) {
  58934. watchingDirs.set(dirPath, config.sys.watchDirectory(dirPath, onDirChange, recursive));
  58935. }
  58936. };
  58937. config.sys.addDestory(close);
  58938. return {
  58939. start,
  58940. close,
  58941. on: compilerCtx.events.on,
  58942. request,
  58943. };
  58944. };
  58945. const watchSrcDirectory = async (config, compilerCtx) => {
  58946. const srcFiles = await compilerCtx.fs.readdir(config.srcDir, {
  58947. recursive: true,
  58948. excludeDirNames: ['.cache', '.git', '.github', '.stencil', '.vscode', 'node_modules'],
  58949. excludeExtensions: [
  58950. '.md',
  58951. '.markdown',
  58952. '.txt',
  58953. '.spec.ts',
  58954. '.spec.tsx',
  58955. '.e2e.ts',
  58956. '.e2e.tsx',
  58957. '.gitignore',
  58958. '.editorconfig',
  58959. ],
  58960. });
  58961. srcFiles.filter(({ isFile }) => isFile).forEach(({ absPath }) => compilerCtx.addWatchFile(absPath));
  58962. compilerCtx.addWatchDir(config.srcDir, true);
  58963. };
  58964. const watchRootFiles = async (config, compilerCtx) => {
  58965. // non-src files that cause a rebuild
  58966. // mainly for root level config files, and getting an event when they change
  58967. const rootFiles = await compilerCtx.fs.readdir(config.rootDir, {
  58968. recursive: false,
  58969. excludeDirNames: ['.cache', '.git', '.github', '.stencil', '.vscode', 'node_modules'],
  58970. });
  58971. rootFiles.filter(({ isFile }) => isFile).forEach(({ absPath }) => compilerCtx.addWatchFile(absPath));
  58972. };
  58973. const emitFsChange = (compilerCtx, buildCtx) => {
  58974. if (buildCtx.dirsAdded.length > 0 ||
  58975. buildCtx.dirsDeleted.length > 0 ||
  58976. buildCtx.filesUpdated.length > 0 ||
  58977. buildCtx.filesAdded.length > 0 ||
  58978. buildCtx.filesDeleted.length > 0) {
  58979. compilerCtx.events.emit('fsChange', {
  58980. dirsAdded: buildCtx.dirsAdded.slice(),
  58981. dirsDeleted: buildCtx.dirsDeleted.slice(),
  58982. filesUpdated: buildCtx.filesUpdated.slice(),
  58983. filesAdded: buildCtx.filesAdded.slice(),
  58984. filesDeleted: buildCtx.filesDeleted.slice(),
  58985. });
  58986. }
  58987. };
  58988. const updateCompilerCtxCache = (config, compilerCtx, path, kind) => {
  58989. compilerCtx.fs.clearFileCache(path);
  58990. compilerCtx.changedFiles.add(path);
  58991. if (kind === 'fileDelete') {
  58992. compilerCtx.moduleMap.delete(path);
  58993. }
  58994. else if (kind === 'dirDelete') {
  58995. const fsRootDir = resolve$1('/');
  58996. compilerCtx.moduleMap.forEach((_, moduleFilePath) => {
  58997. let moduleAncestorDir = dirname(moduleFilePath);
  58998. for (let i = 0; i < 50; i++) {
  58999. if (moduleAncestorDir === config.rootDir || moduleAncestorDir === fsRootDir) {
  59000. break;
  59001. }
  59002. if (moduleAncestorDir === path) {
  59003. compilerCtx.fs.clearFileCache(moduleFilePath);
  59004. compilerCtx.moduleMap.delete(moduleFilePath);
  59005. compilerCtx.changedFiles.add(moduleFilePath);
  59006. break;
  59007. }
  59008. moduleAncestorDir = dirname(moduleAncestorDir);
  59009. }
  59010. });
  59011. }
  59012. };
  59013. const getConfig = (userConfig) => {
  59014. const config = { ...userConfig };
  59015. if (!config.logger) {
  59016. config.logger = createLogger();
  59017. }
  59018. if (!config.sys) {
  59019. config.sys = createSystem({ logger: config.logger });
  59020. }
  59021. setPlatformPath(config.sys.platformPath);
  59022. config.flags = config.flags || {};
  59023. if (config.flags.debug || config.flags.verbose) {
  59024. config.logLevel = 'debug';
  59025. }
  59026. else if (config.flags.logLevel) {
  59027. config.logLevel = config.flags.logLevel;
  59028. }
  59029. else if (typeof config.logLevel !== 'string') {
  59030. config.logLevel = 'info';
  59031. }
  59032. config.logger.setLevel(config.logLevel);
  59033. return config;
  59034. };
  59035. const patchFs = (userSys) => {
  59036. const fsObj = fs$3;
  59037. Object.assign(fsObj.__sys, userSys);
  59038. };
  59039. const createCompiler = async (config) => {
  59040. // actual compiler code
  59041. // could be in a web worker on the browser
  59042. // or the main thread in node
  59043. config = getConfig(config);
  59044. const diagnostics = [];
  59045. const sys = config.sys;
  59046. const compilerCtx = new CompilerContext();
  59047. if (isFunction(config.sys.setupCompiler)) {
  59048. config.sys.setupCompiler({ ts: t });
  59049. }
  59050. patchFs(sys);
  59051. compilerCtx.fs = createInMemoryFs(sys);
  59052. compilerCtx.cache = new Cache(config, createInMemoryFs(sys));
  59053. await compilerCtx.cache.initCacheDir();
  59054. sys.resolveModuleId = (opts) => resolveModuleIdAsync(sys, compilerCtx.fs, opts);
  59055. compilerCtx.worker = createSysWorker(config);
  59056. if (sys.events) {
  59057. // Pipe events from sys.events to compilerCtx
  59058. sys.events.on(compilerCtx.events.emit);
  59059. }
  59060. patchTypescript(config, compilerCtx.fs);
  59061. const build = () => createFullBuild(config, compilerCtx);
  59062. const createWatcher = () => createWatchBuild(config, compilerCtx);
  59063. const destroy = async () => {
  59064. compilerCtx.reset();
  59065. compilerCtx.events.unsubscribeAll();
  59066. await sys.destroy();
  59067. };
  59068. const compiler = {
  59069. build,
  59070. createWatcher,
  59071. destroy,
  59072. sys,
  59073. };
  59074. config.logger.printDiagnostics(diagnostics);
  59075. return compiler;
  59076. };
  59077. const createHydrateBuildId = () => {
  59078. // should be case insensitive because it could be in a URL
  59079. // and shouldn't start with a number cuz we might use it as a js prop
  59080. let chars = 'abcdefghijklmnopqrstuvwxyz';
  59081. let buildId = '';
  59082. while (buildId.length < 8) {
  59083. const char = chars[Math.floor(Math.random() * chars.length)];
  59084. buildId += char;
  59085. if (buildId.length === 1) {
  59086. chars += '0123456789';
  59087. }
  59088. }
  59089. return buildId;
  59090. };
  59091. const getWriteFilePathFromUrlPath = (manager, inputHref) => {
  59092. const baseUrl = new URL(manager.outputTarget.baseUrl, manager.devServerHostUrl);
  59093. const basePathname = baseUrl.pathname.toLowerCase();
  59094. const inputUrl = new URL(inputHref, manager.devServerHostUrl);
  59095. const inputPathname = inputUrl.pathname.toLowerCase();
  59096. const basePathParts = basePathname.split('/');
  59097. const inputPathParts = inputPathname.split('/');
  59098. const isPrerrenderRoot = basePathname === inputPathname;
  59099. let fileName;
  59100. if (isPrerrenderRoot) {
  59101. fileName = path$5.basename(manager.outputTarget.indexHtml);
  59102. }
  59103. else {
  59104. fileName = 'index.html';
  59105. }
  59106. const pathParts = [];
  59107. for (let i = 0; i < inputPathParts.length; i++) {
  59108. const basePathPart = basePathParts[i];
  59109. const inputPathPart = inputPathParts[i];
  59110. if (typeof basePathPart === 'string' && basePathPart === inputPathPart) {
  59111. continue;
  59112. }
  59113. if (i === inputPathParts.length - 1) {
  59114. const lastPart = inputPathParts[i].toLowerCase();
  59115. if (lastPart.endsWith('.html') || lastPart.endsWith('.htm')) {
  59116. fileName = inputPathParts[i];
  59117. break;
  59118. }
  59119. }
  59120. pathParts.push(inputPathPart);
  59121. }
  59122. pathParts.push(fileName);
  59123. // figure out the directory where this file will be saved
  59124. return path$5.join(manager.outputTarget.appDir, ...pathParts);
  59125. };
  59126. const initializePrerenderEntryUrls = (results, manager) => {
  59127. const entryAnchors = [];
  59128. if (Array.isArray(manager.prerenderConfig.entryUrls)) {
  59129. for (const entryUrl of manager.prerenderConfig.entryUrls) {
  59130. const entryAnchor = {
  59131. href: entryUrl,
  59132. };
  59133. entryAnchors.push(entryAnchor);
  59134. }
  59135. }
  59136. else {
  59137. const entryAnchor = {
  59138. href: manager.outputTarget.baseUrl,
  59139. };
  59140. entryAnchors.push(entryAnchor);
  59141. }
  59142. for (const entryAnchor of entryAnchors) {
  59143. // ensure each entry url is valid
  59144. // and has a domain
  59145. try {
  59146. new URL(entryAnchor.href, manager.outputTarget.baseUrl);
  59147. }
  59148. catch (e) {
  59149. const diagnostic = buildError(results.diagnostics);
  59150. diagnostic.header = `Invalid Prerender Entry Url: ${entryAnchor.href}`;
  59151. diagnostic.messageText = `Entry Urls must include the protocol and domain of the site being prerendered.`;
  59152. return;
  59153. }
  59154. }
  59155. const base = new URL(manager.outputTarget.baseUrl);
  59156. const hrefs = crawlAnchorsForNextUrls(manager.prerenderConfig, results.diagnostics, base, base, entryAnchors);
  59157. for (const href of hrefs) {
  59158. addUrlToPendingQueue(manager, href, '#entryUrl');
  59159. }
  59160. };
  59161. const addUrlToPendingQueue = (manager, queueUrl, fromUrl) => {
  59162. if (!isString$1(queueUrl) || queueUrl === '') {
  59163. return;
  59164. }
  59165. if (manager.urlsPending.has(queueUrl)) {
  59166. return;
  59167. }
  59168. if (manager.urlsProcessing.has(queueUrl)) {
  59169. return;
  59170. }
  59171. if (manager.urlsCompleted.has(queueUrl)) {
  59172. return;
  59173. }
  59174. manager.urlsPending.add(queueUrl);
  59175. if (manager.isDebug) {
  59176. const url = new URL(queueUrl, manager.outputTarget.baseUrl).pathname;
  59177. const from = fromUrl.startsWith('#') ? fromUrl : new URL(fromUrl, manager.outputTarget.baseUrl).pathname;
  59178. manager.config.logger.debug(`prerender queue: ${url} (from ${from})`);
  59179. }
  59180. };
  59181. const drainPrerenderQueue = (results, manager) => {
  59182. const nextUrl = manager.urlsPending.values().next();
  59183. if (!nextUrl.done) {
  59184. if (manager.urlsProcessing.size > manager.maxConcurrency) {
  59185. // slow it down there buddy, too many at one time
  59186. setTimeout(() => drainPrerenderQueue(results, manager));
  59187. }
  59188. else {
  59189. const url = nextUrl.value;
  59190. // looks like we're ready to prerender more
  59191. // remove from pending
  59192. manager.urlsPending.delete(url);
  59193. // move to processing
  59194. manager.urlsProcessing.add(url);
  59195. // kick off async prerendering
  59196. prerenderUrl(results, manager, url);
  59197. if (manager.urlsProcessing.size < manager.maxConcurrency) {
  59198. // could be more ready for prerendering
  59199. // let's check again after a tick
  59200. manager.config.sys.nextTick(() => drainPrerenderQueue(results, manager));
  59201. }
  59202. }
  59203. }
  59204. if (manager.urlsProcessing.size === 0 && manager.urlsPending.size === 0) {
  59205. if (isFunction(manager.resolve)) {
  59206. // we're not actively processing anything
  59207. // and there aren't anymore urls in the queue to be prerendered
  59208. // so looks like our job here is done, good work team
  59209. manager.resolve();
  59210. manager.resolve = null;
  59211. }
  59212. }
  59213. };
  59214. const prerenderUrl = async (results, manager, url) => {
  59215. let previewUrl = url;
  59216. try {
  59217. previewUrl = new URL(url).pathname;
  59218. let timespan;
  59219. if (manager.isDebug) {
  59220. timespan = manager.config.logger.createTimeSpan(`prerender start: ${previewUrl}`, true);
  59221. }
  59222. const prerenderRequest = {
  59223. appDir: manager.outputTarget.appDir,
  59224. baseUrl: manager.outputTarget.baseUrl,
  59225. buildId: results.buildId,
  59226. componentGraphPath: manager.componentGraphPath,
  59227. devServerHostUrl: manager.devServerHostUrl,
  59228. hydrateAppFilePath: manager.hydrateAppFilePath,
  59229. isDebug: manager.isDebug,
  59230. prerenderConfigPath: manager.prerenderConfigPath,
  59231. staticSite: manager.staticSite,
  59232. templateId: manager.templateId,
  59233. url: url,
  59234. writeToFilePath: getWriteFilePathFromUrlPath(manager, url),
  59235. };
  59236. // prender this path and wait on the results
  59237. const urlResults = await manager.prerenderUrlWorker(prerenderRequest);
  59238. if (manager.isDebug) {
  59239. const filePath = relative$1(manager.config.rootDir, urlResults.filePath);
  59240. const hasError = urlResults.diagnostics.some((d) => d.level === 'error');
  59241. if (hasError) {
  59242. timespan.finish(`prerender failed: ${previewUrl}, ${filePath}`, 'red');
  59243. }
  59244. else {
  59245. timespan.finish(`prerender finish: ${previewUrl}, ${filePath}`);
  59246. }
  59247. }
  59248. manager.diagnostics.push(...urlResults.diagnostics);
  59249. if (Array.isArray(urlResults.anchorUrls)) {
  59250. for (const anchorUrl of urlResults.anchorUrls) {
  59251. addUrlToPendingQueue(manager, anchorUrl, url);
  59252. }
  59253. }
  59254. }
  59255. catch (e) {
  59256. // darn, idk, bad news
  59257. catchError(manager.diagnostics, e);
  59258. }
  59259. manager.urlsProcessing.delete(url);
  59260. manager.urlsCompleted.add(url);
  59261. results.urls++;
  59262. const urlsCompletedSize = manager.urlsCompleted.size;
  59263. if (manager.progressLogger && urlsCompletedSize > 1) {
  59264. manager.progressLogger.update(` prerendered ${urlsCompletedSize} urls: ${manager.config.logger.dim(previewUrl)}`);
  59265. }
  59266. // let's try to drain the queue again and let this
  59267. // next call figure out if we're actually done or not
  59268. manager.config.sys.nextTick(() => drainPrerenderQueue(results, manager));
  59269. };
  59270. const generateSitemapXml = async (manager) => {
  59271. if (manager.prerenderConfig.sitemapXml === null) {
  59272. // if it's set to null then let's not create a sitemap.xml file
  59273. return null;
  59274. }
  59275. try {
  59276. if (typeof manager.prerenderConfig.sitemapXml !== 'function') {
  59277. // not set to null, but also no config.sitemapXml(), so let's make a default
  59278. manager.prerenderConfig.sitemapXml = function sitemapXml(opts) {
  59279. const content = [];
  59280. content.push(`<?xml version="1.0" encoding="UTF-8"?>`);
  59281. content.push(`<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">`);
  59282. for (const url of opts.urls) {
  59283. content.push(`<url><loc>${url}</loc></url>`);
  59284. }
  59285. content.push(`</urlset>`);
  59286. return content.join('\n');
  59287. };
  59288. }
  59289. const opts = {
  59290. urls: getSitemapUrls(manager),
  59291. baseUrl: manager.outputTarget.baseUrl,
  59292. dir: manager.outputTarget.appDir,
  59293. };
  59294. const userResults = manager.prerenderConfig.sitemapXml(opts);
  59295. if (userResults == null) {
  59296. return null;
  59297. }
  59298. const results = {
  59299. content: null,
  59300. filePath: null,
  59301. url: null,
  59302. };
  59303. if (typeof userResults === 'string') {
  59304. results.content = userResults;
  59305. }
  59306. else {
  59307. results.content = userResults.content;
  59308. results.filePath = userResults.filePath;
  59309. }
  59310. if (typeof results.content !== 'string') {
  59311. return null;
  59312. }
  59313. if (typeof results.filePath !== 'string') {
  59314. results.filePath = join(manager.outputTarget.appDir, `sitemap.xml`);
  59315. }
  59316. if (typeof results.url !== 'string') {
  59317. const sitemapUrl = new URL(`sitemap.xml`, manager.outputTarget.baseUrl);
  59318. results.url = sitemapUrl.href;
  59319. }
  59320. await manager.config.sys.writeFile(results.filePath, results.content);
  59321. return results;
  59322. }
  59323. catch (e) {
  59324. catchError(manager.diagnostics, e);
  59325. return null;
  59326. }
  59327. };
  59328. const getSitemapUrls = (manager) => {
  59329. const urls = [];
  59330. if (typeof manager.prerenderConfig.canonicalUrl === 'function') {
  59331. // user provide a canonicalUrl() function
  59332. // use that to normalize the urls for the sitemap.xml
  59333. // if it returned null then don't add it to the sitemap
  59334. for (const url of manager.urlsCompleted) {
  59335. const canonicalUrl = manager.prerenderConfig.canonicalUrl(new URL(url));
  59336. if (typeof canonicalUrl === 'string' && canonicalUrl.trim() !== '') {
  59337. urls.push(canonicalUrl);
  59338. }
  59339. }
  59340. }
  59341. else {
  59342. for (const url of manager.urlsCompleted) {
  59343. if (typeof url === 'string') {
  59344. urls.push(url);
  59345. }
  59346. }
  59347. }
  59348. return urls.sort(sortUrls);
  59349. };
  59350. const sortUrls = (a, b) => {
  59351. const partsA = a.split('/').length;
  59352. const partsB = b.split('/').length;
  59353. if (partsA < partsB)
  59354. return -1;
  59355. if (partsA > partsB)
  59356. return 1;
  59357. if (a < b)
  59358. return -1;
  59359. if (a > b)
  59360. return 1;
  59361. return 0;
  59362. };
  59363. const generateRobotsTxt = async (manager, sitemapResults) => {
  59364. if (manager.prerenderConfig.robotsTxt === null) {
  59365. // if it's set to null then let's not create a robots.txt file
  59366. return null;
  59367. }
  59368. try {
  59369. if (typeof manager.prerenderConfig.robotsTxt !== 'function') {
  59370. // not set to null, but also no config.robotsTxt(), so let's make a default
  59371. manager.prerenderConfig.robotsTxt = function robotsTxt(opts) {
  59372. const content = [`User-agent: *`, `Disallow:`];
  59373. if (typeof opts.sitemapUrl === 'string') {
  59374. content.push(`Sitemap: ${opts.sitemapUrl}`);
  59375. }
  59376. return content.join('\n');
  59377. };
  59378. }
  59379. const opts = {
  59380. urls: getSitemapUrls(manager),
  59381. baseUrl: manager.outputTarget.baseUrl,
  59382. sitemapUrl: sitemapResults ? sitemapResults.url : null,
  59383. dir: manager.outputTarget.dir,
  59384. };
  59385. const userResults = manager.prerenderConfig.robotsTxt(opts);
  59386. if (userResults == null) {
  59387. return null;
  59388. }
  59389. const results = {
  59390. content: null,
  59391. filePath: null,
  59392. url: null,
  59393. };
  59394. if (typeof userResults === 'string') {
  59395. results.content = userResults;
  59396. }
  59397. else {
  59398. results.content = userResults.content;
  59399. results.filePath = userResults.filePath;
  59400. }
  59401. if (typeof results.content !== 'string') {
  59402. return null;
  59403. }
  59404. const lines = results.content.replace(/\r/g, '\n').split('\n');
  59405. results.content = lines.map((l) => l.trim()).join('\n');
  59406. if (typeof results.filePath !== 'string') {
  59407. results.filePath = join(manager.outputTarget.dir, `robots.txt`);
  59408. }
  59409. if (typeof results.url !== 'string') {
  59410. const robotsTxtUrl = new URL(`/robots.txt`, manager.outputTarget.baseUrl);
  59411. results.url = robotsTxtUrl.href;
  59412. }
  59413. await manager.config.sys.writeFile(results.filePath, results.content);
  59414. return results;
  59415. }
  59416. catch (e) {
  59417. catchError(manager.diagnostics, e);
  59418. return null;
  59419. }
  59420. };
  59421. const generateTemplateHtml = async (config, prerenderConfig, diagnostics, isDebug, srcIndexHtmlPath, outputTarget, hydrateOpts, manager) => {
  59422. try {
  59423. if (!isString$1(srcIndexHtmlPath)) {
  59424. srcIndexHtmlPath = outputTarget.indexHtml;
  59425. }
  59426. let templateHtml;
  59427. if (isFunction(prerenderConfig.loadTemplate)) {
  59428. const loadTemplateResult = prerenderConfig.loadTemplate(srcIndexHtmlPath);
  59429. if (isPromise(loadTemplateResult)) {
  59430. templateHtml = await loadTemplateResult;
  59431. }
  59432. else {
  59433. templateHtml = loadTemplateResult;
  59434. }
  59435. }
  59436. else {
  59437. templateHtml = await config.sys.readFile(srcIndexHtmlPath);
  59438. }
  59439. let doc = createDocument(templateHtml);
  59440. let staticSite = false;
  59441. if (prerenderConfig.staticSite) {
  59442. // purposely do not want any clientside JS
  59443. // go through the document and remove only stencil's scripts
  59444. removeStencilScripts(doc);
  59445. staticSite = true;
  59446. }
  59447. else {
  59448. // config didn't set if it's a staticSite only,
  59449. // but the HTML may not have any stencil scripts at all,
  59450. // so we'll need to know that so we don't add preload modules
  59451. // if there isn't at least one stencil script then it's a static site
  59452. staticSite = !hasStencilScript(doc);
  59453. }
  59454. doc.documentElement.classList.add('hydrated');
  59455. if (hydrateOpts.inlineExternalStyleSheets && !isDebug) {
  59456. try {
  59457. await inlineExternalStyleSheets(config.sys, outputTarget.appDir, doc);
  59458. }
  59459. catch (e) {
  59460. catchError(diagnostics, e);
  59461. }
  59462. }
  59463. if (hydrateOpts.minifyScriptElements && !isDebug) {
  59464. try {
  59465. await minifyScriptElements(doc, true);
  59466. }
  59467. catch (e) {
  59468. catchError(diagnostics, e);
  59469. }
  59470. }
  59471. if (hydrateOpts.minifyStyleElements && !isDebug) {
  59472. try {
  59473. const baseUrl = new URL(outputTarget.baseUrl, manager.devServerHostUrl);
  59474. await minifyStyleElements(config.sys, outputTarget.appDir, doc, baseUrl, true);
  59475. }
  59476. catch (e) {
  59477. catchError(diagnostics, e);
  59478. }
  59479. }
  59480. if (isFunction(prerenderConfig.beforeSerializeTemplate)) {
  59481. const beforeSerializeResults = prerenderConfig.beforeSerializeTemplate(doc);
  59482. if (isPromise(beforeSerializeResults)) {
  59483. doc = await beforeSerializeResults;
  59484. }
  59485. else {
  59486. doc = beforeSerializeResults;
  59487. }
  59488. }
  59489. let html = serializeNodeToHtml(doc);
  59490. if (isFunction(prerenderConfig.afterSerializeTemplate)) {
  59491. const afterSerializeResults = prerenderConfig.afterSerializeTemplate(html);
  59492. if (isPromise(afterSerializeResults)) {
  59493. html = await afterSerializeResults;
  59494. }
  59495. else {
  59496. html = afterSerializeResults;
  59497. }
  59498. }
  59499. return {
  59500. html,
  59501. staticSite,
  59502. };
  59503. }
  59504. catch (e) {
  59505. catchError(diagnostics, e);
  59506. }
  59507. return undefined;
  59508. };
  59509. const createPrerenderer = async (config) => {
  59510. const start = (opts) => {
  59511. return runPrerender(config, opts.hydrateAppFilePath, opts.componentGraph, opts.srcIndexHtmlPath, opts.buildId);
  59512. };
  59513. return {
  59514. start,
  59515. };
  59516. };
  59517. const runPrerender = async (config, hydrateAppFilePath, componentGraph, srcIndexHtmlPath, buildId) => {
  59518. const startTime = Date.now();
  59519. const diagnostics = [];
  59520. const results = {
  59521. buildId,
  59522. diagnostics,
  59523. urls: 0,
  59524. duration: 0,
  59525. average: 0,
  59526. };
  59527. const outputTargets = config.outputTargets.filter(isOutputTargetWww).filter((o) => isString$1(o.indexHtml));
  59528. if (!isString$1(results.buildId)) {
  59529. results.buildId = createHydrateBuildId();
  59530. }
  59531. if (outputTargets.length === 0) {
  59532. return results;
  59533. }
  59534. if (!isString$1(hydrateAppFilePath)) {
  59535. const diagnostic = buildError(diagnostics);
  59536. diagnostic.header = `Prerender Error`;
  59537. diagnostic.messageText = `Build results missing "hydrateAppFilePath"`;
  59538. }
  59539. else {
  59540. if (!isAbsolute$1(hydrateAppFilePath)) {
  59541. hydrateAppFilePath = join(config.sys.getCurrentDirectory(), hydrateAppFilePath);
  59542. }
  59543. const hydrateAppExists = await config.sys.access(hydrateAppFilePath);
  59544. if (!hydrateAppExists) {
  59545. const diagnostic = buildError(diagnostics);
  59546. diagnostic.header = `Prerender Error`;
  59547. diagnostic.messageText = `Unable to open "hydrateAppFilePath": ${hydrateAppFilePath}`;
  59548. }
  59549. }
  59550. if (!hasError(diagnostics)) {
  59551. let workerCtx;
  59552. let workerCtrl;
  59553. if (config.sys.createWorkerController == null || config.maxConcurrentWorkers < 1) {
  59554. workerCtx = createWorkerContext(config.sys);
  59555. }
  59556. else {
  59557. workerCtrl = config.sys.createWorkerController(config.maxConcurrentWorkers);
  59558. workerCtx = createWorkerMainContext(workerCtrl);
  59559. }
  59560. const devServerConfig = { ...config.devServer };
  59561. devServerConfig.openBrowser = false;
  59562. devServerConfig.gzip = false;
  59563. devServerConfig.logRequests = false;
  59564. devServerConfig.reloadStrategy = null;
  59565. const devServerPath = config.sys.getDevServerExecutingPath();
  59566. const { start } = await config.sys.dynamicImport(devServerPath);
  59567. const devServer = await start(devServerConfig, config.logger);
  59568. try {
  59569. await Promise.all(outputTargets.map((outputTarget) => {
  59570. return runPrerenderOutputTarget(workerCtx, results, diagnostics, config, devServer, hydrateAppFilePath, componentGraph, srcIndexHtmlPath, outputTarget);
  59571. }));
  59572. }
  59573. catch (e) {
  59574. catchError(diagnostics, e);
  59575. }
  59576. if (workerCtrl) {
  59577. workerCtrl.destroy();
  59578. }
  59579. if (devServer) {
  59580. await devServer.close();
  59581. }
  59582. }
  59583. results.duration = Date.now() - startTime;
  59584. if (results.urls > 0) {
  59585. results.average = results.duration / results.urls;
  59586. }
  59587. return results;
  59588. };
  59589. const runPrerenderOutputTarget = async (workerCtx, results, diagnostics, config, devServer, hydrateAppFilePath, componentGraph, srcIndexHtmlPath, outputTarget) => {
  59590. try {
  59591. const timeSpan = config.logger.createTimeSpan(`prerendering started`);
  59592. const devServerBaseUrl = new URL(devServer.browserUrl);
  59593. const devServerHostUrl = devServerBaseUrl.origin;
  59594. const prerenderConfig = getPrerenderConfig(diagnostics, outputTarget.prerenderConfig);
  59595. const hydrateOpts = getHydrateOptions(prerenderConfig, devServerBaseUrl, diagnostics);
  59596. config.logger.debug(`prerender hydrate app: ${hydrateAppFilePath}`);
  59597. config.logger.debug(`prerender dev server: ${devServerHostUrl}`);
  59598. if (hasError(diagnostics)) {
  59599. return;
  59600. }
  59601. // get the prerender urls to queue up
  59602. const prerenderDiagnostics = [];
  59603. const manager = {
  59604. prerenderUrlWorker: (prerenderRequest) => workerCtx.prerenderWorker(prerenderRequest),
  59605. componentGraphPath: null,
  59606. config: config,
  59607. diagnostics: prerenderDiagnostics,
  59608. devServerHostUrl: devServerHostUrl,
  59609. hydrateAppFilePath: hydrateAppFilePath,
  59610. isDebug: config.logLevel === 'debug',
  59611. logCount: 0,
  59612. maxConcurrency: Math.max(20, config.maxConcurrentWorkers * 10),
  59613. outputTarget: outputTarget,
  59614. prerenderConfig: prerenderConfig,
  59615. prerenderConfigPath: outputTarget.prerenderConfig,
  59616. staticSite: false,
  59617. templateId: null,
  59618. urlsCompleted: new Set(),
  59619. urlsPending: new Set(),
  59620. urlsProcessing: new Set(),
  59621. resolve: null,
  59622. };
  59623. if (!config.flags.ci && !manager.isDebug) {
  59624. manager.progressLogger = await config.logger.createLineUpdater();
  59625. }
  59626. initializePrerenderEntryUrls(results, manager);
  59627. if (manager.urlsPending.size === 0) {
  59628. const err = buildError(diagnostics);
  59629. err.messageText = `prerendering failed: no urls found in the prerender config`;
  59630. return;
  59631. }
  59632. const templateData = await generateTemplateHtml(config, prerenderConfig, diagnostics, manager.isDebug, srcIndexHtmlPath, outputTarget, hydrateOpts, manager);
  59633. if (diagnostics.length > 0 || !templateData || !isString$1(templateData.html)) {
  59634. return;
  59635. }
  59636. manager.templateId = await createPrerenderTemplate(config, templateData.html);
  59637. manager.staticSite = templateData.staticSite;
  59638. manager.componentGraphPath = await createComponentGraphPath(config, componentGraph, outputTarget);
  59639. await new Promise((resolve) => {
  59640. manager.resolve = resolve;
  59641. config.sys.nextTick(() => drainPrerenderQueue(results, manager));
  59642. });
  59643. if (manager.isDebug) {
  59644. const debugDiagnostics = prerenderDiagnostics.filter((d) => d.level === 'debug');
  59645. if (debugDiagnostics.length > 0) {
  59646. config.logger.printDiagnostics(debugDiagnostics);
  59647. }
  59648. }
  59649. const duration = timeSpan.duration();
  59650. const sitemapResults = await generateSitemapXml(manager);
  59651. await generateRobotsTxt(manager, sitemapResults);
  59652. const prerenderBuildErrors = prerenderDiagnostics.filter((d) => d.level === 'error');
  59653. const prerenderRuntimeErrors = prerenderDiagnostics.filter((d) => d.type === 'runtime');
  59654. if (prerenderBuildErrors.length > 0) {
  59655. // convert to just runtime errors so the other build files still write
  59656. // but the CLI knows an error occurred and should have an exit code 1
  59657. for (const diagnostic of prerenderBuildErrors) {
  59658. diagnostic.type = 'runtime';
  59659. }
  59660. diagnostics.push(...prerenderBuildErrors);
  59661. }
  59662. diagnostics.push(...prerenderRuntimeErrors);
  59663. // Clear progress logger
  59664. if (manager.progressLogger) {
  59665. await manager.progressLogger.stop();
  59666. }
  59667. const totalUrls = manager.urlsCompleted.size;
  59668. if (totalUrls > 1) {
  59669. const average = Math.round(duration / totalUrls);
  59670. config.logger.info(`prerendered ${totalUrls} urls, averaging ${average} ms per url`);
  59671. }
  59672. const statusMessage = prerenderBuildErrors.length > 0 ? 'failed' : 'finished';
  59673. const statusColor = prerenderBuildErrors.length > 0 ? 'red' : 'green';
  59674. timeSpan.finish(`prerendering ${statusMessage}`, statusColor, true);
  59675. }
  59676. catch (e) {
  59677. catchError(diagnostics, e);
  59678. }
  59679. };
  59680. const createPrerenderTemplate = async (config, templateHtml) => {
  59681. const hash = await config.sys.generateContentHash(templateHtml, 12);
  59682. const templateFileName = `prerender-${hash}.html`;
  59683. const templateId = join(config.sys.tmpDirSync(), templateFileName);
  59684. config.logger.debug(`prerender template: ${templateId}`);
  59685. config.sys.writeFileSync(templateId, templateHtml);
  59686. return templateId;
  59687. };
  59688. const createComponentGraphPath = async (config, componentGraph, outputTarget) => {
  59689. if (componentGraph) {
  59690. const content = getComponentPathContent(componentGraph, outputTarget);
  59691. const hash = await config.sys.generateContentHash(content);
  59692. const fileName = `prerender-component-graph-${hash}.json`;
  59693. const componentGraphPath = join(config.sys.tmpDirSync(), fileName);
  59694. config.sys.writeFileSync(componentGraphPath, content);
  59695. return componentGraphPath;
  59696. }
  59697. return null;
  59698. };
  59699. const getComponentPathContent = (componentGraph, outputTarget) => {
  59700. const buildDir = getAbsoluteBuildDir(outputTarget);
  59701. const object = {};
  59702. const entries = Object.entries(componentGraph);
  59703. for (const [key, chunks] of entries) {
  59704. object[key] = chunks.map((filename) => join(buildDir, filename));
  59705. }
  59706. return JSON.stringify(object);
  59707. };
  59708. const dependencies = [
  59709. {
  59710. name: "@stencil/core",
  59711. version: "2.15.1",
  59712. main: "compiler/stencil.js",
  59713. resources: [
  59714. "package.json",
  59715. "compiler/lib.d.ts",
  59716. "compiler/lib.dom.d.ts",
  59717. "compiler/lib.dom.iterable.d.ts",
  59718. "compiler/lib.es2015.collection.d.ts",
  59719. "compiler/lib.es2015.core.d.ts",
  59720. "compiler/lib.es2015.d.ts",
  59721. "compiler/lib.es2015.generator.d.ts",
  59722. "compiler/lib.es2015.iterable.d.ts",
  59723. "compiler/lib.es2015.promise.d.ts",
  59724. "compiler/lib.es2015.proxy.d.ts",
  59725. "compiler/lib.es2015.reflect.d.ts",
  59726. "compiler/lib.es2015.symbol.d.ts",
  59727. "compiler/lib.es2015.symbol.wellknown.d.ts",
  59728. "compiler/lib.es2016.array.include.d.ts",
  59729. "compiler/lib.es2016.d.ts",
  59730. "compiler/lib.es2016.full.d.ts",
  59731. "compiler/lib.es2017.d.ts",
  59732. "compiler/lib.es2017.full.d.ts",
  59733. "compiler/lib.es2017.intl.d.ts",
  59734. "compiler/lib.es2017.object.d.ts",
  59735. "compiler/lib.es2017.sharedmemory.d.ts",
  59736. "compiler/lib.es2017.string.d.ts",
  59737. "compiler/lib.es2017.typedarrays.d.ts",
  59738. "compiler/lib.es2018.asyncgenerator.d.ts",
  59739. "compiler/lib.es2018.asynciterable.d.ts",
  59740. "compiler/lib.es2018.d.ts",
  59741. "compiler/lib.es2018.full.d.ts",
  59742. "compiler/lib.es2018.intl.d.ts",
  59743. "compiler/lib.es2018.promise.d.ts",
  59744. "compiler/lib.es2018.regexp.d.ts",
  59745. "compiler/lib.es2019.array.d.ts",
  59746. "compiler/lib.es2019.d.ts",
  59747. "compiler/lib.es2019.full.d.ts",
  59748. "compiler/lib.es2019.object.d.ts",
  59749. "compiler/lib.es2019.string.d.ts",
  59750. "compiler/lib.es2019.symbol.d.ts",
  59751. "compiler/lib.es2020.bigint.d.ts",
  59752. "compiler/lib.es2020.d.ts",
  59753. "compiler/lib.es2020.full.d.ts",
  59754. "compiler/lib.es2020.intl.d.ts",
  59755. "compiler/lib.es2020.promise.d.ts",
  59756. "compiler/lib.es2020.sharedmemory.d.ts",
  59757. "compiler/lib.es2020.string.d.ts",
  59758. "compiler/lib.es2020.symbol.wellknown.d.ts",
  59759. "compiler/lib.es2021.d.ts",
  59760. "compiler/lib.es2021.full.d.ts",
  59761. "compiler/lib.es2021.intl.d.ts",
  59762. "compiler/lib.es2021.promise.d.ts",
  59763. "compiler/lib.es2021.string.d.ts",
  59764. "compiler/lib.es2021.weakref.d.ts",
  59765. "compiler/lib.es5.d.ts",
  59766. "compiler/lib.es6.d.ts",
  59767. "compiler/lib.esnext.d.ts",
  59768. "compiler/lib.esnext.full.d.ts",
  59769. "compiler/lib.esnext.intl.d.ts",
  59770. "compiler/lib.esnext.promise.d.ts",
  59771. "compiler/lib.esnext.string.d.ts",
  59772. "compiler/lib.esnext.weakref.d.ts",
  59773. "compiler/lib.scripthost.d.ts",
  59774. "compiler/lib.webworker.d.ts",
  59775. "compiler/lib.webworker.importscripts.d.ts",
  59776. "compiler/lib.webworker.iterable.d.ts",
  59777. "internal/index.d.ts",
  59778. "internal/index.js",
  59779. "internal/package.json",
  59780. "internal/stencil-ext-modules.d.ts",
  59781. "internal/stencil-private.d.ts",
  59782. "internal/stencil-public-compiler.d.ts",
  59783. "internal/stencil-public-docs.d.ts",
  59784. "internal/stencil-public-runtime.d.ts",
  59785. "mock-doc/index.js",
  59786. "mock-doc/package.json",
  59787. "internal/client/css-shim.js",
  59788. "internal/client/dom.js",
  59789. "internal/client/index.js",
  59790. "internal/client/package.json",
  59791. "internal/client/patch-browser.js",
  59792. "internal/client/patch-esm.js",
  59793. "internal/client/shadow-css.js",
  59794. "internal/hydrate/index.js",
  59795. "internal/hydrate/package.json",
  59796. "internal/hydrate/runner.js",
  59797. "internal/hydrate/shadow-css.js",
  59798. "internal/stencil-core/index.d.ts",
  59799. "internal/stencil-core/index.js"
  59800. ]
  59801. },
  59802. {
  59803. name: "rollup",
  59804. version: "2.42.3",
  59805. main: "dist/es/rollup.browser.js"
  59806. },
  59807. {
  59808. name: "terser",
  59809. version: "5.6.1",
  59810. main: "dist/bundle.min.js"
  59811. },
  59812. {
  59813. name: "typescript",
  59814. version: "4.5.4",
  59815. main: "lib/typescript.js"
  59816. }
  59817. ];
  59818. const getAbsolutePath = (config, dir) => {
  59819. if (!isAbsolute$1(dir)) {
  59820. dir = join(config.rootDir, dir);
  59821. }
  59822. return dir;
  59823. };
  59824. const setBooleanConfig = (config, configName, flagName, defaultValue) => {
  59825. if (flagName) {
  59826. if (typeof config.flags[flagName] === 'boolean') {
  59827. config[configName] = config.flags[flagName];
  59828. }
  59829. }
  59830. const userConfigName = getUserConfigName(config, configName);
  59831. if (typeof config[userConfigName] === 'function') {
  59832. config[userConfigName] = !!config[userConfigName]();
  59833. }
  59834. if (typeof config[userConfigName] === 'boolean') {
  59835. config[configName] = config[userConfigName];
  59836. }
  59837. else {
  59838. config[configName] = defaultValue;
  59839. }
  59840. };
  59841. const getUserConfigName = (config, correctConfigName) => {
  59842. const userConfigNames = Object.keys(config);
  59843. for (const userConfigName of userConfigNames) {
  59844. if (userConfigName.toLowerCase() === correctConfigName.toLowerCase()) {
  59845. if (userConfigName !== correctConfigName) {
  59846. config.logger.warn(`config "${userConfigName}" should be "${correctConfigName}"`);
  59847. return userConfigName;
  59848. }
  59849. break;
  59850. }
  59851. }
  59852. return correctConfigName;
  59853. };
  59854. const validateDevServer = (config, diagnostics) => {
  59855. var _a;
  59856. if ((config.devServer === null || config.devServer) === false) {
  59857. return null;
  59858. }
  59859. const flags = config.flags;
  59860. const devServer = { ...config.devServer };
  59861. if (isString$1(flags.address)) {
  59862. devServer.address = flags.address;
  59863. }
  59864. else if (!isString$1(devServer.address)) {
  59865. devServer.address = '0.0.0.0';
  59866. }
  59867. let addressProtocol;
  59868. if (devServer.address.toLowerCase().startsWith('http://')) {
  59869. devServer.address = devServer.address.substring(7);
  59870. addressProtocol = 'http';
  59871. }
  59872. else if (devServer.address.toLowerCase().startsWith('https://')) {
  59873. devServer.address = devServer.address.substring(8);
  59874. addressProtocol = 'https';
  59875. }
  59876. devServer.address = devServer.address.split('/')[0];
  59877. let addressPort;
  59878. const addressSplit = devServer.address.split(':');
  59879. if (addressSplit.length > 1) {
  59880. if (!isNaN(addressSplit[1])) {
  59881. devServer.address = addressSplit[0];
  59882. addressPort = parseInt(addressSplit[1], 10);
  59883. }
  59884. }
  59885. if (isNumber$1(flags.port)) {
  59886. devServer.port = flags.port;
  59887. }
  59888. else if (devServer.port !== null && !isNumber$1(devServer.port)) {
  59889. if (isNumber$1(addressPort)) {
  59890. devServer.port = addressPort;
  59891. }
  59892. else if (devServer.address === 'localhost' || !isNaN(devServer.address.split('.')[0])) {
  59893. devServer.port = 3333;
  59894. }
  59895. else {
  59896. devServer.port = null;
  59897. }
  59898. }
  59899. if (devServer.reloadStrategy === undefined) {
  59900. devServer.reloadStrategy = 'hmr';
  59901. }
  59902. else if (devServer.reloadStrategy !== 'hmr' &&
  59903. devServer.reloadStrategy !== 'pageReload' &&
  59904. devServer.reloadStrategy !== null) {
  59905. const err = buildError(diagnostics);
  59906. err.messageText = `Invalid devServer reloadStrategy "${devServer.reloadStrategy}". Valid configs include "hmr", "pageReload" and null.`;
  59907. }
  59908. if (!isBoolean$1(devServer.gzip)) {
  59909. devServer.gzip = true;
  59910. }
  59911. if (!isBoolean$1(devServer.openBrowser)) {
  59912. devServer.openBrowser = true;
  59913. }
  59914. if (!isBoolean$1(devServer.websocket)) {
  59915. devServer.websocket = true;
  59916. }
  59917. if ((_a = config === null || config === void 0 ? void 0 : config.flags) === null || _a === void 0 ? void 0 : _a.ssr) {
  59918. devServer.ssr = true;
  59919. }
  59920. else {
  59921. devServer.ssr = !!devServer.ssr;
  59922. }
  59923. if (devServer.ssr) {
  59924. const wwwOutput = config.outputTargets.find(isOutputTargetWww);
  59925. devServer.prerenderConfig = wwwOutput === null || wwwOutput === void 0 ? void 0 : wwwOutput.prerenderConfig;
  59926. }
  59927. if (isString$1(config.srcIndexHtml)) {
  59928. devServer.srcIndexHtml = normalizePath$1(config.srcIndexHtml);
  59929. }
  59930. if (devServer.protocol !== 'http' && devServer.protocol !== 'https') {
  59931. devServer.protocol = devServer.https ? 'https' : addressProtocol ? addressProtocol : 'http';
  59932. }
  59933. if (devServer.historyApiFallback !== null && devServer.historyApiFallback !== false) {
  59934. devServer.historyApiFallback = devServer.historyApiFallback || {};
  59935. if (!isString$1(devServer.historyApiFallback.index)) {
  59936. devServer.historyApiFallback.index = 'index.html';
  59937. }
  59938. if (!isBoolean$1(devServer.historyApiFallback.disableDotRule)) {
  59939. devServer.historyApiFallback.disableDotRule = false;
  59940. }
  59941. }
  59942. if (flags.open === false) {
  59943. devServer.openBrowser = false;
  59944. }
  59945. else if (flags.prerender && !config.watch) {
  59946. devServer.openBrowser = false;
  59947. }
  59948. let serveDir = null;
  59949. let basePath = null;
  59950. const wwwOutputTarget = config.outputTargets.find(isOutputTargetWww);
  59951. if (wwwOutputTarget) {
  59952. const baseUrl = new URL(wwwOutputTarget.baseUrl, 'http://config.stenciljs.com');
  59953. basePath = baseUrl.pathname;
  59954. serveDir = wwwOutputTarget.appDir;
  59955. }
  59956. else {
  59957. serveDir = config.rootDir;
  59958. }
  59959. if (!isString$1(basePath) || basePath.trim() === '') {
  59960. basePath = `/`;
  59961. }
  59962. basePath = normalizePath$1(basePath);
  59963. if (!basePath.startsWith('/')) {
  59964. basePath = '/' + basePath;
  59965. }
  59966. if (!basePath.endsWith('/')) {
  59967. basePath += '/';
  59968. }
  59969. if (!isBoolean$1(devServer.logRequests)) {
  59970. devServer.logRequests = config.logLevel === 'debug';
  59971. }
  59972. if (!isString$1(devServer.root)) {
  59973. devServer.root = serveDir;
  59974. }
  59975. if (!isString$1(devServer.basePath)) {
  59976. devServer.basePath = basePath;
  59977. }
  59978. if (isString$1(devServer.baseUrl)) {
  59979. const err = buildError(diagnostics);
  59980. err.messageText = `devServer config "baseUrl" has been renamed to "basePath", and should not include a domain or protocol.`;
  59981. }
  59982. if (!isAbsolute$1(devServer.root)) {
  59983. devServer.root = join(config.rootDir, devServer.root);
  59984. }
  59985. devServer.root = normalizePath$1(devServer.root);
  59986. if (devServer.excludeHmr) {
  59987. if (!Array.isArray(devServer.excludeHmr)) {
  59988. const err = buildError(diagnostics);
  59989. err.messageText = `dev server excludeHmr must be an array of glob strings`;
  59990. }
  59991. }
  59992. else {
  59993. devServer.excludeHmr = [];
  59994. }
  59995. if (!config.devMode || config.buildEs5) {
  59996. devServer.experimentalDevModules = false;
  59997. }
  59998. else {
  59999. devServer.experimentalDevModules = !!devServer.experimentalDevModules;
  60000. }
  60001. return devServer;
  60002. };
  60003. const validateNamespace = (c, diagnostics) => {
  60004. c.namespace = isString$1(c.namespace) ? c.namespace : DEFAULT_NAMESPACE;
  60005. c.namespace = c.namespace.trim();
  60006. const invalidNamespaceChars = c.namespace.replace(/(\w)|(\-)|(\$)/g, '');
  60007. if (invalidNamespaceChars !== '') {
  60008. const err = buildError(diagnostics);
  60009. err.messageText = `Namespace "${c.namespace}" contains invalid characters: ${invalidNamespaceChars}`;
  60010. }
  60011. if (c.namespace.length < 3) {
  60012. const err = buildError(diagnostics);
  60013. err.messageText = `Namespace "${c.namespace}" must be at least 3 characters`;
  60014. }
  60015. if (/^\d+$/.test(c.namespace.charAt(0))) {
  60016. const err = buildError(diagnostics);
  60017. err.messageText = `Namespace "${c.namespace}" cannot have a number for the first character`;
  60018. }
  60019. if (c.namespace.charAt(0) === '-') {
  60020. const err = buildError(diagnostics);
  60021. err.messageText = `Namespace "${c.namespace}" cannot have a dash for the first character`;
  60022. }
  60023. if (c.namespace.charAt(c.namespace.length - 1) === '-') {
  60024. const err = buildError(diagnostics);
  60025. err.messageText = `Namespace "${c.namespace}" cannot have a dash for the last character`;
  60026. }
  60027. // the file system namespace is the one
  60028. // used in filenames and seen in the url
  60029. if (!isString$1(c.fsNamespace)) {
  60030. c.fsNamespace = c.namespace.toLowerCase().trim();
  60031. }
  60032. if (c.namespace.includes('-')) {
  60033. // convert to PascalCase
  60034. c.namespace = dashToPascalCase$1(c.namespace);
  60035. }
  60036. };
  60037. const validateDistNamespace = (config, diagnostics) => {
  60038. const hasDist = config.outputTargets.some(isOutputTargetDist);
  60039. if (hasDist) {
  60040. if (!isString$1(config.namespace) || config.namespace.toLowerCase() === 'app') {
  60041. const err = buildError(diagnostics);
  60042. err.messageText = `When generating a distribution it is recommended to choose a unique namespace rather than the default setting "App". Please updated the "namespace" config property within the stencil config.`;
  60043. }
  60044. }
  60045. };
  60046. const DEFAULT_NAMESPACE = 'App';
  60047. const validateHydrated = (config) => {
  60048. if (config.hydratedFlag === null || config.hydratedFlag === false) {
  60049. return null;
  60050. }
  60051. const hydratedFlag = { ...config.hydratedFlag };
  60052. if (!isString$1(hydratedFlag.name) || hydratedFlag.property === '') {
  60053. hydratedFlag.name = `hydrated`;
  60054. }
  60055. if (hydratedFlag.selector === 'attribute') {
  60056. hydratedFlag.selector = `attribute`;
  60057. }
  60058. else {
  60059. hydratedFlag.selector = `class`;
  60060. }
  60061. if (!isString$1(hydratedFlag.property) || hydratedFlag.property === '') {
  60062. hydratedFlag.property = `visibility`;
  60063. }
  60064. if (!isString$1(hydratedFlag.initialValue) && hydratedFlag.initialValue !== null) {
  60065. hydratedFlag.initialValue = `hidden`;
  60066. }
  60067. if (!isString$1(hydratedFlag.hydratedValue) && hydratedFlag.initialValue !== null) {
  60068. hydratedFlag.hydratedValue = `inherit`;
  60069. }
  60070. return hydratedFlag;
  60071. };
  60072. const validateCollection = (config, userOutputs) => {
  60073. return userOutputs.filter(isOutputTargetDistCollection).map((o) => {
  60074. return {
  60075. ...o,
  60076. dir: getAbsolutePath(config, o.dir || 'dist/collection'),
  60077. };
  60078. });
  60079. };
  60080. const validateCopy = (copy, defaultCopy = []) => {
  60081. if (copy === null || copy === false) {
  60082. return [];
  60083. }
  60084. if (!Array.isArray(copy)) {
  60085. copy = [];
  60086. }
  60087. copy = copy.slice();
  60088. for (const task of defaultCopy) {
  60089. if (copy.every((t) => t.src !== task.src)) {
  60090. copy.push(task);
  60091. }
  60092. }
  60093. return unique(copy, (task) => `${task.src}:${task.dest}:${task.keepDirStructure}`);
  60094. };
  60095. /**
  60096. * Validate one or more `dist-custom-elements` output targets. Validation of an output target may involve back-filling
  60097. * fields that are omitted with sensible defaults and/or creating additional supporting output targets that were not
  60098. * explicitly defined by the user
  60099. * @param config the Stencil configuration associated with the project being compiled
  60100. * @param userOutputs the output target(s) specified by the user
  60101. * @returns the validated output target(s)
  60102. */
  60103. const validateCustomElement = (config, userOutputs) => {
  60104. const defaultDir = 'dist';
  60105. return userOutputs.filter(isOutputTargetDistCustomElements).reduce((outputs, o) => {
  60106. const outputTarget = {
  60107. ...o,
  60108. dir: getAbsolutePath(config, o.dir || join(defaultDir, 'components')),
  60109. };
  60110. if (!isBoolean$1(outputTarget.empty)) {
  60111. outputTarget.empty = true;
  60112. }
  60113. if (!isBoolean$1(outputTarget.externalRuntime)) {
  60114. outputTarget.externalRuntime = true;
  60115. }
  60116. // unlike other output targets, Stencil does not allow users to define the output location of types at this time
  60117. if (outputTarget.generateTypeDeclarations) {
  60118. const typesDirectory = getAbsolutePath(config, join(defaultDir, 'types'));
  60119. outputs.push({
  60120. type: DIST_TYPES,
  60121. dir: outputTarget.dir,
  60122. typesDir: typesDirectory,
  60123. });
  60124. }
  60125. outputTarget.copy = validateCopy(outputTarget.copy, []);
  60126. if (outputTarget.copy.length > 0) {
  60127. outputs.push({
  60128. type: COPY,
  60129. dir: config.rootDir,
  60130. copy: [...outputTarget.copy],
  60131. });
  60132. }
  60133. outputs.push(outputTarget);
  60134. return outputs;
  60135. }, []);
  60136. };
  60137. const validateCustomOutput = (config, diagnostics, userOutputs) => {
  60138. return userOutputs.filter(isOutputTargetCustom).map((o) => {
  60139. if (o.validate) {
  60140. const localDiagnostics = [];
  60141. try {
  60142. o.validate(config, diagnostics);
  60143. }
  60144. catch (e) {
  60145. catchError(localDiagnostics, e);
  60146. }
  60147. if (o.copy && o.copy.length > 0) {
  60148. config.outputTargets.push({
  60149. type: COPY,
  60150. dir: config.rootDir,
  60151. copy: [...o.copy],
  60152. });
  60153. }
  60154. diagnostics.push(...localDiagnostics);
  60155. }
  60156. return o;
  60157. });
  60158. };
  60159. const validateDist = (config, userOutputs) => {
  60160. const distOutputTargets = userOutputs.filter(isOutputTargetDist);
  60161. return distOutputTargets.reduce((outputs, o) => {
  60162. const distOutputTarget = validateOutputTargetDist(config, o);
  60163. outputs.push(distOutputTarget);
  60164. const namespace = config.fsNamespace || 'app';
  60165. const lazyDir = join(distOutputTarget.buildDir, namespace);
  60166. // Lazy build for CDN in dist
  60167. outputs.push({
  60168. type: DIST_LAZY,
  60169. esmDir: lazyDir,
  60170. systemDir: config.buildEs5 ? lazyDir : undefined,
  60171. systemLoaderFile: config.buildEs5 ? join(lazyDir, namespace + '.js') : undefined,
  60172. legacyLoaderFile: join(distOutputTarget.buildDir, namespace + '.js'),
  60173. polyfills: distOutputTarget.polyfills !== undefined ? !!distOutputTarget.polyfills : true,
  60174. isBrowserBuild: true,
  60175. empty: distOutputTarget.empty,
  60176. });
  60177. outputs.push({
  60178. type: COPY,
  60179. dir: lazyDir,
  60180. copyAssets: 'dist',
  60181. copy: [...distOutputTarget.copy],
  60182. });
  60183. outputs.push({
  60184. type: DIST_GLOBAL_STYLES,
  60185. file: join(lazyDir, `${config.fsNamespace}.css`),
  60186. });
  60187. outputs.push({
  60188. type: DIST_TYPES,
  60189. dir: distOutputTarget.dir,
  60190. typesDir: distOutputTarget.typesDir,
  60191. empty: distOutputTarget.empty,
  60192. });
  60193. if (config.buildDist) {
  60194. if (distOutputTarget.collectionDir) {
  60195. outputs.push({
  60196. type: DIST_COLLECTION,
  60197. dir: distOutputTarget.dir,
  60198. collectionDir: distOutputTarget.collectionDir,
  60199. empty: distOutputTarget.empty,
  60200. });
  60201. outputs.push({
  60202. type: COPY,
  60203. dir: distOutputTarget.collectionDir,
  60204. copyAssets: 'collection',
  60205. copy: [...distOutputTarget.copy, { src: '**/*.svg' }, { src: '**/*.js' }],
  60206. });
  60207. }
  60208. const esmDir = join(distOutputTarget.dir, 'esm');
  60209. const esmEs5Dir = config.buildEs5 ? join(distOutputTarget.dir, 'esm-es5') : undefined;
  60210. const cjsDir = join(distOutputTarget.dir, 'cjs');
  60211. // Create lazy output-target
  60212. outputs.push({
  60213. type: DIST_LAZY,
  60214. esmDir,
  60215. esmEs5Dir,
  60216. cjsDir,
  60217. cjsIndexFile: join(distOutputTarget.dir, 'index.cjs.js'),
  60218. esmIndexFile: join(distOutputTarget.dir, 'index.js'),
  60219. polyfills: true,
  60220. empty: distOutputTarget.empty,
  60221. });
  60222. // Create output target that will generate the /loader entry-point
  60223. outputs.push({
  60224. type: DIST_LAZY_LOADER,
  60225. dir: distOutputTarget.esmLoaderPath,
  60226. esmDir,
  60227. esmEs5Dir,
  60228. cjsDir,
  60229. componentDts: getComponentsDtsTypesFilePath(distOutputTarget),
  60230. empty: distOutputTarget.empty,
  60231. });
  60232. }
  60233. return outputs;
  60234. }, []);
  60235. };
  60236. const validateOutputTargetDist = (config, o) => {
  60237. const outputTarget = {
  60238. ...o,
  60239. dir: getAbsolutePath(config, o.dir || DEFAULT_DIR),
  60240. };
  60241. if (!isString$1(outputTarget.buildDir)) {
  60242. outputTarget.buildDir = DEFAULT_BUILD_DIR;
  60243. }
  60244. if (!isAbsolute$1(outputTarget.buildDir)) {
  60245. outputTarget.buildDir = join(outputTarget.dir, outputTarget.buildDir);
  60246. }
  60247. if (outputTarget.collectionDir === undefined) {
  60248. outputTarget.collectionDir = DEFAULT_COLLECTION_DIR;
  60249. }
  60250. if (outputTarget.collectionDir && !isAbsolute$1(outputTarget.collectionDir)) {
  60251. outputTarget.collectionDir = join(outputTarget.dir, outputTarget.collectionDir);
  60252. }
  60253. if (!outputTarget.esmLoaderPath) {
  60254. outputTarget.esmLoaderPath = DEFAULT_ESM_LOADER_DIR;
  60255. }
  60256. if (!isAbsolute$1(outputTarget.esmLoaderPath)) {
  60257. outputTarget.esmLoaderPath = resolve$1(outputTarget.dir, outputTarget.esmLoaderPath);
  60258. }
  60259. if (!outputTarget.typesDir) {
  60260. outputTarget.typesDir = DEFAULT_TYPES_DIR;
  60261. }
  60262. if (!isAbsolute$1(outputTarget.typesDir)) {
  60263. outputTarget.typesDir = join(outputTarget.dir, outputTarget.typesDir);
  60264. }
  60265. if (!isBoolean$1(outputTarget.empty)) {
  60266. outputTarget.empty = true;
  60267. }
  60268. outputTarget.copy = validateCopy(outputTarget.copy, []);
  60269. return outputTarget;
  60270. };
  60271. const DEFAULT_DIR = 'dist';
  60272. const DEFAULT_BUILD_DIR = '';
  60273. const DEFAULT_COLLECTION_DIR = 'collection';
  60274. const DEFAULT_TYPES_DIR = 'types';
  60275. const DEFAULT_ESM_LOADER_DIR = 'loader';
  60276. const validateDocs = (config, diagnostics, userOutputs) => {
  60277. const docsOutputs = [];
  60278. // json docs flag
  60279. if (isString$1(config.flags.docsJson)) {
  60280. docsOutputs.push(validateJsonDocsOutputTarget(config, diagnostics, {
  60281. type: 'docs-json',
  60282. file: config.flags.docsJson,
  60283. }));
  60284. }
  60285. // json docs
  60286. const jsonDocsOutputs = userOutputs.filter(isOutputTargetDocsJson);
  60287. jsonDocsOutputs.forEach((jsonDocsOutput) => {
  60288. docsOutputs.push(validateJsonDocsOutputTarget(config, diagnostics, jsonDocsOutput));
  60289. });
  60290. // readme docs flag
  60291. if (config.flags.docs || config.flags.task === 'docs') {
  60292. if (!userOutputs.some(isOutputTargetDocsReadme)) {
  60293. // didn't provide a docs config, so let's add one
  60294. docsOutputs.push(validateReadmeOutputTarget(config, { type: 'docs-readme' }));
  60295. }
  60296. }
  60297. // readme docs
  60298. const readmeDocsOutputs = userOutputs.filter(isOutputTargetDocsReadme);
  60299. readmeDocsOutputs.forEach((readmeDocsOutput) => {
  60300. docsOutputs.push(validateReadmeOutputTarget(config, readmeDocsOutput));
  60301. });
  60302. // custom docs
  60303. const customDocsOutputs = userOutputs.filter(isOutputTargetDocsCustom);
  60304. customDocsOutputs.forEach((jsonDocsOutput) => {
  60305. docsOutputs.push(validateCustomDocsOutputTarget(diagnostics, jsonDocsOutput));
  60306. });
  60307. // vscode docs
  60308. const vscodeDocsOutputs = userOutputs.filter(isOutputTargetDocsVscode);
  60309. vscodeDocsOutputs.forEach((vscodeDocsOutput) => {
  60310. docsOutputs.push(validateVScodeDocsOutputTarget(diagnostics, vscodeDocsOutput));
  60311. });
  60312. return docsOutputs;
  60313. };
  60314. const validateReadmeOutputTarget = (config, outputTarget) => {
  60315. if (!isString$1(outputTarget.dir)) {
  60316. outputTarget.dir = config.srcDir;
  60317. }
  60318. if (!isAbsolute$1(outputTarget.dir)) {
  60319. outputTarget.dir = join(config.rootDir, outputTarget.dir);
  60320. }
  60321. if (outputTarget.footer == null) {
  60322. outputTarget.footer = NOTE;
  60323. }
  60324. outputTarget.strict = !!outputTarget.strict;
  60325. return outputTarget;
  60326. };
  60327. const validateJsonDocsOutputTarget = (config, diagnostics, outputTarget) => {
  60328. if (!isString$1(outputTarget.file)) {
  60329. const err = buildError(diagnostics);
  60330. err.messageText = `docs-json outputTarget missing the "file" option`;
  60331. }
  60332. outputTarget.file = join(config.rootDir, outputTarget.file);
  60333. if (isString$1(outputTarget.typesFile)) {
  60334. outputTarget.typesFile = join(config.rootDir, outputTarget.typesFile);
  60335. }
  60336. else if (outputTarget.typesFile !== null && outputTarget.file.endsWith('.json')) {
  60337. outputTarget.typesFile = outputTarget.file.replace(/\.json$/, '.d.ts');
  60338. }
  60339. outputTarget.strict = !!outputTarget.strict;
  60340. return outputTarget;
  60341. };
  60342. const validateCustomDocsOutputTarget = (diagnostics, outputTarget) => {
  60343. if (!isFunction(outputTarget.generator)) {
  60344. const err = buildError(diagnostics);
  60345. err.messageText = `docs-custom outputTarget missing the "generator" function`;
  60346. }
  60347. outputTarget.strict = !!outputTarget.strict;
  60348. return outputTarget;
  60349. };
  60350. const validateVScodeDocsOutputTarget = (diagnostics, outputTarget) => {
  60351. if (!isString$1(outputTarget.file)) {
  60352. const err = buildError(diagnostics);
  60353. err.messageText = `docs-vscode outputTarget missing the "file" path`;
  60354. }
  60355. return outputTarget;
  60356. };
  60357. const validateAngular = (userConfig, userOutputs) => {
  60358. const angularOutputTargets = userOutputs.filter(isOutputTargetAngular);
  60359. return angularOutputTargets.map((outputTarget) => {
  60360. let directivesProxyFile = outputTarget.directivesProxyFile;
  60361. if (directivesProxyFile && !isAbsolute$1(directivesProxyFile)) {
  60362. directivesProxyFile = join(userConfig.rootDir, directivesProxyFile);
  60363. }
  60364. let directivesArrayFile = outputTarget.directivesArrayFile;
  60365. if (directivesArrayFile && !isAbsolute$1(directivesArrayFile)) {
  60366. directivesArrayFile = join(userConfig.rootDir, directivesArrayFile);
  60367. }
  60368. let directivesUtilsFile = outputTarget.directivesUtilsFile;
  60369. if (directivesUtilsFile && !isAbsolute$1(directivesUtilsFile)) {
  60370. directivesUtilsFile = join(userConfig.rootDir, directivesUtilsFile);
  60371. }
  60372. return {
  60373. type: 'angular',
  60374. componentCorePackage: outputTarget.componentCorePackage,
  60375. directivesProxyFile,
  60376. directivesArrayFile,
  60377. directivesUtilsFile,
  60378. excludeComponents: outputTarget.excludeComponents || [],
  60379. };
  60380. });
  60381. };
  60382. const validateHydrateScript = (config, userOutputs) => {
  60383. const output = [];
  60384. const hasHydrateOutputTarget = userOutputs.some(isOutputTargetHydrate);
  60385. if (!hasHydrateOutputTarget) {
  60386. // we don't already have a hydrate output target
  60387. // let's still see if we require one because of other output targets
  60388. const hasWwwOutput = userOutputs.filter(isOutputTargetWww).some((o) => isString$1(o.indexHtml));
  60389. const shouldBuildHydrate = (config === null || config === void 0 ? void 0 : config.flags.prerender) || (config === null || config === void 0 ? void 0 : config.flags.ssr);
  60390. if (hasWwwOutput && shouldBuildHydrate) {
  60391. // we're prerendering a www output target, so we'll need a hydrate app
  60392. let hydrateDir;
  60393. const distOutput = userOutputs.find(isOutputTargetDist);
  60394. if (distOutput != null && isString$1(distOutput.dir)) {
  60395. hydrateDir = join(distOutput.dir, 'hydrate');
  60396. }
  60397. else {
  60398. hydrateDir = 'dist/hydrate';
  60399. }
  60400. const hydrateForWwwOutputTarget = {
  60401. type: DIST_HYDRATE_SCRIPT,
  60402. dir: hydrateDir,
  60403. };
  60404. userOutputs.push(hydrateForWwwOutputTarget);
  60405. }
  60406. }
  60407. const hydrateOutputTargets = userOutputs.filter(isOutputTargetHydrate);
  60408. hydrateOutputTargets.forEach((outputTarget) => {
  60409. if (!isString$1(outputTarget.dir)) {
  60410. // no directory given, see if we've got a dist to go off of
  60411. outputTarget.dir = 'hydrate';
  60412. }
  60413. if (!isAbsolute$1(outputTarget.dir)) {
  60414. outputTarget.dir = join(config.rootDir, outputTarget.dir);
  60415. }
  60416. if (!isBoolean$1(outputTarget.empty)) {
  60417. outputTarget.empty = true;
  60418. }
  60419. outputTarget.external = outputTarget.external || [];
  60420. outputTarget.external.push(...NODE_BUILTINS);
  60421. output.push(outputTarget);
  60422. });
  60423. return output;
  60424. };
  60425. const validateLazy = (config, userOutputs) => {
  60426. return userOutputs.filter(isOutputTargetDistLazy).map((o) => {
  60427. const dir = getAbsolutePath(config, o.dir || join('dist', config.fsNamespace));
  60428. const lazyOutput = {
  60429. type: DIST_LAZY,
  60430. esmDir: dir,
  60431. systemDir: config.buildEs5 ? dir : undefined,
  60432. systemLoaderFile: config.buildEs5 ? join(dir, `${config.fsNamespace}.js`) : undefined,
  60433. polyfills: !!o.polyfills,
  60434. isBrowserBuild: true,
  60435. empty: isBoolean$1(o.empty) ? o.empty : true,
  60436. };
  60437. return lazyOutput;
  60438. });
  60439. };
  60440. const validateStats = (userConfig, userOutputs) => {
  60441. const outputTargets = [];
  60442. if (userConfig.flags.stats) {
  60443. const hasOutputTarget = userOutputs.some(isOutputTargetStats);
  60444. if (!hasOutputTarget) {
  60445. outputTargets.push({
  60446. type: STATS,
  60447. });
  60448. }
  60449. }
  60450. outputTargets.push(...userOutputs.filter(isOutputTargetStats));
  60451. outputTargets.forEach((outputTarget) => {
  60452. if (!outputTarget.file) {
  60453. outputTarget.file = 'stencil-stats.json';
  60454. }
  60455. if (!isAbsolute$1(outputTarget.file)) {
  60456. outputTarget.file = join(userConfig.rootDir, outputTarget.file);
  60457. }
  60458. });
  60459. return outputTargets;
  60460. };
  60461. const validatePrerender = (config, diagnostics, outputTarget) => {
  60462. if (!config.flags || (!config.flags.ssr && !config.flags.prerender && config.flags.task !== 'prerender')) {
  60463. return;
  60464. }
  60465. outputTarget.baseUrl = normalizePath$1(outputTarget.baseUrl);
  60466. if (!outputTarget.baseUrl.startsWith('http://') && !outputTarget.baseUrl.startsWith('https://')) {
  60467. const err = buildError(diagnostics);
  60468. err.messageText = `When prerendering, the "baseUrl" output target config must be a full URL and start with either "http://" or "https://". The config can be updated in the "www" output target within the stencil config.`;
  60469. }
  60470. try {
  60471. new URL(outputTarget.baseUrl);
  60472. }
  60473. catch (e) {
  60474. const err = buildError(diagnostics);
  60475. err.messageText = `invalid "baseUrl": ${e}`;
  60476. }
  60477. if (!outputTarget.baseUrl.endsWith('/')) {
  60478. outputTarget.baseUrl += '/';
  60479. }
  60480. if (isString$1(outputTarget.prerenderConfig)) {
  60481. if (!isAbsolute$1(outputTarget.prerenderConfig)) {
  60482. outputTarget.prerenderConfig = join(config.rootDir, outputTarget.prerenderConfig);
  60483. }
  60484. }
  60485. };
  60486. const HOST_CONFIG_FILENAME = 'host.config.json';
  60487. const validateServiceWorker = (config, outputTarget) => {
  60488. if (outputTarget.serviceWorker === false) {
  60489. return;
  60490. }
  60491. if (config.devMode && !config.flags.serviceWorker) {
  60492. outputTarget.serviceWorker = null;
  60493. return;
  60494. }
  60495. if (outputTarget.serviceWorker === null) {
  60496. outputTarget.serviceWorker = null;
  60497. return;
  60498. }
  60499. if (outputTarget.serviceWorker === true) {
  60500. outputTarget.serviceWorker = {};
  60501. }
  60502. else if (!outputTarget.serviceWorker && config.devMode) {
  60503. outputTarget.serviceWorker = null;
  60504. return;
  60505. }
  60506. if (typeof outputTarget.serviceWorker !== 'object') {
  60507. // what was passed in could have been a boolean
  60508. // in that case let's just turn it into an empty obj so Object.assign doesn't crash
  60509. outputTarget.serviceWorker = {};
  60510. }
  60511. if (!Array.isArray(outputTarget.serviceWorker.globPatterns)) {
  60512. if (typeof outputTarget.serviceWorker.globPatterns === 'string') {
  60513. outputTarget.serviceWorker.globPatterns = [outputTarget.serviceWorker.globPatterns];
  60514. }
  60515. else if (typeof outputTarget.serviceWorker.globPatterns !== 'string') {
  60516. outputTarget.serviceWorker.globPatterns = DEFAULT_GLOB_PATTERNS.slice();
  60517. }
  60518. }
  60519. if (typeof outputTarget.serviceWorker.globDirectory !== 'string') {
  60520. outputTarget.serviceWorker.globDirectory = outputTarget.appDir;
  60521. }
  60522. if (typeof outputTarget.serviceWorker.globIgnores === 'string') {
  60523. outputTarget.serviceWorker.globIgnores = [outputTarget.serviceWorker.globIgnores];
  60524. }
  60525. outputTarget.serviceWorker.globIgnores = outputTarget.serviceWorker.globIgnores || [];
  60526. addGlobIgnores(config, outputTarget.serviceWorker.globIgnores);
  60527. outputTarget.serviceWorker.dontCacheBustURLsMatching = /p-\w{8}/;
  60528. if (isString$1(outputTarget.serviceWorker.swSrc) && !isAbsolute$1(outputTarget.serviceWorker.swSrc)) {
  60529. outputTarget.serviceWorker.swSrc = join(config.rootDir, outputTarget.serviceWorker.swSrc);
  60530. }
  60531. if (!isString$1(outputTarget.serviceWorker.swDest)) {
  60532. outputTarget.serviceWorker.swDest = join(outputTarget.appDir, DEFAULT_FILENAME);
  60533. }
  60534. if (!isAbsolute$1(outputTarget.serviceWorker.swDest)) {
  60535. outputTarget.serviceWorker.swDest = join(outputTarget.appDir, outputTarget.serviceWorker.swDest);
  60536. }
  60537. };
  60538. const addGlobIgnores = (config, globIgnores) => {
  60539. globIgnores.push(`**/${HOST_CONFIG_FILENAME}`, `**/*.system.entry.js`, `**/*.system.js`, `**/${config.fsNamespace}.js`, `**/${config.fsNamespace}.esm.js`, `**/${config.fsNamespace}.css`);
  60540. };
  60541. const DEFAULT_GLOB_PATTERNS = ['*.html', '**/*.{js,css,json}'];
  60542. const DEFAULT_FILENAME = 'sw.js';
  60543. const validateWww = (config, diagnostics, userOutputs) => {
  60544. const hasOutputTargets = userOutputs.length > 0;
  60545. const hasE2eTests = !!(config.flags && config.flags.e2e);
  60546. const userWwwOutputs = userOutputs.filter(isOutputTargetWww);
  60547. if (!hasOutputTargets ||
  60548. (hasE2eTests && !userOutputs.some(isOutputTargetWww) && !userOutputs.some(isOutputTargetDist))) {
  60549. userWwwOutputs.push({ type: WWW });
  60550. }
  60551. if (config.flags.prerender && userWwwOutputs.length === 0) {
  60552. const err = buildError(diagnostics);
  60553. err.messageText = `You need at least one "www" output target configured in your stencil.config.ts, when the "--prerender" flag is used`;
  60554. }
  60555. return userWwwOutputs.reduce((outputs, o) => {
  60556. const outputTarget = validateWwwOutputTarget(config, o, diagnostics);
  60557. outputs.push(outputTarget);
  60558. // Add dist-lazy output target
  60559. const buildDir = outputTarget.buildDir;
  60560. outputs.push({
  60561. type: DIST_LAZY,
  60562. dir: buildDir,
  60563. esmDir: buildDir,
  60564. systemDir: config.buildEs5 ? buildDir : undefined,
  60565. systemLoaderFile: config.buildEs5 ? join(buildDir, `${config.fsNamespace}.js`) : undefined,
  60566. polyfills: outputTarget.polyfills,
  60567. isBrowserBuild: true,
  60568. });
  60569. // Copy for dist
  60570. outputs.push({
  60571. type: COPY,
  60572. dir: buildDir,
  60573. copyAssets: 'dist',
  60574. });
  60575. // Copy for www
  60576. outputs.push({
  60577. type: COPY,
  60578. dir: outputTarget.appDir,
  60579. copy: validateCopy(outputTarget.copy, [
  60580. { src: 'assets', warn: false },
  60581. { src: 'manifest.json', warn: false },
  60582. ]),
  60583. });
  60584. // Generate global style with original name
  60585. outputs.push({
  60586. type: DIST_GLOBAL_STYLES,
  60587. file: join(buildDir, `${config.fsNamespace}.css`),
  60588. });
  60589. return outputs;
  60590. }, []);
  60591. };
  60592. const validateWwwOutputTarget = (config, outputTarget, diagnostics) => {
  60593. if (!isString$1(outputTarget.baseUrl)) {
  60594. outputTarget.baseUrl = '/';
  60595. }
  60596. if (!outputTarget.baseUrl.endsWith('/')) {
  60597. // Make sure the baseUrl always finish with "/"
  60598. outputTarget.baseUrl += '/';
  60599. }
  60600. outputTarget.dir = getAbsolutePath(config, outputTarget.dir || 'www');
  60601. // Fix "dir" to account
  60602. const pathname = new URL(outputTarget.baseUrl, 'http://localhost/').pathname;
  60603. outputTarget.appDir = join(outputTarget.dir, pathname);
  60604. if (outputTarget.appDir.endsWith('/') || outputTarget.appDir.endsWith('\\')) {
  60605. outputTarget.appDir = outputTarget.appDir.substring(0, outputTarget.appDir.length - 1);
  60606. }
  60607. if (!isString$1(outputTarget.buildDir)) {
  60608. outputTarget.buildDir = 'build';
  60609. }
  60610. if (!isAbsolute$1(outputTarget.buildDir)) {
  60611. outputTarget.buildDir = join(outputTarget.appDir, outputTarget.buildDir);
  60612. }
  60613. if (!isString$1(outputTarget.indexHtml)) {
  60614. outputTarget.indexHtml = 'index.html';
  60615. }
  60616. if (!isAbsolute$1(outputTarget.indexHtml)) {
  60617. outputTarget.indexHtml = join(outputTarget.appDir, outputTarget.indexHtml);
  60618. }
  60619. if (!isBoolean$1(outputTarget.empty)) {
  60620. outputTarget.empty = true;
  60621. }
  60622. validatePrerender(config, diagnostics, outputTarget);
  60623. validateServiceWorker(config, outputTarget);
  60624. if (outputTarget.polyfills === undefined) {
  60625. outputTarget.polyfills = true;
  60626. }
  60627. outputTarget.polyfills = !!outputTarget.polyfills;
  60628. return outputTarget;
  60629. };
  60630. const validateCustomElementBundle = (config, userOutputs) => {
  60631. return userOutputs.filter(isOutputTargetDistCustomElementsBundle).reduce((arr, o) => {
  60632. const outputTarget = {
  60633. ...o,
  60634. dir: getAbsolutePath(config, o.dir || 'dist/custom-elements'),
  60635. };
  60636. if (!isBoolean$1(outputTarget.empty)) {
  60637. outputTarget.empty = true;
  60638. }
  60639. if (!isBoolean$1(outputTarget.externalRuntime)) {
  60640. outputTarget.externalRuntime = true;
  60641. }
  60642. outputTarget.copy = validateCopy(outputTarget.copy, []);
  60643. if (outputTarget.copy.length > 0) {
  60644. arr.push({
  60645. type: COPY,
  60646. dir: config.rootDir,
  60647. copy: [...outputTarget.copy],
  60648. });
  60649. }
  60650. arr.push(outputTarget);
  60651. return arr;
  60652. }, []);
  60653. };
  60654. const validateOutputTargets = (config, diagnostics) => {
  60655. const userOutputs = (config.outputTargets || []).slice();
  60656. userOutputs.forEach((outputTarget) => {
  60657. if (!VALID_TYPES.includes(outputTarget.type)) {
  60658. const err = buildError(diagnostics);
  60659. err.messageText = `Invalid outputTarget type "${outputTarget.type}". Valid outputTarget types include: ${VALID_TYPES.map((t) => `"${t}"`).join(', ')}`;
  60660. }
  60661. else if (outputTarget.type === DIST_CUSTOM_ELEMENTS_BUNDLE) {
  60662. // TODO(STENCIL-260): Remove this check when the 'dist-custom-elements-bundle' is removed
  60663. const warning = buildWarn(diagnostics);
  60664. warning.messageText = `dist-custom-elements-bundle is deprecated and will be removed in a future major version release. Use "dist-custom-elements" instead. If "dist-custom-elements" does not meet your needs, please add a comment to https://github.com/ionic-team/stencil/issues/3136.`;
  60665. }
  60666. });
  60667. config.outputTargets = [
  60668. ...validateCollection(config, userOutputs),
  60669. ...validateCustomElement(config, userOutputs),
  60670. ...validateCustomElementBundle(config, userOutputs),
  60671. ...validateCustomOutput(config, diagnostics, userOutputs),
  60672. ...validateLazy(config, userOutputs),
  60673. ...validateWww(config, diagnostics, userOutputs),
  60674. ...validateDist(config, userOutputs),
  60675. ...validateDocs(config, diagnostics, userOutputs),
  60676. ...validateAngular(config, userOutputs),
  60677. ...validateStats(config, userOutputs),
  60678. ];
  60679. // hydrate also gets info from the www output
  60680. config.outputTargets = [
  60681. ...config.outputTargets,
  60682. ...validateHydrateScript(config, [...userOutputs, ...config.outputTargets]),
  60683. ];
  60684. };
  60685. const validatePaths = (config) => {
  60686. if (typeof config.rootDir !== 'string') {
  60687. config.rootDir = '/';
  60688. }
  60689. if (typeof config.srcDir !== 'string') {
  60690. config.srcDir = DEFAULT_SRC_DIR;
  60691. }
  60692. if (!isAbsolute$1(config.srcDir)) {
  60693. config.srcDir = join(config.rootDir, config.srcDir);
  60694. }
  60695. if (typeof config.cacheDir !== 'string') {
  60696. config.cacheDir = DEFAULT_CACHE_DIR;
  60697. }
  60698. if (!isAbsolute$1(config.cacheDir)) {
  60699. config.cacheDir = join(config.rootDir, config.cacheDir);
  60700. }
  60701. if (typeof config.srcIndexHtml !== 'string') {
  60702. config.srcIndexHtml = join(config.srcDir, DEFAULT_INDEX_HTML);
  60703. }
  60704. if (!isAbsolute$1(config.srcIndexHtml)) {
  60705. config.srcIndexHtml = join(config.rootDir, config.srcIndexHtml);
  60706. }
  60707. if (typeof config.globalScript === 'string' && !isAbsolute$1(config.globalScript)) {
  60708. if (!isAbsolute$1(config.globalScript)) {
  60709. config.globalScript = join(config.rootDir, config.globalScript);
  60710. }
  60711. }
  60712. if (typeof config.globalStyle === 'string') {
  60713. if (!isAbsolute$1(config.globalStyle)) {
  60714. config.globalStyle = join(config.rootDir, config.globalStyle);
  60715. }
  60716. }
  60717. if (config.writeLog) {
  60718. if (typeof config.buildLogFilePath !== 'string') {
  60719. config.buildLogFilePath = DEFAULT_BUILD_LOG_FILE_NAME;
  60720. }
  60721. if (!isAbsolute$1(config.buildLogFilePath)) {
  60722. config.buildLogFilePath = join(config.rootDir, config.buildLogFilePath);
  60723. }
  60724. }
  60725. config.packageJsonFilePath = join(config.rootDir, 'package.json');
  60726. };
  60727. const DEFAULT_BUILD_LOG_FILE_NAME = 'stencil-build.log';
  60728. const DEFAULT_CACHE_DIR = '.stencil';
  60729. const DEFAULT_INDEX_HTML = 'index.html';
  60730. const DEFAULT_SRC_DIR = 'src';
  60731. const validatePlugins = (config, diagnostics) => {
  60732. const userPlugins = config.plugins;
  60733. if (!config.rollupPlugins) {
  60734. config.rollupPlugins = {};
  60735. }
  60736. if (!Array.isArray(userPlugins)) {
  60737. config.plugins = [];
  60738. return;
  60739. }
  60740. const rollupPlugins = userPlugins.filter((plugin) => {
  60741. return !!(plugin && typeof plugin === 'object' && !plugin.pluginType);
  60742. });
  60743. const hasResolveNode = rollupPlugins.some((p) => p.name === 'node-resolve');
  60744. const hasCommonjs = rollupPlugins.some((p) => p.name === 'commonjs');
  60745. if (hasCommonjs) {
  60746. const warn = buildWarn(diagnostics);
  60747. warn.messageText = `Stencil already uses "@rollup/plugin-commonjs", please remove it from your "stencil.config.ts" plugins.
  60748. You can configure the commonjs settings using the "commonjs" property in "stencil.config.ts`;
  60749. }
  60750. if (hasResolveNode) {
  60751. const warn = buildWarn(diagnostics);
  60752. warn.messageText = `Stencil already uses "@rollup/plugin-commonjs", please remove it from your "stencil.config.ts" plugins.
  60753. You can configure the commonjs settings using the "commonjs" property in "stencil.config.ts`;
  60754. }
  60755. config.rollupPlugins.before = [
  60756. ...(config.rollupPlugins.before || []),
  60757. ...rollupPlugins.filter(({ name }) => name !== 'node-resolve' && name !== 'commonjs'),
  60758. ];
  60759. config.plugins = userPlugins.filter((plugin) => {
  60760. return !!(plugin && typeof plugin === 'object' && plugin.pluginType);
  60761. });
  60762. };
  60763. const validateRollupConfig = (config) => {
  60764. const cleanRollupConfig = getCleanRollupConfig(config.rollupConfig);
  60765. config.rollupConfig = cleanRollupConfig;
  60766. };
  60767. const getCleanRollupConfig = (rollupConfig) => {
  60768. let cleanRollupConfig = DEFAULT_ROLLUP_CONFIG;
  60769. if (!rollupConfig || !isObject$4(rollupConfig)) {
  60770. return cleanRollupConfig;
  60771. }
  60772. if (rollupConfig.inputOptions && isObject$4(rollupConfig.inputOptions)) {
  60773. cleanRollupConfig = {
  60774. ...cleanRollupConfig,
  60775. inputOptions: pluck(rollupConfig.inputOptions, ['context', 'moduleContext', 'treeshake']),
  60776. };
  60777. }
  60778. if (rollupConfig.outputOptions && isObject$4(rollupConfig.outputOptions)) {
  60779. cleanRollupConfig = {
  60780. ...cleanRollupConfig,
  60781. outputOptions: pluck(rollupConfig.outputOptions, ['globals']),
  60782. };
  60783. }
  60784. return cleanRollupConfig;
  60785. };
  60786. const DEFAULT_ROLLUP_CONFIG = {
  60787. inputOptions: {},
  60788. outputOptions: {},
  60789. };
  60790. const validateTesting = (config, diagnostics) => {
  60791. const testing = (config.testing = Object.assign({}, config.testing || {}));
  60792. if (!config.flags || (!config.flags.e2e && !config.flags.spec)) {
  60793. return;
  60794. }
  60795. let configPathDir = config.configPath;
  60796. if (isString$1(configPathDir)) {
  60797. if (basename(configPathDir).includes('.')) {
  60798. configPathDir = dirname(configPathDir);
  60799. }
  60800. }
  60801. else {
  60802. configPathDir = config.rootDir;
  60803. }
  60804. if (typeof config.flags.headless === 'boolean') {
  60805. testing.browserHeadless = config.flags.headless;
  60806. }
  60807. else if (typeof testing.browserHeadless !== 'boolean') {
  60808. testing.browserHeadless = true;
  60809. }
  60810. if (!testing.browserWaitUntil) {
  60811. testing.browserWaitUntil = 'load';
  60812. }
  60813. testing.browserArgs = testing.browserArgs || [];
  60814. addTestingConfigOption(testing.browserArgs, '--font-render-hinting=medium');
  60815. addTestingConfigOption(testing.browserArgs, '--incognito');
  60816. if (config.flags.ci) {
  60817. addTestingConfigOption(testing.browserArgs, '--no-sandbox');
  60818. addTestingConfigOption(testing.browserArgs, '--disable-setuid-sandbox');
  60819. addTestingConfigOption(testing.browserArgs, '--disable-dev-shm-usage');
  60820. testing.browserHeadless = true;
  60821. }
  60822. if (typeof testing.rootDir === 'string') {
  60823. if (!isAbsolute$1(testing.rootDir)) {
  60824. testing.rootDir = join(config.rootDir, testing.rootDir);
  60825. }
  60826. }
  60827. else {
  60828. testing.rootDir = config.rootDir;
  60829. }
  60830. if (config.flags && typeof config.flags.screenshotConnector === 'string') {
  60831. testing.screenshotConnector = config.flags.screenshotConnector;
  60832. }
  60833. if (typeof testing.screenshotConnector === 'string') {
  60834. if (!isAbsolute$1(testing.screenshotConnector)) {
  60835. testing.screenshotConnector = join(config.rootDir, testing.screenshotConnector);
  60836. }
  60837. }
  60838. else {
  60839. testing.screenshotConnector = join(config.sys.getCompilerExecutingPath(), '..', '..', 'screenshot', 'local-connector.js');
  60840. }
  60841. if (!Array.isArray(testing.testPathIgnorePatterns)) {
  60842. testing.testPathIgnorePatterns = DEFAULT_IGNORE_PATTERNS.map((ignorePattern) => {
  60843. return join(testing.rootDir, ignorePattern);
  60844. });
  60845. config.outputTargets
  60846. .filter((o) => (isOutputTargetDist(o) || isOutputTargetWww(o)) && o.dir)
  60847. .forEach((outputTarget) => {
  60848. testing.testPathIgnorePatterns.push(outputTarget.dir);
  60849. });
  60850. }
  60851. if (typeof testing.preset !== 'string') {
  60852. testing.preset = join(config.sys.getCompilerExecutingPath(), '..', '..', 'testing');
  60853. }
  60854. else if (!isAbsolute$1(testing.preset)) {
  60855. testing.preset = join(configPathDir, testing.preset);
  60856. }
  60857. if (!Array.isArray(testing.setupFilesAfterEnv)) {
  60858. testing.setupFilesAfterEnv = [];
  60859. }
  60860. testing.setupFilesAfterEnv.unshift(join(config.sys.getCompilerExecutingPath(), '..', '..', 'testing', 'jest-setuptestframework.js'));
  60861. if (isString$1(testing.testEnvironment)) {
  60862. if (!isAbsolute$1(testing.testEnvironment) && isLocalModule(testing.testEnvironment)) {
  60863. testing.testEnvironment = join(configPathDir, testing.testEnvironment);
  60864. }
  60865. }
  60866. if (typeof testing.allowableMismatchedPixels === 'number') {
  60867. if (testing.allowableMismatchedPixels < 0) {
  60868. const err = buildError(diagnostics);
  60869. err.messageText = `allowableMismatchedPixels must be a value that is 0 or greater`;
  60870. }
  60871. }
  60872. else {
  60873. testing.allowableMismatchedPixels = DEFAULT_ALLOWABLE_MISMATCHED_PIXELS;
  60874. }
  60875. if (typeof testing.allowableMismatchedRatio === 'number') {
  60876. if (testing.allowableMismatchedRatio < 0 || testing.allowableMismatchedRatio > 1) {
  60877. const err = buildError(diagnostics);
  60878. err.messageText = `allowableMismatchedRatio must be a value ranging from 0 to 1`;
  60879. }
  60880. }
  60881. if (typeof testing.pixelmatchThreshold === 'number') {
  60882. if (testing.pixelmatchThreshold < 0 || testing.pixelmatchThreshold > 1) {
  60883. const err = buildError(diagnostics);
  60884. err.messageText = `pixelmatchThreshold must be a value ranging from 0 to 1`;
  60885. }
  60886. }
  60887. else {
  60888. testing.pixelmatchThreshold = DEFAULT_PIXEL_MATCH_THRESHOLD;
  60889. }
  60890. if (testing.testRegex === undefined) {
  60891. /**
  60892. * The test regex covers cases of:
  60893. * - files under a `__tests__` directory
  60894. * - the case where a test file has a name such as `test.ts`, `spec.ts` or `e2e.ts`.
  60895. * - these files can use any of the following file extensions: .ts, .tsx, .js, .jsx.
  60896. * - this regex only handles the entire path of a file, e.g. `/some/path/e2e.ts`
  60897. * - the case where a test file ends with `.test.ts`, `.spec.ts`, or `.e2e.ts`.
  60898. * - these files can use any of the following file extensions: .ts, .tsx, .js, .jsx.
  60899. * - this regex case shall match file names such as `my-cmp.spec.ts`, `test.spec.ts`
  60900. * - this regex case shall not match file names such as `attest.ts`, `bespec.ts`
  60901. */
  60902. testing.testRegex = '(/__tests__/.*|(\\.|/)(test|spec|e2e))\\.[jt]sx?$';
  60903. }
  60904. if (Array.isArray(testing.testMatch)) {
  60905. delete testing.testRegex;
  60906. }
  60907. else if (typeof testing.testRegex === 'string') {
  60908. delete testing.testMatch;
  60909. }
  60910. if (typeof testing.runner !== 'string') {
  60911. testing.runner = join(config.sys.getCompilerExecutingPath(), '..', '..', 'testing', 'jest-runner.js');
  60912. }
  60913. if (typeof testing.waitBeforeScreenshot === 'number') {
  60914. if (testing.waitBeforeScreenshot < 0) {
  60915. const err = buildError(diagnostics);
  60916. err.messageText = `waitBeforeScreenshot must be a value that is 0 or greater`;
  60917. }
  60918. }
  60919. else {
  60920. testing.waitBeforeScreenshot = 10;
  60921. }
  60922. if (!Array.isArray(testing.emulate) || testing.emulate.length === 0) {
  60923. testing.emulate = [
  60924. {
  60925. userAgent: 'default',
  60926. viewport: {
  60927. width: 600,
  60928. height: 600,
  60929. deviceScaleFactor: 1,
  60930. isMobile: false,
  60931. hasTouch: false,
  60932. isLandscape: false,
  60933. },
  60934. },
  60935. ];
  60936. }
  60937. };
  60938. const addTestingConfigOption = (setArray, option) => {
  60939. if (!setArray.includes(option)) {
  60940. setArray.push(option);
  60941. }
  60942. };
  60943. const DEFAULT_ALLOWABLE_MISMATCHED_PIXELS = 100;
  60944. const DEFAULT_PIXEL_MATCH_THRESHOLD = 0.1;
  60945. const DEFAULT_IGNORE_PATTERNS = ['.vscode', '.stencil', 'node_modules'];
  60946. const validateWorkers = (config) => {
  60947. if (typeof config.maxConcurrentWorkers !== 'number') {
  60948. config.maxConcurrentWorkers = 8;
  60949. }
  60950. if (config.flags) {
  60951. if (typeof config.flags.maxWorkers === 'number') {
  60952. config.maxConcurrentWorkers = config.flags.maxWorkers;
  60953. }
  60954. else if (config.flags.ci) {
  60955. config.maxConcurrentWorkers = 4;
  60956. }
  60957. }
  60958. config.maxConcurrentWorkers = Math.max(Math.min(config.maxConcurrentWorkers, 16), 0);
  60959. if (config.devServer) {
  60960. config.devServer.worker = config.maxConcurrentWorkers > 0;
  60961. }
  60962. };
  60963. const validateConfig = (userConfig) => {
  60964. const config = Object.assign({}, userConfig || {}); // not positive it's json safe
  60965. const diagnostics = [];
  60966. // copy flags (we know it'll be json safe)
  60967. config.flags = JSON.parse(JSON.stringify(config.flags || {}));
  60968. // default devMode false
  60969. if (config.flags.prod) {
  60970. config.devMode = false;
  60971. }
  60972. else if (config.flags.dev) {
  60973. config.devMode = true;
  60974. }
  60975. else if (!isBoolean$1(config.devMode)) {
  60976. config.devMode = DEFAULT_DEV_MODE;
  60977. }
  60978. config.extras = config.extras || {};
  60979. config.extras.appendChildSlotFix = !!config.extras.appendChildSlotFix;
  60980. config.extras.cloneNodeFix = !!config.extras.cloneNodeFix;
  60981. config.extras.cssVarsShim = !!config.extras.cssVarsShim;
  60982. config.extras.dynamicImportShim = !!config.extras.dynamicImportShim;
  60983. config.extras.lifecycleDOMEvents = !!config.extras.lifecycleDOMEvents;
  60984. config.extras.safari10 = !!config.extras.safari10;
  60985. config.extras.scriptDataOpts = !!config.extras.scriptDataOpts;
  60986. config.extras.shadowDomShim = !!config.extras.shadowDomShim;
  60987. config.extras.slotChildNodesFix = !!config.extras.slotChildNodesFix;
  60988. config.extras.initializeNextTick = !!config.extras.initializeNextTick;
  60989. config.extras.tagNameTransform = !!config.extras.tagNameTransform;
  60990. config.buildEs5 = config.buildEs5 === true || (!config.devMode && config.buildEs5 === 'prod');
  60991. setBooleanConfig(config, 'minifyCss', null, !config.devMode);
  60992. setBooleanConfig(config, 'minifyJs', null, !config.devMode);
  60993. setBooleanConfig(config, 'sourceMap', null, typeof config.sourceMap === 'undefined' ? false : config.sourceMap);
  60994. setBooleanConfig(config, 'watch', 'watch', false);
  60995. setBooleanConfig(config, 'buildDocs', 'docs', !config.devMode);
  60996. setBooleanConfig(config, 'buildDist', 'esm', !config.devMode || config.buildEs5);
  60997. setBooleanConfig(config, 'profile', 'profile', config.devMode);
  60998. setBooleanConfig(config, 'writeLog', 'log', false);
  60999. setBooleanConfig(config, 'buildAppCore', null, true);
  61000. setBooleanConfig(config, 'autoprefixCss', null, config.buildEs5);
  61001. setBooleanConfig(config, 'validateTypes', null, !config._isTesting);
  61002. setBooleanConfig(config, 'allowInlineScripts', null, true);
  61003. if (!isString$1(config.taskQueue)) {
  61004. config.taskQueue = 'async';
  61005. }
  61006. // hash file names
  61007. if (!isBoolean$1(config.hashFileNames)) {
  61008. config.hashFileNames = !config.devMode;
  61009. }
  61010. if (!isNumber$1(config.hashedFileNameLength)) {
  61011. config.hashedFileNameLength = DEFAULT_HASHED_FILENAME_LENTH;
  61012. }
  61013. if (config.hashedFileNameLength < MIN_HASHED_FILENAME_LENTH) {
  61014. const err = buildError(diagnostics);
  61015. err.messageText = `config.hashedFileNameLength must be at least ${MIN_HASHED_FILENAME_LENTH} characters`;
  61016. }
  61017. if (config.hashedFileNameLength > MAX_HASHED_FILENAME_LENTH) {
  61018. const err = buildError(diagnostics);
  61019. err.messageText = `config.hashedFileNameLength cannot be more than ${MAX_HASHED_FILENAME_LENTH} characters`;
  61020. }
  61021. if (!config.env) {
  61022. config.env = {};
  61023. }
  61024. // get a good namespace
  61025. validateNamespace(config, diagnostics);
  61026. // figure out all of the config paths and absolute paths
  61027. validatePaths(config);
  61028. // outputTargets
  61029. validateOutputTargets(config, diagnostics);
  61030. // plugins
  61031. validatePlugins(config, diagnostics);
  61032. // rollup config
  61033. validateRollupConfig(config);
  61034. // dev server
  61035. config.devServer = validateDevServer(config, diagnostics);
  61036. // testing
  61037. validateTesting(config, diagnostics);
  61038. // hydrate flag
  61039. config.hydratedFlag = validateHydrated(config);
  61040. // bundles
  61041. if (Array.isArray(config.bundles)) {
  61042. config.bundles = sortBy(config.bundles, (a) => a.components.length);
  61043. }
  61044. else {
  61045. config.bundles = [];
  61046. }
  61047. // validate how many workers we can use
  61048. validateWorkers(config);
  61049. // default devInspector to whatever devMode is
  61050. setBooleanConfig(config, 'devInspector', null, config.devMode);
  61051. if (!config._isTesting) {
  61052. validateDistNamespace(config, diagnostics);
  61053. }
  61054. setBooleanConfig(config, 'enableCache', 'cache', true);
  61055. if (!Array.isArray(config.watchIgnoredRegex) && config.watchIgnoredRegex != null) {
  61056. config.watchIgnoredRegex = [config.watchIgnoredRegex];
  61057. }
  61058. config.watchIgnoredRegex = (config.watchIgnoredRegex || []).reduce((arr, reg) => {
  61059. if (reg instanceof RegExp) {
  61060. arr.push(reg);
  61061. }
  61062. return arr;
  61063. }, []);
  61064. return {
  61065. config,
  61066. diagnostics,
  61067. };
  61068. };
  61069. const DEFAULT_DEV_MODE = false;
  61070. const DEFAULT_HASHED_FILENAME_LENTH = 8;
  61071. const MIN_HASHED_FILENAME_LENTH = 4;
  61072. const MAX_HASHED_FILENAME_LENTH = 32;
  61073. const validateTsConfig = async (config, sys, init) => {
  61074. var _a;
  61075. const tsconfig = {
  61076. path: null,
  61077. compilerOptions: null,
  61078. files: null,
  61079. include: null,
  61080. exclude: null,
  61081. extends: null,
  61082. diagnostics: [],
  61083. };
  61084. try {
  61085. const readTsConfig = await getTsConfigPath(config, sys, init);
  61086. if (!readTsConfig) {
  61087. const diagnostic = buildError(tsconfig.diagnostics);
  61088. diagnostic.header = `Missing tsconfig.json`;
  61089. diagnostic.messageText = `Unable to load TypeScript config file. Please create a "tsconfig.json" file within the "${config.rootDir}" directory.`;
  61090. }
  61091. else {
  61092. tsconfig.path = readTsConfig.path;
  61093. const host = {
  61094. ...t.sys,
  61095. readFile: (p) => {
  61096. if (p === tsconfig.path) {
  61097. return readTsConfig.content;
  61098. }
  61099. return sys.readFileSync(p);
  61100. },
  61101. readDirectory: (p) => sys.readDirSync(p),
  61102. fileExists: (p) => sys.accessSync(p),
  61103. onUnRecoverableConfigFileDiagnostic: (e) => console.error(e),
  61104. };
  61105. const results = t.getParsedCommandLineOfConfigFile(tsconfig.path, {}, host);
  61106. if (results.errors && results.errors.length > 0) {
  61107. results.errors.forEach((configErr) => {
  61108. const tsDiagnostic = loadTypeScriptDiagnostic(configErr);
  61109. if (tsDiagnostic.code === '18003') {
  61110. // "No inputs were found in config file"
  61111. // fine to just "warn" rather than "error" even before starting
  61112. tsDiagnostic.level = 'warn';
  61113. }
  61114. tsDiagnostic.absFilePath = tsconfig.path;
  61115. tsconfig.diagnostics.push(tsDiagnostic);
  61116. });
  61117. }
  61118. else {
  61119. if (results.raw) {
  61120. const srcDir = relative$1(config.rootDir, config.srcDir);
  61121. if (!hasSrcDirectoryInclude(results.raw.include, srcDir)) {
  61122. const warn = buildWarn(tsconfig.diagnostics);
  61123. warn.header = `tsconfig.json "include" required`;
  61124. warn.messageText = `In order for TypeScript to improve watch performance, it's recommended the "tsconfig.json" file should have the "include" property, with at least the app's "${srcDir}" directory listed. For example: "include": ["${srcDir}"]`;
  61125. }
  61126. if (hasStencilConfigInclude(results.raw.include)) {
  61127. const warn = buildWarn(tsconfig.diagnostics);
  61128. warn.header = `tsconfig.json should not reference stencil.config.ts`;
  61129. warn.messageText = `stencil.config.ts is not part of the output build, it should not be included.`;
  61130. }
  61131. if (Array.isArray(results.raw.files)) {
  61132. tsconfig.files = results.raw.files.slice();
  61133. }
  61134. if (Array.isArray(results.raw.include)) {
  61135. tsconfig.include = results.raw.include.slice();
  61136. }
  61137. if (Array.isArray(results.raw.exclude)) {
  61138. tsconfig.exclude = results.raw.exclude.slice();
  61139. }
  61140. if (isString$1(results.raw.extends)) {
  61141. tsconfig.extends = results.raw.extends;
  61142. }
  61143. }
  61144. if (results.options) {
  61145. tsconfig.compilerOptions = results.options;
  61146. const target = (_a = tsconfig.compilerOptions.target) !== null && _a !== void 0 ? _a : t.ScriptTarget.ES5;
  61147. if ([t.ScriptTarget.ES3, t.ScriptTarget.ES5, t.ScriptTarget.ES2015, t.ScriptTarget.ES2016].includes(target)) {
  61148. const warn = buildWarn(tsconfig.diagnostics);
  61149. warn.messageText = `To improve bundling, it is always recommended to set the tsconfig.json “target” setting to "es2017". Note that the compiler will automatically handle transpilation for ES5-only browsers.`;
  61150. }
  61151. if (tsconfig.compilerOptions.module !== t.ModuleKind.ESNext && !config._isTesting) {
  61152. const warn = buildWarn(tsconfig.diagnostics);
  61153. warn.messageText = `To improve bundling, it is always recommended to set the tsconfig.json “module” setting to “esnext”. Note that the compiler will automatically handle bundling both modern and legacy builds.`;
  61154. }
  61155. tsconfig.compilerOptions.sourceMap = config.sourceMap;
  61156. tsconfig.compilerOptions.inlineSources = config.sourceMap;
  61157. }
  61158. }
  61159. }
  61160. }
  61161. catch (e) {
  61162. catchError(tsconfig.diagnostics, e);
  61163. }
  61164. return tsconfig;
  61165. };
  61166. const getTsConfigPath = async (config, sys, init) => {
  61167. const tsconfig = {
  61168. path: null,
  61169. content: null,
  61170. };
  61171. if (isString$1(config.tsconfig)) {
  61172. if (!isAbsolute$1(config.tsconfig)) {
  61173. tsconfig.path = join(config.rootDir, config.tsconfig);
  61174. }
  61175. else {
  61176. tsconfig.path = config.tsconfig;
  61177. }
  61178. }
  61179. else {
  61180. tsconfig.path = join(config.rootDir, 'tsconfig.json');
  61181. }
  61182. tsconfig.content = await sys.readFile(tsconfig.path);
  61183. if (!isString$1(tsconfig.content)) {
  61184. if (!init.initTsConfig) {
  61185. // not set to automatically generate a default tsconfig
  61186. return null;
  61187. }
  61188. // create a default tsconfig
  61189. tsconfig.path = join(config.rootDir, 'tsconfig.json');
  61190. tsconfig.content = createDefaultTsConfig(config);
  61191. await sys.writeFile(tsconfig.path, tsconfig.content);
  61192. }
  61193. tsconfig.path = normalizePath$1(tsconfig.path);
  61194. return tsconfig;
  61195. };
  61196. const createDefaultTsConfig = (config) => JSON.stringify({
  61197. compilerOptions: {
  61198. allowSyntheticDefaultImports: true,
  61199. experimentalDecorators: true,
  61200. lib: ['dom', 'es2015'],
  61201. moduleResolution: 'node',
  61202. module: 'esnext',
  61203. target: 'es2017',
  61204. jsx: 'react',
  61205. jsxFactory: 'h',
  61206. jsxFragmentFactory: 'Fragment',
  61207. sourceMap: config.sourceMap,
  61208. inlineSources: config.sourceMap,
  61209. },
  61210. include: [relative$1(config.rootDir, config.srcDir)],
  61211. }, null, 2);
  61212. const hasSrcDirectoryInclude = (includeProp, src) => Array.isArray(includeProp) && includeProp.includes(src);
  61213. const hasStencilConfigInclude = (includeProp) => Array.isArray(includeProp) && includeProp.includes('stencil.config.ts');
  61214. const loadConfig = async (init = {}) => {
  61215. const results = {
  61216. config: null,
  61217. diagnostics: [],
  61218. tsconfig: {
  61219. path: null,
  61220. compilerOptions: null,
  61221. files: null,
  61222. include: null,
  61223. exclude: null,
  61224. extends: null,
  61225. },
  61226. };
  61227. try {
  61228. const sys = init.sys || createSystem();
  61229. const config = init.config || {};
  61230. let configPath = init.configPath || config.configPath;
  61231. const loadedConfigFile = await loadConfigFile(sys, results.diagnostics, configPath);
  61232. if (hasError(results.diagnostics)) {
  61233. return results;
  61234. }
  61235. if (loadedConfigFile != null) {
  61236. // merge the user's config object into their loaded config file
  61237. configPath = loadedConfigFile.configPath;
  61238. results.config = { ...loadedConfigFile, ...config };
  61239. results.config.configPath = configPath;
  61240. results.config.rootDir = normalizePath$1(dirname(configPath));
  61241. }
  61242. else {
  61243. // no stencil.config.ts or .js file, which is fine
  61244. // #0CJS ¯\_(ツ)_/¯
  61245. results.config = { ...config };
  61246. results.config.configPath = null;
  61247. results.config.rootDir = normalizePath$1(sys.getCurrentDirectory());
  61248. }
  61249. results.config.sys = sys;
  61250. const validated = validateConfig(results.config);
  61251. results.diagnostics.push(...validated.diagnostics);
  61252. if (hasError(results.diagnostics)) {
  61253. return results;
  61254. }
  61255. results.config = validated.config;
  61256. if (results.config.flags.debug || results.config.flags.verbose) {
  61257. results.config.logLevel = 'debug';
  61258. }
  61259. else if (results.config.flags.logLevel) {
  61260. results.config.logLevel = results.config.flags.logLevel;
  61261. }
  61262. else if (typeof results.config.logLevel !== 'string') {
  61263. results.config.logLevel = 'info';
  61264. }
  61265. results.config.logger = init.logger || results.config.logger || createLogger();
  61266. results.config.logger.setLevel(results.config.logLevel);
  61267. if (!hasError(results.diagnostics)) {
  61268. const tsConfigResults = await validateTsConfig(results.config, sys, init);
  61269. results.diagnostics.push(...tsConfigResults.diagnostics);
  61270. results.config.tsconfig = tsConfigResults.path;
  61271. results.config.tsCompilerOptions = tsConfigResults.compilerOptions;
  61272. results.tsconfig.path = tsConfigResults.path;
  61273. results.tsconfig.compilerOptions = JSON.parse(JSON.stringify(tsConfigResults.compilerOptions));
  61274. results.tsconfig.files = tsConfigResults.files;
  61275. results.tsconfig.include = tsConfigResults.include;
  61276. results.tsconfig.exclude = tsConfigResults.exclude;
  61277. results.tsconfig.extends = tsConfigResults.extends;
  61278. }
  61279. }
  61280. catch (e) {
  61281. catchError(results.diagnostics, e);
  61282. }
  61283. return results;
  61284. };
  61285. const loadConfigFile = async (sys, diagnostics, configPath) => {
  61286. let config = null;
  61287. if (isString$1(configPath)) {
  61288. // the passed in config was a string, so it's probably a path to the config we need to load
  61289. const configFileData = await evaluateConfigFile(sys, diagnostics, configPath);
  61290. if (hasError(diagnostics)) {
  61291. return config;
  61292. }
  61293. if (!configFileData.config) {
  61294. const err = buildError(diagnostics);
  61295. err.messageText = `Invalid Stencil configuration file "${configPath}". Missing "config" property.`;
  61296. err.absFilePath = configPath;
  61297. return config;
  61298. }
  61299. config = configFileData.config;
  61300. config.configPath = normalizePath$1(configPath);
  61301. }
  61302. return config;
  61303. };
  61304. const evaluateConfigFile = async (sys, diagnostics, configFilePath) => {
  61305. let configFileData = null;
  61306. try {
  61307. if (IS_NODE_ENV) {
  61308. const results = nodeRequire(configFilePath);
  61309. diagnostics.push(...results.diagnostics);
  61310. configFileData = results.module;
  61311. }
  61312. else {
  61313. // browser environment, can't use node's require() to evaluate
  61314. let sourceText = await sys.readFile(configFilePath);
  61315. sourceText = transpileTypedConfig(diagnostics, sourceText, configFilePath);
  61316. if (hasError(diagnostics)) {
  61317. return configFileData;
  61318. }
  61319. const evalConfig = new Function(`const exports = {}; ${sourceText}; return exports;`);
  61320. configFileData = evalConfig();
  61321. }
  61322. }
  61323. catch (e) {
  61324. catchError(diagnostics, e);
  61325. }
  61326. return configFileData;
  61327. };
  61328. const transpileTypedConfig = (diagnostics, sourceText, filePath) => {
  61329. // let's transpile an awesome stencil.config.ts file into
  61330. // a boring stencil.config.js file
  61331. if (hasError(diagnostics)) {
  61332. return sourceText;
  61333. }
  61334. const opts = {
  61335. fileName: filePath,
  61336. compilerOptions: {
  61337. module: t.ModuleKind.CommonJS,
  61338. moduleResolution: t.ModuleResolutionKind.NodeJs,
  61339. esModuleInterop: true,
  61340. target: t.ScriptTarget.ES2015,
  61341. allowJs: true,
  61342. },
  61343. reportDiagnostics: false,
  61344. };
  61345. const output = t.transpileModule(sourceText, opts);
  61346. return output.outputText;
  61347. };
  61348. const getTranspileResults = (code, input) => {
  61349. if (!isString$1(input.file)) {
  61350. input.file = 'module.tsx';
  61351. }
  61352. const parsedImport = parseImportPath(input.file);
  61353. const results = {
  61354. code: typeof code === 'string' ? code : '',
  61355. data: [],
  61356. diagnostics: [],
  61357. inputFileExtension: parsedImport.ext,
  61358. inputFilePath: input.file,
  61359. imports: [],
  61360. map: null,
  61361. outputFilePath: null,
  61362. };
  61363. return {
  61364. importData: parsedImport.data,
  61365. results,
  61366. };
  61367. };
  61368. const transpileCtx = { sys: null };
  61369. const getTranspileConfig = (input) => {
  61370. if (input.sys) {
  61371. transpileCtx.sys = input.sys;
  61372. }
  61373. else if (!transpileCtx.sys) {
  61374. if (IS_NODE_ENV) {
  61375. transpileCtx.sys = requireFunc('../sys/node/index.js').createNodeSys();
  61376. }
  61377. else {
  61378. transpileCtx.sys = createSystem();
  61379. }
  61380. }
  61381. const compileOpts = {
  61382. componentExport: getTranspileConfigOpt(input.componentExport, VALID_EXPORT, 'customelement'),
  61383. componentMetadata: getTranspileConfigOpt(input.componentMetadata, VALID_METADATA, null),
  61384. coreImportPath: isString$1(input.coreImportPath) ? input.coreImportPath : STENCIL_INTERNAL_CLIENT_ID,
  61385. currentDirectory: isString$1(input.currentDirectory)
  61386. ? input.currentDirectory
  61387. : transpileCtx.sys.getCurrentDirectory(),
  61388. file: input.file,
  61389. proxy: getTranspileConfigOpt(input.proxy, VALID_PROXY, 'defineproperty'),
  61390. module: getTranspileConfigOpt(input.module, VALID_MODULE, 'esm'),
  61391. sourceMap: input.sourceMap === 'inline' ? 'inline' : input.sourceMap !== false,
  61392. style: getTranspileConfigOpt(input.style, VALID_STYLE, 'static'),
  61393. styleImportData: getTranspileConfigOpt(input.styleImportData, VALID_STYLE_IMPORT_DATA, 'queryparams'),
  61394. target: getTranspileConfigOpt(input.target, VALID_TARGET, 'latest'),
  61395. };
  61396. const tsCompilerOptions = {
  61397. // best we always set this to true
  61398. allowSyntheticDefaultImports: true,
  61399. // best we always set this to true
  61400. esModuleInterop: true,
  61401. // always get source maps
  61402. sourceMap: compileOpts.sourceMap !== false,
  61403. // isolated per file transpiling
  61404. isolatedModules: true,
  61405. // transpileModule does not write anything to disk so there is no need to verify that there are no conflicts between input and output paths.
  61406. suppressOutputPathCheck: true,
  61407. // Filename can be non-ts file.
  61408. allowNonTsExtensions: true,
  61409. // We are not returning a sourceFile for lib file when asked by the program,
  61410. // so pass --noLib to avoid reporting a file not found error.
  61411. noLib: true,
  61412. noResolve: true,
  61413. // NOTE: "module" and "target" configs will be set later
  61414. // after the "ts" object has been loaded
  61415. };
  61416. if (isString$1(input.baseUrl)) {
  61417. compileOpts.baseUrl = input.baseUrl;
  61418. tsCompilerOptions.baseUrl = compileOpts.baseUrl;
  61419. }
  61420. if (input.paths) {
  61421. compileOpts.paths = { ...input.paths };
  61422. tsCompilerOptions.paths = { ...compileOpts.paths };
  61423. }
  61424. const transformOpts = {
  61425. coreImportPath: compileOpts.coreImportPath,
  61426. componentExport: compileOpts.componentExport,
  61427. componentMetadata: compileOpts.componentMetadata,
  61428. currentDirectory: compileOpts.currentDirectory,
  61429. isolatedModules: true,
  61430. module: compileOpts.module,
  61431. proxy: compileOpts.proxy,
  61432. file: compileOpts.file,
  61433. style: compileOpts.style,
  61434. styleImportData: compileOpts.styleImportData,
  61435. target: compileOpts.target,
  61436. };
  61437. const config = {
  61438. rootDir: compileOpts.currentDirectory,
  61439. srcDir: compileOpts.currentDirectory,
  61440. devMode: true,
  61441. minifyCss: true,
  61442. minifyJs: false,
  61443. _isTesting: true,
  61444. validateTypes: false,
  61445. enableCache: false,
  61446. sys: transpileCtx.sys,
  61447. tsCompilerOptions,
  61448. };
  61449. return {
  61450. compileOpts,
  61451. config,
  61452. transformOpts,
  61453. };
  61454. };
  61455. const getTranspileCssConfig = (compileOpts, importData, results) => {
  61456. const transformInput = {
  61457. file: results.inputFilePath,
  61458. input: results.code,
  61459. tag: importData && importData.tag,
  61460. encapsulation: importData && importData.encapsulation,
  61461. mode: importData && importData.mode,
  61462. sourceMap: compileOpts.sourceMap !== false,
  61463. commentOriginalSelector: false,
  61464. minify: false,
  61465. autoprefixer: false,
  61466. module: compileOpts.module,
  61467. styleImportData: compileOpts.styleImportData,
  61468. };
  61469. return transformInput;
  61470. };
  61471. const getTranspileConfigOpt = (value, validValues, defaultValue) => {
  61472. if (value === null || value === 'null') {
  61473. return null;
  61474. }
  61475. value = isString$1(value) ? value.toLowerCase().trim() : null;
  61476. if (validValues.has(value)) {
  61477. return value;
  61478. }
  61479. return defaultValue;
  61480. };
  61481. const VALID_EXPORT = new Set(['customelement', 'module']);
  61482. const VALID_METADATA = new Set(['compilerstatic', null]);
  61483. const VALID_MODULE = new Set(['cjs', 'esm']);
  61484. const VALID_PROXY = new Set(['defineproperty', null]);
  61485. const VALID_STYLE = new Set(['static']);
  61486. const VALID_STYLE_IMPORT_DATA = new Set(['queryparams']);
  61487. const VALID_TARGET = new Set(['latest', 'esnext', 'es2020', 'es2019', 'es2018', 'es2017', 'es2016', 'es2015', 'es5']);
  61488. const convertStaticToMeta = (config, compilerCtx, buildCtx, typeChecker, collection, transformOpts) => {
  61489. return (transformCtx) => {
  61490. let dirPath;
  61491. let moduleFile;
  61492. const visitNode = (node) => {
  61493. if (t.isClassDeclaration(node)) {
  61494. return parseStaticComponentMeta(compilerCtx, typeChecker, node, moduleFile, compilerCtx.nodeMap, transformOpts);
  61495. }
  61496. else if (t.isImportDeclaration(node)) {
  61497. parseModuleImport(config, compilerCtx, buildCtx, moduleFile, dirPath, node, !transformOpts.isolatedModules);
  61498. }
  61499. else if (t.isCallExpression(node)) {
  61500. parseCallExpression(moduleFile, node);
  61501. }
  61502. else if (t.isStringLiteral(node)) {
  61503. parseStringLiteral(moduleFile, node);
  61504. }
  61505. return t.visitEachChild(node, visitNode, transformCtx);
  61506. };
  61507. return (tsSourceFile) => {
  61508. dirPath = dirname(tsSourceFile.fileName);
  61509. moduleFile = getModuleLegacy(config, compilerCtx, tsSourceFile.fileName);
  61510. resetModuleLegacy(moduleFile);
  61511. if (collection != null) {
  61512. moduleFile.isCollectionDependency = true;
  61513. moduleFile.collectionName = collection.collectionName;
  61514. collection.moduleFiles.push(moduleFile);
  61515. }
  61516. else {
  61517. moduleFile.isCollectionDependency = false;
  61518. moduleFile.collectionName = null;
  61519. }
  61520. return visitNode(tsSourceFile);
  61521. };
  61522. };
  61523. };
  61524. /**
  61525. * Stand-alone compiling of a single string
  61526. */
  61527. const transpileModule = (config, input, transformOpts) => {
  61528. if (!config.logger) {
  61529. config = {
  61530. ...config,
  61531. logger: createLogger(),
  61532. };
  61533. }
  61534. const compilerCtx = new CompilerContext();
  61535. const buildCtx = new BuildContext(config, compilerCtx);
  61536. const tsCompilerOptions = {
  61537. ...config.tsCompilerOptions,
  61538. };
  61539. let sourceFilePath = transformOpts.file;
  61540. if (isString$1(sourceFilePath)) {
  61541. sourceFilePath = normalizePath$1(sourceFilePath);
  61542. }
  61543. else {
  61544. sourceFilePath = tsCompilerOptions.jsx ? `module.tsx` : `module.ts`;
  61545. }
  61546. const results = {
  61547. sourceFilePath: sourceFilePath,
  61548. code: null,
  61549. map: null,
  61550. diagnostics: [],
  61551. moduleFile: null,
  61552. };
  61553. if (transformOpts.module === 'cjs') {
  61554. tsCompilerOptions.module = t.ModuleKind.CommonJS;
  61555. }
  61556. else {
  61557. tsCompilerOptions.module = t.ModuleKind.ESNext;
  61558. }
  61559. tsCompilerOptions.target = getScriptTargetKind(transformOpts);
  61560. if ((sourceFilePath.endsWith('.tsx') || sourceFilePath.endsWith('.jsx')) && tsCompilerOptions.jsx == null) {
  61561. // ensure we're setup for JSX in typescript
  61562. tsCompilerOptions.jsx = t.JsxEmit.React;
  61563. }
  61564. if (tsCompilerOptions.jsx != null && !isString$1(tsCompilerOptions.jsxFactory)) {
  61565. tsCompilerOptions.jsxFactory = 'h';
  61566. }
  61567. if (tsCompilerOptions.jsx != null && !isString$1(tsCompilerOptions.jsxFragmentFactory)) {
  61568. tsCompilerOptions.jsxFragmentFactory = 'Fragment';
  61569. }
  61570. if (tsCompilerOptions.paths && !isString$1(tsCompilerOptions.baseUrl)) {
  61571. tsCompilerOptions.baseUrl = '.';
  61572. }
  61573. const sourceFile = t.createSourceFile(sourceFilePath, input, tsCompilerOptions.target);
  61574. // Create a compilerHost object to allow the compiler to read and write files
  61575. const compilerHost = {
  61576. getSourceFile: (fileName) => {
  61577. return normalizePath$1(fileName) === normalizePath$1(sourceFilePath) ? sourceFile : undefined;
  61578. },
  61579. writeFile: (name, text) => {
  61580. if (name.endsWith('.js.map')) {
  61581. results.map = text;
  61582. }
  61583. else if (name.endsWith('.js')) {
  61584. results.code = text;
  61585. }
  61586. },
  61587. getDefaultLibFileName: () => `lib.d.ts`,
  61588. useCaseSensitiveFileNames: () => false,
  61589. getCanonicalFileName: (fileName) => fileName,
  61590. getCurrentDirectory: () => transformOpts.currentDirectory || getCurrentDirectory(),
  61591. getNewLine: () => t.sys.newLine || '\n',
  61592. fileExists: (fileName) => normalizePath$1(fileName) === normalizePath$1(sourceFilePath),
  61593. readFile: () => '',
  61594. directoryExists: () => true,
  61595. getDirectories: () => [],
  61596. };
  61597. const program = t.createProgram([sourceFilePath], tsCompilerOptions, compilerHost);
  61598. const typeChecker = program.getTypeChecker();
  61599. const after = [
  61600. convertStaticToMeta(config, compilerCtx, buildCtx, typeChecker, null, transformOpts),
  61601. ];
  61602. if (transformOpts.componentExport === 'customelement' || transformOpts.componentExport === 'module') {
  61603. after.push(nativeComponentTransform(compilerCtx, transformOpts));
  61604. }
  61605. else {
  61606. after.push(lazyComponentTransform(compilerCtx, transformOpts));
  61607. }
  61608. program.emit(undefined, undefined, undefined, false, {
  61609. before: [
  61610. convertDecoratorsToStatic(config, buildCtx.diagnostics, typeChecker),
  61611. updateStencilCoreImports(transformOpts.coreImportPath),
  61612. ],
  61613. after,
  61614. });
  61615. const tsDiagnostics = [...program.getSyntacticDiagnostics()];
  61616. if (config.validateTypes) {
  61617. tsDiagnostics.push(...program.getOptionsDiagnostics());
  61618. }
  61619. buildCtx.diagnostics.push(...loadTypeScriptDiagnostics(tsDiagnostics));
  61620. results.diagnostics.push(...buildCtx.diagnostics);
  61621. results.moduleFile = compilerCtx.moduleMap.get(results.sourceFilePath);
  61622. return results;
  61623. };
  61624. const getScriptTargetKind = (transformOpts) => {
  61625. const target = transformOpts.target && transformOpts.target.toUpperCase();
  61626. if (isNumber$1(t.ScriptTarget[target])) {
  61627. return t.ScriptTarget[target];
  61628. }
  61629. // ESNext and Latest are the same
  61630. return t.ScriptTarget.Latest;
  61631. };
  61632. const transpile = async (code, opts = {}) => {
  61633. const { importData, results } = getTranspileResults(code, opts);
  61634. try {
  61635. if (shouldTranspileModule(results.inputFileExtension)) {
  61636. const { config, compileOpts, transformOpts } = getTranspileConfig(opts);
  61637. patchTypescript(config, null);
  61638. transpileCode(config, compileOpts, transformOpts, results);
  61639. }
  61640. else if (results.inputFileExtension === 'd.ts') {
  61641. results.code = '';
  61642. }
  61643. else if (results.inputFileExtension === 'css') {
  61644. const transformInput = getTranspileCssConfig(opts, importData, results);
  61645. await transpileCss(transformInput, results);
  61646. }
  61647. else if (results.inputFileExtension === 'json') {
  61648. transpileJson(results);
  61649. }
  61650. }
  61651. catch (e) {
  61652. catchError(results.diagnostics, e);
  61653. }
  61654. return results;
  61655. };
  61656. const transpileSync = (code, opts = {}) => {
  61657. const { importData, results } = getTranspileResults(code, opts);
  61658. try {
  61659. if (shouldTranspileModule(results.inputFileExtension)) {
  61660. const { config, compileOpts, transformOpts } = getTranspileConfig(opts);
  61661. patchTypescript(config, null);
  61662. transpileCode(config, compileOpts, transformOpts, results);
  61663. }
  61664. else if (results.inputFileExtension === 'd.ts') {
  61665. results.code = '';
  61666. }
  61667. else if (results.inputFileExtension === 'css') {
  61668. const transformInput = getTranspileCssConfig(opts, importData, results);
  61669. transpileCssSync(transformInput, results);
  61670. }
  61671. else if (results.inputFileExtension === 'json') {
  61672. transpileJson(results);
  61673. }
  61674. }
  61675. catch (e) {
  61676. catchError(results.diagnostics, e);
  61677. }
  61678. return results;
  61679. };
  61680. const transpileCode = (config, transpileOpts, transformOpts, results) => {
  61681. const transpileResults = transpileModule(config, results.code, transformOpts);
  61682. results.diagnostics.push(...transpileResults.diagnostics);
  61683. if (typeof transpileResults.code === 'string') {
  61684. results.code = transpileResults.code;
  61685. results.map = transpileResults.map;
  61686. if (transpileOpts.sourceMap === 'inline') {
  61687. try {
  61688. const mapObject = JSON.parse(transpileResults.map);
  61689. mapObject.file = transpileOpts.file;
  61690. mapObject.sources = [transpileOpts.file];
  61691. delete mapObject.sourceRoot;
  61692. const sourceMapComment = results.code.lastIndexOf('//#');
  61693. results.code =
  61694. results.code.slice(0, sourceMapComment) + getInlineSourceMappingUrlLinker(JSON.stringify(mapObject));
  61695. }
  61696. catch (e) {
  61697. console.error(e);
  61698. }
  61699. }
  61700. }
  61701. if (isString$1(transpileResults.sourceFilePath)) {
  61702. results.inputFilePath = transpileResults.sourceFilePath;
  61703. }
  61704. const moduleFile = transpileResults.moduleFile;
  61705. if (moduleFile) {
  61706. results.outputFilePath = moduleFile.jsFilePath;
  61707. moduleFile.cmps.forEach((cmp) => {
  61708. results.data.push(getPublicCompilerMeta(cmp));
  61709. });
  61710. moduleFile.originalImports.forEach((originalImport) => {
  61711. results.imports.push({
  61712. path: originalImport,
  61713. });
  61714. });
  61715. }
  61716. };
  61717. const transpileCss = async (transformInput, results) => {
  61718. const cssResults = await transformCssToEsm(transformInput);
  61719. results.code = cssResults.output;
  61720. results.map = cssResults.map;
  61721. results.imports = cssResults.imports.map((p) => ({ path: p.importPath }));
  61722. results.diagnostics.push(...cssResults.diagnostics);
  61723. };
  61724. const transpileCssSync = (transformInput, results) => {
  61725. const cssResults = transformCssToEsmSync(transformInput);
  61726. results.code = cssResults.output;
  61727. results.map = cssResults.map;
  61728. results.imports = cssResults.imports.map((p) => ({ path: p.importPath }));
  61729. results.diagnostics.push(...cssResults.diagnostics);
  61730. };
  61731. const transpileJson = (results) => {
  61732. results.code = index.dataToEsm(JSON.parse(results.code), {
  61733. preferConst: true,
  61734. compact: false,
  61735. indent: ' ',
  61736. });
  61737. results.map = { mappings: '' };
  61738. };
  61739. // NOTE: if you change this, also change scripts/bundles/helpers/jest/jest-preset.js
  61740. const shouldTranspileModule = (ext) => ['tsx', 'ts', 'mjs', 'jsx', 'js'].includes(ext);
  61741. if (IS_WEB_WORKER_ENV) {
  61742. initWebWorkerThread(createWorkerMessageHandler(createSystem()));
  61743. }
  61744. exports.buildId = buildId;
  61745. exports.createCompiler = createCompiler;
  61746. exports.createPrerenderer = createPrerenderer;
  61747. exports.createSystem = createSystem;
  61748. exports.createWorkerContext = createWorkerContext;
  61749. exports.createWorkerMessageHandler = createWorkerMessageHandler;
  61750. exports.dependencies = dependencies;
  61751. exports.loadConfig = loadConfig;
  61752. exports.nodeRequire = nodeRequire;
  61753. exports.optimizeCss = optimizeCss$1;
  61754. exports.optimizeJs = optimizeJs;
  61755. exports.path = path$5;
  61756. exports.transpile = transpile;
  61757. exports.transpileSync = transpileSync;
  61758. exports.ts = t;
  61759. exports.vermoji = vermoji;
  61760. exports.version = version$3;
  61761. exports.versions = versions;
  61762. if (typeof module !== 'undefined' && module.exports) {
  61763. module.exports = exports;
  61764. }
  61765. globalThis.stencil = exports;
  61766. })({});
  61767. //# sourceMappingURL=stencil.js.map