editor.worker.bundle.js 544 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573
  1. (() => {
  2. var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
  3. get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
  4. }) : x)(function(x) {
  5. if (typeof require !== "undefined")
  6. return require.apply(this, arguments);
  7. throw Error('Dynamic require of "' + x + '" is not supported');
  8. });
  9. // node_modules/monaco-editor/esm/vs/base/common/errors.js
  10. var ErrorHandler = class {
  11. constructor() {
  12. this.listeners = [];
  13. this.unexpectedErrorHandler = function(e) {
  14. setTimeout(() => {
  15. if (e.stack) {
  16. if (ErrorNoTelemetry.isErrorNoTelemetry(e)) {
  17. throw new ErrorNoTelemetry(e.message + "\n\n" + e.stack);
  18. }
  19. throw new Error(e.message + "\n\n" + e.stack);
  20. }
  21. throw e;
  22. }, 0);
  23. };
  24. }
  25. emit(e) {
  26. this.listeners.forEach((listener) => {
  27. listener(e);
  28. });
  29. }
  30. onUnexpectedError(e) {
  31. this.unexpectedErrorHandler(e);
  32. this.emit(e);
  33. }
  34. // For external errors, we don't want the listeners to be called
  35. onUnexpectedExternalError(e) {
  36. this.unexpectedErrorHandler(e);
  37. }
  38. };
  39. var errorHandler = new ErrorHandler();
  40. function onUnexpectedError(e) {
  41. if (!isCancellationError(e)) {
  42. errorHandler.onUnexpectedError(e);
  43. }
  44. return void 0;
  45. }
  46. function transformErrorForSerialization(error) {
  47. if (error instanceof Error) {
  48. const { name, message } = error;
  49. const stack = error.stacktrace || error.stack;
  50. return {
  51. $isError: true,
  52. name,
  53. message,
  54. stack,
  55. noTelemetry: ErrorNoTelemetry.isErrorNoTelemetry(error)
  56. };
  57. }
  58. return error;
  59. }
  60. var canceledName = "Canceled";
  61. function isCancellationError(error) {
  62. if (error instanceof CancellationError) {
  63. return true;
  64. }
  65. return error instanceof Error && error.name === canceledName && error.message === canceledName;
  66. }
  67. var CancellationError = class extends Error {
  68. constructor() {
  69. super(canceledName);
  70. this.name = this.message;
  71. }
  72. };
  73. var ErrorNoTelemetry = class _ErrorNoTelemetry extends Error {
  74. constructor(msg) {
  75. super(msg);
  76. this.name = "CodeExpectedError";
  77. }
  78. static fromError(err) {
  79. if (err instanceof _ErrorNoTelemetry) {
  80. return err;
  81. }
  82. const result = new _ErrorNoTelemetry();
  83. result.message = err.message;
  84. result.stack = err.stack;
  85. return result;
  86. }
  87. static isErrorNoTelemetry(err) {
  88. return err.name === "CodeExpectedError";
  89. }
  90. };
  91. var BugIndicatingError = class _BugIndicatingError extends Error {
  92. constructor(message) {
  93. super(message || "An unexpected bug occurred.");
  94. Object.setPrototypeOf(this, _BugIndicatingError.prototype);
  95. }
  96. };
  97. // node_modules/monaco-editor/esm/vs/base/common/functional.js
  98. function createSingleCallFunction(fn, fnDidRunCallback) {
  99. const _this = this;
  100. let didCall = false;
  101. let result;
  102. return function() {
  103. if (didCall) {
  104. return result;
  105. }
  106. didCall = true;
  107. if (fnDidRunCallback) {
  108. try {
  109. result = fn.apply(_this, arguments);
  110. } finally {
  111. fnDidRunCallback();
  112. }
  113. } else {
  114. result = fn.apply(_this, arguments);
  115. }
  116. return result;
  117. };
  118. }
  119. // node_modules/monaco-editor/esm/vs/base/common/iterator.js
  120. var Iterable;
  121. (function(Iterable2) {
  122. function is(thing) {
  123. return thing && typeof thing === "object" && typeof thing[Symbol.iterator] === "function";
  124. }
  125. Iterable2.is = is;
  126. const _empty2 = Object.freeze([]);
  127. function empty() {
  128. return _empty2;
  129. }
  130. Iterable2.empty = empty;
  131. function* single(element) {
  132. yield element;
  133. }
  134. Iterable2.single = single;
  135. function wrap(iterableOrElement) {
  136. if (is(iterableOrElement)) {
  137. return iterableOrElement;
  138. } else {
  139. return single(iterableOrElement);
  140. }
  141. }
  142. Iterable2.wrap = wrap;
  143. function from(iterable) {
  144. return iterable || _empty2;
  145. }
  146. Iterable2.from = from;
  147. function* reverse(array) {
  148. for (let i = array.length - 1; i >= 0; i--) {
  149. yield array[i];
  150. }
  151. }
  152. Iterable2.reverse = reverse;
  153. function isEmpty(iterable) {
  154. return !iterable || iterable[Symbol.iterator]().next().done === true;
  155. }
  156. Iterable2.isEmpty = isEmpty;
  157. function first(iterable) {
  158. return iterable[Symbol.iterator]().next().value;
  159. }
  160. Iterable2.first = first;
  161. function some(iterable, predicate) {
  162. let i = 0;
  163. for (const element of iterable) {
  164. if (predicate(element, i++)) {
  165. return true;
  166. }
  167. }
  168. return false;
  169. }
  170. Iterable2.some = some;
  171. function find(iterable, predicate) {
  172. for (const element of iterable) {
  173. if (predicate(element)) {
  174. return element;
  175. }
  176. }
  177. return void 0;
  178. }
  179. Iterable2.find = find;
  180. function* filter(iterable, predicate) {
  181. for (const element of iterable) {
  182. if (predicate(element)) {
  183. yield element;
  184. }
  185. }
  186. }
  187. Iterable2.filter = filter;
  188. function* map(iterable, fn) {
  189. let index = 0;
  190. for (const element of iterable) {
  191. yield fn(element, index++);
  192. }
  193. }
  194. Iterable2.map = map;
  195. function* flatMap(iterable, fn) {
  196. let index = 0;
  197. for (const element of iterable) {
  198. yield* fn(element, index++);
  199. }
  200. }
  201. Iterable2.flatMap = flatMap;
  202. function* concat(...iterables) {
  203. for (const iterable of iterables) {
  204. yield* iterable;
  205. }
  206. }
  207. Iterable2.concat = concat;
  208. function reduce(iterable, reducer, initialValue) {
  209. let value = initialValue;
  210. for (const element of iterable) {
  211. value = reducer(value, element);
  212. }
  213. return value;
  214. }
  215. Iterable2.reduce = reduce;
  216. function* slice(arr, from2, to = arr.length) {
  217. if (from2 < 0) {
  218. from2 += arr.length;
  219. }
  220. if (to < 0) {
  221. to += arr.length;
  222. } else if (to > arr.length) {
  223. to = arr.length;
  224. }
  225. for (; from2 < to; from2++) {
  226. yield arr[from2];
  227. }
  228. }
  229. Iterable2.slice = slice;
  230. function consume(iterable, atMost = Number.POSITIVE_INFINITY) {
  231. const consumed = [];
  232. if (atMost === 0) {
  233. return [consumed, iterable];
  234. }
  235. const iterator = iterable[Symbol.iterator]();
  236. for (let i = 0; i < atMost; i++) {
  237. const next = iterator.next();
  238. if (next.done) {
  239. return [consumed, Iterable2.empty()];
  240. }
  241. consumed.push(next.value);
  242. }
  243. return [consumed, { [Symbol.iterator]() {
  244. return iterator;
  245. } }];
  246. }
  247. Iterable2.consume = consume;
  248. async function asyncToArray(iterable) {
  249. const result = [];
  250. for await (const item of iterable) {
  251. result.push(item);
  252. }
  253. return Promise.resolve(result);
  254. }
  255. Iterable2.asyncToArray = asyncToArray;
  256. })(Iterable || (Iterable = {}));
  257. // node_modules/monaco-editor/esm/vs/base/common/lifecycle.js
  258. var TRACK_DISPOSABLES = false;
  259. var disposableTracker = null;
  260. function setDisposableTracker(tracker) {
  261. disposableTracker = tracker;
  262. }
  263. if (TRACK_DISPOSABLES) {
  264. const __is_disposable_tracked__ = "__is_disposable_tracked__";
  265. setDisposableTracker(new class {
  266. trackDisposable(x) {
  267. const stack = new Error("Potentially leaked disposable").stack;
  268. setTimeout(() => {
  269. if (!x[__is_disposable_tracked__]) {
  270. console.log(stack);
  271. }
  272. }, 3e3);
  273. }
  274. setParent(child, parent) {
  275. if (child && child !== Disposable.None) {
  276. try {
  277. child[__is_disposable_tracked__] = true;
  278. } catch {
  279. }
  280. }
  281. }
  282. markAsDisposed(disposable) {
  283. if (disposable && disposable !== Disposable.None) {
  284. try {
  285. disposable[__is_disposable_tracked__] = true;
  286. } catch {
  287. }
  288. }
  289. }
  290. markAsSingleton(disposable) {
  291. }
  292. }());
  293. }
  294. function trackDisposable(x) {
  295. disposableTracker?.trackDisposable(x);
  296. return x;
  297. }
  298. function markAsDisposed(disposable) {
  299. disposableTracker?.markAsDisposed(disposable);
  300. }
  301. function setParentOfDisposable(child, parent) {
  302. disposableTracker?.setParent(child, parent);
  303. }
  304. function setParentOfDisposables(children, parent) {
  305. if (!disposableTracker) {
  306. return;
  307. }
  308. for (const child of children) {
  309. disposableTracker.setParent(child, parent);
  310. }
  311. }
  312. function dispose(arg) {
  313. if (Iterable.is(arg)) {
  314. const errors = [];
  315. for (const d of arg) {
  316. if (d) {
  317. try {
  318. d.dispose();
  319. } catch (e) {
  320. errors.push(e);
  321. }
  322. }
  323. }
  324. if (errors.length === 1) {
  325. throw errors[0];
  326. } else if (errors.length > 1) {
  327. throw new AggregateError(errors, "Encountered errors while disposing of store");
  328. }
  329. return Array.isArray(arg) ? [] : arg;
  330. } else if (arg) {
  331. arg.dispose();
  332. return arg;
  333. }
  334. }
  335. function combinedDisposable(...disposables) {
  336. const parent = toDisposable(() => dispose(disposables));
  337. setParentOfDisposables(disposables, parent);
  338. return parent;
  339. }
  340. function toDisposable(fn) {
  341. const self = trackDisposable({
  342. dispose: createSingleCallFunction(() => {
  343. markAsDisposed(self);
  344. fn();
  345. })
  346. });
  347. return self;
  348. }
  349. var DisposableStore = class _DisposableStore {
  350. static {
  351. this.DISABLE_DISPOSED_WARNING = false;
  352. }
  353. constructor() {
  354. this._toDispose = /* @__PURE__ */ new Set();
  355. this._isDisposed = false;
  356. trackDisposable(this);
  357. }
  358. /**
  359. * Dispose of all registered disposables and mark this object as disposed.
  360. *
  361. * Any future disposables added to this object will be disposed of on `add`.
  362. */
  363. dispose() {
  364. if (this._isDisposed) {
  365. return;
  366. }
  367. markAsDisposed(this);
  368. this._isDisposed = true;
  369. this.clear();
  370. }
  371. /**
  372. * @return `true` if this object has been disposed of.
  373. */
  374. get isDisposed() {
  375. return this._isDisposed;
  376. }
  377. /**
  378. * Dispose of all registered disposables but do not mark this object as disposed.
  379. */
  380. clear() {
  381. if (this._toDispose.size === 0) {
  382. return;
  383. }
  384. try {
  385. dispose(this._toDispose);
  386. } finally {
  387. this._toDispose.clear();
  388. }
  389. }
  390. /**
  391. * Add a new {@link IDisposable disposable} to the collection.
  392. */
  393. add(o) {
  394. if (!o) {
  395. return o;
  396. }
  397. if (o === this) {
  398. throw new Error("Cannot register a disposable on itself!");
  399. }
  400. setParentOfDisposable(o, this);
  401. if (this._isDisposed) {
  402. if (!_DisposableStore.DISABLE_DISPOSED_WARNING) {
  403. console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack);
  404. }
  405. } else {
  406. this._toDispose.add(o);
  407. }
  408. return o;
  409. }
  410. /**
  411. * Deletes the value from the store, but does not dispose it.
  412. */
  413. deleteAndLeak(o) {
  414. if (!o) {
  415. return;
  416. }
  417. if (this._toDispose.has(o)) {
  418. this._toDispose.delete(o);
  419. setParentOfDisposable(o, null);
  420. }
  421. }
  422. };
  423. var Disposable = class {
  424. static {
  425. this.None = Object.freeze({ dispose() {
  426. } });
  427. }
  428. constructor() {
  429. this._store = new DisposableStore();
  430. trackDisposable(this);
  431. setParentOfDisposable(this._store, this);
  432. }
  433. dispose() {
  434. markAsDisposed(this);
  435. this._store.dispose();
  436. }
  437. /**
  438. * Adds `o` to the collection of disposables managed by this object.
  439. */
  440. _register(o) {
  441. if (o === this) {
  442. throw new Error("Cannot register a disposable on itself!");
  443. }
  444. return this._store.add(o);
  445. }
  446. };
  447. var DisposableMap = class {
  448. constructor() {
  449. this._store = /* @__PURE__ */ new Map();
  450. this._isDisposed = false;
  451. trackDisposable(this);
  452. }
  453. /**
  454. * Disposes of all stored values and mark this object as disposed.
  455. *
  456. * Trying to use this object after it has been disposed of is an error.
  457. */
  458. dispose() {
  459. markAsDisposed(this);
  460. this._isDisposed = true;
  461. this.clearAndDisposeAll();
  462. }
  463. /**
  464. * Disposes of all stored values and clear the map, but DO NOT mark this object as disposed.
  465. */
  466. clearAndDisposeAll() {
  467. if (!this._store.size) {
  468. return;
  469. }
  470. try {
  471. dispose(this._store.values());
  472. } finally {
  473. this._store.clear();
  474. }
  475. }
  476. get(key) {
  477. return this._store.get(key);
  478. }
  479. set(key, value, skipDisposeOnOverwrite = false) {
  480. if (this._isDisposed) {
  481. console.warn(new Error("Trying to add a disposable to a DisposableMap that has already been disposed of. The added object will be leaked!").stack);
  482. }
  483. if (!skipDisposeOnOverwrite) {
  484. this._store.get(key)?.dispose();
  485. }
  486. this._store.set(key, value);
  487. }
  488. /**
  489. * Delete the value stored for `key` from this map and also dispose of it.
  490. */
  491. deleteAndDispose(key) {
  492. this._store.get(key)?.dispose();
  493. this._store.delete(key);
  494. }
  495. [Symbol.iterator]() {
  496. return this._store[Symbol.iterator]();
  497. }
  498. };
  499. // node_modules/monaco-editor/esm/vs/base/common/linkedList.js
  500. var Node = class _Node {
  501. static {
  502. this.Undefined = new _Node(void 0);
  503. }
  504. constructor(element) {
  505. this.element = element;
  506. this.next = _Node.Undefined;
  507. this.prev = _Node.Undefined;
  508. }
  509. };
  510. var LinkedList = class {
  511. constructor() {
  512. this._first = Node.Undefined;
  513. this._last = Node.Undefined;
  514. this._size = 0;
  515. }
  516. get size() {
  517. return this._size;
  518. }
  519. isEmpty() {
  520. return this._first === Node.Undefined;
  521. }
  522. clear() {
  523. let node = this._first;
  524. while (node !== Node.Undefined) {
  525. const next = node.next;
  526. node.prev = Node.Undefined;
  527. node.next = Node.Undefined;
  528. node = next;
  529. }
  530. this._first = Node.Undefined;
  531. this._last = Node.Undefined;
  532. this._size = 0;
  533. }
  534. unshift(element) {
  535. return this._insert(element, false);
  536. }
  537. push(element) {
  538. return this._insert(element, true);
  539. }
  540. _insert(element, atTheEnd) {
  541. const newNode = new Node(element);
  542. if (this._first === Node.Undefined) {
  543. this._first = newNode;
  544. this._last = newNode;
  545. } else if (atTheEnd) {
  546. const oldLast = this._last;
  547. this._last = newNode;
  548. newNode.prev = oldLast;
  549. oldLast.next = newNode;
  550. } else {
  551. const oldFirst = this._first;
  552. this._first = newNode;
  553. newNode.next = oldFirst;
  554. oldFirst.prev = newNode;
  555. }
  556. this._size += 1;
  557. let didRemove = false;
  558. return () => {
  559. if (!didRemove) {
  560. didRemove = true;
  561. this._remove(newNode);
  562. }
  563. };
  564. }
  565. shift() {
  566. if (this._first === Node.Undefined) {
  567. return void 0;
  568. } else {
  569. const res = this._first.element;
  570. this._remove(this._first);
  571. return res;
  572. }
  573. }
  574. pop() {
  575. if (this._last === Node.Undefined) {
  576. return void 0;
  577. } else {
  578. const res = this._last.element;
  579. this._remove(this._last);
  580. return res;
  581. }
  582. }
  583. _remove(node) {
  584. if (node.prev !== Node.Undefined && node.next !== Node.Undefined) {
  585. const anchor = node.prev;
  586. anchor.next = node.next;
  587. node.next.prev = anchor;
  588. } else if (node.prev === Node.Undefined && node.next === Node.Undefined) {
  589. this._first = Node.Undefined;
  590. this._last = Node.Undefined;
  591. } else if (node.next === Node.Undefined) {
  592. this._last = this._last.prev;
  593. this._last.next = Node.Undefined;
  594. } else if (node.prev === Node.Undefined) {
  595. this._first = this._first.next;
  596. this._first.prev = Node.Undefined;
  597. }
  598. this._size -= 1;
  599. }
  600. *[Symbol.iterator]() {
  601. let node = this._first;
  602. while (node !== Node.Undefined) {
  603. yield node.element;
  604. node = node.next;
  605. }
  606. }
  607. };
  608. // node_modules/monaco-editor/esm/vs/base/common/stopwatch.js
  609. var hasPerformanceNow = globalThis.performance && typeof globalThis.performance.now === "function";
  610. var StopWatch = class _StopWatch {
  611. static create(highResolution) {
  612. return new _StopWatch(highResolution);
  613. }
  614. constructor(highResolution) {
  615. this._now = hasPerformanceNow && highResolution === false ? Date.now : globalThis.performance.now.bind(globalThis.performance);
  616. this._startTime = this._now();
  617. this._stopTime = -1;
  618. }
  619. stop() {
  620. this._stopTime = this._now();
  621. }
  622. reset() {
  623. this._startTime = this._now();
  624. this._stopTime = -1;
  625. }
  626. elapsed() {
  627. if (this._stopTime !== -1) {
  628. return this._stopTime - this._startTime;
  629. }
  630. return this._now() - this._startTime;
  631. }
  632. };
  633. // node_modules/monaco-editor/esm/vs/base/common/event.js
  634. var _enableListenerGCedWarning = false;
  635. var _enableDisposeWithListenerWarning = false;
  636. var _enableSnapshotPotentialLeakWarning = false;
  637. var Event;
  638. (function(Event2) {
  639. Event2.None = () => Disposable.None;
  640. function _addLeakageTraceLogic(options) {
  641. if (_enableSnapshotPotentialLeakWarning) {
  642. const { onDidAddListener: origListenerDidAdd } = options;
  643. const stack = Stacktrace.create();
  644. let count = 0;
  645. options.onDidAddListener = () => {
  646. if (++count === 2) {
  647. console.warn("snapshotted emitter LIKELY used public and SHOULD HAVE BEEN created with DisposableStore. snapshotted here");
  648. stack.print();
  649. }
  650. origListenerDidAdd?.();
  651. };
  652. }
  653. }
  654. function defer(event, disposable) {
  655. return debounce(event, () => void 0, 0, void 0, true, void 0, disposable);
  656. }
  657. Event2.defer = defer;
  658. function once(event) {
  659. return (listener, thisArgs = null, disposables) => {
  660. let didFire = false;
  661. let result = void 0;
  662. result = event((e) => {
  663. if (didFire) {
  664. return;
  665. } else if (result) {
  666. result.dispose();
  667. } else {
  668. didFire = true;
  669. }
  670. return listener.call(thisArgs, e);
  671. }, null, disposables);
  672. if (didFire) {
  673. result.dispose();
  674. }
  675. return result;
  676. };
  677. }
  678. Event2.once = once;
  679. function onceIf(event, condition) {
  680. return Event2.once(Event2.filter(event, condition));
  681. }
  682. Event2.onceIf = onceIf;
  683. function map(event, map2, disposable) {
  684. return snapshot((listener, thisArgs = null, disposables) => event((i) => listener.call(thisArgs, map2(i)), null, disposables), disposable);
  685. }
  686. Event2.map = map;
  687. function forEach(event, each, disposable) {
  688. return snapshot((listener, thisArgs = null, disposables) => event((i) => {
  689. each(i);
  690. listener.call(thisArgs, i);
  691. }, null, disposables), disposable);
  692. }
  693. Event2.forEach = forEach;
  694. function filter(event, filter2, disposable) {
  695. return snapshot((listener, thisArgs = null, disposables) => event((e) => filter2(e) && listener.call(thisArgs, e), null, disposables), disposable);
  696. }
  697. Event2.filter = filter;
  698. function signal(event) {
  699. return event;
  700. }
  701. Event2.signal = signal;
  702. function any(...events) {
  703. return (listener, thisArgs = null, disposables) => {
  704. const disposable = combinedDisposable(...events.map((event) => event((e) => listener.call(thisArgs, e))));
  705. return addAndReturnDisposable(disposable, disposables);
  706. };
  707. }
  708. Event2.any = any;
  709. function reduce(event, merge, initial, disposable) {
  710. let output = initial;
  711. return map(event, (e) => {
  712. output = merge(output, e);
  713. return output;
  714. }, disposable);
  715. }
  716. Event2.reduce = reduce;
  717. function snapshot(event, disposable) {
  718. let listener;
  719. const options = {
  720. onWillAddFirstListener() {
  721. listener = event(emitter.fire, emitter);
  722. },
  723. onDidRemoveLastListener() {
  724. listener?.dispose();
  725. }
  726. };
  727. if (!disposable) {
  728. _addLeakageTraceLogic(options);
  729. }
  730. const emitter = new Emitter(options);
  731. disposable?.add(emitter);
  732. return emitter.event;
  733. }
  734. function addAndReturnDisposable(d, store) {
  735. if (store instanceof Array) {
  736. store.push(d);
  737. } else if (store) {
  738. store.add(d);
  739. }
  740. return d;
  741. }
  742. function debounce(event, merge, delay = 100, leading = false, flushOnListenerRemove = false, leakWarningThreshold, disposable) {
  743. let subscription;
  744. let output = void 0;
  745. let handle = void 0;
  746. let numDebouncedCalls = 0;
  747. let doFire;
  748. const options = {
  749. leakWarningThreshold,
  750. onWillAddFirstListener() {
  751. subscription = event((cur) => {
  752. numDebouncedCalls++;
  753. output = merge(output, cur);
  754. if (leading && !handle) {
  755. emitter.fire(output);
  756. output = void 0;
  757. }
  758. doFire = () => {
  759. const _output = output;
  760. output = void 0;
  761. handle = void 0;
  762. if (!leading || numDebouncedCalls > 1) {
  763. emitter.fire(_output);
  764. }
  765. numDebouncedCalls = 0;
  766. };
  767. if (typeof delay === "number") {
  768. clearTimeout(handle);
  769. handle = setTimeout(doFire, delay);
  770. } else {
  771. if (handle === void 0) {
  772. handle = 0;
  773. queueMicrotask(doFire);
  774. }
  775. }
  776. });
  777. },
  778. onWillRemoveListener() {
  779. if (flushOnListenerRemove && numDebouncedCalls > 0) {
  780. doFire?.();
  781. }
  782. },
  783. onDidRemoveLastListener() {
  784. doFire = void 0;
  785. subscription.dispose();
  786. }
  787. };
  788. if (!disposable) {
  789. _addLeakageTraceLogic(options);
  790. }
  791. const emitter = new Emitter(options);
  792. disposable?.add(emitter);
  793. return emitter.event;
  794. }
  795. Event2.debounce = debounce;
  796. function accumulate(event, delay = 0, disposable) {
  797. return Event2.debounce(event, (last, e) => {
  798. if (!last) {
  799. return [e];
  800. }
  801. last.push(e);
  802. return last;
  803. }, delay, void 0, true, void 0, disposable);
  804. }
  805. Event2.accumulate = accumulate;
  806. function latch(event, equals3 = (a, b) => a === b, disposable) {
  807. let firstCall = true;
  808. let cache;
  809. return filter(event, (value) => {
  810. const shouldEmit = firstCall || !equals3(value, cache);
  811. firstCall = false;
  812. cache = value;
  813. return shouldEmit;
  814. }, disposable);
  815. }
  816. Event2.latch = latch;
  817. function split(event, isT, disposable) {
  818. return [
  819. Event2.filter(event, isT, disposable),
  820. Event2.filter(event, (e) => !isT(e), disposable)
  821. ];
  822. }
  823. Event2.split = split;
  824. function buffer(event, flushAfterTimeout = false, _buffer = [], disposable) {
  825. let buffer2 = _buffer.slice();
  826. let listener = event((e) => {
  827. if (buffer2) {
  828. buffer2.push(e);
  829. } else {
  830. emitter.fire(e);
  831. }
  832. });
  833. if (disposable) {
  834. disposable.add(listener);
  835. }
  836. const flush = () => {
  837. buffer2?.forEach((e) => emitter.fire(e));
  838. buffer2 = null;
  839. };
  840. const emitter = new Emitter({
  841. onWillAddFirstListener() {
  842. if (!listener) {
  843. listener = event((e) => emitter.fire(e));
  844. if (disposable) {
  845. disposable.add(listener);
  846. }
  847. }
  848. },
  849. onDidAddFirstListener() {
  850. if (buffer2) {
  851. if (flushAfterTimeout) {
  852. setTimeout(flush);
  853. } else {
  854. flush();
  855. }
  856. }
  857. },
  858. onDidRemoveLastListener() {
  859. if (listener) {
  860. listener.dispose();
  861. }
  862. listener = null;
  863. }
  864. });
  865. if (disposable) {
  866. disposable.add(emitter);
  867. }
  868. return emitter.event;
  869. }
  870. Event2.buffer = buffer;
  871. function chain(event, sythensize) {
  872. const fn = (listener, thisArgs, disposables) => {
  873. const cs = sythensize(new ChainableSynthesis());
  874. return event(function(value) {
  875. const result = cs.evaluate(value);
  876. if (result !== HaltChainable) {
  877. listener.call(thisArgs, result);
  878. }
  879. }, void 0, disposables);
  880. };
  881. return fn;
  882. }
  883. Event2.chain = chain;
  884. const HaltChainable = Symbol("HaltChainable");
  885. class ChainableSynthesis {
  886. constructor() {
  887. this.steps = [];
  888. }
  889. map(fn) {
  890. this.steps.push(fn);
  891. return this;
  892. }
  893. forEach(fn) {
  894. this.steps.push((v) => {
  895. fn(v);
  896. return v;
  897. });
  898. return this;
  899. }
  900. filter(fn) {
  901. this.steps.push((v) => fn(v) ? v : HaltChainable);
  902. return this;
  903. }
  904. reduce(merge, initial) {
  905. let last = initial;
  906. this.steps.push((v) => {
  907. last = merge(last, v);
  908. return last;
  909. });
  910. return this;
  911. }
  912. latch(equals3 = (a, b) => a === b) {
  913. let firstCall = true;
  914. let cache;
  915. this.steps.push((value) => {
  916. const shouldEmit = firstCall || !equals3(value, cache);
  917. firstCall = false;
  918. cache = value;
  919. return shouldEmit ? value : HaltChainable;
  920. });
  921. return this;
  922. }
  923. evaluate(value) {
  924. for (const step of this.steps) {
  925. value = step(value);
  926. if (value === HaltChainable) {
  927. break;
  928. }
  929. }
  930. return value;
  931. }
  932. }
  933. function fromNodeEventEmitter(emitter, eventName, map2 = (id) => id) {
  934. const fn = (...args) => result.fire(map2(...args));
  935. const onFirstListenerAdd = () => emitter.on(eventName, fn);
  936. const onLastListenerRemove = () => emitter.removeListener(eventName, fn);
  937. const result = new Emitter({ onWillAddFirstListener: onFirstListenerAdd, onDidRemoveLastListener: onLastListenerRemove });
  938. return result.event;
  939. }
  940. Event2.fromNodeEventEmitter = fromNodeEventEmitter;
  941. function fromDOMEventEmitter(emitter, eventName, map2 = (id) => id) {
  942. const fn = (...args) => result.fire(map2(...args));
  943. const onFirstListenerAdd = () => emitter.addEventListener(eventName, fn);
  944. const onLastListenerRemove = () => emitter.removeEventListener(eventName, fn);
  945. const result = new Emitter({ onWillAddFirstListener: onFirstListenerAdd, onDidRemoveLastListener: onLastListenerRemove });
  946. return result.event;
  947. }
  948. Event2.fromDOMEventEmitter = fromDOMEventEmitter;
  949. function toPromise(event) {
  950. return new Promise((resolve2) => once(event)(resolve2));
  951. }
  952. Event2.toPromise = toPromise;
  953. function fromPromise(promise) {
  954. const result = new Emitter();
  955. promise.then((res) => {
  956. result.fire(res);
  957. }, () => {
  958. result.fire(void 0);
  959. }).finally(() => {
  960. result.dispose();
  961. });
  962. return result.event;
  963. }
  964. Event2.fromPromise = fromPromise;
  965. function forward(from, to) {
  966. return from((e) => to.fire(e));
  967. }
  968. Event2.forward = forward;
  969. function runAndSubscribe(event, handler, initial) {
  970. handler(initial);
  971. return event((e) => handler(e));
  972. }
  973. Event2.runAndSubscribe = runAndSubscribe;
  974. class EmitterObserver {
  975. constructor(_observable, store) {
  976. this._observable = _observable;
  977. this._counter = 0;
  978. this._hasChanged = false;
  979. const options = {
  980. onWillAddFirstListener: () => {
  981. _observable.addObserver(this);
  982. this._observable.reportChanges();
  983. },
  984. onDidRemoveLastListener: () => {
  985. _observable.removeObserver(this);
  986. }
  987. };
  988. if (!store) {
  989. _addLeakageTraceLogic(options);
  990. }
  991. this.emitter = new Emitter(options);
  992. if (store) {
  993. store.add(this.emitter);
  994. }
  995. }
  996. beginUpdate(_observable) {
  997. this._counter++;
  998. }
  999. handlePossibleChange(_observable) {
  1000. }
  1001. handleChange(_observable, _change) {
  1002. this._hasChanged = true;
  1003. }
  1004. endUpdate(_observable) {
  1005. this._counter--;
  1006. if (this._counter === 0) {
  1007. this._observable.reportChanges();
  1008. if (this._hasChanged) {
  1009. this._hasChanged = false;
  1010. this.emitter.fire(this._observable.get());
  1011. }
  1012. }
  1013. }
  1014. }
  1015. function fromObservable(obs, store) {
  1016. const observer = new EmitterObserver(obs, store);
  1017. return observer.emitter.event;
  1018. }
  1019. Event2.fromObservable = fromObservable;
  1020. function fromObservableLight(observable) {
  1021. return (listener, thisArgs, disposables) => {
  1022. let count = 0;
  1023. let didChange = false;
  1024. const observer = {
  1025. beginUpdate() {
  1026. count++;
  1027. },
  1028. endUpdate() {
  1029. count--;
  1030. if (count === 0) {
  1031. observable.reportChanges();
  1032. if (didChange) {
  1033. didChange = false;
  1034. listener.call(thisArgs);
  1035. }
  1036. }
  1037. },
  1038. handlePossibleChange() {
  1039. },
  1040. handleChange() {
  1041. didChange = true;
  1042. }
  1043. };
  1044. observable.addObserver(observer);
  1045. observable.reportChanges();
  1046. const disposable = {
  1047. dispose() {
  1048. observable.removeObserver(observer);
  1049. }
  1050. };
  1051. if (disposables instanceof DisposableStore) {
  1052. disposables.add(disposable);
  1053. } else if (Array.isArray(disposables)) {
  1054. disposables.push(disposable);
  1055. }
  1056. return disposable;
  1057. };
  1058. }
  1059. Event2.fromObservableLight = fromObservableLight;
  1060. })(Event || (Event = {}));
  1061. var EventProfiling = class _EventProfiling {
  1062. static {
  1063. this.all = /* @__PURE__ */ new Set();
  1064. }
  1065. static {
  1066. this._idPool = 0;
  1067. }
  1068. constructor(name) {
  1069. this.listenerCount = 0;
  1070. this.invocationCount = 0;
  1071. this.elapsedOverall = 0;
  1072. this.durations = [];
  1073. this.name = `${name}_${_EventProfiling._idPool++}`;
  1074. _EventProfiling.all.add(this);
  1075. }
  1076. start(listenerCount) {
  1077. this._stopWatch = new StopWatch();
  1078. this.listenerCount = listenerCount;
  1079. }
  1080. stop() {
  1081. if (this._stopWatch) {
  1082. const elapsed = this._stopWatch.elapsed();
  1083. this.durations.push(elapsed);
  1084. this.elapsedOverall += elapsed;
  1085. this.invocationCount += 1;
  1086. this._stopWatch = void 0;
  1087. }
  1088. }
  1089. };
  1090. var _globalLeakWarningThreshold = -1;
  1091. var LeakageMonitor = class _LeakageMonitor {
  1092. static {
  1093. this._idPool = 1;
  1094. }
  1095. constructor(_errorHandler, threshold, name = (_LeakageMonitor._idPool++).toString(16).padStart(3, "0")) {
  1096. this._errorHandler = _errorHandler;
  1097. this.threshold = threshold;
  1098. this.name = name;
  1099. this._warnCountdown = 0;
  1100. }
  1101. dispose() {
  1102. this._stacks?.clear();
  1103. }
  1104. check(stack, listenerCount) {
  1105. const threshold = this.threshold;
  1106. if (threshold <= 0 || listenerCount < threshold) {
  1107. return void 0;
  1108. }
  1109. if (!this._stacks) {
  1110. this._stacks = /* @__PURE__ */ new Map();
  1111. }
  1112. const count = this._stacks.get(stack.value) || 0;
  1113. this._stacks.set(stack.value, count + 1);
  1114. this._warnCountdown -= 1;
  1115. if (this._warnCountdown <= 0) {
  1116. this._warnCountdown = threshold * 0.5;
  1117. const [topStack, topCount] = this.getMostFrequentStack();
  1118. const message = `[${this.name}] potential listener LEAK detected, having ${listenerCount} listeners already. MOST frequent listener (${topCount}):`;
  1119. console.warn(message);
  1120. console.warn(topStack);
  1121. const error = new ListenerLeakError(message, topStack);
  1122. this._errorHandler(error);
  1123. }
  1124. return () => {
  1125. const count2 = this._stacks.get(stack.value) || 0;
  1126. this._stacks.set(stack.value, count2 - 1);
  1127. };
  1128. }
  1129. getMostFrequentStack() {
  1130. if (!this._stacks) {
  1131. return void 0;
  1132. }
  1133. let topStack;
  1134. let topCount = 0;
  1135. for (const [stack, count] of this._stacks) {
  1136. if (!topStack || topCount < count) {
  1137. topStack = [stack, count];
  1138. topCount = count;
  1139. }
  1140. }
  1141. return topStack;
  1142. }
  1143. };
  1144. var Stacktrace = class _Stacktrace {
  1145. static create() {
  1146. const err = new Error();
  1147. return new _Stacktrace(err.stack ?? "");
  1148. }
  1149. constructor(value) {
  1150. this.value = value;
  1151. }
  1152. print() {
  1153. console.warn(this.value.split("\n").slice(2).join("\n"));
  1154. }
  1155. };
  1156. var ListenerLeakError = class extends Error {
  1157. constructor(message, stack) {
  1158. super(message);
  1159. this.name = "ListenerLeakError";
  1160. this.stack = stack;
  1161. }
  1162. };
  1163. var ListenerRefusalError = class extends Error {
  1164. constructor(message, stack) {
  1165. super(message);
  1166. this.name = "ListenerRefusalError";
  1167. this.stack = stack;
  1168. }
  1169. };
  1170. var UniqueContainer = class {
  1171. constructor(value) {
  1172. this.value = value;
  1173. }
  1174. };
  1175. var compactionThreshold = 2;
  1176. var forEachListener = (listeners, fn) => {
  1177. if (listeners instanceof UniqueContainer) {
  1178. fn(listeners);
  1179. } else {
  1180. for (let i = 0; i < listeners.length; i++) {
  1181. const l = listeners[i];
  1182. if (l) {
  1183. fn(l);
  1184. }
  1185. }
  1186. }
  1187. };
  1188. var _listenerFinalizers;
  1189. if (_enableListenerGCedWarning) {
  1190. const leaks = [];
  1191. setInterval(() => {
  1192. if (leaks.length === 0) {
  1193. return;
  1194. }
  1195. console.warn("[LEAKING LISTENERS] GC'ed these listeners that were NOT yet disposed:");
  1196. console.warn(leaks.join("\n"));
  1197. leaks.length = 0;
  1198. }, 3e3);
  1199. _listenerFinalizers = new FinalizationRegistry((heldValue) => {
  1200. if (typeof heldValue === "string") {
  1201. leaks.push(heldValue);
  1202. }
  1203. });
  1204. }
  1205. var Emitter = class {
  1206. constructor(options) {
  1207. this._size = 0;
  1208. this._options = options;
  1209. this._leakageMon = _globalLeakWarningThreshold > 0 || this._options?.leakWarningThreshold ? new LeakageMonitor(options?.onListenerError ?? onUnexpectedError, this._options?.leakWarningThreshold ?? _globalLeakWarningThreshold) : void 0;
  1210. this._perfMon = this._options?._profName ? new EventProfiling(this._options._profName) : void 0;
  1211. this._deliveryQueue = this._options?.deliveryQueue;
  1212. }
  1213. dispose() {
  1214. if (!this._disposed) {
  1215. this._disposed = true;
  1216. if (this._deliveryQueue?.current === this) {
  1217. this._deliveryQueue.reset();
  1218. }
  1219. if (this._listeners) {
  1220. if (_enableDisposeWithListenerWarning) {
  1221. const listeners = this._listeners;
  1222. queueMicrotask(() => {
  1223. forEachListener(listeners, (l) => l.stack?.print());
  1224. });
  1225. }
  1226. this._listeners = void 0;
  1227. this._size = 0;
  1228. }
  1229. this._options?.onDidRemoveLastListener?.();
  1230. this._leakageMon?.dispose();
  1231. }
  1232. }
  1233. /**
  1234. * For the public to allow to subscribe
  1235. * to events from this Emitter
  1236. */
  1237. get event() {
  1238. this._event ??= (callback, thisArgs, disposables) => {
  1239. if (this._leakageMon && this._size > this._leakageMon.threshold ** 2) {
  1240. const message = `[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;
  1241. console.warn(message);
  1242. const tuple = this._leakageMon.getMostFrequentStack() ?? ["UNKNOWN stack", -1];
  1243. const error = new ListenerRefusalError(`${message}. HINT: Stack shows most frequent listener (${tuple[1]}-times)`, tuple[0]);
  1244. const errorHandler2 = this._options?.onListenerError || onUnexpectedError;
  1245. errorHandler2(error);
  1246. return Disposable.None;
  1247. }
  1248. if (this._disposed) {
  1249. return Disposable.None;
  1250. }
  1251. if (thisArgs) {
  1252. callback = callback.bind(thisArgs);
  1253. }
  1254. const contained = new UniqueContainer(callback);
  1255. let removeMonitor;
  1256. let stack;
  1257. if (this._leakageMon && this._size >= Math.ceil(this._leakageMon.threshold * 0.2)) {
  1258. contained.stack = Stacktrace.create();
  1259. removeMonitor = this._leakageMon.check(contained.stack, this._size + 1);
  1260. }
  1261. if (_enableDisposeWithListenerWarning) {
  1262. contained.stack = stack ?? Stacktrace.create();
  1263. }
  1264. if (!this._listeners) {
  1265. this._options?.onWillAddFirstListener?.(this);
  1266. this._listeners = contained;
  1267. this._options?.onDidAddFirstListener?.(this);
  1268. } else if (this._listeners instanceof UniqueContainer) {
  1269. this._deliveryQueue ??= new EventDeliveryQueuePrivate();
  1270. this._listeners = [this._listeners, contained];
  1271. } else {
  1272. this._listeners.push(contained);
  1273. }
  1274. this._size++;
  1275. const result = toDisposable(() => {
  1276. _listenerFinalizers?.unregister(result);
  1277. removeMonitor?.();
  1278. this._removeListener(contained);
  1279. });
  1280. if (disposables instanceof DisposableStore) {
  1281. disposables.add(result);
  1282. } else if (Array.isArray(disposables)) {
  1283. disposables.push(result);
  1284. }
  1285. if (_listenerFinalizers) {
  1286. const stack2 = new Error().stack.split("\n").slice(2, 3).join("\n").trim();
  1287. const match = /(file:|vscode-file:\/\/vscode-app)?(\/[^:]*:\d+:\d+)/.exec(stack2);
  1288. _listenerFinalizers.register(result, match?.[2] ?? stack2, result);
  1289. }
  1290. return result;
  1291. };
  1292. return this._event;
  1293. }
  1294. _removeListener(listener) {
  1295. this._options?.onWillRemoveListener?.(this);
  1296. if (!this._listeners) {
  1297. return;
  1298. }
  1299. if (this._size === 1) {
  1300. this._listeners = void 0;
  1301. this._options?.onDidRemoveLastListener?.(this);
  1302. this._size = 0;
  1303. return;
  1304. }
  1305. const listeners = this._listeners;
  1306. const index = listeners.indexOf(listener);
  1307. if (index === -1) {
  1308. console.log("disposed?", this._disposed);
  1309. console.log("size?", this._size);
  1310. console.log("arr?", JSON.stringify(this._listeners));
  1311. throw new Error("Attempted to dispose unknown listener");
  1312. }
  1313. this._size--;
  1314. listeners[index] = void 0;
  1315. const adjustDeliveryQueue = this._deliveryQueue.current === this;
  1316. if (this._size * compactionThreshold <= listeners.length) {
  1317. let n = 0;
  1318. for (let i = 0; i < listeners.length; i++) {
  1319. if (listeners[i]) {
  1320. listeners[n++] = listeners[i];
  1321. } else if (adjustDeliveryQueue) {
  1322. this._deliveryQueue.end--;
  1323. if (n < this._deliveryQueue.i) {
  1324. this._deliveryQueue.i--;
  1325. }
  1326. }
  1327. }
  1328. listeners.length = n;
  1329. }
  1330. }
  1331. _deliver(listener, value) {
  1332. if (!listener) {
  1333. return;
  1334. }
  1335. const errorHandler2 = this._options?.onListenerError || onUnexpectedError;
  1336. if (!errorHandler2) {
  1337. listener.value(value);
  1338. return;
  1339. }
  1340. try {
  1341. listener.value(value);
  1342. } catch (e) {
  1343. errorHandler2(e);
  1344. }
  1345. }
  1346. /** Delivers items in the queue. Assumes the queue is ready to go. */
  1347. _deliverQueue(dq) {
  1348. const listeners = dq.current._listeners;
  1349. while (dq.i < dq.end) {
  1350. this._deliver(listeners[dq.i++], dq.value);
  1351. }
  1352. dq.reset();
  1353. }
  1354. /**
  1355. * To be kept private to fire an event to
  1356. * subscribers
  1357. */
  1358. fire(event) {
  1359. if (this._deliveryQueue?.current) {
  1360. this._deliverQueue(this._deliveryQueue);
  1361. this._perfMon?.stop();
  1362. }
  1363. this._perfMon?.start(this._size);
  1364. if (!this._listeners) {
  1365. } else if (this._listeners instanceof UniqueContainer) {
  1366. this._deliver(this._listeners, event);
  1367. } else {
  1368. const dq = this._deliveryQueue;
  1369. dq.enqueue(this, event, this._listeners.length);
  1370. this._deliverQueue(dq);
  1371. }
  1372. this._perfMon?.stop();
  1373. }
  1374. hasListeners() {
  1375. return this._size > 0;
  1376. }
  1377. };
  1378. var EventDeliveryQueuePrivate = class {
  1379. constructor() {
  1380. this.i = -1;
  1381. this.end = 0;
  1382. }
  1383. enqueue(emitter, value, end) {
  1384. this.i = 0;
  1385. this.end = end;
  1386. this.current = emitter;
  1387. this.value = value;
  1388. }
  1389. reset() {
  1390. this.i = this.end;
  1391. this.current = void 0;
  1392. this.value = void 0;
  1393. }
  1394. };
  1395. // node_modules/monaco-editor/esm/vs/nls.messages.js
  1396. function getNLSMessages() {
  1397. return globalThis._VSCODE_NLS_MESSAGES;
  1398. }
  1399. function getNLSLanguage() {
  1400. return globalThis._VSCODE_NLS_LANGUAGE;
  1401. }
  1402. // node_modules/monaco-editor/esm/vs/nls.js
  1403. var isPseudo = getNLSLanguage() === "pseudo" || typeof document !== "undefined" && document.location && document.location.hash.indexOf("pseudo=true") >= 0;
  1404. function _format(message, args) {
  1405. let result;
  1406. if (args.length === 0) {
  1407. result = message;
  1408. } else {
  1409. result = message.replace(/\{(\d+)\}/g, (match, rest) => {
  1410. const index = rest[0];
  1411. const arg = args[index];
  1412. let result2 = match;
  1413. if (typeof arg === "string") {
  1414. result2 = arg;
  1415. } else if (typeof arg === "number" || typeof arg === "boolean" || arg === void 0 || arg === null) {
  1416. result2 = String(arg);
  1417. }
  1418. return result2;
  1419. });
  1420. }
  1421. if (isPseudo) {
  1422. result = "\uFF3B" + result.replace(/[aouei]/g, "$&$&") + "\uFF3D";
  1423. }
  1424. return result;
  1425. }
  1426. function localize(data, message, ...args) {
  1427. if (typeof data === "number") {
  1428. return _format(lookupMessage(data, message), args);
  1429. }
  1430. return _format(message, args);
  1431. }
  1432. function lookupMessage(index, fallback) {
  1433. const message = getNLSMessages()?.[index];
  1434. if (typeof message !== "string") {
  1435. if (typeof fallback === "string") {
  1436. return fallback;
  1437. }
  1438. throw new Error(`!!! NLS MISSING: ${index} !!!`);
  1439. }
  1440. return message;
  1441. }
  1442. // node_modules/monaco-editor/esm/vs/base/common/platform.js
  1443. var LANGUAGE_DEFAULT = "en";
  1444. var _isWindows = false;
  1445. var _isMacintosh = false;
  1446. var _isLinux = false;
  1447. var _isLinuxSnap = false;
  1448. var _isNative = false;
  1449. var _isWeb = false;
  1450. var _isElectron = false;
  1451. var _isIOS = false;
  1452. var _isCI = false;
  1453. var _isMobile = false;
  1454. var _locale = void 0;
  1455. var _language = LANGUAGE_DEFAULT;
  1456. var _platformLocale = LANGUAGE_DEFAULT;
  1457. var _translationsConfigFile = void 0;
  1458. var _userAgent = void 0;
  1459. var $globalThis = globalThis;
  1460. var nodeProcess = void 0;
  1461. if (typeof $globalThis.vscode !== "undefined" && typeof $globalThis.vscode.process !== "undefined") {
  1462. nodeProcess = $globalThis.vscode.process;
  1463. } else if (typeof process !== "undefined" && typeof process?.versions?.node === "string") {
  1464. nodeProcess = process;
  1465. }
  1466. var isElectronProcess = typeof nodeProcess?.versions?.electron === "string";
  1467. var isElectronRenderer = isElectronProcess && nodeProcess?.type === "renderer";
  1468. if (typeof nodeProcess === "object") {
  1469. _isWindows = nodeProcess.platform === "win32";
  1470. _isMacintosh = nodeProcess.platform === "darwin";
  1471. _isLinux = nodeProcess.platform === "linux";
  1472. _isLinuxSnap = _isLinux && !!nodeProcess.env["SNAP"] && !!nodeProcess.env["SNAP_REVISION"];
  1473. _isElectron = isElectronProcess;
  1474. _isCI = !!nodeProcess.env["CI"] || !!nodeProcess.env["BUILD_ARTIFACTSTAGINGDIRECTORY"];
  1475. _locale = LANGUAGE_DEFAULT;
  1476. _language = LANGUAGE_DEFAULT;
  1477. const rawNlsConfig = nodeProcess.env["VSCODE_NLS_CONFIG"];
  1478. if (rawNlsConfig) {
  1479. try {
  1480. const nlsConfig = JSON.parse(rawNlsConfig);
  1481. _locale = nlsConfig.userLocale;
  1482. _platformLocale = nlsConfig.osLocale;
  1483. _language = nlsConfig.resolvedLanguage || LANGUAGE_DEFAULT;
  1484. _translationsConfigFile = nlsConfig.languagePack?.translationsConfigFile;
  1485. } catch (e) {
  1486. }
  1487. }
  1488. _isNative = true;
  1489. } else if (typeof navigator === "object" && !isElectronRenderer) {
  1490. _userAgent = navigator.userAgent;
  1491. _isWindows = _userAgent.indexOf("Windows") >= 0;
  1492. _isMacintosh = _userAgent.indexOf("Macintosh") >= 0;
  1493. _isIOS = (_userAgent.indexOf("Macintosh") >= 0 || _userAgent.indexOf("iPad") >= 0 || _userAgent.indexOf("iPhone") >= 0) && !!navigator.maxTouchPoints && navigator.maxTouchPoints > 0;
  1494. _isLinux = _userAgent.indexOf("Linux") >= 0;
  1495. _isMobile = _userAgent?.indexOf("Mobi") >= 0;
  1496. _isWeb = true;
  1497. _language = getNLSLanguage() || LANGUAGE_DEFAULT;
  1498. _locale = navigator.language.toLowerCase();
  1499. _platformLocale = _locale;
  1500. } else {
  1501. console.error("Unable to resolve platform.");
  1502. }
  1503. var _platform = 0;
  1504. if (_isMacintosh) {
  1505. _platform = 1;
  1506. } else if (_isWindows) {
  1507. _platform = 3;
  1508. } else if (_isLinux) {
  1509. _platform = 2;
  1510. }
  1511. var isWindows = _isWindows;
  1512. var isMacintosh = _isMacintosh;
  1513. var isNative = _isNative;
  1514. var isWeb = _isWeb;
  1515. var isWebWorker = _isWeb && typeof $globalThis.importScripts === "function";
  1516. var webWorkerOrigin = isWebWorker ? $globalThis.origin : void 0;
  1517. var userAgent = _userAgent;
  1518. var setTimeout0IsFaster = typeof $globalThis.postMessage === "function" && !$globalThis.importScripts;
  1519. var setTimeout0 = (() => {
  1520. if (setTimeout0IsFaster) {
  1521. const pending = [];
  1522. $globalThis.addEventListener("message", (e) => {
  1523. if (e.data && e.data.vscodeScheduleAsyncWork) {
  1524. for (let i = 0, len = pending.length; i < len; i++) {
  1525. const candidate = pending[i];
  1526. if (candidate.id === e.data.vscodeScheduleAsyncWork) {
  1527. pending.splice(i, 1);
  1528. candidate.callback();
  1529. return;
  1530. }
  1531. }
  1532. }
  1533. });
  1534. let lastId = 0;
  1535. return (callback) => {
  1536. const myId = ++lastId;
  1537. pending.push({
  1538. id: myId,
  1539. callback
  1540. });
  1541. $globalThis.postMessage({ vscodeScheduleAsyncWork: myId }, "*");
  1542. };
  1543. }
  1544. return (callback) => setTimeout(callback);
  1545. })();
  1546. var isChrome = !!(userAgent && userAgent.indexOf("Chrome") >= 0);
  1547. var isFirefox = !!(userAgent && userAgent.indexOf("Firefox") >= 0);
  1548. var isSafari = !!(!isChrome && (userAgent && userAgent.indexOf("Safari") >= 0));
  1549. var isEdge = !!(userAgent && userAgent.indexOf("Edg/") >= 0);
  1550. var isAndroid = !!(userAgent && userAgent.indexOf("Android") >= 0);
  1551. // node_modules/monaco-editor/esm/vs/base/common/cache.js
  1552. function identity(t) {
  1553. return t;
  1554. }
  1555. var LRUCachedFunction = class {
  1556. constructor(arg1, arg2) {
  1557. this.lastCache = void 0;
  1558. this.lastArgKey = void 0;
  1559. if (typeof arg1 === "function") {
  1560. this._fn = arg1;
  1561. this._computeKey = identity;
  1562. } else {
  1563. this._fn = arg2;
  1564. this._computeKey = arg1.getCacheKey;
  1565. }
  1566. }
  1567. get(arg) {
  1568. const key = this._computeKey(arg);
  1569. if (this.lastArgKey !== key) {
  1570. this.lastArgKey = key;
  1571. this.lastCache = this._fn(arg);
  1572. }
  1573. return this.lastCache;
  1574. }
  1575. };
  1576. // node_modules/monaco-editor/esm/vs/base/common/lazy.js
  1577. var Lazy = class {
  1578. constructor(executor) {
  1579. this.executor = executor;
  1580. this._didRun = false;
  1581. }
  1582. /**
  1583. * Get the wrapped value.
  1584. *
  1585. * This will force evaluation of the lazy value if it has not been resolved yet. Lazy values are only
  1586. * resolved once. `getValue` will re-throw exceptions that are hit while resolving the value
  1587. */
  1588. get value() {
  1589. if (!this._didRun) {
  1590. try {
  1591. this._value = this.executor();
  1592. } catch (err) {
  1593. this._error = err;
  1594. } finally {
  1595. this._didRun = true;
  1596. }
  1597. }
  1598. if (this._error) {
  1599. throw this._error;
  1600. }
  1601. return this._value;
  1602. }
  1603. /**
  1604. * Get the wrapped value without forcing evaluation.
  1605. */
  1606. get rawValue() {
  1607. return this._value;
  1608. }
  1609. };
  1610. // node_modules/monaco-editor/esm/vs/base/common/strings.js
  1611. function escapeRegExpCharacters(value) {
  1612. return value.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g, "\\$&");
  1613. }
  1614. function splitLines(str) {
  1615. return str.split(/\r\n|\r|\n/);
  1616. }
  1617. function firstNonWhitespaceIndex(str) {
  1618. for (let i = 0, len = str.length; i < len; i++) {
  1619. const chCode = str.charCodeAt(i);
  1620. if (chCode !== 32 && chCode !== 9) {
  1621. return i;
  1622. }
  1623. }
  1624. return -1;
  1625. }
  1626. function lastNonWhitespaceIndex(str, startIndex = str.length - 1) {
  1627. for (let i = startIndex; i >= 0; i--) {
  1628. const chCode = str.charCodeAt(i);
  1629. if (chCode !== 32 && chCode !== 9) {
  1630. return i;
  1631. }
  1632. }
  1633. return -1;
  1634. }
  1635. function isUpperAsciiLetter(code) {
  1636. return code >= 65 && code <= 90;
  1637. }
  1638. function isHighSurrogate(charCode) {
  1639. return 55296 <= charCode && charCode <= 56319;
  1640. }
  1641. function isLowSurrogate(charCode) {
  1642. return 56320 <= charCode && charCode <= 57343;
  1643. }
  1644. function computeCodePoint(highSurrogate, lowSurrogate) {
  1645. return (highSurrogate - 55296 << 10) + (lowSurrogate - 56320) + 65536;
  1646. }
  1647. function getNextCodePoint(str, len, offset) {
  1648. const charCode = str.charCodeAt(offset);
  1649. if (isHighSurrogate(charCode) && offset + 1 < len) {
  1650. const nextCharCode = str.charCodeAt(offset + 1);
  1651. if (isLowSurrogate(nextCharCode)) {
  1652. return computeCodePoint(charCode, nextCharCode);
  1653. }
  1654. }
  1655. return charCode;
  1656. }
  1657. var IS_BASIC_ASCII = /^[\t\n\r\x20-\x7E]*$/;
  1658. function isBasicASCII(str) {
  1659. return IS_BASIC_ASCII.test(str);
  1660. }
  1661. var UTF8_BOM_CHARACTER = String.fromCharCode(
  1662. 65279
  1663. /* CharCode.UTF8_BOM */
  1664. );
  1665. var GraphemeBreakTree = class _GraphemeBreakTree {
  1666. static {
  1667. this._INSTANCE = null;
  1668. }
  1669. static getInstance() {
  1670. if (!_GraphemeBreakTree._INSTANCE) {
  1671. _GraphemeBreakTree._INSTANCE = new _GraphemeBreakTree();
  1672. }
  1673. return _GraphemeBreakTree._INSTANCE;
  1674. }
  1675. constructor() {
  1676. this._data = getGraphemeBreakRawData();
  1677. }
  1678. getGraphemeBreakType(codePoint) {
  1679. if (codePoint < 32) {
  1680. if (codePoint === 10) {
  1681. return 3;
  1682. }
  1683. if (codePoint === 13) {
  1684. return 2;
  1685. }
  1686. return 4;
  1687. }
  1688. if (codePoint < 127) {
  1689. return 0;
  1690. }
  1691. const data = this._data;
  1692. const nodeCount = data.length / 3;
  1693. let nodeIndex = 1;
  1694. while (nodeIndex <= nodeCount) {
  1695. if (codePoint < data[3 * nodeIndex]) {
  1696. nodeIndex = 2 * nodeIndex;
  1697. } else if (codePoint > data[3 * nodeIndex + 1]) {
  1698. nodeIndex = 2 * nodeIndex + 1;
  1699. } else {
  1700. return data[3 * nodeIndex + 2];
  1701. }
  1702. }
  1703. return 0;
  1704. }
  1705. };
  1706. function getGraphemeBreakRawData() {
  1707. return JSON.parse("[0,0,0,51229,51255,12,44061,44087,12,127462,127487,6,7083,7085,5,47645,47671,12,54813,54839,12,128678,128678,14,3270,3270,5,9919,9923,14,45853,45879,12,49437,49463,12,53021,53047,12,71216,71218,7,128398,128399,14,129360,129374,14,2519,2519,5,4448,4519,9,9742,9742,14,12336,12336,14,44957,44983,12,46749,46775,12,48541,48567,12,50333,50359,12,52125,52151,12,53917,53943,12,69888,69890,5,73018,73018,5,127990,127990,14,128558,128559,14,128759,128760,14,129653,129655,14,2027,2035,5,2891,2892,7,3761,3761,5,6683,6683,5,8293,8293,4,9825,9826,14,9999,9999,14,43452,43453,5,44509,44535,12,45405,45431,12,46301,46327,12,47197,47223,12,48093,48119,12,48989,49015,12,49885,49911,12,50781,50807,12,51677,51703,12,52573,52599,12,53469,53495,12,54365,54391,12,65279,65279,4,70471,70472,7,72145,72147,7,119173,119179,5,127799,127818,14,128240,128244,14,128512,128512,14,128652,128652,14,128721,128722,14,129292,129292,14,129445,129450,14,129734,129743,14,1476,1477,5,2366,2368,7,2750,2752,7,3076,3076,5,3415,3415,5,4141,4144,5,6109,6109,5,6964,6964,5,7394,7400,5,9197,9198,14,9770,9770,14,9877,9877,14,9968,9969,14,10084,10084,14,43052,43052,5,43713,43713,5,44285,44311,12,44733,44759,12,45181,45207,12,45629,45655,12,46077,46103,12,46525,46551,12,46973,46999,12,47421,47447,12,47869,47895,12,48317,48343,12,48765,48791,12,49213,49239,12,49661,49687,12,50109,50135,12,50557,50583,12,51005,51031,12,51453,51479,12,51901,51927,12,52349,52375,12,52797,52823,12,53245,53271,12,53693,53719,12,54141,54167,12,54589,54615,12,55037,55063,12,69506,69509,5,70191,70193,5,70841,70841,7,71463,71467,5,72330,72342,5,94031,94031,5,123628,123631,5,127763,127765,14,127941,127941,14,128043,128062,14,128302,128317,14,128465,128467,14,128539,128539,14,128640,128640,14,128662,128662,14,128703,128703,14,128745,128745,14,129004,129007,14,129329,129330,14,129402,129402,14,129483,129483,14,129686,129704,14,130048,131069,14,173,173,4,1757,1757,1,2200,2207,5,2434,2435,7,2631,2632,5,2817,2817,5,3008,3008,5,3201,3201,5,3387,3388,5,3542,3542,5,3902,3903,7,4190,4192,5,6002,6003,5,6439,6440,5,6765,6770,7,7019,7027,5,7154,7155,7,8205,8205,13,8505,8505,14,9654,9654,14,9757,9757,14,9792,9792,14,9852,9853,14,9890,9894,14,9937,9937,14,9981,9981,14,10035,10036,14,11035,11036,14,42654,42655,5,43346,43347,7,43587,43587,5,44006,44007,7,44173,44199,12,44397,44423,12,44621,44647,12,44845,44871,12,45069,45095,12,45293,45319,12,45517,45543,12,45741,45767,12,45965,45991,12,46189,46215,12,46413,46439,12,46637,46663,12,46861,46887,12,47085,47111,12,47309,47335,12,47533,47559,12,47757,47783,12,47981,48007,12,48205,48231,12,48429,48455,12,48653,48679,12,48877,48903,12,49101,49127,12,49325,49351,12,49549,49575,12,49773,49799,12,49997,50023,12,50221,50247,12,50445,50471,12,50669,50695,12,50893,50919,12,51117,51143,12,51341,51367,12,51565,51591,12,51789,51815,12,52013,52039,12,52237,52263,12,52461,52487,12,52685,52711,12,52909,52935,12,53133,53159,12,53357,53383,12,53581,53607,12,53805,53831,12,54029,54055,12,54253,54279,12,54477,54503,12,54701,54727,12,54925,54951,12,55149,55175,12,68101,68102,5,69762,69762,7,70067,70069,7,70371,70378,5,70720,70721,7,71087,71087,5,71341,71341,5,71995,71996,5,72249,72249,7,72850,72871,5,73109,73109,5,118576,118598,5,121505,121519,5,127245,127247,14,127568,127569,14,127777,127777,14,127872,127891,14,127956,127967,14,128015,128016,14,128110,128172,14,128259,128259,14,128367,128368,14,128424,128424,14,128488,128488,14,128530,128532,14,128550,128551,14,128566,128566,14,128647,128647,14,128656,128656,14,128667,128673,14,128691,128693,14,128715,128715,14,128728,128732,14,128752,128752,14,128765,128767,14,129096,129103,14,129311,129311,14,129344,129349,14,129394,129394,14,129413,129425,14,129466,129471,14,129511,129535,14,129664,129666,14,129719,129722,14,129760,129767,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2307,2307,7,2382,2383,7,2497,2500,5,2563,2563,7,2677,2677,5,2763,2764,7,2879,2879,5,2914,2915,5,3021,3021,5,3142,3144,5,3263,3263,5,3285,3286,5,3398,3400,7,3530,3530,5,3633,3633,5,3864,3865,5,3974,3975,5,4155,4156,7,4229,4230,5,5909,5909,7,6078,6085,7,6277,6278,5,6451,6456,7,6744,6750,5,6846,6846,5,6972,6972,5,7074,7077,5,7146,7148,7,7222,7223,5,7416,7417,5,8234,8238,4,8417,8417,5,9000,9000,14,9203,9203,14,9730,9731,14,9748,9749,14,9762,9763,14,9776,9783,14,9800,9811,14,9831,9831,14,9872,9873,14,9882,9882,14,9900,9903,14,9929,9933,14,9941,9960,14,9974,9974,14,9989,9989,14,10006,10006,14,10062,10062,14,10160,10160,14,11647,11647,5,12953,12953,14,43019,43019,5,43232,43249,5,43443,43443,5,43567,43568,7,43696,43696,5,43765,43765,7,44013,44013,5,44117,44143,12,44229,44255,12,44341,44367,12,44453,44479,12,44565,44591,12,44677,44703,12,44789,44815,12,44901,44927,12,45013,45039,12,45125,45151,12,45237,45263,12,45349,45375,12,45461,45487,12,45573,45599,12,45685,45711,12,45797,45823,12,45909,45935,12,46021,46047,12,46133,46159,12,46245,46271,12,46357,46383,12,46469,46495,12,46581,46607,12,46693,46719,12,46805,46831,12,46917,46943,12,47029,47055,12,47141,47167,12,47253,47279,12,47365,47391,12,47477,47503,12,47589,47615,12,47701,47727,12,47813,47839,12,47925,47951,12,48037,48063,12,48149,48175,12,48261,48287,12,48373,48399,12,48485,48511,12,48597,48623,12,48709,48735,12,48821,48847,12,48933,48959,12,49045,49071,12,49157,49183,12,49269,49295,12,49381,49407,12,49493,49519,12,49605,49631,12,49717,49743,12,49829,49855,12,49941,49967,12,50053,50079,12,50165,50191,12,50277,50303,12,50389,50415,12,50501,50527,12,50613,50639,12,50725,50751,12,50837,50863,12,50949,50975,12,51061,51087,12,51173,51199,12,51285,51311,12,51397,51423,12,51509,51535,12,51621,51647,12,51733,51759,12,51845,51871,12,51957,51983,12,52069,52095,12,52181,52207,12,52293,52319,12,52405,52431,12,52517,52543,12,52629,52655,12,52741,52767,12,52853,52879,12,52965,52991,12,53077,53103,12,53189,53215,12,53301,53327,12,53413,53439,12,53525,53551,12,53637,53663,12,53749,53775,12,53861,53887,12,53973,53999,12,54085,54111,12,54197,54223,12,54309,54335,12,54421,54447,12,54533,54559,12,54645,54671,12,54757,54783,12,54869,54895,12,54981,55007,12,55093,55119,12,55243,55291,10,66045,66045,5,68325,68326,5,69688,69702,5,69817,69818,5,69957,69958,7,70089,70092,5,70198,70199,5,70462,70462,5,70502,70508,5,70750,70750,5,70846,70846,7,71100,71101,5,71230,71230,7,71351,71351,5,71737,71738,5,72000,72000,7,72160,72160,5,72273,72278,5,72752,72758,5,72882,72883,5,73031,73031,5,73461,73462,7,94192,94193,7,119149,119149,7,121403,121452,5,122915,122916,5,126980,126980,14,127358,127359,14,127535,127535,14,127759,127759,14,127771,127771,14,127792,127793,14,127825,127867,14,127897,127899,14,127945,127945,14,127985,127986,14,128000,128007,14,128021,128021,14,128066,128100,14,128184,128235,14,128249,128252,14,128266,128276,14,128335,128335,14,128379,128390,14,128407,128419,14,128444,128444,14,128481,128481,14,128499,128499,14,128526,128526,14,128536,128536,14,128543,128543,14,128556,128556,14,128564,128564,14,128577,128580,14,128643,128645,14,128649,128649,14,128654,128654,14,128660,128660,14,128664,128664,14,128675,128675,14,128686,128689,14,128695,128696,14,128705,128709,14,128717,128719,14,128725,128725,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129009,129023,14,129160,129167,14,129296,129304,14,129320,129327,14,129340,129342,14,129356,129356,14,129388,129392,14,129399,129400,14,129404,129407,14,129432,129442,14,129454,129455,14,129473,129474,14,129485,129487,14,129648,129651,14,129659,129660,14,129671,129679,14,129709,129711,14,129728,129730,14,129751,129753,14,129776,129782,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2274,2274,1,2363,2363,7,2377,2380,7,2402,2403,5,2494,2494,5,2507,2508,7,2558,2558,5,2622,2624,7,2641,2641,5,2691,2691,7,2759,2760,5,2786,2787,5,2876,2876,5,2881,2884,5,2901,2902,5,3006,3006,5,3014,3016,7,3072,3072,5,3134,3136,5,3157,3158,5,3260,3260,5,3266,3266,5,3274,3275,7,3328,3329,5,3391,3392,7,3405,3405,5,3457,3457,5,3536,3537,7,3551,3551,5,3636,3642,5,3764,3772,5,3895,3895,5,3967,3967,7,3993,4028,5,4146,4151,5,4182,4183,7,4226,4226,5,4253,4253,5,4957,4959,5,5940,5940,7,6070,6070,7,6087,6088,7,6158,6158,4,6432,6434,5,6448,6449,7,6679,6680,5,6742,6742,5,6754,6754,5,6783,6783,5,6912,6915,5,6966,6970,5,6978,6978,5,7042,7042,7,7080,7081,5,7143,7143,7,7150,7150,7,7212,7219,5,7380,7392,5,7412,7412,5,8203,8203,4,8232,8232,4,8265,8265,14,8400,8412,5,8421,8432,5,8617,8618,14,9167,9167,14,9200,9200,14,9410,9410,14,9723,9726,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9774,14,9786,9786,14,9794,9794,14,9823,9823,14,9828,9828,14,9833,9850,14,9855,9855,14,9875,9875,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9935,9935,14,9939,9939,14,9962,9962,14,9972,9972,14,9978,9978,14,9986,9986,14,9997,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10133,10135,14,10548,10549,14,11093,11093,14,12330,12333,5,12441,12442,5,42608,42610,5,43010,43010,5,43045,43046,5,43188,43203,7,43302,43309,5,43392,43394,5,43446,43449,5,43493,43493,5,43571,43572,7,43597,43597,7,43703,43704,5,43756,43757,5,44003,44004,7,44009,44010,7,44033,44059,12,44089,44115,12,44145,44171,12,44201,44227,12,44257,44283,12,44313,44339,12,44369,44395,12,44425,44451,12,44481,44507,12,44537,44563,12,44593,44619,12,44649,44675,12,44705,44731,12,44761,44787,12,44817,44843,12,44873,44899,12,44929,44955,12,44985,45011,12,45041,45067,12,45097,45123,12,45153,45179,12,45209,45235,12,45265,45291,12,45321,45347,12,45377,45403,12,45433,45459,12,45489,45515,12,45545,45571,12,45601,45627,12,45657,45683,12,45713,45739,12,45769,45795,12,45825,45851,12,45881,45907,12,45937,45963,12,45993,46019,12,46049,46075,12,46105,46131,12,46161,46187,12,46217,46243,12,46273,46299,12,46329,46355,12,46385,46411,12,46441,46467,12,46497,46523,12,46553,46579,12,46609,46635,12,46665,46691,12,46721,46747,12,46777,46803,12,46833,46859,12,46889,46915,12,46945,46971,12,47001,47027,12,47057,47083,12,47113,47139,12,47169,47195,12,47225,47251,12,47281,47307,12,47337,47363,12,47393,47419,12,47449,47475,12,47505,47531,12,47561,47587,12,47617,47643,12,47673,47699,12,47729,47755,12,47785,47811,12,47841,47867,12,47897,47923,12,47953,47979,12,48009,48035,12,48065,48091,12,48121,48147,12,48177,48203,12,48233,48259,12,48289,48315,12,48345,48371,12,48401,48427,12,48457,48483,12,48513,48539,12,48569,48595,12,48625,48651,12,48681,48707,12,48737,48763,12,48793,48819,12,48849,48875,12,48905,48931,12,48961,48987,12,49017,49043,12,49073,49099,12,49129,49155,12,49185,49211,12,49241,49267,12,49297,49323,12,49353,49379,12,49409,49435,12,49465,49491,12,49521,49547,12,49577,49603,12,49633,49659,12,49689,49715,12,49745,49771,12,49801,49827,12,49857,49883,12,49913,49939,12,49969,49995,12,50025,50051,12,50081,50107,12,50137,50163,12,50193,50219,12,50249,50275,12,50305,50331,12,50361,50387,12,50417,50443,12,50473,50499,12,50529,50555,12,50585,50611,12,50641,50667,12,50697,50723,12,50753,50779,12,50809,50835,12,50865,50891,12,50921,50947,12,50977,51003,12,51033,51059,12,51089,51115,12,51145,51171,12,51201,51227,12,51257,51283,12,51313,51339,12,51369,51395,12,51425,51451,12,51481,51507,12,51537,51563,12,51593,51619,12,51649,51675,12,51705,51731,12,51761,51787,12,51817,51843,12,51873,51899,12,51929,51955,12,51985,52011,12,52041,52067,12,52097,52123,12,52153,52179,12,52209,52235,12,52265,52291,12,52321,52347,12,52377,52403,12,52433,52459,12,52489,52515,12,52545,52571,12,52601,52627,12,52657,52683,12,52713,52739,12,52769,52795,12,52825,52851,12,52881,52907,12,52937,52963,12,52993,53019,12,53049,53075,12,53105,53131,12,53161,53187,12,53217,53243,12,53273,53299,12,53329,53355,12,53385,53411,12,53441,53467,12,53497,53523,12,53553,53579,12,53609,53635,12,53665,53691,12,53721,53747,12,53777,53803,12,53833,53859,12,53889,53915,12,53945,53971,12,54001,54027,12,54057,54083,12,54113,54139,12,54169,54195,12,54225,54251,12,54281,54307,12,54337,54363,12,54393,54419,12,54449,54475,12,54505,54531,12,54561,54587,12,54617,54643,12,54673,54699,12,54729,54755,12,54785,54811,12,54841,54867,12,54897,54923,12,54953,54979,12,55009,55035,12,55065,55091,12,55121,55147,12,55177,55203,12,65024,65039,5,65520,65528,4,66422,66426,5,68152,68154,5,69291,69292,5,69633,69633,5,69747,69748,5,69811,69814,5,69826,69826,5,69932,69932,7,70016,70017,5,70079,70080,7,70095,70095,5,70196,70196,5,70367,70367,5,70402,70403,7,70464,70464,5,70487,70487,5,70709,70711,7,70725,70725,7,70833,70834,7,70843,70844,7,70849,70849,7,71090,71093,5,71103,71104,5,71227,71228,7,71339,71339,5,71344,71349,5,71458,71461,5,71727,71735,5,71985,71989,7,71998,71998,5,72002,72002,7,72154,72155,5,72193,72202,5,72251,72254,5,72281,72283,5,72344,72345,5,72766,72766,7,72874,72880,5,72885,72886,5,73023,73029,5,73104,73105,5,73111,73111,5,92912,92916,5,94095,94098,5,113824,113827,4,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,125252,125258,5,127183,127183,14,127340,127343,14,127377,127386,14,127491,127503,14,127548,127551,14,127744,127756,14,127761,127761,14,127769,127769,14,127773,127774,14,127780,127788,14,127796,127797,14,127820,127823,14,127869,127869,14,127894,127895,14,127902,127903,14,127943,127943,14,127947,127950,14,127972,127972,14,127988,127988,14,127992,127994,14,128009,128011,14,128019,128019,14,128023,128041,14,128064,128064,14,128102,128107,14,128174,128181,14,128238,128238,14,128246,128247,14,128254,128254,14,128264,128264,14,128278,128299,14,128329,128330,14,128348,128359,14,128371,128377,14,128392,128393,14,128401,128404,14,128421,128421,14,128433,128434,14,128450,128452,14,128476,128478,14,128483,128483,14,128495,128495,14,128506,128506,14,128519,128520,14,128528,128528,14,128534,128534,14,128538,128538,14,128540,128542,14,128544,128549,14,128552,128555,14,128557,128557,14,128560,128563,14,128565,128565,14,128567,128576,14,128581,128591,14,128641,128642,14,128646,128646,14,128648,128648,14,128650,128651,14,128653,128653,14,128655,128655,14,128657,128659,14,128661,128661,14,128663,128663,14,128665,128666,14,128674,128674,14,128676,128677,14,128679,128685,14,128690,128690,14,128694,128694,14,128697,128702,14,128704,128704,14,128710,128714,14,128716,128716,14,128720,128720,14,128723,128724,14,128726,128727,14,128733,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129008,129008,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129661,129663,14,129667,129670,14,129680,129685,14,129705,129708,14,129712,129718,14,129723,129727,14,129731,129733,14,129744,129750,14,129754,129759,14,129768,129775,14,129783,129791,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2192,2193,1,2250,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3132,3132,5,3137,3140,7,3146,3149,5,3170,3171,5,3202,3203,7,3262,3262,7,3264,3265,7,3267,3268,7,3271,3272,7,3276,3277,5,3298,3299,5,3330,3331,7,3390,3390,5,3393,3396,5,3402,3404,7,3406,3406,1,3426,3427,5,3458,3459,7,3535,3535,5,3538,3540,5,3544,3550,7,3570,3571,7,3635,3635,7,3655,3662,5,3763,3763,7,3784,3789,5,3893,3893,5,3897,3897,5,3953,3966,5,3968,3972,5,3981,3991,5,4038,4038,5,4145,4145,7,4153,4154,5,4157,4158,5,4184,4185,5,4209,4212,5,4228,4228,7,4237,4237,5,4352,4447,8,4520,4607,10,5906,5908,5,5938,5939,5,5970,5971,5,6068,6069,5,6071,6077,5,6086,6086,5,6089,6099,5,6155,6157,5,6159,6159,5,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6862,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7679,5,8204,8204,5,8206,8207,4,8233,8233,4,8252,8252,14,8288,8292,4,8294,8303,4,8413,8416,5,8418,8420,5,8482,8482,14,8596,8601,14,8986,8987,14,9096,9096,14,9193,9196,14,9199,9199,14,9201,9202,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9729,14,9732,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9775,9775,14,9784,9785,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9874,14,9876,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9934,14,9936,9936,14,9938,9938,14,9940,9940,14,9961,9961,14,9963,9967,14,9970,9971,14,9973,9973,14,9975,9977,14,9979,9980,14,9982,9985,14,9987,9988,14,9992,9996,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10083,14,10085,10087,14,10145,10145,14,10175,10175,14,11013,11015,14,11088,11088,14,11503,11505,5,11744,11775,5,12334,12335,5,12349,12349,14,12951,12951,14,42607,42607,5,42612,42621,5,42736,42737,5,43014,43014,5,43043,43044,7,43047,43047,7,43136,43137,7,43204,43205,5,43263,43263,5,43335,43345,5,43360,43388,8,43395,43395,7,43444,43445,7,43450,43451,7,43454,43456,7,43561,43566,5,43569,43570,5,43573,43574,5,43596,43596,5,43644,43644,5,43698,43700,5,43710,43711,5,43755,43755,7,43758,43759,7,43766,43766,5,44005,44005,5,44008,44008,5,44012,44012,7,44032,44032,11,44060,44060,11,44088,44088,11,44116,44116,11,44144,44144,11,44172,44172,11,44200,44200,11,44228,44228,11,44256,44256,11,44284,44284,11,44312,44312,11,44340,44340,11,44368,44368,11,44396,44396,11,44424,44424,11,44452,44452,11,44480,44480,11,44508,44508,11,44536,44536,11,44564,44564,11,44592,44592,11,44620,44620,11,44648,44648,11,44676,44676,11,44704,44704,11,44732,44732,11,44760,44760,11,44788,44788,11,44816,44816,11,44844,44844,11,44872,44872,11,44900,44900,11,44928,44928,11,44956,44956,11,44984,44984,11,45012,45012,11,45040,45040,11,45068,45068,11,45096,45096,11,45124,45124,11,45152,45152,11,45180,45180,11,45208,45208,11,45236,45236,11,45264,45264,11,45292,45292,11,45320,45320,11,45348,45348,11,45376,45376,11,45404,45404,11,45432,45432,11,45460,45460,11,45488,45488,11,45516,45516,11,45544,45544,11,45572,45572,11,45600,45600,11,45628,45628,11,45656,45656,11,45684,45684,11,45712,45712,11,45740,45740,11,45768,45768,11,45796,45796,11,45824,45824,11,45852,45852,11,45880,45880,11,45908,45908,11,45936,45936,11,45964,45964,11,45992,45992,11,46020,46020,11,46048,46048,11,46076,46076,11,46104,46104,11,46132,46132,11,46160,46160,11,46188,46188,11,46216,46216,11,46244,46244,11,46272,46272,11,46300,46300,11,46328,46328,11,46356,46356,11,46384,46384,11,46412,46412,11,46440,46440,11,46468,46468,11,46496,46496,11,46524,46524,11,46552,46552,11,46580,46580,11,46608,46608,11,46636,46636,11,46664,46664,11,46692,46692,11,46720,46720,11,46748,46748,11,46776,46776,11,46804,46804,11,46832,46832,11,46860,46860,11,46888,46888,11,46916,46916,11,46944,46944,11,46972,46972,11,47000,47000,11,47028,47028,11,47056,47056,11,47084,47084,11,47112,47112,11,47140,47140,11,47168,47168,11,47196,47196,11,47224,47224,11,47252,47252,11,47280,47280,11,47308,47308,11,47336,47336,11,47364,47364,11,47392,47392,11,47420,47420,11,47448,47448,11,47476,47476,11,47504,47504,11,47532,47532,11,47560,47560,11,47588,47588,11,47616,47616,11,47644,47644,11,47672,47672,11,47700,47700,11,47728,47728,11,47756,47756,11,47784,47784,11,47812,47812,11,47840,47840,11,47868,47868,11,47896,47896,11,47924,47924,11,47952,47952,11,47980,47980,11,48008,48008,11,48036,48036,11,48064,48064,11,48092,48092,11,48120,48120,11,48148,48148,11,48176,48176,11,48204,48204,11,48232,48232,11,48260,48260,11,48288,48288,11,48316,48316,11,48344,48344,11,48372,48372,11,48400,48400,11,48428,48428,11,48456,48456,11,48484,48484,11,48512,48512,11,48540,48540,11,48568,48568,11,48596,48596,11,48624,48624,11,48652,48652,11,48680,48680,11,48708,48708,11,48736,48736,11,48764,48764,11,48792,48792,11,48820,48820,11,48848,48848,11,48876,48876,11,48904,48904,11,48932,48932,11,48960,48960,11,48988,48988,11,49016,49016,11,49044,49044,11,49072,49072,11,49100,49100,11,49128,49128,11,49156,49156,11,49184,49184,11,49212,49212,11,49240,49240,11,49268,49268,11,49296,49296,11,49324,49324,11,49352,49352,11,49380,49380,11,49408,49408,11,49436,49436,11,49464,49464,11,49492,49492,11,49520,49520,11,49548,49548,11,49576,49576,11,49604,49604,11,49632,49632,11,49660,49660,11,49688,49688,11,49716,49716,11,49744,49744,11,49772,49772,11,49800,49800,11,49828,49828,11,49856,49856,11,49884,49884,11,49912,49912,11,49940,49940,11,49968,49968,11,49996,49996,11,50024,50024,11,50052,50052,11,50080,50080,11,50108,50108,11,50136,50136,11,50164,50164,11,50192,50192,11,50220,50220,11,50248,50248,11,50276,50276,11,50304,50304,11,50332,50332,11,50360,50360,11,50388,50388,11,50416,50416,11,50444,50444,11,50472,50472,11,50500,50500,11,50528,50528,11,50556,50556,11,50584,50584,11,50612,50612,11,50640,50640,11,50668,50668,11,50696,50696,11,50724,50724,11,50752,50752,11,50780,50780,11,50808,50808,11,50836,50836,11,50864,50864,11,50892,50892,11,50920,50920,11,50948,50948,11,50976,50976,11,51004,51004,11,51032,51032,11,51060,51060,11,51088,51088,11,51116,51116,11,51144,51144,11,51172,51172,11,51200,51200,11,51228,51228,11,51256,51256,11,51284,51284,11,51312,51312,11,51340,51340,11,51368,51368,11,51396,51396,11,51424,51424,11,51452,51452,11,51480,51480,11,51508,51508,11,51536,51536,11,51564,51564,11,51592,51592,11,51620,51620,11,51648,51648,11,51676,51676,11,51704,51704,11,51732,51732,11,51760,51760,11,51788,51788,11,51816,51816,11,51844,51844,11,51872,51872,11,51900,51900,11,51928,51928,11,51956,51956,11,51984,51984,11,52012,52012,11,52040,52040,11,52068,52068,11,52096,52096,11,52124,52124,11,52152,52152,11,52180,52180,11,52208,52208,11,52236,52236,11,52264,52264,11,52292,52292,11,52320,52320,11,52348,52348,11,52376,52376,11,52404,52404,11,52432,52432,11,52460,52460,11,52488,52488,11,52516,52516,11,52544,52544,11,52572,52572,11,52600,52600,11,52628,52628,11,52656,52656,11,52684,52684,11,52712,52712,11,52740,52740,11,52768,52768,11,52796,52796,11,52824,52824,11,52852,52852,11,52880,52880,11,52908,52908,11,52936,52936,11,52964,52964,11,52992,52992,11,53020,53020,11,53048,53048,11,53076,53076,11,53104,53104,11,53132,53132,11,53160,53160,11,53188,53188,11,53216,53216,11,53244,53244,11,53272,53272,11,53300,53300,11,53328,53328,11,53356,53356,11,53384,53384,11,53412,53412,11,53440,53440,11,53468,53468,11,53496,53496,11,53524,53524,11,53552,53552,11,53580,53580,11,53608,53608,11,53636,53636,11,53664,53664,11,53692,53692,11,53720,53720,11,53748,53748,11,53776,53776,11,53804,53804,11,53832,53832,11,53860,53860,11,53888,53888,11,53916,53916,11,53944,53944,11,53972,53972,11,54000,54000,11,54028,54028,11,54056,54056,11,54084,54084,11,54112,54112,11,54140,54140,11,54168,54168,11,54196,54196,11,54224,54224,11,54252,54252,11,54280,54280,11,54308,54308,11,54336,54336,11,54364,54364,11,54392,54392,11,54420,54420,11,54448,54448,11,54476,54476,11,54504,54504,11,54532,54532,11,54560,54560,11,54588,54588,11,54616,54616,11,54644,54644,11,54672,54672,11,54700,54700,11,54728,54728,11,54756,54756,11,54784,54784,11,54812,54812,11,54840,54840,11,54868,54868,11,54896,54896,11,54924,54924,11,54952,54952,11,54980,54980,11,55008,55008,11,55036,55036,11,55064,55064,11,55092,55092,11,55120,55120,11,55148,55148,11,55176,55176,11,55216,55238,9,64286,64286,5,65056,65071,5,65438,65439,5,65529,65531,4,66272,66272,5,68097,68099,5,68108,68111,5,68159,68159,5,68900,68903,5,69446,69456,5,69632,69632,7,69634,69634,7,69744,69744,5,69759,69761,5,69808,69810,7,69815,69816,7,69821,69821,1,69837,69837,1,69927,69931,5,69933,69940,5,70003,70003,5,70018,70018,7,70070,70078,5,70082,70083,1,70094,70094,7,70188,70190,7,70194,70195,7,70197,70197,7,70206,70206,5,70368,70370,7,70400,70401,5,70459,70460,5,70463,70463,7,70465,70468,7,70475,70477,7,70498,70499,7,70512,70516,5,70712,70719,5,70722,70724,5,70726,70726,5,70832,70832,5,70835,70840,5,70842,70842,5,70845,70845,5,70847,70848,5,70850,70851,5,71088,71089,7,71096,71099,7,71102,71102,7,71132,71133,5,71219,71226,5,71229,71229,5,71231,71232,5,71340,71340,7,71342,71343,7,71350,71350,7,71453,71455,5,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,118528,118573,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123566,123566,5,125136,125142,5,126976,126979,14,126981,127182,14,127184,127231,14,127279,127279,14,127344,127345,14,127374,127374,14,127405,127461,14,127489,127490,14,127514,127514,14,127538,127546,14,127561,127567,14,127570,127743,14,127757,127758,14,127760,127760,14,127762,127762,14,127766,127768,14,127770,127770,14,127772,127772,14,127775,127776,14,127778,127779,14,127789,127791,14,127794,127795,14,127798,127798,14,127819,127819,14,127824,127824,14,127868,127868,14,127870,127871,14,127892,127893,14,127896,127896,14,127900,127901,14,127904,127940,14,127942,127942,14,127944,127944,14,127946,127946,14,127951,127955,14,127968,127971,14,127973,127984,14,127987,127987,14,127989,127989,14,127991,127991,14,127995,127999,5,128008,128008,14,128012,128014,14,128017,128018,14,128020,128020,14,128022,128022,14,128042,128042,14,128063,128063,14,128065,128065,14,128101,128101,14,128108,128109,14,128173,128173,14,128182,128183,14,128236,128237,14,128239,128239,14,128245,128245,14,128248,128248,14,128253,128253,14,128255,128258,14,128260,128263,14,128265,128265,14,128277,128277,14,128300,128301,14,128326,128328,14,128331,128334,14,128336,128347,14,128360,128366,14,128369,128370,14,128378,128378,14,128391,128391,14,128394,128397,14,128400,128400,14,128405,128406,14,128420,128420,14,128422,128423,14,128425,128432,14,128435,128443,14,128445,128449,14,128453,128464,14,128468,128475,14,128479,128480,14,128482,128482,14,128484,128487,14,128489,128494,14,128496,128498,14,128500,128505,14,128507,128511,14,128513,128518,14,128521,128525,14,128527,128527,14,128529,128529,14,128533,128533,14,128535,128535,14,128537,128537,14]");
  1708. }
  1709. var AmbiguousCharacters = class _AmbiguousCharacters {
  1710. static {
  1711. this.ambiguousCharacterData = new Lazy(() => {
  1712. return JSON.parse('{"_common":[8232,32,8233,32,5760,32,8192,32,8193,32,8194,32,8195,32,8196,32,8197,32,8198,32,8200,32,8201,32,8202,32,8287,32,8199,32,8239,32,2042,95,65101,95,65102,95,65103,95,8208,45,8209,45,8210,45,65112,45,1748,45,8259,45,727,45,8722,45,10134,45,11450,45,1549,44,1643,44,8218,44,184,44,42233,44,894,59,2307,58,2691,58,1417,58,1795,58,1796,58,5868,58,65072,58,6147,58,6153,58,8282,58,1475,58,760,58,42889,58,8758,58,720,58,42237,58,451,33,11601,33,660,63,577,63,2429,63,5038,63,42731,63,119149,46,8228,46,1793,46,1794,46,42510,46,68176,46,1632,46,1776,46,42232,46,1373,96,65287,96,8219,96,8242,96,1370,96,1523,96,8175,96,65344,96,900,96,8189,96,8125,96,8127,96,8190,96,697,96,884,96,712,96,714,96,715,96,756,96,699,96,701,96,700,96,702,96,42892,96,1497,96,2036,96,2037,96,5194,96,5836,96,94033,96,94034,96,65339,91,10088,40,10098,40,12308,40,64830,40,65341,93,10089,41,10099,41,12309,41,64831,41,10100,123,119060,123,10101,125,65342,94,8270,42,1645,42,8727,42,66335,42,5941,47,8257,47,8725,47,8260,47,9585,47,10187,47,10744,47,119354,47,12755,47,12339,47,11462,47,20031,47,12035,47,65340,92,65128,92,8726,92,10189,92,10741,92,10745,92,119311,92,119355,92,12756,92,20022,92,12034,92,42872,38,708,94,710,94,5869,43,10133,43,66203,43,8249,60,10094,60,706,60,119350,60,5176,60,5810,60,5120,61,11840,61,12448,61,42239,61,8250,62,10095,62,707,62,119351,62,5171,62,94015,62,8275,126,732,126,8128,126,8764,126,65372,124,65293,45,120784,50,120794,50,120804,50,120814,50,120824,50,130034,50,42842,50,423,50,1000,50,42564,50,5311,50,42735,50,119302,51,120785,51,120795,51,120805,51,120815,51,120825,51,130035,51,42923,51,540,51,439,51,42858,51,11468,51,1248,51,94011,51,71882,51,120786,52,120796,52,120806,52,120816,52,120826,52,130036,52,5070,52,71855,52,120787,53,120797,53,120807,53,120817,53,120827,53,130037,53,444,53,71867,53,120788,54,120798,54,120808,54,120818,54,120828,54,130038,54,11474,54,5102,54,71893,54,119314,55,120789,55,120799,55,120809,55,120819,55,120829,55,130039,55,66770,55,71878,55,2819,56,2538,56,2666,56,125131,56,120790,56,120800,56,120810,56,120820,56,120830,56,130040,56,547,56,546,56,66330,56,2663,57,2920,57,2541,57,3437,57,120791,57,120801,57,120811,57,120821,57,120831,57,130041,57,42862,57,11466,57,71884,57,71852,57,71894,57,9082,97,65345,97,119834,97,119886,97,119938,97,119990,97,120042,97,120094,97,120146,97,120198,97,120250,97,120302,97,120354,97,120406,97,120458,97,593,97,945,97,120514,97,120572,97,120630,97,120688,97,120746,97,65313,65,119808,65,119860,65,119912,65,119964,65,120016,65,120068,65,120120,65,120172,65,120224,65,120276,65,120328,65,120380,65,120432,65,913,65,120488,65,120546,65,120604,65,120662,65,120720,65,5034,65,5573,65,42222,65,94016,65,66208,65,119835,98,119887,98,119939,98,119991,98,120043,98,120095,98,120147,98,120199,98,120251,98,120303,98,120355,98,120407,98,120459,98,388,98,5071,98,5234,98,5551,98,65314,66,8492,66,119809,66,119861,66,119913,66,120017,66,120069,66,120121,66,120173,66,120225,66,120277,66,120329,66,120381,66,120433,66,42932,66,914,66,120489,66,120547,66,120605,66,120663,66,120721,66,5108,66,5623,66,42192,66,66178,66,66209,66,66305,66,65347,99,8573,99,119836,99,119888,99,119940,99,119992,99,120044,99,120096,99,120148,99,120200,99,120252,99,120304,99,120356,99,120408,99,120460,99,7428,99,1010,99,11429,99,43951,99,66621,99,128844,67,71922,67,71913,67,65315,67,8557,67,8450,67,8493,67,119810,67,119862,67,119914,67,119966,67,120018,67,120174,67,120226,67,120278,67,120330,67,120382,67,120434,67,1017,67,11428,67,5087,67,42202,67,66210,67,66306,67,66581,67,66844,67,8574,100,8518,100,119837,100,119889,100,119941,100,119993,100,120045,100,120097,100,120149,100,120201,100,120253,100,120305,100,120357,100,120409,100,120461,100,1281,100,5095,100,5231,100,42194,100,8558,68,8517,68,119811,68,119863,68,119915,68,119967,68,120019,68,120071,68,120123,68,120175,68,120227,68,120279,68,120331,68,120383,68,120435,68,5024,68,5598,68,5610,68,42195,68,8494,101,65349,101,8495,101,8519,101,119838,101,119890,101,119942,101,120046,101,120098,101,120150,101,120202,101,120254,101,120306,101,120358,101,120410,101,120462,101,43826,101,1213,101,8959,69,65317,69,8496,69,119812,69,119864,69,119916,69,120020,69,120072,69,120124,69,120176,69,120228,69,120280,69,120332,69,120384,69,120436,69,917,69,120492,69,120550,69,120608,69,120666,69,120724,69,11577,69,5036,69,42224,69,71846,69,71854,69,66182,69,119839,102,119891,102,119943,102,119995,102,120047,102,120099,102,120151,102,120203,102,120255,102,120307,102,120359,102,120411,102,120463,102,43829,102,42905,102,383,102,7837,102,1412,102,119315,70,8497,70,119813,70,119865,70,119917,70,120021,70,120073,70,120125,70,120177,70,120229,70,120281,70,120333,70,120385,70,120437,70,42904,70,988,70,120778,70,5556,70,42205,70,71874,70,71842,70,66183,70,66213,70,66853,70,65351,103,8458,103,119840,103,119892,103,119944,103,120048,103,120100,103,120152,103,120204,103,120256,103,120308,103,120360,103,120412,103,120464,103,609,103,7555,103,397,103,1409,103,119814,71,119866,71,119918,71,119970,71,120022,71,120074,71,120126,71,120178,71,120230,71,120282,71,120334,71,120386,71,120438,71,1292,71,5056,71,5107,71,42198,71,65352,104,8462,104,119841,104,119945,104,119997,104,120049,104,120101,104,120153,104,120205,104,120257,104,120309,104,120361,104,120413,104,120465,104,1211,104,1392,104,5058,104,65320,72,8459,72,8460,72,8461,72,119815,72,119867,72,119919,72,120023,72,120179,72,120231,72,120283,72,120335,72,120387,72,120439,72,919,72,120494,72,120552,72,120610,72,120668,72,120726,72,11406,72,5051,72,5500,72,42215,72,66255,72,731,105,9075,105,65353,105,8560,105,8505,105,8520,105,119842,105,119894,105,119946,105,119998,105,120050,105,120102,105,120154,105,120206,105,120258,105,120310,105,120362,105,120414,105,120466,105,120484,105,618,105,617,105,953,105,8126,105,890,105,120522,105,120580,105,120638,105,120696,105,120754,105,1110,105,42567,105,1231,105,43893,105,5029,105,71875,105,65354,106,8521,106,119843,106,119895,106,119947,106,119999,106,120051,106,120103,106,120155,106,120207,106,120259,106,120311,106,120363,106,120415,106,120467,106,1011,106,1112,106,65322,74,119817,74,119869,74,119921,74,119973,74,120025,74,120077,74,120129,74,120181,74,120233,74,120285,74,120337,74,120389,74,120441,74,42930,74,895,74,1032,74,5035,74,5261,74,42201,74,119844,107,119896,107,119948,107,120000,107,120052,107,120104,107,120156,107,120208,107,120260,107,120312,107,120364,107,120416,107,120468,107,8490,75,65323,75,119818,75,119870,75,119922,75,119974,75,120026,75,120078,75,120130,75,120182,75,120234,75,120286,75,120338,75,120390,75,120442,75,922,75,120497,75,120555,75,120613,75,120671,75,120729,75,11412,75,5094,75,5845,75,42199,75,66840,75,1472,108,8739,73,9213,73,65512,73,1633,108,1777,73,66336,108,125127,108,120783,73,120793,73,120803,73,120813,73,120823,73,130033,73,65321,73,8544,73,8464,73,8465,73,119816,73,119868,73,119920,73,120024,73,120128,73,120180,73,120232,73,120284,73,120336,73,120388,73,120440,73,65356,108,8572,73,8467,108,119845,108,119897,108,119949,108,120001,108,120053,108,120105,73,120157,73,120209,73,120261,73,120313,73,120365,73,120417,73,120469,73,448,73,120496,73,120554,73,120612,73,120670,73,120728,73,11410,73,1030,73,1216,73,1493,108,1503,108,1575,108,126464,108,126592,108,65166,108,65165,108,1994,108,11599,73,5825,73,42226,73,93992,73,66186,124,66313,124,119338,76,8556,76,8466,76,119819,76,119871,76,119923,76,120027,76,120079,76,120131,76,120183,76,120235,76,120287,76,120339,76,120391,76,120443,76,11472,76,5086,76,5290,76,42209,76,93974,76,71843,76,71858,76,66587,76,66854,76,65325,77,8559,77,8499,77,119820,77,119872,77,119924,77,120028,77,120080,77,120132,77,120184,77,120236,77,120288,77,120340,77,120392,77,120444,77,924,77,120499,77,120557,77,120615,77,120673,77,120731,77,1018,77,11416,77,5047,77,5616,77,5846,77,42207,77,66224,77,66321,77,119847,110,119899,110,119951,110,120003,110,120055,110,120107,110,120159,110,120211,110,120263,110,120315,110,120367,110,120419,110,120471,110,1400,110,1404,110,65326,78,8469,78,119821,78,119873,78,119925,78,119977,78,120029,78,120081,78,120185,78,120237,78,120289,78,120341,78,120393,78,120445,78,925,78,120500,78,120558,78,120616,78,120674,78,120732,78,11418,78,42208,78,66835,78,3074,111,3202,111,3330,111,3458,111,2406,111,2662,111,2790,111,3046,111,3174,111,3302,111,3430,111,3664,111,3792,111,4160,111,1637,111,1781,111,65359,111,8500,111,119848,111,119900,111,119952,111,120056,111,120108,111,120160,111,120212,111,120264,111,120316,111,120368,111,120420,111,120472,111,7439,111,7441,111,43837,111,959,111,120528,111,120586,111,120644,111,120702,111,120760,111,963,111,120532,111,120590,111,120648,111,120706,111,120764,111,11423,111,4351,111,1413,111,1505,111,1607,111,126500,111,126564,111,126596,111,65259,111,65260,111,65258,111,65257,111,1726,111,64428,111,64429,111,64427,111,64426,111,1729,111,64424,111,64425,111,64423,111,64422,111,1749,111,3360,111,4125,111,66794,111,71880,111,71895,111,66604,111,1984,79,2534,79,2918,79,12295,79,70864,79,71904,79,120782,79,120792,79,120802,79,120812,79,120822,79,130032,79,65327,79,119822,79,119874,79,119926,79,119978,79,120030,79,120082,79,120134,79,120186,79,120238,79,120290,79,120342,79,120394,79,120446,79,927,79,120502,79,120560,79,120618,79,120676,79,120734,79,11422,79,1365,79,11604,79,4816,79,2848,79,66754,79,42227,79,71861,79,66194,79,66219,79,66564,79,66838,79,9076,112,65360,112,119849,112,119901,112,119953,112,120005,112,120057,112,120109,112,120161,112,120213,112,120265,112,120317,112,120369,112,120421,112,120473,112,961,112,120530,112,120544,112,120588,112,120602,112,120646,112,120660,112,120704,112,120718,112,120762,112,120776,112,11427,112,65328,80,8473,80,119823,80,119875,80,119927,80,119979,80,120031,80,120083,80,120187,80,120239,80,120291,80,120343,80,120395,80,120447,80,929,80,120504,80,120562,80,120620,80,120678,80,120736,80,11426,80,5090,80,5229,80,42193,80,66197,80,119850,113,119902,113,119954,113,120006,113,120058,113,120110,113,120162,113,120214,113,120266,113,120318,113,120370,113,120422,113,120474,113,1307,113,1379,113,1382,113,8474,81,119824,81,119876,81,119928,81,119980,81,120032,81,120084,81,120188,81,120240,81,120292,81,120344,81,120396,81,120448,81,11605,81,119851,114,119903,114,119955,114,120007,114,120059,114,120111,114,120163,114,120215,114,120267,114,120319,114,120371,114,120423,114,120475,114,43847,114,43848,114,7462,114,11397,114,43905,114,119318,82,8475,82,8476,82,8477,82,119825,82,119877,82,119929,82,120033,82,120189,82,120241,82,120293,82,120345,82,120397,82,120449,82,422,82,5025,82,5074,82,66740,82,5511,82,42211,82,94005,82,65363,115,119852,115,119904,115,119956,115,120008,115,120060,115,120112,115,120164,115,120216,115,120268,115,120320,115,120372,115,120424,115,120476,115,42801,115,445,115,1109,115,43946,115,71873,115,66632,115,65331,83,119826,83,119878,83,119930,83,119982,83,120034,83,120086,83,120138,83,120190,83,120242,83,120294,83,120346,83,120398,83,120450,83,1029,83,1359,83,5077,83,5082,83,42210,83,94010,83,66198,83,66592,83,119853,116,119905,116,119957,116,120009,116,120061,116,120113,116,120165,116,120217,116,120269,116,120321,116,120373,116,120425,116,120477,116,8868,84,10201,84,128872,84,65332,84,119827,84,119879,84,119931,84,119983,84,120035,84,120087,84,120139,84,120191,84,120243,84,120295,84,120347,84,120399,84,120451,84,932,84,120507,84,120565,84,120623,84,120681,84,120739,84,11430,84,5026,84,42196,84,93962,84,71868,84,66199,84,66225,84,66325,84,119854,117,119906,117,119958,117,120010,117,120062,117,120114,117,120166,117,120218,117,120270,117,120322,117,120374,117,120426,117,120478,117,42911,117,7452,117,43854,117,43858,117,651,117,965,117,120534,117,120592,117,120650,117,120708,117,120766,117,1405,117,66806,117,71896,117,8746,85,8899,85,119828,85,119880,85,119932,85,119984,85,120036,85,120088,85,120140,85,120192,85,120244,85,120296,85,120348,85,120400,85,120452,85,1357,85,4608,85,66766,85,5196,85,42228,85,94018,85,71864,85,8744,118,8897,118,65366,118,8564,118,119855,118,119907,118,119959,118,120011,118,120063,118,120115,118,120167,118,120219,118,120271,118,120323,118,120375,118,120427,118,120479,118,7456,118,957,118,120526,118,120584,118,120642,118,120700,118,120758,118,1141,118,1496,118,71430,118,43945,118,71872,118,119309,86,1639,86,1783,86,8548,86,119829,86,119881,86,119933,86,119985,86,120037,86,120089,86,120141,86,120193,86,120245,86,120297,86,120349,86,120401,86,120453,86,1140,86,11576,86,5081,86,5167,86,42719,86,42214,86,93960,86,71840,86,66845,86,623,119,119856,119,119908,119,119960,119,120012,119,120064,119,120116,119,120168,119,120220,119,120272,119,120324,119,120376,119,120428,119,120480,119,7457,119,1121,119,1309,119,1377,119,71434,119,71438,119,71439,119,43907,119,71919,87,71910,87,119830,87,119882,87,119934,87,119986,87,120038,87,120090,87,120142,87,120194,87,120246,87,120298,87,120350,87,120402,87,120454,87,1308,87,5043,87,5076,87,42218,87,5742,120,10539,120,10540,120,10799,120,65368,120,8569,120,119857,120,119909,120,119961,120,120013,120,120065,120,120117,120,120169,120,120221,120,120273,120,120325,120,120377,120,120429,120,120481,120,5441,120,5501,120,5741,88,9587,88,66338,88,71916,88,65336,88,8553,88,119831,88,119883,88,119935,88,119987,88,120039,88,120091,88,120143,88,120195,88,120247,88,120299,88,120351,88,120403,88,120455,88,42931,88,935,88,120510,88,120568,88,120626,88,120684,88,120742,88,11436,88,11613,88,5815,88,42219,88,66192,88,66228,88,66327,88,66855,88,611,121,7564,121,65369,121,119858,121,119910,121,119962,121,120014,121,120066,121,120118,121,120170,121,120222,121,120274,121,120326,121,120378,121,120430,121,120482,121,655,121,7935,121,43866,121,947,121,8509,121,120516,121,120574,121,120632,121,120690,121,120748,121,1199,121,4327,121,71900,121,65337,89,119832,89,119884,89,119936,89,119988,89,120040,89,120092,89,120144,89,120196,89,120248,89,120300,89,120352,89,120404,89,120456,89,933,89,978,89,120508,89,120566,89,120624,89,120682,89,120740,89,11432,89,1198,89,5033,89,5053,89,42220,89,94019,89,71844,89,66226,89,119859,122,119911,122,119963,122,120015,122,120067,122,120119,122,120171,122,120223,122,120275,122,120327,122,120379,122,120431,122,120483,122,7458,122,43923,122,71876,122,66293,90,71909,90,65338,90,8484,90,8488,90,119833,90,119885,90,119937,90,119989,90,120041,90,120197,90,120249,90,120301,90,120353,90,120405,90,120457,90,918,90,120493,90,120551,90,120609,90,120667,90,120725,90,5059,90,42204,90,71849,90,65282,34,65284,36,65285,37,65286,38,65290,42,65291,43,65294,46,65295,47,65296,48,65297,49,65298,50,65299,51,65300,52,65301,53,65302,54,65303,55,65304,56,65305,57,65308,60,65309,61,65310,62,65312,64,65316,68,65318,70,65319,71,65324,76,65329,81,65330,82,65333,85,65334,86,65335,87,65343,95,65346,98,65348,100,65350,102,65355,107,65357,109,65358,110,65361,113,65362,114,65364,116,65365,117,65367,119,65370,122,65371,123,65373,125,119846,109],"_default":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"cs":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"de":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"es":[8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"fr":[65374,126,65306,58,65281,33,8216,96,8245,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"it":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"ja":[8211,45,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65292,44,65307,59],"ko":[8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"pl":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"pt-BR":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"qps-ploc":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"ru":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,305,105,921,73,1009,112,215,120,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"tr":[160,32,8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"zh-hans":[65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41],"zh-hant":[8211,45,65374,126,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65307,59]}');
  1713. });
  1714. }
  1715. static {
  1716. this.cache = new LRUCachedFunction({ getCacheKey: JSON.stringify }, (locales) => {
  1717. function arrayToMap(arr) {
  1718. const result = /* @__PURE__ */ new Map();
  1719. for (let i = 0; i < arr.length; i += 2) {
  1720. result.set(arr[i], arr[i + 1]);
  1721. }
  1722. return result;
  1723. }
  1724. function mergeMaps(map1, map2) {
  1725. const result = new Map(map1);
  1726. for (const [key, value] of map2) {
  1727. result.set(key, value);
  1728. }
  1729. return result;
  1730. }
  1731. function intersectMaps(map1, map2) {
  1732. if (!map1) {
  1733. return map2;
  1734. }
  1735. const result = /* @__PURE__ */ new Map();
  1736. for (const [key, value] of map1) {
  1737. if (map2.has(key)) {
  1738. result.set(key, value);
  1739. }
  1740. }
  1741. return result;
  1742. }
  1743. const data = this.ambiguousCharacterData.value;
  1744. let filteredLocales = locales.filter((l) => !l.startsWith("_") && l in data);
  1745. if (filteredLocales.length === 0) {
  1746. filteredLocales = ["_default"];
  1747. }
  1748. let languageSpecificMap = void 0;
  1749. for (const locale of filteredLocales) {
  1750. const map2 = arrayToMap(data[locale]);
  1751. languageSpecificMap = intersectMaps(languageSpecificMap, map2);
  1752. }
  1753. const commonMap = arrayToMap(data["_common"]);
  1754. const map = mergeMaps(commonMap, languageSpecificMap);
  1755. return new _AmbiguousCharacters(map);
  1756. });
  1757. }
  1758. static getInstance(locales) {
  1759. return _AmbiguousCharacters.cache.get(Array.from(locales));
  1760. }
  1761. static {
  1762. this._locales = new Lazy(() => Object.keys(_AmbiguousCharacters.ambiguousCharacterData.value).filter((k) => !k.startsWith("_")));
  1763. }
  1764. static getLocales() {
  1765. return _AmbiguousCharacters._locales.value;
  1766. }
  1767. constructor(confusableDictionary) {
  1768. this.confusableDictionary = confusableDictionary;
  1769. }
  1770. isAmbiguous(codePoint) {
  1771. return this.confusableDictionary.has(codePoint);
  1772. }
  1773. /**
  1774. * Returns the non basic ASCII code point that the given code point can be confused,
  1775. * or undefined if such code point does note exist.
  1776. */
  1777. getPrimaryConfusable(codePoint) {
  1778. return this.confusableDictionary.get(codePoint);
  1779. }
  1780. getConfusableCodePoints() {
  1781. return new Set(this.confusableDictionary.keys());
  1782. }
  1783. };
  1784. var InvisibleCharacters = class _InvisibleCharacters {
  1785. static getRawData() {
  1786. return JSON.parse("[9,10,11,12,13,32,127,160,173,847,1564,4447,4448,6068,6069,6155,6156,6157,6158,7355,7356,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8203,8204,8205,8206,8207,8234,8235,8236,8237,8238,8239,8287,8288,8289,8290,8291,8292,8293,8294,8295,8296,8297,8298,8299,8300,8301,8302,8303,10240,12288,12644,65024,65025,65026,65027,65028,65029,65030,65031,65032,65033,65034,65035,65036,65037,65038,65039,65279,65440,65520,65521,65522,65523,65524,65525,65526,65527,65528,65532,78844,119155,119156,119157,119158,119159,119160,119161,119162,917504,917505,917506,917507,917508,917509,917510,917511,917512,917513,917514,917515,917516,917517,917518,917519,917520,917521,917522,917523,917524,917525,917526,917527,917528,917529,917530,917531,917532,917533,917534,917535,917536,917537,917538,917539,917540,917541,917542,917543,917544,917545,917546,917547,917548,917549,917550,917551,917552,917553,917554,917555,917556,917557,917558,917559,917560,917561,917562,917563,917564,917565,917566,917567,917568,917569,917570,917571,917572,917573,917574,917575,917576,917577,917578,917579,917580,917581,917582,917583,917584,917585,917586,917587,917588,917589,917590,917591,917592,917593,917594,917595,917596,917597,917598,917599,917600,917601,917602,917603,917604,917605,917606,917607,917608,917609,917610,917611,917612,917613,917614,917615,917616,917617,917618,917619,917620,917621,917622,917623,917624,917625,917626,917627,917628,917629,917630,917631,917760,917761,917762,917763,917764,917765,917766,917767,917768,917769,917770,917771,917772,917773,917774,917775,917776,917777,917778,917779,917780,917781,917782,917783,917784,917785,917786,917787,917788,917789,917790,917791,917792,917793,917794,917795,917796,917797,917798,917799,917800,917801,917802,917803,917804,917805,917806,917807,917808,917809,917810,917811,917812,917813,917814,917815,917816,917817,917818,917819,917820,917821,917822,917823,917824,917825,917826,917827,917828,917829,917830,917831,917832,917833,917834,917835,917836,917837,917838,917839,917840,917841,917842,917843,917844,917845,917846,917847,917848,917849,917850,917851,917852,917853,917854,917855,917856,917857,917858,917859,917860,917861,917862,917863,917864,917865,917866,917867,917868,917869,917870,917871,917872,917873,917874,917875,917876,917877,917878,917879,917880,917881,917882,917883,917884,917885,917886,917887,917888,917889,917890,917891,917892,917893,917894,917895,917896,917897,917898,917899,917900,917901,917902,917903,917904,917905,917906,917907,917908,917909,917910,917911,917912,917913,917914,917915,917916,917917,917918,917919,917920,917921,917922,917923,917924,917925,917926,917927,917928,917929,917930,917931,917932,917933,917934,917935,917936,917937,917938,917939,917940,917941,917942,917943,917944,917945,917946,917947,917948,917949,917950,917951,917952,917953,917954,917955,917956,917957,917958,917959,917960,917961,917962,917963,917964,917965,917966,917967,917968,917969,917970,917971,917972,917973,917974,917975,917976,917977,917978,917979,917980,917981,917982,917983,917984,917985,917986,917987,917988,917989,917990,917991,917992,917993,917994,917995,917996,917997,917998,917999]");
  1787. }
  1788. static {
  1789. this._data = void 0;
  1790. }
  1791. static getData() {
  1792. if (!this._data) {
  1793. this._data = new Set(_InvisibleCharacters.getRawData());
  1794. }
  1795. return this._data;
  1796. }
  1797. static isInvisibleCharacter(codePoint) {
  1798. return _InvisibleCharacters.getData().has(codePoint);
  1799. }
  1800. static get codePoints() {
  1801. return _InvisibleCharacters.getData();
  1802. }
  1803. };
  1804. // node_modules/monaco-editor/esm/vs/base/common/process.js
  1805. var safeProcess;
  1806. var vscodeGlobal = globalThis.vscode;
  1807. if (typeof vscodeGlobal !== "undefined" && typeof vscodeGlobal.process !== "undefined") {
  1808. const sandboxProcess = vscodeGlobal.process;
  1809. safeProcess = {
  1810. get platform() {
  1811. return sandboxProcess.platform;
  1812. },
  1813. get arch() {
  1814. return sandboxProcess.arch;
  1815. },
  1816. get env() {
  1817. return sandboxProcess.env;
  1818. },
  1819. cwd() {
  1820. return sandboxProcess.cwd();
  1821. }
  1822. };
  1823. } else if (typeof process !== "undefined" && typeof process?.versions?.node === "string") {
  1824. safeProcess = {
  1825. get platform() {
  1826. return process.platform;
  1827. },
  1828. get arch() {
  1829. return process.arch;
  1830. },
  1831. get env() {
  1832. return process.env;
  1833. },
  1834. cwd() {
  1835. return process.env["VSCODE_CWD"] || process.cwd();
  1836. }
  1837. };
  1838. } else {
  1839. safeProcess = {
  1840. // Supported
  1841. get platform() {
  1842. return isWindows ? "win32" : isMacintosh ? "darwin" : "linux";
  1843. },
  1844. get arch() {
  1845. return void 0;
  1846. },
  1847. // Unsupported
  1848. get env() {
  1849. return {};
  1850. },
  1851. cwd() {
  1852. return "/";
  1853. }
  1854. };
  1855. }
  1856. var cwd = safeProcess.cwd;
  1857. var env = safeProcess.env;
  1858. var platform = safeProcess.platform;
  1859. // node_modules/monaco-editor/esm/vs/base/common/path.js
  1860. var CHAR_UPPERCASE_A = 65;
  1861. var CHAR_LOWERCASE_A = 97;
  1862. var CHAR_UPPERCASE_Z = 90;
  1863. var CHAR_LOWERCASE_Z = 122;
  1864. var CHAR_DOT = 46;
  1865. var CHAR_FORWARD_SLASH = 47;
  1866. var CHAR_BACKWARD_SLASH = 92;
  1867. var CHAR_COLON = 58;
  1868. var CHAR_QUESTION_MARK = 63;
  1869. var ErrorInvalidArgType = class extends Error {
  1870. constructor(name, expected, actual) {
  1871. let determiner;
  1872. if (typeof expected === "string" && expected.indexOf("not ") === 0) {
  1873. determiner = "must not be";
  1874. expected = expected.replace(/^not /, "");
  1875. } else {
  1876. determiner = "must be";
  1877. }
  1878. const type = name.indexOf(".") !== -1 ? "property" : "argument";
  1879. let msg = `The "${name}" ${type} ${determiner} of type ${expected}`;
  1880. msg += `. Received type ${typeof actual}`;
  1881. super(msg);
  1882. this.code = "ERR_INVALID_ARG_TYPE";
  1883. }
  1884. };
  1885. function validateObject(pathObject, name) {
  1886. if (pathObject === null || typeof pathObject !== "object") {
  1887. throw new ErrorInvalidArgType(name, "Object", pathObject);
  1888. }
  1889. }
  1890. function validateString(value, name) {
  1891. if (typeof value !== "string") {
  1892. throw new ErrorInvalidArgType(name, "string", value);
  1893. }
  1894. }
  1895. var platformIsWin32 = platform === "win32";
  1896. function isPathSeparator(code) {
  1897. return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;
  1898. }
  1899. function isPosixPathSeparator(code) {
  1900. return code === CHAR_FORWARD_SLASH;
  1901. }
  1902. function isWindowsDeviceRoot(code) {
  1903. return code >= CHAR_UPPERCASE_A && code <= CHAR_UPPERCASE_Z || code >= CHAR_LOWERCASE_A && code <= CHAR_LOWERCASE_Z;
  1904. }
  1905. function normalizeString(path, allowAboveRoot, separator, isPathSeparator2) {
  1906. let res = "";
  1907. let lastSegmentLength = 0;
  1908. let lastSlash = -1;
  1909. let dots = 0;
  1910. let code = 0;
  1911. for (let i = 0; i <= path.length; ++i) {
  1912. if (i < path.length) {
  1913. code = path.charCodeAt(i);
  1914. } else if (isPathSeparator2(code)) {
  1915. break;
  1916. } else {
  1917. code = CHAR_FORWARD_SLASH;
  1918. }
  1919. if (isPathSeparator2(code)) {
  1920. if (lastSlash === i - 1 || dots === 1) {
  1921. } else if (dots === 2) {
  1922. if (res.length < 2 || lastSegmentLength !== 2 || res.charCodeAt(res.length - 1) !== CHAR_DOT || res.charCodeAt(res.length - 2) !== CHAR_DOT) {
  1923. if (res.length > 2) {
  1924. const lastSlashIndex = res.lastIndexOf(separator);
  1925. if (lastSlashIndex === -1) {
  1926. res = "";
  1927. lastSegmentLength = 0;
  1928. } else {
  1929. res = res.slice(0, lastSlashIndex);
  1930. lastSegmentLength = res.length - 1 - res.lastIndexOf(separator);
  1931. }
  1932. lastSlash = i;
  1933. dots = 0;
  1934. continue;
  1935. } else if (res.length !== 0) {
  1936. res = "";
  1937. lastSegmentLength = 0;
  1938. lastSlash = i;
  1939. dots = 0;
  1940. continue;
  1941. }
  1942. }
  1943. if (allowAboveRoot) {
  1944. res += res.length > 0 ? `${separator}..` : "..";
  1945. lastSegmentLength = 2;
  1946. }
  1947. } else {
  1948. if (res.length > 0) {
  1949. res += `${separator}${path.slice(lastSlash + 1, i)}`;
  1950. } else {
  1951. res = path.slice(lastSlash + 1, i);
  1952. }
  1953. lastSegmentLength = i - lastSlash - 1;
  1954. }
  1955. lastSlash = i;
  1956. dots = 0;
  1957. } else if (code === CHAR_DOT && dots !== -1) {
  1958. ++dots;
  1959. } else {
  1960. dots = -1;
  1961. }
  1962. }
  1963. return res;
  1964. }
  1965. function formatExt(ext) {
  1966. return ext ? `${ext[0] === "." ? "" : "."}${ext}` : "";
  1967. }
  1968. function _format2(sep2, pathObject) {
  1969. validateObject(pathObject, "pathObject");
  1970. const dir = pathObject.dir || pathObject.root;
  1971. const base = pathObject.base || `${pathObject.name || ""}${formatExt(pathObject.ext)}`;
  1972. if (!dir) {
  1973. return base;
  1974. }
  1975. return dir === pathObject.root ? `${dir}${base}` : `${dir}${sep2}${base}`;
  1976. }
  1977. var win32 = {
  1978. // path.resolve([from ...], to)
  1979. resolve(...pathSegments) {
  1980. let resolvedDevice = "";
  1981. let resolvedTail = "";
  1982. let resolvedAbsolute = false;
  1983. for (let i = pathSegments.length - 1; i >= -1; i--) {
  1984. let path;
  1985. if (i >= 0) {
  1986. path = pathSegments[i];
  1987. validateString(path, `paths[${i}]`);
  1988. if (path.length === 0) {
  1989. continue;
  1990. }
  1991. } else if (resolvedDevice.length === 0) {
  1992. path = cwd();
  1993. } else {
  1994. path = env[`=${resolvedDevice}`] || cwd();
  1995. if (path === void 0 || path.slice(0, 2).toLowerCase() !== resolvedDevice.toLowerCase() && path.charCodeAt(2) === CHAR_BACKWARD_SLASH) {
  1996. path = `${resolvedDevice}\\`;
  1997. }
  1998. }
  1999. const len = path.length;
  2000. let rootEnd = 0;
  2001. let device = "";
  2002. let isAbsolute = false;
  2003. const code = path.charCodeAt(0);
  2004. if (len === 1) {
  2005. if (isPathSeparator(code)) {
  2006. rootEnd = 1;
  2007. isAbsolute = true;
  2008. }
  2009. } else if (isPathSeparator(code)) {
  2010. isAbsolute = true;
  2011. if (isPathSeparator(path.charCodeAt(1))) {
  2012. let j = 2;
  2013. let last = j;
  2014. while (j < len && !isPathSeparator(path.charCodeAt(j))) {
  2015. j++;
  2016. }
  2017. if (j < len && j !== last) {
  2018. const firstPart = path.slice(last, j);
  2019. last = j;
  2020. while (j < len && isPathSeparator(path.charCodeAt(j))) {
  2021. j++;
  2022. }
  2023. if (j < len && j !== last) {
  2024. last = j;
  2025. while (j < len && !isPathSeparator(path.charCodeAt(j))) {
  2026. j++;
  2027. }
  2028. if (j === len || j !== last) {
  2029. device = `\\\\${firstPart}\\${path.slice(last, j)}`;
  2030. rootEnd = j;
  2031. }
  2032. }
  2033. }
  2034. } else {
  2035. rootEnd = 1;
  2036. }
  2037. } else if (isWindowsDeviceRoot(code) && path.charCodeAt(1) === CHAR_COLON) {
  2038. device = path.slice(0, 2);
  2039. rootEnd = 2;
  2040. if (len > 2 && isPathSeparator(path.charCodeAt(2))) {
  2041. isAbsolute = true;
  2042. rootEnd = 3;
  2043. }
  2044. }
  2045. if (device.length > 0) {
  2046. if (resolvedDevice.length > 0) {
  2047. if (device.toLowerCase() !== resolvedDevice.toLowerCase()) {
  2048. continue;
  2049. }
  2050. } else {
  2051. resolvedDevice = device;
  2052. }
  2053. }
  2054. if (resolvedAbsolute) {
  2055. if (resolvedDevice.length > 0) {
  2056. break;
  2057. }
  2058. } else {
  2059. resolvedTail = `${path.slice(rootEnd)}\\${resolvedTail}`;
  2060. resolvedAbsolute = isAbsolute;
  2061. if (isAbsolute && resolvedDevice.length > 0) {
  2062. break;
  2063. }
  2064. }
  2065. }
  2066. resolvedTail = normalizeString(resolvedTail, !resolvedAbsolute, "\\", isPathSeparator);
  2067. return resolvedAbsolute ? `${resolvedDevice}\\${resolvedTail}` : `${resolvedDevice}${resolvedTail}` || ".";
  2068. },
  2069. normalize(path) {
  2070. validateString(path, "path");
  2071. const len = path.length;
  2072. if (len === 0) {
  2073. return ".";
  2074. }
  2075. let rootEnd = 0;
  2076. let device;
  2077. let isAbsolute = false;
  2078. const code = path.charCodeAt(0);
  2079. if (len === 1) {
  2080. return isPosixPathSeparator(code) ? "\\" : path;
  2081. }
  2082. if (isPathSeparator(code)) {
  2083. isAbsolute = true;
  2084. if (isPathSeparator(path.charCodeAt(1))) {
  2085. let j = 2;
  2086. let last = j;
  2087. while (j < len && !isPathSeparator(path.charCodeAt(j))) {
  2088. j++;
  2089. }
  2090. if (j < len && j !== last) {
  2091. const firstPart = path.slice(last, j);
  2092. last = j;
  2093. while (j < len && isPathSeparator(path.charCodeAt(j))) {
  2094. j++;
  2095. }
  2096. if (j < len && j !== last) {
  2097. last = j;
  2098. while (j < len && !isPathSeparator(path.charCodeAt(j))) {
  2099. j++;
  2100. }
  2101. if (j === len) {
  2102. return `\\\\${firstPart}\\${path.slice(last)}\\`;
  2103. }
  2104. if (j !== last) {
  2105. device = `\\\\${firstPart}\\${path.slice(last, j)}`;
  2106. rootEnd = j;
  2107. }
  2108. }
  2109. }
  2110. } else {
  2111. rootEnd = 1;
  2112. }
  2113. } else if (isWindowsDeviceRoot(code) && path.charCodeAt(1) === CHAR_COLON) {
  2114. device = path.slice(0, 2);
  2115. rootEnd = 2;
  2116. if (len > 2 && isPathSeparator(path.charCodeAt(2))) {
  2117. isAbsolute = true;
  2118. rootEnd = 3;
  2119. }
  2120. }
  2121. let tail = rootEnd < len ? normalizeString(path.slice(rootEnd), !isAbsolute, "\\", isPathSeparator) : "";
  2122. if (tail.length === 0 && !isAbsolute) {
  2123. tail = ".";
  2124. }
  2125. if (tail.length > 0 && isPathSeparator(path.charCodeAt(len - 1))) {
  2126. tail += "\\";
  2127. }
  2128. if (device === void 0) {
  2129. return isAbsolute ? `\\${tail}` : tail;
  2130. }
  2131. return isAbsolute ? `${device}\\${tail}` : `${device}${tail}`;
  2132. },
  2133. isAbsolute(path) {
  2134. validateString(path, "path");
  2135. const len = path.length;
  2136. if (len === 0) {
  2137. return false;
  2138. }
  2139. const code = path.charCodeAt(0);
  2140. return isPathSeparator(code) || // Possible device root
  2141. len > 2 && isWindowsDeviceRoot(code) && path.charCodeAt(1) === CHAR_COLON && isPathSeparator(path.charCodeAt(2));
  2142. },
  2143. join(...paths) {
  2144. if (paths.length === 0) {
  2145. return ".";
  2146. }
  2147. let joined;
  2148. let firstPart;
  2149. for (let i = 0; i < paths.length; ++i) {
  2150. const arg = paths[i];
  2151. validateString(arg, "path");
  2152. if (arg.length > 0) {
  2153. if (joined === void 0) {
  2154. joined = firstPart = arg;
  2155. } else {
  2156. joined += `\\${arg}`;
  2157. }
  2158. }
  2159. }
  2160. if (joined === void 0) {
  2161. return ".";
  2162. }
  2163. let needsReplace = true;
  2164. let slashCount = 0;
  2165. if (typeof firstPart === "string" && isPathSeparator(firstPart.charCodeAt(0))) {
  2166. ++slashCount;
  2167. const firstLen = firstPart.length;
  2168. if (firstLen > 1 && isPathSeparator(firstPart.charCodeAt(1))) {
  2169. ++slashCount;
  2170. if (firstLen > 2) {
  2171. if (isPathSeparator(firstPart.charCodeAt(2))) {
  2172. ++slashCount;
  2173. } else {
  2174. needsReplace = false;
  2175. }
  2176. }
  2177. }
  2178. }
  2179. if (needsReplace) {
  2180. while (slashCount < joined.length && isPathSeparator(joined.charCodeAt(slashCount))) {
  2181. slashCount++;
  2182. }
  2183. if (slashCount >= 2) {
  2184. joined = `\\${joined.slice(slashCount)}`;
  2185. }
  2186. }
  2187. return win32.normalize(joined);
  2188. },
  2189. // It will solve the relative path from `from` to `to`, for instance:
  2190. // from = 'C:\\orandea\\test\\aaa'
  2191. // to = 'C:\\orandea\\impl\\bbb'
  2192. // The output of the function should be: '..\\..\\impl\\bbb'
  2193. relative(from, to) {
  2194. validateString(from, "from");
  2195. validateString(to, "to");
  2196. if (from === to) {
  2197. return "";
  2198. }
  2199. const fromOrig = win32.resolve(from);
  2200. const toOrig = win32.resolve(to);
  2201. if (fromOrig === toOrig) {
  2202. return "";
  2203. }
  2204. from = fromOrig.toLowerCase();
  2205. to = toOrig.toLowerCase();
  2206. if (from === to) {
  2207. return "";
  2208. }
  2209. let fromStart = 0;
  2210. while (fromStart < from.length && from.charCodeAt(fromStart) === CHAR_BACKWARD_SLASH) {
  2211. fromStart++;
  2212. }
  2213. let fromEnd = from.length;
  2214. while (fromEnd - 1 > fromStart && from.charCodeAt(fromEnd - 1) === CHAR_BACKWARD_SLASH) {
  2215. fromEnd--;
  2216. }
  2217. const fromLen = fromEnd - fromStart;
  2218. let toStart = 0;
  2219. while (toStart < to.length && to.charCodeAt(toStart) === CHAR_BACKWARD_SLASH) {
  2220. toStart++;
  2221. }
  2222. let toEnd = to.length;
  2223. while (toEnd - 1 > toStart && to.charCodeAt(toEnd - 1) === CHAR_BACKWARD_SLASH) {
  2224. toEnd--;
  2225. }
  2226. const toLen = toEnd - toStart;
  2227. const length = fromLen < toLen ? fromLen : toLen;
  2228. let lastCommonSep = -1;
  2229. let i = 0;
  2230. for (; i < length; i++) {
  2231. const fromCode = from.charCodeAt(fromStart + i);
  2232. if (fromCode !== to.charCodeAt(toStart + i)) {
  2233. break;
  2234. } else if (fromCode === CHAR_BACKWARD_SLASH) {
  2235. lastCommonSep = i;
  2236. }
  2237. }
  2238. if (i !== length) {
  2239. if (lastCommonSep === -1) {
  2240. return toOrig;
  2241. }
  2242. } else {
  2243. if (toLen > length) {
  2244. if (to.charCodeAt(toStart + i) === CHAR_BACKWARD_SLASH) {
  2245. return toOrig.slice(toStart + i + 1);
  2246. }
  2247. if (i === 2) {
  2248. return toOrig.slice(toStart + i);
  2249. }
  2250. }
  2251. if (fromLen > length) {
  2252. if (from.charCodeAt(fromStart + i) === CHAR_BACKWARD_SLASH) {
  2253. lastCommonSep = i;
  2254. } else if (i === 2) {
  2255. lastCommonSep = 3;
  2256. }
  2257. }
  2258. if (lastCommonSep === -1) {
  2259. lastCommonSep = 0;
  2260. }
  2261. }
  2262. let out = "";
  2263. for (i = fromStart + lastCommonSep + 1; i <= fromEnd; ++i) {
  2264. if (i === fromEnd || from.charCodeAt(i) === CHAR_BACKWARD_SLASH) {
  2265. out += out.length === 0 ? ".." : "\\..";
  2266. }
  2267. }
  2268. toStart += lastCommonSep;
  2269. if (out.length > 0) {
  2270. return `${out}${toOrig.slice(toStart, toEnd)}`;
  2271. }
  2272. if (toOrig.charCodeAt(toStart) === CHAR_BACKWARD_SLASH) {
  2273. ++toStart;
  2274. }
  2275. return toOrig.slice(toStart, toEnd);
  2276. },
  2277. toNamespacedPath(path) {
  2278. if (typeof path !== "string" || path.length === 0) {
  2279. return path;
  2280. }
  2281. const resolvedPath = win32.resolve(path);
  2282. if (resolvedPath.length <= 2) {
  2283. return path;
  2284. }
  2285. if (resolvedPath.charCodeAt(0) === CHAR_BACKWARD_SLASH) {
  2286. if (resolvedPath.charCodeAt(1) === CHAR_BACKWARD_SLASH) {
  2287. const code = resolvedPath.charCodeAt(2);
  2288. if (code !== CHAR_QUESTION_MARK && code !== CHAR_DOT) {
  2289. return `\\\\?\\UNC\\${resolvedPath.slice(2)}`;
  2290. }
  2291. }
  2292. } else if (isWindowsDeviceRoot(resolvedPath.charCodeAt(0)) && resolvedPath.charCodeAt(1) === CHAR_COLON && resolvedPath.charCodeAt(2) === CHAR_BACKWARD_SLASH) {
  2293. return `\\\\?\\${resolvedPath}`;
  2294. }
  2295. return path;
  2296. },
  2297. dirname(path) {
  2298. validateString(path, "path");
  2299. const len = path.length;
  2300. if (len === 0) {
  2301. return ".";
  2302. }
  2303. let rootEnd = -1;
  2304. let offset = 0;
  2305. const code = path.charCodeAt(0);
  2306. if (len === 1) {
  2307. return isPathSeparator(code) ? path : ".";
  2308. }
  2309. if (isPathSeparator(code)) {
  2310. rootEnd = offset = 1;
  2311. if (isPathSeparator(path.charCodeAt(1))) {
  2312. let j = 2;
  2313. let last = j;
  2314. while (j < len && !isPathSeparator(path.charCodeAt(j))) {
  2315. j++;
  2316. }
  2317. if (j < len && j !== last) {
  2318. last = j;
  2319. while (j < len && isPathSeparator(path.charCodeAt(j))) {
  2320. j++;
  2321. }
  2322. if (j < len && j !== last) {
  2323. last = j;
  2324. while (j < len && !isPathSeparator(path.charCodeAt(j))) {
  2325. j++;
  2326. }
  2327. if (j === len) {
  2328. return path;
  2329. }
  2330. if (j !== last) {
  2331. rootEnd = offset = j + 1;
  2332. }
  2333. }
  2334. }
  2335. }
  2336. } else if (isWindowsDeviceRoot(code) && path.charCodeAt(1) === CHAR_COLON) {
  2337. rootEnd = len > 2 && isPathSeparator(path.charCodeAt(2)) ? 3 : 2;
  2338. offset = rootEnd;
  2339. }
  2340. let end = -1;
  2341. let matchedSlash = true;
  2342. for (let i = len - 1; i >= offset; --i) {
  2343. if (isPathSeparator(path.charCodeAt(i))) {
  2344. if (!matchedSlash) {
  2345. end = i;
  2346. break;
  2347. }
  2348. } else {
  2349. matchedSlash = false;
  2350. }
  2351. }
  2352. if (end === -1) {
  2353. if (rootEnd === -1) {
  2354. return ".";
  2355. }
  2356. end = rootEnd;
  2357. }
  2358. return path.slice(0, end);
  2359. },
  2360. basename(path, suffix) {
  2361. if (suffix !== void 0) {
  2362. validateString(suffix, "suffix");
  2363. }
  2364. validateString(path, "path");
  2365. let start = 0;
  2366. let end = -1;
  2367. let matchedSlash = true;
  2368. let i;
  2369. if (path.length >= 2 && isWindowsDeviceRoot(path.charCodeAt(0)) && path.charCodeAt(1) === CHAR_COLON) {
  2370. start = 2;
  2371. }
  2372. if (suffix !== void 0 && suffix.length > 0 && suffix.length <= path.length) {
  2373. if (suffix === path) {
  2374. return "";
  2375. }
  2376. let extIdx = suffix.length - 1;
  2377. let firstNonSlashEnd = -1;
  2378. for (i = path.length - 1; i >= start; --i) {
  2379. const code = path.charCodeAt(i);
  2380. if (isPathSeparator(code)) {
  2381. if (!matchedSlash) {
  2382. start = i + 1;
  2383. break;
  2384. }
  2385. } else {
  2386. if (firstNonSlashEnd === -1) {
  2387. matchedSlash = false;
  2388. firstNonSlashEnd = i + 1;
  2389. }
  2390. if (extIdx >= 0) {
  2391. if (code === suffix.charCodeAt(extIdx)) {
  2392. if (--extIdx === -1) {
  2393. end = i;
  2394. }
  2395. } else {
  2396. extIdx = -1;
  2397. end = firstNonSlashEnd;
  2398. }
  2399. }
  2400. }
  2401. }
  2402. if (start === end) {
  2403. end = firstNonSlashEnd;
  2404. } else if (end === -1) {
  2405. end = path.length;
  2406. }
  2407. return path.slice(start, end);
  2408. }
  2409. for (i = path.length - 1; i >= start; --i) {
  2410. if (isPathSeparator(path.charCodeAt(i))) {
  2411. if (!matchedSlash) {
  2412. start = i + 1;
  2413. break;
  2414. }
  2415. } else if (end === -1) {
  2416. matchedSlash = false;
  2417. end = i + 1;
  2418. }
  2419. }
  2420. if (end === -1) {
  2421. return "";
  2422. }
  2423. return path.slice(start, end);
  2424. },
  2425. extname(path) {
  2426. validateString(path, "path");
  2427. let start = 0;
  2428. let startDot = -1;
  2429. let startPart = 0;
  2430. let end = -1;
  2431. let matchedSlash = true;
  2432. let preDotState = 0;
  2433. if (path.length >= 2 && path.charCodeAt(1) === CHAR_COLON && isWindowsDeviceRoot(path.charCodeAt(0))) {
  2434. start = startPart = 2;
  2435. }
  2436. for (let i = path.length - 1; i >= start; --i) {
  2437. const code = path.charCodeAt(i);
  2438. if (isPathSeparator(code)) {
  2439. if (!matchedSlash) {
  2440. startPart = i + 1;
  2441. break;
  2442. }
  2443. continue;
  2444. }
  2445. if (end === -1) {
  2446. matchedSlash = false;
  2447. end = i + 1;
  2448. }
  2449. if (code === CHAR_DOT) {
  2450. if (startDot === -1) {
  2451. startDot = i;
  2452. } else if (preDotState !== 1) {
  2453. preDotState = 1;
  2454. }
  2455. } else if (startDot !== -1) {
  2456. preDotState = -1;
  2457. }
  2458. }
  2459. if (startDot === -1 || end === -1 || // We saw a non-dot character immediately before the dot
  2460. preDotState === 0 || // The (right-most) trimmed path component is exactly '..'
  2461. preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
  2462. return "";
  2463. }
  2464. return path.slice(startDot, end);
  2465. },
  2466. format: _format2.bind(null, "\\"),
  2467. parse(path) {
  2468. validateString(path, "path");
  2469. const ret = { root: "", dir: "", base: "", ext: "", name: "" };
  2470. if (path.length === 0) {
  2471. return ret;
  2472. }
  2473. const len = path.length;
  2474. let rootEnd = 0;
  2475. let code = path.charCodeAt(0);
  2476. if (len === 1) {
  2477. if (isPathSeparator(code)) {
  2478. ret.root = ret.dir = path;
  2479. return ret;
  2480. }
  2481. ret.base = ret.name = path;
  2482. return ret;
  2483. }
  2484. if (isPathSeparator(code)) {
  2485. rootEnd = 1;
  2486. if (isPathSeparator(path.charCodeAt(1))) {
  2487. let j = 2;
  2488. let last = j;
  2489. while (j < len && !isPathSeparator(path.charCodeAt(j))) {
  2490. j++;
  2491. }
  2492. if (j < len && j !== last) {
  2493. last = j;
  2494. while (j < len && isPathSeparator(path.charCodeAt(j))) {
  2495. j++;
  2496. }
  2497. if (j < len && j !== last) {
  2498. last = j;
  2499. while (j < len && !isPathSeparator(path.charCodeAt(j))) {
  2500. j++;
  2501. }
  2502. if (j === len) {
  2503. rootEnd = j;
  2504. } else if (j !== last) {
  2505. rootEnd = j + 1;
  2506. }
  2507. }
  2508. }
  2509. }
  2510. } else if (isWindowsDeviceRoot(code) && path.charCodeAt(1) === CHAR_COLON) {
  2511. if (len <= 2) {
  2512. ret.root = ret.dir = path;
  2513. return ret;
  2514. }
  2515. rootEnd = 2;
  2516. if (isPathSeparator(path.charCodeAt(2))) {
  2517. if (len === 3) {
  2518. ret.root = ret.dir = path;
  2519. return ret;
  2520. }
  2521. rootEnd = 3;
  2522. }
  2523. }
  2524. if (rootEnd > 0) {
  2525. ret.root = path.slice(0, rootEnd);
  2526. }
  2527. let startDot = -1;
  2528. let startPart = rootEnd;
  2529. let end = -1;
  2530. let matchedSlash = true;
  2531. let i = path.length - 1;
  2532. let preDotState = 0;
  2533. for (; i >= rootEnd; --i) {
  2534. code = path.charCodeAt(i);
  2535. if (isPathSeparator(code)) {
  2536. if (!matchedSlash) {
  2537. startPart = i + 1;
  2538. break;
  2539. }
  2540. continue;
  2541. }
  2542. if (end === -1) {
  2543. matchedSlash = false;
  2544. end = i + 1;
  2545. }
  2546. if (code === CHAR_DOT) {
  2547. if (startDot === -1) {
  2548. startDot = i;
  2549. } else if (preDotState !== 1) {
  2550. preDotState = 1;
  2551. }
  2552. } else if (startDot !== -1) {
  2553. preDotState = -1;
  2554. }
  2555. }
  2556. if (end !== -1) {
  2557. if (startDot === -1 || // We saw a non-dot character immediately before the dot
  2558. preDotState === 0 || // The (right-most) trimmed path component is exactly '..'
  2559. preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
  2560. ret.base = ret.name = path.slice(startPart, end);
  2561. } else {
  2562. ret.name = path.slice(startPart, startDot);
  2563. ret.base = path.slice(startPart, end);
  2564. ret.ext = path.slice(startDot, end);
  2565. }
  2566. }
  2567. if (startPart > 0 && startPart !== rootEnd) {
  2568. ret.dir = path.slice(0, startPart - 1);
  2569. } else {
  2570. ret.dir = ret.root;
  2571. }
  2572. return ret;
  2573. },
  2574. sep: "\\",
  2575. delimiter: ";",
  2576. win32: null,
  2577. posix: null
  2578. };
  2579. var posixCwd = (() => {
  2580. if (platformIsWin32) {
  2581. const regexp = /\\/g;
  2582. return () => {
  2583. const cwd2 = cwd().replace(regexp, "/");
  2584. return cwd2.slice(cwd2.indexOf("/"));
  2585. };
  2586. }
  2587. return () => cwd();
  2588. })();
  2589. var posix = {
  2590. // path.resolve([from ...], to)
  2591. resolve(...pathSegments) {
  2592. let resolvedPath = "";
  2593. let resolvedAbsolute = false;
  2594. for (let i = pathSegments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
  2595. const path = i >= 0 ? pathSegments[i] : posixCwd();
  2596. validateString(path, `paths[${i}]`);
  2597. if (path.length === 0) {
  2598. continue;
  2599. }
  2600. resolvedPath = `${path}/${resolvedPath}`;
  2601. resolvedAbsolute = path.charCodeAt(0) === CHAR_FORWARD_SLASH;
  2602. }
  2603. resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute, "/", isPosixPathSeparator);
  2604. if (resolvedAbsolute) {
  2605. return `/${resolvedPath}`;
  2606. }
  2607. return resolvedPath.length > 0 ? resolvedPath : ".";
  2608. },
  2609. normalize(path) {
  2610. validateString(path, "path");
  2611. if (path.length === 0) {
  2612. return ".";
  2613. }
  2614. const isAbsolute = path.charCodeAt(0) === CHAR_FORWARD_SLASH;
  2615. const trailingSeparator = path.charCodeAt(path.length - 1) === CHAR_FORWARD_SLASH;
  2616. path = normalizeString(path, !isAbsolute, "/", isPosixPathSeparator);
  2617. if (path.length === 0) {
  2618. if (isAbsolute) {
  2619. return "/";
  2620. }
  2621. return trailingSeparator ? "./" : ".";
  2622. }
  2623. if (trailingSeparator) {
  2624. path += "/";
  2625. }
  2626. return isAbsolute ? `/${path}` : path;
  2627. },
  2628. isAbsolute(path) {
  2629. validateString(path, "path");
  2630. return path.length > 0 && path.charCodeAt(0) === CHAR_FORWARD_SLASH;
  2631. },
  2632. join(...paths) {
  2633. if (paths.length === 0) {
  2634. return ".";
  2635. }
  2636. let joined;
  2637. for (let i = 0; i < paths.length; ++i) {
  2638. const arg = paths[i];
  2639. validateString(arg, "path");
  2640. if (arg.length > 0) {
  2641. if (joined === void 0) {
  2642. joined = arg;
  2643. } else {
  2644. joined += `/${arg}`;
  2645. }
  2646. }
  2647. }
  2648. if (joined === void 0) {
  2649. return ".";
  2650. }
  2651. return posix.normalize(joined);
  2652. },
  2653. relative(from, to) {
  2654. validateString(from, "from");
  2655. validateString(to, "to");
  2656. if (from === to) {
  2657. return "";
  2658. }
  2659. from = posix.resolve(from);
  2660. to = posix.resolve(to);
  2661. if (from === to) {
  2662. return "";
  2663. }
  2664. const fromStart = 1;
  2665. const fromEnd = from.length;
  2666. const fromLen = fromEnd - fromStart;
  2667. const toStart = 1;
  2668. const toLen = to.length - toStart;
  2669. const length = fromLen < toLen ? fromLen : toLen;
  2670. let lastCommonSep = -1;
  2671. let i = 0;
  2672. for (; i < length; i++) {
  2673. const fromCode = from.charCodeAt(fromStart + i);
  2674. if (fromCode !== to.charCodeAt(toStart + i)) {
  2675. break;
  2676. } else if (fromCode === CHAR_FORWARD_SLASH) {
  2677. lastCommonSep = i;
  2678. }
  2679. }
  2680. if (i === length) {
  2681. if (toLen > length) {
  2682. if (to.charCodeAt(toStart + i) === CHAR_FORWARD_SLASH) {
  2683. return to.slice(toStart + i + 1);
  2684. }
  2685. if (i === 0) {
  2686. return to.slice(toStart + i);
  2687. }
  2688. } else if (fromLen > length) {
  2689. if (from.charCodeAt(fromStart + i) === CHAR_FORWARD_SLASH) {
  2690. lastCommonSep = i;
  2691. } else if (i === 0) {
  2692. lastCommonSep = 0;
  2693. }
  2694. }
  2695. }
  2696. let out = "";
  2697. for (i = fromStart + lastCommonSep + 1; i <= fromEnd; ++i) {
  2698. if (i === fromEnd || from.charCodeAt(i) === CHAR_FORWARD_SLASH) {
  2699. out += out.length === 0 ? ".." : "/..";
  2700. }
  2701. }
  2702. return `${out}${to.slice(toStart + lastCommonSep)}`;
  2703. },
  2704. toNamespacedPath(path) {
  2705. return path;
  2706. },
  2707. dirname(path) {
  2708. validateString(path, "path");
  2709. if (path.length === 0) {
  2710. return ".";
  2711. }
  2712. const hasRoot = path.charCodeAt(0) === CHAR_FORWARD_SLASH;
  2713. let end = -1;
  2714. let matchedSlash = true;
  2715. for (let i = path.length - 1; i >= 1; --i) {
  2716. if (path.charCodeAt(i) === CHAR_FORWARD_SLASH) {
  2717. if (!matchedSlash) {
  2718. end = i;
  2719. break;
  2720. }
  2721. } else {
  2722. matchedSlash = false;
  2723. }
  2724. }
  2725. if (end === -1) {
  2726. return hasRoot ? "/" : ".";
  2727. }
  2728. if (hasRoot && end === 1) {
  2729. return "//";
  2730. }
  2731. return path.slice(0, end);
  2732. },
  2733. basename(path, suffix) {
  2734. if (suffix !== void 0) {
  2735. validateString(suffix, "ext");
  2736. }
  2737. validateString(path, "path");
  2738. let start = 0;
  2739. let end = -1;
  2740. let matchedSlash = true;
  2741. let i;
  2742. if (suffix !== void 0 && suffix.length > 0 && suffix.length <= path.length) {
  2743. if (suffix === path) {
  2744. return "";
  2745. }
  2746. let extIdx = suffix.length - 1;
  2747. let firstNonSlashEnd = -1;
  2748. for (i = path.length - 1; i >= 0; --i) {
  2749. const code = path.charCodeAt(i);
  2750. if (code === CHAR_FORWARD_SLASH) {
  2751. if (!matchedSlash) {
  2752. start = i + 1;
  2753. break;
  2754. }
  2755. } else {
  2756. if (firstNonSlashEnd === -1) {
  2757. matchedSlash = false;
  2758. firstNonSlashEnd = i + 1;
  2759. }
  2760. if (extIdx >= 0) {
  2761. if (code === suffix.charCodeAt(extIdx)) {
  2762. if (--extIdx === -1) {
  2763. end = i;
  2764. }
  2765. } else {
  2766. extIdx = -1;
  2767. end = firstNonSlashEnd;
  2768. }
  2769. }
  2770. }
  2771. }
  2772. if (start === end) {
  2773. end = firstNonSlashEnd;
  2774. } else if (end === -1) {
  2775. end = path.length;
  2776. }
  2777. return path.slice(start, end);
  2778. }
  2779. for (i = path.length - 1; i >= 0; --i) {
  2780. if (path.charCodeAt(i) === CHAR_FORWARD_SLASH) {
  2781. if (!matchedSlash) {
  2782. start = i + 1;
  2783. break;
  2784. }
  2785. } else if (end === -1) {
  2786. matchedSlash = false;
  2787. end = i + 1;
  2788. }
  2789. }
  2790. if (end === -1) {
  2791. return "";
  2792. }
  2793. return path.slice(start, end);
  2794. },
  2795. extname(path) {
  2796. validateString(path, "path");
  2797. let startDot = -1;
  2798. let startPart = 0;
  2799. let end = -1;
  2800. let matchedSlash = true;
  2801. let preDotState = 0;
  2802. for (let i = path.length - 1; i >= 0; --i) {
  2803. const code = path.charCodeAt(i);
  2804. if (code === CHAR_FORWARD_SLASH) {
  2805. if (!matchedSlash) {
  2806. startPart = i + 1;
  2807. break;
  2808. }
  2809. continue;
  2810. }
  2811. if (end === -1) {
  2812. matchedSlash = false;
  2813. end = i + 1;
  2814. }
  2815. if (code === CHAR_DOT) {
  2816. if (startDot === -1) {
  2817. startDot = i;
  2818. } else if (preDotState !== 1) {
  2819. preDotState = 1;
  2820. }
  2821. } else if (startDot !== -1) {
  2822. preDotState = -1;
  2823. }
  2824. }
  2825. if (startDot === -1 || end === -1 || // We saw a non-dot character immediately before the dot
  2826. preDotState === 0 || // The (right-most) trimmed path component is exactly '..'
  2827. preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
  2828. return "";
  2829. }
  2830. return path.slice(startDot, end);
  2831. },
  2832. format: _format2.bind(null, "/"),
  2833. parse(path) {
  2834. validateString(path, "path");
  2835. const ret = { root: "", dir: "", base: "", ext: "", name: "" };
  2836. if (path.length === 0) {
  2837. return ret;
  2838. }
  2839. const isAbsolute = path.charCodeAt(0) === CHAR_FORWARD_SLASH;
  2840. let start;
  2841. if (isAbsolute) {
  2842. ret.root = "/";
  2843. start = 1;
  2844. } else {
  2845. start = 0;
  2846. }
  2847. let startDot = -1;
  2848. let startPart = 0;
  2849. let end = -1;
  2850. let matchedSlash = true;
  2851. let i = path.length - 1;
  2852. let preDotState = 0;
  2853. for (; i >= start; --i) {
  2854. const code = path.charCodeAt(i);
  2855. if (code === CHAR_FORWARD_SLASH) {
  2856. if (!matchedSlash) {
  2857. startPart = i + 1;
  2858. break;
  2859. }
  2860. continue;
  2861. }
  2862. if (end === -1) {
  2863. matchedSlash = false;
  2864. end = i + 1;
  2865. }
  2866. if (code === CHAR_DOT) {
  2867. if (startDot === -1) {
  2868. startDot = i;
  2869. } else if (preDotState !== 1) {
  2870. preDotState = 1;
  2871. }
  2872. } else if (startDot !== -1) {
  2873. preDotState = -1;
  2874. }
  2875. }
  2876. if (end !== -1) {
  2877. const start2 = startPart === 0 && isAbsolute ? 1 : startPart;
  2878. if (startDot === -1 || // We saw a non-dot character immediately before the dot
  2879. preDotState === 0 || // The (right-most) trimmed path component is exactly '..'
  2880. preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
  2881. ret.base = ret.name = path.slice(start2, end);
  2882. } else {
  2883. ret.name = path.slice(start2, startDot);
  2884. ret.base = path.slice(start2, end);
  2885. ret.ext = path.slice(startDot, end);
  2886. }
  2887. }
  2888. if (startPart > 0) {
  2889. ret.dir = path.slice(0, startPart - 1);
  2890. } else if (isAbsolute) {
  2891. ret.dir = "/";
  2892. }
  2893. return ret;
  2894. },
  2895. sep: "/",
  2896. delimiter: ":",
  2897. win32: null,
  2898. posix: null
  2899. };
  2900. posix.win32 = win32.win32 = win32;
  2901. posix.posix = win32.posix = posix;
  2902. var normalize = platformIsWin32 ? win32.normalize : posix.normalize;
  2903. var join = platformIsWin32 ? win32.join : posix.join;
  2904. var resolve = platformIsWin32 ? win32.resolve : posix.resolve;
  2905. var relative = platformIsWin32 ? win32.relative : posix.relative;
  2906. var dirname = platformIsWin32 ? win32.dirname : posix.dirname;
  2907. var basename = platformIsWin32 ? win32.basename : posix.basename;
  2908. var extname = platformIsWin32 ? win32.extname : posix.extname;
  2909. var sep = platformIsWin32 ? win32.sep : posix.sep;
  2910. // node_modules/monaco-editor/esm/vs/base/common/uri.js
  2911. var _schemePattern = /^\w[\w\d+.-]*$/;
  2912. var _singleSlashStart = /^\//;
  2913. var _doubleSlashStart = /^\/\//;
  2914. function _validateUri(ret, _strict) {
  2915. if (!ret.scheme && _strict) {
  2916. throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${ret.authority}", path: "${ret.path}", query: "${ret.query}", fragment: "${ret.fragment}"}`);
  2917. }
  2918. if (ret.scheme && !_schemePattern.test(ret.scheme)) {
  2919. throw new Error("[UriError]: Scheme contains illegal characters.");
  2920. }
  2921. if (ret.path) {
  2922. if (ret.authority) {
  2923. if (!_singleSlashStart.test(ret.path)) {
  2924. throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character');
  2925. }
  2926. } else {
  2927. if (_doubleSlashStart.test(ret.path)) {
  2928. throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")');
  2929. }
  2930. }
  2931. }
  2932. }
  2933. function _schemeFix(scheme, _strict) {
  2934. if (!scheme && !_strict) {
  2935. return "file";
  2936. }
  2937. return scheme;
  2938. }
  2939. function _referenceResolution(scheme, path) {
  2940. switch (scheme) {
  2941. case "https":
  2942. case "http":
  2943. case "file":
  2944. if (!path) {
  2945. path = _slash;
  2946. } else if (path[0] !== _slash) {
  2947. path = _slash + path;
  2948. }
  2949. break;
  2950. }
  2951. return path;
  2952. }
  2953. var _empty = "";
  2954. var _slash = "/";
  2955. var _regexp = /^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;
  2956. var URI = class _URI {
  2957. static isUri(thing) {
  2958. if (thing instanceof _URI) {
  2959. return true;
  2960. }
  2961. if (!thing) {
  2962. return false;
  2963. }
  2964. return typeof thing.authority === "string" && typeof thing.fragment === "string" && typeof thing.path === "string" && typeof thing.query === "string" && typeof thing.scheme === "string" && typeof thing.fsPath === "string" && typeof thing.with === "function" && typeof thing.toString === "function";
  2965. }
  2966. /**
  2967. * @internal
  2968. */
  2969. constructor(schemeOrData, authority, path, query, fragment, _strict = false) {
  2970. if (typeof schemeOrData === "object") {
  2971. this.scheme = schemeOrData.scheme || _empty;
  2972. this.authority = schemeOrData.authority || _empty;
  2973. this.path = schemeOrData.path || _empty;
  2974. this.query = schemeOrData.query || _empty;
  2975. this.fragment = schemeOrData.fragment || _empty;
  2976. } else {
  2977. this.scheme = _schemeFix(schemeOrData, _strict);
  2978. this.authority = authority || _empty;
  2979. this.path = _referenceResolution(this.scheme, path || _empty);
  2980. this.query = query || _empty;
  2981. this.fragment = fragment || _empty;
  2982. _validateUri(this, _strict);
  2983. }
  2984. }
  2985. // ---- filesystem path -----------------------
  2986. /**
  2987. * Returns a string representing the corresponding file system path of this URI.
  2988. * Will handle UNC paths, normalizes windows drive letters to lower-case, and uses the
  2989. * platform specific path separator.
  2990. *
  2991. * * Will *not* validate the path for invalid characters and semantics.
  2992. * * Will *not* look at the scheme of this URI.
  2993. * * The result shall *not* be used for display purposes but for accessing a file on disk.
  2994. *
  2995. *
  2996. * The *difference* to `URI#path` is the use of the platform specific separator and the handling
  2997. * of UNC paths. See the below sample of a file-uri with an authority (UNC path).
  2998. *
  2999. * ```ts
  3000. const u = URI.parse('file://server/c$/folder/file.txt')
  3001. u.authority === 'server'
  3002. u.path === '/shares/c$/file.txt'
  3003. u.fsPath === '\\server\c$\folder\file.txt'
  3004. ```
  3005. *
  3006. * Using `URI#path` to read a file (using fs-apis) would not be enough because parts of the path,
  3007. * namely the server name, would be missing. Therefore `URI#fsPath` exists - it's sugar to ease working
  3008. * with URIs that represent files on disk (`file` scheme).
  3009. */
  3010. get fsPath() {
  3011. return uriToFsPath(this, false);
  3012. }
  3013. // ---- modify to new -------------------------
  3014. with(change) {
  3015. if (!change) {
  3016. return this;
  3017. }
  3018. let { scheme, authority, path, query, fragment } = change;
  3019. if (scheme === void 0) {
  3020. scheme = this.scheme;
  3021. } else if (scheme === null) {
  3022. scheme = _empty;
  3023. }
  3024. if (authority === void 0) {
  3025. authority = this.authority;
  3026. } else if (authority === null) {
  3027. authority = _empty;
  3028. }
  3029. if (path === void 0) {
  3030. path = this.path;
  3031. } else if (path === null) {
  3032. path = _empty;
  3033. }
  3034. if (query === void 0) {
  3035. query = this.query;
  3036. } else if (query === null) {
  3037. query = _empty;
  3038. }
  3039. if (fragment === void 0) {
  3040. fragment = this.fragment;
  3041. } else if (fragment === null) {
  3042. fragment = _empty;
  3043. }
  3044. if (scheme === this.scheme && authority === this.authority && path === this.path && query === this.query && fragment === this.fragment) {
  3045. return this;
  3046. }
  3047. return new Uri(scheme, authority, path, query, fragment);
  3048. }
  3049. // ---- parse & validate ------------------------
  3050. /**
  3051. * Creates a new URI from a string, e.g. `http://www.example.com/some/path`,
  3052. * `file:///usr/home`, or `scheme:with/path`.
  3053. *
  3054. * @param value A string which represents an URI (see `URI#toString`).
  3055. */
  3056. static parse(value, _strict = false) {
  3057. const match = _regexp.exec(value);
  3058. if (!match) {
  3059. return new Uri(_empty, _empty, _empty, _empty, _empty);
  3060. }
  3061. return new Uri(match[2] || _empty, percentDecode(match[4] || _empty), percentDecode(match[5] || _empty), percentDecode(match[7] || _empty), percentDecode(match[9] || _empty), _strict);
  3062. }
  3063. /**
  3064. * Creates a new URI from a file system path, e.g. `c:\my\files`,
  3065. * `/usr/home`, or `\\server\share\some\path`.
  3066. *
  3067. * The *difference* between `URI#parse` and `URI#file` is that the latter treats the argument
  3068. * as path, not as stringified-uri. E.g. `URI.file(path)` is **not the same as**
  3069. * `URI.parse('file://' + path)` because the path might contain characters that are
  3070. * interpreted (# and ?). See the following sample:
  3071. * ```ts
  3072. const good = URI.file('/coding/c#/project1');
  3073. good.scheme === 'file';
  3074. good.path === '/coding/c#/project1';
  3075. good.fragment === '';
  3076. const bad = URI.parse('file://' + '/coding/c#/project1');
  3077. bad.scheme === 'file';
  3078. bad.path === '/coding/c'; // path is now broken
  3079. bad.fragment === '/project1';
  3080. ```
  3081. *
  3082. * @param path A file system path (see `URI#fsPath`)
  3083. */
  3084. static file(path) {
  3085. let authority = _empty;
  3086. if (isWindows) {
  3087. path = path.replace(/\\/g, _slash);
  3088. }
  3089. if (path[0] === _slash && path[1] === _slash) {
  3090. const idx = path.indexOf(_slash, 2);
  3091. if (idx === -1) {
  3092. authority = path.substring(2);
  3093. path = _slash;
  3094. } else {
  3095. authority = path.substring(2, idx);
  3096. path = path.substring(idx) || _slash;
  3097. }
  3098. }
  3099. return new Uri("file", authority, path, _empty, _empty);
  3100. }
  3101. /**
  3102. * Creates new URI from uri components.
  3103. *
  3104. * Unless `strict` is `true` the scheme is defaults to be `file`. This function performs
  3105. * validation and should be used for untrusted uri components retrieved from storage,
  3106. * user input, command arguments etc
  3107. */
  3108. static from(components, strict) {
  3109. const result = new Uri(components.scheme, components.authority, components.path, components.query, components.fragment, strict);
  3110. return result;
  3111. }
  3112. /**
  3113. * Join a URI path with path fragments and normalizes the resulting path.
  3114. *
  3115. * @param uri The input URI.
  3116. * @param pathFragment The path fragment to add to the URI path.
  3117. * @returns The resulting URI.
  3118. */
  3119. static joinPath(uri, ...pathFragment) {
  3120. if (!uri.path) {
  3121. throw new Error(`[UriError]: cannot call joinPath on URI without path`);
  3122. }
  3123. let newPath;
  3124. if (isWindows && uri.scheme === "file") {
  3125. newPath = _URI.file(win32.join(uriToFsPath(uri, true), ...pathFragment)).path;
  3126. } else {
  3127. newPath = posix.join(uri.path, ...pathFragment);
  3128. }
  3129. return uri.with({ path: newPath });
  3130. }
  3131. // ---- printing/externalize ---------------------------
  3132. /**
  3133. * Creates a string representation for this URI. It's guaranteed that calling
  3134. * `URI.parse` with the result of this function creates an URI which is equal
  3135. * to this URI.
  3136. *
  3137. * * The result shall *not* be used for display purposes but for externalization or transport.
  3138. * * The result will be encoded using the percentage encoding and encoding happens mostly
  3139. * ignore the scheme-specific encoding rules.
  3140. *
  3141. * @param skipEncoding Do not encode the result, default is `false`
  3142. */
  3143. toString(skipEncoding = false) {
  3144. return _asFormatted(this, skipEncoding);
  3145. }
  3146. toJSON() {
  3147. return this;
  3148. }
  3149. static revive(data) {
  3150. if (!data) {
  3151. return data;
  3152. } else if (data instanceof _URI) {
  3153. return data;
  3154. } else {
  3155. const result = new Uri(data);
  3156. result._formatted = data.external ?? null;
  3157. result._fsPath = data._sep === _pathSepMarker ? data.fsPath ?? null : null;
  3158. return result;
  3159. }
  3160. }
  3161. };
  3162. var _pathSepMarker = isWindows ? 1 : void 0;
  3163. var Uri = class extends URI {
  3164. constructor() {
  3165. super(...arguments);
  3166. this._formatted = null;
  3167. this._fsPath = null;
  3168. }
  3169. get fsPath() {
  3170. if (!this._fsPath) {
  3171. this._fsPath = uriToFsPath(this, false);
  3172. }
  3173. return this._fsPath;
  3174. }
  3175. toString(skipEncoding = false) {
  3176. if (!skipEncoding) {
  3177. if (!this._formatted) {
  3178. this._formatted = _asFormatted(this, false);
  3179. }
  3180. return this._formatted;
  3181. } else {
  3182. return _asFormatted(this, true);
  3183. }
  3184. }
  3185. toJSON() {
  3186. const res = {
  3187. $mid: 1
  3188. /* MarshalledId.Uri */
  3189. };
  3190. if (this._fsPath) {
  3191. res.fsPath = this._fsPath;
  3192. res._sep = _pathSepMarker;
  3193. }
  3194. if (this._formatted) {
  3195. res.external = this._formatted;
  3196. }
  3197. if (this.path) {
  3198. res.path = this.path;
  3199. }
  3200. if (this.scheme) {
  3201. res.scheme = this.scheme;
  3202. }
  3203. if (this.authority) {
  3204. res.authority = this.authority;
  3205. }
  3206. if (this.query) {
  3207. res.query = this.query;
  3208. }
  3209. if (this.fragment) {
  3210. res.fragment = this.fragment;
  3211. }
  3212. return res;
  3213. }
  3214. };
  3215. var encodeTable = {
  3216. [
  3217. 58
  3218. /* CharCode.Colon */
  3219. ]: "%3A",
  3220. // gen-delims
  3221. [
  3222. 47
  3223. /* CharCode.Slash */
  3224. ]: "%2F",
  3225. [
  3226. 63
  3227. /* CharCode.QuestionMark */
  3228. ]: "%3F",
  3229. [
  3230. 35
  3231. /* CharCode.Hash */
  3232. ]: "%23",
  3233. [
  3234. 91
  3235. /* CharCode.OpenSquareBracket */
  3236. ]: "%5B",
  3237. [
  3238. 93
  3239. /* CharCode.CloseSquareBracket */
  3240. ]: "%5D",
  3241. [
  3242. 64
  3243. /* CharCode.AtSign */
  3244. ]: "%40",
  3245. [
  3246. 33
  3247. /* CharCode.ExclamationMark */
  3248. ]: "%21",
  3249. // sub-delims
  3250. [
  3251. 36
  3252. /* CharCode.DollarSign */
  3253. ]: "%24",
  3254. [
  3255. 38
  3256. /* CharCode.Ampersand */
  3257. ]: "%26",
  3258. [
  3259. 39
  3260. /* CharCode.SingleQuote */
  3261. ]: "%27",
  3262. [
  3263. 40
  3264. /* CharCode.OpenParen */
  3265. ]: "%28",
  3266. [
  3267. 41
  3268. /* CharCode.CloseParen */
  3269. ]: "%29",
  3270. [
  3271. 42
  3272. /* CharCode.Asterisk */
  3273. ]: "%2A",
  3274. [
  3275. 43
  3276. /* CharCode.Plus */
  3277. ]: "%2B",
  3278. [
  3279. 44
  3280. /* CharCode.Comma */
  3281. ]: "%2C",
  3282. [
  3283. 59
  3284. /* CharCode.Semicolon */
  3285. ]: "%3B",
  3286. [
  3287. 61
  3288. /* CharCode.Equals */
  3289. ]: "%3D",
  3290. [
  3291. 32
  3292. /* CharCode.Space */
  3293. ]: "%20"
  3294. };
  3295. function encodeURIComponentFast(uriComponent, isPath, isAuthority) {
  3296. let res = void 0;
  3297. let nativeEncodePos = -1;
  3298. for (let pos = 0; pos < uriComponent.length; pos++) {
  3299. const code = uriComponent.charCodeAt(pos);
  3300. if (code >= 97 && code <= 122 || code >= 65 && code <= 90 || code >= 48 && code <= 57 || code === 45 || code === 46 || code === 95 || code === 126 || isPath && code === 47 || isAuthority && code === 91 || isAuthority && code === 93 || isAuthority && code === 58) {
  3301. if (nativeEncodePos !== -1) {
  3302. res += encodeURIComponent(uriComponent.substring(nativeEncodePos, pos));
  3303. nativeEncodePos = -1;
  3304. }
  3305. if (res !== void 0) {
  3306. res += uriComponent.charAt(pos);
  3307. }
  3308. } else {
  3309. if (res === void 0) {
  3310. res = uriComponent.substr(0, pos);
  3311. }
  3312. const escaped = encodeTable[code];
  3313. if (escaped !== void 0) {
  3314. if (nativeEncodePos !== -1) {
  3315. res += encodeURIComponent(uriComponent.substring(nativeEncodePos, pos));
  3316. nativeEncodePos = -1;
  3317. }
  3318. res += escaped;
  3319. } else if (nativeEncodePos === -1) {
  3320. nativeEncodePos = pos;
  3321. }
  3322. }
  3323. }
  3324. if (nativeEncodePos !== -1) {
  3325. res += encodeURIComponent(uriComponent.substring(nativeEncodePos));
  3326. }
  3327. return res !== void 0 ? res : uriComponent;
  3328. }
  3329. function encodeURIComponentMinimal(path) {
  3330. let res = void 0;
  3331. for (let pos = 0; pos < path.length; pos++) {
  3332. const code = path.charCodeAt(pos);
  3333. if (code === 35 || code === 63) {
  3334. if (res === void 0) {
  3335. res = path.substr(0, pos);
  3336. }
  3337. res += encodeTable[code];
  3338. } else {
  3339. if (res !== void 0) {
  3340. res += path[pos];
  3341. }
  3342. }
  3343. }
  3344. return res !== void 0 ? res : path;
  3345. }
  3346. function uriToFsPath(uri, keepDriveLetterCasing) {
  3347. let value;
  3348. if (uri.authority && uri.path.length > 1 && uri.scheme === "file") {
  3349. value = `//${uri.authority}${uri.path}`;
  3350. } else if (uri.path.charCodeAt(0) === 47 && (uri.path.charCodeAt(1) >= 65 && uri.path.charCodeAt(1) <= 90 || uri.path.charCodeAt(1) >= 97 && uri.path.charCodeAt(1) <= 122) && uri.path.charCodeAt(2) === 58) {
  3351. if (!keepDriveLetterCasing) {
  3352. value = uri.path[1].toLowerCase() + uri.path.substr(2);
  3353. } else {
  3354. value = uri.path.substr(1);
  3355. }
  3356. } else {
  3357. value = uri.path;
  3358. }
  3359. if (isWindows) {
  3360. value = value.replace(/\//g, "\\");
  3361. }
  3362. return value;
  3363. }
  3364. function _asFormatted(uri, skipEncoding) {
  3365. const encoder = !skipEncoding ? encodeURIComponentFast : encodeURIComponentMinimal;
  3366. let res = "";
  3367. let { scheme, authority, path, query, fragment } = uri;
  3368. if (scheme) {
  3369. res += scheme;
  3370. res += ":";
  3371. }
  3372. if (authority || scheme === "file") {
  3373. res += _slash;
  3374. res += _slash;
  3375. }
  3376. if (authority) {
  3377. let idx = authority.indexOf("@");
  3378. if (idx !== -1) {
  3379. const userinfo = authority.substr(0, idx);
  3380. authority = authority.substr(idx + 1);
  3381. idx = userinfo.lastIndexOf(":");
  3382. if (idx === -1) {
  3383. res += encoder(userinfo, false, false);
  3384. } else {
  3385. res += encoder(userinfo.substr(0, idx), false, false);
  3386. res += ":";
  3387. res += encoder(userinfo.substr(idx + 1), false, true);
  3388. }
  3389. res += "@";
  3390. }
  3391. authority = authority.toLowerCase();
  3392. idx = authority.lastIndexOf(":");
  3393. if (idx === -1) {
  3394. res += encoder(authority, false, true);
  3395. } else {
  3396. res += encoder(authority.substr(0, idx), false, true);
  3397. res += authority.substr(idx);
  3398. }
  3399. }
  3400. if (path) {
  3401. if (path.length >= 3 && path.charCodeAt(0) === 47 && path.charCodeAt(2) === 58) {
  3402. const code = path.charCodeAt(1);
  3403. if (code >= 65 && code <= 90) {
  3404. path = `/${String.fromCharCode(code + 32)}:${path.substr(3)}`;
  3405. }
  3406. } else if (path.length >= 2 && path.charCodeAt(1) === 58) {
  3407. const code = path.charCodeAt(0);
  3408. if (code >= 65 && code <= 90) {
  3409. path = `${String.fromCharCode(code + 32)}:${path.substr(2)}`;
  3410. }
  3411. }
  3412. res += encoder(path, true, false);
  3413. }
  3414. if (query) {
  3415. res += "?";
  3416. res += encoder(query, false, false);
  3417. }
  3418. if (fragment) {
  3419. res += "#";
  3420. res += !skipEncoding ? encodeURIComponentFast(fragment, false, false) : fragment;
  3421. }
  3422. return res;
  3423. }
  3424. function decodeURIComponentGraceful(str) {
  3425. try {
  3426. return decodeURIComponent(str);
  3427. } catch {
  3428. if (str.length > 3) {
  3429. return str.substr(0, 3) + decodeURIComponentGraceful(str.substr(3));
  3430. } else {
  3431. return str;
  3432. }
  3433. }
  3434. }
  3435. var _rEncodedAsHex = /(%[0-9A-Za-z][0-9A-Za-z])+/g;
  3436. function percentDecode(str) {
  3437. if (!str.match(_rEncodedAsHex)) {
  3438. return str;
  3439. }
  3440. return str.replace(_rEncodedAsHex, (match) => decodeURIComponentGraceful(match));
  3441. }
  3442. // node_modules/monaco-editor/esm/vs/base/common/network.js
  3443. var Schemas;
  3444. (function(Schemas2) {
  3445. Schemas2.inMemory = "inmemory";
  3446. Schemas2.vscode = "vscode";
  3447. Schemas2.internal = "private";
  3448. Schemas2.walkThrough = "walkThrough";
  3449. Schemas2.walkThroughSnippet = "walkThroughSnippet";
  3450. Schemas2.http = "http";
  3451. Schemas2.https = "https";
  3452. Schemas2.file = "file";
  3453. Schemas2.mailto = "mailto";
  3454. Schemas2.untitled = "untitled";
  3455. Schemas2.data = "data";
  3456. Schemas2.command = "command";
  3457. Schemas2.vscodeRemote = "vscode-remote";
  3458. Schemas2.vscodeRemoteResource = "vscode-remote-resource";
  3459. Schemas2.vscodeManagedRemoteResource = "vscode-managed-remote-resource";
  3460. Schemas2.vscodeUserData = "vscode-userdata";
  3461. Schemas2.vscodeCustomEditor = "vscode-custom-editor";
  3462. Schemas2.vscodeNotebookCell = "vscode-notebook-cell";
  3463. Schemas2.vscodeNotebookCellMetadata = "vscode-notebook-cell-metadata";
  3464. Schemas2.vscodeNotebookCellMetadataDiff = "vscode-notebook-cell-metadata-diff";
  3465. Schemas2.vscodeNotebookCellOutput = "vscode-notebook-cell-output";
  3466. Schemas2.vscodeNotebookCellOutputDiff = "vscode-notebook-cell-output-diff";
  3467. Schemas2.vscodeNotebookMetadata = "vscode-notebook-metadata";
  3468. Schemas2.vscodeInteractiveInput = "vscode-interactive-input";
  3469. Schemas2.vscodeSettings = "vscode-settings";
  3470. Schemas2.vscodeWorkspaceTrust = "vscode-workspace-trust";
  3471. Schemas2.vscodeTerminal = "vscode-terminal";
  3472. Schemas2.vscodeChatCodeBlock = "vscode-chat-code-block";
  3473. Schemas2.vscodeChatCodeCompareBlock = "vscode-chat-code-compare-block";
  3474. Schemas2.vscodeChatSesssion = "vscode-chat-editor";
  3475. Schemas2.webviewPanel = "webview-panel";
  3476. Schemas2.vscodeWebview = "vscode-webview";
  3477. Schemas2.extension = "extension";
  3478. Schemas2.vscodeFileResource = "vscode-file";
  3479. Schemas2.tmp = "tmp";
  3480. Schemas2.vsls = "vsls";
  3481. Schemas2.vscodeSourceControl = "vscode-scm";
  3482. Schemas2.commentsInput = "comment";
  3483. Schemas2.codeSetting = "code-setting";
  3484. Schemas2.outputChannel = "output";
  3485. })(Schemas || (Schemas = {}));
  3486. var connectionTokenQueryName = "tkn";
  3487. var RemoteAuthoritiesImpl = class {
  3488. constructor() {
  3489. this._hosts = /* @__PURE__ */ Object.create(null);
  3490. this._ports = /* @__PURE__ */ Object.create(null);
  3491. this._connectionTokens = /* @__PURE__ */ Object.create(null);
  3492. this._preferredWebSchema = "http";
  3493. this._delegate = null;
  3494. this._serverRootPath = "/";
  3495. }
  3496. setPreferredWebSchema(schema) {
  3497. this._preferredWebSchema = schema;
  3498. }
  3499. get _remoteResourcesPath() {
  3500. return posix.join(this._serverRootPath, Schemas.vscodeRemoteResource);
  3501. }
  3502. rewrite(uri) {
  3503. if (this._delegate) {
  3504. try {
  3505. return this._delegate(uri);
  3506. } catch (err) {
  3507. onUnexpectedError(err);
  3508. return uri;
  3509. }
  3510. }
  3511. const authority = uri.authority;
  3512. let host = this._hosts[authority];
  3513. if (host && host.indexOf(":") !== -1 && host.indexOf("[") === -1) {
  3514. host = `[${host}]`;
  3515. }
  3516. const port = this._ports[authority];
  3517. const connectionToken = this._connectionTokens[authority];
  3518. let query = `path=${encodeURIComponent(uri.path)}`;
  3519. if (typeof connectionToken === "string") {
  3520. query += `&${connectionTokenQueryName}=${encodeURIComponent(connectionToken)}`;
  3521. }
  3522. return URI.from({
  3523. scheme: isWeb ? this._preferredWebSchema : Schemas.vscodeRemoteResource,
  3524. authority: `${host}:${port}`,
  3525. path: this._remoteResourcesPath,
  3526. query
  3527. });
  3528. }
  3529. };
  3530. var RemoteAuthorities = new RemoteAuthoritiesImpl();
  3531. var VSCODE_AUTHORITY = "vscode-app";
  3532. var FileAccessImpl = class _FileAccessImpl {
  3533. static {
  3534. this.FALLBACK_AUTHORITY = VSCODE_AUTHORITY;
  3535. }
  3536. /**
  3537. * Returns a URI to use in contexts where the browser is responsible
  3538. * for loading (e.g. fetch()) or when used within the DOM.
  3539. *
  3540. * **Note:** use `dom.ts#asCSSUrl` whenever the URL is to be used in CSS context.
  3541. */
  3542. asBrowserUri(resourcePath) {
  3543. const uri = this.toUri(resourcePath);
  3544. return this.uriToBrowserUri(uri);
  3545. }
  3546. /**
  3547. * Returns a URI to use in contexts where the browser is responsible
  3548. * for loading (e.g. fetch()) or when used within the DOM.
  3549. *
  3550. * **Note:** use `dom.ts#asCSSUrl` whenever the URL is to be used in CSS context.
  3551. */
  3552. uriToBrowserUri(uri) {
  3553. if (uri.scheme === Schemas.vscodeRemote) {
  3554. return RemoteAuthorities.rewrite(uri);
  3555. }
  3556. if (
  3557. // ...only ever for `file` resources
  3558. uri.scheme === Schemas.file && // ...and we run in native environments
  3559. (isNative || // ...or web worker extensions on desktop
  3560. webWorkerOrigin === `${Schemas.vscodeFileResource}://${_FileAccessImpl.FALLBACK_AUTHORITY}`)
  3561. ) {
  3562. return uri.with({
  3563. scheme: Schemas.vscodeFileResource,
  3564. // We need to provide an authority here so that it can serve
  3565. // as origin for network and loading matters in chromium.
  3566. // If the URI is not coming with an authority already, we
  3567. // add our own
  3568. authority: uri.authority || _FileAccessImpl.FALLBACK_AUTHORITY,
  3569. query: null,
  3570. fragment: null
  3571. });
  3572. }
  3573. return uri;
  3574. }
  3575. toUri(uriOrModule, moduleIdToUrl) {
  3576. if (URI.isUri(uriOrModule)) {
  3577. return uriOrModule;
  3578. }
  3579. if (globalThis._VSCODE_FILE_ROOT) {
  3580. const rootUriOrPath = globalThis._VSCODE_FILE_ROOT;
  3581. if (/^\w[\w\d+.-]*:\/\//.test(rootUriOrPath)) {
  3582. return URI.joinPath(URI.parse(rootUriOrPath, true), uriOrModule);
  3583. }
  3584. const modulePath = join(rootUriOrPath, uriOrModule);
  3585. return URI.file(modulePath);
  3586. }
  3587. return URI.parse(moduleIdToUrl.toUrl(uriOrModule));
  3588. }
  3589. };
  3590. var FileAccess = new FileAccessImpl();
  3591. var COI;
  3592. (function(COI2) {
  3593. const coiHeaders = /* @__PURE__ */ new Map([
  3594. ["1", { "Cross-Origin-Opener-Policy": "same-origin" }],
  3595. ["2", { "Cross-Origin-Embedder-Policy": "require-corp" }],
  3596. ["3", { "Cross-Origin-Opener-Policy": "same-origin", "Cross-Origin-Embedder-Policy": "require-corp" }]
  3597. ]);
  3598. COI2.CoopAndCoep = Object.freeze(coiHeaders.get("3"));
  3599. const coiSearchParamName = "vscode-coi";
  3600. function getHeadersFromQuery(url) {
  3601. let params;
  3602. if (typeof url === "string") {
  3603. params = new URL(url).searchParams;
  3604. } else if (url instanceof URL) {
  3605. params = url.searchParams;
  3606. } else if (URI.isUri(url)) {
  3607. params = new URL(url.toString(true)).searchParams;
  3608. }
  3609. const value = params?.get(coiSearchParamName);
  3610. if (!value) {
  3611. return void 0;
  3612. }
  3613. return coiHeaders.get(value);
  3614. }
  3615. COI2.getHeadersFromQuery = getHeadersFromQuery;
  3616. function addSearchParam(urlOrSearch, coop, coep) {
  3617. if (!globalThis.crossOriginIsolated) {
  3618. return;
  3619. }
  3620. const value = coop && coep ? "3" : coep ? "2" : "1";
  3621. if (urlOrSearch instanceof URLSearchParams) {
  3622. urlOrSearch.set(coiSearchParamName, value);
  3623. } else {
  3624. urlOrSearch[coiSearchParamName] = value;
  3625. }
  3626. }
  3627. COI2.addSearchParam = addSearchParam;
  3628. })(COI || (COI = {}));
  3629. // node_modules/monaco-editor/esm/vs/base/common/worker/simpleWorker.js
  3630. var isESM = true;
  3631. var DEFAULT_CHANNEL = "default";
  3632. var INITIALIZE = "$initialize";
  3633. var RequestMessage = class {
  3634. constructor(vsWorker, req, channel, method, args) {
  3635. this.vsWorker = vsWorker;
  3636. this.req = req;
  3637. this.channel = channel;
  3638. this.method = method;
  3639. this.args = args;
  3640. this.type = 0;
  3641. }
  3642. };
  3643. var ReplyMessage = class {
  3644. constructor(vsWorker, seq, res, err) {
  3645. this.vsWorker = vsWorker;
  3646. this.seq = seq;
  3647. this.res = res;
  3648. this.err = err;
  3649. this.type = 1;
  3650. }
  3651. };
  3652. var SubscribeEventMessage = class {
  3653. constructor(vsWorker, req, channel, eventName, arg) {
  3654. this.vsWorker = vsWorker;
  3655. this.req = req;
  3656. this.channel = channel;
  3657. this.eventName = eventName;
  3658. this.arg = arg;
  3659. this.type = 2;
  3660. }
  3661. };
  3662. var EventMessage = class {
  3663. constructor(vsWorker, req, event) {
  3664. this.vsWorker = vsWorker;
  3665. this.req = req;
  3666. this.event = event;
  3667. this.type = 3;
  3668. }
  3669. };
  3670. var UnsubscribeEventMessage = class {
  3671. constructor(vsWorker, req) {
  3672. this.vsWorker = vsWorker;
  3673. this.req = req;
  3674. this.type = 4;
  3675. }
  3676. };
  3677. var SimpleWorkerProtocol = class {
  3678. constructor(handler) {
  3679. this._workerId = -1;
  3680. this._handler = handler;
  3681. this._lastSentReq = 0;
  3682. this._pendingReplies = /* @__PURE__ */ Object.create(null);
  3683. this._pendingEmitters = /* @__PURE__ */ new Map();
  3684. this._pendingEvents = /* @__PURE__ */ new Map();
  3685. }
  3686. setWorkerId(workerId) {
  3687. this._workerId = workerId;
  3688. }
  3689. sendMessage(channel, method, args) {
  3690. const req = String(++this._lastSentReq);
  3691. return new Promise((resolve2, reject) => {
  3692. this._pendingReplies[req] = {
  3693. resolve: resolve2,
  3694. reject
  3695. };
  3696. this._send(new RequestMessage(this._workerId, req, channel, method, args));
  3697. });
  3698. }
  3699. listen(channel, eventName, arg) {
  3700. let req = null;
  3701. const emitter = new Emitter({
  3702. onWillAddFirstListener: () => {
  3703. req = String(++this._lastSentReq);
  3704. this._pendingEmitters.set(req, emitter);
  3705. this._send(new SubscribeEventMessage(this._workerId, req, channel, eventName, arg));
  3706. },
  3707. onDidRemoveLastListener: () => {
  3708. this._pendingEmitters.delete(req);
  3709. this._send(new UnsubscribeEventMessage(this._workerId, req));
  3710. req = null;
  3711. }
  3712. });
  3713. return emitter.event;
  3714. }
  3715. handleMessage(message) {
  3716. if (!message || !message.vsWorker) {
  3717. return;
  3718. }
  3719. if (this._workerId !== -1 && message.vsWorker !== this._workerId) {
  3720. return;
  3721. }
  3722. this._handleMessage(message);
  3723. }
  3724. createProxyToRemoteChannel(channel, sendMessageBarrier) {
  3725. const handler = {
  3726. get: (target, name) => {
  3727. if (typeof name === "string" && !target[name]) {
  3728. if (propertyIsDynamicEvent(name)) {
  3729. target[name] = (arg) => {
  3730. return this.listen(channel, name, arg);
  3731. };
  3732. } else if (propertyIsEvent(name)) {
  3733. target[name] = this.listen(channel, name, void 0);
  3734. } else if (name.charCodeAt(0) === 36) {
  3735. target[name] = async (...myArgs) => {
  3736. await sendMessageBarrier?.();
  3737. return this.sendMessage(channel, name, myArgs);
  3738. };
  3739. }
  3740. }
  3741. return target[name];
  3742. }
  3743. };
  3744. return new Proxy(/* @__PURE__ */ Object.create(null), handler);
  3745. }
  3746. _handleMessage(msg) {
  3747. switch (msg.type) {
  3748. case 1:
  3749. return this._handleReplyMessage(msg);
  3750. case 0:
  3751. return this._handleRequestMessage(msg);
  3752. case 2:
  3753. return this._handleSubscribeEventMessage(msg);
  3754. case 3:
  3755. return this._handleEventMessage(msg);
  3756. case 4:
  3757. return this._handleUnsubscribeEventMessage(msg);
  3758. }
  3759. }
  3760. _handleReplyMessage(replyMessage) {
  3761. if (!this._pendingReplies[replyMessage.seq]) {
  3762. console.warn("Got reply to unknown seq");
  3763. return;
  3764. }
  3765. const reply = this._pendingReplies[replyMessage.seq];
  3766. delete this._pendingReplies[replyMessage.seq];
  3767. if (replyMessage.err) {
  3768. let err = replyMessage.err;
  3769. if (replyMessage.err.$isError) {
  3770. err = new Error();
  3771. err.name = replyMessage.err.name;
  3772. err.message = replyMessage.err.message;
  3773. err.stack = replyMessage.err.stack;
  3774. }
  3775. reply.reject(err);
  3776. return;
  3777. }
  3778. reply.resolve(replyMessage.res);
  3779. }
  3780. _handleRequestMessage(requestMessage) {
  3781. const req = requestMessage.req;
  3782. const result = this._handler.handleMessage(requestMessage.channel, requestMessage.method, requestMessage.args);
  3783. result.then((r) => {
  3784. this._send(new ReplyMessage(this._workerId, req, r, void 0));
  3785. }, (e) => {
  3786. if (e.detail instanceof Error) {
  3787. e.detail = transformErrorForSerialization(e.detail);
  3788. }
  3789. this._send(new ReplyMessage(this._workerId, req, void 0, transformErrorForSerialization(e)));
  3790. });
  3791. }
  3792. _handleSubscribeEventMessage(msg) {
  3793. const req = msg.req;
  3794. const disposable = this._handler.handleEvent(msg.channel, msg.eventName, msg.arg)((event) => {
  3795. this._send(new EventMessage(this._workerId, req, event));
  3796. });
  3797. this._pendingEvents.set(req, disposable);
  3798. }
  3799. _handleEventMessage(msg) {
  3800. if (!this._pendingEmitters.has(msg.req)) {
  3801. console.warn("Got event for unknown req");
  3802. return;
  3803. }
  3804. this._pendingEmitters.get(msg.req).fire(msg.event);
  3805. }
  3806. _handleUnsubscribeEventMessage(msg) {
  3807. if (!this._pendingEvents.has(msg.req)) {
  3808. console.warn("Got unsubscribe for unknown req");
  3809. return;
  3810. }
  3811. this._pendingEvents.get(msg.req).dispose();
  3812. this._pendingEvents.delete(msg.req);
  3813. }
  3814. _send(msg) {
  3815. const transfer = [];
  3816. if (msg.type === 0) {
  3817. for (let i = 0; i < msg.args.length; i++) {
  3818. if (msg.args[i] instanceof ArrayBuffer) {
  3819. transfer.push(msg.args[i]);
  3820. }
  3821. }
  3822. } else if (msg.type === 1) {
  3823. if (msg.res instanceof ArrayBuffer) {
  3824. transfer.push(msg.res);
  3825. }
  3826. }
  3827. this._handler.sendMessage(msg, transfer);
  3828. }
  3829. };
  3830. function propertyIsEvent(name) {
  3831. return name[0] === "o" && name[1] === "n" && isUpperAsciiLetter(name.charCodeAt(2));
  3832. }
  3833. function propertyIsDynamicEvent(name) {
  3834. return /^onDynamic/.test(name) && isUpperAsciiLetter(name.charCodeAt(9));
  3835. }
  3836. var SimpleWorkerServer = class {
  3837. constructor(postMessage, requestHandlerFactory) {
  3838. this._localChannels = /* @__PURE__ */ new Map();
  3839. this._remoteChannels = /* @__PURE__ */ new Map();
  3840. this._requestHandlerFactory = requestHandlerFactory;
  3841. this._requestHandler = null;
  3842. this._protocol = new SimpleWorkerProtocol({
  3843. sendMessage: (msg, transfer) => {
  3844. postMessage(msg, transfer);
  3845. },
  3846. handleMessage: (channel, method, args) => this._handleMessage(channel, method, args),
  3847. handleEvent: (channel, eventName, arg) => this._handleEvent(channel, eventName, arg)
  3848. });
  3849. }
  3850. onmessage(msg) {
  3851. this._protocol.handleMessage(msg);
  3852. }
  3853. _handleMessage(channel, method, args) {
  3854. if (channel === DEFAULT_CHANNEL && method === INITIALIZE) {
  3855. return this.initialize(args[0], args[1], args[2]);
  3856. }
  3857. const requestHandler = channel === DEFAULT_CHANNEL ? this._requestHandler : this._localChannels.get(channel);
  3858. if (!requestHandler) {
  3859. return Promise.reject(new Error(`Missing channel ${channel} on worker thread`));
  3860. }
  3861. if (typeof requestHandler[method] !== "function") {
  3862. return Promise.reject(new Error(`Missing method ${method} on worker thread channel ${channel}`));
  3863. }
  3864. try {
  3865. return Promise.resolve(requestHandler[method].apply(requestHandler, args));
  3866. } catch (e) {
  3867. return Promise.reject(e);
  3868. }
  3869. }
  3870. _handleEvent(channel, eventName, arg) {
  3871. const requestHandler = channel === DEFAULT_CHANNEL ? this._requestHandler : this._localChannels.get(channel);
  3872. if (!requestHandler) {
  3873. throw new Error(`Missing channel ${channel} on worker thread`);
  3874. }
  3875. if (propertyIsDynamicEvent(eventName)) {
  3876. const event = requestHandler[eventName].call(requestHandler, arg);
  3877. if (typeof event !== "function") {
  3878. throw new Error(`Missing dynamic event ${eventName} on request handler.`);
  3879. }
  3880. return event;
  3881. }
  3882. if (propertyIsEvent(eventName)) {
  3883. const event = requestHandler[eventName];
  3884. if (typeof event !== "function") {
  3885. throw new Error(`Missing event ${eventName} on request handler.`);
  3886. }
  3887. return event;
  3888. }
  3889. throw new Error(`Malformed event name ${eventName}`);
  3890. }
  3891. getChannel(channel) {
  3892. if (!this._remoteChannels.has(channel)) {
  3893. const inst = this._protocol.createProxyToRemoteChannel(channel);
  3894. this._remoteChannels.set(channel, inst);
  3895. }
  3896. return this._remoteChannels.get(channel);
  3897. }
  3898. async initialize(workerId, loaderConfig, moduleId) {
  3899. this._protocol.setWorkerId(workerId);
  3900. if (this._requestHandlerFactory) {
  3901. this._requestHandler = this._requestHandlerFactory(this);
  3902. return;
  3903. }
  3904. if (loaderConfig) {
  3905. if (typeof loaderConfig.baseUrl !== "undefined") {
  3906. delete loaderConfig["baseUrl"];
  3907. }
  3908. if (typeof loaderConfig.paths !== "undefined") {
  3909. if (typeof loaderConfig.paths.vs !== "undefined") {
  3910. delete loaderConfig.paths["vs"];
  3911. }
  3912. }
  3913. if (typeof loaderConfig.trustedTypesPolicy !== "undefined") {
  3914. delete loaderConfig["trustedTypesPolicy"];
  3915. }
  3916. loaderConfig.catchError = true;
  3917. globalThis.require.config(loaderConfig);
  3918. }
  3919. if (isESM) {
  3920. const url = FileAccess.asBrowserUri(`${moduleId}.js`).toString(true);
  3921. return import(`${url}`).then((module) => {
  3922. this._requestHandler = module.create(this);
  3923. if (!this._requestHandler) {
  3924. throw new Error(`No RequestHandler!`);
  3925. }
  3926. });
  3927. }
  3928. return new Promise((resolve2, reject) => {
  3929. const req = globalThis.require;
  3930. req([moduleId], (module) => {
  3931. this._requestHandler = module.create(this);
  3932. if (!this._requestHandler) {
  3933. reject(new Error(`No RequestHandler!`));
  3934. return;
  3935. }
  3936. resolve2();
  3937. }, reject);
  3938. });
  3939. }
  3940. };
  3941. // node_modules/monaco-editor/esm/vs/base/common/diff/diffChange.js
  3942. var DiffChange = class {
  3943. /**
  3944. * Constructs a new DiffChange with the given sequence information
  3945. * and content.
  3946. */
  3947. constructor(originalStart, originalLength, modifiedStart, modifiedLength) {
  3948. this.originalStart = originalStart;
  3949. this.originalLength = originalLength;
  3950. this.modifiedStart = modifiedStart;
  3951. this.modifiedLength = modifiedLength;
  3952. }
  3953. /**
  3954. * The end point (exclusive) of the change in the original sequence.
  3955. */
  3956. getOriginalEnd() {
  3957. return this.originalStart + this.originalLength;
  3958. }
  3959. /**
  3960. * The end point (exclusive) of the change in the modified sequence.
  3961. */
  3962. getModifiedEnd() {
  3963. return this.modifiedStart + this.modifiedLength;
  3964. }
  3965. };
  3966. // node_modules/monaco-editor/esm/vs/base/common/hash.js
  3967. function numberHash(val, initialHashVal) {
  3968. return (initialHashVal << 5) - initialHashVal + val | 0;
  3969. }
  3970. function stringHash(s, hashVal) {
  3971. hashVal = numberHash(149417, hashVal);
  3972. for (let i = 0, length = s.length; i < length; i++) {
  3973. hashVal = numberHash(s.charCodeAt(i), hashVal);
  3974. }
  3975. return hashVal;
  3976. }
  3977. function leftRotate(value, bits, totalBits = 32) {
  3978. const delta = totalBits - bits;
  3979. const mask = ~((1 << delta) - 1);
  3980. return (value << bits | (mask & value) >>> delta) >>> 0;
  3981. }
  3982. function fill(dest, index = 0, count = dest.byteLength, value = 0) {
  3983. for (let i = 0; i < count; i++) {
  3984. dest[index + i] = value;
  3985. }
  3986. }
  3987. function leftPad(value, length, char = "0") {
  3988. while (value.length < length) {
  3989. value = char + value;
  3990. }
  3991. return value;
  3992. }
  3993. function toHexString(bufferOrValue, bitsize = 32) {
  3994. if (bufferOrValue instanceof ArrayBuffer) {
  3995. return Array.from(new Uint8Array(bufferOrValue)).map((b) => b.toString(16).padStart(2, "0")).join("");
  3996. }
  3997. return leftPad((bufferOrValue >>> 0).toString(16), bitsize / 4);
  3998. }
  3999. var StringSHA1 = class _StringSHA1 {
  4000. static {
  4001. this._bigBlock32 = new DataView(new ArrayBuffer(320));
  4002. }
  4003. // 80 * 4 = 320
  4004. constructor() {
  4005. this._h0 = 1732584193;
  4006. this._h1 = 4023233417;
  4007. this._h2 = 2562383102;
  4008. this._h3 = 271733878;
  4009. this._h4 = 3285377520;
  4010. this._buff = new Uint8Array(
  4011. 64 + 3
  4012. /* to fit any utf-8 */
  4013. );
  4014. this._buffDV = new DataView(this._buff.buffer);
  4015. this._buffLen = 0;
  4016. this._totalLen = 0;
  4017. this._leftoverHighSurrogate = 0;
  4018. this._finished = false;
  4019. }
  4020. update(str) {
  4021. const strLen = str.length;
  4022. if (strLen === 0) {
  4023. return;
  4024. }
  4025. const buff = this._buff;
  4026. let buffLen = this._buffLen;
  4027. let leftoverHighSurrogate = this._leftoverHighSurrogate;
  4028. let charCode;
  4029. let offset;
  4030. if (leftoverHighSurrogate !== 0) {
  4031. charCode = leftoverHighSurrogate;
  4032. offset = -1;
  4033. leftoverHighSurrogate = 0;
  4034. } else {
  4035. charCode = str.charCodeAt(0);
  4036. offset = 0;
  4037. }
  4038. while (true) {
  4039. let codePoint = charCode;
  4040. if (isHighSurrogate(charCode)) {
  4041. if (offset + 1 < strLen) {
  4042. const nextCharCode = str.charCodeAt(offset + 1);
  4043. if (isLowSurrogate(nextCharCode)) {
  4044. offset++;
  4045. codePoint = computeCodePoint(charCode, nextCharCode);
  4046. } else {
  4047. codePoint = 65533;
  4048. }
  4049. } else {
  4050. leftoverHighSurrogate = charCode;
  4051. break;
  4052. }
  4053. } else if (isLowSurrogate(charCode)) {
  4054. codePoint = 65533;
  4055. }
  4056. buffLen = this._push(buff, buffLen, codePoint);
  4057. offset++;
  4058. if (offset < strLen) {
  4059. charCode = str.charCodeAt(offset);
  4060. } else {
  4061. break;
  4062. }
  4063. }
  4064. this._buffLen = buffLen;
  4065. this._leftoverHighSurrogate = leftoverHighSurrogate;
  4066. }
  4067. _push(buff, buffLen, codePoint) {
  4068. if (codePoint < 128) {
  4069. buff[buffLen++] = codePoint;
  4070. } else if (codePoint < 2048) {
  4071. buff[buffLen++] = 192 | (codePoint & 1984) >>> 6;
  4072. buff[buffLen++] = 128 | (codePoint & 63) >>> 0;
  4073. } else if (codePoint < 65536) {
  4074. buff[buffLen++] = 224 | (codePoint & 61440) >>> 12;
  4075. buff[buffLen++] = 128 | (codePoint & 4032) >>> 6;
  4076. buff[buffLen++] = 128 | (codePoint & 63) >>> 0;
  4077. } else {
  4078. buff[buffLen++] = 240 | (codePoint & 1835008) >>> 18;
  4079. buff[buffLen++] = 128 | (codePoint & 258048) >>> 12;
  4080. buff[buffLen++] = 128 | (codePoint & 4032) >>> 6;
  4081. buff[buffLen++] = 128 | (codePoint & 63) >>> 0;
  4082. }
  4083. if (buffLen >= 64) {
  4084. this._step();
  4085. buffLen -= 64;
  4086. this._totalLen += 64;
  4087. buff[0] = buff[64 + 0];
  4088. buff[1] = buff[64 + 1];
  4089. buff[2] = buff[64 + 2];
  4090. }
  4091. return buffLen;
  4092. }
  4093. digest() {
  4094. if (!this._finished) {
  4095. this._finished = true;
  4096. if (this._leftoverHighSurrogate) {
  4097. this._leftoverHighSurrogate = 0;
  4098. this._buffLen = this._push(
  4099. this._buff,
  4100. this._buffLen,
  4101. 65533
  4102. /* SHA1Constant.UNICODE_REPLACEMENT */
  4103. );
  4104. }
  4105. this._totalLen += this._buffLen;
  4106. this._wrapUp();
  4107. }
  4108. return toHexString(this._h0) + toHexString(this._h1) + toHexString(this._h2) + toHexString(this._h3) + toHexString(this._h4);
  4109. }
  4110. _wrapUp() {
  4111. this._buff[this._buffLen++] = 128;
  4112. fill(this._buff, this._buffLen);
  4113. if (this._buffLen > 56) {
  4114. this._step();
  4115. fill(this._buff);
  4116. }
  4117. const ml = 8 * this._totalLen;
  4118. this._buffDV.setUint32(56, Math.floor(ml / 4294967296), false);
  4119. this._buffDV.setUint32(60, ml % 4294967296, false);
  4120. this._step();
  4121. }
  4122. _step() {
  4123. const bigBlock32 = _StringSHA1._bigBlock32;
  4124. const data = this._buffDV;
  4125. for (let j = 0; j < 64; j += 4) {
  4126. bigBlock32.setUint32(j, data.getUint32(j, false), false);
  4127. }
  4128. for (let j = 64; j < 320; j += 4) {
  4129. bigBlock32.setUint32(j, leftRotate(bigBlock32.getUint32(j - 12, false) ^ bigBlock32.getUint32(j - 32, false) ^ bigBlock32.getUint32(j - 56, false) ^ bigBlock32.getUint32(j - 64, false), 1), false);
  4130. }
  4131. let a = this._h0;
  4132. let b = this._h1;
  4133. let c = this._h2;
  4134. let d = this._h3;
  4135. let e = this._h4;
  4136. let f, k;
  4137. let temp;
  4138. for (let j = 0; j < 80; j++) {
  4139. if (j < 20) {
  4140. f = b & c | ~b & d;
  4141. k = 1518500249;
  4142. } else if (j < 40) {
  4143. f = b ^ c ^ d;
  4144. k = 1859775393;
  4145. } else if (j < 60) {
  4146. f = b & c | b & d | c & d;
  4147. k = 2400959708;
  4148. } else {
  4149. f = b ^ c ^ d;
  4150. k = 3395469782;
  4151. }
  4152. temp = leftRotate(a, 5) + f + e + k + bigBlock32.getUint32(j * 4, false) & 4294967295;
  4153. e = d;
  4154. d = c;
  4155. c = leftRotate(b, 30);
  4156. b = a;
  4157. a = temp;
  4158. }
  4159. this._h0 = this._h0 + a & 4294967295;
  4160. this._h1 = this._h1 + b & 4294967295;
  4161. this._h2 = this._h2 + c & 4294967295;
  4162. this._h3 = this._h3 + d & 4294967295;
  4163. this._h4 = this._h4 + e & 4294967295;
  4164. }
  4165. };
  4166. // node_modules/monaco-editor/esm/vs/base/common/diff/diff.js
  4167. var StringDiffSequence = class {
  4168. constructor(source) {
  4169. this.source = source;
  4170. }
  4171. getElements() {
  4172. const source = this.source;
  4173. const characters = new Int32Array(source.length);
  4174. for (let i = 0, len = source.length; i < len; i++) {
  4175. characters[i] = source.charCodeAt(i);
  4176. }
  4177. return characters;
  4178. }
  4179. };
  4180. function stringDiff(original, modified, pretty) {
  4181. return new LcsDiff(new StringDiffSequence(original), new StringDiffSequence(modified)).ComputeDiff(pretty).changes;
  4182. }
  4183. var Debug = class {
  4184. static Assert(condition, message) {
  4185. if (!condition) {
  4186. throw new Error(message);
  4187. }
  4188. }
  4189. };
  4190. var MyArray = class {
  4191. /**
  4192. * Copies a range of elements from an Array starting at the specified source index and pastes
  4193. * them to another Array starting at the specified destination index. The length and the indexes
  4194. * are specified as 64-bit integers.
  4195. * sourceArray:
  4196. * The Array that contains the data to copy.
  4197. * sourceIndex:
  4198. * A 64-bit integer that represents the index in the sourceArray at which copying begins.
  4199. * destinationArray:
  4200. * The Array that receives the data.
  4201. * destinationIndex:
  4202. * A 64-bit integer that represents the index in the destinationArray at which storing begins.
  4203. * length:
  4204. * A 64-bit integer that represents the number of elements to copy.
  4205. */
  4206. static Copy(sourceArray, sourceIndex, destinationArray, destinationIndex, length) {
  4207. for (let i = 0; i < length; i++) {
  4208. destinationArray[destinationIndex + i] = sourceArray[sourceIndex + i];
  4209. }
  4210. }
  4211. static Copy2(sourceArray, sourceIndex, destinationArray, destinationIndex, length) {
  4212. for (let i = 0; i < length; i++) {
  4213. destinationArray[destinationIndex + i] = sourceArray[sourceIndex + i];
  4214. }
  4215. }
  4216. };
  4217. var DiffChangeHelper = class {
  4218. /**
  4219. * Constructs a new DiffChangeHelper for the given DiffSequences.
  4220. */
  4221. constructor() {
  4222. this.m_changes = [];
  4223. this.m_originalStart = 1073741824;
  4224. this.m_modifiedStart = 1073741824;
  4225. this.m_originalCount = 0;
  4226. this.m_modifiedCount = 0;
  4227. }
  4228. /**
  4229. * Marks the beginning of the next change in the set of differences.
  4230. */
  4231. MarkNextChange() {
  4232. if (this.m_originalCount > 0 || this.m_modifiedCount > 0) {
  4233. this.m_changes.push(new DiffChange(this.m_originalStart, this.m_originalCount, this.m_modifiedStart, this.m_modifiedCount));
  4234. }
  4235. this.m_originalCount = 0;
  4236. this.m_modifiedCount = 0;
  4237. this.m_originalStart = 1073741824;
  4238. this.m_modifiedStart = 1073741824;
  4239. }
  4240. /**
  4241. * Adds the original element at the given position to the elements
  4242. * affected by the current change. The modified index gives context
  4243. * to the change position with respect to the original sequence.
  4244. * @param originalIndex The index of the original element to add.
  4245. * @param modifiedIndex The index of the modified element that provides corresponding position in the modified sequence.
  4246. */
  4247. AddOriginalElement(originalIndex, modifiedIndex) {
  4248. this.m_originalStart = Math.min(this.m_originalStart, originalIndex);
  4249. this.m_modifiedStart = Math.min(this.m_modifiedStart, modifiedIndex);
  4250. this.m_originalCount++;
  4251. }
  4252. /**
  4253. * Adds the modified element at the given position to the elements
  4254. * affected by the current change. The original index gives context
  4255. * to the change position with respect to the modified sequence.
  4256. * @param originalIndex The index of the original element that provides corresponding position in the original sequence.
  4257. * @param modifiedIndex The index of the modified element to add.
  4258. */
  4259. AddModifiedElement(originalIndex, modifiedIndex) {
  4260. this.m_originalStart = Math.min(this.m_originalStart, originalIndex);
  4261. this.m_modifiedStart = Math.min(this.m_modifiedStart, modifiedIndex);
  4262. this.m_modifiedCount++;
  4263. }
  4264. /**
  4265. * Retrieves all of the changes marked by the class.
  4266. */
  4267. getChanges() {
  4268. if (this.m_originalCount > 0 || this.m_modifiedCount > 0) {
  4269. this.MarkNextChange();
  4270. }
  4271. return this.m_changes;
  4272. }
  4273. /**
  4274. * Retrieves all of the changes marked by the class in the reverse order
  4275. */
  4276. getReverseChanges() {
  4277. if (this.m_originalCount > 0 || this.m_modifiedCount > 0) {
  4278. this.MarkNextChange();
  4279. }
  4280. this.m_changes.reverse();
  4281. return this.m_changes;
  4282. }
  4283. };
  4284. var LcsDiff = class _LcsDiff {
  4285. /**
  4286. * Constructs the DiffFinder
  4287. */
  4288. constructor(originalSequence, modifiedSequence, continueProcessingPredicate = null) {
  4289. this.ContinueProcessingPredicate = continueProcessingPredicate;
  4290. this._originalSequence = originalSequence;
  4291. this._modifiedSequence = modifiedSequence;
  4292. const [originalStringElements, originalElementsOrHash, originalHasStrings] = _LcsDiff._getElements(originalSequence);
  4293. const [modifiedStringElements, modifiedElementsOrHash, modifiedHasStrings] = _LcsDiff._getElements(modifiedSequence);
  4294. this._hasStrings = originalHasStrings && modifiedHasStrings;
  4295. this._originalStringElements = originalStringElements;
  4296. this._originalElementsOrHash = originalElementsOrHash;
  4297. this._modifiedStringElements = modifiedStringElements;
  4298. this._modifiedElementsOrHash = modifiedElementsOrHash;
  4299. this.m_forwardHistory = [];
  4300. this.m_reverseHistory = [];
  4301. }
  4302. static _isStringArray(arr) {
  4303. return arr.length > 0 && typeof arr[0] === "string";
  4304. }
  4305. static _getElements(sequence) {
  4306. const elements = sequence.getElements();
  4307. if (_LcsDiff._isStringArray(elements)) {
  4308. const hashes = new Int32Array(elements.length);
  4309. for (let i = 0, len = elements.length; i < len; i++) {
  4310. hashes[i] = stringHash(elements[i], 0);
  4311. }
  4312. return [elements, hashes, true];
  4313. }
  4314. if (elements instanceof Int32Array) {
  4315. return [[], elements, false];
  4316. }
  4317. return [[], new Int32Array(elements), false];
  4318. }
  4319. ElementsAreEqual(originalIndex, newIndex) {
  4320. if (this._originalElementsOrHash[originalIndex] !== this._modifiedElementsOrHash[newIndex]) {
  4321. return false;
  4322. }
  4323. return this._hasStrings ? this._originalStringElements[originalIndex] === this._modifiedStringElements[newIndex] : true;
  4324. }
  4325. ElementsAreStrictEqual(originalIndex, newIndex) {
  4326. if (!this.ElementsAreEqual(originalIndex, newIndex)) {
  4327. return false;
  4328. }
  4329. const originalElement = _LcsDiff._getStrictElement(this._originalSequence, originalIndex);
  4330. const modifiedElement = _LcsDiff._getStrictElement(this._modifiedSequence, newIndex);
  4331. return originalElement === modifiedElement;
  4332. }
  4333. static _getStrictElement(sequence, index) {
  4334. if (typeof sequence.getStrictElement === "function") {
  4335. return sequence.getStrictElement(index);
  4336. }
  4337. return null;
  4338. }
  4339. OriginalElementsAreEqual(index1, index2) {
  4340. if (this._originalElementsOrHash[index1] !== this._originalElementsOrHash[index2]) {
  4341. return false;
  4342. }
  4343. return this._hasStrings ? this._originalStringElements[index1] === this._originalStringElements[index2] : true;
  4344. }
  4345. ModifiedElementsAreEqual(index1, index2) {
  4346. if (this._modifiedElementsOrHash[index1] !== this._modifiedElementsOrHash[index2]) {
  4347. return false;
  4348. }
  4349. return this._hasStrings ? this._modifiedStringElements[index1] === this._modifiedStringElements[index2] : true;
  4350. }
  4351. ComputeDiff(pretty) {
  4352. return this._ComputeDiff(0, this._originalElementsOrHash.length - 1, 0, this._modifiedElementsOrHash.length - 1, pretty);
  4353. }
  4354. /**
  4355. * Computes the differences between the original and modified input
  4356. * sequences on the bounded range.
  4357. * @returns An array of the differences between the two input sequences.
  4358. */
  4359. _ComputeDiff(originalStart, originalEnd, modifiedStart, modifiedEnd, pretty) {
  4360. const quitEarlyArr = [false];
  4361. let changes = this.ComputeDiffRecursive(originalStart, originalEnd, modifiedStart, modifiedEnd, quitEarlyArr);
  4362. if (pretty) {
  4363. changes = this.PrettifyChanges(changes);
  4364. }
  4365. return {
  4366. quitEarly: quitEarlyArr[0],
  4367. changes
  4368. };
  4369. }
  4370. /**
  4371. * Private helper method which computes the differences on the bounded range
  4372. * recursively.
  4373. * @returns An array of the differences between the two input sequences.
  4374. */
  4375. ComputeDiffRecursive(originalStart, originalEnd, modifiedStart, modifiedEnd, quitEarlyArr) {
  4376. quitEarlyArr[0] = false;
  4377. while (originalStart <= originalEnd && modifiedStart <= modifiedEnd && this.ElementsAreEqual(originalStart, modifiedStart)) {
  4378. originalStart++;
  4379. modifiedStart++;
  4380. }
  4381. while (originalEnd >= originalStart && modifiedEnd >= modifiedStart && this.ElementsAreEqual(originalEnd, modifiedEnd)) {
  4382. originalEnd--;
  4383. modifiedEnd--;
  4384. }
  4385. if (originalStart > originalEnd || modifiedStart > modifiedEnd) {
  4386. let changes;
  4387. if (modifiedStart <= modifiedEnd) {
  4388. Debug.Assert(originalStart === originalEnd + 1, "originalStart should only be one more than originalEnd");
  4389. changes = [
  4390. new DiffChange(originalStart, 0, modifiedStart, modifiedEnd - modifiedStart + 1)
  4391. ];
  4392. } else if (originalStart <= originalEnd) {
  4393. Debug.Assert(modifiedStart === modifiedEnd + 1, "modifiedStart should only be one more than modifiedEnd");
  4394. changes = [
  4395. new DiffChange(originalStart, originalEnd - originalStart + 1, modifiedStart, 0)
  4396. ];
  4397. } else {
  4398. Debug.Assert(originalStart === originalEnd + 1, "originalStart should only be one more than originalEnd");
  4399. Debug.Assert(modifiedStart === modifiedEnd + 1, "modifiedStart should only be one more than modifiedEnd");
  4400. changes = [];
  4401. }
  4402. return changes;
  4403. }
  4404. const midOriginalArr = [0];
  4405. const midModifiedArr = [0];
  4406. const result = this.ComputeRecursionPoint(originalStart, originalEnd, modifiedStart, modifiedEnd, midOriginalArr, midModifiedArr, quitEarlyArr);
  4407. const midOriginal = midOriginalArr[0];
  4408. const midModified = midModifiedArr[0];
  4409. if (result !== null) {
  4410. return result;
  4411. } else if (!quitEarlyArr[0]) {
  4412. const leftChanges = this.ComputeDiffRecursive(originalStart, midOriginal, modifiedStart, midModified, quitEarlyArr);
  4413. let rightChanges = [];
  4414. if (!quitEarlyArr[0]) {
  4415. rightChanges = this.ComputeDiffRecursive(midOriginal + 1, originalEnd, midModified + 1, modifiedEnd, quitEarlyArr);
  4416. } else {
  4417. rightChanges = [
  4418. new DiffChange(midOriginal + 1, originalEnd - (midOriginal + 1) + 1, midModified + 1, modifiedEnd - (midModified + 1) + 1)
  4419. ];
  4420. }
  4421. return this.ConcatenateChanges(leftChanges, rightChanges);
  4422. }
  4423. return [
  4424. new DiffChange(originalStart, originalEnd - originalStart + 1, modifiedStart, modifiedEnd - modifiedStart + 1)
  4425. ];
  4426. }
  4427. WALKTRACE(diagonalForwardBase, diagonalForwardStart, diagonalForwardEnd, diagonalForwardOffset, diagonalReverseBase, diagonalReverseStart, diagonalReverseEnd, diagonalReverseOffset, forwardPoints, reversePoints, originalIndex, originalEnd, midOriginalArr, modifiedIndex, modifiedEnd, midModifiedArr, deltaIsEven, quitEarlyArr) {
  4428. let forwardChanges = null;
  4429. let reverseChanges = null;
  4430. let changeHelper = new DiffChangeHelper();
  4431. let diagonalMin = diagonalForwardStart;
  4432. let diagonalMax = diagonalForwardEnd;
  4433. let diagonalRelative = midOriginalArr[0] - midModifiedArr[0] - diagonalForwardOffset;
  4434. let lastOriginalIndex = -1073741824;
  4435. let historyIndex = this.m_forwardHistory.length - 1;
  4436. do {
  4437. const diagonal = diagonalRelative + diagonalForwardBase;
  4438. if (diagonal === diagonalMin || diagonal < diagonalMax && forwardPoints[diagonal - 1] < forwardPoints[diagonal + 1]) {
  4439. originalIndex = forwardPoints[diagonal + 1];
  4440. modifiedIndex = originalIndex - diagonalRelative - diagonalForwardOffset;
  4441. if (originalIndex < lastOriginalIndex) {
  4442. changeHelper.MarkNextChange();
  4443. }
  4444. lastOriginalIndex = originalIndex;
  4445. changeHelper.AddModifiedElement(originalIndex + 1, modifiedIndex);
  4446. diagonalRelative = diagonal + 1 - diagonalForwardBase;
  4447. } else {
  4448. originalIndex = forwardPoints[diagonal - 1] + 1;
  4449. modifiedIndex = originalIndex - diagonalRelative - diagonalForwardOffset;
  4450. if (originalIndex < lastOriginalIndex) {
  4451. changeHelper.MarkNextChange();
  4452. }
  4453. lastOriginalIndex = originalIndex - 1;
  4454. changeHelper.AddOriginalElement(originalIndex, modifiedIndex + 1);
  4455. diagonalRelative = diagonal - 1 - diagonalForwardBase;
  4456. }
  4457. if (historyIndex >= 0) {
  4458. forwardPoints = this.m_forwardHistory[historyIndex];
  4459. diagonalForwardBase = forwardPoints[0];
  4460. diagonalMin = 1;
  4461. diagonalMax = forwardPoints.length - 1;
  4462. }
  4463. } while (--historyIndex >= -1);
  4464. forwardChanges = changeHelper.getReverseChanges();
  4465. if (quitEarlyArr[0]) {
  4466. let originalStartPoint = midOriginalArr[0] + 1;
  4467. let modifiedStartPoint = midModifiedArr[0] + 1;
  4468. if (forwardChanges !== null && forwardChanges.length > 0) {
  4469. const lastForwardChange = forwardChanges[forwardChanges.length - 1];
  4470. originalStartPoint = Math.max(originalStartPoint, lastForwardChange.getOriginalEnd());
  4471. modifiedStartPoint = Math.max(modifiedStartPoint, lastForwardChange.getModifiedEnd());
  4472. }
  4473. reverseChanges = [
  4474. new DiffChange(originalStartPoint, originalEnd - originalStartPoint + 1, modifiedStartPoint, modifiedEnd - modifiedStartPoint + 1)
  4475. ];
  4476. } else {
  4477. changeHelper = new DiffChangeHelper();
  4478. diagonalMin = diagonalReverseStart;
  4479. diagonalMax = diagonalReverseEnd;
  4480. diagonalRelative = midOriginalArr[0] - midModifiedArr[0] - diagonalReverseOffset;
  4481. lastOriginalIndex = 1073741824;
  4482. historyIndex = deltaIsEven ? this.m_reverseHistory.length - 1 : this.m_reverseHistory.length - 2;
  4483. do {
  4484. const diagonal = diagonalRelative + diagonalReverseBase;
  4485. if (diagonal === diagonalMin || diagonal < diagonalMax && reversePoints[diagonal - 1] >= reversePoints[diagonal + 1]) {
  4486. originalIndex = reversePoints[diagonal + 1] - 1;
  4487. modifiedIndex = originalIndex - diagonalRelative - diagonalReverseOffset;
  4488. if (originalIndex > lastOriginalIndex) {
  4489. changeHelper.MarkNextChange();
  4490. }
  4491. lastOriginalIndex = originalIndex + 1;
  4492. changeHelper.AddOriginalElement(originalIndex + 1, modifiedIndex + 1);
  4493. diagonalRelative = diagonal + 1 - diagonalReverseBase;
  4494. } else {
  4495. originalIndex = reversePoints[diagonal - 1];
  4496. modifiedIndex = originalIndex - diagonalRelative - diagonalReverseOffset;
  4497. if (originalIndex > lastOriginalIndex) {
  4498. changeHelper.MarkNextChange();
  4499. }
  4500. lastOriginalIndex = originalIndex;
  4501. changeHelper.AddModifiedElement(originalIndex + 1, modifiedIndex + 1);
  4502. diagonalRelative = diagonal - 1 - diagonalReverseBase;
  4503. }
  4504. if (historyIndex >= 0) {
  4505. reversePoints = this.m_reverseHistory[historyIndex];
  4506. diagonalReverseBase = reversePoints[0];
  4507. diagonalMin = 1;
  4508. diagonalMax = reversePoints.length - 1;
  4509. }
  4510. } while (--historyIndex >= -1);
  4511. reverseChanges = changeHelper.getChanges();
  4512. }
  4513. return this.ConcatenateChanges(forwardChanges, reverseChanges);
  4514. }
  4515. /**
  4516. * Given the range to compute the diff on, this method finds the point:
  4517. * (midOriginal, midModified)
  4518. * that exists in the middle of the LCS of the two sequences and
  4519. * is the point at which the LCS problem may be broken down recursively.
  4520. * This method will try to keep the LCS trace in memory. If the LCS recursion
  4521. * point is calculated and the full trace is available in memory, then this method
  4522. * will return the change list.
  4523. * @param originalStart The start bound of the original sequence range
  4524. * @param originalEnd The end bound of the original sequence range
  4525. * @param modifiedStart The start bound of the modified sequence range
  4526. * @param modifiedEnd The end bound of the modified sequence range
  4527. * @param midOriginal The middle point of the original sequence range
  4528. * @param midModified The middle point of the modified sequence range
  4529. * @returns The diff changes, if available, otherwise null
  4530. */
  4531. ComputeRecursionPoint(originalStart, originalEnd, modifiedStart, modifiedEnd, midOriginalArr, midModifiedArr, quitEarlyArr) {
  4532. let originalIndex = 0, modifiedIndex = 0;
  4533. let diagonalForwardStart = 0, diagonalForwardEnd = 0;
  4534. let diagonalReverseStart = 0, diagonalReverseEnd = 0;
  4535. originalStart--;
  4536. modifiedStart--;
  4537. midOriginalArr[0] = 0;
  4538. midModifiedArr[0] = 0;
  4539. this.m_forwardHistory = [];
  4540. this.m_reverseHistory = [];
  4541. const maxDifferences = originalEnd - originalStart + (modifiedEnd - modifiedStart);
  4542. const numDiagonals = maxDifferences + 1;
  4543. const forwardPoints = new Int32Array(numDiagonals);
  4544. const reversePoints = new Int32Array(numDiagonals);
  4545. const diagonalForwardBase = modifiedEnd - modifiedStart;
  4546. const diagonalReverseBase = originalEnd - originalStart;
  4547. const diagonalForwardOffset = originalStart - modifiedStart;
  4548. const diagonalReverseOffset = originalEnd - modifiedEnd;
  4549. const delta = diagonalReverseBase - diagonalForwardBase;
  4550. const deltaIsEven = delta % 2 === 0;
  4551. forwardPoints[diagonalForwardBase] = originalStart;
  4552. reversePoints[diagonalReverseBase] = originalEnd;
  4553. quitEarlyArr[0] = false;
  4554. for (let numDifferences = 1; numDifferences <= maxDifferences / 2 + 1; numDifferences++) {
  4555. let furthestOriginalIndex = 0;
  4556. let furthestModifiedIndex = 0;
  4557. diagonalForwardStart = this.ClipDiagonalBound(diagonalForwardBase - numDifferences, numDifferences, diagonalForwardBase, numDiagonals);
  4558. diagonalForwardEnd = this.ClipDiagonalBound(diagonalForwardBase + numDifferences, numDifferences, diagonalForwardBase, numDiagonals);
  4559. for (let diagonal = diagonalForwardStart; diagonal <= diagonalForwardEnd; diagonal += 2) {
  4560. if (diagonal === diagonalForwardStart || diagonal < diagonalForwardEnd && forwardPoints[diagonal - 1] < forwardPoints[diagonal + 1]) {
  4561. originalIndex = forwardPoints[diagonal + 1];
  4562. } else {
  4563. originalIndex = forwardPoints[diagonal - 1] + 1;
  4564. }
  4565. modifiedIndex = originalIndex - (diagonal - diagonalForwardBase) - diagonalForwardOffset;
  4566. const tempOriginalIndex = originalIndex;
  4567. while (originalIndex < originalEnd && modifiedIndex < modifiedEnd && this.ElementsAreEqual(originalIndex + 1, modifiedIndex + 1)) {
  4568. originalIndex++;
  4569. modifiedIndex++;
  4570. }
  4571. forwardPoints[diagonal] = originalIndex;
  4572. if (originalIndex + modifiedIndex > furthestOriginalIndex + furthestModifiedIndex) {
  4573. furthestOriginalIndex = originalIndex;
  4574. furthestModifiedIndex = modifiedIndex;
  4575. }
  4576. if (!deltaIsEven && Math.abs(diagonal - diagonalReverseBase) <= numDifferences - 1) {
  4577. if (originalIndex >= reversePoints[diagonal]) {
  4578. midOriginalArr[0] = originalIndex;
  4579. midModifiedArr[0] = modifiedIndex;
  4580. if (tempOriginalIndex <= reversePoints[diagonal] && 1447 > 0 && numDifferences <= 1447 + 1) {
  4581. return this.WALKTRACE(diagonalForwardBase, diagonalForwardStart, diagonalForwardEnd, diagonalForwardOffset, diagonalReverseBase, diagonalReverseStart, diagonalReverseEnd, diagonalReverseOffset, forwardPoints, reversePoints, originalIndex, originalEnd, midOriginalArr, modifiedIndex, modifiedEnd, midModifiedArr, deltaIsEven, quitEarlyArr);
  4582. } else {
  4583. return null;
  4584. }
  4585. }
  4586. }
  4587. }
  4588. const matchLengthOfLongest = (furthestOriginalIndex - originalStart + (furthestModifiedIndex - modifiedStart) - numDifferences) / 2;
  4589. if (this.ContinueProcessingPredicate !== null && !this.ContinueProcessingPredicate(furthestOriginalIndex, matchLengthOfLongest)) {
  4590. quitEarlyArr[0] = true;
  4591. midOriginalArr[0] = furthestOriginalIndex;
  4592. midModifiedArr[0] = furthestModifiedIndex;
  4593. if (matchLengthOfLongest > 0 && 1447 > 0 && numDifferences <= 1447 + 1) {
  4594. return this.WALKTRACE(diagonalForwardBase, diagonalForwardStart, diagonalForwardEnd, diagonalForwardOffset, diagonalReverseBase, diagonalReverseStart, diagonalReverseEnd, diagonalReverseOffset, forwardPoints, reversePoints, originalIndex, originalEnd, midOriginalArr, modifiedIndex, modifiedEnd, midModifiedArr, deltaIsEven, quitEarlyArr);
  4595. } else {
  4596. originalStart++;
  4597. modifiedStart++;
  4598. return [
  4599. new DiffChange(originalStart, originalEnd - originalStart + 1, modifiedStart, modifiedEnd - modifiedStart + 1)
  4600. ];
  4601. }
  4602. }
  4603. diagonalReverseStart = this.ClipDiagonalBound(diagonalReverseBase - numDifferences, numDifferences, diagonalReverseBase, numDiagonals);
  4604. diagonalReverseEnd = this.ClipDiagonalBound(diagonalReverseBase + numDifferences, numDifferences, diagonalReverseBase, numDiagonals);
  4605. for (let diagonal = diagonalReverseStart; diagonal <= diagonalReverseEnd; diagonal += 2) {
  4606. if (diagonal === diagonalReverseStart || diagonal < diagonalReverseEnd && reversePoints[diagonal - 1] >= reversePoints[diagonal + 1]) {
  4607. originalIndex = reversePoints[diagonal + 1] - 1;
  4608. } else {
  4609. originalIndex = reversePoints[diagonal - 1];
  4610. }
  4611. modifiedIndex = originalIndex - (diagonal - diagonalReverseBase) - diagonalReverseOffset;
  4612. const tempOriginalIndex = originalIndex;
  4613. while (originalIndex > originalStart && modifiedIndex > modifiedStart && this.ElementsAreEqual(originalIndex, modifiedIndex)) {
  4614. originalIndex--;
  4615. modifiedIndex--;
  4616. }
  4617. reversePoints[diagonal] = originalIndex;
  4618. if (deltaIsEven && Math.abs(diagonal - diagonalForwardBase) <= numDifferences) {
  4619. if (originalIndex <= forwardPoints[diagonal]) {
  4620. midOriginalArr[0] = originalIndex;
  4621. midModifiedArr[0] = modifiedIndex;
  4622. if (tempOriginalIndex >= forwardPoints[diagonal] && 1447 > 0 && numDifferences <= 1447 + 1) {
  4623. return this.WALKTRACE(diagonalForwardBase, diagonalForwardStart, diagonalForwardEnd, diagonalForwardOffset, diagonalReverseBase, diagonalReverseStart, diagonalReverseEnd, diagonalReverseOffset, forwardPoints, reversePoints, originalIndex, originalEnd, midOriginalArr, modifiedIndex, modifiedEnd, midModifiedArr, deltaIsEven, quitEarlyArr);
  4624. } else {
  4625. return null;
  4626. }
  4627. }
  4628. }
  4629. }
  4630. if (numDifferences <= 1447) {
  4631. let temp = new Int32Array(diagonalForwardEnd - diagonalForwardStart + 2);
  4632. temp[0] = diagonalForwardBase - diagonalForwardStart + 1;
  4633. MyArray.Copy2(forwardPoints, diagonalForwardStart, temp, 1, diagonalForwardEnd - diagonalForwardStart + 1);
  4634. this.m_forwardHistory.push(temp);
  4635. temp = new Int32Array(diagonalReverseEnd - diagonalReverseStart + 2);
  4636. temp[0] = diagonalReverseBase - diagonalReverseStart + 1;
  4637. MyArray.Copy2(reversePoints, diagonalReverseStart, temp, 1, diagonalReverseEnd - diagonalReverseStart + 1);
  4638. this.m_reverseHistory.push(temp);
  4639. }
  4640. }
  4641. return this.WALKTRACE(diagonalForwardBase, diagonalForwardStart, diagonalForwardEnd, diagonalForwardOffset, diagonalReverseBase, diagonalReverseStart, diagonalReverseEnd, diagonalReverseOffset, forwardPoints, reversePoints, originalIndex, originalEnd, midOriginalArr, modifiedIndex, modifiedEnd, midModifiedArr, deltaIsEven, quitEarlyArr);
  4642. }
  4643. /**
  4644. * Shifts the given changes to provide a more intuitive diff.
  4645. * While the first element in a diff matches the first element after the diff,
  4646. * we shift the diff down.
  4647. *
  4648. * @param changes The list of changes to shift
  4649. * @returns The shifted changes
  4650. */
  4651. PrettifyChanges(changes) {
  4652. for (let i = 0; i < changes.length; i++) {
  4653. const change = changes[i];
  4654. const originalStop = i < changes.length - 1 ? changes[i + 1].originalStart : this._originalElementsOrHash.length;
  4655. const modifiedStop = i < changes.length - 1 ? changes[i + 1].modifiedStart : this._modifiedElementsOrHash.length;
  4656. const checkOriginal = change.originalLength > 0;
  4657. const checkModified = change.modifiedLength > 0;
  4658. while (change.originalStart + change.originalLength < originalStop && change.modifiedStart + change.modifiedLength < modifiedStop && (!checkOriginal || this.OriginalElementsAreEqual(change.originalStart, change.originalStart + change.originalLength)) && (!checkModified || this.ModifiedElementsAreEqual(change.modifiedStart, change.modifiedStart + change.modifiedLength))) {
  4659. const startStrictEqual = this.ElementsAreStrictEqual(change.originalStart, change.modifiedStart);
  4660. const endStrictEqual = this.ElementsAreStrictEqual(change.originalStart + change.originalLength, change.modifiedStart + change.modifiedLength);
  4661. if (endStrictEqual && !startStrictEqual) {
  4662. break;
  4663. }
  4664. change.originalStart++;
  4665. change.modifiedStart++;
  4666. }
  4667. const mergedChangeArr = [null];
  4668. if (i < changes.length - 1 && this.ChangesOverlap(changes[i], changes[i + 1], mergedChangeArr)) {
  4669. changes[i] = mergedChangeArr[0];
  4670. changes.splice(i + 1, 1);
  4671. i--;
  4672. continue;
  4673. }
  4674. }
  4675. for (let i = changes.length - 1; i >= 0; i--) {
  4676. const change = changes[i];
  4677. let originalStop = 0;
  4678. let modifiedStop = 0;
  4679. if (i > 0) {
  4680. const prevChange = changes[i - 1];
  4681. originalStop = prevChange.originalStart + prevChange.originalLength;
  4682. modifiedStop = prevChange.modifiedStart + prevChange.modifiedLength;
  4683. }
  4684. const checkOriginal = change.originalLength > 0;
  4685. const checkModified = change.modifiedLength > 0;
  4686. let bestDelta = 0;
  4687. let bestScore = this._boundaryScore(change.originalStart, change.originalLength, change.modifiedStart, change.modifiedLength);
  4688. for (let delta = 1; ; delta++) {
  4689. const originalStart = change.originalStart - delta;
  4690. const modifiedStart = change.modifiedStart - delta;
  4691. if (originalStart < originalStop || modifiedStart < modifiedStop) {
  4692. break;
  4693. }
  4694. if (checkOriginal && !this.OriginalElementsAreEqual(originalStart, originalStart + change.originalLength)) {
  4695. break;
  4696. }
  4697. if (checkModified && !this.ModifiedElementsAreEqual(modifiedStart, modifiedStart + change.modifiedLength)) {
  4698. break;
  4699. }
  4700. const touchingPreviousChange = originalStart === originalStop && modifiedStart === modifiedStop;
  4701. const score2 = (touchingPreviousChange ? 5 : 0) + this._boundaryScore(originalStart, change.originalLength, modifiedStart, change.modifiedLength);
  4702. if (score2 > bestScore) {
  4703. bestScore = score2;
  4704. bestDelta = delta;
  4705. }
  4706. }
  4707. change.originalStart -= bestDelta;
  4708. change.modifiedStart -= bestDelta;
  4709. const mergedChangeArr = [null];
  4710. if (i > 0 && this.ChangesOverlap(changes[i - 1], changes[i], mergedChangeArr)) {
  4711. changes[i - 1] = mergedChangeArr[0];
  4712. changes.splice(i, 1);
  4713. i++;
  4714. continue;
  4715. }
  4716. }
  4717. if (this._hasStrings) {
  4718. for (let i = 1, len = changes.length; i < len; i++) {
  4719. const aChange = changes[i - 1];
  4720. const bChange = changes[i];
  4721. const matchedLength = bChange.originalStart - aChange.originalStart - aChange.originalLength;
  4722. const aOriginalStart = aChange.originalStart;
  4723. const bOriginalEnd = bChange.originalStart + bChange.originalLength;
  4724. const abOriginalLength = bOriginalEnd - aOriginalStart;
  4725. const aModifiedStart = aChange.modifiedStart;
  4726. const bModifiedEnd = bChange.modifiedStart + bChange.modifiedLength;
  4727. const abModifiedLength = bModifiedEnd - aModifiedStart;
  4728. if (matchedLength < 5 && abOriginalLength < 20 && abModifiedLength < 20) {
  4729. const t = this._findBetterContiguousSequence(aOriginalStart, abOriginalLength, aModifiedStart, abModifiedLength, matchedLength);
  4730. if (t) {
  4731. const [originalMatchStart, modifiedMatchStart] = t;
  4732. if (originalMatchStart !== aChange.originalStart + aChange.originalLength || modifiedMatchStart !== aChange.modifiedStart + aChange.modifiedLength) {
  4733. aChange.originalLength = originalMatchStart - aChange.originalStart;
  4734. aChange.modifiedLength = modifiedMatchStart - aChange.modifiedStart;
  4735. bChange.originalStart = originalMatchStart + matchedLength;
  4736. bChange.modifiedStart = modifiedMatchStart + matchedLength;
  4737. bChange.originalLength = bOriginalEnd - bChange.originalStart;
  4738. bChange.modifiedLength = bModifiedEnd - bChange.modifiedStart;
  4739. }
  4740. }
  4741. }
  4742. }
  4743. }
  4744. return changes;
  4745. }
  4746. _findBetterContiguousSequence(originalStart, originalLength, modifiedStart, modifiedLength, desiredLength) {
  4747. if (originalLength < desiredLength || modifiedLength < desiredLength) {
  4748. return null;
  4749. }
  4750. const originalMax = originalStart + originalLength - desiredLength + 1;
  4751. const modifiedMax = modifiedStart + modifiedLength - desiredLength + 1;
  4752. let bestScore = 0;
  4753. let bestOriginalStart = 0;
  4754. let bestModifiedStart = 0;
  4755. for (let i = originalStart; i < originalMax; i++) {
  4756. for (let j = modifiedStart; j < modifiedMax; j++) {
  4757. const score2 = this._contiguousSequenceScore(i, j, desiredLength);
  4758. if (score2 > 0 && score2 > bestScore) {
  4759. bestScore = score2;
  4760. bestOriginalStart = i;
  4761. bestModifiedStart = j;
  4762. }
  4763. }
  4764. }
  4765. if (bestScore > 0) {
  4766. return [bestOriginalStart, bestModifiedStart];
  4767. }
  4768. return null;
  4769. }
  4770. _contiguousSequenceScore(originalStart, modifiedStart, length) {
  4771. let score2 = 0;
  4772. for (let l = 0; l < length; l++) {
  4773. if (!this.ElementsAreEqual(originalStart + l, modifiedStart + l)) {
  4774. return 0;
  4775. }
  4776. score2 += this._originalStringElements[originalStart + l].length;
  4777. }
  4778. return score2;
  4779. }
  4780. _OriginalIsBoundary(index) {
  4781. if (index <= 0 || index >= this._originalElementsOrHash.length - 1) {
  4782. return true;
  4783. }
  4784. return this._hasStrings && /^\s*$/.test(this._originalStringElements[index]);
  4785. }
  4786. _OriginalRegionIsBoundary(originalStart, originalLength) {
  4787. if (this._OriginalIsBoundary(originalStart) || this._OriginalIsBoundary(originalStart - 1)) {
  4788. return true;
  4789. }
  4790. if (originalLength > 0) {
  4791. const originalEnd = originalStart + originalLength;
  4792. if (this._OriginalIsBoundary(originalEnd - 1) || this._OriginalIsBoundary(originalEnd)) {
  4793. return true;
  4794. }
  4795. }
  4796. return false;
  4797. }
  4798. _ModifiedIsBoundary(index) {
  4799. if (index <= 0 || index >= this._modifiedElementsOrHash.length - 1) {
  4800. return true;
  4801. }
  4802. return this._hasStrings && /^\s*$/.test(this._modifiedStringElements[index]);
  4803. }
  4804. _ModifiedRegionIsBoundary(modifiedStart, modifiedLength) {
  4805. if (this._ModifiedIsBoundary(modifiedStart) || this._ModifiedIsBoundary(modifiedStart - 1)) {
  4806. return true;
  4807. }
  4808. if (modifiedLength > 0) {
  4809. const modifiedEnd = modifiedStart + modifiedLength;
  4810. if (this._ModifiedIsBoundary(modifiedEnd - 1) || this._ModifiedIsBoundary(modifiedEnd)) {
  4811. return true;
  4812. }
  4813. }
  4814. return false;
  4815. }
  4816. _boundaryScore(originalStart, originalLength, modifiedStart, modifiedLength) {
  4817. const originalScore = this._OriginalRegionIsBoundary(originalStart, originalLength) ? 1 : 0;
  4818. const modifiedScore = this._ModifiedRegionIsBoundary(modifiedStart, modifiedLength) ? 1 : 0;
  4819. return originalScore + modifiedScore;
  4820. }
  4821. /**
  4822. * Concatenates the two input DiffChange lists and returns the resulting
  4823. * list.
  4824. * @param The left changes
  4825. * @param The right changes
  4826. * @returns The concatenated list
  4827. */
  4828. ConcatenateChanges(left, right) {
  4829. const mergedChangeArr = [];
  4830. if (left.length === 0 || right.length === 0) {
  4831. return right.length > 0 ? right : left;
  4832. } else if (this.ChangesOverlap(left[left.length - 1], right[0], mergedChangeArr)) {
  4833. const result = new Array(left.length + right.length - 1);
  4834. MyArray.Copy(left, 0, result, 0, left.length - 1);
  4835. result[left.length - 1] = mergedChangeArr[0];
  4836. MyArray.Copy(right, 1, result, left.length, right.length - 1);
  4837. return result;
  4838. } else {
  4839. const result = new Array(left.length + right.length);
  4840. MyArray.Copy(left, 0, result, 0, left.length);
  4841. MyArray.Copy(right, 0, result, left.length, right.length);
  4842. return result;
  4843. }
  4844. }
  4845. /**
  4846. * Returns true if the two changes overlap and can be merged into a single
  4847. * change
  4848. * @param left The left change
  4849. * @param right The right change
  4850. * @param mergedChange The merged change if the two overlap, null otherwise
  4851. * @returns True if the two changes overlap
  4852. */
  4853. ChangesOverlap(left, right, mergedChangeArr) {
  4854. Debug.Assert(left.originalStart <= right.originalStart, "Left change is not less than or equal to right change");
  4855. Debug.Assert(left.modifiedStart <= right.modifiedStart, "Left change is not less than or equal to right change");
  4856. if (left.originalStart + left.originalLength >= right.originalStart || left.modifiedStart + left.modifiedLength >= right.modifiedStart) {
  4857. const originalStart = left.originalStart;
  4858. let originalLength = left.originalLength;
  4859. const modifiedStart = left.modifiedStart;
  4860. let modifiedLength = left.modifiedLength;
  4861. if (left.originalStart + left.originalLength >= right.originalStart) {
  4862. originalLength = right.originalStart + right.originalLength - left.originalStart;
  4863. }
  4864. if (left.modifiedStart + left.modifiedLength >= right.modifiedStart) {
  4865. modifiedLength = right.modifiedStart + right.modifiedLength - left.modifiedStart;
  4866. }
  4867. mergedChangeArr[0] = new DiffChange(originalStart, originalLength, modifiedStart, modifiedLength);
  4868. return true;
  4869. } else {
  4870. mergedChangeArr[0] = null;
  4871. return false;
  4872. }
  4873. }
  4874. /**
  4875. * Helper method used to clip a diagonal index to the range of valid
  4876. * diagonals. This also decides whether or not the diagonal index,
  4877. * if it exceeds the boundary, should be clipped to the boundary or clipped
  4878. * one inside the boundary depending on the Even/Odd status of the boundary
  4879. * and numDifferences.
  4880. * @param diagonal The index of the diagonal to clip.
  4881. * @param numDifferences The current number of differences being iterated upon.
  4882. * @param diagonalBaseIndex The base reference diagonal.
  4883. * @param numDiagonals The total number of diagonals.
  4884. * @returns The clipped diagonal index.
  4885. */
  4886. ClipDiagonalBound(diagonal, numDifferences, diagonalBaseIndex, numDiagonals) {
  4887. if (diagonal >= 0 && diagonal < numDiagonals) {
  4888. return diagonal;
  4889. }
  4890. const diagonalsBelow = diagonalBaseIndex;
  4891. const diagonalsAbove = numDiagonals - diagonalBaseIndex - 1;
  4892. const diffEven = numDifferences % 2 === 0;
  4893. if (diagonal < 0) {
  4894. const lowerBoundEven = diagonalsBelow % 2 === 0;
  4895. return diffEven === lowerBoundEven ? 0 : 1;
  4896. } else {
  4897. const upperBoundEven = diagonalsAbove % 2 === 0;
  4898. return diffEven === upperBoundEven ? numDiagonals - 1 : numDiagonals - 2;
  4899. }
  4900. }
  4901. };
  4902. // node_modules/monaco-editor/esm/vs/editor/common/core/position.js
  4903. var Position = class _Position {
  4904. constructor(lineNumber, column) {
  4905. this.lineNumber = lineNumber;
  4906. this.column = column;
  4907. }
  4908. /**
  4909. * Create a new position from this position.
  4910. *
  4911. * @param newLineNumber new line number
  4912. * @param newColumn new column
  4913. */
  4914. with(newLineNumber = this.lineNumber, newColumn = this.column) {
  4915. if (newLineNumber === this.lineNumber && newColumn === this.column) {
  4916. return this;
  4917. } else {
  4918. return new _Position(newLineNumber, newColumn);
  4919. }
  4920. }
  4921. /**
  4922. * Derive a new position from this position.
  4923. *
  4924. * @param deltaLineNumber line number delta
  4925. * @param deltaColumn column delta
  4926. */
  4927. delta(deltaLineNumber = 0, deltaColumn = 0) {
  4928. return this.with(this.lineNumber + deltaLineNumber, this.column + deltaColumn);
  4929. }
  4930. /**
  4931. * Test if this position equals other position
  4932. */
  4933. equals(other) {
  4934. return _Position.equals(this, other);
  4935. }
  4936. /**
  4937. * Test if position `a` equals position `b`
  4938. */
  4939. static equals(a, b) {
  4940. if (!a && !b) {
  4941. return true;
  4942. }
  4943. return !!a && !!b && a.lineNumber === b.lineNumber && a.column === b.column;
  4944. }
  4945. /**
  4946. * Test if this position is before other position.
  4947. * If the two positions are equal, the result will be false.
  4948. */
  4949. isBefore(other) {
  4950. return _Position.isBefore(this, other);
  4951. }
  4952. /**
  4953. * Test if position `a` is before position `b`.
  4954. * If the two positions are equal, the result will be false.
  4955. */
  4956. static isBefore(a, b) {
  4957. if (a.lineNumber < b.lineNumber) {
  4958. return true;
  4959. }
  4960. if (b.lineNumber < a.lineNumber) {
  4961. return false;
  4962. }
  4963. return a.column < b.column;
  4964. }
  4965. /**
  4966. * Test if this position is before other position.
  4967. * If the two positions are equal, the result will be true.
  4968. */
  4969. isBeforeOrEqual(other) {
  4970. return _Position.isBeforeOrEqual(this, other);
  4971. }
  4972. /**
  4973. * Test if position `a` is before position `b`.
  4974. * If the two positions are equal, the result will be true.
  4975. */
  4976. static isBeforeOrEqual(a, b) {
  4977. if (a.lineNumber < b.lineNumber) {
  4978. return true;
  4979. }
  4980. if (b.lineNumber < a.lineNumber) {
  4981. return false;
  4982. }
  4983. return a.column <= b.column;
  4984. }
  4985. /**
  4986. * A function that compares positions, useful for sorting
  4987. */
  4988. static compare(a, b) {
  4989. const aLineNumber = a.lineNumber | 0;
  4990. const bLineNumber = b.lineNumber | 0;
  4991. if (aLineNumber === bLineNumber) {
  4992. const aColumn = a.column | 0;
  4993. const bColumn = b.column | 0;
  4994. return aColumn - bColumn;
  4995. }
  4996. return aLineNumber - bLineNumber;
  4997. }
  4998. /**
  4999. * Clone this position.
  5000. */
  5001. clone() {
  5002. return new _Position(this.lineNumber, this.column);
  5003. }
  5004. /**
  5005. * Convert to a human-readable representation.
  5006. */
  5007. toString() {
  5008. return "(" + this.lineNumber + "," + this.column + ")";
  5009. }
  5010. // ---
  5011. /**
  5012. * Create a `Position` from an `IPosition`.
  5013. */
  5014. static lift(pos) {
  5015. return new _Position(pos.lineNumber, pos.column);
  5016. }
  5017. /**
  5018. * Test if `obj` is an `IPosition`.
  5019. */
  5020. static isIPosition(obj) {
  5021. return obj && typeof obj.lineNumber === "number" && typeof obj.column === "number";
  5022. }
  5023. toJSON() {
  5024. return {
  5025. lineNumber: this.lineNumber,
  5026. column: this.column
  5027. };
  5028. }
  5029. };
  5030. // node_modules/monaco-editor/esm/vs/editor/common/core/range.js
  5031. var Range = class _Range {
  5032. constructor(startLineNumber, startColumn, endLineNumber, endColumn) {
  5033. if (startLineNumber > endLineNumber || startLineNumber === endLineNumber && startColumn > endColumn) {
  5034. this.startLineNumber = endLineNumber;
  5035. this.startColumn = endColumn;
  5036. this.endLineNumber = startLineNumber;
  5037. this.endColumn = startColumn;
  5038. } else {
  5039. this.startLineNumber = startLineNumber;
  5040. this.startColumn = startColumn;
  5041. this.endLineNumber = endLineNumber;
  5042. this.endColumn = endColumn;
  5043. }
  5044. }
  5045. /**
  5046. * Test if this range is empty.
  5047. */
  5048. isEmpty() {
  5049. return _Range.isEmpty(this);
  5050. }
  5051. /**
  5052. * Test if `range` is empty.
  5053. */
  5054. static isEmpty(range) {
  5055. return range.startLineNumber === range.endLineNumber && range.startColumn === range.endColumn;
  5056. }
  5057. /**
  5058. * Test if position is in this range. If the position is at the edges, will return true.
  5059. */
  5060. containsPosition(position) {
  5061. return _Range.containsPosition(this, position);
  5062. }
  5063. /**
  5064. * Test if `position` is in `range`. If the position is at the edges, will return true.
  5065. */
  5066. static containsPosition(range, position) {
  5067. if (position.lineNumber < range.startLineNumber || position.lineNumber > range.endLineNumber) {
  5068. return false;
  5069. }
  5070. if (position.lineNumber === range.startLineNumber && position.column < range.startColumn) {
  5071. return false;
  5072. }
  5073. if (position.lineNumber === range.endLineNumber && position.column > range.endColumn) {
  5074. return false;
  5075. }
  5076. return true;
  5077. }
  5078. /**
  5079. * Test if `position` is in `range`. If the position is at the edges, will return false.
  5080. * @internal
  5081. */
  5082. static strictContainsPosition(range, position) {
  5083. if (position.lineNumber < range.startLineNumber || position.lineNumber > range.endLineNumber) {
  5084. return false;
  5085. }
  5086. if (position.lineNumber === range.startLineNumber && position.column <= range.startColumn) {
  5087. return false;
  5088. }
  5089. if (position.lineNumber === range.endLineNumber && position.column >= range.endColumn) {
  5090. return false;
  5091. }
  5092. return true;
  5093. }
  5094. /**
  5095. * Test if range is in this range. If the range is equal to this range, will return true.
  5096. */
  5097. containsRange(range) {
  5098. return _Range.containsRange(this, range);
  5099. }
  5100. /**
  5101. * Test if `otherRange` is in `range`. If the ranges are equal, will return true.
  5102. */
  5103. static containsRange(range, otherRange) {
  5104. if (otherRange.startLineNumber < range.startLineNumber || otherRange.endLineNumber < range.startLineNumber) {
  5105. return false;
  5106. }
  5107. if (otherRange.startLineNumber > range.endLineNumber || otherRange.endLineNumber > range.endLineNumber) {
  5108. return false;
  5109. }
  5110. if (otherRange.startLineNumber === range.startLineNumber && otherRange.startColumn < range.startColumn) {
  5111. return false;
  5112. }
  5113. if (otherRange.endLineNumber === range.endLineNumber && otherRange.endColumn > range.endColumn) {
  5114. return false;
  5115. }
  5116. return true;
  5117. }
  5118. /**
  5119. * Test if `range` is strictly in this range. `range` must start after and end before this range for the result to be true.
  5120. */
  5121. strictContainsRange(range) {
  5122. return _Range.strictContainsRange(this, range);
  5123. }
  5124. /**
  5125. * Test if `otherRange` is strictly in `range` (must start after, and end before). If the ranges are equal, will return false.
  5126. */
  5127. static strictContainsRange(range, otherRange) {
  5128. if (otherRange.startLineNumber < range.startLineNumber || otherRange.endLineNumber < range.startLineNumber) {
  5129. return false;
  5130. }
  5131. if (otherRange.startLineNumber > range.endLineNumber || otherRange.endLineNumber > range.endLineNumber) {
  5132. return false;
  5133. }
  5134. if (otherRange.startLineNumber === range.startLineNumber && otherRange.startColumn <= range.startColumn) {
  5135. return false;
  5136. }
  5137. if (otherRange.endLineNumber === range.endLineNumber && otherRange.endColumn >= range.endColumn) {
  5138. return false;
  5139. }
  5140. return true;
  5141. }
  5142. /**
  5143. * A reunion of the two ranges.
  5144. * The smallest position will be used as the start point, and the largest one as the end point.
  5145. */
  5146. plusRange(range) {
  5147. return _Range.plusRange(this, range);
  5148. }
  5149. /**
  5150. * A reunion of the two ranges.
  5151. * The smallest position will be used as the start point, and the largest one as the end point.
  5152. */
  5153. static plusRange(a, b) {
  5154. let startLineNumber;
  5155. let startColumn;
  5156. let endLineNumber;
  5157. let endColumn;
  5158. if (b.startLineNumber < a.startLineNumber) {
  5159. startLineNumber = b.startLineNumber;
  5160. startColumn = b.startColumn;
  5161. } else if (b.startLineNumber === a.startLineNumber) {
  5162. startLineNumber = b.startLineNumber;
  5163. startColumn = Math.min(b.startColumn, a.startColumn);
  5164. } else {
  5165. startLineNumber = a.startLineNumber;
  5166. startColumn = a.startColumn;
  5167. }
  5168. if (b.endLineNumber > a.endLineNumber) {
  5169. endLineNumber = b.endLineNumber;
  5170. endColumn = b.endColumn;
  5171. } else if (b.endLineNumber === a.endLineNumber) {
  5172. endLineNumber = b.endLineNumber;
  5173. endColumn = Math.max(b.endColumn, a.endColumn);
  5174. } else {
  5175. endLineNumber = a.endLineNumber;
  5176. endColumn = a.endColumn;
  5177. }
  5178. return new _Range(startLineNumber, startColumn, endLineNumber, endColumn);
  5179. }
  5180. /**
  5181. * A intersection of the two ranges.
  5182. */
  5183. intersectRanges(range) {
  5184. return _Range.intersectRanges(this, range);
  5185. }
  5186. /**
  5187. * A intersection of the two ranges.
  5188. */
  5189. static intersectRanges(a, b) {
  5190. let resultStartLineNumber = a.startLineNumber;
  5191. let resultStartColumn = a.startColumn;
  5192. let resultEndLineNumber = a.endLineNumber;
  5193. let resultEndColumn = a.endColumn;
  5194. const otherStartLineNumber = b.startLineNumber;
  5195. const otherStartColumn = b.startColumn;
  5196. const otherEndLineNumber = b.endLineNumber;
  5197. const otherEndColumn = b.endColumn;
  5198. if (resultStartLineNumber < otherStartLineNumber) {
  5199. resultStartLineNumber = otherStartLineNumber;
  5200. resultStartColumn = otherStartColumn;
  5201. } else if (resultStartLineNumber === otherStartLineNumber) {
  5202. resultStartColumn = Math.max(resultStartColumn, otherStartColumn);
  5203. }
  5204. if (resultEndLineNumber > otherEndLineNumber) {
  5205. resultEndLineNumber = otherEndLineNumber;
  5206. resultEndColumn = otherEndColumn;
  5207. } else if (resultEndLineNumber === otherEndLineNumber) {
  5208. resultEndColumn = Math.min(resultEndColumn, otherEndColumn);
  5209. }
  5210. if (resultStartLineNumber > resultEndLineNumber) {
  5211. return null;
  5212. }
  5213. if (resultStartLineNumber === resultEndLineNumber && resultStartColumn > resultEndColumn) {
  5214. return null;
  5215. }
  5216. return new _Range(resultStartLineNumber, resultStartColumn, resultEndLineNumber, resultEndColumn);
  5217. }
  5218. /**
  5219. * Test if this range equals other.
  5220. */
  5221. equalsRange(other) {
  5222. return _Range.equalsRange(this, other);
  5223. }
  5224. /**
  5225. * Test if range `a` equals `b`.
  5226. */
  5227. static equalsRange(a, b) {
  5228. if (!a && !b) {
  5229. return true;
  5230. }
  5231. return !!a && !!b && a.startLineNumber === b.startLineNumber && a.startColumn === b.startColumn && a.endLineNumber === b.endLineNumber && a.endColumn === b.endColumn;
  5232. }
  5233. /**
  5234. * Return the end position (which will be after or equal to the start position)
  5235. */
  5236. getEndPosition() {
  5237. return _Range.getEndPosition(this);
  5238. }
  5239. /**
  5240. * Return the end position (which will be after or equal to the start position)
  5241. */
  5242. static getEndPosition(range) {
  5243. return new Position(range.endLineNumber, range.endColumn);
  5244. }
  5245. /**
  5246. * Return the start position (which will be before or equal to the end position)
  5247. */
  5248. getStartPosition() {
  5249. return _Range.getStartPosition(this);
  5250. }
  5251. /**
  5252. * Return the start position (which will be before or equal to the end position)
  5253. */
  5254. static getStartPosition(range) {
  5255. return new Position(range.startLineNumber, range.startColumn);
  5256. }
  5257. /**
  5258. * Transform to a user presentable string representation.
  5259. */
  5260. toString() {
  5261. return "[" + this.startLineNumber + "," + this.startColumn + " -> " + this.endLineNumber + "," + this.endColumn + "]";
  5262. }
  5263. /**
  5264. * Create a new range using this range's start position, and using endLineNumber and endColumn as the end position.
  5265. */
  5266. setEndPosition(endLineNumber, endColumn) {
  5267. return new _Range(this.startLineNumber, this.startColumn, endLineNumber, endColumn);
  5268. }
  5269. /**
  5270. * Create a new range using this range's end position, and using startLineNumber and startColumn as the start position.
  5271. */
  5272. setStartPosition(startLineNumber, startColumn) {
  5273. return new _Range(startLineNumber, startColumn, this.endLineNumber, this.endColumn);
  5274. }
  5275. /**
  5276. * Create a new empty range using this range's start position.
  5277. */
  5278. collapseToStart() {
  5279. return _Range.collapseToStart(this);
  5280. }
  5281. /**
  5282. * Create a new empty range using this range's start position.
  5283. */
  5284. static collapseToStart(range) {
  5285. return new _Range(range.startLineNumber, range.startColumn, range.startLineNumber, range.startColumn);
  5286. }
  5287. /**
  5288. * Create a new empty range using this range's end position.
  5289. */
  5290. collapseToEnd() {
  5291. return _Range.collapseToEnd(this);
  5292. }
  5293. /**
  5294. * Create a new empty range using this range's end position.
  5295. */
  5296. static collapseToEnd(range) {
  5297. return new _Range(range.endLineNumber, range.endColumn, range.endLineNumber, range.endColumn);
  5298. }
  5299. /**
  5300. * Moves the range by the given amount of lines.
  5301. */
  5302. delta(lineCount) {
  5303. return new _Range(this.startLineNumber + lineCount, this.startColumn, this.endLineNumber + lineCount, this.endColumn);
  5304. }
  5305. // ---
  5306. static fromPositions(start, end = start) {
  5307. return new _Range(start.lineNumber, start.column, end.lineNumber, end.column);
  5308. }
  5309. static lift(range) {
  5310. if (!range) {
  5311. return null;
  5312. }
  5313. return new _Range(range.startLineNumber, range.startColumn, range.endLineNumber, range.endColumn);
  5314. }
  5315. /**
  5316. * Test if `obj` is an `IRange`.
  5317. */
  5318. static isIRange(obj) {
  5319. return obj && typeof obj.startLineNumber === "number" && typeof obj.startColumn === "number" && typeof obj.endLineNumber === "number" && typeof obj.endColumn === "number";
  5320. }
  5321. /**
  5322. * Test if the two ranges are touching in any way.
  5323. */
  5324. static areIntersectingOrTouching(a, b) {
  5325. if (a.endLineNumber < b.startLineNumber || a.endLineNumber === b.startLineNumber && a.endColumn < b.startColumn) {
  5326. return false;
  5327. }
  5328. if (b.endLineNumber < a.startLineNumber || b.endLineNumber === a.startLineNumber && b.endColumn < a.startColumn) {
  5329. return false;
  5330. }
  5331. return true;
  5332. }
  5333. /**
  5334. * Test if the two ranges are intersecting. If the ranges are touching it returns true.
  5335. */
  5336. static areIntersecting(a, b) {
  5337. if (a.endLineNumber < b.startLineNumber || a.endLineNumber === b.startLineNumber && a.endColumn <= b.startColumn) {
  5338. return false;
  5339. }
  5340. if (b.endLineNumber < a.startLineNumber || b.endLineNumber === a.startLineNumber && b.endColumn <= a.startColumn) {
  5341. return false;
  5342. }
  5343. return true;
  5344. }
  5345. /**
  5346. * A function that compares ranges, useful for sorting ranges
  5347. * It will first compare ranges on the startPosition and then on the endPosition
  5348. */
  5349. static compareRangesUsingStarts(a, b) {
  5350. if (a && b) {
  5351. const aStartLineNumber = a.startLineNumber | 0;
  5352. const bStartLineNumber = b.startLineNumber | 0;
  5353. if (aStartLineNumber === bStartLineNumber) {
  5354. const aStartColumn = a.startColumn | 0;
  5355. const bStartColumn = b.startColumn | 0;
  5356. if (aStartColumn === bStartColumn) {
  5357. const aEndLineNumber = a.endLineNumber | 0;
  5358. const bEndLineNumber = b.endLineNumber | 0;
  5359. if (aEndLineNumber === bEndLineNumber) {
  5360. const aEndColumn = a.endColumn | 0;
  5361. const bEndColumn = b.endColumn | 0;
  5362. return aEndColumn - bEndColumn;
  5363. }
  5364. return aEndLineNumber - bEndLineNumber;
  5365. }
  5366. return aStartColumn - bStartColumn;
  5367. }
  5368. return aStartLineNumber - bStartLineNumber;
  5369. }
  5370. const aExists = a ? 1 : 0;
  5371. const bExists = b ? 1 : 0;
  5372. return aExists - bExists;
  5373. }
  5374. /**
  5375. * A function that compares ranges, useful for sorting ranges
  5376. * It will first compare ranges on the endPosition and then on the startPosition
  5377. */
  5378. static compareRangesUsingEnds(a, b) {
  5379. if (a.endLineNumber === b.endLineNumber) {
  5380. if (a.endColumn === b.endColumn) {
  5381. if (a.startLineNumber === b.startLineNumber) {
  5382. return a.startColumn - b.startColumn;
  5383. }
  5384. return a.startLineNumber - b.startLineNumber;
  5385. }
  5386. return a.endColumn - b.endColumn;
  5387. }
  5388. return a.endLineNumber - b.endLineNumber;
  5389. }
  5390. /**
  5391. * Test if the range spans multiple lines.
  5392. */
  5393. static spansMultipleLines(range) {
  5394. return range.endLineNumber > range.startLineNumber;
  5395. }
  5396. toJSON() {
  5397. return this;
  5398. }
  5399. };
  5400. // node_modules/monaco-editor/esm/vs/base/common/uint.js
  5401. function toUint8(v) {
  5402. if (v < 0) {
  5403. return 0;
  5404. }
  5405. if (v > 255) {
  5406. return 255;
  5407. }
  5408. return v | 0;
  5409. }
  5410. function toUint32(v) {
  5411. if (v < 0) {
  5412. return 0;
  5413. }
  5414. if (v > 4294967295) {
  5415. return 4294967295;
  5416. }
  5417. return v | 0;
  5418. }
  5419. // node_modules/monaco-editor/esm/vs/editor/common/core/characterClassifier.js
  5420. var CharacterClassifier = class _CharacterClassifier {
  5421. constructor(_defaultValue) {
  5422. const defaultValue = toUint8(_defaultValue);
  5423. this._defaultValue = defaultValue;
  5424. this._asciiMap = _CharacterClassifier._createAsciiMap(defaultValue);
  5425. this._map = /* @__PURE__ */ new Map();
  5426. }
  5427. static _createAsciiMap(defaultValue) {
  5428. const asciiMap = new Uint8Array(256);
  5429. asciiMap.fill(defaultValue);
  5430. return asciiMap;
  5431. }
  5432. set(charCode, _value) {
  5433. const value = toUint8(_value);
  5434. if (charCode >= 0 && charCode < 256) {
  5435. this._asciiMap[charCode] = value;
  5436. } else {
  5437. this._map.set(charCode, value);
  5438. }
  5439. }
  5440. get(charCode) {
  5441. if (charCode >= 0 && charCode < 256) {
  5442. return this._asciiMap[charCode];
  5443. } else {
  5444. return this._map.get(charCode) || this._defaultValue;
  5445. }
  5446. }
  5447. clear() {
  5448. this._asciiMap.fill(this._defaultValue);
  5449. this._map.clear();
  5450. }
  5451. };
  5452. // node_modules/monaco-editor/esm/vs/editor/common/languages/linkComputer.js
  5453. var Uint8Matrix = class {
  5454. constructor(rows, cols, defaultValue) {
  5455. const data = new Uint8Array(rows * cols);
  5456. for (let i = 0, len = rows * cols; i < len; i++) {
  5457. data[i] = defaultValue;
  5458. }
  5459. this._data = data;
  5460. this.rows = rows;
  5461. this.cols = cols;
  5462. }
  5463. get(row, col) {
  5464. return this._data[row * this.cols + col];
  5465. }
  5466. set(row, col, value) {
  5467. this._data[row * this.cols + col] = value;
  5468. }
  5469. };
  5470. var StateMachine = class {
  5471. constructor(edges) {
  5472. let maxCharCode = 0;
  5473. let maxState = 0;
  5474. for (let i = 0, len = edges.length; i < len; i++) {
  5475. const [from, chCode, to] = edges[i];
  5476. if (chCode > maxCharCode) {
  5477. maxCharCode = chCode;
  5478. }
  5479. if (from > maxState) {
  5480. maxState = from;
  5481. }
  5482. if (to > maxState) {
  5483. maxState = to;
  5484. }
  5485. }
  5486. maxCharCode++;
  5487. maxState++;
  5488. const states = new Uint8Matrix(
  5489. maxState,
  5490. maxCharCode,
  5491. 0
  5492. /* State.Invalid */
  5493. );
  5494. for (let i = 0, len = edges.length; i < len; i++) {
  5495. const [from, chCode, to] = edges[i];
  5496. states.set(from, chCode, to);
  5497. }
  5498. this._states = states;
  5499. this._maxCharCode = maxCharCode;
  5500. }
  5501. nextState(currentState, chCode) {
  5502. if (chCode < 0 || chCode >= this._maxCharCode) {
  5503. return 0;
  5504. }
  5505. return this._states.get(currentState, chCode);
  5506. }
  5507. };
  5508. var _stateMachine = null;
  5509. function getStateMachine() {
  5510. if (_stateMachine === null) {
  5511. _stateMachine = new StateMachine([
  5512. [
  5513. 1,
  5514. 104,
  5515. 2
  5516. /* State.H */
  5517. ],
  5518. [
  5519. 1,
  5520. 72,
  5521. 2
  5522. /* State.H */
  5523. ],
  5524. [
  5525. 1,
  5526. 102,
  5527. 6
  5528. /* State.F */
  5529. ],
  5530. [
  5531. 1,
  5532. 70,
  5533. 6
  5534. /* State.F */
  5535. ],
  5536. [
  5537. 2,
  5538. 116,
  5539. 3
  5540. /* State.HT */
  5541. ],
  5542. [
  5543. 2,
  5544. 84,
  5545. 3
  5546. /* State.HT */
  5547. ],
  5548. [
  5549. 3,
  5550. 116,
  5551. 4
  5552. /* State.HTT */
  5553. ],
  5554. [
  5555. 3,
  5556. 84,
  5557. 4
  5558. /* State.HTT */
  5559. ],
  5560. [
  5561. 4,
  5562. 112,
  5563. 5
  5564. /* State.HTTP */
  5565. ],
  5566. [
  5567. 4,
  5568. 80,
  5569. 5
  5570. /* State.HTTP */
  5571. ],
  5572. [
  5573. 5,
  5574. 115,
  5575. 9
  5576. /* State.BeforeColon */
  5577. ],
  5578. [
  5579. 5,
  5580. 83,
  5581. 9
  5582. /* State.BeforeColon */
  5583. ],
  5584. [
  5585. 5,
  5586. 58,
  5587. 10
  5588. /* State.AfterColon */
  5589. ],
  5590. [
  5591. 6,
  5592. 105,
  5593. 7
  5594. /* State.FI */
  5595. ],
  5596. [
  5597. 6,
  5598. 73,
  5599. 7
  5600. /* State.FI */
  5601. ],
  5602. [
  5603. 7,
  5604. 108,
  5605. 8
  5606. /* State.FIL */
  5607. ],
  5608. [
  5609. 7,
  5610. 76,
  5611. 8
  5612. /* State.FIL */
  5613. ],
  5614. [
  5615. 8,
  5616. 101,
  5617. 9
  5618. /* State.BeforeColon */
  5619. ],
  5620. [
  5621. 8,
  5622. 69,
  5623. 9
  5624. /* State.BeforeColon */
  5625. ],
  5626. [
  5627. 9,
  5628. 58,
  5629. 10
  5630. /* State.AfterColon */
  5631. ],
  5632. [
  5633. 10,
  5634. 47,
  5635. 11
  5636. /* State.AlmostThere */
  5637. ],
  5638. [
  5639. 11,
  5640. 47,
  5641. 12
  5642. /* State.End */
  5643. ]
  5644. ]);
  5645. }
  5646. return _stateMachine;
  5647. }
  5648. var _classifier = null;
  5649. function getClassifier() {
  5650. if (_classifier === null) {
  5651. _classifier = new CharacterClassifier(
  5652. 0
  5653. /* CharacterClass.None */
  5654. );
  5655. const FORCE_TERMINATION_CHARACTERS = ` <>'"\u3001\u3002\uFF61\uFF64\uFF0C\uFF0E\uFF1A\uFF1B\u2018\u3008\u300C\u300E\u3014\uFF08\uFF3B\uFF5B\uFF62\uFF63\uFF5D\uFF3D\uFF09\u3015\u300F\u300D\u3009\u2019\uFF40\uFF5E\u2026`;
  5656. for (let i = 0; i < FORCE_TERMINATION_CHARACTERS.length; i++) {
  5657. _classifier.set(
  5658. FORCE_TERMINATION_CHARACTERS.charCodeAt(i),
  5659. 1
  5660. /* CharacterClass.ForceTermination */
  5661. );
  5662. }
  5663. const CANNOT_END_WITH_CHARACTERS = ".,;:";
  5664. for (let i = 0; i < CANNOT_END_WITH_CHARACTERS.length; i++) {
  5665. _classifier.set(
  5666. CANNOT_END_WITH_CHARACTERS.charCodeAt(i),
  5667. 2
  5668. /* CharacterClass.CannotEndIn */
  5669. );
  5670. }
  5671. }
  5672. return _classifier;
  5673. }
  5674. var LinkComputer = class _LinkComputer {
  5675. static _createLink(classifier, line, lineNumber, linkBeginIndex, linkEndIndex) {
  5676. let lastIncludedCharIndex = linkEndIndex - 1;
  5677. do {
  5678. const chCode = line.charCodeAt(lastIncludedCharIndex);
  5679. const chClass = classifier.get(chCode);
  5680. if (chClass !== 2) {
  5681. break;
  5682. }
  5683. lastIncludedCharIndex--;
  5684. } while (lastIncludedCharIndex > linkBeginIndex);
  5685. if (linkBeginIndex > 0) {
  5686. const charCodeBeforeLink = line.charCodeAt(linkBeginIndex - 1);
  5687. const lastCharCodeInLink = line.charCodeAt(lastIncludedCharIndex);
  5688. if (charCodeBeforeLink === 40 && lastCharCodeInLink === 41 || charCodeBeforeLink === 91 && lastCharCodeInLink === 93 || charCodeBeforeLink === 123 && lastCharCodeInLink === 125) {
  5689. lastIncludedCharIndex--;
  5690. }
  5691. }
  5692. return {
  5693. range: {
  5694. startLineNumber: lineNumber,
  5695. startColumn: linkBeginIndex + 1,
  5696. endLineNumber: lineNumber,
  5697. endColumn: lastIncludedCharIndex + 2
  5698. },
  5699. url: line.substring(linkBeginIndex, lastIncludedCharIndex + 1)
  5700. };
  5701. }
  5702. static computeLinks(model, stateMachine = getStateMachine()) {
  5703. const classifier = getClassifier();
  5704. const result = [];
  5705. for (let i = 1, lineCount = model.getLineCount(); i <= lineCount; i++) {
  5706. const line = model.getLineContent(i);
  5707. const len = line.length;
  5708. let j = 0;
  5709. let linkBeginIndex = 0;
  5710. let linkBeginChCode = 0;
  5711. let state = 1;
  5712. let hasOpenParens = false;
  5713. let hasOpenSquareBracket = false;
  5714. let inSquareBrackets = false;
  5715. let hasOpenCurlyBracket = false;
  5716. while (j < len) {
  5717. let resetStateMachine = false;
  5718. const chCode = line.charCodeAt(j);
  5719. if (state === 13) {
  5720. let chClass;
  5721. switch (chCode) {
  5722. case 40:
  5723. hasOpenParens = true;
  5724. chClass = 0;
  5725. break;
  5726. case 41:
  5727. chClass = hasOpenParens ? 0 : 1;
  5728. break;
  5729. case 91:
  5730. inSquareBrackets = true;
  5731. hasOpenSquareBracket = true;
  5732. chClass = 0;
  5733. break;
  5734. case 93:
  5735. inSquareBrackets = false;
  5736. chClass = hasOpenSquareBracket ? 0 : 1;
  5737. break;
  5738. case 123:
  5739. hasOpenCurlyBracket = true;
  5740. chClass = 0;
  5741. break;
  5742. case 125:
  5743. chClass = hasOpenCurlyBracket ? 0 : 1;
  5744. break;
  5745. case 39:
  5746. case 34:
  5747. case 96:
  5748. if (linkBeginChCode === chCode) {
  5749. chClass = 1;
  5750. } else if (linkBeginChCode === 39 || linkBeginChCode === 34 || linkBeginChCode === 96) {
  5751. chClass = 0;
  5752. } else {
  5753. chClass = 1;
  5754. }
  5755. break;
  5756. case 42:
  5757. chClass = linkBeginChCode === 42 ? 1 : 0;
  5758. break;
  5759. case 124:
  5760. chClass = linkBeginChCode === 124 ? 1 : 0;
  5761. break;
  5762. case 32:
  5763. chClass = inSquareBrackets ? 0 : 1;
  5764. break;
  5765. default:
  5766. chClass = classifier.get(chCode);
  5767. }
  5768. if (chClass === 1) {
  5769. result.push(_LinkComputer._createLink(classifier, line, i, linkBeginIndex, j));
  5770. resetStateMachine = true;
  5771. }
  5772. } else if (state === 12) {
  5773. let chClass;
  5774. if (chCode === 91) {
  5775. hasOpenSquareBracket = true;
  5776. chClass = 0;
  5777. } else {
  5778. chClass = classifier.get(chCode);
  5779. }
  5780. if (chClass === 1) {
  5781. resetStateMachine = true;
  5782. } else {
  5783. state = 13;
  5784. }
  5785. } else {
  5786. state = stateMachine.nextState(state, chCode);
  5787. if (state === 0) {
  5788. resetStateMachine = true;
  5789. }
  5790. }
  5791. if (resetStateMachine) {
  5792. state = 1;
  5793. hasOpenParens = false;
  5794. hasOpenSquareBracket = false;
  5795. hasOpenCurlyBracket = false;
  5796. linkBeginIndex = j + 1;
  5797. linkBeginChCode = chCode;
  5798. }
  5799. j++;
  5800. }
  5801. if (state === 13) {
  5802. result.push(_LinkComputer._createLink(classifier, line, i, linkBeginIndex, len));
  5803. }
  5804. }
  5805. return result;
  5806. }
  5807. };
  5808. function computeLinks(model) {
  5809. if (!model || typeof model.getLineCount !== "function" || typeof model.getLineContent !== "function") {
  5810. return [];
  5811. }
  5812. return LinkComputer.computeLinks(model);
  5813. }
  5814. // node_modules/monaco-editor/esm/vs/editor/common/languages/supports/inplaceReplaceSupport.js
  5815. var BasicInplaceReplace = class _BasicInplaceReplace {
  5816. constructor() {
  5817. this._defaultValueSet = [
  5818. ["true", "false"],
  5819. ["True", "False"],
  5820. ["Private", "Public", "Friend", "ReadOnly", "Partial", "Protected", "WriteOnly"],
  5821. ["public", "protected", "private"]
  5822. ];
  5823. }
  5824. static {
  5825. this.INSTANCE = new _BasicInplaceReplace();
  5826. }
  5827. navigateValueSet(range1, text1, range2, text2, up) {
  5828. if (range1 && text1) {
  5829. const result = this.doNavigateValueSet(text1, up);
  5830. if (result) {
  5831. return {
  5832. range: range1,
  5833. value: result
  5834. };
  5835. }
  5836. }
  5837. if (range2 && text2) {
  5838. const result = this.doNavigateValueSet(text2, up);
  5839. if (result) {
  5840. return {
  5841. range: range2,
  5842. value: result
  5843. };
  5844. }
  5845. }
  5846. return null;
  5847. }
  5848. doNavigateValueSet(text, up) {
  5849. const numberResult = this.numberReplace(text, up);
  5850. if (numberResult !== null) {
  5851. return numberResult;
  5852. }
  5853. return this.textReplace(text, up);
  5854. }
  5855. numberReplace(value, up) {
  5856. const precision = Math.pow(10, value.length - (value.lastIndexOf(".") + 1));
  5857. let n1 = Number(value);
  5858. const n2 = parseFloat(value);
  5859. if (!isNaN(n1) && !isNaN(n2) && n1 === n2) {
  5860. if (n1 === 0 && !up) {
  5861. return null;
  5862. } else {
  5863. n1 = Math.floor(n1 * precision);
  5864. n1 += up ? precision : -precision;
  5865. return String(n1 / precision);
  5866. }
  5867. }
  5868. return null;
  5869. }
  5870. textReplace(value, up) {
  5871. return this.valueSetsReplace(this._defaultValueSet, value, up);
  5872. }
  5873. valueSetsReplace(valueSets, value, up) {
  5874. let result = null;
  5875. for (let i = 0, len = valueSets.length; result === null && i < len; i++) {
  5876. result = this.valueSetReplace(valueSets[i], value, up);
  5877. }
  5878. return result;
  5879. }
  5880. valueSetReplace(valueSet, value, up) {
  5881. let idx = valueSet.indexOf(value);
  5882. if (idx >= 0) {
  5883. idx += up ? 1 : -1;
  5884. if (idx < 0) {
  5885. idx = valueSet.length - 1;
  5886. } else {
  5887. idx %= valueSet.length;
  5888. }
  5889. return valueSet[idx];
  5890. }
  5891. return null;
  5892. }
  5893. };
  5894. // node_modules/monaco-editor/esm/vs/base/common/cancellation.js
  5895. var shortcutEvent = Object.freeze(function(callback, context) {
  5896. const handle = setTimeout(callback.bind(context), 0);
  5897. return { dispose() {
  5898. clearTimeout(handle);
  5899. } };
  5900. });
  5901. var CancellationToken;
  5902. (function(CancellationToken2) {
  5903. function isCancellationToken(thing) {
  5904. if (thing === CancellationToken2.None || thing === CancellationToken2.Cancelled) {
  5905. return true;
  5906. }
  5907. if (thing instanceof MutableToken) {
  5908. return true;
  5909. }
  5910. if (!thing || typeof thing !== "object") {
  5911. return false;
  5912. }
  5913. return typeof thing.isCancellationRequested === "boolean" && typeof thing.onCancellationRequested === "function";
  5914. }
  5915. CancellationToken2.isCancellationToken = isCancellationToken;
  5916. CancellationToken2.None = Object.freeze({
  5917. isCancellationRequested: false,
  5918. onCancellationRequested: Event.None
  5919. });
  5920. CancellationToken2.Cancelled = Object.freeze({
  5921. isCancellationRequested: true,
  5922. onCancellationRequested: shortcutEvent
  5923. });
  5924. })(CancellationToken || (CancellationToken = {}));
  5925. var MutableToken = class {
  5926. constructor() {
  5927. this._isCancelled = false;
  5928. this._emitter = null;
  5929. }
  5930. cancel() {
  5931. if (!this._isCancelled) {
  5932. this._isCancelled = true;
  5933. if (this._emitter) {
  5934. this._emitter.fire(void 0);
  5935. this.dispose();
  5936. }
  5937. }
  5938. }
  5939. get isCancellationRequested() {
  5940. return this._isCancelled;
  5941. }
  5942. get onCancellationRequested() {
  5943. if (this._isCancelled) {
  5944. return shortcutEvent;
  5945. }
  5946. if (!this._emitter) {
  5947. this._emitter = new Emitter();
  5948. }
  5949. return this._emitter.event;
  5950. }
  5951. dispose() {
  5952. if (this._emitter) {
  5953. this._emitter.dispose();
  5954. this._emitter = null;
  5955. }
  5956. }
  5957. };
  5958. var CancellationTokenSource = class {
  5959. constructor(parent) {
  5960. this._token = void 0;
  5961. this._parentListener = void 0;
  5962. this._parentListener = parent && parent.onCancellationRequested(this.cancel, this);
  5963. }
  5964. get token() {
  5965. if (!this._token) {
  5966. this._token = new MutableToken();
  5967. }
  5968. return this._token;
  5969. }
  5970. cancel() {
  5971. if (!this._token) {
  5972. this._token = CancellationToken.Cancelled;
  5973. } else if (this._token instanceof MutableToken) {
  5974. this._token.cancel();
  5975. }
  5976. }
  5977. dispose(cancel = false) {
  5978. if (cancel) {
  5979. this.cancel();
  5980. }
  5981. this._parentListener?.dispose();
  5982. if (!this._token) {
  5983. this._token = CancellationToken.None;
  5984. } else if (this._token instanceof MutableToken) {
  5985. this._token.dispose();
  5986. }
  5987. }
  5988. };
  5989. // node_modules/monaco-editor/esm/vs/base/common/keyCodes.js
  5990. var KeyCodeStrMap = class {
  5991. constructor() {
  5992. this._keyCodeToStr = [];
  5993. this._strToKeyCode = /* @__PURE__ */ Object.create(null);
  5994. }
  5995. define(keyCode, str) {
  5996. this._keyCodeToStr[keyCode] = str;
  5997. this._strToKeyCode[str.toLowerCase()] = keyCode;
  5998. }
  5999. keyCodeToStr(keyCode) {
  6000. return this._keyCodeToStr[keyCode];
  6001. }
  6002. strToKeyCode(str) {
  6003. return this._strToKeyCode[str.toLowerCase()] || 0;
  6004. }
  6005. };
  6006. var uiMap = new KeyCodeStrMap();
  6007. var userSettingsUSMap = new KeyCodeStrMap();
  6008. var userSettingsGeneralMap = new KeyCodeStrMap();
  6009. var EVENT_KEY_CODE_MAP = new Array(230);
  6010. var NATIVE_WINDOWS_KEY_CODE_TO_KEY_CODE = {};
  6011. var scanCodeIntToStr = [];
  6012. var scanCodeStrToInt = /* @__PURE__ */ Object.create(null);
  6013. var scanCodeLowerCaseStrToInt = /* @__PURE__ */ Object.create(null);
  6014. var IMMUTABLE_CODE_TO_KEY_CODE = [];
  6015. var IMMUTABLE_KEY_CODE_TO_CODE = [];
  6016. for (let i = 0; i <= 193; i++) {
  6017. IMMUTABLE_CODE_TO_KEY_CODE[i] = -1;
  6018. }
  6019. for (let i = 0; i <= 132; i++) {
  6020. IMMUTABLE_KEY_CODE_TO_CODE[i] = -1;
  6021. }
  6022. (function() {
  6023. const empty = "";
  6024. const mappings = [
  6025. // immutable, scanCode, scanCodeStr, keyCode, keyCodeStr, eventKeyCode, vkey, usUserSettingsLabel, generalUserSettingsLabel
  6026. [1, 0, "None", 0, "unknown", 0, "VK_UNKNOWN", empty, empty],
  6027. [1, 1, "Hyper", 0, empty, 0, empty, empty, empty],
  6028. [1, 2, "Super", 0, empty, 0, empty, empty, empty],
  6029. [1, 3, "Fn", 0, empty, 0, empty, empty, empty],
  6030. [1, 4, "FnLock", 0, empty, 0, empty, empty, empty],
  6031. [1, 5, "Suspend", 0, empty, 0, empty, empty, empty],
  6032. [1, 6, "Resume", 0, empty, 0, empty, empty, empty],
  6033. [1, 7, "Turbo", 0, empty, 0, empty, empty, empty],
  6034. [1, 8, "Sleep", 0, empty, 0, "VK_SLEEP", empty, empty],
  6035. [1, 9, "WakeUp", 0, empty, 0, empty, empty, empty],
  6036. [0, 10, "KeyA", 31, "A", 65, "VK_A", empty, empty],
  6037. [0, 11, "KeyB", 32, "B", 66, "VK_B", empty, empty],
  6038. [0, 12, "KeyC", 33, "C", 67, "VK_C", empty, empty],
  6039. [0, 13, "KeyD", 34, "D", 68, "VK_D", empty, empty],
  6040. [0, 14, "KeyE", 35, "E", 69, "VK_E", empty, empty],
  6041. [0, 15, "KeyF", 36, "F", 70, "VK_F", empty, empty],
  6042. [0, 16, "KeyG", 37, "G", 71, "VK_G", empty, empty],
  6043. [0, 17, "KeyH", 38, "H", 72, "VK_H", empty, empty],
  6044. [0, 18, "KeyI", 39, "I", 73, "VK_I", empty, empty],
  6045. [0, 19, "KeyJ", 40, "J", 74, "VK_J", empty, empty],
  6046. [0, 20, "KeyK", 41, "K", 75, "VK_K", empty, empty],
  6047. [0, 21, "KeyL", 42, "L", 76, "VK_L", empty, empty],
  6048. [0, 22, "KeyM", 43, "M", 77, "VK_M", empty, empty],
  6049. [0, 23, "KeyN", 44, "N", 78, "VK_N", empty, empty],
  6050. [0, 24, "KeyO", 45, "O", 79, "VK_O", empty, empty],
  6051. [0, 25, "KeyP", 46, "P", 80, "VK_P", empty, empty],
  6052. [0, 26, "KeyQ", 47, "Q", 81, "VK_Q", empty, empty],
  6053. [0, 27, "KeyR", 48, "R", 82, "VK_R", empty, empty],
  6054. [0, 28, "KeyS", 49, "S", 83, "VK_S", empty, empty],
  6055. [0, 29, "KeyT", 50, "T", 84, "VK_T", empty, empty],
  6056. [0, 30, "KeyU", 51, "U", 85, "VK_U", empty, empty],
  6057. [0, 31, "KeyV", 52, "V", 86, "VK_V", empty, empty],
  6058. [0, 32, "KeyW", 53, "W", 87, "VK_W", empty, empty],
  6059. [0, 33, "KeyX", 54, "X", 88, "VK_X", empty, empty],
  6060. [0, 34, "KeyY", 55, "Y", 89, "VK_Y", empty, empty],
  6061. [0, 35, "KeyZ", 56, "Z", 90, "VK_Z", empty, empty],
  6062. [0, 36, "Digit1", 22, "1", 49, "VK_1", empty, empty],
  6063. [0, 37, "Digit2", 23, "2", 50, "VK_2", empty, empty],
  6064. [0, 38, "Digit3", 24, "3", 51, "VK_3", empty, empty],
  6065. [0, 39, "Digit4", 25, "4", 52, "VK_4", empty, empty],
  6066. [0, 40, "Digit5", 26, "5", 53, "VK_5", empty, empty],
  6067. [0, 41, "Digit6", 27, "6", 54, "VK_6", empty, empty],
  6068. [0, 42, "Digit7", 28, "7", 55, "VK_7", empty, empty],
  6069. [0, 43, "Digit8", 29, "8", 56, "VK_8", empty, empty],
  6070. [0, 44, "Digit9", 30, "9", 57, "VK_9", empty, empty],
  6071. [0, 45, "Digit0", 21, "0", 48, "VK_0", empty, empty],
  6072. [1, 46, "Enter", 3, "Enter", 13, "VK_RETURN", empty, empty],
  6073. [1, 47, "Escape", 9, "Escape", 27, "VK_ESCAPE", empty, empty],
  6074. [1, 48, "Backspace", 1, "Backspace", 8, "VK_BACK", empty, empty],
  6075. [1, 49, "Tab", 2, "Tab", 9, "VK_TAB", empty, empty],
  6076. [1, 50, "Space", 10, "Space", 32, "VK_SPACE", empty, empty],
  6077. [0, 51, "Minus", 88, "-", 189, "VK_OEM_MINUS", "-", "OEM_MINUS"],
  6078. [0, 52, "Equal", 86, "=", 187, "VK_OEM_PLUS", "=", "OEM_PLUS"],
  6079. [0, 53, "BracketLeft", 92, "[", 219, "VK_OEM_4", "[", "OEM_4"],
  6080. [0, 54, "BracketRight", 94, "]", 221, "VK_OEM_6", "]", "OEM_6"],
  6081. [0, 55, "Backslash", 93, "\\", 220, "VK_OEM_5", "\\", "OEM_5"],
  6082. [0, 56, "IntlHash", 0, empty, 0, empty, empty, empty],
  6083. // has been dropped from the w3c spec
  6084. [0, 57, "Semicolon", 85, ";", 186, "VK_OEM_1", ";", "OEM_1"],
  6085. [0, 58, "Quote", 95, "'", 222, "VK_OEM_7", "'", "OEM_7"],
  6086. [0, 59, "Backquote", 91, "`", 192, "VK_OEM_3", "`", "OEM_3"],
  6087. [0, 60, "Comma", 87, ",", 188, "VK_OEM_COMMA", ",", "OEM_COMMA"],
  6088. [0, 61, "Period", 89, ".", 190, "VK_OEM_PERIOD", ".", "OEM_PERIOD"],
  6089. [0, 62, "Slash", 90, "/", 191, "VK_OEM_2", "/", "OEM_2"],
  6090. [1, 63, "CapsLock", 8, "CapsLock", 20, "VK_CAPITAL", empty, empty],
  6091. [1, 64, "F1", 59, "F1", 112, "VK_F1", empty, empty],
  6092. [1, 65, "F2", 60, "F2", 113, "VK_F2", empty, empty],
  6093. [1, 66, "F3", 61, "F3", 114, "VK_F3", empty, empty],
  6094. [1, 67, "F4", 62, "F4", 115, "VK_F4", empty, empty],
  6095. [1, 68, "F5", 63, "F5", 116, "VK_F5", empty, empty],
  6096. [1, 69, "F6", 64, "F6", 117, "VK_F6", empty, empty],
  6097. [1, 70, "F7", 65, "F7", 118, "VK_F7", empty, empty],
  6098. [1, 71, "F8", 66, "F8", 119, "VK_F8", empty, empty],
  6099. [1, 72, "F9", 67, "F9", 120, "VK_F9", empty, empty],
  6100. [1, 73, "F10", 68, "F10", 121, "VK_F10", empty, empty],
  6101. [1, 74, "F11", 69, "F11", 122, "VK_F11", empty, empty],
  6102. [1, 75, "F12", 70, "F12", 123, "VK_F12", empty, empty],
  6103. [1, 76, "PrintScreen", 0, empty, 0, empty, empty, empty],
  6104. [1, 77, "ScrollLock", 84, "ScrollLock", 145, "VK_SCROLL", empty, empty],
  6105. [1, 78, "Pause", 7, "PauseBreak", 19, "VK_PAUSE", empty, empty],
  6106. [1, 79, "Insert", 19, "Insert", 45, "VK_INSERT", empty, empty],
  6107. [1, 80, "Home", 14, "Home", 36, "VK_HOME", empty, empty],
  6108. [1, 81, "PageUp", 11, "PageUp", 33, "VK_PRIOR", empty, empty],
  6109. [1, 82, "Delete", 20, "Delete", 46, "VK_DELETE", empty, empty],
  6110. [1, 83, "End", 13, "End", 35, "VK_END", empty, empty],
  6111. [1, 84, "PageDown", 12, "PageDown", 34, "VK_NEXT", empty, empty],
  6112. [1, 85, "ArrowRight", 17, "RightArrow", 39, "VK_RIGHT", "Right", empty],
  6113. [1, 86, "ArrowLeft", 15, "LeftArrow", 37, "VK_LEFT", "Left", empty],
  6114. [1, 87, "ArrowDown", 18, "DownArrow", 40, "VK_DOWN", "Down", empty],
  6115. [1, 88, "ArrowUp", 16, "UpArrow", 38, "VK_UP", "Up", empty],
  6116. [1, 89, "NumLock", 83, "NumLock", 144, "VK_NUMLOCK", empty, empty],
  6117. [1, 90, "NumpadDivide", 113, "NumPad_Divide", 111, "VK_DIVIDE", empty, empty],
  6118. [1, 91, "NumpadMultiply", 108, "NumPad_Multiply", 106, "VK_MULTIPLY", empty, empty],
  6119. [1, 92, "NumpadSubtract", 111, "NumPad_Subtract", 109, "VK_SUBTRACT", empty, empty],
  6120. [1, 93, "NumpadAdd", 109, "NumPad_Add", 107, "VK_ADD", empty, empty],
  6121. [1, 94, "NumpadEnter", 3, empty, 0, empty, empty, empty],
  6122. [1, 95, "Numpad1", 99, "NumPad1", 97, "VK_NUMPAD1", empty, empty],
  6123. [1, 96, "Numpad2", 100, "NumPad2", 98, "VK_NUMPAD2", empty, empty],
  6124. [1, 97, "Numpad3", 101, "NumPad3", 99, "VK_NUMPAD3", empty, empty],
  6125. [1, 98, "Numpad4", 102, "NumPad4", 100, "VK_NUMPAD4", empty, empty],
  6126. [1, 99, "Numpad5", 103, "NumPad5", 101, "VK_NUMPAD5", empty, empty],
  6127. [1, 100, "Numpad6", 104, "NumPad6", 102, "VK_NUMPAD6", empty, empty],
  6128. [1, 101, "Numpad7", 105, "NumPad7", 103, "VK_NUMPAD7", empty, empty],
  6129. [1, 102, "Numpad8", 106, "NumPad8", 104, "VK_NUMPAD8", empty, empty],
  6130. [1, 103, "Numpad9", 107, "NumPad9", 105, "VK_NUMPAD9", empty, empty],
  6131. [1, 104, "Numpad0", 98, "NumPad0", 96, "VK_NUMPAD0", empty, empty],
  6132. [1, 105, "NumpadDecimal", 112, "NumPad_Decimal", 110, "VK_DECIMAL", empty, empty],
  6133. [0, 106, "IntlBackslash", 97, "OEM_102", 226, "VK_OEM_102", empty, empty],
  6134. [1, 107, "ContextMenu", 58, "ContextMenu", 93, empty, empty, empty],
  6135. [1, 108, "Power", 0, empty, 0, empty, empty, empty],
  6136. [1, 109, "NumpadEqual", 0, empty, 0, empty, empty, empty],
  6137. [1, 110, "F13", 71, "F13", 124, "VK_F13", empty, empty],
  6138. [1, 111, "F14", 72, "F14", 125, "VK_F14", empty, empty],
  6139. [1, 112, "F15", 73, "F15", 126, "VK_F15", empty, empty],
  6140. [1, 113, "F16", 74, "F16", 127, "VK_F16", empty, empty],
  6141. [1, 114, "F17", 75, "F17", 128, "VK_F17", empty, empty],
  6142. [1, 115, "F18", 76, "F18", 129, "VK_F18", empty, empty],
  6143. [1, 116, "F19", 77, "F19", 130, "VK_F19", empty, empty],
  6144. [1, 117, "F20", 78, "F20", 131, "VK_F20", empty, empty],
  6145. [1, 118, "F21", 79, "F21", 132, "VK_F21", empty, empty],
  6146. [1, 119, "F22", 80, "F22", 133, "VK_F22", empty, empty],
  6147. [1, 120, "F23", 81, "F23", 134, "VK_F23", empty, empty],
  6148. [1, 121, "F24", 82, "F24", 135, "VK_F24", empty, empty],
  6149. [1, 122, "Open", 0, empty, 0, empty, empty, empty],
  6150. [1, 123, "Help", 0, empty, 0, empty, empty, empty],
  6151. [1, 124, "Select", 0, empty, 0, empty, empty, empty],
  6152. [1, 125, "Again", 0, empty, 0, empty, empty, empty],
  6153. [1, 126, "Undo", 0, empty, 0, empty, empty, empty],
  6154. [1, 127, "Cut", 0, empty, 0, empty, empty, empty],
  6155. [1, 128, "Copy", 0, empty, 0, empty, empty, empty],
  6156. [1, 129, "Paste", 0, empty, 0, empty, empty, empty],
  6157. [1, 130, "Find", 0, empty, 0, empty, empty, empty],
  6158. [1, 131, "AudioVolumeMute", 117, "AudioVolumeMute", 173, "VK_VOLUME_MUTE", empty, empty],
  6159. [1, 132, "AudioVolumeUp", 118, "AudioVolumeUp", 175, "VK_VOLUME_UP", empty, empty],
  6160. [1, 133, "AudioVolumeDown", 119, "AudioVolumeDown", 174, "VK_VOLUME_DOWN", empty, empty],
  6161. [1, 134, "NumpadComma", 110, "NumPad_Separator", 108, "VK_SEPARATOR", empty, empty],
  6162. [0, 135, "IntlRo", 115, "ABNT_C1", 193, "VK_ABNT_C1", empty, empty],
  6163. [1, 136, "KanaMode", 0, empty, 0, empty, empty, empty],
  6164. [0, 137, "IntlYen", 0, empty, 0, empty, empty, empty],
  6165. [1, 138, "Convert", 0, empty, 0, empty, empty, empty],
  6166. [1, 139, "NonConvert", 0, empty, 0, empty, empty, empty],
  6167. [1, 140, "Lang1", 0, empty, 0, empty, empty, empty],
  6168. [1, 141, "Lang2", 0, empty, 0, empty, empty, empty],
  6169. [1, 142, "Lang3", 0, empty, 0, empty, empty, empty],
  6170. [1, 143, "Lang4", 0, empty, 0, empty, empty, empty],
  6171. [1, 144, "Lang5", 0, empty, 0, empty, empty, empty],
  6172. [1, 145, "Abort", 0, empty, 0, empty, empty, empty],
  6173. [1, 146, "Props", 0, empty, 0, empty, empty, empty],
  6174. [1, 147, "NumpadParenLeft", 0, empty, 0, empty, empty, empty],
  6175. [1, 148, "NumpadParenRight", 0, empty, 0, empty, empty, empty],
  6176. [1, 149, "NumpadBackspace", 0, empty, 0, empty, empty, empty],
  6177. [1, 150, "NumpadMemoryStore", 0, empty, 0, empty, empty, empty],
  6178. [1, 151, "NumpadMemoryRecall", 0, empty, 0, empty, empty, empty],
  6179. [1, 152, "NumpadMemoryClear", 0, empty, 0, empty, empty, empty],
  6180. [1, 153, "NumpadMemoryAdd", 0, empty, 0, empty, empty, empty],
  6181. [1, 154, "NumpadMemorySubtract", 0, empty, 0, empty, empty, empty],
  6182. [1, 155, "NumpadClear", 131, "Clear", 12, "VK_CLEAR", empty, empty],
  6183. [1, 156, "NumpadClearEntry", 0, empty, 0, empty, empty, empty],
  6184. [1, 0, empty, 5, "Ctrl", 17, "VK_CONTROL", empty, empty],
  6185. [1, 0, empty, 4, "Shift", 16, "VK_SHIFT", empty, empty],
  6186. [1, 0, empty, 6, "Alt", 18, "VK_MENU", empty, empty],
  6187. [1, 0, empty, 57, "Meta", 91, "VK_COMMAND", empty, empty],
  6188. [1, 157, "ControlLeft", 5, empty, 0, "VK_LCONTROL", empty, empty],
  6189. [1, 158, "ShiftLeft", 4, empty, 0, "VK_LSHIFT", empty, empty],
  6190. [1, 159, "AltLeft", 6, empty, 0, "VK_LMENU", empty, empty],
  6191. [1, 160, "MetaLeft", 57, empty, 0, "VK_LWIN", empty, empty],
  6192. [1, 161, "ControlRight", 5, empty, 0, "VK_RCONTROL", empty, empty],
  6193. [1, 162, "ShiftRight", 4, empty, 0, "VK_RSHIFT", empty, empty],
  6194. [1, 163, "AltRight", 6, empty, 0, "VK_RMENU", empty, empty],
  6195. [1, 164, "MetaRight", 57, empty, 0, "VK_RWIN", empty, empty],
  6196. [1, 165, "BrightnessUp", 0, empty, 0, empty, empty, empty],
  6197. [1, 166, "BrightnessDown", 0, empty, 0, empty, empty, empty],
  6198. [1, 167, "MediaPlay", 0, empty, 0, empty, empty, empty],
  6199. [1, 168, "MediaRecord", 0, empty, 0, empty, empty, empty],
  6200. [1, 169, "MediaFastForward", 0, empty, 0, empty, empty, empty],
  6201. [1, 170, "MediaRewind", 0, empty, 0, empty, empty, empty],
  6202. [1, 171, "MediaTrackNext", 124, "MediaTrackNext", 176, "VK_MEDIA_NEXT_TRACK", empty, empty],
  6203. [1, 172, "MediaTrackPrevious", 125, "MediaTrackPrevious", 177, "VK_MEDIA_PREV_TRACK", empty, empty],
  6204. [1, 173, "MediaStop", 126, "MediaStop", 178, "VK_MEDIA_STOP", empty, empty],
  6205. [1, 174, "Eject", 0, empty, 0, empty, empty, empty],
  6206. [1, 175, "MediaPlayPause", 127, "MediaPlayPause", 179, "VK_MEDIA_PLAY_PAUSE", empty, empty],
  6207. [1, 176, "MediaSelect", 128, "LaunchMediaPlayer", 181, "VK_MEDIA_LAUNCH_MEDIA_SELECT", empty, empty],
  6208. [1, 177, "LaunchMail", 129, "LaunchMail", 180, "VK_MEDIA_LAUNCH_MAIL", empty, empty],
  6209. [1, 178, "LaunchApp2", 130, "LaunchApp2", 183, "VK_MEDIA_LAUNCH_APP2", empty, empty],
  6210. [1, 179, "LaunchApp1", 0, empty, 0, "VK_MEDIA_LAUNCH_APP1", empty, empty],
  6211. [1, 180, "SelectTask", 0, empty, 0, empty, empty, empty],
  6212. [1, 181, "LaunchScreenSaver", 0, empty, 0, empty, empty, empty],
  6213. [1, 182, "BrowserSearch", 120, "BrowserSearch", 170, "VK_BROWSER_SEARCH", empty, empty],
  6214. [1, 183, "BrowserHome", 121, "BrowserHome", 172, "VK_BROWSER_HOME", empty, empty],
  6215. [1, 184, "BrowserBack", 122, "BrowserBack", 166, "VK_BROWSER_BACK", empty, empty],
  6216. [1, 185, "BrowserForward", 123, "BrowserForward", 167, "VK_BROWSER_FORWARD", empty, empty],
  6217. [1, 186, "BrowserStop", 0, empty, 0, "VK_BROWSER_STOP", empty, empty],
  6218. [1, 187, "BrowserRefresh", 0, empty, 0, "VK_BROWSER_REFRESH", empty, empty],
  6219. [1, 188, "BrowserFavorites", 0, empty, 0, "VK_BROWSER_FAVORITES", empty, empty],
  6220. [1, 189, "ZoomToggle", 0, empty, 0, empty, empty, empty],
  6221. [1, 190, "MailReply", 0, empty, 0, empty, empty, empty],
  6222. [1, 191, "MailForward", 0, empty, 0, empty, empty, empty],
  6223. [1, 192, "MailSend", 0, empty, 0, empty, empty, empty],
  6224. // See https://lists.w3.org/Archives/Public/www-dom/2010JulSep/att-0182/keyCode-spec.html
  6225. // If an Input Method Editor is processing key input and the event is keydown, return 229.
  6226. [1, 0, empty, 114, "KeyInComposition", 229, empty, empty, empty],
  6227. [1, 0, empty, 116, "ABNT_C2", 194, "VK_ABNT_C2", empty, empty],
  6228. [1, 0, empty, 96, "OEM_8", 223, "VK_OEM_8", empty, empty],
  6229. [1, 0, empty, 0, empty, 0, "VK_KANA", empty, empty],
  6230. [1, 0, empty, 0, empty, 0, "VK_HANGUL", empty, empty],
  6231. [1, 0, empty, 0, empty, 0, "VK_JUNJA", empty, empty],
  6232. [1, 0, empty, 0, empty, 0, "VK_FINAL", empty, empty],
  6233. [1, 0, empty, 0, empty, 0, "VK_HANJA", empty, empty],
  6234. [1, 0, empty, 0, empty, 0, "VK_KANJI", empty, empty],
  6235. [1, 0, empty, 0, empty, 0, "VK_CONVERT", empty, empty],
  6236. [1, 0, empty, 0, empty, 0, "VK_NONCONVERT", empty, empty],
  6237. [1, 0, empty, 0, empty, 0, "VK_ACCEPT", empty, empty],
  6238. [1, 0, empty, 0, empty, 0, "VK_MODECHANGE", empty, empty],
  6239. [1, 0, empty, 0, empty, 0, "VK_SELECT", empty, empty],
  6240. [1, 0, empty, 0, empty, 0, "VK_PRINT", empty, empty],
  6241. [1, 0, empty, 0, empty, 0, "VK_EXECUTE", empty, empty],
  6242. [1, 0, empty, 0, empty, 0, "VK_SNAPSHOT", empty, empty],
  6243. [1, 0, empty, 0, empty, 0, "VK_HELP", empty, empty],
  6244. [1, 0, empty, 0, empty, 0, "VK_APPS", empty, empty],
  6245. [1, 0, empty, 0, empty, 0, "VK_PROCESSKEY", empty, empty],
  6246. [1, 0, empty, 0, empty, 0, "VK_PACKET", empty, empty],
  6247. [1, 0, empty, 0, empty, 0, "VK_DBE_SBCSCHAR", empty, empty],
  6248. [1, 0, empty, 0, empty, 0, "VK_DBE_DBCSCHAR", empty, empty],
  6249. [1, 0, empty, 0, empty, 0, "VK_ATTN", empty, empty],
  6250. [1, 0, empty, 0, empty, 0, "VK_CRSEL", empty, empty],
  6251. [1, 0, empty, 0, empty, 0, "VK_EXSEL", empty, empty],
  6252. [1, 0, empty, 0, empty, 0, "VK_EREOF", empty, empty],
  6253. [1, 0, empty, 0, empty, 0, "VK_PLAY", empty, empty],
  6254. [1, 0, empty, 0, empty, 0, "VK_ZOOM", empty, empty],
  6255. [1, 0, empty, 0, empty, 0, "VK_NONAME", empty, empty],
  6256. [1, 0, empty, 0, empty, 0, "VK_PA1", empty, empty],
  6257. [1, 0, empty, 0, empty, 0, "VK_OEM_CLEAR", empty, empty]
  6258. ];
  6259. const seenKeyCode = [];
  6260. const seenScanCode = [];
  6261. for (const mapping of mappings) {
  6262. const [immutable, scanCode, scanCodeStr, keyCode, keyCodeStr, eventKeyCode, vkey, usUserSettingsLabel, generalUserSettingsLabel] = mapping;
  6263. if (!seenScanCode[scanCode]) {
  6264. seenScanCode[scanCode] = true;
  6265. scanCodeIntToStr[scanCode] = scanCodeStr;
  6266. scanCodeStrToInt[scanCodeStr] = scanCode;
  6267. scanCodeLowerCaseStrToInt[scanCodeStr.toLowerCase()] = scanCode;
  6268. if (immutable) {
  6269. IMMUTABLE_CODE_TO_KEY_CODE[scanCode] = keyCode;
  6270. if (keyCode !== 0 && keyCode !== 3 && keyCode !== 5 && keyCode !== 4 && keyCode !== 6 && keyCode !== 57) {
  6271. IMMUTABLE_KEY_CODE_TO_CODE[keyCode] = scanCode;
  6272. }
  6273. }
  6274. }
  6275. if (!seenKeyCode[keyCode]) {
  6276. seenKeyCode[keyCode] = true;
  6277. if (!keyCodeStr) {
  6278. throw new Error(`String representation missing for key code ${keyCode} around scan code ${scanCodeStr}`);
  6279. }
  6280. uiMap.define(keyCode, keyCodeStr);
  6281. userSettingsUSMap.define(keyCode, usUserSettingsLabel || keyCodeStr);
  6282. userSettingsGeneralMap.define(keyCode, generalUserSettingsLabel || usUserSettingsLabel || keyCodeStr);
  6283. }
  6284. if (eventKeyCode) {
  6285. EVENT_KEY_CODE_MAP[eventKeyCode] = keyCode;
  6286. }
  6287. if (vkey) {
  6288. NATIVE_WINDOWS_KEY_CODE_TO_KEY_CODE[vkey] = keyCode;
  6289. }
  6290. }
  6291. IMMUTABLE_KEY_CODE_TO_CODE[
  6292. 3
  6293. /* KeyCode.Enter */
  6294. ] = 46;
  6295. })();
  6296. var KeyCodeUtils;
  6297. (function(KeyCodeUtils2) {
  6298. function toString(keyCode) {
  6299. return uiMap.keyCodeToStr(keyCode);
  6300. }
  6301. KeyCodeUtils2.toString = toString;
  6302. function fromString(key) {
  6303. return uiMap.strToKeyCode(key);
  6304. }
  6305. KeyCodeUtils2.fromString = fromString;
  6306. function toUserSettingsUS(keyCode) {
  6307. return userSettingsUSMap.keyCodeToStr(keyCode);
  6308. }
  6309. KeyCodeUtils2.toUserSettingsUS = toUserSettingsUS;
  6310. function toUserSettingsGeneral(keyCode) {
  6311. return userSettingsGeneralMap.keyCodeToStr(keyCode);
  6312. }
  6313. KeyCodeUtils2.toUserSettingsGeneral = toUserSettingsGeneral;
  6314. function fromUserSettings(key) {
  6315. return userSettingsUSMap.strToKeyCode(key) || userSettingsGeneralMap.strToKeyCode(key);
  6316. }
  6317. KeyCodeUtils2.fromUserSettings = fromUserSettings;
  6318. function toElectronAccelerator(keyCode) {
  6319. if (keyCode >= 98 && keyCode <= 113) {
  6320. return null;
  6321. }
  6322. switch (keyCode) {
  6323. case 16:
  6324. return "Up";
  6325. case 18:
  6326. return "Down";
  6327. case 15:
  6328. return "Left";
  6329. case 17:
  6330. return "Right";
  6331. }
  6332. return uiMap.keyCodeToStr(keyCode);
  6333. }
  6334. KeyCodeUtils2.toElectronAccelerator = toElectronAccelerator;
  6335. })(KeyCodeUtils || (KeyCodeUtils = {}));
  6336. function KeyChord(firstPart, secondPart) {
  6337. const chordPart = (secondPart & 65535) << 16 >>> 0;
  6338. return (firstPart | chordPart) >>> 0;
  6339. }
  6340. // node_modules/monaco-editor/esm/vs/editor/common/core/selection.js
  6341. var Selection = class _Selection extends Range {
  6342. constructor(selectionStartLineNumber, selectionStartColumn, positionLineNumber, positionColumn) {
  6343. super(selectionStartLineNumber, selectionStartColumn, positionLineNumber, positionColumn);
  6344. this.selectionStartLineNumber = selectionStartLineNumber;
  6345. this.selectionStartColumn = selectionStartColumn;
  6346. this.positionLineNumber = positionLineNumber;
  6347. this.positionColumn = positionColumn;
  6348. }
  6349. /**
  6350. * Transform to a human-readable representation.
  6351. */
  6352. toString() {
  6353. return "[" + this.selectionStartLineNumber + "," + this.selectionStartColumn + " -> " + this.positionLineNumber + "," + this.positionColumn + "]";
  6354. }
  6355. /**
  6356. * Test if equals other selection.
  6357. */
  6358. equalsSelection(other) {
  6359. return _Selection.selectionsEqual(this, other);
  6360. }
  6361. /**
  6362. * Test if the two selections are equal.
  6363. */
  6364. static selectionsEqual(a, b) {
  6365. return a.selectionStartLineNumber === b.selectionStartLineNumber && a.selectionStartColumn === b.selectionStartColumn && a.positionLineNumber === b.positionLineNumber && a.positionColumn === b.positionColumn;
  6366. }
  6367. /**
  6368. * Get directions (LTR or RTL).
  6369. */
  6370. getDirection() {
  6371. if (this.selectionStartLineNumber === this.startLineNumber && this.selectionStartColumn === this.startColumn) {
  6372. return 0;
  6373. }
  6374. return 1;
  6375. }
  6376. /**
  6377. * Create a new selection with a different `positionLineNumber` and `positionColumn`.
  6378. */
  6379. setEndPosition(endLineNumber, endColumn) {
  6380. if (this.getDirection() === 0) {
  6381. return new _Selection(this.startLineNumber, this.startColumn, endLineNumber, endColumn);
  6382. }
  6383. return new _Selection(endLineNumber, endColumn, this.startLineNumber, this.startColumn);
  6384. }
  6385. /**
  6386. * Get the position at `positionLineNumber` and `positionColumn`.
  6387. */
  6388. getPosition() {
  6389. return new Position(this.positionLineNumber, this.positionColumn);
  6390. }
  6391. /**
  6392. * Get the position at the start of the selection.
  6393. */
  6394. getSelectionStart() {
  6395. return new Position(this.selectionStartLineNumber, this.selectionStartColumn);
  6396. }
  6397. /**
  6398. * Create a new selection with a different `selectionStartLineNumber` and `selectionStartColumn`.
  6399. */
  6400. setStartPosition(startLineNumber, startColumn) {
  6401. if (this.getDirection() === 0) {
  6402. return new _Selection(startLineNumber, startColumn, this.endLineNumber, this.endColumn);
  6403. }
  6404. return new _Selection(this.endLineNumber, this.endColumn, startLineNumber, startColumn);
  6405. }
  6406. // ----
  6407. /**
  6408. * Create a `Selection` from one or two positions
  6409. */
  6410. static fromPositions(start, end = start) {
  6411. return new _Selection(start.lineNumber, start.column, end.lineNumber, end.column);
  6412. }
  6413. /**
  6414. * Creates a `Selection` from a range, given a direction.
  6415. */
  6416. static fromRange(range, direction) {
  6417. if (direction === 0) {
  6418. return new _Selection(range.startLineNumber, range.startColumn, range.endLineNumber, range.endColumn);
  6419. } else {
  6420. return new _Selection(range.endLineNumber, range.endColumn, range.startLineNumber, range.startColumn);
  6421. }
  6422. }
  6423. /**
  6424. * Create a `Selection` from an `ISelection`.
  6425. */
  6426. static liftSelection(sel) {
  6427. return new _Selection(sel.selectionStartLineNumber, sel.selectionStartColumn, sel.positionLineNumber, sel.positionColumn);
  6428. }
  6429. /**
  6430. * `a` equals `b`.
  6431. */
  6432. static selectionsArrEqual(a, b) {
  6433. if (a && !b || !a && b) {
  6434. return false;
  6435. }
  6436. if (!a && !b) {
  6437. return true;
  6438. }
  6439. if (a.length !== b.length) {
  6440. return false;
  6441. }
  6442. for (let i = 0, len = a.length; i < len; i++) {
  6443. if (!this.selectionsEqual(a[i], b[i])) {
  6444. return false;
  6445. }
  6446. }
  6447. return true;
  6448. }
  6449. /**
  6450. * Test if `obj` is an `ISelection`.
  6451. */
  6452. static isISelection(obj) {
  6453. return obj && typeof obj.selectionStartLineNumber === "number" && typeof obj.selectionStartColumn === "number" && typeof obj.positionLineNumber === "number" && typeof obj.positionColumn === "number";
  6454. }
  6455. /**
  6456. * Create with a direction.
  6457. */
  6458. static createWithDirection(startLineNumber, startColumn, endLineNumber, endColumn, direction) {
  6459. if (direction === 0) {
  6460. return new _Selection(startLineNumber, startColumn, endLineNumber, endColumn);
  6461. }
  6462. return new _Selection(endLineNumber, endColumn, startLineNumber, startColumn);
  6463. }
  6464. };
  6465. // node_modules/monaco-editor/esm/vs/base/common/types.js
  6466. function isString(str) {
  6467. return typeof str === "string";
  6468. }
  6469. // node_modules/monaco-editor/esm/vs/base/common/codiconsUtil.js
  6470. var _codiconFontCharacters = /* @__PURE__ */ Object.create(null);
  6471. function register(id, fontCharacter) {
  6472. if (isString(fontCharacter)) {
  6473. const val = _codiconFontCharacters[fontCharacter];
  6474. if (val === void 0) {
  6475. throw new Error(`${id} references an unknown codicon: ${fontCharacter}`);
  6476. }
  6477. fontCharacter = val;
  6478. }
  6479. _codiconFontCharacters[id] = fontCharacter;
  6480. return { id };
  6481. }
  6482. // node_modules/monaco-editor/esm/vs/base/common/codiconsLibrary.js
  6483. var codiconsLibrary = {
  6484. add: register("add", 6e4),
  6485. plus: register("plus", 6e4),
  6486. gistNew: register("gist-new", 6e4),
  6487. repoCreate: register("repo-create", 6e4),
  6488. lightbulb: register("lightbulb", 60001),
  6489. lightBulb: register("light-bulb", 60001),
  6490. repo: register("repo", 60002),
  6491. repoDelete: register("repo-delete", 60002),
  6492. gistFork: register("gist-fork", 60003),
  6493. repoForked: register("repo-forked", 60003),
  6494. gitPullRequest: register("git-pull-request", 60004),
  6495. gitPullRequestAbandoned: register("git-pull-request-abandoned", 60004),
  6496. recordKeys: register("record-keys", 60005),
  6497. keyboard: register("keyboard", 60005),
  6498. tag: register("tag", 60006),
  6499. gitPullRequestLabel: register("git-pull-request-label", 60006),
  6500. tagAdd: register("tag-add", 60006),
  6501. tagRemove: register("tag-remove", 60006),
  6502. person: register("person", 60007),
  6503. personFollow: register("person-follow", 60007),
  6504. personOutline: register("person-outline", 60007),
  6505. personFilled: register("person-filled", 60007),
  6506. gitBranch: register("git-branch", 60008),
  6507. gitBranchCreate: register("git-branch-create", 60008),
  6508. gitBranchDelete: register("git-branch-delete", 60008),
  6509. sourceControl: register("source-control", 60008),
  6510. mirror: register("mirror", 60009),
  6511. mirrorPublic: register("mirror-public", 60009),
  6512. star: register("star", 60010),
  6513. starAdd: register("star-add", 60010),
  6514. starDelete: register("star-delete", 60010),
  6515. starEmpty: register("star-empty", 60010),
  6516. comment: register("comment", 60011),
  6517. commentAdd: register("comment-add", 60011),
  6518. alert: register("alert", 60012),
  6519. warning: register("warning", 60012),
  6520. search: register("search", 60013),
  6521. searchSave: register("search-save", 60013),
  6522. logOut: register("log-out", 60014),
  6523. signOut: register("sign-out", 60014),
  6524. logIn: register("log-in", 60015),
  6525. signIn: register("sign-in", 60015),
  6526. eye: register("eye", 60016),
  6527. eyeUnwatch: register("eye-unwatch", 60016),
  6528. eyeWatch: register("eye-watch", 60016),
  6529. circleFilled: register("circle-filled", 60017),
  6530. primitiveDot: register("primitive-dot", 60017),
  6531. closeDirty: register("close-dirty", 60017),
  6532. debugBreakpoint: register("debug-breakpoint", 60017),
  6533. debugBreakpointDisabled: register("debug-breakpoint-disabled", 60017),
  6534. debugHint: register("debug-hint", 60017),
  6535. terminalDecorationSuccess: register("terminal-decoration-success", 60017),
  6536. primitiveSquare: register("primitive-square", 60018),
  6537. edit: register("edit", 60019),
  6538. pencil: register("pencil", 60019),
  6539. info: register("info", 60020),
  6540. issueOpened: register("issue-opened", 60020),
  6541. gistPrivate: register("gist-private", 60021),
  6542. gitForkPrivate: register("git-fork-private", 60021),
  6543. lock: register("lock", 60021),
  6544. mirrorPrivate: register("mirror-private", 60021),
  6545. close: register("close", 60022),
  6546. removeClose: register("remove-close", 60022),
  6547. x: register("x", 60022),
  6548. repoSync: register("repo-sync", 60023),
  6549. sync: register("sync", 60023),
  6550. clone: register("clone", 60024),
  6551. desktopDownload: register("desktop-download", 60024),
  6552. beaker: register("beaker", 60025),
  6553. microscope: register("microscope", 60025),
  6554. vm: register("vm", 60026),
  6555. deviceDesktop: register("device-desktop", 60026),
  6556. file: register("file", 60027),
  6557. fileText: register("file-text", 60027),
  6558. more: register("more", 60028),
  6559. ellipsis: register("ellipsis", 60028),
  6560. kebabHorizontal: register("kebab-horizontal", 60028),
  6561. mailReply: register("mail-reply", 60029),
  6562. reply: register("reply", 60029),
  6563. organization: register("organization", 60030),
  6564. organizationFilled: register("organization-filled", 60030),
  6565. organizationOutline: register("organization-outline", 60030),
  6566. newFile: register("new-file", 60031),
  6567. fileAdd: register("file-add", 60031),
  6568. newFolder: register("new-folder", 60032),
  6569. fileDirectoryCreate: register("file-directory-create", 60032),
  6570. trash: register("trash", 60033),
  6571. trashcan: register("trashcan", 60033),
  6572. history: register("history", 60034),
  6573. clock: register("clock", 60034),
  6574. folder: register("folder", 60035),
  6575. fileDirectory: register("file-directory", 60035),
  6576. symbolFolder: register("symbol-folder", 60035),
  6577. logoGithub: register("logo-github", 60036),
  6578. markGithub: register("mark-github", 60036),
  6579. github: register("github", 60036),
  6580. terminal: register("terminal", 60037),
  6581. console: register("console", 60037),
  6582. repl: register("repl", 60037),
  6583. zap: register("zap", 60038),
  6584. symbolEvent: register("symbol-event", 60038),
  6585. error: register("error", 60039),
  6586. stop: register("stop", 60039),
  6587. variable: register("variable", 60040),
  6588. symbolVariable: register("symbol-variable", 60040),
  6589. array: register("array", 60042),
  6590. symbolArray: register("symbol-array", 60042),
  6591. symbolModule: register("symbol-module", 60043),
  6592. symbolPackage: register("symbol-package", 60043),
  6593. symbolNamespace: register("symbol-namespace", 60043),
  6594. symbolObject: register("symbol-object", 60043),
  6595. symbolMethod: register("symbol-method", 60044),
  6596. symbolFunction: register("symbol-function", 60044),
  6597. symbolConstructor: register("symbol-constructor", 60044),
  6598. symbolBoolean: register("symbol-boolean", 60047),
  6599. symbolNull: register("symbol-null", 60047),
  6600. symbolNumeric: register("symbol-numeric", 60048),
  6601. symbolNumber: register("symbol-number", 60048),
  6602. symbolStructure: register("symbol-structure", 60049),
  6603. symbolStruct: register("symbol-struct", 60049),
  6604. symbolParameter: register("symbol-parameter", 60050),
  6605. symbolTypeParameter: register("symbol-type-parameter", 60050),
  6606. symbolKey: register("symbol-key", 60051),
  6607. symbolText: register("symbol-text", 60051),
  6608. symbolReference: register("symbol-reference", 60052),
  6609. goToFile: register("go-to-file", 60052),
  6610. symbolEnum: register("symbol-enum", 60053),
  6611. symbolValue: register("symbol-value", 60053),
  6612. symbolRuler: register("symbol-ruler", 60054),
  6613. symbolUnit: register("symbol-unit", 60054),
  6614. activateBreakpoints: register("activate-breakpoints", 60055),
  6615. archive: register("archive", 60056),
  6616. arrowBoth: register("arrow-both", 60057),
  6617. arrowDown: register("arrow-down", 60058),
  6618. arrowLeft: register("arrow-left", 60059),
  6619. arrowRight: register("arrow-right", 60060),
  6620. arrowSmallDown: register("arrow-small-down", 60061),
  6621. arrowSmallLeft: register("arrow-small-left", 60062),
  6622. arrowSmallRight: register("arrow-small-right", 60063),
  6623. arrowSmallUp: register("arrow-small-up", 60064),
  6624. arrowUp: register("arrow-up", 60065),
  6625. bell: register("bell", 60066),
  6626. bold: register("bold", 60067),
  6627. book: register("book", 60068),
  6628. bookmark: register("bookmark", 60069),
  6629. debugBreakpointConditionalUnverified: register("debug-breakpoint-conditional-unverified", 60070),
  6630. debugBreakpointConditional: register("debug-breakpoint-conditional", 60071),
  6631. debugBreakpointConditionalDisabled: register("debug-breakpoint-conditional-disabled", 60071),
  6632. debugBreakpointDataUnverified: register("debug-breakpoint-data-unverified", 60072),
  6633. debugBreakpointData: register("debug-breakpoint-data", 60073),
  6634. debugBreakpointDataDisabled: register("debug-breakpoint-data-disabled", 60073),
  6635. debugBreakpointLogUnverified: register("debug-breakpoint-log-unverified", 60074),
  6636. debugBreakpointLog: register("debug-breakpoint-log", 60075),
  6637. debugBreakpointLogDisabled: register("debug-breakpoint-log-disabled", 60075),
  6638. briefcase: register("briefcase", 60076),
  6639. broadcast: register("broadcast", 60077),
  6640. browser: register("browser", 60078),
  6641. bug: register("bug", 60079),
  6642. calendar: register("calendar", 60080),
  6643. caseSensitive: register("case-sensitive", 60081),
  6644. check: register("check", 60082),
  6645. checklist: register("checklist", 60083),
  6646. chevronDown: register("chevron-down", 60084),
  6647. chevronLeft: register("chevron-left", 60085),
  6648. chevronRight: register("chevron-right", 60086),
  6649. chevronUp: register("chevron-up", 60087),
  6650. chromeClose: register("chrome-close", 60088),
  6651. chromeMaximize: register("chrome-maximize", 60089),
  6652. chromeMinimize: register("chrome-minimize", 60090),
  6653. chromeRestore: register("chrome-restore", 60091),
  6654. circleOutline: register("circle-outline", 60092),
  6655. circle: register("circle", 60092),
  6656. debugBreakpointUnverified: register("debug-breakpoint-unverified", 60092),
  6657. terminalDecorationIncomplete: register("terminal-decoration-incomplete", 60092),
  6658. circleSlash: register("circle-slash", 60093),
  6659. circuitBoard: register("circuit-board", 60094),
  6660. clearAll: register("clear-all", 60095),
  6661. clippy: register("clippy", 60096),
  6662. closeAll: register("close-all", 60097),
  6663. cloudDownload: register("cloud-download", 60098),
  6664. cloudUpload: register("cloud-upload", 60099),
  6665. code: register("code", 60100),
  6666. collapseAll: register("collapse-all", 60101),
  6667. colorMode: register("color-mode", 60102),
  6668. commentDiscussion: register("comment-discussion", 60103),
  6669. creditCard: register("credit-card", 60105),
  6670. dash: register("dash", 60108),
  6671. dashboard: register("dashboard", 60109),
  6672. database: register("database", 60110),
  6673. debugContinue: register("debug-continue", 60111),
  6674. debugDisconnect: register("debug-disconnect", 60112),
  6675. debugPause: register("debug-pause", 60113),
  6676. debugRestart: register("debug-restart", 60114),
  6677. debugStart: register("debug-start", 60115),
  6678. debugStepInto: register("debug-step-into", 60116),
  6679. debugStepOut: register("debug-step-out", 60117),
  6680. debugStepOver: register("debug-step-over", 60118),
  6681. debugStop: register("debug-stop", 60119),
  6682. debug: register("debug", 60120),
  6683. deviceCameraVideo: register("device-camera-video", 60121),
  6684. deviceCamera: register("device-camera", 60122),
  6685. deviceMobile: register("device-mobile", 60123),
  6686. diffAdded: register("diff-added", 60124),
  6687. diffIgnored: register("diff-ignored", 60125),
  6688. diffModified: register("diff-modified", 60126),
  6689. diffRemoved: register("diff-removed", 60127),
  6690. diffRenamed: register("diff-renamed", 60128),
  6691. diff: register("diff", 60129),
  6692. diffSidebyside: register("diff-sidebyside", 60129),
  6693. discard: register("discard", 60130),
  6694. editorLayout: register("editor-layout", 60131),
  6695. emptyWindow: register("empty-window", 60132),
  6696. exclude: register("exclude", 60133),
  6697. extensions: register("extensions", 60134),
  6698. eyeClosed: register("eye-closed", 60135),
  6699. fileBinary: register("file-binary", 60136),
  6700. fileCode: register("file-code", 60137),
  6701. fileMedia: register("file-media", 60138),
  6702. filePdf: register("file-pdf", 60139),
  6703. fileSubmodule: register("file-submodule", 60140),
  6704. fileSymlinkDirectory: register("file-symlink-directory", 60141),
  6705. fileSymlinkFile: register("file-symlink-file", 60142),
  6706. fileZip: register("file-zip", 60143),
  6707. files: register("files", 60144),
  6708. filter: register("filter", 60145),
  6709. flame: register("flame", 60146),
  6710. foldDown: register("fold-down", 60147),
  6711. foldUp: register("fold-up", 60148),
  6712. fold: register("fold", 60149),
  6713. folderActive: register("folder-active", 60150),
  6714. folderOpened: register("folder-opened", 60151),
  6715. gear: register("gear", 60152),
  6716. gift: register("gift", 60153),
  6717. gistSecret: register("gist-secret", 60154),
  6718. gist: register("gist", 60155),
  6719. gitCommit: register("git-commit", 60156),
  6720. gitCompare: register("git-compare", 60157),
  6721. compareChanges: register("compare-changes", 60157),
  6722. gitMerge: register("git-merge", 60158),
  6723. githubAction: register("github-action", 60159),
  6724. githubAlt: register("github-alt", 60160),
  6725. globe: register("globe", 60161),
  6726. grabber: register("grabber", 60162),
  6727. graph: register("graph", 60163),
  6728. gripper: register("gripper", 60164),
  6729. heart: register("heart", 60165),
  6730. home: register("home", 60166),
  6731. horizontalRule: register("horizontal-rule", 60167),
  6732. hubot: register("hubot", 60168),
  6733. inbox: register("inbox", 60169),
  6734. issueReopened: register("issue-reopened", 60171),
  6735. issues: register("issues", 60172),
  6736. italic: register("italic", 60173),
  6737. jersey: register("jersey", 60174),
  6738. json: register("json", 60175),
  6739. kebabVertical: register("kebab-vertical", 60176),
  6740. key: register("key", 60177),
  6741. law: register("law", 60178),
  6742. lightbulbAutofix: register("lightbulb-autofix", 60179),
  6743. linkExternal: register("link-external", 60180),
  6744. link: register("link", 60181),
  6745. listOrdered: register("list-ordered", 60182),
  6746. listUnordered: register("list-unordered", 60183),
  6747. liveShare: register("live-share", 60184),
  6748. loading: register("loading", 60185),
  6749. location: register("location", 60186),
  6750. mailRead: register("mail-read", 60187),
  6751. mail: register("mail", 60188),
  6752. markdown: register("markdown", 60189),
  6753. megaphone: register("megaphone", 60190),
  6754. mention: register("mention", 60191),
  6755. milestone: register("milestone", 60192),
  6756. gitPullRequestMilestone: register("git-pull-request-milestone", 60192),
  6757. mortarBoard: register("mortar-board", 60193),
  6758. move: register("move", 60194),
  6759. multipleWindows: register("multiple-windows", 60195),
  6760. mute: register("mute", 60196),
  6761. noNewline: register("no-newline", 60197),
  6762. note: register("note", 60198),
  6763. octoface: register("octoface", 60199),
  6764. openPreview: register("open-preview", 60200),
  6765. package: register("package", 60201),
  6766. paintcan: register("paintcan", 60202),
  6767. pin: register("pin", 60203),
  6768. play: register("play", 60204),
  6769. run: register("run", 60204),
  6770. plug: register("plug", 60205),
  6771. preserveCase: register("preserve-case", 60206),
  6772. preview: register("preview", 60207),
  6773. project: register("project", 60208),
  6774. pulse: register("pulse", 60209),
  6775. question: register("question", 60210),
  6776. quote: register("quote", 60211),
  6777. radioTower: register("radio-tower", 60212),
  6778. reactions: register("reactions", 60213),
  6779. references: register("references", 60214),
  6780. refresh: register("refresh", 60215),
  6781. regex: register("regex", 60216),
  6782. remoteExplorer: register("remote-explorer", 60217),
  6783. remote: register("remote", 60218),
  6784. remove: register("remove", 60219),
  6785. replaceAll: register("replace-all", 60220),
  6786. replace: register("replace", 60221),
  6787. repoClone: register("repo-clone", 60222),
  6788. repoForcePush: register("repo-force-push", 60223),
  6789. repoPull: register("repo-pull", 60224),
  6790. repoPush: register("repo-push", 60225),
  6791. report: register("report", 60226),
  6792. requestChanges: register("request-changes", 60227),
  6793. rocket: register("rocket", 60228),
  6794. rootFolderOpened: register("root-folder-opened", 60229),
  6795. rootFolder: register("root-folder", 60230),
  6796. rss: register("rss", 60231),
  6797. ruby: register("ruby", 60232),
  6798. saveAll: register("save-all", 60233),
  6799. saveAs: register("save-as", 60234),
  6800. save: register("save", 60235),
  6801. screenFull: register("screen-full", 60236),
  6802. screenNormal: register("screen-normal", 60237),
  6803. searchStop: register("search-stop", 60238),
  6804. server: register("server", 60240),
  6805. settingsGear: register("settings-gear", 60241),
  6806. settings: register("settings", 60242),
  6807. shield: register("shield", 60243),
  6808. smiley: register("smiley", 60244),
  6809. sortPrecedence: register("sort-precedence", 60245),
  6810. splitHorizontal: register("split-horizontal", 60246),
  6811. splitVertical: register("split-vertical", 60247),
  6812. squirrel: register("squirrel", 60248),
  6813. starFull: register("star-full", 60249),
  6814. starHalf: register("star-half", 60250),
  6815. symbolClass: register("symbol-class", 60251),
  6816. symbolColor: register("symbol-color", 60252),
  6817. symbolConstant: register("symbol-constant", 60253),
  6818. symbolEnumMember: register("symbol-enum-member", 60254),
  6819. symbolField: register("symbol-field", 60255),
  6820. symbolFile: register("symbol-file", 60256),
  6821. symbolInterface: register("symbol-interface", 60257),
  6822. symbolKeyword: register("symbol-keyword", 60258),
  6823. symbolMisc: register("symbol-misc", 60259),
  6824. symbolOperator: register("symbol-operator", 60260),
  6825. symbolProperty: register("symbol-property", 60261),
  6826. wrench: register("wrench", 60261),
  6827. wrenchSubaction: register("wrench-subaction", 60261),
  6828. symbolSnippet: register("symbol-snippet", 60262),
  6829. tasklist: register("tasklist", 60263),
  6830. telescope: register("telescope", 60264),
  6831. textSize: register("text-size", 60265),
  6832. threeBars: register("three-bars", 60266),
  6833. thumbsdown: register("thumbsdown", 60267),
  6834. thumbsup: register("thumbsup", 60268),
  6835. tools: register("tools", 60269),
  6836. triangleDown: register("triangle-down", 60270),
  6837. triangleLeft: register("triangle-left", 60271),
  6838. triangleRight: register("triangle-right", 60272),
  6839. triangleUp: register("triangle-up", 60273),
  6840. twitter: register("twitter", 60274),
  6841. unfold: register("unfold", 60275),
  6842. unlock: register("unlock", 60276),
  6843. unmute: register("unmute", 60277),
  6844. unverified: register("unverified", 60278),
  6845. verified: register("verified", 60279),
  6846. versions: register("versions", 60280),
  6847. vmActive: register("vm-active", 60281),
  6848. vmOutline: register("vm-outline", 60282),
  6849. vmRunning: register("vm-running", 60283),
  6850. watch: register("watch", 60284),
  6851. whitespace: register("whitespace", 60285),
  6852. wholeWord: register("whole-word", 60286),
  6853. window: register("window", 60287),
  6854. wordWrap: register("word-wrap", 60288),
  6855. zoomIn: register("zoom-in", 60289),
  6856. zoomOut: register("zoom-out", 60290),
  6857. listFilter: register("list-filter", 60291),
  6858. listFlat: register("list-flat", 60292),
  6859. listSelection: register("list-selection", 60293),
  6860. selection: register("selection", 60293),
  6861. listTree: register("list-tree", 60294),
  6862. debugBreakpointFunctionUnverified: register("debug-breakpoint-function-unverified", 60295),
  6863. debugBreakpointFunction: register("debug-breakpoint-function", 60296),
  6864. debugBreakpointFunctionDisabled: register("debug-breakpoint-function-disabled", 60296),
  6865. debugStackframeActive: register("debug-stackframe-active", 60297),
  6866. circleSmallFilled: register("circle-small-filled", 60298),
  6867. debugStackframeDot: register("debug-stackframe-dot", 60298),
  6868. terminalDecorationMark: register("terminal-decoration-mark", 60298),
  6869. debugStackframe: register("debug-stackframe", 60299),
  6870. debugStackframeFocused: register("debug-stackframe-focused", 60299),
  6871. debugBreakpointUnsupported: register("debug-breakpoint-unsupported", 60300),
  6872. symbolString: register("symbol-string", 60301),
  6873. debugReverseContinue: register("debug-reverse-continue", 60302),
  6874. debugStepBack: register("debug-step-back", 60303),
  6875. debugRestartFrame: register("debug-restart-frame", 60304),
  6876. debugAlt: register("debug-alt", 60305),
  6877. callIncoming: register("call-incoming", 60306),
  6878. callOutgoing: register("call-outgoing", 60307),
  6879. menu: register("menu", 60308),
  6880. expandAll: register("expand-all", 60309),
  6881. feedback: register("feedback", 60310),
  6882. gitPullRequestReviewer: register("git-pull-request-reviewer", 60310),
  6883. groupByRefType: register("group-by-ref-type", 60311),
  6884. ungroupByRefType: register("ungroup-by-ref-type", 60312),
  6885. account: register("account", 60313),
  6886. gitPullRequestAssignee: register("git-pull-request-assignee", 60313),
  6887. bellDot: register("bell-dot", 60314),
  6888. debugConsole: register("debug-console", 60315),
  6889. library: register("library", 60316),
  6890. output: register("output", 60317),
  6891. runAll: register("run-all", 60318),
  6892. syncIgnored: register("sync-ignored", 60319),
  6893. pinned: register("pinned", 60320),
  6894. githubInverted: register("github-inverted", 60321),
  6895. serverProcess: register("server-process", 60322),
  6896. serverEnvironment: register("server-environment", 60323),
  6897. pass: register("pass", 60324),
  6898. issueClosed: register("issue-closed", 60324),
  6899. stopCircle: register("stop-circle", 60325),
  6900. playCircle: register("play-circle", 60326),
  6901. record: register("record", 60327),
  6902. debugAltSmall: register("debug-alt-small", 60328),
  6903. vmConnect: register("vm-connect", 60329),
  6904. cloud: register("cloud", 60330),
  6905. merge: register("merge", 60331),
  6906. export: register("export", 60332),
  6907. graphLeft: register("graph-left", 60333),
  6908. magnet: register("magnet", 60334),
  6909. notebook: register("notebook", 60335),
  6910. redo: register("redo", 60336),
  6911. checkAll: register("check-all", 60337),
  6912. pinnedDirty: register("pinned-dirty", 60338),
  6913. passFilled: register("pass-filled", 60339),
  6914. circleLargeFilled: register("circle-large-filled", 60340),
  6915. circleLarge: register("circle-large", 60341),
  6916. circleLargeOutline: register("circle-large-outline", 60341),
  6917. combine: register("combine", 60342),
  6918. gather: register("gather", 60342),
  6919. table: register("table", 60343),
  6920. variableGroup: register("variable-group", 60344),
  6921. typeHierarchy: register("type-hierarchy", 60345),
  6922. typeHierarchySub: register("type-hierarchy-sub", 60346),
  6923. typeHierarchySuper: register("type-hierarchy-super", 60347),
  6924. gitPullRequestCreate: register("git-pull-request-create", 60348),
  6925. runAbove: register("run-above", 60349),
  6926. runBelow: register("run-below", 60350),
  6927. notebookTemplate: register("notebook-template", 60351),
  6928. debugRerun: register("debug-rerun", 60352),
  6929. workspaceTrusted: register("workspace-trusted", 60353),
  6930. workspaceUntrusted: register("workspace-untrusted", 60354),
  6931. workspaceUnknown: register("workspace-unknown", 60355),
  6932. terminalCmd: register("terminal-cmd", 60356),
  6933. terminalDebian: register("terminal-debian", 60357),
  6934. terminalLinux: register("terminal-linux", 60358),
  6935. terminalPowershell: register("terminal-powershell", 60359),
  6936. terminalTmux: register("terminal-tmux", 60360),
  6937. terminalUbuntu: register("terminal-ubuntu", 60361),
  6938. terminalBash: register("terminal-bash", 60362),
  6939. arrowSwap: register("arrow-swap", 60363),
  6940. copy: register("copy", 60364),
  6941. personAdd: register("person-add", 60365),
  6942. filterFilled: register("filter-filled", 60366),
  6943. wand: register("wand", 60367),
  6944. debugLineByLine: register("debug-line-by-line", 60368),
  6945. inspect: register("inspect", 60369),
  6946. layers: register("layers", 60370),
  6947. layersDot: register("layers-dot", 60371),
  6948. layersActive: register("layers-active", 60372),
  6949. compass: register("compass", 60373),
  6950. compassDot: register("compass-dot", 60374),
  6951. compassActive: register("compass-active", 60375),
  6952. azure: register("azure", 60376),
  6953. issueDraft: register("issue-draft", 60377),
  6954. gitPullRequestClosed: register("git-pull-request-closed", 60378),
  6955. gitPullRequestDraft: register("git-pull-request-draft", 60379),
  6956. debugAll: register("debug-all", 60380),
  6957. debugCoverage: register("debug-coverage", 60381),
  6958. runErrors: register("run-errors", 60382),
  6959. folderLibrary: register("folder-library", 60383),
  6960. debugContinueSmall: register("debug-continue-small", 60384),
  6961. beakerStop: register("beaker-stop", 60385),
  6962. graphLine: register("graph-line", 60386),
  6963. graphScatter: register("graph-scatter", 60387),
  6964. pieChart: register("pie-chart", 60388),
  6965. bracket: register("bracket", 60175),
  6966. bracketDot: register("bracket-dot", 60389),
  6967. bracketError: register("bracket-error", 60390),
  6968. lockSmall: register("lock-small", 60391),
  6969. azureDevops: register("azure-devops", 60392),
  6970. verifiedFilled: register("verified-filled", 60393),
  6971. newline: register("newline", 60394),
  6972. layout: register("layout", 60395),
  6973. layoutActivitybarLeft: register("layout-activitybar-left", 60396),
  6974. layoutActivitybarRight: register("layout-activitybar-right", 60397),
  6975. layoutPanelLeft: register("layout-panel-left", 60398),
  6976. layoutPanelCenter: register("layout-panel-center", 60399),
  6977. layoutPanelJustify: register("layout-panel-justify", 60400),
  6978. layoutPanelRight: register("layout-panel-right", 60401),
  6979. layoutPanel: register("layout-panel", 60402),
  6980. layoutSidebarLeft: register("layout-sidebar-left", 60403),
  6981. layoutSidebarRight: register("layout-sidebar-right", 60404),
  6982. layoutStatusbar: register("layout-statusbar", 60405),
  6983. layoutMenubar: register("layout-menubar", 60406),
  6984. layoutCentered: register("layout-centered", 60407),
  6985. target: register("target", 60408),
  6986. indent: register("indent", 60409),
  6987. recordSmall: register("record-small", 60410),
  6988. errorSmall: register("error-small", 60411),
  6989. terminalDecorationError: register("terminal-decoration-error", 60411),
  6990. arrowCircleDown: register("arrow-circle-down", 60412),
  6991. arrowCircleLeft: register("arrow-circle-left", 60413),
  6992. arrowCircleRight: register("arrow-circle-right", 60414),
  6993. arrowCircleUp: register("arrow-circle-up", 60415),
  6994. layoutSidebarRightOff: register("layout-sidebar-right-off", 60416),
  6995. layoutPanelOff: register("layout-panel-off", 60417),
  6996. layoutSidebarLeftOff: register("layout-sidebar-left-off", 60418),
  6997. blank: register("blank", 60419),
  6998. heartFilled: register("heart-filled", 60420),
  6999. map: register("map", 60421),
  7000. mapHorizontal: register("map-horizontal", 60421),
  7001. foldHorizontal: register("fold-horizontal", 60421),
  7002. mapFilled: register("map-filled", 60422),
  7003. mapHorizontalFilled: register("map-horizontal-filled", 60422),
  7004. foldHorizontalFilled: register("fold-horizontal-filled", 60422),
  7005. circleSmall: register("circle-small", 60423),
  7006. bellSlash: register("bell-slash", 60424),
  7007. bellSlashDot: register("bell-slash-dot", 60425),
  7008. commentUnresolved: register("comment-unresolved", 60426),
  7009. gitPullRequestGoToChanges: register("git-pull-request-go-to-changes", 60427),
  7010. gitPullRequestNewChanges: register("git-pull-request-new-changes", 60428),
  7011. searchFuzzy: register("search-fuzzy", 60429),
  7012. commentDraft: register("comment-draft", 60430),
  7013. send: register("send", 60431),
  7014. sparkle: register("sparkle", 60432),
  7015. insert: register("insert", 60433),
  7016. mic: register("mic", 60434),
  7017. thumbsdownFilled: register("thumbsdown-filled", 60435),
  7018. thumbsupFilled: register("thumbsup-filled", 60436),
  7019. coffee: register("coffee", 60437),
  7020. snake: register("snake", 60438),
  7021. game: register("game", 60439),
  7022. vr: register("vr", 60440),
  7023. chip: register("chip", 60441),
  7024. piano: register("piano", 60442),
  7025. music: register("music", 60443),
  7026. micFilled: register("mic-filled", 60444),
  7027. repoFetch: register("repo-fetch", 60445),
  7028. copilot: register("copilot", 60446),
  7029. lightbulbSparkle: register("lightbulb-sparkle", 60447),
  7030. robot: register("robot", 60448),
  7031. sparkleFilled: register("sparkle-filled", 60449),
  7032. diffSingle: register("diff-single", 60450),
  7033. diffMultiple: register("diff-multiple", 60451),
  7034. surroundWith: register("surround-with", 60452),
  7035. share: register("share", 60453),
  7036. gitStash: register("git-stash", 60454),
  7037. gitStashApply: register("git-stash-apply", 60455),
  7038. gitStashPop: register("git-stash-pop", 60456),
  7039. vscode: register("vscode", 60457),
  7040. vscodeInsiders: register("vscode-insiders", 60458),
  7041. codeOss: register("code-oss", 60459),
  7042. runCoverage: register("run-coverage", 60460),
  7043. runAllCoverage: register("run-all-coverage", 60461),
  7044. coverage: register("coverage", 60462),
  7045. githubProject: register("github-project", 60463),
  7046. mapVertical: register("map-vertical", 60464),
  7047. foldVertical: register("fold-vertical", 60464),
  7048. mapVerticalFilled: register("map-vertical-filled", 60465),
  7049. foldVerticalFilled: register("fold-vertical-filled", 60465),
  7050. goToSearch: register("go-to-search", 60466),
  7051. percentage: register("percentage", 60467),
  7052. sortPercentage: register("sort-percentage", 60467),
  7053. attach: register("attach", 60468)
  7054. };
  7055. // node_modules/monaco-editor/esm/vs/base/common/codicons.js
  7056. var codiconsDerived = {
  7057. dialogError: register("dialog-error", "error"),
  7058. dialogWarning: register("dialog-warning", "warning"),
  7059. dialogInfo: register("dialog-info", "info"),
  7060. dialogClose: register("dialog-close", "close"),
  7061. treeItemExpanded: register("tree-item-expanded", "chevron-down"),
  7062. // collapsed is done with rotation
  7063. treeFilterOnTypeOn: register("tree-filter-on-type-on", "list-filter"),
  7064. treeFilterOnTypeOff: register("tree-filter-on-type-off", "list-selection"),
  7065. treeFilterClear: register("tree-filter-clear", "close"),
  7066. treeItemLoading: register("tree-item-loading", "loading"),
  7067. menuSelection: register("menu-selection", "check"),
  7068. menuSubmenu: register("menu-submenu", "chevron-right"),
  7069. menuBarMore: register("menubar-more", "more"),
  7070. scrollbarButtonLeft: register("scrollbar-button-left", "triangle-left"),
  7071. scrollbarButtonRight: register("scrollbar-button-right", "triangle-right"),
  7072. scrollbarButtonUp: register("scrollbar-button-up", "triangle-up"),
  7073. scrollbarButtonDown: register("scrollbar-button-down", "triangle-down"),
  7074. toolBarMore: register("toolbar-more", "more"),
  7075. quickInputBack: register("quick-input-back", "arrow-left"),
  7076. dropDownButton: register("drop-down-button", 60084),
  7077. symbolCustomColor: register("symbol-customcolor", 60252),
  7078. exportIcon: register("export", 60332),
  7079. workspaceUnspecified: register("workspace-unspecified", 60355),
  7080. newLine: register("newline", 60394),
  7081. thumbsDownFilled: register("thumbsdown-filled", 60435),
  7082. thumbsUpFilled: register("thumbsup-filled", 60436),
  7083. gitFetch: register("git-fetch", 60445),
  7084. lightbulbSparkleAutofix: register("lightbulb-sparkle-autofix", 60447),
  7085. debugBreakpointPending: register("debug-breakpoint-pending", 60377)
  7086. };
  7087. var Codicon = {
  7088. ...codiconsLibrary,
  7089. ...codiconsDerived
  7090. };
  7091. // node_modules/monaco-editor/esm/vs/editor/common/tokenizationRegistry.js
  7092. var TokenizationRegistry = class {
  7093. constructor() {
  7094. this._tokenizationSupports = /* @__PURE__ */ new Map();
  7095. this._factories = /* @__PURE__ */ new Map();
  7096. this._onDidChange = new Emitter();
  7097. this.onDidChange = this._onDidChange.event;
  7098. this._colorMap = null;
  7099. }
  7100. handleChange(languageIds) {
  7101. this._onDidChange.fire({
  7102. changedLanguages: languageIds,
  7103. changedColorMap: false
  7104. });
  7105. }
  7106. register(languageId, support) {
  7107. this._tokenizationSupports.set(languageId, support);
  7108. this.handleChange([languageId]);
  7109. return toDisposable(() => {
  7110. if (this._tokenizationSupports.get(languageId) !== support) {
  7111. return;
  7112. }
  7113. this._tokenizationSupports.delete(languageId);
  7114. this.handleChange([languageId]);
  7115. });
  7116. }
  7117. get(languageId) {
  7118. return this._tokenizationSupports.get(languageId) || null;
  7119. }
  7120. registerFactory(languageId, factory) {
  7121. this._factories.get(languageId)?.dispose();
  7122. const myData = new TokenizationSupportFactoryData(this, languageId, factory);
  7123. this._factories.set(languageId, myData);
  7124. return toDisposable(() => {
  7125. const v = this._factories.get(languageId);
  7126. if (!v || v !== myData) {
  7127. return;
  7128. }
  7129. this._factories.delete(languageId);
  7130. v.dispose();
  7131. });
  7132. }
  7133. async getOrCreate(languageId) {
  7134. const tokenizationSupport = this.get(languageId);
  7135. if (tokenizationSupport) {
  7136. return tokenizationSupport;
  7137. }
  7138. const factory = this._factories.get(languageId);
  7139. if (!factory || factory.isResolved) {
  7140. return null;
  7141. }
  7142. await factory.resolve();
  7143. return this.get(languageId);
  7144. }
  7145. isResolved(languageId) {
  7146. const tokenizationSupport = this.get(languageId);
  7147. if (tokenizationSupport) {
  7148. return true;
  7149. }
  7150. const factory = this._factories.get(languageId);
  7151. if (!factory || factory.isResolved) {
  7152. return true;
  7153. }
  7154. return false;
  7155. }
  7156. setColorMap(colorMap) {
  7157. this._colorMap = colorMap;
  7158. this._onDidChange.fire({
  7159. changedLanguages: Array.from(this._tokenizationSupports.keys()),
  7160. changedColorMap: true
  7161. });
  7162. }
  7163. getColorMap() {
  7164. return this._colorMap;
  7165. }
  7166. getDefaultBackground() {
  7167. if (this._colorMap && this._colorMap.length > 2) {
  7168. return this._colorMap[
  7169. 2
  7170. /* ColorId.DefaultBackground */
  7171. ];
  7172. }
  7173. return null;
  7174. }
  7175. };
  7176. var TokenizationSupportFactoryData = class extends Disposable {
  7177. get isResolved() {
  7178. return this._isResolved;
  7179. }
  7180. constructor(_registry, _languageId, _factory) {
  7181. super();
  7182. this._registry = _registry;
  7183. this._languageId = _languageId;
  7184. this._factory = _factory;
  7185. this._isDisposed = false;
  7186. this._resolvePromise = null;
  7187. this._isResolved = false;
  7188. }
  7189. dispose() {
  7190. this._isDisposed = true;
  7191. super.dispose();
  7192. }
  7193. async resolve() {
  7194. if (!this._resolvePromise) {
  7195. this._resolvePromise = this._create();
  7196. }
  7197. return this._resolvePromise;
  7198. }
  7199. async _create() {
  7200. const value = await this._factory.tokenizationSupport;
  7201. this._isResolved = true;
  7202. if (value && !this._isDisposed) {
  7203. this._register(this._registry.register(this._languageId, value));
  7204. }
  7205. }
  7206. };
  7207. // node_modules/monaco-editor/esm/vs/editor/common/languages.js
  7208. var Token = class {
  7209. constructor(offset, type, language) {
  7210. this.offset = offset;
  7211. this.type = type;
  7212. this.language = language;
  7213. this._tokenBrand = void 0;
  7214. }
  7215. toString() {
  7216. return "(" + this.offset + ", " + this.type + ")";
  7217. }
  7218. };
  7219. var HoverVerbosityAction;
  7220. (function(HoverVerbosityAction3) {
  7221. HoverVerbosityAction3[HoverVerbosityAction3["Increase"] = 0] = "Increase";
  7222. HoverVerbosityAction3[HoverVerbosityAction3["Decrease"] = 1] = "Decrease";
  7223. })(HoverVerbosityAction || (HoverVerbosityAction = {}));
  7224. var CompletionItemKinds;
  7225. (function(CompletionItemKinds2) {
  7226. const byKind = /* @__PURE__ */ new Map();
  7227. byKind.set(0, Codicon.symbolMethod);
  7228. byKind.set(1, Codicon.symbolFunction);
  7229. byKind.set(2, Codicon.symbolConstructor);
  7230. byKind.set(3, Codicon.symbolField);
  7231. byKind.set(4, Codicon.symbolVariable);
  7232. byKind.set(5, Codicon.symbolClass);
  7233. byKind.set(6, Codicon.symbolStruct);
  7234. byKind.set(7, Codicon.symbolInterface);
  7235. byKind.set(8, Codicon.symbolModule);
  7236. byKind.set(9, Codicon.symbolProperty);
  7237. byKind.set(10, Codicon.symbolEvent);
  7238. byKind.set(11, Codicon.symbolOperator);
  7239. byKind.set(12, Codicon.symbolUnit);
  7240. byKind.set(13, Codicon.symbolValue);
  7241. byKind.set(15, Codicon.symbolEnum);
  7242. byKind.set(14, Codicon.symbolConstant);
  7243. byKind.set(15, Codicon.symbolEnum);
  7244. byKind.set(16, Codicon.symbolEnumMember);
  7245. byKind.set(17, Codicon.symbolKeyword);
  7246. byKind.set(27, Codicon.symbolSnippet);
  7247. byKind.set(18, Codicon.symbolText);
  7248. byKind.set(19, Codicon.symbolColor);
  7249. byKind.set(20, Codicon.symbolFile);
  7250. byKind.set(21, Codicon.symbolReference);
  7251. byKind.set(22, Codicon.symbolCustomColor);
  7252. byKind.set(23, Codicon.symbolFolder);
  7253. byKind.set(24, Codicon.symbolTypeParameter);
  7254. byKind.set(25, Codicon.account);
  7255. byKind.set(26, Codicon.issues);
  7256. function toIcon(kind) {
  7257. let codicon = byKind.get(kind);
  7258. if (!codicon) {
  7259. console.info("No codicon found for CompletionItemKind " + kind);
  7260. codicon = Codicon.symbolProperty;
  7261. }
  7262. return codicon;
  7263. }
  7264. CompletionItemKinds2.toIcon = toIcon;
  7265. const data = /* @__PURE__ */ new Map();
  7266. data.set(
  7267. "method",
  7268. 0
  7269. /* CompletionItemKind.Method */
  7270. );
  7271. data.set(
  7272. "function",
  7273. 1
  7274. /* CompletionItemKind.Function */
  7275. );
  7276. data.set(
  7277. "constructor",
  7278. 2
  7279. /* CompletionItemKind.Constructor */
  7280. );
  7281. data.set(
  7282. "field",
  7283. 3
  7284. /* CompletionItemKind.Field */
  7285. );
  7286. data.set(
  7287. "variable",
  7288. 4
  7289. /* CompletionItemKind.Variable */
  7290. );
  7291. data.set(
  7292. "class",
  7293. 5
  7294. /* CompletionItemKind.Class */
  7295. );
  7296. data.set(
  7297. "struct",
  7298. 6
  7299. /* CompletionItemKind.Struct */
  7300. );
  7301. data.set(
  7302. "interface",
  7303. 7
  7304. /* CompletionItemKind.Interface */
  7305. );
  7306. data.set(
  7307. "module",
  7308. 8
  7309. /* CompletionItemKind.Module */
  7310. );
  7311. data.set(
  7312. "property",
  7313. 9
  7314. /* CompletionItemKind.Property */
  7315. );
  7316. data.set(
  7317. "event",
  7318. 10
  7319. /* CompletionItemKind.Event */
  7320. );
  7321. data.set(
  7322. "operator",
  7323. 11
  7324. /* CompletionItemKind.Operator */
  7325. );
  7326. data.set(
  7327. "unit",
  7328. 12
  7329. /* CompletionItemKind.Unit */
  7330. );
  7331. data.set(
  7332. "value",
  7333. 13
  7334. /* CompletionItemKind.Value */
  7335. );
  7336. data.set(
  7337. "constant",
  7338. 14
  7339. /* CompletionItemKind.Constant */
  7340. );
  7341. data.set(
  7342. "enum",
  7343. 15
  7344. /* CompletionItemKind.Enum */
  7345. );
  7346. data.set(
  7347. "enum-member",
  7348. 16
  7349. /* CompletionItemKind.EnumMember */
  7350. );
  7351. data.set(
  7352. "enumMember",
  7353. 16
  7354. /* CompletionItemKind.EnumMember */
  7355. );
  7356. data.set(
  7357. "keyword",
  7358. 17
  7359. /* CompletionItemKind.Keyword */
  7360. );
  7361. data.set(
  7362. "snippet",
  7363. 27
  7364. /* CompletionItemKind.Snippet */
  7365. );
  7366. data.set(
  7367. "text",
  7368. 18
  7369. /* CompletionItemKind.Text */
  7370. );
  7371. data.set(
  7372. "color",
  7373. 19
  7374. /* CompletionItemKind.Color */
  7375. );
  7376. data.set(
  7377. "file",
  7378. 20
  7379. /* CompletionItemKind.File */
  7380. );
  7381. data.set(
  7382. "reference",
  7383. 21
  7384. /* CompletionItemKind.Reference */
  7385. );
  7386. data.set(
  7387. "customcolor",
  7388. 22
  7389. /* CompletionItemKind.Customcolor */
  7390. );
  7391. data.set(
  7392. "folder",
  7393. 23
  7394. /* CompletionItemKind.Folder */
  7395. );
  7396. data.set(
  7397. "type-parameter",
  7398. 24
  7399. /* CompletionItemKind.TypeParameter */
  7400. );
  7401. data.set(
  7402. "typeParameter",
  7403. 24
  7404. /* CompletionItemKind.TypeParameter */
  7405. );
  7406. data.set(
  7407. "account",
  7408. 25
  7409. /* CompletionItemKind.User */
  7410. );
  7411. data.set(
  7412. "issue",
  7413. 26
  7414. /* CompletionItemKind.Issue */
  7415. );
  7416. function fromString(value, strict) {
  7417. let res = data.get(value);
  7418. if (typeof res === "undefined" && !strict) {
  7419. res = 9;
  7420. }
  7421. return res;
  7422. }
  7423. CompletionItemKinds2.fromString = fromString;
  7424. })(CompletionItemKinds || (CompletionItemKinds = {}));
  7425. var InlineCompletionTriggerKind;
  7426. (function(InlineCompletionTriggerKind3) {
  7427. InlineCompletionTriggerKind3[InlineCompletionTriggerKind3["Automatic"] = 0] = "Automatic";
  7428. InlineCompletionTriggerKind3[InlineCompletionTriggerKind3["Explicit"] = 1] = "Explicit";
  7429. })(InlineCompletionTriggerKind || (InlineCompletionTriggerKind = {}));
  7430. var DocumentPasteTriggerKind;
  7431. (function(DocumentPasteTriggerKind2) {
  7432. DocumentPasteTriggerKind2[DocumentPasteTriggerKind2["Automatic"] = 0] = "Automatic";
  7433. DocumentPasteTriggerKind2[DocumentPasteTriggerKind2["PasteAs"] = 1] = "PasteAs";
  7434. })(DocumentPasteTriggerKind || (DocumentPasteTriggerKind = {}));
  7435. var SignatureHelpTriggerKind;
  7436. (function(SignatureHelpTriggerKind3) {
  7437. SignatureHelpTriggerKind3[SignatureHelpTriggerKind3["Invoke"] = 1] = "Invoke";
  7438. SignatureHelpTriggerKind3[SignatureHelpTriggerKind3["TriggerCharacter"] = 2] = "TriggerCharacter";
  7439. SignatureHelpTriggerKind3[SignatureHelpTriggerKind3["ContentChange"] = 3] = "ContentChange";
  7440. })(SignatureHelpTriggerKind || (SignatureHelpTriggerKind = {}));
  7441. var DocumentHighlightKind;
  7442. (function(DocumentHighlightKind3) {
  7443. DocumentHighlightKind3[DocumentHighlightKind3["Text"] = 0] = "Text";
  7444. DocumentHighlightKind3[DocumentHighlightKind3["Read"] = 1] = "Read";
  7445. DocumentHighlightKind3[DocumentHighlightKind3["Write"] = 2] = "Write";
  7446. })(DocumentHighlightKind || (DocumentHighlightKind = {}));
  7447. var symbolKindNames = {
  7448. [
  7449. 17
  7450. /* SymbolKind.Array */
  7451. ]: localize("Array", "array"),
  7452. [
  7453. 16
  7454. /* SymbolKind.Boolean */
  7455. ]: localize("Boolean", "boolean"),
  7456. [
  7457. 4
  7458. /* SymbolKind.Class */
  7459. ]: localize("Class", "class"),
  7460. [
  7461. 13
  7462. /* SymbolKind.Constant */
  7463. ]: localize("Constant", "constant"),
  7464. [
  7465. 8
  7466. /* SymbolKind.Constructor */
  7467. ]: localize("Constructor", "constructor"),
  7468. [
  7469. 9
  7470. /* SymbolKind.Enum */
  7471. ]: localize("Enum", "enumeration"),
  7472. [
  7473. 21
  7474. /* SymbolKind.EnumMember */
  7475. ]: localize("EnumMember", "enumeration member"),
  7476. [
  7477. 23
  7478. /* SymbolKind.Event */
  7479. ]: localize("Event", "event"),
  7480. [
  7481. 7
  7482. /* SymbolKind.Field */
  7483. ]: localize("Field", "field"),
  7484. [
  7485. 0
  7486. /* SymbolKind.File */
  7487. ]: localize("File", "file"),
  7488. [
  7489. 11
  7490. /* SymbolKind.Function */
  7491. ]: localize("Function", "function"),
  7492. [
  7493. 10
  7494. /* SymbolKind.Interface */
  7495. ]: localize("Interface", "interface"),
  7496. [
  7497. 19
  7498. /* SymbolKind.Key */
  7499. ]: localize("Key", "key"),
  7500. [
  7501. 5
  7502. /* SymbolKind.Method */
  7503. ]: localize("Method", "method"),
  7504. [
  7505. 1
  7506. /* SymbolKind.Module */
  7507. ]: localize("Module", "module"),
  7508. [
  7509. 2
  7510. /* SymbolKind.Namespace */
  7511. ]: localize("Namespace", "namespace"),
  7512. [
  7513. 20
  7514. /* SymbolKind.Null */
  7515. ]: localize("Null", "null"),
  7516. [
  7517. 15
  7518. /* SymbolKind.Number */
  7519. ]: localize("Number", "number"),
  7520. [
  7521. 18
  7522. /* SymbolKind.Object */
  7523. ]: localize("Object", "object"),
  7524. [
  7525. 24
  7526. /* SymbolKind.Operator */
  7527. ]: localize("Operator", "operator"),
  7528. [
  7529. 3
  7530. /* SymbolKind.Package */
  7531. ]: localize("Package", "package"),
  7532. [
  7533. 6
  7534. /* SymbolKind.Property */
  7535. ]: localize("Property", "property"),
  7536. [
  7537. 14
  7538. /* SymbolKind.String */
  7539. ]: localize("String", "string"),
  7540. [
  7541. 22
  7542. /* SymbolKind.Struct */
  7543. ]: localize("Struct", "struct"),
  7544. [
  7545. 25
  7546. /* SymbolKind.TypeParameter */
  7547. ]: localize("TypeParameter", "type parameter"),
  7548. [
  7549. 12
  7550. /* SymbolKind.Variable */
  7551. ]: localize("Variable", "variable")
  7552. };
  7553. var SymbolKinds;
  7554. (function(SymbolKinds2) {
  7555. const byKind = /* @__PURE__ */ new Map();
  7556. byKind.set(0, Codicon.symbolFile);
  7557. byKind.set(1, Codicon.symbolModule);
  7558. byKind.set(2, Codicon.symbolNamespace);
  7559. byKind.set(3, Codicon.symbolPackage);
  7560. byKind.set(4, Codicon.symbolClass);
  7561. byKind.set(5, Codicon.symbolMethod);
  7562. byKind.set(6, Codicon.symbolProperty);
  7563. byKind.set(7, Codicon.symbolField);
  7564. byKind.set(8, Codicon.symbolConstructor);
  7565. byKind.set(9, Codicon.symbolEnum);
  7566. byKind.set(10, Codicon.symbolInterface);
  7567. byKind.set(11, Codicon.symbolFunction);
  7568. byKind.set(12, Codicon.symbolVariable);
  7569. byKind.set(13, Codicon.symbolConstant);
  7570. byKind.set(14, Codicon.symbolString);
  7571. byKind.set(15, Codicon.symbolNumber);
  7572. byKind.set(16, Codicon.symbolBoolean);
  7573. byKind.set(17, Codicon.symbolArray);
  7574. byKind.set(18, Codicon.symbolObject);
  7575. byKind.set(19, Codicon.symbolKey);
  7576. byKind.set(20, Codicon.symbolNull);
  7577. byKind.set(21, Codicon.symbolEnumMember);
  7578. byKind.set(22, Codicon.symbolStruct);
  7579. byKind.set(23, Codicon.symbolEvent);
  7580. byKind.set(24, Codicon.symbolOperator);
  7581. byKind.set(25, Codicon.symbolTypeParameter);
  7582. function toIcon(kind) {
  7583. let icon = byKind.get(kind);
  7584. if (!icon) {
  7585. console.info("No codicon found for SymbolKind " + kind);
  7586. icon = Codicon.symbolProperty;
  7587. }
  7588. return icon;
  7589. }
  7590. SymbolKinds2.toIcon = toIcon;
  7591. })(SymbolKinds || (SymbolKinds = {}));
  7592. var FoldingRangeKind = class _FoldingRangeKind {
  7593. static {
  7594. this.Comment = new _FoldingRangeKind("comment");
  7595. }
  7596. static {
  7597. this.Imports = new _FoldingRangeKind("imports");
  7598. }
  7599. static {
  7600. this.Region = new _FoldingRangeKind("region");
  7601. }
  7602. /**
  7603. * Returns a {@link FoldingRangeKind} for the given value.
  7604. *
  7605. * @param value of the kind.
  7606. */
  7607. static fromValue(value) {
  7608. switch (value) {
  7609. case "comment":
  7610. return _FoldingRangeKind.Comment;
  7611. case "imports":
  7612. return _FoldingRangeKind.Imports;
  7613. case "region":
  7614. return _FoldingRangeKind.Region;
  7615. }
  7616. return new _FoldingRangeKind(value);
  7617. }
  7618. /**
  7619. * Creates a new {@link FoldingRangeKind}.
  7620. *
  7621. * @param value of the kind.
  7622. */
  7623. constructor(value) {
  7624. this.value = value;
  7625. }
  7626. };
  7627. var NewSymbolNameTag;
  7628. (function(NewSymbolNameTag3) {
  7629. NewSymbolNameTag3[NewSymbolNameTag3["AIGenerated"] = 1] = "AIGenerated";
  7630. })(NewSymbolNameTag || (NewSymbolNameTag = {}));
  7631. var NewSymbolNameTriggerKind;
  7632. (function(NewSymbolNameTriggerKind3) {
  7633. NewSymbolNameTriggerKind3[NewSymbolNameTriggerKind3["Invoke"] = 0] = "Invoke";
  7634. NewSymbolNameTriggerKind3[NewSymbolNameTriggerKind3["Automatic"] = 1] = "Automatic";
  7635. })(NewSymbolNameTriggerKind || (NewSymbolNameTriggerKind = {}));
  7636. var Command;
  7637. (function(Command2) {
  7638. function is(obj) {
  7639. if (!obj || typeof obj !== "object") {
  7640. return false;
  7641. }
  7642. return typeof obj.id === "string" && typeof obj.title === "string";
  7643. }
  7644. Command2.is = is;
  7645. })(Command || (Command = {}));
  7646. var InlayHintKind;
  7647. (function(InlayHintKind3) {
  7648. InlayHintKind3[InlayHintKind3["Type"] = 1] = "Type";
  7649. InlayHintKind3[InlayHintKind3["Parameter"] = 2] = "Parameter";
  7650. })(InlayHintKind || (InlayHintKind = {}));
  7651. var TokenizationRegistry2 = new TokenizationRegistry();
  7652. var TreeSitterTokenizationRegistry = new TokenizationRegistry();
  7653. var InlineEditTriggerKind;
  7654. (function(InlineEditTriggerKind3) {
  7655. InlineEditTriggerKind3[InlineEditTriggerKind3["Invoke"] = 0] = "Invoke";
  7656. InlineEditTriggerKind3[InlineEditTriggerKind3["Automatic"] = 1] = "Automatic";
  7657. })(InlineEditTriggerKind || (InlineEditTriggerKind = {}));
  7658. // node_modules/monaco-editor/esm/vs/editor/common/standalone/standaloneEnums.js
  7659. var AccessibilitySupport;
  7660. (function(AccessibilitySupport2) {
  7661. AccessibilitySupport2[AccessibilitySupport2["Unknown"] = 0] = "Unknown";
  7662. AccessibilitySupport2[AccessibilitySupport2["Disabled"] = 1] = "Disabled";
  7663. AccessibilitySupport2[AccessibilitySupport2["Enabled"] = 2] = "Enabled";
  7664. })(AccessibilitySupport || (AccessibilitySupport = {}));
  7665. var CodeActionTriggerType;
  7666. (function(CodeActionTriggerType2) {
  7667. CodeActionTriggerType2[CodeActionTriggerType2["Invoke"] = 1] = "Invoke";
  7668. CodeActionTriggerType2[CodeActionTriggerType2["Auto"] = 2] = "Auto";
  7669. })(CodeActionTriggerType || (CodeActionTriggerType = {}));
  7670. var CompletionItemInsertTextRule;
  7671. (function(CompletionItemInsertTextRule2) {
  7672. CompletionItemInsertTextRule2[CompletionItemInsertTextRule2["None"] = 0] = "None";
  7673. CompletionItemInsertTextRule2[CompletionItemInsertTextRule2["KeepWhitespace"] = 1] = "KeepWhitespace";
  7674. CompletionItemInsertTextRule2[CompletionItemInsertTextRule2["InsertAsSnippet"] = 4] = "InsertAsSnippet";
  7675. })(CompletionItemInsertTextRule || (CompletionItemInsertTextRule = {}));
  7676. var CompletionItemKind;
  7677. (function(CompletionItemKind2) {
  7678. CompletionItemKind2[CompletionItemKind2["Method"] = 0] = "Method";
  7679. CompletionItemKind2[CompletionItemKind2["Function"] = 1] = "Function";
  7680. CompletionItemKind2[CompletionItemKind2["Constructor"] = 2] = "Constructor";
  7681. CompletionItemKind2[CompletionItemKind2["Field"] = 3] = "Field";
  7682. CompletionItemKind2[CompletionItemKind2["Variable"] = 4] = "Variable";
  7683. CompletionItemKind2[CompletionItemKind2["Class"] = 5] = "Class";
  7684. CompletionItemKind2[CompletionItemKind2["Struct"] = 6] = "Struct";
  7685. CompletionItemKind2[CompletionItemKind2["Interface"] = 7] = "Interface";
  7686. CompletionItemKind2[CompletionItemKind2["Module"] = 8] = "Module";
  7687. CompletionItemKind2[CompletionItemKind2["Property"] = 9] = "Property";
  7688. CompletionItemKind2[CompletionItemKind2["Event"] = 10] = "Event";
  7689. CompletionItemKind2[CompletionItemKind2["Operator"] = 11] = "Operator";
  7690. CompletionItemKind2[CompletionItemKind2["Unit"] = 12] = "Unit";
  7691. CompletionItemKind2[CompletionItemKind2["Value"] = 13] = "Value";
  7692. CompletionItemKind2[CompletionItemKind2["Constant"] = 14] = "Constant";
  7693. CompletionItemKind2[CompletionItemKind2["Enum"] = 15] = "Enum";
  7694. CompletionItemKind2[CompletionItemKind2["EnumMember"] = 16] = "EnumMember";
  7695. CompletionItemKind2[CompletionItemKind2["Keyword"] = 17] = "Keyword";
  7696. CompletionItemKind2[CompletionItemKind2["Text"] = 18] = "Text";
  7697. CompletionItemKind2[CompletionItemKind2["Color"] = 19] = "Color";
  7698. CompletionItemKind2[CompletionItemKind2["File"] = 20] = "File";
  7699. CompletionItemKind2[CompletionItemKind2["Reference"] = 21] = "Reference";
  7700. CompletionItemKind2[CompletionItemKind2["Customcolor"] = 22] = "Customcolor";
  7701. CompletionItemKind2[CompletionItemKind2["Folder"] = 23] = "Folder";
  7702. CompletionItemKind2[CompletionItemKind2["TypeParameter"] = 24] = "TypeParameter";
  7703. CompletionItemKind2[CompletionItemKind2["User"] = 25] = "User";
  7704. CompletionItemKind2[CompletionItemKind2["Issue"] = 26] = "Issue";
  7705. CompletionItemKind2[CompletionItemKind2["Snippet"] = 27] = "Snippet";
  7706. })(CompletionItemKind || (CompletionItemKind = {}));
  7707. var CompletionItemTag;
  7708. (function(CompletionItemTag2) {
  7709. CompletionItemTag2[CompletionItemTag2["Deprecated"] = 1] = "Deprecated";
  7710. })(CompletionItemTag || (CompletionItemTag = {}));
  7711. var CompletionTriggerKind;
  7712. (function(CompletionTriggerKind2) {
  7713. CompletionTriggerKind2[CompletionTriggerKind2["Invoke"] = 0] = "Invoke";
  7714. CompletionTriggerKind2[CompletionTriggerKind2["TriggerCharacter"] = 1] = "TriggerCharacter";
  7715. CompletionTriggerKind2[CompletionTriggerKind2["TriggerForIncompleteCompletions"] = 2] = "TriggerForIncompleteCompletions";
  7716. })(CompletionTriggerKind || (CompletionTriggerKind = {}));
  7717. var ContentWidgetPositionPreference;
  7718. (function(ContentWidgetPositionPreference2) {
  7719. ContentWidgetPositionPreference2[ContentWidgetPositionPreference2["EXACT"] = 0] = "EXACT";
  7720. ContentWidgetPositionPreference2[ContentWidgetPositionPreference2["ABOVE"] = 1] = "ABOVE";
  7721. ContentWidgetPositionPreference2[ContentWidgetPositionPreference2["BELOW"] = 2] = "BELOW";
  7722. })(ContentWidgetPositionPreference || (ContentWidgetPositionPreference = {}));
  7723. var CursorChangeReason;
  7724. (function(CursorChangeReason2) {
  7725. CursorChangeReason2[CursorChangeReason2["NotSet"] = 0] = "NotSet";
  7726. CursorChangeReason2[CursorChangeReason2["ContentFlush"] = 1] = "ContentFlush";
  7727. CursorChangeReason2[CursorChangeReason2["RecoverFromMarkers"] = 2] = "RecoverFromMarkers";
  7728. CursorChangeReason2[CursorChangeReason2["Explicit"] = 3] = "Explicit";
  7729. CursorChangeReason2[CursorChangeReason2["Paste"] = 4] = "Paste";
  7730. CursorChangeReason2[CursorChangeReason2["Undo"] = 5] = "Undo";
  7731. CursorChangeReason2[CursorChangeReason2["Redo"] = 6] = "Redo";
  7732. })(CursorChangeReason || (CursorChangeReason = {}));
  7733. var DefaultEndOfLine;
  7734. (function(DefaultEndOfLine2) {
  7735. DefaultEndOfLine2[DefaultEndOfLine2["LF"] = 1] = "LF";
  7736. DefaultEndOfLine2[DefaultEndOfLine2["CRLF"] = 2] = "CRLF";
  7737. })(DefaultEndOfLine || (DefaultEndOfLine = {}));
  7738. var DocumentHighlightKind2;
  7739. (function(DocumentHighlightKind3) {
  7740. DocumentHighlightKind3[DocumentHighlightKind3["Text"] = 0] = "Text";
  7741. DocumentHighlightKind3[DocumentHighlightKind3["Read"] = 1] = "Read";
  7742. DocumentHighlightKind3[DocumentHighlightKind3["Write"] = 2] = "Write";
  7743. })(DocumentHighlightKind2 || (DocumentHighlightKind2 = {}));
  7744. var EditorAutoIndentStrategy;
  7745. (function(EditorAutoIndentStrategy2) {
  7746. EditorAutoIndentStrategy2[EditorAutoIndentStrategy2["None"] = 0] = "None";
  7747. EditorAutoIndentStrategy2[EditorAutoIndentStrategy2["Keep"] = 1] = "Keep";
  7748. EditorAutoIndentStrategy2[EditorAutoIndentStrategy2["Brackets"] = 2] = "Brackets";
  7749. EditorAutoIndentStrategy2[EditorAutoIndentStrategy2["Advanced"] = 3] = "Advanced";
  7750. EditorAutoIndentStrategy2[EditorAutoIndentStrategy2["Full"] = 4] = "Full";
  7751. })(EditorAutoIndentStrategy || (EditorAutoIndentStrategy = {}));
  7752. var EditorOption;
  7753. (function(EditorOption2) {
  7754. EditorOption2[EditorOption2["acceptSuggestionOnCommitCharacter"] = 0] = "acceptSuggestionOnCommitCharacter";
  7755. EditorOption2[EditorOption2["acceptSuggestionOnEnter"] = 1] = "acceptSuggestionOnEnter";
  7756. EditorOption2[EditorOption2["accessibilitySupport"] = 2] = "accessibilitySupport";
  7757. EditorOption2[EditorOption2["accessibilityPageSize"] = 3] = "accessibilityPageSize";
  7758. EditorOption2[EditorOption2["ariaLabel"] = 4] = "ariaLabel";
  7759. EditorOption2[EditorOption2["ariaRequired"] = 5] = "ariaRequired";
  7760. EditorOption2[EditorOption2["autoClosingBrackets"] = 6] = "autoClosingBrackets";
  7761. EditorOption2[EditorOption2["autoClosingComments"] = 7] = "autoClosingComments";
  7762. EditorOption2[EditorOption2["screenReaderAnnounceInlineSuggestion"] = 8] = "screenReaderAnnounceInlineSuggestion";
  7763. EditorOption2[EditorOption2["autoClosingDelete"] = 9] = "autoClosingDelete";
  7764. EditorOption2[EditorOption2["autoClosingOvertype"] = 10] = "autoClosingOvertype";
  7765. EditorOption2[EditorOption2["autoClosingQuotes"] = 11] = "autoClosingQuotes";
  7766. EditorOption2[EditorOption2["autoIndent"] = 12] = "autoIndent";
  7767. EditorOption2[EditorOption2["automaticLayout"] = 13] = "automaticLayout";
  7768. EditorOption2[EditorOption2["autoSurround"] = 14] = "autoSurround";
  7769. EditorOption2[EditorOption2["bracketPairColorization"] = 15] = "bracketPairColorization";
  7770. EditorOption2[EditorOption2["guides"] = 16] = "guides";
  7771. EditorOption2[EditorOption2["codeLens"] = 17] = "codeLens";
  7772. EditorOption2[EditorOption2["codeLensFontFamily"] = 18] = "codeLensFontFamily";
  7773. EditorOption2[EditorOption2["codeLensFontSize"] = 19] = "codeLensFontSize";
  7774. EditorOption2[EditorOption2["colorDecorators"] = 20] = "colorDecorators";
  7775. EditorOption2[EditorOption2["colorDecoratorsLimit"] = 21] = "colorDecoratorsLimit";
  7776. EditorOption2[EditorOption2["columnSelection"] = 22] = "columnSelection";
  7777. EditorOption2[EditorOption2["comments"] = 23] = "comments";
  7778. EditorOption2[EditorOption2["contextmenu"] = 24] = "contextmenu";
  7779. EditorOption2[EditorOption2["copyWithSyntaxHighlighting"] = 25] = "copyWithSyntaxHighlighting";
  7780. EditorOption2[EditorOption2["cursorBlinking"] = 26] = "cursorBlinking";
  7781. EditorOption2[EditorOption2["cursorSmoothCaretAnimation"] = 27] = "cursorSmoothCaretAnimation";
  7782. EditorOption2[EditorOption2["cursorStyle"] = 28] = "cursorStyle";
  7783. EditorOption2[EditorOption2["cursorSurroundingLines"] = 29] = "cursorSurroundingLines";
  7784. EditorOption2[EditorOption2["cursorSurroundingLinesStyle"] = 30] = "cursorSurroundingLinesStyle";
  7785. EditorOption2[EditorOption2["cursorWidth"] = 31] = "cursorWidth";
  7786. EditorOption2[EditorOption2["disableLayerHinting"] = 32] = "disableLayerHinting";
  7787. EditorOption2[EditorOption2["disableMonospaceOptimizations"] = 33] = "disableMonospaceOptimizations";
  7788. EditorOption2[EditorOption2["domReadOnly"] = 34] = "domReadOnly";
  7789. EditorOption2[EditorOption2["dragAndDrop"] = 35] = "dragAndDrop";
  7790. EditorOption2[EditorOption2["dropIntoEditor"] = 36] = "dropIntoEditor";
  7791. EditorOption2[EditorOption2["emptySelectionClipboard"] = 37] = "emptySelectionClipboard";
  7792. EditorOption2[EditorOption2["experimentalWhitespaceRendering"] = 38] = "experimentalWhitespaceRendering";
  7793. EditorOption2[EditorOption2["extraEditorClassName"] = 39] = "extraEditorClassName";
  7794. EditorOption2[EditorOption2["fastScrollSensitivity"] = 40] = "fastScrollSensitivity";
  7795. EditorOption2[EditorOption2["find"] = 41] = "find";
  7796. EditorOption2[EditorOption2["fixedOverflowWidgets"] = 42] = "fixedOverflowWidgets";
  7797. EditorOption2[EditorOption2["folding"] = 43] = "folding";
  7798. EditorOption2[EditorOption2["foldingStrategy"] = 44] = "foldingStrategy";
  7799. EditorOption2[EditorOption2["foldingHighlight"] = 45] = "foldingHighlight";
  7800. EditorOption2[EditorOption2["foldingImportsByDefault"] = 46] = "foldingImportsByDefault";
  7801. EditorOption2[EditorOption2["foldingMaximumRegions"] = 47] = "foldingMaximumRegions";
  7802. EditorOption2[EditorOption2["unfoldOnClickAfterEndOfLine"] = 48] = "unfoldOnClickAfterEndOfLine";
  7803. EditorOption2[EditorOption2["fontFamily"] = 49] = "fontFamily";
  7804. EditorOption2[EditorOption2["fontInfo"] = 50] = "fontInfo";
  7805. EditorOption2[EditorOption2["fontLigatures"] = 51] = "fontLigatures";
  7806. EditorOption2[EditorOption2["fontSize"] = 52] = "fontSize";
  7807. EditorOption2[EditorOption2["fontWeight"] = 53] = "fontWeight";
  7808. EditorOption2[EditorOption2["fontVariations"] = 54] = "fontVariations";
  7809. EditorOption2[EditorOption2["formatOnPaste"] = 55] = "formatOnPaste";
  7810. EditorOption2[EditorOption2["formatOnType"] = 56] = "formatOnType";
  7811. EditorOption2[EditorOption2["glyphMargin"] = 57] = "glyphMargin";
  7812. EditorOption2[EditorOption2["gotoLocation"] = 58] = "gotoLocation";
  7813. EditorOption2[EditorOption2["hideCursorInOverviewRuler"] = 59] = "hideCursorInOverviewRuler";
  7814. EditorOption2[EditorOption2["hover"] = 60] = "hover";
  7815. EditorOption2[EditorOption2["inDiffEditor"] = 61] = "inDiffEditor";
  7816. EditorOption2[EditorOption2["inlineSuggest"] = 62] = "inlineSuggest";
  7817. EditorOption2[EditorOption2["inlineEdit"] = 63] = "inlineEdit";
  7818. EditorOption2[EditorOption2["letterSpacing"] = 64] = "letterSpacing";
  7819. EditorOption2[EditorOption2["lightbulb"] = 65] = "lightbulb";
  7820. EditorOption2[EditorOption2["lineDecorationsWidth"] = 66] = "lineDecorationsWidth";
  7821. EditorOption2[EditorOption2["lineHeight"] = 67] = "lineHeight";
  7822. EditorOption2[EditorOption2["lineNumbers"] = 68] = "lineNumbers";
  7823. EditorOption2[EditorOption2["lineNumbersMinChars"] = 69] = "lineNumbersMinChars";
  7824. EditorOption2[EditorOption2["linkedEditing"] = 70] = "linkedEditing";
  7825. EditorOption2[EditorOption2["links"] = 71] = "links";
  7826. EditorOption2[EditorOption2["matchBrackets"] = 72] = "matchBrackets";
  7827. EditorOption2[EditorOption2["minimap"] = 73] = "minimap";
  7828. EditorOption2[EditorOption2["mouseStyle"] = 74] = "mouseStyle";
  7829. EditorOption2[EditorOption2["mouseWheelScrollSensitivity"] = 75] = "mouseWheelScrollSensitivity";
  7830. EditorOption2[EditorOption2["mouseWheelZoom"] = 76] = "mouseWheelZoom";
  7831. EditorOption2[EditorOption2["multiCursorMergeOverlapping"] = 77] = "multiCursorMergeOverlapping";
  7832. EditorOption2[EditorOption2["multiCursorModifier"] = 78] = "multiCursorModifier";
  7833. EditorOption2[EditorOption2["multiCursorPaste"] = 79] = "multiCursorPaste";
  7834. EditorOption2[EditorOption2["multiCursorLimit"] = 80] = "multiCursorLimit";
  7835. EditorOption2[EditorOption2["occurrencesHighlight"] = 81] = "occurrencesHighlight";
  7836. EditorOption2[EditorOption2["overviewRulerBorder"] = 82] = "overviewRulerBorder";
  7837. EditorOption2[EditorOption2["overviewRulerLanes"] = 83] = "overviewRulerLanes";
  7838. EditorOption2[EditorOption2["padding"] = 84] = "padding";
  7839. EditorOption2[EditorOption2["pasteAs"] = 85] = "pasteAs";
  7840. EditorOption2[EditorOption2["parameterHints"] = 86] = "parameterHints";
  7841. EditorOption2[EditorOption2["peekWidgetDefaultFocus"] = 87] = "peekWidgetDefaultFocus";
  7842. EditorOption2[EditorOption2["placeholder"] = 88] = "placeholder";
  7843. EditorOption2[EditorOption2["definitionLinkOpensInPeek"] = 89] = "definitionLinkOpensInPeek";
  7844. EditorOption2[EditorOption2["quickSuggestions"] = 90] = "quickSuggestions";
  7845. EditorOption2[EditorOption2["quickSuggestionsDelay"] = 91] = "quickSuggestionsDelay";
  7846. EditorOption2[EditorOption2["readOnly"] = 92] = "readOnly";
  7847. EditorOption2[EditorOption2["readOnlyMessage"] = 93] = "readOnlyMessage";
  7848. EditorOption2[EditorOption2["renameOnType"] = 94] = "renameOnType";
  7849. EditorOption2[EditorOption2["renderControlCharacters"] = 95] = "renderControlCharacters";
  7850. EditorOption2[EditorOption2["renderFinalNewline"] = 96] = "renderFinalNewline";
  7851. EditorOption2[EditorOption2["renderLineHighlight"] = 97] = "renderLineHighlight";
  7852. EditorOption2[EditorOption2["renderLineHighlightOnlyWhenFocus"] = 98] = "renderLineHighlightOnlyWhenFocus";
  7853. EditorOption2[EditorOption2["renderValidationDecorations"] = 99] = "renderValidationDecorations";
  7854. EditorOption2[EditorOption2["renderWhitespace"] = 100] = "renderWhitespace";
  7855. EditorOption2[EditorOption2["revealHorizontalRightPadding"] = 101] = "revealHorizontalRightPadding";
  7856. EditorOption2[EditorOption2["roundedSelection"] = 102] = "roundedSelection";
  7857. EditorOption2[EditorOption2["rulers"] = 103] = "rulers";
  7858. EditorOption2[EditorOption2["scrollbar"] = 104] = "scrollbar";
  7859. EditorOption2[EditorOption2["scrollBeyondLastColumn"] = 105] = "scrollBeyondLastColumn";
  7860. EditorOption2[EditorOption2["scrollBeyondLastLine"] = 106] = "scrollBeyondLastLine";
  7861. EditorOption2[EditorOption2["scrollPredominantAxis"] = 107] = "scrollPredominantAxis";
  7862. EditorOption2[EditorOption2["selectionClipboard"] = 108] = "selectionClipboard";
  7863. EditorOption2[EditorOption2["selectionHighlight"] = 109] = "selectionHighlight";
  7864. EditorOption2[EditorOption2["selectOnLineNumbers"] = 110] = "selectOnLineNumbers";
  7865. EditorOption2[EditorOption2["showFoldingControls"] = 111] = "showFoldingControls";
  7866. EditorOption2[EditorOption2["showUnused"] = 112] = "showUnused";
  7867. EditorOption2[EditorOption2["snippetSuggestions"] = 113] = "snippetSuggestions";
  7868. EditorOption2[EditorOption2["smartSelect"] = 114] = "smartSelect";
  7869. EditorOption2[EditorOption2["smoothScrolling"] = 115] = "smoothScrolling";
  7870. EditorOption2[EditorOption2["stickyScroll"] = 116] = "stickyScroll";
  7871. EditorOption2[EditorOption2["stickyTabStops"] = 117] = "stickyTabStops";
  7872. EditorOption2[EditorOption2["stopRenderingLineAfter"] = 118] = "stopRenderingLineAfter";
  7873. EditorOption2[EditorOption2["suggest"] = 119] = "suggest";
  7874. EditorOption2[EditorOption2["suggestFontSize"] = 120] = "suggestFontSize";
  7875. EditorOption2[EditorOption2["suggestLineHeight"] = 121] = "suggestLineHeight";
  7876. EditorOption2[EditorOption2["suggestOnTriggerCharacters"] = 122] = "suggestOnTriggerCharacters";
  7877. EditorOption2[EditorOption2["suggestSelection"] = 123] = "suggestSelection";
  7878. EditorOption2[EditorOption2["tabCompletion"] = 124] = "tabCompletion";
  7879. EditorOption2[EditorOption2["tabIndex"] = 125] = "tabIndex";
  7880. EditorOption2[EditorOption2["unicodeHighlighting"] = 126] = "unicodeHighlighting";
  7881. EditorOption2[EditorOption2["unusualLineTerminators"] = 127] = "unusualLineTerminators";
  7882. EditorOption2[EditorOption2["useShadowDOM"] = 128] = "useShadowDOM";
  7883. EditorOption2[EditorOption2["useTabStops"] = 129] = "useTabStops";
  7884. EditorOption2[EditorOption2["wordBreak"] = 130] = "wordBreak";
  7885. EditorOption2[EditorOption2["wordSegmenterLocales"] = 131] = "wordSegmenterLocales";
  7886. EditorOption2[EditorOption2["wordSeparators"] = 132] = "wordSeparators";
  7887. EditorOption2[EditorOption2["wordWrap"] = 133] = "wordWrap";
  7888. EditorOption2[EditorOption2["wordWrapBreakAfterCharacters"] = 134] = "wordWrapBreakAfterCharacters";
  7889. EditorOption2[EditorOption2["wordWrapBreakBeforeCharacters"] = 135] = "wordWrapBreakBeforeCharacters";
  7890. EditorOption2[EditorOption2["wordWrapColumn"] = 136] = "wordWrapColumn";
  7891. EditorOption2[EditorOption2["wordWrapOverride1"] = 137] = "wordWrapOverride1";
  7892. EditorOption2[EditorOption2["wordWrapOverride2"] = 138] = "wordWrapOverride2";
  7893. EditorOption2[EditorOption2["wrappingIndent"] = 139] = "wrappingIndent";
  7894. EditorOption2[EditorOption2["wrappingStrategy"] = 140] = "wrappingStrategy";
  7895. EditorOption2[EditorOption2["showDeprecated"] = 141] = "showDeprecated";
  7896. EditorOption2[EditorOption2["inlayHints"] = 142] = "inlayHints";
  7897. EditorOption2[EditorOption2["editorClassName"] = 143] = "editorClassName";
  7898. EditorOption2[EditorOption2["pixelRatio"] = 144] = "pixelRatio";
  7899. EditorOption2[EditorOption2["tabFocusMode"] = 145] = "tabFocusMode";
  7900. EditorOption2[EditorOption2["layoutInfo"] = 146] = "layoutInfo";
  7901. EditorOption2[EditorOption2["wrappingInfo"] = 147] = "wrappingInfo";
  7902. EditorOption2[EditorOption2["defaultColorDecorators"] = 148] = "defaultColorDecorators";
  7903. EditorOption2[EditorOption2["colorDecoratorsActivatedOn"] = 149] = "colorDecoratorsActivatedOn";
  7904. EditorOption2[EditorOption2["inlineCompletionsAccessibilityVerbose"] = 150] = "inlineCompletionsAccessibilityVerbose";
  7905. })(EditorOption || (EditorOption = {}));
  7906. var EndOfLinePreference;
  7907. (function(EndOfLinePreference2) {
  7908. EndOfLinePreference2[EndOfLinePreference2["TextDefined"] = 0] = "TextDefined";
  7909. EndOfLinePreference2[EndOfLinePreference2["LF"] = 1] = "LF";
  7910. EndOfLinePreference2[EndOfLinePreference2["CRLF"] = 2] = "CRLF";
  7911. })(EndOfLinePreference || (EndOfLinePreference = {}));
  7912. var EndOfLineSequence;
  7913. (function(EndOfLineSequence2) {
  7914. EndOfLineSequence2[EndOfLineSequence2["LF"] = 0] = "LF";
  7915. EndOfLineSequence2[EndOfLineSequence2["CRLF"] = 1] = "CRLF";
  7916. })(EndOfLineSequence || (EndOfLineSequence = {}));
  7917. var GlyphMarginLane;
  7918. (function(GlyphMarginLane3) {
  7919. GlyphMarginLane3[GlyphMarginLane3["Left"] = 1] = "Left";
  7920. GlyphMarginLane3[GlyphMarginLane3["Center"] = 2] = "Center";
  7921. GlyphMarginLane3[GlyphMarginLane3["Right"] = 3] = "Right";
  7922. })(GlyphMarginLane || (GlyphMarginLane = {}));
  7923. var HoverVerbosityAction2;
  7924. (function(HoverVerbosityAction3) {
  7925. HoverVerbosityAction3[HoverVerbosityAction3["Increase"] = 0] = "Increase";
  7926. HoverVerbosityAction3[HoverVerbosityAction3["Decrease"] = 1] = "Decrease";
  7927. })(HoverVerbosityAction2 || (HoverVerbosityAction2 = {}));
  7928. var IndentAction;
  7929. (function(IndentAction2) {
  7930. IndentAction2[IndentAction2["None"] = 0] = "None";
  7931. IndentAction2[IndentAction2["Indent"] = 1] = "Indent";
  7932. IndentAction2[IndentAction2["IndentOutdent"] = 2] = "IndentOutdent";
  7933. IndentAction2[IndentAction2["Outdent"] = 3] = "Outdent";
  7934. })(IndentAction || (IndentAction = {}));
  7935. var InjectedTextCursorStops;
  7936. (function(InjectedTextCursorStops3) {
  7937. InjectedTextCursorStops3[InjectedTextCursorStops3["Both"] = 0] = "Both";
  7938. InjectedTextCursorStops3[InjectedTextCursorStops3["Right"] = 1] = "Right";
  7939. InjectedTextCursorStops3[InjectedTextCursorStops3["Left"] = 2] = "Left";
  7940. InjectedTextCursorStops3[InjectedTextCursorStops3["None"] = 3] = "None";
  7941. })(InjectedTextCursorStops || (InjectedTextCursorStops = {}));
  7942. var InlayHintKind2;
  7943. (function(InlayHintKind3) {
  7944. InlayHintKind3[InlayHintKind3["Type"] = 1] = "Type";
  7945. InlayHintKind3[InlayHintKind3["Parameter"] = 2] = "Parameter";
  7946. })(InlayHintKind2 || (InlayHintKind2 = {}));
  7947. var InlineCompletionTriggerKind2;
  7948. (function(InlineCompletionTriggerKind3) {
  7949. InlineCompletionTriggerKind3[InlineCompletionTriggerKind3["Automatic"] = 0] = "Automatic";
  7950. InlineCompletionTriggerKind3[InlineCompletionTriggerKind3["Explicit"] = 1] = "Explicit";
  7951. })(InlineCompletionTriggerKind2 || (InlineCompletionTriggerKind2 = {}));
  7952. var InlineEditTriggerKind2;
  7953. (function(InlineEditTriggerKind3) {
  7954. InlineEditTriggerKind3[InlineEditTriggerKind3["Invoke"] = 0] = "Invoke";
  7955. InlineEditTriggerKind3[InlineEditTriggerKind3["Automatic"] = 1] = "Automatic";
  7956. })(InlineEditTriggerKind2 || (InlineEditTriggerKind2 = {}));
  7957. var KeyCode;
  7958. (function(KeyCode2) {
  7959. KeyCode2[KeyCode2["DependsOnKbLayout"] = -1] = "DependsOnKbLayout";
  7960. KeyCode2[KeyCode2["Unknown"] = 0] = "Unknown";
  7961. KeyCode2[KeyCode2["Backspace"] = 1] = "Backspace";
  7962. KeyCode2[KeyCode2["Tab"] = 2] = "Tab";
  7963. KeyCode2[KeyCode2["Enter"] = 3] = "Enter";
  7964. KeyCode2[KeyCode2["Shift"] = 4] = "Shift";
  7965. KeyCode2[KeyCode2["Ctrl"] = 5] = "Ctrl";
  7966. KeyCode2[KeyCode2["Alt"] = 6] = "Alt";
  7967. KeyCode2[KeyCode2["PauseBreak"] = 7] = "PauseBreak";
  7968. KeyCode2[KeyCode2["CapsLock"] = 8] = "CapsLock";
  7969. KeyCode2[KeyCode2["Escape"] = 9] = "Escape";
  7970. KeyCode2[KeyCode2["Space"] = 10] = "Space";
  7971. KeyCode2[KeyCode2["PageUp"] = 11] = "PageUp";
  7972. KeyCode2[KeyCode2["PageDown"] = 12] = "PageDown";
  7973. KeyCode2[KeyCode2["End"] = 13] = "End";
  7974. KeyCode2[KeyCode2["Home"] = 14] = "Home";
  7975. KeyCode2[KeyCode2["LeftArrow"] = 15] = "LeftArrow";
  7976. KeyCode2[KeyCode2["UpArrow"] = 16] = "UpArrow";
  7977. KeyCode2[KeyCode2["RightArrow"] = 17] = "RightArrow";
  7978. KeyCode2[KeyCode2["DownArrow"] = 18] = "DownArrow";
  7979. KeyCode2[KeyCode2["Insert"] = 19] = "Insert";
  7980. KeyCode2[KeyCode2["Delete"] = 20] = "Delete";
  7981. KeyCode2[KeyCode2["Digit0"] = 21] = "Digit0";
  7982. KeyCode2[KeyCode2["Digit1"] = 22] = "Digit1";
  7983. KeyCode2[KeyCode2["Digit2"] = 23] = "Digit2";
  7984. KeyCode2[KeyCode2["Digit3"] = 24] = "Digit3";
  7985. KeyCode2[KeyCode2["Digit4"] = 25] = "Digit4";
  7986. KeyCode2[KeyCode2["Digit5"] = 26] = "Digit5";
  7987. KeyCode2[KeyCode2["Digit6"] = 27] = "Digit6";
  7988. KeyCode2[KeyCode2["Digit7"] = 28] = "Digit7";
  7989. KeyCode2[KeyCode2["Digit8"] = 29] = "Digit8";
  7990. KeyCode2[KeyCode2["Digit9"] = 30] = "Digit9";
  7991. KeyCode2[KeyCode2["KeyA"] = 31] = "KeyA";
  7992. KeyCode2[KeyCode2["KeyB"] = 32] = "KeyB";
  7993. KeyCode2[KeyCode2["KeyC"] = 33] = "KeyC";
  7994. KeyCode2[KeyCode2["KeyD"] = 34] = "KeyD";
  7995. KeyCode2[KeyCode2["KeyE"] = 35] = "KeyE";
  7996. KeyCode2[KeyCode2["KeyF"] = 36] = "KeyF";
  7997. KeyCode2[KeyCode2["KeyG"] = 37] = "KeyG";
  7998. KeyCode2[KeyCode2["KeyH"] = 38] = "KeyH";
  7999. KeyCode2[KeyCode2["KeyI"] = 39] = "KeyI";
  8000. KeyCode2[KeyCode2["KeyJ"] = 40] = "KeyJ";
  8001. KeyCode2[KeyCode2["KeyK"] = 41] = "KeyK";
  8002. KeyCode2[KeyCode2["KeyL"] = 42] = "KeyL";
  8003. KeyCode2[KeyCode2["KeyM"] = 43] = "KeyM";
  8004. KeyCode2[KeyCode2["KeyN"] = 44] = "KeyN";
  8005. KeyCode2[KeyCode2["KeyO"] = 45] = "KeyO";
  8006. KeyCode2[KeyCode2["KeyP"] = 46] = "KeyP";
  8007. KeyCode2[KeyCode2["KeyQ"] = 47] = "KeyQ";
  8008. KeyCode2[KeyCode2["KeyR"] = 48] = "KeyR";
  8009. KeyCode2[KeyCode2["KeyS"] = 49] = "KeyS";
  8010. KeyCode2[KeyCode2["KeyT"] = 50] = "KeyT";
  8011. KeyCode2[KeyCode2["KeyU"] = 51] = "KeyU";
  8012. KeyCode2[KeyCode2["KeyV"] = 52] = "KeyV";
  8013. KeyCode2[KeyCode2["KeyW"] = 53] = "KeyW";
  8014. KeyCode2[KeyCode2["KeyX"] = 54] = "KeyX";
  8015. KeyCode2[KeyCode2["KeyY"] = 55] = "KeyY";
  8016. KeyCode2[KeyCode2["KeyZ"] = 56] = "KeyZ";
  8017. KeyCode2[KeyCode2["Meta"] = 57] = "Meta";
  8018. KeyCode2[KeyCode2["ContextMenu"] = 58] = "ContextMenu";
  8019. KeyCode2[KeyCode2["F1"] = 59] = "F1";
  8020. KeyCode2[KeyCode2["F2"] = 60] = "F2";
  8021. KeyCode2[KeyCode2["F3"] = 61] = "F3";
  8022. KeyCode2[KeyCode2["F4"] = 62] = "F4";
  8023. KeyCode2[KeyCode2["F5"] = 63] = "F5";
  8024. KeyCode2[KeyCode2["F6"] = 64] = "F6";
  8025. KeyCode2[KeyCode2["F7"] = 65] = "F7";
  8026. KeyCode2[KeyCode2["F8"] = 66] = "F8";
  8027. KeyCode2[KeyCode2["F9"] = 67] = "F9";
  8028. KeyCode2[KeyCode2["F10"] = 68] = "F10";
  8029. KeyCode2[KeyCode2["F11"] = 69] = "F11";
  8030. KeyCode2[KeyCode2["F12"] = 70] = "F12";
  8031. KeyCode2[KeyCode2["F13"] = 71] = "F13";
  8032. KeyCode2[KeyCode2["F14"] = 72] = "F14";
  8033. KeyCode2[KeyCode2["F15"] = 73] = "F15";
  8034. KeyCode2[KeyCode2["F16"] = 74] = "F16";
  8035. KeyCode2[KeyCode2["F17"] = 75] = "F17";
  8036. KeyCode2[KeyCode2["F18"] = 76] = "F18";
  8037. KeyCode2[KeyCode2["F19"] = 77] = "F19";
  8038. KeyCode2[KeyCode2["F20"] = 78] = "F20";
  8039. KeyCode2[KeyCode2["F21"] = 79] = "F21";
  8040. KeyCode2[KeyCode2["F22"] = 80] = "F22";
  8041. KeyCode2[KeyCode2["F23"] = 81] = "F23";
  8042. KeyCode2[KeyCode2["F24"] = 82] = "F24";
  8043. KeyCode2[KeyCode2["NumLock"] = 83] = "NumLock";
  8044. KeyCode2[KeyCode2["ScrollLock"] = 84] = "ScrollLock";
  8045. KeyCode2[KeyCode2["Semicolon"] = 85] = "Semicolon";
  8046. KeyCode2[KeyCode2["Equal"] = 86] = "Equal";
  8047. KeyCode2[KeyCode2["Comma"] = 87] = "Comma";
  8048. KeyCode2[KeyCode2["Minus"] = 88] = "Minus";
  8049. KeyCode2[KeyCode2["Period"] = 89] = "Period";
  8050. KeyCode2[KeyCode2["Slash"] = 90] = "Slash";
  8051. KeyCode2[KeyCode2["Backquote"] = 91] = "Backquote";
  8052. KeyCode2[KeyCode2["BracketLeft"] = 92] = "BracketLeft";
  8053. KeyCode2[KeyCode2["Backslash"] = 93] = "Backslash";
  8054. KeyCode2[KeyCode2["BracketRight"] = 94] = "BracketRight";
  8055. KeyCode2[KeyCode2["Quote"] = 95] = "Quote";
  8056. KeyCode2[KeyCode2["OEM_8"] = 96] = "OEM_8";
  8057. KeyCode2[KeyCode2["IntlBackslash"] = 97] = "IntlBackslash";
  8058. KeyCode2[KeyCode2["Numpad0"] = 98] = "Numpad0";
  8059. KeyCode2[KeyCode2["Numpad1"] = 99] = "Numpad1";
  8060. KeyCode2[KeyCode2["Numpad2"] = 100] = "Numpad2";
  8061. KeyCode2[KeyCode2["Numpad3"] = 101] = "Numpad3";
  8062. KeyCode2[KeyCode2["Numpad4"] = 102] = "Numpad4";
  8063. KeyCode2[KeyCode2["Numpad5"] = 103] = "Numpad5";
  8064. KeyCode2[KeyCode2["Numpad6"] = 104] = "Numpad6";
  8065. KeyCode2[KeyCode2["Numpad7"] = 105] = "Numpad7";
  8066. KeyCode2[KeyCode2["Numpad8"] = 106] = "Numpad8";
  8067. KeyCode2[KeyCode2["Numpad9"] = 107] = "Numpad9";
  8068. KeyCode2[KeyCode2["NumpadMultiply"] = 108] = "NumpadMultiply";
  8069. KeyCode2[KeyCode2["NumpadAdd"] = 109] = "NumpadAdd";
  8070. KeyCode2[KeyCode2["NUMPAD_SEPARATOR"] = 110] = "NUMPAD_SEPARATOR";
  8071. KeyCode2[KeyCode2["NumpadSubtract"] = 111] = "NumpadSubtract";
  8072. KeyCode2[KeyCode2["NumpadDecimal"] = 112] = "NumpadDecimal";
  8073. KeyCode2[KeyCode2["NumpadDivide"] = 113] = "NumpadDivide";
  8074. KeyCode2[KeyCode2["KEY_IN_COMPOSITION"] = 114] = "KEY_IN_COMPOSITION";
  8075. KeyCode2[KeyCode2["ABNT_C1"] = 115] = "ABNT_C1";
  8076. KeyCode2[KeyCode2["ABNT_C2"] = 116] = "ABNT_C2";
  8077. KeyCode2[KeyCode2["AudioVolumeMute"] = 117] = "AudioVolumeMute";
  8078. KeyCode2[KeyCode2["AudioVolumeUp"] = 118] = "AudioVolumeUp";
  8079. KeyCode2[KeyCode2["AudioVolumeDown"] = 119] = "AudioVolumeDown";
  8080. KeyCode2[KeyCode2["BrowserSearch"] = 120] = "BrowserSearch";
  8081. KeyCode2[KeyCode2["BrowserHome"] = 121] = "BrowserHome";
  8082. KeyCode2[KeyCode2["BrowserBack"] = 122] = "BrowserBack";
  8083. KeyCode2[KeyCode2["BrowserForward"] = 123] = "BrowserForward";
  8084. KeyCode2[KeyCode2["MediaTrackNext"] = 124] = "MediaTrackNext";
  8085. KeyCode2[KeyCode2["MediaTrackPrevious"] = 125] = "MediaTrackPrevious";
  8086. KeyCode2[KeyCode2["MediaStop"] = 126] = "MediaStop";
  8087. KeyCode2[KeyCode2["MediaPlayPause"] = 127] = "MediaPlayPause";
  8088. KeyCode2[KeyCode2["LaunchMediaPlayer"] = 128] = "LaunchMediaPlayer";
  8089. KeyCode2[KeyCode2["LaunchMail"] = 129] = "LaunchMail";
  8090. KeyCode2[KeyCode2["LaunchApp2"] = 130] = "LaunchApp2";
  8091. KeyCode2[KeyCode2["Clear"] = 131] = "Clear";
  8092. KeyCode2[KeyCode2["MAX_VALUE"] = 132] = "MAX_VALUE";
  8093. })(KeyCode || (KeyCode = {}));
  8094. var MarkerSeverity;
  8095. (function(MarkerSeverity2) {
  8096. MarkerSeverity2[MarkerSeverity2["Hint"] = 1] = "Hint";
  8097. MarkerSeverity2[MarkerSeverity2["Info"] = 2] = "Info";
  8098. MarkerSeverity2[MarkerSeverity2["Warning"] = 4] = "Warning";
  8099. MarkerSeverity2[MarkerSeverity2["Error"] = 8] = "Error";
  8100. })(MarkerSeverity || (MarkerSeverity = {}));
  8101. var MarkerTag;
  8102. (function(MarkerTag2) {
  8103. MarkerTag2[MarkerTag2["Unnecessary"] = 1] = "Unnecessary";
  8104. MarkerTag2[MarkerTag2["Deprecated"] = 2] = "Deprecated";
  8105. })(MarkerTag || (MarkerTag = {}));
  8106. var MinimapPosition;
  8107. (function(MinimapPosition2) {
  8108. MinimapPosition2[MinimapPosition2["Inline"] = 1] = "Inline";
  8109. MinimapPosition2[MinimapPosition2["Gutter"] = 2] = "Gutter";
  8110. })(MinimapPosition || (MinimapPosition = {}));
  8111. var MinimapSectionHeaderStyle;
  8112. (function(MinimapSectionHeaderStyle2) {
  8113. MinimapSectionHeaderStyle2[MinimapSectionHeaderStyle2["Normal"] = 1] = "Normal";
  8114. MinimapSectionHeaderStyle2[MinimapSectionHeaderStyle2["Underlined"] = 2] = "Underlined";
  8115. })(MinimapSectionHeaderStyle || (MinimapSectionHeaderStyle = {}));
  8116. var MouseTargetType;
  8117. (function(MouseTargetType2) {
  8118. MouseTargetType2[MouseTargetType2["UNKNOWN"] = 0] = "UNKNOWN";
  8119. MouseTargetType2[MouseTargetType2["TEXTAREA"] = 1] = "TEXTAREA";
  8120. MouseTargetType2[MouseTargetType2["GUTTER_GLYPH_MARGIN"] = 2] = "GUTTER_GLYPH_MARGIN";
  8121. MouseTargetType2[MouseTargetType2["GUTTER_LINE_NUMBERS"] = 3] = "GUTTER_LINE_NUMBERS";
  8122. MouseTargetType2[MouseTargetType2["GUTTER_LINE_DECORATIONS"] = 4] = "GUTTER_LINE_DECORATIONS";
  8123. MouseTargetType2[MouseTargetType2["GUTTER_VIEW_ZONE"] = 5] = "GUTTER_VIEW_ZONE";
  8124. MouseTargetType2[MouseTargetType2["CONTENT_TEXT"] = 6] = "CONTENT_TEXT";
  8125. MouseTargetType2[MouseTargetType2["CONTENT_EMPTY"] = 7] = "CONTENT_EMPTY";
  8126. MouseTargetType2[MouseTargetType2["CONTENT_VIEW_ZONE"] = 8] = "CONTENT_VIEW_ZONE";
  8127. MouseTargetType2[MouseTargetType2["CONTENT_WIDGET"] = 9] = "CONTENT_WIDGET";
  8128. MouseTargetType2[MouseTargetType2["OVERVIEW_RULER"] = 10] = "OVERVIEW_RULER";
  8129. MouseTargetType2[MouseTargetType2["SCROLLBAR"] = 11] = "SCROLLBAR";
  8130. MouseTargetType2[MouseTargetType2["OVERLAY_WIDGET"] = 12] = "OVERLAY_WIDGET";
  8131. MouseTargetType2[MouseTargetType2["OUTSIDE_EDITOR"] = 13] = "OUTSIDE_EDITOR";
  8132. })(MouseTargetType || (MouseTargetType = {}));
  8133. var NewSymbolNameTag2;
  8134. (function(NewSymbolNameTag3) {
  8135. NewSymbolNameTag3[NewSymbolNameTag3["AIGenerated"] = 1] = "AIGenerated";
  8136. })(NewSymbolNameTag2 || (NewSymbolNameTag2 = {}));
  8137. var NewSymbolNameTriggerKind2;
  8138. (function(NewSymbolNameTriggerKind3) {
  8139. NewSymbolNameTriggerKind3[NewSymbolNameTriggerKind3["Invoke"] = 0] = "Invoke";
  8140. NewSymbolNameTriggerKind3[NewSymbolNameTriggerKind3["Automatic"] = 1] = "Automatic";
  8141. })(NewSymbolNameTriggerKind2 || (NewSymbolNameTriggerKind2 = {}));
  8142. var OverlayWidgetPositionPreference;
  8143. (function(OverlayWidgetPositionPreference2) {
  8144. OverlayWidgetPositionPreference2[OverlayWidgetPositionPreference2["TOP_RIGHT_CORNER"] = 0] = "TOP_RIGHT_CORNER";
  8145. OverlayWidgetPositionPreference2[OverlayWidgetPositionPreference2["BOTTOM_RIGHT_CORNER"] = 1] = "BOTTOM_RIGHT_CORNER";
  8146. OverlayWidgetPositionPreference2[OverlayWidgetPositionPreference2["TOP_CENTER"] = 2] = "TOP_CENTER";
  8147. })(OverlayWidgetPositionPreference || (OverlayWidgetPositionPreference = {}));
  8148. var OverviewRulerLane;
  8149. (function(OverviewRulerLane3) {
  8150. OverviewRulerLane3[OverviewRulerLane3["Left"] = 1] = "Left";
  8151. OverviewRulerLane3[OverviewRulerLane3["Center"] = 2] = "Center";
  8152. OverviewRulerLane3[OverviewRulerLane3["Right"] = 4] = "Right";
  8153. OverviewRulerLane3[OverviewRulerLane3["Full"] = 7] = "Full";
  8154. })(OverviewRulerLane || (OverviewRulerLane = {}));
  8155. var PartialAcceptTriggerKind;
  8156. (function(PartialAcceptTriggerKind2) {
  8157. PartialAcceptTriggerKind2[PartialAcceptTriggerKind2["Word"] = 0] = "Word";
  8158. PartialAcceptTriggerKind2[PartialAcceptTriggerKind2["Line"] = 1] = "Line";
  8159. PartialAcceptTriggerKind2[PartialAcceptTriggerKind2["Suggest"] = 2] = "Suggest";
  8160. })(PartialAcceptTriggerKind || (PartialAcceptTriggerKind = {}));
  8161. var PositionAffinity;
  8162. (function(PositionAffinity2) {
  8163. PositionAffinity2[PositionAffinity2["Left"] = 0] = "Left";
  8164. PositionAffinity2[PositionAffinity2["Right"] = 1] = "Right";
  8165. PositionAffinity2[PositionAffinity2["None"] = 2] = "None";
  8166. PositionAffinity2[PositionAffinity2["LeftOfInjectedText"] = 3] = "LeftOfInjectedText";
  8167. PositionAffinity2[PositionAffinity2["RightOfInjectedText"] = 4] = "RightOfInjectedText";
  8168. })(PositionAffinity || (PositionAffinity = {}));
  8169. var RenderLineNumbersType;
  8170. (function(RenderLineNumbersType2) {
  8171. RenderLineNumbersType2[RenderLineNumbersType2["Off"] = 0] = "Off";
  8172. RenderLineNumbersType2[RenderLineNumbersType2["On"] = 1] = "On";
  8173. RenderLineNumbersType2[RenderLineNumbersType2["Relative"] = 2] = "Relative";
  8174. RenderLineNumbersType2[RenderLineNumbersType2["Interval"] = 3] = "Interval";
  8175. RenderLineNumbersType2[RenderLineNumbersType2["Custom"] = 4] = "Custom";
  8176. })(RenderLineNumbersType || (RenderLineNumbersType = {}));
  8177. var RenderMinimap;
  8178. (function(RenderMinimap2) {
  8179. RenderMinimap2[RenderMinimap2["None"] = 0] = "None";
  8180. RenderMinimap2[RenderMinimap2["Text"] = 1] = "Text";
  8181. RenderMinimap2[RenderMinimap2["Blocks"] = 2] = "Blocks";
  8182. })(RenderMinimap || (RenderMinimap = {}));
  8183. var ScrollType;
  8184. (function(ScrollType2) {
  8185. ScrollType2[ScrollType2["Smooth"] = 0] = "Smooth";
  8186. ScrollType2[ScrollType2["Immediate"] = 1] = "Immediate";
  8187. })(ScrollType || (ScrollType = {}));
  8188. var ScrollbarVisibility;
  8189. (function(ScrollbarVisibility2) {
  8190. ScrollbarVisibility2[ScrollbarVisibility2["Auto"] = 1] = "Auto";
  8191. ScrollbarVisibility2[ScrollbarVisibility2["Hidden"] = 2] = "Hidden";
  8192. ScrollbarVisibility2[ScrollbarVisibility2["Visible"] = 3] = "Visible";
  8193. })(ScrollbarVisibility || (ScrollbarVisibility = {}));
  8194. var SelectionDirection;
  8195. (function(SelectionDirection2) {
  8196. SelectionDirection2[SelectionDirection2["LTR"] = 0] = "LTR";
  8197. SelectionDirection2[SelectionDirection2["RTL"] = 1] = "RTL";
  8198. })(SelectionDirection || (SelectionDirection = {}));
  8199. var ShowLightbulbIconMode;
  8200. (function(ShowLightbulbIconMode2) {
  8201. ShowLightbulbIconMode2["Off"] = "off";
  8202. ShowLightbulbIconMode2["OnCode"] = "onCode";
  8203. ShowLightbulbIconMode2["On"] = "on";
  8204. })(ShowLightbulbIconMode || (ShowLightbulbIconMode = {}));
  8205. var SignatureHelpTriggerKind2;
  8206. (function(SignatureHelpTriggerKind3) {
  8207. SignatureHelpTriggerKind3[SignatureHelpTriggerKind3["Invoke"] = 1] = "Invoke";
  8208. SignatureHelpTriggerKind3[SignatureHelpTriggerKind3["TriggerCharacter"] = 2] = "TriggerCharacter";
  8209. SignatureHelpTriggerKind3[SignatureHelpTriggerKind3["ContentChange"] = 3] = "ContentChange";
  8210. })(SignatureHelpTriggerKind2 || (SignatureHelpTriggerKind2 = {}));
  8211. var SymbolKind;
  8212. (function(SymbolKind2) {
  8213. SymbolKind2[SymbolKind2["File"] = 0] = "File";
  8214. SymbolKind2[SymbolKind2["Module"] = 1] = "Module";
  8215. SymbolKind2[SymbolKind2["Namespace"] = 2] = "Namespace";
  8216. SymbolKind2[SymbolKind2["Package"] = 3] = "Package";
  8217. SymbolKind2[SymbolKind2["Class"] = 4] = "Class";
  8218. SymbolKind2[SymbolKind2["Method"] = 5] = "Method";
  8219. SymbolKind2[SymbolKind2["Property"] = 6] = "Property";
  8220. SymbolKind2[SymbolKind2["Field"] = 7] = "Field";
  8221. SymbolKind2[SymbolKind2["Constructor"] = 8] = "Constructor";
  8222. SymbolKind2[SymbolKind2["Enum"] = 9] = "Enum";
  8223. SymbolKind2[SymbolKind2["Interface"] = 10] = "Interface";
  8224. SymbolKind2[SymbolKind2["Function"] = 11] = "Function";
  8225. SymbolKind2[SymbolKind2["Variable"] = 12] = "Variable";
  8226. SymbolKind2[SymbolKind2["Constant"] = 13] = "Constant";
  8227. SymbolKind2[SymbolKind2["String"] = 14] = "String";
  8228. SymbolKind2[SymbolKind2["Number"] = 15] = "Number";
  8229. SymbolKind2[SymbolKind2["Boolean"] = 16] = "Boolean";
  8230. SymbolKind2[SymbolKind2["Array"] = 17] = "Array";
  8231. SymbolKind2[SymbolKind2["Object"] = 18] = "Object";
  8232. SymbolKind2[SymbolKind2["Key"] = 19] = "Key";
  8233. SymbolKind2[SymbolKind2["Null"] = 20] = "Null";
  8234. SymbolKind2[SymbolKind2["EnumMember"] = 21] = "EnumMember";
  8235. SymbolKind2[SymbolKind2["Struct"] = 22] = "Struct";
  8236. SymbolKind2[SymbolKind2["Event"] = 23] = "Event";
  8237. SymbolKind2[SymbolKind2["Operator"] = 24] = "Operator";
  8238. SymbolKind2[SymbolKind2["TypeParameter"] = 25] = "TypeParameter";
  8239. })(SymbolKind || (SymbolKind = {}));
  8240. var SymbolTag;
  8241. (function(SymbolTag2) {
  8242. SymbolTag2[SymbolTag2["Deprecated"] = 1] = "Deprecated";
  8243. })(SymbolTag || (SymbolTag = {}));
  8244. var TextEditorCursorBlinkingStyle;
  8245. (function(TextEditorCursorBlinkingStyle2) {
  8246. TextEditorCursorBlinkingStyle2[TextEditorCursorBlinkingStyle2["Hidden"] = 0] = "Hidden";
  8247. TextEditorCursorBlinkingStyle2[TextEditorCursorBlinkingStyle2["Blink"] = 1] = "Blink";
  8248. TextEditorCursorBlinkingStyle2[TextEditorCursorBlinkingStyle2["Smooth"] = 2] = "Smooth";
  8249. TextEditorCursorBlinkingStyle2[TextEditorCursorBlinkingStyle2["Phase"] = 3] = "Phase";
  8250. TextEditorCursorBlinkingStyle2[TextEditorCursorBlinkingStyle2["Expand"] = 4] = "Expand";
  8251. TextEditorCursorBlinkingStyle2[TextEditorCursorBlinkingStyle2["Solid"] = 5] = "Solid";
  8252. })(TextEditorCursorBlinkingStyle || (TextEditorCursorBlinkingStyle = {}));
  8253. var TextEditorCursorStyle;
  8254. (function(TextEditorCursorStyle2) {
  8255. TextEditorCursorStyle2[TextEditorCursorStyle2["Line"] = 1] = "Line";
  8256. TextEditorCursorStyle2[TextEditorCursorStyle2["Block"] = 2] = "Block";
  8257. TextEditorCursorStyle2[TextEditorCursorStyle2["Underline"] = 3] = "Underline";
  8258. TextEditorCursorStyle2[TextEditorCursorStyle2["LineThin"] = 4] = "LineThin";
  8259. TextEditorCursorStyle2[TextEditorCursorStyle2["BlockOutline"] = 5] = "BlockOutline";
  8260. TextEditorCursorStyle2[TextEditorCursorStyle2["UnderlineThin"] = 6] = "UnderlineThin";
  8261. })(TextEditorCursorStyle || (TextEditorCursorStyle = {}));
  8262. var TrackedRangeStickiness;
  8263. (function(TrackedRangeStickiness2) {
  8264. TrackedRangeStickiness2[TrackedRangeStickiness2["AlwaysGrowsWhenTypingAtEdges"] = 0] = "AlwaysGrowsWhenTypingAtEdges";
  8265. TrackedRangeStickiness2[TrackedRangeStickiness2["NeverGrowsWhenTypingAtEdges"] = 1] = "NeverGrowsWhenTypingAtEdges";
  8266. TrackedRangeStickiness2[TrackedRangeStickiness2["GrowsOnlyWhenTypingBefore"] = 2] = "GrowsOnlyWhenTypingBefore";
  8267. TrackedRangeStickiness2[TrackedRangeStickiness2["GrowsOnlyWhenTypingAfter"] = 3] = "GrowsOnlyWhenTypingAfter";
  8268. })(TrackedRangeStickiness || (TrackedRangeStickiness = {}));
  8269. var WrappingIndent;
  8270. (function(WrappingIndent2) {
  8271. WrappingIndent2[WrappingIndent2["None"] = 0] = "None";
  8272. WrappingIndent2[WrappingIndent2["Same"] = 1] = "Same";
  8273. WrappingIndent2[WrappingIndent2["Indent"] = 2] = "Indent";
  8274. WrappingIndent2[WrappingIndent2["DeepIndent"] = 3] = "DeepIndent";
  8275. })(WrappingIndent || (WrappingIndent = {}));
  8276. // node_modules/monaco-editor/esm/vs/editor/common/services/editorBaseApi.js
  8277. var KeyMod = class {
  8278. static {
  8279. this.CtrlCmd = 2048;
  8280. }
  8281. static {
  8282. this.Shift = 1024;
  8283. }
  8284. static {
  8285. this.Alt = 512;
  8286. }
  8287. static {
  8288. this.WinCtrl = 256;
  8289. }
  8290. static chord(firstPart, secondPart) {
  8291. return KeyChord(firstPart, secondPart);
  8292. }
  8293. };
  8294. function createMonacoBaseAPI() {
  8295. return {
  8296. editor: void 0,
  8297. // undefined override expected here
  8298. languages: void 0,
  8299. // undefined override expected here
  8300. CancellationTokenSource,
  8301. Emitter,
  8302. KeyCode,
  8303. KeyMod,
  8304. Position,
  8305. Range,
  8306. Selection,
  8307. SelectionDirection,
  8308. MarkerSeverity,
  8309. MarkerTag,
  8310. Uri: URI,
  8311. Token
  8312. };
  8313. }
  8314. // node_modules/monaco-editor/esm/vs/editor/common/services/editorWorkerHost.js
  8315. var EditorWorkerHost = class _EditorWorkerHost {
  8316. static {
  8317. this.CHANNEL_NAME = "editorWorkerHost";
  8318. }
  8319. static getChannel(workerServer) {
  8320. return workerServer.getChannel(_EditorWorkerHost.CHANNEL_NAME);
  8321. }
  8322. static setChannel(workerClient, obj) {
  8323. workerClient.setChannel(_EditorWorkerHost.CHANNEL_NAME, obj);
  8324. }
  8325. };
  8326. // node_modules/monaco-editor/esm/vs/base/common/map.js
  8327. var _a;
  8328. var _b;
  8329. var ResourceMapEntry = class {
  8330. constructor(uri, value) {
  8331. this.uri = uri;
  8332. this.value = value;
  8333. }
  8334. };
  8335. function isEntries(arg) {
  8336. return Array.isArray(arg);
  8337. }
  8338. var ResourceMap = class _ResourceMap {
  8339. static {
  8340. this.defaultToKey = (resource) => resource.toString();
  8341. }
  8342. constructor(arg, toKey) {
  8343. this[_a] = "ResourceMap";
  8344. if (arg instanceof _ResourceMap) {
  8345. this.map = new Map(arg.map);
  8346. this.toKey = toKey ?? _ResourceMap.defaultToKey;
  8347. } else if (isEntries(arg)) {
  8348. this.map = /* @__PURE__ */ new Map();
  8349. this.toKey = toKey ?? _ResourceMap.defaultToKey;
  8350. for (const [resource, value] of arg) {
  8351. this.set(resource, value);
  8352. }
  8353. } else {
  8354. this.map = /* @__PURE__ */ new Map();
  8355. this.toKey = arg ?? _ResourceMap.defaultToKey;
  8356. }
  8357. }
  8358. set(resource, value) {
  8359. this.map.set(this.toKey(resource), new ResourceMapEntry(resource, value));
  8360. return this;
  8361. }
  8362. get(resource) {
  8363. return this.map.get(this.toKey(resource))?.value;
  8364. }
  8365. has(resource) {
  8366. return this.map.has(this.toKey(resource));
  8367. }
  8368. get size() {
  8369. return this.map.size;
  8370. }
  8371. clear() {
  8372. this.map.clear();
  8373. }
  8374. delete(resource) {
  8375. return this.map.delete(this.toKey(resource));
  8376. }
  8377. forEach(clb, thisArg) {
  8378. if (typeof thisArg !== "undefined") {
  8379. clb = clb.bind(thisArg);
  8380. }
  8381. for (const [_, entry] of this.map) {
  8382. clb(entry.value, entry.uri, this);
  8383. }
  8384. }
  8385. *values() {
  8386. for (const entry of this.map.values()) {
  8387. yield entry.value;
  8388. }
  8389. }
  8390. *keys() {
  8391. for (const entry of this.map.values()) {
  8392. yield entry.uri;
  8393. }
  8394. }
  8395. *entries() {
  8396. for (const entry of this.map.values()) {
  8397. yield [entry.uri, entry.value];
  8398. }
  8399. }
  8400. *[(_a = Symbol.toStringTag, Symbol.iterator)]() {
  8401. for (const [, entry] of this.map) {
  8402. yield [entry.uri, entry.value];
  8403. }
  8404. }
  8405. };
  8406. var LinkedMap = class {
  8407. constructor() {
  8408. this[_b] = "LinkedMap";
  8409. this._map = /* @__PURE__ */ new Map();
  8410. this._head = void 0;
  8411. this._tail = void 0;
  8412. this._size = 0;
  8413. this._state = 0;
  8414. }
  8415. clear() {
  8416. this._map.clear();
  8417. this._head = void 0;
  8418. this._tail = void 0;
  8419. this._size = 0;
  8420. this._state++;
  8421. }
  8422. isEmpty() {
  8423. return !this._head && !this._tail;
  8424. }
  8425. get size() {
  8426. return this._size;
  8427. }
  8428. get first() {
  8429. return this._head?.value;
  8430. }
  8431. get last() {
  8432. return this._tail?.value;
  8433. }
  8434. has(key) {
  8435. return this._map.has(key);
  8436. }
  8437. get(key, touch = 0) {
  8438. const item = this._map.get(key);
  8439. if (!item) {
  8440. return void 0;
  8441. }
  8442. if (touch !== 0) {
  8443. this.touch(item, touch);
  8444. }
  8445. return item.value;
  8446. }
  8447. set(key, value, touch = 0) {
  8448. let item = this._map.get(key);
  8449. if (item) {
  8450. item.value = value;
  8451. if (touch !== 0) {
  8452. this.touch(item, touch);
  8453. }
  8454. } else {
  8455. item = { key, value, next: void 0, previous: void 0 };
  8456. switch (touch) {
  8457. case 0:
  8458. this.addItemLast(item);
  8459. break;
  8460. case 1:
  8461. this.addItemFirst(item);
  8462. break;
  8463. case 2:
  8464. this.addItemLast(item);
  8465. break;
  8466. default:
  8467. this.addItemLast(item);
  8468. break;
  8469. }
  8470. this._map.set(key, item);
  8471. this._size++;
  8472. }
  8473. return this;
  8474. }
  8475. delete(key) {
  8476. return !!this.remove(key);
  8477. }
  8478. remove(key) {
  8479. const item = this._map.get(key);
  8480. if (!item) {
  8481. return void 0;
  8482. }
  8483. this._map.delete(key);
  8484. this.removeItem(item);
  8485. this._size--;
  8486. return item.value;
  8487. }
  8488. shift() {
  8489. if (!this._head && !this._tail) {
  8490. return void 0;
  8491. }
  8492. if (!this._head || !this._tail) {
  8493. throw new Error("Invalid list");
  8494. }
  8495. const item = this._head;
  8496. this._map.delete(item.key);
  8497. this.removeItem(item);
  8498. this._size--;
  8499. return item.value;
  8500. }
  8501. forEach(callbackfn, thisArg) {
  8502. const state = this._state;
  8503. let current = this._head;
  8504. while (current) {
  8505. if (thisArg) {
  8506. callbackfn.bind(thisArg)(current.value, current.key, this);
  8507. } else {
  8508. callbackfn(current.value, current.key, this);
  8509. }
  8510. if (this._state !== state) {
  8511. throw new Error(`LinkedMap got modified during iteration.`);
  8512. }
  8513. current = current.next;
  8514. }
  8515. }
  8516. keys() {
  8517. const map = this;
  8518. const state = this._state;
  8519. let current = this._head;
  8520. const iterator = {
  8521. [Symbol.iterator]() {
  8522. return iterator;
  8523. },
  8524. next() {
  8525. if (map._state !== state) {
  8526. throw new Error(`LinkedMap got modified during iteration.`);
  8527. }
  8528. if (current) {
  8529. const result = { value: current.key, done: false };
  8530. current = current.next;
  8531. return result;
  8532. } else {
  8533. return { value: void 0, done: true };
  8534. }
  8535. }
  8536. };
  8537. return iterator;
  8538. }
  8539. values() {
  8540. const map = this;
  8541. const state = this._state;
  8542. let current = this._head;
  8543. const iterator = {
  8544. [Symbol.iterator]() {
  8545. return iterator;
  8546. },
  8547. next() {
  8548. if (map._state !== state) {
  8549. throw new Error(`LinkedMap got modified during iteration.`);
  8550. }
  8551. if (current) {
  8552. const result = { value: current.value, done: false };
  8553. current = current.next;
  8554. return result;
  8555. } else {
  8556. return { value: void 0, done: true };
  8557. }
  8558. }
  8559. };
  8560. return iterator;
  8561. }
  8562. entries() {
  8563. const map = this;
  8564. const state = this._state;
  8565. let current = this._head;
  8566. const iterator = {
  8567. [Symbol.iterator]() {
  8568. return iterator;
  8569. },
  8570. next() {
  8571. if (map._state !== state) {
  8572. throw new Error(`LinkedMap got modified during iteration.`);
  8573. }
  8574. if (current) {
  8575. const result = { value: [current.key, current.value], done: false };
  8576. current = current.next;
  8577. return result;
  8578. } else {
  8579. return { value: void 0, done: true };
  8580. }
  8581. }
  8582. };
  8583. return iterator;
  8584. }
  8585. [(_b = Symbol.toStringTag, Symbol.iterator)]() {
  8586. return this.entries();
  8587. }
  8588. trimOld(newSize) {
  8589. if (newSize >= this.size) {
  8590. return;
  8591. }
  8592. if (newSize === 0) {
  8593. this.clear();
  8594. return;
  8595. }
  8596. let current = this._head;
  8597. let currentSize = this.size;
  8598. while (current && currentSize > newSize) {
  8599. this._map.delete(current.key);
  8600. current = current.next;
  8601. currentSize--;
  8602. }
  8603. this._head = current;
  8604. this._size = currentSize;
  8605. if (current) {
  8606. current.previous = void 0;
  8607. }
  8608. this._state++;
  8609. }
  8610. trimNew(newSize) {
  8611. if (newSize >= this.size) {
  8612. return;
  8613. }
  8614. if (newSize === 0) {
  8615. this.clear();
  8616. return;
  8617. }
  8618. let current = this._tail;
  8619. let currentSize = this.size;
  8620. while (current && currentSize > newSize) {
  8621. this._map.delete(current.key);
  8622. current = current.previous;
  8623. currentSize--;
  8624. }
  8625. this._tail = current;
  8626. this._size = currentSize;
  8627. if (current) {
  8628. current.next = void 0;
  8629. }
  8630. this._state++;
  8631. }
  8632. addItemFirst(item) {
  8633. if (!this._head && !this._tail) {
  8634. this._tail = item;
  8635. } else if (!this._head) {
  8636. throw new Error("Invalid list");
  8637. } else {
  8638. item.next = this._head;
  8639. this._head.previous = item;
  8640. }
  8641. this._head = item;
  8642. this._state++;
  8643. }
  8644. addItemLast(item) {
  8645. if (!this._head && !this._tail) {
  8646. this._head = item;
  8647. } else if (!this._tail) {
  8648. throw new Error("Invalid list");
  8649. } else {
  8650. item.previous = this._tail;
  8651. this._tail.next = item;
  8652. }
  8653. this._tail = item;
  8654. this._state++;
  8655. }
  8656. removeItem(item) {
  8657. if (item === this._head && item === this._tail) {
  8658. this._head = void 0;
  8659. this._tail = void 0;
  8660. } else if (item === this._head) {
  8661. if (!item.next) {
  8662. throw new Error("Invalid list");
  8663. }
  8664. item.next.previous = void 0;
  8665. this._head = item.next;
  8666. } else if (item === this._tail) {
  8667. if (!item.previous) {
  8668. throw new Error("Invalid list");
  8669. }
  8670. item.previous.next = void 0;
  8671. this._tail = item.previous;
  8672. } else {
  8673. const next = item.next;
  8674. const previous = item.previous;
  8675. if (!next || !previous) {
  8676. throw new Error("Invalid list");
  8677. }
  8678. next.previous = previous;
  8679. previous.next = next;
  8680. }
  8681. item.next = void 0;
  8682. item.previous = void 0;
  8683. this._state++;
  8684. }
  8685. touch(item, touch) {
  8686. if (!this._head || !this._tail) {
  8687. throw new Error("Invalid list");
  8688. }
  8689. if (touch !== 1 && touch !== 2) {
  8690. return;
  8691. }
  8692. if (touch === 1) {
  8693. if (item === this._head) {
  8694. return;
  8695. }
  8696. const next = item.next;
  8697. const previous = item.previous;
  8698. if (item === this._tail) {
  8699. previous.next = void 0;
  8700. this._tail = previous;
  8701. } else {
  8702. next.previous = previous;
  8703. previous.next = next;
  8704. }
  8705. item.previous = void 0;
  8706. item.next = this._head;
  8707. this._head.previous = item;
  8708. this._head = item;
  8709. this._state++;
  8710. } else if (touch === 2) {
  8711. if (item === this._tail) {
  8712. return;
  8713. }
  8714. const next = item.next;
  8715. const previous = item.previous;
  8716. if (item === this._head) {
  8717. next.previous = void 0;
  8718. this._head = next;
  8719. } else {
  8720. next.previous = previous;
  8721. previous.next = next;
  8722. }
  8723. item.next = void 0;
  8724. item.previous = this._tail;
  8725. this._tail.next = item;
  8726. this._tail = item;
  8727. this._state++;
  8728. }
  8729. }
  8730. toJSON() {
  8731. const data = [];
  8732. this.forEach((value, key) => {
  8733. data.push([key, value]);
  8734. });
  8735. return data;
  8736. }
  8737. fromJSON(data) {
  8738. this.clear();
  8739. for (const [key, value] of data) {
  8740. this.set(key, value);
  8741. }
  8742. }
  8743. };
  8744. var Cache = class extends LinkedMap {
  8745. constructor(limit, ratio = 1) {
  8746. super();
  8747. this._limit = limit;
  8748. this._ratio = Math.min(Math.max(0, ratio), 1);
  8749. }
  8750. get limit() {
  8751. return this._limit;
  8752. }
  8753. set limit(limit) {
  8754. this._limit = limit;
  8755. this.checkTrim();
  8756. }
  8757. get(key, touch = 2) {
  8758. return super.get(key, touch);
  8759. }
  8760. peek(key) {
  8761. return super.get(
  8762. key,
  8763. 0
  8764. /* Touch.None */
  8765. );
  8766. }
  8767. set(key, value) {
  8768. super.set(
  8769. key,
  8770. value,
  8771. 2
  8772. /* Touch.AsNew */
  8773. );
  8774. return this;
  8775. }
  8776. checkTrim() {
  8777. if (this.size > this._limit) {
  8778. this.trim(Math.round(this._limit * this._ratio));
  8779. }
  8780. }
  8781. };
  8782. var LRUCache = class extends Cache {
  8783. constructor(limit, ratio = 1) {
  8784. super(limit, ratio);
  8785. }
  8786. trim(newSize) {
  8787. this.trimOld(newSize);
  8788. }
  8789. set(key, value) {
  8790. super.set(key, value);
  8791. this.checkTrim();
  8792. return this;
  8793. }
  8794. };
  8795. var SetMap = class {
  8796. constructor() {
  8797. this.map = /* @__PURE__ */ new Map();
  8798. }
  8799. add(key, value) {
  8800. let values = this.map.get(key);
  8801. if (!values) {
  8802. values = /* @__PURE__ */ new Set();
  8803. this.map.set(key, values);
  8804. }
  8805. values.add(value);
  8806. }
  8807. delete(key, value) {
  8808. const values = this.map.get(key);
  8809. if (!values) {
  8810. return;
  8811. }
  8812. values.delete(value);
  8813. if (values.size === 0) {
  8814. this.map.delete(key);
  8815. }
  8816. }
  8817. forEach(key, fn) {
  8818. const values = this.map.get(key);
  8819. if (!values) {
  8820. return;
  8821. }
  8822. values.forEach(fn);
  8823. }
  8824. get(key) {
  8825. const values = this.map.get(key);
  8826. if (!values) {
  8827. return /* @__PURE__ */ new Set();
  8828. }
  8829. return values;
  8830. }
  8831. };
  8832. // node_modules/monaco-editor/esm/vs/editor/common/core/wordCharacterClassifier.js
  8833. var wordClassifierCache = new LRUCache(10);
  8834. // node_modules/monaco-editor/esm/vs/base/common/objects.js
  8835. function getAllPropertyNames(obj) {
  8836. let res = [];
  8837. while (Object.prototype !== obj) {
  8838. res = res.concat(Object.getOwnPropertyNames(obj));
  8839. obj = Object.getPrototypeOf(obj);
  8840. }
  8841. return res;
  8842. }
  8843. function getAllMethodNames(obj) {
  8844. const methods = [];
  8845. for (const prop of getAllPropertyNames(obj)) {
  8846. if (typeof obj[prop] === "function") {
  8847. methods.push(prop);
  8848. }
  8849. }
  8850. return methods;
  8851. }
  8852. function createProxyObject(methodNames, invoke) {
  8853. const createProxyMethod = (method) => {
  8854. return function() {
  8855. const args = Array.prototype.slice.call(arguments, 0);
  8856. return invoke(method, args);
  8857. };
  8858. };
  8859. const result = {};
  8860. for (const methodName of methodNames) {
  8861. result[methodName] = createProxyMethod(methodName);
  8862. }
  8863. return result;
  8864. }
  8865. // node_modules/monaco-editor/esm/vs/editor/common/model.js
  8866. var OverviewRulerLane2;
  8867. (function(OverviewRulerLane3) {
  8868. OverviewRulerLane3[OverviewRulerLane3["Left"] = 1] = "Left";
  8869. OverviewRulerLane3[OverviewRulerLane3["Center"] = 2] = "Center";
  8870. OverviewRulerLane3[OverviewRulerLane3["Right"] = 4] = "Right";
  8871. OverviewRulerLane3[OverviewRulerLane3["Full"] = 7] = "Full";
  8872. })(OverviewRulerLane2 || (OverviewRulerLane2 = {}));
  8873. var GlyphMarginLane2;
  8874. (function(GlyphMarginLane3) {
  8875. GlyphMarginLane3[GlyphMarginLane3["Left"] = 1] = "Left";
  8876. GlyphMarginLane3[GlyphMarginLane3["Center"] = 2] = "Center";
  8877. GlyphMarginLane3[GlyphMarginLane3["Right"] = 3] = "Right";
  8878. })(GlyphMarginLane2 || (GlyphMarginLane2 = {}));
  8879. var InjectedTextCursorStops2;
  8880. (function(InjectedTextCursorStops3) {
  8881. InjectedTextCursorStops3[InjectedTextCursorStops3["Both"] = 0] = "Both";
  8882. InjectedTextCursorStops3[InjectedTextCursorStops3["Right"] = 1] = "Right";
  8883. InjectedTextCursorStops3[InjectedTextCursorStops3["Left"] = 2] = "Left";
  8884. InjectedTextCursorStops3[InjectedTextCursorStops3["None"] = 3] = "None";
  8885. })(InjectedTextCursorStops2 || (InjectedTextCursorStops2 = {}));
  8886. // node_modules/monaco-editor/esm/vs/editor/common/model/textModelSearch.js
  8887. function leftIsWordBounday(wordSeparators, text, textLength, matchStartIndex, matchLength) {
  8888. if (matchStartIndex === 0) {
  8889. return true;
  8890. }
  8891. const charBefore = text.charCodeAt(matchStartIndex - 1);
  8892. if (wordSeparators.get(charBefore) !== 0) {
  8893. return true;
  8894. }
  8895. if (charBefore === 13 || charBefore === 10) {
  8896. return true;
  8897. }
  8898. if (matchLength > 0) {
  8899. const firstCharInMatch = text.charCodeAt(matchStartIndex);
  8900. if (wordSeparators.get(firstCharInMatch) !== 0) {
  8901. return true;
  8902. }
  8903. }
  8904. return false;
  8905. }
  8906. function rightIsWordBounday(wordSeparators, text, textLength, matchStartIndex, matchLength) {
  8907. if (matchStartIndex + matchLength === textLength) {
  8908. return true;
  8909. }
  8910. const charAfter = text.charCodeAt(matchStartIndex + matchLength);
  8911. if (wordSeparators.get(charAfter) !== 0) {
  8912. return true;
  8913. }
  8914. if (charAfter === 13 || charAfter === 10) {
  8915. return true;
  8916. }
  8917. if (matchLength > 0) {
  8918. const lastCharInMatch = text.charCodeAt(matchStartIndex + matchLength - 1);
  8919. if (wordSeparators.get(lastCharInMatch) !== 0) {
  8920. return true;
  8921. }
  8922. }
  8923. return false;
  8924. }
  8925. function isValidMatch(wordSeparators, text, textLength, matchStartIndex, matchLength) {
  8926. return leftIsWordBounday(wordSeparators, text, textLength, matchStartIndex, matchLength) && rightIsWordBounday(wordSeparators, text, textLength, matchStartIndex, matchLength);
  8927. }
  8928. var Searcher = class {
  8929. constructor(wordSeparators, searchRegex) {
  8930. this._wordSeparators = wordSeparators;
  8931. this._searchRegex = searchRegex;
  8932. this._prevMatchStartIndex = -1;
  8933. this._prevMatchLength = 0;
  8934. }
  8935. reset(lastIndex) {
  8936. this._searchRegex.lastIndex = lastIndex;
  8937. this._prevMatchStartIndex = -1;
  8938. this._prevMatchLength = 0;
  8939. }
  8940. next(text) {
  8941. const textLength = text.length;
  8942. let m;
  8943. do {
  8944. if (this._prevMatchStartIndex + this._prevMatchLength === textLength) {
  8945. return null;
  8946. }
  8947. m = this._searchRegex.exec(text);
  8948. if (!m) {
  8949. return null;
  8950. }
  8951. const matchStartIndex = m.index;
  8952. const matchLength = m[0].length;
  8953. if (matchStartIndex === this._prevMatchStartIndex && matchLength === this._prevMatchLength) {
  8954. if (matchLength === 0) {
  8955. if (getNextCodePoint(text, textLength, this._searchRegex.lastIndex) > 65535) {
  8956. this._searchRegex.lastIndex += 2;
  8957. } else {
  8958. this._searchRegex.lastIndex += 1;
  8959. }
  8960. continue;
  8961. }
  8962. return null;
  8963. }
  8964. this._prevMatchStartIndex = matchStartIndex;
  8965. this._prevMatchLength = matchLength;
  8966. if (!this._wordSeparators || isValidMatch(this._wordSeparators, text, textLength, matchStartIndex, matchLength)) {
  8967. return m;
  8968. }
  8969. } while (m);
  8970. return null;
  8971. }
  8972. };
  8973. // node_modules/monaco-editor/esm/vs/base/common/assert.js
  8974. function assertNever(value, message = "Unreachable") {
  8975. throw new Error(message);
  8976. }
  8977. function assertFn(condition) {
  8978. if (!condition()) {
  8979. debugger;
  8980. condition();
  8981. onUnexpectedError(new BugIndicatingError("Assertion Failed"));
  8982. }
  8983. }
  8984. function checkAdjacentItems(items, predicate) {
  8985. let i = 0;
  8986. while (i < items.length - 1) {
  8987. const a = items[i];
  8988. const b = items[i + 1];
  8989. if (!predicate(a, b)) {
  8990. return false;
  8991. }
  8992. i++;
  8993. }
  8994. return true;
  8995. }
  8996. // node_modules/monaco-editor/esm/vs/editor/common/core/wordHelper.js
  8997. var USUAL_WORD_SEPARATORS = "`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?";
  8998. function createWordRegExp(allowInWords = "") {
  8999. let source = "(-?\\d*\\.\\d\\w*)|([^";
  9000. for (const sep2 of USUAL_WORD_SEPARATORS) {
  9001. if (allowInWords.indexOf(sep2) >= 0) {
  9002. continue;
  9003. }
  9004. source += "\\" + sep2;
  9005. }
  9006. source += "\\s]+)";
  9007. return new RegExp(source, "g");
  9008. }
  9009. var DEFAULT_WORD_REGEXP = createWordRegExp();
  9010. function ensureValidWordDefinition(wordDefinition) {
  9011. let result = DEFAULT_WORD_REGEXP;
  9012. if (wordDefinition && wordDefinition instanceof RegExp) {
  9013. if (!wordDefinition.global) {
  9014. let flags = "g";
  9015. if (wordDefinition.ignoreCase) {
  9016. flags += "i";
  9017. }
  9018. if (wordDefinition.multiline) {
  9019. flags += "m";
  9020. }
  9021. if (wordDefinition.unicode) {
  9022. flags += "u";
  9023. }
  9024. result = new RegExp(wordDefinition.source, flags);
  9025. } else {
  9026. result = wordDefinition;
  9027. }
  9028. }
  9029. result.lastIndex = 0;
  9030. return result;
  9031. }
  9032. var _defaultConfig = new LinkedList();
  9033. _defaultConfig.unshift({
  9034. maxLen: 1e3,
  9035. windowSize: 15,
  9036. timeBudget: 150
  9037. });
  9038. function getWordAtText(column, wordDefinition, text, textOffset, config) {
  9039. wordDefinition = ensureValidWordDefinition(wordDefinition);
  9040. if (!config) {
  9041. config = Iterable.first(_defaultConfig);
  9042. }
  9043. if (text.length > config.maxLen) {
  9044. let start = column - config.maxLen / 2;
  9045. if (start < 0) {
  9046. start = 0;
  9047. } else {
  9048. textOffset += start;
  9049. }
  9050. text = text.substring(start, column + config.maxLen / 2);
  9051. return getWordAtText(column, wordDefinition, text, textOffset, config);
  9052. }
  9053. const t1 = Date.now();
  9054. const pos = column - 1 - textOffset;
  9055. let prevRegexIndex = -1;
  9056. let match = null;
  9057. for (let i = 1; ; i++) {
  9058. if (Date.now() - t1 >= config.timeBudget) {
  9059. break;
  9060. }
  9061. const regexIndex = pos - config.windowSize * i;
  9062. wordDefinition.lastIndex = Math.max(0, regexIndex);
  9063. const thisMatch = _findRegexMatchEnclosingPosition(wordDefinition, text, pos, prevRegexIndex);
  9064. if (!thisMatch && match) {
  9065. break;
  9066. }
  9067. match = thisMatch;
  9068. if (regexIndex <= 0) {
  9069. break;
  9070. }
  9071. prevRegexIndex = regexIndex;
  9072. }
  9073. if (match) {
  9074. const result = {
  9075. word: match[0],
  9076. startColumn: textOffset + 1 + match.index,
  9077. endColumn: textOffset + 1 + match.index + match[0].length
  9078. };
  9079. wordDefinition.lastIndex = 0;
  9080. return result;
  9081. }
  9082. return null;
  9083. }
  9084. function _findRegexMatchEnclosingPosition(wordDefinition, text, pos, stopPos) {
  9085. let match;
  9086. while (match = wordDefinition.exec(text)) {
  9087. const matchIndex = match.index || 0;
  9088. if (matchIndex <= pos && wordDefinition.lastIndex >= pos) {
  9089. return match;
  9090. } else if (stopPos > 0 && matchIndex > stopPos) {
  9091. return null;
  9092. }
  9093. }
  9094. return null;
  9095. }
  9096. // node_modules/monaco-editor/esm/vs/editor/common/services/unicodeTextModelHighlighter.js
  9097. var UnicodeTextModelHighlighter = class {
  9098. static computeUnicodeHighlights(model, options, range) {
  9099. const startLine = range ? range.startLineNumber : 1;
  9100. const endLine = range ? range.endLineNumber : model.getLineCount();
  9101. const codePointHighlighter = new CodePointHighlighter(options);
  9102. const candidates = codePointHighlighter.getCandidateCodePoints();
  9103. let regex;
  9104. if (candidates === "allNonBasicAscii") {
  9105. regex = new RegExp("[^\\t\\n\\r\\x20-\\x7E]", "g");
  9106. } else {
  9107. regex = new RegExp(`${buildRegExpCharClassExpr(Array.from(candidates))}`, "g");
  9108. }
  9109. const searcher = new Searcher(null, regex);
  9110. const ranges = [];
  9111. let hasMore = false;
  9112. let m;
  9113. let ambiguousCharacterCount = 0;
  9114. let invisibleCharacterCount = 0;
  9115. let nonBasicAsciiCharacterCount = 0;
  9116. forLoop:
  9117. for (let lineNumber = startLine, lineCount = endLine; lineNumber <= lineCount; lineNumber++) {
  9118. const lineContent = model.getLineContent(lineNumber);
  9119. const lineLength = lineContent.length;
  9120. searcher.reset(0);
  9121. do {
  9122. m = searcher.next(lineContent);
  9123. if (m) {
  9124. let startIndex = m.index;
  9125. let endIndex = m.index + m[0].length;
  9126. if (startIndex > 0) {
  9127. const charCodeBefore = lineContent.charCodeAt(startIndex - 1);
  9128. if (isHighSurrogate(charCodeBefore)) {
  9129. startIndex--;
  9130. }
  9131. }
  9132. if (endIndex + 1 < lineLength) {
  9133. const charCodeBefore = lineContent.charCodeAt(endIndex - 1);
  9134. if (isHighSurrogate(charCodeBefore)) {
  9135. endIndex++;
  9136. }
  9137. }
  9138. const str = lineContent.substring(startIndex, endIndex);
  9139. let word = getWordAtText(startIndex + 1, DEFAULT_WORD_REGEXP, lineContent, 0);
  9140. if (word && word.endColumn <= startIndex + 1) {
  9141. word = null;
  9142. }
  9143. const highlightReason = codePointHighlighter.shouldHighlightNonBasicASCII(str, word ? word.word : null);
  9144. if (highlightReason !== 0) {
  9145. if (highlightReason === 3) {
  9146. ambiguousCharacterCount++;
  9147. } else if (highlightReason === 2) {
  9148. invisibleCharacterCount++;
  9149. } else if (highlightReason === 1) {
  9150. nonBasicAsciiCharacterCount++;
  9151. } else {
  9152. assertNever(highlightReason);
  9153. }
  9154. const MAX_RESULT_LENGTH = 1e3;
  9155. if (ranges.length >= MAX_RESULT_LENGTH) {
  9156. hasMore = true;
  9157. break forLoop;
  9158. }
  9159. ranges.push(new Range(lineNumber, startIndex + 1, lineNumber, endIndex + 1));
  9160. }
  9161. }
  9162. } while (m);
  9163. }
  9164. return {
  9165. ranges,
  9166. hasMore,
  9167. ambiguousCharacterCount,
  9168. invisibleCharacterCount,
  9169. nonBasicAsciiCharacterCount
  9170. };
  9171. }
  9172. static computeUnicodeHighlightReason(char, options) {
  9173. const codePointHighlighter = new CodePointHighlighter(options);
  9174. const reason = codePointHighlighter.shouldHighlightNonBasicASCII(char, null);
  9175. switch (reason) {
  9176. case 0:
  9177. return null;
  9178. case 2:
  9179. return {
  9180. kind: 1
  9181. /* UnicodeHighlighterReasonKind.Invisible */
  9182. };
  9183. case 3: {
  9184. const codePoint = char.codePointAt(0);
  9185. const primaryConfusable = codePointHighlighter.ambiguousCharacters.getPrimaryConfusable(codePoint);
  9186. const notAmbiguousInLocales = AmbiguousCharacters.getLocales().filter((l) => !AmbiguousCharacters.getInstance(/* @__PURE__ */ new Set([...options.allowedLocales, l])).isAmbiguous(codePoint));
  9187. return { kind: 0, confusableWith: String.fromCodePoint(primaryConfusable), notAmbiguousInLocales };
  9188. }
  9189. case 1:
  9190. return {
  9191. kind: 2
  9192. /* UnicodeHighlighterReasonKind.NonBasicAscii */
  9193. };
  9194. }
  9195. }
  9196. };
  9197. function buildRegExpCharClassExpr(codePoints, flags) {
  9198. const src = `[${escapeRegExpCharacters(codePoints.map((i) => String.fromCodePoint(i)).join(""))}]`;
  9199. return src;
  9200. }
  9201. var CodePointHighlighter = class {
  9202. constructor(options) {
  9203. this.options = options;
  9204. this.allowedCodePoints = new Set(options.allowedCodePoints);
  9205. this.ambiguousCharacters = AmbiguousCharacters.getInstance(new Set(options.allowedLocales));
  9206. }
  9207. getCandidateCodePoints() {
  9208. if (this.options.nonBasicASCII) {
  9209. return "allNonBasicAscii";
  9210. }
  9211. const set = /* @__PURE__ */ new Set();
  9212. if (this.options.invisibleCharacters) {
  9213. for (const cp of InvisibleCharacters.codePoints) {
  9214. if (!isAllowedInvisibleCharacter(String.fromCodePoint(cp))) {
  9215. set.add(cp);
  9216. }
  9217. }
  9218. }
  9219. if (this.options.ambiguousCharacters) {
  9220. for (const cp of this.ambiguousCharacters.getConfusableCodePoints()) {
  9221. set.add(cp);
  9222. }
  9223. }
  9224. for (const cp of this.allowedCodePoints) {
  9225. set.delete(cp);
  9226. }
  9227. return set;
  9228. }
  9229. shouldHighlightNonBasicASCII(character, wordContext) {
  9230. const codePoint = character.codePointAt(0);
  9231. if (this.allowedCodePoints.has(codePoint)) {
  9232. return 0;
  9233. }
  9234. if (this.options.nonBasicASCII) {
  9235. return 1;
  9236. }
  9237. let hasBasicASCIICharacters = false;
  9238. let hasNonConfusableNonBasicAsciiCharacter = false;
  9239. if (wordContext) {
  9240. for (const char of wordContext) {
  9241. const codePoint2 = char.codePointAt(0);
  9242. const isBasicASCII2 = isBasicASCII(char);
  9243. hasBasicASCIICharacters = hasBasicASCIICharacters || isBasicASCII2;
  9244. if (!isBasicASCII2 && !this.ambiguousCharacters.isAmbiguous(codePoint2) && !InvisibleCharacters.isInvisibleCharacter(codePoint2)) {
  9245. hasNonConfusableNonBasicAsciiCharacter = true;
  9246. }
  9247. }
  9248. }
  9249. if (
  9250. /* Don't allow mixing weird looking characters with ASCII */
  9251. !hasBasicASCIICharacters && /* Is there an obviously weird looking character? */
  9252. hasNonConfusableNonBasicAsciiCharacter
  9253. ) {
  9254. return 0;
  9255. }
  9256. if (this.options.invisibleCharacters) {
  9257. if (!isAllowedInvisibleCharacter(character) && InvisibleCharacters.isInvisibleCharacter(codePoint)) {
  9258. return 2;
  9259. }
  9260. }
  9261. if (this.options.ambiguousCharacters) {
  9262. if (this.ambiguousCharacters.isAmbiguous(codePoint)) {
  9263. return 3;
  9264. }
  9265. }
  9266. return 0;
  9267. }
  9268. };
  9269. function isAllowedInvisibleCharacter(character) {
  9270. return character === " " || character === "\n" || character === " ";
  9271. }
  9272. // node_modules/monaco-editor/esm/vs/editor/common/diff/linesDiffComputer.js
  9273. var LinesDiff = class {
  9274. constructor(changes, moves, hitTimeout) {
  9275. this.changes = changes;
  9276. this.moves = moves;
  9277. this.hitTimeout = hitTimeout;
  9278. }
  9279. };
  9280. var MovedText = class {
  9281. constructor(lineRangeMapping, changes) {
  9282. this.lineRangeMapping = lineRangeMapping;
  9283. this.changes = changes;
  9284. }
  9285. };
  9286. // node_modules/monaco-editor/esm/vs/editor/common/core/offsetRange.js
  9287. var OffsetRange = class _OffsetRange {
  9288. static addRange(range, sortedRanges) {
  9289. let i = 0;
  9290. while (i < sortedRanges.length && sortedRanges[i].endExclusive < range.start) {
  9291. i++;
  9292. }
  9293. let j = i;
  9294. while (j < sortedRanges.length && sortedRanges[j].start <= range.endExclusive) {
  9295. j++;
  9296. }
  9297. if (i === j) {
  9298. sortedRanges.splice(i, 0, range);
  9299. } else {
  9300. const start = Math.min(range.start, sortedRanges[i].start);
  9301. const end = Math.max(range.endExclusive, sortedRanges[j - 1].endExclusive);
  9302. sortedRanges.splice(i, j - i, new _OffsetRange(start, end));
  9303. }
  9304. }
  9305. static tryCreate(start, endExclusive) {
  9306. if (start > endExclusive) {
  9307. return void 0;
  9308. }
  9309. return new _OffsetRange(start, endExclusive);
  9310. }
  9311. static ofLength(length) {
  9312. return new _OffsetRange(0, length);
  9313. }
  9314. static ofStartAndLength(start, length) {
  9315. return new _OffsetRange(start, start + length);
  9316. }
  9317. constructor(start, endExclusive) {
  9318. this.start = start;
  9319. this.endExclusive = endExclusive;
  9320. if (start > endExclusive) {
  9321. throw new BugIndicatingError(`Invalid range: ${this.toString()}`);
  9322. }
  9323. }
  9324. get isEmpty() {
  9325. return this.start === this.endExclusive;
  9326. }
  9327. delta(offset) {
  9328. return new _OffsetRange(this.start + offset, this.endExclusive + offset);
  9329. }
  9330. deltaStart(offset) {
  9331. return new _OffsetRange(this.start + offset, this.endExclusive);
  9332. }
  9333. deltaEnd(offset) {
  9334. return new _OffsetRange(this.start, this.endExclusive + offset);
  9335. }
  9336. get length() {
  9337. return this.endExclusive - this.start;
  9338. }
  9339. toString() {
  9340. return `[${this.start}, ${this.endExclusive})`;
  9341. }
  9342. contains(offset) {
  9343. return this.start <= offset && offset < this.endExclusive;
  9344. }
  9345. /**
  9346. * for all numbers n: range1.contains(n) or range2.contains(n) => range1.join(range2).contains(n)
  9347. * The joined range is the smallest range that contains both ranges.
  9348. */
  9349. join(other) {
  9350. return new _OffsetRange(Math.min(this.start, other.start), Math.max(this.endExclusive, other.endExclusive));
  9351. }
  9352. /**
  9353. * for all numbers n: range1.contains(n) and range2.contains(n) <=> range1.intersect(range2).contains(n)
  9354. *
  9355. * The resulting range is empty if the ranges do not intersect, but touch.
  9356. * If the ranges don't even touch, the result is undefined.
  9357. */
  9358. intersect(other) {
  9359. const start = Math.max(this.start, other.start);
  9360. const end = Math.min(this.endExclusive, other.endExclusive);
  9361. if (start <= end) {
  9362. return new _OffsetRange(start, end);
  9363. }
  9364. return void 0;
  9365. }
  9366. intersects(other) {
  9367. const start = Math.max(this.start, other.start);
  9368. const end = Math.min(this.endExclusive, other.endExclusive);
  9369. return start < end;
  9370. }
  9371. isBefore(other) {
  9372. return this.endExclusive <= other.start;
  9373. }
  9374. isAfter(other) {
  9375. return this.start >= other.endExclusive;
  9376. }
  9377. slice(arr) {
  9378. return arr.slice(this.start, this.endExclusive);
  9379. }
  9380. substring(str) {
  9381. return str.substring(this.start, this.endExclusive);
  9382. }
  9383. /**
  9384. * Returns the given value if it is contained in this instance, otherwise the closest value that is contained.
  9385. * The range must not be empty.
  9386. */
  9387. clip(value) {
  9388. if (this.isEmpty) {
  9389. throw new BugIndicatingError(`Invalid clipping range: ${this.toString()}`);
  9390. }
  9391. return Math.max(this.start, Math.min(this.endExclusive - 1, value));
  9392. }
  9393. /**
  9394. * Returns `r := value + k * length` such that `r` is contained in this range.
  9395. * The range must not be empty.
  9396. *
  9397. * E.g. `[5, 10).clipCyclic(10) === 5`, `[5, 10).clipCyclic(11) === 6` and `[5, 10).clipCyclic(4) === 9`.
  9398. */
  9399. clipCyclic(value) {
  9400. if (this.isEmpty) {
  9401. throw new BugIndicatingError(`Invalid clipping range: ${this.toString()}`);
  9402. }
  9403. if (value < this.start) {
  9404. return this.endExclusive - (this.start - value) % this.length;
  9405. }
  9406. if (value >= this.endExclusive) {
  9407. return this.start + (value - this.start) % this.length;
  9408. }
  9409. return value;
  9410. }
  9411. forEach(f) {
  9412. for (let i = this.start; i < this.endExclusive; i++) {
  9413. f(i);
  9414. }
  9415. }
  9416. };
  9417. // node_modules/monaco-editor/esm/vs/base/common/arraysFind.js
  9418. function findLastMonotonous(array, predicate) {
  9419. const idx = findLastIdxMonotonous(array, predicate);
  9420. return idx === -1 ? void 0 : array[idx];
  9421. }
  9422. function findLastIdxMonotonous(array, predicate, startIdx = 0, endIdxEx = array.length) {
  9423. let i = startIdx;
  9424. let j = endIdxEx;
  9425. while (i < j) {
  9426. const k = Math.floor((i + j) / 2);
  9427. if (predicate(array[k])) {
  9428. i = k + 1;
  9429. } else {
  9430. j = k;
  9431. }
  9432. }
  9433. return i - 1;
  9434. }
  9435. function findFirstMonotonous(array, predicate) {
  9436. const idx = findFirstIdxMonotonousOrArrLen(array, predicate);
  9437. return idx === array.length ? void 0 : array[idx];
  9438. }
  9439. function findFirstIdxMonotonousOrArrLen(array, predicate, startIdx = 0, endIdxEx = array.length) {
  9440. let i = startIdx;
  9441. let j = endIdxEx;
  9442. while (i < j) {
  9443. const k = Math.floor((i + j) / 2);
  9444. if (predicate(array[k])) {
  9445. j = k;
  9446. } else {
  9447. i = k + 1;
  9448. }
  9449. }
  9450. return i;
  9451. }
  9452. var MonotonousArray = class _MonotonousArray {
  9453. static {
  9454. this.assertInvariants = false;
  9455. }
  9456. constructor(_array) {
  9457. this._array = _array;
  9458. this._findLastMonotonousLastIdx = 0;
  9459. }
  9460. /**
  9461. * The predicate must be monotonous, i.e. `arr.map(predicate)` must be like `[true, ..., true, false, ..., false]`!
  9462. * For subsequent calls, current predicate must be weaker than (or equal to) the previous predicate, i.e. more entries must be `true`.
  9463. */
  9464. findLastMonotonous(predicate) {
  9465. if (_MonotonousArray.assertInvariants) {
  9466. if (this._prevFindLastPredicate) {
  9467. for (const item of this._array) {
  9468. if (this._prevFindLastPredicate(item) && !predicate(item)) {
  9469. throw new Error("MonotonousArray: current predicate must be weaker than (or equal to) the previous predicate.");
  9470. }
  9471. }
  9472. }
  9473. this._prevFindLastPredicate = predicate;
  9474. }
  9475. const idx = findLastIdxMonotonous(this._array, predicate, this._findLastMonotonousLastIdx);
  9476. this._findLastMonotonousLastIdx = idx + 1;
  9477. return idx === -1 ? void 0 : this._array[idx];
  9478. }
  9479. };
  9480. // node_modules/monaco-editor/esm/vs/editor/common/core/lineRange.js
  9481. var LineRange = class _LineRange {
  9482. static fromRangeInclusive(range) {
  9483. return new _LineRange(range.startLineNumber, range.endLineNumber + 1);
  9484. }
  9485. /**
  9486. * @param lineRanges An array of sorted line ranges.
  9487. */
  9488. static joinMany(lineRanges) {
  9489. if (lineRanges.length === 0) {
  9490. return [];
  9491. }
  9492. let result = new LineRangeSet(lineRanges[0].slice());
  9493. for (let i = 1; i < lineRanges.length; i++) {
  9494. result = result.getUnion(new LineRangeSet(lineRanges[i].slice()));
  9495. }
  9496. return result.ranges;
  9497. }
  9498. static join(lineRanges) {
  9499. if (lineRanges.length === 0) {
  9500. throw new BugIndicatingError("lineRanges cannot be empty");
  9501. }
  9502. let startLineNumber = lineRanges[0].startLineNumber;
  9503. let endLineNumberExclusive = lineRanges[0].endLineNumberExclusive;
  9504. for (let i = 1; i < lineRanges.length; i++) {
  9505. startLineNumber = Math.min(startLineNumber, lineRanges[i].startLineNumber);
  9506. endLineNumberExclusive = Math.max(endLineNumberExclusive, lineRanges[i].endLineNumberExclusive);
  9507. }
  9508. return new _LineRange(startLineNumber, endLineNumberExclusive);
  9509. }
  9510. static ofLength(startLineNumber, length) {
  9511. return new _LineRange(startLineNumber, startLineNumber + length);
  9512. }
  9513. /**
  9514. * @internal
  9515. */
  9516. static deserialize(lineRange) {
  9517. return new _LineRange(lineRange[0], lineRange[1]);
  9518. }
  9519. constructor(startLineNumber, endLineNumberExclusive) {
  9520. if (startLineNumber > endLineNumberExclusive) {
  9521. throw new BugIndicatingError(`startLineNumber ${startLineNumber} cannot be after endLineNumberExclusive ${endLineNumberExclusive}`);
  9522. }
  9523. this.startLineNumber = startLineNumber;
  9524. this.endLineNumberExclusive = endLineNumberExclusive;
  9525. }
  9526. /**
  9527. * Indicates if this line range contains the given line number.
  9528. */
  9529. contains(lineNumber) {
  9530. return this.startLineNumber <= lineNumber && lineNumber < this.endLineNumberExclusive;
  9531. }
  9532. /**
  9533. * Indicates if this line range is empty.
  9534. */
  9535. get isEmpty() {
  9536. return this.startLineNumber === this.endLineNumberExclusive;
  9537. }
  9538. /**
  9539. * Moves this line range by the given offset of line numbers.
  9540. */
  9541. delta(offset) {
  9542. return new _LineRange(this.startLineNumber + offset, this.endLineNumberExclusive + offset);
  9543. }
  9544. deltaLength(offset) {
  9545. return new _LineRange(this.startLineNumber, this.endLineNumberExclusive + offset);
  9546. }
  9547. /**
  9548. * The number of lines this line range spans.
  9549. */
  9550. get length() {
  9551. return this.endLineNumberExclusive - this.startLineNumber;
  9552. }
  9553. /**
  9554. * Creates a line range that combines this and the given line range.
  9555. */
  9556. join(other) {
  9557. return new _LineRange(Math.min(this.startLineNumber, other.startLineNumber), Math.max(this.endLineNumberExclusive, other.endLineNumberExclusive));
  9558. }
  9559. toString() {
  9560. return `[${this.startLineNumber},${this.endLineNumberExclusive})`;
  9561. }
  9562. /**
  9563. * The resulting range is empty if the ranges do not intersect, but touch.
  9564. * If the ranges don't even touch, the result is undefined.
  9565. */
  9566. intersect(other) {
  9567. const startLineNumber = Math.max(this.startLineNumber, other.startLineNumber);
  9568. const endLineNumberExclusive = Math.min(this.endLineNumberExclusive, other.endLineNumberExclusive);
  9569. if (startLineNumber <= endLineNumberExclusive) {
  9570. return new _LineRange(startLineNumber, endLineNumberExclusive);
  9571. }
  9572. return void 0;
  9573. }
  9574. intersectsStrict(other) {
  9575. return this.startLineNumber < other.endLineNumberExclusive && other.startLineNumber < this.endLineNumberExclusive;
  9576. }
  9577. overlapOrTouch(other) {
  9578. return this.startLineNumber <= other.endLineNumberExclusive && other.startLineNumber <= this.endLineNumberExclusive;
  9579. }
  9580. equals(b) {
  9581. return this.startLineNumber === b.startLineNumber && this.endLineNumberExclusive === b.endLineNumberExclusive;
  9582. }
  9583. toInclusiveRange() {
  9584. if (this.isEmpty) {
  9585. return null;
  9586. }
  9587. return new Range(this.startLineNumber, 1, this.endLineNumberExclusive - 1, Number.MAX_SAFE_INTEGER);
  9588. }
  9589. /**
  9590. * @deprecated Using this function is discouraged because it might lead to bugs: The end position is not guaranteed to be a valid position!
  9591. */
  9592. toExclusiveRange() {
  9593. return new Range(this.startLineNumber, 1, this.endLineNumberExclusive, 1);
  9594. }
  9595. mapToLineArray(f) {
  9596. const result = [];
  9597. for (let lineNumber = this.startLineNumber; lineNumber < this.endLineNumberExclusive; lineNumber++) {
  9598. result.push(f(lineNumber));
  9599. }
  9600. return result;
  9601. }
  9602. forEach(f) {
  9603. for (let lineNumber = this.startLineNumber; lineNumber < this.endLineNumberExclusive; lineNumber++) {
  9604. f(lineNumber);
  9605. }
  9606. }
  9607. /**
  9608. * @internal
  9609. */
  9610. serialize() {
  9611. return [this.startLineNumber, this.endLineNumberExclusive];
  9612. }
  9613. includes(lineNumber) {
  9614. return this.startLineNumber <= lineNumber && lineNumber < this.endLineNumberExclusive;
  9615. }
  9616. /**
  9617. * Converts this 1-based line range to a 0-based offset range (subtracts 1!).
  9618. * @internal
  9619. */
  9620. toOffsetRange() {
  9621. return new OffsetRange(this.startLineNumber - 1, this.endLineNumberExclusive - 1);
  9622. }
  9623. };
  9624. var LineRangeSet = class _LineRangeSet {
  9625. constructor(_normalizedRanges = []) {
  9626. this._normalizedRanges = _normalizedRanges;
  9627. }
  9628. get ranges() {
  9629. return this._normalizedRanges;
  9630. }
  9631. addRange(range) {
  9632. if (range.length === 0) {
  9633. return;
  9634. }
  9635. const joinRangeStartIdx = findFirstIdxMonotonousOrArrLen(this._normalizedRanges, (r) => r.endLineNumberExclusive >= range.startLineNumber);
  9636. const joinRangeEndIdxExclusive = findLastIdxMonotonous(this._normalizedRanges, (r) => r.startLineNumber <= range.endLineNumberExclusive) + 1;
  9637. if (joinRangeStartIdx === joinRangeEndIdxExclusive) {
  9638. this._normalizedRanges.splice(joinRangeStartIdx, 0, range);
  9639. } else if (joinRangeStartIdx === joinRangeEndIdxExclusive - 1) {
  9640. const joinRange = this._normalizedRanges[joinRangeStartIdx];
  9641. this._normalizedRanges[joinRangeStartIdx] = joinRange.join(range);
  9642. } else {
  9643. const joinRange = this._normalizedRanges[joinRangeStartIdx].join(this._normalizedRanges[joinRangeEndIdxExclusive - 1]).join(range);
  9644. this._normalizedRanges.splice(joinRangeStartIdx, joinRangeEndIdxExclusive - joinRangeStartIdx, joinRange);
  9645. }
  9646. }
  9647. contains(lineNumber) {
  9648. const rangeThatStartsBeforeEnd = findLastMonotonous(this._normalizedRanges, (r) => r.startLineNumber <= lineNumber);
  9649. return !!rangeThatStartsBeforeEnd && rangeThatStartsBeforeEnd.endLineNumberExclusive > lineNumber;
  9650. }
  9651. intersects(range) {
  9652. const rangeThatStartsBeforeEnd = findLastMonotonous(this._normalizedRanges, (r) => r.startLineNumber < range.endLineNumberExclusive);
  9653. return !!rangeThatStartsBeforeEnd && rangeThatStartsBeforeEnd.endLineNumberExclusive > range.startLineNumber;
  9654. }
  9655. getUnion(other) {
  9656. if (this._normalizedRanges.length === 0) {
  9657. return other;
  9658. }
  9659. if (other._normalizedRanges.length === 0) {
  9660. return this;
  9661. }
  9662. const result = [];
  9663. let i1 = 0;
  9664. let i2 = 0;
  9665. let current = null;
  9666. while (i1 < this._normalizedRanges.length || i2 < other._normalizedRanges.length) {
  9667. let next = null;
  9668. if (i1 < this._normalizedRanges.length && i2 < other._normalizedRanges.length) {
  9669. const lineRange1 = this._normalizedRanges[i1];
  9670. const lineRange2 = other._normalizedRanges[i2];
  9671. if (lineRange1.startLineNumber < lineRange2.startLineNumber) {
  9672. next = lineRange1;
  9673. i1++;
  9674. } else {
  9675. next = lineRange2;
  9676. i2++;
  9677. }
  9678. } else if (i1 < this._normalizedRanges.length) {
  9679. next = this._normalizedRanges[i1];
  9680. i1++;
  9681. } else {
  9682. next = other._normalizedRanges[i2];
  9683. i2++;
  9684. }
  9685. if (current === null) {
  9686. current = next;
  9687. } else {
  9688. if (current.endLineNumberExclusive >= next.startLineNumber) {
  9689. current = new LineRange(current.startLineNumber, Math.max(current.endLineNumberExclusive, next.endLineNumberExclusive));
  9690. } else {
  9691. result.push(current);
  9692. current = next;
  9693. }
  9694. }
  9695. }
  9696. if (current !== null) {
  9697. result.push(current);
  9698. }
  9699. return new _LineRangeSet(result);
  9700. }
  9701. /**
  9702. * Subtracts all ranges in this set from `range` and returns the result.
  9703. */
  9704. subtractFrom(range) {
  9705. const joinRangeStartIdx = findFirstIdxMonotonousOrArrLen(this._normalizedRanges, (r) => r.endLineNumberExclusive >= range.startLineNumber);
  9706. const joinRangeEndIdxExclusive = findLastIdxMonotonous(this._normalizedRanges, (r) => r.startLineNumber <= range.endLineNumberExclusive) + 1;
  9707. if (joinRangeStartIdx === joinRangeEndIdxExclusive) {
  9708. return new _LineRangeSet([range]);
  9709. }
  9710. const result = [];
  9711. let startLineNumber = range.startLineNumber;
  9712. for (let i = joinRangeStartIdx; i < joinRangeEndIdxExclusive; i++) {
  9713. const r = this._normalizedRanges[i];
  9714. if (r.startLineNumber > startLineNumber) {
  9715. result.push(new LineRange(startLineNumber, r.startLineNumber));
  9716. }
  9717. startLineNumber = r.endLineNumberExclusive;
  9718. }
  9719. if (startLineNumber < range.endLineNumberExclusive) {
  9720. result.push(new LineRange(startLineNumber, range.endLineNumberExclusive));
  9721. }
  9722. return new _LineRangeSet(result);
  9723. }
  9724. toString() {
  9725. return this._normalizedRanges.map((r) => r.toString()).join(", ");
  9726. }
  9727. getIntersection(other) {
  9728. const result = [];
  9729. let i1 = 0;
  9730. let i2 = 0;
  9731. while (i1 < this._normalizedRanges.length && i2 < other._normalizedRanges.length) {
  9732. const r1 = this._normalizedRanges[i1];
  9733. const r2 = other._normalizedRanges[i2];
  9734. const i = r1.intersect(r2);
  9735. if (i && !i.isEmpty) {
  9736. result.push(i);
  9737. }
  9738. if (r1.endLineNumberExclusive < r2.endLineNumberExclusive) {
  9739. i1++;
  9740. } else {
  9741. i2++;
  9742. }
  9743. }
  9744. return new _LineRangeSet(result);
  9745. }
  9746. getWithDelta(value) {
  9747. return new _LineRangeSet(this._normalizedRanges.map((r) => r.delta(value)));
  9748. }
  9749. };
  9750. // node_modules/monaco-editor/esm/vs/editor/common/core/textLength.js
  9751. var TextLength = class _TextLength {
  9752. static {
  9753. this.zero = new _TextLength(0, 0);
  9754. }
  9755. static betweenPositions(position1, position2) {
  9756. if (position1.lineNumber === position2.lineNumber) {
  9757. return new _TextLength(0, position2.column - position1.column);
  9758. } else {
  9759. return new _TextLength(position2.lineNumber - position1.lineNumber, position2.column - 1);
  9760. }
  9761. }
  9762. static ofRange(range) {
  9763. return _TextLength.betweenPositions(range.getStartPosition(), range.getEndPosition());
  9764. }
  9765. static ofText(text) {
  9766. let line = 0;
  9767. let column = 0;
  9768. for (const c of text) {
  9769. if (c === "\n") {
  9770. line++;
  9771. column = 0;
  9772. } else {
  9773. column++;
  9774. }
  9775. }
  9776. return new _TextLength(line, column);
  9777. }
  9778. constructor(lineCount, columnCount) {
  9779. this.lineCount = lineCount;
  9780. this.columnCount = columnCount;
  9781. }
  9782. isGreaterThanOrEqualTo(other) {
  9783. if (this.lineCount !== other.lineCount) {
  9784. return this.lineCount > other.lineCount;
  9785. }
  9786. return this.columnCount >= other.columnCount;
  9787. }
  9788. createRange(startPosition) {
  9789. if (this.lineCount === 0) {
  9790. return new Range(startPosition.lineNumber, startPosition.column, startPosition.lineNumber, startPosition.column + this.columnCount);
  9791. } else {
  9792. return new Range(startPosition.lineNumber, startPosition.column, startPosition.lineNumber + this.lineCount, this.columnCount + 1);
  9793. }
  9794. }
  9795. addToPosition(position) {
  9796. if (this.lineCount === 0) {
  9797. return new Position(position.lineNumber, position.column + this.columnCount);
  9798. } else {
  9799. return new Position(position.lineNumber + this.lineCount, this.columnCount + 1);
  9800. }
  9801. }
  9802. toString() {
  9803. return `${this.lineCount},${this.columnCount}`;
  9804. }
  9805. };
  9806. // node_modules/monaco-editor/esm/vs/editor/common/core/textEdit.js
  9807. var SingleTextEdit = class {
  9808. constructor(range, text) {
  9809. this.range = range;
  9810. this.text = text;
  9811. }
  9812. toSingleEditOperation() {
  9813. return {
  9814. range: this.range,
  9815. text: this.text
  9816. };
  9817. }
  9818. };
  9819. // node_modules/monaco-editor/esm/vs/editor/common/diff/rangeMapping.js
  9820. var LineRangeMapping = class _LineRangeMapping {
  9821. static inverse(mapping, originalLineCount, modifiedLineCount) {
  9822. const result = [];
  9823. let lastOriginalEndLineNumber = 1;
  9824. let lastModifiedEndLineNumber = 1;
  9825. for (const m of mapping) {
  9826. const r2 = new _LineRangeMapping(new LineRange(lastOriginalEndLineNumber, m.original.startLineNumber), new LineRange(lastModifiedEndLineNumber, m.modified.startLineNumber));
  9827. if (!r2.modified.isEmpty) {
  9828. result.push(r2);
  9829. }
  9830. lastOriginalEndLineNumber = m.original.endLineNumberExclusive;
  9831. lastModifiedEndLineNumber = m.modified.endLineNumberExclusive;
  9832. }
  9833. const r = new _LineRangeMapping(new LineRange(lastOriginalEndLineNumber, originalLineCount + 1), new LineRange(lastModifiedEndLineNumber, modifiedLineCount + 1));
  9834. if (!r.modified.isEmpty) {
  9835. result.push(r);
  9836. }
  9837. return result;
  9838. }
  9839. static clip(mapping, originalRange, modifiedRange) {
  9840. const result = [];
  9841. for (const m of mapping) {
  9842. const original = m.original.intersect(originalRange);
  9843. const modified = m.modified.intersect(modifiedRange);
  9844. if (original && !original.isEmpty && modified && !modified.isEmpty) {
  9845. result.push(new _LineRangeMapping(original, modified));
  9846. }
  9847. }
  9848. return result;
  9849. }
  9850. constructor(originalRange, modifiedRange) {
  9851. this.original = originalRange;
  9852. this.modified = modifiedRange;
  9853. }
  9854. toString() {
  9855. return `{${this.original.toString()}->${this.modified.toString()}}`;
  9856. }
  9857. flip() {
  9858. return new _LineRangeMapping(this.modified, this.original);
  9859. }
  9860. join(other) {
  9861. return new _LineRangeMapping(this.original.join(other.original), this.modified.join(other.modified));
  9862. }
  9863. /**
  9864. * This method assumes that the LineRangeMapping describes a valid diff!
  9865. * I.e. if one range is empty, the other range cannot be the entire document.
  9866. * It avoids various problems when the line range points to non-existing line-numbers.
  9867. */
  9868. toRangeMapping() {
  9869. const origInclusiveRange = this.original.toInclusiveRange();
  9870. const modInclusiveRange = this.modified.toInclusiveRange();
  9871. if (origInclusiveRange && modInclusiveRange) {
  9872. return new RangeMapping(origInclusiveRange, modInclusiveRange);
  9873. } else if (this.original.startLineNumber === 1 || this.modified.startLineNumber === 1) {
  9874. if (!(this.modified.startLineNumber === 1 && this.original.startLineNumber === 1)) {
  9875. throw new BugIndicatingError("not a valid diff");
  9876. }
  9877. return new RangeMapping(new Range(this.original.startLineNumber, 1, this.original.endLineNumberExclusive, 1), new Range(this.modified.startLineNumber, 1, this.modified.endLineNumberExclusive, 1));
  9878. } else {
  9879. return new RangeMapping(new Range(this.original.startLineNumber - 1, Number.MAX_SAFE_INTEGER, this.original.endLineNumberExclusive - 1, Number.MAX_SAFE_INTEGER), new Range(this.modified.startLineNumber - 1, Number.MAX_SAFE_INTEGER, this.modified.endLineNumberExclusive - 1, Number.MAX_SAFE_INTEGER));
  9880. }
  9881. }
  9882. /**
  9883. * This method assumes that the LineRangeMapping describes a valid diff!
  9884. * I.e. if one range is empty, the other range cannot be the entire document.
  9885. * It avoids various problems when the line range points to non-existing line-numbers.
  9886. */
  9887. toRangeMapping2(original, modified) {
  9888. if (isValidLineNumber(this.original.endLineNumberExclusive, original) && isValidLineNumber(this.modified.endLineNumberExclusive, modified)) {
  9889. return new RangeMapping(new Range(this.original.startLineNumber, 1, this.original.endLineNumberExclusive, 1), new Range(this.modified.startLineNumber, 1, this.modified.endLineNumberExclusive, 1));
  9890. }
  9891. if (!this.original.isEmpty && !this.modified.isEmpty) {
  9892. return new RangeMapping(Range.fromPositions(new Position(this.original.startLineNumber, 1), normalizePosition(new Position(this.original.endLineNumberExclusive - 1, Number.MAX_SAFE_INTEGER), original)), Range.fromPositions(new Position(this.modified.startLineNumber, 1), normalizePosition(new Position(this.modified.endLineNumberExclusive - 1, Number.MAX_SAFE_INTEGER), modified)));
  9893. }
  9894. if (this.original.startLineNumber > 1 && this.modified.startLineNumber > 1) {
  9895. return new RangeMapping(Range.fromPositions(normalizePosition(new Position(this.original.startLineNumber - 1, Number.MAX_SAFE_INTEGER), original), normalizePosition(new Position(this.original.endLineNumberExclusive - 1, Number.MAX_SAFE_INTEGER), original)), Range.fromPositions(normalizePosition(new Position(this.modified.startLineNumber - 1, Number.MAX_SAFE_INTEGER), modified), normalizePosition(new Position(this.modified.endLineNumberExclusive - 1, Number.MAX_SAFE_INTEGER), modified)));
  9896. }
  9897. throw new BugIndicatingError();
  9898. }
  9899. };
  9900. function normalizePosition(position, content) {
  9901. if (position.lineNumber < 1) {
  9902. return new Position(1, 1);
  9903. }
  9904. if (position.lineNumber > content.length) {
  9905. return new Position(content.length, content[content.length - 1].length + 1);
  9906. }
  9907. const line = content[position.lineNumber - 1];
  9908. if (position.column > line.length + 1) {
  9909. return new Position(position.lineNumber, line.length + 1);
  9910. }
  9911. return position;
  9912. }
  9913. function isValidLineNumber(lineNumber, lines) {
  9914. return lineNumber >= 1 && lineNumber <= lines.length;
  9915. }
  9916. var DetailedLineRangeMapping = class _DetailedLineRangeMapping extends LineRangeMapping {
  9917. static fromRangeMappings(rangeMappings) {
  9918. const originalRange = LineRange.join(rangeMappings.map((r) => LineRange.fromRangeInclusive(r.originalRange)));
  9919. const modifiedRange = LineRange.join(rangeMappings.map((r) => LineRange.fromRangeInclusive(r.modifiedRange)));
  9920. return new _DetailedLineRangeMapping(originalRange, modifiedRange, rangeMappings);
  9921. }
  9922. constructor(originalRange, modifiedRange, innerChanges) {
  9923. super(originalRange, modifiedRange);
  9924. this.innerChanges = innerChanges;
  9925. }
  9926. flip() {
  9927. return new _DetailedLineRangeMapping(this.modified, this.original, this.innerChanges?.map((c) => c.flip()));
  9928. }
  9929. withInnerChangesFromLineRanges() {
  9930. return new _DetailedLineRangeMapping(this.original, this.modified, [this.toRangeMapping()]);
  9931. }
  9932. };
  9933. var RangeMapping = class _RangeMapping {
  9934. static assertSorted(rangeMappings) {
  9935. for (let i = 1; i < rangeMappings.length; i++) {
  9936. const previous = rangeMappings[i - 1];
  9937. const current = rangeMappings[i];
  9938. if (!(previous.originalRange.getEndPosition().isBeforeOrEqual(current.originalRange.getStartPosition()) && previous.modifiedRange.getEndPosition().isBeforeOrEqual(current.modifiedRange.getStartPosition()))) {
  9939. throw new BugIndicatingError("Range mappings must be sorted");
  9940. }
  9941. }
  9942. }
  9943. constructor(originalRange, modifiedRange) {
  9944. this.originalRange = originalRange;
  9945. this.modifiedRange = modifiedRange;
  9946. }
  9947. toString() {
  9948. return `{${this.originalRange.toString()}->${this.modifiedRange.toString()}}`;
  9949. }
  9950. flip() {
  9951. return new _RangeMapping(this.modifiedRange, this.originalRange);
  9952. }
  9953. /**
  9954. * Creates a single text edit that describes the change from the original to the modified text.
  9955. */
  9956. toTextEdit(modified) {
  9957. const newText = modified.getValueOfRange(this.modifiedRange);
  9958. return new SingleTextEdit(this.originalRange, newText);
  9959. }
  9960. };
  9961. // node_modules/monaco-editor/esm/vs/editor/common/diff/legacyLinesDiffComputer.js
  9962. var MINIMUM_MATCHING_CHARACTER_LENGTH = 3;
  9963. var LegacyLinesDiffComputer = class {
  9964. computeDiff(originalLines, modifiedLines, options) {
  9965. const diffComputer = new DiffComputer(originalLines, modifiedLines, {
  9966. maxComputationTime: options.maxComputationTimeMs,
  9967. shouldIgnoreTrimWhitespace: options.ignoreTrimWhitespace,
  9968. shouldComputeCharChanges: true,
  9969. shouldMakePrettyDiff: true,
  9970. shouldPostProcessCharChanges: true
  9971. });
  9972. const result = diffComputer.computeDiff();
  9973. const changes = [];
  9974. let lastChange = null;
  9975. for (const c of result.changes) {
  9976. let originalRange;
  9977. if (c.originalEndLineNumber === 0) {
  9978. originalRange = new LineRange(c.originalStartLineNumber + 1, c.originalStartLineNumber + 1);
  9979. } else {
  9980. originalRange = new LineRange(c.originalStartLineNumber, c.originalEndLineNumber + 1);
  9981. }
  9982. let modifiedRange;
  9983. if (c.modifiedEndLineNumber === 0) {
  9984. modifiedRange = new LineRange(c.modifiedStartLineNumber + 1, c.modifiedStartLineNumber + 1);
  9985. } else {
  9986. modifiedRange = new LineRange(c.modifiedStartLineNumber, c.modifiedEndLineNumber + 1);
  9987. }
  9988. let change = new DetailedLineRangeMapping(originalRange, modifiedRange, c.charChanges?.map((c2) => new RangeMapping(new Range(c2.originalStartLineNumber, c2.originalStartColumn, c2.originalEndLineNumber, c2.originalEndColumn), new Range(c2.modifiedStartLineNumber, c2.modifiedStartColumn, c2.modifiedEndLineNumber, c2.modifiedEndColumn))));
  9989. if (lastChange) {
  9990. if (lastChange.modified.endLineNumberExclusive === change.modified.startLineNumber || lastChange.original.endLineNumberExclusive === change.original.startLineNumber) {
  9991. change = new DetailedLineRangeMapping(lastChange.original.join(change.original), lastChange.modified.join(change.modified), lastChange.innerChanges && change.innerChanges ? lastChange.innerChanges.concat(change.innerChanges) : void 0);
  9992. changes.pop();
  9993. }
  9994. }
  9995. changes.push(change);
  9996. lastChange = change;
  9997. }
  9998. assertFn(() => {
  9999. return checkAdjacentItems(changes, (m1, m2) => m2.original.startLineNumber - m1.original.endLineNumberExclusive === m2.modified.startLineNumber - m1.modified.endLineNumberExclusive && // There has to be an unchanged line in between (otherwise both diffs should have been joined)
  10000. m1.original.endLineNumberExclusive < m2.original.startLineNumber && m1.modified.endLineNumberExclusive < m2.modified.startLineNumber);
  10001. });
  10002. return new LinesDiff(changes, [], result.quitEarly);
  10003. }
  10004. };
  10005. function computeDiff(originalSequence, modifiedSequence, continueProcessingPredicate, pretty) {
  10006. const diffAlgo = new LcsDiff(originalSequence, modifiedSequence, continueProcessingPredicate);
  10007. return diffAlgo.ComputeDiff(pretty);
  10008. }
  10009. var LineSequence = class {
  10010. constructor(lines) {
  10011. const startColumns = [];
  10012. const endColumns = [];
  10013. for (let i = 0, length = lines.length; i < length; i++) {
  10014. startColumns[i] = getFirstNonBlankColumn(lines[i], 1);
  10015. endColumns[i] = getLastNonBlankColumn(lines[i], 1);
  10016. }
  10017. this.lines = lines;
  10018. this._startColumns = startColumns;
  10019. this._endColumns = endColumns;
  10020. }
  10021. getElements() {
  10022. const elements = [];
  10023. for (let i = 0, len = this.lines.length; i < len; i++) {
  10024. elements[i] = this.lines[i].substring(this._startColumns[i] - 1, this._endColumns[i] - 1);
  10025. }
  10026. return elements;
  10027. }
  10028. getStrictElement(index) {
  10029. return this.lines[index];
  10030. }
  10031. getStartLineNumber(i) {
  10032. return i + 1;
  10033. }
  10034. getEndLineNumber(i) {
  10035. return i + 1;
  10036. }
  10037. createCharSequence(shouldIgnoreTrimWhitespace, startIndex, endIndex) {
  10038. const charCodes = [];
  10039. const lineNumbers = [];
  10040. const columns = [];
  10041. let len = 0;
  10042. for (let index = startIndex; index <= endIndex; index++) {
  10043. const lineContent = this.lines[index];
  10044. const startColumn = shouldIgnoreTrimWhitespace ? this._startColumns[index] : 1;
  10045. const endColumn = shouldIgnoreTrimWhitespace ? this._endColumns[index] : lineContent.length + 1;
  10046. for (let col = startColumn; col < endColumn; col++) {
  10047. charCodes[len] = lineContent.charCodeAt(col - 1);
  10048. lineNumbers[len] = index + 1;
  10049. columns[len] = col;
  10050. len++;
  10051. }
  10052. if (!shouldIgnoreTrimWhitespace && index < endIndex) {
  10053. charCodes[len] = 10;
  10054. lineNumbers[len] = index + 1;
  10055. columns[len] = lineContent.length + 1;
  10056. len++;
  10057. }
  10058. }
  10059. return new CharSequence(charCodes, lineNumbers, columns);
  10060. }
  10061. };
  10062. var CharSequence = class {
  10063. constructor(charCodes, lineNumbers, columns) {
  10064. this._charCodes = charCodes;
  10065. this._lineNumbers = lineNumbers;
  10066. this._columns = columns;
  10067. }
  10068. toString() {
  10069. return "[" + this._charCodes.map((s, idx) => (s === 10 ? "\\n" : String.fromCharCode(s)) + `-(${this._lineNumbers[idx]},${this._columns[idx]})`).join(", ") + "]";
  10070. }
  10071. _assertIndex(index, arr) {
  10072. if (index < 0 || index >= arr.length) {
  10073. throw new Error(`Illegal index`);
  10074. }
  10075. }
  10076. getElements() {
  10077. return this._charCodes;
  10078. }
  10079. getStartLineNumber(i) {
  10080. if (i > 0 && i === this._lineNumbers.length) {
  10081. return this.getEndLineNumber(i - 1);
  10082. }
  10083. this._assertIndex(i, this._lineNumbers);
  10084. return this._lineNumbers[i];
  10085. }
  10086. getEndLineNumber(i) {
  10087. if (i === -1) {
  10088. return this.getStartLineNumber(i + 1);
  10089. }
  10090. this._assertIndex(i, this._lineNumbers);
  10091. if (this._charCodes[i] === 10) {
  10092. return this._lineNumbers[i] + 1;
  10093. }
  10094. return this._lineNumbers[i];
  10095. }
  10096. getStartColumn(i) {
  10097. if (i > 0 && i === this._columns.length) {
  10098. return this.getEndColumn(i - 1);
  10099. }
  10100. this._assertIndex(i, this._columns);
  10101. return this._columns[i];
  10102. }
  10103. getEndColumn(i) {
  10104. if (i === -1) {
  10105. return this.getStartColumn(i + 1);
  10106. }
  10107. this._assertIndex(i, this._columns);
  10108. if (this._charCodes[i] === 10) {
  10109. return 1;
  10110. }
  10111. return this._columns[i] + 1;
  10112. }
  10113. };
  10114. var CharChange = class _CharChange {
  10115. constructor(originalStartLineNumber, originalStartColumn, originalEndLineNumber, originalEndColumn, modifiedStartLineNumber, modifiedStartColumn, modifiedEndLineNumber, modifiedEndColumn) {
  10116. this.originalStartLineNumber = originalStartLineNumber;
  10117. this.originalStartColumn = originalStartColumn;
  10118. this.originalEndLineNumber = originalEndLineNumber;
  10119. this.originalEndColumn = originalEndColumn;
  10120. this.modifiedStartLineNumber = modifiedStartLineNumber;
  10121. this.modifiedStartColumn = modifiedStartColumn;
  10122. this.modifiedEndLineNumber = modifiedEndLineNumber;
  10123. this.modifiedEndColumn = modifiedEndColumn;
  10124. }
  10125. static createFromDiffChange(diffChange, originalCharSequence, modifiedCharSequence) {
  10126. const originalStartLineNumber = originalCharSequence.getStartLineNumber(diffChange.originalStart);
  10127. const originalStartColumn = originalCharSequence.getStartColumn(diffChange.originalStart);
  10128. const originalEndLineNumber = originalCharSequence.getEndLineNumber(diffChange.originalStart + diffChange.originalLength - 1);
  10129. const originalEndColumn = originalCharSequence.getEndColumn(diffChange.originalStart + diffChange.originalLength - 1);
  10130. const modifiedStartLineNumber = modifiedCharSequence.getStartLineNumber(diffChange.modifiedStart);
  10131. const modifiedStartColumn = modifiedCharSequence.getStartColumn(diffChange.modifiedStart);
  10132. const modifiedEndLineNumber = modifiedCharSequence.getEndLineNumber(diffChange.modifiedStart + diffChange.modifiedLength - 1);
  10133. const modifiedEndColumn = modifiedCharSequence.getEndColumn(diffChange.modifiedStart + diffChange.modifiedLength - 1);
  10134. return new _CharChange(originalStartLineNumber, originalStartColumn, originalEndLineNumber, originalEndColumn, modifiedStartLineNumber, modifiedStartColumn, modifiedEndLineNumber, modifiedEndColumn);
  10135. }
  10136. };
  10137. function postProcessCharChanges(rawChanges) {
  10138. if (rawChanges.length <= 1) {
  10139. return rawChanges;
  10140. }
  10141. const result = [rawChanges[0]];
  10142. let prevChange = result[0];
  10143. for (let i = 1, len = rawChanges.length; i < len; i++) {
  10144. const currChange = rawChanges[i];
  10145. const originalMatchingLength = currChange.originalStart - (prevChange.originalStart + prevChange.originalLength);
  10146. const modifiedMatchingLength = currChange.modifiedStart - (prevChange.modifiedStart + prevChange.modifiedLength);
  10147. const matchingLength = Math.min(originalMatchingLength, modifiedMatchingLength);
  10148. if (matchingLength < MINIMUM_MATCHING_CHARACTER_LENGTH) {
  10149. prevChange.originalLength = currChange.originalStart + currChange.originalLength - prevChange.originalStart;
  10150. prevChange.modifiedLength = currChange.modifiedStart + currChange.modifiedLength - prevChange.modifiedStart;
  10151. } else {
  10152. result.push(currChange);
  10153. prevChange = currChange;
  10154. }
  10155. }
  10156. return result;
  10157. }
  10158. var LineChange = class _LineChange {
  10159. constructor(originalStartLineNumber, originalEndLineNumber, modifiedStartLineNumber, modifiedEndLineNumber, charChanges) {
  10160. this.originalStartLineNumber = originalStartLineNumber;
  10161. this.originalEndLineNumber = originalEndLineNumber;
  10162. this.modifiedStartLineNumber = modifiedStartLineNumber;
  10163. this.modifiedEndLineNumber = modifiedEndLineNumber;
  10164. this.charChanges = charChanges;
  10165. }
  10166. static createFromDiffResult(shouldIgnoreTrimWhitespace, diffChange, originalLineSequence, modifiedLineSequence, continueCharDiff, shouldComputeCharChanges, shouldPostProcessCharChanges) {
  10167. let originalStartLineNumber;
  10168. let originalEndLineNumber;
  10169. let modifiedStartLineNumber;
  10170. let modifiedEndLineNumber;
  10171. let charChanges = void 0;
  10172. if (diffChange.originalLength === 0) {
  10173. originalStartLineNumber = originalLineSequence.getStartLineNumber(diffChange.originalStart) - 1;
  10174. originalEndLineNumber = 0;
  10175. } else {
  10176. originalStartLineNumber = originalLineSequence.getStartLineNumber(diffChange.originalStart);
  10177. originalEndLineNumber = originalLineSequence.getEndLineNumber(diffChange.originalStart + diffChange.originalLength - 1);
  10178. }
  10179. if (diffChange.modifiedLength === 0) {
  10180. modifiedStartLineNumber = modifiedLineSequence.getStartLineNumber(diffChange.modifiedStart) - 1;
  10181. modifiedEndLineNumber = 0;
  10182. } else {
  10183. modifiedStartLineNumber = modifiedLineSequence.getStartLineNumber(diffChange.modifiedStart);
  10184. modifiedEndLineNumber = modifiedLineSequence.getEndLineNumber(diffChange.modifiedStart + diffChange.modifiedLength - 1);
  10185. }
  10186. if (shouldComputeCharChanges && diffChange.originalLength > 0 && diffChange.originalLength < 20 && diffChange.modifiedLength > 0 && diffChange.modifiedLength < 20 && continueCharDiff()) {
  10187. const originalCharSequence = originalLineSequence.createCharSequence(shouldIgnoreTrimWhitespace, diffChange.originalStart, diffChange.originalStart + diffChange.originalLength - 1);
  10188. const modifiedCharSequence = modifiedLineSequence.createCharSequence(shouldIgnoreTrimWhitespace, diffChange.modifiedStart, diffChange.modifiedStart + diffChange.modifiedLength - 1);
  10189. if (originalCharSequence.getElements().length > 0 && modifiedCharSequence.getElements().length > 0) {
  10190. let rawChanges = computeDiff(originalCharSequence, modifiedCharSequence, continueCharDiff, true).changes;
  10191. if (shouldPostProcessCharChanges) {
  10192. rawChanges = postProcessCharChanges(rawChanges);
  10193. }
  10194. charChanges = [];
  10195. for (let i = 0, length = rawChanges.length; i < length; i++) {
  10196. charChanges.push(CharChange.createFromDiffChange(rawChanges[i], originalCharSequence, modifiedCharSequence));
  10197. }
  10198. }
  10199. }
  10200. return new _LineChange(originalStartLineNumber, originalEndLineNumber, modifiedStartLineNumber, modifiedEndLineNumber, charChanges);
  10201. }
  10202. };
  10203. var DiffComputer = class {
  10204. constructor(originalLines, modifiedLines, opts) {
  10205. this.shouldComputeCharChanges = opts.shouldComputeCharChanges;
  10206. this.shouldPostProcessCharChanges = opts.shouldPostProcessCharChanges;
  10207. this.shouldIgnoreTrimWhitespace = opts.shouldIgnoreTrimWhitespace;
  10208. this.shouldMakePrettyDiff = opts.shouldMakePrettyDiff;
  10209. this.originalLines = originalLines;
  10210. this.modifiedLines = modifiedLines;
  10211. this.original = new LineSequence(originalLines);
  10212. this.modified = new LineSequence(modifiedLines);
  10213. this.continueLineDiff = createContinueProcessingPredicate(opts.maxComputationTime);
  10214. this.continueCharDiff = createContinueProcessingPredicate(opts.maxComputationTime === 0 ? 0 : Math.min(opts.maxComputationTime, 5e3));
  10215. }
  10216. computeDiff() {
  10217. if (this.original.lines.length === 1 && this.original.lines[0].length === 0) {
  10218. if (this.modified.lines.length === 1 && this.modified.lines[0].length === 0) {
  10219. return {
  10220. quitEarly: false,
  10221. changes: []
  10222. };
  10223. }
  10224. return {
  10225. quitEarly: false,
  10226. changes: [{
  10227. originalStartLineNumber: 1,
  10228. originalEndLineNumber: 1,
  10229. modifiedStartLineNumber: 1,
  10230. modifiedEndLineNumber: this.modified.lines.length,
  10231. charChanges: void 0
  10232. }]
  10233. };
  10234. }
  10235. if (this.modified.lines.length === 1 && this.modified.lines[0].length === 0) {
  10236. return {
  10237. quitEarly: false,
  10238. changes: [{
  10239. originalStartLineNumber: 1,
  10240. originalEndLineNumber: this.original.lines.length,
  10241. modifiedStartLineNumber: 1,
  10242. modifiedEndLineNumber: 1,
  10243. charChanges: void 0
  10244. }]
  10245. };
  10246. }
  10247. const diffResult = computeDiff(this.original, this.modified, this.continueLineDiff, this.shouldMakePrettyDiff);
  10248. const rawChanges = diffResult.changes;
  10249. const quitEarly = diffResult.quitEarly;
  10250. if (this.shouldIgnoreTrimWhitespace) {
  10251. const lineChanges = [];
  10252. for (let i = 0, length = rawChanges.length; i < length; i++) {
  10253. lineChanges.push(LineChange.createFromDiffResult(this.shouldIgnoreTrimWhitespace, rawChanges[i], this.original, this.modified, this.continueCharDiff, this.shouldComputeCharChanges, this.shouldPostProcessCharChanges));
  10254. }
  10255. return {
  10256. quitEarly,
  10257. changes: lineChanges
  10258. };
  10259. }
  10260. const result = [];
  10261. let originalLineIndex = 0;
  10262. let modifiedLineIndex = 0;
  10263. for (let i = -1, len = rawChanges.length; i < len; i++) {
  10264. const nextChange = i + 1 < len ? rawChanges[i + 1] : null;
  10265. const originalStop = nextChange ? nextChange.originalStart : this.originalLines.length;
  10266. const modifiedStop = nextChange ? nextChange.modifiedStart : this.modifiedLines.length;
  10267. while (originalLineIndex < originalStop && modifiedLineIndex < modifiedStop) {
  10268. const originalLine = this.originalLines[originalLineIndex];
  10269. const modifiedLine = this.modifiedLines[modifiedLineIndex];
  10270. if (originalLine !== modifiedLine) {
  10271. {
  10272. let originalStartColumn = getFirstNonBlankColumn(originalLine, 1);
  10273. let modifiedStartColumn = getFirstNonBlankColumn(modifiedLine, 1);
  10274. while (originalStartColumn > 1 && modifiedStartColumn > 1) {
  10275. const originalChar = originalLine.charCodeAt(originalStartColumn - 2);
  10276. const modifiedChar = modifiedLine.charCodeAt(modifiedStartColumn - 2);
  10277. if (originalChar !== modifiedChar) {
  10278. break;
  10279. }
  10280. originalStartColumn--;
  10281. modifiedStartColumn--;
  10282. }
  10283. if (originalStartColumn > 1 || modifiedStartColumn > 1) {
  10284. this._pushTrimWhitespaceCharChange(result, originalLineIndex + 1, 1, originalStartColumn, modifiedLineIndex + 1, 1, modifiedStartColumn);
  10285. }
  10286. }
  10287. {
  10288. let originalEndColumn = getLastNonBlankColumn(originalLine, 1);
  10289. let modifiedEndColumn = getLastNonBlankColumn(modifiedLine, 1);
  10290. const originalMaxColumn = originalLine.length + 1;
  10291. const modifiedMaxColumn = modifiedLine.length + 1;
  10292. while (originalEndColumn < originalMaxColumn && modifiedEndColumn < modifiedMaxColumn) {
  10293. const originalChar = originalLine.charCodeAt(originalEndColumn - 1);
  10294. const modifiedChar = originalLine.charCodeAt(modifiedEndColumn - 1);
  10295. if (originalChar !== modifiedChar) {
  10296. break;
  10297. }
  10298. originalEndColumn++;
  10299. modifiedEndColumn++;
  10300. }
  10301. if (originalEndColumn < originalMaxColumn || modifiedEndColumn < modifiedMaxColumn) {
  10302. this._pushTrimWhitespaceCharChange(result, originalLineIndex + 1, originalEndColumn, originalMaxColumn, modifiedLineIndex + 1, modifiedEndColumn, modifiedMaxColumn);
  10303. }
  10304. }
  10305. }
  10306. originalLineIndex++;
  10307. modifiedLineIndex++;
  10308. }
  10309. if (nextChange) {
  10310. result.push(LineChange.createFromDiffResult(this.shouldIgnoreTrimWhitespace, nextChange, this.original, this.modified, this.continueCharDiff, this.shouldComputeCharChanges, this.shouldPostProcessCharChanges));
  10311. originalLineIndex += nextChange.originalLength;
  10312. modifiedLineIndex += nextChange.modifiedLength;
  10313. }
  10314. }
  10315. return {
  10316. quitEarly,
  10317. changes: result
  10318. };
  10319. }
  10320. _pushTrimWhitespaceCharChange(result, originalLineNumber, originalStartColumn, originalEndColumn, modifiedLineNumber, modifiedStartColumn, modifiedEndColumn) {
  10321. if (this._mergeTrimWhitespaceCharChange(result, originalLineNumber, originalStartColumn, originalEndColumn, modifiedLineNumber, modifiedStartColumn, modifiedEndColumn)) {
  10322. return;
  10323. }
  10324. let charChanges = void 0;
  10325. if (this.shouldComputeCharChanges) {
  10326. charChanges = [new CharChange(originalLineNumber, originalStartColumn, originalLineNumber, originalEndColumn, modifiedLineNumber, modifiedStartColumn, modifiedLineNumber, modifiedEndColumn)];
  10327. }
  10328. result.push(new LineChange(originalLineNumber, originalLineNumber, modifiedLineNumber, modifiedLineNumber, charChanges));
  10329. }
  10330. _mergeTrimWhitespaceCharChange(result, originalLineNumber, originalStartColumn, originalEndColumn, modifiedLineNumber, modifiedStartColumn, modifiedEndColumn) {
  10331. const len = result.length;
  10332. if (len === 0) {
  10333. return false;
  10334. }
  10335. const prevChange = result[len - 1];
  10336. if (prevChange.originalEndLineNumber === 0 || prevChange.modifiedEndLineNumber === 0) {
  10337. return false;
  10338. }
  10339. if (prevChange.originalEndLineNumber === originalLineNumber && prevChange.modifiedEndLineNumber === modifiedLineNumber) {
  10340. if (this.shouldComputeCharChanges && prevChange.charChanges) {
  10341. prevChange.charChanges.push(new CharChange(originalLineNumber, originalStartColumn, originalLineNumber, originalEndColumn, modifiedLineNumber, modifiedStartColumn, modifiedLineNumber, modifiedEndColumn));
  10342. }
  10343. return true;
  10344. }
  10345. if (prevChange.originalEndLineNumber + 1 === originalLineNumber && prevChange.modifiedEndLineNumber + 1 === modifiedLineNumber) {
  10346. prevChange.originalEndLineNumber = originalLineNumber;
  10347. prevChange.modifiedEndLineNumber = modifiedLineNumber;
  10348. if (this.shouldComputeCharChanges && prevChange.charChanges) {
  10349. prevChange.charChanges.push(new CharChange(originalLineNumber, originalStartColumn, originalLineNumber, originalEndColumn, modifiedLineNumber, modifiedStartColumn, modifiedLineNumber, modifiedEndColumn));
  10350. }
  10351. return true;
  10352. }
  10353. return false;
  10354. }
  10355. };
  10356. function getFirstNonBlankColumn(txt, defaultValue) {
  10357. const r = firstNonWhitespaceIndex(txt);
  10358. if (r === -1) {
  10359. return defaultValue;
  10360. }
  10361. return r + 1;
  10362. }
  10363. function getLastNonBlankColumn(txt, defaultValue) {
  10364. const r = lastNonWhitespaceIndex(txt);
  10365. if (r === -1) {
  10366. return defaultValue;
  10367. }
  10368. return r + 2;
  10369. }
  10370. function createContinueProcessingPredicate(maximumRuntime) {
  10371. if (maximumRuntime === 0) {
  10372. return () => true;
  10373. }
  10374. const startTime = Date.now();
  10375. return () => {
  10376. return Date.now() - startTime < maximumRuntime;
  10377. };
  10378. }
  10379. // node_modules/monaco-editor/esm/vs/base/common/arrays.js
  10380. function equals2(one, other, itemEquals = (a, b) => a === b) {
  10381. if (one === other) {
  10382. return true;
  10383. }
  10384. if (!one || !other) {
  10385. return false;
  10386. }
  10387. if (one.length !== other.length) {
  10388. return false;
  10389. }
  10390. for (let i = 0, len = one.length; i < len; i++) {
  10391. if (!itemEquals(one[i], other[i])) {
  10392. return false;
  10393. }
  10394. }
  10395. return true;
  10396. }
  10397. function* groupAdjacentBy(items, shouldBeGrouped) {
  10398. let currentGroup;
  10399. let last;
  10400. for (const item of items) {
  10401. if (last !== void 0 && shouldBeGrouped(last, item)) {
  10402. currentGroup.push(item);
  10403. } else {
  10404. if (currentGroup) {
  10405. yield currentGroup;
  10406. }
  10407. currentGroup = [item];
  10408. }
  10409. last = item;
  10410. }
  10411. if (currentGroup) {
  10412. yield currentGroup;
  10413. }
  10414. }
  10415. function forEachAdjacent(arr, f) {
  10416. for (let i = 0; i <= arr.length; i++) {
  10417. f(i === 0 ? void 0 : arr[i - 1], i === arr.length ? void 0 : arr[i]);
  10418. }
  10419. }
  10420. function forEachWithNeighbors(arr, f) {
  10421. for (let i = 0; i < arr.length; i++) {
  10422. f(i === 0 ? void 0 : arr[i - 1], arr[i], i + 1 === arr.length ? void 0 : arr[i + 1]);
  10423. }
  10424. }
  10425. function pushMany(arr, items) {
  10426. for (const item of items) {
  10427. arr.push(item);
  10428. }
  10429. }
  10430. var CompareResult;
  10431. (function(CompareResult2) {
  10432. function isLessThan(result) {
  10433. return result < 0;
  10434. }
  10435. CompareResult2.isLessThan = isLessThan;
  10436. function isLessThanOrEqual(result) {
  10437. return result <= 0;
  10438. }
  10439. CompareResult2.isLessThanOrEqual = isLessThanOrEqual;
  10440. function isGreaterThan(result) {
  10441. return result > 0;
  10442. }
  10443. CompareResult2.isGreaterThan = isGreaterThan;
  10444. function isNeitherLessOrGreaterThan(result) {
  10445. return result === 0;
  10446. }
  10447. CompareResult2.isNeitherLessOrGreaterThan = isNeitherLessOrGreaterThan;
  10448. CompareResult2.greaterThan = 1;
  10449. CompareResult2.lessThan = -1;
  10450. CompareResult2.neitherLessOrGreaterThan = 0;
  10451. })(CompareResult || (CompareResult = {}));
  10452. function compareBy(selector, comparator) {
  10453. return (a, b) => comparator(selector(a), selector(b));
  10454. }
  10455. var numberComparator = (a, b) => a - b;
  10456. function reverseOrder(comparator) {
  10457. return (a, b) => -comparator(a, b);
  10458. }
  10459. var CallbackIterable = class _CallbackIterable {
  10460. static {
  10461. this.empty = new _CallbackIterable((_callback) => {
  10462. });
  10463. }
  10464. constructor(iterate) {
  10465. this.iterate = iterate;
  10466. }
  10467. toArray() {
  10468. const result = [];
  10469. this.iterate((item) => {
  10470. result.push(item);
  10471. return true;
  10472. });
  10473. return result;
  10474. }
  10475. filter(predicate) {
  10476. return new _CallbackIterable((cb) => this.iterate((item) => predicate(item) ? cb(item) : true));
  10477. }
  10478. map(mapFn) {
  10479. return new _CallbackIterable((cb) => this.iterate((item) => cb(mapFn(item))));
  10480. }
  10481. findLast(predicate) {
  10482. let result;
  10483. this.iterate((item) => {
  10484. if (predicate(item)) {
  10485. result = item;
  10486. }
  10487. return true;
  10488. });
  10489. return result;
  10490. }
  10491. findLastMaxBy(comparator) {
  10492. let result;
  10493. let first = true;
  10494. this.iterate((item) => {
  10495. if (first || CompareResult.isGreaterThan(comparator(item, result))) {
  10496. first = false;
  10497. result = item;
  10498. }
  10499. return true;
  10500. });
  10501. return result;
  10502. }
  10503. };
  10504. // node_modules/monaco-editor/esm/vs/editor/common/diff/defaultLinesDiffComputer/algorithms/diffAlgorithm.js
  10505. var DiffAlgorithmResult = class _DiffAlgorithmResult {
  10506. static trivial(seq1, seq2) {
  10507. return new _DiffAlgorithmResult([new SequenceDiff(OffsetRange.ofLength(seq1.length), OffsetRange.ofLength(seq2.length))], false);
  10508. }
  10509. static trivialTimedOut(seq1, seq2) {
  10510. return new _DiffAlgorithmResult([new SequenceDiff(OffsetRange.ofLength(seq1.length), OffsetRange.ofLength(seq2.length))], true);
  10511. }
  10512. constructor(diffs, hitTimeout) {
  10513. this.diffs = diffs;
  10514. this.hitTimeout = hitTimeout;
  10515. }
  10516. };
  10517. var SequenceDiff = class _SequenceDiff {
  10518. static invert(sequenceDiffs, doc1Length) {
  10519. const result = [];
  10520. forEachAdjacent(sequenceDiffs, (a, b) => {
  10521. result.push(_SequenceDiff.fromOffsetPairs(a ? a.getEndExclusives() : OffsetPair.zero, b ? b.getStarts() : new OffsetPair(doc1Length, (a ? a.seq2Range.endExclusive - a.seq1Range.endExclusive : 0) + doc1Length)));
  10522. });
  10523. return result;
  10524. }
  10525. static fromOffsetPairs(start, endExclusive) {
  10526. return new _SequenceDiff(new OffsetRange(start.offset1, endExclusive.offset1), new OffsetRange(start.offset2, endExclusive.offset2));
  10527. }
  10528. static assertSorted(sequenceDiffs) {
  10529. let last = void 0;
  10530. for (const cur of sequenceDiffs) {
  10531. if (last) {
  10532. if (!(last.seq1Range.endExclusive <= cur.seq1Range.start && last.seq2Range.endExclusive <= cur.seq2Range.start)) {
  10533. throw new BugIndicatingError("Sequence diffs must be sorted");
  10534. }
  10535. }
  10536. last = cur;
  10537. }
  10538. }
  10539. constructor(seq1Range, seq2Range) {
  10540. this.seq1Range = seq1Range;
  10541. this.seq2Range = seq2Range;
  10542. }
  10543. swap() {
  10544. return new _SequenceDiff(this.seq2Range, this.seq1Range);
  10545. }
  10546. toString() {
  10547. return `${this.seq1Range} <-> ${this.seq2Range}`;
  10548. }
  10549. join(other) {
  10550. return new _SequenceDiff(this.seq1Range.join(other.seq1Range), this.seq2Range.join(other.seq2Range));
  10551. }
  10552. delta(offset) {
  10553. if (offset === 0) {
  10554. return this;
  10555. }
  10556. return new _SequenceDiff(this.seq1Range.delta(offset), this.seq2Range.delta(offset));
  10557. }
  10558. deltaStart(offset) {
  10559. if (offset === 0) {
  10560. return this;
  10561. }
  10562. return new _SequenceDiff(this.seq1Range.deltaStart(offset), this.seq2Range.deltaStart(offset));
  10563. }
  10564. deltaEnd(offset) {
  10565. if (offset === 0) {
  10566. return this;
  10567. }
  10568. return new _SequenceDiff(this.seq1Range.deltaEnd(offset), this.seq2Range.deltaEnd(offset));
  10569. }
  10570. intersect(other) {
  10571. const i1 = this.seq1Range.intersect(other.seq1Range);
  10572. const i2 = this.seq2Range.intersect(other.seq2Range);
  10573. if (!i1 || !i2) {
  10574. return void 0;
  10575. }
  10576. return new _SequenceDiff(i1, i2);
  10577. }
  10578. getStarts() {
  10579. return new OffsetPair(this.seq1Range.start, this.seq2Range.start);
  10580. }
  10581. getEndExclusives() {
  10582. return new OffsetPair(this.seq1Range.endExclusive, this.seq2Range.endExclusive);
  10583. }
  10584. };
  10585. var OffsetPair = class _OffsetPair {
  10586. static {
  10587. this.zero = new _OffsetPair(0, 0);
  10588. }
  10589. static {
  10590. this.max = new _OffsetPair(Number.MAX_SAFE_INTEGER, Number.MAX_SAFE_INTEGER);
  10591. }
  10592. constructor(offset1, offset2) {
  10593. this.offset1 = offset1;
  10594. this.offset2 = offset2;
  10595. }
  10596. toString() {
  10597. return `${this.offset1} <-> ${this.offset2}`;
  10598. }
  10599. delta(offset) {
  10600. if (offset === 0) {
  10601. return this;
  10602. }
  10603. return new _OffsetPair(this.offset1 + offset, this.offset2 + offset);
  10604. }
  10605. equals(other) {
  10606. return this.offset1 === other.offset1 && this.offset2 === other.offset2;
  10607. }
  10608. };
  10609. var InfiniteTimeout = class _InfiniteTimeout {
  10610. static {
  10611. this.instance = new _InfiniteTimeout();
  10612. }
  10613. isValid() {
  10614. return true;
  10615. }
  10616. };
  10617. var DateTimeout = class {
  10618. constructor(timeout) {
  10619. this.timeout = timeout;
  10620. this.startTime = Date.now();
  10621. this.valid = true;
  10622. if (timeout <= 0) {
  10623. throw new BugIndicatingError("timeout must be positive");
  10624. }
  10625. }
  10626. // Recommendation: Set a log-point `{this.disable()}` in the body
  10627. isValid() {
  10628. const valid = Date.now() - this.startTime < this.timeout;
  10629. if (!valid && this.valid) {
  10630. this.valid = false;
  10631. debugger;
  10632. }
  10633. return this.valid;
  10634. }
  10635. };
  10636. // node_modules/monaco-editor/esm/vs/editor/common/diff/defaultLinesDiffComputer/utils.js
  10637. var Array2D = class {
  10638. constructor(width, height) {
  10639. this.width = width;
  10640. this.height = height;
  10641. this.array = [];
  10642. this.array = new Array(width * height);
  10643. }
  10644. get(x, y) {
  10645. return this.array[x + y * this.width];
  10646. }
  10647. set(x, y, value) {
  10648. this.array[x + y * this.width] = value;
  10649. }
  10650. };
  10651. function isSpace(charCode) {
  10652. return charCode === 32 || charCode === 9;
  10653. }
  10654. var LineRangeFragment = class _LineRangeFragment {
  10655. static {
  10656. this.chrKeys = /* @__PURE__ */ new Map();
  10657. }
  10658. static getKey(chr) {
  10659. let key = this.chrKeys.get(chr);
  10660. if (key === void 0) {
  10661. key = this.chrKeys.size;
  10662. this.chrKeys.set(chr, key);
  10663. }
  10664. return key;
  10665. }
  10666. constructor(range, lines, source) {
  10667. this.range = range;
  10668. this.lines = lines;
  10669. this.source = source;
  10670. this.histogram = [];
  10671. let counter = 0;
  10672. for (let i = range.startLineNumber - 1; i < range.endLineNumberExclusive - 1; i++) {
  10673. const line = lines[i];
  10674. for (let j = 0; j < line.length; j++) {
  10675. counter++;
  10676. const chr = line[j];
  10677. const key2 = _LineRangeFragment.getKey(chr);
  10678. this.histogram[key2] = (this.histogram[key2] || 0) + 1;
  10679. }
  10680. counter++;
  10681. const key = _LineRangeFragment.getKey("\n");
  10682. this.histogram[key] = (this.histogram[key] || 0) + 1;
  10683. }
  10684. this.totalCount = counter;
  10685. }
  10686. computeSimilarity(other) {
  10687. let sumDifferences = 0;
  10688. const maxLength = Math.max(this.histogram.length, other.histogram.length);
  10689. for (let i = 0; i < maxLength; i++) {
  10690. sumDifferences += Math.abs((this.histogram[i] ?? 0) - (other.histogram[i] ?? 0));
  10691. }
  10692. return 1 - sumDifferences / (this.totalCount + other.totalCount);
  10693. }
  10694. };
  10695. // node_modules/monaco-editor/esm/vs/editor/common/diff/defaultLinesDiffComputer/algorithms/dynamicProgrammingDiffing.js
  10696. var DynamicProgrammingDiffing = class {
  10697. compute(sequence1, sequence2, timeout = InfiniteTimeout.instance, equalityScore) {
  10698. if (sequence1.length === 0 || sequence2.length === 0) {
  10699. return DiffAlgorithmResult.trivial(sequence1, sequence2);
  10700. }
  10701. const lcsLengths = new Array2D(sequence1.length, sequence2.length);
  10702. const directions = new Array2D(sequence1.length, sequence2.length);
  10703. const lengths = new Array2D(sequence1.length, sequence2.length);
  10704. for (let s12 = 0; s12 < sequence1.length; s12++) {
  10705. for (let s22 = 0; s22 < sequence2.length; s22++) {
  10706. if (!timeout.isValid()) {
  10707. return DiffAlgorithmResult.trivialTimedOut(sequence1, sequence2);
  10708. }
  10709. const horizontalLen = s12 === 0 ? 0 : lcsLengths.get(s12 - 1, s22);
  10710. const verticalLen = s22 === 0 ? 0 : lcsLengths.get(s12, s22 - 1);
  10711. let extendedSeqScore;
  10712. if (sequence1.getElement(s12) === sequence2.getElement(s22)) {
  10713. if (s12 === 0 || s22 === 0) {
  10714. extendedSeqScore = 0;
  10715. } else {
  10716. extendedSeqScore = lcsLengths.get(s12 - 1, s22 - 1);
  10717. }
  10718. if (s12 > 0 && s22 > 0 && directions.get(s12 - 1, s22 - 1) === 3) {
  10719. extendedSeqScore += lengths.get(s12 - 1, s22 - 1);
  10720. }
  10721. extendedSeqScore += equalityScore ? equalityScore(s12, s22) : 1;
  10722. } else {
  10723. extendedSeqScore = -1;
  10724. }
  10725. const newValue = Math.max(horizontalLen, verticalLen, extendedSeqScore);
  10726. if (newValue === extendedSeqScore) {
  10727. const prevLen = s12 > 0 && s22 > 0 ? lengths.get(s12 - 1, s22 - 1) : 0;
  10728. lengths.set(s12, s22, prevLen + 1);
  10729. directions.set(s12, s22, 3);
  10730. } else if (newValue === horizontalLen) {
  10731. lengths.set(s12, s22, 0);
  10732. directions.set(s12, s22, 1);
  10733. } else if (newValue === verticalLen) {
  10734. lengths.set(s12, s22, 0);
  10735. directions.set(s12, s22, 2);
  10736. }
  10737. lcsLengths.set(s12, s22, newValue);
  10738. }
  10739. }
  10740. const result = [];
  10741. let lastAligningPosS1 = sequence1.length;
  10742. let lastAligningPosS2 = sequence2.length;
  10743. function reportDecreasingAligningPositions(s12, s22) {
  10744. if (s12 + 1 !== lastAligningPosS1 || s22 + 1 !== lastAligningPosS2) {
  10745. result.push(new SequenceDiff(new OffsetRange(s12 + 1, lastAligningPosS1), new OffsetRange(s22 + 1, lastAligningPosS2)));
  10746. }
  10747. lastAligningPosS1 = s12;
  10748. lastAligningPosS2 = s22;
  10749. }
  10750. let s1 = sequence1.length - 1;
  10751. let s2 = sequence2.length - 1;
  10752. while (s1 >= 0 && s2 >= 0) {
  10753. if (directions.get(s1, s2) === 3) {
  10754. reportDecreasingAligningPositions(s1, s2);
  10755. s1--;
  10756. s2--;
  10757. } else {
  10758. if (directions.get(s1, s2) === 1) {
  10759. s1--;
  10760. } else {
  10761. s2--;
  10762. }
  10763. }
  10764. }
  10765. reportDecreasingAligningPositions(-1, -1);
  10766. result.reverse();
  10767. return new DiffAlgorithmResult(result, false);
  10768. }
  10769. };
  10770. // node_modules/monaco-editor/esm/vs/editor/common/diff/defaultLinesDiffComputer/algorithms/myersDiffAlgorithm.js
  10771. var MyersDiffAlgorithm = class {
  10772. compute(seq1, seq2, timeout = InfiniteTimeout.instance) {
  10773. if (seq1.length === 0 || seq2.length === 0) {
  10774. return DiffAlgorithmResult.trivial(seq1, seq2);
  10775. }
  10776. const seqX = seq1;
  10777. const seqY = seq2;
  10778. function getXAfterSnake(x, y) {
  10779. while (x < seqX.length && y < seqY.length && seqX.getElement(x) === seqY.getElement(y)) {
  10780. x++;
  10781. y++;
  10782. }
  10783. return x;
  10784. }
  10785. let d = 0;
  10786. const V = new FastInt32Array();
  10787. V.set(0, getXAfterSnake(0, 0));
  10788. const paths = new FastArrayNegativeIndices();
  10789. paths.set(0, V.get(0) === 0 ? null : new SnakePath(null, 0, 0, V.get(0)));
  10790. let k = 0;
  10791. loop:
  10792. while (true) {
  10793. d++;
  10794. if (!timeout.isValid()) {
  10795. return DiffAlgorithmResult.trivialTimedOut(seqX, seqY);
  10796. }
  10797. const lowerBound = -Math.min(d, seqY.length + d % 2);
  10798. const upperBound = Math.min(d, seqX.length + d % 2);
  10799. for (k = lowerBound; k <= upperBound; k += 2) {
  10800. let step = 0;
  10801. const maxXofDLineTop = k === upperBound ? -1 : V.get(k + 1);
  10802. const maxXofDLineLeft = k === lowerBound ? -1 : V.get(k - 1) + 1;
  10803. step++;
  10804. const x = Math.min(Math.max(maxXofDLineTop, maxXofDLineLeft), seqX.length);
  10805. const y = x - k;
  10806. step++;
  10807. if (x > seqX.length || y > seqY.length) {
  10808. continue;
  10809. }
  10810. const newMaxX = getXAfterSnake(x, y);
  10811. V.set(k, newMaxX);
  10812. const lastPath = x === maxXofDLineTop ? paths.get(k + 1) : paths.get(k - 1);
  10813. paths.set(k, newMaxX !== x ? new SnakePath(lastPath, x, y, newMaxX - x) : lastPath);
  10814. if (V.get(k) === seqX.length && V.get(k) - k === seqY.length) {
  10815. break loop;
  10816. }
  10817. }
  10818. }
  10819. let path = paths.get(k);
  10820. const result = [];
  10821. let lastAligningPosS1 = seqX.length;
  10822. let lastAligningPosS2 = seqY.length;
  10823. while (true) {
  10824. const endX = path ? path.x + path.length : 0;
  10825. const endY = path ? path.y + path.length : 0;
  10826. if (endX !== lastAligningPosS1 || endY !== lastAligningPosS2) {
  10827. result.push(new SequenceDiff(new OffsetRange(endX, lastAligningPosS1), new OffsetRange(endY, lastAligningPosS2)));
  10828. }
  10829. if (!path) {
  10830. break;
  10831. }
  10832. lastAligningPosS1 = path.x;
  10833. lastAligningPosS2 = path.y;
  10834. path = path.prev;
  10835. }
  10836. result.reverse();
  10837. return new DiffAlgorithmResult(result, false);
  10838. }
  10839. };
  10840. var SnakePath = class {
  10841. constructor(prev, x, y, length) {
  10842. this.prev = prev;
  10843. this.x = x;
  10844. this.y = y;
  10845. this.length = length;
  10846. }
  10847. };
  10848. var FastInt32Array = class {
  10849. constructor() {
  10850. this.positiveArr = new Int32Array(10);
  10851. this.negativeArr = new Int32Array(10);
  10852. }
  10853. get(idx) {
  10854. if (idx < 0) {
  10855. idx = -idx - 1;
  10856. return this.negativeArr[idx];
  10857. } else {
  10858. return this.positiveArr[idx];
  10859. }
  10860. }
  10861. set(idx, value) {
  10862. if (idx < 0) {
  10863. idx = -idx - 1;
  10864. if (idx >= this.negativeArr.length) {
  10865. const arr = this.negativeArr;
  10866. this.negativeArr = new Int32Array(arr.length * 2);
  10867. this.negativeArr.set(arr);
  10868. }
  10869. this.negativeArr[idx] = value;
  10870. } else {
  10871. if (idx >= this.positiveArr.length) {
  10872. const arr = this.positiveArr;
  10873. this.positiveArr = new Int32Array(arr.length * 2);
  10874. this.positiveArr.set(arr);
  10875. }
  10876. this.positiveArr[idx] = value;
  10877. }
  10878. }
  10879. };
  10880. var FastArrayNegativeIndices = class {
  10881. constructor() {
  10882. this.positiveArr = [];
  10883. this.negativeArr = [];
  10884. }
  10885. get(idx) {
  10886. if (idx < 0) {
  10887. idx = -idx - 1;
  10888. return this.negativeArr[idx];
  10889. } else {
  10890. return this.positiveArr[idx];
  10891. }
  10892. }
  10893. set(idx, value) {
  10894. if (idx < 0) {
  10895. idx = -idx - 1;
  10896. this.negativeArr[idx] = value;
  10897. } else {
  10898. this.positiveArr[idx] = value;
  10899. }
  10900. }
  10901. };
  10902. // node_modules/monaco-editor/esm/vs/editor/common/diff/defaultLinesDiffComputer/linesSliceCharSequence.js
  10903. var LinesSliceCharSequence = class {
  10904. constructor(lines, range, considerWhitespaceChanges) {
  10905. this.lines = lines;
  10906. this.range = range;
  10907. this.considerWhitespaceChanges = considerWhitespaceChanges;
  10908. this.elements = [];
  10909. this.firstElementOffsetByLineIdx = [];
  10910. this.lineStartOffsets = [];
  10911. this.trimmedWsLengthsByLineIdx = [];
  10912. this.firstElementOffsetByLineIdx.push(0);
  10913. for (let lineNumber = this.range.startLineNumber; lineNumber <= this.range.endLineNumber; lineNumber++) {
  10914. let line = lines[lineNumber - 1];
  10915. let lineStartOffset = 0;
  10916. if (lineNumber === this.range.startLineNumber && this.range.startColumn > 1) {
  10917. lineStartOffset = this.range.startColumn - 1;
  10918. line = line.substring(lineStartOffset);
  10919. }
  10920. this.lineStartOffsets.push(lineStartOffset);
  10921. let trimmedWsLength = 0;
  10922. if (!considerWhitespaceChanges) {
  10923. const trimmedStartLine = line.trimStart();
  10924. trimmedWsLength = line.length - trimmedStartLine.length;
  10925. line = trimmedStartLine.trimEnd();
  10926. }
  10927. this.trimmedWsLengthsByLineIdx.push(trimmedWsLength);
  10928. const lineLength = lineNumber === this.range.endLineNumber ? Math.min(this.range.endColumn - 1 - lineStartOffset - trimmedWsLength, line.length) : line.length;
  10929. for (let i = 0; i < lineLength; i++) {
  10930. this.elements.push(line.charCodeAt(i));
  10931. }
  10932. if (lineNumber < this.range.endLineNumber) {
  10933. this.elements.push("\n".charCodeAt(0));
  10934. this.firstElementOffsetByLineIdx.push(this.elements.length);
  10935. }
  10936. }
  10937. }
  10938. toString() {
  10939. return `Slice: "${this.text}"`;
  10940. }
  10941. get text() {
  10942. return this.getText(new OffsetRange(0, this.length));
  10943. }
  10944. getText(range) {
  10945. return this.elements.slice(range.start, range.endExclusive).map((e) => String.fromCharCode(e)).join("");
  10946. }
  10947. getElement(offset) {
  10948. return this.elements[offset];
  10949. }
  10950. get length() {
  10951. return this.elements.length;
  10952. }
  10953. getBoundaryScore(length) {
  10954. const prevCategory = getCategory(length > 0 ? this.elements[length - 1] : -1);
  10955. const nextCategory = getCategory(length < this.elements.length ? this.elements[length] : -1);
  10956. if (prevCategory === 7 && nextCategory === 8) {
  10957. return 0;
  10958. }
  10959. if (prevCategory === 8) {
  10960. return 150;
  10961. }
  10962. let score2 = 0;
  10963. if (prevCategory !== nextCategory) {
  10964. score2 += 10;
  10965. if (prevCategory === 0 && nextCategory === 1) {
  10966. score2 += 1;
  10967. }
  10968. }
  10969. score2 += getCategoryBoundaryScore(prevCategory);
  10970. score2 += getCategoryBoundaryScore(nextCategory);
  10971. return score2;
  10972. }
  10973. translateOffset(offset, preference = "right") {
  10974. const i = findLastIdxMonotonous(this.firstElementOffsetByLineIdx, (value) => value <= offset);
  10975. const lineOffset = offset - this.firstElementOffsetByLineIdx[i];
  10976. return new Position(this.range.startLineNumber + i, 1 + this.lineStartOffsets[i] + lineOffset + (lineOffset === 0 && preference === "left" ? 0 : this.trimmedWsLengthsByLineIdx[i]));
  10977. }
  10978. translateRange(range) {
  10979. const pos1 = this.translateOffset(range.start, "right");
  10980. const pos2 = this.translateOffset(range.endExclusive, "left");
  10981. if (pos2.isBefore(pos1)) {
  10982. return Range.fromPositions(pos2, pos2);
  10983. }
  10984. return Range.fromPositions(pos1, pos2);
  10985. }
  10986. /**
  10987. * Finds the word that contains the character at the given offset
  10988. */
  10989. findWordContaining(offset) {
  10990. if (offset < 0 || offset >= this.elements.length) {
  10991. return void 0;
  10992. }
  10993. if (!isWordChar(this.elements[offset])) {
  10994. return void 0;
  10995. }
  10996. let start = offset;
  10997. while (start > 0 && isWordChar(this.elements[start - 1])) {
  10998. start--;
  10999. }
  11000. let end = offset;
  11001. while (end < this.elements.length && isWordChar(this.elements[end])) {
  11002. end++;
  11003. }
  11004. return new OffsetRange(start, end);
  11005. }
  11006. countLinesIn(range) {
  11007. return this.translateOffset(range.endExclusive).lineNumber - this.translateOffset(range.start).lineNumber;
  11008. }
  11009. isStronglyEqual(offset1, offset2) {
  11010. return this.elements[offset1] === this.elements[offset2];
  11011. }
  11012. extendToFullLines(range) {
  11013. const start = findLastMonotonous(this.firstElementOffsetByLineIdx, (x) => x <= range.start) ?? 0;
  11014. const end = findFirstMonotonous(this.firstElementOffsetByLineIdx, (x) => range.endExclusive <= x) ?? this.elements.length;
  11015. return new OffsetRange(start, end);
  11016. }
  11017. };
  11018. function isWordChar(charCode) {
  11019. return charCode >= 97 && charCode <= 122 || charCode >= 65 && charCode <= 90 || charCode >= 48 && charCode <= 57;
  11020. }
  11021. var score = {
  11022. [
  11023. 0
  11024. /* CharBoundaryCategory.WordLower */
  11025. ]: 0,
  11026. [
  11027. 1
  11028. /* CharBoundaryCategory.WordUpper */
  11029. ]: 0,
  11030. [
  11031. 2
  11032. /* CharBoundaryCategory.WordNumber */
  11033. ]: 0,
  11034. [
  11035. 3
  11036. /* CharBoundaryCategory.End */
  11037. ]: 10,
  11038. [
  11039. 4
  11040. /* CharBoundaryCategory.Other */
  11041. ]: 2,
  11042. [
  11043. 5
  11044. /* CharBoundaryCategory.Separator */
  11045. ]: 30,
  11046. [
  11047. 6
  11048. /* CharBoundaryCategory.Space */
  11049. ]: 3,
  11050. [
  11051. 7
  11052. /* CharBoundaryCategory.LineBreakCR */
  11053. ]: 10,
  11054. [
  11055. 8
  11056. /* CharBoundaryCategory.LineBreakLF */
  11057. ]: 10
  11058. };
  11059. function getCategoryBoundaryScore(category) {
  11060. return score[category];
  11061. }
  11062. function getCategory(charCode) {
  11063. if (charCode === 10) {
  11064. return 8;
  11065. } else if (charCode === 13) {
  11066. return 7;
  11067. } else if (isSpace(charCode)) {
  11068. return 6;
  11069. } else if (charCode >= 97 && charCode <= 122) {
  11070. return 0;
  11071. } else if (charCode >= 65 && charCode <= 90) {
  11072. return 1;
  11073. } else if (charCode >= 48 && charCode <= 57) {
  11074. return 2;
  11075. } else if (charCode === -1) {
  11076. return 3;
  11077. } else if (charCode === 44 || charCode === 59) {
  11078. return 5;
  11079. } else {
  11080. return 4;
  11081. }
  11082. }
  11083. // node_modules/monaco-editor/esm/vs/editor/common/diff/defaultLinesDiffComputer/computeMovedLines.js
  11084. function computeMovedLines(changes, originalLines, modifiedLines, hashedOriginalLines, hashedModifiedLines, timeout) {
  11085. let { moves, excludedChanges } = computeMovesFromSimpleDeletionsToSimpleInsertions(changes, originalLines, modifiedLines, timeout);
  11086. if (!timeout.isValid()) {
  11087. return [];
  11088. }
  11089. const filteredChanges = changes.filter((c) => !excludedChanges.has(c));
  11090. const unchangedMoves = computeUnchangedMoves(filteredChanges, hashedOriginalLines, hashedModifiedLines, originalLines, modifiedLines, timeout);
  11091. pushMany(moves, unchangedMoves);
  11092. moves = joinCloseConsecutiveMoves(moves);
  11093. moves = moves.filter((current) => {
  11094. const lines = current.original.toOffsetRange().slice(originalLines).map((l) => l.trim());
  11095. const originalText = lines.join("\n");
  11096. return originalText.length >= 15 && countWhere(lines, (l) => l.length >= 2) >= 2;
  11097. });
  11098. moves = removeMovesInSameDiff(changes, moves);
  11099. return moves;
  11100. }
  11101. function countWhere(arr, predicate) {
  11102. let count = 0;
  11103. for (const t of arr) {
  11104. if (predicate(t)) {
  11105. count++;
  11106. }
  11107. }
  11108. return count;
  11109. }
  11110. function computeMovesFromSimpleDeletionsToSimpleInsertions(changes, originalLines, modifiedLines, timeout) {
  11111. const moves = [];
  11112. const deletions = changes.filter((c) => c.modified.isEmpty && c.original.length >= 3).map((d) => new LineRangeFragment(d.original, originalLines, d));
  11113. const insertions = new Set(changes.filter((c) => c.original.isEmpty && c.modified.length >= 3).map((d) => new LineRangeFragment(d.modified, modifiedLines, d)));
  11114. const excludedChanges = /* @__PURE__ */ new Set();
  11115. for (const deletion of deletions) {
  11116. let highestSimilarity = -1;
  11117. let best;
  11118. for (const insertion of insertions) {
  11119. const similarity = deletion.computeSimilarity(insertion);
  11120. if (similarity > highestSimilarity) {
  11121. highestSimilarity = similarity;
  11122. best = insertion;
  11123. }
  11124. }
  11125. if (highestSimilarity > 0.9 && best) {
  11126. insertions.delete(best);
  11127. moves.push(new LineRangeMapping(deletion.range, best.range));
  11128. excludedChanges.add(deletion.source);
  11129. excludedChanges.add(best.source);
  11130. }
  11131. if (!timeout.isValid()) {
  11132. return { moves, excludedChanges };
  11133. }
  11134. }
  11135. return { moves, excludedChanges };
  11136. }
  11137. function computeUnchangedMoves(changes, hashedOriginalLines, hashedModifiedLines, originalLines, modifiedLines, timeout) {
  11138. const moves = [];
  11139. const original3LineHashes = new SetMap();
  11140. for (const change of changes) {
  11141. for (let i = change.original.startLineNumber; i < change.original.endLineNumberExclusive - 2; i++) {
  11142. const key = `${hashedOriginalLines[i - 1]}:${hashedOriginalLines[i + 1 - 1]}:${hashedOriginalLines[i + 2 - 1]}`;
  11143. original3LineHashes.add(key, { range: new LineRange(i, i + 3) });
  11144. }
  11145. }
  11146. const possibleMappings = [];
  11147. changes.sort(compareBy((c) => c.modified.startLineNumber, numberComparator));
  11148. for (const change of changes) {
  11149. let lastMappings = [];
  11150. for (let i = change.modified.startLineNumber; i < change.modified.endLineNumberExclusive - 2; i++) {
  11151. const key = `${hashedModifiedLines[i - 1]}:${hashedModifiedLines[i + 1 - 1]}:${hashedModifiedLines[i + 2 - 1]}`;
  11152. const currentModifiedRange = new LineRange(i, i + 3);
  11153. const nextMappings = [];
  11154. original3LineHashes.forEach(key, ({ range }) => {
  11155. for (const lastMapping of lastMappings) {
  11156. if (lastMapping.originalLineRange.endLineNumberExclusive + 1 === range.endLineNumberExclusive && lastMapping.modifiedLineRange.endLineNumberExclusive + 1 === currentModifiedRange.endLineNumberExclusive) {
  11157. lastMapping.originalLineRange = new LineRange(lastMapping.originalLineRange.startLineNumber, range.endLineNumberExclusive);
  11158. lastMapping.modifiedLineRange = new LineRange(lastMapping.modifiedLineRange.startLineNumber, currentModifiedRange.endLineNumberExclusive);
  11159. nextMappings.push(lastMapping);
  11160. return;
  11161. }
  11162. }
  11163. const mapping = {
  11164. modifiedLineRange: currentModifiedRange,
  11165. originalLineRange: range
  11166. };
  11167. possibleMappings.push(mapping);
  11168. nextMappings.push(mapping);
  11169. });
  11170. lastMappings = nextMappings;
  11171. }
  11172. if (!timeout.isValid()) {
  11173. return [];
  11174. }
  11175. }
  11176. possibleMappings.sort(reverseOrder(compareBy((m) => m.modifiedLineRange.length, numberComparator)));
  11177. const modifiedSet = new LineRangeSet();
  11178. const originalSet = new LineRangeSet();
  11179. for (const mapping of possibleMappings) {
  11180. const diffOrigToMod = mapping.modifiedLineRange.startLineNumber - mapping.originalLineRange.startLineNumber;
  11181. const modifiedSections = modifiedSet.subtractFrom(mapping.modifiedLineRange);
  11182. const originalTranslatedSections = originalSet.subtractFrom(mapping.originalLineRange).getWithDelta(diffOrigToMod);
  11183. const modifiedIntersectedSections = modifiedSections.getIntersection(originalTranslatedSections);
  11184. for (const s of modifiedIntersectedSections.ranges) {
  11185. if (s.length < 3) {
  11186. continue;
  11187. }
  11188. const modifiedLineRange = s;
  11189. const originalLineRange = s.delta(-diffOrigToMod);
  11190. moves.push(new LineRangeMapping(originalLineRange, modifiedLineRange));
  11191. modifiedSet.addRange(modifiedLineRange);
  11192. originalSet.addRange(originalLineRange);
  11193. }
  11194. }
  11195. moves.sort(compareBy((m) => m.original.startLineNumber, numberComparator));
  11196. const monotonousChanges = new MonotonousArray(changes);
  11197. for (let i = 0; i < moves.length; i++) {
  11198. const move = moves[i];
  11199. const firstTouchingChangeOrig = monotonousChanges.findLastMonotonous((c) => c.original.startLineNumber <= move.original.startLineNumber);
  11200. const firstTouchingChangeMod = findLastMonotonous(changes, (c) => c.modified.startLineNumber <= move.modified.startLineNumber);
  11201. const linesAbove = Math.max(move.original.startLineNumber - firstTouchingChangeOrig.original.startLineNumber, move.modified.startLineNumber - firstTouchingChangeMod.modified.startLineNumber);
  11202. const lastTouchingChangeOrig = monotonousChanges.findLastMonotonous((c) => c.original.startLineNumber < move.original.endLineNumberExclusive);
  11203. const lastTouchingChangeMod = findLastMonotonous(changes, (c) => c.modified.startLineNumber < move.modified.endLineNumberExclusive);
  11204. const linesBelow = Math.max(lastTouchingChangeOrig.original.endLineNumberExclusive - move.original.endLineNumberExclusive, lastTouchingChangeMod.modified.endLineNumberExclusive - move.modified.endLineNumberExclusive);
  11205. let extendToTop;
  11206. for (extendToTop = 0; extendToTop < linesAbove; extendToTop++) {
  11207. const origLine = move.original.startLineNumber - extendToTop - 1;
  11208. const modLine = move.modified.startLineNumber - extendToTop - 1;
  11209. if (origLine > originalLines.length || modLine > modifiedLines.length) {
  11210. break;
  11211. }
  11212. if (modifiedSet.contains(modLine) || originalSet.contains(origLine)) {
  11213. break;
  11214. }
  11215. if (!areLinesSimilar(originalLines[origLine - 1], modifiedLines[modLine - 1], timeout)) {
  11216. break;
  11217. }
  11218. }
  11219. if (extendToTop > 0) {
  11220. originalSet.addRange(new LineRange(move.original.startLineNumber - extendToTop, move.original.startLineNumber));
  11221. modifiedSet.addRange(new LineRange(move.modified.startLineNumber - extendToTop, move.modified.startLineNumber));
  11222. }
  11223. let extendToBottom;
  11224. for (extendToBottom = 0; extendToBottom < linesBelow; extendToBottom++) {
  11225. const origLine = move.original.endLineNumberExclusive + extendToBottom;
  11226. const modLine = move.modified.endLineNumberExclusive + extendToBottom;
  11227. if (origLine > originalLines.length || modLine > modifiedLines.length) {
  11228. break;
  11229. }
  11230. if (modifiedSet.contains(modLine) || originalSet.contains(origLine)) {
  11231. break;
  11232. }
  11233. if (!areLinesSimilar(originalLines[origLine - 1], modifiedLines[modLine - 1], timeout)) {
  11234. break;
  11235. }
  11236. }
  11237. if (extendToBottom > 0) {
  11238. originalSet.addRange(new LineRange(move.original.endLineNumberExclusive, move.original.endLineNumberExclusive + extendToBottom));
  11239. modifiedSet.addRange(new LineRange(move.modified.endLineNumberExclusive, move.modified.endLineNumberExclusive + extendToBottom));
  11240. }
  11241. if (extendToTop > 0 || extendToBottom > 0) {
  11242. moves[i] = new LineRangeMapping(new LineRange(move.original.startLineNumber - extendToTop, move.original.endLineNumberExclusive + extendToBottom), new LineRange(move.modified.startLineNumber - extendToTop, move.modified.endLineNumberExclusive + extendToBottom));
  11243. }
  11244. }
  11245. return moves;
  11246. }
  11247. function areLinesSimilar(line1, line2, timeout) {
  11248. if (line1.trim() === line2.trim()) {
  11249. return true;
  11250. }
  11251. if (line1.length > 300 && line2.length > 300) {
  11252. return false;
  11253. }
  11254. const myersDiffingAlgorithm = new MyersDiffAlgorithm();
  11255. const result = myersDiffingAlgorithm.compute(new LinesSliceCharSequence([line1], new Range(1, 1, 1, line1.length), false), new LinesSliceCharSequence([line2], new Range(1, 1, 1, line2.length), false), timeout);
  11256. let commonNonSpaceCharCount = 0;
  11257. const inverted = SequenceDiff.invert(result.diffs, line1.length);
  11258. for (const seq of inverted) {
  11259. seq.seq1Range.forEach((idx) => {
  11260. if (!isSpace(line1.charCodeAt(idx))) {
  11261. commonNonSpaceCharCount++;
  11262. }
  11263. });
  11264. }
  11265. function countNonWsChars(str) {
  11266. let count = 0;
  11267. for (let i = 0; i < line1.length; i++) {
  11268. if (!isSpace(str.charCodeAt(i))) {
  11269. count++;
  11270. }
  11271. }
  11272. return count;
  11273. }
  11274. const longerLineLength = countNonWsChars(line1.length > line2.length ? line1 : line2);
  11275. const r = commonNonSpaceCharCount / longerLineLength > 0.6 && longerLineLength > 10;
  11276. return r;
  11277. }
  11278. function joinCloseConsecutiveMoves(moves) {
  11279. if (moves.length === 0) {
  11280. return moves;
  11281. }
  11282. moves.sort(compareBy((m) => m.original.startLineNumber, numberComparator));
  11283. const result = [moves[0]];
  11284. for (let i = 1; i < moves.length; i++) {
  11285. const last = result[result.length - 1];
  11286. const current = moves[i];
  11287. const originalDist = current.original.startLineNumber - last.original.endLineNumberExclusive;
  11288. const modifiedDist = current.modified.startLineNumber - last.modified.endLineNumberExclusive;
  11289. const currentMoveAfterLast = originalDist >= 0 && modifiedDist >= 0;
  11290. if (currentMoveAfterLast && originalDist + modifiedDist <= 2) {
  11291. result[result.length - 1] = last.join(current);
  11292. continue;
  11293. }
  11294. result.push(current);
  11295. }
  11296. return result;
  11297. }
  11298. function removeMovesInSameDiff(changes, moves) {
  11299. const changesMonotonous = new MonotonousArray(changes);
  11300. moves = moves.filter((m) => {
  11301. const diffBeforeEndOfMoveOriginal = changesMonotonous.findLastMonotonous((c) => c.original.startLineNumber < m.original.endLineNumberExclusive) || new LineRangeMapping(new LineRange(1, 1), new LineRange(1, 1));
  11302. const diffBeforeEndOfMoveModified = findLastMonotonous(changes, (c) => c.modified.startLineNumber < m.modified.endLineNumberExclusive);
  11303. const differentDiffs = diffBeforeEndOfMoveOriginal !== diffBeforeEndOfMoveModified;
  11304. return differentDiffs;
  11305. });
  11306. return moves;
  11307. }
  11308. // node_modules/monaco-editor/esm/vs/editor/common/diff/defaultLinesDiffComputer/heuristicSequenceOptimizations.js
  11309. function optimizeSequenceDiffs(sequence1, sequence2, sequenceDiffs) {
  11310. let result = sequenceDiffs;
  11311. result = joinSequenceDiffsByShifting(sequence1, sequence2, result);
  11312. result = joinSequenceDiffsByShifting(sequence1, sequence2, result);
  11313. result = shiftSequenceDiffs(sequence1, sequence2, result);
  11314. return result;
  11315. }
  11316. function joinSequenceDiffsByShifting(sequence1, sequence2, sequenceDiffs) {
  11317. if (sequenceDiffs.length === 0) {
  11318. return sequenceDiffs;
  11319. }
  11320. const result = [];
  11321. result.push(sequenceDiffs[0]);
  11322. for (let i = 1; i < sequenceDiffs.length; i++) {
  11323. const prevResult = result[result.length - 1];
  11324. let cur = sequenceDiffs[i];
  11325. if (cur.seq1Range.isEmpty || cur.seq2Range.isEmpty) {
  11326. const length = cur.seq1Range.start - prevResult.seq1Range.endExclusive;
  11327. let d;
  11328. for (d = 1; d <= length; d++) {
  11329. if (sequence1.getElement(cur.seq1Range.start - d) !== sequence1.getElement(cur.seq1Range.endExclusive - d) || sequence2.getElement(cur.seq2Range.start - d) !== sequence2.getElement(cur.seq2Range.endExclusive - d)) {
  11330. break;
  11331. }
  11332. }
  11333. d--;
  11334. if (d === length) {
  11335. result[result.length - 1] = new SequenceDiff(new OffsetRange(prevResult.seq1Range.start, cur.seq1Range.endExclusive - length), new OffsetRange(prevResult.seq2Range.start, cur.seq2Range.endExclusive - length));
  11336. continue;
  11337. }
  11338. cur = cur.delta(-d);
  11339. }
  11340. result.push(cur);
  11341. }
  11342. const result2 = [];
  11343. for (let i = 0; i < result.length - 1; i++) {
  11344. const nextResult = result[i + 1];
  11345. let cur = result[i];
  11346. if (cur.seq1Range.isEmpty || cur.seq2Range.isEmpty) {
  11347. const length = nextResult.seq1Range.start - cur.seq1Range.endExclusive;
  11348. let d;
  11349. for (d = 0; d < length; d++) {
  11350. if (!sequence1.isStronglyEqual(cur.seq1Range.start + d, cur.seq1Range.endExclusive + d) || !sequence2.isStronglyEqual(cur.seq2Range.start + d, cur.seq2Range.endExclusive + d)) {
  11351. break;
  11352. }
  11353. }
  11354. if (d === length) {
  11355. result[i + 1] = new SequenceDiff(new OffsetRange(cur.seq1Range.start + length, nextResult.seq1Range.endExclusive), new OffsetRange(cur.seq2Range.start + length, nextResult.seq2Range.endExclusive));
  11356. continue;
  11357. }
  11358. if (d > 0) {
  11359. cur = cur.delta(d);
  11360. }
  11361. }
  11362. result2.push(cur);
  11363. }
  11364. if (result.length > 0) {
  11365. result2.push(result[result.length - 1]);
  11366. }
  11367. return result2;
  11368. }
  11369. function shiftSequenceDiffs(sequence1, sequence2, sequenceDiffs) {
  11370. if (!sequence1.getBoundaryScore || !sequence2.getBoundaryScore) {
  11371. return sequenceDiffs;
  11372. }
  11373. for (let i = 0; i < sequenceDiffs.length; i++) {
  11374. const prevDiff = i > 0 ? sequenceDiffs[i - 1] : void 0;
  11375. const diff = sequenceDiffs[i];
  11376. const nextDiff = i + 1 < sequenceDiffs.length ? sequenceDiffs[i + 1] : void 0;
  11377. const seq1ValidRange = new OffsetRange(prevDiff ? prevDiff.seq1Range.endExclusive + 1 : 0, nextDiff ? nextDiff.seq1Range.start - 1 : sequence1.length);
  11378. const seq2ValidRange = new OffsetRange(prevDiff ? prevDiff.seq2Range.endExclusive + 1 : 0, nextDiff ? nextDiff.seq2Range.start - 1 : sequence2.length);
  11379. if (diff.seq1Range.isEmpty) {
  11380. sequenceDiffs[i] = shiftDiffToBetterPosition(diff, sequence1, sequence2, seq1ValidRange, seq2ValidRange);
  11381. } else if (diff.seq2Range.isEmpty) {
  11382. sequenceDiffs[i] = shiftDiffToBetterPosition(diff.swap(), sequence2, sequence1, seq2ValidRange, seq1ValidRange).swap();
  11383. }
  11384. }
  11385. return sequenceDiffs;
  11386. }
  11387. function shiftDiffToBetterPosition(diff, sequence1, sequence2, seq1ValidRange, seq2ValidRange) {
  11388. const maxShiftLimit = 100;
  11389. let deltaBefore = 1;
  11390. while (diff.seq1Range.start - deltaBefore >= seq1ValidRange.start && diff.seq2Range.start - deltaBefore >= seq2ValidRange.start && sequence2.isStronglyEqual(diff.seq2Range.start - deltaBefore, diff.seq2Range.endExclusive - deltaBefore) && deltaBefore < maxShiftLimit) {
  11391. deltaBefore++;
  11392. }
  11393. deltaBefore--;
  11394. let deltaAfter = 0;
  11395. while (diff.seq1Range.start + deltaAfter < seq1ValidRange.endExclusive && diff.seq2Range.endExclusive + deltaAfter < seq2ValidRange.endExclusive && sequence2.isStronglyEqual(diff.seq2Range.start + deltaAfter, diff.seq2Range.endExclusive + deltaAfter) && deltaAfter < maxShiftLimit) {
  11396. deltaAfter++;
  11397. }
  11398. if (deltaBefore === 0 && deltaAfter === 0) {
  11399. return diff;
  11400. }
  11401. let bestDelta = 0;
  11402. let bestScore = -1;
  11403. for (let delta = -deltaBefore; delta <= deltaAfter; delta++) {
  11404. const seq2OffsetStart = diff.seq2Range.start + delta;
  11405. const seq2OffsetEndExclusive = diff.seq2Range.endExclusive + delta;
  11406. const seq1Offset = diff.seq1Range.start + delta;
  11407. const score2 = sequence1.getBoundaryScore(seq1Offset) + sequence2.getBoundaryScore(seq2OffsetStart) + sequence2.getBoundaryScore(seq2OffsetEndExclusive);
  11408. if (score2 > bestScore) {
  11409. bestScore = score2;
  11410. bestDelta = delta;
  11411. }
  11412. }
  11413. return diff.delta(bestDelta);
  11414. }
  11415. function removeShortMatches(sequence1, sequence2, sequenceDiffs) {
  11416. const result = [];
  11417. for (const s of sequenceDiffs) {
  11418. const last = result[result.length - 1];
  11419. if (!last) {
  11420. result.push(s);
  11421. continue;
  11422. }
  11423. if (s.seq1Range.start - last.seq1Range.endExclusive <= 2 || s.seq2Range.start - last.seq2Range.endExclusive <= 2) {
  11424. result[result.length - 1] = new SequenceDiff(last.seq1Range.join(s.seq1Range), last.seq2Range.join(s.seq2Range));
  11425. } else {
  11426. result.push(s);
  11427. }
  11428. }
  11429. return result;
  11430. }
  11431. function extendDiffsToEntireWordIfAppropriate(sequence1, sequence2, sequenceDiffs) {
  11432. const equalMappings = SequenceDiff.invert(sequenceDiffs, sequence1.length);
  11433. const additional = [];
  11434. let lastPoint = new OffsetPair(0, 0);
  11435. function scanWord(pair, equalMapping) {
  11436. if (pair.offset1 < lastPoint.offset1 || pair.offset2 < lastPoint.offset2) {
  11437. return;
  11438. }
  11439. const w1 = sequence1.findWordContaining(pair.offset1);
  11440. const w2 = sequence2.findWordContaining(pair.offset2);
  11441. if (!w1 || !w2) {
  11442. return;
  11443. }
  11444. let w = new SequenceDiff(w1, w2);
  11445. const equalPart = w.intersect(equalMapping);
  11446. let equalChars1 = equalPart.seq1Range.length;
  11447. let equalChars2 = equalPart.seq2Range.length;
  11448. while (equalMappings.length > 0) {
  11449. const next = equalMappings[0];
  11450. const intersects = next.seq1Range.intersects(w.seq1Range) || next.seq2Range.intersects(w.seq2Range);
  11451. if (!intersects) {
  11452. break;
  11453. }
  11454. const v1 = sequence1.findWordContaining(next.seq1Range.start);
  11455. const v2 = sequence2.findWordContaining(next.seq2Range.start);
  11456. const v = new SequenceDiff(v1, v2);
  11457. const equalPart2 = v.intersect(next);
  11458. equalChars1 += equalPart2.seq1Range.length;
  11459. equalChars2 += equalPart2.seq2Range.length;
  11460. w = w.join(v);
  11461. if (w.seq1Range.endExclusive >= next.seq1Range.endExclusive) {
  11462. equalMappings.shift();
  11463. } else {
  11464. break;
  11465. }
  11466. }
  11467. if (equalChars1 + equalChars2 < (w.seq1Range.length + w.seq2Range.length) * 2 / 3) {
  11468. additional.push(w);
  11469. }
  11470. lastPoint = w.getEndExclusives();
  11471. }
  11472. while (equalMappings.length > 0) {
  11473. const next = equalMappings.shift();
  11474. if (next.seq1Range.isEmpty) {
  11475. continue;
  11476. }
  11477. scanWord(next.getStarts(), next);
  11478. scanWord(next.getEndExclusives().delta(-1), next);
  11479. }
  11480. const merged = mergeSequenceDiffs(sequenceDiffs, additional);
  11481. return merged;
  11482. }
  11483. function mergeSequenceDiffs(sequenceDiffs1, sequenceDiffs2) {
  11484. const result = [];
  11485. while (sequenceDiffs1.length > 0 || sequenceDiffs2.length > 0) {
  11486. const sd1 = sequenceDiffs1[0];
  11487. const sd2 = sequenceDiffs2[0];
  11488. let next;
  11489. if (sd1 && (!sd2 || sd1.seq1Range.start < sd2.seq1Range.start)) {
  11490. next = sequenceDiffs1.shift();
  11491. } else {
  11492. next = sequenceDiffs2.shift();
  11493. }
  11494. if (result.length > 0 && result[result.length - 1].seq1Range.endExclusive >= next.seq1Range.start) {
  11495. result[result.length - 1] = result[result.length - 1].join(next);
  11496. } else {
  11497. result.push(next);
  11498. }
  11499. }
  11500. return result;
  11501. }
  11502. function removeVeryShortMatchingLinesBetweenDiffs(sequence1, _sequence2, sequenceDiffs) {
  11503. let diffs = sequenceDiffs;
  11504. if (diffs.length === 0) {
  11505. return diffs;
  11506. }
  11507. let counter = 0;
  11508. let shouldRepeat;
  11509. do {
  11510. shouldRepeat = false;
  11511. const result = [
  11512. diffs[0]
  11513. ];
  11514. for (let i = 1; i < diffs.length; i++) {
  11515. let shouldJoinDiffs = function(before, after) {
  11516. const unchangedRange = new OffsetRange(lastResult.seq1Range.endExclusive, cur.seq1Range.start);
  11517. const unchangedText = sequence1.getText(unchangedRange);
  11518. const unchangedTextWithoutWs = unchangedText.replace(/\s/g, "");
  11519. if (unchangedTextWithoutWs.length <= 4 && (before.seq1Range.length + before.seq2Range.length > 5 || after.seq1Range.length + after.seq2Range.length > 5)) {
  11520. return true;
  11521. }
  11522. return false;
  11523. };
  11524. const cur = diffs[i];
  11525. const lastResult = result[result.length - 1];
  11526. const shouldJoin = shouldJoinDiffs(lastResult, cur);
  11527. if (shouldJoin) {
  11528. shouldRepeat = true;
  11529. result[result.length - 1] = result[result.length - 1].join(cur);
  11530. } else {
  11531. result.push(cur);
  11532. }
  11533. }
  11534. diffs = result;
  11535. } while (counter++ < 10 && shouldRepeat);
  11536. return diffs;
  11537. }
  11538. function removeVeryShortMatchingTextBetweenLongDiffs(sequence1, sequence2, sequenceDiffs) {
  11539. let diffs = sequenceDiffs;
  11540. if (diffs.length === 0) {
  11541. return diffs;
  11542. }
  11543. let counter = 0;
  11544. let shouldRepeat;
  11545. do {
  11546. shouldRepeat = false;
  11547. const result = [
  11548. diffs[0]
  11549. ];
  11550. for (let i = 1; i < diffs.length; i++) {
  11551. let shouldJoinDiffs = function(before, after) {
  11552. const unchangedRange = new OffsetRange(lastResult.seq1Range.endExclusive, cur.seq1Range.start);
  11553. const unchangedLineCount = sequence1.countLinesIn(unchangedRange);
  11554. if (unchangedLineCount > 5 || unchangedRange.length > 500) {
  11555. return false;
  11556. }
  11557. const unchangedText = sequence1.getText(unchangedRange).trim();
  11558. if (unchangedText.length > 20 || unchangedText.split(/\r\n|\r|\n/).length > 1) {
  11559. return false;
  11560. }
  11561. const beforeLineCount1 = sequence1.countLinesIn(before.seq1Range);
  11562. const beforeSeq1Length = before.seq1Range.length;
  11563. const beforeLineCount2 = sequence2.countLinesIn(before.seq2Range);
  11564. const beforeSeq2Length = before.seq2Range.length;
  11565. const afterLineCount1 = sequence1.countLinesIn(after.seq1Range);
  11566. const afterSeq1Length = after.seq1Range.length;
  11567. const afterLineCount2 = sequence2.countLinesIn(after.seq2Range);
  11568. const afterSeq2Length = after.seq2Range.length;
  11569. const max = 2 * 40 + 50;
  11570. function cap(v) {
  11571. return Math.min(v, max);
  11572. }
  11573. if (Math.pow(Math.pow(cap(beforeLineCount1 * 40 + beforeSeq1Length), 1.5) + Math.pow(cap(beforeLineCount2 * 40 + beforeSeq2Length), 1.5), 1.5) + Math.pow(Math.pow(cap(afterLineCount1 * 40 + afterSeq1Length), 1.5) + Math.pow(cap(afterLineCount2 * 40 + afterSeq2Length), 1.5), 1.5) > (max ** 1.5) ** 1.5 * 1.3) {
  11574. return true;
  11575. }
  11576. return false;
  11577. };
  11578. const cur = diffs[i];
  11579. const lastResult = result[result.length - 1];
  11580. const shouldJoin = shouldJoinDiffs(lastResult, cur);
  11581. if (shouldJoin) {
  11582. shouldRepeat = true;
  11583. result[result.length - 1] = result[result.length - 1].join(cur);
  11584. } else {
  11585. result.push(cur);
  11586. }
  11587. }
  11588. diffs = result;
  11589. } while (counter++ < 10 && shouldRepeat);
  11590. const newDiffs = [];
  11591. forEachWithNeighbors(diffs, (prev, cur, next) => {
  11592. let newDiff = cur;
  11593. function shouldMarkAsChanged(text) {
  11594. return text.length > 0 && text.trim().length <= 3 && cur.seq1Range.length + cur.seq2Range.length > 100;
  11595. }
  11596. const fullRange1 = sequence1.extendToFullLines(cur.seq1Range);
  11597. const prefix = sequence1.getText(new OffsetRange(fullRange1.start, cur.seq1Range.start));
  11598. if (shouldMarkAsChanged(prefix)) {
  11599. newDiff = newDiff.deltaStart(-prefix.length);
  11600. }
  11601. const suffix = sequence1.getText(new OffsetRange(cur.seq1Range.endExclusive, fullRange1.endExclusive));
  11602. if (shouldMarkAsChanged(suffix)) {
  11603. newDiff = newDiff.deltaEnd(suffix.length);
  11604. }
  11605. const availableSpace = SequenceDiff.fromOffsetPairs(prev ? prev.getEndExclusives() : OffsetPair.zero, next ? next.getStarts() : OffsetPair.max);
  11606. const result = newDiff.intersect(availableSpace);
  11607. if (newDiffs.length > 0 && result.getStarts().equals(newDiffs[newDiffs.length - 1].getEndExclusives())) {
  11608. newDiffs[newDiffs.length - 1] = newDiffs[newDiffs.length - 1].join(result);
  11609. } else {
  11610. newDiffs.push(result);
  11611. }
  11612. });
  11613. return newDiffs;
  11614. }
  11615. // node_modules/monaco-editor/esm/vs/editor/common/diff/defaultLinesDiffComputer/lineSequence.js
  11616. var LineSequence2 = class {
  11617. constructor(trimmedHash, lines) {
  11618. this.trimmedHash = trimmedHash;
  11619. this.lines = lines;
  11620. }
  11621. getElement(offset) {
  11622. return this.trimmedHash[offset];
  11623. }
  11624. get length() {
  11625. return this.trimmedHash.length;
  11626. }
  11627. getBoundaryScore(length) {
  11628. const indentationBefore = length === 0 ? 0 : getIndentation(this.lines[length - 1]);
  11629. const indentationAfter = length === this.lines.length ? 0 : getIndentation(this.lines[length]);
  11630. return 1e3 - (indentationBefore + indentationAfter);
  11631. }
  11632. getText(range) {
  11633. return this.lines.slice(range.start, range.endExclusive).join("\n");
  11634. }
  11635. isStronglyEqual(offset1, offset2) {
  11636. return this.lines[offset1] === this.lines[offset2];
  11637. }
  11638. };
  11639. function getIndentation(str) {
  11640. let i = 0;
  11641. while (i < str.length && (str.charCodeAt(i) === 32 || str.charCodeAt(i) === 9)) {
  11642. i++;
  11643. }
  11644. return i;
  11645. }
  11646. // node_modules/monaco-editor/esm/vs/editor/common/diff/defaultLinesDiffComputer/defaultLinesDiffComputer.js
  11647. var DefaultLinesDiffComputer = class {
  11648. constructor() {
  11649. this.dynamicProgrammingDiffing = new DynamicProgrammingDiffing();
  11650. this.myersDiffingAlgorithm = new MyersDiffAlgorithm();
  11651. }
  11652. computeDiff(originalLines, modifiedLines, options) {
  11653. if (originalLines.length <= 1 && equals2(originalLines, modifiedLines, (a, b) => a === b)) {
  11654. return new LinesDiff([], [], false);
  11655. }
  11656. if (originalLines.length === 1 && originalLines[0].length === 0 || modifiedLines.length === 1 && modifiedLines[0].length === 0) {
  11657. return new LinesDiff([
  11658. new DetailedLineRangeMapping(new LineRange(1, originalLines.length + 1), new LineRange(1, modifiedLines.length + 1), [
  11659. new RangeMapping(new Range(1, 1, originalLines.length, originalLines[originalLines.length - 1].length + 1), new Range(1, 1, modifiedLines.length, modifiedLines[modifiedLines.length - 1].length + 1))
  11660. ])
  11661. ], [], false);
  11662. }
  11663. const timeout = options.maxComputationTimeMs === 0 ? InfiniteTimeout.instance : new DateTimeout(options.maxComputationTimeMs);
  11664. const considerWhitespaceChanges = !options.ignoreTrimWhitespace;
  11665. const perfectHashes = /* @__PURE__ */ new Map();
  11666. function getOrCreateHash(text) {
  11667. let hash = perfectHashes.get(text);
  11668. if (hash === void 0) {
  11669. hash = perfectHashes.size;
  11670. perfectHashes.set(text, hash);
  11671. }
  11672. return hash;
  11673. }
  11674. const originalLinesHashes = originalLines.map((l) => getOrCreateHash(l.trim()));
  11675. const modifiedLinesHashes = modifiedLines.map((l) => getOrCreateHash(l.trim()));
  11676. const sequence1 = new LineSequence2(originalLinesHashes, originalLines);
  11677. const sequence2 = new LineSequence2(modifiedLinesHashes, modifiedLines);
  11678. const lineAlignmentResult = (() => {
  11679. if (sequence1.length + sequence2.length < 1700) {
  11680. return this.dynamicProgrammingDiffing.compute(sequence1, sequence2, timeout, (offset1, offset2) => originalLines[offset1] === modifiedLines[offset2] ? modifiedLines[offset2].length === 0 ? 0.1 : 1 + Math.log(1 + modifiedLines[offset2].length) : 0.99);
  11681. }
  11682. return this.myersDiffingAlgorithm.compute(sequence1, sequence2, timeout);
  11683. })();
  11684. let lineAlignments = lineAlignmentResult.diffs;
  11685. let hitTimeout = lineAlignmentResult.hitTimeout;
  11686. lineAlignments = optimizeSequenceDiffs(sequence1, sequence2, lineAlignments);
  11687. lineAlignments = removeVeryShortMatchingLinesBetweenDiffs(sequence1, sequence2, lineAlignments);
  11688. const alignments = [];
  11689. const scanForWhitespaceChanges = (equalLinesCount) => {
  11690. if (!considerWhitespaceChanges) {
  11691. return;
  11692. }
  11693. for (let i = 0; i < equalLinesCount; i++) {
  11694. const seq1Offset = seq1LastStart + i;
  11695. const seq2Offset = seq2LastStart + i;
  11696. if (originalLines[seq1Offset] !== modifiedLines[seq2Offset]) {
  11697. const characterDiffs = this.refineDiff(originalLines, modifiedLines, new SequenceDiff(new OffsetRange(seq1Offset, seq1Offset + 1), new OffsetRange(seq2Offset, seq2Offset + 1)), timeout, considerWhitespaceChanges);
  11698. for (const a of characterDiffs.mappings) {
  11699. alignments.push(a);
  11700. }
  11701. if (characterDiffs.hitTimeout) {
  11702. hitTimeout = true;
  11703. }
  11704. }
  11705. }
  11706. };
  11707. let seq1LastStart = 0;
  11708. let seq2LastStart = 0;
  11709. for (const diff of lineAlignments) {
  11710. assertFn(() => diff.seq1Range.start - seq1LastStart === diff.seq2Range.start - seq2LastStart);
  11711. const equalLinesCount = diff.seq1Range.start - seq1LastStart;
  11712. scanForWhitespaceChanges(equalLinesCount);
  11713. seq1LastStart = diff.seq1Range.endExclusive;
  11714. seq2LastStart = diff.seq2Range.endExclusive;
  11715. const characterDiffs = this.refineDiff(originalLines, modifiedLines, diff, timeout, considerWhitespaceChanges);
  11716. if (characterDiffs.hitTimeout) {
  11717. hitTimeout = true;
  11718. }
  11719. for (const a of characterDiffs.mappings) {
  11720. alignments.push(a);
  11721. }
  11722. }
  11723. scanForWhitespaceChanges(originalLines.length - seq1LastStart);
  11724. const changes = lineRangeMappingFromRangeMappings(alignments, originalLines, modifiedLines);
  11725. let moves = [];
  11726. if (options.computeMoves) {
  11727. moves = this.computeMoves(changes, originalLines, modifiedLines, originalLinesHashes, modifiedLinesHashes, timeout, considerWhitespaceChanges);
  11728. }
  11729. assertFn(() => {
  11730. function validatePosition(pos, lines) {
  11731. if (pos.lineNumber < 1 || pos.lineNumber > lines.length) {
  11732. return false;
  11733. }
  11734. const line = lines[pos.lineNumber - 1];
  11735. if (pos.column < 1 || pos.column > line.length + 1) {
  11736. return false;
  11737. }
  11738. return true;
  11739. }
  11740. function validateRange(range, lines) {
  11741. if (range.startLineNumber < 1 || range.startLineNumber > lines.length + 1) {
  11742. return false;
  11743. }
  11744. if (range.endLineNumberExclusive < 1 || range.endLineNumberExclusive > lines.length + 1) {
  11745. return false;
  11746. }
  11747. return true;
  11748. }
  11749. for (const c of changes) {
  11750. if (!c.innerChanges) {
  11751. return false;
  11752. }
  11753. for (const ic of c.innerChanges) {
  11754. const valid = validatePosition(ic.modifiedRange.getStartPosition(), modifiedLines) && validatePosition(ic.modifiedRange.getEndPosition(), modifiedLines) && validatePosition(ic.originalRange.getStartPosition(), originalLines) && validatePosition(ic.originalRange.getEndPosition(), originalLines);
  11755. if (!valid) {
  11756. return false;
  11757. }
  11758. }
  11759. if (!validateRange(c.modified, modifiedLines) || !validateRange(c.original, originalLines)) {
  11760. return false;
  11761. }
  11762. }
  11763. return true;
  11764. });
  11765. return new LinesDiff(changes, moves, hitTimeout);
  11766. }
  11767. computeMoves(changes, originalLines, modifiedLines, hashedOriginalLines, hashedModifiedLines, timeout, considerWhitespaceChanges) {
  11768. const moves = computeMovedLines(changes, originalLines, modifiedLines, hashedOriginalLines, hashedModifiedLines, timeout);
  11769. const movesWithDiffs = moves.map((m) => {
  11770. const moveChanges = this.refineDiff(originalLines, modifiedLines, new SequenceDiff(m.original.toOffsetRange(), m.modified.toOffsetRange()), timeout, considerWhitespaceChanges);
  11771. const mappings = lineRangeMappingFromRangeMappings(moveChanges.mappings, originalLines, modifiedLines, true);
  11772. return new MovedText(m, mappings);
  11773. });
  11774. return movesWithDiffs;
  11775. }
  11776. refineDiff(originalLines, modifiedLines, diff, timeout, considerWhitespaceChanges) {
  11777. const lineRangeMapping = toLineRangeMapping(diff);
  11778. const rangeMapping = lineRangeMapping.toRangeMapping2(originalLines, modifiedLines);
  11779. const slice1 = new LinesSliceCharSequence(originalLines, rangeMapping.originalRange, considerWhitespaceChanges);
  11780. const slice2 = new LinesSliceCharSequence(modifiedLines, rangeMapping.modifiedRange, considerWhitespaceChanges);
  11781. const diffResult = slice1.length + slice2.length < 500 ? this.dynamicProgrammingDiffing.compute(slice1, slice2, timeout) : this.myersDiffingAlgorithm.compute(slice1, slice2, timeout);
  11782. const check = false;
  11783. let diffs = diffResult.diffs;
  11784. if (check) {
  11785. SequenceDiff.assertSorted(diffs);
  11786. }
  11787. diffs = optimizeSequenceDiffs(slice1, slice2, diffs);
  11788. if (check) {
  11789. SequenceDiff.assertSorted(diffs);
  11790. }
  11791. diffs = extendDiffsToEntireWordIfAppropriate(slice1, slice2, diffs);
  11792. if (check) {
  11793. SequenceDiff.assertSorted(diffs);
  11794. }
  11795. diffs = removeShortMatches(slice1, slice2, diffs);
  11796. if (check) {
  11797. SequenceDiff.assertSorted(diffs);
  11798. }
  11799. diffs = removeVeryShortMatchingTextBetweenLongDiffs(slice1, slice2, diffs);
  11800. if (check) {
  11801. SequenceDiff.assertSorted(diffs);
  11802. }
  11803. const result = diffs.map((d) => new RangeMapping(slice1.translateRange(d.seq1Range), slice2.translateRange(d.seq2Range)));
  11804. if (check) {
  11805. RangeMapping.assertSorted(result);
  11806. }
  11807. return {
  11808. mappings: result,
  11809. hitTimeout: diffResult.hitTimeout
  11810. };
  11811. }
  11812. };
  11813. function lineRangeMappingFromRangeMappings(alignments, originalLines, modifiedLines, dontAssertStartLine = false) {
  11814. const changes = [];
  11815. for (const g of groupAdjacentBy(alignments.map((a) => getLineRangeMapping(a, originalLines, modifiedLines)), (a1, a2) => a1.original.overlapOrTouch(a2.original) || a1.modified.overlapOrTouch(a2.modified))) {
  11816. const first = g[0];
  11817. const last = g[g.length - 1];
  11818. changes.push(new DetailedLineRangeMapping(first.original.join(last.original), first.modified.join(last.modified), g.map((a) => a.innerChanges[0])));
  11819. }
  11820. assertFn(() => {
  11821. if (!dontAssertStartLine && changes.length > 0) {
  11822. if (changes[0].modified.startLineNumber !== changes[0].original.startLineNumber) {
  11823. return false;
  11824. }
  11825. if (modifiedLines.length - changes[changes.length - 1].modified.endLineNumberExclusive !== originalLines.length - changes[changes.length - 1].original.endLineNumberExclusive) {
  11826. return false;
  11827. }
  11828. }
  11829. return checkAdjacentItems(changes, (m1, m2) => m2.original.startLineNumber - m1.original.endLineNumberExclusive === m2.modified.startLineNumber - m1.modified.endLineNumberExclusive && // There has to be an unchanged line in between (otherwise both diffs should have been joined)
  11830. m1.original.endLineNumberExclusive < m2.original.startLineNumber && m1.modified.endLineNumberExclusive < m2.modified.startLineNumber);
  11831. });
  11832. return changes;
  11833. }
  11834. function getLineRangeMapping(rangeMapping, originalLines, modifiedLines) {
  11835. let lineStartDelta = 0;
  11836. let lineEndDelta = 0;
  11837. if (rangeMapping.modifiedRange.endColumn === 1 && rangeMapping.originalRange.endColumn === 1 && rangeMapping.originalRange.startLineNumber + lineStartDelta <= rangeMapping.originalRange.endLineNumber && rangeMapping.modifiedRange.startLineNumber + lineStartDelta <= rangeMapping.modifiedRange.endLineNumber) {
  11838. lineEndDelta = -1;
  11839. }
  11840. if (rangeMapping.modifiedRange.startColumn - 1 >= modifiedLines[rangeMapping.modifiedRange.startLineNumber - 1].length && rangeMapping.originalRange.startColumn - 1 >= originalLines[rangeMapping.originalRange.startLineNumber - 1].length && rangeMapping.originalRange.startLineNumber <= rangeMapping.originalRange.endLineNumber + lineEndDelta && rangeMapping.modifiedRange.startLineNumber <= rangeMapping.modifiedRange.endLineNumber + lineEndDelta) {
  11841. lineStartDelta = 1;
  11842. }
  11843. const originalLineRange = new LineRange(rangeMapping.originalRange.startLineNumber + lineStartDelta, rangeMapping.originalRange.endLineNumber + 1 + lineEndDelta);
  11844. const modifiedLineRange = new LineRange(rangeMapping.modifiedRange.startLineNumber + lineStartDelta, rangeMapping.modifiedRange.endLineNumber + 1 + lineEndDelta);
  11845. return new DetailedLineRangeMapping(originalLineRange, modifiedLineRange, [rangeMapping]);
  11846. }
  11847. function toLineRangeMapping(sequenceDiff) {
  11848. return new LineRangeMapping(new LineRange(sequenceDiff.seq1Range.start + 1, sequenceDiff.seq1Range.endExclusive + 1), new LineRange(sequenceDiff.seq2Range.start + 1, sequenceDiff.seq2Range.endExclusive + 1));
  11849. }
  11850. // node_modules/monaco-editor/esm/vs/editor/common/diff/linesDiffComputers.js
  11851. var linesDiffComputers = {
  11852. getLegacy: () => new LegacyLinesDiffComputer(),
  11853. getDefault: () => new DefaultLinesDiffComputer()
  11854. };
  11855. // node_modules/monaco-editor/esm/vs/base/common/color.js
  11856. function roundFloat(number, decimalPoints) {
  11857. const decimal = Math.pow(10, decimalPoints);
  11858. return Math.round(number * decimal) / decimal;
  11859. }
  11860. var RGBA = class {
  11861. constructor(r, g, b, a = 1) {
  11862. this._rgbaBrand = void 0;
  11863. this.r = Math.min(255, Math.max(0, r)) | 0;
  11864. this.g = Math.min(255, Math.max(0, g)) | 0;
  11865. this.b = Math.min(255, Math.max(0, b)) | 0;
  11866. this.a = roundFloat(Math.max(Math.min(1, a), 0), 3);
  11867. }
  11868. static equals(a, b) {
  11869. return a.r === b.r && a.g === b.g && a.b === b.b && a.a === b.a;
  11870. }
  11871. };
  11872. var HSLA = class _HSLA {
  11873. constructor(h, s, l, a) {
  11874. this._hslaBrand = void 0;
  11875. this.h = Math.max(Math.min(360, h), 0) | 0;
  11876. this.s = roundFloat(Math.max(Math.min(1, s), 0), 3);
  11877. this.l = roundFloat(Math.max(Math.min(1, l), 0), 3);
  11878. this.a = roundFloat(Math.max(Math.min(1, a), 0), 3);
  11879. }
  11880. static equals(a, b) {
  11881. return a.h === b.h && a.s === b.s && a.l === b.l && a.a === b.a;
  11882. }
  11883. /**
  11884. * Converts an RGB color value to HSL. Conversion formula
  11885. * adapted from http://en.wikipedia.org/wiki/HSL_color_space.
  11886. * Assumes r, g, and b are contained in the set [0, 255] and
  11887. * returns h in the set [0, 360], s, and l in the set [0, 1].
  11888. */
  11889. static fromRGBA(rgba) {
  11890. const r = rgba.r / 255;
  11891. const g = rgba.g / 255;
  11892. const b = rgba.b / 255;
  11893. const a = rgba.a;
  11894. const max = Math.max(r, g, b);
  11895. const min = Math.min(r, g, b);
  11896. let h = 0;
  11897. let s = 0;
  11898. const l = (min + max) / 2;
  11899. const chroma = max - min;
  11900. if (chroma > 0) {
  11901. s = Math.min(l <= 0.5 ? chroma / (2 * l) : chroma / (2 - 2 * l), 1);
  11902. switch (max) {
  11903. case r:
  11904. h = (g - b) / chroma + (g < b ? 6 : 0);
  11905. break;
  11906. case g:
  11907. h = (b - r) / chroma + 2;
  11908. break;
  11909. case b:
  11910. h = (r - g) / chroma + 4;
  11911. break;
  11912. }
  11913. h *= 60;
  11914. h = Math.round(h);
  11915. }
  11916. return new _HSLA(h, s, l, a);
  11917. }
  11918. static _hue2rgb(p, q, t) {
  11919. if (t < 0) {
  11920. t += 1;
  11921. }
  11922. if (t > 1) {
  11923. t -= 1;
  11924. }
  11925. if (t < 1 / 6) {
  11926. return p + (q - p) * 6 * t;
  11927. }
  11928. if (t < 1 / 2) {
  11929. return q;
  11930. }
  11931. if (t < 2 / 3) {
  11932. return p + (q - p) * (2 / 3 - t) * 6;
  11933. }
  11934. return p;
  11935. }
  11936. /**
  11937. * Converts an HSL color value to RGB. Conversion formula
  11938. * adapted from http://en.wikipedia.org/wiki/HSL_color_space.
  11939. * Assumes h in the set [0, 360] s, and l are contained in the set [0, 1] and
  11940. * returns r, g, and b in the set [0, 255].
  11941. */
  11942. static toRGBA(hsla) {
  11943. const h = hsla.h / 360;
  11944. const { s, l, a } = hsla;
  11945. let r, g, b;
  11946. if (s === 0) {
  11947. r = g = b = l;
  11948. } else {
  11949. const q = l < 0.5 ? l * (1 + s) : l + s - l * s;
  11950. const p = 2 * l - q;
  11951. r = _HSLA._hue2rgb(p, q, h + 1 / 3);
  11952. g = _HSLA._hue2rgb(p, q, h);
  11953. b = _HSLA._hue2rgb(p, q, h - 1 / 3);
  11954. }
  11955. return new RGBA(Math.round(r * 255), Math.round(g * 255), Math.round(b * 255), a);
  11956. }
  11957. };
  11958. var HSVA = class _HSVA {
  11959. constructor(h, s, v, a) {
  11960. this._hsvaBrand = void 0;
  11961. this.h = Math.max(Math.min(360, h), 0) | 0;
  11962. this.s = roundFloat(Math.max(Math.min(1, s), 0), 3);
  11963. this.v = roundFloat(Math.max(Math.min(1, v), 0), 3);
  11964. this.a = roundFloat(Math.max(Math.min(1, a), 0), 3);
  11965. }
  11966. static equals(a, b) {
  11967. return a.h === b.h && a.s === b.s && a.v === b.v && a.a === b.a;
  11968. }
  11969. // from http://www.rapidtables.com/convert/color/rgb-to-hsv.htm
  11970. static fromRGBA(rgba) {
  11971. const r = rgba.r / 255;
  11972. const g = rgba.g / 255;
  11973. const b = rgba.b / 255;
  11974. const cmax = Math.max(r, g, b);
  11975. const cmin = Math.min(r, g, b);
  11976. const delta = cmax - cmin;
  11977. const s = cmax === 0 ? 0 : delta / cmax;
  11978. let m;
  11979. if (delta === 0) {
  11980. m = 0;
  11981. } else if (cmax === r) {
  11982. m = ((g - b) / delta % 6 + 6) % 6;
  11983. } else if (cmax === g) {
  11984. m = (b - r) / delta + 2;
  11985. } else {
  11986. m = (r - g) / delta + 4;
  11987. }
  11988. return new _HSVA(Math.round(m * 60), s, cmax, rgba.a);
  11989. }
  11990. // from http://www.rapidtables.com/convert/color/hsv-to-rgb.htm
  11991. static toRGBA(hsva) {
  11992. const { h, s, v, a } = hsva;
  11993. const c = v * s;
  11994. const x = c * (1 - Math.abs(h / 60 % 2 - 1));
  11995. const m = v - c;
  11996. let [r, g, b] = [0, 0, 0];
  11997. if (h < 60) {
  11998. r = c;
  11999. g = x;
  12000. } else if (h < 120) {
  12001. r = x;
  12002. g = c;
  12003. } else if (h < 180) {
  12004. g = c;
  12005. b = x;
  12006. } else if (h < 240) {
  12007. g = x;
  12008. b = c;
  12009. } else if (h < 300) {
  12010. r = x;
  12011. b = c;
  12012. } else if (h <= 360) {
  12013. r = c;
  12014. b = x;
  12015. }
  12016. r = Math.round((r + m) * 255);
  12017. g = Math.round((g + m) * 255);
  12018. b = Math.round((b + m) * 255);
  12019. return new RGBA(r, g, b, a);
  12020. }
  12021. };
  12022. var Color = class _Color {
  12023. static fromHex(hex) {
  12024. return _Color.Format.CSS.parseHex(hex) || _Color.red;
  12025. }
  12026. static equals(a, b) {
  12027. if (!a && !b) {
  12028. return true;
  12029. }
  12030. if (!a || !b) {
  12031. return false;
  12032. }
  12033. return a.equals(b);
  12034. }
  12035. get hsla() {
  12036. if (this._hsla) {
  12037. return this._hsla;
  12038. } else {
  12039. return HSLA.fromRGBA(this.rgba);
  12040. }
  12041. }
  12042. get hsva() {
  12043. if (this._hsva) {
  12044. return this._hsva;
  12045. }
  12046. return HSVA.fromRGBA(this.rgba);
  12047. }
  12048. constructor(arg) {
  12049. if (!arg) {
  12050. throw new Error("Color needs a value");
  12051. } else if (arg instanceof RGBA) {
  12052. this.rgba = arg;
  12053. } else if (arg instanceof HSLA) {
  12054. this._hsla = arg;
  12055. this.rgba = HSLA.toRGBA(arg);
  12056. } else if (arg instanceof HSVA) {
  12057. this._hsva = arg;
  12058. this.rgba = HSVA.toRGBA(arg);
  12059. } else {
  12060. throw new Error("Invalid color ctor argument");
  12061. }
  12062. }
  12063. equals(other) {
  12064. return !!other && RGBA.equals(this.rgba, other.rgba) && HSLA.equals(this.hsla, other.hsla) && HSVA.equals(this.hsva, other.hsva);
  12065. }
  12066. /**
  12067. * http://www.w3.org/TR/WCAG20/#relativeluminancedef
  12068. * Returns the number in the set [0, 1]. O => Darkest Black. 1 => Lightest white.
  12069. */
  12070. getRelativeLuminance() {
  12071. const R = _Color._relativeLuminanceForComponent(this.rgba.r);
  12072. const G = _Color._relativeLuminanceForComponent(this.rgba.g);
  12073. const B = _Color._relativeLuminanceForComponent(this.rgba.b);
  12074. const luminance = 0.2126 * R + 0.7152 * G + 0.0722 * B;
  12075. return roundFloat(luminance, 4);
  12076. }
  12077. static _relativeLuminanceForComponent(color) {
  12078. const c = color / 255;
  12079. return c <= 0.03928 ? c / 12.92 : Math.pow((c + 0.055) / 1.055, 2.4);
  12080. }
  12081. /**
  12082. * http://24ways.org/2010/calculating-color-contrast
  12083. * Return 'true' if lighter color otherwise 'false'
  12084. */
  12085. isLighter() {
  12086. const yiq = (this.rgba.r * 299 + this.rgba.g * 587 + this.rgba.b * 114) / 1e3;
  12087. return yiq >= 128;
  12088. }
  12089. isLighterThan(another) {
  12090. const lum1 = this.getRelativeLuminance();
  12091. const lum2 = another.getRelativeLuminance();
  12092. return lum1 > lum2;
  12093. }
  12094. isDarkerThan(another) {
  12095. const lum1 = this.getRelativeLuminance();
  12096. const lum2 = another.getRelativeLuminance();
  12097. return lum1 < lum2;
  12098. }
  12099. lighten(factor) {
  12100. return new _Color(new HSLA(this.hsla.h, this.hsla.s, this.hsla.l + this.hsla.l * factor, this.hsla.a));
  12101. }
  12102. darken(factor) {
  12103. return new _Color(new HSLA(this.hsla.h, this.hsla.s, this.hsla.l - this.hsla.l * factor, this.hsla.a));
  12104. }
  12105. transparent(factor) {
  12106. const { r, g, b, a } = this.rgba;
  12107. return new _Color(new RGBA(r, g, b, a * factor));
  12108. }
  12109. isTransparent() {
  12110. return this.rgba.a === 0;
  12111. }
  12112. isOpaque() {
  12113. return this.rgba.a === 1;
  12114. }
  12115. opposite() {
  12116. return new _Color(new RGBA(255 - this.rgba.r, 255 - this.rgba.g, 255 - this.rgba.b, this.rgba.a));
  12117. }
  12118. makeOpaque(opaqueBackground) {
  12119. if (this.isOpaque() || opaqueBackground.rgba.a !== 1) {
  12120. return this;
  12121. }
  12122. const { r, g, b, a } = this.rgba;
  12123. return new _Color(new RGBA(opaqueBackground.rgba.r - a * (opaqueBackground.rgba.r - r), opaqueBackground.rgba.g - a * (opaqueBackground.rgba.g - g), opaqueBackground.rgba.b - a * (opaqueBackground.rgba.b - b), 1));
  12124. }
  12125. toString() {
  12126. if (!this._toString) {
  12127. this._toString = _Color.Format.CSS.format(this);
  12128. }
  12129. return this._toString;
  12130. }
  12131. static getLighterColor(of, relative2, factor) {
  12132. if (of.isLighterThan(relative2)) {
  12133. return of;
  12134. }
  12135. factor = factor ? factor : 0.5;
  12136. const lum1 = of.getRelativeLuminance();
  12137. const lum2 = relative2.getRelativeLuminance();
  12138. factor = factor * (lum2 - lum1) / lum2;
  12139. return of.lighten(factor);
  12140. }
  12141. static getDarkerColor(of, relative2, factor) {
  12142. if (of.isDarkerThan(relative2)) {
  12143. return of;
  12144. }
  12145. factor = factor ? factor : 0.5;
  12146. const lum1 = of.getRelativeLuminance();
  12147. const lum2 = relative2.getRelativeLuminance();
  12148. factor = factor * (lum1 - lum2) / lum1;
  12149. return of.darken(factor);
  12150. }
  12151. static {
  12152. this.white = new _Color(new RGBA(255, 255, 255, 1));
  12153. }
  12154. static {
  12155. this.black = new _Color(new RGBA(0, 0, 0, 1));
  12156. }
  12157. static {
  12158. this.red = new _Color(new RGBA(255, 0, 0, 1));
  12159. }
  12160. static {
  12161. this.blue = new _Color(new RGBA(0, 0, 255, 1));
  12162. }
  12163. static {
  12164. this.green = new _Color(new RGBA(0, 255, 0, 1));
  12165. }
  12166. static {
  12167. this.cyan = new _Color(new RGBA(0, 255, 255, 1));
  12168. }
  12169. static {
  12170. this.lightgrey = new _Color(new RGBA(211, 211, 211, 1));
  12171. }
  12172. static {
  12173. this.transparent = new _Color(new RGBA(0, 0, 0, 0));
  12174. }
  12175. };
  12176. (function(Color2) {
  12177. let Format;
  12178. (function(Format2) {
  12179. let CSS;
  12180. (function(CSS2) {
  12181. function formatRGB(color) {
  12182. if (color.rgba.a === 1) {
  12183. return `rgb(${color.rgba.r}, ${color.rgba.g}, ${color.rgba.b})`;
  12184. }
  12185. return Color2.Format.CSS.formatRGBA(color);
  12186. }
  12187. CSS2.formatRGB = formatRGB;
  12188. function formatRGBA(color) {
  12189. return `rgba(${color.rgba.r}, ${color.rgba.g}, ${color.rgba.b}, ${+color.rgba.a.toFixed(2)})`;
  12190. }
  12191. CSS2.formatRGBA = formatRGBA;
  12192. function formatHSL(color) {
  12193. if (color.hsla.a === 1) {
  12194. return `hsl(${color.hsla.h}, ${(color.hsla.s * 100).toFixed(2)}%, ${(color.hsla.l * 100).toFixed(2)}%)`;
  12195. }
  12196. return Color2.Format.CSS.formatHSLA(color);
  12197. }
  12198. CSS2.formatHSL = formatHSL;
  12199. function formatHSLA(color) {
  12200. return `hsla(${color.hsla.h}, ${(color.hsla.s * 100).toFixed(2)}%, ${(color.hsla.l * 100).toFixed(2)}%, ${color.hsla.a.toFixed(2)})`;
  12201. }
  12202. CSS2.formatHSLA = formatHSLA;
  12203. function _toTwoDigitHex(n) {
  12204. const r = n.toString(16);
  12205. return r.length !== 2 ? "0" + r : r;
  12206. }
  12207. function formatHex(color) {
  12208. return `#${_toTwoDigitHex(color.rgba.r)}${_toTwoDigitHex(color.rgba.g)}${_toTwoDigitHex(color.rgba.b)}`;
  12209. }
  12210. CSS2.formatHex = formatHex;
  12211. function formatHexA(color, compact = false) {
  12212. if (compact && color.rgba.a === 1) {
  12213. return Color2.Format.CSS.formatHex(color);
  12214. }
  12215. return `#${_toTwoDigitHex(color.rgba.r)}${_toTwoDigitHex(color.rgba.g)}${_toTwoDigitHex(color.rgba.b)}${_toTwoDigitHex(Math.round(color.rgba.a * 255))}`;
  12216. }
  12217. CSS2.formatHexA = formatHexA;
  12218. function format(color) {
  12219. if (color.isOpaque()) {
  12220. return Color2.Format.CSS.formatHex(color);
  12221. }
  12222. return Color2.Format.CSS.formatRGBA(color);
  12223. }
  12224. CSS2.format = format;
  12225. function parseHex(hex) {
  12226. const length = hex.length;
  12227. if (length === 0) {
  12228. return null;
  12229. }
  12230. if (hex.charCodeAt(0) !== 35) {
  12231. return null;
  12232. }
  12233. if (length === 7) {
  12234. const r = 16 * _parseHexDigit(hex.charCodeAt(1)) + _parseHexDigit(hex.charCodeAt(2));
  12235. const g = 16 * _parseHexDigit(hex.charCodeAt(3)) + _parseHexDigit(hex.charCodeAt(4));
  12236. const b = 16 * _parseHexDigit(hex.charCodeAt(5)) + _parseHexDigit(hex.charCodeAt(6));
  12237. return new Color2(new RGBA(r, g, b, 1));
  12238. }
  12239. if (length === 9) {
  12240. const r = 16 * _parseHexDigit(hex.charCodeAt(1)) + _parseHexDigit(hex.charCodeAt(2));
  12241. const g = 16 * _parseHexDigit(hex.charCodeAt(3)) + _parseHexDigit(hex.charCodeAt(4));
  12242. const b = 16 * _parseHexDigit(hex.charCodeAt(5)) + _parseHexDigit(hex.charCodeAt(6));
  12243. const a = 16 * _parseHexDigit(hex.charCodeAt(7)) + _parseHexDigit(hex.charCodeAt(8));
  12244. return new Color2(new RGBA(r, g, b, a / 255));
  12245. }
  12246. if (length === 4) {
  12247. const r = _parseHexDigit(hex.charCodeAt(1));
  12248. const g = _parseHexDigit(hex.charCodeAt(2));
  12249. const b = _parseHexDigit(hex.charCodeAt(3));
  12250. return new Color2(new RGBA(16 * r + r, 16 * g + g, 16 * b + b));
  12251. }
  12252. if (length === 5) {
  12253. const r = _parseHexDigit(hex.charCodeAt(1));
  12254. const g = _parseHexDigit(hex.charCodeAt(2));
  12255. const b = _parseHexDigit(hex.charCodeAt(3));
  12256. const a = _parseHexDigit(hex.charCodeAt(4));
  12257. return new Color2(new RGBA(16 * r + r, 16 * g + g, 16 * b + b, (16 * a + a) / 255));
  12258. }
  12259. return null;
  12260. }
  12261. CSS2.parseHex = parseHex;
  12262. function _parseHexDigit(charCode) {
  12263. switch (charCode) {
  12264. case 48:
  12265. return 0;
  12266. case 49:
  12267. return 1;
  12268. case 50:
  12269. return 2;
  12270. case 51:
  12271. return 3;
  12272. case 52:
  12273. return 4;
  12274. case 53:
  12275. return 5;
  12276. case 54:
  12277. return 6;
  12278. case 55:
  12279. return 7;
  12280. case 56:
  12281. return 8;
  12282. case 57:
  12283. return 9;
  12284. case 97:
  12285. return 10;
  12286. case 65:
  12287. return 10;
  12288. case 98:
  12289. return 11;
  12290. case 66:
  12291. return 11;
  12292. case 99:
  12293. return 12;
  12294. case 67:
  12295. return 12;
  12296. case 100:
  12297. return 13;
  12298. case 68:
  12299. return 13;
  12300. case 101:
  12301. return 14;
  12302. case 69:
  12303. return 14;
  12304. case 102:
  12305. return 15;
  12306. case 70:
  12307. return 15;
  12308. }
  12309. return 0;
  12310. }
  12311. })(CSS = Format2.CSS || (Format2.CSS = {}));
  12312. })(Format = Color2.Format || (Color2.Format = {}));
  12313. })(Color || (Color = {}));
  12314. // node_modules/monaco-editor/esm/vs/editor/common/languages/defaultDocumentColorsComputer.js
  12315. function _parseCaptureGroups(captureGroups) {
  12316. const values = [];
  12317. for (const captureGroup of captureGroups) {
  12318. const parsedNumber = Number(captureGroup);
  12319. if (parsedNumber || parsedNumber === 0 && captureGroup.replace(/\s/g, "") !== "") {
  12320. values.push(parsedNumber);
  12321. }
  12322. }
  12323. return values;
  12324. }
  12325. function _toIColor(r, g, b, a) {
  12326. return {
  12327. red: r / 255,
  12328. blue: b / 255,
  12329. green: g / 255,
  12330. alpha: a
  12331. };
  12332. }
  12333. function _findRange(model, match) {
  12334. const index = match.index;
  12335. const length = match[0].length;
  12336. if (!index) {
  12337. return;
  12338. }
  12339. const startPosition = model.positionAt(index);
  12340. const range = {
  12341. startLineNumber: startPosition.lineNumber,
  12342. startColumn: startPosition.column,
  12343. endLineNumber: startPosition.lineNumber,
  12344. endColumn: startPosition.column + length
  12345. };
  12346. return range;
  12347. }
  12348. function _findHexColorInformation(range, hexValue) {
  12349. if (!range) {
  12350. return;
  12351. }
  12352. const parsedHexColor = Color.Format.CSS.parseHex(hexValue);
  12353. if (!parsedHexColor) {
  12354. return;
  12355. }
  12356. return {
  12357. range,
  12358. color: _toIColor(parsedHexColor.rgba.r, parsedHexColor.rgba.g, parsedHexColor.rgba.b, parsedHexColor.rgba.a)
  12359. };
  12360. }
  12361. function _findRGBColorInformation(range, matches, isAlpha) {
  12362. if (!range || matches.length !== 1) {
  12363. return;
  12364. }
  12365. const match = matches[0];
  12366. const captureGroups = match.values();
  12367. const parsedRegex = _parseCaptureGroups(captureGroups);
  12368. return {
  12369. range,
  12370. color: _toIColor(parsedRegex[0], parsedRegex[1], parsedRegex[2], isAlpha ? parsedRegex[3] : 1)
  12371. };
  12372. }
  12373. function _findHSLColorInformation(range, matches, isAlpha) {
  12374. if (!range || matches.length !== 1) {
  12375. return;
  12376. }
  12377. const match = matches[0];
  12378. const captureGroups = match.values();
  12379. const parsedRegex = _parseCaptureGroups(captureGroups);
  12380. const colorEquivalent = new Color(new HSLA(parsedRegex[0], parsedRegex[1] / 100, parsedRegex[2] / 100, isAlpha ? parsedRegex[3] : 1));
  12381. return {
  12382. range,
  12383. color: _toIColor(colorEquivalent.rgba.r, colorEquivalent.rgba.g, colorEquivalent.rgba.b, colorEquivalent.rgba.a)
  12384. };
  12385. }
  12386. function _findMatches(model, regex) {
  12387. if (typeof model === "string") {
  12388. return [...model.matchAll(regex)];
  12389. } else {
  12390. return model.findMatches(regex);
  12391. }
  12392. }
  12393. function computeColors(model) {
  12394. const result = [];
  12395. const initialValidationRegex = /\b(rgb|rgba|hsl|hsla)(\([0-9\s,.\%]*\))|(#)([A-Fa-f0-9]{3})\b|(#)([A-Fa-f0-9]{4})\b|(#)([A-Fa-f0-9]{6})\b|(#)([A-Fa-f0-9]{8})\b/gm;
  12396. const initialValidationMatches = _findMatches(model, initialValidationRegex);
  12397. if (initialValidationMatches.length > 0) {
  12398. for (const initialMatch of initialValidationMatches) {
  12399. const initialCaptureGroups = initialMatch.filter((captureGroup) => captureGroup !== void 0);
  12400. const colorScheme = initialCaptureGroups[1];
  12401. const colorParameters = initialCaptureGroups[2];
  12402. if (!colorParameters) {
  12403. continue;
  12404. }
  12405. let colorInformation;
  12406. if (colorScheme === "rgb") {
  12407. const regexParameters = /^\(\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*\)$/gm;
  12408. colorInformation = _findRGBColorInformation(_findRange(model, initialMatch), _findMatches(colorParameters, regexParameters), false);
  12409. } else if (colorScheme === "rgba") {
  12410. const regexParameters = /^\(\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(0[.][0-9]+|[.][0-9]+|[01][.]|[01])\s*\)$/gm;
  12411. colorInformation = _findRGBColorInformation(_findRange(model, initialMatch), _findMatches(colorParameters, regexParameters), true);
  12412. } else if (colorScheme === "hsl") {
  12413. const regexParameters = /^\(\s*(36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*\)$/gm;
  12414. colorInformation = _findHSLColorInformation(_findRange(model, initialMatch), _findMatches(colorParameters, regexParameters), false);
  12415. } else if (colorScheme === "hsla") {
  12416. const regexParameters = /^\(\s*(36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*,\s*(0[.][0-9]+|[.][0-9]+|[01][.]|[01])\s*\)$/gm;
  12417. colorInformation = _findHSLColorInformation(_findRange(model, initialMatch), _findMatches(colorParameters, regexParameters), true);
  12418. } else if (colorScheme === "#") {
  12419. colorInformation = _findHexColorInformation(_findRange(model, initialMatch), colorScheme + colorParameters);
  12420. }
  12421. if (colorInformation) {
  12422. result.push(colorInformation);
  12423. }
  12424. }
  12425. }
  12426. return result;
  12427. }
  12428. function computeDefaultDocumentColors(model) {
  12429. if (!model || typeof model.getValue !== "function" || typeof model.positionAt !== "function") {
  12430. return [];
  12431. }
  12432. return computeColors(model);
  12433. }
  12434. // node_modules/monaco-editor/esm/vs/editor/common/services/findSectionHeaders.js
  12435. var markRegex = new RegExp("\\bMARK:\\s*(.*)$", "d");
  12436. var trimDashesRegex = /^-+|-+$/g;
  12437. function findSectionHeaders(model, options) {
  12438. let headers = [];
  12439. if (options.findRegionSectionHeaders && options.foldingRules?.markers) {
  12440. const regionHeaders = collectRegionHeaders(model, options);
  12441. headers = headers.concat(regionHeaders);
  12442. }
  12443. if (options.findMarkSectionHeaders) {
  12444. const markHeaders = collectMarkHeaders(model);
  12445. headers = headers.concat(markHeaders);
  12446. }
  12447. return headers;
  12448. }
  12449. function collectRegionHeaders(model, options) {
  12450. const regionHeaders = [];
  12451. const endLineNumber = model.getLineCount();
  12452. for (let lineNumber = 1; lineNumber <= endLineNumber; lineNumber++) {
  12453. const lineContent = model.getLineContent(lineNumber);
  12454. const match = lineContent.match(options.foldingRules.markers.start);
  12455. if (match) {
  12456. const range = { startLineNumber: lineNumber, startColumn: match[0].length + 1, endLineNumber: lineNumber, endColumn: lineContent.length + 1 };
  12457. if (range.endColumn > range.startColumn) {
  12458. const sectionHeader = {
  12459. range,
  12460. ...getHeaderText(lineContent.substring(match[0].length)),
  12461. shouldBeInComments: false
  12462. };
  12463. if (sectionHeader.text || sectionHeader.hasSeparatorLine) {
  12464. regionHeaders.push(sectionHeader);
  12465. }
  12466. }
  12467. }
  12468. }
  12469. return regionHeaders;
  12470. }
  12471. function collectMarkHeaders(model) {
  12472. const markHeaders = [];
  12473. const endLineNumber = model.getLineCount();
  12474. for (let lineNumber = 1; lineNumber <= endLineNumber; lineNumber++) {
  12475. const lineContent = model.getLineContent(lineNumber);
  12476. addMarkHeaderIfFound(lineContent, lineNumber, markHeaders);
  12477. }
  12478. return markHeaders;
  12479. }
  12480. function addMarkHeaderIfFound(lineContent, lineNumber, sectionHeaders) {
  12481. markRegex.lastIndex = 0;
  12482. const match = markRegex.exec(lineContent);
  12483. if (match) {
  12484. const column = match.indices[1][0] + 1;
  12485. const endColumn = match.indices[1][1] + 1;
  12486. const range = { startLineNumber: lineNumber, startColumn: column, endLineNumber: lineNumber, endColumn };
  12487. if (range.endColumn > range.startColumn) {
  12488. const sectionHeader = {
  12489. range,
  12490. ...getHeaderText(match[1]),
  12491. shouldBeInComments: true
  12492. };
  12493. if (sectionHeader.text || sectionHeader.hasSeparatorLine) {
  12494. sectionHeaders.push(sectionHeader);
  12495. }
  12496. }
  12497. }
  12498. }
  12499. function getHeaderText(text) {
  12500. text = text.trim();
  12501. const hasSeparatorLine = text.startsWith("-");
  12502. text = text.replace(trimDashesRegex, "");
  12503. return { text, hasSeparatorLine };
  12504. }
  12505. // node_modules/monaco-editor/esm/vs/base/common/symbols.js
  12506. var MicrotaskDelay = Symbol("MicrotaskDelay");
  12507. // node_modules/monaco-editor/esm/vs/base/common/async.js
  12508. var runWhenGlobalIdle;
  12509. var _runWhenIdle;
  12510. (function() {
  12511. if (typeof globalThis.requestIdleCallback !== "function" || typeof globalThis.cancelIdleCallback !== "function") {
  12512. _runWhenIdle = (_targetWindow, runner) => {
  12513. setTimeout0(() => {
  12514. if (disposed) {
  12515. return;
  12516. }
  12517. const end = Date.now() + 15;
  12518. const deadline = {
  12519. didTimeout: true,
  12520. timeRemaining() {
  12521. return Math.max(0, end - Date.now());
  12522. }
  12523. };
  12524. runner(Object.freeze(deadline));
  12525. });
  12526. let disposed = false;
  12527. return {
  12528. dispose() {
  12529. if (disposed) {
  12530. return;
  12531. }
  12532. disposed = true;
  12533. }
  12534. };
  12535. };
  12536. } else {
  12537. _runWhenIdle = (targetWindow, runner, timeout) => {
  12538. const handle = targetWindow.requestIdleCallback(runner, typeof timeout === "number" ? { timeout } : void 0);
  12539. let disposed = false;
  12540. return {
  12541. dispose() {
  12542. if (disposed) {
  12543. return;
  12544. }
  12545. disposed = true;
  12546. targetWindow.cancelIdleCallback(handle);
  12547. }
  12548. };
  12549. };
  12550. }
  12551. runWhenGlobalIdle = (runner) => _runWhenIdle(globalThis, runner);
  12552. })();
  12553. var Promises;
  12554. (function(Promises2) {
  12555. async function settled(promises) {
  12556. let firstError = void 0;
  12557. const result = await Promise.all(promises.map((promise) => promise.then((value) => value, (error) => {
  12558. if (!firstError) {
  12559. firstError = error;
  12560. }
  12561. return void 0;
  12562. })));
  12563. if (typeof firstError !== "undefined") {
  12564. throw firstError;
  12565. }
  12566. return result;
  12567. }
  12568. Promises2.settled = settled;
  12569. function withAsyncBody(bodyFn) {
  12570. return new Promise(async (resolve2, reject) => {
  12571. try {
  12572. await bodyFn(resolve2, reject);
  12573. } catch (error) {
  12574. reject(error);
  12575. }
  12576. });
  12577. }
  12578. Promises2.withAsyncBody = withAsyncBody;
  12579. })(Promises || (Promises = {}));
  12580. var AsyncIterableObject = class _AsyncIterableObject {
  12581. static fromArray(items) {
  12582. return new _AsyncIterableObject((writer) => {
  12583. writer.emitMany(items);
  12584. });
  12585. }
  12586. static fromPromise(promise) {
  12587. return new _AsyncIterableObject(async (emitter) => {
  12588. emitter.emitMany(await promise);
  12589. });
  12590. }
  12591. static fromPromises(promises) {
  12592. return new _AsyncIterableObject(async (emitter) => {
  12593. await Promise.all(promises.map(async (p) => emitter.emitOne(await p)));
  12594. });
  12595. }
  12596. static merge(iterables) {
  12597. return new _AsyncIterableObject(async (emitter) => {
  12598. await Promise.all(iterables.map(async (iterable) => {
  12599. for await (const item of iterable) {
  12600. emitter.emitOne(item);
  12601. }
  12602. }));
  12603. });
  12604. }
  12605. static {
  12606. this.EMPTY = _AsyncIterableObject.fromArray([]);
  12607. }
  12608. constructor(executor, onReturn) {
  12609. this._state = 0;
  12610. this._results = [];
  12611. this._error = null;
  12612. this._onReturn = onReturn;
  12613. this._onStateChanged = new Emitter();
  12614. queueMicrotask(async () => {
  12615. const writer = {
  12616. emitOne: (item) => this.emitOne(item),
  12617. emitMany: (items) => this.emitMany(items),
  12618. reject: (error) => this.reject(error)
  12619. };
  12620. try {
  12621. await Promise.resolve(executor(writer));
  12622. this.resolve();
  12623. } catch (err) {
  12624. this.reject(err);
  12625. } finally {
  12626. writer.emitOne = void 0;
  12627. writer.emitMany = void 0;
  12628. writer.reject = void 0;
  12629. }
  12630. });
  12631. }
  12632. [Symbol.asyncIterator]() {
  12633. let i = 0;
  12634. return {
  12635. next: async () => {
  12636. do {
  12637. if (this._state === 2) {
  12638. throw this._error;
  12639. }
  12640. if (i < this._results.length) {
  12641. return { done: false, value: this._results[i++] };
  12642. }
  12643. if (this._state === 1) {
  12644. return { done: true, value: void 0 };
  12645. }
  12646. await Event.toPromise(this._onStateChanged.event);
  12647. } while (true);
  12648. },
  12649. return: async () => {
  12650. this._onReturn?.();
  12651. return { done: true, value: void 0 };
  12652. }
  12653. };
  12654. }
  12655. static map(iterable, mapFn) {
  12656. return new _AsyncIterableObject(async (emitter) => {
  12657. for await (const item of iterable) {
  12658. emitter.emitOne(mapFn(item));
  12659. }
  12660. });
  12661. }
  12662. map(mapFn) {
  12663. return _AsyncIterableObject.map(this, mapFn);
  12664. }
  12665. static filter(iterable, filterFn) {
  12666. return new _AsyncIterableObject(async (emitter) => {
  12667. for await (const item of iterable) {
  12668. if (filterFn(item)) {
  12669. emitter.emitOne(item);
  12670. }
  12671. }
  12672. });
  12673. }
  12674. filter(filterFn) {
  12675. return _AsyncIterableObject.filter(this, filterFn);
  12676. }
  12677. static coalesce(iterable) {
  12678. return _AsyncIterableObject.filter(iterable, (item) => !!item);
  12679. }
  12680. coalesce() {
  12681. return _AsyncIterableObject.coalesce(this);
  12682. }
  12683. static async toPromise(iterable) {
  12684. const result = [];
  12685. for await (const item of iterable) {
  12686. result.push(item);
  12687. }
  12688. return result;
  12689. }
  12690. toPromise() {
  12691. return _AsyncIterableObject.toPromise(this);
  12692. }
  12693. /**
  12694. * The value will be appended at the end.
  12695. *
  12696. * **NOTE** If `resolve()` or `reject()` have already been called, this method has no effect.
  12697. */
  12698. emitOne(value) {
  12699. if (this._state !== 0) {
  12700. return;
  12701. }
  12702. this._results.push(value);
  12703. this._onStateChanged.fire();
  12704. }
  12705. /**
  12706. * The values will be appended at the end.
  12707. *
  12708. * **NOTE** If `resolve()` or `reject()` have already been called, this method has no effect.
  12709. */
  12710. emitMany(values) {
  12711. if (this._state !== 0) {
  12712. return;
  12713. }
  12714. this._results = this._results.concat(values);
  12715. this._onStateChanged.fire();
  12716. }
  12717. /**
  12718. * Calling `resolve()` will mark the result array as complete.
  12719. *
  12720. * **NOTE** `resolve()` must be called, otherwise all consumers of this iterable will hang indefinitely, similar to a non-resolved promise.
  12721. * **NOTE** If `resolve()` or `reject()` have already been called, this method has no effect.
  12722. */
  12723. resolve() {
  12724. if (this._state !== 0) {
  12725. return;
  12726. }
  12727. this._state = 1;
  12728. this._onStateChanged.fire();
  12729. }
  12730. /**
  12731. * Writing an error will permanently invalidate this iterable.
  12732. * The current users will receive an error thrown, as will all future users.
  12733. *
  12734. * **NOTE** If `resolve()` or `reject()` have already been called, this method has no effect.
  12735. */
  12736. reject(error) {
  12737. if (this._state !== 0) {
  12738. return;
  12739. }
  12740. this._state = 2;
  12741. this._error = error;
  12742. this._onStateChanged.fire();
  12743. }
  12744. };
  12745. // node_modules/monaco-editor/esm/vs/editor/common/model/prefixSumComputer.js
  12746. var PrefixSumComputer = class {
  12747. constructor(values) {
  12748. this.values = values;
  12749. this.prefixSum = new Uint32Array(values.length);
  12750. this.prefixSumValidIndex = new Int32Array(1);
  12751. this.prefixSumValidIndex[0] = -1;
  12752. }
  12753. insertValues(insertIndex, insertValues) {
  12754. insertIndex = toUint32(insertIndex);
  12755. const oldValues = this.values;
  12756. const oldPrefixSum = this.prefixSum;
  12757. const insertValuesLen = insertValues.length;
  12758. if (insertValuesLen === 0) {
  12759. return false;
  12760. }
  12761. this.values = new Uint32Array(oldValues.length + insertValuesLen);
  12762. this.values.set(oldValues.subarray(0, insertIndex), 0);
  12763. this.values.set(oldValues.subarray(insertIndex), insertIndex + insertValuesLen);
  12764. this.values.set(insertValues, insertIndex);
  12765. if (insertIndex - 1 < this.prefixSumValidIndex[0]) {
  12766. this.prefixSumValidIndex[0] = insertIndex - 1;
  12767. }
  12768. this.prefixSum = new Uint32Array(this.values.length);
  12769. if (this.prefixSumValidIndex[0] >= 0) {
  12770. this.prefixSum.set(oldPrefixSum.subarray(0, this.prefixSumValidIndex[0] + 1));
  12771. }
  12772. return true;
  12773. }
  12774. setValue(index, value) {
  12775. index = toUint32(index);
  12776. value = toUint32(value);
  12777. if (this.values[index] === value) {
  12778. return false;
  12779. }
  12780. this.values[index] = value;
  12781. if (index - 1 < this.prefixSumValidIndex[0]) {
  12782. this.prefixSumValidIndex[0] = index - 1;
  12783. }
  12784. return true;
  12785. }
  12786. removeValues(startIndex, count) {
  12787. startIndex = toUint32(startIndex);
  12788. count = toUint32(count);
  12789. const oldValues = this.values;
  12790. const oldPrefixSum = this.prefixSum;
  12791. if (startIndex >= oldValues.length) {
  12792. return false;
  12793. }
  12794. const maxCount = oldValues.length - startIndex;
  12795. if (count >= maxCount) {
  12796. count = maxCount;
  12797. }
  12798. if (count === 0) {
  12799. return false;
  12800. }
  12801. this.values = new Uint32Array(oldValues.length - count);
  12802. this.values.set(oldValues.subarray(0, startIndex), 0);
  12803. this.values.set(oldValues.subarray(startIndex + count), startIndex);
  12804. this.prefixSum = new Uint32Array(this.values.length);
  12805. if (startIndex - 1 < this.prefixSumValidIndex[0]) {
  12806. this.prefixSumValidIndex[0] = startIndex - 1;
  12807. }
  12808. if (this.prefixSumValidIndex[0] >= 0) {
  12809. this.prefixSum.set(oldPrefixSum.subarray(0, this.prefixSumValidIndex[0] + 1));
  12810. }
  12811. return true;
  12812. }
  12813. getTotalSum() {
  12814. if (this.values.length === 0) {
  12815. return 0;
  12816. }
  12817. return this._getPrefixSum(this.values.length - 1);
  12818. }
  12819. /**
  12820. * Returns the sum of the first `index + 1` many items.
  12821. * @returns `SUM(0 <= j <= index, values[j])`.
  12822. */
  12823. getPrefixSum(index) {
  12824. if (index < 0) {
  12825. return 0;
  12826. }
  12827. index = toUint32(index);
  12828. return this._getPrefixSum(index);
  12829. }
  12830. _getPrefixSum(index) {
  12831. if (index <= this.prefixSumValidIndex[0]) {
  12832. return this.prefixSum[index];
  12833. }
  12834. let startIndex = this.prefixSumValidIndex[0] + 1;
  12835. if (startIndex === 0) {
  12836. this.prefixSum[0] = this.values[0];
  12837. startIndex++;
  12838. }
  12839. if (index >= this.values.length) {
  12840. index = this.values.length - 1;
  12841. }
  12842. for (let i = startIndex; i <= index; i++) {
  12843. this.prefixSum[i] = this.prefixSum[i - 1] + this.values[i];
  12844. }
  12845. this.prefixSumValidIndex[0] = Math.max(this.prefixSumValidIndex[0], index);
  12846. return this.prefixSum[index];
  12847. }
  12848. getIndexOf(sum) {
  12849. sum = Math.floor(sum);
  12850. this.getTotalSum();
  12851. let low = 0;
  12852. let high = this.values.length - 1;
  12853. let mid = 0;
  12854. let midStop = 0;
  12855. let midStart = 0;
  12856. while (low <= high) {
  12857. mid = low + (high - low) / 2 | 0;
  12858. midStop = this.prefixSum[mid];
  12859. midStart = midStop - this.values[mid];
  12860. if (sum < midStart) {
  12861. high = mid - 1;
  12862. } else if (sum >= midStop) {
  12863. low = mid + 1;
  12864. } else {
  12865. break;
  12866. }
  12867. }
  12868. return new PrefixSumIndexOfResult(mid, sum - midStart);
  12869. }
  12870. };
  12871. var PrefixSumIndexOfResult = class {
  12872. constructor(index, remainder) {
  12873. this.index = index;
  12874. this.remainder = remainder;
  12875. this._prefixSumIndexOfResultBrand = void 0;
  12876. this.index = index;
  12877. this.remainder = remainder;
  12878. }
  12879. };
  12880. // node_modules/monaco-editor/esm/vs/editor/common/model/mirrorTextModel.js
  12881. var MirrorTextModel = class {
  12882. constructor(uri, lines, eol, versionId) {
  12883. this._uri = uri;
  12884. this._lines = lines;
  12885. this._eol = eol;
  12886. this._versionId = versionId;
  12887. this._lineStarts = null;
  12888. this._cachedTextValue = null;
  12889. }
  12890. dispose() {
  12891. this._lines.length = 0;
  12892. }
  12893. get version() {
  12894. return this._versionId;
  12895. }
  12896. getText() {
  12897. if (this._cachedTextValue === null) {
  12898. this._cachedTextValue = this._lines.join(this._eol);
  12899. }
  12900. return this._cachedTextValue;
  12901. }
  12902. onEvents(e) {
  12903. if (e.eol && e.eol !== this._eol) {
  12904. this._eol = e.eol;
  12905. this._lineStarts = null;
  12906. }
  12907. const changes = e.changes;
  12908. for (const change of changes) {
  12909. this._acceptDeleteRange(change.range);
  12910. this._acceptInsertText(new Position(change.range.startLineNumber, change.range.startColumn), change.text);
  12911. }
  12912. this._versionId = e.versionId;
  12913. this._cachedTextValue = null;
  12914. }
  12915. _ensureLineStarts() {
  12916. if (!this._lineStarts) {
  12917. const eolLength = this._eol.length;
  12918. const linesLength = this._lines.length;
  12919. const lineStartValues = new Uint32Array(linesLength);
  12920. for (let i = 0; i < linesLength; i++) {
  12921. lineStartValues[i] = this._lines[i].length + eolLength;
  12922. }
  12923. this._lineStarts = new PrefixSumComputer(lineStartValues);
  12924. }
  12925. }
  12926. /**
  12927. * All changes to a line's text go through this method
  12928. */
  12929. _setLineText(lineIndex, newValue) {
  12930. this._lines[lineIndex] = newValue;
  12931. if (this._lineStarts) {
  12932. this._lineStarts.setValue(lineIndex, this._lines[lineIndex].length + this._eol.length);
  12933. }
  12934. }
  12935. _acceptDeleteRange(range) {
  12936. if (range.startLineNumber === range.endLineNumber) {
  12937. if (range.startColumn === range.endColumn) {
  12938. return;
  12939. }
  12940. this._setLineText(range.startLineNumber - 1, this._lines[range.startLineNumber - 1].substring(0, range.startColumn - 1) + this._lines[range.startLineNumber - 1].substring(range.endColumn - 1));
  12941. return;
  12942. }
  12943. this._setLineText(range.startLineNumber - 1, this._lines[range.startLineNumber - 1].substring(0, range.startColumn - 1) + this._lines[range.endLineNumber - 1].substring(range.endColumn - 1));
  12944. this._lines.splice(range.startLineNumber, range.endLineNumber - range.startLineNumber);
  12945. if (this._lineStarts) {
  12946. this._lineStarts.removeValues(range.startLineNumber, range.endLineNumber - range.startLineNumber);
  12947. }
  12948. }
  12949. _acceptInsertText(position, insertText) {
  12950. if (insertText.length === 0) {
  12951. return;
  12952. }
  12953. const insertLines = splitLines(insertText);
  12954. if (insertLines.length === 1) {
  12955. this._setLineText(position.lineNumber - 1, this._lines[position.lineNumber - 1].substring(0, position.column - 1) + insertLines[0] + this._lines[position.lineNumber - 1].substring(position.column - 1));
  12956. return;
  12957. }
  12958. insertLines[insertLines.length - 1] += this._lines[position.lineNumber - 1].substring(position.column - 1);
  12959. this._setLineText(position.lineNumber - 1, this._lines[position.lineNumber - 1].substring(0, position.column - 1) + insertLines[0]);
  12960. const newLengths = new Uint32Array(insertLines.length - 1);
  12961. for (let i = 1; i < insertLines.length; i++) {
  12962. this._lines.splice(position.lineNumber + i - 1, 0, insertLines[i]);
  12963. newLengths[i - 1] = insertLines[i].length + this._eol.length;
  12964. }
  12965. if (this._lineStarts) {
  12966. this._lineStarts.insertValues(position.lineNumber, newLengths);
  12967. }
  12968. }
  12969. };
  12970. // node_modules/monaco-editor/esm/vs/editor/common/services/textModelSync/textModelSync.impl.js
  12971. var STOP_SYNC_MODEL_DELTA_TIME_MS = 60 * 1e3;
  12972. var WorkerTextModelSyncServer = class {
  12973. constructor() {
  12974. this._models = /* @__PURE__ */ Object.create(null);
  12975. }
  12976. getModel(uri) {
  12977. return this._models[uri];
  12978. }
  12979. getModels() {
  12980. const all = [];
  12981. Object.keys(this._models).forEach((key) => all.push(this._models[key]));
  12982. return all;
  12983. }
  12984. $acceptNewModel(data) {
  12985. this._models[data.url] = new MirrorModel(URI.parse(data.url), data.lines, data.EOL, data.versionId);
  12986. }
  12987. $acceptModelChanged(uri, e) {
  12988. if (!this._models[uri]) {
  12989. return;
  12990. }
  12991. const model = this._models[uri];
  12992. model.onEvents(e);
  12993. }
  12994. $acceptRemovedModel(uri) {
  12995. if (!this._models[uri]) {
  12996. return;
  12997. }
  12998. delete this._models[uri];
  12999. }
  13000. };
  13001. var MirrorModel = class extends MirrorTextModel {
  13002. get uri() {
  13003. return this._uri;
  13004. }
  13005. get eol() {
  13006. return this._eol;
  13007. }
  13008. getValue() {
  13009. return this.getText();
  13010. }
  13011. findMatches(regex) {
  13012. const matches = [];
  13013. for (let i = 0; i < this._lines.length; i++) {
  13014. const line = this._lines[i];
  13015. const offsetToAdd = this.offsetAt(new Position(i + 1, 1));
  13016. const iteratorOverMatches = line.matchAll(regex);
  13017. for (const match of iteratorOverMatches) {
  13018. if (match.index || match.index === 0) {
  13019. match.index = match.index + offsetToAdd;
  13020. }
  13021. matches.push(match);
  13022. }
  13023. }
  13024. return matches;
  13025. }
  13026. getLinesContent() {
  13027. return this._lines.slice(0);
  13028. }
  13029. getLineCount() {
  13030. return this._lines.length;
  13031. }
  13032. getLineContent(lineNumber) {
  13033. return this._lines[lineNumber - 1];
  13034. }
  13035. getWordAtPosition(position, wordDefinition) {
  13036. const wordAtText = getWordAtText(position.column, ensureValidWordDefinition(wordDefinition), this._lines[position.lineNumber - 1], 0);
  13037. if (wordAtText) {
  13038. return new Range(position.lineNumber, wordAtText.startColumn, position.lineNumber, wordAtText.endColumn);
  13039. }
  13040. return null;
  13041. }
  13042. words(wordDefinition) {
  13043. const lines = this._lines;
  13044. const wordenize = this._wordenize.bind(this);
  13045. let lineNumber = 0;
  13046. let lineText = "";
  13047. let wordRangesIdx = 0;
  13048. let wordRanges = [];
  13049. return {
  13050. *[Symbol.iterator]() {
  13051. while (true) {
  13052. if (wordRangesIdx < wordRanges.length) {
  13053. const value = lineText.substring(wordRanges[wordRangesIdx].start, wordRanges[wordRangesIdx].end);
  13054. wordRangesIdx += 1;
  13055. yield value;
  13056. } else {
  13057. if (lineNumber < lines.length) {
  13058. lineText = lines[lineNumber];
  13059. wordRanges = wordenize(lineText, wordDefinition);
  13060. wordRangesIdx = 0;
  13061. lineNumber += 1;
  13062. } else {
  13063. break;
  13064. }
  13065. }
  13066. }
  13067. }
  13068. };
  13069. }
  13070. getLineWords(lineNumber, wordDefinition) {
  13071. const content = this._lines[lineNumber - 1];
  13072. const ranges = this._wordenize(content, wordDefinition);
  13073. const words = [];
  13074. for (const range of ranges) {
  13075. words.push({
  13076. word: content.substring(range.start, range.end),
  13077. startColumn: range.start + 1,
  13078. endColumn: range.end + 1
  13079. });
  13080. }
  13081. return words;
  13082. }
  13083. _wordenize(content, wordDefinition) {
  13084. const result = [];
  13085. let match;
  13086. wordDefinition.lastIndex = 0;
  13087. while (match = wordDefinition.exec(content)) {
  13088. if (match[0].length === 0) {
  13089. break;
  13090. }
  13091. result.push({ start: match.index, end: match.index + match[0].length });
  13092. }
  13093. return result;
  13094. }
  13095. getValueInRange(range) {
  13096. range = this._validateRange(range);
  13097. if (range.startLineNumber === range.endLineNumber) {
  13098. return this._lines[range.startLineNumber - 1].substring(range.startColumn - 1, range.endColumn - 1);
  13099. }
  13100. const lineEnding = this._eol;
  13101. const startLineIndex = range.startLineNumber - 1;
  13102. const endLineIndex = range.endLineNumber - 1;
  13103. const resultLines = [];
  13104. resultLines.push(this._lines[startLineIndex].substring(range.startColumn - 1));
  13105. for (let i = startLineIndex + 1; i < endLineIndex; i++) {
  13106. resultLines.push(this._lines[i]);
  13107. }
  13108. resultLines.push(this._lines[endLineIndex].substring(0, range.endColumn - 1));
  13109. return resultLines.join(lineEnding);
  13110. }
  13111. offsetAt(position) {
  13112. position = this._validatePosition(position);
  13113. this._ensureLineStarts();
  13114. return this._lineStarts.getPrefixSum(position.lineNumber - 2) + (position.column - 1);
  13115. }
  13116. positionAt(offset) {
  13117. offset = Math.floor(offset);
  13118. offset = Math.max(0, offset);
  13119. this._ensureLineStarts();
  13120. const out = this._lineStarts.getIndexOf(offset);
  13121. const lineLength = this._lines[out.index].length;
  13122. return {
  13123. lineNumber: 1 + out.index,
  13124. column: 1 + Math.min(out.remainder, lineLength)
  13125. };
  13126. }
  13127. _validateRange(range) {
  13128. const start = this._validatePosition({ lineNumber: range.startLineNumber, column: range.startColumn });
  13129. const end = this._validatePosition({ lineNumber: range.endLineNumber, column: range.endColumn });
  13130. if (start.lineNumber !== range.startLineNumber || start.column !== range.startColumn || end.lineNumber !== range.endLineNumber || end.column !== range.endColumn) {
  13131. return {
  13132. startLineNumber: start.lineNumber,
  13133. startColumn: start.column,
  13134. endLineNumber: end.lineNumber,
  13135. endColumn: end.column
  13136. };
  13137. }
  13138. return range;
  13139. }
  13140. _validatePosition(position) {
  13141. if (!Position.isIPosition(position)) {
  13142. throw new Error("bad position");
  13143. }
  13144. let { lineNumber, column } = position;
  13145. let hasChanged = false;
  13146. if (lineNumber < 1) {
  13147. lineNumber = 1;
  13148. column = 1;
  13149. hasChanged = true;
  13150. } else if (lineNumber > this._lines.length) {
  13151. lineNumber = this._lines.length;
  13152. column = this._lines[lineNumber - 1].length + 1;
  13153. hasChanged = true;
  13154. } else {
  13155. const maxCharacter = this._lines[lineNumber - 1].length + 1;
  13156. if (column < 1) {
  13157. column = 1;
  13158. hasChanged = true;
  13159. } else if (column > maxCharacter) {
  13160. column = maxCharacter;
  13161. hasChanged = true;
  13162. }
  13163. }
  13164. if (!hasChanged) {
  13165. return position;
  13166. } else {
  13167. return { lineNumber, column };
  13168. }
  13169. }
  13170. };
  13171. // node_modules/monaco-editor/esm/vs/editor/common/services/editorSimpleWorker.js
  13172. var isESM2 = true;
  13173. var BaseEditorSimpleWorker = class {
  13174. constructor() {
  13175. this._workerTextModelSyncServer = new WorkerTextModelSyncServer();
  13176. }
  13177. dispose() {
  13178. }
  13179. _getModel(uri) {
  13180. return this._workerTextModelSyncServer.getModel(uri);
  13181. }
  13182. _getModels() {
  13183. return this._workerTextModelSyncServer.getModels();
  13184. }
  13185. $acceptNewModel(data) {
  13186. this._workerTextModelSyncServer.$acceptNewModel(data);
  13187. }
  13188. $acceptModelChanged(uri, e) {
  13189. this._workerTextModelSyncServer.$acceptModelChanged(uri, e);
  13190. }
  13191. $acceptRemovedModel(uri) {
  13192. this._workerTextModelSyncServer.$acceptRemovedModel(uri);
  13193. }
  13194. async $computeUnicodeHighlights(url, options, range) {
  13195. const model = this._getModel(url);
  13196. if (!model) {
  13197. return { ranges: [], hasMore: false, ambiguousCharacterCount: 0, invisibleCharacterCount: 0, nonBasicAsciiCharacterCount: 0 };
  13198. }
  13199. return UnicodeTextModelHighlighter.computeUnicodeHighlights(model, options, range);
  13200. }
  13201. async $findSectionHeaders(url, options) {
  13202. const model = this._getModel(url);
  13203. if (!model) {
  13204. return [];
  13205. }
  13206. return findSectionHeaders(model, options);
  13207. }
  13208. // ---- BEGIN diff --------------------------------------------------------------------------
  13209. async $computeDiff(originalUrl, modifiedUrl, options, algorithm) {
  13210. const original = this._getModel(originalUrl);
  13211. const modified = this._getModel(modifiedUrl);
  13212. if (!original || !modified) {
  13213. return null;
  13214. }
  13215. const result = EditorSimpleWorker.computeDiff(original, modified, options, algorithm);
  13216. return result;
  13217. }
  13218. static computeDiff(originalTextModel, modifiedTextModel, options, algorithm) {
  13219. const diffAlgorithm = algorithm === "advanced" ? linesDiffComputers.getDefault() : linesDiffComputers.getLegacy();
  13220. const originalLines = originalTextModel.getLinesContent();
  13221. const modifiedLines = modifiedTextModel.getLinesContent();
  13222. const result = diffAlgorithm.computeDiff(originalLines, modifiedLines, options);
  13223. const identical = result.changes.length > 0 ? false : this._modelsAreIdentical(originalTextModel, modifiedTextModel);
  13224. function getLineChanges(changes) {
  13225. return changes.map((m) => [m.original.startLineNumber, m.original.endLineNumberExclusive, m.modified.startLineNumber, m.modified.endLineNumberExclusive, m.innerChanges?.map((m2) => [
  13226. m2.originalRange.startLineNumber,
  13227. m2.originalRange.startColumn,
  13228. m2.originalRange.endLineNumber,
  13229. m2.originalRange.endColumn,
  13230. m2.modifiedRange.startLineNumber,
  13231. m2.modifiedRange.startColumn,
  13232. m2.modifiedRange.endLineNumber,
  13233. m2.modifiedRange.endColumn
  13234. ])]);
  13235. }
  13236. return {
  13237. identical,
  13238. quitEarly: result.hitTimeout,
  13239. changes: getLineChanges(result.changes),
  13240. moves: result.moves.map((m) => [
  13241. m.lineRangeMapping.original.startLineNumber,
  13242. m.lineRangeMapping.original.endLineNumberExclusive,
  13243. m.lineRangeMapping.modified.startLineNumber,
  13244. m.lineRangeMapping.modified.endLineNumberExclusive,
  13245. getLineChanges(m.changes)
  13246. ])
  13247. };
  13248. }
  13249. static _modelsAreIdentical(original, modified) {
  13250. const originalLineCount = original.getLineCount();
  13251. const modifiedLineCount = modified.getLineCount();
  13252. if (originalLineCount !== modifiedLineCount) {
  13253. return false;
  13254. }
  13255. for (let line = 1; line <= originalLineCount; line++) {
  13256. const originalLine = original.getLineContent(line);
  13257. const modifiedLine = modified.getLineContent(line);
  13258. if (originalLine !== modifiedLine) {
  13259. return false;
  13260. }
  13261. }
  13262. return true;
  13263. }
  13264. static {
  13265. this._diffLimit = 1e5;
  13266. }
  13267. async $computeMoreMinimalEdits(modelUrl, edits, pretty) {
  13268. const model = this._getModel(modelUrl);
  13269. if (!model) {
  13270. return edits;
  13271. }
  13272. const result = [];
  13273. let lastEol = void 0;
  13274. edits = edits.slice(0).sort((a, b) => {
  13275. if (a.range && b.range) {
  13276. return Range.compareRangesUsingStarts(a.range, b.range);
  13277. }
  13278. const aRng = a.range ? 0 : 1;
  13279. const bRng = b.range ? 0 : 1;
  13280. return aRng - bRng;
  13281. });
  13282. let writeIndex = 0;
  13283. for (let readIndex = 1; readIndex < edits.length; readIndex++) {
  13284. if (Range.getEndPosition(edits[writeIndex].range).equals(Range.getStartPosition(edits[readIndex].range))) {
  13285. edits[writeIndex].range = Range.fromPositions(Range.getStartPosition(edits[writeIndex].range), Range.getEndPosition(edits[readIndex].range));
  13286. edits[writeIndex].text += edits[readIndex].text;
  13287. } else {
  13288. writeIndex++;
  13289. edits[writeIndex] = edits[readIndex];
  13290. }
  13291. }
  13292. edits.length = writeIndex + 1;
  13293. for (let { range, text, eol } of edits) {
  13294. if (typeof eol === "number") {
  13295. lastEol = eol;
  13296. }
  13297. if (Range.isEmpty(range) && !text) {
  13298. continue;
  13299. }
  13300. const original = model.getValueInRange(range);
  13301. text = text.replace(/\r\n|\n|\r/g, model.eol);
  13302. if (original === text) {
  13303. continue;
  13304. }
  13305. if (Math.max(text.length, original.length) > EditorSimpleWorker._diffLimit) {
  13306. result.push({ range, text });
  13307. continue;
  13308. }
  13309. const changes = stringDiff(original, text, pretty);
  13310. const editOffset = model.offsetAt(Range.lift(range).getStartPosition());
  13311. for (const change of changes) {
  13312. const start = model.positionAt(editOffset + change.originalStart);
  13313. const end = model.positionAt(editOffset + change.originalStart + change.originalLength);
  13314. const newEdit = {
  13315. text: text.substr(change.modifiedStart, change.modifiedLength),
  13316. range: { startLineNumber: start.lineNumber, startColumn: start.column, endLineNumber: end.lineNumber, endColumn: end.column }
  13317. };
  13318. if (model.getValueInRange(newEdit.range) !== newEdit.text) {
  13319. result.push(newEdit);
  13320. }
  13321. }
  13322. }
  13323. if (typeof lastEol === "number") {
  13324. result.push({ eol: lastEol, text: "", range: { startLineNumber: 0, startColumn: 0, endLineNumber: 0, endColumn: 0 } });
  13325. }
  13326. return result;
  13327. }
  13328. // ---- END minimal edits ---------------------------------------------------------------
  13329. async $computeLinks(modelUrl) {
  13330. const model = this._getModel(modelUrl);
  13331. if (!model) {
  13332. return null;
  13333. }
  13334. return computeLinks(model);
  13335. }
  13336. // --- BEGIN default document colors -----------------------------------------------------------
  13337. async $computeDefaultDocumentColors(modelUrl) {
  13338. const model = this._getModel(modelUrl);
  13339. if (!model) {
  13340. return null;
  13341. }
  13342. return computeDefaultDocumentColors(model);
  13343. }
  13344. static {
  13345. this._suggestionsLimit = 1e4;
  13346. }
  13347. async $textualSuggest(modelUrls, leadingWord, wordDef, wordDefFlags) {
  13348. const sw = new StopWatch();
  13349. const wordDefRegExp = new RegExp(wordDef, wordDefFlags);
  13350. const seen = /* @__PURE__ */ new Set();
  13351. outer:
  13352. for (const url of modelUrls) {
  13353. const model = this._getModel(url);
  13354. if (!model) {
  13355. continue;
  13356. }
  13357. for (const word of model.words(wordDefRegExp)) {
  13358. if (word === leadingWord || !isNaN(Number(word))) {
  13359. continue;
  13360. }
  13361. seen.add(word);
  13362. if (seen.size > EditorSimpleWorker._suggestionsLimit) {
  13363. break outer;
  13364. }
  13365. }
  13366. }
  13367. return { words: Array.from(seen), duration: sw.elapsed() };
  13368. }
  13369. // ---- END suggest --------------------------------------------------------------------------
  13370. //#region -- word ranges --
  13371. async $computeWordRanges(modelUrl, range, wordDef, wordDefFlags) {
  13372. const model = this._getModel(modelUrl);
  13373. if (!model) {
  13374. return /* @__PURE__ */ Object.create(null);
  13375. }
  13376. const wordDefRegExp = new RegExp(wordDef, wordDefFlags);
  13377. const result = /* @__PURE__ */ Object.create(null);
  13378. for (let line = range.startLineNumber; line < range.endLineNumber; line++) {
  13379. const words = model.getLineWords(line, wordDefRegExp);
  13380. for (const word of words) {
  13381. if (!isNaN(Number(word.word))) {
  13382. continue;
  13383. }
  13384. let array = result[word.word];
  13385. if (!array) {
  13386. array = [];
  13387. result[word.word] = array;
  13388. }
  13389. array.push({
  13390. startLineNumber: line,
  13391. startColumn: word.startColumn,
  13392. endLineNumber: line,
  13393. endColumn: word.endColumn
  13394. });
  13395. }
  13396. }
  13397. return result;
  13398. }
  13399. //#endregion
  13400. async $navigateValueSet(modelUrl, range, up, wordDef, wordDefFlags) {
  13401. const model = this._getModel(modelUrl);
  13402. if (!model) {
  13403. return null;
  13404. }
  13405. const wordDefRegExp = new RegExp(wordDef, wordDefFlags);
  13406. if (range.startColumn === range.endColumn) {
  13407. range = {
  13408. startLineNumber: range.startLineNumber,
  13409. startColumn: range.startColumn,
  13410. endLineNumber: range.endLineNumber,
  13411. endColumn: range.endColumn + 1
  13412. };
  13413. }
  13414. const selectionText = model.getValueInRange(range);
  13415. const wordRange = model.getWordAtPosition({ lineNumber: range.startLineNumber, column: range.startColumn }, wordDefRegExp);
  13416. if (!wordRange) {
  13417. return null;
  13418. }
  13419. const word = model.getValueInRange(wordRange);
  13420. const result = BasicInplaceReplace.INSTANCE.navigateValueSet(range, selectionText, wordRange, word, up);
  13421. return result;
  13422. }
  13423. };
  13424. var EditorSimpleWorker = class extends BaseEditorSimpleWorker {
  13425. constructor(_host, _foreignModuleFactory) {
  13426. super();
  13427. this._host = _host;
  13428. this._foreignModuleFactory = _foreignModuleFactory;
  13429. this._foreignModule = null;
  13430. }
  13431. async $ping() {
  13432. return "pong";
  13433. }
  13434. // ---- BEGIN foreign module support --------------------------------------------------------------------------
  13435. $loadForeignModule(moduleId, createData, foreignHostMethods) {
  13436. const proxyMethodRequest = (method, args) => {
  13437. return this._host.$fhr(method, args);
  13438. };
  13439. const foreignHost = createProxyObject(foreignHostMethods, proxyMethodRequest);
  13440. const ctx = {
  13441. host: foreignHost,
  13442. getMirrorModels: () => {
  13443. return this._getModels();
  13444. }
  13445. };
  13446. if (this._foreignModuleFactory) {
  13447. this._foreignModule = this._foreignModuleFactory(ctx, createData);
  13448. return Promise.resolve(getAllMethodNames(this._foreignModule));
  13449. }
  13450. return new Promise((resolve2, reject) => {
  13451. const onModuleCallback = (foreignModule) => {
  13452. this._foreignModule = foreignModule.create(ctx, createData);
  13453. resolve2(getAllMethodNames(this._foreignModule));
  13454. };
  13455. if (!isESM2) {
  13456. __require([`${moduleId}`], onModuleCallback, reject);
  13457. } else {
  13458. const url = FileAccess.asBrowserUri(`${moduleId}.js`).toString(true);
  13459. import(`${url}`).then(onModuleCallback).catch(reject);
  13460. }
  13461. });
  13462. }
  13463. // foreign method request
  13464. $fmr(method, args) {
  13465. if (!this._foreignModule || typeof this._foreignModule[method] !== "function") {
  13466. return Promise.reject(new Error("Missing requestHandler or method: " + method));
  13467. }
  13468. try {
  13469. return Promise.resolve(this._foreignModule[method].apply(this._foreignModule, args));
  13470. } catch (e) {
  13471. return Promise.reject(e);
  13472. }
  13473. }
  13474. };
  13475. if (typeof importScripts === "function") {
  13476. globalThis.monaco = createMonacoBaseAPI();
  13477. }
  13478. // node_modules/monaco-editor/esm/vs/editor/editor.worker.js
  13479. var initialized = false;
  13480. function initialize(foreignModule) {
  13481. if (initialized) {
  13482. return;
  13483. }
  13484. initialized = true;
  13485. const simpleWorker = new SimpleWorkerServer((msg) => {
  13486. globalThis.postMessage(msg);
  13487. }, (workerServer) => new EditorSimpleWorker(EditorWorkerHost.getChannel(workerServer), foreignModule));
  13488. globalThis.onmessage = (e) => {
  13489. simpleWorker.onmessage(e.data);
  13490. };
  13491. }
  13492. globalThis.onmessage = (e) => {
  13493. if (!initialized) {
  13494. initialize(null);
  13495. }
  13496. };
  13497. })();